{"version":3,"sources":["utils.js","hooks/signature-focus-context.js","components/patient-elements/text-input.js","components/patient-elements/label.js","components/ui/button.js","components/patient-elements/signature-input.js","components/patient-elements/initials-input.js","components/patient-elements/checkbox-input.js","components/patient-elements/radio-group-input.js","hooks/use-modal.js","components/ui/modal/index.js","components/ui/loading/index.js","hooks/use-font-loader.js","components/patient-signature/verify-patient.jsx","components/patient-signature/index.js","components/patient-controls/index.js","components/form-validation.js","components/sign-document/sign-document.js","components/error-view/index.js","components/sign-document/index.js","components/print-view/print-view.jsx","components/print-view/index.js","redux/template-info.js","hooks/useTokenValidation.js","components/create-template/index.js","development.js","redux/layout.js","components/form-elements/controls.js","hooks/use-hover.js","hooks/use-resize.js","components/ui/input.js","components/ui/field.js","components/form-elements/text-element.js","components/form-elements/label-element.js","components/form-elements/signature-element.js","components/form-elements/initials-element.js","components/form-elements/checkbox-element.js","components/form-elements/radio-group-element.js","components/form-elements/element-defaults.js","hooks/useFormControlDrag.js","components/template-editor/form-controls/index.js","components/form-item.js","components/template-editor/template-workspace/index.js","components/template-editor/index.js","components/template-preview/index.js","components/copy-template/index.js","components/not-authorized/index.js","components/error-page/index.js","components/OldSignatureUrlHandler.jsx","assets/images/404-error.png","components/not-found/index.jsx","app.js","serviceWorkerRegistration.js","reportWebVitals.js","redux/store.js","index.js"],"names":["sortByPosition","items","R","pos","Math","floor","y","x","scrollToElement","element","container","document","getElementById","rec","getBoundingClientRect","scrollToTop","scrollTop","top","scrollToLeft","scrollLeft","left","focus","scrollTo","behavior","SignatureFocusContext","React","createContext","useSignatureFormFocus","layout","formElements","type","elms","map","index","id","indexedEls","useState","focusedEl","setFocusedEl","focusNextElement","focusPrevElement","focusElement","nextElement","useFieldFocus","useContext","isFocused","TextInput","size","attributes","printView","useFormikContext","values","handleChange","handleBlur","elemRef","useRef","useEffect","current","className","style","width","absoluteWidth","height","absoluteHeight","margin","absoluteTop","absoluteLeft","onClick","underline","background","paddingLeft","paddingRight","ref","onBlur","placeholder","placeHolder","onFocus","e","name","value","onChange","defaultProps","Label","fontSize","color","Button","children","rest","SignatureInput","signatureData","triggerSignature","coachIsSigning","setFieldValue","paddingTop","opacity","src","alt","backgroundSize","display","visible","InitialsInput","initials","justifyContent","flex","alignItems","CheckBoxInput","checked","target","label","RadioGroupInput","text","htmlFor","useModal","initialStatus","showModal","setShowModal","toggle","Modal","isShowing","hide","fullscreen","ReactDOM","createPortal","Fragment","tabIndex","role","body","Loading","font1","FontFaceObserver","font2","font3","useFontLoader","fontsLoaded","setFontsLoaded","Promise","all","loaded","then","validateTokenAndDob","token","dateOfBirth","fetch","method","headers","Authorization","JSON","stringify","response","ok","json","result","VerifyPatient","dateStr","setPatientIsVerified","location","useLocation","numberOfAttempts","setNumberOfAttempts","tokenString","queryString","parse","search","dob","setDob","isLoading","setIsLoading","errorMsg","setErrorMsg","flexDirection","textAlign","required","disabled","isNaN","Date","length","Error","message","PatientSignature","patientIsVerified","sigCanvas","clear","formValues","touched","errors","signatureRequired","setSignatureRequired","generateSignature","fontFamily","canvas","getCanvas","ctx","getContext","beginPath","font","textBaseline","fillStyle","fillText","stroke","autoGeneratedSig","setAutoGeneratedSig","off","on","patient_name","patient_initials","initialsFromName","s","undefined","names","split","substring","toUpperCase","getInitials","canvasProps","clearOnResize","getImageData","data","some","channel","isCanvasBlank","imgUrl","getTrimmedCanvas","toDataURL","timestamp","now","toLocaleString","setTimeout","console","error","verifyPatient","PatientFormControls","dmePreview","onCancel","pageCount","setCurrentPage","currentPage","handleSubmit","validateForm","isValid","fieldError","prop","fieldTouched","initialItemFocused","setInitialItemFocused","activeElement","elm","nextError","getNextError","generateValidationSchema","layoutValidation","filter","propEq","reduce","acc","assoc","Yup","getErrorMsg","shape","min","max","signature","SignDocumentScreen","handleSave","templateInfo","initialValues","coachSignature","signedByCoach","log","content","zoom","setZoom","template_id","files","imgLoaded","setImgLoaded","isFromEmailOrSMS","origin","Provider","signed_date","validationSchema","onSubmit","transform","visibility","onLoad","draggable","position","zIndex","userSelect","page","ErrorPage","errorMessage","goBack","padding","SignPatientDocument","history","useHistory","params","setLayout","templateInfoApi","useQuery","push","pathname","state","showBackBtn","layoutApi","templateSignedByCoachApi","signature_id","fetchCoachSignedLayoutApi","isError","isSignedByCoach","lay","fetchData","saveSignatureApi","useMutation","layoutWithValues","String","title","description","pick","coach","Accept","bulk","bulk_signatures","isFetching","isSuccess","minHeight","lineHeight","fontWeight","marginBottom","window","close","mutate","preview","PrintSignedDocumentScreen","enableReinitialize","PrintDocumentView","setInitialValues","signedLayoutApi","coachSignedLayoutApi","initValues","prev","cur","createSlice","initialState","fileName","pages","reducers","setTemplateInfo","payload","actions","selectTemplateInfo","validateUserToken","useTokenValidation","decodeToken","isAuthorized","setIsAuthorized","checkToken","btoa","browserHistory","UploadDocumentSchema","yup","file","isRequired","CreateSignatureTemplate","dispatch","useDispatch","setError","uploadSignatureTemplateApi","formData","FormData","append","company","isSubmitting","Form","minWidth","border","borderRadius","Field","marginTop","accept","Dimmer","active","Loader","primary","Development","inputs","setInputs","createTemplateLink","editTemplateLink","signSignatureLink","overflow","gridTemplateColumns","gridGap","to","layoutItems","clearLayout","moveFormItem","assocPath","updateFormItemAttributes","resizeFormItem","indexBy","addFormItem","updateFormItem","deleteFormItem","dissoc","selectLayout","createSelector","_","ElementControls","handleDelete","EditComponent","showControls","right","marginRight","Group","icon","Icon","negative","useHover","hovered","setHovered","handleMouseOver","useCallback","handleMouseOut","node","removeEventListener","addEventListener","useResize","initialSize","setSize","getSize","currentSize","elSize","deltaHeight","deltaWidth","onResize","event","handle","onResizeStop","newSize","Input","props","TextElement","origSize","isHovered","assigned_to_coach","resizeHandles","minConstraints","maxConstraints","readOnly","LabelElement","setWidth","inputShadowRef","offsetWidth","theWidth","SignatureElement","lockAspectRatio","InitialsElement","borderBottom","CheckBoxElement","RadioGroupElement","defaultValue","updatedElms","el","elIndex","elementDefaults","TEXT","LABEL","SIGNATURE","COACH_SIGNATURE","DATE","INITIALS","CHECKBOX","RADIO_GROUP","useFormControlDrag","dropZone","selectedControl","setSelectedControl","setActive","started","setStarted","useSelector","onDrop","bounds","OFFSETS","clientX","clientY","getRelativeCoords","uuidv4","onDragStart","taskName","dataTransfer","effectAllowed","setData","onDragOver","preventDefault","onDragEnd","clientPos","onDragLeave","FormControls","signaturesAdded","setSignaturesAdded","previewTemplate","setPreviewTemplate","saveSignatureFormLayoutApi","patients","coachSignatureExists","find","patientSignatureExists","maxHeight","alert","FormItem","handleDrag","ui","deltaPosition","setState","deltaX","deltaY","onStart","onStop","round","onControlledDrag","controlledPosition","onControlledDragStop","dragHandlers","this","onDrag","PureComponent","connect","TemplateWorkspace","forwardRef","dropZoneRef","currentImgUrl","item","TemplateEditor","TemplateLoader","metaResponse","metaData","layoutResponse","layoutData","enabled","Object","keys","TemplatePreview","CopyDocumentSchema","CopySignatureTemplate","copySignatureTemplateApi","NotAuthorized","justifyItems","maxWidth","OldSignatureUrlHandler","decodedToken","atob","urlParams","html_document_template_id","assignment_id","NotFound","class","NotFoundImage","queryClient","QueryClient","defaultOptions","queries","retry","refetchOnWindowFocus","App","client","path","component","CreateTemplate","SignDocument","exact","Component","displayName","Boolean","hostname","match","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","configureStore","reducer","layoutReducer","template_info","templateInfoReducer","rootElement","createBrowserHistory","render","store","navigator","serviceWorker","ready","registration","unregister","catch"],"mappings":"suBAoBaA,EAAiB,SAAAC,GAC5B,OAAOC,IAAW,CAChBA,KAAS,gBAAGC,EAAG,EAAHA,IAAG,OAAOC,KAAKC,MAAMF,EAAIG,EAAI,GAAG,IAC5CJ,KAAS,gBAAGC,EAAG,EAAHA,IAAG,OAAOC,KAAKC,MAAMF,EAAII,EAAE,KAFlCL,CAGJD,EACL,EAOaO,EAAkB,SAAAC,GAC7B,IAAIC,EAAYC,SAASC,eAAe,wBAGpCC,EAAMJ,EAAQK,wBACZC,EAAcL,EAAUM,UAAYH,EAAII,IAH3B,IAIbC,EAAeR,EA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,GAAM,SACrB,cAAC,IAAM,CAAC3S,QAASgE,GAAe,SAC9B,cAAC,GAAG,QAGRwO,IH2GI,kBAAmBI,WACrBA,UAAUC,cAAcC,MACrB1c,MAAK,SAAC2c,GACLA,EAAaC,YACf,IACCC,OAAM,SAACnX,GACND,QAAQC,MAAMA,EAAMnD,QACtB,IGvGNgZ,I","file":"static/js/main.0c88bb5a.chunk.js","sourcesContent":["import * as R from \"ramda\";\n\nexport const getInitials = s => {\n if (s === undefined) {\n return \"\";\n } else {\n const names = s.split(\" \");\n let initials = names[0].substring(0, 1).toUpperCase();\n if (names.length > 2) {\n initials += names[names.length - 2].substring(0, 1).toUpperCase();\n initials += names[names.length - 1].substring(0, 1).toUpperCase();\n } else if (names.length > 1) {\n initials += names[names.length - 1].substring(0, 1).toUpperCase();\n }\n return initials;\n }\n};\n\n// janky sort, idea was to give abituary weights primary left to right and don't look at specific pixes but sections of pages\n// so it follows more of a natural reading pattern\nexport const sortByPosition = items => {\n return R.sortWith([\n R.ascend(({ pos }) => Math.floor(pos.y / 10)),\n R.ascend(({ pos }) => Math.floor(pos.x))\n ])(items);\n};\n\nexport const getNextError = (formElements, errors) =>\n R.find(({ id }) => {\n return !!R.prop(id, errors);\n })(formElements);\n\nexport const scrollToElement = element => {\n var container = document.getElementById(\"form-builder-preview\");\n const OFFSET_TOP = 100;\n const OFFSET_LEFT = 50;\n var rec = element.getBoundingClientRect();\n const scrollToTop = container.scrollTop + rec.top - OFFSET_TOP;\n const scrollToLeft = container.scrollLeft + rec.left - OFFSET_LEFT;\n element.focus();\n container.scrollTo({\n top: scrollToTop,\n left: scrollToLeft,\n behavior: \"smooth\"\n });\n};\n","import React from \"react\";\nimport * as R from \"ramda\";\nimport { sortByPosition } from \"../utils\";\n\nconst SignatureFocusContext = React.createContext();\n\nexport default SignatureFocusContext;\n\nexport const useSignatureFormFocus = (layout = []) => {\n const formElements = R.pipe(\n sortByPosition,\n R.filter(({ type }) => type !== \"LABEL\"),\n elms => elms.map(({ id, pos }, index) => ({ id, pos, index }))\n )(layout);\n const indexedEls = R.indexBy(R.prop(\"id\"), formElements);\n const [focusedEl, setFocusedEl] = React.useState({ index: -1, id: null });\n const focusNextElement = () => {\n const nextElm = formElements[focusedEl.index + 1];\n if (nextElm) setFocusedEl(formElements[focusedEl.index + 1]);\n };\n const focusPrevElement = () => {\n const nextElm = formElements[focusedEl.index - 1];\n if (nextElm) setFocusedEl(formElements[focusedEl.index - 1]);\n };\n const focusElement = id => {\n if (id !== false) {\n setFocusedEl({ id: null, index: focusedEl.index });\n const nextElement = R.prop(id, indexedEls);\n if (nextElement) {\n setFocusedEl(nextElement);\n }\n }\n };\n return {\n focusedEl,\n focusNextElement,\n focusPrevElement,\n focusElement,\n formElements\n };\n};\n\nexport const useFieldFocus = ({ id }) => {\n const { focusedEl, focusElement } = React.useContext(SignatureFocusContext);\n return {\n focusElement,\n focusedEl,\n isFocused: focusedEl.id === id\n };\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useFieldFocus } from \"../../hooks/signature-focus-context\";\nimport { useFormikContext } from \"formik\";\nimport { scrollToElement } from \"../../utils\";\nimport \"./text-input.scss\";\n\nconst TextInput = ({ type, id, pos, size, attributes, index, printView }) => {\n const { focusElement, isFocused } = useFieldFocus({\n id,\n attributes\n });\n const { values, handleChange, handleBlur } = useFormikContext();\n const elemRef = React.useRef();\n React.useEffect(() => {\n if (isFocused && elemRef && elemRef.current) {\n scrollToElement(elemRef.current);\n }\n }, [isFocused]);\n return (\n {\n focusElement(id);\n }}\n >\n {!printView ? (\n {\n focusElement(id);\n }}\n name={id}\n id={id}\n style={{\n width: \"100%\",\n height: \"100%\",\n paddingLeft: 2,\n paddingRight: 2,\n background: attributes.background\n }}\n value={values[id]}\n onChange={handleChange}\n />\n ) : (\n \n {values[id]}\n \n )}\n \n );\n};\n\nTextInput.propTypes = {\n id: PropTypes.string.isRequired,\n size: PropTypes.object.isRequired,\n printView: PropTypes.bool\n};\n\nTextInput.defaultProps = {\n type: \"text\"\n};\n\nexport default TextInput;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport \"./label.scss\";\n\nconst Label = ({ id, pos, attributes }) => {\n return (\n \n
{attributes.value}
\n \n );\n};\n\nLabel.propTypes = {\n id: PropTypes.string.isRequired,\n};\n\nexport default Label;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport \"./button.scss\";\n\nconst Button = ({ onClick, children, className, ...rest }) => {\n return (\n \n );\n};\n\nButton.defaultProps = {};\n\nButton.propTypes = {\n onClick: PropTypes.func,\n children: PropTypes.node,\n className: PropTypes.string\n};\n\nexport default Button;\n","import React, { useRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport Button from \"../ui/button\";\nimport { useFieldFocus } from \"../../hooks/signature-focus-context\";\nimport { useFormikContext } from \"formik\";\nimport { scrollToElement } from \"../../utils\";\nimport \"./signature-input.scss\";\n\nconst SignatureInput = ({ id, pos, size, signatureData, attributes, triggerSignature, coachIsSigning }) => {\n const { isFocused, focusElement } = useFieldFocus({\n id,\n attributes\n });\n const { values, setFieldValue } = useFormikContext();\n const elemRef = useRef();\n React.useEffect(() => {\n if (isFocused && elemRef && elemRef.current) {\n scrollToElement(elemRef.current);\n }\n }, [isFocused, elemRef]);\n\n if(triggerSignature !== \"\" && !coachIsSigning){\n values[id] = triggerSignature;\n }\n \n return (\n {\n focusElement(id);\n }}\n >\n {\n focusElement(id);\n }}\n name={id}\n id={id}\n value={values[id]}\n style={{\n opacity: \"0\"\n }}\n />\n \n {!values[id] ? (\n
\n {\n setFieldValue(id, signatureData);\n }}\n >\n Signature\n
\n \n ) : (\n
\n \n {(triggerSignature == \"\" || coachIsSigning) && setFieldValue(id, \"\")}\n style={{ visible: isFocused ? \"visible\" : \"hidden\" }}\n >\n Clear\n }\n
\n )}\n \n \n );\n};\n\nSignatureInput.propTypes = {\n id: PropTypes.string.isRequired,\n signatureData: PropTypes.string.isRequired,\n value: PropTypes.string\n};\n\nexport default SignatureInput;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport Button from \"../ui/button\";\nimport { useFieldFocus } from \"../../hooks/signature-focus-context\";\nimport { useFormikContext } from \"formik\";\nimport { scrollToElement } from \"../../utils\";\nimport \"./signature-input.scss\";\n\nconst InitialsInput = ({ id, pos, size, initials, attributes }) => {\n const { isFocused, focusElement } = useFieldFocus({\n id,\n attributes,\n });\n const { values, setFieldValue } = useFormikContext();\n const elemRef = React.useRef();\n React.useEffect(() => {\n if (isFocused && elemRef && elemRef.current) {\n scrollToElement(elemRef.current);\n }\n }, [isFocused]);\n return (\n {\n focusElement(id);\n }}\n >\n {\n focusElement(id);\n }}\n name={id}\n id={id}\n value={values[id]}\n style={{\n opacity: \"0\",\n }}\n />\n \n {!values[id] ? (\n
\n {\n setFieldValue(id, initials);\n }}\n >\n Initial\n
\n \n ) : (\n
\n \n {initials}\n
\n setFieldValue(id, \"\")}\n >\n Clear\n \n \n )}\n \n \n );\n};\n\nInitialsInput.propTypes = {\n id: PropTypes.string.isRequired,\n signatureData: PropTypes.string.isRequired,\n value: PropTypes.string,\n};\n\nexport default InitialsInput;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useFieldFocus } from \"../../hooks/signature-focus-context\";\nimport { useFormikContext } from \"formik\";\nimport { scrollToElement } from \"../../utils\";\nimport \"./checkbox-input.scss\";\n\nconst CheckBoxInput = ({ id, pos, size, attributes }) => {\n const { isFocused, focusElement } = useFieldFocus({\n id,\n attributes\n });\n const { values, setFieldValue } = useFormikContext();\n const elemRef = React.useRef();\n React.useEffect(() => {\n if (isFocused && elemRef && elemRef.current) {\n scrollToElement(elemRef.current);\n }\n }, [isFocused]);\n return (\n focusElement(id)}\n >\n \n
\n setFieldValue(id, target.checked)}\n />\n {attributes.label}\n
\n \n \n );\n};\n\nCheckBoxInput.propTypes = {\n id: PropTypes.string.isRequired\n};\n\nexport default CheckBoxInput;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useFieldFocus } from \"../../hooks/signature-focus-context\";\nimport { useFormikContext } from \"formik\";\nimport { scrollToElement } from \"../../utils\";\nimport \"./radio-group-input.scss\";\n\nconst RadioGroupInput = ({ id, pos, size, attributes }) => {\n const { isFocused, focusElement } = useFieldFocus({\n id,\n attributes\n });\n const elemRef = React.useRef();\n React.useEffect(() => {\n if (isFocused && elemRef && elemRef.current) {\n scrollToElement(elemRef.current);\n }\n }, [isFocused]);\n const { values, setFieldValue } = useFormikContext();\n return (\n focusElement(id)}\n >\n \n
\n {attributes.elms?.map(({ value, text }) => (\n
\n {\n setFieldValue(id, target.name);\n }}\n />\n \n
\n ))}\n
\n \n \n );\n};\n\nRadioGroupInput.propTypes = {\n id: PropTypes.string.isRequired\n};\n\nexport default RadioGroupInput;\n","import { useState } from \"react\";\n\nconst useModal = (initialStatus = false) => {\n const [showModal, setShowModal] = useState(initialStatus);\n\n function toggle() {\n setShowModal(!showModal);\n }\n\n return {\n showModal,\n setShowModal,\n toggle,\n };\n};\n\nexport default useModal;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport ReactDOM from \"react-dom\";\nimport \"./style.scss\";\n\nconst Modal = ({ isShowing, hide, children, fullscreen }) =>\n isShowing\n ? ReactDOM.createPortal(\n \n
\n \n
\n {hide && (\n
\n \n ×\n \n
\n )}\n
{children}
\n
\n
\n
,\n document.body\n )\n : null;\n\nModal.propTypes = {\n isShowing: PropTypes.bool,\n hide: PropTypes.func,\n children: PropTypes.node,\n fullscreen: PropTypes.bool,\n};\n\nexport default Modal;\n","import React from \"react\";\nimport \"./style.scss\";\n\nconst Loading = () => {\n return
Loading
;\n};\n\nLoading.defaultProps = {};\n\nLoading.propTypes = {};\n\nexport default Loading;\n","import React from \"react\";\nimport FontFaceObserver from \"fontfaceobserver\";\n\nvar font1 = new FontFaceObserver(\"Sofia\");\nvar font2 = new FontFaceObserver(\"Arizonia\");\nvar font3 = new FontFaceObserver(\"Allura\");\n\nconst useFontLoader = () => {\n const [fontsLoaded, setFontsLoaded] = React.useState(false);\n React.useEffect(() => {\n Promise.all([font1.loaded, font2.loaded, font3.loaded]).then(() => {\n setFontsLoaded(true);\n });\n }, []);\n return [fontsLoaded];\n};\nexport default useFontLoader;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useLocation } from \"react-router-dom\";\nimport queryString from \"query-string\";\nimport Loading from \"../ui/loading\";\n\nconst validateTokenAndDob = async (token, { dateOfBirth }) => {\n const response = await fetch(`/api/auth/validate-token-and-dob`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${token}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ token, dateOfBirth }),\n });\n if (!response.ok) throw response.text();\n const result = await response.json();\n return result;\n};\n\nfunction isDateValid(dateStr) {\n return !isNaN(new Date(dateStr));\n}\n\nconst VerifyPatient = ({ setPatientIsVerified }) => {\n const location = useLocation();\n const [numberOfAttempts, setNumberOfAttempts] = React.useState(1);\n const tokenString = queryString.parse(location.search).token;\n const [dob, setDob] = React.useState(\"\");\n const [isLoading, setIsLoading] = React.useState(false);\n const [errorMsg, setErrorMsg] = React.useState(\"\");\n\n return (\n \n
\n
\n
\n \n setDob(e.target.value)}\n name=\"patient_dob\"\n required\n />\n
\n
\n \n {\n try {\n setIsLoading(true);\n setErrorMsg(\"\");\n if (tokenString && tokenString.length > 0) {\n const resultToken = await validateTokenAndDob(tokenString, {\n dateOfBirth: dob,\n numberOfAttempts,\n });\n if (resultToken) {\n setPatientIsVerified(true);\n }\n } else throw new Error(\"Invalid Link\");\n } catch (err) {\n setErrorMsg(\n err.message ?? \"Birth dates do not match. Try again.\",\n );\n setNumberOfAttempts((x) => x++);\n } finally {\n setIsLoading(false);\n }\n }}\n >\n Submit\n \n {isLoading && }\n
\n {errorMsg &&
{errorMsg}
}\n {/* {numberOfAttempts > 1 &&
Birth dates don't match. Try again.
} */}\n \n \n );\n};\n\nVerifyPatient.propTypes = {\n setPatientIsVerified: PropTypes.func.isRequired,\n};\n\nexport default VerifyPatient;\n","import React, { useRef } from \"react\";\nimport SignaturePad from \"react-signature-canvas\";\nimport useModal from \"@hooks/use-modal\";\nimport Modal from \"../ui/modal\";\nimport { getInitials } from \"../../utils\";\nimport { useFormikContext } from \"formik\";\nimport Loading from \"../ui/loading\";\nimport useFontLoader from \"@hooks/use-font-loader\";\nimport VerifyPatient from \"./verify-patient\";\nimport \"./style.scss\";\n\n// returns true if all color channels in each pixel are 0 (or \"blank\")\nfunction isCanvasBlank(canvas) {\n return !canvas\n .getContext(\"2d\")\n .getImageData(0, 0, canvas.width, canvas.height)\n .data.some((channel) => channel !== 0);\n}\n\nconst PatientSignature = ({ patientIsVerified, setPatientIsVerified }) => {\n const sigCanvas = useRef();\n const { showModal, setShowModal } = useModal(true);\n const clear = () => sigCanvas.current.clear();\n const {\n values: formValues,\n setFieldValue,\n handleChange,\n touched,\n errors,\n handleBlur,\n } = useFormikContext();\n const [signatureRequired, setSignatureRequired] = React.useState(\"\");\n\n const saveSignature = () => {\n try {\n const canvas = sigCanvas.current.getCanvas();\n if (\n isCanvasBlank(canvas) ||\n !formValues.patient_name ||\n !formValues.patient_initials\n ) {\n setSignatureRequired(\"Signature Is Required\");\n return;\n }\n const imgUrl = sigCanvas.current\n .getTrimmedCanvas()\n .toDataURL(\"image/svg+xml\");\n setFieldValue(\"signature\", imgUrl);\n const timestamp = new Date(Date.now()).toLocaleString();\n setFieldValue(\"signed_date\", timestamp);\n setTimeout(() => {\n setShowModal(false);\n }, 100);\n } catch (e) {\n console.error(e);\n }\n };\n const generateSignature = (text, fontFamily) => {\n const fontSize = 22,\n color = \"black\",\n textAlign = \"left\",\n textBaseline = \"top\";\n sigCanvas.current.clear();\n const canvas = sigCanvas.current.getCanvas();\n\n const ctx = canvas.getContext(\"2d\");\n\n ctx.beginPath();\n ctx.font = fontSize + \"px \" + fontFamily;\n ctx.textAlign = textAlign;\n ctx.textBaseline = textBaseline;\n ctx.fillStyle = color;\n ctx.fillText(text, canvas.width / 2 - 100, canvas.height / 2);\n ctx.stroke();\n };\n const [autoGeneratedSig, setAutoGeneratedSig] = React.useState(true);\n React.useEffect(() => {\n if (sigCanvas && patientIsVerified) {\n if (autoGeneratedSig) sigCanvas.current.off();\n else sigCanvas.current.on();\n }\n setSignatureRequired(\"\");\n }, [autoGeneratedSig, sigCanvas, patientIsVerified]);\n const [fontsLoaded] = useFontLoader();\n\n if (!patientIsVerified) {\n return (\n \n );\n }\n\n return (\n \n {!fontsLoaded && }\n
\n
\n
\n \n {\n handleChange(e);\n const { target } = e;\n if (autoGeneratedSig) {\n generateSignature(target.value, formValues.font);\n }\n }}\n onBlur={(e) => {\n handleBlur(e);\n const { target } = e;\n if (target.value && !formValues.patient_initials) {\n const initialsFromName = getInitials(target.value);\n setFieldValue(\"patient_initials\", initialsFromName);\n }\n }}\n />\n
\n
\n \n \n
\n
\n
\n
\n {\n setFieldValue(\"font\", target.value);\n if (formValues.patient_name)\n generateSignature(formValues.patient_name, target.value);\n }}\n style={{ fontFamily: formValues.font }}\n >\n \n \n \n \n
\n
\n
\n {autoGeneratedSig ? \"Auto Generated Signature\" : \"Draw Signature\"}\n
\n
\n \n {!autoGeneratedSig && (\n \n )}\n
\n \n {signatureRequired}\n
\n
\n {\n clear();\n setAutoGeneratedSig(target.checked);\n if (target.checked) {\n generateSignature(formValues.patient_name, formValues.font);\n }\n }}\n name=\"autoGeneratedSig\"\n />\n \n
\n \n \n Save\n \n \n \n
\n

Paperwork can be no fun

\n
\n
\n );\n};\n\nexport default PatientSignature;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { prop } from \"ramda\";\nimport SignatureFocusContext from \"../../hooks/signature-focus-context\";\nimport { useFormikContext } from \"formik\";\nimport { GrFormNext, GrFormPrevious } from \"react-icons/gr\";\nimport { getNextError, scrollToElement } from \"../../utils\";\nimport \"./style.scss\";\n\nconst PatientFormControls = ({ dmePreview, onCancel }) => {\n const {\n focusedEl,\n focusElement,\n pageCount,\n setCurrentPage,\n currentPage,\n formElements,\n } = React.useContext(SignatureFocusContext);\n const { errors, handleSubmit, touched, validateForm, isValid } =\n useFormikContext();\n const fieldError = prop(prop(\"id\", focusedEl), errors);\n const fieldTouched = prop(prop(\"id\", focusedEl), touched);\n React.useEffect(() => {\n validateForm();\n }, [validateForm]);\n const [initialItemFocused, setInitialItemFocused] = React.useState(false);\n\n React.useEffect(() => {\n const activeElement = formElements[focusedEl.index];\n if (activeElement) {\n const elm = document.getElementById(activeElement.id);\n if (elm && !initialItemFocused) {\n scrollToElement(elm);\n setInitialItemFocused(true);\n }\n }\n }, [focusedEl, formElements, initialItemFocused]);\n return (\n \n
\n
Pages
\n setCurrentPage((x) => --x)}\n >\n \n
\n
\n {currentPage + 1}/{pageCount}\n
\n setCurrentPage((x) => ++x)}\n className={`button default small ${\n currentPage + 1 >= pageCount ? \"disabled\" : \"\"\n }`}\n >\n \n \n\n {onCancel && (\n
\n Back\n
\n )}\n
\n {fieldError}\n
\n {!dmePreview && (\n {\n if (!isValid) {\n const nextError = getNextError(formElements, errors);\n if (nextError && nextError.id) focusElement(nextError.id);\n }\n handleSubmit();\n }}\n >\n Submit\n \n )}\n \n
\n );\n};\n\nPatientFormControls.propTypes = {\n zoom: PropTypes.number,\n setZoom: PropTypes.func.isRequired,\n dmePreview: PropTypes.bool,\n};\n\nexport default PatientFormControls;\n","import * as Yup from \"yup\";\nimport { assoc, propEq } from \"ramda\";\n\nconst generateValidationSchema = layout => {\n const layoutValidation = layout\n .filter(\n ({ type, attributes }) =>\n type !== \"LABEL\" && propEq(\"required\", true, attributes)\n )\n .reduce(\n (acc, { id, type }) =>\n assoc(id, Yup.string().required(getErrorMsg(type)), acc),\n {}\n );\n return Yup.object().shape({\n patient_name: Yup.string()\n .min(2, \"Name Is Required\")\n .max(200, \"Too many characters\")\n .required(\"Required\"),\n patient_initials: Yup.string()\n .max(5, \"Too many characters\")\n .required(\"Required\"),\n signature: Yup.string().required(\"Signature Required\"),\n ...layoutValidation\n });\n};\n\nexport default generateValidationSchema;\n\nconst getErrorMsg = type => {\n switch (type) {\n case \"SIGNATURE\":\n return \"Signature is required\";\n case \"INITIALS\":\n return \"Your Initials are required\";\n case \"DATE\":\n return \"Date is required\";\n case \"TEXT\":\n return \"Field is required\";\n default:\n return \"Field is required\";\n }\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n TextInput,\n Label,\n SignatureInput,\n InitialsInput,\n RadioGroupInput,\n CheckBoxInput,\n} from \"../patient-elements\";\nimport PatientSignature from \"../patient-signature\";\nimport PatientControls from \"../patient-controls\";\nimport SignatureFocusContext, {\n useSignatureFormFocus,\n} from \"../../hooks/signature-focus-context\";\nimport { Formik } from \"formik\";\nimport generateValidationSchema from \"../form-validation\";\nimport Loading from \"../ui/loading\";\nimport { assoc } from \"ramda\";\nimport \"./style.scss\";\n\nconst Y_OFFSET = 35; // from edit controls in formbuilder\n\nconst SignDocumentScreen = ({\n layout,\n handleSave,\n dmePreview,\n printView,\n onCancel,\n templateInfo,\n initialValues,\n coachSignature,\n signedByCoach,\n}) => {\n console.log(onCancel);\n const content = React.useRef();\n const [zoom, setZoom] = React.useState(1);\n const [currentPage, setCurrentPage] = React.useState(0);\n const imgUrl = `/api/template/download/${templateInfo.template_id}/${templateInfo.files[currentPage]}?token=${templateInfo.token}`;\n const {\n focusElement,\n focusNextElement,\n focusPrevElement,\n formElements,\n focusedEl,\n } = useSignatureFormFocus(layout);\n const [imgLoaded, setImgLoaded] = React.useState(false);\n\n const isFromEmailOrSMS =\n (templateInfo?.origin === \"email\" || templateInfo?.origin === \"sms\") ??\n false;\n const [patientIsVerified, setPatientIsVerified] =\n React.useState(!isFromEmailOrSMS);\n return (\n \n type !== \"LABEL\")\n .reduce((acc, { id }) => assoc(id, \"\", acc), {\n signature: \"\",\n patient_name: \"\",\n signed_date: \"\",\n patient_initials: \"\",\n font: \"Sofia\",\n })\n }\n validationSchema={!coachSignature && generateValidationSchema(layout)}\n onSubmit={(values) => {\n handleSave(values);\n }}\n >\n {({ values }) => (\n \n {!printView && !dmePreview && imgLoaded && (\n \n )}\n {!imgLoaded && }\n \n setImgLoaded(true)}\n alt=\"document\"\n draggable=\"false\"\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n zIndex: 0,\n width: 916,\n userSelect: \"none\",\n }}\n onClick={() => {\n focusElement(false);\n }}\n />\n {layout\n .filter((x) => x.page === currentPage)\n .map(({ id, type, pos, size, attributes, value }) => (\n \n {type === \"TEXT\" && !coachSignature && (\n \n )}\n {type === \"LABEL\" && (\n \n )}\n \n \n );\n};\n\nexport default SignDocumentScreen;\n\nSignDocumentScreen.propTypes = {\n layout: PropTypes.arrayOf(PropTypes.object).isRequired,\n templateInfo: PropTypes.object.isRequired,\n handleSave: PropTypes.func,\n dmePreview: PropTypes.bool,\n printView: PropTypes.bool,\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nconst ErrorPage = ({ errorMessage, goBack }) => {\n return (\n \n

