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AAQ,WACND,GAAK,IACH,QACFC,EAAK,UACH,UACFA,EAAK,UACH,QACFA,EAAK,SACH,aACFA,EAAK,SACH,WACJA,EAAA,IAEA,CACD,OAAAA,CAEM,CAEL,SACKC,EAAMf,CAAO,SAClB,EACAA,EAAO5O,IAAoB,CAAZ4O,EAAA5O,IAAQ,CACxB,GAAAuF,MAAA,CAAAqJ,EAAA9H,QAAA,MAAAvB,MAAA,CAAAqJ,EAAA7H,SAAA,EAFgB,GAAO,CD2EvBpK,EAAAC,CAAA,CAAAF,EAAA,qBAAA8S,CAAA,sBAAAG,CAAA,CCjG2B,EAwB3B","sources":["webpack://_N_E/./src/components/Form.tsx","webpack://_N_E/./src/components/Menu.tsx","webpack://_N_E/./src/components/Projects/NewProject/Name.tsx","webpack://_N_E/./src/components/Projects/NewProject/Alert.tsx","webpack://_N_E/./src/components/Projects/NewProject/Account.tsx","webpack://_N_E/./src/components/Projects/NewProject/Contact.tsx","webpack://_N_E/./src/components/Projects/NewProject/Project.tsx","webpack://_N_E/./src/components/Projects/NewProject/ProjectType.tsx","webpack://_N_E/./src/components/Projects/NewProject/PhotoPhases/PhaseForm.tsx","webpack://_N_E/./src/components/Projects/NewProject/PhotoPhases/index.tsx","webpack://_N_E/./src/components/Projects/NewProject/ProjectCategory.tsx","webpack://_N_E/./src/components/Projects/NewProject/index.tsx","webpack://_N_E/./src/utils/user.ts","webpack://_N_E/"],"sourcesContent":["import { useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Dialog from \"@mui/material/Dialog\";\nimport AppBar from \"@mui/material/AppBar\";\nimport Toolbar from \"@mui/material/Toolbar\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Typography from \"@mui/material/Typography\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport Slide from \"@mui/material/Slide\";\nimport { TransitionProps } from \"@mui/material/transitions\";\nimport { forwardRef, ReactNode } from \"react\";\n\nimport { RedirectTypes } from \"utils/project\";\n\nconst Transition = forwardRef(function Transition(\n props: TransitionProps & {\n children: React.ReactElement;\n },\n ref: React.Ref\n) {\n return ;\n});\n\ninterface FormProps {\n open: boolean;\n setOpen: (o: boolean) => void;\n title: string;\n submitText?: string;\n hideSubmitButton?: boolean;\n onSave: (event?: React.FormEvent) => Promise;\n // これを指定した場合、実際に閉じる処理も外部で実装する必要がある\n onClose?: () => void;\n children: ReactNode | ReactNode[];\n // redirectする際の設定をするもので、実際のredirect処理はonSave等外部で実施する必要がある\n // redirectTypeはSubmit時のevent.target.nameを通して利用可能\n redirectConfig?: {\n type: RedirectTypes;\n text: string;\n };\n}\n\nexport default function Form({\n open,\n setOpen,\n title,\n submitText = \"保存\",\n hideSubmitButton = false,\n onSave,\n onClose,\n children,\n redirectConfig,\n}: FormProps) {\n const [isSubmitting, setIsSubmitting] = useState(false);\n\n const handleClose = () => {\n if (onClose) {\n return onClose();\n }\n setOpen(false);\n };\n\n const handleSave = async (event: React.FormEvent) => {\n event.preventDefault();\n if (isSubmitting) return;\n setIsSubmitting(true);\n await onSave(event);\n setIsSubmitting(false);\n };\n\n return (\n \n
\n \n \n \n \n \n \n {title}\n \n {!hideSubmitButton && (\n \n {submitText}\n \n )}\n {redirectConfig && (\n \n {redirectConfig.text}\n \n )}\n \n \n {children}\n
\n \n );\n}\n","import Menu from \"@mui/material/Menu\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\n\nimport { useNetworkStatus } from \"hooks/online\";\n\ninterface Menu {\n icon?: any;\n label: string;\n onClick: () => any;\n}\n\ninterface MenuProps {\n open: boolean;\n anchor: HTMLElement | null;\n menus: Menu[];\n onClose: () => void;\n}\n\nexport default function BasicMenu({ open, anchor, menus, onClose }: MenuProps) {\n const online = useNetworkStatus();\n\n if (!open) return
;\n return (\n \n {menus.map((menu) => (\n {\n menu.onClick();\n onClose();\n }}\n disabled={!online}\n >\n {menu.icon && {menu.icon}}\n {menu.label}\n \n ))}\n \n );\n}\n","import { Controller, useFormContext } from \"react-hook-form\";\nimport TextField from \"@mui/material/TextField\";\n\nexport default function Name() {\n const { control } = useFormContext();\n\n return (\n (\n \n )}\n control={control}\n name=\"name\"\n rules={{\n required: \"必須項目です\",\n }}\n />\n );\n}\n","import { Controller, useFormContext } from \"react-hook-form\";\nimport TextField from \"@mui/material/TextField\";\n\nexport default function Alert() {\n const { control } = useFormContext();\n\n return (\n (\n \n )}\n control={control}\n name=\"alert\"\n />\n );\n}\n","import { useState, useEffect } from \"react\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport Autocomplete from \"@mui/material/Autocomplete\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport TextField from \"@mui/material/TextField\";\nimport Box from \"@mui/material/Box\";\n\nimport { useAccounts } from \"contexts/accounts\";\nimport { useDebounce } from \"hooks/debounce\";\n\ninterface Selected {\n name: string | null;\n id?: string | null;\n}\n\nexport default function Account() {\n const [val, setVal] = useState(\"\");\n const [selected, setSelected] = useState(null);\n const { control, setValue, watch } = useFormContext();\n const { accounts, loading, refetch } = useAccounts();\n const debouncedInputText = useDebounce(val, 500);\n\n const [options, setOptions] = useState([]);\n\n const accountName = watch(\"accountName\");\n const accountId = watch(\"accountId\");\n\n useEffect(() => {\n setOptions(\n accounts\n .filter((account) => account.active ?? true)\n .map((acc, idx) => {\n const contacts = acc.contacts?.items.filter(\n (contact) => contact?.active ?? true\n );\n return {\n name: acc.name,\n site: acc.site,\n numOfContacts: contacts?.length || 0,\n id: acc.id,\n key: acc.id + idx,\n };\n })\n );\n }, [accounts]);\n\n useEffect(() => {\n if (!accountName) return;\n setSelected({ name: accountName, id: accountId });\n }, [accountName, accountId]);\n\n const reload = async (keyword: string) => {\n await refetch({\n filter: {\n name: {\n contains: keyword,\n },\n },\n limit: 9999,\n });\n };\n\n useEffect(() => {\n if (debouncedInputText) {\n reload(debouncedInputText);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [debouncedInputText]);\n\n return (\n \n !!value.id && option.id === value.id\n }\n getOptionLabel={(opt) => opt.name || \"\"}\n options={options}\n renderOption={(props, option) => (\n \n {option.name} {option.site} ({option.numOfContacts})\n \n )}\n inputValue={val}\n value={selected}\n onInputChange={(_, value) => {\n setVal(value || \"\");\n setSelected({ name: value });\n }}\n onChange={(_, value) => {\n if (value) {\n setValue(\"accountId\", value.id);\n setValue(\"accountName\", `${value.name} ${value.site || \"\"}`);\n (document.activeElement as HTMLInputElement).blur();\n } else {\n setValue(\"accountId\", null);\n setValue(\"accountName\", null);\n setSelected({ name: null, id: null });\n }\n }}\n loading={loading}\n renderInput={(params) => (\n (\n {\n setVal(\"\");\n setValue(\"accountId\", null);\n setValue(\"accountName\", null);\n setSelected({ name: \"\", id: null });\n }}\n inputProps={{\n ...params.inputProps,\n autoComplete: \"new-password\",\n endAdornment: (\n <>\n {loading ? (\n \n ) : null}\n {params.InputProps.endAdornment}\n \n ),\n }}\n />\n )}\n control={control}\n name=\"accountId\"\n rules={{\n required: \"必須項目です\",\n }}\n />\n )}\n />\n );\n}\n","import { useEffect, useState } from \"react\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport Autocomplete from \"@mui/material/Autocomplete\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport TextField from \"@mui/material/TextField\";\n\nimport { useContacts } from \"contexts/contacts\";\nimport { useDebounce } from \"hooks/debounce\";\nimport { useAccounts } from \"contexts/accounts\";\n\nexport default function Contact() {\n const [val, setVal] = useState(\"\");\n const [selected, setSelected] = useState(null);\n const { control, setValue, watch } = useFormContext();\n const { searchedContacts, contacts, loading, refetch, setContactSearchText } =\n useContacts();\n const { accounts } = useAccounts();\n\n const accountId = watch(\"accountId\");\n const contactName = watch(\"contactName\");\n const contactId = watch(\"contactId\");\n\n const debouncedAccountId = useDebounce(accountId, 500);\n\n const [options, setOptions] = useState<\n {\n id: string;\n accountId: string;\n accountName: string;\n label: string;\n }[]\n >([]);\n\n useEffect(() => {\n if (accountId === \"\" || accountId === undefined || accountId === null) {\n setOptions(\n searchedContacts\n ?.filter((c) => {\n const account = accounts.find(\n (account) => account.id === c.account?.id\n );\n return (c.active ?? true) && (account?.active ?? true);\n })\n .map((c) => ({\n id: c.id,\n accountId: c.accountId,\n accountName: `${c.account?.name} ${c.account?.site || \"\"}` || \"\",\n label: c.name || `${c.lastName} ${c.firstName}`,\n }))\n );\n } else {\n setOptions(\n contacts\n ?.filter((c) => c.active ?? true)\n .map((c) => ({\n id: c.id,\n accountId: c.accountId,\n accountName: `${c.account?.name} ${c.account?.site || \"\"}` || \"\",\n label: c.name || `${c.lastName} ${c.firstName}`,\n }))\n );\n }\n }, [contacts, accountId, searchedContacts, accounts]);\n\n useEffect(() => {\n refetch({ accountId: debouncedAccountId });\n const contactUpdate =\n contacts.length > 0 && contacts[0].accountId != debouncedAccountId;\n if (!contactUpdate) return;\n if (\n debouncedAccountId === \"\" ||\n debouncedAccountId === undefined ||\n debouncedAccountId === null\n ) {\n setValue(\"contactId\", null);\n setValue(\"contactName\", null);\n setSelected({ label: \"\", id: null });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [debouncedAccountId]);\n\n useEffect(() => {\n if (!contactName) return;\n setSelected({ label: contactName, id: contactId });\n }, [contactName, contactId]);\n\n return (\n \n !!value && option.id === value.id\n }\n inputValue={val}\n value={selected}\n onInputChange={(_, value) => {\n setContactSearchText(value || \"\");\n setVal(value || \"\");\n setSelected({ label: value });\n }}\n onChange={(_, value) => {\n if (value) {\n setValue(\"contactId\", value.id);\n setValue(\"contactName\", value.label);\n setValue(\"accountId\", value.accountId);\n setValue(\"accountName\", value.accountName);\n (document.activeElement as HTMLInputElement).blur();\n } else {\n setValue(\"contactId\", null);\n setValue(\"contactName\", null);\n }\n }}\n autoHighlight\n loading={loading}\n renderOption={(props, option) => (\n
  • \n {option.label} ({option.accountName})\n
  • \n )}\n renderInput={(params) => (\n (\n {\n setVal(\"\");\n setValue(\"contactId\", null);\n setValue(\"contactName\", null);\n setSelected({ label: \"\", id: null });\n }}\n inputProps={{\n ...params.inputProps,\n autoComplete: \"new-password\",\n endAdornment: (\n <>\n {loading ? (\n \n ) : null}\n {params.InputProps.endAdornment}\n \n ),\n }}\n />\n )}\n control={control}\n name=\"contactId\"\n defaultValue={contacts ? contacts[0]?.id : null}\n rules={{\n required: \"必須項目です\",\n }}\n />\n )}\n />\n );\n}\n","import { useState, useEffect } from \"react\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport Autocomplete from \"@mui/material/Autocomplete\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport TextField from \"@mui/material/TextField\";\nimport Box from \"@mui/material/Box\";\nimport { API } from \"aws-amplify\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nimport { CustomError } from \"utils/error\";\nimport { useDebounce } from \"hooks/debounce\";\nimport { getContact } from \"graphql/queries\";\nimport { Contact } from \"API\";\nimport { projectsByGroupIdForManager } from \"graphql/queries\";\nimport { Project as ProjectType } from \"API\";\nimport { useAlerts } from \"contexts/alerts\";\n\ninterface ProjectProps {\n defaultProjects?: ProjectType[];\n groupId: String | undefined;\n}\nexport default function Project({ groupId, defaultProjects }: ProjectProps) {\n const { control, setValue, watch } = useFormContext();\n const [inputText, setInputText] = useState(\"\");\n const debouncedInputText = useDebounce(inputText, 500);\n const { addAlert } = useAlerts();\n\n const [selectedProject, setSelectedProject] = useState<{\n name: string | undefined;\n id: string | undefined;\n } | null>(null);\n const pastProjectId = watch(\"pastProjectId\");\n\n const { data: projects = defaultProjects, isLoading } = useQuery({\n queryKey: [\"projectsByGroupIdForManager\", groupId, debouncedInputText],\n queryFn: async () => {\n let nextToken: string | null = null;\n let allItems: ProjectType[] = [];\n try {\n while (true) {\n const res: any = await API.graphql({\n query: projectsByGroupIdForManager,\n variables: {\n groupId,\n filter: {\n archived: { ne: true },\n name: { contains: debouncedInputText },\n },\n sortDirection: \"DESC\",\n nextToken,\n },\n authMode: \"AMAZON_COGNITO_USER_POOLS\",\n });\n const items = res.data.projectsByGroupIdForManager.items;\n allItems = allItems.concat(items);\n nextToken = res.data.projectsByGroupIdForManager.nextToken;\n if (!nextToken) break;\n }\n return allItems;\n } catch (err) {\n const customError = new CustomError(err, \"get\");\n addAlert({ message: customError.message, severity: \"error\" });\n }\n },\n staleTime: 1000 * 60 * 5,\n gcTime: 1000 * 60 * 6,\n enabled: !!debouncedInputText,\n });\n\n const options = projects?.map((acc, idx) => ({\n name: acc.name,\n reference: acc.reference,\n id: acc.id,\n key: acc.id + idx,\n }));\n\n useEffect(() => {\n if (pastProjectId) {\n const project = projects?.find((p) => p.id === pastProjectId);\n if (project) {\n if (project.account?.active ?? true) {\n setValue(\"accountId\", project.accountId);\n setValue(\"accountName\", project.accountName);\n }\n if (project.category?.active ?? true) {\n setValue(\"categoryId\", project.categoryId);\n }\n // useEffectの型エラー回避のためawaitでなくthen使用\n getContactById(project.contactId).then((contact) => {\n if (!contact) {\n setValue(\"contactId\", null);\n setValue(\"contactName\", null);\n } else if (contact.active ?? true) {\n setValue(\"contactId\", project.contactId);\n setValue(\"contactName\", project.contactName);\n }\n });\n setValue(\"projectId\", project.id);\n setValue(\"type\", project.type);\n setSelectedProject({ name: project.name, id: project.id });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [pastProjectId]);\n\n const getContactById = async (id: string): Promise => {\n try {\n const contact = (\n await API.graphql({\n query: getContact,\n variables: { id },\n authMode: \"AMAZON_COGNITO_USER_POOLS\",\n })\n ).data.getContact;\n return contact;\n } catch (err) {\n return null;\n }\n };\n\n return (\n value && option.id === value.id}\n getOptionLabel={(opt) => opt.name ?? \"\"}\n options={options ?? []}\n renderOption={(props, option) => (\n \n {option.name}\n \n )}\n value={selectedProject || null}\n onInputChange={(_, value) => {\n setInputText(value || \"\");\n }}\n onChange={async (_, value) => {\n //TODO: cannot set value to the form\n if (value) {\n const project = projects?.find((p) => p.id === value.id);\n if (project) {\n if (project?.account?.active ?? true) {\n setValue(\"accountId\", project.accountId);\n setValue(\"accountName\", project.accountName);\n }\n if (project.category?.active ?? true) {\n setValue(\"categoryId\", project.categoryId);\n }\n const contact = await getContactById(project.contactId);\n if (!contact) {\n setValue(\"contactId\", null);\n setValue(\"contactName\", null);\n } else if (contact.active ?? true) {\n setValue(\"contactId\", project.contactId);\n setValue(\"contactName\", project.contactName);\n }\n }\n setValue(\"projectId\", project?.id);\n setValue(\"type\", project?.type);\n setSelectedProject({ name: project?.name, id: project?.id });\n } else {\n setValue(\"accountId\", null);\n setValue(\"accountName\", null);\n setValue(\"contactId\", null);\n setValue(\"contactName\", null);\n setValue(\"projectId\", null);\n setValue(\"categoryId\", null);\n setValue(\"type\", null);\n setSelectedProject(null);\n }\n }}\n loading={isLoading}\n renderInput={(params) => (\n (\n \n {isLoading ? (\n \n ) : null}\n {params.InputProps.endAdornment}\n \n ),\n }}\n />\n )}\n control={control}\n name=\"pastProjectId\"\n />\n )}\n />\n );\n}\n","import { Controller, useFormContext } from \"react-hook-form\";\nimport TextField from \"@mui/material/TextField\";\nimport MenuItem from \"@mui/material/MenuItem\";\n\nexport default function ProjectType() {\n const { control } = useFormContext();\n return (\n (\n \n 梱包\n その他\n \n )}\n control={control}\n name=\"type\"\n defaultValue=\"PACK\"\n rules={{\n required: \"必須項目です\",\n }}\n />\n );\n}\n","import Tooltip from \"@mui/material/Tooltip\";\nimport Checkbox from \"@mui/material/Checkbox\";\nimport TextField from \"@mui/material/TextField\";\nimport FormGroup from \"@mui/material/FormGroup\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Button from \"@mui/material/Button\";\nimport Dialog from \"@mui/material/Dialog\";\nimport DialogActions from \"@mui/material/DialogActions\";\nimport DialogContent from \"@mui/material/DialogContent\";\nimport DialogTitle from \"@mui/material/DialogTitle\";\nimport { useForm } from \"react-hook-form\";\nimport { useEffect } from \"react\";\n\nimport { ProjectPhotoPhase } from \"API\";\n\ninterface Props {\n title: string;\n open: boolean;\n onSubmit: (data: any) => void;\n onClose: () => void;\n phase?: ProjectPhotoPhase | null;\n}\n\nexport default function PhaseForm({\n title,\n open,\n phase,\n onSubmit,\n onClose,\n}: Props) {\n const { register, handleSubmit, watch, setValue } = useForm();\n\n useEffect(() => {\n if (open) return setValue(\"name\", phase?.name);\n setValue(\"name\", null);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n const phaseNameInput = watch(\"name\");\n\n return (\n \n {title}\n \n \n \n \n \n }\n />\n \n \n \n \n \n \n \n \n );\n}\n","import Chip from \"@mui/material/Chip\";\nimport Stack from \"@mui/material/Stack\";\nimport ArrowForwardIosIcon from \"@mui/icons-material/ArrowForwardIos\";\nimport AddCircleIcon from \"@mui/icons-material/AddCircle\";\nimport { useFormContext } from \"react-hook-form\";\nimport { Dispatch, SetStateAction, useEffect, useState } from \"react\";\nimport { uuid } from \"short-uuid\";\n\nimport PhaseForm from \"./PhaseForm\";\n\nimport { ProjectPhotoPhase } from \"API\";\n\nfunction NextArrowIcon({\n insertable,\n onClick,\n}: {\n insertable?: boolean;\n onClick?: () => void;\n}) {\n const [isHovering, setIsHovered] = useState(false);\n\n if (!insertable)\n return (\n
    \n \n
    \n );\n\n const onMouseEnter = () => setIsHovered(true);\n const onMouseLeave = () => setIsHovered(false);\n return (\n \n {!isHovering && }\n {isHovering && }\n
    \n );\n}\n\ninterface PhaseChipProps {\n phase: ProjectPhotoPhase;\n setPhotoPhases: Dispatch>;\n}\n\nfunction PhaseChip({ phase, setPhotoPhases }: PhaseChipProps) {\n const [open, setOpen] = useState(false);\n\n const handleClick = () => setOpen(true);\n const handleClose = () => setOpen(false);\n\n const handleDelete = () => {\n setPhotoPhases((prev: ProjectPhotoPhase[]) =>\n prev.filter((p) => p.id !== phase?.id)\n );\n };\n\n const handleUpdate = (data: any) => {\n if (!data.name) return;\n setPhotoPhases((prev: ProjectPhotoPhase[]) =>\n prev.map((p) => (p.id === phase?.id ? data : p))\n );\n handleClose();\n };\n\n const phaseName = (phase: ProjectPhotoPhase) => {\n if (phase.requiresPhoto) return `*${phase?.name}`;\n return phase?.name;\n };\n\n return (\n <>\n \n \n \n );\n}\n\nexport default function PhotoPhases() {\n const [open, setOpen] = useState(false);\n const [index, setIndex] = useState(0);\n const { setValue } = useFormContext();\n const [photoPhases, setPhotoPhases] = useState([]);\n\n useEffect(() => {\n setValue(\"photoPhases\", photoPhases);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [photoPhases]);\n\n const handleClick = (idx: number) => {\n setIndex(idx);\n setOpen(true);\n };\n const handleClose = () => setOpen(false);\n\n const handleCreate = (data: any) => {\n if (!data.name) return;\n let newArray = photoPhases.slice();\n newArray.splice(index, 0, { id: uuid(), ...data });\n setPhotoPhases(newArray);\n handleClose();\n };\n\n return (\n \n \n \n handleClick(0)} />\n {photoPhases?.map((phase, idx) => (\n <>\n \n handleClick(idx + 1)} />\n \n ))}\n \n \n );\n}\n","import { useState } from \"react\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport Autocomplete from \"@mui/material/Autocomplete\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport TextField from \"@mui/material/TextField\";\nimport Box from \"@mui/material/Box\";\nimport { API } from \"aws-amplify\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nimport { CustomError } from \"utils/error\";\nimport { useDebounce } from \"hooks/debounce\";\nimport { ProjectCategory as ProjectCategoryType } from \"API\";\nimport { useAlerts } from \"contexts/alerts\";\nimport { projectCategoriesByGroupId } from \"graphql/queries\";\n\ninterface ProjectProps {\n defaultProjectCategories?: ProjectCategoryType[];\n groupId: String | undefined;\n}\nexport function ProjectCategory({\n groupId,\n defaultProjectCategories,\n}: ProjectProps) {\n const { control } = useFormContext();\n const [inputText, setInputText] = useState(\"\");\n const debouncedInputText = useDebounce(inputText, 500);\n const { addAlert } = useAlerts();\n\n const { data: projectCategories = defaultProjectCategories, isLoading } =\n useQuery({\n queryKey: [\"projectCategories\", groupId, debouncedInputText],\n queryFn: async () => {\n let nextToken: string | null = null;\n let allItems: ProjectCategoryType[] = [];\n try {\n while (true) {\n const res: any = await API.graphql({\n query: projectCategoriesByGroupId,\n variables: {\n groupId,\n nextToken,\n filter: {\n active: { ne: false },\n name: { contains: debouncedInputText },\n },\n },\n authMode: \"AMAZON_COGNITO_USER_POOLS\",\n });\n const items = res.data.projectCategoriesByGroupId.items;\n allItems = allItems.concat(items);\n nextToken = res.data.projectCategoriesByGroupId.nextToken;\n if (!nextToken) break;\n }\n return allItems;\n } catch (err) {\n const customError = new CustomError(err, \"get\");\n addAlert({ message: customError.message, severity: \"error\" });\n }\n },\n staleTime: 1000 * 60 * 5,\n gcTime: 1000 * 60 * 6,\n });\n\n const options = projectCategories\n ?.map((p) => ({\n name: p.name,\n id: p.id,\n }))\n .sort((a, b) => a.name.localeCompare(b.name));\n\n return (\n (\n option.id === field.value) ?? null}\n onChange={(_, selectedOption) => {\n field.onChange(selectedOption?.id ?? null);\n }}\n onInputChange={(_, value) => {\n setInputText(value || \"\");\n }}\n options={options ?? []}\n isOptionEqualToValue={(option) => option.id === field.value}\n getOptionLabel={(opt) => opt.name ?? \"\"}\n renderOption={(props, option) => (\n \n {option.name}\n \n )}\n loading={isLoading}\n renderInput={(params) => (\n \n {isLoading ? (\n \n ) : null}\n {params.InputProps.endAdornment}\n \n ),\n }}\n />\n )}\n />\n )}\n />\n );\n}\n","import { useForm, FormProvider } from \"react-hook-form\";\nimport Typography from \"@mui/material/Typography\";\nimport { useEffect } from \"react\";\n\nimport Name from \"./Name\";\nimport Alert from \"./Alert\";\nimport Account from \"./Account\";\nimport Contact from \"./Contact\";\nimport Project from \"./Project\";\nimport ProjectType from \"./ProjectType\";\nimport PhotoPhases from \"./PhotoPhases\";\nimport { ProjectCategory } from \"./ProjectCategory\";\n\nimport { useAccounts } from \"contexts/accounts\";\nimport { useProjects } from \"contexts/projects\";\nimport Form from \"components/Form\";\nimport { useAuth } from \"contexts/auth\";\nimport { RedirectTypes } from \"utils/project\";\nimport { Project as ProjectT } from \"API\";\n\ninterface NewProjectProps {\n open: boolean;\n setOpen: (o: boolean) => void;\n defaultValues?: any;\n projects?: ProjectT[];\n}\n\nexport function NewProject({\n open,\n setOpen,\n defaultValues,\n projects,\n}: NewProjectProps) {\n const { create, copy } = useProjects();\n const { refetch: refetchAccounts } = useAccounts();\n const { user, currentGroup } = useAuth();\n const { handleSubmit, reset, ...method } = useForm({\n defaultValues,\n });\n\n useEffect(() => {\n reset();\n refetchAccounts({\n tenantId: user?.tenantId,\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n const onSubmit = (data: any, event: any) => {\n const redirectType = event.target.name;\n if (data.projectId) {\n // コピーの場合以下三つは使わないので削除\n if (data.pastProjectId || data.pastProjectId === \"\")\n delete data.pastProjectId;\n if (data.photoPhases) delete data.photoPhases;\n copy(data, redirectType);\n } else {\n create(data, redirectType);\n }\n setOpen(false);\n };\n\n return (\n \n \n
    \n
    \n \n \n \n \n \n \n \n
    \n \n 案件写真フェーズ\n \n \n 案件単位で写真を取れます\n \n \n
    \n
    \n
    \n \n
    \n );\n}\n","import type { ProjectsByGroupIdForManagerUser, User } from \"API\";\n\nexport type Role = \"READONLY\" | \"ADMIN\" | \"MANAGER\" | \"SALES\" | \"PRODUCTION\";\n\nexport function getRoleName(role: Role) {\n let roleName = \"?\";\n switch (role) {\n case \"ADMIN\":\n roleName = \"管理者\";\n case \"MANAGER\":\n roleName = \"責任者\";\n case \"SALES\":\n roleName = \"営業\";\n case \"PRODUCTION\":\n roleName = \"現場\";\n case \"READONLY\":\n roleName = \"閲覧\";\n }\n\n return roleName;\n}\n\nexport function getFullName(\n user: User | ProjectsByGroupIdForManagerUser | null | undefined\n) {\n if (!user) return \"-\";\n if (user.name) return user.name;\n return `${user.lastName} ${user.firstName}`;\n}\n","\"use strict\";\n(self[\"webpackChunk_N_E\"] = self[\"webpackChunk_N_E\"] || []).push([[2814],{\n\n/***/ 11553:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Z\": function() { return /* binding */ Form; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85893);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67294);\n/* harmony import */ var _mui_material_Button__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(69417);\n/* harmony import */ var _mui_material_Dialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(50657);\n/* harmony import */ var _mui_material_AppBar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(42293);\n/* harmony import */ var _mui_material_Toolbar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(10155);\n/* harmony import */ var _mui_material_IconButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(93946);\n/* harmony import */ var _mui_material_Typography__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(15861);\n/* harmony import */ var _mui_icons_material_Close__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(50594);\n/* harmony import */ var _mui_material_Slide__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(54776);\n\n\n\n\n\n\n\n\n\n\n\nconst Transition = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function Transition(props, ref) {\n return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material_Slide__WEBPACK_IMPORTED_MODULE_2__/* [\"default\"] */ .Z, {\n direction: \"up\",\n ref: ref,\n ...props\n });\n});\nfunction Form(param) {\n let { open , setOpen , title , submitText =\"保存\" , hideSubmitButton =false , onSave , onClose , children , redirectConfig } = param;\n const [isSubmitting, setIsSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);\n const handleClose = ()=>{\n if (onClose) {\n return onClose();\n }\n setOpen(false);\n };\n const handleSave = async (event)=>{\n event.preventDefault();\n if (isSubmitting) return;\n setIsSubmitting(true);\n await onSave(event);\n setIsSubmitting(false);\n };\n return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material_Dialog__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .Z, {\n fullScreen: true,\n open: open,\n onClose: handleClose,\n TransitionComponent: Transition,\n children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(\"form\", {\n onSubmit: handleSave,\n children: [\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material_AppBar__WEBPACK_IMPORTED_MODULE_4__/* [\"default\"] */ .Z, {\n sx: {\n position: \"relative\"\n },\n children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mui_material_Toolbar__WEBPACK_IMPORTED_MODULE_5__/* [\"default\"] */ .Z, {\n children: [\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material_IconButton__WEBPACK_IMPORTED_MODULE_6__/* [\"default\"] */ .Z, {\n edge: \"start\",\n color: \"inherit\",\n onClick: handleClose,\n \"aria-label\": \"close\",\n children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_icons_material_Close__WEBPACK_IMPORTED_MODULE_7__/* [\"default\"] */ .Z, {})\n }),\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_8__/* [\"default\"] */ .Z, {\n sx: {\n ml: 2,\n flex: 1\n },\n variant: \"h6\",\n component: \"div\",\n children: title\n }),\n !hideSubmitButton && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_9__/* [\"default\"] */ .Z, {\n onClick: handleSave,\n type: \"submit\",\n autoFocus: true,\n color: \"inherit\",\n disabled: isSubmitting,\n children: submitText\n }),\n redirectConfig && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_9__/* [\"default\"] */ .Z, {\n sx: {\n ml: 2\n },\n onClick: handleSave,\n type: \"submit\",\n autoFocus: true,\n color: \"inherit\",\n name: redirectConfig.type,\n disabled: isSubmitting,\n children: redirectConfig.text\n })\n ]\n })\n }),\n children\n ]\n })\n });\n}\n\n\n/***/ }),\n\n/***/ 70258:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Z\": function() { return /* binding */ BasicMenu; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85893);\n/* harmony import */ var _mui_material_Menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25464);\n/* harmony import */ var _mui_material_MenuItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18972);\n/* harmony import */ var _mui_material_ListItemText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(59334);\n/* harmony import */ var _mui_material_ListItemIcon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(48885);\n/* harmony import */ var hooks_online__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13662);\n\n\n\n\n\n\nfunction BasicMenu(param) {\n let { open , anchor , menus , onClose } = param;\n const online = (0,hooks_online__WEBPACK_IMPORTED_MODULE_1__/* .useNetworkStatus */ .k)();\n if (!open) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(\"div\", {});\n return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material_Menu__WEBPACK_IMPORTED_MODULE_2__/* [\"default\"] */ .Z, {\n id: \"basic-menu\",\n open: open,\n onClose: onClose,\n anchorEl: anchor,\n MenuListProps: {\n \"aria-labelledby\": \"basic-button\"\n },\n children: menus.map((menu)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mui_material_MenuItem__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .Z, {\n onClick: ()=>{\n menu.onClick();\n onClose();\n },\n disabled: !online,\n children: [\n menu.icon && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material_ListItemIcon__WEBPACK_IMPORTED_MODULE_4__/* [\"default\"] */ .Z, {\n children: menu.icon\n }),\n /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material_ListItemText__WEBPACK_IMPORTED_MODULE_5__/* [\"default\"] */ .Z, {\n children: menu.label\n })\n ]\n }, menu.label))\n });\n}\n\n\n/***/ }),\n\n/***/ 25744:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"V\": function() { return /* binding */ NewProject; }\n});\n\n// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js\nvar jsx_runtime = __webpack_require__(85893);\n// EXTERNAL MODULE: ./node_modules/react-hook-form/dist/index.esm.mjs\nvar index_esm = __webpack_require__(87536);\n// EXTERNAL MODULE: ./node_modules/@mui/material/Typography/Typography.js + 1 modules\nvar Typography = __webpack_require__(15861);\n// EXTERNAL MODULE: ./node_modules/react/index.js\nvar react = __webpack_require__(67294);\n// EXTERNAL MODULE: ./node_modules/@mui/material/TextField/TextField.js + 3 modules\nvar TextField = __webpack_require__(61903);\n;// CONCATENATED MODULE: ./src/components/Projects/NewProject/Name.tsx\n\n\n\nfunction Name() {\n const { control } = (0,index_esm/* useFormContext */.Gc)();\n return /*#__PURE__*/ (0,jsx_runtime.jsx)(index_esm/* Controller */.Qr, {\n render: (param)=>/*#__PURE__*/ {\n let { field } = param;\n return (0,jsx_runtime.jsx)(TextField/* default */.Z, {\n label: \"案件名\",\n variant: \"outlined\",\n required: true,\n ...field\n });\n },\n control: control,\n name: \"name\",\n rules: {\n required: \"必須項目です\"\n }\n });\n}\n\n;// CONCATENATED MODULE: ./src/components/Projects/NewProject/Alert.tsx\n\n\n\nfunction Alert() {\n const { control } = (0,index_esm/* useFormContext */.Gc)();\n return /*#__PURE__*/ (0,jsx_runtime.jsx)(index_esm/* Controller */.Qr, {\n render: (param)=>/*#__PURE__*/ {\n let { field } = param;\n return (0,jsx_runtime.jsx)(TextField/* default */.Z, {\n multiline: true,\n rows: 3,\n label: \"注意事項\",\n variant: \"outlined\",\n helperText: \"要注意案件の場合、こちらで記名してください\",\n ...field\n });\n },\n control: control,\n name: \"alert\"\n });\n}\n\n// EXTERNAL MODULE: ./node_modules/@mui/material/Autocomplete/Autocomplete.js + 1 modules\nvar Autocomplete = __webpack_require__(5306);\n// EXTERNAL MODULE: ./node_modules/@mui/material/CircularProgress/CircularProgress.js + 1 modules\nvar CircularProgress = __webpack_require__(98456);\n// EXTERNAL MODULE: ./node_modules/@mui/material/Box/Box.js + 2 modules\nvar Box = __webpack_require__(5616);\n// EXTERNAL MODULE: ./src/contexts/accounts.tsx\nvar contexts_accounts = __webpack_require__(7742);\n// EXTERNAL MODULE: ./src/hooks/debounce.ts\nvar debounce = __webpack_require__(63025);\n;// CONCATENATED MODULE: ./src/components/Projects/NewProject/Account.tsx\n\n\n\n\n\n\n\n\n\nfunction Account() {\n const [val, setVal] = (0,react.useState)(\"\");\n const [selected, setSelected] = (0,react.useState)(null);\n const { control , setValue , watch } = (0,index_esm/* useFormContext */.Gc)();\n const { accounts , loading , refetch } = (0,contexts_accounts/* useAccounts */.x)();\n const debouncedInputText = (0,debounce/* useDebounce */.N)(val, 500);\n const [options, setOptions] = (0,react.useState)([]);\n const accountName = watch(\"accountName\");\n const accountId = watch(\"accountId\");\n (0,react.useEffect)(()=>{\n var _active;\n setOptions(accounts.filter((account)=>(_active = account.active) !== null && _active !== void 0 ? _active : true).map((acc, idx)=>{\n var ref;\n var ref1;\n const contacts = (ref = acc.contacts) === null || ref === void 0 ? void 0 : ref.items.filter((contact)=>{\n return (ref1 = contact === null || contact === void 0 ? void 0 : contact.active) !== null && ref1 !== void 0 ? ref1 : true;\n });\n return {\n name: acc.name,\n site: acc.site,\n numOfContacts: (contacts === null || contacts === void 0 ? void 0 : contacts.length) || 0,\n id: acc.id,\n key: acc.id + idx\n };\n }));\n }, [\n accounts\n ]);\n (0,react.useEffect)(()=>{\n if (!accountName) return;\n setSelected({\n name: accountName,\n id: accountId\n });\n }, [\n accountName,\n accountId\n ]);\n const reload = async (keyword)=>{\n await refetch({\n filter: {\n name: {\n contains: keyword\n }\n },\n limit: 9999\n });\n };\n (0,react.useEffect)(()=>{\n if (debouncedInputText) {\n reload(debouncedInputText);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n debouncedInputText\n ]);\n return /*#__PURE__*/ (0,jsx_runtime.jsx)(Autocomplete/* default */.Z, {\n includeInputInList: true,\n filterSelectedOptions: true,\n isOptionEqualToValue: (option, value)=>!!value.id && option.id === value.id,\n getOptionLabel: (opt)=>opt.name || \"\",\n options: options,\n renderOption: (props, option)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)(Box/* default */.Z, {\n component: \"li\",\n ...props,\n children: [\n option.name,\n \" \",\n option.site,\n \" (\",\n option.numOfContacts,\n \")\"\n ]\n }),\n inputValue: val,\n value: selected,\n onInputChange: (_, value)=>{\n setVal(value || \"\");\n setSelected({\n name: value\n });\n },\n onChange: (_, value)=>{\n if (value) {\n setValue(\"accountId\", value.id);\n setValue(\"accountName\", \"\".concat(value.name, \" \").concat(value.site || \"\"));\n document.activeElement.blur();\n } else {\n setValue(\"accountId\", null);\n setValue(\"accountName\", null);\n setSelected({\n name: null,\n id: null\n });\n }\n },\n loading: loading,\n renderInput: (params)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(index_esm/* Controller */.Qr, {\n render: (param)=>/*#__PURE__*/ {\n let { field } = param;\n return (0,jsx_runtime.jsx)(TextField/* default */.Z, {\n sx: {\n width: \"100%\"\n },\n label: \"取引先\",\n variant: \"outlined\",\n required: true,\n ...field,\n ...params,\n onFocus: ()=>{\n setVal(\"\");\n setValue(\"accountId\", null);\n setValue(\"accountName\", null);\n setSelected({\n name: \"\",\n id: null\n });\n },\n inputProps: {\n ...params.inputProps,\n autoComplete: \"new-password\",\n endAdornment: /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {\n children: [\n loading ? /*#__PURE__*/ (0,jsx_runtime.jsx)(CircularProgress/* default */.Z, {\n color: \"inherit\",\n size: 20\n }) : null,\n params.InputProps.endAdornment\n ]\n })\n }\n });\n },\n control: control,\n name: \"accountId\",\n rules: {\n required: \"必須項目です\"\n }\n })\n });\n}\n\n// EXTERNAL MODULE: ./src/contexts/contacts.tsx\nvar contexts_contacts = __webpack_require__(36225);\n;// CONCATENATED MODULE: ./src/components/Projects/NewProject/Contact.tsx\n\n\n\n\n\n\n\n\n\nfunction Contact() {\n const [val, setVal] = (0,react.useState)(\"\");\n const [selected, setSelected] = (0,react.useState)(null);\n const { control , setValue , watch } = (0,index_esm/* useFormContext */.Gc)();\n const { searchedContacts , contacts , loading , refetch , setContactSearchText } = (0,contexts_contacts/* useContacts */.g)();\n const { accounts } = (0,contexts_accounts/* useAccounts */.x)();\n const accountId = watch(\"accountId\");\n const contactName = watch(\"contactName\");\n const contactId = watch(\"contactId\");\n const debouncedAccountId = (0,debounce/* useDebounce */.N)(accountId, 500);\n const [options, setOptions] = (0,react.useState)([]);\n (0,react.useEffect)(()=>{\n if (accountId === \"\" || accountId === undefined || accountId === null) {\n setOptions(searchedContacts === null || searchedContacts === void 0 ? void 0 : searchedContacts.filter((c)=>{\n const account = accounts.find((account)=>{\n var ref;\n return account.id === ((ref = c.account) === null || ref === void 0 ? void 0 : ref.id);\n });\n var _active, ref;\n return ((_active = c.active) !== null && _active !== void 0 ? _active : true) && ((ref = account === null || account === void 0 ? void 0 : account.active) !== null && ref !== void 0 ? ref : true);\n }).map((c)=>{\n var ref, ref1;\n return {\n id: c.id,\n accountId: c.accountId,\n accountName: \"\".concat((ref = c.account) === null || ref === void 0 ? void 0 : ref.name, \" \").concat(((ref1 = c.account) === null || ref1 === void 0 ? void 0 : ref1.site) || \"\") || \"\",\n label: c.name || \"\".concat(c.lastName, \" \").concat(c.firstName)\n };\n }));\n } else {\n var _active;\n setOptions(contacts === null || contacts === void 0 ? void 0 : contacts.filter((c)=>(_active = c.active) !== null && _active !== void 0 ? _active : true).map((c)=>{\n var ref, ref1;\n return {\n id: c.id,\n accountId: c.accountId,\n accountName: \"\".concat((ref = c.account) === null || ref === void 0 ? void 0 : ref.name, \" \").concat(((ref1 = c.account) === null || ref1 === void 0 ? void 0 : ref1.site) || \"\") || \"\",\n label: c.name || \"\".concat(c.lastName, \" \").concat(c.firstName)\n };\n }));\n }\n }, [\n contacts,\n accountId,\n searchedContacts,\n accounts\n ]);\n (0,react.useEffect)(()=>{\n refetch({\n accountId: debouncedAccountId\n });\n const contactUpdate = contacts.length > 0 && contacts[0].accountId != debouncedAccountId;\n if (!contactUpdate) return;\n if (debouncedAccountId === \"\" || debouncedAccountId === undefined || debouncedAccountId === null) {\n setValue(\"contactId\", null);\n setValue(\"contactName\", null);\n setSelected({\n label: \"\",\n id: null\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n debouncedAccountId\n ]);\n (0,react.useEffect)(()=>{\n if (!contactName) return;\n setSelected({\n label: contactName,\n id: contactId\n });\n }, [\n contactName,\n contactId\n ]);\n return /*#__PURE__*/ (0,jsx_runtime.jsx)(Autocomplete/* default */.Z, {\n options: options,\n isOptionEqualToValue: (option, value)=>!!value && option.id === value.id,\n inputValue: val,\n value: selected,\n onInputChange: (_, value)=>{\n setContactSearchText(value || \"\");\n setVal(value || \"\");\n setSelected({\n label: value\n });\n },\n onChange: (_, value)=>{\n if (value) {\n setValue(\"contactId\", value.id);\n setValue(\"contactName\", value.label);\n setValue(\"accountId\", value.accountId);\n setValue(\"accountName\", value.accountName);\n document.activeElement.blur();\n } else {\n setValue(\"contactId\", null);\n setValue(\"contactName\", null);\n }\n },\n autoHighlight: true,\n loading: loading,\n renderOption: (props, option)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)(\"li\", {\n ...props,\n children: [\n option.label,\n \" (\",\n option.accountName,\n \")\"\n ]\n }),\n renderInput: (params)=>{\n var ref;\n /*#__PURE__*/ return (0,jsx_runtime.jsx)(index_esm/* Controller */.Qr, {\n render: (param)=>/*#__PURE__*/ {\n let { field } = param;\n return (0,jsx_runtime.jsx)(TextField/* default */.Z, {\n sx: {\n width: \"100%\"\n },\n label: \"取引先担当者\",\n variant: \"outlined\",\n required: true,\n ...field,\n ...params,\n onFocus: ()=>{\n setVal(\"\");\n setValue(\"contactId\", null);\n setValue(\"contactName\", null);\n setSelected({\n label: \"\",\n id: null\n });\n },\n inputProps: {\n ...params.inputProps,\n autoComplete: \"new-password\",\n endAdornment: /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {\n children: [\n loading ? /*#__PURE__*/ (0,jsx_runtime.jsx)(CircularProgress/* default */.Z, {\n color: \"inherit\",\n size: 20\n }) : null,\n params.InputProps.endAdornment\n ]\n })\n }\n });\n },\n control: control,\n name: \"contactId\",\n defaultValue: contacts ? (ref = contacts[0]) === null || ref === void 0 ? void 0 : ref.id : null,\n rules: {\n required: \"必須項目です\"\n }\n });\n }\n });\n}\n\n// EXTERNAL MODULE: ./node_modules/@aws-amplify/api/lib-esm/API.js + 1 modules\nvar API = __webpack_require__(10552);\n// EXTERNAL MODULE: ./node_modules/@tanstack/react-query/build/modern/useQuery.js + 7 modules\nvar useQuery = __webpack_require__(87633);\n// EXTERNAL MODULE: ./src/utils/error.ts\nvar error = __webpack_require__(78191);\n// EXTERNAL MODULE: ./src/graphql/queries.ts\nvar queries = __webpack_require__(18490);\n// EXTERNAL MODULE: ./src/contexts/alerts.tsx + 6 modules\nvar alerts = __webpack_require__(75313);\n;// CONCATENATED MODULE: ./src/components/Projects/NewProject/Project.tsx\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction Project(param) {\n let { groupId , defaultProjects } = param;\n const { control , setValue , watch } = (0,index_esm/* useFormContext */.Gc)();\n const [inputText, setInputText] = (0,react.useState)(\"\");\n const debouncedInputText = (0,debounce/* useDebounce */.N)(inputText, 500);\n const { addAlert } = (0,alerts/* useAlerts */.Z)();\n const [selectedProject, setSelectedProject] = (0,react.useState)(null);\n const pastProjectId = watch(\"pastProjectId\");\n const { data: projects = defaultProjects , isLoading } = (0,useQuery/* useQuery */.a)({\n queryKey: [\n \"projectsByGroupIdForManager\",\n groupId,\n debouncedInputText\n ],\n queryFn: async ()=>{\n let nextToken = null;\n let allItems = [];\n try {\n while(true){\n const res = await API/* API.graphql */.b.graphql({\n query: queries.projectsByGroupIdForManager,\n variables: {\n groupId,\n filter: {\n archived: {\n ne: true\n },\n name: {\n contains: debouncedInputText\n }\n },\n sortDirection: \"DESC\",\n nextToken\n },\n authMode: \"AMAZON_COGNITO_USER_POOLS\"\n });\n const items = res.data.projectsByGroupIdForManager.items;\n allItems = allItems.concat(items);\n nextToken = res.data.projectsByGroupIdForManager.nextToken;\n if (!nextToken) break;\n }\n return allItems;\n } catch (err) {\n const customError = new error/* CustomError */.s(err, \"get\");\n addAlert({\n message: customError.message,\n severity: \"error\"\n });\n }\n },\n staleTime: 1000 * 60 * 5,\n gcTime: 1000 * 60 * 6,\n enabled: !!debouncedInputText\n });\n const options = projects === null || projects === void 0 ? void 0 : projects.map((acc, idx)=>({\n name: acc.name,\n reference: acc.reference,\n id: acc.id,\n key: acc.id + idx\n }));\n (0,react.useEffect)(()=>{\n if (pastProjectId) {\n const project = projects === null || projects === void 0 ? void 0 : projects.find((p)=>p.id === pastProjectId);\n if (project) {\n var ref, ref1;\n var ref2;\n if ((ref2 = (ref = project.account) === null || ref === void 0 ? void 0 : ref.active) !== null && ref2 !== void 0 ? ref2 : true) {\n setValue(\"accountId\", project.accountId);\n setValue(\"accountName\", project.accountName);\n }\n var ref3;\n if ((ref3 = (ref1 = project.category) === null || ref1 === void 0 ? void 0 : ref1.active) !== null && ref3 !== void 0 ? ref3 : true) {\n setValue(\"categoryId\", project.categoryId);\n }\n // useEffectの型エラー回避のためawaitでなくthen使用\n getContactById(project.contactId).then((contact)=>{\n var _active;\n if (!contact) {\n setValue(\"contactId\", null);\n setValue(\"contactName\", null);\n } else if ((_active = contact.active) !== null && _active !== void 0 ? _active : true) {\n setValue(\"contactId\", project.contactId);\n setValue(\"contactName\", project.contactName);\n }\n });\n setValue(\"projectId\", project.id);\n setValue(\"type\", project.type);\n setSelectedProject({\n name: project.name,\n id: project.id\n });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n pastProjectId\n ]);\n const getContactById = async (id)=>{\n try {\n const contact = (await API/* API.graphql */.b.graphql({\n query: queries.getContact,\n variables: {\n id\n },\n authMode: \"AMAZON_COGNITO_USER_POOLS\"\n })).data.getContact;\n return contact;\n } catch (err) {\n return null;\n }\n };\n var _name;\n return /*#__PURE__*/ (0,jsx_runtime.jsx)(Autocomplete/* default */.Z, {\n includeInputInList: true,\n filterSelectedOptions: true,\n isOptionEqualToValue: (option, value)=>value && option.id === value.id,\n getOptionLabel: (opt)=>(_name = opt.name) !== null && _name !== void 0 ? _name : \"\",\n options: options !== null && options !== void 0 ? options : [],\n renderOption: (props, option)=>/*#__PURE__*/ (0,react.createElement)(Box/* default */.Z, {\n ...props,\n key: option.id,\n component: \"li\"\n }, option.name),\n value: selectedProject || null,\n onInputChange: (_, value)=>{\n setInputText(value || \"\");\n },\n onChange: async (_, value)=>{\n //TODO: cannot set value to the form\n if (value) {\n const project = projects === null || projects === void 0 ? void 0 : projects.find((p)=>p.id === value.id);\n if (project) {\n var ref, ref1;\n var ref2;\n if ((ref2 = project === null || project === void 0 ? void 0 : (ref = project.account) === null || ref === void 0 ? void 0 : ref.active) !== null && ref2 !== void 0 ? ref2 : true) {\n setValue(\"accountId\", project.accountId);\n setValue(\"accountName\", project.accountName);\n }\n var ref3;\n if ((ref3 = (ref1 = project.category) === null || ref1 === void 0 ? void 0 : ref1.active) !== null && ref3 !== void 0 ? ref3 : true) {\n setValue(\"categoryId\", project.categoryId);\n }\n const contact = await getContactById(project.contactId);\n var _active;\n if (!contact) {\n setValue(\"contactId\", null);\n setValue(\"contactName\", null);\n } else if ((_active = contact.active) !== null && _active !== void 0 ? _active : true) {\n setValue(\"contactId\", project.contactId);\n setValue(\"contactName\", project.contactName);\n }\n }\n setValue(\"projectId\", project === null || project === void 0 ? void 0 : project.id);\n setValue(\"type\", project === null || project === void 0 ? void 0 : project.type);\n setSelectedProject({\n name: project === null || project === void 0 ? void 0 : project.name,\n id: project === null || project === void 0 ? void 0 : project.id\n });\n } else {\n setValue(\"accountId\", null);\n setValue(\"accountName\", null);\n setValue(\"contactId\", null);\n setValue(\"contactName\", null);\n setValue(\"projectId\", null);\n setValue(\"categoryId\", null);\n setValue(\"type\", null);\n setSelectedProject(null);\n }\n },\n loading: isLoading,\n renderInput: (params)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(index_esm/* Controller */.Qr, {\n render: (param)=>/*#__PURE__*/ {\n let { field } = param;\n return (0,jsx_runtime.jsx)(TextField/* default */.Z, {\n sx: {\n width: \"100%\"\n },\n label: \"過去案件\",\n variant: \"outlined\",\n ...field,\n ...params,\n inputProps: {\n ...params.inputProps,\n autoComplete: \"new-password\",\n endAdornment: /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {\n children: [\n isLoading ? /*#__PURE__*/ (0,jsx_runtime.jsx)(CircularProgress/* default */.Z, {\n color: \"inherit\",\n size: 20\n }) : null,\n params.InputProps.endAdornment\n ]\n })\n }\n });\n },\n control: control,\n name: \"pastProjectId\"\n })\n });\n}\n\n// EXTERNAL MODULE: ./node_modules/@mui/material/MenuItem/MenuItem.js + 1 modules\nvar MenuItem = __webpack_require__(18972);\n;// CONCATENATED MODULE: ./src/components/Projects/NewProject/ProjectType.tsx\n\n\n\n\nfunction ProjectType() {\n const { control } = (0,index_esm/* useFormContext */.Gc)();\n return /*#__PURE__*/ (0,jsx_runtime.jsx)(index_esm/* Controller */.Qr, {\n render: (param)=>/*#__PURE__*/ {\n let { field } = param;\n return (0,jsx_runtime.jsxs)(TextField/* default */.Z, {\n select: true,\n label: \"案件タイプ\",\n variant: \"outlined\",\n ...field,\n children: [\n /*#__PURE__*/ (0,jsx_runtime.jsx)(MenuItem/* default */.Z, {\n value: \"PACK\",\n children: \"梱包\"\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(MenuItem/* default */.Z, {\n value: \"OTHER\",\n children: \"その他\"\n })\n ]\n });\n },\n control: control,\n name: \"type\",\n defaultValue: \"PACK\",\n rules: {\n required: \"必須項目です\"\n }\n });\n}\n\n// EXTERNAL MODULE: ./node_modules/@mui/material/Chip/Chip.js + 2 modules\nvar Chip = __webpack_require__(87918);\n// EXTERNAL MODULE: ./node_modules/@mui/material/Stack/Stack.js + 1 modules\nvar Stack = __webpack_require__(51233);\n// EXTERNAL MODULE: ./node_modules/@mui/icons-material/ArrowForwardIos.js\nvar ArrowForwardIos = __webpack_require__(13379);\n// EXTERNAL MODULE: ./node_modules/@mui/icons-material/AddCircle.js\nvar AddCircle = __webpack_require__(63205);\n// EXTERNAL MODULE: ./node_modules/short-uuid/index.js\nvar short_uuid = __webpack_require__(7597);\n// EXTERNAL MODULE: ./node_modules/@mui/material/Tooltip/Tooltip.js\nvar Tooltip = __webpack_require__(21023);\n// EXTERNAL MODULE: ./node_modules/@mui/material/Checkbox/Checkbox.js + 4 modules\nvar Checkbox = __webpack_require__(69368);\n// EXTERNAL MODULE: ./node_modules/@mui/material/FormGroup/FormGroup.js + 1 modules\nvar FormGroup = __webpack_require__(53457);\n// EXTERNAL MODULE: ./node_modules/@mui/material/FormControlLabel/FormControlLabel.js + 1 modules\nvar FormControlLabel = __webpack_require__(50480);\n// EXTERNAL MODULE: ./node_modules/@mui/material/Button/Button.js + 3 modules\nvar Button = __webpack_require__(69417);\n// EXTERNAL MODULE: ./node_modules/@mui/material/Dialog/Dialog.js + 1 modules\nvar Dialog = __webpack_require__(50657);\n// EXTERNAL MODULE: ./node_modules/@mui/material/DialogActions/DialogActions.js + 1 modules\nvar DialogActions = __webpack_require__(31425);\n// EXTERNAL MODULE: ./node_modules/@mui/material/DialogContent/DialogContent.js + 1 modules\nvar DialogContent = __webpack_require__(6514);\n// EXTERNAL MODULE: ./node_modules/@mui/material/DialogTitle/DialogTitle.js\nvar DialogTitle = __webpack_require__(37645);\n;// CONCATENATED MODULE: ./src/components/Projects/NewProject/PhotoPhases/PhaseForm.tsx\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction PhaseForm(param) {\n let { title , open , phase , onSubmit , onClose } = param;\n const { register , handleSubmit , watch , setValue } = (0,index_esm/* useForm */.cI)();\n (0,react.useEffect)(()=>{\n if (open) return setValue(\"name\", phase === null || phase === void 0 ? void 0 : phase.name);\n setValue(\"name\", null);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n open\n ]);\n const phaseNameInput = watch(\"name\");\n return /*#__PURE__*/ (0,jsx_runtime.jsxs)(Dialog/* default */.Z, {\n open: open,\n onClose: onClose,\n fullWidth: true,\n maxWidth: \"sm\",\n children: [\n /*#__PURE__*/ (0,jsx_runtime.jsx)(DialogTitle/* default */.Z, {\n children: title\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(DialogContent/* default */.Z, {\n children: /*#__PURE__*/ (0,jsx_runtime.jsxs)(FormGroup/* default */.Z, {\n children: [\n /*#__PURE__*/ (0,jsx_runtime.jsx)(TextField/* default */.Z, {\n autoFocus: true,\n margin: \"dense\",\n id: \"name\",\n label: \"フェーズ名\",\n fullWidth: true,\n required: true,\n variant: \"outlined\",\n defaultValue: phase === null || phase === void 0 ? void 0 : phase.name,\n helperText: !phaseNameInput && \"必須項目です\",\n ...register(\"name\")\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Tooltip/* default */.Z, {\n placement: \"left\",\n title: \"現場で写真を撮らないと次へ進めない\",\n children: /*#__PURE__*/ (0,jsx_runtime.jsx)(FormControlLabel/* default */.Z, {\n label: \"写真必須\",\n control: /*#__PURE__*/ (0,jsx_runtime.jsx)(Checkbox/* default */.Z, {\n defaultChecked: phase === null || phase === void 0 ? void 0 : phase.requiresPhoto,\n ...register(\"requiresPhoto\")\n })\n })\n })\n ]\n })\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsxs)(DialogActions/* default */.Z, {\n children: [\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Button/* default */.Z, {\n onClick: onClose,\n children: \"キャンセル\"\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Button/* default */.Z, {\n onClick: handleSubmit(onSubmit),\n children: \"保存\"\n })\n ]\n })\n ]\n });\n}\n\n;// CONCATENATED MODULE: ./src/components/Projects/NewProject/PhotoPhases/index.tsx\n\n\n\n\n\n\n\n\n\nfunction NextArrowIcon(param) {\n let { insertable , onClick } = param;\n const [isHovering, setIsHovered] = (0,react.useState)(false);\n if (!insertable) return /*#__PURE__*/ (0,jsx_runtime.jsx)(\"div\", {\n className: \"flex items-center\",\n children: /*#__PURE__*/ (0,jsx_runtime.jsx)(ArrowForwardIos/* default */.Z, {\n sx: {\n fontSize: 14\n }\n })\n });\n const onMouseEnter = ()=>setIsHovered(true);\n const onMouseLeave = ()=>setIsHovered(false);\n return /*#__PURE__*/ (0,jsx_runtime.jsxs)(\"div\", {\n className: \"flex items-center cursor-pointer\",\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n children: [\n !isHovering && /*#__PURE__*/ (0,jsx_runtime.jsx)(ArrowForwardIos/* default */.Z, {\n sx: {\n fontSize: 14\n }\n }),\n isHovering && /*#__PURE__*/ (0,jsx_runtime.jsx)(AddCircle/* default */.Z, {\n sx: {\n fontSize: 20\n },\n onClick: onClick\n })\n ]\n });\n}\nfunction PhaseChip(param) {\n let { phase , setPhotoPhases } = param;\n const [open, setOpen] = (0,react.useState)(false);\n const handleClick = ()=>setOpen(true);\n const handleClose = ()=>setOpen(false);\n const handleDelete = ()=>{\n setPhotoPhases((prev)=>{\n return prev.filter((p)=>{\n return p.id !== (phase === null || phase === void 0 ? void 0 : phase.id);\n });\n });\n };\n const handleUpdate = (data)=>{\n if (!data.name) return;\n setPhotoPhases((prev)=>{\n return prev.map((p)=>{\n return p.id === (phase === null || phase === void 0 ? void 0 : phase.id) ? data : p;\n });\n });\n handleClose();\n };\n const phaseName = (phase)=>{\n if (phase.requiresPhoto) return \"*\".concat(phase === null || phase === void 0 ? void 0 : phase.name);\n return phase === null || phase === void 0 ? void 0 : phase.name;\n };\n return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {\n children: [\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Chip/* default */.Z, {\n variant: \"outlined\",\n label: phaseName(phase),\n onClick: handleClick,\n onDelete: handleDelete\n }, phase === null || phase === void 0 ? void 0 : phase.id),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(PhaseForm, {\n title: \"写真フェーズ編集\",\n open: open,\n onClose: handleClose,\n phase: phase,\n onSubmit: handleUpdate\n })\n ]\n });\n}\nfunction PhotoPhases() {\n const [open, setOpen] = (0,react.useState)(false);\n const [index, setIndex] = (0,react.useState)(0);\n const { setValue } = (0,index_esm/* useFormContext */.Gc)();\n const [photoPhases, setPhotoPhases] = (0,react.useState)([]);\n (0,react.useEffect)(()=>{\n setValue(\"photoPhases\", photoPhases);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n photoPhases\n ]);\n const handleClick = (idx)=>{\n setIndex(idx);\n setOpen(true);\n };\n const handleClose = ()=>setOpen(false);\n const handleCreate = (data)=>{\n if (!data.name) return;\n let newArray = photoPhases.slice();\n newArray.splice(index, 0, {\n id: (0,short_uuid.uuid)(),\n ...data\n });\n setPhotoPhases(newArray);\n handleClose();\n };\n return /*#__PURE__*/ (0,jsx_runtime.jsxs)(Stack/* default */.Z, {\n direction: \"row\",\n sx: {\n flexWrap: \"wrap\",\n gap: 0.5\n },\n children: [\n /*#__PURE__*/ (0,jsx_runtime.jsx)(PhaseForm, {\n title: \"写真フェーズ挿入\",\n open: open,\n onClose: handleClose,\n onSubmit: handleCreate,\n phase: null\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Chip/* default */.Z, {\n label: \"入荷\"\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(NextArrowIcon, {\n insertable: true,\n onClick: ()=>handleClick(0)\n }),\n photoPhases === null || photoPhases === void 0 ? void 0 : photoPhases.map((phase, idx)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {\n children: [\n /*#__PURE__*/ (0,jsx_runtime.jsx)(PhaseChip, {\n phase: phase,\n setPhotoPhases: setPhotoPhases\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(NextArrowIcon, {\n insertable: true,\n onClick: ()=>handleClick(idx + 1)\n })\n ]\n })),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Chip/* default */.Z, {\n label: \"出荷\"\n })\n ]\n });\n}\n\n;// CONCATENATED MODULE: ./src/components/Projects/NewProject/ProjectCategory.tsx\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction ProjectCategory(param) {\n let { groupId , defaultProjectCategories } = param;\n const { control } = (0,index_esm/* useFormContext */.Gc)();\n const [inputText, setInputText] = (0,react.useState)(\"\");\n const debouncedInputText = (0,debounce/* useDebounce */.N)(inputText, 500);\n const { addAlert } = (0,alerts/* useAlerts */.Z)();\n const { data: projectCategories = defaultProjectCategories , isLoading } = (0,useQuery/* useQuery */.a)({\n queryKey: [\n \"projectCategories\",\n groupId,\n debouncedInputText\n ],\n queryFn: async ()=>{\n let nextToken = null;\n let allItems = [];\n try {\n while(true){\n const res = await API/* API.graphql */.b.graphql({\n query: queries.projectCategoriesByGroupId,\n variables: {\n groupId,\n nextToken,\n filter: {\n active: {\n ne: false\n },\n name: {\n contains: debouncedInputText\n }\n }\n },\n authMode: \"AMAZON_COGNITO_USER_POOLS\"\n });\n const items = res.data.projectCategoriesByGroupId.items;\n allItems = allItems.concat(items);\n nextToken = res.data.projectCategoriesByGroupId.nextToken;\n if (!nextToken) break;\n }\n return allItems;\n } catch (err) {\n const customError = new error/* CustomError */.s(err, \"get\");\n addAlert({\n message: customError.message,\n severity: \"error\"\n });\n }\n },\n staleTime: 1000 * 60 * 5,\n gcTime: 1000 * 60 * 6\n });\n const options = projectCategories === null || projectCategories === void 0 ? void 0 : projectCategories.map((p)=>({\n name: p.name,\n id: p.id\n })).sort((a, b)=>a.name.localeCompare(b.name));\n var ref, _name;\n return /*#__PURE__*/ (0,jsx_runtime.jsx)(index_esm/* Controller */.Qr, {\n name: \"categoryId\",\n control: control,\n render: (param)=>{\n let { field } = param;\n /*#__PURE__*/ return (0,jsx_runtime.jsx)(Autocomplete/* default */.Z, {\n ...field,\n value: (ref = options === null || options === void 0 ? void 0 : options.find((option)=>option.id === field.value)) !== null && ref !== void 0 ? ref : null,\n onChange: (_, selectedOption)=>{\n var ref;\n field.onChange((ref = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.id) !== null && ref !== void 0 ? ref : null);\n },\n onInputChange: (_, value)=>{\n setInputText(value || \"\");\n },\n options: options !== null && options !== void 0 ? options : [],\n isOptionEqualToValue: (option)=>option.id === field.value,\n getOptionLabel: (opt)=>(_name = opt.name) !== null && _name !== void 0 ? _name : \"\",\n renderOption: (props, option)=>/*#__PURE__*/ (0,react.createElement)(Box/* default */.Z, {\n ...props,\n key: option.id,\n component: \"li\"\n }, option.name),\n loading: isLoading,\n renderInput: (params)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(TextField/* default */.Z, {\n ...params,\n label: \"案件分類\",\n variant: \"outlined\",\n InputProps: {\n ...params.InputProps,\n endAdornment: /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {\n children: [\n isLoading ? /*#__PURE__*/ (0,jsx_runtime.jsx)(CircularProgress/* default */.Z, {\n color: \"inherit\",\n size: 20\n }) : null,\n params.InputProps.endAdornment\n ]\n })\n }\n })\n });\n }\n });\n}\n\n// EXTERNAL MODULE: ./src/contexts/projects.tsx\nvar contexts_projects = __webpack_require__(40394);\n// EXTERNAL MODULE: ./src/components/Form.tsx\nvar Form = __webpack_require__(11553);\n// EXTERNAL MODULE: ./src/contexts/auth.tsx + 2 modules\nvar auth = __webpack_require__(17297);\n// EXTERNAL MODULE: ./src/utils/project.ts\nvar project = __webpack_require__(25180);\n;// CONCATENATED MODULE: ./src/components/Projects/NewProject/index.tsx\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction NewProject(param) {\n let { open , setOpen , defaultValues , projects } = param;\n const { create , copy } = (0,contexts_projects/* useProjects */.Z)();\n const { refetch: refetchAccounts } = (0,contexts_accounts/* useAccounts */.x)();\n const { user , currentGroup } = (0,auth/* useAuth */.a)();\n const { handleSubmit , reset , ...method } = (0,index_esm/* useForm */.cI)({\n defaultValues\n });\n (0,react.useEffect)(()=>{\n reset();\n refetchAccounts({\n tenantId: user === null || user === void 0 ? void 0 : user.tenantId\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n open\n ]);\n const onSubmit = (data, event)=>{\n const redirectType = event.target.name;\n if (data.projectId) {\n // コピーの場合以下三つは使わないので削除\n if (data.pastProjectId || data.pastProjectId === \"\") delete data.pastProjectId;\n if (data.photoPhases) delete data.photoPhases;\n copy(data, redirectType);\n } else {\n create(data, redirectType);\n }\n setOpen(false);\n };\n return /*#__PURE__*/ (0,jsx_runtime.jsx)(index_esm/* FormProvider */.RV, {\n ...method,\n reset: reset,\n handleSubmit: handleSubmit,\n children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Form/* default */.Z, {\n open: open,\n setOpen: setOpen,\n title: \"新規案件\",\n onSave: handleSubmit(onSubmit),\n redirectConfig: {\n type: project/* RedirectTypes.schedules */.co.schedules,\n text: \"保存してスケジュール作成\"\n },\n children: /*#__PURE__*/ (0,jsx_runtime.jsx)(\"div\", {\n className: \"m-4 w-full flex justify-center\",\n children: /*#__PURE__*/ (0,jsx_runtime.jsxs)(\"div\", {\n className: \"w-full max-w-md flex flex-col gap-6\",\n children: [\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Name, {}),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Account, {}),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Contact, {}),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectCategory, {\n groupId: currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.id\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectType, {}),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Project, {\n defaultProjects: projects,\n groupId: currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.id\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Alert, {}),\n /*#__PURE__*/ (0,jsx_runtime.jsxs)(\"div\", {\n className: \"border border-1 border-gray-300 rounded p-4\",\n children: [\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Typography/* default */.Z, {\n variant: \"subtitle2\",\n color: \"black\",\n children: \"案件写真フェーズ\"\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(Typography/* default */.Z, {\n variant: \"subtitle2\",\n sx: {\n fontSize: 10,\n mb: 4\n },\n color: \"gray\",\n children: \"案件単位で写真を取れます\"\n }),\n /*#__PURE__*/ (0,jsx_runtime.jsx)(PhotoPhases, {})\n ]\n })\n ]\n })\n })\n })\n });\n}\n\n\n/***/ }),\n\n/***/ 95978:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"O\": function() { return /* binding */ getRoleName; },\n/* harmony export */ \"P\": function() { return /* binding */ getFullName; }\n/* harmony export */ });\nfunction getRoleName(role) {\n let roleName = \"?\";\n switch(role){\n case \"ADMIN\":\n roleName = \"管理者\";\n case \"MANAGER\":\n roleName = \"責任者\";\n case \"SALES\":\n roleName = \"営業\";\n case \"PRODUCTION\":\n roleName = \"現場\";\n case \"READONLY\":\n roleName = \"閲覧\";\n }\n return roleName;\n}\nfunction getFullName(user) {\n if (!user) return \"-\";\n if (user.name) return user.name;\n return \"\".concat(user.lastName, \" \").concat(user.firstName);\n}\n\n\n/***/ })\n\n}]);"],"names":["self","push","__unused_webpack_module","__webpack_exports__","__webpack_require__","d","Form","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","react__WEBPACK_IMPORTED_MODULE_1__","_mui_material_Button__WEBPACK_IMPORTED_MODULE_9__","_mui_material_Dialog__WEBPACK_IMPORTED_MODULE_3__","_mui_material_AppBar__WEBPACK_IMPORTED_MODULE_4__","_mui_material_Toolbar__WEBPACK_IMPORTED_MODULE_5__","_mui_material_IconButton__WEBPACK_IMPORTED_MODULE_6__","_mui_material_Typography__WEBPACK_IMPORTED_MODULE_8__","_mui_icons_material_Close__WEBPACK_IMPORTED_MODULE_7__","_mui_material_Slide__WEBPACK_IMPORTED_MODULE_2__","Transition","forwardRef","props","ref","jsx","Z","direction","param","open","setOpen","title","submitText","hideSubmitButton","onSave","onClose","children","redirectConfig","isSubmitting","setIsSubmitting","useState","handleClose","handleSave","event","preventDefault","fullScreen","TransitionComponent","jsxs","onSubmit","sx","position","edge","color","onClick","ml","flex","variant","component","type","autoFocus","disabled","name","text","BasicMenu","_mui_material_Menu__WEBPACK_IMPORTED_MODULE_2__","_mui_material_MenuItem__WEBPACK_IMPORTED_MODULE_3__","_mui_material_ListItemText__WEBPACK_IMPORTED_MODULE_5__","_mui_material_ListItemIcon__WEBPACK_IMPORTED_MODULE_4__","hooks_online__WEBPACK_IMPORTED_MODULE_1__","anchor","menus","online","k","id","anchorEl","MenuListProps","map","menu","icon","label","NewProject","jsx_runtime","index_esm","Typography","react","TextField","Name","control","Gc","Qr","field","required","rules","Alert","multiline","rows","helperText","Autocomplete","CircularProgress","Box","contexts_accounts","debounce","Account","val","setVal","selected","setSelected","setValue","watch","accounts","loading","refetch","x","debouncedInputText","N","options","setOptions","accountName","accountId","useEffect","_active","filter","account","active","acc","idx","ref1","contacts","items","contact","site","numOfContacts","length","key","reload","keyword","contains","limit","includeInputInList","filterSelectedOptions","isOptionEqualToValue","option","value","getOptionLabel","opt","renderOption","inputValue","_","concat","document","activeElement","blur","renderInput","width","params","inputProps","autoComplete","endAdornment","Fragment","size","InputProps","contexts_contacts","Contact","searchedContacts","setContactSearchText","g","contactName","contactId","debouncedAccountId","find","c","lastName","firstName","contactUpdate","autoHighlight","defaultValue","API","useQuery","error","queries","alerts","Project","_name","groupId","defaultProjects","inputText","setInputText","addAlert","selectedProject","setSelectedProject","pastProjectId","data","projects","isLoading","a","queryKey","queryFn","nextToken","allItems","res","b","graphql","query","projectsByGroupIdForManager","variables","archived","ne","sortDirection","authMode","err","customError","s","message","severity","staleTime","gcTime","enabled","reference","project","p","ref2","ref3","category","categoryId","getContactById","then","getContact","createElement","onChange","MenuItem","ProjectType","select","Chip","Stack","ArrowForwardIos","AddCircle","short_uuid","Tooltip","Checkbox","FormGroup","FormControlLabel","Button","Dialog","DialogActions","DialogContent","DialogTitle","PhaseForm","phase","register","handleSubmit","cI","phaseNameInput","fullWidth","maxWidth","margin","placement","defaultChecked","requiresPhoto","NextArrowIcon","insertable","isHovering","setIsHovered","className","fontSize","onMouseEnter","onMouseLeave","PhaseChip","setPhotoPhases","handleClick","handleDelete","prev","handleUpdate","onDelete","PhotoPhases","index","setIndex","photoPhases","handleCreate","newArray","slice","splice","uuid","flexWrap","gap","ProjectCategory","defaultProjectCategories","projectCategories","projectCategoriesByGroupId","sort","localeCompare","selectedOption","contexts_projects","auth","defaultValues","create","copy","refetchAccounts","user","currentGroup","reset","method","tenantId","redirectType","target","projectId","RV","co","schedules","mb","getRoleName","role","roleName","getFullName"],"sourceRoot":""}