{"ast":null,"code":"var _jsxFileName = \"D:\\\\Project\\\\UC_Trains_Voice\\\\react-demo\\\\src\\\\gavt\\\\GavtCali.tsx\",\n  _s = $RefreshSig$();\nimport React, { useState } from 'react';\nimport { Divider, Steps, Breadcrumb, Button, message } from 'antd';\nimport { AudioOutlined } from '@ant-design/icons';\nimport { Link } from 'react-router-dom';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst stepsTitles = ['Instruction', 'Before You Start', 'Record Your Voice', 'Complete'];\nconst stepsDescriptions = [`This module will record your production of different vowel sounds so we can provide resonance targets customized to your voice. \n    If you do not want to complete this procedure right now, or if you experience any technical difficulty, you can use resonance targets derived from a published reference sample of cis women or men (under the “Reference Targets” tab). \n    It should take around five minutes to complete the customization process.`, `To measure your resonance for a vowel, we want you to sustain JUST the vowel sound for about two seconds. (We will give you a key word to identify the vowel, but you should produce only the vowel sound, not the whole word.) Try to produce the vowel in a way that feels natural and comfortable to you – we will use our measurements from this production as a baseline for any changes in resonance. \n    Everyone's vowels will be a bit different depending on their dialect or language background. That’s OK!\n    When you are ready to produce the vowel, click “start” and sustain the vowel for about two seconds, then click “stop.”\n    `, 'Follow the steps to record your voice.', 'Review and complete the calibration.'];\nconst recordingSteps = [{\n  title: '“ee” like in “seed” ',\n  description: 'Click “start” and pronounce the vowel for 2 seconds, then click “stop”.'\n}, {\n  title: '“ih” like in “hid” ',\n  description: 'Click “start” and pronounce the vowel for 2 seconds, then click “stop”.'\n}, {\n  title: '“eh” like in “head” ',\n  description: 'Click “start” and pronounce the vowel for 2 seconds, then click “stop”.'\n}];\nconst GavtCali = () => {\n  _s();\n  const [currentStep, setCurrentStep] = useState(0);\n  const [currentRecordingStep, setCurrentRecordingStep] = useState(0);\n  const [isRecording, setIsRecording] = useState(false);\n  const nextStep = () => {\n    if (currentStep < stepsTitles.length - 1) {\n      setCurrentStep(currentStep + 1);\n      setIsRecording(false); // Reset recording state\n      setCurrentRecordingStep(0); // Reset recording step\n    }\n  };\n  const prevStep = () => {\n    if (currentStep > 0) {\n      setCurrentStep(currentStep - 1);\n      setIsRecording(false); // Reset recording state\n      setCurrentRecordingStep(0); // Reset recording step\n    }\n  };\n  const startRecording = () => {\n    setIsRecording(true);\n    message.info('Recording started!');\n  };\n  const stopRecording = () => {\n    setIsRecording(false);\n    message.info('Recording saved!');\n  };\n  const renderRecordingButton = () => /*#__PURE__*/_jsxDEV(Button, {\n    icon: /*#__PURE__*/_jsxDEV(AudioOutlined, {}, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 64,\n      columnNumber: 13\n    }, this),\n    onClick: isRecording ? stopRecording : startRecording,\n    type: isRecording ? \"default\" : \"primary\",\n    children: isRecording ? 'Stop Recording' : 'Start Recording'\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 63,\n    columnNumber: 5\n  }, this);\n  const renderStepContent = step => {\n    switch (step) {\n      case 2:\n        return /*#__PURE__*/_jsxDEV(\"div\", {\n          children: [/*#__PURE__*/_jsxDEV(Steps, {\n            progressDot: true,\n            current: currentRecordingStep,\n            direction: \"vertical\",\n            items: recordingSteps\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 77,\n            columnNumber: 13\n          }, this), renderRecordingButton()]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 76,\n          columnNumber: 11\n        }, this);\n      default:\n        return /*#__PURE__*/_jsxDEV(\"p\", {\n          children: stepsDescriptions[step]\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 82,\n          columnNumber: 16\n        }, this);\n    }\n  };\n  return /*#__PURE__*/_jsxDEV(\"div\", {\n    style: {\n      display: 'flex',\n      flexDirection: 'column',\n      alignItems: 'center',\n      marginTop: '20px',\n      width: '80%'\n    },\n    children: [/*#__PURE__*/_jsxDEV(Breadcrumb, {\n      style: {\n        marginBottom: '20px',\n        alignSelf: 'start'\n      },\n      children: [/*#__PURE__*/_jsxDEV(Breadcrumb.Item, {\n        children: /*#__PURE__*/_jsxDEV(Link, {\n          to: \"/gavt\",\n          children: \"Gavt Home\"\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 89,\n          columnNumber: 26\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 89,\n        columnNumber: 9\n      }, this), /*#__PURE__*/_jsxDEV(Breadcrumb.Item, {\n        children: \"Calibration\"\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 90,\n        columnNumber: 9\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 88,\n      columnNumber: 7\n    }, this), /*#__PURE__*/_jsxDEV(Steps, {\n      progressDot: true,\n      current: currentStep,\n      items: stepsTitles.map(title => ({\n        title\n      }))\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 92,\n      columnNumber: 7\n    }, this), /*#__PURE__*/_jsxDEV(Divider, {}, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 93,\n      columnNumber: 7\n    }, this), renderStepContent(currentStep), /*#__PURE__*/_jsxDEV(\"div\", {\n      style: {\n        marginTop: '20px'\n      },\n      children: [/*#__PURE__*/_jsxDEV(Button, {\n        disabled: currentStep === 0,\n        onClick: prevStep,\n        children: \"Previous\"\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 96,\n        columnNumber: 9\n      }, this), /*#__PURE__*/_jsxDEV(Button, {\n        type: \"primary\",\n        onClick: nextStep,\n        disabled: currentStep === stepsTitles.length - 1,\n        children: currentStep === stepsTitles.length - 1 ? 'Finish' : 'Next'\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 97,\n        columnNumber: 9\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 95,\n      columnNumber: 7\n    }, this)]\n  }, void 0, true, {\n    fileName: _jsxFileName,\n    lineNumber: 87,\n    columnNumber: 5\n  }, this);\n};\n_s(GavtCali, \"PBWyBqeUkTSo4ypxwy2Ro2Ktotg=\");\n_c = GavtCali;\nexport default GavtCali;\nvar _c;\n$RefreshReg$(_c, \"GavtCali\");","map":{"version":3,"names":["React","useState","Divider","Steps","Breadcrumb","Button","message","AudioOutlined","Link","jsxDEV","_jsxDEV","stepsTitles","stepsDescriptions","recordingSteps","title","description","GavtCali","_s","currentStep","setCurrentStep","currentRecordingStep","setCurrentRecordingStep","isRecording","setIsRecording","nextStep","length","prevStep","startRecording","info","stopRecording","renderRecordingButton","icon","fileName","_jsxFileName","lineNumber","columnNumber","onClick","type","children","renderStepContent","step","progressDot","current","direction","items","style","display","flexDirection","alignItems","marginTop","width","marginBottom","alignSelf","Item","to","map","disabled","_c","$RefreshReg$"],"sources":["D:/Project/UC_Trains_Voice/react-demo/src/gavt/GavtCali.tsx"],"sourcesContent":["import React, { useState } from 'react';\r\nimport { Divider, Steps, Breadcrumb, Button, message } from 'antd';\r\nimport { AudioOutlined } from '@ant-design/icons';\r\nimport { Link } from 'react-router-dom';\r\n\r\nconst stepsTitles = [\r\n  'Instruction',\r\n  'Before You Start',\r\n  'Record Your Voice',\r\n  'Complete'\r\n];\r\n\r\nconst stepsDescriptions = [\r\n    `This module will record your production of different vowel sounds so we can provide resonance targets customized to your voice. \r\n    If you do not want to complete this procedure right now, or if you experience any technical difficulty, you can use resonance targets derived from a published reference sample of cis women or men (under the “Reference Targets” tab). \r\n    It should take around five minutes to complete the customization process.`,\r\n    `To measure your resonance for a vowel, we want you to sustain JUST the vowel sound for about two seconds. (We will give you a key word to identify the vowel, but you should produce only the vowel sound, not the whole word.) Try to produce the vowel in a way that feels natural and comfortable to you – we will use our measurements from this production as a baseline for any changes in resonance. \r\n    Everyone's vowels will be a bit different depending on their dialect or language background. That’s OK!\r\n    When you are ready to produce the vowel, click “start” and sustain the vowel for about two seconds, then click “stop.”\r\n    `,\r\n    'Follow the steps to record your voice.',\r\n    'Review and complete the calibration.'\r\n];\r\n\r\nconst recordingSteps = [\r\n    { title: '“ee” like in “seed” ', description: 'Click “start” and pronounce the vowel for 2 seconds, then click “stop”.' },\r\n    { title: '“ih” like in “hid” ', description: 'Click “start” and pronounce the vowel for 2 seconds, then click “stop”.' },\r\n    { title: '“eh” like in “head” ', description: 'Click “start” and pronounce the vowel for 2 seconds, then click “stop”.' }\r\n];\r\n\r\nconst GavtCali: React.FC = () => {\r\n  const [currentStep, setCurrentStep] = useState(0);\r\n  const [currentRecordingStep, setCurrentRecordingStep] = useState(0);\r\n  const [isRecording, setIsRecording] = useState(false);\r\n\r\n  const nextStep = () => {\r\n    if (currentStep < stepsTitles.length - 1) {\r\n      setCurrentStep(currentStep + 1);\r\n      setIsRecording(false); // Reset recording state\r\n      setCurrentRecordingStep(0); // Reset recording step\r\n    }\r\n  };\r\n\r\n  const prevStep = () => {\r\n    if (currentStep > 0) {\r\n      setCurrentStep(currentStep - 1);\r\n      setIsRecording(false); // Reset recording state\r\n      setCurrentRecordingStep(0); // Reset recording step\r\n    }\r\n  };\r\n\r\n  const startRecording = () => {\r\n    setIsRecording(true);\r\n    message.info('Recording started!');\r\n  };\r\n\r\n  const stopRecording = () => {\r\n    setIsRecording(false);\r\n    message.info('Recording saved!');\r\n  };\r\n\r\n  const renderRecordingButton = () => (\r\n    <Button\r\n      icon={<AudioOutlined />}\r\n      onClick={isRecording ? stopRecording : startRecording}\r\n      type={isRecording ? \"default\" : \"primary\"}\r\n    >\r\n      {isRecording ? 'Stop Recording' : 'Start Recording'}\r\n    </Button>\r\n  );\r\n\r\n  const renderStepContent = (step: number) => {\r\n    switch(step) {\r\n      case 2:\r\n        return (\r\n          <div>\r\n            <Steps progressDot current={currentRecordingStep} direction=\"vertical\" items={recordingSteps} />\r\n            {renderRecordingButton()}\r\n          </div>\r\n        );\r\n      default:\r\n        return <p>{stepsDescriptions[step]}</p>;\r\n    }\r\n  };\r\n\r\n  return (\r\n    <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: '20px', width: '80%' }}>\r\n      <Breadcrumb style={{ marginBottom: '20px', alignSelf: 'start' }}>\r\n        <Breadcrumb.Item><Link to=\"/gavt\">Gavt Home</Link></Breadcrumb.Item>\r\n        <Breadcrumb.Item>Calibration</Breadcrumb.Item>\r\n      </Breadcrumb>\r\n      <Steps progressDot current={currentStep} items={stepsTitles.map(title => ({ title }))} />\r\n      <Divider />\r\n      {renderStepContent(currentStep)}\r\n      <div style={{ marginTop: '20px' }}>\r\n        <Button disabled={currentStep === 0} onClick={prevStep}>Previous</Button>\r\n        <Button type=\"primary\" onClick={nextStep} disabled={currentStep === stepsTitles.length - 1}>\r\n          {currentStep === stepsTitles.length - 1 ? 'Finish' : 'Next'}\r\n        </Button>\r\n      </div>\r\n    </div>\r\n  );\r\n}\r\n\r\nexport default GavtCali;"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,OAAO,EAAEC,KAAK,EAAEC,UAAU,EAAEC,MAAM,EAAEC,OAAO,QAAQ,MAAM;AAClE,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,IAAI,QAAQ,kBAAkB;AAAC,SAAAC,MAAA,IAAAC,OAAA;AAExC,MAAMC,WAAW,GAAG,CAClB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,CACX;AAED,MAAMC,iBAAiB,GAAG,CACrB;AACL;AACA,8EAA8E,EACzE;AACL;AACA;AACA,KAAK,EACD,wCAAwC,EACxC,sCAAsC,CACzC;AAED,MAAMC,cAAc,GAAG,CACnB;EAAEC,KAAK,EAAE,sBAAsB;EAAEC,WAAW,EAAE;AAA0E,CAAC,EACzH;EAAED,KAAK,EAAE,qBAAqB;EAAEC,WAAW,EAAE;AAA0E,CAAC,EACxH;EAAED,KAAK,EAAE,sBAAsB;EAAEC,WAAW,EAAE;AAA0E,CAAC,CAC5H;AAED,MAAMC,QAAkB,GAAGA,CAAA,KAAM;EAAAC,EAAA;EAC/B,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGlB,QAAQ,CAAC,CAAC,CAAC;EACj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