Woops Sorry, something went wrong

\n
{errorMessage}
\n
{goBack && }
\n \n );\n};\n\nErrorPage.propTypes = {\n errorMessage: PropTypes.string,\n goBack: PropTypes.bool\n};\n\nexport default ErrorPage;\n","import React, { useState, useEffect } from \"react\";\nimport PropTypes from \"prop-types\";\nimport SignDocument from \"./sign-document\";\nimport Loading from \"@components/ui/loading\";\nimport ErrorPage from \"@components/error-view\";\nimport { pick } from \"ramda\";\nimport SignatureScreen from \"@components/sign-document/sign-document\";\nimport { useQuery, useMutation } from \"react-query\";\nimport { useLocation, useHistory } from \"react-router-dom\";\nimport queryString from \"query-string\";\nimport \"./style.scss\";\n\nconst SignPatientDocument = () => {\n const location = useLocation();\n const history = useHistory();\n const params = queryString.parse(location.search);\n const [layout, setLayout] = useState(null);\n\n const templateInfoApi = useQuery([\"meta\", params], async () => {\n try {\n const response = await fetch(\n `/api/template/download/${params.template_id}/meta.json?token=${params.token}`,\n );\n if (!response.ok) throw new Error(\"Error fetching template info\");\n const data = await response.json();\n return { ...params, ...data };\n } catch (err) {\n history.push({\n pathname: \"/error-page\",\n state: { errorMessage: \"Invalid Link\", showBackBtn: false },\n });\n }\n });\n\n const layoutApi = async () => {\n const response = await fetch(\n `/api/template/download/${params.template_id}/layout.json?token=${params.token}`\n );\n const data = await response.json();\n return data;\n };\n\n const templateInfo = templateInfoApi.data ?? {};\n\n const templateSignedByCoachApi = useQuery([\"signed_by_coach\", params], async () => {\n const response = await fetch(`/api/signature/${params.signature_id}/coach-signed`, {\n method: \"GET\"\n });\n const result = await response.json();\n return result;\n });\n\n const fetchCoachSignedLayoutApi = async () => {\n const response = await fetch(\n `/api/template/download/${params.template_id}/${params.signature_id}_coach_signed.json?token=${params.token}`\n );\n\n const result = await response.json();\n return result;\n };\n\n useEffect(() => {\n async function fetchData() {\n\n if (!templateSignedByCoachApi.isLoading && !templateSignedByCoachApi.isError && layout == null) {\n const isSignedByCoach = templateSignedByCoachApi.data;\n let lay = [];\n if (isSignedByCoach) {\n lay = await fetchCoachSignedLayoutApi();\n }\n else {\n lay = await layoutApi();\n }\n setLayout(lay);\n }\n }\n\n fetchData();\n }, [templateSignedByCoachApi])\n\n const saveSignatureApi = useMutation(\n async ({ formValues, layout, templateInfo }) => {\n const layoutWithValues = layout.map((x) => ({\n ...x,\n value: String(formValues[x.id]),\n }));\n const signatureData = {\n layout: layoutWithValues,\n template_id: templateInfo.template_id,\n id: templateInfo.signature_id,\n title: templateInfo.title ?? \"title\",\n description: \"signed patient document\",\n ...pick(\n [\n \"font\",\n \"patient_initials\",\n \"patient_name\",\n \"signature\",\n \"signed_date\",\n ],\n formValues,\n ),\n signature: \"\",\n };\n let response = null\n\n if (!params.coach) {\n response = await fetch(\"/api/signature/save\", {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${params.token}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(signatureData),\n });\n }\n else {\n if(params.bulk && params.bulk.length > 0){\n signatureData.bulk_signatures = params.bulk.split(',')\n }\n response = await fetch(\"/api/signature/coach/save\", {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${params.token}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(signatureData),\n });\n }\n\n if (!response.ok) throw response.text();\n return response;\n },\n );\n if (\n templateInfoApi.isFetching ||\n saveSignatureApi.isLoading ||\n templateSignedByCoachApi.isLoading ||\n layout == null\n )\n return ;\n else if (\n templateInfoApi.isError ||\n saveSignatureApi.isError ||\n templateSignedByCoachApi.isError\n )\n return (\n \n );\n else if (saveSignatureApi.isSuccess)\n return (\n \n \n Thank you, your document has submitted successfully.\n \n \n Please close this window.\n

