@openmrs/esm-fast-data-entry-app 1.0.1-pre.85 → 1.0.1-pre.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/132.js CHANGED
@@ -1 +1 @@
1
- (self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[132],{8132:(e,o,t)=>{"use strict";t.r(o),t.d(o,{backendDependencies:()=>i,importTranslation:()=>n,setupOpenMRS:()=>p,version:()=>s});var a=t(1132),r={formCategories:{_type:a.Type.Array,_description:"Organize forms into categories. A form can belong to multiple categories.",_elements:{name:{_type:a.Type.String,_description:"Category name"},forms:{_type:a.Type.Array,_description:"List of forms for this category.",_elements:{formUUID:{_type:a.Type.UUID,_description:"UUID of form"},name:{_type:a.Type.String,_description:"Name of form"}}}},_default:[{name:"ICRC Forms",forms:[{formUUID:"0cefb866-110c-4f16-af58-560932a1db1f",name:"Adult Triage"}]},{name:"Distress Scales",forms:[{formUUID:"9f26aad4-244a-46ca-be49-1196df1a8c9a",name:"POC Sample Form 1"}]}]},formCategoriesToShow:{_type:a.Type.Array,_description:"Forms to show by default on the forms app home page.",_elements:{_type:a.Type.String,_description:"Name of category"},_default:["ICRC Forms","Distress Scales"]},groupSessionConcepts:{sessionName:{_type:a.Type.UUID,_description:"UUID of concept for Session Name",_default:"e2559620-900b-4f66-ae41-0b9c4adfb654"},sessionDate:{_type:a.Type.UUID,_description:"UUID of concept for Session Date",_default:"ceaca505-6dff-4940-8a43-8c060a0924d7"},practitionerName:{_type:a.Type.UUID,_description:"UUID of concept for Practitioner Name",_default:"f1a2d58c-1a0e-4148-931a-aac224649fdc"},sessionNotes:{_type:a.Type.UUID,_description:"UUID of concept for Session Notes",_default:"fa8fedc0-c066-4da3-8dc1-2ad8621fc480"}}},s="1.0.1-pre.85",n=t(3979),i={fhir2:"^1.2.0","webservices.rest":"^2.2.0"};function p(){var e="@openmrs/esm-fast-data-entry-app",o={featureName:"fast-data-entry-app",moduleName:e};return(0,a.defineConfigSchema)(e,r),(0,a.registerBreadcrumbs)([{path:"".concat(window.spaBase,"/forms"),title:"Forms",parent:"".concat(window.spaBase,"/home")}]),{pages:[{load:(0,a.getAsyncLifecycle)((function(){return Promise.all([t.e(672),t.e(804)]).then(t.bind(t,9804))}),o),route:"forms"}],extensions:[{name:"forms-app-link",slot:"app-menu-slot",load:(0,a.getAsyncLifecycle)((function(){return Promise.all([t.e(672),t.e(397),t.e(776)]).then(t.bind(t,5776))}),o),online:!0,offline:!0}]}}},3979:(e,o,t)=>{var a={"./en.json":[3574,574],"./fr.json":[2757,757]};function r(e){if(!t.o(a,e))return Promise.resolve().then((()=>{var o=new Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}));var o=a[e],r=o[0];return t.e(o[1]).then((()=>t(r)))}r.keys=()=>Object.keys(a),r.id=3979,e.exports=r}}]);
1
+ (self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[132],{8132:(e,o,t)=>{"use strict";t.r(o),t.d(o,{backendDependencies:()=>i,importTranslation:()=>n,setupOpenMRS:()=>p,version:()=>s});var a=t(1132),r={formCategories:{_type:a.Type.Array,_description:"Organize forms into categories. A form can belong to multiple categories.",_elements:{name:{_type:a.Type.String,_description:"Category name"},forms:{_type:a.Type.Array,_description:"List of forms for this category.",_elements:{formUUID:{_type:a.Type.UUID,_description:"UUID of form"},name:{_type:a.Type.String,_description:"Name of form"}}}},_default:[{name:"ICRC Forms",forms:[{formUUID:"0cefb866-110c-4f16-af58-560932a1db1f",name:"Adult Triage"}]},{name:"Distress Scales",forms:[{formUUID:"9f26aad4-244a-46ca-be49-1196df1a8c9a",name:"POC Sample Form 1"}]}]},formCategoriesToShow:{_type:a.Type.Array,_description:"Forms to show by default on the forms app home page.",_elements:{_type:a.Type.String,_description:"Name of category"},_default:["ICRC Forms","Distress Scales"]},groupSessionConcepts:{sessionName:{_type:a.Type.UUID,_description:"UUID of concept for Session Name",_default:"e2559620-900b-4f66-ae41-0b9c4adfb654"},sessionDate:{_type:a.Type.UUID,_description:"UUID of concept for Session Date",_default:"ceaca505-6dff-4940-8a43-8c060a0924d7"},practitionerName:{_type:a.Type.UUID,_description:"UUID of concept for Practitioner Name",_default:"f1a2d58c-1a0e-4148-931a-aac224649fdc"},sessionNotes:{_type:a.Type.UUID,_description:"UUID of concept for Session Notes",_default:"fa8fedc0-c066-4da3-8dc1-2ad8621fc480"}}},s="1.0.1-pre.93",n=t(3979),i={fhir2:"^1.2.0","webservices.rest":"^2.2.0"};function p(){var e="@openmrs/esm-fast-data-entry-app",o={featureName:"fast-data-entry-app",moduleName:e};return(0,a.defineConfigSchema)(e,r),(0,a.registerBreadcrumbs)([{path:"".concat(window.spaBase,"/forms"),title:"Forms",parent:"".concat(window.spaBase,"/home")}]),{pages:[{load:(0,a.getAsyncLifecycle)((function(){return Promise.all([t.e(672),t.e(804)]).then(t.bind(t,9804))}),o),route:"forms"}],extensions:[{name:"forms-app-link",slot:"app-menu-slot",load:(0,a.getAsyncLifecycle)((function(){return Promise.all([t.e(672),t.e(397),t.e(776)]).then(t.bind(t,5776))}),o),online:!0,offline:!0}]}}},3979:(e,o,t)=>{var a={"./en.json":[3574,574],"./fr.json":[2757,757]};function r(e){if(!t.o(a,e))return Promise.resolve().then((()=>{var o=new Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}));var o=a[e],r=o[0];return t.e(o[1]).then((()=>t(r)))}r.keys=()=>Object.keys(a),r.id=3979,e.exports=r}}]);
package/dist/153.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[153],{7153:(e,t,r)=>{r.r(t),r.d(t,{default:()=>gt});var n=r(1132),a=r(1672),o=r.n(a),i=r(4422),l=r(2327),s=r(3133),c=r(3379),u=r.n(c),d=r(7795),m=r.n(d),f=r(569),p=r.n(f),_=r(3565),y=r.n(_),h=r(9216),v=r.n(h),g=r(4589),b=r.n(g),E=r(8914),w={};w.styleTagTransform=b(),w.setAttributes=y(),w.insert=p().bind(null,"head"),w.domAPI=m(),w.insertStyleElement=v(),u()(E.Z,w);const S=E.Z&&E.Z.locals?E.Z.locals:void 0;var O=r(3397),x=r(2504),N=r(1338),P=r(7612);function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function A(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){A(e,t,r[t])}))}return e}var k={setGroup:function(e){},unsetGroup:function(){},setSessionMeta:function(e){},openPatientSearch:function(){},saveEncounter:function(e){},editEncounter:function(e){},validateForNext:function(){},validateForComplete:function(){},updateVisitUuid:function(e){},submitForNext:function(){},submitForReview:function(){},submitForComplete:function(){},addPatientUuid:function(e){},removePatientUuid:function(e){},goToReview:function(){},destroySession:function(){},closeSession:function(){}},I={activeFormUuid:null,forms:{},workflowState:null,activePatientUuid:null,activeEncounterUuid:null,activeVisitUuid:null,patientUuids:[],encounters:{},visits:{},activeGroupUuid:null,activeGroupName:null,activeGroupMembers:[],activeSessionMeta:{sessionName:null,practitionerName:null,sessionDate:null,sessionNotes:null},groupVisitTypeUuid:null,userUuid:null},j=o().createContext(C({},I,k)),U=function(e){var t,r,i,l,s,c,u,d,m,f,p,_,y,h,v,g,b,E,w,S,O,A,U,R,G,M,D,z,F,Z,B,L,V,W,q,K,Q,X,$=e.children,H=(0,n.useSession)().user,J=(0,N.useParams)().formUuid.split("&")[0],Y=(0,P.Z)("@openmrs/esm-fast-data-entry-app.groupSessionVisitTypeUuid"),ee=null==Y||null===(t=Y.result)||void 0===t||null===(r=t.data)||void 0===r||null===(i=r.results)||void 0===i||null===(l=i[0])||void 0===l?void 0:l.value,te=(q=(0,a.useReducer)(x.ZP,C({},I,k)),K=2,function(e){if(Array.isArray(e))return e}(q)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(q,K)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}(q,K)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),re=te[0],ne=te[1],ae=(0,a.useMemo)((function(){return{initializeWorkflowState:function(e){var t=e.activeFormUuid;return ne({type:"INITIALIZE_WORKFLOW_STATE",activeFormUuid:t,userUuid:H.uuid})},setGroup:function(e){return ne({type:"SET_GROUP",group:e})},unsetGroup:function(){return ne({type:"UNSET_GROUP"})},setSessionMeta:function(e){return ne({type:"SET_SESSION_META",meta:e})},addPatientUuid:function(e){return ne({type:"ADD_PATIENT_UUID",patientUuid:e})},removePatientUuid:function(e){return ne({type:"REMOVE_PATIENT_UUID",patientUuid:e})},openPatientSearch:function(){return ne({type:"OPEN_PATIENT_SEARCH"})},saveEncounter:function(e){return ne({type:"SAVE_ENCOUNTER",encounterUuid:e})},validateForNext:function(){return ne({type:"VALIDATE_FOR_NEXT"})},validateForComplete:function(){return ne({type:"VALIDATE_FOR_COMPLETE"})},updateVisitUuid:function(e){return ne({type:"UPDATE_VISIT_UUID",visitUuid:e})},submitForNext:function(e){return ne({type:"SUBMIT_FOR_NEXT",nextPatientUuid:e})},submitForComplete:function(){return ne({type:"SUBMIT_FOR_COMPLETE"})},editEncounter:function(e){return ne({type:"EDIT_ENCOUNTER",patientUuid:e})},goToReview:function(){return ne({type:"GO_TO_REVIEW"})},destroySession:function(){return ne({type:"DESTROY_SESSION"})},closeSession:function(){return ne({type:"CLOSE_SESSION"})}}}),[H]);return(0,a.useEffect)((function(){null===(null==re?void 0:re.workflowState)&&J&&ae.initializeWorkflowState({activeFormUuid:J})}),[J,null==re?void 0:re.workflowState,ae]),o().createElement(j.Provider,{value:(Q=C({groupVisitTypeUuid:ee},re,ae),X={workflowState:null!==(G=null===(s=re.forms)||void 0===s||null===(c=s[re.activeFormUuid])||void 0===c?void 0:c.workflowState)&&void 0!==G?G:I.workflowState,activePatientUuid:null!==(M=null===(u=re.forms)||void 0===u||null===(d=u[re.activeFormUuid])||void 0===d?void 0:d.activePatientUuid)&&void 0!==M?M:I.activePatientUuid,activeEncounterUuid:null!==(D=null===(m=re.forms)||void 0===m||null===(f=m[re.activeFormUuid])||void 0===f?void 0:f.activeEncounterUuid)&&void 0!==D?D:I.activeEncounterUuid,activeVisitUuid:null!==(z=null===(p=re.forms)||void 0===p||null===(_=p[re.activeFormUuid])||void 0===_?void 0:_.activeVisitUuid)&&void 0!==z?z:I.activeVisitUuid,patientUuids:null!==(F=null===(y=re.forms)||void 0===y||null===(h=y[re.activeFormUuid])||void 0===h?void 0:h.patientUuids)&&void 0!==F?F:I.patientUuids,encounters:null!==(Z=null===(v=re.forms)||void 0===v||null===(g=v[re.activeFormUuid])||void 0===g?void 0:g.encounters)&&void 0!==Z?Z:I.encounters,activeGroupUuid:null!==(B=null===(b=re.forms)||void 0===b||null===(E=b[re.activeFormUuid])||void 0===E?void 0:E.groupUuid)&&void 0!==B?B:I.activeGroupUuid,activeGroupName:null!==(L=null===(w=re.forms)||void 0===w||null===(S=w[re.activeFormUuid])||void 0===S?void 0:S.groupName)&&void 0!==L?L:I.activeGroupName,activeGroupMembers:null!==(V=null===(O=re.forms)||void 0===O||null===(A=O[re.activeFormUuid])||void 0===A?void 0:A.groupMembers)&&void 0!==V?V:I.activeGroupMembers,activeSessionMeta:null!==(W=null===(U=re.forms)||void 0===U||null===(R=U[re.activeFormUuid])||void 0===R?void 0:R.sessionMeta)&&void 0!==W?W:I.activeSessionMeta},X=null!=X?X:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Q,Object.getOwnPropertyDescriptors(X)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(X)).forEach((function(e){Object.defineProperty(Q,e,Object.getOwnPropertyDescriptor(X,e))})),Q)},$)};const R=j,G=function(){var e=(0,a.useContext)(R),t=e.activeGroupName,r=e.activeGroupUuid,n=e.patientUuids,c=e.activeSessionMeta,u=e.unsetGroup,d=e.destroySession,m=(0,O.useTranslation)().t;return r?o().createElement("div",{className:S.container},o().createElement("div",{className:S.groupAvatar,role:"img"},o().createElement(l.zW,{size:48})),o().createElement("div",{className:S.groupInfoContent},o().createElement("div",{className:S.groupInfoRow},o().createElement("span",{className:S.groupName},t)),o().createElement("div",{className:S.groupInfoRow},o().createElement("span",null,n.length," ",m("members","members")))),(null==c?void 0:c.sessionNotes)&&o().createElement("div",{className:S.groupMeataContent},o().createElement("div",{className:"".concat(S.groupInfoRow," ").concat(S.sessionNotesLabel)},m("sessionNotes","Session Notes")),o().createElement("div",{className:S.groupInfoRow},c.sessionNotes)),o().createElement("span",{style:{flexGrow:1}}),o().createElement("span",null,o().createElement(i.Button,{kind:"ghost",onClick:function(){return u()}},m("changeGroup","Choose a different group")," ",o().createElement(s.x8,{size:20}))),o().createElement("span",null,o().createElement(i.Button,{kind:"ghost",onClick:function(){return d()}},m("cancel","Cancel")," ",o().createElement(s.x8,{size:20})))):null};var M=r(7159),D={};D.styleTagTransform=b(),D.setAttributes=y(),D.insert=p().bind(null,"head"),D.domAPI=m(),D.insertStyleElement=v(),u()(M.Z,D);const z=M.Z&&M.Z.locals?M.Z.locals:void 0;var F=r(8115),Z=r(5443),B={};B.styleTagTransform=b(),B.setAttributes=y(),B.insert=p().bind(null,"head"),B.domAPI=m(),B.insertStyleElement=v(),u()(Z.Z,B);const L=Z.Z&&Z.Z.locals?Z.Z.locals:void 0;var V=r(68),W={};W.styleTagTransform=b(),W.setAttributes=y(),W.insert=p().bind(null,"head"),W.domAPI=m(),W.insertStyleElement=v(),u()(V.Z,W);const q=V.Z&&V.Z.locals?V.Z.locals:void 0;var K=r(9370),Q={};Q.styleTagTransform=b(),Q.setAttributes=y(),Q.insert=p().bind(null,"head"),Q.domAPI=m(),Q.insertStyleElement=v(),u()(K.Z,Q);const X=K.Z&&K.Z.locals?K.Z.locals:void 0;var $=r(2619),H=r(9423),J={};J.styleTagTransform=b(),J.setAttributes=y(),J.insert=p().bind(null,"head"),J.domAPI=m(),J.insertStyleElement=v(),u()(H.Z,J);const Y=H.Z&&H.Z.locals?H.Z.locals:void 0;function ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const te=function(e){var t,r,n=(t=(0,a.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(t,r)||function(e,t){if(e){if("string"==typeof e)return ee(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ee(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=n[0],i=n[1];return(0,a.useEffect)((function(){var t=function(t){t.key===e&&i(!0)},r=function(t){t.key===e&&i(!1)};return window.addEventListener("keydown",t),window.addEventListener("keyup",r),function(){window.removeEventListener("keydown",t),window.removeEventListener("keyup",r)}}),[e]),o};function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ne(){return ne=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ne.apply(this,arguments)}var ae=function(e,t){switch(t.type){case"arrowUp":return{selectedIndex:Math.max(e.selectedIndex-1,0)};case"arrowDown":return{selectedIndex:Math.min(e.selectedIndex+1,t.listLength-1)};case"select":return{selectedIndex:t.payload};default:return e}},oe={behavior:"smooth",block:"nearest"},ie=function(e){var t,r,n=e.index,i=e.selectGroupAction,s=e.group,c=e.dispatch,u=e.state,d=e.totalGroups,m=e.lastRef,f=(0,a.useRef)(null),p=(0,O.useTranslation)().t;return(0,a.useEffect)((function(){u.selectedIndex===d-1?m.current.scrollIntoView(oe):u.selectedIndex===n&&f.current.scrollIntoView(oe)}),[u,n,d,m]),o().createElement("div",{onClick:function(){c({type:"select",payload:n}),i(s)},className:"".concat(Y.patientSearchResult," ").concat(n===u.selectedIndex&&Y.patientSearchResultSelected),role:"button","aria-pressed":n===u.selectedIndex,tabIndex:0,ref:f},o().createElement("div",{className:Y.patientAvatar,role:"img"},o().createElement(l.zW,{size:24})),o().createElement("div",null,o().createElement("h2",{className:Y.patientName},s.name),o().createElement("p",{className:Y.demographics},null!==(r=null===(t=s.cohortMembers)||void 0===t?void 0:t.length)&&void 0!==r?r:0," ",p("members","members"),o().createElement("span",{className:Y.middot},"·")," ",s.description)))},le=function(){return o().createElement("div",{className:Y.patientSearchResult},o().createElement("div",{className:Y.patientAvatar,role:"img"},o().createElement(i.SkeletonIcon,{style:{height:"3rem",width:"3rem"}})),o().createElement("div",null,o().createElement("h2",{className:Y.patientName},o().createElement(i.SkeletonText,null)),o().createElement("span",{className:Y.demographics},o().createElement(i.SkeletonIcon,null)," ",o().createElement("span",{className:Y.middot},"·")," ",o().createElement(i.SkeletonIcon,null)," ",o().createElement("span",{className:Y.middot},"·")," ",o().createElement(i.SkeletonIcon,null))))};const se=function(e){var t,r,n=e.groups,i=e.selectGroupAction,l=e.lastRef,s=te("ArrowUp"),c=te("ArrowDown"),u=te("Enter"),d=(t=(0,a.useReducer)(ae,{selectedIndex:0}),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(t,r)||function(e,t){if(e){if("string"==typeof e)return re(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=d[0],f=d[1];return(0,a.useEffect)((function(){s&&f({type:"arrowUp"})}),[s]),(0,a.useEffect)((function(){c&&f({type:"arrowDown",listLength:n.length})}),[c,n.length]),(0,a.useEffect)((function(){u&&n.length&&i(n[m.selectedIndex])}),[u,i,n,m.selectedIndex]),o().createElement(o().Fragment,null,n.map((function(e,t){return o().createElement(ie,ne({key:t,totalGroups:n.length},{lastRef:l,index:t,selectGroupAction:i,group:e,dispatch:f,state:m}))})))};var ce=r(4593);function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function de(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function me(){return me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},me.apply(this,arguments)}function fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){de(e,t,r[t])}))}return e}function pe(e,t){if(e){if("string"==typeof e)return ue(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ue(e,t):void 0}}var _e=function(e){var t,r,o,i,l,s,c,u,d,m,f,p,_,y,h,v,g;return t=fe({baseUrl:"/ws/rest/v1/cohortm/cohort",resultsToFetch:10},me({},e)),o=t.baseUrl,i=t.searchTerm,l=t.parameters,c=void 0===(s=t.searching)||s,u=t.resultsToFetch,d=void 0===u?10:u,m=(0,a.useCallback)((function(e,t){var r;if(t&&!(null==t||null===(r=t.data)||void 0===r?void 0:r.links.some((function(e){return"next"===e.rel}))))return null;var n="".concat(o,"?q=").concat(i),a=fe({totalCount:!0,limit:d},l);return Object.entries(a).forEach((function(e){var t,r,a=(r=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(t,r)||pe(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=a[0],i=a[1];null!=i&&(n+="&".concat(o,"=").concat(i))})),e&&(n+="&startIndex=".concat(e*d)),n}),[o,i,l,d]),f=(0,ce.ZP)(c?m:null,n.openmrsFetch),p=f.data,_=f.isValidating,y=f.setSize,h=f.error,v=f.size,g=(0,a.useMemo)((function(){var e,t,n,a,o,i;return{data:p?(e=[]).concat.apply(e,(i=null!==(r=null==p?void 0:p.map((function(e){var t;return null==e||null===(t=e.data)||void 0===t?void 0:t.results})))&&void 0!==r?r:[],function(e){if(Array.isArray(e))return ue(e)}(i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||pe(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())):null,isLoading:!p&&!h,error:h,hasMore:!!(null==p?void 0:p.length)&&!!(null===(t=p[p.length-1].data)||void 0===t||null===(n=t.links)||void 0===n?void 0:n.some((function(e){return"next"===e.rel}))),loadingNewData:_,setPage:y,currentPage:v,totalResults:null==p||null===(a=p[0])||void 0===a||null===(o=a.data)||void 0===o?void 0:o.totalCount}}),[p,_,h,y,v]),g};const ye=function(e){var t=e.query,r=void 0===t?"":t,n=e.selectGroupAction,l=(0,O.useTranslation)().t,s=_e({searchTerm:r,searching:!!r,parameters:{v:"full"}}),c=s.isLoading,u=s.data,d=s.error,m=s.loadingNewData,f=s.setPage,p=s.hasMore,_=s.totalResults,y=(0,a.useRef)(null),h=(0,a.useRef)(null),v=(0,a.useCallback)((function(e){m||(h.current&&h.current.disconnect(),h.current=new IntersectionObserver((function(e){e[0].isIntersecting&&p&&f((function(e){return e+1}))}),{threshold:.75}),e&&h.current.observe(e))}),[m,p,f]);return d?o().createElement("div",{className:X.searchResults},o().createElement(i.Layer,null,o().createElement(i.Tile,{className:X.emptySearchResultsTile},o().createElement($.N,null),o().createElement("div",null,o().createElement("p",{className:X.errorMessage},l("error","Error")),o().createElement("p",{className:X.errorCopy},l("errorCopy","Sorry, there was an error. You can try to reload this page, or contact the site administrator and quote the error code above.")))))):c?o().createElement("div",{className:X.searchResultsContainer},o().createElement(le,null),o().createElement(le,null),o().createElement(le,null),o().createElement(le,null),o().createElement(le,null)):0===(null==u?void 0:u.length)?o().createElement("div",{className:X.searchResults},o().createElement(i.Layer,null,o().createElement(i.Tile,{className:X.emptySearchResultsTile},o().createElement($.N,null),o().createElement("p",{className:X.emptyResultText},l("noGroupsFoundMessage","Sorry, no groups have been found")),o().createElement("p",{className:X.actionText},o().createElement("span",null,l("trySearchWithPatientUniqueID","Try searching with the cohort's description")),o().createElement("br",null),o().createElement("span",null,l("orLabelName","OR label name")))))):o().createElement("div",{className:X.searchResultsContainer},o().createElement("div",{className:X.searchResults,style:{maxHeight:"22rem"}},o().createElement("p",{className:X.resultsText},_," ",l("searchResultsText","search result(s)")),o().createElement(se,{groups:u,selectGroupAction:n,lastRef:y}),o().createElement("div",{ref:y},o().createElement("div",{className:X.lastItem,ref:v},p&&o().createElement(i.Loading,{withOverlay:!1,small:!0}),!p&&o().createElement("p",null,l("noMoreResults","End of search results"))))))};var he=r(7518);function ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ge(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ve(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ve(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const be=function(e){var t=e.selectGroupAction,r=(0,O.useTranslation)().t,n=ge((0,a.useState)(""),2),l=n[0],s=n[1],c=ge((0,a.useState)(!1),2),u=c[0],d=c[1];return o().createElement("div",{className:q.patientSearchBar},o().createElement("div",{className:q.searchArea},o().createElement(i.Search,{autoFocus:!0,className:q.patientSearchInput,closeButtonLabelText:r("clearSearch","Clear"),labelText:"",onChange:function(e){var t;t=e.target.value,(0,he.Z)((function(e){d(!!t.length),s(e)}),300),s(t),t.length?d(!0):d(!1)},onClear:function(){},placeholder:r("searchForGroup","Search for a group by name"),size:"sm",value:l}),o().createElement(i.Button,{kind:"secondary",size:"sm"},r("search","Search"))),u&&o().createElement("div",{className:q.floatingSearchResultsContainer},o().createElement(ye,{query:l,selectGroupAction:function(e){t(e),d(!1),s("")}})))};var Ee=r(8808),we=r(8034),Se={};Se.styleTagTransform=b(),Se.setAttributes=y(),Se.insert=p().bind(null,"head"),Se.domAPI=m(),Se.insertStyleElement=v(),u()(we.Z,Se);const Oe=we.Z&&we.Z.locals?we.Z.locals:void 0;var xe=r(282);function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Te(){return Te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Te.apply(this,arguments)}function Ae(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Pe(e,t,r[t])}))}return e}function Ce(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}function ke(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||Ie(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ie(e,t){if(e){if("string"==typeof e)return Ne(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ne(e,t):void 0}}var je=o().memo(n.ExtensionSlot),Ue=function(e){var t=e.patient,r=e.removePatient,n=(0,O.useTranslation)().t,l=(0,a.useCallback)((function(){return r(null==t?void 0:t.uuid)}),[t,r]),s=(0,a.useMemo)((function(){return t?t.display?t.display:function(e){var t,r,n,a,o,i,l,s=null==e||null===(t=e.name)||void 0===t||null===(r=t[0])||void 0===r||null===(n=r.given)||void 0===n?void 0:n[0],c=null==e||null===(a=e.name)||void 0===a||null===(o=a[0])||void 0===o?void 0:o.family,u=null==e||null===(i=e.identifier)||void 0===i||null===(l=i[0])||void 0===l?void 0:l.value,d=u?u+" - ":"";return(d+=(s||"")+" "+(c||"")).replace(/\s+/g," ")}(t):""}),[t]);return o().createElement("li",{key:null==t?void 0:t.uuid,className:Oe.patientRow},o().createElement("span",null,o().createElement(i.Button,{kind:"tertiary",size:"sm",hasIconOnly:!0,onClick:l,renderIcon:Ee.ZN,tooltipAlignment:"start",tooltipPosition:"top",iconDescription:n("remove","Remove")})),o().createElement("span",{className:Oe.patientName},s))},Re=function(e){var t=e.name,r=e.setName,n=e.patientList,a=e.updatePatientList,l=e.errors,s=e.validate,c=e.removePatient,u=(0,O.useTranslation)().t;return o().createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"1rem"}},o().createElement(i.TextInput,{labelText:u("newGroupName","New Group Name"),value:t,onChange:function(e){return r(e.target.value)},onBlur:function(){return s("name")}}),(null==l?void 0:l.name)&&o().createElement("p",{className:Oe.formError},"required"===l.name?u("groupNameError","Please enter a group name."):l.name),o().createElement(i.FormLabel,null,n.length," ",u("patientsInGroup","Patients in group")),(null==l?void 0:l.patientList)&&o().createElement("p",{className:Oe.formError},u("noPatientError","Please enter at least one patient.")),!(null==l?void 0:l.patientList)&&o().createElement("ul",{className:Oe.patientList},null==n?void 0:n.map((function(e,t){return o().createElement(Ue,{patient:e,removePatient:c,key:t})}))),o().createElement(i.FormLabel,null,"Search for patients to add to group"),o().createElement("div",{className:Oe.searchBar},o().createElement(je,{extensionSlotName:"patient-search-bar-slot",state:{selectPatientAction:a,buttonProps:{kind:"secondary"}}})))};const Ge=function(e){var t=e.patients,r=void 0===t?void 0:t,l=e.isCreate,s=void 0===l?void 0:l,c=e.groupName,u=void 0===c?"":c,d=e.cohortUuid,m=void 0===d?void 0:d,f=e.isOpen,p=e.handleCancel,_=e.onPostSubmit,y=(0,a.useContext)(R).setGroup,h=(0,O.useTranslation)().t,v=ke((0,a.useState)({}),2),g=v[0],b=v[1],E=ke((0,a.useState)(u),2),w=E[0],S=E[1],x=ke((0,a.useState)(r||[]),2),N=x[0],P=x[1],T=(0,xe.zg)(),A=T.post,C=T.result,k=T.error,I=(0,a.useCallback)((function(e){return P((function(t){return t.filter((function(t){return t.uuid!==e}))}))}),[P]),j=(0,a.useCallback)((function(e){var t=!0;return e?(t="name"===e?!!w:!!N.length,b((function(r){return Ce(Ae({},r),Pe({},e,t?null:"required"))}))):(w?b((function(e){return Ce(Ae({},e),{name:null})})):(b((function(e){return Ce(Ae({},e),{name:"required"})})),t=!1),N.length?b((function(e){return Ce(Ae({},e),{patientList:null})})):(b((function(e){return Ce(Ae({},e),{patientList:"required"})})),t=!1)),t}),[w,N.length]),U=(0,a.useCallback)((function(e){P((function(t){return t.find((function(t){return t.uuid===e.uuid}))?t:(r=t,function(e){if(Array.isArray(e))return Ne(e)}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||Ie(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e]);var r})),b((function(e){return Ce(Ae({},e),{patientList:null})}))}),[P]);return(0,a.useEffect)((function(){C&&y(Ce(Ae({},C),{cohortMembers:N.map((function(e){return{patient:{uuid:e.uuid}}}))}))}),[C,y,N]),(0,a.useEffect)((function(){var e;k&&((0,n.showToast)({kind:"error",title:h("postError","POST Error"),description:null!==(e=k.message)&&void 0!==e?e:h("unknownPostError","An unknown error occurred while saving data")}),k.fieldErrors&&b(Object.fromEntries(Object.entries(k.fieldErrors).map((function(e){var t,r=ke(e,2),n=r[0],a=r[1];return[n,null==a||null===(t=a[0])||void 0===t?void 0:t.message]})))))}),[k,h]),o().createElement("div",{className:Oe.modal},o().createElement(i.ComposedModal,{open:f,onClose:p},o().createElement(i.ModalHeader,null,s?h("createNewGroup","Create New Group"):h("editGroup","Edit Group")),o().createElement(i.ModalBody,null,o().createElement(Re,Te({},{name:w,setName:S,patientList:N,updatePatientList:U,errors:g,validate:j,removePatient:I}))),o().createElement(i.ModalFooter,null,o().createElement(i.Button,{kind:"secondary",onClick:p},h("cancel","Cancel")),o().createElement(i.Button,{kind:"primary",onClick:function(){j()&&(A({uuid:m,name:w,cohortMembers:N.map((function(e){return{patient:e.uuid}}))}),_&&_())}},s?h("createGroup","Create Group"):h("save","Save")))))};function Me(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function De(){return De=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},De.apply(this,arguments)}const ze=function(){var e,t,r=(0,O.useTranslation)().t,n=(0,a.useContext)(R),l=n.activeGroupUuid,c=n.setGroup,u=n.destroySession,d=(e=(0,a.useState)(!1),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Me(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Me(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=d[0],f=d[1],p=(0,a.useCallback)((function(){f(!1)}),[]),_=(0,a.useCallback)((function(){f(!1)}),[]),y=(0,a.useCallback)((function(){f(!0)}),[]);return l?null:o().createElement("div",{className:L.searchHeaderContainer},o().createElement("span",{className:L.padded},r("findGroup","Find group"),":"),o().createElement("span",{className:L.searchBarWrapper},o().createElement(be,{selectGroupAction:function(e){c(e)}})),o().createElement("span",{className:L.padded},r("or","or")),o().createElement("span",null,o().createElement(i.Button,{onClick:y,renderIcon:F.mm,iconDescription:"Add"},r("createNewGroup","Create New Group")),o().createElement(Ge,De({},{isCreate:!0,isOpen:m,handleCancel:p,onPostSubmit:_}))),o().createElement("span",{style:{flexGrow:1}}),o().createElement("span",null,o().createElement(i.Button,{kind:"ghost",onClick:function(){u()}},r("cancel","Cancel")," ",o().createElement(s.x8,{size:20}))))};var Fe=r(7536),Ze=r(4211);function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Le(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ve(){return Ve=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ve.apply(this,arguments)}var We=function(e){var t,r,n,l,s,c,u,d=e.patient,m=(0,a.useContext)(R),f=m.patientUuids,p=m.addPatientUuid,_=m.removePatientUuid,y=null==d||null===(t=d.name)||void 0===t||null===(r=t[0])||void 0===r||null===(n=r.given)||void 0===n?void 0:n[0],h=null==d||null===(l=d.name)||void 0===l||null===(s=l[0])||void 0===s?void 0:s.family,v=null==d||null===(c=d.identifier)||void 0===c||null===(u=c[0])||void 0===u?void 0:u.value;return d?o().createElement(i.TableRow,null,o().createElement(i.TableCell,null,d.display||d.displayName||[y,h].join(" ")),o().createElement(i.TableCell,null,v),o().createElement(i.TableCell,null,o().createElement(i.Checkbox,{checked:f.includes(d.id),labelText:d.id,hideLabel:!0,id:"".concat(v,"-attendance-checkbox"),onChange:function(e,t){t.checked?p(d.id):_(d.id)}}))):o().createElement(i.TableRow,null,o().createElement(i.TableCell,null,o().createElement(i.SkeletonText,null)),o().createElement(i.TableCell,null,o().createElement(i.SkeletonText,null)),o().createElement(i.TableCell,null,o().createElement(i.Checkbox,{diabled:!0})))};const qe=function(e){var t,r,n=e.patients,s=(0,O.useTranslation)().t,c=(0,a.useContext)(R),u=c.activeGroupUuid,d=c.activeGroupName,m=c.activeGroupMembers,f=(t=(0,a.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(t,r)||function(e,t){if(e){if("string"==typeof e)return Be(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Be(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=f[0],_=f[1],y=[s("name","Name"),s("identifier","Patient ID"),s("patientIsPresent","Patient is present")],h=(0,a.useCallback)((function(){_(!1)}),[]),v=(0,a.useCallback)((function(){_(!1)}),[]),g=(0,a.useMemo)((function(){return m.map((function(e){var t=n.find((function(t){return t.id===e}));return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Le(e,t,r[t])}))}return e}({uuid:e},t)}))}),[m,n]);return u?o().createElement("div",null,o().createElement("span",{style:{flexGrow:1}}),o().createElement(i.Button,{kind:"ghost",onClick:function(){return _(!0)}},s("editGroup","Edit Group")," ",o().createElement(l.I8,{size:20})),o().createElement(Ge,Ve({},{cohortUuid:u,patients:g,isCreate:!1,groupName:d,isOpen:p,handleCancel:h,onPostSubmit:v})),o().createElement(i.Table,null,o().createElement(i.TableHead,null,o().createElement(i.TableRow,null,y.map((function(e,t){return o().createElement(i.TableHeader,{key:t},e)})))),o().createElement(i.TableBody,null,m.map((function(e,t){var r=n.find((function(t){return t.id===e}));return o().createElement(We,{patient:r,key:t})}))))):o().createElement("div",null,s("selectGroupFirst","Please select a group first"))};function Ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Qe(e,t,r,n,a,o,i){try{var l=e[o](i),s=l.value}catch(e){return void r(e)}l.done?t(s):Promise.resolve(s).then(n,a)}function Xe(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){Qe(o,n,a,i,l,"next",e)}function l(e){Qe(o,n,a,i,l,"throw",e)}i(void 0)}))}}function $e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ke(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ke(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var He=function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}};function Je(){return Je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Je.apply(this,arguments)}const Ye=function(){var e=(0,O.useTranslation)().t,t=(0,Fe.Gc)(),r=t.register,l=t.formState.errors,s=t.control,c=function(e){var t=$e((0,a.useState)([]),2),r=t[0],o=t[1],i=$e((0,a.useState)(!0),2),l=i[0],s=i[1];(0,a.useEffect)((function(){e&&0!==e.length?u(e):(o([]),s(!1))}),[e]);var c,u=(c=Xe((function(e){var t,r;return He(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),s(!0),[4,Promise.all(e.map(function(){var e=Xe((function(e){return He(this,(function(t){switch(t.label){case 0:return[4,(0,n.fetchCurrentPatient)(e)];case 1:return[2,t.sent()]}}))}));return function(t){return e.apply(this,arguments)}}()))];case 1:return t=a.sent(),o(t),s(!1),[3,3];case 2:return r=a.sent(),console.error("Error fetching patients:",r),s(!1),[3,3];case 3:return[2]}}))})),function(e){return c.apply(this,arguments)});return{patients:r,isLoading:l}}((0,a.useContext)(R).patientUuids),u=c.patients,d=c.isLoading;return o().createElement("div",null,!d&&o().createElement("div",{className:z.formSection},o().createElement("h4",null,e("sessionDetails","1. Session details")),o().createElement("div",null,o().createElement("p",null,e("allFieldsRequired","All fields are required unless marked optional"))),o().createElement(i.Layer,null,o().createElement(i.Tile,{className:z.formSectionTile},o().createElement(i.Layer,null,o().createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"1.5rem"}},o().createElement(i.TextInput,Je({id:"text",type:"text",labelText:e("sessionName","Session Name")},r("sessionName",{required:!0}),{invalid:l.sessionName,invalidText:"This field is required"})),o().createElement(i.TextInput,Je({id:"text",type:"text",labelText:e("practitionerName","Practitioner Name")},r("practitionerName",{required:!0}),{invalid:l.practitionerName,invalidText:"This field is required"})),o().createElement(Fe.Qr,{name:"sessionDate",control:s,rules:{required:!0},render:function(t){var r=t.field;return o().createElement(i.DatePicker,Je({datePickerType:"single",size:"md",maxDate:new Date},r),o().createElement(i.DatePickerInput,{id:"session-date",labelText:e("sessionDate","Session Date"),placeholder:"mm/dd/yyyy",size:"md",invalid:l.sessionDate,invalidText:"This field is required"}))}}),o().createElement(i.TextArea,Je({id:"text",type:"text",labelText:e("sessionNotes","Session Notes")},r("sessionNotes",{required:!0}),{invalid:l.sessionNotes,invalidText:"This field is required"})))))),o().createElement("h4",null,e("sessionParticipants","2. Session participants")),o().createElement("div",null,o().createElement("p",null,e("markAbsentPatients","The patients in this group. Patients that are not present in the session should be marked as absent."))),o().createElement(i.Layer,null,o().createElement(i.Tile,{className:z.formSectionTile},o().createElement(i.Layer,null,o().createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"1.5rem"}},o().createElement(qe,{patients:u})))))))};function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function tt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rt(){return rt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rt.apply(this,arguments)}var nt=function(){var e,t,r=(0,O.useTranslation)().t,n=(0,a.useContext)(R),l=n.workflowState,s=n.patientUuids,c=(e=(0,a.useState)(!1),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return et(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?et(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=c[0],d=c[1];return"NEW_GROUP_SESSION"!==l?null:o().createElement(o().Fragment,null,o().createElement("div",{className:z.rightPanelActionButtons},o().createElement(i.Button,{kind:"secondary",type:"submit",disabled:!s.length},r("createNewSession","Create New Session")),o().createElement(i.Button,{kind:"tertiary",onClick:function(){d(!0)}},r("cancel","Cancel"))),o().createElement(Ze.Z,{open:u,setOpen:d,context:n}))},at=function(){var e=(0,O.useTranslation)().t,t=(0,Fe.Gc)(),r=t.register,n=t.formState.errors,i=t.setValue,l=(0,a.useContext)(R).activeGroupUuid;return(0,a.useEffect)((function(){l&&i("groupUuid",l)}),[l,i]),o().createElement(o().Fragment,null,o().createElement("input",rt({hidden:!0},r("groupUuid",{value:l,required:e("chooseGroupError","Please choose a group.")}))),n.groupUuid&&!l&&o().createElement("div",{className:z.formError},n.groupUuid.message))};const ot=function(){var e=(0,O.useTranslation)().t,t=(0,a.useContext)(R),r=t.setSessionMeta,n=t.workflowState,i=(0,Fe.cI)();return"NEW_GROUP_SESSION"!==n?null:o().createElement(Fe.RV,rt({},i),o().createElement("form",{onSubmit:i.handleSubmit((function(e){var t,n,a=e.sessionDate,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["sessionDate"]);r((t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tt(e,t,r[t])}))}return e}({},o),n=null!=(n={sessionDate:a[0]})?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})),t))}))},o().createElement("div",{className:z.workspace},o().createElement("div",{className:z.formMainContent},o().createElement("div",{className:z.formContainer},o().createElement(Ye,null)),o().createElement("div",{className:z.rightPanel},o().createElement("h4",null,e("newGroupSession","New Group Session")),o().createElement(at,null),o().createElement("hr",{style:{width:"100%"}}),o().createElement(nt,null))))))};var it=r(1671),lt=r(611),st=r(9688),ct=r(2223);function ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mt(){return mt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mt.apply(this,arguments)}function ft(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dt(e,t,r[t])}))}return e}function pt(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}function _t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ut(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ut(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var yt=(0,n.getGlobalStore)("ampath-form-state"),ht=function(){var e=(0,a.useContext)(R),t=e.activeFormUuid,r=e.submitForNext,l=e.patientUuids,s=e.activePatientUuid,c=e.workflowState,u=(0,n.useStore)(yt)[t],d=("ready"!==u||"EDIT_FORM"!==c)&&"readyWithValidationErrors"!==u,m=_t((0,a.useState)(!1),2),f=m[0],p=m[1],_=_t((0,a.useState)(!1),2),y=_[0],h=_[1],v=(0,O.useTranslation)().t,g=s===l[l.length-1];return o().createElement(o().Fragment,null,o().createElement("div",{className:z.rightPanelActionButtons},o().createElement(i.Button,{kind:"primary",onClick:function(){"EDIT_FORM"!==c&&"readyWithValidationErrors"!==u||r()},disabled:d},g?v("saveForm","Save Form"):v("nextPatient","Next Patient")),o().createElement(i.Button,{kind:"secondary",onClick:function(){return h(!0)}},v("saveAndComplete","Save & Complete")),o().createElement(i.Button,{kind:"tertiary",onClick:function(){return p(!0)}},v("cancel","Cancel"))),o().createElement(Ze.Z,{open:f,setOpen:p,context:e}),o().createElement(ct.Z,{open:y,setOpen:h,context:e,validateFirst:!1}))};const vt=function(){var e=(0,n.useConfig)().groupSessionConcepts,t=(0,O.useTranslation)().t,r=(0,a.useContext)(R),i=r.patientUuids,l=r.activePatientUuid,s=r.encounters,c=r.activeEncounterUuid,u=r.activeVisitUuid,d=r.activeFormUuid,m=r.saveEncounter,f=r.activeSessionMeta,p=r.groupVisitTypeUuid,_=r.updateVisitUuid,y=r.submitForNext,h=r.workflowState,v=(0,n.useSession)().sessionLocation,g=_t((0,a.useState)(null),2),b=g[0],E=g[1],w=_t((0,a.useState)(null),2),S=w[0],x=w[1],N=(0,st.Z)({showSuccessNotification:!1,showErrorNotification:!0}),P=N.saveVisit,T=N.updateEncounter,A=N.success;(0,a.useEffect)((function(){A&&A.data.patient.uuid===l&&(x(A.data),_(A.data.uuid))}),[A,_,u,l,S,x]);var C=(0,a.useCallback)((function(t){u||P({patientUuid:l,startDatetime:f.sessionDate,stopDatetime:f.sessionDate,visitType:p,location:null==v?void 0:v.uuid});var r=new Date(f.sessionDate);t.obs.forEach((function(e,n){var a;t.obs[n]=pt(ft({},e),{groupMembers:null===(a=e.groupMembers)||void 0===a?void 0:a.map((function(e){return pt(ft({},e),{obsDatetime:r.toISOString()})})),obsDatetime:r.toISOString()})})),u||Object.entries(e).forEach((function(e){var r=_t(e,2),n=r[0],a=r[1];t.obs.push({concept:a,value:null==f?void 0:f[n]})})),t.location=null==v?void 0:v.uuid,t.encounterDatetime=r.toISOString()}),[l,u,f,e,p,P,v]);(0,a.useEffect)((function(){var e,t;b&&S&&(null===(e=b.patient)||void 0===e?void 0:e.uuid)===(null===(t=S.patient)||void 0===t?void 0:t.uuid)&&T({uuid:b.uuid,visit:S.uuid})}),[b,T,S]);var k=(0,a.useCallback)((function(e){e&&e.uuid&&(m(e.uuid),E(e))}),[m]),I=(0,a.useCallback)((function(e){y(e)}),[y]);return"NEW_GROUP_SESSION"===h?null:o().createElement("div",{className:z.workspace},o().createElement("div",{className:z.formMainContent},o().createElement("div",{className:z.formContainer},o().createElement(lt.Z,mt({patientUuid:l,encounterUuid:c},{formUuid:d,handlePostResponse:k,handleEncounterCreate:C}))),o().createElement("div",{className:z.rightPanel},o().createElement("h4",null,t("formsFilled","Forms filled")),o().createElement("div",{className:z.patientCardsSection},null==i?void 0:i.map((function(e){return o().createElement(it.Z,mt({key:e},{patientUuid:e,activePatientUuid:l,editEncounter:I,encounters:s}))}))),o().createElement(ht,null))))},gt=function(){return o().createElement(U,null,o().createElement("div",{className:z.breadcrumbsContainer},o().createElement(n.ExtensionSlot,{extensionSlotName:"breadcrumbs-slot"})),o().createElement(ze,null),o().createElement(G,null),o().createElement("div",{className:z.workspaceWrapper},o().createElement(ot,null),o().createElement(vt,null)))}},8034:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(3645),a=r.n(n)()((function(e){return e[1]}));a.push([e.id,'.-esm-fast-data-entry__styles__modal___xdlE9 .cds--modal{z-index:90}.-esm-fast-data-entry__styles__modal___xdlE9 .cds--modal-container{height:600px}.-esm-fast-data-entry__styles__modal___xdlE9 .cds--modal-content{height:100%}.-esm-fast-data-entry__styles__searchBar___eK\\+Us>div>div>div{width:100%}.-esm-fast-data-entry__styles__formError___0VO-V{color:red}.-esm-fast-data-entry__styles__patientRow___tNveQ{display:flex;align-items:center;width:"100%"}.-esm-fast-data-entry__styles__patientRow___tNveQ:nth-child(odd){background-color:#e0e0e0}.-esm-fast-data-entry__styles__patientName___1dVPc{flex-grow:1;padding-left:1rem}.-esm-fast-data-entry__styles__loading___Iz1NP{display:flex;height:100%;flex-direction:column;justify-content:center;align-items:center;row-gap:1rem}',""]),a.locals={modal:"-esm-fast-data-entry__styles__modal___xdlE9",searchBar:"-esm-fast-data-entry__styles__searchBar___eK+Us",formError:"-esm-fast-data-entry__styles__formError___0VO-V",patientRow:"-esm-fast-data-entry__styles__patientRow___tNveQ",patientName:"-esm-fast-data-entry__styles__patientName___1dVPc",loading:"-esm-fast-data-entry__styles__loading___Iz1NP"};const o=a},8914:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(3645),a=r.n(n)()((function(e){return e[1]}));a.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-fast-data-entry__styles__container___9Vn3g{height:5rem;display:flex;align-items:center;background-color:#fff;border-top:.0125rem solid #e0e0e0;border-bottom:.0125rem solid #e0e0e0;padding:0 1rem}.-esm-fast-data-entry__styles__photoPlaceholder___mRAQO{height:3rem;width:3rem}.-esm-fast-data-entry__styles__groupAvatar___qCLlZ{width:3rem;height:3rem;margin:.5rem 1rem .5rem 0;border-radius:1px}.-esm-fast-data-entry__styles__groupName___XRVMQ{font-size:var(--cds-heading-03-font-size, 1.25rem);font-weight:var(--cds-heading-03-font-weight, 400);line-height:var(--cds-heading-03-line-height, 1.4);letter-spacing:var(--cds-heading-03-letter-spacing, 0);font-weight:600}.-esm-fast-data-entry__styles__groupInfoContent___GMqli{margin-left:1rem;margin-right:4rem}.-esm-fast-data-entry__styles__groupInfoRow___WXABV{display:flex;align-items:center;font-size:var(--cds-body-compact-02-font-size, 1rem);font-weight:var(--cds-body-compact-02-font-weight, 400);line-height:var(--cds-body-compact-02-line-height, 1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing, 0);color:#525252;column-gap:.8rem}.-esm-fast-data-entry__styles__groupInfoRow___WXABV>button{min-height:2rem}.-esm-fast-data-entry__styles__sessionNotesLabel___eE69Z{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);margin-bottom:.125rem}.-esm-fast-data-entry__styles__groupEditBtn___dagwZ{color:#161616;margin:.5rem}.-esm-fast-data-entry__styles__groupMetaContent___OMT76{flex-grow:1}",""]),a.locals={container:"-esm-fast-data-entry__styles__container___9Vn3g",photoPlaceholder:"-esm-fast-data-entry__styles__photoPlaceholder___mRAQO",groupAvatar:"-esm-fast-data-entry__styles__groupAvatar___qCLlZ",groupName:"-esm-fast-data-entry__styles__groupName___XRVMQ",groupInfoContent:"-esm-fast-data-entry__styles__groupInfoContent___GMqli",groupInfoRow:"-esm-fast-data-entry__styles__groupInfoRow___WXABV",sessionNotesLabel:"-esm-fast-data-entry__styles__sessionNotesLabel___eE69Z",groupEditBtn:"-esm-fast-data-entry__styles__groupEditBtn___dagwZ",groupMetaContent:"-esm-fast-data-entry__styles__groupMetaContent___OMT76"};const o=a},5443:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(3645),a=r.n(n)()((function(e){return e[1]}));a.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-fast-data-entry__styles__searchHeaderContainer___3ZMXh{height:5rem;display:flex;align-items:center;background-color:#fff;border-top:.0125rem solid #e0e0e0;border-bottom:.0125rem solid #e0e0e0;padding:0 1rem}.-esm-fast-data-entry__styles__searchBarWrapper___dRAl4{min-width:35rem}.-esm-fast-data-entry__styles__padded___8E3A9{padding:1rem}",""]),a.locals={searchHeaderContainer:"-esm-fast-data-entry__styles__searchHeaderContainer___3ZMXh",searchBarWrapper:"-esm-fast-data-entry__styles__searchBarWrapper___dRAl4",padded:"-esm-fast-data-entry__styles__padded___8E3A9"};const o=a},9423:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(3645),a=r.n(n)()((function(e){return e[1]}));a.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-fast-data-entry__compact-group-result__patientSearchResult___i7AGA{text-decoration:none;display:flex;align-items:center;border-bottom:1px solid #e0e0e0;padding:0 .75rem}.-esm-fast-data-entry__compact-group-result__patientSearchResult___i7AGA:hover,.-esm-fast-data-entry__compact-group-result__patientSearchResult___i7AGA:focus{background-color:#f4f4f4}.-esm-fast-data-entry__compact-group-result__patientSearchResultSelected___NKBck{background-color:#e0e0e0}.-esm-fast-data-entry__compact-group-result__patientBanner___hohFI{display:flex}.-esm-fast-data-entry__compact-group-result__patientName___Bm1nd{font-size:var(--cds-heading-02-font-size, 1rem);font-weight:var(--cds-heading-02-font-weight, 600);line-height:var(--cds-heading-02-line-height, 1.5);letter-spacing:var(--cds-heading-02-letter-spacing, 0)}.-esm-fast-data-entry__compact-group-result__patientAvatar___ekNKL{width:3rem;height:3rem;margin:.5rem 1rem .5rem 0;border-radius:1px}.-esm-fast-data-entry__compact-group-result__patientInfo___aPztL{width:100%;display:flex;flex-flow:column wrap;margin:1rem;cursor:pointer}.-esm-fast-data-entry__compact-group-result__demographics___ZX2gk{margin-top:.5rem;font-size:var(--cds-body-compact-02-font-size, 1rem);font-weight:var(--cds-body-compact-02-font-weight, 400);line-height:var(--cds-body-compact-02-line-height, 1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing, 0);color:#525252}.-esm-fast-data-entry__compact-group-result__identifiers___nO-LM{font-size:var(--cds-body-compact-02-font-size, 1rem);font-weight:var(--cds-body-compact-02-font-weight, 400);line-height:var(--cds-body-compact-02-line-height, 1.375);letter-spacing:var(--cds-body-compact-02-letter-spacing, 0);color:#8d8d8d}.-esm-fast-data-entry__compact-group-result__actionsContainer___GtQQe{padding-top:.5rem;margin-top:1rem}.-esm-fast-data-entry__compact-group-result__middot___K0huB{margin:0 .5rem}",""]),a.locals={patientSearchResult:"-esm-fast-data-entry__compact-group-result__patientSearchResult___i7AGA",patientSearchResultSelected:"-esm-fast-data-entry__compact-group-result__patientSearchResultSelected___NKBck",patientBanner:"-esm-fast-data-entry__compact-group-result__patientBanner___hohFI",patientName:"-esm-fast-data-entry__compact-group-result__patientName___Bm1nd",patientAvatar:"-esm-fast-data-entry__compact-group-result__patientAvatar___ekNKL",patientInfo:"-esm-fast-data-entry__compact-group-result__patientInfo___aPztL",demographics:"-esm-fast-data-entry__compact-group-result__demographics___ZX2gk",identifiers:"-esm-fast-data-entry__compact-group-result__identifiers___nO-LM",actionsContainer:"-esm-fast-data-entry__compact-group-result__actionsContainer___GtQQe",middot:"-esm-fast-data-entry__compact-group-result__middot___K0huB"};const o=a},68:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(3645),a=r.n(n)()((function(e){return e[1]}));a.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-fast-data-entry__compact-group-search__patientSearchBar___DDD\\+\\+{width:50vw;position:relative}.-esm-fast-data-entry__compact-group-search__floatingSearchResultsContainer___Qw-70{position:absolute;overflow-y:auto;box-shadow:0 .5rem 1rem #e0e0e0;z-index:99;border:0 1px 1px 1px solid #e0e0e0;width:100%;background-color:#fff}.-esm-fast-data-entry__compact-group-search__searchArea___\\+uJny{width:inherit;display:flex;justify-content:center;align-items:center;border:1px solid #8d8d8d}.-esm-fast-data-entry__compact-group-search__patientSearchInput___FLVTr{border:none}.-esm-fast-data-entry__compact-group-search__patientSearchInput___FLVTr input:focus{outline:1px solid 1px solid #ff832b}",""]),a.locals={patientSearchBar:"-esm-fast-data-entry__compact-group-search__patientSearchBar___DDD++",floatingSearchResultsContainer:"-esm-fast-data-entry__compact-group-search__floatingSearchResultsContainer___Qw-70",searchArea:"-esm-fast-data-entry__compact-group-search__searchArea___+uJny",patientSearchInput:"-esm-fast-data-entry__compact-group-search__patientSearchInput___FLVTr"};const o=a},9370:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(3645),a=r.n(n)()((function(e){return e[1]}));a.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-fast-data-entry__group-search__searchResultsContainer___o8N-5{width:100%;background-color:#fff}.-esm-fast-data-entry__group-search__searchResultsContainer___o8N-5 a{text-decoration:none;font-size:var(--cds-heading-02-font-size, 1rem);font-weight:var(--cds-heading-02-font-weight, 600);line-height:var(--cds-heading-02-line-height, 1.5);letter-spacing:var(--cds-heading-02-letter-spacing, 0);color:#525252;margin:0rem}.omrs-breakpoint-lt-desktop .-esm-fast-data-entry__group-search__searchResultsContainer___o8N-5{top:6.25rem}.omrs-breakpoint-gt-tablet .-esm-fast-data-entry__group-search__searchResultsContainer___o8N-5{padding:0;top:3rem}.-esm-fast-data-entry__group-search__searchResults___waz\\+y{width:100%}.-esm-fast-data-entry__group-search__searchTerm___nyCGc{font-size:var(--cds-heading-03-font-size, 1.25rem);font-weight:var(--cds-heading-03-font-weight, 400);line-height:var(--cds-heading-03-line-height, 1.4);letter-spacing:var(--cds-heading-03-letter-spacing, 0);margin-top:.375rem}.-esm-fast-data-entry__group-search__resultsText___tut0N{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:#525252;line-height:1rem;margin:.5rem 1rem}.-esm-fast-data-entry__group-search__helperText___DxXca{color:var(--omrs-color-ink-medium-contrast);margin-left:2.375rem}.-esm-fast-data-entry__group-search__emptyResultText___mWUlV{font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px);color:#525252;margin-top:1rem;margin-bottom:.313rem}.-esm-fast-data-entry__group-search__actionText___pfkSN{font-size:var(--cds-body-01-font-size, 0.875rem);font-weight:var(--cds-body-01-font-weight, 400);line-height:var(--cds-body-01-line-height, 1.42857);letter-spacing:var(--cds-body-01-letter-spacing, 0.16px);color:#525252}.-esm-fast-data-entry__group-search__pagination___RfffN{display:flex;justify-content:space-evenly;padding:4.688rem 0 1.5rem}.-esm-fast-data-entry__group-search__emptySearchResultsTile___JGNyK{text-align:center;margin-top:1rem;padding:3rem 0rem}.omrs-breakpoint-gt-tablet .-esm-fast-data-entry__group-search__emptySearchResultsTile___JGNyK{margin:1rem}.-esm-fast-data-entry__group-search__errorMessage___c4zp4{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);margin-top:2.25rem;margin-bottom:.5rem}.-esm-fast-data-entry__group-search__errorCopy___EjmNT{margin-bottom:.5rem;font-size:var(--cds-body-01-font-size, 0.875rem);font-weight:var(--cds-body-01-font-weight, 400);line-height:var(--cds-body-01-line-height, 1.42857);letter-spacing:var(--cds-body-01-letter-spacing, 0.16px);color:#525252}.-esm-fast-data-entry__group-search__lastItem___48nGL{padding:1rem;display:flex;justify-content:center;align-items:center}",""]),a.locals={searchResultsContainer:"-esm-fast-data-entry__group-search__searchResultsContainer___o8N-5",searchResults:"-esm-fast-data-entry__group-search__searchResults___waz+y",searchTerm:"-esm-fast-data-entry__group-search__searchTerm___nyCGc",resultsText:"-esm-fast-data-entry__group-search__resultsText___tut0N",helperText:"-esm-fast-data-entry__group-search__helperText___DxXca",emptyResultText:"-esm-fast-data-entry__group-search__emptyResultText___mWUlV",actionText:"-esm-fast-data-entry__group-search__actionText___pfkSN",pagination:"-esm-fast-data-entry__group-search__pagination___RfffN",emptySearchResultsTile:"-esm-fast-data-entry__group-search__emptySearchResultsTile___JGNyK",errorMessage:"-esm-fast-data-entry__group-search__errorMessage___c4zp4",errorCopy:"-esm-fast-data-entry__group-search__errorCopy___EjmNT",lastItem:"-esm-fast-data-entry__group-search__lastItem___48nGL"};const o=a},7159:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(3645),a=r.n(n)()((function(e){return e[1]}));a.push([e.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.-esm-fast-data-entry__styles__breadcrumbsContainer___sgb6T>div>div>nav{background-color:#fff;padding:.75rem 1rem;height:2.5rem}.-esm-fast-data-entry__styles__workspaceWrapper___KeE2D{display:flex;justify-content:center}.-esm-fast-data-entry__styles__workspace___e3uV4{width:1100px}.omrs-breakpoint-lt-large-desktop .-esm-fast-data-entry__styles__workspace___e3uV4{width:1000px}.omrs-breakpoint-lt-small-desktop .-esm-fast-data-entry__styles__workspace___e3uV4{width:100vw;padding:0 .75rem}.-esm-fast-data-entry__styles__selectPatientMessage___kmuRr{font-size:var(--cds-productive-heading-03-font-size, 1.25rem);font-weight:var(--cds-productive-heading-03-font-weight, 400);line-height:var(--cds-productive-heading-03-line-height, 1.4);letter-spacing:var(--cds-productive-heading-03-letter-spacing, 0);margin:2rem;text-align:center}.-esm-fast-data-entry__styles__formMainContent___l0zj8{display:flex;text-align:center;margin-top:1rem;column-gap:1rem}.-esm-fast-data-entry__styles__formContainer___cM3g8{flex-grow:1;max-height:calc(100vh - 14rem);overflow-y:scroll;text-align:left}.-esm-fast-data-entry__styles__formContainer___cM3g8 .cds--form-item .question-area{max-width:100%}.-esm-fast-data-entry__styles__rightPanel___iBUBP{min-width:13rem;text-align:left;overflow-y:scroll;display:flex;flex-direction:column;row-gap:1rem}.-esm-fast-data-entry__styles__patientCardsSection___2IKZo{margin:1rem 0;border-bottom:1px solid #f4f4f4}.-esm-fast-data-entry__styles__rightPanelActionButtons___P38yA{display:flex;flex-direction:column;row-gap:.5rem}.-esm-fast-data-entry__styles__rightPanelActionButtons___P38yA button{width:100%;text-decoration:"none"}.-esm-fast-data-entry__styles__formSection___XvWDb{display:flex;flex-direction:column;row-gap:1rem;justify-content:flex-start;align-items:flex-start;text-align:left}.-esm-fast-data-entry__styles__formSectionTile___Kv\\+-Q{width:500px}.-esm-fast-data-entry__styles__formError___ljPPl{font-size:var(--cds-helper-text-02-font-size, carbon--type-scale(2));font-weight:var(--cds-helper-text-02-font-weight, carbon--font-weight("regular"));line-height:var(--cds-helper-text-02-line-height, 1.28572);letter-spacing:var(--cds-helper-text-02-letter-spacing, 0.16px);color:#da1e28}',""]),a.locals={breadcrumbsContainer:"-esm-fast-data-entry__styles__breadcrumbsContainer___sgb6T",workspaceWrapper:"-esm-fast-data-entry__styles__workspaceWrapper___KeE2D",workspace:"-esm-fast-data-entry__styles__workspace___e3uV4",selectPatientMessage:"-esm-fast-data-entry__styles__selectPatientMessage___kmuRr",formMainContent:"-esm-fast-data-entry__styles__formMainContent___l0zj8",formContainer:"-esm-fast-data-entry__styles__formContainer___cM3g8",rightPanel:"-esm-fast-data-entry__styles__rightPanel___iBUBP",patientCardsSection:"-esm-fast-data-entry__styles__patientCardsSection___2IKZo",rightPanelActionButtons:"-esm-fast-data-entry__styles__rightPanelActionButtons___P38yA",formSection:"-esm-fast-data-entry__styles__formSection___XvWDb",formSectionTile:"-esm-fast-data-entry__styles__formSectionTile___Kv+-Q",formError:"-esm-fast-data-entry__styles__formError___ljPPl"};const o=a}}]);
package/dist/327.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[327],{2327:(e,t,r)=>{r.d(t,{$r:()=>E,K$:()=>u,wn:()=>_,zW:()=>x});var a,l,n,i,h,o,c,w,d,p,s,f=r(1927),m=r(1672),z=r.n(m),v=["children","size"],M=["children","size"],L=["children","size"],g=["children","size"],u=z().forwardRef((function(e,t){var r=e.children,l=e.size,n=void 0===l?16:l,i=(0,f._)(e,v);return z().createElement(f.I,(0,f.a)({width:n,height:n,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},i),a||(a=z().createElement("path",{d:"M30 28.6L3.4 2 2 3.4l10.1 10.1L4 21.6V28h6.4l8.1-8.1L28.6 30 30 28.6zM9.6 26H6v-3.6l7.5-7.5 3.6 3.6L9.6 26zM29.4 6.2L29.4 6.2l-3.6-3.6c-.8-.8-2-.8-2.8 0l0 0 0 0-8 8 1.4 1.4L20 8.4l3.6 3.6L20 15.6l1.4 1.4 8-8C30.2 8.2 30.2 7 29.4 6.2L29.4 6.2zM25 10.6L21.4 7l3-3L28 7.6 25 10.6z"})),r)})),E=z().forwardRef((function(e,t){var r=e.children,a=e.size,p=void 0===a?16:a,s=(0,f._)(e,M);return 16===p||"16"===p||"16px"===p?z().createElement(f.I,(0,f.a)({width:p,height:p,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},s),l||(l=z().createElement("path",{d:"M8,1C4.1,1,1,4.1,1,8s3.1,7,7,7s7-3.1,7-7S11.9,1,8,1z M10.7,11.5L4.5,5.3l0.8-0.8l6.2,6.2L10.7,11.5z"})),n||(n=z().createElement("path",{fill:"none",d:"M10.7,11.5L4.5,5.3l0.8-0.8l6.2,6.2L10.7,11.5z","data-icon-path":"inner-path",opacity:"0"})),r):20===p||"20"===p||"20px"===p?z().createElement(f.I,(0,f.a)({width:p,height:p,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},s),i||(i=z().createElement("path",{d:"M10,1c-5,0-9,4-9,9s4,9,9,9s9-4,9-9S15,1,10,1z M13.5,14.5l-8-8l1-1l8,8L13.5,14.5z"})),h||(h=z().createElement("path",{d:"M13.5,14.5l-8-8l1-1l8,8L13.5,14.5z","data-icon-path":"inner-path",opacity:"0"})),r):24===p||"24"===p||"24px"===p?z().createElement(f.I,(0,f.a)({width:p,height:p,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},s),o||(o=z().createElement("path",{d:"M12,1C5.9,1,1,5.9,1,12s4.9,11,11,11s11-4.9,11-11S18.1,1,12,1z M16.3,17.5L6.5,7.7l1.2-1.2l9.8,9.8L16.3,17.5z"})),c||(c=z().createElement("path",{fill:"none",d:"M16.3,17.5L6.5,7.7l1.2-1.2l9.8,9.8L16.3,17.5z","data-icon-path":"inner-path",opacity:"0"})),r):z().createElement(f.I,(0,f.a)({width:p,height:p,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},s),w||(w=z().createElement("path",{fill:"none",d:"M14.9 7.2H17.1V24.799H14.9z","data-icon-path":"inner-path",transform:"rotate(-45 16 16)"})),d||(d=z().createElement("path",{d:"M16,2A13.914,13.914,0,0,0,2,16,13.914,13.914,0,0,0,16,30,13.914,13.914,0,0,0,30,16,13.914,13.914,0,0,0,16,2Zm5.4449,21L9,10.5557,10.5557,9,23,21.4448Z"})),r)})),x=z().forwardRef((function(e,t){var r=e.children,a=e.size,l=void 0===a?16:a,n=(0,f._)(e,L);return z().createElement(f.I,(0,f.a)({width:l,height:l,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},n),p||(p=z().createElement("path",{d:"M26 14H24v2h2a3.0033 3.0033 0 013 3v4h2V19A5.0058 5.0058 0 0026 14zM24 4a3 3 0 11-3 3 3 3 0 013-3m0-2a5 5 0 105 5A5 5 0 0024 2zM23 30H21V28a3.0033 3.0033 0 00-3-3H14a3.0033 3.0033 0 00-3 3v2H9V28a5.0059 5.0059 0 015-5h4a5.0059 5.0059 0 015 5zM16 13a3 3 0 11-3 3 3 3 0 013-3m0-2a5 5 0 105 5A5 5 0 0016 11zM8 14H6a5.0059 5.0059 0 00-5 5v4H3V19a3.0033 3.0033 0 013-3H8zM8 4A3 3 0 115 7 3 3 0 018 4M8 2a5 5 0 105 5A5 5 0 008 2z"})),r)})),_=z().forwardRef((function(e,t){var r=e.children,a=e.size,l=void 0===a?16:a,n=(0,f._)(e,g);return z().createElement(f.I,(0,f.a)({width:l,height:l,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},n),s||(s=z().createElement("path",{d:"M18,28H14a2,2,0,0,1-2-2V18.41L4.59,11A2,2,0,0,1,4,9.59V6A2,2,0,0,1,6,4H26a2,2,0,0,1,2,2V9.59A2,2,0,0,1,27.41,11L20,18.41V26A2,2,0,0,1,18,28ZM6,6V9.59l8,8V26h4V17.59l8-8V6Z"})),r)}))}}]);
1
+ "use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[327],{2327:(e,t,r)=>{r.d(t,{$r:()=>V,I8:()=>x,K$:()=>_,wn:()=>C,zW:()=>H});var l,a,n,i,h,o,c,w,d,s,p,f,m=r(1927),z=r(1672),v=r.n(z),M=["children","size"],L=["children","size"],g=["children","size"],u=["children","size"],E=["children","size"],x=v().forwardRef((function(e,t){var r=e.children,a=e.size,n=void 0===a?16:a,i=(0,m._)(e,M);return v().createElement(m.I,(0,m.a)({width:n,height:n,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},i),l||(l=v().createElement("path",{d:"M2 26H30V28H2zM25.4 9c.8-.8.8-2 0-2.8 0 0 0 0 0 0l-3.6-3.6c-.8-.8-2-.8-2.8 0 0 0 0 0 0 0l-15 15V24h6.4L25.4 9zM20.4 4L24 7.6l-3 3L17.4 7 20.4 4zM6 22v-3.6l10-10 3.6 3.6-10 10H6z"})),r)})),_=v().forwardRef((function(e,t){var r=e.children,l=e.size,n=void 0===l?16:l,i=(0,m._)(e,L);return v().createElement(m.I,(0,m.a)({width:n,height:n,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},i),a||(a=v().createElement("path",{d:"M30 28.6L3.4 2 2 3.4l10.1 10.1L4 21.6V28h6.4l8.1-8.1L28.6 30 30 28.6zM9.6 26H6v-3.6l7.5-7.5 3.6 3.6L9.6 26zM29.4 6.2L29.4 6.2l-3.6-3.6c-.8-.8-2-.8-2.8 0l0 0 0 0-8 8 1.4 1.4L20 8.4l3.6 3.6L20 15.6l1.4 1.4 8-8C30.2 8.2 30.2 7 29.4 6.2L29.4 6.2zM25 10.6L21.4 7l3-3L28 7.6 25 10.6z"})),r)})),V=v().forwardRef((function(e,t){var r=e.children,l=e.size,a=void 0===l?16:l,p=(0,m._)(e,g);return 16===a||"16"===a||"16px"===a?v().createElement(m.I,(0,m.a)({width:a,height:a,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},p),n||(n=v().createElement("path",{d:"M8,1C4.1,1,1,4.1,1,8s3.1,7,7,7s7-3.1,7-7S11.9,1,8,1z M10.7,11.5L4.5,5.3l0.8-0.8l6.2,6.2L10.7,11.5z"})),i||(i=v().createElement("path",{fill:"none",d:"M10.7,11.5L4.5,5.3l0.8-0.8l6.2,6.2L10.7,11.5z","data-icon-path":"inner-path",opacity:"0"})),r):20===a||"20"===a||"20px"===a?v().createElement(m.I,(0,m.a)({width:a,height:a,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},p),h||(h=v().createElement("path",{d:"M10,1c-5,0-9,4-9,9s4,9,9,9s9-4,9-9S15,1,10,1z M13.5,14.5l-8-8l1-1l8,8L13.5,14.5z"})),o||(o=v().createElement("path",{d:"M13.5,14.5l-8-8l1-1l8,8L13.5,14.5z","data-icon-path":"inner-path",opacity:"0"})),r):24===a||"24"===a||"24px"===a?v().createElement(m.I,(0,m.a)({width:a,height:a,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},p),c||(c=v().createElement("path",{d:"M12,1C5.9,1,1,5.9,1,12s4.9,11,11,11s11-4.9,11-11S18.1,1,12,1z M16.3,17.5L6.5,7.7l1.2-1.2l9.8,9.8L16.3,17.5z"})),w||(w=v().createElement("path",{fill:"none",d:"M16.3,17.5L6.5,7.7l1.2-1.2l9.8,9.8L16.3,17.5z","data-icon-path":"inner-path",opacity:"0"})),r):v().createElement(m.I,(0,m.a)({width:a,height:a,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},p),d||(d=v().createElement("path",{fill:"none",d:"M14.9 7.2H17.1V24.799H14.9z","data-icon-path":"inner-path",transform:"rotate(-45 16 16)"})),s||(s=v().createElement("path",{d:"M16,2A13.914,13.914,0,0,0,2,16,13.914,13.914,0,0,0,16,30,13.914,13.914,0,0,0,30,16,13.914,13.914,0,0,0,16,2Zm5.4449,21L9,10.5557,10.5557,9,23,21.4448Z"})),r)})),H=v().forwardRef((function(e,t){var r=e.children,l=e.size,a=void 0===l?16:l,n=(0,m._)(e,u);return v().createElement(m.I,(0,m.a)({width:a,height:a,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},n),p||(p=v().createElement("path",{d:"M26 14H24v2h2a3.0033 3.0033 0 013 3v4h2V19A5.0058 5.0058 0 0026 14zM24 4a3 3 0 11-3 3 3 3 0 013-3m0-2a5 5 0 105 5A5 5 0 0024 2zM23 30H21V28a3.0033 3.0033 0 00-3-3H14a3.0033 3.0033 0 00-3 3v2H9V28a5.0059 5.0059 0 015-5h4a5.0059 5.0059 0 015 5zM16 13a3 3 0 11-3 3 3 3 0 013-3m0-2a5 5 0 105 5A5 5 0 0016 11zM8 14H6a5.0059 5.0059 0 00-5 5v4H3V19a3.0033 3.0033 0 013-3H8zM8 4A3 3 0 115 7 3 3 0 018 4M8 2a5 5 0 105 5A5 5 0 008 2z"})),r)})),C=v().forwardRef((function(e,t){var r=e.children,l=e.size,a=void 0===l?16:l,n=(0,m._)(e,E);return v().createElement(m.I,(0,m.a)({width:a,height:a,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},n),f||(f=v().createElement("path",{d:"M18,28H14a2,2,0,0,1-2-2V18.41L4.59,11A2,2,0,0,1,4,9.59V6A2,2,0,0,1,6,4H26a2,2,0,0,1,2,2V9.59A2,2,0,0,1,27.41,11L20,18.41V26A2,2,0,0,1,18,28ZM6,6V9.59l8,8V26h4V17.59l8-8V6Z"})),r)}))}}]);
package/dist/571.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[571],{8808:(e,t,r)=>{r.d(t,{ZN:()=>u});var s,a,n=r(1927),i=r(1672),o=r.n(i),l=["children","size"],u=o().forwardRef((function(e,t){var r=e.children,i=e.size,u=void 0===i?16:i,c=(0,n._)(e,l);return o().createElement(n.I,(0,n.a)({width:u,height:u,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},c),s||(s=o().createElement("path",{d:"M12 12H14V24H12zM18 12H20V24H18z"})),a||(a=o().createElement("path",{d:"M4 6V8H6V28a2 2 0 002 2H24a2 2 0 002-2V8h2V6zM8 28V8H24V28zM12 2H20V4H12z"})),r)}))},7518:(e,t,r)=>{r.d(t,{Z:()=>k});const s=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},a="object"==typeof global&&global&&global.Object===Object&&global;var n="object"==typeof self&&self&&self.Object===Object&&self;const i=a||n||Function("return this")(),o=function(){return i.Date.now()};var l=/\s/;var u=/^\s+/;const c=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&l.test(e.charAt(t)););return t}(e)+1).replace(u,""):e},f=i.Symbol;var d=Object.prototype,m=d.hasOwnProperty,y=d.toString,h=f?f.toStringTag:void 0;var v=Object.prototype.toString;var g=f?f.toStringTag:void 0;const p=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":g&&g in Object(e)?function(e){var t=m.call(e,h),r=e[h];try{e[h]=void 0;var s=!0}catch(e){}var a=y.call(e);return s&&(t?e[h]=r:delete e[h]),a}(e):function(e){return v.call(e)}(e)};var b=/^[-+]0x[0-9a-f]+$/i,_=/^0b[01]+$/i,V=/^0o[0-7]+$/i,w=parseInt;const A=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==p(e)}(e))return NaN;if(s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=c(e);var r=_.test(e);return r||V.test(e)?w(e.slice(2),r?2:8):b.test(e)?NaN:+e};var S=Math.max,F=Math.min;const k=function(e,t,r){var a,n,i,l,u,c,f=0,d=!1,m=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var r=a,s=n;return a=n=void 0,f=t,l=e.apply(s,r)}function v(e){return f=e,u=setTimeout(p,t),d?h(e):l}function g(e){var r=e-c;return void 0===c||r>=t||r<0||m&&e-f>=i}function p(){var e=o();if(g(e))return b(e);u=setTimeout(p,function(e){var r=t-(e-c);return m?F(r,i-(e-f)):r}(e))}function b(e){return u=void 0,y&&a?h(e):(a=n=void 0,l)}function _(){var e=o(),r=g(e);if(a=arguments,n=this,c=e,r){if(void 0===u)return v(c);if(m)return clearTimeout(u),u=setTimeout(p,t),h(c)}return void 0===u&&(u=setTimeout(p,t)),l}return t=A(t)||0,s(r)&&(d=!!r.leading,i=(m="maxWait"in r)?S(A(r.maxWait)||0,t):i,y="trailing"in r?!!r.trailing:y),_.cancel=function(){void 0!==u&&clearTimeout(u),f=0,a=c=n=u=void 0},_.flush=function(){return void 0===u?l:b(o())},_}},7536:(e,t,r)=>{r.d(t,{Gc:()=>V,Qr:()=>T,RV:()=>w,cI:()=>_e});var s=r(1672),a=e=>"checkbox"===e.type,n=e=>e instanceof Date,i=e=>null==e;const o=e=>"object"==typeof e;var l=e=>!i(e)&&!Array.isArray(e)&&o(e)&&!n(e),u=e=>l(e)&&e.target?a(e.target)?e.target.checked:e.target.value:e,c=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),f=e=>Array.isArray(e)?e.filter(Boolean):[],d=e=>void 0===e,m=(e,t,r)=>{if(!t||!l(e))return r;const s=f(t.split(/[,[\].]+?/)).reduce(((e,t)=>i(e)?e:e[t]),e);return d(s)||s===e?d(e[t])?r:e[t]:s};const y="blur",h="onChange",v="onSubmit",g="all",p="pattern",b="required",_=s.createContext(null),V=()=>s.useContext(_),w=e=>{const{children:t,...r}=e;return s.createElement(_.Provider,{value:r},t)};var A=(e,t,r,s=!0)=>{const a={};for(const n in e)Object.defineProperty(a,n,{get:()=>{const a=n;return t[a]!==g&&(t[a]=!s||g),r&&(r[a]=!0),e[a]}});return a},S=e=>l(e)&&!Object.keys(e).length,F=(e,t,r)=>{const{name:s,...a}=e;return S(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find((e=>t[e]===(!r||g)))},k=e=>Array.isArray(e)?e:[e],x=(e,t,r)=>r&&t?e===t:!e||!t||e===t||k(e).some((e=>e&&(e.startsWith(t)||t.startsWith(e))));function D(e){const t=s.useRef(e);t.current=e,s.useEffect((()=>{const r=!e.disabled&&t.current.subject.subscribe({next:t.current.callback});return()=>(e=>{e&&e.unsubscribe()})(r)}),[e.disabled])}var C=e=>"string"==typeof e,j=(e,t,r,s)=>{const a=Array.isArray(e);return C(e)?(s&&t.watch.add(e),m(r,e)):a?e.map((e=>(s&&t.watch.add(e),m(r,e)))):(s&&(t.watchAll=!0),r)},O=e=>"function"==typeof e,E=e=>{for(const t in e)if(O(e[t]))return!0;return!1};const T=e=>e.render(function(e){const t=V(),{name:r,control:a=t.control,shouldUnregister:n}=e,i=c(a._names.array,r),o=function(e){const t=V(),{control:r=t.control,name:a,defaultValue:n,disabled:i,exact:o}=e||{},u=s.useRef(a);u.current=a;const c=s.useCallback((e=>{if(x(u.current,e.name,o)){const t=j(u.current,r._names,e.values||r._formValues);m(d(u.current)||l(t)&&!E(t)?{...t}:Array.isArray(t)?[...t]:d(t)?n:t)}}),[r,o,n]);D({disabled:i,subject:r._subjects.watch,callback:c});const[f,m]=s.useState(d(n)?r._getWatch(a):n);return s.useEffect((()=>{r._removeUnmounted()})),f}({control:a,name:r,defaultValue:m(a._formValues,r,m(a._defaultValues,r,e.defaultValue)),exact:!0}),f=function(e){const t=V(),{control:r=t.control,disabled:a,name:n,exact:i}=e||{},[o,l]=s.useState(r._formState),u=s.useRef({isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=s.useRef(n),f=s.useRef(!0);return c.current=n,D({disabled:a,callback:s.useCallback((e=>f.current&&x(c.current,e.name,i)&&F(e,u.current)&&l({...r._formState,...e})),[r,i]),subject:r._subjects.state}),s.useEffect((()=>(f.current=!0,()=>{f.current=!1})),[]),A(o,r._proxyFormState,u.current,!1)}({control:a,name:r}),h=s.useRef(a.register(r,{...e.rules,value:o}));return s.useEffect((()=>{const e=(e,t)=>{const r=m(a._fields,e);r&&(r._f.mount=t)};return e(r,!0),()=>{const t=a._options.shouldUnregister||n;(i?t&&!a._stateFlags.action:t)?a.unregister(r):e(r,!1)}}),[r,a,i,n]),{field:{name:r,value:o,onChange:s.useCallback((e=>{h.current.onChange({target:{value:u(e),name:r},type:"change"})}),[r]),onBlur:s.useCallback((()=>{h.current.onBlur({target:{value:m(a._formValues,r),name:r},type:y})}),[r,a]),ref:s.useCallback((e=>{const t=m(a._fields,r);e&&t&&e.focus&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}),[r,a._fields])},formState:f,fieldState:Object.defineProperties({},{invalid:{get:()=>!!m(f.errors,r)},isDirty:{get:()=>!!m(f.dirtyFields,r)},isTouched:{get:()=>!!m(f.touchedFields,r)},error:{get:()=>m(f.errors,r)}})}}(e));var N=(e,t,r,s,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[s]:a||!0}}:{},M=e=>/^\w*$/.test(e),U=e=>f(e.replace(/["|']|\]/g,"").split(/\.|\[/));function L(e,t,r){let s=-1;const a=M(t)?[t]:U(t),n=a.length,i=n-1;for(;++s<n;){const t=a[s];let n=r;if(s!==i){const r=e[t];n=l(r)||Array.isArray(r)?r:isNaN(+a[s+1])?{}:[]}e[t]=n,e=e[t]}return e}const B=(e,t,r)=>{for(const s of r||Object.keys(e)){const r=m(e,s);if(r){const{_f:e,...s}=r;if(e&&t(e.name)){if(e.ref.focus&&d(e.ref.focus()))break;if(e.refs){e.refs[0].focus();break}}else l(s)&&B(s,t)}}};var H=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))))),R=(e,t,r)=>{const s=f(m(e,r));return L(s,"root",t[r]),L(e,r,s),e},z=e=>"boolean"==typeof e,q=e=>"file"===e.type,P=e=>C(e)||s.isValidElement(e),$=e=>"radio"===e.type,I=e=>e instanceof RegExp;const W={value:!1,isValid:!1},J={value:!0,isValid:!0};var Z=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!d(e[0].attributes.value)?d(e[0].value)||""===e[0].value?J:{value:e[0].value,isValid:!0}:J:W}return W};const G={isValid:!1,value:null};var Q=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),G):G;function K(e,t,r="validate"){if(P(e)||Array.isArray(e)&&e.every(P)||z(e)&&!e)return{type:r,message:P(e)?e:"",ref:t}}var X=e=>l(e)&&!I(e)?e:{value:e,message:""},Y=async(e,t,r,s,n)=>{const{ref:o,refs:u,required:c,maxLength:f,minLength:d,min:m,max:y,pattern:h,validate:v,name:g,valueAsNumber:_,mount:V,disabled:w}=e._f;if(!V||w)return{};const A=u?u[0]:o,F=e=>{s&&A.reportValidity&&(A.setCustomValidity(z(e)?"":e||" "),A.reportValidity())},k={},x=$(o),D=a(o),j=x||D,E=(_||q(o))&&!o.value||""===t||Array.isArray(t)&&!t.length,T=N.bind(null,g,r,k),M=(e,t,r,s="maxLength",a="minLength")=>{const n=e?t:r;k[g]={type:e?s:a,message:n,ref:o,...T(e?s:a,n)}};if(n?!Array.isArray(t)||!t.length:c&&(!j&&(E||i(t))||z(t)&&!t||D&&!Z(u).isValid||x&&!Q(u).isValid)){const{value:e,message:t}=P(c)?{value:!!c,message:c}:X(c);if(e&&(k[g]={type:b,message:t,ref:A,...T(b,t)},!r))return F(t),k}if(!(E||i(m)&&i(y))){let e,s;const a=X(y),n=X(m);if(i(t)||isNaN(t)){const r=o.valueAsDate||new Date(t);C(a.value)&&(e=r>new Date(a.value)),C(n.value)&&(s=r<new Date(n.value))}else{const r=o.valueAsNumber||+t;i(a.value)||(e=r>a.value),i(n.value)||(s=r<n.value)}if((e||s)&&(M(!!e,a.message,n.message,"max","min"),!r))return F(k[g].message),k}if((f||d)&&!E&&(C(t)||n&&Array.isArray(t))){const e=X(f),s=X(d),a=!i(e.value)&&t.length>e.value,n=!i(s.value)&&t.length<s.value;if((a||n)&&(M(a,e.message,s.message),!r))return F(k[g].message),k}if(h&&!E&&C(t)){const{value:e,message:s}=X(h);if(I(e)&&!t.match(e)&&(k[g]={type:p,message:s,ref:o,...T(p,s)},!r))return F(s),k}if(v)if(O(v)){const e=K(await v(t),A);if(e&&(k[g]={...e,...T("validate",e.message)},!r))return F(e.message),k}else if(l(v)){let e={};for(const s in v){if(!S(e)&&!r)break;const a=K(await v[s](t),A,s);a&&(e={...a,...T(s,a.message)},F(a.message),r&&(k[g]=e))}if(!S(e)&&(k[g]={ref:A,...e},!r))return k}return F(!0),k},ee="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function te(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(ee&&(e instanceof Blob||e instanceof FileList)||!r&&!l(e))return e;t=r?[]:{};for(const r in e){if(O(e[r])){t=e;break}t[r]=te(e[r])}}return t}var re=e=>({isOnSubmit:!e||e===v,isOnBlur:"onBlur"===e,isOnChange:e===h,isOnAll:e===g,isOnTouch:"onTouched"===e});function se(e){for(const t in e)if(!d(e[t]))return!1;return!0}function ae(e,t){const r=M(t)?[t]:U(t),s=1==r.length?e:function(e,t){const r=t.slice(0,-1).length;let s=0;for(;s<r;)e=d(e)?s++:e[t[s++]];return e}(e,r),a=r[r.length-1];let n;s&&delete s[a];for(let t=0;t<r.slice(0,-1).length;t++){let s,a=-1;const i=r.slice(0,-(t+1)),o=i.length-1;for(t>0&&(n=e);++a<i.length;){const t=i[a];s=s?s[t]:e[t],o===a&&(l(s)&&S(s)||Array.isArray(s)&&se(s))&&(n?delete n[t]:delete e[t]),n=s}}return e}function ne(){let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}}var ie=e=>i(e)||!o(e);function oe(e,t){if(ie(e)||ie(t))return e===t;if(n(e)&&n(t))return e.getTime()===t.getTime();const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(const a of r){const r=e[a];if(!s.includes(a))return!1;if("ref"!==a){const e=t[a];if(n(r)&&n(e)||l(r)&&l(e)||Array.isArray(r)&&Array.isArray(e)?!oe(r,e):r!==e)return!1}}return!0}var le=e=>{const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ue=e=>"select-multiple"===e.type,ce=e=>le(e)&&e.isConnected;function fe(e,t={}){const r=Array.isArray(e);if(l(e)||r)for(const r in e)Array.isArray(e[r])||l(e[r])&&!E(e[r])?(t[r]=Array.isArray(e[r])?[]:{},fe(e[r],t[r])):i(e[r])||(t[r]=!0);return t}function de(e,t,r){const s=Array.isArray(e);if(l(e)||s)for(const s in e)Array.isArray(e[s])||l(e[s])&&!E(e[s])?d(t)||ie(r[s])?r[s]=Array.isArray(e[s])?fe(e[s],[]):{...fe(e[s])}:de(e[s],i(t)?{}:t[s],r[s]):r[s]=!oe(e[s],t[s]);return r}var me=(e,t)=>de(e,t,fe(t)),ye=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:s})=>d(e)?e:t?""===e||i(e)?NaN:+e:r&&C(e)?new Date(e):s?s(e):e;function he(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return q(t)?t.files:$(t)?Q(e.refs).value:ue(t)?[...t.selectedOptions].map((({value:e})=>e)):a(t)?Z(e.refs).value:ye(d(t.value)?e.ref.value:t.value,e)}var ve=e=>d(e)?void 0:I(e)?e.source:l(e)?I(e.value)?e.value.source:e.value:e;function ge(e,t,r){const s=m(e,r);if(s||M(r))return{error:s,name:r};const a=r.split(".");for(;a.length;){const s=a.join("."),n=m(t,s),i=m(e,s);if(n&&!Array.isArray(n)&&r!==s)return{name:r};if(i&&i.type)return{name:s,error:i};a.pop()}return{name:r}}const pe={mode:v,reValidateMode:h,shouldFocusError:!0};function be(e={}){let t,r={...pe,...e},s={isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touchedFields:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,errors:{}},o={},l=te(r.defaultValues)||{},h=r.shouldUnregister?{}:te(l),v={action:!1,mount:!1,watch:!1},p={mount:new Set,unMount:new Set,array:new Set,watch:new Set},b=0,_={};const V={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},w={watch:ne(),array:ne(),state:ne()},A=re(r.mode),F=re(r.reValidateMode),x=r.criteriaMode===g,D=async e=>{let t=!1;return V.isValid&&(t=r.resolver?S((await N()).errors):await M(o,!0),e||t===s.isValid||(s.isValid=t,w.state.next({isValid:t}))),t},E=(e,t,r,s)=>{const a=m(o,e);if(a){const n=m(h,e,d(r)?m(l,e):r);d(n)||s&&s.defaultChecked||t?L(h,e,t?n:he(a._f)):I(e,n),v.mount&&D()}},T=(e,t,r,a,n)=>{let i=!1;const o={name:e},u=m(s.touchedFields,e);if(V.isDirty){const e=s.isDirty;s.isDirty=o.isDirty=U(),i=e!==o.isDirty}if(V.dirtyFields&&(!r||a)){const r=m(s.dirtyFields,e);oe(m(l,e),t)?ae(s.dirtyFields,e):L(s.dirtyFields,e,!0),o.dirtyFields=s.dirtyFields,i=i||r!==m(s.dirtyFields,e)}return r&&!u&&(L(s.touchedFields,e,r),o.touchedFields=s.touchedFields,i=i||V.touchedFields&&u!==r),i&&n&&w.state.next(o),i?o:{}},N=async e=>r.resolver?await r.resolver({...h},r.context,((e,t,r,s)=>{const a={};for(const r of e){const e=m(t,r);e&&L(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:s}})(e||p.mount,o,r.criteriaMode,r.shouldUseNativeValidation)):{},M=async(e,t,a={valid:!0})=>{for(const n in e){const i=e[n];if(i){const{_f:e,...n}=i;if(e){const n=p.array.has(e.name),o=await Y(i,m(h,e.name),x,r.shouldUseNativeValidation,n);if(o[e.name]&&(a.valid=!1,t))break;!t&&(m(o,e.name)?n?R(s.errors,o,e.name):L(s.errors,e.name,o[e.name]):ae(s.errors,e.name))}n&&await M(n,t,a)}}return a.valid},U=(e,t)=>(e&&t&&L(h,e,t),!oe(Q(),l)),P=(e,t,r)=>{const s={...v.mount?h:d(t)?l:C(e)?{[e]:t}:t};return j(e,p,s,r)},I=(e,t,r={})=>{const s=m(o,e);let n=t;if(s){const r=s._f;r&&(!r.disabled&&L(h,e,ye(t,r)),n=ee&&le(r.ref)&&i(t)?"":t,ue(r.ref)?[...r.ref.options].forEach((e=>e.selected=n.includes(e.value))):r.refs?a(r.ref)?r.refs.length>1?r.refs.forEach((e=>!e.disabled&&(e.checked=Array.isArray(n)?!!n.find((t=>t===e.value)):n===e.value))):r.refs[0]&&(r.refs[0].checked=!!n):r.refs.forEach((e=>e.checked=e.value===n)):q(r.ref)?r.ref.value="":(r.ref.value=n,r.ref.type||w.watch.next({name:e})))}(r.shouldDirty||r.shouldTouch)&&T(e,n,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&G(e)},W=(e,t,r)=>{for(const s in t){const a=t[s],i=`${e}.${s}`,l=m(o,i);!p.array.has(e)&&ie(a)&&(!l||l._f)||n(a)?I(i,a,r):W(i,a,r)}},J=(e,t,r={})=>{const a=m(o,e),n=p.array.has(e),u=te(t);L(h,e,u),n?(w.array.next({name:e,values:h}),(V.isDirty||V.dirtyFields)&&r.shouldDirty&&(s.dirtyFields=me(l,h),w.state.next({name:e,dirtyFields:s.dirtyFields,isDirty:U(e,u)}))):!a||a._f||i(u)?I(e,u,r):W(e,u,r),H(e,p)&&w.state.next({}),w.watch.next({name:e})},Z=async a=>{const n=a.target;let i=n.name;const l=m(o,i);if(l){let f,d;const v=n.type?he(l._f):u(a),g=a.type===y||"focusout"===a.type,k=!((c=l._f).mount&&(c.required||c.min||c.max||c.maxLength||c.minLength||c.pattern||c.validate)||r.resolver||m(s.errors,i)||l._f.deps)||((e,t,r,s,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?s.isOnBlur:a.isOnBlur)?!e:!(r?s.isOnChange:a.isOnChange)||e))(g,m(s.touchedFields,i),s.isSubmitted,F,A),C=H(i,p,g);L(h,i,v),g?(l._f.onBlur&&l._f.onBlur(a),t&&t(0)):l._f.onChange&&l._f.onChange(a);const j=T(i,v,g,!1),O=!S(j)||C;if(!g&&w.watch.next({name:i,type:a.type}),k)return O&&w.state.next({name:i,...C?{}:j});if(!g&&C&&w.state.next({}),_[i]=(_[i],1),w.state.next({isValidating:!0}),r.resolver){const{errors:e}=await N([i]),t=ge(s.errors,o,i),r=ge(e,o,t.name||i);f=r.error,i=r.name,d=S(e)}else f=(await Y(l,m(h,i),x,r.shouldUseNativeValidation))[i],d=await D(!0);l._f.deps&&G(l._f.deps),(async(r,a,n,i)=>{const o=m(s.errors,r),l=V.isValid&&s.isValid!==a;var u;if(e.delayError&&n?(u=()=>((e,t)=>{L(s.errors,e,t),w.state.next({errors:s.errors})})(r,n),t=e=>{clearTimeout(b),b=window.setTimeout(u,e)},t(e.delayError)):(clearTimeout(b),t=null,n?L(s.errors,r,n):ae(s.errors,r)),(n?!oe(o,n):o)||!S(i)||l){const e={...i,...l?{isValid:a}:{},errors:s.errors,name:r};s={...s,...e},w.state.next(e)}_[r]--,V.isValidating&&!Object.values(_).some((e=>e))&&(w.state.next({isValidating:!1}),_={})})(i,d,f,j)}var c},G=async(e,t={})=>{let a,n;const i=k(e);if(w.state.next({isValidating:!0}),r.resolver){const t=await(async e=>{const{errors:t}=await N();if(e)for(const r of e){const e=m(t,r);e?L(s.errors,r,e):ae(s.errors,r)}else s.errors=t;return t})(d(e)?e:i);a=S(t),n=e?!i.some((e=>m(t,e))):a}else e?(n=(await Promise.all(i.map((async e=>{const t=m(o,e);return await M(t&&t._f?{[e]:t}:t)})))).every(Boolean),(n||s.isValid)&&D()):n=a=await M(o);return w.state.next({...!C(e)||V.isValid&&a!==s.isValid?{}:{name:e},...r.resolver?{isValid:a}:{},errors:s.errors,isValidating:!1}),t.shouldFocus&&!n&&B(o,(e=>m(s.errors,e)),e?i:p.mount),n},Q=e=>{const t={...l,...v.mount?h:{}};return d(e)?t:C(e)?m(t,e):e.map((e=>m(t,e)))},K=(e,t)=>({invalid:!!m((t||s).errors,e),isDirty:!!m((t||s).dirtyFields,e),isTouched:!!m((t||s).touchedFields,e),error:m((t||s).errors,e)}),X=(e,t={})=>{for(const a of e?k(e):p.mount)p.mount.delete(a),p.array.delete(a),m(o,a)&&(t.keepValue||(ae(o,a),ae(h,a)),!t.keepError&&ae(s.errors,a),!t.keepDirty&&ae(s.dirtyFields,a),!t.keepTouched&&ae(s.touchedFields,a),!r.shouldUnregister&&!t.keepDefaultValue&&ae(l,a));w.watch.next({}),w.state.next({...s,...t.keepDirty?{isDirty:U()}:{}}),!t.keepIsValid&&D()},se=(e,t={})=>{let s=m(o,e);const n=z(t.disabled);return L(o,e,{_f:{...s&&s._f?s._f:{ref:{name:e}},name:e,mount:!0,...t}}),p.mount.add(e),s?n&&L(h,e,t.disabled?void 0:m(h,e,he(s._f))):E(e,!0,t.value),{...n?{disabled:t.disabled}:{},...r.shouldUseNativeValidation?{required:!!t.required,min:ve(t.min),max:ve(t.max),minLength:ve(t.minLength),maxLength:ve(t.maxLength),pattern:ve(t.pattern)}:{},name:e,onChange:Z,onBlur:Z,ref:n=>{if(n){se(e,t),s=m(o,e);const r=d(n.value)&&n.querySelectorAll&&n.querySelectorAll("input,select,textarea")[0]||n,i=(e=>$(e)||a(e))(r),u=s._f.refs||[];if(i?u.find((e=>e===r)):r===s._f.ref)return;L(o,e,{_f:{...s._f,...i?{refs:[...u.filter(ce),r,...Array.isArray(m(l,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),E(e,!1,void 0,r)}else s=m(o,e,{}),s._f&&(s._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!c(p.array,e)||!v.action)&&p.unMount.add(e)}}};return{control:{register:se,unregister:X,getFieldState:K,_executeSchema:N,_getWatch:P,_getDirty:U,_updateValid:D,_removeUnmounted:()=>{for(const e of p.unMount){const t=m(o,e);t&&(t._f.refs?t._f.refs.every((e=>!ce(e))):!ce(t._f.ref))&&X(e)}p.unMount=new Set},_updateFieldArray:(e,t=[],r,a,n=!0,i=!0)=>{if(a&&r){if(v.action=!0,i&&Array.isArray(m(o,e))){const t=r(m(o,e),a.argA,a.argB);n&&L(o,e,t)}if(V.errors&&i&&Array.isArray(m(s.errors,e))){const t=r(m(s.errors,e),a.argA,a.argB);n&&L(s.errors,e,t),((e,t)=>{!f(m(e,t)).length&&ae(e,t)})(s.errors,e)}if(V.touchedFields&&i&&Array.isArray(m(s.touchedFields,e))){const t=r(m(s.touchedFields,e),a.argA,a.argB);n&&L(s.touchedFields,e,t)}V.dirtyFields&&(s.dirtyFields=me(l,h)),w.state.next({isDirty:U(e,t),dirtyFields:s.dirtyFields,errors:s.errors,isValid:s.isValid})}else L(h,e,t)},_getFieldArray:t=>f(m(v.mount?h:l,t,e.shouldUnregister?m(l,t,[]):[])),_subjects:w,_proxyFormState:V,get _fields(){return o},get _formValues(){return h},get _stateFlags(){return v},set _stateFlags(e){v=e},get _defaultValues(){return l},get _names(){return p},set _names(e){p=e},get _formState(){return s},set _formState(e){s=e},get _options(){return r},set _options(e){r={...r,...e}}},trigger:G,register:se,handleSubmit:(e,t)=>async a=>{a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let n=!0,i=te(h);w.state.next({isSubmitting:!0});try{if(r.resolver){const{errors:e,values:t}=await N();s.errors=e,i=t}else await M(o);S(s.errors)?(w.state.next({errors:{},isSubmitting:!0}),await e(i,a)):(t&&await t({...s.errors},a),r.shouldFocusError&&B(o,(e=>m(s.errors,e)),p.mount))}catch(e){throw n=!1,e}finally{s.isSubmitted=!0,w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:S(s.errors)&&n,submitCount:s.submitCount+1,errors:s.errors})}},watch:(e,t)=>O(e)?w.watch.subscribe({next:r=>e(P(void 0,t),r)}):P(e,t,!0),setValue:J,getValues:Q,reset:(t,r={})=>{const a=t||l,n=te(a),i=t&&!S(t)?n:l;if(r.keepDefaultValues||(l=a),!r.keepValues){if(r.keepDirtyValues)for(const e of p.mount)m(s.dirtyFields,e)?L(i,e,m(h,e)):J(e,m(i,e));else{if(ee&&d(t))for(const e of p.mount){const t=m(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;try{if(le(e)){e.closest("form").reset();break}}catch(e){}}}o={}}h=e.shouldUnregister?r.keepDefaultValues?te(l):{}:n,w.array.next({values:i}),w.watch.next({values:i})}p={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},v.mount=!V.isValid||!!r.keepIsValid,v.watch=!!e.shouldUnregister,w.state.next({submitCount:r.keepSubmitCount?s.submitCount:0,isDirty:r.keepDirty||r.keepDirtyValues?s.isDirty:!(!r.keepDefaultValues||oe(t,l)),isSubmitted:!!r.keepIsSubmitted&&s.isSubmitted,dirtyFields:r.keepDirty||r.keepDirtyValues?s.dirtyFields:r.keepDefaultValues&&t?me(l,t):{},touchedFields:r.keepTouched?s.touchedFields:{},errors:r.keepErrors?s.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},resetField:(e,t={})=>{m(o,e)&&(d(t.defaultValue)?J(e,m(l,e)):(J(e,t.defaultValue),L(l,e,t.defaultValue)),t.keepTouched||ae(s.touchedFields,e),t.keepDirty||(ae(s.dirtyFields,e),s.isDirty=t.defaultValue?U(e,m(l,e)):U()),t.keepError||(ae(s.errors,e),V.isValid&&D()),w.state.next({...s}))},clearErrors:e=>{e?k(e).forEach((e=>ae(s.errors,e))):s.errors={},w.state.next({errors:s.errors})},unregister:X,setError:(e,t,r)=>{const a=(m(o,e,{_f:{}})._f||{}).ref;L(s.errors,e,{...t,ref:a}),w.state.next({name:e,errors:s.errors,isValid:!1}),r&&r.shouldFocus&&a&&a.focus&&a.focus()},setFocus:(e,t={})=>{const r=m(o,e)._f,s=r.refs?r.refs[0]:r.ref;s.focus(),t.shouldSelect&&s.select()},getFieldState:K}}function _e(e={}){const t=s.useRef(),[r,a]=s.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touchedFields:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,errors:{}});t.current?t.current.control._options=e:t.current={...be(e),formState:r};const n=t.current.control,i=s.useCallback((e=>{F(e,n._proxyFormState,!0)&&(n._formState={...n._formState,...e},a({...n._formState}))}),[n]);return D({subject:n._subjects.state,callback:i}),s.useEffect((()=>{n._stateFlags.mount||(n._proxyFormState.isValid&&n._updateValid(),n._stateFlags.mount=!0),n._stateFlags.watch&&(n._stateFlags.watch=!1,n._subjects.state.next({})),n._removeUnmounted()})),t.current.formState=A(r,n._proxyFormState),t.current}},4593:(e,t,r)=>{r.d(t,{ZP:()=>l});var s=r(1672),a=r(5591),n=r(1753),i=r(1688);const o=Promise.resolve(),l=(0,n.xD)(a.ZP,(e=>(t,r,a)=>{const l=(0,s.useRef)(!1),{cache:u,initialSize:c=1,revalidateAll:f=!1,persistSize:d=!1,revalidateFirstPage:m=!0,revalidateOnMount:y=!1,parallel:h=!1}=a;let v;try{v=(e=>(0,n.qC)(e?e(0,null):null)[0])(t),v&&(v="$inf$"+v)}catch(e){}const[g,p,b]=(0,n.JN)(u,v),_=(0,s.useCallback)((()=>(0,n.o8)(g()._l)?c:g()._l),[u,v,c]);(0,i.useSyncExternalStore)((0,s.useCallback)((e=>v?b(v,(()=>{e()})):()=>{}),[u,v]),_,_);const V=(0,s.useCallback)((()=>{const e=g()._l;return(0,n.o8)(e)?c:e}),[v,c]),w=(0,s.useRef)(V());(0,n.LI)((()=>{l.current?v&&p({_l:d?w.current:V()}):l.current=!0}),[v,u]);const A=y&&!l.current,S=e(v,(async e=>{const s=g()._i,i=[],o=V(),[l]=(0,n.JN)(u,e),c=l().data,d=[];let y=null;for(let e=0;e<o;++e){const[o,l]=(0,n.qC)(t(e,h?null:y));if(!o)break;const[v,g]=(0,n.JN)(u,o);let p=v().data;const b=f||s||(0,n.o8)(p)||m&&!e&&!(0,n.o8)(c)||A||c&&!(0,n.o8)(c[e])&&!a.compare(c[e],p);if(r&&b){const t=async()=>{p=await r(l),g({data:p,_k:l}),i[e]=p};h?d.push(t):await t()}else i[e]=p;h||(y=p)}return h&&await Promise.all(d.map((e=>e()))),p({_i:n.i_}),i}),a),F=(0,s.useCallback)((function(e,t){const r="boolean"==typeof t?{revalidate:t}:t||{},s=!1!==r.revalidate;return v?(s&&((0,n.o8)(e)?p({_i:!0}):p({_i:!1})),arguments.length?S.mutate(e,{...r,revalidate:s}):S.mutate()):o}),[v,u]),k=(0,s.useCallback)((e=>{if(!v)return o;const[,r]=(0,n.JN)(u,v);let s;if((0,n.mf)(e)?s=e(V()):"number"==typeof e&&(s=e),"number"!=typeof s)return o;r({_l:s}),w.current=s;const a=[],[i]=(0,n.JN)(u,v);let l=null;for(let e=0;e<s;++e){const[r]=(0,n.qC)(t(e,l)),[s]=(0,n.JN)(u,r),o=r?s().data:n.i_;if((0,n.o8)(o))return F(i().data);a.push(o),l=o}return F(a)}),[v,u,F,V]);return{size:V(),setSize:k,mutate:F,get data(){return S.data},get error(){return S.error},get isValidating(){return S.isValidating},get isLoading(){return S.isLoading}}}))}}]);
package/dist/574.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[574],{3574:e=>{e.exports=JSON.parse('{"actions":"Actions","allFieldsRequired":"All fields are required unless marked optional","allForms":"All Forms","areYouSure":"Are you sure?","cancel":"Cancel","cancelExplanation":"You will lose any unsaved changes on the current form. Do you want to discard the current session?","changeGroup":"Choose a different group","chooseGroupError":"Please choose a group.","clearSearch":"Clear","complete":"Complete","createGroup":"Create Group","createNewGroup":"Create New Group","createNewPatient":"Create new patient","createNewSession":"Create New Session","discard":"Discard","error":"Error","errorCopy":"Sorry, there was an error. You can try to reload this page, or contact the site administrator and quote the error code above.","errorLoadingData":"Error Loading Data","fastDataEntry":"Fast Data Entry","fillForm":"Fill Form","findGroup":"Find group","formName":"Form Name","formsAppMenuLink":"Fast Data Entry","formsFilled":"Forms filled","goToForm":"Go To Form","groupNameError":"Please enter a group name.","identifier":"Identifier","markAbsentPatients":"The patients in this group. Patients that are not present in the session should be marked as absent.","members":"members","name":"Name","newGroupName":"New Group Name","newGroupSession":"New Group Session","nextPatient":"Next Patient","noFormsFound":"No Forms To Show","noFormsFoundMessage":"No forms could be found for this category. Please double check the form concept uuids and access permissions.","noGroupsFoundMessage":"Sorry, no groups have been found","noMoreResults":"End of search results","noPatientError":"Please enter at least one patient.","or":"or","orLabelName":"OR label name","patientIsPresent":"Patient is present","patientsInGroup":"Patients in group","postError":"POST Error","practitionerName":"Practitioner Name","remove":"Remove","resumeGroupSession":"Resume Group Session","resumeSession":"Resume Session","saveAndComplete":"Save & Complete","saveExplanation":"Do you want to save the current form and exit the workflow?","saveForm":"Save Form","saveSession":"Save Session","search":"Search","searchForGroup":"Search for a group by name","searchResultsText":"search result(s)","selectGroupFirst":"Please select a group first","selectPatientFirst":"Please select a patient first","sessionDate":"Session Date","sessionDetails":"1. Session details","sessionName":"Session Name","sessionNotes":"Session Notes","sessionParticipants":"2. Session participants","startGroupSession":"Start Group Session","trySearchWithPatientUniqueID":"Try searching with the cohort\'s description","unknown":"Unknown","unknownPostError":"An unknown error occured while saving data"}')}}]);
1
+ "use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[574],{3574:e=>{e.exports=JSON.parse('{"actions":"Actions","allFieldsRequired":"All fields are required unless marked optional","allForms":"All Forms","areYouSure":"Are you sure?","cancel":"Cancel","cancelExplanation":"You will lose any unsaved changes on the current form. Do you want to discard the current session?","changeGroup":"Choose a different group","chooseGroupError":"Please choose a group.","clearSearch":"Clear","complete":"Complete","createGroup":"Create Group","createNewGroup":"Create New Group","createNewPatient":"Create new patient","createNewSession":"Create New Session","discard":"Discard","editGroup":"Edit Group","error":"Error","errorCopy":"Sorry, there was an error. You can try to reload this page, or contact the site administrator and quote the error code above.","errorLoadingData":"Error Loading Data","fastDataEntry":"Fast Data Entry","fillForm":"Fill Form","findGroup":"Find group","formName":"Form Name","formsAppMenuLink":"Fast Data Entry","formsFilled":"Forms filled","goToForm":"Go To Form","groupNameError":"Please enter a group name.","identifier":"Identifier","markAbsentPatients":"The patients in this group. Patients that are not present in the session should be marked as absent.","members":"members","name":"Name","newGroupName":"New Group Name","newGroupSession":"New Group Session","nextPatient":"Next Patient","noFormsFound":"No Forms To Show","noFormsFoundMessage":"No forms could be found for this category. Please double check the form concept uuids and access permissions.","noGroupsFoundMessage":"Sorry, no groups have been found","noMoreResults":"End of search results","noPatientError":"Please enter at least one patient.","or":"or","orLabelName":"OR label name","patientIsPresent":"Patient is present","patientsInGroup":"Patients in group","postError":"POST Error","practitionerName":"Practitioner Name","remove":"Remove","resumeGroupSession":"Resume Group Session","resumeSession":"Resume Session","save":"Save","saveAndComplete":"Save & Complete","saveExplanation":"Do you want to save the current form and exit the workflow?","saveForm":"Save Form","saveSession":"Save Session","search":"Search","searchForGroup":"Search for a group by name","searchResultsText":"search result(s)","selectGroupFirst":"Please select a group first","selectPatientFirst":"Please select a patient first","sessionDate":"Session Date","sessionDetails":"1. Session details","sessionName":"Session Name","sessionNotes":"Session Notes","sessionParticipants":"2. Session participants","startGroupSession":"Start Group Session","trySearchWithPatientUniqueID":"Try searching with the cohort\'s description","unknown":"Unknown","unknownPostError":"An unknown error occurred while saving data"}')}}]);
package/dist/617.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[617],{5672:(t,e,r)=>{r.d(e,{AB:()=>p,ZP:()=>y,ol:()=>v});var n=r(1672),o=r.n(n),i=r(2126),u=r(1338),a=r(7612),l=r(1132);function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){s(t,e,r[e])}))}return t}var d={addPatient:function(t){},openPatientSearch:function(){},saveEncounter:function(t){},editEncounter:function(t){},submitForNext:function(){},submitForReview:function(){},submitForComplete:function(){},goToReview:function(){},destroySession:function(){},closeSession:function(){}},v={activeFormUuid:null,forms:{},workflowState:null,activePatientUuid:null,activeEncounterUuid:null,patientUuids:[],encounters:{},singleSessionVisitTypeUuid:null,userUuid:null},m=o().createContext(f({},v,d)),p=function(t){var e,r,s,p,y,b,w,h,U,S,E,O,g,P,F,T,_,I,k,j,A,R,N,C=t.children,x=(0,l.useSession)().user,M=(0,u.useParams)().formUuid.split("&")[0],D=(0,u.useLocation)().search,B=new URLSearchParams(D).get("patientUuid"),W=(j=(0,n.useReducer)(i.ZP,f({},v,d)),A=2,function(t){if(Array.isArray(t))return t}(j)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}}(j,A)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}(j,A)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),V=W[0],L=W[1],Z=(0,a.Z)("@openmrs/esm-fast-data-entry-app.groupSessionVisitTypeUuid"),$=null==Z||null===(e=Z.result)||void 0===e||null===(r=e.data)||void 0===r||null===(s=r.results)||void 0===s||null===(p=s[0])||void 0===p?void 0:p.value,G=(0,n.useMemo)((function(){return{initializeWorkflowState:function(t){var e=t.activeFormUuid,r=t.newPatientUuid;return L({type:"INITIALIZE_WORKFLOW_STATE",activeFormUuid:e,newPatientUuid:r,userUuid:x.uuid})},addPatient:function(t){return L({type:"ADD_PATIENT",patientUuid:t})},openPatientSearch:function(){return L({type:"OPEN_PATIENT_SEARCH"})},saveEncounter:function(t){return L({type:"SAVE_ENCOUNTER",encounterUuid:t})},submitForNext:function(){return L({type:"SUBMIT_FOR_NEXT"})},submitForReview:function(){return L({type:"SUBMIT_FOR_REVIEW"})},submitForComplete:function(){return L({type:"SUBMIT_FOR_COMPLETE"})},editEncounter:function(t){return L({type:"EDIT_ENCOUNTER",patientUuid:t})},goToReview:function(){return L({type:"GO_TO_REVIEW"})},destroySession:function(){return L({type:"DESTROY_SESSION"})},closeSession:function(){return L({type:"CLOSE_SESSION"})}}}),[x]);return(0,n.useEffect)((function(){null===(null==V?void 0:V.workflowState)&&M&&G.initializeWorkflowState({activeFormUuid:M,newPatientUuid:B})}),[M,B,null==V?void 0:V.workflowState,G]),o().createElement(m.Provider,{value:(R=f({},V,G),N={workflowState:null!==(F=null===(y=V.forms)||void 0===y||null===(b=y[V.activeFormUuid])||void 0===b?void 0:b.workflowState)&&void 0!==F?F:v.workflowState,activePatientUuid:null!==(T=null===(w=V.forms)||void 0===w||null===(h=w[V.activeFormUuid])||void 0===h?void 0:h.activePatientUuid)&&void 0!==T?T:v.activePatientUuid,activeEncounterUuid:null!==(_=null===(U=V.forms)||void 0===U||null===(S=U[V.activeFormUuid])||void 0===S?void 0:S.activeEncounterUuid)&&void 0!==_?_:v.activeEncounterUuid,patientUuids:null!==(I=null===(E=V.forms)||void 0===E||null===(O=E[V.activeFormUuid])||void 0===O?void 0:O.patientUuids)&&void 0!==I?I:v.patientUuids,encounters:null!==(k=null===(g=V.forms)||void 0===g||null===(P=g[V.activeFormUuid])||void 0===P?void 0:P.encounters)&&void 0!==k?k:v.encounters,singleSessionVisitTypeUuid:$},N=null!=N?N:{},Object.getOwnPropertyDescriptors?Object.defineProperties(R,Object.getOwnPropertyDescriptors(N)):function(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r.push.apply(r,n)}return r}(Object(N)).forEach((function(t){Object.defineProperty(R,t,Object.getOwnPropertyDescriptor(N,t))})),R)},C)};const y=m},2126:(t,e,r)=>{r.d(e,{Go:()=>v,IE:()=>d,ZP:()=>y});var n=r(1132),o=r(5672);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){u(t,e,r[e])}))}return t}function l(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r.push.apply(r,n)}return r}(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})),t}function c(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function s(t){var e=function(t,e){if("object"!==f(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===f(e)?e:String(e)}var f=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},d="1.1.0",v="openmrs:fastDataEntryWorkflowState",m=function(t){localStorage.setItem(v+":"+t.userUuid,JSON.stringify(t))},p={workflowState:"NEW_PATIENT",activePatientUuid:null,activeEncounterUuid:null,patientUuids:[],encounters:{}};const y=function(t,e){switch(e.type){case"INITIALIZE_WORKFLOW_STATE":var r,f=localStorage.getItem(v+":"+e.userUuid),y=f?JSON.parse(f):{},b={},w=e.newPatientUuid?{activePatientUuid:e.newPatientUuid,workflowState:"EDIT_FORM"}:{};return f&&y._storageVersion===d?(b=l(a({},y),{activeFormUuid:e.activeFormUuid,forms:l(a({},y.forms),u({},e.activeFormUuid,l(a({},p,y.forms[e.activeFormUuid],w),{patientUuids:(null===(r=y.forms[e.activeFormUuid])||void 0===r?void 0:r.patientUuids)||p.patientUuids})))}),e.newPatientUuid&&!b.forms[e.activeFormUuid].patientUuids.includes(e.newPatientUuid)&&b.forms[e.activeFormUuid].patientUuids.push(e.newPatientUuid)):b=l(a({},o.ol),{_storageVersion:d,forms:u({},e.activeFormUuid,p),activeFormUuid:e.activeFormUuid,userUuid:e.userUuid}),m(b),a({},b);case"ADD_PATIENT":var h=l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{patientUuids:(R=t.forms[t.activeFormUuid].patientUuids,function(t){if(Array.isArray(t))return i(t)}(R)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(R)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(R)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e.patientUuid]),activePatientUuid:e.patientUuid,activeEncounterUuid:null,workflowState:"EDIT_FORM"})))});return m(h),h;case"OPEN_PATIENT_SEARCH":var U=l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{activePatientUuid:null,activeEncounterUuid:null,workflowState:"NEW_PATIENT"})))});return m(U),U;case"SAVE_ENCOUNTER":if("SUBMIT_FOR_COMPLETE"===t.forms[t.activeFormUuid].workflowState){var S=t.forms,E=t.activeFormUuid,O=(S[E],c(S,[E].map(s))),g=l(a({},t),{forms:O,activeFormUuid:null});return m(g),(0,n.navigate)({to:"${openmrsSpaBase}/forms"}),g}var P=l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{encounters:l(a({},t.forms[t.activeFormUuid].encounters),u({},t.forms[t.activeFormUuid].activePatientUuid,e.encounterUuid)),activePatientUuid:null,activeEncounterUuid:null,workflowState:"SUBMIT_FOR_NEXT"===t.forms[t.activeFormUuid].workflowState?"NEW_PATIENT":"SUBMIT_FOR_REVIEW"===t.forms[t.activeFormUuid].workflowState?"REVIEW":t.forms[t.activeFormUuid].workflowState})))});return m(P),P;case"EDIT_ENCOUNTER":var F=l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{activeEncounterUuid:t.forms[t.activeFormUuid].encounters[e.patientUuid],activePatientUuid:e.patientUuid,workflowState:"EDIT_FORM"})))});return m(F),F;case"SUBMIT_FOR_NEXT":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{workflowState:"SUBMIT_FOR_NEXT"})))});case"SUBMIT_FOR_REVIEW":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{workflowState:"SUBMIT_FOR_REVIEW"})))});case"SUBMIT_FOR_COMPLETE":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{workflowState:"SUBMIT_FOR_COMPLETE"})))});case"GO_TO_REVIEW":var T=l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{activeEncounterUuid:null,activePatientUuid:null,workflowState:"REVIEW"})))});return m(T),T;case"DESTROY_SESSION":var _=t.forms,I=t.activeFormUuid,k=(_[I],c(_,[I].map(s))),j=l(a({},t),{forms:k,activeFormUuid:null});return m(j),(0,n.navigate)({to:"${openmrsSpaBase}/forms"}),j;case"CLOSE_SESSION":var A=l(a({},t),{activeFormUuid:null});return m(A),(0,n.navigate)({to:"${openmrsSpaBase}/forms"}),A;default:return t}var R}},282:(t,e,r)=>{r.d(e,{wJ:()=>f,lQ:()=>y,Eu:()=>d.Z,zg:()=>S});var n=r(1132),o=r(821);function i(t,e,r,n,o,i,u){try{var a=t[i](u),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var u=t.apply(e,r);function a(t){i(u,n,o,a,l,"next",t)}function l(t){i(u,n,o,a,l,"throw",t)}a(void 0)}))}}var a=function(t,e){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},l="(uuid,name,display,encounterType:(uuid,name,viewPrivilege,editPrivilege),version,published,retired,resources:(uuid,name,dataType,valueReference))",c="/ws/rest/v1/form?v=custom:".concat(l),s="/ws/rest/v1/form?v=custom:".concat(l,"&q=poc");const f=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=(0,n.useSession)(),r=!0,i=r?c:s,l=(0,o.ZP)([i,t],u((function(){var t,e,r,o;return a(this,(function(u){switch(u.label){case 0:return[4,(0,n.openmrsFetch)(i)];case 1:return r=u.sent(),[2,null!==(o=null===(t=r.data)||void 0===t||null===(e=t.results)||void 0===e?void 0:e.filter((function(t){return t.published&&!/component/i.test(t.name)})))&&void 0!==o?o:[]]}}))}))),f=l.data,d=l.error;return{forms:null==f?void 0:f.filter((function(t){var r,o;return Boolean((0,n.userHasAccess)(null===(r=t.encounterType)||void 0===r||null===(o=r.editPrivilege)||void 0===o?void 0:o.display,null==e?void 0:e.user))})),isLoading:!d&&!f,error:d}};var d=r(4439),v=r(1672);function m(t,e,r,n,o,i,u){try{var a=t[i](u),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(n,o)}function p(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function u(t){m(i,n,o,u,a,"next",t)}function a(t){m(i,n,o,u,a,"throw",t)}u(void 0)}))}}const y=function(t){var e="".concat("/ws/rest/v1/encounter/").concat(t),r=(0,o.ZP)(e,p((function(){return function(t,e){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(t){switch(t.label){case 0:return[4,(0,n.openmrsFetch)(e)];case 1:return[2,t.sent().data||null]}}))}))),i=r.data,u=r.error;return{encounter:i,isLoading:!u&&i,error:u}};function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function w(t,e,r,n,o,i,u){try{var a=t[i](u),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(n,o)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return b(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var U=function(t){var e,r,o=t.endpointUrl,i=h((0,v.useState)(null),2),u=i[0],a=i[1],l=h((0,v.useState)(null),2),c=l[0],s=l[1],f=h((0,v.useState)(null),2),d=f[0],m=f[1],p=(0,v.useCallback)((function(t){a(!1),d&&m(null),s(t.data)}),[d]),y=(0,v.useCallback)((function(t){var e,r,n;a(!1),c&&s(null),m(null!==(n=null!==(r=null==t||null===(e=t.responseBody)||void 0===e?void 0:e.error)&&void 0!==r?r:null==t?void 0:t.responseBody)&&void 0!==n?n:t)}),[c]),b=(0,v.useCallback)((e=function(t){var e;return function(t,e){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(r){return a(!0),e={},[2,(0,n.openmrsFetch)(o,(e.method="POST",e.headers={"Content-Type":"application/json"},e.body=t,e)).then(p).catch(y)]}))},r=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(t){w(i,n,o,u,a,"next",t)}function a(t){w(i,n,o,u,a,"throw",t)}u(void 0)}))},function(t){return r.apply(this,arguments)}),[o,y,p]);return{post:b,isPosting:u,result:c,error:d,reset:function(){a(null),s(null),m(null)}}},S=function(){return U({endpointUrl:"/ws/rest/v1/cohortm/cohort"})}},4439:(t,e,r)=>{r.d(e,{Z:()=>a});var n=r(1132),o=r(1672);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e,r,n,o,i,u){try{var a=t[i](u),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(n,o)}const a=function(t){var e,r,a=(e=(0,o.useState)(null),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}}(e,r)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=a[0],c=a[1];(0,o.useEffect)((function(){t?d(t):c(null)}),[t]);var s,f,d=(s=function(t){var e;return function(t,e){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(r){switch(r.label){case 0:return[4,(0,n.fetchCurrentPatient)(t)];case 1:return e=r.sent(),c(e),[2]}}))},f=function(){var t=this,e=arguments;return new Promise((function(r,n){var o=s.apply(t,e);function i(t){u(o,r,n,i,a,"next",t)}function a(t){u(o,r,n,i,a,"throw",t)}i(void 0)}))},function(t){return f.apply(this,arguments)});return l}},7612:(t,e,r)=>{r.d(e,{Z:()=>a});var n=r(1672),o=r(1132);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const a=function(t){var e=u((0,n.useState)(!1),2),r=e[0],i=e[1],a=u((0,n.useState)(null),2),l=a[0],c=a[1],s=u((0,n.useState)(null),2),f=s[0],d=s[1],v=(0,n.useCallback)((function(t){i(!1),d(!1),c(t)}),[]),m=(0,n.useCallback)((function(t){i(!1),c(null),d(t)}),[]),p=(0,n.useCallback)((function(){(0,o.openmrsFetch)("/ws/rest/v1/systemsetting?q=".concat(t,"&v=default")).then(v).catch(m)}),[m,v,t]);return(0,n.useEffect)((function(){p()}),[p]),{result:l,error:f,isSubmitting:r}}}}]);
1
+ "use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[617],{5672:(t,e,r)=>{r.d(e,{AB:()=>p,ZP:()=>y,ol:()=>v});var n=r(1672),o=r.n(n),i=r(2126),u=r(1338),a=r(7612),l=r(1132);function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){s(t,e,r[e])}))}return t}var d={addPatient:function(t){},openPatientSearch:function(){},saveEncounter:function(t){},editEncounter:function(t){},submitForNext:function(){},submitForReview:function(){},submitForComplete:function(){},goToReview:function(){},destroySession:function(){},closeSession:function(){}},v={activeFormUuid:null,forms:{},workflowState:null,activePatientUuid:null,activeEncounterUuid:null,patientUuids:[],encounters:{},singleSessionVisitTypeUuid:null,userUuid:null},m=o().createContext(f({},v,d)),p=function(t){var e,r,s,p,y,b,w,h,U,S,E,O,g,P,F,T,_,I,k,j,A,R,N,C=t.children,x=(0,l.useSession)().user,M=(0,u.useParams)().formUuid.split("&")[0],D=(0,u.useLocation)().search,B=new URLSearchParams(D).get("patientUuid"),W=(j=(0,n.useReducer)(i.ZP,f({},v,d)),A=2,function(t){if(Array.isArray(t))return t}(j)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}}(j,A)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}(j,A)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),V=W[0],L=W[1],Z=(0,a.Z)("@openmrs/esm-fast-data-entry-app.groupSessionVisitTypeUuid"),$=null==Z||null===(e=Z.result)||void 0===e||null===(r=e.data)||void 0===r||null===(s=r.results)||void 0===s||null===(p=s[0])||void 0===p?void 0:p.value,G=(0,n.useMemo)((function(){return{initializeWorkflowState:function(t){var e=t.activeFormUuid,r=t.newPatientUuid;return L({type:"INITIALIZE_WORKFLOW_STATE",activeFormUuid:e,newPatientUuid:r,userUuid:x.uuid})},addPatient:function(t){return L({type:"ADD_PATIENT",patientUuid:t})},openPatientSearch:function(){return L({type:"OPEN_PATIENT_SEARCH"})},saveEncounter:function(t){return L({type:"SAVE_ENCOUNTER",encounterUuid:t})},submitForNext:function(){return L({type:"SUBMIT_FOR_NEXT"})},submitForReview:function(){return L({type:"SUBMIT_FOR_REVIEW"})},submitForComplete:function(){return L({type:"SUBMIT_FOR_COMPLETE"})},editEncounter:function(t){return L({type:"EDIT_ENCOUNTER",patientUuid:t})},goToReview:function(){return L({type:"GO_TO_REVIEW"})},destroySession:function(){return L({type:"DESTROY_SESSION"})},closeSession:function(){return L({type:"CLOSE_SESSION"})}}}),[x]);return(0,n.useEffect)((function(){null===(null==V?void 0:V.workflowState)&&M&&G.initializeWorkflowState({activeFormUuid:M,newPatientUuid:B})}),[M,B,null==V?void 0:V.workflowState,G]),o().createElement(m.Provider,{value:(R=f({},V,G),N={workflowState:null!==(F=null===(y=V.forms)||void 0===y||null===(b=y[V.activeFormUuid])||void 0===b?void 0:b.workflowState)&&void 0!==F?F:v.workflowState,activePatientUuid:null!==(T=null===(w=V.forms)||void 0===w||null===(h=w[V.activeFormUuid])||void 0===h?void 0:h.activePatientUuid)&&void 0!==T?T:v.activePatientUuid,activeEncounterUuid:null!==(_=null===(U=V.forms)||void 0===U||null===(S=U[V.activeFormUuid])||void 0===S?void 0:S.activeEncounterUuid)&&void 0!==_?_:v.activeEncounterUuid,patientUuids:null!==(I=null===(E=V.forms)||void 0===E||null===(O=E[V.activeFormUuid])||void 0===O?void 0:O.patientUuids)&&void 0!==I?I:v.patientUuids,encounters:null!==(k=null===(g=V.forms)||void 0===g||null===(P=g[V.activeFormUuid])||void 0===P?void 0:P.encounters)&&void 0!==k?k:v.encounters,singleSessionVisitTypeUuid:$},N=null!=N?N:{},Object.getOwnPropertyDescriptors?Object.defineProperties(R,Object.getOwnPropertyDescriptors(N)):function(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r.push.apply(r,n)}return r}(Object(N)).forEach((function(t){Object.defineProperty(R,t,Object.getOwnPropertyDescriptor(N,t))})),R)},C)};const y=m},2126:(t,e,r)=>{r.d(e,{Go:()=>v,IE:()=>d,ZP:()=>y});var n=r(1132),o=r(5672);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){u(t,e,r[e])}))}return t}function l(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r.push.apply(r,n)}return r}(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})),t}function c(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function s(t){var e=function(t,e){if("object"!==f(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===f(e)?e:String(e)}var f=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},d="1.1.0",v="openmrs:fastDataEntryWorkflowState",m=function(t){localStorage.setItem(v+":"+t.userUuid,JSON.stringify(t))},p={workflowState:"NEW_PATIENT",activePatientUuid:null,activeEncounterUuid:null,patientUuids:[],encounters:{}};const y=function(t,e){switch(e.type){case"INITIALIZE_WORKFLOW_STATE":var r,f=localStorage.getItem(v+":"+e.userUuid),y=f?JSON.parse(f):{},b={},w=e.newPatientUuid?{activePatientUuid:e.newPatientUuid,workflowState:"EDIT_FORM"}:{};return f&&y._storageVersion===d?(b=l(a({},y),{activeFormUuid:e.activeFormUuid,forms:l(a({},y.forms),u({},e.activeFormUuid,l(a({},p,y.forms[e.activeFormUuid],w),{patientUuids:(null===(r=y.forms[e.activeFormUuid])||void 0===r?void 0:r.patientUuids)||p.patientUuids})))}),e.newPatientUuid&&!b.forms[e.activeFormUuid].patientUuids.includes(e.newPatientUuid)&&b.forms[e.activeFormUuid].patientUuids.push(e.newPatientUuid)):b=l(a({},o.ol),{_storageVersion:d,forms:u({},e.activeFormUuid,p),activeFormUuid:e.activeFormUuid,userUuid:e.userUuid}),m(b),a({},b);case"ADD_PATIENT":var h=l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{patientUuids:(R=t.forms[t.activeFormUuid].patientUuids,function(t){if(Array.isArray(t))return i(t)}(R)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(R)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(R)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e.patientUuid]),activePatientUuid:e.patientUuid,activeEncounterUuid:null,workflowState:"EDIT_FORM"})))});return m(h),h;case"OPEN_PATIENT_SEARCH":var U=l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{activePatientUuid:null,activeEncounterUuid:null,workflowState:"NEW_PATIENT"})))});return m(U),U;case"SAVE_ENCOUNTER":if("SUBMIT_FOR_COMPLETE"===t.forms[t.activeFormUuid].workflowState){var S=t.forms,E=t.activeFormUuid,O=(S[E],c(S,[E].map(s))),g=l(a({},t),{forms:O,activeFormUuid:null});return m(g),(0,n.navigate)({to:"${openmrsSpaBase}/forms"}),g}var P=l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{encounters:l(a({},t.forms[t.activeFormUuid].encounters),u({},t.forms[t.activeFormUuid].activePatientUuid,e.encounterUuid)),activePatientUuid:null,activeEncounterUuid:null,workflowState:"SUBMIT_FOR_NEXT"===t.forms[t.activeFormUuid].workflowState?"NEW_PATIENT":"SUBMIT_FOR_REVIEW"===t.forms[t.activeFormUuid].workflowState?"REVIEW":t.forms[t.activeFormUuid].workflowState})))});return m(P),P;case"EDIT_ENCOUNTER":var F=l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{activeEncounterUuid:t.forms[t.activeFormUuid].encounters[e.patientUuid],activePatientUuid:e.patientUuid,workflowState:"EDIT_FORM"})))});return m(F),F;case"SUBMIT_FOR_NEXT":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{workflowState:"SUBMIT_FOR_NEXT"})))});case"SUBMIT_FOR_REVIEW":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{workflowState:"SUBMIT_FOR_REVIEW"})))});case"SUBMIT_FOR_COMPLETE":return window.dispatchEvent(new CustomEvent("ampath-form-action",{detail:{formUuid:t.activeFormUuid,patientUuid:t.forms[t.activeFormUuid].activePatientUuid,action:"onSubmit"}})),l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{workflowState:"SUBMIT_FOR_COMPLETE"})))});case"GO_TO_REVIEW":var T=l(a({},t),{forms:l(a({},t.forms),u({},t.activeFormUuid,l(a({},t.forms[t.activeFormUuid]),{activeEncounterUuid:null,activePatientUuid:null,workflowState:"REVIEW"})))});return m(T),T;case"DESTROY_SESSION":var _=t.forms,I=t.activeFormUuid,k=(_[I],c(_,[I].map(s))),j=l(a({},t),{forms:k,activeFormUuid:null});return m(j),(0,n.navigate)({to:"${openmrsSpaBase}/forms"}),j;case"CLOSE_SESSION":var A=l(a({},t),{activeFormUuid:null});return m(A),(0,n.navigate)({to:"${openmrsSpaBase}/forms"}),A;default:return t}var R}},282:(t,e,r)=>{r.d(e,{wJ:()=>f,lQ:()=>y,Eu:()=>d.Z,zg:()=>S});var n=r(1132),o=r(5591);function i(t,e,r,n,o,i,u){try{var a=t[i](u),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(n,o)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var u=t.apply(e,r);function a(t){i(u,n,o,a,l,"next",t)}function l(t){i(u,n,o,a,l,"throw",t)}a(void 0)}))}}var a=function(t,e){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},l="(uuid,name,display,encounterType:(uuid,name,viewPrivilege,editPrivilege),version,published,retired,resources:(uuid,name,dataType,valueReference))",c="/ws/rest/v1/form?v=custom:".concat(l),s="/ws/rest/v1/form?v=custom:".concat(l,"&q=poc");const f=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=(0,n.useSession)(),r=!0,i=r?c:s,l=(0,o.ZP)([i,t],u((function(){var t,e,r,o;return a(this,(function(u){switch(u.label){case 0:return[4,(0,n.openmrsFetch)(i)];case 1:return r=u.sent(),[2,null!==(o=null===(t=r.data)||void 0===t||null===(e=t.results)||void 0===e?void 0:e.filter((function(t){return t.published&&!/component/i.test(t.name)})))&&void 0!==o?o:[]]}}))}))),f=l.data,d=l.error;return{forms:null==f?void 0:f.filter((function(t){var r,o;return Boolean((0,n.userHasAccess)(null===(r=t.encounterType)||void 0===r||null===(o=r.editPrivilege)||void 0===o?void 0:o.display,null==e?void 0:e.user))})),isLoading:!d&&!f,error:d}};var d=r(4439),v=r(1672);function m(t,e,r,n,o,i,u){try{var a=t[i](u),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(n,o)}function p(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function u(t){m(i,n,o,u,a,"next",t)}function a(t){m(i,n,o,u,a,"throw",t)}u(void 0)}))}}const y=function(t){var e="".concat("/ws/rest/v1/encounter/").concat(t),r=(0,o.ZP)(e,p((function(){return function(t,e){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(t){switch(t.label){case 0:return[4,(0,n.openmrsFetch)(e)];case 1:return[2,t.sent().data||null]}}))}))),i=r.data,u=r.error;return{encounter:i,isLoading:!u&&i,error:u}};function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function w(t,e,r,n,o,i,u){try{var a=t[i](u),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(n,o)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return b(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var U=function(t){var e,r,o=t.endpointUrl,i=h((0,v.useState)(null),2),u=i[0],a=i[1],l=h((0,v.useState)(null),2),c=l[0],s=l[1],f=h((0,v.useState)(null),2),d=f[0],m=f[1],p=(0,v.useCallback)((function(t){a(!1),d&&m(null),s(t.data)}),[d]),y=(0,v.useCallback)((function(t){var e,r,n;a(!1),c&&s(null),m(null!==(n=null!==(r=null==t||null===(e=t.responseBody)||void 0===e?void 0:e.error)&&void 0!==r?r:null==t?void 0:t.responseBody)&&void 0!==n?n:t)}),[c]),b=(0,v.useCallback)((e=function(t){var e,r;return function(t,e){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(i){return a(!0),e=o,t.uuid&&(e+="/"+t.uuid),r={},[2,(0,n.openmrsFetch)(e,(r.method="POST",r.headers={"Content-Type":"application/json"},r.body=t,r)).then(p).catch(y)]}))},r=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(t){w(i,n,o,u,a,"next",t)}function a(t){w(i,n,o,u,a,"throw",t)}u(void 0)}))},function(t){return r.apply(this,arguments)}),[o,y,p]);return{post:b,isPosting:u,result:c,error:d,reset:function(){a(null),s(null),m(null)}}},S=function(){return U({endpointUrl:"/ws/rest/v1/cohortm/cohort"})}},4439:(t,e,r)=>{r.d(e,{Z:()=>a});var n=r(1132),o=r(1672);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e,r,n,o,i,u){try{var a=t[i](u),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(n,o)}const a=function(t){var e,r,a=(e=(0,o.useState)(null),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}}(e,r)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=a[0],c=a[1];(0,o.useEffect)((function(){t?d(t):c(null)}),[t]);var s,f,d=(s=function(t){var e;return function(t,e){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(r){switch(r.label){case 0:return[4,(0,n.fetchCurrentPatient)(t)];case 1:return e=r.sent(),c(e),[2]}}))},f=function(){var t=this,e=arguments;return new Promise((function(r,n){var o=s.apply(t,e);function i(t){u(o,r,n,i,a,"next",t)}function a(t){u(o,r,n,i,a,"throw",t)}i(void 0)}))},function(t){return f.apply(this,arguments)});return l}},7612:(t,e,r)=>{r.d(e,{Z:()=>a});var n=r(1672),o=r(1132);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const a=function(t){var e=u((0,n.useState)(!1),2),r=e[0],i=e[1],a=u((0,n.useState)(null),2),l=a[0],c=a[1],s=u((0,n.useState)(null),2),f=s[0],d=s[1],v=(0,n.useCallback)((function(t){i(!1),d(!1),c(t)}),[]),m=(0,n.useCallback)((function(t){i(!1),c(null),d(t)}),[]),p=(0,n.useCallback)((function(){(0,o.openmrsFetch)("/ws/rest/v1/systemsetting?q=".concat(t,"&v=default")).then(v).catch(m)}),[m,v,t]);return(0,n.useEffect)((function(){p()}),[p]),{result:l,error:f,isSubmitting:r}}}}]);
package/dist/656.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 656.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[656],{3645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var s=0;s<e.length;s++){var u=[].concat(e[s]);r&&o[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),t.push(u))}},t}},3379:e=>{var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var i={},a=[],s=0;s<e.length;s++){var u=e[s],c=r.base?u[0]+r.base:u[0],l=i[c]||0,d="".concat(c," ").concat(l);i[c]=l+1;var f=n(d),p={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==f)t[f].references++,t[f].updater(p);else{var v=o(p,r);r.byIndex=s,t.splice(s,0,{identifier:d,updater:v,references:1})}a.push(d)}return a}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var a=0;a<i.length;a++){var s=n(i[a]);t[s].references--}for(var u=r(e,o),c=0;c<i.length;c++){var l=n(i[c]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}i=u}}},569:e=>{var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},9216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},3565:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7795:e=>{e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},4589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},3250:(e,t,n)=>{var r=n(1672),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,s=r.useLayoutEffect,u=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,l=r[1];return s((function(){o.value=n,o.getSnapshot=t,c(o)&&l({inst:o})}),[e,n,t]),a((function(){return c(o)&&l({inst:o}),e((function(){c(o)&&l({inst:o})}))}),[e]),u(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l},1688:(e,t,n)=>{e.exports=n(3250)},1753:(e,t,n)=>{n.d(t,{$l:()=>c,BN:()=>M,DY:()=>o,J$:()=>q,JN:()=>g,LI:()=>L,PM:()=>f,W6:()=>O,i_:()=>u,ko:()=>z,kw:()=>C,mf:()=>d,o8:()=>l,qC:()=>x,s6:()=>Z,sj:()=>I,u3:()=>D,u_:()=>W,w6:()=>S,xD:()=>G});var r=n(1672);const o=new WeakMap,i={},a={},s=()=>{},u=s(),c=Object,l=e=>e===u,d=e=>"function"==typeof e,f=(e,t)=>({...e,...t}),p="undefined",v=typeof window!=p,h=typeof document!=p,g=(e,t)=>{const n=o.get(e);return[()=>!l(t)&&e.get(t)||i,r=>{if(!l(t)){const o=e.get(t);t in a||(a[t]=o),n[5](t,f(o,r),o||i)}},n[6],()=>!l(t)&&t in a?a[t]:!l(t)&&e.get(t)||i]},m=new WeakMap;let E=0;const y=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(c(e)!==e||r||n==RegExp)o=r?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(o=m.get(e),o)return o;if(o=++E+"~",m.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=y(e[i])+",";m.set(e,o)}if(n==c){o="#";const t=c.keys(e).sort();for(;!l(i=t.pop());)l(e[i])||(o+=i+":"+y(e[i])+",");m.set(e,o)}}return o};let w=!0;const[_,b]=v&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[s,s],T={isOnline:()=>w,isVisible:()=>{const e=h&&document.visibilityState;return l(e)||"hidden"!==e}},R={initFocus:e=>(h&&document.addEventListener("visibilitychange",e),_("focus",e),()=>{h&&document.removeEventListener("visibilitychange",e),b("focus",e)}),initReconnect:e=>{const t=()=>{w=!0,e()},n=()=>{w=!1};return _("online",t),_("offline",n),()=>{b("online",t),b("offline",n)}}},S=!r.useId,O=!v||"Deno"in window,C=e=>v&&typeof window.requestAnimationFrame!=p?window.requestAnimationFrame(e):setTimeout(e,1),L=O?r.useEffect:r.useLayoutEffect,V="undefined"!=typeof navigator&&navigator.connection,k=!O&&V&&(["slow-2g","2g"].includes(V.effectiveType)||V.saveData),x=e=>{if(d(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?y(e):"",t]};let N=0;const D=()=>++N;var I={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:0,MUTATE_EVENT:2,RECONNECT_EVENT:1};async function M(...e){const[t,n,r,i]=e,a=f({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{});let s=a.populateCache;const c=a.rollbackOnError;let p=a.optimisticData;const v=!1!==a.revalidate,h=a.throwOnError;if(d(n)){const e=n,r=[],o=t.keys();for(let n=o.next();!n.done;n=o.next()){const o=n.value;!/^\$(inf|sub)\$/.test(o)&&e(t.get(o)._k)&&r.push(o)}return Promise.all(r.map(m))}return m(n);async function m(n){const[i]=x(n);if(!i)return;const[a,f]=g(t,i),[m,E,y]=o.get(t),w=m[i],_=()=>v&&(delete y[i],w&&w[0])?w[0](2).then((()=>a().data)):a().data;if(e.length<3)return _();let b,T=r;const R=D();E[i]=[R,0];const S=!l(p),O=a(),C=O.data,L=O._c,V=l(L)?C:L;if(S&&(p=d(p)?p(V):p,f({data:p,_c:V})),d(T))try{T=T(V)}catch(e){b=e}if(T&&d(T.then)){if(T=await T.catch((e=>{b=e})),R!==E[i][0]){if(b)throw b;return T}b&&S&&(e=>"function"==typeof c?c(e):!1!==c)(b)&&(s=!0,T=V,f({data:T,_c:u}))}s&&(b||(d(s)&&(T=s(T,V)),f({data:T,_c:u}))),E[i][1]=D();const k=await _();if(f({_c:u}),!b)return s?k:T;if(h)throw b}}const A=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},P=(e,t)=>{if(!o.has(e)){const n=f(R,t),r={},i=M.bind(u,e);let a=s;const c={},l=(e,t)=>{const n=c[e]||[];return c[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},d=(t,n,r)=>{e.set(t,n);const o=c[t];if(o)for(const e of o)e(n,r)},p=()=>{if(!o.has(e)&&(o.set(e,[r,{},{},{},i,d,l]),!O)){const t=n.initFocus(setTimeout.bind(u,A.bind(u,r,0))),i=n.initReconnect(setTimeout.bind(u,A.bind(u,r,1)));a=()=>{t&&t(),i&&i(),o.delete(e)}}};return p(),[e,i,p,a]}return[e,o.get(e)[4]]},[j,F]=P(new Map),W=f({onLoadingSlow:s,onSuccess:s,onError:s,onErrorRetry:(e,t,n,r,o)=>{const i=n.errorRetryCount,a=o.retryCount,s=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!l(i)&&a>i||setTimeout(r,s,o)},onDiscarded:s,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:k?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:k?5e3:3e3,compare:(e,t)=>y(e)==y(t),isPaused:()=>!1,cache:j,mutate:F,fallback:{}},T),U=(e,t)=>{const n=f(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:a}=t;r&&i&&(n.use=r.concat(i)),o&&a&&(n.fallback=f(o,a))}return n},J=(0,r.createContext)({}),q=e=>{const{value:t}=e,n=(0,r.useContext)(J),o=d(t),i=(0,r.useMemo)((()=>o?t(n):t),[o,n,t]),a=(0,r.useMemo)((()=>o?i:U(n,i)),[o,n,i]),s=i&&i.provider,c=(0,r.useRef)(u);s&&!c.current&&(c.current=P(s(a.cache||j),i));const l=c.current;return l&&(a.cache=l[0],a.mutate=l[1]),L((()=>{if(l)return l[2]&&l[2](),l[3]}),[]),(0,r.createElement)(J.Provider,f(e,{value:a}))},$=v&&window.__SWR_DEVTOOLS_USE__,H=$?window.__SWR_DEVTOOLS_USE__:[],B=e=>d(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],Y=H.concat((e=>(t,n,r)=>e(t,n&&((...e)=>{const[r]=x(t),[,,,i]=o.get(j),a=i[r];return a?(delete i[r],a):n(...e)}),r))),Z=e=>function(...t){const n=f(W,(0,r.useContext)(J)),[o,i,a]=B(t),s=U(n,a);let u=e;const{use:c}=s,l=(c||[]).concat(Y);for(let e=l.length;e--;)u=l[e](u);return u(o,i||s.fetcher||null,s)},z=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}},G=(e,t)=>(...n)=>{const[r,o,i]=B(n),a=(i.use||[]).concat(t);return e(r,o,{...i,use:a})};$&&(window.__SWR_DEVTOOLS_REACT__=r)},5591:(e,t,n)=>{n.d(t,{ZP:()=>s});var r=n(1672),o=n(1688),i=n(1753);const a={dedupe:!0},s=(i.$l.defineProperty(i.J$,"defaultValue",{value:i.u_}),(0,i.s6)(((e,t,n)=>{const{cache:s,compare:u,suspense:c,fallbackData:l,revalidateOnMount:d,revalidateIfStale:f,refreshInterval:p,refreshWhenHidden:v,refreshWhenOffline:h,keepPreviousData:g}=n,[m,E,y]=i.DY.get(s),[w,_]=(0,i.qC)(e),b=(0,r.useRef)(!1),T=(0,r.useRef)(!1),R=(0,r.useRef)(w),S=(0,r.useRef)(t),O=(0,r.useRef)(n),C=()=>O.current,L=()=>C().isVisible()&&C().isOnline(),[V,k,x,N]=(0,i.JN)(s,w),D=(0,r.useRef)({}).current,I=(0,i.o8)(l)?n.fallback[w]:l,M=(e,t)=>{for(const n in D){const r=n;if("data"===r){if(!u(e[r],t[r])){if(!(0,i.o8)(e[r]))return!1;if(!u($,t[r]))return!1}}else if(t[r]!==e[r])return!1}return!0},A=(0,r.useMemo)((()=>{const e=!!w&&!!t&&((0,i.o8)(d)?!C().isPaused()&&!c&&(!!(0,i.o8)(f)||f):d),n=t=>{const n=(0,i.PM)(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n},r=V(),o=N(),a=n(r),s=r===o?a:n(o);let u=a;return[()=>{const e=n(V());return M(e,u)?(u.data=e.data,u.isLoading=e.isLoading,u.isValidating=e.isValidating,u.error=e.error,u):(u=e,e)},()=>s]}),[s,w]),P=(0,o.useSyncExternalStore)((0,r.useCallback)((e=>x(w,((t,n)=>{M(n,t)||e()}))),[s,w]),A[0],A[1]),j=!b.current,F=m[w]&&m[w].length>0,W=P.data,U=(0,i.o8)(W)?I:W,J=P.error,q=(0,r.useRef)(U),$=g?(0,i.o8)(W)?q.current:W:U,H=!(F&&!(0,i.o8)(J))&&(j&&!(0,i.o8)(d)?d:!C().isPaused()&&(c?!(0,i.o8)(U)&&f:(0,i.o8)(U)||f)),B=!!(w&&t&&j&&H),Y=(0,i.o8)(P.isValidating)?B:P.isValidating,Z=(0,i.o8)(P.isLoading)?B:P.isLoading,z=(0,r.useCallback)((async e=>{const t=S.current;if(!w||!t||T.current||C().isPaused())return!1;let r,o,a=!0;const s=e||{},c=!y[w]||!s.dedupe,l=()=>i.w6?!T.current&&w===R.current&&b.current:w===R.current,d={isValidating:!1,isLoading:!1},f=()=>{k(d)},p=()=>{const e=y[w];e&&e[1]===o&&delete y[w]},v={isValidating:!0};(0,i.o8)(V().data)&&(v.isLoading=!0);try{if(c&&(k(v),n.loadingTimeout&&(0,i.o8)(V().data)&&setTimeout((()=>{a&&l()&&C().onLoadingSlow(w,n)}),n.loadingTimeout),y[w]=[t(_),(0,i.u3)()]),[r,o]=y[w],r=await r,c&&setTimeout(p,n.dedupingInterval),!y[w]||y[w][1]!==o)return c&&l()&&C().onDiscarded(w),!1;d.error=i.i_;const e=E[w];if(!(0,i.o8)(e)&&(o<=e[0]||o<=e[1]||0===e[1]))return f(),c&&l()&&C().onDiscarded(w),!1;const s=V().data;d.data=u(s,r)?s:r,c&&l()&&C().onSuccess(r,w,n)}catch(e){p();const t=C(),{shouldRetryOnError:n}=t;t.isPaused()||(d.error=e,c&&l()&&(t.onError(e,w,t),(!0===n||(0,i.mf)(n)&&n(e))&&L()&&t.onErrorRetry(e,w,t,(e=>{const t=m[w];t&&t[0]&&t[0](i.sj.ERROR_REVALIDATE_EVENT,e)}),{retryCount:(s.retryCount||0)+1,dedupe:!0})))}return a=!1,f(),!0}),[w,s]),G=(0,r.useCallback)(((...e)=>(0,i.BN)(s,R.current,...e)),[]);if((0,i.LI)((()=>{S.current=t,O.current=n,(0,i.o8)(W)||(q.current=W)})),(0,i.LI)((()=>{if(!w)return;const e=z.bind(i.i_,a);let t=0;const n=(0,i.ko)(w,m,((n,r={})=>{if(n==i.sj.FOCUS_EVENT){const n=Date.now();C().revalidateOnFocus&&n>t&&L()&&(t=n+C().focusThrottleInterval,e())}else if(n==i.sj.RECONNECT_EVENT)C().revalidateOnReconnect&&L()&&e();else{if(n==i.sj.MUTATE_EVENT)return z();if(n==i.sj.ERROR_REVALIDATE_EVENT)return z(r)}}));return T.current=!1,R.current=w,b.current=!0,k({_k:_}),H&&((0,i.o8)(U)||i.W6?e():(0,i.kw)(e)),()=>{T.current=!0,n()}}),[w]),(0,i.LI)((()=>{let e;function t(){const t=(0,i.mf)(p)?p(V().data):p;t&&-1!==e&&(e=setTimeout(n,t))}function n(){V().error||!v&&!C().isVisible()||!h&&!C().isOnline()?t():z(a).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[p,v,h,w]),(0,r.useDebugValue)($),c&&(0,i.o8)(U)&&w){if(!i.w6&&i.W6)throw new Error("Fallback data is required when using suspense in SSR.");throw S.current=t,O.current=n,T.current=!1,(0,i.o8)(J)?z(a):J}return{mutate:G,get data(){return D.data=!0,$},get error(){return D.error=!0,J},get isValidating(){return D.isValidating=!0,Y},get isLoading(){return D.isLoading=!0,Z}}})))}}]);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license React
3
+ * use-sync-external-store-shim.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
package/dist/804.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[804],{9804:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var a=n(1672),r=n.n(a),l=n(1338),m=window.spaBase,u="".concat(m).concat("/forms"),o=r().lazy((function(){return Promise.all([n.e(553),n.e(397),n.e(617),n.e(229),n.e(32)]).then(n.bind(n,8032))})),c=r().lazy((function(){return Promise.all([n.e(820),n.e(553),n.e(397),n.e(617),n.e(74),n.e(255)]).then(n.bind(n,5255))})),s=r().lazy((function(){return Promise.all([n.e(820),n.e(327),n.e(553),n.e(403),n.e(397),n.e(617),n.e(229),n.e(74),n.e(168)]).then(n.bind(n,5168))}));const i=function(){return r().createElement("main",null,r().createElement(l.BrowserRouter,{basename:u},r().createElement(l.Routes,null,r().createElement(l.Route,{path:"/",element:r().createElement(o,null)}),r().createElement(l.Route,{path:"/form/:formUuid",element:r().createElement(c,null)}),r().createElement(l.Route,{path:"/groupform/:formUuid",element:r().createElement(s,null)}))))}}}]);
1
+ "use strict";(self.webpackChunk_openmrs_esm_fast_data_entry_app=self.webpackChunk_openmrs_esm_fast_data_entry_app||[]).push([[804],{9804:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var a=n(1672),r=n.n(a),l=n(1338),m=window.spaBase,u="".concat(m).concat("/forms"),o=r().lazy((function(){return Promise.all([n.e(656),n.e(397),n.e(617),n.e(229),n.e(32)]).then(n.bind(n,8032))})),c=r().lazy((function(){return Promise.all([n.e(820),n.e(656),n.e(397),n.e(617),n.e(74),n.e(255)]).then(n.bind(n,5255))})),s=r().lazy((function(){return Promise.all([n.e(820),n.e(327),n.e(656),n.e(571),n.e(397),n.e(617),n.e(229),n.e(74),n.e(153)]).then(n.bind(n,7153))}));const i=function(){return r().createElement("main",null,r().createElement(l.BrowserRouter,{basename:u},r().createElement(l.Routes,null,r().createElement(l.Route,{path:"/",element:r().createElement(o,null)}),r().createElement(l.Route,{path:"/form/:formUuid",element:r().createElement(c,null)}),r().createElement(l.Route,{path:"/groupform/:formUuid",element:r().createElement(s,null)}))))}}}]);