1(this.webpackJsonporchid=this.webpackJsonporchid||[]).push([[12],{1110:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return a}));var i="GAD-7",r="PHQ-9",a="EPDS"},1177:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(1110);function r(e){return e===i.b}},1178:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(1110);function r(e){return e===i.c}},1466:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d}));var i=n(2),r=n.n(i),a=n(6),o=n(7),s=n(1467),c=n(1),l=0;function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.a,n=Object(c.useRef)(e);Object(c.useEffect)((function(){n.current=e}),[e]);var i=Object(c.useRef)();Object(c.useEffect)((function(){var e=i.current;return function(){return e&&clearTimeout(e)}}),[i]);var d=Object(c.useState)(l),u=Object(o.a)(d,2),j=u[0],b=u[1],m=Object(c.useCallback)((function(e){return b(0),new Promise((function(i,o){function s(){return c.apply(this,arguments)}function c(){return(c=Object(a.a)(r.a.mark((function a(){var c,d,u=arguments;return r.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c=u.length>0&&void 0!==u[0]?u[0]:l,r.prev=1,r.next=4,n.current(e);case 4:return d=r.sent,i(d),r.abrupt("return");case 9:if(r.prev=9,r.t0=r.catch(1),!(c>=t+l-1)){r.next=14;break}return o(new Error(r.t0)),r.abrupt("return");case 14:return b((function(e){return e+1})),s(c+1),r.abrupt("return");case 17:case"end":return r.stop()}}),a,null,[[1,9]])})))).apply(this,arguments)}return s()}))}),[t,n]);return{retryCount:j,fnWithRetry:m}}},1467:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var i=10},1468:function(e,t,n){"use strict";var i=n(2),r=n.n(i),a=n(6),o=n(7),s=n(1),c=n(203),l=n(753),d=n(455),u=n(221),j=n(771),b=n(838),m=n(430),_=n(1469),f=n.n(_),h=n(19),v=n(0),p="send-reminder-modal";t.a=function(e){var t=e.show,n=e.onHide,i=e.patientUserId,_=e.form,O=e.amplitudePageName,x=Object(m.useOrchidPubNubState)().chatOperations,y=Object(s.useState)(!1),g=Object(o.a)(y,2),S=g[0],C=g[1],w=Object(s.useState)('Please complete "'.concat(null===_||void 0===_?void 0:_.form_schema_title,'" ASAP!')),k=Object(o.a)(w,2),N=k[0],P=k[1],A=Object(s.useState)(!1),D=Object(o.a)(A,2),F=D[0],M=D[1],L=Object(s.useState)(),I=Object(o.a)(L,2),E=I[0],T=I[1];Object(s.useEffect)((function(){i&&x&&x.addPartner(i)}),[i,x]),Object(s.useEffect)((function(){_&&P('Please complete "'.concat(_.form_schema_title,'" ASAP!'))}),[_]);var z=function(){var e=Object(a.a)(r.a.mark((function e(t){return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),C(!0),e.prev=2,e.next=5,x.sendMessage(i,N);case 5:M(!0),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),T(e.t0);case 11:return e.prev=11,C(!1),n(),P('Please complete "'.concat(null===_||void 0===_?void 0:_.form_schema_title,'" ASAP!')),e.finish(11);case 16:case"end":return e.stop()}}),e,null,[[2,8,11,16]])})));return function(t){return e.apply(this,arguments)}}();return Object(v.jsxs)(v.Fragment,{children:[E&&Object(v.jsx)(b.a,{show:!0,onHide:function(){return T(void 0)},duration:3e3,errorMsg:E.toString()}),Object(v.jsx)(j.a,{labelTitle:"Sent!",children:"You can view the reminder form the chat tab.",hideCancel:!0,labelConfirm:"Got it",show:F,onCancel:function(){return M(!1)},onConfirm:function(){return M(!1)}}),Object(v.jsxs)(u.a,{dialogClassName:f.a["send-reminder__dialog"],contentClassName:f.a["send-reminder__content"],show:t,onHide:function(){Object(h.d)(O,[p,"exit-modal-button"],"click"),n(),P('Please complete "'.concat(null===_||void 0===_?void 0:_.form_schema_title,'" ASAP!'))},Header:"Send a reminder via chat?",headerClass:f.a["send-reminder__header"],bodyClass:f.a["send-reminder__body"],Footer:Object(v.jsxs)(v.Fragment,{children:[Object(v.jsx)(c.a,{variant:"link",className:"gray01",onClick:function(){Object(h.d)(O,[p,"cancel-button"],"click"),n(),P('Please complete "'.concat(null===_||void 0===_?void 0:_.form_schema_title,'" ASAP!'))},children:"Cancel"}),Object(v.jsxs)(c.a,{variant:"primary",disabled:S,type:"submit",form:"send-reminder",onClick:function(){Object(h.d)(O,[p,"send-button"],"click")},children:["Send",S&&Object(v.jsx)(l.a,{as:"span",animation:"grow",size:"sm",role:"status","aria-hidden":"true"})]})]}),footerClass:f.a["send-reminder__footer"],children:[Object(v.jsx)("p",{children:"We will send below message to your patient to remind the patients to complete the assignments."}),Object(v.jsx)(d.a,{id:"send-reminder",onSubmit:z,children:Object(v.jsx)(d.a.Group,{className:"mb-0",controlId:"message",children:Object(v.jsx)(d.a.Control,{type:"text",value:N,onChange:function(e){return P(e.target.value)},onFocus:function(){Object(h.d)(O,[p,"message-field"],"focus")}})})})]})]})}},1469:function(e,t,n){e.exports={"send-reminder__content":"styles_send-reminder__content__ciD3Y","send-reminder__dialog":"styles_send-reminder__dialog__18RyJ","send-reminder__header":"styles_send-reminder__header__2G8lP","send-reminder__body":"styles_send-reminder__body__2AkV0","send-reminder__footer":"styles_send-reminder__footer__3BUu5"}},1582:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));
1var i=n(1177),r=n(1178);function a(e,t){if(e&&t&&(Object(i.a)(t)||Object(r.a)(t))){var n=Object.values(e)[0];if(n)return Object.values(n).reduce((function(e,t){var n,i=null===(n=t.match(/\((.*)\)$/))||void 0===n?void 0:n[1];return i?e+ +i:e}),0)}}},1933:function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var i=n(7),r=n(4),a=n(1),o=n(1934),s=n.n(o),c=n(771),l=n(796),d=n(58),u=n(178),j=n(0);function b(e){var t=e.show,n=e.onCancel,i=e.onConfirm,r=e.options,a=e.setOptions,o=e.action,l="print"===(void 0===o?"print":o)?"Print Options":"PDF Options";return Object(j.jsx)(c.a,{contentClassName:s.a.printOptionsModal,labelCancel:d.e.cancel,show:t,onCancel:n,onConfirm:i,labelTitle:l,children:Object(j.jsx)(m,{options:r,setOptions:a}),labelConfirm:d.e.confirm})}function m(e){var t=e.options,n=e.setOptions;return Object(j.jsxs)("div",{className:s.a.optionsModalContent,children:[Object(j.jsx)("div",{className:s.a.title,children:"Show all unselected options for PDF/Print view for:"}),Object(j.jsxs)("div",{className:s.a.option,children:[Object(j.jsx)(l.a,{id:"unselected-options-for-radios",type:"checkbox",checked:!t.hideUnselectedOptionsForRadios,onChange:function(e){return n((function(t){return Object(r.a)(Object(r.a)({},t),{},{hideUnselectedOptionsForRadios:!e.target.checked})}))}}),Object(j.jsx)("label",{htmlFor:"unselected-options-for-radios",children:"Multiple Choice / Multiple Choice Grid"})]}),Object(j.jsxs)("div",{className:s.a.option,children:[Object(j.jsx)(l.a,{id:"unselected-options-for-checkboxes",type:"checkbox",checked:!t.hideUnselectedOptionsForCheckboxes,onChange:function(e){return n((function(t){return Object(r.a)(Object(r.a)({},t),{},{hideUnselectedOptionsForCheckboxes:!e.target.checked})}))}}),Object(j.jsx)("label",{htmlFor:"unselected-options-for-checkboxes",children:"Checkboxes / Checkboxes Grid"})]})]})}function _(e){var t=e.onConfirm,n=e.action,r=void 0===n?"print":n,o=Object(u.a)(!1),s=o.show,c=o.open,l=o.close,d=Object(a.useState)({hideUnselectedOptionsForRadios:!0,hideUnselectedOptionsForCheckboxes:!0}),m=Object(i.a)(d,2),_=m[0],f=m[1],h=Object(a.useMemo)((function(){return Object(j.jsx)(b,{show:s,onCancel:l,onConfirm:function(){l(),t()},action:r,options:_,setOptions:f})}),[s,_,l,t,r]);return{openPrintOptionsModal:c,printOptions:_,printOptionsModal:h}}},1934:function(e,t,n){e.exports={printOptionsModal:"PrintOptionsModal_printOptionsModal__2Lx9l",optionsModalContent:"PrintOptionsModal_optionsModalContent__1sxXU",title:"PrintOptionsModal_title__2vWGa",option:"PrintOptionsModal_option__1NwDD"}},1936:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(1);function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=Object(i.useRef)(e),a=Object(i.useRef)(t);Object(i.useEffect)((function(){r.current=e}),[e]),Object(i.useEffect)((function(){a.current=t}),[t]);var o=Object(i.useRef)();Object(i.useEffect)((function(){var e=o.current;return function(){return e&&clearTimeout(e)}}),[o]);var s=Object(i.useCallback)((function(e){return e.map((function(e){return function(){return o.current&&(clearTimeout(o.current),o.current=void 0),o.current=setTimeout((function(){a.current()}),n),e.apply(void 0,arguments)}}))}),[a,n]);return Object(i.useMemo)((function(){return s(r.current)}),[s])}},1942:function(e,t,n){"use strict";var i=n(7),r=n(165),a=n.n(r),o=n(1),s=n(759),c=n(760),l=n(54),d=n(58),u=n(10),j=n(1943),b=n.n(j),m=n(1466),_=n(1467),f=n(0),h="VISITED_URLS",v=Object.freeze({sameDay:"[today] [at] h:mmA z",lastDay:"[yesterday] [at] h:mmA z",sameElse:"DD/MM/YYYY [at] h:mmA z"});t.a=function(e){var t=e.busy,n=e.saved,r=e.retryCount,j=e.maxRetry,p=void 0===j?_.a:j,O=e.className,x=e.tooltipClassName,y=e.tooltip,g=Object(l.c)(),S=g.defaultUserTimezone,C=g.user,w=Object(o.useRef)(""),k=Object(o.useState)(!1),N=Object(i.a)(k,2),P=N[0],A=N[1];Object(o.useEffect)((function(){var e=JSON.parse(window.sessionStorage.getItem(h)||"{}"),t=e.id,n=e.urls;return t!==(null===C||void 0===C?void 0:C.sub)&&(window.sessionStorage.removeItem(h),t=void 0,n=[]),A(n.some((function(e){return e===window.location.href}))),(null===C||void 0===C?void 0:C.sub)&&(n.push(window.location.href),window.sessionStorage.setItem(h,JSON.stringify({id:C.sub,urls:n}))),function(){window.sessionStorage.removeItem(h)}}),[null===C||void 0===C?void 0:C.sub]);var D=Object(o.useMemo)((function(){return t?r>m.a?d.e.failedToSaveChangesRetrying:d.e.savingDraft:void 0===n?P?d.e.allChangesSavedAsDraft:"":!1===n?r===m.a?w.current:r>=p+m.a-1?d.e.unableToSave:d.e.failedToSaveChangesRetrying:d.e.draftSaved+a.a.tz(Date.now(),S).calendar(v)}),[t,r,n,S,p,P]);return Object(o.useEffect)((function(){w.current=D}),[D]),Object(f.jsx)(s.a,{placement:"bottom",overlay:Object(f.jsx)(c.a,{id:"auto-saved-tooltip",className:x,children:y}),children:Object(f.jsx)("span",{className:Object(u.a)(b.a["auto-saved-state"],O),children:D})})}},1943:function(e,t,n){e.exports={"auto-saved-state":"AutoSavedState_auto-saved-state__3omoq"}},1946:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(1110);function r(e){return e===i.a}},3087:function(e,t,n){e.exports={interpretation:"styles_interpretation__2wjiE",interpretation__score:"styles_interpretation__score__2cwXI",interpretation__title:"styles_interpretation__title__2lMaQ",interpretation__text:"styles_interpretation__text__3eeLo",interpretation__footnote:"styles_interpretation__footnote__1zCpV",interpretation__table:"styles_interpretation__table__3SLSk","interpretation__table-title-th":"styles_interpretation__table-title-th__3ZaRE","interpretation__table-second-tr":"styles_interpretation__table-second-tr__1gCaC",placeHolderShimmer:"styles_placeHolderShimmer__mSueU",shimmer:"styles_shimmer__3PAuD"}},3088:function(e,t,n){e.exports={interpretation:"styles_interpretation__3nE4q",interpretation__score:"styles_interpretation__score__O5gA1",interpretation__title:"styles_interpretation__title__1zyFo",interpretation__text:"styles_interpretation__text__3ramd",interpretation__footnote:"styles_interpretation__footnote__2_vXF",interpretation__table:"styles_interpretation__table__2rJ26","interpretation__table-title-th":"styles_interpretation__table-title-th__8gYbG","interpretation__table-second-tr":"styles_interpretation__table-second-tr__3K6eP",placeHolderShimmer:"styles_placeHolderShimmer__2GLHh",shimmer:"styles_shimmer__RRe24"}},3089:function(e,t,n){e.exports={"side-info__patient-type-tag":"AssessmentSideInfo_side-info__patient-type-tag__2X8fs","side-info__title":"AssessmentSideInfo_side-info__title__jNcNa","side-info__content":"AssessmentSideInfo_side-info__content__2SrPj","side-info-patient":"AssessmentSideInfo_side-info-patient__1sJU6",placeHolderShimmer:"AssessmentSideInfo_placeHolderShimmer__1PQh8",shimmer:"AssessmentSideInfo_shimmer__1PQLw"}},3090:function(e,t,n){e.exports={scoring:"styles_scoring__1iLXy",scoring__points:"styles_scoring__points__-SxWg",scoring__tag:"styles_scoring__tag__AYMtU","scoring__tag--positive":"styles_scoring__tag--positive__3fuh0","scoring__tag--negative":"styles_scoring__tag--negative__YPoui",placeHolderShimmer:"styles_placeHolderShimmer__1Dwvj",shimmer:"styles_shimmer__7XUbJ"}},3091:function(e,t,n){e.exports={"form-fill-in__tooltip":"FormFillIn_form-fill-in__tooltip__gcA-C","form-fill-in__footer":"FormFillIn_form-fill-in__footer__3fi8z","form-fill-in__btn--phone":"FormFillIn_form-fill-in__btn--phone__DYySs","form-fill-in__body":"FormFillIn_form-fill-in__body__1Pz5R","form-fill-in__patient-not-filled":"FormFillIn_form-fill-in__patient-not-filled__1rbSQ","form-fill-in__patient-empty":"FormFillIn_form-fill-in__patient-empty__3V4yD","form-fill-in__suicidal":"FormFillIn_form-fill-in__suicidal__19IEw","form-fill-in__epds-container":"FormFillIn_form-fill-in__epds-container__3ef29","form-fill-in__source":"FormFillIn_form-fill-in__source__UlUhD","form-fill-in__source-text":"FormFillIn_form-fill-in__source-text__1-0wP","print-button":"FormFillIn_print-button__Gt7ke",placeHolderShimmer:"FormFillIn_placeHolderShimmer__itnTU",shimmer:"FormFillIn_shimmer__3vhuw"}},3092:function(e,t,n){e.exports={"generate-note-pdf":"FormPrintOrDownloadTrigger_generate-note-pdf__1iqX_"}},3359:function(e,t,n){"use strict";n.r(t);
1var i,r,a,o,s,c,l=n(3),d=n(2),u=n.n(d),j=n(4),b=n(6),m=n(7),_=n(1),f=n(203),h=n(585),v=n(361),p=n(217),O=n(29),x=["title","titleId"];function y(){return(y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function g(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function S(e,t){var n=e.title,l=e.titleId,d=g(e,x);return _.createElement("svg",y({width:144,height:139,viewBox:"0 0 144 139",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":l},d),n?_.createElement("title",{id:l},n):null,i||(i=_.createElement("path",{d:"M1.78622 121.775L26.7077 18.5075C27.1635 16.6185 28.9111 15.3304 30.8504 15.4539L138.63 22.3208C141.078 22.4767 142.81 24.778 142.282 27.173L118.554 134.919C118.117 136.906 116.257 138.248 114.234 138.037L5.2604 126.692C2.85342 126.441 1.21851 124.127 1.78622 121.775Z",fill:"#CF9746"})),r||(r=_.createElement("path",{d:"M11.6201 119.66L35.1789 21.9766L137.032 28.47L114.602 130.389L11.6201 119.66Z",fill:"#EACDCD"})),a||(a=_.createElement("path",{d:"M9.37402 116.453L32.9328 18.7695L134.786 25.263L112.355 127.182L9.37402 116.453Z",fill:"white"})),o||(o=_.createElement("path",{d:"M78.0357 86.4773V95.6639C78.0155 96.5011 77.3489 97.1749 76.5247 97.1953H67.4429C67.0451 97.1855 66.6661 97.0215 66.3845 96.7372C66.1029 96.4529 65.9402 96.0701 65.93 95.668V86.4793C65.9502 85.6421 66.6167 84.9703 67.4429 84.9499H76.5328C77.361 84.9703 78.0276 85.6442 78.0478 86.4793L78.0357 86.4773ZM90 63.5118C90.0024 65.934 89.3288 68.3077 88.0568 70.3604L88.0871 70.3073C87.5063 71.1541 86.8122 71.9155 86.0247 72.5697L86.0045 72.5861C85.3561 73.1619 84.6471 73.7091 83.8997 74.2074L83.8269 74.2523C83.2708 74.5967 82.5005 75.0493 81.5161 75.6102C80.4756 76.2098 79.5924 77.0529 78.9406 78.0686L78.9224 78.0972C78.3559 78.8331 77.9964 79.71 77.8822 80.6353L77.8801 80.6598C77.8735 81.1162 77.7124 81.5565 77.4236 81.9074L77.4256 81.9034C77.3089 82.0804 77.1518 82.2265 76.9676 82.3296C76.7835 82.4326 76.5776 82.4895 76.3672 82.4955H67.2773C67.0677 82.4805 66.8664 82.4071 66.6956 82.2835C66.5248 82.1598 66.3913 81.9908 66.3097 81.7951L66.3077 81.787C66.0516 81.3533 65.9142 80.8586 65.9098 80.3535V78.6281C65.9546 76.3883 66.834 74.248 68.3721 72.6351L68.3701 72.6371C69.8374 70.9043 71.6497 69.5037 73.6887 68.5267L73.7856 68.4859C74.9801 68.0008 76.0625 67.2716 76.9651 66.3439L76.9671 66.3419C77.6295 65.5214 77.967 64.4816 77.9145 63.424V63.4342C77.8818 62.8536 77.705 62.2908 77.4003 61.7976C77.0956 61.3044 76.6729 60.8967 76.1712 60.6122L76.1531 60.6041C74.9543 59.7753 73.5286 59.3475 72.0767 59.381H72.0828C70.6283 59.3229 69.191 59.7162 67.9641 60.5081L67.9923 60.4897C66.5002 61.7782 65.1577 63.2339 63.9908 64.8288L63.9403 64.9003C63.8052 65.0876 63.6288 65.2405 63.4251 65.3468C63.2214 65.4532 62.9959 65.51 62.7667 65.5129C62.4263 65.502 62.0959 65.3944 61.8132 65.2025L61.8193 65.2066L55.6099 60.4223C55.3008 60.1949 55.0909 59.8554 55.0241 59.4749L55.0221 59.4667C54.9583 59.0938 55.0339 58.7103 55.2342 58.3906L55.2301 58.3968C58.5772 52.273 64.924 48.1953 72.2161 48.1953C72.4242 48.1953 72.6302 48.1994 72.8363 48.2055H72.806C74.9339 48.2162 77.0406 48.6333 79.0154 49.4348L78.9002 49.3939C80.9108 50.163 82.7899 51.2454 84.4693 52.6018L84.4289 52.5691C86.0518 53.8884 87.4014 55.5183 88.4002 57.3656L88.4406 57.4493C89.4162 59.1992 89.9919 61.2902 89.9939 63.5159L90 63.5118Z",fill:"#185888"})),s||(s=_.createElement("path",{d:"M47.3011 13.1512C44.1726 15.2288 42.1812 20.9275 41.8359 24.1592L125.367 26.7492C125.696 27.7807 126.229 27.7142 125.725 19.1963C125.095 8.54891 113.135 13.9573 102.732 11.4482C92.7349 9.03718 91.7317 10.5226 87.2309 5.18381C82.7301 -0.154999 77.7673 5.74368 75.0867 9.40545C72.406 13.0672 53.9608 8.72846 47.3011 13.1512Z",fill:"#93B6F0"})),c||(c=_.createElement("ellipse",{cx:82.5048,cy:11.7114,rx:3.52821,ry:3.20746,fill:"#E4F5FF"})))}var C,w=_.forwardRef(S),k=(n.p,n(114)),N=["title","titleId"];function P(){return(P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function A(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function D(e,t){var n=e.title,i=e.titleId,r=A(e,N);return _.createElement("svg",P({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":i},r),n?_.createElement("title",{id:i},n):null,C||(C=_.createElement("path",{d:"M20 21V19C20 16.7909 18.2091 15 16 15H8C5.79086 15 4 16.7909 4 19V21M20 7V10.5M20 13V13.01M16 7C16 9.20914 14.2091 11 12 11C9.79086 11 8 9.20914 8 7C8 4.79086 9.79086 3 12 3C14.2091 3 16 4.79086 16 7Z",stroke:"#F61E5F",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))}var F=_.forwardRef(D),M=(n.p,n(1099)),L=n(10),I=n(3087),E=n.n(I),T=n(0),z=function(){return Object(T.jsxs)("div",{className:E.a.interpretation,children:[Object(T.jsx)("div",{className:E.a.interpretation__title,children:"GAD-7 Interpretation:"}),Object(T.jsxs)("div",{className:E.a.interpretation__text,children:[Object(T.jsx)("b",{children:"When screening for anxiety disorders, a score of 8 or greater represents a reasonable cut-point for identifying probable cases of generalized anxiety disorder;"})," ","further diagnostic assessment is warranted to determine the presence and type of anxiety disorder. Using a cut-off of 8 the GAD-7 has a sensitivity of 92% and specificity of 76% for diagnosis generalized anxiety disorder. ",Object(T.jsx)("sup",{children:"2,3"})]}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:E.a.interpretation__text,children:["The following cut-offs correlate with level of anxiety severity"," ",Object(T.jsx)("sup",{children:"2"}),"."]}),Object(T.jsx)("div",{className:E.a.interpretation__score,children:Object(T.jsxs)("ul",{children:[Object(T.jsxs)("li",{children:["Score ",Object(T.jsx)("b",{children:"0-4: Minimal Anxiety"})]}),Object(T.jsxs)("li",{children:["Score ",Object(T.jsx)("b",{children:"5-9: Mild Anxiety"})]}),Object(T.jsxs)("li",{children:["Score ",Object(T.jsx)("b",{children:"10-14: Moderate Anxiety"})]}),Object(T.jsxs)("li",{children:["Score"," ",Object(T.jsxs)("b",{children:["greater than 15: ",Object(T.jsx)("span",{className:"red",children:"Severe Anxiety"})]})]})]})}),Object(T.jsxs)("div",{className:Object(L.a)("mt-3",E.a.interpretation__text),children:["Based on a recent meta-analysis, some experts have recommended considering using a cut-off of 8 in order to optimize sensitivity without compromising specificity. ",Object(T.jsx)("sup",{children:"2"})]}),Object(T.jsx)("hr",{}),Object(T.jsx)("div",{className:E.a.interpretation__title,children:"Performing as Screening Tool for Anxiety Disorders"}
1),Object(T.jsxs)("div",{className:Object(L.a)("mb-3",E.a.interpretation__text),children:["Although designed as a screening tool for generalized anxiety, the GAD-7 is also performs reasonably well as a screening tool for three other common anxiety disorders\u2014Panic Disorder, Social Anxiety Disorder, and Post-traumatic Stress Disorder. ",Object(T.jsx)("sup",{children:"3"})]}),Object(T.jsxs)(M.a,{className:E.a.interpretation__table,size:"sm",children:[Object(T.jsxs)("thead",{children:[Object(T.jsx)("tr",{children:Object(T.jsx)("th",{className:E.a["interpretation__table-title-th"],colSpan:6,children:"Performance of GAD-7 as Screening Tool for Anxiety Disorders3 (Using GAD-7 Score Cut-off of \u226510)"})}),Object(T.jsxs)("tr",{className:E.a["interpretation__table-second-tr"],children:[Object(T.jsx)("th",{}),Object(T.jsx)("th",{children:"Test"}),Object(T.jsx)("th",{children:"Sensitivity"}),Object(T.jsx)("th",{children:"Specificity"}),Object(T.jsx)("th",{children:"Positive Likelihood Ratio"}),Object(T.jsx)("th",{})]})]}),Object(T.jsxs)("tbody",{children:[Object(T.jsxs)("tr",{children:[Object(T.jsx)("td",{}),Object(T.jsx)("td",{children:"Generalized Anxiety Disorder"}),Object(T.jsx)("td",{children:"89%"}),Object(T.jsx)("td",{children:"82%"}
1),Object(T.jsx)("td",{children:"5.1"}),Object(T.jsx)("td",{})]}),Object(T.jsxs)("tr",{children:[Object(T.jsx)("td",{}),Object(T.jsx)("td",{children:"Panic Disorder"}),Object(T.jsx)("td",{children:"74%"}),Object(T.jsx)("td",{children:"81%"}),Object(T.jsx)("td",{children:"3.9"}),Object(T.jsx)("td",{})]}),Object(T.jsxs)("tr",{children:[Object(T.jsx)("td",{}),Object(T.jsx)("td",{children:"Social Anxiety Disorder"}),Object(T.jsx)("td",{children:"72%"}),Object(T.jsx)("td",{children:"80%"}),Object(T.jsx)("td",{children:"3.6"}),Object(T.jsx)("td",{})]}),Object(T.jsxs)("tr",{children:[Object(T.jsx)("td",{}),Object(T.jsx)("td",{children:"Post Traumatic Stress Disorder"}),Object(T.jsx)("td",{children:"66%"}),Object(T.jsx)("td",{children:"81%"}),Object(T.jsx)("td",{children:"3.5"}),Object(T.jsx)("td",{})]}),Object(T.jsxs)("tr",{children:[Object(T.jsx)("td",{}),Object(T.jsx)("td",{children:"Any anxiety disorder"}),Object(T.jsx)("td",{children:"68%"}),Object(T.jsx)("td",{children:"88%"}),Object(T.jsx)("td",{children:"5.5"}),Object(T.jsx)("td",{})]})]})]}),Object(T.jsx)("hr",{}),Object(T.jsx)("div",{className:"bd-12",children:"Source"}),Object(T.jsx)("br",{}),Object(T.jsx)("div",{className:E.a.interpretation__footnote,children:Object(T.jsxs)("ol",{children:[Object(T.jsx)("li",{children:"Spitzer RL, Kroenke K, Williams JB, L\xf6we B. A brief measure for assessing generalized anxiety disorder: the GAD-7. Arch Intern Med. 2006;166:1092-7."}),Object(T.jsx)("li",{children:"Plummer F, Manea L, Trepel D, McMillan D. Screening for anxiety disorders with the GAD-7 and GAD-2: a systematic review and diagnostic metaanalysis. Gen Hosp Psychiatry. 2016;39:24-31."}),Object(T.jsx)("li",{children:"Kroenke K, Spitzer RL, Williams JB, Monahan PO, L\xf6we B. Anxiety disorders in primary care: prevalence, impairment, comorbidity, and detection. Ann Intern Med. 2007;146:317-25."})]})})]})},H=n(3088),R=n.n(H),U=function(){return Object(T.jsxs)("div",{className:R.a.interpretation,children:[Object(T.jsx)("div",{className:R.a.interpretation__title,children:"PHQ-9 Interpretation:"}),Object(T.jsx)("div",{className:R.a.interpretation__text,children:"Total scores of 5, 10, 15, and 20 represent cutpoints for mild, moderate, moderately severe and severe depression, respectively."}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:R.a.interpretation__text,children:[Object(T.jsx)("b",{children:"Note:"})," Question 9 is a single screening question on suicide risk. A patient who answers yes to question 9 needs further assessment for suicide risk by an individual who is competent to assess this risk."]}),Object(T.jsx)("div",{className:R.a.interpretation__score,children:Object(T.jsxs)("ul",{children:[Object(T.jsxs)("li",{children:["Score ",Object(T.jsx)("b",{children:"0-4: Non-minimal"})]}),Object(T.jsxs)("li",{children:["Score ",Object(T.jsx)("b",{children:"5-9: Mild "})]}),Object(T.jsxs)("li",{children:["Score ",Object(T.jsx)("b",{children:"10-14: Moderate"})]}),Object(T.jsxs)("li",{children:["Score"," ",Object(T.jsxs)("b",{children:["15-19: ",Object(T.jsx)("span",{className:"red",children:"Moderately Severe"})]})]}),Object(T.jsxs)("li",{children:["Score"," ",Object(T.jsxs)("b",{children:["20-27: ",Object(T.jsx)("span",{className:"red",children:"Severe"})]})]})]})}),Object(T.jsx)("hr",{}),Object(T.jsxs)(M.a,{className:R.a.interpretation__table,size:"sm",children:[Object(T.jsxs)("thead",{children:[Object(T.jsx)("tr",{children:Object(T.jsx)("th",{className:R.a["interpretation__table-title-th"],colSpan:5,children:"Provisional Diagnosis and Proposed Treatment Actions"})}),Object(T.jsxs)("tr",{className:R.a["interpretation__table-second-tr"],children:[Object(T.jsx)("th",{}),Object(T.jsx)("th",{children:"PHQ-9 Score"}),Object(T.jsx)("th",{children:"Depression Severity"}),Object(T.jsx)("th",{children:"Proposed Treatment Actions"}),Object(T.jsx)("th",{})]})]}),Object(T.jsxs)("tbody",{children:[Object(T.jsxs)("tr",{children:[Object(T.jsx)("td",{}),Object(T.jsx)("td",{children:"0-4"}),Object(T.jsx)("td",{children:"None-minimal"}),Object(T.jsx)("td",{children:"None"}),Object(T.jsx)("td",{})]}),Object(T.jsxs)("tr",{children:[Object(T.jsx)("td",{}),Object(T.jsx)("td",{children:"5-9"}),Object(T.jsx)("td",{children:"Mild"}),Object(T.jsx)("td",{children:"Watchful waiting; repeat PHQ-9 at follow-up"}),Object(T.jsx)("td",{})]}),Object(T.jsxs)("tr",{children:[Object(T.jsx)("td",{}),Object(T.jsx)("td",{children:"10-14"}),Object(T.jsx)("td",{children:"Moderate"}),Object(T.jsx)("td",{children:"Treatment plan, considering counseling, follow-up and/or parmacotherapy"}),Object(T.jsx)("td",{})]}),Object(T.jsxs)("tr",{children:[Object(T.jsx)("td",{}),Object(T.jsx)("td",{children:"15-19"}),Object(T.jsx)("td",{children:"Moderately Severe"}),Object(T.jsx)("td",{children:"Active treatment with pharmacotherapy and/
1or psychotherapy"}),Object(T.jsx)("td",{})]}),Object(T.jsxs)("tr",{children:[Object(T.jsx)("td",{}),Object(T.jsx)("td",{children:"20-27"}),Object(T.jsx)("td",{children:"Severe"}),Object(T.jsx)("td",{className:R.a[""],children:"Immediate initiation of pharmacotherapy and, if severe impairment or poor response to therapy, expedited referral to a mental health specialist for psychotherapy and/or collaborative management"}),Object(T.jsx)("td",{})]})]})]}),Object(T.jsx)("hr",{}),Object(T.jsx)("div",{className:"bd-12",children:"Source"}),Object(T.jsx)("br",{}),Object(T.jsx)("div",{className:R.a.interpretation__footnote,children:Object(T.jsxs)("ul",{children:[Object(T.jsx)("li",{children:"Kroenke K, Spitzer RL, Williams JB. The Patient Health Questionnaire-2: Validity of a Two-Item Depression Screener. Medical Care. 2003;41:1284-92."}),Object(T.jsx)("li",{children:"Kroenke K, Spitzer RL, Williams JB. The PHQ-9: validity of a brief depression severity measure. J Gen Intern Med. 2001;16:606-13."}),Object(T.jsx)("li",{children:"Kroenke K, Spitzer RL. The PHQ-9: a new depression diagnostic and severity measure. Psychiatr Ann. 2002;32:509-21."})]})})]})},G=n(1582),J=n(1468),B=n(451),W=n(771),Q=n(286),Y=n(120),V=n(450),K=n(418),Z=n.n(K),q=n(855),X=n(54);function $(e){if(e<=60){var t=e.toFixed(2);return"".concat(t," sec")}var n=Math.floor(e/60),i=e%60,r=i.toFixed(2);return"".concat(n," min ").concat(i<10?"0".concat(r," sec"):"".concat(r," sec"))}var ee=n(869),te=n(3089),ne=n.n(te),ie=function(e){var t,n=e.metaData,i=e.isUserPro,r=e.isAssessmentTemplate,a=e.isAssessment,o=Object(X.c)().defaultUserTimezone;return r?Object(T.jsxs)("div",{className:ne.a["side-info-patient"],children:[Object(T.jsx)("div",{className:ne.a["side-info__title"],children:"Patient preferred name"}),Object(T.jsx)("div",{className:ne.a["side-info__content"],children:"-"}),Object(T.jsx)("div",{className:ne.a["side-info__title"],children:"DOB"}),Object(T.jsx)("div",{className:ne.a["side-info__content"],children:"-"}),Object(T.jsx)("div",{className:ne.a["side-info__title"],children:"Assessment status"}),Object(T.jsx)("div",{className:ne.a["side-info__content"],children:"-"}),Object(T.jsx)("div",{className:ne.a["side-info__title"],children:"Time to complete"}),Object(T.jsx)("div",{className:ne.a["side-info__content"],children:"-"})]}):i?Object(T.jsxs)("div",{children:[Object(T.jsx)("div",{className:ne.a["side-info__patient-type-tag"],children:Object(T.jsx)(q.a,{type:"adult"})}),(null===n||void 0===n?void 0:n.patient)&&Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("div",{className:ne.a["side-info__title"],children:"Patient preferred name"}),Object(T.jsx)("div",{className:ne.a["side-info__content"],children:"".concat(n.patient.first_name||""," ").concat(n.patient.last_name||"")})]}),(null===n||void 0===n||null===(t=n.patient)||void 0===t?void 0:t.dob)&&Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("div",{className:ne.a["side-info__title"],children:"DOB"}),Object(T.jsx)("div",{className:ne.a["side-info__content"],children:Z.a.tz(n.patient.dob,o).format(ee.a)})]}),Object(T.jsx)("div",{className:ne.a["side-info__title"],children:"Assessment status"}),Object(T.jsx)("div",{className:ne.a["side-info__content"],children:(null===n||void 0===n?void 0:n.completed_timestamp)?Object(T.jsxs)("div",{children:["Signed & submitted ",Object(T.jsx)("br",{}),"".concat(new Date(null===n||void 0===n?void 0:n.completed_timestamp).toLocaleDateString("en-US",{hour:"2-digit",minute:"2-digit"}))]}):"Pending"}),a&&Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("div",{className:ne.a["side-info__title"],children:"Time to complete"}),Object(T.jsx)("div",{className:ne.a["side-info__content"],children:(null===n||void 0===n?void 0:n.time_to_complete_seconds)?$(null===n||void 0===n?void 0:n.time_to_complete_seconds):"-"})]})]}):Object(T.jsxs)("div",{className:ne.a["side-info-patient"],children:[(null===n||void 0===n?void 0:n.orchid_pro)&&Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("div",{className:ne.a["side-info__title"],children:"Primary Clinician"}
1),Object(T.jsx)("div",{className:ne.a["side-info__content"],children:"".concat(n.orchid_pro.first_name||""," ").concat(n.orchid_pro.last_name||"")})]}),Object(T.jsx)("div",{className:ne.a["side-info__title"],children:"Assessment status"}),Object(T.jsx)("div",{className:ne.a["side-info__content"],children:(null===n||void 0===n?void 0:n.completed_timestamp)?Object(T.jsxs)("div",{children:["Signed & submitted ",Object(T.jsx)("br",{}),"".concat(new Date(null===n||void 0===n?void 0:n.completed_timestamp).toLocaleDateString("en-US",{hour:"2-digit",minute:"2-digit"}))]}):"Pending"}),a&&Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("div",{className:ne.a["side-info__title"],children:"Time to complete"}),Object(T.jsx)("div",{className:ne.a["side-info__content"],children:(null===n||void 0===n?void 0:n.time_to_complete_seconds)?$(null===n||void 0===n?void 0:n.time_to_complete_seconds):"-"})]})]})},re=n(1942),ae=n(967),oe=n(58),se=n(1177),ce=n(1178);var le=n(3090),de=n.n(le),ue=function(e){var t,n,i=e.metaData,r=e.data,a=Object(_.useMemo)((function(){var e,t,n,a=Object(se.a)(null===i||void 0===i||null===(e=i.form_json_schema)||void 0===e?void 0:e.title),o=Object(ce.a)(null===i||void 0===i||null===(t=i.form_json_schema)||void 0===t?void 0:t.title),s={show:!0};if(s.show=!(!(null===i||void 0===i?void 0:i.completed_timestamp)||!a&&!o),!s.show)return s;var c=Object(G.a)(r,null===i||void 0===i||null===(n=i.form_json_schema)||void 0===n?void 0:n.title);return void 0===c?s:a?Object(j.a)(Object(j.a)({},s),{},{score:c},function(e){var t={type:oe.e.severe,noticeable:!1};return e<5?t.type=oe.e.minimalAnxiety:e<10?t.type=oe.e.mildAnxiety:e<15?t.type=oe.e.moderateAnxiety:(t.type=oe.e.severeAnxiety,t.noticeable=!0),t}(c)):Object(j.a)(Object(j.a)({},s),{},{score:c},function(e){var t={type:oe.e.severe,noticeable:!1};return e<5?t.type=oe.e.nonminimal:e<10?t.type=oe.e.mild:e<15?t.type=oe.e.moderate:e<20?(t.type=oe.e.moderatelySevere,t.noticeable=!0):(t.type=oe.e.severe,t.noticeable=!0),t}(c))}),[r,null===i||void 0===i?void 0:i.completed_timestamp,null===i||void 0===i||null===(t=i.form_json_schema)||void 0===t?void 0:t.title]),o=a.show,s=a.score,c=a.type,l=a.noticeable;return o&&void 0!==s?Object(T.jsxs)("p",{className:de.a.scoring,children:["".concat(null===i||void 0===i||null===(n=i.form_json_schema)||void 0===n?void 0:n.title," ").concat(oe.e.totalScoreObtainedBy),Object(T.jsx)("span",{className:de.a.scoring__points,children:"".concat(s,",")}),Object(T.jsx)("span",{className:Object(L.a)(de.a.scoring__tag,l&&de.a["scoring__tag--negative"]),children:c})]}):null},je=n(1463),be=n.n(je),me=n(3091),_e=n.n(me),fe=n(776),he=n(896);function ve(e){return[4e15,0xe35fa931a0001,0xe35fa931a0002,0xe35fa931a0003,0xe35fa931a0004,0xe35fa931a0005,0xe35fa931a0006,0xe35fa931a0007,0xe35fa931a0008,0xe35fa931a0009,0xe35fa931a000a,0xe35fa931a000b,0xe35fa931a000c,0xe35fa931a000d,0xe35fa931a000e,0xe35fa931a000f].includes(e)}var pe=n(1946),Oe=n(27),xe=n(21);function ye(e){return ge.apply(this,arguments)}function ge(){return(ge=Object(b.a)(u.a.mark((function e(t){var n;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(xe.b)("/api/notes/v1/forms/complete/".concat(t),{method:"PUT",body:JSON.stringify({completed:!0})});case 2:if((n=e.sent).ok){e.next=13;break}return e.t0=Error,e.t1="failed to complete form: ",e.t2=Oe.a,e.next=9,n.text();case 9:throw e.t3=e.sent,e.t4=(0,e.t2)(e.t3),e.t5=e.t1.concat.call(e.t1,e.t4),new e.t0(e.t5);case 13:return e.abrupt("return");case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Se=n(425),Ce=n(428),we=n(922),ke=n(1132),Ne=n(980),Pe=n(887),Ae=n(857),De=n(1493),Fe=n(105),Me=n(3092),Le=n.n(Me),Ie=n(1933),Ee=function(e){var t=e.partialData,n=e.action,i=e.children,r=Object(_.useState)(!1),a=Object(m.a)(r,2),o=a[0],s=a[1],c=Object(_.useState)(),l=Object(m.a)(c,2),d=l[0],j=l[1],f=Object(_.useState)(),h=Object(m.a)(f,2),v=h[0],p=h[1],O=(null===t||void 0===t?void 0:t.form_data_id)||"",x=Object(Ie.a)({onConfirm:function(){return s(!0)},action:n}),y=x.openPrintOptionsModal,g=x.printOptions,S=x.printOptionsModal,C=Object(_.useCallback)(Object(b.a)(u.a.mark((function e(){var t,n,i,r,a;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(O){e.next=3;break}return console.warn("No form data id provided"),e.abrupt("return");case 3:return y(),e.next=6,Object(we.a)({type:"form",id:O});case 6:if(t=e.sent,j(t),!(null===t||void 0===t?void 0:t.cipher_key)){e.next=35;break}return e.next=11,Object(fe.c)(null===t||void 0===t?void 0:t.cipher_key);case 11:return i=e.sent,r={},e.prev=13,e.next=16,Object(Ne.a)({type:"form",id:O});case 16:r=e.sent,e.next=21;break;case 19:e.prev=19,e.t0=e.catch(13);
1case 21:if(!(null===(n=r)||void 0===n?void 0:n.data)){e.next=32;break}return e.t2=JSON,e.next=25,Object(fe.d)(r.data,i);case 25:if(e.t3=e.sent,e.t3){e.next=28;break}e.t3="{}";case 28:e.t4=e.t3,e.t1=e.t2.parse.call(e.t2,e.t4),e.next=33;break;case 32:e.t1={};case 33:a=e.t1,p(a);case 35:case"end":return e.stop()}}),e,null,[[13,19]])}))),[O,y]);return Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("div",{onClick:C,children:i}),o&&d&&v&&Object(Fe.createPortal)(Object(T.jsx)("div",{className:Le.a["generate-note-pdf"],"aria-hidden":"true",tabIndex:-1,children:Object(T.jsx)(De.a,{type:"form",action:n,onAction:function(){return s(!1)},metaData:d,data:v,templateContentOptions:g})}),document.body),S]})},Te=n(201),ze=n(42),He=n(68),Re=n(1936),Ue=n(1466),Ge=n(178),Je=n(908),Be=n(19),We=n(180),Qe=Ae.a.form,Ye="form-fill-in-page";t.default=function(e){var t,n,i,r,a,o,s,c,d,x,y,g=e.preview,S=Object(_.useRef)(null),C=Object(He.b)().setPage;Object(_.useEffect)((function(){return C(Ye)}),[C]);var N=Object(ze.b)().isPhonePortrait,P=null===(t=Object(X.c)())||void 0===t?void 0:t.user,A=Object(O.q)(),D=Object(O.s)(),M=Object(_.useState)(),I=Object(m.a)(M,2),E=I[0],H=I[1],R=Object(_.useState)(!1),K=Object(m.a)(R,2),Z=K[0],q=K[1],$=Object(_.useState)({}),ee=Object(m.a)($,2),te=ee[0],ne=ee[1],le=Object(_.useState)(),de=Object(m.a)(le,2),je=de[0],me=de[1],Oe=Object(_.useState)(),xe=Object(m.a)(Oe,2),ge=xe[0],Ae=xe[1],De=Object(We.b)().practiceOwnerOrchidUserId;Object(_.useEffect)((function(){function e(){return(e=Object(b.a)(u.a.mark((function e(){var t,n,i,r,a,o,s;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((null===D||void 0===D?void 0:D.form_data_id)||!window.opener){e.next=5;break}return e.next=3,Object(he.a)();case 3:t=e.sent,H({form_json_schema:t.form_json_schema,form_ui_schema:t.form_ui_schema,schema_v2:t.schema_v2});case 5:if(!(null===D||void 0===D?void 0:D.form_data_id)){e.next=40;break}return e.next=8,Object(we.a)(Object(j.a)({type:Qe,id:null===D||void 0===D?void 0:D.form_data_id},De&&{onBehalfOf:De}));case 8:if(n=e.sent,H(n),!(null===n||void 0===n?void 0:n.cipher_key)){e.next=38;break}return e.next=13,Object(fe.c)(null===n||void 0===n?void 0:n.cipher_key);case 13:return r=e.sent,Ae(r),a={},e.prev=16,e.next=19,Object(Ne.a)(Object(j.a)({type:Qe,id:null===D||void 0===D?void 0:D.form_data_id},De&&{onBehalfOf:De}));case 19:a=e.sent,e.next=24;break;case 22:e.prev=22,e.t0=e.catch(16);case 24:if(!(null===(i=a)||void 0===i?void 0:i.data)){e.next=35;break}return e.t2=JSON,e.next=28,Object(fe.d)(a.data,r);case 28:if(e.t3=e.sent,e.t3){e.next=31;break}e.t3="{}";case 31:e.t4=e.t3,e.t1=e.t2.parse.call(e.t2,e.t4),e.next=36;break;case 35:e.t1={};case 36:o=e.t1,ne(o);case 38:e.next=45;break;case 40:if(!(null===D||void 0===D?void 0:D.form_template_id)){e.next=45;break}return e.next=43,Object(ke.a)({type:Qe,id:null===D||void 0===D?void 0:D.form_template_id,revision:null===D||void 0===D?void 0:D.form_template_revision});case 43:s=e.sent,H((function(e){return Object(j.a)(Object(j.a)({},e),s)}));case 45:q(!0);case 46:case"end":return e.stop()}}),e,null,[[16,22]])})))).apply(this,arguments)}(function(){return e.apply(this,arguments)})().catch(me)}),[]);var Fe=Object(_.useCallback)(Object(b.a)(u.a.mark((function e(){var t,n,i,r,a,o,s,c,l,d;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Object(j.a)(Object(j.a)(Object(j.a)({form_schema_id:null!==(t=null===E||void 0===E?void 0:E.form_schema_id)&&void 0!==t?t:0,form_schema_revision:null!==(n=null===E||void 0===E?void 0:E.form_schema_revision)&&void 0!==n?n:0},E&&"appointment"in E&&{appointment_id:null===E||void 0===E||null===(i=E.appointment)||void 0===i?void 0:i.appointment_id}),E&&"group_session"in E&&{group_session_id:null===E||void 0===E||null===(r=E.group_session)||void 0===r?void 0:r.group_session_id}),E&&"patient"in E&&{patient_cognito_sub:null===E||void 0===E||null===(a=E.patient)||void 0===a?void 0:a.cognito_sub}),e.next=3,Object(Se.a)(Qe,o);case 3:return s=e.sent,e.next=6,Object(fe.c)(s.cipher_key);case 6:return c=e.sent,Ae(c),e.next=10,Object(fe.e)(JSON.stringify(te),c);case 10:return l=e.sent,e.next=13,Object(Ce.a)(Qe,s.form_data_id,{orchid_pro_cognito_sub:s.orchid_pro.cognito_sub,data:l});case 13:d=e.sent,A("/pro-dashboard/forms-and-forms/form/".concat(d.form_data_id)),tt(!0);case 16:case"end":return e.stop()}}),e)}))),[te,A,E]),Me=Object(_.useCallback)(Object(b.a)(u.a.mark((function e(){var t,n,i,r;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ge){e.next=8;break}
1if(null===E||void 0===E?void 0:E.cipher_key){e.next=4;break}throw new Error("not having cipher key");case 4:return e.next=6,Object(fe.c)(null===E||void 0===E?void 0:E.cipher_key);case 6:n=e.sent,Ae(ge);case 8:if(!(n&&(null===E||void 0===E?void 0:E.form_data_id)&&(null===E||void 0===E||null===(t=E.orchid_pro)||void 0===t?void 0:t.cognito_sub))){e.next=15;break}return e.next=11,Object(fe.e)(JSON.stringify(te),n);case 11:return r=e.sent,e.next=14,Object(Ce.a)(Qe,null===E||void 0===E?void 0:E.form_data_id,{data:r,orchid_pro_cognito_sub:null===E||void 0===E||null===(i=E.orchid_pro)||void 0===i?void 0:i.cognito_sub});case 14:tt(!0);case 15:case"end":return e.stop()}}),e)}))),[te,ge,null===E||void 0===E?void 0:E.cipher_key,null===E||void 0===E?void 0:E.form_data_id,null===E||void 0===E||null===(n=E.orchid_pro)||void 0===n?void 0:n.cognito_sub]),Le=Object(Ue.b)(Me),Ie=Le.retryCount,Ve=Le.fnWithRetry,Ke=Object(Ue.b)(Fe),Ze=Ke.retryCount,qe=Ke.fnWithRetry,Xe=Object(_.useState)(),$e=Object(m.a)(Xe,2),et=$e[0],tt=$e[1],nt=Object(_.useState)(!1),it=Object(m.a)(nt,2),rt=it[0],at=it[1],ot=Object(_.useCallback)((function(){at(!0),me(void 0);var e=(null===E||void 0===E?void 0:E.form_data_id)?Ve:qe;return e&&e().then((function(){tt(!0)})).catch((function(e){tt(!1),me(e)}
1)).finally((function(){return at(!1)}))}),[qe,Ve,null===E||void 0===E?void 0:E.form_data_id]),st=Object(Re.a)([ne],ot),ct=Object(m.a)(st,1)[0],lt=function(){var e=Object(b.a)(u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=S.current)||void 0===t?void 0:t.validate()){e.next=3;break}return e.abrupt("return");case 3:if(!(null===E||void 0===E?void 0:E.form_data_id)){e.next=15;break}return e.prev=4,e.next=7,ot();case 7:return e.next=9,ye(null===E||void 0===E?void 0:E.form_data_id);case 9:ve(E.form_schema_id)?A("/member-dashboard/notes-and-forms/assessment-submitted",{state:{metaData:E,data:te}}):A("/member-dashboard/notes-and-forms/form-completed",{state:{orchidProInfo:null===E||void 0===E?void 0:E.orchid_pro}}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),me(e.t0);case 15:case"end":return e.stop()}}),e,null,[[4,12]])})));return function(){return e.apply(this,arguments)}}(),dt=Object(_.useMemo)((function(){return"orchid_pro"===(null===P||void 0===P?void 0:P.user_type)}),[null===P||void 0===P?void 0:P.user_type]),ut=Object(_.useMemo)((function(){var e;return!!(null===P||void 0===P||null===(e=P.minors)||void 0===e?void 0:e.length)&&!!(null===P||void 0===P?void 0:P.current_minor_user_id
1)}),[null===P||void 0===P?void 0:P.minors,null===P||void 0===P?void 0:P.current_minor_user_id]),jt=Object(_.useMemo)((function(){var e;return!!g||(!!dt||!ut&&(null===E||void 0===E||null===(e=E.patient)||void 0===e?void 0:e.cognito_sub)!==(null===P||void 0===P?void 0:P.sub))}),[dt,null===E||void 0===E||null===(i=E.patient)||void 0===i?void 0:i.cognito_sub,g,null===P||void 0===P?void 0:P.sub,ut]),bt=Object(O.o)().pathname,mt=Object(_.useMemo)((function(){if(g&&bt.startsWith("/pro-dashboard/notes-and-forms/view-form-template"))return!0}),[g,bt]),_t=Object(Ge.a)(!1),ft=_t.show,ht=_t.open,vt=_t.close,pt=Object(_.useMemo)((function(){if(!(null===E||void 0===E?void 0:E.completed_timestamp))return!1;var e=te&&Object.values(te)[0];if(e){var t,n=Object.values(e);return Object(ce.a)(null===E||void 0===E||null===(t=E.form_json_schema)||void 0===t?void 0:t.title)&&9===(null===n||void 0===n?void 0:n.length)&&"Nearly every day (3)"===n[8]}return!1}),[te,null===E||void 0===E||null===(r=E.form_json_schema)||void 0===r?void 0:r.title,null===E||void 0===E?void 0:E.completed_timestamp]),Ot=Object(_.useMemo)((function(){var e,t,n;if(!(null===E||void 0===E?void 0:E.completed_timestamp))return!1;var i=Object(G.a)(te,null===E||void 0===E||null===(e=E.form_json_schema)||void 0===e?void 0:e.title);return pt||!!i&&Object(se.a)(null===E||void 0===E||null===(t=E.form_json_schema)||void 0===t?void 0:t.title)&&i>15||!!i&&Object(ce.a)(null===E||void 0===E||null===(n=E.form_json_schema)||void 0===n?void 0:n.title)&&i>=20&&i<=27}),[te,null===E||void 0===E||null===(a=E.form_json_schema)||void 0===a?void 0:a.title,pt,null===E||void 0===E?void 0:E.completed_timestamp]),xt=Object(_.useState)(!1),yt=Object(m.a)(xt,2),gt=yt[0],St=yt[1],Ct=Object(_.useMemo)((function(){var e,t=null===E||void 0===E||null===(e=E.form_json_schema)||void 0===e?void 0:e.title;return{isEPDS:Object(pe.a)(t),isPHQ9:Object(ce.a)(t),isGAD7:Object(se.a)(t)}}),[null===E||void 0===E||null===(o=E.form_json_schema)||void 0===o?void 0:o.title]);return Object(T.jsxs)(T.Fragment,{children:[E&&(null===E||void 0===E||null===(s=E.patient)||void 0===s?void 0:s.cognito_sub)&&Object(T.jsx)(J.a,{show:gt,onHide:function(){return St(!1)},patientUserId:E.patient.cognito_sub,form:E,amplitudePageName:Ye}),N?Object(T.jsxs)(Q.a,{hideBackButton:!0,children:[Object(T.jsx)("div",{children:(null===E||void 0===E||null===(c=E.form_json_schema)||void 0===c?void 0:c.title)||""}),Object(T.jsx)(ue,{metaData:E,data:te}),Object(T.jsx)(Y.a,{onClick:function(){Object(Be.d)(Ye,"exit-button","click"),A(-1)},children:Object(T.jsx)(k.a,{className:"gray01"})})]}):Object(T.jsxs)("div",{className:be.a.layout__header,children:[Object(T.jsx)(f.a,{variant:"outline-primary",size:"lg",className:be.a.layout__btn,onClick:function(){Object(Be.d)(Ye,"exit-button","click"),!1===et?ht():window.close()},children:oe.e.exit}),Object(T.jsx)(W.a,{show:ft,labelTitle:oe.e.areYouSure,children:oe.e.draftIsBeingSaved,labelCancel:oe.e.cancel,labelConfirm:oe.e.continue,onCancel:vt,onConfirm:function(){return window.close()}}),void 0!==(null===E||void 0===E?void 0:E.form_data_id)&&void 0!==et&&Object(T.jsx)(re.a,{tooltipClassName:_e.a["form-fill-in__tooltip"],className:be.a["layout__save-state"],busy:rt,saved:et,retryCount:(null===E||void 0===E?void 0:E.form_data_id)?Ie:Ze,tooltip:Object(T.jsxs)("span",{children:[oe.e.everyChangeYouMake+" "+oe.e.click+" ",Object(T.jsx)("strong",{children:oe.e.submit+" "}),oe.e.toLockYourForm]})}),Object(T.jsxs)("div",{className:be.a.layout__actions,children:[E&&te&&Object(T.jsx)(Ee,{partialData:E,action:"print",children:Object(T.jsx)(f.a,{variant:"link",size:"lg",className:Object(L.a)(_e.a["print-button"],be.a.layout__btn),onClick:function(){return Object(Be.d)(Ye,"print-button","click")},children:"Print"})}),(null===E||void 0===E?void 0:E.form_data_id)&&Object(T.jsxs)(T.Fragment,{children:[!jt&&!(null===E||void 0===E?void 0:E.completed_timestamp)&&Object(T.jsx)(f.a,{variant:"outline-primary",size:"lg",className:be.a.layout__btn,onClick:function(){Object(Be.d)(Ye,"save-as-draft-button","click"),ot()},disabled:et,children:oe.e.saveAsDraft}
1),(null===E||void 0===E?void 0:E.completed_timestamp)?Object(T.jsx)(f.a,{variant:"primary",disabled:!0,size:"lg",className:be.a.layout__btn,children:dt?oe.e.patientSubmitted:oe.e.alreadySubmitted}):!dt&&Object(T.jsx)(f.a,{className:be.a.layout__btn,variant:"primary",size:"lg",disabled:void 0===(null===E||void 0===E?void 0:E.form_schema_revision)||null===(null===E||void 0===E?void 0:E.form_schema_revision)||!1===et||!Object.keys(te).length,onClick:function(){Object(Be.d)(Ye,"submit-button","click"),lt()},children:oe.e.submit})]})]})]}),Object(T.jsxs)(h.a,{fluid:!0,className:Object(L.a)(be.a.layout__content,N&&be.a["layout__content--phone"]),children:[je&&Object(T.jsx)(B.a,{variant:"danger",error:je,offset:-100}),Object(T.jsxs)(v.a,{children:[Object(T.jsx)(p.a,{md:3,children:Object(T.jsx)(ie,{metaData:E,isUserPro:dt,isAssessmentTemplate:mt,isAssessment:ve(null===E||void 0===E?void 0:E.form_schema_id)})}),Object(T.jsxs)(p.a,{md:7,className:_e.a["form-fill-in__body"],children:[!N&&Object(T.jsx)("h3",{className:be.a.layout__title,children:(null===E||void 0===E||null===(d=E.form_json_schema)||void 0===d?void 0:d.title)||""}),Ot&&Object(T.jsxs)("div",{className:_e.a["form-fill-in__suicidal"],children:[Object(T.jsx)(F,{}),Object(T.jsx)("span",{className:"ml-2",children:"Elevated risk for Suicidal Ideation"})]}),Object(T.jsx)(ue,{metaData:E,data:te}),!mt&&dt&&ve(null===E||void 0===E?void 0:E.form_schema_id)&&!(null===E||void 0===E?void 0:E.completed_timestamp)?Object(T.jsxs)("div",{className:_e.a["form-fill-in__patient-not-filled"],children:[Object(T.jsx)(w,{}),Object(T.jsx)("div",{className:_e.a["form-fill-in__patient-empty"],children:"Your patient has not completed the assignment"}),Object(T.jsx)(f.a,{onClick:function(){Object(Be.d)(Ye,"send-reminder-button","click"),St(!0)},children:"Send Reminder"})]}):Object(T.jsxs)(T.Fragment,{children:[Te.j&&Object(T.jsx)(Je.b,{imperativeHandleRef:S,templateElements:null!==(x=null===E||void 0===E||null===(y=E.schema_v2)||void 0===y?void 0:y.elements)&&void 0!==x?x:[],templateData:dt&&!(null===E||void 0===E?void 0:E.completed_timestamp)?{}:te,onChange:function(e,t){jt||(tt(!1),ct((function(n){return Object(j.a)(Object(j.a)({},n),{},Object(l.a)({},e,t))})))},disabled:!Z,isLocked:!!(null===E||void 0===E?void 0:E.completed_timestamp),showSuicidalWarningInPhq9:pt,showCopyToClipboard:!jt&&"orchid_pro"===(null===P||void 0===P?void 0:P.user_type)}),(null===E||void 0===E?void 0:E.form_json_schema)&&(null===E||void 0===E?void 0:E.form_ui_schema)&&!Te.c&&Object(T.jsx)(ae.a,{jsonSchema:null===E||void 0===E?void 0:E.form_json_schema,uiSchema:null===E||void 0===E?void 0:E.form_ui_schema,formData:dt&&!(null===E||void 0===E?void 0:E.completed_timestamp)?{}:te,onChange:function(e){jt||(tt(!1),ct(e))},disabled:!!(null===E||void 0===E?void 0:E.completed_timestamp),mode:jt?Pe.a.print:Pe.a.fill,suicidal:pt})]}),!mt&&dt&&ve(null===E||void 0===E?void 0:E.form_schema_id)&&Object(T.jsxs)(T.Fragment,{children:[Ct.isGAD7&&Object(T.jsx)(z,{}),Ct.isPHQ9&&Object(T.jsx)(U,{}),Ct.isEPDS&&Object(T.jsxs)("div",{className:_e.a["form-fill-in__epds-container"],children:[Object(T.jsx)("div",{className:_e.a["form-fill-in__source"],children:"Source"}),Object(T.jsx)("div",{className:_e.a["form-fill-in__source-text"],children:"Cox, J.L., Holden, J.M., and Sagovsky, R. 1987. Detection of postnatal depression: Development of the 10-item Edinburgh Postnatal Depression Scale. British Journal of Psychiatry 150:782-786."})]})]})]})]})]}),N&&Object(T.jsx)(V.a,{className:_e.a["form-fill-in__footer"],children:(null===E||void 0===E?void 0:E.form_data_id)&&Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)(p.a,{md:6,xs:6,className:"pl-0 pr-2",children:!jt&&!(null===E||void 0===E?void 0:E.completed_timestamp)&&Object(T.jsx)(f.a,{variant:"outline-primary",size:"lg",className:_e.a["form-fill-in__btn--phone"],onClick:function(){Object(Be.d)(Ye,"save-as-draft-button","click"),ot()},disabled:et,children:oe.e.saveAsDraft})}),Object(T.jsx)(p.a,{md:6,xs:6,className:"pl-2 pr-0",children:(null===E||void 0===E?void 0:E.completed_timestamp)?Object(T.jsx)(f.a,{variant:"primary",disabled:!0,size:"lg",className:_e.a["form-fill-in__btn--phone"],children:dt?oe.e.patientSubmitted:oe.e.alreadySubmitted}):!dt&&Object(T.jsx)(f.a,{className:_e.a["form-fill-in__btn--phone"],variant:"primary",size:"lg",disabled:void 0===(null===E||void 0===E?void 0:E.form_schema_revision)||null===(null===E||void 0===E?void 0:E.form_schema_revision)||!1===et||!Object.keys(te).length,onClick:function(){Object(Be.d)(Ye,"submit-button","click"),lt()},children:oe.e.submit})})]})})]})}}}]); 2//# sourceMappingURL=12.67d40093.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.