\n {\n window.close();\n }}\n >\n Close\n \n \n );\n else\n return (\n {\n console.log(\"save\");\n saveSignatureApi.mutate({\n formValues,\n layout: layout ?? [],\n templateInfo,\n });\n }}\n templateInfo={templateInfo}\n layout={layout ?? []}\n preview\n coachSignature={templateSignedByCoachApi.data ? params.coach : (params.coach || false)}\n signedByCoach={templateSignedByCoachApi.data}\n />\n );\n};\n\nexport default SignPatientDocument;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n TextInput,\n Label,\n SignatureInput,\n InitialsInput,\n RadioGroupInput,\n CheckBoxInput,\n} from \"../patient-elements\";\nimport SignatureFocusContext, {\n useSignatureFormFocus,\n} from \"../../hooks/signature-focus-context\";\nimport { Formik } from \"formik\";\nimport generateValidationSchema from \"../form-validation\";\nimport Loading from \"../ui/loading\";\nimport { assoc } from \"ramda\";\nimport \"./style.scss\";\n\nconst Y_OFFSET = 35; // from edit controls in formbuilder\n\nconst PrintSignedDocumentScreen = ({ layout, templateInfo, initialValues }) => {\n const content = React.useRef();\n const [imgLoaded, setImgLoaded] = React.useState(false);\n const [currentPage, setCurrentPage] = React.useState(0);\n const {\n focusElement,\n focusNextElement,\n focusPrevElement,\n formElements,\n focusedEl,\n } = useSignatureFormFocus(layout);\n return (\n \n type !== \"LABEL\")\n .reduce((acc, { id }) => assoc(id, \"\", acc), {\n signature: \"\",\n patient_name: \"\",\n signed_date: \"\",\n patient_initials: \"\",\n font: \"Sofia\",\n })\n }\n validationSchema={generateValidationSchema(layout)}\n onSubmit={(values) => {}}\n >\n {({ values, handleSubmit }) => (\n \n {!imgLoaded && }\n <>\n
\n {templateInfo.files.map((x, index) => (\n \n setImgLoaded(true)}\n alt=\"document\"\n draggable=\"false\"\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n zIndex: 0,\n width: 916,\n userSelect: \"none\",\n }}\n />\n\n {layout\n .filter((x) => x.page === index)\n .map(({ id, type, pos, size, attributes, value }, index) => (\n \n {type === \"TEXT\" && (\n \n )}\n {type === \"LABEL\" && (\n
\n ))}\n \n ))}\n \n \n
\n )}\n \n \n );\n};\n\nexport default PrintSignedDocumentScreen;\n\nPrintSignedDocumentScreen.propTypes = {\n layout: PropTypes.arrayOf(PropTypes.object).isRequired,\n templateInfo: PropTypes.object.isRequired,\n};\n","import React, { useState, useEffect } from \"react\";\nimport PrintSignedDocumentScreen from \"./print-view\";\nimport { useLocation } from \"react-router-dom\";\nimport queryString from \"query-string\";\nimport { useQuery } from \"react-query\";\nimport Loading from \"../ui/loading\";\nimport \"./style.scss\";\n\nconst PrintDocumentView = () => {\n const location = useLocation();\n const params = queryString.parse(location.search);\n const [layout, setLayout] = useState(null);\n const [initialValues, setInitialValues] = useState(null);\n\n const templateInfoApi = useQuery([\"meta\", params], async () => {\n const response = await fetch(\n `/api/template/download/${params.template_id}/meta.json?token=${params.token}`\n );\n const data = await response.json();\n return { ...params, ...data };\n });\n\n const signedLayoutApi = async () => {\n const response = await fetch(\n `/api/template/download/${params.template_id}/${params.signature_id}_signed.json?token=${params.token}`\n );\n const result = await response.json();\n return result;\n };\n\n const coachSignedLayoutApi = async () => {\n const response = await fetch(\n `/api/template/download/${params.template_id}/${params.signature_id}_coach_signed.json?token=${params.token}`\n );\n const result = await response.json();\n return result;\n };\n\n const templateSignedByCoachApi = useQuery([\"signed_by_coach\", params], async () => {\n const response = await fetch(`/api/signature/${params.signature_id}/coach-signed`, {\n method: \"GET\"\n });\n const result = await response.json();\n return result;\n });\n\n useEffect(() => {\n\n async function fetchData() {\n if (!templateSignedByCoachApi.isLoading && !templateSignedByCoachApi.isError && layout == null) {\n const isSignedByCoach = templateSignedByCoachApi.data;\n let lay = [];\n if (isSignedByCoach && params.coach == true) {\n lay = await coachSignedLayoutApi();\n }\n else {\n lay = await signedLayoutApi();\n }\n setLayout(lay);\n const initValues = lay.reduce((prev, cur) => {\n return { [cur.id]: cur.value, ...prev };\n }, {}) ?? {};\n setInitialValues(initValues);\n }\n }\n\n fetchData();\n }, [templateSignedByCoachApi])\n\n return templateInfoApi.isLoading || templateSignedByCoachApi.isLoading || layout == null || initialValues == null ? (\n
\n \n
\n ) : (\n \n );\n};\n\nexport default PrintDocumentView;\n","import { createSlice } from \"@reduxjs/toolkit\";\r\nimport { prop } from \"ramda\";\r\n\r\nexport const templateInfo = createSlice({\r\n name: \"template_info\",\r\n initialState: {\r\n loaded: false,\r\n template_id: \"\",\r\n token: \"\",\r\n title: \"\",\r\n description: \"\",\r\n fileName: \"\",\r\n pages: 1,\r\n files: [],\r\n currentPage: 0\r\n },\r\n reducers: {\r\n setTemplateInfo: (state, { payload }) => ({ ...state, ...payload }),\r\n setCurrentPage: (state, { payload }) => ({ ...state, currentPage: payload })\r\n }\r\n});\r\n\r\nexport const { setTemplateInfo, setCurrentPage } = templateInfo.actions;\r\n\r\n// The function below is called a selector and allows us to select a value from\r\n// the state. Selectors can also be defined inline where they're used instead of\r\n// in the slice file. For example: `useSelector((state) => state.counter.value)`\r\n// export const selectLayout = state => state.layout;\r\nexport const selectTemplateInfo = prop(\"template_info\"); //createSelector(prop(\"document\"), values);\r\n\r\nexport default templateInfo.reducer;\r\n","import { useEffect, useState } from \"react\";\nimport { browserHistory } from \"../index\";\n\nexport const validateUserToken = async (token) => {\n const response = await fetch(`/api/auth`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${token}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ token }),\n });\n if (!response.ok) throw response.text();\n const result = await response.json();\n return result;\n};\n\nconst useTokenValidation = (token, decodeToken = false) => {\n const [isAuthorized, setIsAuthorized] = useState();\n async function checkToken() {\n try {\n const isValid = await validateUserToken(\n decodeToken ? window.btoa(token) : token\n );\n if (!isValid) browserHistory.push(\"/not-authorized\");\n setIsAuthorized(isValid);\n } catch (e) {\n /* handle error */\n browserHistory.push(\"/not-authorized\");\n }\n }\n useEffect(() => {\n checkToken();\n }, [token]); // eslint-disable-line\n return isAuthorized;\n};\n\nexport default useTokenValidation;\n","import React, { useState } from \"react\";\nimport { useLocation, useHistory } from \"react-router-dom\";\nimport queryString from \"query-string\";\nimport { Formik } from \"formik\";\nimport ErrorPage from \"@components/error-view\";\nimport * as yup from \"yup\";\nimport { setTemplateInfo } from \"@redux/template-info\";\nimport { useDispatch } from \"react-redux\";\nimport { Button, Form, Dimmer, Loader } from \"semantic-ui-react\";\nimport Loading from \"@components/ui/loading\";\nimport { useMutation } from \"react-query\";\nimport useTokenValidation from \"@hooks/useTokenValidation\";\n\nconst UploadDocumentSchema = yup.object().shape({\n title: yup.string().required(),\n file: yup.object().isRequired,\n});\n\nconst CreateSignatureTemplate = () => {\n const location = useLocation();\n const params = queryString.parse(location.search);\n const history = useHistory();\n const dispatch = useDispatch();\n const [error, setError] = useState(false);\n useTokenValidation(params.token);\n\n const uploadSignatureTemplateApi = useMutation(async ({ values, params }) => {\n var formData = new FormData();\n formData.append(\"pdf_file\", values.file);\n formData.append(\"title\", values.title);\n formData.append(\"description\", values.description);\n formData.append(\"token\", params.token);\n formData.append(\"company\", params.company);\n\n const response = await fetch(\"/api/template/upload-template\", {\n method: \"POST\",\n headers: { Authorization: `Bearer ${params.token}` },\n body: formData,\n });\n if (response.ok) {\n const templateInfo = await response.json();\n if (templateInfo.error) {\n setError(templateInfo.message);\n } else {\n setError(false);\n dispatch(\n setTemplateInfo({\n ...params,\n ...templateInfo,\n loaded: true,\n })\n );\n history.push({\n pathname: `/template-editor?token=${params.token}&template_id=${templateInfo.template_id}&company=${params.company}`,\n state: { ...params },\n });\n }\n return templateInfo;\n }\n var error = await response.text();\n throw error;\n });\n\n return (\n \n {uploadSignatureTemplateApi.isLoading && }\n {uploadSignatureTemplateApi.isError ? (\n \n ) : (\n {\n await uploadSignatureTemplateApi.mutate({\n values,\n params,\n });\n }}\n validationSchema={UploadDocumentSchema}\n >\n {({\n isSubmitting,\n setFieldValue,\n handleChange,\n values,\n handleSubmit,\n }) => (\n \n \n Create Signature Template\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n {\n setFieldValue(\"file\", target.files[0]);\n // const MBSize = event.target.files[0].size / 1024;\n // if (MBSize > 101376) {\n // errorMessage(\"File size must be less than 99MB.\");\n // } else\n // setSelectedFile(target.files[0]);\n }}\n />\n \n \n \n \n \n \n \n \n \n \n {isSubmitting && }\n \n \n \n )}\n \n )}\n \n );\n};\n\nexport default CreateSignatureTemplate;\n","import React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nconst Development = () => {\n const [inputs, setInputs] = React.useState({\n token: \"\",\n template_id: \"\",\n signature_id: \"\",\n });\n const createTemplateLink = `/create-template?token=${window.btoa(\n inputs.token\n )}`;\n const editTemplateLink = `/template-editor?token=${window.btoa(\n inputs.token\n )}&template_id=${inputs.template_id}`;\n const signSignatureLink = `/signature&token=${window.btoa(\n inputs.token\n )}&template_id=${inputs.template_id}&signature_id=${inputs.signature_id}`;\n return (\n
\n

