{"ast":null,"code":"import _slicedToArray from \"/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/slicedToArray\";\n\nvar _this = this,\n _jsxFileName = \"/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/src/components/MessagesDemo.js\";\n\nimport React, { useRef, useState } from 'react';\nimport { Toast } from 'primereact/toast';\nimport { Messages } from 'primereact/messages';\nimport { Message } from 'primereact/message';\nimport { InputText } from 'primereact/inputtext';\nimport { Button } from 'primereact/button';\n\nvar MessagesDemo = function MessagesDemo() {\n var _useState = useState(''),\n _useState2 = _slicedToArray(_useState, 2),\n username = _useState2[0],\n setUsername = _useState2[1];\n\n var _useState3 = useState(''),\n _useState4 = _slicedToArray(_useState3, 2),\n email = _useState4[0],\n setEmail = _useState4[1];\n\n var toast = useRef();\n var message = useRef();\n\n var addSuccessMessage = function addSuccessMessage() {\n message.current.show({\n severity: 'success',\n content: 'Message Detail'\n });\n };\n\n var addInfoMessage = function addInfoMessage() {\n message.current.show({\n severity: 'info',\n content: 'Message Detail'\n });\n };\n\n var addWarnMessage = function addWarnMessage() {\n message.current.show({\n severity: 'warn',\n content: 'Message Detail'\n });\n };\n\n var addErrorMessage = function addErrorMessage() {\n message.current.show({\n severity: 'error',\n content: 'Message Detail'\n });\n };\n\n var showSuccess = function showSuccess() {\n toast.current.show({\n severity: 'success',\n summary: 'Success Message',\n detail: 'Message Detail',\n life: 3000\n });\n };\n\n var showInfo = function showInfo() {\n toast.current.show({\n severity: 'info',\n summary: 'Info Message',\n detail: 'Message Detail',\n life: 3000\n });\n };\n\n var showWarn = function showWarn() {\n toast.current.show({\n severity: 'warn',\n summary: 'Warn Message',\n detail: 'Message Detail',\n life: 3000\n });\n };\n\n var showError = function showError() {\n toast.current.show({\n severity: 'error',\n summary: 'Error Message',\n detail: 'Message Detail',\n life: 3000\n });\n };\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"grid\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 9\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"col-12 lg:col-6\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 13\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"card\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 17\n }\n }, /*#__PURE__*/React.createElement(\"h5\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 21\n }\n }, \"Toast\"), /*#__PURE__*/React.createElement(Toast, {\n ref: toast,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 21\n }\n }), /*#__PURE__*/React.createElement(Button, {\n type: \"button\",\n onClick: showSuccess,\n label: \"Success\",\n className: \"p-button-success mr-2\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 21\n }\n }), /*#__PURE__*/React.createElement(Button, {\n type: \"button\",\n onClick: showInfo,\n label: \"Info\",\n className: \"p-button-info mr-2\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 21\n }\n }), /*#__PURE__*/React.createElement(Button, {\n type: \"button\",\n onClick: showWarn,\n label: \"Warn\",\n className: \"p-button-warning mr-2\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 21\n }\n }), /*#__PURE__*/React.createElement(Button, {\n type: \"button\",\n onClick: showError,\n label: \"Error\",\n className: \"p-button-danger mr-2\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 21\n }\n }))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"col-12 lg:col-6\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 13\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"card\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 17\n }\n }, /*#__PURE__*/React.createElement(\"h5\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 21\n }\n }, \"Messages\"), /*#__PURE__*/React.createElement(Button, {\n label: \"Success\",\n type: \"button\",\n onClick: addSuccessMessage,\n className: \"p-button-success mr-2\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 21\n }\n }), /*#__PURE__*/React.createElement(Button, {\n label: \"Info\",\n type: \"button\",\n onClick: addInfoMessage,\n className: \"p-button-info mr-2\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 21\n }\n }), /*#__PURE__*/React.createElement(Button, {\n label: \"Warn\",\n type: \"button\",\n onClick: addWarnMessage,\n className: \"p-button-warning mr-2\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 21\n }\n }), /*#__PURE__*/React.createElement(Button, {\n label: \"Error\",\n type: \"button\",\n onClick: addErrorMessage,\n className: \"p-button-danger mr-2\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 21\n }\n }), /*#__PURE__*/React.createElement(Messages, {\n ref: message,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 21\n }\n }))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"col-12 lg:col-8\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 13\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"card\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 17\n }\n }, /*#__PURE__*/React.createElement(\"h5\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 21\n }\n }, \"Inline\"), /*#__PURE__*/React.createElement(\"div\", {\n className: \"field grid\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 21\n }\n }, /*#__PURE__*/React.createElement(\"label\", {\n htmlFor: \"username1\",\n className: \"col-fixed w-9rem\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 25\n }\n }, \"Username\"), /*#__PURE__*/React.createElement(\"div\", {\n className: \"col\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 25\n }\n }, /*#__PURE__*/React.createElement(InputText, {\n id: \"username1\",\n value: username,\n onChange: function onChange(e) {\n return setUsername(e.target.value);\n },\n required: true,\n className: \"p-invalid mr-2\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 29\n }\n }), /*#__PURE__*/React.createElement(Message, {\n severity: \"error\",\n text: \"Username is required\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 29\n }\n }))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"field grid\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 21\n }\n }, /*#__PURE__*/React.createElement(\"label\", {\n htmlFor: \"email\",\n className: \"col-fixed w-9rem\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 25\n }\n }, \"Email\"), /*#__PURE__*/React.createElement(\"div\", {\n className: \"col\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 25\n }\n }, /*#__PURE__*/React.createElement(InputText, {\n id: \"email\",\n value: email,\n onChange: function onChange(e) {\n return setEmail(e.target.value);\n },\n required: true,\n className: \"p-invalid mr-2\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 29\n }\n }), /*#__PURE__*/React.createElement(Message, {\n severity: \"error\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 29\n }\n }))))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"col-12 lg:col-4\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 13\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"card\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 17\n }\n }, /*#__PURE__*/React.createElement(\"h5\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 21\n }\n }, \"Help Text\"), /*#__PURE__*/React.createElement(\"div\", {\n className: \"field p-fluid\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 95,\n columnNumber: 21\n }\n }, /*#__PURE__*/React.createElement(\"label\", {\n htmlFor: \"username2\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 25\n }\n }, \"Username\"), /*#__PURE__*/React.createElement(InputText, {\n id: \"username2\",\n type: \"text\",\n className: \"p-invalid\",\n \"aria-describedby\": \"username-help\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 25\n }\n }), /*#__PURE__*/React.createElement(\"small\", {\n id: \"username-help\",\n className: \"p-error\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 25\n }\n }, \"Enter your username to reset your password.\")))));\n};\n\nvar comparisonFn = function comparisonFn(prevProps, nextProps) {\n return prevProps.location.pathname === nextProps.location.pathname;\n};\n\nexport default React.memo(MessagesDemo, comparisonFn);","map":{"version":3,"names":["React","useRef","useState","Toast","Messages","Message","InputText","Button","MessagesDemo","username","setUsername","email","setEmail","toast","message","addSuccessMessage","current","show","severity","content","addInfoMessage","addWarnMessage","addErrorMessage","showSuccess","summary","detail","life","showInfo","showWarn","showError","e","target","value","comparisonFn","prevProps","nextProps","location","pathname","memo"],"sources":["/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/src/components/MessagesDemo.js"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { Toast } from 'primereact/toast';\nimport { Messages } from 'primereact/messages';\nimport { Message } from 'primereact/message';\nimport { InputText } from 'primereact/inputtext';\nimport { Button } from 'primereact/button';\n\nconst MessagesDemo = () => {\n const [username, setUsername] = useState('');\n const [email, setEmail] = useState('');\n const toast = useRef();\n const message = useRef();\n\n const addSuccessMessage = () => {\n message.current.show({ severity: 'success', content: 'Message Detail' });\n };\n\n const addInfoMessage = () => {\n message.current.show({ severity: 'info', content: 'Message Detail' });\n };\n\n const addWarnMessage = () => {\n message.current.show({ severity: 'warn', content: 'Message Detail' });\n };\n\n const addErrorMessage = () => {\n message.current.show({ severity: 'error', content: 'Message Detail' });\n };\n\n const showSuccess = () => {\n toast.current.show({ severity: 'success', summary: 'Success Message', detail: 'Message Detail', life: 3000 });\n };\n\n const showInfo = () => {\n toast.current.show({ severity: 'info', summary: 'Info Message', detail: 'Message Detail', life: 3000 });\n };\n\n const showWarn = () => {\n toast.current.show({ severity: 'warn', summary: 'Warn Message', detail: 'Message Detail', life: 3000 });\n };\n\n const showError = () => {\n toast.current.show({ severity: 'error', summary: 'Error Message', detail: 'Message Detail', life: 3000 });\n };\n\n return (\n