Development/Testing

\n \n
\n \n
* dme token = phoenix token, patient = signature token
\n
\n \n setInputs((x) => ({ ...x, token: target.value }))\n }\n />\n \n \n setInputs((x) => ({ ...x, template_id: target.value }))\n }\n />\n \n \n setInputs((x) => ({ ...x, signature_id: target.value }))\n }\n />\n
\n
\n
\n Create Template\n
Link: {createTemplateLink}
\n
\n
\n Edit Template\n
Link: {editTemplateLink}
\n
\n
\n Sign document\n
Link: {signSignatureLink}
\n
\n
\n Print preview document\n
Link:
\n
\n
\n \n );\n};\n\nDevelopment.defaultProps = {};\n\nDevelopment.propTypes = {};\n\nexport default Development;\n","import { createSlice } from \"@reduxjs/toolkit\";\r\nimport { createSelector } from \"reselect\";\r\nimport { assoc, assocPath, prop, values, dissoc, indexBy } from \"ramda\";\r\n\r\nexport const layoutItems = createSlice({\r\n name: \"layout\",\r\n initialState: {},\r\n reducers: {\r\n clearLayout: () => ({}),\r\n moveFormItem: (state, { payload }) => {\r\n // Redux Toolkit allows us to write \"mutating\" logic in reducers. It\r\n // doesn't actually mutate the state because it uses the Immer library,\r\n // which detects changes to a \"draft state\" and produces a brand new\r\n // immutable state based off those changes\r\n // state.value += 1;\r\n // state[payload.id].pos = payload.pos;\r\n return assocPath([payload.id, \"pos\"], payload.pos, state);\r\n },\r\n updateFormItemAttributes: (state, { payload }) => {\r\n return assocPath([payload.id, \"attributes\"], payload.attributes, state);\r\n },\r\n resizeFormItem: (state, { payload }) => {\r\n return assocPath([payload.id, \"size\"], payload.size, state);\r\n },\r\n setLayout: (state, { payload }) => indexBy(prop(\"id\"), payload),\r\n addFormItem: (state, { payload }) => assoc(payload.id, payload, state),\r\n updateFormItem: (state, { payload }) => assoc(payload.id, payload, state),\r\n deleteFormItem: (state, { payload }) => dissoc(payload.id, state)\r\n }\r\n});\r\n\r\nexport const {\r\n addFormItem,\r\n moveFormItem,\r\n deleteFormItem,\r\n updateFormItem,\r\n resizeFormItem,\r\n updateFormItemAttributes,\r\n clearLayout,\r\n setLayout\r\n} = layoutItems.actions;\r\n\r\n// The function below is called a selector and allows us to select a value from\r\n// the state. Selectors can also be defined inline where they're used instead of\r\n// in the slice file. For example: `useSelector((state) => state.counter.value)`\r\n// export const selectLayout = state => state.layout;\r\nexport const selectLayout = createSelector(prop(\"layout\"), values);\r\nexport const getLayoutItem = createSelector(\r\n [prop(\"layout\"), (_, id) => id],\r\n (layout, id) => prop(id, layout)\r\n);\r\n\r\nexport default layoutItems.reducer;\r\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Button, Icon } from \"semantic-ui-react\";\nimport useModal from \"../../hooks/use-modal\";\nimport Modal from \"../ui/modal\";\n\nconst ElementControls = ({\n handleDelete,\n children,\n isRequired,\n EditComponent,\n showControls,\n}) => {\n const { showModal, toggle } = useModal(false);\n return (\n \n {children}\n \n {EditComponent}\n \n \n \n \n \n {isRequired && *}\n \n \n \n \n \n \n );\n};\nexport default ElementControls;\n\nElementControls.propTypes = {\n handleDelete: PropTypes.func,\n children: PropTypes.node,\n EditComponent: PropTypes.node,\n isRequired: PropTypes.bool,\n};\n","import { useState, useRef, useCallback } from \"react\";\n\nfunction useHover() {\n const [hovered, setHovered] = useState(false);\n\t\n const handleMouseOver = useCallback(() => setHovered(true), []);\n const handleMouseOut = useCallback(() => setHovered(false), []);\n\n const ref = useRef();\n \n const callbackRef = useCallback(\n node => {\n if (ref.current) {\n ref.current.removeEventListener(\"mouseover\", handleMouseOver);\n ref.current.removeEventListener(\"mouseout\", handleMouseOut);\n }\n\n ref.current = node;\n\n if (ref.current) {\n ref.current.addEventListener(\"mouseover\", handleMouseOver);\n ref.current.addEventListener(\"mouseout\", handleMouseOut);\n }\n },\n [handleMouseOver, handleMouseOut]\n );\n\n return [callbackRef, hovered];\n}\nexport default useHover;\n","import React from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { resizeFormItem } from \"../redux/layout\";\n\nfunction useResize(id, initialSize) {\n const dispatch = useDispatch();\n const [size, setSize] = React.useState({\n absoluteHeight: initialSize.absoluteHeight,\n absoluteWidth: initialSize.absoluteWidth,\n absoluteTop: initialSize.absoluteTop,\n absoluteLeft: initialSize.absoluteLeft,\n });\n const getSize = (currentSize, elSize) => {\n const deltaHeight = elSize.height - currentSize.absoluteHeight;\n const deltaWidth = elSize.width - currentSize.absoluteWidth;\n return {\n absoluteTop: Math.floor(currentSize.absoluteTop + deltaHeight),\n absoluteLeft: Math.floor(currentSize.absoluteLeft + deltaWidth),\n absoluteWidth: Math.floor(elSize.width),\n absoluteHeight: Math.floor(elSize.height),\n };\n };\n\n const onResize = (event, { element, size: elSize, handle }) => {\n setSize({ ...getSize(size, elSize) });\n };\n\n const onResizeStop = (event, { element, size: elSize, handle }) => {\n const newSize = getSize(size, elSize);\n dispatch(resizeFormItem({ id, size: newSize }));\n };\n return { size, onResize, onResizeStop };\n}\n\nexport default useResize;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport \"./input.scss\";\n\nconst Input = ({ className, ...props }) => (\n \n);\n\nInput.defaultProps = { className: \"\" };\n\nInput.propTypes = {\n className: PropTypes.string\n};\n\nexport default Input;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport \"./field.scss\";\n\nconst Field = ({ label, children }) => {\n return (\n
\n
{label}
\n {children}\n
\n );\n};\n\nField.propTypes = { children: PropTypes.node, label: PropTypes.string };\n\nexport default Field;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useDispatch } from \"react-redux\";\nimport { deleteFormItem, updateFormItemAttributes } from \"../../redux/layout\";\nimport Controls from \"./controls\";\nimport useHover from \"../../hooks/use-hover\";\nimport useResize from \"../../hooks/use-resize\";\nimport { Resizable } from \"react-resizable\";\nimport Input from \"../ui/input\";\nimport Field from \"../ui/field\";\n\nconst TextElement = ({ type, id, pos, size: origSize, attributes }) => {\n const dispatch = useDispatch();\n const [elemRef, isHovered] = useHover();\n const { size, onResize, onResizeStop } = useResize(id, origSize);\n return (\n
\n {\n dispatch(deleteFormItem({ id }));\n }}\n isRequired={attributes.required}\n showControls={isHovered}\n EditComponent={\n \n {type === \"text\" && (\n \n {\n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n ...attributes,\n placeHolder: target.value,\n },\n }),\n );\n }}\n type=\"text\"\n />\n \n )}\n \n {\n dispatch(\n updateFormItemAttributes({\n id,\n attributes: { ...attributes, background: target.value },\n }),\n );\n }}\n >\n \n \n \n \n {/* */}\n {/* */}\n {/* dispatch( */}\n {/* updateFormItemAttributes({ */}\n {/* id, */}\n {/* attributes: { */}\n {/* ...attributes, */}\n {/* underline: target.checked, */}\n {/* }, */}\n {/* }) */}\n {/* ) */}\n {/* } */}\n {/* /> */}\n {/* */}\n \n \n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n ...attributes,\n required: target.checked,\n },\n }),\n )\n }\n />\n \n \n \n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n ...attributes,\n assigned_to_coach: target.checked,\n },\n }),\n )\n }\n />\n \n
\n }\n >\n \n \n \n \n \n \n \n );\n};\n\nTextElement.propTypes = {\n id: PropTypes.string.isRequired,\n type: PropTypes.string,\n};\n\nTextElement.defaultProps = {\n type: \"text\",\n};\n\nexport default TextElement;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useDispatch } from \"react-redux\";\nimport { deleteFormItem, updateFormItemAttributes } from \"../../redux/layout\";\nimport Field from \"../ui/field\";\nimport Controls from \"./controls\";\nimport useHover from \"../../hooks/use-hover\";\n\nconst LabelElement = ({ id, pos, attributes }) => {\n const dispatch = useDispatch();\n const [width, setWidth] = React.useState(0);\n const inputShadowRef = React.useRef();\n const [elemRef, isHovered] = useHover();\n React.useEffect(() => {\n if (inputShadowRef && inputShadowRef.current) {\n setWidth(inputShadowRef.current.offsetWidth);\n }\n }, [attributes.value, attributes.fontSize, attributes.color]);\n return (\n
\n {\n dispatch(deleteFormItem({ id }));\n }}\n showControls={isHovered}\n EditComponent={\n
\n \n \n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n ...attributes,\n color: target.value,\n fontSize: attributes.fontSize,\n },\n })\n )\n }\n />\n \n \n {\n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n value: attributes.value,\n color: attributes.color,\n fontSize: target.value,\n },\n })\n );\n var theWidth = inputShadowRef.current.getBoundingClientRect()\n .width;\n setWidth(theWidth);\n }}\n />\n
{attributes.fontSize}px
\n
\n
\n }\n >\n {\n dispatch(\n updateFormItemAttributes({\n id,\n attributes: { ...attributes, value: target.value },\n })\n );\n var theWidth = inputShadowRef.current.getBoundingClientRect().width;\n setWidth(theWidth);\n }}\n style={{\n fontSize: `${attributes.fontSize}px`,\n color: attributes.color,\n width: `${width + 30}px`,\n }}\n />\n \n {attributes.value}\n
\n \n \n );\n};\n\nLabelElement.propTypes = {\n id: PropTypes.string.isRequired,\n};\n\nexport default LabelElement;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useDispatch } from \"react-redux\";\nimport { deleteFormItem, updateFormItemAttributes } from \"../../redux/layout\";\nimport Field from \"../ui/field\";\nimport Input from \"../ui/input\";\nimport Controls from \"./controls\";\nimport useHover from \"../../hooks/use-hover\";\nimport useResize from \"../../hooks/use-resize\";\nimport { Resizable } from \"react-resizable\";\n\nconst SignatureElement = ({ id, pos, size: origSize, attributes }) => {\n const dispatch = useDispatch();\n const [elemRef, isHovered] = useHover();\n const { size, onResize, onResizeStop } = useResize(id, origSize);\n return (\n
\n {\n dispatch(deleteFormItem({ id }));\n }}\n showControls={isHovered}\n EditComponent={\n \n \n \n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n ...attributes,\n required: target.checked,\n },\n })\n )\n }\n />\n \n {/* */}\n {/* */}\n {/* dispatch( */}\n {/* updateFormItemAttributes({ */}\n {/* id, */}\n {/* attributes: { */}\n {/* ...attributes, */}\n {/* underline: target.checked, */}\n {/* }, */}\n {/* }) */}\n {/* ) */}\n {/* } */}\n {/* /> */}\n {/* */}\n
\n }\n >\n \n \n
\n
\n Signature\n
\n
\n \n \n \n \n );\n};\n\nSignatureElement.propTypes = {\n id: PropTypes.string.isRequired,\n};\n\nexport default SignatureElement;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useDispatch } from \"react-redux\";\nimport { deleteFormItem, updateFormItemAttributes } from \"../../redux/layout\";\nimport Field from \"../ui/field\";\nimport Input from \"../ui/input\";\nimport Controls from \"./controls\";\nimport useResize from \"../../hooks/use-resize\";\nimport { Resizable } from \"react-resizable\";\nimport useHover from \"../../hooks/use-hover\";\n\nconst InitialsElement = ({ id, pos, size: origSize, attributes }) => {\n const dispatch = useDispatch();\n const [elemRef, isHovered] = useHover();\n const { size, onResize, onResizeStop } = useResize(id, origSize);\n return (\n \n {\n dispatch(deleteFormItem({ id }));\n }}\n showControls={isHovered}\n EditComponent={\n \n \n \n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n ...attributes,\n required: target.checked\n }\n })\n )\n }\n />\n \n {/* */}\n {/* */}\n {/* dispatch( */}\n {/* updateFormItemAttributes({ */}\n {/* id, */}\n {/* attributes: { */}\n {/* ...attributes, */}\n {/* underline: target.checked, */}\n {/* }, */}\n {/* }) */}\n {/* ) */}\n {/* } */}\n {/* /> */}\n {/* */}\n \n }\n >\n \n \n
\n
\n Initials\n
\n
\n \n \n \n \n );\n};\n\nInitialsElement.propTypes = {\n id: PropTypes.string.isRequired\n};\n\nexport default InitialsElement;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useDispatch } from \"react-redux\";\nimport { deleteFormItem, updateFormItemAttributes } from \"../../redux/layout\";\nimport Controls from \"./controls\";\nimport useHover from \"../../hooks/use-hover\";\nimport useResize from \"../../hooks/use-resize\";\nimport { Resizable } from \"react-resizable\";\nimport Field from \"../ui/field\";\n\nconst CheckBoxElement = ({ id, pos, size: origSize, attributes }) => {\n const dispatch = useDispatch();\n const [elemRef, isHovered] = useHover();\n const { size, onResize, onResizeStop } = useResize(id, origSize);\n return (\n
\n {\n dispatch(deleteFormItem({ id }));\n }}\n showControls={isHovered}\n EditComponent={\n \n {/* */}\n {/* { */}\n {/* dispatch( */}\n {/* updateFormItemAttributes({ */}\n {/* id, */}\n {/* attributes: { ...attributes, label: target.value }, */}\n {/* }) */}\n {/* ); */}\n {/* }} */}\n {/* type=\"text\" */}\n {/* /> */}\n {/* */}\n \n \n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n ...attributes,\n required: target.checked,\n },\n })\n )\n }\n />\n \n
\n }\n >\n \n \n
\n \n {/* {attributes.label} */}\n
\n \n \n \n \n );\n};\n\nCheckBoxElement.propTypes = {\n id: PropTypes.string.isRequired,\n};\n\nexport default CheckBoxElement;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useDispatch } from \"react-redux\";\nimport { deleteFormItem, updateFormItemAttributes } from \"../../redux/layout\";\nimport Field from \"../ui/field\";\nimport Button from \"../ui/button\";\nimport Input from \"../ui/input\";\nimport Controls from \"./controls\";\nimport useHover from \"../../hooks/use-hover\";\nimport useResize from \"../../hooks/use-resize\";\nimport { Resizable } from \"react-resizable\";\n\nconst RadioGroupElement = ({ id, pos, size: origSize, attributes }) => {\n const dispatch = useDispatch();\n const [elemRef, isHovered] = useHover();\n const { size, onResize, onResizeStop } = useResize(id, origSize);\n return (\n
\n {\n dispatch(deleteFormItem({ id }));\n }}\n showControls={isHovered}\n EditComponent={\n \n {attributes.elms.map(({ text, value }, index) => (\n
\n \n {\n const { elms } = attributes;\n const updatedElms = elms.map((el, elIndex) =>\n elIndex === index ? { ...el, text: target.value } : el\n );\n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n ...attributes,\n elms: updatedElms\n }\n })\n );\n }}\n type=\"text\"\n />\n \n \n {\n const { elms } = attributes;\n const updatedElms = elms.map((el, elIndex) =>\n elIndex === index ? { ...el, value: target.value } : el\n );\n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n ...attributes,\n elms: updatedElms\n }\n })\n );\n }}\n type=\"text\"\n />\n \n {\n const elms = attributes.elms.filter(\n (el, elIndex) => elIndex !== index\n );\n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n ...attributes,\n elms\n }\n })\n );\n }}\n className=\"danger small\"\n style={{\n padding: \"0.48571429em 1em 0.48571429em\"\n }}\n >\n Delete\n \n
\n ))}\n {\n const elms = [\n ...attributes.elms,\n {\n text: `option${attributes.elms.length + 1}`,\n value: `option${attributes.elms.length + 1}`\n }\n ];\n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n ...attributes,\n elms\n }\n })\n );\n }}\n >\n Add\n \n \n \n dispatch(\n updateFormItemAttributes({\n id,\n attributes: {\n ...attributes,\n required: target.checked\n }\n })\n )\n }\n />\n \n
\n }\n >\n \n \n
\n {attributes.elms.map(({ value, text }) => (\n
\n \n \n
\n ))}\n
\n \n \n \n \n );\n};\n\nRadioGroupElement.propTypes = {\n id: PropTypes.string.isRequired\n};\n\nexport default RadioGroupElement;\n","const elementDefaults = {\n TEXT: {\n attributes: {\n value: \"\",\n required: false,\n placeHolder: \"\",\n background: \"none\",\n underline: false,\n },\n size: {\n absoluteHeight: 20,\n absoluteWidth: 150,\n absoluteTop: 0,\n absoluteLeft: 0,\n },\n },\n LABEL: {\n attributes: { value: \"\", fontSize: 20, color: \"#000000\", underline: false },\n size: {\n absoluteHeight: 30,\n absoluteWidth: 150,\n absoluteTop: 0,\n absoluteLeft: 0,\n },\n },\n SIGNATURE: {\n attributes: {\n value: \"\",\n required: false,\n background: \"none\",\n underline: false,\n },\n size: {\n absoluteHeight: 50,\n absoluteWidth: 150,\n absoluteTop: 0,\n absoluteLeft: 0,\n },\n },\n COACH_SIGNATURE: {\n attributes: {\n value: \"\",\n required: false,\n background: \"none\",\n underline: false,\n },\n size: {\n absoluteHeight: 50,\n absoluteWidth: 150,\n absoluteTop: 0,\n absoluteLeft: 0,\n },\n },\n DATE: {\n attributes: {\n value: \"\",\n required: false,\n background: \"none\",\n underline: false,\n },\n size: {\n absoluteHeight: 20,\n absoluteWidth: 150,\n absoluteTop: 0,\n absoluteLeft: 0,\n },\n },\n INITIALS: {\n attributes: {\n value: \"\",\n required: false,\n background: \"none\",\n underline: false,\n },\n size: {\n absoluteHeight: 20,\n absoluteWidth: 100,\n absoluteTop: 0,\n absoluteLeft: 0,\n },\n },\n CHECKBOX: {\n attributes: { value: \"\", label: \"\", background: \"none\" },\n size: {\n absoluteHeight: 20,\n absoluteWidth: 50,\n absoluteTop: 0,\n absoluteLeft: 0,\n },\n },\n RADIO_GROUP: {\n attributes: {\n value: \"\",\n required: false,\n elms: [\n { text: \"option1\", value: \"option1\" },\n { text: \"option2\", value: \"option2\" },\n ],\n },\n size: {\n absoluteHeight: 75,\n absoluteWidth: 100,\n absoluteTop: 0,\n absoluteLeft: 0,\n },\n },\n};\n\nexport default elementDefaults;\n","import React from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { addFormItem } from \"@redux/layout\";\nimport { selectTemplateInfo } from \"@redux/template-info\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { elementDefaults } from \"@components/form-elements\";\n\nexport default function useFormControlDrag(dropZone) {\n const [selectedControl, setSelectedControl] = React.useState(\"\");\n const dispatch = useDispatch();\n const [active, setActive] = React.useState(false);\n const [started, setStarted] = React.useState(false);\n const templateInfo = useSelector(selectTemplateInfo);\n\n function onDragStart(event, taskName) {\n // event.preventDefault();\n setStarted(true);\n event.dataTransfer.effectAllowed = \"copy\";\n // NOTE: this does not work in chrome, can only set dataTransfer on drag end\n setSelectedControl(taskName);\n event.dataTransfer.setData(\"taskName\", taskName);\n }\n function onDragOver(event) {\n setActive(true);\n event.preventDefault();\n }\n\n function onDragLeave() {\n setActive(false);\n }\n function onDragEnd(event) {\n /* NOTE: handle super fringe bug I experenced on linux/wayland display protocol & chrome */\n // https://bugs.chromium.org/p/chromium/issues/detail?id=875164\n // don't add onDrop event to div manually call it\n setStarted(false);\n setActive(false);\n const clientPos = dropZone.current.getBoundingClientRect();\n const pos = { x: event.clientX, y: event.clientY };\n if (\n pos.x > clientPos.x &&\n pos.x < clientPos.x + clientPos.width &&\n pos.y > clientPos.y &&\n pos.y < clientPos.y + clientPos.height\n ) {\n onDrop(event);\n }\n setSelectedControl(\"\");\n }\n\n function getRelativeCoords(event) {\n const bounds = dropZone.current.getBoundingClientRect();\n const OFFSETS = { x: 80, y: 50 };\n const x = event.clientX - bounds.left - OFFSETS.x;\n const y = event.clientY - bounds.top - OFFSETS.y;\n return { x: Math.floor(x), y: Math.floor(y) };\n }\n const onDrop = event => {\n setActive(false);\n setStarted(false);\n const pos = getRelativeCoords(event);\n if (selectedControl) {\n dispatch(\n addFormItem({\n id: uuidv4(),\n type: selectedControl,\n page: templateInfo.currentPage ?? 0,\n pos,\n ...elementDefaults[selectedControl]\n })\n );\n }\n };\n\n return {\n onDragStart,\n onDragOver,\n onDragEnd,\n onDrop,\n active,\n onDragLeave,\n started,\n selectedControl\n };\n}\n","import React, { useState, useEffect } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useDispatch, useSelector } from \"react-redux\";\n//import { useHistory } from \"react-router-dom\";\nimport Button from \"@components/ui/button\";\nimport { clearLayout, selectLayout } from \"@redux/layout\";\nimport { selectTemplateInfo, setCurrentPage } from \"@redux/template-info\";\nimport Loading from \"@components/ui/loading\";\nimport Modal from \"@components/ui/modal\";\nimport { useMutation } from \"react-query\";\nimport ErrorPage from \"@components/error-view\";\nimport SignatureScreen from \"@components/sign-document/sign-document\";\nimport \"./style.scss\";\n\nconst FormControls = ({ onDragStart, onDragEnd }) => {\n const dispatch = useDispatch();\n // const history = useHistory();\n const layout = useSelector(selectLayout);\n const templateInfo = useSelector(selectTemplateInfo);\n const [signaturesAdded, setSignaturesAdded] = useState(false);\n const [previewTemplate, setPreviewTemplate] = useState(false);\n\n const saveSignatureFormLayoutApi = useMutation(\n async ({ templateInfo, layout }) => {\n const payload = {\n layout: layout.map((element) => ({\n ...element,\n attributes: {\n ...element.attributes,\n placeHolder: \"\",\n background: \"\",\n },\n })),\n company: \"\",\n patients: [],\n ...templateInfo,\n };\n\n const response = await fetch(\"/api/template/save-template\", {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${templateInfo.token}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(payload),\n });\n if (!response.ok) {\n const errorMessage = await response.text();\n throw errorMessage;\n }\n const result = await response.json();\n return result;\n },\n );\n\n const { currentPage, pages } = templateInfo;\n\n useEffect(() => {\n const coachSignatureExists =\n layout.length > 0 &&\n layout.find((x) => x.type === \"COACH_SIGNATURE\") !== undefined;\n const patientSignatureExists =\n layout.length > 0 &&\n layout.find((x) => x.type === \"SIGNATURE\") !== undefined;\n\n if (coachSignatureExists && patientSignatureExists)\n setSignaturesAdded(true);\n else setSignaturesAdded(false);\n }, [layout]);\n\n return (\n
\n {saveSignatureFormLayoutApi.isLoading && }\n \n \n \n\n \n setPreviewTemplate(false)}\n />\n \n \n \n \n Thank you, your document has submitted successfully.\n \n \n Please close this window.\n

\n {\n window.close();\n }}\n >\n Close\n \n
\n \n
S3 Signature Form Builder
\n
\n onDragStart(event, \"TEXT\")}\n onDragEnd={onDragEnd}\n className=\"form-control draggable TEXT\"\n >\n Text Input\n
\n onDragStart(event, \"LABEL\")}\n onDragEnd={onDragEnd}\n draggable\n className=\"form-control draggable LABEL\"\n >\n Label\n \n onDragStart(event, \"SIGNATURE\")}\n onDragEnd={onDragEnd}\n draggable\n className=\"form-control draggable SIGNATURE\"\n >\n Signature *\n \n onDragStart(event, \"DATE\")}\n onDragEnd={onDragEnd}\n draggable\n className=\"form-control draggable DATE\"\n >\n Date\n \n onDragStart(event, \"INITIALS\")}\n onDragEnd={onDragEnd}\n draggable\n className=\"form-control draggable INITIALS\"\n >\n Initials\n \n onDragStart(event, \"CHECKBOX\")}\n onDragEnd={onDragEnd}\n draggable\n className=\"form-control draggable CHECKBOX\"\n >\n Check Box\n \n onDragStart(event, \"RADIO_GROUP\")}\n onDragEnd={onDragEnd}\n draggable\n className=\"form-control draggable RADIO_GROUP\"\n >\n Radio Group\n \n onDragStart(event, \"COACH_SIGNATURE\")}\n onDragEnd={onDragEnd}\n draggable\n className=\"form-control draggable COACH_SIGNATURE\"\n >\n Coach Signature *\n \n \n \n {\n dispatch(clearLayout());\n }}\n className=\"danger\"\n >\n Clear\n \n {\n setPreviewTemplate(true);\n //history.push(\"/template-preview\");\n }}\n >\n Preview\n \n {\n if (templateInfo.patients) {\n alert(\"save and assign template to patients\");\n } else {\n // var tempTemplateInfo = JSON.parse(JSON.stringify(templateInfo));\n // var tempLayout = JSON.parse(JSON.stringify(layout));\n // tempTemplateInfo.layout = tempLayout;\n //\n // tempTemplateInfo.patients = [];\n // tempTemplateInfo.company_id = \"\";\n // for (var i = 0; i < tempLayout.length; i++) {\n // tempLayout[i].attributes.placeHolder = \"\";\n // tempLayout[i].attributes.background = \"\";\n // }\n // const result = await saveSignatureFormLayout({\n // tempLayout,\n // ...tempTemplateInfo,\n // });\n await saveSignatureFormLayoutApi.mutate({\n templateInfo,\n layout,\n });\n }\n }}\n // disabled={saveSignatureFormLayoutApi.isLoading || !signaturesAdded}\n disabled={saveSignatureFormLayoutApi.isLoading}\n >\n Save\n \n \n \n {\n dispatch(setCurrentPage(currentPage - 1));\n }}\n disabled={templateInfo.currentPage <= 0}\n >\n Previous\n \n \n Page: {currentPage + 1} / {pages}\n \n {\n dispatch(setCurrentPage(currentPage + 1));\n }}\n disabled={currentPage + 1 === pages}\n >\n Next\n \n \n \n {!signaturesAdded && (\n

* Coach and patient signatures are required

\n )}\n \n \n );\n};\n\nFormControls.propTypes = {\n onDragEnd: PropTypes.func.isRequired,\n onDragStart: PropTypes.func.isRequired,\n};\n\nexport default FormControls;\n","import React, { PureComponent } from \"react\";\nimport PropTypes from \"prop-types\";\nimport Draggable from \"react-draggable\";\nimport { connect } from \"react-redux\";\nimport { moveFormItem } from \"../redux/layout\";\nimport {\n TextElement,\n LabelElement,\n SignatureElement,\n InitialsElement,\n CheckBoxElement,\n RadioGroupElement,\n} from \"./form-elements\";\n\nclass FormItem extends PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n deltaPosition: {\n x: 0,\n y: 0,\n },\n controlledPosition: {\n x: props.pos.x,\n y: props.pos.y,\n },\n };\n }\n state = {};\n\n handleDrag = (e, ui) => {\n const { x, y } = this.state.deltaPosition;\n this.setState({\n deltaPosition: {\n x: x + ui.deltaX,\n y: y + ui.deltaY,\n },\n });\n };\n\n onStart = () => {};\n\n onStop = (e, ui) => {\n const { dispatch, id } = this.props;\n dispatch(\n moveFormItem({ id, pos: { x: Math.round(ui.x), y: Math.round(ui.y) } })\n );\n };\n\n onControlledDrag = (e, position) => {\n const { x, y } = position;\n this.setState({ controlledPosition: { x, y } });\n };\n\n onControlledDragStop = (e, position) => {\n this.onControlledDrag(e, position);\n this.onStop();\n };\n render() {\n const dragHandlers = { onStart: this.onStart, onStop: this.onStop };\n const { controlledPosition } = this.state;\n const { type, pos, id, index, attributes, size } = this.props;\n return (\n \n
\n {type === \"TEXT\" && (\n \n )}\n {type === \"LABEL\" && (\n \n )}\n {(type === \"SIGNATURE\" || type === \"COACH_SIGNATURE\") && (\n \n )}\n {type === \"INITIALS\" && (\n \n )}\n {type === \"DATE\" && (\n \n )}\n {type === \"CHECKBOX\" && (\n \n )}\n {type === \"RADIO_GROUP\" && (\n \n )}\n
\n \n );\n }\n}\n\nFormItem.propTypes = {\n pos: PropTypes.object.isRequired,\n type: PropTypes.string.isRequired,\n id: PropTypes.string.isRequired,\n dispatch: PropTypes.func.isRequired,\n index: PropTypes.number,\n};\n\nexport default connect(() => ({}))(FormItem);\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useSelector } from \"react-redux\";\nimport { selectLayout } from \"@redux/layout\";\nimport { selectTemplateInfo } from \"@redux/template-info\";\nimport FormItem from \"@components/form-item\";\nimport \"./style.scss\";\n\nconst TemplateWorkspace = React.forwardRef(\n ({ onDragOver, onDragLeave, active, token }, dropZoneRef) => {\n const layout = useSelector(selectLayout);\n const templateInfo = useSelector(selectTemplateInfo);\n const currentImgUrl = `api/template/download/${templateInfo.template_id}/${\n templateInfo.files[templateInfo.currentPage]\n }?token=${token}&create_template=true`;\n return (\n \n {\n // NOTE: disable image dragging on firefox\n e.preventDefault();\n return false;\n }}\n className={`form-layout-img ${active ? \"active\" : \"\"}`}\n style={{\n userSelect: \"none\",\n position: \"absolute\",\n top: 0,\n left: 0,\n zIndex: 0,\n width: 916\n }}\n ref={dropZoneRef}\n />\n {layout\n .filter(x => x.page === templateInfo.currentPage)\n .map((item, index) => (\n \n ))}\n \n );\n }\n);\n\nTemplateWorkspace.propTypes = {\n onDragOver: PropTypes.func.isRequired,\n onDrop: PropTypes.func.isRequired\n};\n\nexport default TemplateWorkspace;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { useDispatch } from \"react-redux\";\nimport { useLocation } from \"react-router-dom\";\nimport { useQuery } from \"react-query\";\nimport queryString from \"query-string\";\nimport useFormControlDrag from \"@hooks/useFormControlDrag\";\nimport FormControls from \"./form-controls\";\nimport TemplateWorkspace from \"./template-workspace\";\nimport { setTemplateInfo, selectTemplateInfo } from \"@redux/template-info\";\nimport { setLayout } from \"@redux/layout\";\n\nconst TemplateEditor = () => {\n const dropZoneRef = React.useRef();\n const {\n onDragStart,\n onDragEnd,\n onDragOver,\n onDragLeave,\n onDrop,\n active,\n selectedControl,\n } = useFormControlDrag(dropZoneRef);\n return (\n
\n \n \n
\n );\n};\n\nconst TemplateLoader = () => {\n const error = false;\n const isLoading = false;\n const location = useLocation();\n const dispatch = useDispatch();\n const params = queryString.parse(location.search);\n const templateInfo = useSelector(selectTemplateInfo);\n\n useQuery(\n [\"meta_layout\", params],\n async () => {\n if (templateInfo.template_id === \"\") {\n const metaResponse = await fetch(\n `/api/template/download/${params.template_id}/meta.json?token=${params.token}`\n );\n const metaData = await metaResponse.json();\n dispatch(\n setTemplateInfo({\n ...params,\n ...metaData,\n loaded: true,\n })\n );\n const layoutResponse = await fetch(\n `/api/template/download/${params.template_id}/layout.json?token=${params.token}`\n );\n const layoutData = await layoutResponse.json();\n dispatch(setLayout(layoutData));\n }\n },\n { enabled: params !== undefined && Object.keys(params).length > 0 }\n );\n\n if (templateInfo.loaded) return ;\n return (\n \n {isLoading && (\n <>\n

Getting everything setup

\n \n )}\n
{error}
\n \n );\n};\n\nexport default TemplateLoader;\n","import React from \"react\";\nimport queryString from \"query-string\";\nimport Loading from \"@components/ui/loading\";\nimport ErrorPage from \"@components/error-view\";\nimport SignatureScreen from \"@components/sign-document/sign-document\";\nimport { useLocation } from \"react-router-dom\";\nimport { useQuery } from \"react-query\";\nimport \"./style.scss\";\n\nconst TemplatePreview = () => {\n const location = useLocation();\n const params = queryString.parse(location.search);\n console.log(params);\n\n const templateInfoApi = useQuery([\"meta\", params], async () => {\n const response = await fetch(\n `/api/template/download/${params.template_id}/meta.json?token=${params.token}`,\n );\n const data = await response.json();\n return { ...params, ...data };\n });\n\n const layoutApi = useQuery([\"layout\", params], async () => {\n const response = await fetch(\n `/api/template/download/${params.template_id}/layout.json?token=${params.token}`,\n );\n const data = await response.json();\n return data;\n });\n\n const templateInfo = templateInfoApi.data ?? {};\n \n if (layoutApi.isFetching || templateInfoApi.isFetching) return ;\n else if (layoutApi.isError || templateInfoApi.isError)\n return (\n \n );\n\n return (\n \n );\n};\n\nexport default TemplatePreview;\n","import React, { useState } from \"react\";\nimport { useLocation } from \"react-router-dom\";\nimport queryString from \"query-string\";\nimport { Formik } from \"formik\";\nimport ErrorPage from \"@components/error-view\";\nimport * as yup from \"yup\";\nimport { Button, Form } from \"semantic-ui-react\";\nimport Loading from \"@components/ui/loading\";\nimport { useMutation } from \"react-query\";\nimport useTokenValidation from \"@hooks/useTokenValidation\";\n\nconst CopyDocumentSchema = yup.object().shape({\n title: yup.string().required(),\n});\n\nconst CopySignatureTemplate = () => {\n const location = useLocation();\n const params = queryString.parse(location.search);\n const [error, setError] = useState(false);\n useTokenValidation(params.token);\n\n const copySignatureTemplateApi = useMutation(async ({ values, params }) => {\n const payload = {\n title: values.title,\n description: values.description,\n template_id: params.template_id,\n };\n\n const response = await fetch(\"/api/template/copy-template\", {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${params.token}`,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(payload),\n });\n if (response.ok) {\n const templateInfo = await response.json();\n if (templateInfo.error) setError(templateInfo.message);\n else setError(false);\n return templateInfo;\n }\n var error = await response.text();\n throw error;\n });\n\n return (\n \n {copySignatureTemplateApi.isLoading && }\n {copySignatureTemplateApi.isError ? (\n \n ) : !error && copySignatureTemplateApi.isSuccess ? (\n \n \n Thank you, your document has submitted successfully.\n \n \n Please close this window.\n

\n {\n window.close();\n }}\n >\n Close\n \n \n ) : (\n {\n await copySignatureTemplateApi.mutate({\n values,\n params,\n });\n }}\n validationSchema={CopyDocumentSchema}\n >\n {({ isSubmitting, handleChange, values, handleSubmit }) => (\n \n \n Copy Signature Template\n \n \n \n \n \n \n\n \n \n \n \n \n {isSubmitting && }\n \n \n \n )}\n \n )}\n \n );\n};\n\nexport default CopySignatureTemplate;\n","import React from \"react\";\n\nconst NotAuthorized = () => {\n return (\n \n \n

\n You are not authorized to access this page. Please try again or contact\n an administrator\n

\n

Please close this window.

\n \n );\n};\n\nNotAuthorized.defaultProps = {};\n\nNotAuthorized.propTypes = {};\n\nexport default NotAuthorized;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { useLocation, useHistory } from \"react-router-dom\";\n\nconst ErrorPage = () => {\n const location = useLocation();\n const history = useHistory();\n const errorMessage = location.state?.errorMessage ?? \"Something went wrong\";\n const showBackBtn = location.state?.showBackBtn ?? true;\n return (\n \n

Woops Sorry

\n
{errorMessage}
\n {showBackBtn && }\n \n );\n};\n\nErrorPage.propTypes = {\n errorMessage: PropTypes.string,\n};\n\nexport default ErrorPage;\n","import { useLocation, useHistory } from \"react-router-dom\";\nimport queryString from \"query-string\";\n\nconst OldSignatureUrlHandler = () => {\n console.log('old signature url handler')\n const location = useLocation();\n const history = useHistory();\n const params = queryString.parse(location.search);\n console.log(params);\n const decodedToken = window.atob(params.token);\n const urlParams = `/signature?token=${decodedToken}&template_id=${params.html_document_template_id}&signature_id=${params.assignment_id}`;\n history.push(urlParams);\n return null;\n};\n\nexport default OldSignatureUrlHandler;\n","export default __webpack_public_path__ + \"static/media/404-error.5f546723.png\";","import React from \"react\";\nimport NotFoundImage from \"../../assets/images/404-error.png\";\n\nconst NotFound = () => {\n return (\n \n \n \n \n \n

\n You are not authorized to access this page.\n
\n Please try again or contact an administrator\n

\n

\n

Please close this window.

\n

\n \n \n );\n};\n\nexport default NotFound;\n","import React, { Component } from \"react\";\nimport { Switch, Route } from \"react-router-dom\";\nimport SignDocument from \"./components/sign-document\";\nimport PrintView from \"./components/print-view\";\nimport CreateTemplate from \"./components/create-template\";\nimport DevelopmentUI from \"./development\";\nimport TemplateEditor from \"./components/template-editor\";\nimport TemplatePreview from \"./components/template-preview\";\nimport CopyTemplate from \"./components/copy-template\";\nimport NotAuthorized from \"./components/not-authorized\";\nimport ErrorPage from \"./components/error-page\";\nimport OldSignatureUrlHandler from \"./components/OldSignatureUrlHandler\";\nimport NotFoundPage from \"./components/not-found\";\nimport { QueryClient, QueryClientProvider } from \"react-query\";\nimport \"./app.scss\";\nimport \"./custom.css\";\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n retry: false,\n refetchOnWindowFocus: false,\n },\n },\n});\n\nexport default class App extends Component {\n static displayName = App.name;\n render() {\n return (\n \n
\n \n \n \n \n \n \n \n \n \n \n {/* */}\n {/* */}\n {/* */}\n \n \n \n \n \n {/* index.php?route=common/patient&token=${encoded_token}&html_document_template_id=${sig.html_document_template_id}&patient_id=${user_id} */}\n {/* - // &assignment_id=${sig.signature_assignment_id}&platform=web` */}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n );\n }\n}\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://cra.link/PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\r\n);\r\n\r\nexport function register(config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://cra.link/PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl, config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then((registration) => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://cra.link/PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch((error) => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' },\r\n })\r\n .then((response) => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then((registration) => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log('No internet connection found. App is running in offline mode.');\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready\r\n .then((registration) => {\r\n registration.unregister();\r\n })\r\n .catch((error) => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n","const reportWebVitals = (onPerfEntry) => {\r\n if (onPerfEntry && onPerfEntry instanceof Function) {\r\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\r\n getCLS(onPerfEntry);\r\n getFID(onPerfEntry);\r\n getFCP(onPerfEntry);\r\n getLCP(onPerfEntry);\r\n getTTFB(onPerfEntry);\r\n });\r\n }\r\n};\r\n\r\nexport default reportWebVitals;\r\n","import { configureStore } from \"@reduxjs/toolkit\";\r\nimport layoutReducer from \"./layout\";\r\nimport templateInfoReducer from \"./template-info\";\r\n\r\nexport default configureStore({\r\n reducer: {\r\n layout: layoutReducer,\r\n template_info: templateInfoReducer\r\n }\r\n});\r\n","import React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport App from \"./app\";\r\nimport * as serviceWorkerRegistration from \"./serviceWorkerRegistration\";\r\nimport reportWebVitals from \"./reportWebVitals\";\r\nimport { createBrowserHistory } from \"history\";\r\nimport { Router } from \"react-router-dom\";\r\nimport { Provider } from \"react-redux\";\r\nimport store from \"./redux/store\";\r\nimport \"./index.css\";\r\n\r\nconst rootElement = document.getElementById(\"root\");\r\nexport const browserHistory = createBrowserHistory();\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n ,\r\n rootElement\r\n);\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://cra.link/PWA\r\nserviceWorkerRegistration.unregister();\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals();\r\n"],"sourceRoot":""}