@rpg-engine/long-bow 0.3.92 → 0.3.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Dropdown.d.ts +1 -1
- package/dist/components/Marketplace/Marketplace.d.ts +20 -0
- package/dist/components/Marketplace/MarketplaceRows.d.ts +12 -0
- package/dist/components/Marketplace/__mocks__/index.d.ts +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/long-bow.cjs.development.js +187 -15
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +186 -16
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/Marketplace.stories.d.ts +4 -0
- package/dist/stories/MarketplaceRows.stories.d.ts +4 -0
- package/package.json +2 -2
- package/src/components/CraftBook/CraftBook.tsx +16 -0
- package/src/components/CraftBook/MockItems.ts +13 -1
- package/src/components/Dropdown.tsx +4 -2
- package/src/components/Marketplace/Marketplace.tsx +132 -0
- package/src/components/Marketplace/MarketplaceRows.tsx +171 -0
- package/src/components/Marketplace/__mocks__/index.tsx +65 -0
- package/src/components/shared/Ellipsis.tsx +3 -0
- package/src/index.tsx +2 -0
- package/src/stories/Marketplace.stories.tsx +42 -0
- package/src/stories/MarketplaceRows.stories.tsx +28 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"long-bow.cjs.production.min.js","sources":["../src/constants/uiFonts.ts","../src/components/Button.tsx","../src/components/RPGUIContainer.tsx","../src/components/shared/SpriteFromAtlas.tsx","../src/components/Item/Inventory/ErrorBoundary.tsx","../src/components/Arrow/SelectArrow.tsx","../src/components/shared/Ellipsis.tsx","../src/components/PropertySelect/PropertySelect.tsx","../src/components/Character/CharacterSelection.tsx","../src/components/shared/Column.tsx","../src/components/Chat/Chat.tsx","../src/components/Input.tsx","../src/components/Chatdeprecated/ChatDeprecated.tsx","../src/constants/uiColors.ts","../src/components/Shortcuts/SingleShortcut.ts","../src/components/CircularController/CircularController.tsx","../src/hooks/useOutsideAlerter.ts","../src/components/NPCDialog/NPCDialog.tsx","../src/components/DraggableContainer.tsx","../src/components/Dropdown.tsx","../src/components/Abstractions/ModalPortal.tsx","../src/components/RelativeListMenu.tsx","../src/components/Item/Cards/MobileItemTooltip.tsx","../src/components/Item/Inventory/itemContainerHelper.ts","../src/components/Item/Inventory/ItemSlot.tsx","../src/components/Item/Cards/ItemInfo.tsx","../src/components/Item/Cards/ItemInfoDisplay.tsx","../src/components/Item/Cards/ItemTooltip.tsx","../src/components/Item/Cards/ItemInfoWrapper.tsx","../src/components/CraftBook/CraftBook.tsx","../src/components/DropdownSelectorContainer.tsx","../src/components/Equipment/EquipmentSet.tsx","../src/constants/uiDevices.ts","../src/components/typography/DynamicText.tsx","../src/components/NPCDialog/NPCDialogText.tsx","../src/libs/StringHelpers.ts","../src/hooks/useEventListener.ts","../src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx","../src/components/NPCDialog/NPCMultiDialog.tsx","../src/components/RangeSlider.tsx","../src/components/HistoryDialog.tsx","../src/components/Abstractions/SlotsContainer.tsx","../src/components/Item/Inventory/ItemQuantitySelector.tsx","../src/components/Shortcuts/ShortcutsSetter.tsx","../src/components/Item/Inventory/ItemContainer.tsx","../src/components/itemSelector/ItemSelector.tsx","../src/components/ListMenu.tsx","../src/components/ProgressBar.tsx","../src/components/QuestInfo/QuestInfo.tsx","../src/components/QuestList.tsx","../src/components/RPGUIRoot.tsx","../src/components/Shortcuts/Shortcuts.tsx","../src/components/SimpleProgressBar.tsx","../src/components/SkillProgressBar.tsx","../src/components/SkillsContainer.tsx","../src/components/Spellbook/Spell.tsx","../src/components/Spellbook/Spellbook.tsx","../src/components/TimeWidget/DayNightPeriod/DayNightPeriod.tsx","../src/components/TimeWidget/TimeWidget.tsx","../src/components/TradingMenu/TradingItemRow.tsx","../src/components/TradingMenu/TradingMenu.tsx","../src/components/Truncate.tsx","../src/components/CheckButton.tsx","../src/components/RadioButton.tsx","../src/components/TextArea.tsx"],"sourcesContent":["export const uiFonts = {\n size: {\n xxsmall: '8px',\n xsmall: '9px',\n small: '12px',\n medium: '14px',\n large: '16px',\n xLarge: '18px',\n xxLarge: '20px',\n xxxLarge: '24px',\n },\n};\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\n\nexport enum ButtonTypes {\n RPGUIButton = 'rpgui-button',\n RPGUIGoldButton = 'rpgui-button golden',\n}\n\nexport interface IButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n disabled?: boolean;\n children: React.ReactNode;\n buttonType: ButtonTypes;\n onPointerDown?: (e: any) => void;\n}\n\nexport const Button = ({\n disabled = false,\n children,\n buttonType,\n onPointerDown,\n ...props\n}: IButtonProps) => {\n return (\n <ButtonContainer\n className={`${buttonType}`}\n disabled={disabled}\n {...props}\n onPointerDown={onPointerDown}\n >\n <p>{children}</p>\n </ButtonContainer>\n );\n};\n\nconst ButtonContainer = styled.button`\n height: 45px;\n font-size: ${uiFonts.size.small};\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nexport enum RPGUIContainerTypes {\n Framed = 'framed',\n FramedGold = 'framed-golden',\n FramedGold2 = 'framed-golden-2',\n FramedGrey = 'framed-grey',\n}\nexport interface IRPGUIContainerProps {\n type: RPGUIContainerTypes;\n children: React.ReactNode;\n width?: string;\n height?: string;\n className?: string;\n}\n\nexport const RPGUIContainer: React.FC<IRPGUIContainerProps> = ({\n children,\n type,\n width = '50%',\n height,\n className,\n}) => {\n return (\n <Container\n width={width}\n height={height || 'auto'}\n className={`rpgui-container ${type} ${className}`}\n >\n {children}\n </Container>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n}\n\nconst Container = styled.div<IContainerProps>`\n height: ${props => props.height};\n width: ${({ width }) => width};\n display: flex;\n flex-wrap: wrap;\n image-rendering: pixelated;\n`;\n","import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n atlasJSON: any;\n atlasIMG: any;\n spriteKey: string;\n width?: number;\n height?: number;\n grayScale?: boolean;\n opacity?: number;\n onPointerDown?: () => void;\n containerStyle?: any;\n imgStyle?: any;\n imgScale?: number;\n imgClassname?: string;\n}\n\nexport const SpriteFromAtlas: React.FC<IProps> = ({\n atlasJSON,\n atlasIMG,\n spriteKey,\n width = GRID_WIDTH,\n height = GRID_HEIGHT,\n imgScale = 2,\n imgStyle,\n onPointerDown,\n containerStyle,\n grayScale = false,\n opacity = 1,\n imgClassname,\n}) => {\n //! If an item is not showing, remember that you MUST run yarn atlas:copy everytime you add a new item to the atlas (it will sync our public folder atlas with src/atlas).\n //!Due to React's limitations, we cannot import it from the public folder directly!\n\n const spriteData =\n atlasJSON.frames[spriteKey] || atlasJSON.frames['others/no-image.png'];\n\n if (!spriteData) throw new Error(`Sprite ${spriteKey} not found in atlas!`);\n\n return (\n <Container\n width={width}\n height={height}\n hasHover={grayScale}\n onPointerDown={onPointerDown}\n style={containerStyle}\n >\n <ImgSprite\n className={`sprite-from-atlas-img ${imgClassname || ''}`}\n atlasIMG={atlasIMG}\n frame={spriteData.frame}\n scale={imgScale}\n grayScale={grayScale}\n opacity={opacity}\n style={imgStyle}\n />\n </Container>\n );\n};\n\ninterface IImgSpriteProps {\n atlasIMG: any;\n frame: {\n x: number;\n y: number;\n w: number;\n h: number;\n };\n scale: number;\n grayScale: boolean;\n opacity: number;\n}\n\ninterface IContainerProps {\n width: number;\n height: number;\n hasHover: boolean;\n}\n\nconst Container = styled.div`\n width: ${(props: IContainerProps) => props.width}px;\n height: ${(props: IContainerProps) => props.height}px;\n ${(props: IContainerProps) =>\n !props.hasHover\n ? `&:hover {\n filter: sepia(100%) saturate(300%) brightness(70%) hue-rotate(180deg);\n }`\n : ``}\n`;\n\nconst ImgSprite = styled.div<IImgSpriteProps>`\n width: ${props => props.frame.w}px;\n height: ${props => props.frame.h}px;\n background-image: url(${props => props.atlasIMG});\n background-position: -${props => props.frame.x}px -${props => props.frame.y}px;\n transform: scale(${props => props.scale});\n position: relative;\n top: 8px;\n left: 8px;\n filter: ${props => (props.grayScale ? 'grayscale(100%)' : 'none')};\n opacity: ${props => props.opacity};\n`;\n","import React, { Component, ErrorInfo, ReactNode } from 'react';\nimport atlasJSON from '../../../mocks/atlas/items/items.json';\nimport atlasIMG from '../../../mocks/atlas/items/items.png';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\n\ninterface Props {\n children?: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n}\n\nexport class ErrorBoundary extends Component<Props, State> {\n public state: State = {\n hasError: false,\n };\n\n public static getDerivedStateFromError(_: Error): State {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n public componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error('Uncaught error:', error, errorInfo);\n }\n\n public render() {\n if (this.state.hasError) {\n return (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={'others/no-image.png'}\n imgScale={3}\n />\n );\n }\n\n return this.props.children;\n }\n}\n","import React from 'react';\nimport styled from 'styled-components';\nimport LeftArrowClickIcon from './img/arrow01-left-clicked.png';\nimport LeftArrowIcon from './img/arrow01-left.png';\nimport RightArrowClickIcon from './img/arrow01-right-clicked.png';\nimport RightArrowIcon from './img/arrow01-right.png';\n\nexport interface ArrowBarProps extends React.HTMLAttributes<HTMLDivElement> {\n direction: 'right' | 'left';\n onPointerDown: () => void;\n size?: number;\n}\n\nexport const SelectArrow: React.FC<ArrowBarProps> = ({\n direction = 'left',\n size,\n onPointerDown,\n ...props\n}) => {\n return (\n <>\n {direction === 'left' ? (\n <LeftArrow\n size={size}\n onPointerDown={() => onPointerDown()}\n {...props}\n ></LeftArrow>\n ) : (\n <RightArrow\n size={size}\n onPointerDown={() => onPointerDown()}\n {...props}\n ></RightArrow>\n )}\n </>\n );\n};\n\ninterface IArrowProps {\n size?: number;\n}\n\nconst LeftArrow = styled.span<IArrowProps>`\n background-image: url(${LeftArrowIcon});\n background-size: 100% 100%;\n left: 0;\n position: absolute;\n width: ${props => props.size || 40}px;\n height: ${props => props.size || 42}px;\n :active {\n background-image: url(${LeftArrowClickIcon});\n }\n z-index: 2;\n`;\n\nconst RightArrow = styled.span<IArrowProps>`\n background-image: url(${RightArrowIcon});\n right: 0;\n position: absolute;\n width: ${props => props.size || 40}px;\n height: ${props => props.size || 42}px;\n background-size: 100% 100%;\n :active {\n background-image: url(${RightArrowClickIcon});\n }\n z-index: 2;\n`;\n\nexport default SelectArrow;\n","import React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n children: React.ReactNode;\n maxLines: 1 | 2 | 3;\n maxWidth: string;\n fontSize?: string;\n center?: boolean;\n}\n\nexport const Ellipsis = ({\n children,\n maxLines,\n maxWidth,\n fontSize,\n center,\n}: IProps) => {\n return (\n <Container maxWidth={maxWidth} fontSize={fontSize} center={center}>\n <div className={`ellipsis-${maxLines}-lines`}>{children}</div>\n </Container>\n );\n};\n\ninterface IContainerProps {\n maxWidth?: string;\n fontSize?: string;\n center?: boolean;\n}\n\nconst Container = styled.div<IContainerProps>`\n .ellipsis-1-lines {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: ${props => props.maxWidth};\n\n ${props => props.center && `margin: 0 auto;`}\n }\n .ellipsis-2-lines {\n display: -webkit-box;\n max-width: ${props => props.maxWidth}px;\n\n height: 25px;\n margin: 0 auto;\n line-height: 1;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n .ellipsis-3-lines {\n display: -webkit-box;\n max-width: ${props => props.maxWidth}px;\n\n height: 43px;\n margin: 0 auto;\n line-height: 1;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../constants/uiFonts';\nimport SelectArrow from '../Arrow/SelectArrow';\nimport { Ellipsis } from '../shared/Ellipsis';\n\nexport interface IPropertySelectProps {\n availableProperties: Array<IPropertiesProps>;\n selectedProperty?: IPropertiesProps;\n children?: React.ReactNode;\n onChange: (selectedProperty: IPropertiesProps) => void;\n}\n\nexport interface IPropertiesProps {\n id: string;\n name: string;\n}\n\nexport const PropertySelect: React.FC<IPropertySelectProps> = ({\n availableProperties,\n onChange,\n}) => {\n const [currentIndex, setCurrentIndex] = useState(0);\n const propertiesLength = availableProperties.length - 1;\n\n const onLeftClick = () => {\n if (currentIndex === 0) setCurrentIndex(propertiesLength);\n else setCurrentIndex(index => index - 1);\n };\n const onRightClick = () => {\n if (currentIndex === propertiesLength) setCurrentIndex(0);\n else setCurrentIndex(index => index + 1);\n };\n\n useEffect(() => {\n onChange(availableProperties[currentIndex]);\n }, [currentIndex]);\n\n useEffect(() => {\n setCurrentIndex(0);\n }, [JSON.stringify(availableProperties)]);\n\n const getCurrentSelectionName = () => {\n const item = availableProperties[currentIndex];\n if (item) {\n return item.name;\n }\n return '';\n };\n\n return (\n <Container>\n <TextOverlay>\n <p>\n <Item>\n <Ellipsis maxLines={1} maxWidth=\"60%\" center>\n {getCurrentSelectionName()}\n </Ellipsis>\n </Item>\n </p>\n </TextOverlay>\n <div className=\"rpgui-progress-track\"></div>\n\n <SelectArrow direction=\"left\" onPointerDown={onLeftClick}></SelectArrow>\n <SelectArrow direction=\"right\" onPointerDown={onRightClick}></SelectArrow>\n </Container>\n );\n};\n\nconst Item = styled.span`\n font-size: 1rem;\n color: white;\n text-align: center;\n z-index: 1;\n position: absolute;\n top: 12px;\n width: 100%;\n\n p {\n margin: 0 auto;\n font-size: ${uiFonts.size.small};\n }\n`;\n\nconst TextOverlay = styled.div`\n width: 100%;\n position: relative;\n`;\n\ninterface IContainerProps {\n percentageWidth?: number;\n minWidth?: number;\n style?: Record<string, any>;\n}\n\nconst Container = styled.div<IContainerProps>`\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: start;\n align-items: flex-start;\n min-width: 100px;\n width: 40%;\n`;\n\nexport default PropertySelect;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\n\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nimport { ErrorBoundary } from '../Item/Inventory/ErrorBoundary';\nimport PropertySelect, {\n IPropertiesProps,\n} from '../PropertySelect/PropertySelect';\n\nexport interface ICharacterProps {\n name: string;\n textureKey: string;\n}\n\nexport interface ICharacterSelectionProps {\n availableCharacters: ICharacterProps[];\n atlasJSON: any;\n atlasIMG: any;\n onChange: (textureKey: string) => void;\n}\n\nexport const CharacterSelection: React.FC<ICharacterSelectionProps> = ({\n availableCharacters,\n atlasJSON,\n atlasIMG,\n onChange,\n}) => {\n const propertySelectValues = availableCharacters.map((item) => {\n return {\n id: item.textureKey,\n name: item.name,\n };\n });\n\n const [selectedValue, setSelectedValue] = useState<IPropertiesProps>();\n const [selectedSpriteKey, setSelectedSpriteKey] = useState('');\n\n const onSelectedValueChange = () => {\n const textureKey = selectedValue ? selectedValue.id : '';\n const spriteKey = textureKey ? textureKey + '/down/standing/0.png' : '';\n\n if (spriteKey === selectedSpriteKey) {\n return;\n }\n\n setSelectedSpriteKey(spriteKey);\n onChange(textureKey);\n };\n\n useEffect(() => {\n onSelectedValueChange();\n }, [selectedValue]);\n\n useEffect(() => {\n setSelectedValue(propertySelectValues[0]);\n }, [availableCharacters]);\n\n return (\n <Container>\n {selectedSpriteKey && atlasIMG && atlasJSON && (\n <ErrorBoundary>\n <SpriteFromAtlas\n spriteKey={selectedSpriteKey}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n imgScale={4}\n height={80}\n width={64}\n containerStyle={{\n display: 'flex',\n alignItems: 'center',\n paddingBottom: '15px',\n }}\n imgStyle={{\n left: '22px',\n }}\n />\n </ErrorBoundary>\n )}\n <PropertySelect\n availableProperties={propertySelectValues}\n onChange={(value) => {\n setSelectedValue(value);\n }}\n />\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n image-rendering: pixelated;\n`;\n\nexport default CharacterSelection;\n","import styled from 'styled-components';\n\ninterface IColumn {\n flex?: number;\n alignItems?: string;\n justifyContent?: string;\n flexWrap?: string;\n}\n\nexport const Column = styled.div<IColumn>`\n flex: ${props => props.flex || 'auto'};\n display: flex;\n flex-wrap: ${props => props.flexWrap || 'nowrap'};\n align-items: ${props => props.alignItems || 'flex-start'};\n justify-content: ${props => props.justifyContent || 'flex-start'};\n`;\n","import { IChatMessage } from '@rpg-engine/shared';\nimport dayjs from 'dayjs';\nimport React, { useEffect, useState } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { RxPaperPlane } from 'react-icons/rx';\nimport styled from 'styled-components';\nimport { Column } from '../shared/Column';\n\ninterface IEmitter {\n _id: string;\n name: string;\n}\n\ninterface IStyles {\n textColor?: string;\n buttonColor?: string;\n buttonBackgroundColor?: string;\n width?: string;\n height?: string;\n}\n\nexport interface IChatProps {\n chatMessages: IChatMessage[];\n onSendChatMessage: (message: string) => void;\n onCloseButton: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n opacity?: number;\n sendMessage: boolean;\n styles?: IStyles;\n}\n\nexport const Chat: React.FC<IChatProps> = ({\n chatMessages,\n onSendChatMessage,\n onFocus,\n onBlur,\n styles = {\n textColor: '#c65102',\n buttonColor: '#005b96',\n buttonBackgroundColor: 'rgba(0,0,0,.2)',\n width: '80%',\n height: 'auto',\n },\n}) => {\n const [message, setMessage] = useState('');\n\n useEffect(() => {\n scrollChatToBottom();\n }, []);\n\n useEffect(() => {\n scrollChatToBottom();\n }, [chatMessages]);\n\n const scrollChatToBottom = () => {\n const scrollingElement = document.querySelector('.chat-body');\n if (scrollingElement) {\n scrollingElement.scrollTop = scrollingElement.scrollHeight;\n }\n };\n\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!message || message.trim() === '') return;\n onSendChatMessage(message);\n setMessage('');\n };\n const getInputValue = (value: string) => {\n setMessage(value);\n };\n\n const onRenderMessageLines = (\n emitter: IEmitter,\n createdAt: string | undefined,\n message: string\n ) => {\n return `${dayjs(createdAt || new Date()).format('HH:mm')} ${\n emitter?.name ? `${emitter.name}: ` : 'Unknown: '\n } ${message}`;\n };\n\n const onRenderChatMessages = (chatMessages: IChatMessage[]) => {\n return chatMessages?.length ? (\n chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (\n <Message color={styles?.textColor || '#c65102'} key={`${_id}_${index}`}>\n {onRenderMessageLines(emitter, createdAt as string, message)}\n </Message>\n ))\n ) : (\n <Message color={styles?.textColor || '#c65102'}>\n No messages available.\n </Message>\n );\n };\n\n return (\n <ChatContainer\n width={styles?.width || '80%'}\n height={styles?.height || 'auto'}\n >\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\n <MessagesContainer className=\"chat-body\">\n {onRenderChatMessages(chatMessages)}\n </MessagesContainer>\n\n <Form onSubmit={handleSubmit}>\n <Column flex={70}>\n <TextField\n value={message}\n id=\"inputMessage\"\n onChange={e => getInputValue(e.target.value)}\n height={20}\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n onPointerDown={onFocus}\n autoFocus\n />\n </Column>\n <Column justifyContent=\"flex-end\">\n <Button\n buttonColor={styles?.buttonColor || '#005b96'}\n buttonBackgroundColor={\n styles?.buttonBackgroundColor || 'rgba(0,0,0,.5)'\n }\n id=\"chat-send-button\"\n style={{ borderRadius: '20%' }}\n >\n <RxPaperPlane size={15} />\n </Button>\n </Column>\n </Form>\n </ErrorBoundary>\n </ChatContainer>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n}\n\ninterface IMessageProps {\n color: string;\n}\n\ninterface IButtonProps {\n buttonColor: string;\n buttonBackgroundColor: string;\n}\n\nconst ChatContainer = styled.div<IContainerProps>`\n height: ${props => props.height};\n width: ${({ width }) => width};\n padding: 10px;\n background-color: rgba(0, 0, 0, 0.2);\n height: auto;\n`;\n\nconst TextField = styled.input`\n width: 100%;\n background-color: rgba(0, 0, 0, 0.25) !important;\n border: none !important;\n max-height: 28px !important;\n`;\n\nconst MessagesContainer = styled.div`\n height: 70%;\n margin-bottom: 10px;\n .chat-body {\n max-height: auto;\n overflow-y: auto;\n }\n`;\n\nconst Message = styled.div<IMessageProps>`\n margin-bottom: 8px;\n color: ${({ color }) => color};\n`;\n\nconst Form = styled.form`\n display: flex;\n width: 100%;\n justify-content: center;\n align-items: center;\n`;\n\nconst Button = styled.button<IButtonProps>`\n color: ${({ buttonColor }) => buttonColor};\n background-color: ${({ buttonBackgroundColor }) => buttonBackgroundColor};\n width: 28px;\n height: 28px;\n border: none !important;\n`;\n","import React from 'react';\n\nexport interface IInputProps\n extends React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n > {\n innerRef?: React.Ref<HTMLInputElement>;\n}\n\nexport const Input: React.FC<IInputProps> = ({ ...props }) => {\n const { innerRef, ...rest } = props;\n\n return <input {...rest} ref={props.innerRef} />;\n};\n","import { IChatMessage } from '@rpg-engine/shared';\nimport dayjs from 'dayjs';\nimport React, { useEffect, useState } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Button, ButtonTypes } from '../Button';\nimport { Input } from '../Input';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';\nimport { Column } from '../shared/Column';\n\ninterface IEmitter {\n _id: string;\n name: string;\n}\nexport interface IChatDeprecatedProps {\n chatMessages: IChatMessage[];\n onSendChatMessage: (message: string) => void;\n onCloseButton: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n opacity?: number;\n width?: string;\n height?: string;\n}\n\nexport const ChatDeprecated: React.FC<IChatDeprecatedProps> = ({\n chatMessages,\n onSendChatMessage,\n opacity = 1,\n width = '100%',\n height = '250px',\n onCloseButton,\n onFocus,\n onBlur,\n}) => {\n const [message, setMessage] = useState('');\n\n useEffect(() => {\n scrollChatToBottom();\n }, []);\n\n useEffect(() => {\n scrollChatToBottom();\n }, [chatMessages]);\n\n const scrollChatToBottom = () => {\n const scrollingElement = document.querySelector('.chat-body');\n if (scrollingElement) {\n scrollingElement.scrollTop = scrollingElement.scrollHeight;\n }\n };\n\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n onSendChatMessage(message);\n setMessage('');\n };\n const getInputValue = (value: string) => {\n setMessage(value);\n };\n\n const onRenderMessageLines = (\n emitter: IEmitter,\n createdAt: string | undefined,\n message: string\n ) => {\n return `${dayjs(createdAt || new Date()).format('HH:mm')} ${\n emitter?.name ? `${emitter.name}: ` : 'Unknown: '\n } ${message}`;\n };\n\n const onRenderChatMessages = (chatMessages: IChatMessage[]) => {\n return chatMessages?.length ? (\n chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (\n <MessageText key={`${_id}_${index}`}>\n {onRenderMessageLines(emitter, createdAt as string, message)}\n </MessageText>\n ))\n ) : (\n <MessageText>No messages available.</MessageText>\n );\n };\n\n return (\n <Container>\n <CustomContainer\n type={RPGUIContainerTypes.FramedGrey}\n width={width}\n height={height}\n className=\"chat-container\"\n opacity={opacity}\n >\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\n {onCloseButton && (\n <CloseButton onPointerDown={onCloseButton}>X</CloseButton>\n )}\n <RPGUIContainer\n type={RPGUIContainerTypes.FramedGrey}\n width={'100%'}\n height={'80%'}\n className=\"chat-body dark-background\"\n >\n {onRenderChatMessages(chatMessages)}\n </RPGUIContainer>\n\n <Form onSubmit={handleSubmit}>\n <Column flex={70}>\n <CustomInput\n value={message}\n id=\"inputMessage\"\n onChange={e => getInputValue(e.target.value)}\n height={20}\n className=\"chat-input dark-background\"\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n />\n </Column>\n <Column justifyContent=\"flex-end\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n id=\"chat-send-button\"\n >\n Send\n </Button>\n </Column>\n </Form>\n </ErrorBoundary>\n </CustomContainer>\n </Container>\n );\n};\n\nconst Container = styled.div`\n position: relative;\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 2px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 0.7rem;\n`;\n\nconst CustomInput = styled(Input)`\n height: 30px;\n width: 100%;\n\n .rpgui-content .input {\n min-height: 39px;\n }\n`;\n\ninterface ICustomContainerProps {\n opacity: number;\n}\n\nconst CustomContainer = styled(RPGUIContainer)`\n display: block;\n\n opacity: ${(props: ICustomContainerProps) => props.opacity};\n\n &:hover {\n opacity: 1;\n }\n\n .dark-background {\n background-color: ${uiColors.darkGray} !important;\n }\n\n .chat-body {\n &.rpgui-container.framed-grey {\n background: unset;\n }\n max-height: 170px;\n overflow-y: auto;\n }\n`;\n\nconst Form = styled.form`\n display: flex;\n width: 100%;\n justify-content: center;\n align-items: center;\n`;\n\nconst MessageText = styled.p`\n display: block !important;\n width: 100%;\n font-size: ${uiFonts.size.xsmall} !important;\n overflow-y: auto;\n margin: 0;\n`;\n","export const uiColors = {\n lightGray: '#757161',\n gray: '#4E4A4E',\n darkGray: '#3e3e3e',\n darkYellow: '#FFC857',\n yellow: '#FFFF00',\n orange: '#D27D2C',\n cardinal: '#C5283D',\n red: '#D04648',\n darkRed: '#442434',\n raisinBlack: '#191923',\n navyBlue: '#0E79B2',\n purple: '#6833A3',\n darkPurple: '#522761',\n blue: '#597DCE',\n darkBlue: '#30346D',\n brown: '#854C30',\n lightGreen: '#6DAA2C',\n brownGreen: '#346524',\n};\n","import styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\nexport const SingleShortcut = styled.button`\n width: 3rem;\n height: 3rem;\n background-color: ${uiColors.lightGray};\n border: 2px solid ${uiColors.darkGray};\n border-radius: 50%;\n text-transform: uppercase;\n font-size: 0.7rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n\n span {\n pointer-events: none;\n }\n\n .mana {\n position: absolute;\n top: -5px;\n right: 0;\n font-size: 0.65rem;\n color: ${uiColors.blue};\n }\n\n .qty {\n position: absolute;\n top: -5px;\n right: 0;\n font-size: 0.65rem;\n }\n\n .magicWords {\n margin-top: 4px;\n }\n\n .keyboard {\n position: absolute;\n bottom: -5px;\n left: 0;\n font-size: 0.65rem;\n color: ${uiColors.yellow};\n }\n\n &:hover,\n &:focus {\n background-color: ${uiColors.darkGray};\n }\n\n &:active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n\n &:disabled {\n opacity: 0.5;\n }\n`;\n","import {\n getItemTextureKeyPath,\n IItem,\n IItemContainer,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SingleShortcut } from '../Shortcuts/SingleShortcut';\n\nexport type CircularControllerProps = {\n onActionClick: () => void;\n onCancelClick: () => void;\n onShortcutClick: (index: number) => void;\n mana: number;\n shortcuts: IShortcut[];\n inventory?: IItemContainer | null;\n atlasIMG: any;\n atlasJSON: any;\n};\n\nexport const CircularController: React.FC<CircularControllerProps> = ({\n onActionClick,\n onCancelClick,\n onShortcutClick,\n mana,\n shortcuts,\n inventory,\n atlasIMG,\n atlasJSON,\n}) => {\n const onTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {\n const target = e.target as HTMLButtonElement;\n target?.classList.add('active');\n };\n\n const onTouchEnd = (\n action: () => void,\n e: React.TouchEvent<HTMLButtonElement>\n ) => {\n const target = e.target as HTMLButtonElement;\n setTimeout(() => {\n target?.classList.remove('active');\n }, 100);\n action();\n };\n\n const renderShortcut = (i: number) => {\n let variant = '';\n\n if (i === 0) variant = 'top';\n else if (i >= 3) variant = `bottom-${i - 3}`;\n\n const onShortcutClickBinded =\n shortcuts[i]?.type !== ShortcutType.None\n ? onShortcutClick.bind(null, i)\n : () => {};\n\n if (shortcuts[i]?.type === ShortcutType.Item) {\n const payload = shortcuts[i]?.payload as IItem | undefined;\n\n let itemsFromEquipment: (IItem | undefined | null)[] = [];\n\n if (inventory) {\n Object.keys(inventory.slots).forEach(i => {\n const index = parseInt(i);\n\n if (inventory.slots[index]?.key === payload?.key) {\n itemsFromEquipment.push(inventory.slots[index]);\n }\n });\n }\n\n const totalQty = itemsFromEquipment.reduce(\n (acc, item) => acc + (item?.stackQty || 1),\n 0\n );\n\n return (\n <StyledShortcut\n key={i}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onShortcutClickBinded)}\n disabled={false}\n className={variant}\n >\n {payload && (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: payload.texturePath,\n texturePath: payload.texturePath,\n stackQty: payload.stackQty || 1,\n isStackable: payload.isStackable,\n },\n atlasJSON\n )}\n width={32}\n height={32}\n imgScale={1.4}\n imgStyle={{ left: '4px' }}\n containerStyle={{ pointerEvents: 'none' }}\n />\n )}\n <span className=\"qty\">{totalQty}</span>\n </StyledShortcut>\n );\n }\n\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\n\n return (\n <StyledShortcut\n key={i}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onShortcutClickBinded)}\n disabled={mana < (payload?.manaCost ?? 0)}\n className={variant}\n >\n <span className=\"mana\">{payload && payload.manaCost}</span>\n <span className=\"magicWords\">\n {payload?.magicWords.split(' ').map(word => word[0])}\n </span>\n </StyledShortcut>\n );\n };\n\n return (\n <ButtonsContainer>\n <ShortcutsContainer>\n {Array.from({ length: 6 }).map((_, i) => renderShortcut(i))}\n </ShortcutsContainer>\n <Button\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onActionClick)}\n >\n <div className=\"rpgui-icon sword\" />\n </Button>\n\n <CancelButton\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onCancelClick)}\n >\n <span>X</span>\n </CancelButton>\n </ButtonsContainer>\n );\n};\n\nconst Button = styled.button`\n width: 4.3rem;\n height: 4.3rem;\n background-color: ${uiColors.lightGray};\n border: 2px solid ${uiColors.darkGray};\n border-radius: 50%;\n text-transform: uppercase;\n font-size: 0.7rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n transition: all 0.1s;\n margin-top: -3rem;\n\n &.active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n\n .sword {\n transform: rotate(-45deg);\n height: 2.5rem;\n width: 1.9rem;\n pointer-events: none;\n }\n`;\n\nconst CancelButton = styled(Button)`\n width: 3rem;\n height: 3rem;\n font-size: 0.8rem;\n\n span {\n margin-top: 4px;\n margin-left: 2px;\n pointer-events: none;\n }\n`;\n\nconst ButtonsContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n`;\n\nconst ShortcutsContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n flex-direction: column;\n margin-top: 3rem;\n\n .top {\n transform: translate(93%, 25%);\n }\n\n .bottom-0 {\n transform: translate(93%, -25%);\n }\n\n .bottom-1 {\n transform: translate(-120%, calc(-5.5rem));\n }\n\n .bottom-2 {\n transform: translate(-30%, calc(-5.5rem - 25%));\n }\n`;\n\nconst StyledShortcut = styled(SingleShortcut)`\n width: 2.5rem;\n height: 2.5rem;\n transition: all 0.1s;\n\n .mana,\n .qty {\n font-size: 0.5rem;\n }\n\n &:hover,\n &:focus,\n &:active {\n background-color: ${uiColors.lightGray};\n }\n\n &.active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n`;\n","import { useEffect } from 'react';\n\nexport function useOutsideClick(ref: any, id: string) {\n useEffect(() => {\n /**\n * Alert if clicked on outside of element\n */\n function handleClickOutside(event: any) {\n if (ref.current && !ref.current.contains(event.target)) {\n const event = new CustomEvent('clickOutside', {\n detail: {\n id,\n },\n });\n document.dispatchEvent(event);\n }\n }\n // Bind the event listener\n document.addEventListener('pointerdown', handleClickOutside);\n return () => {\n // Unbind the event listener on clean up\n document.removeEventListener('pointerdown', handleClickOutside);\n };\n }, [ref]);\n}\n","import React from 'react';\nimport styled from 'styled-components';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';\nimport { NPCDialogText } from './NPCDialogText';\nimport {\n IQuestionDialog,\n IQuestionDialogAnswer,\n QuestionDialog,\n} from './QuestionDialog/QuestionDialog';\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\n\nexport enum NPCDialogType {\n TextOnly = 'TextOnly',\n TextAndThumbnail = 'TextAndThumbnail',\n}\n\nexport interface INPCDialogProps {\n text?: string;\n type: NPCDialogType;\n imagePath?: string;\n onClose?: () => void;\n isQuestionDialog?: boolean;\n answers?: IQuestionDialogAnswer[];\n questions?: IQuestionDialog[];\n}\n\nexport const NPCDialog: React.FC<INPCDialogProps> = ({\n text,\n type,\n onClose,\n imagePath,\n isQuestionDialog = false,\n questions,\n answers,\n}) => {\n return (\n <RPGUIContainer\n type={RPGUIContainerTypes.FramedGold}\n width={isQuestionDialog ? '600px' : '80%'}\n height={'180px'}\n >\n {isQuestionDialog && questions && answers ? (\n <>\n <TextContainer\n flex={type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'}\n >\n <QuestionDialog\n questions={questions}\n answers={answers}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n {type === NPCDialogType.TextAndThumbnail && (\n <ThumbnailContainer>\n <NPCThumbnail src={imagePath || aliceDefaultThumbnail} />\n </ThumbnailContainer>\n )}\n </>\n ) : (\n <>\n <Container>\n <TextContainer\n flex={type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'}\n >\n <NPCDialogText\n type={type}\n text={text || 'No text provided.'}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n {type === NPCDialogType.TextAndThumbnail && (\n <ThumbnailContainer>\n <NPCThumbnail src={imagePath || aliceDefaultThumbnail} />\n </ThumbnailContainer>\n )}\n </Container>\n </>\n )}\n </RPGUIContainer>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n width: 100%;\n height: 100%;\n\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n position: relative;\n`;\n\ninterface ITextContainerProps {\n flex: string;\n}\n\nconst TextContainer = styled.div<ITextContainerProps>`\n flex: ${({ flex }) => flex} 0 0;\n width: 355px;\n`;\n\nconst ThumbnailContainer = styled.div`\n flex: 30% 0 0;\n display: flex;\n justify-content: flex-end;\n`;\n\nconst NPCThumbnail = styled.img`\n image-rendering: pixelated;\n height: 128px;\n width: 128px;\n`;\n","import React, { useEffect, useRef } from 'react';\nimport Draggable from 'react-draggable';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\nimport { IPosition } from '../types/eventTypes';\nimport { RPGUIContainerTypes } from './RPGUIContainer';\n\nexport interface IDraggableContainerProps {\n children: React.ReactNode;\n width?: string;\n height?: string;\n className?: string;\n type?: RPGUIContainerTypes;\n title?: string;\n imgSrc?: string;\n imgWidth?: string;\n onCloseButton?: () => void;\n cancelDrag?: string;\n onPositionChange?: (position: IPosition) => void;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n onOutsideClick?: () => void;\n initialPosition?: IPosition;\n scale?: number;\n}\n\nexport const DraggableContainer: React.FC<IDraggableContainerProps> = ({\n children,\n width = '50%',\n height,\n className,\n type = RPGUIContainerTypes.FramedGold,\n onCloseButton,\n title,\n imgSrc,\n imgWidth = '20px',\n cancelDrag,\n onPositionChange,\n onPositionChangeEnd,\n onPositionChangeStart,\n onOutsideClick,\n initialPosition = { x: 0, y: 0 },\n scale,\n}) => {\n const draggableRef = useRef(null);\n\n useOutsideClick(draggableRef, 'item-container');\n\n useEffect(() => {\n document.addEventListener('clickOutside', event => {\n const e = event as CustomEvent;\n\n if (e.detail.id === 'item-container') {\n if (onOutsideClick) {\n onOutsideClick();\n }\n }\n });\n\n return () => {\n document.removeEventListener('clickOutside', _e => {});\n };\n }, []);\n\n return (\n <Draggable\n cancel={`.container-close,${cancelDrag}`}\n onDrag={(_e, data) => {\n if (onPositionChange) {\n onPositionChange({\n x: data.x,\n y: data.y,\n });\n }\n }}\n onStop={(_e, data) => {\n if (onPositionChangeEnd) {\n onPositionChangeEnd({\n x: data.x,\n y: data.y,\n });\n }\n }}\n onStart={(_e, data) => {\n if (onPositionChangeStart) {\n onPositionChangeStart({\n x: data.x,\n y: data.y,\n });\n }\n }}\n defaultPosition={initialPosition}\n scale={scale}\n >\n <Container\n ref={draggableRef}\n width={width}\n height={height || 'auto'}\n className={`rpgui-container ${type} ${className}`}\n >\n {title && (\n <TitleContainer className=\"drag-handler\">\n <Title>\n {imgSrc && <Icon src={imgSrc} width={imgWidth} />}\n {title}\n </Title>\n </TitleContainer>\n )}\n {onCloseButton && (\n <CloseButton\n className=\"container-close\"\n onPointerDown={onCloseButton}\n >\n X\n </CloseButton>\n )}\n\n {children}\n </Container>\n </Draggable>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n}\n\nconst Container = styled.div<IContainerProps>`\n height: ${props => props.height};\n width: ${({ width }) => width};\n display: flex;\n flex-wrap: wrap;\n image-rendering: pixelated;\n\n &.rpgui-container {\n padding-top: 1.5rem;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 3px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 1.1rem;\n @media (max-width: 768px) {\n font-size: 1.3rem;\n padding: 3px;\n }\n`;\n\nconst TitleContainer = styled.div`\n width: 100%;\n height: 100%;\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n`;\n\nconst Title = styled.h1`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.large};\n`;\n\ninterface ICustomIconProps {\n width: string;\n}\n\nconst Icon = styled.img`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.xsmall};\n width: ${(props: ICustomIconProps) => props.width};\n margin-right: 0.5rem;\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport interface IOptionsProps {\n id: number;\n value: string;\n option: string;\n}\n\nexport interface IDropdownProps {\n options: IOptionsProps[];\n width?: string;\n onChange: (value: string) => void;\n}\n\nexport const Dropdown: React.FC<IDropdownProps> = ({\n options,\n width,\n onChange,\n}) => {\n const dropdownId = uuidv4();\n\n const [selectedValue, setSelectedValue] = useState<string>('');\n const [selectedOption, setSelectedOption] = useState<string>('');\n const [opened, setOpened] = useState<boolean>(false);\n\n useEffect(() => {\n const firstOption = options[0];\n\n if (firstOption) {\n let change = !selectedValue;\n if (!change) {\n change = options.filter((o) => o.value === selectedValue).length < 1;\n }\n\n /**\n * make a selection if there is no selected value already present\n * or if there is a selected value but its not in new options\n */\n if (change) {\n setSelectedValue(firstOption.value);\n setSelectedOption(firstOption.option);\n }\n }\n }, [options]);\n\n useEffect(() => {\n if (selectedValue) {\n onChange(selectedValue);\n }\n }, [selectedValue]);\n\n return (\n <Container onMouseLeave={() => setOpened(false)} width={width}>\n <DropdownSelect\n id={`dropdown-${dropdownId}`}\n className=\"rpgui-dropdown-imp rpgui-dropdown-imp-header\"\n onPointerDown={() => setOpened((prev) => !prev)}\n >\n <label>▼</label> {selectedOption}\n </DropdownSelect>\n\n <DropdownOptions className=\"rpgui-dropdown-imp\" opened={opened}>\n {options.map((option) => {\n return (\n <li\n key={option.id}\n onPointerDown={() => {\n setSelectedValue(option.value);\n setSelectedOption(option.option);\n setOpened(false);\n }}\n >\n {option.option}\n </li>\n );\n })}\n </DropdownOptions>\n </Container>\n );\n};\n\nconst Container = styled.div<{ width: string | undefined }>`\n position: relative;\n width: ${(props) => props.width || '100%'};\n`;\n\nconst DropdownSelect = styled.p`\n width: 100%;\n box-sizing: border-box;\n`;\n\nconst DropdownOptions = styled.ul<{\n opened: boolean;\n}>`\n position: absolute;\n width: 100%;\n display: ${(props) => (props.opened ? 'block' : 'none')};\n box-sizing: border-box;\n @media (max-width: 768px) {\n padding: 8px 0;\n }\n`;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport styled from 'styled-components';\n\nconst modalRoot = document.getElementById('modal-root')!;\n\ninterface ModalPortalProps {\n children: React.ReactNode;\n}\n\nconst ModalPortal: React.FC<ModalPortalProps> = ({ children }) => {\n return ReactDOM.createPortal(\n <Container className=\"rpgui-content\">{children}</Container>,\n modalRoot\n );\n};\n\nconst Container = styled.div`\n position: static !important;\n`;\n\nexport default ModalPortal;\n","import React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\nimport ModalPortal from './Abstractions/ModalPortal';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface IRelativeMenuProps {\n options: IListMenuOption[];\n onSelected: (selectedOptionId: string) => void;\n fontSize?: number;\n onOutsideClick?: () => void;\n pos: { x: number; y: number };\n}\n\nexport const RelativeListMenu: React.FC<IRelativeMenuProps> = ({\n options,\n onSelected,\n onOutsideClick,\n fontSize = 0.8,\n pos,\n}) => {\n const ref = useRef(null);\n\n useOutsideClick(ref, 'relative-context-menu');\n\n useEffect(() => {\n document.addEventListener('clickOutside', event => {\n const e = event as CustomEvent;\n\n if (e.detail.id === 'relative-context-menu') {\n if (onOutsideClick) {\n onOutsideClick();\n }\n }\n });\n\n return () => {\n document.removeEventListener('clickOutside', _e => {});\n };\n }, []);\n\n return (\n <ModalPortal>\n <Container fontSize={fontSize} ref={ref} {...pos}>\n <ul className=\"rpgui-list-imp\" style={{ overflow: 'hidden' }}>\n {options.map((params, index) => (\n <ListElement\n key={params?.id || index}\n onPointerDown={() => {\n onSelected(params?.id);\n }}\n >\n {params?.text || 'No text'}\n </ListElement>\n ))}\n </ul>\n </Container>\n </ModalPortal>\n );\n};\n\ninterface IContainerProps {\n fontSize?: number;\n x: number;\n y: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n position: absolute;\n top: ${props => props.y}px;\n left: ${props => props.x}px;\n\n display: flex;\n flex-direction: column;\n width: max-content;\n justify-content: start;\n align-items: flex-start;\n\n li {\n font-size: ${props => props.fontSize}em;\n }\n`;\n\nconst ListElement = styled.li`\n margin-right: 0.5rem;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { ItemInfoDisplay } from './ItemInfoDisplay';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface MobileItemTooltipProps {\n item: IItem;\n atlasIMG: any;\n atlasJSON: any;\n closeTooltip: () => void;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n options?: IListMenuOption[];\n onSelected?: (selectedOptionId: string) => void;\n}\n\nexport const MobileItemTooltip: React.FC<MobileItemTooltipProps> = ({\n item,\n atlasIMG,\n atlasJSON,\n closeTooltip,\n equipmentSet,\n scale = 1,\n options,\n onSelected,\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n\n const handleFadeOut = () => {\n ref.current?.classList.add('fadeOut');\n };\n\n return (\n <ModalPortal>\n <Container\n ref={ref}\n onTouchEnd={() => {\n handleFadeOut();\n setTimeout(() => {\n closeTooltip();\n }, 100);\n }}\n scale={scale}\n >\n <ItemInfoDisplay\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n isMobile\n />\n <OptionsContainer>\n {options?.map(option => (\n <Option\n key={option.id}\n onTouchEnd={() => {\n handleFadeOut();\n setTimeout(() => {\n onSelected?.(option.id);\n closeTooltip();\n }, 100);\n }}\n >\n {option.text}\n </Option>\n ))}\n </OptionsContainer>\n </Container>\n </ModalPortal>\n );\n};\n\nconst Container = styled.div<{ scale: number }>`\n position: absolute;\n z-index: 100;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0 0 0 / 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.5rem;\n transition: opacity 0.08s;\n animation: fadeIn 0.1s forwards;\n\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 0.92;\n }\n }\n\n @keyframes fadeOut {\n 0% {\n opacity: 0.92;\n }\n 100% {\n opacity: 0;\n }\n }\n\n &.fadeOut {\n animation: fadeOut 0.1s forwards;\n }\n\n @media (max-width: 580px) {\n flex-direction: column;\n }\n`;\n\nconst OptionsContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n flex-wrap: wrap;\n\n @media (max-width: 580px) {\n flex-direction: row;\n justify-content: center;\n }\n`;\n\nconst Option = styled.button`\n padding: 1rem;\n background-color: #333;\n color: white;\n border: none;\n border-radius: 3px;\n width: 8rem;\n transition: background-color 0.1s;\n\n &:hover {\n background-color: #555;\n }\n\n @media (max-width: 580px) {\n padding: 1rem 0.5rem;\n }\n`;\n","import {\n ActionsForEquipmentSet,\n ActionsForInventory,\n ActionsForLoot,\n ActionsForMapContainer,\n DepotSocketEvents,\n IItem,\n ItemContainerType,\n ItemSocketEvents,\n ItemSocketEventsDisplayLabels,\n ItemType,\n} from '@rpg-engine/shared';\n\nexport interface IContextMenuItem {\n id: string;\n text: string;\n}\n\nconst generateContextMenuListOptions = (actionsByTypeList: any) => {\n const contextMenu: IContextMenuItem[] = actionsByTypeList.map(\n (action: string) => {\n return { id: action, text: ItemSocketEventsDisplayLabels[action] };\n }\n );\n return contextMenu;\n};\n\nexport const generateContextMenu = (\n item: IItem,\n itemContainerType: ItemContainerType | null,\n isDepotSystem?: boolean\n) => {\n let contextActionMenu: IContextMenuItem[] = [];\n\n if (itemContainerType === ItemContainerType.Inventory) {\n switch (item.type) {\n case ItemType.Weapon:\n case ItemType.Armor:\n case ItemType.Accessory:\n case ItemType.Jewelry:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Equipment\n );\n break;\n case ItemType.Container:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Container\n );\n break;\n case ItemType.Consumable:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Consumable\n );\n break;\n case ItemType.CraftingResource:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.CraftingResource\n );\n break;\n case ItemType.Tool:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Tool\n );\n break;\n\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Other\n );\n break;\n }\n\n if (isDepotSystem) {\n contextActionMenu.push({\n id: DepotSocketEvents.Deposit,\n text: 'Deposit',\n });\n }\n }\n if (itemContainerType === ItemContainerType.Equipment) {\n switch (item.type) {\n case ItemType.Container:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForEquipmentSet.Container\n );\n\n break;\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForEquipmentSet.Equipment\n );\n }\n }\n if (itemContainerType === ItemContainerType.Loot) {\n switch (item.type) {\n case ItemType.Weapon:\n case ItemType.Armor:\n case ItemType.Accessory:\n case ItemType.Jewelry:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.Equipment\n );\n break;\n case ItemType.Consumable:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.Consumable\n );\n break;\n case ItemType.CraftingResource:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.CraftingResource\n );\n break;\n case ItemType.Tool:\n contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Tool);\n break;\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.Other\n );\n break;\n }\n }\n if (itemContainerType === ItemContainerType.MapContainer) {\n switch (item.type) {\n case ItemType.Weapon:\n case ItemType.Armor:\n case ItemType.Accessory:\n case ItemType.Jewelry:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Equipment\n );\n break;\n case ItemType.Consumable:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Consumable\n );\n break;\n case ItemType.CraftingResource:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.CraftingResource\n );\n break;\n case ItemType.Tool:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Tool\n );\n break;\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Other\n );\n break;\n }\n\n const contextActionMenuDontHaveUseWith = !contextActionMenu.find(action =>\n action.text.toLowerCase().includes('use with')\n );\n\n if (item.hasUseWith && contextActionMenuDontHaveUseWith) {\n contextActionMenu.push({ id: 'use-with', text: 'Use with...' });\n }\n }\n if (itemContainerType === ItemContainerType.Depot) {\n contextActionMenu = [\n {\n id: ItemSocketEvents.GetItemInfo,\n text: ItemSocketEventsDisplayLabels.GetItemInfo,\n },\n { id: DepotSocketEvents.Withdraw, text: 'Withdraw' },\n ];\n }\n\n return contextActionMenu;\n};\n","import {\n getItemTextureKeyPath,\n IEquipmentSet,\n IItem,\n IItemContainer,\n ItemContainerType,\n ItemRarities,\n ItemSlotType,\n ItemType,\n} from '@rpg-engine/shared';\n\nimport { observer } from 'mobx-react-lite';\nimport React, { useEffect, useRef, useState } from 'react';\nimport Draggable from 'react-draggable';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport { IPosition } from '../../../types/eventTypes';\nimport { RelativeListMenu } from '../../RelativeListMenu';\nimport { Ellipsis } from '../../shared/Ellipsis';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\nimport { ItemTooltip } from '../Cards/ItemTooltip';\nimport { MobileItemTooltip } from '../Cards/MobileItemTooltip';\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { generateContextMenu, IContextMenuItem } from './itemContainerHelper';\n\nexport const EquipmentSlotSpriteByType: any = {\n Neck: 'accessories/corruption-necklace.png',\n LeftHand: 'swords/broad-sword.png',\n Ring: 'rings/iron-ring.png',\n Head: 'helmets/viking-helmet.png',\n Torso: 'armors/iron-armor.png',\n Legs: 'legs/studded-legs.png',\n Feet: 'boots/iron-boots.png',\n Inventory: 'containers/bag.png',\n RightHand: 'shields/plate-shield.png',\n Accessory: 'ranged-weapons/arrow.png',\n};\n\ninterface IProps {\n slotIndex: number;\n item: IItem | null;\n itemContainer?: IItemContainer | null;\n itemContainerType: ItemContainerType | null;\n slotSpriteMask?: ItemSlotType | null;\n onSelected: (selectedOption: string, item: IItem) => void;\n onMouseOver: (\n event: any,\n slotIndex: number,\n item: IItem | null,\n x: number,\n y: number\n ) => void;\n onMouseOut?: () => void;\n onPointerDown: (\n ItemType: ItemType,\n itemContainerType: ItemContainerType | null,\n item: IItem\n ) => void;\n onDragStart: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onDragEnd: (quantity?: number) => void;\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\n dragScale?: number;\n checkIfItemCanBeMoved: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;\n onPlaceDrop: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n atlasJSON: any;\n atlasIMG: any;\n isContextMenuDisabled?: boolean;\n isSelectingShortcut?: boolean;\n equipmentSet?: IEquipmentSet | null;\n setItemShortcut?: (item: IItem, shortcutIndex: number) => void;\n isDepotSystem?: boolean;\n}\n\nexport const ItemSlot: React.FC<IProps> = observer(\n ({\n slotIndex,\n item,\n itemContainerType: containerType,\n slotSpriteMask,\n onMouseOver,\n onMouseOut,\n onPointerDown,\n onSelected,\n atlasJSON,\n atlasIMG,\n isContextMenuDisabled = false,\n onDragEnd,\n onDragStart,\n onPlaceDrop,\n onOutsideDrop: onDrop,\n checkIfItemCanBeMoved,\n openQuantitySelector,\n checkIfItemShouldDragEnd,\n dragScale,\n isSelectingShortcut,\n equipmentSet,\n setItemShortcut,\n isDepotSystem,\n }) => {\n const [isTooltipVisible, setTooltipVisible] = useState(false);\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\n\n const [isContextMenuVisible, setIsContextMenuVisible] = useState(false);\n const [contextMenuPosition, setContextMenuPosition] = useState({\n x: 0,\n y: 0,\n });\n\n const [isFocused, setIsFocused] = useState(false);\n const [wasDragged, setWasDragged] = useState(false);\n const [dragPosition, setDragPosition] = useState<IPosition>({ x: 0, y: 0 });\n const [dropPosition, setDropPosition] = useState<IPosition | null>(null);\n const dragContainer = useRef<HTMLDivElement>(null);\n\n const [contextActions, setContextActions] = useState<IContextMenuItem[]>(\n []\n );\n\n useEffect(() => {\n setDragPosition({ x: 0, y: 0 });\n setIsFocused(false);\n\n if (item) {\n setContextActions(\n generateContextMenu(item, containerType, isDepotSystem)\n );\n }\n }, [item, isDepotSystem]);\n\n useEffect(() => {\n if (onDrop && item && dropPosition) {\n onDrop(item, dropPosition);\n }\n }, [dropPosition]);\n\n const getStackInfo = (itemId: string, stackQty: number) => {\n const isFractionalStackQty = stackQty % 1 !== 0;\n const isLargerThan999 = stackQty > 999;\n\n let qtyClassName = 'regular';\n if (isLargerThan999) qtyClassName = 'small';\n if (isFractionalStackQty) qtyClassName = 'xsmall';\n\n if (stackQty > 1) {\n return (\n <ItemQtyContainer key={`qty-${itemId}`}>\n <Ellipsis maxLines={1} maxWidth=\"48px\">\n <ItemQty className={qtyClassName}>\n {Math.round(stackQty * 100) / 100}{' '}\n </ItemQty>\n </Ellipsis>\n </ItemQtyContainer>\n );\n }\n return undefined;\n };\n\n const renderItem = (itemToRender: IItem | null) => {\n const element = [];\n\n if (itemToRender?.texturePath) {\n element.push(\n <ErrorBoundary key={itemToRender._id}>\n <SpriteFromAtlas\n key={itemToRender._id}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: itemToRender.texturePath,\n texturePath: itemToRender.texturePath,\n stackQty: itemToRender.stackQty || 1,\n isStackable: itemToRender.isStackable,\n },\n atlasJSON\n )}\n imgScale={3}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </ErrorBoundary>\n );\n }\n const stackInfo = getStackInfo(\n itemToRender?._id ?? '',\n itemToRender?.stackQty ?? 0\n );\n if (stackInfo) {\n element.push(stackInfo);\n }\n\n return element;\n };\n\n const renderEquipment = (itemToRender: IItem | null) => {\n if (\n itemToRender?.texturePath &&\n itemToRender.allowedEquipSlotType?.includes(slotSpriteMask!)\n ) {\n const element = [];\n\n element.push(\n <ErrorBoundary key={itemToRender._id}>\n <SpriteFromAtlas\n key={itemToRender._id}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: itemToRender.texturePath,\n texturePath: itemToRender.texturePath,\n stackQty: itemToRender.stackQty || 1,\n isStackable: itemToRender.isStackable,\n },\n atlasJSON\n )}\n imgScale={3}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </ErrorBoundary>\n );\n const stackInfo = getStackInfo(\n itemToRender?._id ?? '',\n itemToRender?.stackQty ?? 0\n );\n if (stackInfo) {\n element.push(stackInfo);\n }\n return element;\n } else {\n return (\n <ErrorBoundary key={uuidv4()}>\n <SpriteFromAtlas\n key={uuidv4()}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={EquipmentSlotSpriteByType[slotSpriteMask!]}\n imgScale={3}\n grayScale={true}\n opacity={0.4}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </ErrorBoundary>\n );\n }\n };\n\n const onRenderSlot = (itemToRender: IItem | null) => {\n switch (containerType) {\n case ItemContainerType.Equipment:\n return renderEquipment(itemToRender);\n case ItemContainerType.Inventory:\n return renderItem(itemToRender);\n default:\n return renderItem(itemToRender);\n }\n };\n\n const resetItem = () => {\n setTooltipVisible(false);\n setWasDragged(false);\n };\n\n const onSuccesfulDrag = (quantity?: number) => {\n resetItem();\n\n if (quantity === -1) {\n setDragPosition({ x: 0, y: 0 });\n setIsFocused(false);\n } else if (item) {\n onDragEnd(quantity);\n }\n };\n\n return (\n <Container\n item={item}\n className=\"rpgui-icon empty-slot\"\n onMouseUp={() => {\n const data = item ? item : null;\n if (onPlaceDrop) onPlaceDrop(data, slotIndex, containerType);\n }}\n onTouchEnd={e => {\n const { clientX, clientY } = e.changedTouches[0];\n const simulatedEvent = new MouseEvent('mouseup', {\n clientX,\n clientY,\n bubbles: true,\n });\n\n document\n .elementFromPoint(clientX, clientY)\n ?.dispatchEvent(simulatedEvent);\n }}\n isSelectingShortcut={\n isSelectingShortcut &&\n (item?.type === ItemType.Consumable || item?.type === ItemType.Tool)\n }\n >\n <Draggable\n axis={isSelectingShortcut ? 'none' : 'both'}\n defaultClassName={item ? 'draggable' : 'empty-slot'}\n scale={dragScale}\n onStop={(e, data) => {\n const target = e.target as HTMLElement;\n if (\n target?.id.includes('shortcutSetter') &&\n setItemShortcut &&\n item\n ) {\n const index = parseInt(target.id.split('_')[1]);\n if (!isNaN(index)) {\n setItemShortcut(item, index);\n }\n }\n\n if (wasDragged && item && !isSelectingShortcut) {\n //@ts-ignore\n const classes: string[] = Array.from(e.target?.classList);\n\n const isOutsideDrop =\n classes.some(elm => {\n return elm.includes('rpgui-content');\n }) || classes.length === 0;\n\n if (isOutsideDrop) {\n setDropPosition({\n x: data.x,\n y: data.y,\n });\n }\n\n setWasDragged(false);\n\n const target = dragContainer.current;\n if (!target || !wasDragged) return;\n\n const style = window.getComputedStyle(target);\n const matrix = new DOMMatrixReadOnly(style.transform);\n const x = matrix.m41;\n const y = matrix.m42;\n\n setDragPosition({ x, y });\n\n setTimeout(() => {\n if (checkIfItemCanBeMoved()) {\n if (checkIfItemShouldDragEnd && !checkIfItemShouldDragEnd())\n return;\n\n if (\n item.stackQty &&\n item.stackQty !== 1 &&\n openQuantitySelector\n )\n openQuantitySelector(item.stackQty, onSuccesfulDrag);\n else onSuccesfulDrag(item.stackQty);\n } else {\n resetItem();\n setIsFocused(false);\n setDragPosition({ x: 0, y: 0 });\n }\n }, 100);\n } else if (item) {\n let isTouch = false;\n if (\n !isContextMenuDisabled &&\n e.type === 'touchend' &&\n !isSelectingShortcut\n ) {\n isTouch = true;\n setIsTooltipMobileVisible(true);\n }\n\n if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch) {\n setIsContextMenuVisible(!isContextMenuVisible);\n const event = e as MouseEvent;\n\n if (event.clientX && event.clientY) {\n setContextMenuPosition({\n x: event.clientX - 10,\n y: event.clientY - 5,\n });\n }\n }\n\n onPointerDown(item.type, containerType, item);\n }\n }}\n onStart={() => {\n if (!item || isSelectingShortcut) {\n return;\n }\n\n if (onDragStart) {\n onDragStart(item, slotIndex, containerType);\n }\n }}\n onDrag={(_e, data) => {\n if (\n Math.abs(data.x - dragPosition.x) > 5 ||\n Math.abs(data.y - dragPosition.y) > 5\n ) {\n setWasDragged(true);\n setIsFocused(true);\n }\n }}\n position={dragPosition}\n cancel=\".empty-slot\"\n >\n <ItemContainer\n ref={dragContainer}\n isFocused={isFocused}\n onMouseOver={event => {\n onMouseOver(event, slotIndex, item, event.clientX, event.clientY);\n }}\n onMouseOut={() => {\n if (onMouseOut) onMouseOut();\n }}\n onMouseEnter={() => {\n setTooltipVisible(true);\n }}\n onMouseLeave={() => {\n setTooltipVisible(false);\n }}\n >\n {onRenderSlot(item)}\n </ItemContainer>\n </Draggable>\n\n {isTooltipVisible && item && !isFocused && (\n <ItemTooltip\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n />\n )}\n\n {isTooltipMobileVisible && item && (\n <MobileItemTooltip\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n closeTooltip={() => {\n setIsTooltipMobileVisible(false);\n }}\n scale={dragScale}\n options={contextActions}\n onSelected={(optionId: string) => {\n setIsContextMenuVisible(false);\n if (item) {\n onSelected(optionId, item);\n }\n }}\n />\n )}\n\n {!isContextMenuDisabled && isContextMenuVisible && contextActions && (\n <RelativeListMenu\n options={contextActions}\n onSelected={(optionId: string) => {\n setIsContextMenuVisible(false);\n if (item) {\n onSelected(optionId, item);\n }\n }}\n onOutsideClick={() => {\n setIsContextMenuVisible(false);\n }}\n pos={contextMenuPosition}\n />\n )}\n </Container>\n );\n }\n);\n\nexport const rarityColor = (item: IItem | null) => {\n switch (item?.rarity) {\n case ItemRarities.Uncommon:\n return 'rgba(13, 193, 13, 0.6)';\n case ItemRarities.Rare:\n return 'rgba(8, 104, 187, 0.6)';\n case ItemRarities.Epic:\n return 'rgba(191, 0, 255, 0.6)';\n case ItemRarities.Legendary:\n return 'rgba(255, 191, 0,0.6)';\n default:\n return null;\n }\n};\n\ninterface ContainerTypes {\n item: IItem | null;\n isSelectingShortcut?: boolean;\n}\n\nconst Container = styled.div<ContainerTypes>`\n margin: 0.1rem;\n .sprite-from-atlas-img--item {\n position: relative;\n top: 1.5rem;\n left: 1.5rem;\n border-color: ${({ item }) => rarityColor(item)};\n box-shadow: ${({ item }) => `0 0 5px 2px ${rarityColor(item)}`} inset, ${({\n item,\n}) => `0 0 4px 3px ${rarityColor(item)}`};\n //background-color: ${({ item }) => rarityColor(item)};\n }\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n border-radius: 12px;\n pointer-events: none;\n animation: ${({ isSelectingShortcut }) =>\n isSelectingShortcut ? 'bg-color-change 1s infinite' : 'none'};\n\n @keyframes bg-color-change {\n 0% {\n background-color: rgba(255 255 255 / 0.5);\n }\n 50% {\n background-color: transparent;\n }\n 100% {\n background-color: rgba(255 255 255 / 0.5);\n }\n }\n }\n`;\n\nconst ItemContainer = styled.div<{ isFocused?: boolean }>`\n width: 100%;\n height: 100%;\n position: relative;\n\n ${props => props.isFocused && 'z-index: 100; pointer-events: none;'}\n`;\n\nconst ItemQtyContainer = styled.div`\n position: relative;\n width: 85%;\n height: 16px;\n top: 25px;\n left: 2px;\n pointer-events: none;\n\n display: flex;\n justify-content: flex-end;\n`;\n\nconst ItemQty = styled.span`\n &.regular {\n font-size: ${uiFonts.size.small};\n }\n &.small {\n font-size: ${uiFonts.size.xsmall};\n }\n &.xsmall {\n font-size: ${uiFonts.size.xxsmall};\n }\n`;\n","import { IItem } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\nimport { ErrorBoundary } from '../Inventory/ErrorBoundary';\nimport { EquipmentSlotSpriteByType, rarityColor } from '../Inventory/ItemSlot';\n\ninterface IItemInfoProps {\n item: IItem;\n itemToCompare?: IItem;\n atlasIMG: any;\n atlasJSON: any;\n}\n\ninterface IItemStat {\n key: keyof IItem;\n label?: string;\n higherIsWorse?: boolean;\n}\n\nconst statisticsToDisplay: IItemStat[] = [\n { key: 'attack' },\n { key: 'defense' },\n { key: 'maxRange', label: 'Range' },\n { key: 'weight', higherIsWorse: true },\n];\n\nexport const ItemInfo: React.FC<IItemInfoProps> = ({\n item,\n itemToCompare,\n atlasIMG,\n atlasJSON,\n}) => {\n const renderStatistics = () => {\n const statistics = [];\n\n for (const stat of statisticsToDisplay) {\n const itemStatistic = item[stat.key];\n\n if (itemStatistic) {\n const label =\n stat.label || stat.key[0].toUpperCase() + stat.key.slice(1);\n\n const isItemToCompare = !!itemToCompare;\n\n const isOnlyInOneItem = isItemToCompare && !itemToCompare?.[stat.key];\n const statDiff =\n parseInt(itemStatistic.toString()) -\n parseInt(itemToCompare?.[stat.key]?.toString() ?? '0');\n\n const isDifference = isItemToCompare && statDiff !== 0;\n const isBetter =\n (statDiff > 0 && !stat.higherIsWorse) ||\n (statDiff < 0 && stat.higherIsWorse);\n\n statistics.push(\n <Statistic key={stat.key} className={isOnlyInOneItem ? 'better' : ''}>\n <div className=\"label\">{label}:</div>\n <div\n className={`value ${\n isDifference ? (isBetter ? 'better' : 'worse') : ''\n }`}\n >\n {`${itemStatistic.toString()} ${\n isDifference ? `(${statDiff > 0 ? '+' : ''}${statDiff})` : ''\n }`}\n </div>\n </Statistic>\n );\n }\n }\n\n return statistics;\n };\n\n const renderMissingStatistic = () => {\n const statistics = [];\n\n for (const stat of statisticsToDisplay) {\n const itemToCompareStatistic = itemToCompare?.[stat.key];\n\n if (itemToCompareStatistic && !item[stat.key]) {\n const label =\n stat.label || stat.key[0].toUpperCase() + stat.key.slice(1);\n\n statistics.push(\n <Statistic key={stat.key} className=\"worse\">\n <div className=\"label\">{label}:</div>\n <div className=\"value worse\">\n {itemToCompareStatistic.toString()}\n </div>\n </Statistic>\n );\n }\n }\n\n return statistics;\n };\n\n const renderAvaibleSlots = () => {\n if (!item.allowedEquipSlotType) return null;\n\n return item.allowedEquipSlotType.map((slotType, index) => (\n <ErrorBoundary key={index}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={EquipmentSlotSpriteByType[slotType]}\n imgScale={2}\n grayScale={true}\n opacity={0.4}\n containerStyle={{ width: '32px', height: '32px' }}\n />\n </ErrorBoundary>\n ));\n };\n\n return (\n <Container item={item}>\n <Header>\n <div>\n <Title>{item.name}</Title>\n {item.rarity !== 'Common' && (\n <Rarity item={item}>{item.rarity}</Rarity>\n )}\n <Type>{item.subType}</Type>\n </div>\n <AllowedSlots>{renderAvaibleSlots()}</AllowedSlots>\n </Header>\n\n {renderStatistics()}\n {item.isTwoHanded && <Statistic>Two handed</Statistic>}\n\n <Description>{item.description}</Description>\n\n {item.maxStackSize && item.maxStackSize !== 1 && (\n <StackInfo>\n x{Math.round((item.stackQty ?? 1) * 100) / 100}({item.maxStackSize})\n </StackInfo>\n )}\n\n {renderMissingStatistic().length > 0 && (\n <MissingStatistics>\n <Statistic>Equipped Diff</Statistic>\n {itemToCompare && renderMissingStatistic()}\n </MissingStatistics>\n )}\n </Container>\n );\n};\n\nconst Container = styled.div<{ item: IItem }>`\n color: white;\n background-color: #222;\n border-radius: 5px;\n padding: 0.5rem;\n font-size: ${uiFonts.size.small};\n border: 3px solid ${({ item }) => rarityColor(item) ?? uiColors.lightGray};\n height: max-content;\n width: 15rem;\n\n @media (max-width: 580px) {\n width: 80vw;\n }\n`;\n\nconst Title = styled.div`\n font-size: ${uiFonts.size.medium};\n font-weight: bold;\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n margin: 0;\n`;\n\nconst Rarity = styled.div<{ item: IItem }>`\n font-size: ${uiFonts.size.small};\n font-weight: normal;\n margin-top: 0.2rem;\n color: ${({ item }) => rarityColor(item)};\n filter: brightness(1.5);\n`;\n\nconst Type = styled.div`\n font-size: ${uiFonts.size.small};\n margin-top: 0.2rem;\n color: ${uiColors.lightGray};\n`;\n\nconst Statistic = styled.div`\n margin-bottom: 0.4rem;\n width: max-content;\n\n .label {\n display: inline-block;\n margin-right: 0.5rem;\n color: inherit;\n }\n\n .value {\n display: inline-block;\n color: inherit;\n }\n\n &.better,\n .better {\n color: ${uiColors.lightGreen};\n }\n\n &.worse,\n .worse {\n color: ${uiColors.cardinal};\n }\n`;\n\nconst Description = styled.div`\n margin-top: 1.5rem;\n font-size: ${uiFonts.size.small};\n color: ${uiColors.lightGray};\n font-style: italic;\n`;\n\nconst Header = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n`;\n\nconst AllowedSlots = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n margin-left: auto;\n align-self: flex-start;\n`;\n\nconst StackInfo = styled.div`\n width: 100%;\n text-align: right;\n font-size: ${uiFonts.size.small};\n color: ${uiColors.orange};\n margin-top: 1rem;\n`;\n\nconst MissingStatistics = styled.div`\n margin-top: 1rem;\n color: ${uiColors.cardinal};\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport { camelCase } from 'lodash';\nimport React, { useMemo } from 'react';\nimport styled from 'styled-components';\nimport { ItemInfo } from './ItemInfo';\n\nexport interface IItemInfoDisplayProps {\n item: IItem;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n isMobile?: boolean;\n}\n\ntype EquipmentSlotTypes =\n | 'head'\n | 'neck'\n | 'leftHand'\n | 'rightHand'\n | 'ring'\n | 'legs'\n | 'boot'\n | 'accessory'\n | 'armor'\n | 'inventory';\n\nconst itemSlotTypes: EquipmentSlotTypes[] = [\n 'head',\n 'neck',\n 'leftHand',\n 'rightHand',\n 'ring',\n 'legs',\n 'boot',\n 'accessory',\n 'armor',\n 'inventory',\n];\n\nconst getSlotType = (\n itemSlotTypes: string[],\n slotType: string,\n subType: string\n): keyof IEquipmentSet => {\n if (!itemSlotTypes.includes(slotType)) {\n return subType as keyof IEquipmentSet;\n }\n return slotType as keyof IEquipmentSet;\n};\n\nexport const ItemInfoDisplay: React.FC<IItemInfoDisplayProps> = ({\n item,\n atlasIMG,\n atlasJSON,\n equipmentSet,\n isMobile,\n}) => {\n const itemToCompare = useMemo(() => {\n if (equipmentSet && item.allowedEquipSlotType?.length) {\n const allowedSlotTypeCamelCase = camelCase(item.allowedEquipSlotType[0]);\n const itemSubTypeCamelCase = camelCase(item.subType);\n\n const slotType = getSlotType(\n itemSlotTypes,\n allowedSlotTypeCamelCase,\n itemSubTypeCamelCase\n );\n\n const itemFromEquipment = equipmentSet[slotType] as IItem;\n\n if (\n itemFromEquipment &&\n (!item._id || itemFromEquipment._id !== item._id)\n ) {\n return itemFromEquipment;\n }\n }\n\n return undefined;\n }, [equipmentSet, item]);\n\n return (\n <Flex $isMobile={isMobile}>\n <ItemInfo\n item={item}\n itemToCompare={itemToCompare}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n {itemToCompare && (\n <CompareContainer>\n <Equipped>\n <span>Equipped</span>\n </Equipped>\n <ItemInfo\n item={itemToCompare}\n itemToCompare={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n </CompareContainer>\n )}\n </Flex>\n );\n};\n\nconst Flex = styled.div<{ $isMobile?: boolean }>`\n display: flex;\n gap: 0.5rem;\n flex-direction: ${({ $isMobile }) => ($isMobile ? 'row-reverse' : 'row')};\n\n @media (max-width: 580px) {\n flex-direction: column-reverse;\n align-items: center;\n }\n`;\n\nconst Equipped = styled.div`\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n`;\n\nconst CompareContainer = styled.div`\n position: relative;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { ItemInfoDisplay } from './ItemInfoDisplay';\n\nexport interface IItemTooltipProps {\n item: IItem;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n}\n\nconst offset = 20;\n\nexport const ItemTooltip: React.FC<IItemTooltipProps> = ({\n item,\n atlasIMG,\n atlasJSON,\n equipmentSet,\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const { current } = ref;\n\n if (current) {\n const handleMouseMove = (event: MouseEvent) => {\n const { clientX, clientY } = event;\n\n // Adjust the position of the tooltip based on the mouse position\n const rect = current.getBoundingClientRect();\n\n const tooltipWidth = rect.width;\n const tooltipHeight = rect.height;\n const isOffScreenRight =\n clientX + tooltipWidth + offset > window.innerWidth;\n const isOffScreenBottom =\n clientY + tooltipHeight + offset > window.innerHeight;\n const x = isOffScreenRight\n ? clientX - tooltipWidth - offset\n : clientX + offset;\n const y = isOffScreenBottom\n ? clientY - tooltipHeight - offset\n : clientY + offset;\n\n current.style.transform = `translate(${x}px, ${y}px)`;\n current.style.opacity = '1';\n };\n\n window.addEventListener('mousemove', handleMouseMove);\n\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n };\n }\n\n return;\n }, []);\n\n return (\n <ModalPortal>\n <Container ref={ref}>\n <ItemInfoDisplay\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n />\n </Container>\n </ModalPortal>\n );\n};\n\nconst Container = styled.div`\n position: absolute;\n z-index: 100;\n pointer-events: none;\n left: 0;\n top: 0;\n opacity: 0;\n transition: opacity 0.08s;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport { ItemTooltip } from './ItemTooltip';\nimport { MobileItemTooltip } from './MobileItemTooltip';\n\ninterface IItemInfoWrapperProps {\n item: IItem;\n children: React.ReactNode;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n}\n\nexport const ItemInfoWrapper: React.FC<IItemInfoWrapperProps> = ({\n children,\n atlasIMG,\n atlasJSON,\n item,\n equipmentSet,\n scale,\n}) => {\n const [isTooltipVisible, setIsTooltipVisible] = useState(false);\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\n\n return (\n <div\n onMouseEnter={() => {\n if (!isTooltipMobileVisible) setIsTooltipVisible(true);\n }}\n onMouseLeave={setIsTooltipVisible.bind(null, false)}\n onTouchEnd={() => {\n setIsTooltipMobileVisible(true);\n setIsTooltipVisible(false);\n }}\n >\n {children}\n\n {isTooltipVisible && !isTooltipMobileVisible && (\n <ItemTooltip\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n item={item}\n />\n )}\n {isTooltipMobileVisible && (\n <MobileItemTooltip\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n closeTooltip={() => {\n setIsTooltipMobileVisible(false);\n console.log('close');\n }}\n item={item}\n scale={scale}\n />\n )}\n </div>\n );\n};\n","import { ICraftableItem, IEquipmentSet, ItemSubType } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Dropdown, IOptionsProps } from '../Dropdown';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nexport interface IItemCraftSelectorProps {\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onSelect: (value: string) => void;\n onCraftItem: (value: string | undefined) => void;\n craftablesItems: ICraftableItem[];\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n}\n\nexport interface ShowMessage {\n show: boolean;\n index: number;\n}\n\nexport const CraftBook: React.FC<IItemCraftSelectorProps> = ({\n atlasIMG,\n atlasJSON,\n onClose,\n onSelect,\n onCraftItem,\n craftablesItems,\n equipmentSet,\n scale,\n}) => {\n let optionsId: number = 0;\n const [isShown, setIsShown] = useState<ShowMessage>({\n show: false,\n index: 200,\n });\n const [craftItem, setCraftItem] = useState<string>();\n\n const getDropdownOptions = () => {\n const options: IOptionsProps[] = [];\n\n Object.keys(ItemSubType).forEach(key => {\n if (key === 'DeadBody') {\n return; // we can't craft crafting resouces...\n }\n\n options.push({\n id: optionsId,\n value: key,\n option: key,\n });\n optionsId += 1;\n });\n\n return options;\n };\n\n const modifyString = (str: string) => {\n // Split the string by \"/\" and \".\"\n let parts = str.split('/');\n let fileName = parts[parts.length - 1];\n parts = fileName.split('.');\n let name = parts[0];\n\n // Replace all occurrences of \"-\" with \" \"\n name = name.replace(/-/g, ' ');\n\n // Uppercase the first word\n let words = name.split(' ');\n let firstWord = words[0].slice(0, 1).toUpperCase() + words[0].slice(1);\n let modifiedWords = [firstWord].concat(words.slice(1));\n name = modifiedWords.join(' ');\n\n return name;\n };\n\n const handleClick = (value: string) => {\n setCraftItem(value);\n };\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n width=\"500px\"\n cancelDrag=\".inputRadioCraftBook\"\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n scale={scale}\n >\n <div style={{ width: '100%' }}>\n <Title>Craftbook</Title>\n <Subtitle>Select an item to craft</Subtitle>\n <hr className=\"golden\" />\n </div>\n <Dropdown\n options={getDropdownOptions()}\n onChange={value => onSelect(value)}\n />\n <RadioInputScroller className=\"inputRadioCraftBook\">\n {craftablesItems?.map((option, index) => (\n <RadioOptionsWrapper key={index}>\n <SpriteAtlasWrapper>\n <ItemInfoWrapper\n item={option}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={option.texturePath}\n imgScale={3}\n grayScale={!option.canCraft}\n />\n </ItemInfoWrapper>\n </SpriteAtlasWrapper>\n <div>\n <div onPointerDown={() => handleClick(option.key)}>\n <input\n className=\"rpgui-radio\"\n type=\"radio\"\n value={option.name}\n name=\"test\"\n disabled={!option.canCraft}\n checked={craftItem === option.key}\n onChange={() => handleClick(option.key)}\n />\n <label\n onPointerDown={() => {\n handleClick(option.key);\n }}\n onTouchEnd={() => {\n setIsShown({ show: true, index: index });\n }}\n style={{ display: 'flex', alignItems: 'center' }}\n onMouseEnter={() => setIsShown({ show: true, index: index })}\n onMouseLeave={() => setIsShown({ show: false, index: index })}\n >\n {modifyString(option.name)}\n </label>\n </div>\n\n {isShown &&\n isShown.index === index &&\n option.ingredients.map((option, index) => (\n <Recipes key={index}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={option.texturePath}\n imgScale={1}\n />\n <StyledItem>\n {modifyString(option.key)} ({option.qty}x)\n </StyledItem>\n </Recipes>\n ))}\n </div>\n </RadioOptionsWrapper>\n ))}\n </RadioInputScroller>\n <ButtonWrapper>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onCraftItem(craftItem)}\n >\n Craft\n </Button>\n </ButtonWrapper>\n </DraggableContainer>\n );\n};\n\nconst StyledItem = styled.div`\n margin-left: 10px;\n`;\n\nconst Recipes = styled.div`\n font-size: 0.6rem;\n color: yellow !important;\n margin-bottom: 3px;\n display: flex;\n align-items: center;\n\n .sprite-from-atlas-img {\n top: 0px;\n left: 0px;\n }\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: yellow !important;\n`;\nconst Subtitle = styled.h1`\n font-size: 0.4rem;\n color: yellow !important;\n`;\n\nconst RadioInputScroller = styled.div`\n padding-left: 15px;\n padding-top: 10px;\n width: 100%;\n margin-top: 1rem;\n align-items: center;\n margin-left: 20px;\n align-items: flex-start;\n overflow-y: scroll;\n height: 360px;\n -webkit-overflow-scrolling: touch;\n`;\n\nconst SpriteAtlasWrapper = styled.div`\n margin-right: 40px;\n`;\n\nconst RadioOptionsWrapper = styled.div`\n display: flex;\n align-items: stretch;\n margin-bottom: 40px;\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n padding-top: 20px;\n width: 100%;\n button {\n padding: 0px 50px;\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { Dropdown } from './Dropdown';\n\ninterface IDropdownSelectorOption {\n id: string;\n name: string;\n}\n\nexport interface IDropdownSelectorContainer {\n onChange: (id: string) => void;\n options: IDropdownSelectorOption[];\n details?: string;\n title: string;\n}\n\nexport const DropdownSelectorContainer: React.FC<IDropdownSelectorContainer> = ({\n title,\n onChange,\n options,\n details,\n}) => {\n return (\n <div>\n <p>{title}</p>\n <Dropdown\n options={options.map((option, index) => ({\n option: option.name,\n value: option.id,\n id: index,\n }))}\n onChange={onChange}\n />\n <Details>{details}</Details>\n </div>\n );\n};\n\nconst Details = styled.p`\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n","import {\n IEquipmentSet,\n IItem,\n IItemContainer,\n ItemContainerType,\n ItemSlotType,\n ItemType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { IPosition } from '../../types/eventTypes';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { ItemSlot } from '../Item/Inventory/ItemSlot';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\n\nexport interface IEquipmentSetProps {\n equipmentSet: IEquipmentSet;\n onClose?: () => void;\n onItemClick?: (\n ItemType: ItemType,\n item: IItem,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragStart?: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragEnd?: (quantity?: number) => void;\n onItemPlaceDrop?: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemOutsideDrop?: (item: IItem, position: IPosition) => void;\n scale?: number;\n checkIfItemCanBeMoved: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;\n onSelected?: (optionId: string) => void;\n initialPosition?: { x: number; y: number };\n type: ItemContainerType | null;\n atlasIMG: any;\n atlasJSON: any;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n}\n\nexport const EquipmentSet: React.FC<IEquipmentSetProps> = ({\n equipmentSet,\n onClose,\n onMouseOver,\n onSelected,\n onItemClick,\n atlasIMG,\n atlasJSON,\n onItemDragEnd,\n onItemDragStart,\n onItemPlaceDrop,\n onItemOutsideDrop,\n checkIfItemCanBeMoved,\n checkIfItemShouldDragEnd,\n scale,\n initialPosition,\n onPositionChangeEnd,\n onPositionChangeStart,\n}) => {\n const {\n neck,\n leftHand,\n ring,\n head,\n armor,\n legs,\n boot,\n inventory,\n rightHand,\n accessory,\n } = equipmentSet;\n\n const equipmentData = [\n neck,\n leftHand,\n ring,\n head,\n armor,\n legs,\n boot,\n inventory,\n rightHand,\n accessory,\n ];\n\n const equipmentMaskSlots = [\n ItemSlotType.Neck,\n ItemSlotType.LeftHand,\n ItemSlotType.Ring,\n ItemSlotType.Head,\n ItemSlotType.Torso,\n ItemSlotType.Legs,\n ItemSlotType.Feet,\n ItemSlotType.Inventory,\n ItemSlotType.RightHand,\n ItemSlotType.Accessory,\n ];\n\n const onRenderEquipmentSlotRange = (start: number, end: number) => {\n const equipmentRange = equipmentData.slice(start, end);\n const slotMaksRange = equipmentMaskSlots.slice(start, end);\n\n return equipmentRange.map((data, i) => {\n const item = data as IItem;\n const itemContainer =\n (item && (item.itemContainer as IItemContainer)) ?? null;\n\n return (\n <ItemSlot\n key={i}\n slotIndex={i}\n item={item}\n itemContainer={itemContainer}\n itemContainerType={ItemContainerType.Equipment}\n slotSpriteMask={slotMaksRange[i]}\n onMouseOver={(event, slotIndex, item) => {\n if (onMouseOver) onMouseOver(event, slotIndex, item);\n }}\n onPointerDown={(itemType, ContainerType) => {\n if (onItemClick) onItemClick(itemType, item, ContainerType);\n }}\n onSelected={(optionId: string) => {\n if (onSelected) onSelected(optionId);\n }}\n onDragStart={(item, slotIndex, itemContainerType) => {\n if (!item) {\n return;\n }\n\n if (onItemDragStart)\n onItemDragStart(item, slotIndex, itemContainerType);\n }}\n onDragEnd={quantity => {\n if (onItemDragEnd) onItemDragEnd(quantity);\n }}\n dragScale={scale}\n checkIfItemCanBeMoved={checkIfItemCanBeMoved}\n checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}\n onPlaceDrop={(item, slotIndex, itemContainerType) => {\n if (onItemPlaceDrop)\n onItemPlaceDrop(item, slotIndex, itemContainerType);\n }}\n onOutsideDrop={(item, position) => {\n if (onItemOutsideDrop) onItemOutsideDrop(item, position);\n }}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n );\n });\n };\n\n return (\n <DraggableContainer\n title={'Equipments'}\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"330px\"\n cancelDrag=\".equipment-container-body\"\n scale={scale}\n initialPosition={initialPosition}\n onPositionChangeEnd={onPositionChangeEnd}\n onPositionChangeStart={onPositionChangeStart}\n >\n <EquipmentSetContainer className=\"equipment-container-body\">\n <EquipmentColumn>{onRenderEquipmentSlotRange(0, 3)}</EquipmentColumn>\n <EquipmentColumn>{onRenderEquipmentSlotRange(3, 7)}</EquipmentColumn>\n <EquipmentColumn>{onRenderEquipmentSlotRange(7, 10)}</EquipmentColumn>\n </EquipmentSetContainer>\n </DraggableContainer>\n );\n};\n\nconst EquipmentSetContainer = styled.div`\n width: inherit;\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n flex-direction: row;\n touch-action: none;\n`;\n\nconst EquipmentColumn = styled.div`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n flex-direction: column;\n touch-action: none;\n`;\n","import { isMobileOrTablet } from '@rpg-engine/shared';\n\nexport const IS_MOBILE_OR_TABLET = isMobileOrTablet();\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n text: string;\n onFinish?: () => void;\n onStart?: () => void;\n}\n\nexport const DynamicText: React.FC<IProps> = ({ text, onFinish, onStart }) => {\n const [textState, setTextState] = useState<string>('');\n\n useEffect(() => {\n let i = 0;\n const interval = setInterval(() => {\n // on every interval, show one more character\n\n if (i === 0) {\n if (onStart) {\n onStart();\n }\n }\n\n if (i < text.length) {\n setTextState(text.substring(0, i + 1));\n i++;\n } else {\n clearInterval(interval);\n if (onFinish) {\n onFinish();\n }\n }\n }, 50);\n\n return () => {\n clearInterval(interval);\n };\n }, [text]);\n\n return <TextContainer>{textState}</TextContainer>;\n};\n\nconst TextContainer = styled.p`\n font-size: 0.7rem !important;\n color: white;\n text-shadow: 1px 1px 0px #000000;\n letter-spacing: 1.2px;\n word-break: normal;\n`;\n","import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { NPCDialogType } from '../..';\nimport { IS_MOBILE_OR_TABLET } from '../../constants/uiDevices';\nimport { chunkString } from '../../libs/StringHelpers';\nimport { DynamicText } from '../typography/DynamicText';\nimport pressButtonGif from './img/press-button.gif';\nimport pressSpaceGif from './img/space.gif';\n\ninterface IProps {\n text: string;\n onClose: () => void;\n onEndStep?: () => void;\n onStartStep?: () => void;\n type?: NPCDialogType;\n}\n\nexport const NPCDialogText: React.FC<IProps> = ({\n text,\n onClose,\n onEndStep,\n onStartStep,\n type,\n}) => {\n const windowSize = useRef([window.innerWidth, window.innerHeight]);\n function maxCharacters(width: number) {\n // Set the font size to 16 pixels\n var fontSize = 11.2;\n\n // Calculate the number of characters that can fit in one line\n var charactersPerLine = Math.floor(width / 2 / fontSize);\n\n // Calculate the number of lines that can fit in the div\n var linesPerDiv = Math.floor(180 / fontSize);\n\n // Calculate the maximum number of characters that can fit in the div\n var maxCharacters = charactersPerLine * linesPerDiv;\n\n // Return the maximum number of characters\n return Math.round(maxCharacters / 5);\n }\n\n const textChunks = chunkString(text, maxCharacters(windowSize.current[0]));\n\n const [chunkIndex, setChunkIndex] = useState<number>(0);\n const onHandleSpacePress = (event: KeyboardEvent) => {\n if (event.code === 'Space') {\n goToNextStep();\n }\n };\n\n const goToNextStep = () => {\n const hasNextChunk = textChunks?.[chunkIndex + 1] || false;\n\n if (hasNextChunk) {\n setChunkIndex(prev => prev + 1);\n } else {\n // if there's no more text chunks, close the dialog\n onClose();\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onHandleSpacePress);\n\n return () => document.removeEventListener('keydown', onHandleSpacePress);\n }, [chunkIndex]);\n\n const [showGoNextIndicator, setShowGoNextIndicator] = useState<boolean>(\n false\n );\n\n return (\n <Container>\n <DynamicText\n text={textChunks?.[chunkIndex] || ''}\n onFinish={() => {\n setShowGoNextIndicator(true);\n\n onEndStep && onEndStep();\n }}\n onStart={() => {\n setShowGoNextIndicator(false);\n\n onStartStep && onStartStep();\n }}\n />\n {showGoNextIndicator && (\n <PressSpaceIndicator\n right={type === NPCDialogType.TextOnly ? '1rem' : '10.5rem'}\n src={IS_MOBILE_OR_TABLET ? pressButtonGif : pressSpaceGif}\n onPointerDown={() => {\n goToNextStep();\n }}\n />\n )}\n </Container>\n );\n};\n\nconst Container = styled.div``;\n\ninterface IPressSpaceIndicatorProps {\n right: string;\n}\n\nconst PressSpaceIndicator = styled.img<IPressSpaceIndicatorProps>`\n position: absolute;\n right: ${({ right }) => right};\n bottom: 1rem;\n height: 20.7px;\n image-rendering: -webkit-optimize-contrast;\n`;\n","export const chunkString = (str: string, length: number) => {\n return str.match(new RegExp('.{1,' + length + '}', 'g'));\n};\n","import React from 'react';\n\n//@ts-ignore\nexport const useEventListener = (type, handler, el = window) => {\n const savedHandler = React.useRef();\n\n React.useEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n\n React.useEffect(() => {\n //@ts-ignore\n const listener = e => savedHandler.current(e);\n\n el.addEventListener(type, listener);\n\n return () => {\n el.removeEventListener(type, listener);\n };\n }, [type, el]);\n};\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { useEventListener } from '../../../hooks/useEventListener';\nimport { DynamicText } from '../../typography/DynamicText';\n\nexport interface IQuestionDialogAnswer {\n id: number;\n text: string;\n nextQuestionId?: number;\n}\n\nexport interface IQuestionDialog {\n id: number;\n text: string;\n answerIds?: number[];\n}\n\nexport interface IProps {\n questions: IQuestionDialog[];\n answers: IQuestionDialogAnswer[];\n onClose: () => void;\n}\n\nexport const QuestionDialog: React.FC<IProps> = ({\n questions,\n answers,\n onClose,\n}) => {\n const [currentQuestion, setCurrentQuestion] = useState(questions[0]);\n\n const [canShowAnswers, setCanShowAnswers] = useState<boolean>(false);\n\n const onGetFirstAnswer = () => {\n if (!currentQuestion.answerIds || currentQuestion.answerIds.length === 0) {\n return null;\n }\n\n const firstAnswerId = currentQuestion.answerIds![0];\n\n return answers.find(answer => answer.id === firstAnswerId);\n };\n\n const [\n currentAnswer,\n setCurrentAnswer,\n ] = useState<IQuestionDialogAnswer | null>(onGetFirstAnswer()!);\n\n useEffect(() => {\n setCurrentAnswer(onGetFirstAnswer()!);\n }, [currentQuestion]);\n\n const onGetAnswers = (answerIds: number[]) => {\n return answerIds.map((answerId: number) =>\n answers.find(answer => answer.id === answerId)\n );\n };\n\n const onKeyPress = (e: KeyboardEvent) => {\n switch (e.key) {\n case 'ArrowDown':\n // select next answer, if any.\n // if no next answer, select first answer\n // const nextAnswer = onGetAnswers(currentQuestion.answerIds!).find(\n // (answer) => answer?.id === currentAnswer!.id + 1\n // );\n\n const nextAnswerIndex = onGetAnswers(\n currentQuestion.answerIds!\n ).findIndex(answer => answer?.id === currentAnswer!.id + 1);\n\n const nextAnswerID = currentQuestion.answerIds![nextAnswerIndex];\n\n const nextAnswer = onGetAnswers(currentQuestion.answerIds!).find(\n answer => answer?.id === nextAnswerID\n );\n\n setCurrentAnswer(nextAnswer || onGetFirstAnswer()!);\n\n break;\n case 'ArrowUp':\n // select previous answer, if any.\n // if no previous answer, select last answer\n\n const previousAnswerIndex = onGetAnswers(\n currentQuestion.answerIds!\n ).findIndex(answer => answer?.id === currentAnswer!.id - 1);\n\n const previousAnswerID =\n currentQuestion.answerIds &&\n currentQuestion.answerIds[previousAnswerIndex];\n\n const previousAnswer = onGetAnswers(currentQuestion.answerIds!).find(\n answer => answer?.id === previousAnswerID\n );\n\n if (previousAnswer) {\n setCurrentAnswer(previousAnswer);\n } else {\n setCurrentAnswer(onGetAnswers(currentQuestion.answerIds!).pop()!);\n }\n\n break;\n case 'Enter':\n setCanShowAnswers(false);\n\n if (!currentAnswer?.nextQuestionId) {\n onClose();\n return;\n } else {\n setCurrentQuestion(\n questions.find(\n question => question.id === currentAnswer!.nextQuestionId\n )!\n );\n }\n\n break;\n }\n };\n useEventListener('keydown', onKeyPress);\n\n const onAnswerClick = (answer: IQuestionDialogAnswer) => {\n setCanShowAnswers(false);\n if (answer.nextQuestionId) {\n // if there is a next question, go to it\n setCurrentQuestion(\n questions.find(question => question.id === answer.nextQuestionId)!\n );\n } else {\n // else, finish dialog!\n onClose();\n }\n };\n\n const onRenderCurrentAnswers = () => {\n const answerIds = currentQuestion.answerIds;\n if (!answerIds) {\n return null;\n }\n\n const answers = onGetAnswers(answerIds);\n\n if (!answers) {\n return null;\n }\n\n return answers.map(answer => {\n const isSelected = currentAnswer?.id === answer?.id;\n const selectedColor = isSelected ? 'yellow' : 'white';\n\n if (answer) {\n return (\n <AnswerRow key={`answer_${answer.id}`}>\n <AnswerSelectedIcon color={selectedColor}>\n {isSelected ? 'X' : null}\n </AnswerSelectedIcon>\n\n <Answer\n key={answer.id}\n onPointerDown={() => onAnswerClick(answer)}\n color={selectedColor}\n >\n {answer.text}\n </Answer>\n </AnswerRow>\n );\n }\n\n return null;\n });\n };\n\n return (\n <Container>\n <QuestionContainer>\n <DynamicText\n text={currentQuestion.text}\n onStart={() => setCanShowAnswers(false)}\n onFinish={() => setCanShowAnswers(true)}\n />\n </QuestionContainer>\n\n {canShowAnswers && (\n <AnswersContainer>{onRenderCurrentAnswers()}</AnswersContainer>\n )}\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n word-break: break-all;\n box-sizing: border-box;\n justify-content: flex-start;\n align-items: flex-start;\n flex-wrap: wrap;\n`;\n\nconst QuestionContainer = styled.div`\n flex: 100%;\n width: 100%;\n`;\n\nconst AnswersContainer = styled.div`\n flex: 100%;\n`;\n\ninterface IAnswerProps {\n color: string;\n}\n\nconst Answer = styled.p<IAnswerProps>`\n flex: auto;\n color: ${props => props.color} !important;\n font-size: 0.65rem !important;\n background: inherit;\n border: none;\n`;\n\nconst AnswerSelectedIcon = styled.span<IAnswerProps>`\n flex: 5% 0 0;\n color: ${props => props.color} !important;\n`;\n\nconst AnswerRow = styled.div`\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n margin-bottom: 0.5rem;\n height: 22px;\n p {\n line-height: unset;\n margin-top: 0;\n margin-bottom: 0rem;\n }\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\nimport pressSpaceGif from './img/space.gif';\nimport { NPCDialogText } from './NPCDialogText';\n\nexport enum ImgSide {\n right = 'right',\n left = 'left',\n}\n\nexport interface NPCMultiDialogType {\n text: string;\n imagePath?: string;\n imageSide: ImgSide;\n}\n\nexport interface INPCMultiDialogProps {\n onClose: () => void;\n textAndTypeArray: NPCMultiDialogType[];\n}\n\nexport const NPCMultiDialog: React.FC<INPCMultiDialogProps> = ({\n onClose,\n textAndTypeArray,\n}) => {\n const [showGoNextIndicator, setShowGoNextIndicator] = useState<boolean>(\n false\n );\n const [slide, setSlide] = useState<number>(0);\n\n const onHandleSpacePress = (event: KeyboardEvent) => {\n if (event.code === 'Space') {\n if (slide < textAndTypeArray?.length - 1) {\n setSlide(prev => prev + 1);\n } else {\n // if there's no more text chunks, close the dialog\n onClose();\n }\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onHandleSpacePress);\n\n return () => document.removeEventListener('keydown', onHandleSpacePress);\n }, [slide]);\n\n return (\n <RPGUIContainer\n type={RPGUIContainerTypes.FramedGold}\n width={'50%'}\n height={'180px'}\n >\n <>\n <Container>\n {textAndTypeArray[slide]?.imageSide === 'right' && (\n <>\n <TextContainer flex={'70%'}>\n <NPCDialogText\n onStartStep={() => setShowGoNextIndicator(false)}\n onEndStep={() => setShowGoNextIndicator(true)}\n text={textAndTypeArray[slide].text || 'No text provided.'}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n <ThumbnailContainer>\n <NPCThumbnail\n src={\n textAndTypeArray[slide].imagePath || aliceDefaultThumbnail\n }\n />\n </ThumbnailContainer>\n {showGoNextIndicator && (\n <PressSpaceIndicator right={'10.5rem'} src={pressSpaceGif} />\n )}\n </>\n )}\n {textAndTypeArray[slide].imageSide === 'left' && (\n <>\n <ThumbnailContainer>\n <NPCThumbnail\n src={\n textAndTypeArray[slide].imagePath || aliceDefaultThumbnail\n }\n />\n </ThumbnailContainer>\n <TextContainer flex={'70%'}>\n <NPCDialogText\n onStartStep={() => setShowGoNextIndicator(false)}\n onEndStep={() => setShowGoNextIndicator(true)}\n text={textAndTypeArray[slide].text || 'No text provided.'}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n {showGoNextIndicator && (\n <PressSpaceIndicator right={'1rem'} src={pressSpaceGif} />\n )}\n </>\n )}\n </Container>\n )\n </>\n </RPGUIContainer>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n width: 100%;\n height: 100%;\n\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n position: relative;\n`;\n\ninterface ITextContainerProps {\n flex: string;\n}\n\nconst TextContainer = styled.div<ITextContainerProps>`\n flex: ${({ flex }) => flex} 0 0;\n width: 355px;\n`;\n\nconst ThumbnailContainer = styled.div`\n flex: 30% 0 0;\n display: flex;\n justify-content: flex-end;\n`;\n\nconst NPCThumbnail = styled.img`\n image-rendering: pixelated;\n height: 128px;\n width: 128px;\n`;\n\ninterface IPressSpaceIndicatorProps {\n right: string;\n}\n\nconst PressSpaceIndicator = styled.img<IPressSpaceIndicatorProps>`\n position: absolute;\n right: ${({ right }) => right};\n bottom: 1rem;\n height: 20.7px;\n image-rendering: -webkit-optimize-contrast;\n`;\n","import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport enum RangeSliderType {\n Slider = 'rpgui-slider',\n GoldSlider = 'rpgui-slider golden',\n}\n\nexport interface IRangeSliderProps {\n type: RangeSliderType;\n valueMin: number;\n valueMax: number;\n width: string;\n onChange: (value: number) => void;\n value: number;\n}\n\nexport const RangeSlider: React.FC<IRangeSliderProps> = ({\n type,\n valueMin,\n valueMax,\n width,\n onChange,\n value,\n}) => {\n const sliderId = uuidv4();\n\n const containerRef = useRef<HTMLDivElement>(null);\n const [left, setLeft] = useState(0);\n\n useEffect(() => {\n const calculatedWidth = containerRef.current?.clientWidth || 0;\n setLeft(\n Math.max(\n ((value - valueMin) / (valueMax - valueMin)) * (calculatedWidth - 35) +\n 10\n )\n );\n }, [value, valueMin, valueMax]);\n\n const typeClass = type === RangeSliderType.GoldSlider ? 'golden' : '';\n\n return (\n <div\n style={{ width: width, position: 'relative' }}\n className={`rpgui-slider-container ${typeClass}`}\n id={`rpgui-slider-${sliderId}`}\n ref={containerRef}\n >\n <div style={{ pointerEvents: 'none' }}>\n <div className={`rpgui-slider-track ${typeClass}`} />\n <div className={`rpgui-slider-left-edge ${typeClass}`} />\n <div className={`rpgui-slider-right-edge ${typeClass}`} />\n <div className={`rpgui-slider-thumb ${typeClass}`} style={{ left }} />\n </div>\n <Input\n type=\"range\"\n style={{ width: width }}\n min={valueMin}\n max={valueMax}\n onChange={e => onChange(Number(e.target.value))}\n value={value}\n className=\"rpgui-cursor-point\"\n />\n </div>\n );\n};\n\nconst Input = styled.input`\n opacity: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n margin-top: -5px;\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { NPCDialog, NPCDialogType } from './NPCDialog/NPCDialog';\nimport { NPCMultiDialog, NPCMultiDialogType } from './NPCDialog/NPCMultiDialog';\nimport {\n IQuestionDialog,\n IQuestionDialogAnswer,\n QuestionDialog,\n} from './NPCDialog/QuestionDialog/QuestionDialog';\n\nexport interface IHistoryDialogProps {\n backgroundImgPath: string[];\n fullCoverBackground: boolean;\n questions?: IQuestionDialog[];\n answers?: IQuestionDialogAnswer[];\n text?: string;\n imagePath?: string;\n textAndTypeArray?: NPCMultiDialogType[];\n onClose: () => void;\n}\n\nexport const HistoryDialog: React.FC<IHistoryDialogProps> = ({\n backgroundImgPath,\n fullCoverBackground,\n questions,\n answers,\n text,\n imagePath,\n textAndTypeArray,\n onClose,\n}) => {\n const [img, setImage] = useState<number>(0);\n const onHandleSpacePress = (event: KeyboardEvent) => {\n if (event.code === 'Space') {\n if (img < backgroundImgPath?.length - 1) {\n setImage(prev => prev + 1);\n } else {\n // if there's no more text chunks, close the dialog\n onClose();\n }\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onHandleSpacePress);\n\n return () => document.removeEventListener('keydown', onHandleSpacePress);\n }, [backgroundImgPath]);\n return (\n <BackgroundContainer\n imgPath={backgroundImgPath[img]}\n fullImg={fullCoverBackground}\n >\n <DialogContainer>\n {textAndTypeArray ? (\n <NPCMultiDialog\n textAndTypeArray={textAndTypeArray}\n onClose={onClose}\n />\n ) : questions && answers ? (\n <QuestionDialog\n questions={questions}\n answers={answers}\n onClose={onClose}\n />\n ) : text && imagePath ? (\n <NPCDialog\n text={text}\n imagePath={imagePath}\n onClose={onClose}\n type={NPCDialogType.TextAndThumbnail}\n />\n ) : (\n <NPCDialog\n text={text}\n onClose={onClose}\n type={NPCDialogType.TextOnly}\n />\n )}\n </DialogContainer>\n </BackgroundContainer>\n );\n};\n\ninterface IImgContainerProps {\n imgPath: string;\n fullImg: boolean;\n}\n\nconst BackgroundContainer = styled.div<IImgContainerProps>`\n width: 100%;\n height: 100%;\n background-image: url(${props => props.imgPath});\n background-size: ${props => (props.imgPath ? 'cover' : 'auto')};\n display: flex;\n justify-content: space-evenly;\n align-items: center;\n`;\n\nconst DialogContainer = styled.div`\n display: flex;\n justify-content: center;\n padding-top: 200px;\n`;\n","import React from 'react';\nimport { IPosition } from '../../types/eventTypes';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\n\ninterface IProps {\n children: React.ReactNode;\n title: string;\n onClose?: () => void;\n onPositionChange?: (position: IPosition) => void;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n onOutsideClick?: () => void;\n initialPosition?: IPosition;\n scale?: number;\n}\n\nexport const SlotsContainer: React.FC<IProps> = ({\n children,\n title,\n onClose,\n onPositionChange,\n onPositionChangeEnd,\n onPositionChangeStart,\n onOutsideClick,\n initialPosition,\n scale,\n}) => {\n return (\n <DraggableContainer\n title={title}\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n width=\"400px\"\n cancelDrag=\".item-container-body, #shortcuts_list\"\n onPositionChange={({ x, y }) => {\n if (onPositionChange) {\n onPositionChange({ x, y });\n }\n }}\n onPositionChangeEnd={({ x, y }) => {\n if (onPositionChangeEnd) {\n onPositionChangeEnd({ x, y });\n }\n }}\n onPositionChangeStart={({ x, y }) => {\n if (onPositionChangeStart) {\n onPositionChangeStart({ x, y });\n }\n }}\n onOutsideClick={onOutsideClick}\n initialPosition={initialPosition}\n scale={scale}\n >\n {children}\n </DraggableContainer>\n );\n};\n","import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../../Button';\nimport { Input } from '../../Input';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../../RPGUIContainer';\nimport { RangeSlider, RangeSliderType } from '../../RangeSlider';\n\nexport interface IItemQuantitySelectorProps {\n quantity: number;\n onConfirm: (quantity: number) => void;\n onClose: () => void;\n}\n\nexport const ItemQuantitySelector: React.FC<IItemQuantitySelectorProps> = ({\n quantity,\n onConfirm,\n onClose,\n}) => {\n const [value, setValue] = useState(quantity);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n\n const closeSelector = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose();\n }\n };\n\n document.addEventListener('keydown', closeSelector);\n\n return () => {\n document.removeEventListener('keydown', closeSelector);\n };\n }\n\n return () => {};\n }, []);\n\n return (\n <StyledContainer type={RPGUIContainerTypes.Framed} width=\"25rem\">\n <CloseButton className=\"container-close\" onPointerDown={onClose}>\n X\n </CloseButton>\n <h2>Select quantity to move</h2>\n <StyledForm\n style={{ width: '100%' }}\n onSubmit={e => {\n e.preventDefault();\n\n const numberValue = Number(value);\n\n if (Number.isNaN(numberValue)) {\n return;\n }\n\n onConfirm(Math.max(1, Math.min(quantity, numberValue)));\n }}\n noValidate\n >\n <StyledInput\n innerRef={inputRef}\n placeholder=\"Enter quantity\"\n type=\"number\"\n min={1}\n max={quantity}\n value={value}\n onChange={e => {\n if (Number(e.target.value) >= quantity) {\n setValue(quantity);\n return;\n }\n\n setValue((e.target.value as unknown) as number);\n }}\n onBlur={e => {\n const newValue = Math.max(\n 1,\n Math.min(quantity, Number(e.target.value))\n );\n\n setValue(newValue);\n }}\n />\n <RangeSlider\n type={RangeSliderType.Slider}\n valueMin={1}\n valueMax={quantity}\n width=\"100%\"\n onChange={setValue}\n value={value}\n />\n <Button buttonType={ButtonTypes.RPGUIButton} type=\"submit\">\n Confirm\n </Button>\n </StyledForm>\n </StyledContainer>\n );\n};\n\nconst StyledContainer = styled(RPGUIContainer)`\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nconst StyledForm = styled.form`\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n`;\nconst StyledInput = styled(Input)`\n text-align: center;\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n &[type='number'] {\n -moz-appearance: textfield;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 3px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 0.8rem;\n`;\n","import {\n getItemTextureKeyPath,\n IItem,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\ntype ShortcutsSetterProps = {\n setSettingShortcutIndex: (index: number) => void;\n settingShortcutIndex: number;\n shortcuts: IShortcut[];\n removeShortcut: (index: number) => void;\n atlasJSON: any;\n atlasIMG: any;\n};\n\nexport const ShortcutsSetter: React.FC<ShortcutsSetterProps> = ({\n setSettingShortcutIndex,\n settingShortcutIndex,\n shortcuts,\n removeShortcut,\n atlasJSON,\n atlasIMG,\n}) => {\n const getContent = (index: number) => {\n if (shortcuts[index]?.type === ShortcutType.Item) {\n const payload = shortcuts[index]?.payload as IItem | undefined;\n\n if (!payload) return null;\n\n return (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: payload.texturePath,\n texturePath: payload.texturePath,\n stackQty: payload.stackQty || 1,\n isStackable: payload.isStackable,\n },\n atlasJSON\n )}\n width={32}\n height={32}\n imgScale={1.6}\n imgStyle={{ left: '5px' }}\n />\n );\n }\n\n const payload = shortcuts[index]?.payload as IRawSpell | undefined;\n\n return <span>{payload?.magicWords.split(' ').map(word => word[0])}</span>;\n };\n\n return (\n <Container>\n <p>Shortcuts:</p>\n <List id=\"shortcuts_list\">\n {Array.from({ length: 6 }).map((_, i) => (\n <Shortcut\n key={i}\n onPointerDown={() => {\n if (settingShortcutIndex !== -1) setSettingShortcutIndex(-1);\n\n removeShortcut(i);\n if (\n settingShortcutIndex === -1 &&\n (!shortcuts[i] || shortcuts[i].type === ShortcutType.None)\n )\n setSettingShortcutIndex(i);\n }}\n disabled={settingShortcutIndex !== -1 && settingShortcutIndex !== i}\n isBeingSet={settingShortcutIndex === i}\n id={`shortcutSetter_${i}`}\n >\n {getContent(i)}\n </Shortcut>\n ))}\n </List>\n </Container>\n );\n};\n\nconst Container = styled.div`\n p {\n margin: 0;\n margin-left: 0.5rem;\n }\n`;\n\nconst Shortcut = styled.button<{ isBeingSet?: boolean }>`\n width: 2.6rem;\n height: 2.6rem;\n background-color: ${uiColors.lightGray};\n border: 2px solid\n ${({ isBeingSet }) => (isBeingSet ? uiColors.yellow : uiColors.darkGray)};\n border-radius: 50%;\n text-transform: uppercase;\n font-size: 0.7rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n\n span {\n margin-top: 4px;\n }\n\n &:hover,\n &:focus {\n background-color: ${uiColors.darkGray};\n }\n\n &:active {\n background-color: ${uiColors.gray};\n }\n\n &:disabled {\n opacity: 0.5;\n }\n`;\n\nconst List = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding-bottom: 0.5rem;\n padding-left: 0.5rem;\n box-sizing: border-box;\n margin: 0 !important;\n`;\n","import {\n IEquipmentSet,\n IItem,\n IItemContainer,\n IShortcut,\n ItemContainerType,\n ItemType,\n} from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { SlotsContainer } from '../../Abstractions/SlotsContainer';\nimport { ItemQuantitySelector } from './ItemQuantitySelector';\n\nimport { IPosition } from '../../../types/eventTypes';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { ShortcutsSetter } from '../../Shortcuts/ShortcutsSetter';\nimport { ItemSlot } from './ItemSlot';\n\nexport interface IItemContainerProps {\n itemContainer: IItemContainer;\n onClose?: () => void;\n onItemClick?: (\n item: IItem,\n ItemType: IItem['type'],\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragStart?: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragEnd?: (quantity?: number) => void;\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\n onItemPlaceDrop?: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n scale?: number;\n checkIfItemCanBeMoved: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;\n onSelected?: (optionId: string, item: IItem) => void;\n type: ItemContainerType;\n atlasJSON: any;\n atlasIMG: any;\n disableContextMenu?: boolean;\n initialPosition?: { x: number; y: number };\n shortcuts?: IShortcut[];\n setItemShortcut?: (key: string, index: number) => void;\n removeShortcut?: (index: number) => void;\n equipmentSet?: IEquipmentSet | null;\n isDepotSystem?: boolean;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n}\n\nexport const ItemContainer: React.FC<IItemContainerProps> = ({\n itemContainer,\n onClose,\n onMouseOver,\n onSelected,\n onItemClick,\n type,\n atlasJSON,\n atlasIMG,\n disableContextMenu = false,\n onItemDragEnd,\n onItemDragStart,\n onItemPlaceDrop,\n onOutsideDrop,\n checkIfItemCanBeMoved,\n initialPosition,\n checkIfItemShouldDragEnd,\n scale,\n shortcuts,\n setItemShortcut,\n removeShortcut,\n equipmentSet,\n isDepotSystem,\n onPositionChangeEnd,\n onPositionChangeStart,\n}) => {\n const [quantitySelect, setQuantitySelect] = useState({\n isOpen: false,\n maxQuantity: 1,\n callback: (_quantity: number) => {},\n });\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\n\n const handleSetShortcut = (item: IItem, index: number) => {\n if (item.type === ItemType.Consumable || item.type === ItemType.Tool) {\n setItemShortcut?.(item.key, index);\n }\n };\n\n const onRenderSlots = () => {\n const slots = [];\n\n for (let i = 0; i < itemContainer.slotQty; i++) {\n slots.push(\n <ItemSlot\n isContextMenuDisabled={disableContextMenu}\n key={i}\n slotIndex={i}\n item={itemContainer.slots?.[i] || null}\n itemContainerType={type}\n onMouseOver={(event, slotIndex, item) => {\n if (onMouseOver) onMouseOver(event, slotIndex, item);\n }}\n onPointerDown={(itemType, containerType, item) => {\n if (settingShortcutIndex !== -1) {\n setSettingShortcutIndex(-1);\n\n handleSetShortcut(item, settingShortcutIndex);\n } else if (onItemClick) onItemClick(item, itemType, containerType);\n }}\n onSelected={(optionId: string, item: IItem) => {\n if (onSelected) onSelected(optionId, item);\n }}\n onDragStart={(item, slotIndex, itemContainerType) => {\n if (onItemDragStart)\n onItemDragStart(item, slotIndex, itemContainerType);\n }}\n onDragEnd={quantity => {\n if (onItemDragEnd) onItemDragEnd(quantity);\n }}\n dragScale={scale}\n checkIfItemCanBeMoved={checkIfItemCanBeMoved}\n checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}\n openQuantitySelector={(maxQuantity, callback) => {\n setQuantitySelect({\n isOpen: true,\n maxQuantity,\n callback,\n });\n }}\n onPlaceDrop={(item, slotIndex, itemContainerType) => {\n if (onItemPlaceDrop)\n onItemPlaceDrop(item, slotIndex, itemContainerType);\n }}\n onOutsideDrop={(item, position) => {\n if (onOutsideDrop) onOutsideDrop(item, position);\n }}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n isSelectingShortcut={settingShortcutIndex !== -1}\n equipmentSet={equipmentSet}\n setItemShortcut={\n type === ItemContainerType.Inventory ? handleSetShortcut : undefined\n }\n isDepotSystem={isDepotSystem}\n />\n );\n }\n return slots;\n };\n\n return (\n <>\n <SlotsContainer\n title={itemContainer.name || 'Container'}\n onClose={onClose}\n initialPosition={initialPosition}\n scale={scale}\n onPositionChangeEnd={onPositionChangeEnd}\n onPositionChangeStart={onPositionChangeStart}\n >\n {type === ItemContainerType.Inventory &&\n shortcuts &&\n removeShortcut && (\n <ShortcutsSetter\n setSettingShortcutIndex={setSettingShortcutIndex}\n settingShortcutIndex={settingShortcutIndex}\n shortcuts={shortcuts}\n removeShortcut={removeShortcut}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n )}\n <ItemsContainer className=\"item-container-body\">\n {onRenderSlots()}\n </ItemsContainer>\n </SlotsContainer>\n {quantitySelect.isOpen && (\n <ModalPortal>\n <QuantitySelectorContainer>\n <ItemQuantitySelector\n quantity={quantitySelect.maxQuantity}\n onConfirm={quantity => {\n quantitySelect.callback(quantity);\n setQuantitySelect({\n isOpen: false,\n maxQuantity: 1,\n callback: () => {},\n });\n }}\n onClose={() => {\n quantitySelect.callback(-1);\n setQuantitySelect({\n isOpen: false,\n maxQuantity: 1,\n callback: () => {},\n });\n }}\n />\n </QuantitySelectorContainer>\n </ModalPortal>\n )}\n </>\n );\n};\n\nconst ItemsContainer = styled.div`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n`;\n\nconst QuantitySelectorContainer = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n z-index: 100;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(0, 0, 0, 0.5);\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nexport interface IOptionsItemSelectorProps {\n name: string;\n description?: string;\n imageKey: string;\n}\n\nexport interface IItemSelectorProps {\n atlasJSON: any;\n atlasIMG: any;\n options: IOptionsItemSelectorProps[];\n onClose: () => void;\n onSelect: (value: string) => void;\n}\n\nexport const ItemSelector: React.FC<IItemSelectorProps> = ({\n atlasIMG,\n atlasJSON,\n options,\n onClose,\n onSelect,\n}) => {\n const [selectedValue, setSelectedValue] = useState<string>();\n\n const handleClick = () => {\n let element = document.querySelector(\n `input[name='test']:checked`\n ) as HTMLInputElement;\n const elementValue = element.value;\n setSelectedValue(elementValue);\n };\n\n useEffect(() => {\n if (selectedValue) {\n onSelect(selectedValue);\n }\n }, [selectedValue]);\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n width=\"500px\"\n cancelDrag=\".equipment-container-body .arrow-selector\"\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n >\n <div style={{ width: '100%' }}>\n <Title>{'Harvesting instruments'}</Title>\n <Subtitle>{'Use the tool, you need it'}</Subtitle>\n <hr className=\"golden\" />\n </div>\n\n <RadioInputScroller>\n {options?.map((option, index) => (\n <RadioOptionsWrapper key={index}>\n <SpriteAtlasWrapper>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={option.imageKey}\n imgScale={3}\n />\n </SpriteAtlasWrapper>\n <div>\n <input\n className=\"rpgui-radio\"\n type=\"radio\"\n value={option.name}\n name=\"test\"\n />\n <label\n onPointerDown={handleClick}\n style={{ display: 'flex', alignItems: 'center' }}\n >\n {option.name} <br />\n {option.description}\n </label>\n </div>\n </RadioOptionsWrapper>\n ))}\n </RadioInputScroller>\n <ButtonWrapper>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n <Button buttonType={ButtonTypes.RPGUIButton}>Select</Button>\n </ButtonWrapper>\n </DraggableContainer>\n );\n};\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: yellow !important;\n`;\nconst Subtitle = styled.h1`\n font-size: 0.4rem;\n color: yellow !important;\n`;\n\nconst RadioInputScroller = styled.div`\n padding-left: 15px;\n padding-top: 10px;\n width: 100%;\n margin-top: 1rem;\n align-items: center;\n margin-left: 20px;\n align-items: flex-start;\n overflow-y: scroll;\n height: 360px;\n`;\n\nconst SpriteAtlasWrapper = styled.div`\n margin-right: 40px;\n`;\n\nconst RadioOptionsWrapper = styled.div`\n display: flex;\n align-items: stretch;\n margin-bottom: 40px;\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n padding-top: 20px;\n width: 100%;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface IListMenuProps {\n x: number;\n y: number;\n options: IListMenuOption[];\n onSelected: (selectedOptionId: string) => void;\n}\n\nexport const ListMenu: React.FC<IListMenuProps> = ({\n options,\n onSelected,\n x,\n y,\n}) => {\n return (\n <Container x={x} y={y}>\n <ul className=\"rpgui-list-imp\" style={{ overflow: 'hidden' }}>\n {options.map((params, index) => (\n <ListElement\n key={params?.id || index}\n onPointerDown={() => {\n onSelected(params?.id);\n }}\n >\n {params?.text || 'No text'}\n </ListElement>\n ))}\n </ul>\n </Container>\n );\n};\n\ninterface IContainerProps {\n x?: number;\n y?: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n display: flex;\n flex-direction: column;\n width: 100%;\n justify-content: start;\n align-items: flex-start;\n position: absolute;\n top: ${props => props.y || 0}px;\n left: ${props => props.x || 0}px;\n\n li {\n font-size: ${uiFonts.size.xsmall};\n }\n`;\n\nconst ListElement = styled.li`\n margin-right: 0.5rem;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\n\nexport interface IBarProps {\n max: number;\n value: number;\n color: 'red' | 'blue' | 'green';\n style?: Record<string, any>;\n displayText?: boolean;\n percentageWidth?: number;\n minWidth?: number;\n}\n\nexport const ProgressBar: React.FC<IBarProps> = ({\n max,\n value,\n color,\n displayText = true,\n percentageWidth = 40,\n minWidth = 100,\n style,\n}) => {\n const calculatePercentageValue = function(max: number, value: number) {\n if (value > max) {\n value = max;\n }\n return (value * 100) / max;\n };\n\n return (\n <Container\n className=\"rpgui-progress\"\n data-value={calculatePercentageValue(max, value) / 100}\n data-rpguitype=\"progress\"\n percentageWidth={percentageWidth}\n minWidth={minWidth}\n style={style}\n >\n {displayText && (\n <TextOverlay>\n <ProgressBarText>\n {value}/{max}\n </ProgressBarText>\n </TextOverlay>\n )}\n <div className=\" rpgui-progress-track\">\n <div\n className={`rpgui-progress-fill ${color} `}\n style={{\n left: '0px',\n width: calculatePercentageValue(max, value) + '%',\n }}\n ></div>\n </div>\n <div className=\" rpgui-progress-left-edge\"></div>\n <div className=\" rpgui-progress-right-edge\"></div>\n </Container>\n );\n};\n\nconst ProgressBarText = styled.span`\n font-size: ${uiFonts.size.small} !important;\n color: white;\n text-align: center;\n z-index: 1;\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n top: 12px;\n`;\n\nconst TextOverlay = styled.div`\n width: 100%;\n position: relative;\n`;\n\ninterface IContainerProps {\n percentageWidth?: number;\n minWidth?: number;\n style?: Record<string, any>;\n}\n\nconst Container = styled.div<IContainerProps>`\n display: flex;\n flex-direction: column;\n min-width: ${props => props.minWidth}px;\n width: ${props => props.percentageWidth}%;\n justify-content: start;\n align-items: flex-start;\n ${props => props.style}\n`;\n","import { IQuest } from '@rpg-engine/shared';\nimport React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport SelectArrow from '../Arrow/SelectArrow';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\n\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { Column } from '../shared/Column';\nimport thumbnailDefault from './img/default.png';\n\nexport interface IQuestsButtonProps {\n disabled: boolean;\n title: string;\n onClick: (questId: string, npcId: string) => void;\n}\n\nexport interface IQuestInfoProps {\n onClose?: () => void;\n buttons?: IQuestsButtonProps[];\n quests: IQuest[];\n onChangeQuest: (currentQuestIndex: number, currentQuestId: string) => void;\n scale?: number;\n}\n\nexport const QuestInfo: React.FC<IQuestInfoProps> = ({\n quests,\n onClose,\n buttons,\n onChangeQuest,\n scale,\n}) => {\n const [currentIndex, setCurrentIndex] = useState(0);\n const questsLength = quests.length - 1;\n\n useEffect(() => {\n if (onChangeQuest) {\n onChangeQuest(currentIndex, quests[currentIndex]._id);\n }\n }, [currentIndex]);\n\n const onLeftClick = () => {\n if (currentIndex === 0) setCurrentIndex(questsLength);\n else setCurrentIndex(index => index - 1);\n };\n const onRightClick = () => {\n if (currentIndex === questsLength) setCurrentIndex(0);\n else setCurrentIndex(index => index + 1);\n };\n\n return (\n <QuestDraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"730px\"\n cancelDrag=\".equipment-container-body .arrow-selector\"\n scale={scale}\n >\n {quests.length >= 2 ? (\n <QuestsContainer>\n {currentIndex !== 0 && (\n <SelectArrow\n direction=\"left\"\n onPointerDown={onLeftClick}\n ></SelectArrow>\n )}\n {currentIndex !== quests.length - 1 && (\n <SelectArrow\n direction=\"right\"\n onPointerDown={onRightClick}\n ></SelectArrow>\n )}\n\n <QuestContainer>\n <TitleContainer className=\"drag-handler\">\n <Title>\n <Thumbnail\n src={quests[currentIndex].thumbnail || thumbnailDefault}\n />\n {quests[currentIndex].title}\n </Title>\n <QuestSplitDiv>\n <hr className=\"golden\" />\n </QuestSplitDiv>\n </TitleContainer>\n <Content>\n <p>{quests[currentIndex].description}</p>\n </Content>\n <QuestColumn className=\"dark-background\" justifyContent=\"flex-end\">\n {buttons &&\n buttons.map((button, index) => (\n <Button\n key={index}\n onPointerDown={() =>\n button.onClick(\n quests[currentIndex]._id,\n quests[currentIndex].npcId\n )\n }\n disabled={button.disabled}\n buttonType={ButtonTypes.RPGUIButton}\n id={`button-${index}`}\n >\n {button.title}\n </Button>\n ))}\n </QuestColumn>\n </QuestContainer>\n </QuestsContainer>\n ) : (\n <QuestsContainer>\n <QuestContainer>\n <TitleContainer className=\"drag-handler\">\n <Title>\n <Thumbnail src={quests[0].thumbnail || thumbnailDefault} />\n {quests[0].title}\n </Title>\n <QuestSplitDiv>\n <hr className=\"golden\" />\n </QuestSplitDiv>\n </TitleContainer>\n <Content>\n <p>{quests[0].description}</p>\n </Content>\n <QuestColumn className=\"dark-background\" justifyContent=\"flex-end\">\n {buttons &&\n buttons.map((button, index) => (\n <Button\n key={index}\n onPointerDown={() =>\n button.onClick(quests[0]._id, quests[0].npcId)\n }\n disabled={button.disabled}\n buttonType={ButtonTypes.RPGUIButton}\n id={`button-${index}`}\n >\n {button.title}\n </Button>\n ))}\n </QuestColumn>\n </QuestContainer>\n </QuestsContainer>\n )}\n </QuestDraggableContainer>\n );\n};\n\nconst QuestDraggableContainer = styled(DraggableContainer)`\n border: 1px solid black;\n width: 600px;\n padding: 0 0 0 0 !important;\n .DraggableContainer__TitleContainer-sc-184mpyl-2 {\n height: auto;\n }\n .container-close {\n position: absolute;\n margin-left: auto;\n top: 20px;\n padding-right: 5px;\n }\n img {\n display: inline-block;\n vertical-align: middle;\n line-height: normal;\n }\n`;\n\nconst QuestContainer = styled.div`\n margin-right: 40px;\n margin-left: 40px;\n`;\n\nconst QuestsContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst Content = styled.div`\n padding: 18px;\n h1 {\n text-align: left;\n margin: 14px 0px;\n }\n`;\n\nconst QuestSplitDiv = styled.div`\n width: 100%;\n font-size: 11px;\n margin-bottom: 10px;\n hr {\n margin: 0px;\n padding: 0px;\n }\n p {\n margin-bottom: 0px;\n }\n`;\n\nconst QuestColumn = styled(Column)`\n padding-top: 5px;\n margin-bottom: 20px;\n display: flex;\n justify-content: space-evenly;\n`;\n\nconst TitleContainer = styled.div`\n width: 100%;\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n margin-top: 1rem;\n`;\n\nconst Title = styled.h1`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.medium} !important;\n color: ${uiColors.yellow} !important;\n`;\n\nconst Thumbnail = styled.img`\n color: white;\n z-index: 22;\n width: 32px * 1.5;\n margin-right: 0.5rem;\n position: relative;\n top: -4px;\n`;\n","import { IQuest } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { DraggableContainer } from './DraggableContainer';\nimport { RPGUIContainerTypes } from './RPGUIContainer';\n\nexport interface IQuestListProps {\n quests?: IQuest[];\n onClose: () => void;\n scale?: number;\n}\n\nexport const QuestList: React.FC<IQuestListProps> = ({\n quests,\n onClose,\n scale,\n}) => {\n return (\n <QuestDraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"520px\"\n scale={scale}\n >\n <div style={{ width: '100%' }}>\n <Title>Quests</Title>\n <hr className=\"golden\" />\n\n <QuestListContainer>\n {quests ? (\n quests.map((quest, i) => (\n <div className=\"quest-item\" key={i}>\n <span className=\"quest-number\">{i + 1}</span>\n <div className=\"quest-detail\">\n <p className=\"quest-detail__title\">{quest.title}</p>\n <p className=\"quest-detail__description\">\n {quest.description}\n </p>\n </div>\n </div>\n ))\n ) : (\n <NoQuestContainer>\n <p>There are no ongoing quests</p>\n </NoQuestContainer>\n )}\n </QuestListContainer>\n </div>\n </QuestDraggableContainer>\n );\n};\n\nconst QuestDraggableContainer = styled(DraggableContainer)`\n .container-close {\n top: 10px;\n right: 10px;\n }\n\n .quest-title {\n text-align: left;\n margin-left: 44px;\n margin-top: 20px;\n color: yellow;\n }\n\n .quest-desc {\n margin-top: 12px;\n margin-left: 44px;\n }\n\n .rpgui-progress {\n min-width: 80%;\n margin: 0 auto;\n }\n`;\n\nconst Title = styled.h1`\n z-index: 22;\n font-size: ${uiFonts.size.medium} !important;\n color: yellow !important;\n`;\n\nconst QuestListContainer = styled.div`\n margin-top: 20px;\n margin-bottom: 40px;\n overflow-y: auto;\n max-height: 400px;\n\n .quest-item {\n display: flex;\n align-items: flex-start;\n margin-bottom: 12px;\n }\n\n .quest-number {\n border-radius: 50%;\n width: 28px;\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 16px;\n background-color: brown;\n flex-shrink: 0;\n }\n\n .quest-number.completed {\n background-color: yellow;\n }\n\n p {\n margin: 0;\n }\n\n .quest-detail__title {\n color: yellow;\n }\n\n .quest-detail__description {\n margin-top: 5px;\n }\n .Noquest-detail__description {\n margin-top: 5px;\n margin: auto;\n }\n`;\nconst NoQuestContainer = styled.div`\n text-align: center;\n p {\n margin-top: 5px;\n }\n`;\n","import React from 'react';\nimport 'rpgui/rpgui.min.css';\nimport 'rpgui/rpgui.min.js';\n\ninterface IProps {\n children: React.ReactNode;\n}\n\n//@ts-ignore\nexport const _RPGUI = RPGUI;\n\nexport const RPGUIRoot: React.FC<IProps> = ({ children }) => {\n return <div className=\"rpgui-content\">{children}</div>;\n};\n","import {\n getItemTextureKeyPath,\n IItem,\n IItemContainer,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SingleShortcut } from './SingleShortcut';\n\nexport type ShortcutsProps = {\n shortcuts: IShortcut[];\n onShortcutCast: (index: number) => void;\n mana: number;\n isBlockedCastingByKeyboard?: boolean;\n inventory?: IItemContainer | null;\n atlasJSON: any;\n atlasIMG: any;\n};\n\nexport const Shortcuts: React.FC<ShortcutsProps> = ({\n shortcuts,\n onShortcutCast,\n mana,\n isBlockedCastingByKeyboard = false,\n atlasJSON,\n atlasIMG,\n inventory,\n}) => {\n const shortcutsRefs = useRef<HTMLButtonElement[]>([]);\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (isBlockedCastingByKeyboard) return;\n\n const shortcutIndex = Number(e.key) - 1;\n if (shortcutIndex >= 0 && shortcutIndex <= 5) {\n onShortcutCast(shortcutIndex);\n shortcutsRefs.current[shortcutIndex]?.classList.add('active');\n setTimeout(() => {\n shortcutsRefs.current[shortcutIndex]?.classList.remove('active');\n }, 150);\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [shortcuts, isBlockedCastingByKeyboard]);\n\n return (\n <List>\n {Array.from({ length: 6 }).map((_, i) => {\n if (shortcuts[i]?.type === ShortcutType.Item) {\n const payload = shortcuts[i]?.payload as IItem | undefined;\n\n let itemsFromEquipment: (IItem | undefined | null)[] = [];\n\n if (inventory) {\n Object.keys(inventory.slots).forEach(i => {\n const index = parseInt(i);\n\n if (inventory.slots[index]?.key === payload?.key) {\n itemsFromEquipment.push(inventory.slots[index]);\n }\n });\n }\n\n const totalQty = itemsFromEquipment.reduce(\n (acc, item) => acc + (item?.stackQty || 1),\n 0\n );\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={onShortcutCast.bind(null, i)}\n disabled={false}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n {payload && (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: payload.texturePath,\n texturePath: payload.texturePath,\n stackQty: payload.stackQty || 1,\n isStackable: payload.isStackable,\n },\n atlasJSON\n )}\n width={32}\n height={32}\n />\n )}\n <span className=\"qty\">{totalQty}</span>\n <span className=\"keyboard\">{i + 1}</span>\n </StyledShortcut>\n );\n }\n\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={onShortcutCast.bind(null, i)}\n disabled={mana < (payload?.manaCost ?? 0)}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n <span className=\"mana\">{payload && payload.manaCost}</span>\n <span className=\"magicWords\">\n {payload?.magicWords.split(' ').map(word => word[0])}\n </span>\n <span className=\"keyboard\">{i + 1}</span>\n </StyledShortcut>\n );\n })}\n </List>\n );\n};\n\nconst StyledShortcut = styled(SingleShortcut)`\n transition: all 0.15s;\n\n &.active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n`;\n\nconst List = styled.p`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n box-sizing: border-box;\n margin: 0 !important;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nexport interface ISimpleProgressBarProps {\n value: number;\n bgColor?: string;\n margin?: number;\n}\n\nexport const SimpleProgressBar: React.FC<ISimpleProgressBarProps> = ({\n value,\n bgColor = 'red',\n margin = 20,\n}) => {\n return (\n <Container className=\"simple-progress-bar\">\n <ProgressBarContainer margin={margin}>\n <BackgroundBar>\n <Progress value={value} bgColor={bgColor} />\n </BackgroundBar>\n </ProgressBarContainer>\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n`;\n\nconst BackgroundBar = styled.span`\n background-color: rgba(0, 0, 0, 0.075);\n`;\n\ninterface ISimpleProgressBarThemeProps {\n value: number;\n bgColor: string;\n}\n\nconst Progress = styled.span`\n background-color: ${(props: ISimpleProgressBarThemeProps) => props.bgColor};\n width: ${(props: ISimpleProgressBarThemeProps) => props.value}%;\n`;\n\ninterface ISimpleProgressBarTheme2Props {\n margin: number;\n}\n\nconst ProgressBarContainer = styled.div`\n border-radius: 60px;\n border: 1px solid #282424;\n overflow: hidden;\n width: 100%;\n span {\n display: block;\n height: 100%;\n }\n height: 8px;\n margin-left: ${(props: ISimpleProgressBarTheme2Props) => props.margin}px;\n`;\n","import { getSPForLevel } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { ErrorBoundary } from './Item/Inventory/ErrorBoundary';\nimport { SpriteFromAtlas } from './shared/SpriteFromAtlas';\nimport { SimpleProgressBar } from './SimpleProgressBar';\n\nexport interface ISkillProgressBarProps {\n skillName: string;\n bgColor: string;\n level: number;\n skillPoints: number;\n skillPointsToNextLevel?: number;\n texturePath: string;\n showSkillPoints?: boolean;\n atlasJSON: any;\n atlasIMG: any;\n}\n\nexport const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({\n bgColor,\n skillName,\n level,\n skillPoints,\n skillPointsToNextLevel,\n texturePath,\n showSkillPoints = true,\n atlasIMG,\n atlasJSON,\n}) => {\n if (!skillPointsToNextLevel) {\n skillPointsToNextLevel = getSPForLevel(level + 1);\n }\n\n const nextLevelSPWillbe = skillPoints + skillPointsToNextLevel;\n\n const ratio = (skillPoints / nextLevelSPWillbe) * 100;\n\n return (\n <>\n <ProgressTitle>\n <TitleName>{skillName}</TitleName>\n <ValueDisplay>lv {level}</ValueDisplay>\n </ProgressTitle>\n <ProgressBody>\n <ProgressIconContainer>\n {atlasIMG && atlasJSON ? (\n <SpriteContainer>\n <ErrorBoundary>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={texturePath}\n imgScale={1}\n grayScale\n opacity={0.5}\n />\n </ErrorBoundary>\n </SpriteContainer>\n ) : (\n <></>\n )}\n </ProgressIconContainer>\n\n <ProgressBarContainer>\n <SimpleProgressBar value={ratio} bgColor={bgColor} />\n </ProgressBarContainer>\n </ProgressBody>\n {showSkillPoints && (\n <SkillDisplayContainer>\n <SkillPointsDisplay>\n {skillPoints}/{nextLevelSPWillbe}\n </SkillPointsDisplay>\n </SkillDisplayContainer>\n )}\n </>\n );\n};\n\nconst ProgressBarContainer = styled.div`\n position: relative;\n top: 8px;\n width: 100%;\n height: auto;\n`;\n\nconst SpriteContainer = styled.div`\n position: relative;\n top: -3px;\n left: 0;\n`;\n\nconst SkillDisplayContainer = styled.div`\n margin: 0 auto;\n\n p {\n margin: 0;\n }\n`;\n\nconst SkillPointsDisplay = styled.p`\n font-size: 0.6rem !important;\n font-weight: bold;\n text-align: center;\n`;\n\nconst TitleName = styled.span`\n margin-left: 5px;\n`;\n\nconst ValueDisplay = styled.span``;\n\nconst ProgressIconContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nconst ProgressBody = styled.div`\n display: flex;\n flex-direction: row;\n width: 100%;\n`;\n\nconst ProgressTitle = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n span {\n font-size: 0.6rem;\n }\n`;\n","import { ISkill, ISkillDetails } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../constants/uiColors';\nimport { DraggableContainer } from './DraggableContainer';\nimport { SkillProgressBar } from './SkillProgressBar';\n\nexport interface ISkillContainerProps {\n skill: ISkill;\n onCloseButton: () => void;\n atlasJSON: any;\n atlasIMG: any;\n scale?: number;\n}\n\nconst skillProps = {\n attributes: {\n color: uiColors.purple,\n values: {\n stamina: 'spell-icons/regenerate.png',\n magic: 'spell-icons/fireball.png',\n magicResistance: 'spell-icons/freeze.png',\n strength: 'spell-icons/enchanted-blow.png',\n resistance: 'spell-icons/magic-shield.png',\n dexterity: 'spell-icons/haste.png',\n },\n },\n combat: {\n color: uiColors.cardinal,\n values: {\n first: 'gloves/leather-gloves.png',\n club: 'maces/club.png',\n sword: 'swords/double-edged-sword.png',\n axe: 'axes/double-axe.png',\n distance: 'ranged-weapons/horse-bow.png',\n shielding: 'shields/studded-shield.png',\n dagger: 'daggers/dagger.png',\n },\n },\n crafting: {\n color: uiColors.blue,\n values: {\n fishing: 'foods/fish.png',\n mining: 'crafting-resources/iron-ingot.png',\n lumberjacking: 'crafting-resources/greater-wooden-log.png',\n blacksmithing: 'hammers/hammer.png',\n cooking: 'foods/chickens-meat.png',\n alchemy: 'potions/greater-mana-potion.png',\n },\n },\n};\n\ninterface SkillMap {\n [key: string]: string;\n}\n\nconst skillNameMap: SkillMap = {\n stamina: 'Stamina',\n magic: 'Magic',\n magicResistance: 'Magic Resistance',\n strength: 'Strength',\n resistance: 'Resistance',\n dexterity: 'Dexterity',\n first: 'Fist',\n club: 'Club',\n sword: 'Sword',\n axe: 'Axe',\n distance: 'Distance',\n shielding: 'Shielding',\n dagger: 'Dagger',\n fishing: 'Fishing',\n mining: 'Mining',\n lumberjacking: 'Lumberjacking',\n blacksmithing: 'Blacksmithing',\n cooking: 'Cooking',\n alchemy: 'Alchemy',\n};\n\nexport const SkillsContainer: React.FC<ISkillContainerProps> = ({\n onCloseButton,\n skill,\n atlasIMG,\n atlasJSON,\n scale,\n}) => {\n const onRenderSkillCategory = (\n category: 'attributes' | 'combat' | 'crafting'\n ) => {\n const skillCategory = skillProps[category];\n\n const skillCategoryColor = skillCategory.color;\n\n const output = [];\n\n for (const [key, value] of Object.entries(skillCategory.values)) {\n //@ts-ignore\n const skillDetails = (skill[key] as unknown) as ISkillDetails;\n\n output.push(\n <SkillProgressBar\n key={key}\n skillName={skillNameMap[key]}\n bgColor={skillCategoryColor}\n level={skillDetails.level || 0}\n skillPoints={Math.round(skillDetails.skillPoints) || 0}\n skillPointsToNextLevel={\n Math.round(skillDetails.skillPointsToNextLevel) || 0\n }\n texturePath={value}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n );\n }\n\n return output;\n };\n\n return (\n <SkillsDraggableContainer\n title=\"Skills\"\n cancelDrag=\"#skillsDiv\"\n scale={scale}\n >\n {onCloseButton && (\n <CloseButton onPointerDown={onCloseButton}>X</CloseButton>\n )}\n <SkillsContainerDiv id=\"skillsDiv\">\n <SkillSplitDiv>\n <p>General</p>\n <hr className=\"golden\" />\n\n <SkillProgressBar\n skillName={'Level'}\n bgColor={uiColors.navyBlue}\n level={Math.round(skill.level) || 0}\n skillPoints={Math.round(skill.experience) || 0}\n skillPointsToNextLevel={Math.round(skill.xpToNextLevel) || 0}\n texturePath={'swords/broad-sword.png'}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n <p>Combat Skills</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('combat')}\n\n <SkillSplitDiv>\n <p>Crafting Skills</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('crafting')}\n\n <SkillSplitDiv>\n <p>Basic Attributes</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('attributes')}\n </SkillsContainerDiv>\n </SkillsDraggableContainer>\n );\n};\n\nconst SkillsDraggableContainer = styled(DraggableContainer)`\n border: 1px solid black;\n width: 400px;\n height: 90%;\n .DraggableContainer__TitleContainer-sc-184mpyl-2 {\n width: auto;\n height: auto;\n }\n`;\n\nconst SkillsContainerDiv = styled.div`\n width: 100%;\n -webkit-overflow-y: scroll;\n overflow-y: scroll;\n height: 90%;\n padding-right: 10px;\n`;\n\nconst SkillSplitDiv = styled.div`\n width: 100%;\n font-size: 11px;\n hr {\n margin: 0;\n margin-bottom: 1rem;\n padding: 0px;\n }\n p {\n margin-bottom: 0px;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 2px;\n right: 2px;\n color: white;\n z-index: 22;\n font-size: 1.1rem;\n`;\n","import { IRawSpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\n\ninterface Props extends IRawSpell {\n charMana: number;\n charMagicLevel: number;\n onPointerDown?: (spellKey: string) => void;\n isSettingShortcut?: boolean;\n spellKey: string;\n}\n\nexport const Spell: React.FC<Props> = ({\n spellKey,\n name,\n description,\n magicWords,\n manaCost,\n charMana,\n charMagicLevel,\n onPointerDown,\n isSettingShortcut,\n minMagicLevelRequired,\n}) => {\n const disabled = isSettingShortcut\n ? charMagicLevel < minMagicLevelRequired\n : manaCost > charMana || charMagicLevel < minMagicLevelRequired;\n\n return (\n <Container\n disabled={disabled}\n onPointerDown={onPointerDown?.bind(null, spellKey)}\n isSettingShortcut={isSettingShortcut && !disabled}\n className=\"spell\"\n >\n {disabled && (\n <Overlay>\n {charMagicLevel < minMagicLevelRequired\n ? 'Low magic level'\n : manaCost > charMana && 'No mana'}\n </Overlay>\n )}\n <SpellImage>{magicWords.split(' ').map(word => word[0])}</SpellImage>\n <Info>\n <Title>\n <span>{name}</span>\n <span className=\"spell\">({magicWords})</span>\n </Title>\n <Description>{description}</Description>\n </Info>\n\n <Divider />\n <Cost>\n <span>Mana cost:</span>\n <span className=\"mana\">{manaCost}</span>\n </Cost>\n </Container>\n );\n};\n\nconst Container = styled.button<{ isSettingShortcut?: boolean }>`\n display: block;\n background: none;\n border: 2px solid transparent;\n border-radius: 1rem;\n width: 100%;\n display: flex;\n height: 5rem;\n gap: 1rem;\n align-items: center;\n padding: 0 1rem;\n text-align: left;\n position: relative;\n\n animation: ${({ isSettingShortcut }) =>\n isSettingShortcut ? 'border-color-change 1s infinite' : 'none'};\n\n @keyframes border-color-change {\n 0% {\n border-color: ${uiColors.yellow};\n }\n 50% {\n border-color: transparent;\n }\n 100% {\n border-color: ${uiColors.yellow};\n }\n }\n\n &:hover,\n &:focus {\n background-color: ${uiColors.darkGray};\n }\n\n &:active {\n background: none;\n }\n`;\n\nconst SpellImage = styled.div`\n width: 4rem;\n height: 4rem;\n font-size: ${uiFonts.size.xLarge};\n font-weight: bold;\n background-color: ${uiColors.darkGray};\n color: ${uiColors.lightGray};\n display: flex;\n justify-content: center;\n align-items: center;\n text-transform: uppercase;\n`;\n\nconst Info = styled.span`\n width: 0;\n flex: 1;\n`;\n\nconst Title = styled.p`\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n margin-bottom: 5px;\n margin: 0;\n\n span {\n font-size: ${uiFonts.size.medium} !important;\n font-weight: bold !important;\n color: ${uiColors.yellow} !important;\n margin-right: 0.5rem;\n }\n\n .spell {\n font-size: ${uiFonts.size.small} !important;\n font-weight: normal !important;\n color: ${uiColors.lightGray} !important;\n }\n`;\n\nconst Description = styled.div`\n font-size: ${uiFonts.size.small} !important;\n line-height: 1.1 !important;\n`;\n\nconst Divider = styled.div`\n width: 1px;\n height: 100%;\n margin: 0 1rem;\n background-color: ${uiColors.lightGray};\n`;\n\nconst Cost = styled.p`\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: 0.5rem;\n\n div {\n z-index: 1;\n }\n\n .mana {\n position: relative;\n font-size: ${uiFonts.size.medium};\n font-weight: bold;\n z-index: 1;\n\n &::after {\n position: absolute;\n content: '';\n top: 0;\n left: 0;\n background-color: ${uiColors.blue};\n width: 100%;\n height: 100%;\n border-radius: 50%;\n transform: scale(1.8);\n filter: blur(10px);\n z-index: -1;\n }\n }\n`;\n\nconst Overlay = styled.p`\n margin: 0 !important;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n color: ${uiColors.yellow};\n font-size: ${uiFonts.size.large} !important;\n font-weight: bold;\n z-index: 10;\n background-color: rgba(0 0 0 / 0.2);\n`;\n","import { IRawSpell, IShortcut } from '@rpg-engine/shared';\nimport React, { Fragment, useEffect, useMemo, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Input } from '../Input';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { ShortcutsSetter } from '../Shortcuts/ShortcutsSetter';\nimport { Spell } from './Spell';\n\nexport interface ISpellbookProps {\n onClose?: () => void;\n onInputFocus?: () => void;\n onInputBlur?: () => void;\n spells: IRawSpell[];\n magicLevel: number;\n mana: number;\n onSpellClick: (spellKey: string) => void;\n setSpellShortcut: (key: string, index: number) => void;\n shortcuts: IShortcut[];\n removeShortcut: (index: number) => void;\n atlasIMG: any;\n atlasJSON: any;\n scale?: number;\n}\n\nexport const Spellbook: React.FC<ISpellbookProps> = ({\n onClose,\n onInputFocus,\n onInputBlur,\n spells,\n magicLevel,\n mana,\n onSpellClick,\n setSpellShortcut,\n shortcuts,\n removeShortcut,\n atlasIMG,\n atlasJSON,\n scale,\n}) => {\n const [search, setSearch] = useState('');\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\n\n useEffect(() => {\n const handleEscapeClose = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose?.();\n }\n };\n\n document.addEventListener('keydown', handleEscapeClose);\n\n return () => {\n document.removeEventListener('keydown', handleEscapeClose);\n };\n }, [onClose]);\n\n const spellsToDisplay = useMemo(() => {\n return spells\n .sort((a, b) => {\n if (a.minMagicLevelRequired > b.minMagicLevelRequired) return 1;\n if (a.minMagicLevelRequired < b.minMagicLevelRequired) return -1;\n return 0;\n })\n .filter(\n spell =>\n spell.name.toLocaleLowerCase().includes(search.toLocaleLowerCase()) ||\n spell.magicWords\n .toLocaleLowerCase()\n .includes(search.toLocaleLowerCase())\n );\n }, [search, spells]);\n\n const setShortcut = (spellKey: string) => {\n setSpellShortcut?.(spellKey, settingShortcutIndex);\n setSettingShortcutIndex(-1);\n };\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={onClose}\n width=\"inherit\"\n height=\"inherit\"\n cancelDrag=\"#spellbook-search, #shortcuts_list, .spell\"\n scale={scale}\n >\n <Container>\n <Title>Learned Spells</Title>\n\n <ShortcutsSetter\n setSettingShortcutIndex={setSettingShortcutIndex}\n settingShortcutIndex={settingShortcutIndex}\n shortcuts={shortcuts}\n removeShortcut={removeShortcut}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n <Input\n placeholder=\"Search for spell\"\n value={search}\n onChange={e => setSearch(e.target.value)}\n onFocus={onInputFocus}\n onBlur={onInputBlur}\n id=\"spellbook-search\"\n />\n\n <SpellList>\n {spellsToDisplay.map(spell => (\n <Fragment key={spell.key}>\n <Spell\n charMana={mana}\n charMagicLevel={magicLevel}\n onPointerDown={\n settingShortcutIndex !== -1 ? setShortcut : onSpellClick\n }\n spellKey={spell.key}\n isSettingShortcut={settingShortcutIndex !== -1}\n {...spell}\n />\n </Fragment>\n ))}\n </SpellList>\n </Container>\n </DraggableContainer>\n );\n};\n\nconst Title = styled.h1`\n font-size: ${uiFonts.size.large} !important;\n margin-bottom: 0 !important;\n`;\n\nconst Container = styled.div`\n width: 100%;\n height: 100%;\n color: white;\n display: flex;\n flex-direction: column;\n`;\n\nconst SpellList = styled.div`\n width: 100%;\n min-height: 0;\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n margin-top: 1rem;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nimport { PeriodOfDay } from '@rpg-engine/shared';\nimport AfternoonGif from './gif/afternoon.gif';\nimport MorningGif from './gif/morning.gif';\nimport NightGif from './gif/night.gif';\n\nexport interface IPeriodOfDayDisplayProps {\n periodOfDay: PeriodOfDay;\n}\n\nexport const DayNightPeriod: React.FC<IPeriodOfDayDisplayProps> = ({\n periodOfDay,\n}) => {\n const periodOfDaySrcFiles = {\n [PeriodOfDay.Morning]: MorningGif,\n [PeriodOfDay.Afternoon]: AfternoonGif,\n [PeriodOfDay.Night]: NightGif,\n };\n\n return (\n <GifContainer>\n <img src={periodOfDaySrcFiles[periodOfDay]} />\n </GifContainer>\n );\n};\n\nconst GifContainer = styled.div`\n width: 100%;\n\n img {\n width: 67%;\n }\n`;\n","import { PeriodOfDay } from '@rpg-engine/shared';\nimport React from 'react';\nimport Draggable from 'react-draggable';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { DayNightPeriod } from './DayNightPeriod/DayNightPeriod';\n\nimport ClockWidgetImg from './img/clockwidget.png';\n\nexport interface IClockWidgetProps {\n onClose?: () => void;\n TimeClock: string;\n periodOfDay: PeriodOfDay;\n scale?: number;\n}\n\nexport const TimeWidget: React.FC<IClockWidgetProps> = ({\n onClose,\n TimeClock,\n periodOfDay,\n scale,\n}) => {\n return (\n <Draggable scale={scale}>\n <WidgetContainer>\n <CloseButton onPointerDown={onClose}>X</CloseButton>\n <DayNightContainer>\n <DayNightPeriod periodOfDay={periodOfDay} />\n </DayNightContainer>\n <Time>{TimeClock}</Time>\n </WidgetContainer>\n </Draggable>\n );\n};\n\nconst WidgetContainer = styled.div`\n background-image: url(${ClockWidgetImg});\n background-size: 10rem;\n background-repeat: no-repeat;\n width: 10rem;\n position: absolute;\n height: 100px;\n`;\n\nconst Time = styled.div`\n top: 0.75rem;\n right: 0.5rem;\n position: absolute;\n font-size: ${uiFonts.size.small};\n color: white;\n`;\n\nconst CloseButton = styled.p`\n position: absolute;\n top: -0.5rem;\n margin: 0;\n right: -0.2rem;\n font-size: ${uiFonts.size.small} !important;\n z-index: 1;\n`;\n\nconst DayNightContainer = styled.div`\n margin-top: -0.3rem;\n margin-left: -0.3rem;\n`;\n","import {\n getItemTextureKeyPath,\n IEquipmentSet,\n ITradeResponseItem,\n} from '@rpg-engine/shared';\nimport capitalize from 'lodash/capitalize';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport SelectArrow from '../Arrow/SelectArrow';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { Ellipsis } from '../shared/Ellipsis';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nexport interface ITradeComponentProps {\n traderItem: ITradeResponseItem;\n onQuantityChange: (\n traderItem: ITradeResponseItem,\n selectedQty: number\n ) => void;\n atlasJSON: any;\n atlasIMG: any;\n selectedQty: number;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n}\n\nconst outerQty = 10;\n\nexport const TradingItemRow: React.FC<ITradeComponentProps> = ({\n atlasIMG,\n atlasJSON,\n onQuantityChange,\n traderItem,\n selectedQty,\n equipmentSet,\n scale,\n}) => {\n const onLeftClick = (qty = 1) => {\n onQuantityChange(traderItem, Math.max(0, selectedQty - qty));\n };\n\n const onRightClick = (qty = 1) => {\n onQuantityChange(\n traderItem,\n Math.min(traderItem.stackQty ?? 999, selectedQty + qty)\n );\n };\n\n return (\n <ItemWrapper>\n <ItemIconContainer>\n <SpriteContainer>\n <ItemInfoWrapper\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n item={traderItem}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: traderItem.key,\n stackQty: traderItem.stackQty || 1,\n texturePath: traderItem.texturePath,\n isStackable: traderItem.isStackable,\n },\n atlasJSON\n )}\n imgScale={2.5}\n />\n </ItemInfoWrapper>\n </SpriteContainer>\n </ItemIconContainer>\n\n <ItemNameContainer>\n <NameValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"250px\">\n {capitalize(traderItem.name)}\n </Ellipsis>\n </p>\n <p>${traderItem.price}</p>\n </NameValue>\n </ItemNameContainer>\n <QuantityContainer>\n <SelectArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"left\"\n onPointerDown={onLeftClick.bind(null, outerQty)}\n />\n <StyledArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"left\"\n onPointerDown={onLeftClick}\n />\n <QuantityDisplay>\n <TextOverlay>\n <Item>{selectedQty}</Item>\n </TextOverlay>\n </QuantityDisplay>\n <StyledArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"right\"\n onPointerDown={onRightClick}\n />\n <SelectArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"right\"\n onPointerDown={onRightClick.bind(null, outerQty)}\n />\n </QuantityContainer>\n </ItemWrapper>\n );\n};\n\nconst StyledArrow = styled(SelectArrow)`\n margin: 40px;\n`;\n\nconst ItemWrapper = styled.div`\n width: 100%;\n margin: auto;\n display: flex;\n justify-content: space-between;\n margin-bottom: 1rem;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n padding: 0.5rem;\n`;\n\nconst ItemNameContainer = styled.div`\n flex: 60%;\n`;\n\nconst ItemIconContainer = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n\n flex: 0 0 58px;\n`;\n\nconst SpriteContainer = styled.div`\n position: relative;\n top: -0.5rem;\n left: 0.5rem;\n`;\n\nconst NameValue = styled.div`\n p {\n font-size: 0.75rem;\n margin: 0;\n }\n`;\n\nconst Item = styled.span`\n color: white;\n text-align: center;\n z-index: 1;\n\n width: 100%;\n`;\n\nconst TextOverlay = styled.div`\n width: 100%;\n position: relative;\n`;\n\ninterface IContainerProps {\n percentageWidth?: number;\n minWidth?: number;\n style?: Record<string, any>;\n}\n\nconst QuantityContainer = styled.div<IContainerProps>`\n position: relative;\n display: flex;\n\n min-width: 100px;\n width: 40%;\n justify-content: center;\n align-items: center;\n\n flex: 40%;\n`;\n\nconst QuantityDisplay = styled.div`\n font-size: ${uiFonts.size.small};\n`;\n","import {\n IEquipmentSet,\n ITradeRequestItem,\n ITradeResponseItem,\n TradeTransactionType,\n} from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { TradingItemRow } from './TradingItemRow';\n\nexport interface ITradingMenu {\n traderItems: ITradeResponseItem[];\n onClose: () => void;\n onConfirm: (items: ITradeRequestItem[]) => void;\n type: TradeTransactionType;\n atlasJSON: any;\n atlasIMG: any;\n characterAvailableGold: number;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n}\n\nexport const TradingMenu: React.FC<ITradingMenu> = ({\n traderItems,\n onClose,\n type,\n atlasJSON,\n atlasIMG,\n characterAvailableGold,\n onConfirm,\n equipmentSet,\n scale,\n}) => {\n const [sum, setSum] = useState(0);\n const [qtyMap, setQtyMap] = useState(new Map());\n\n const onQuantityChange = (item: ITradeResponseItem, selectedQty: number) => {\n setQtyMap(new Map(qtyMap.set(item.key, selectedQty)));\n\n let newSum = 0;\n traderItems.forEach(item => {\n const qty = qtyMap.get(item.key);\n if (qty) newSum += qty * item.price;\n setSum(newSum);\n });\n };\n\n const isBuy = () => {\n return type == 'buy';\n };\n\n const hasGoldForSale = () => {\n if (isBuy()) {\n return !(sum > characterAvailableGold);\n }\n return true;\n };\n\n const getFinalGold = () => {\n if (isBuy()) {\n return characterAvailableGold - sum;\n } else {\n return characterAvailableGold + sum;\n }\n };\n\n const Capitalize = (word: string) => {\n return word[0].toUpperCase() + word.substring(1);\n };\n\n const onConfirmClick = () => {\n const items: ITradeRequestItem[] = [];\n\n traderItems.forEach(item => {\n const qty = qtyMap.get(item.key);\n if (qty) {\n items.push(Object.assign({}, item, { qty: qty }));\n }\n });\n\n onConfirm(items);\n };\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"600px\"\n cancelDrag=\"#TraderContainer\"\n scale={scale}\n >\n <>\n <div style={{ width: '100%' }}>\n <Title>{Capitalize(type)} Menu</Title>\n <hr className=\"golden\" />\n </div>\n <TradingComponentScrollWrapper id=\"TraderContainer\">\n {traderItems.map((tradeItem, index) => (\n <ItemWrapper key={`${tradeItem.key}_${index}`}>\n <TradingItemRow\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n onQuantityChange={onQuantityChange}\n traderItem={tradeItem}\n selectedQty={qtyMap.get(tradeItem.key) ?? 0}\n equipmentSet={equipmentSet}\n scale={scale}\n />\n </ItemWrapper>\n ))}\n </TradingComponentScrollWrapper>\n <GoldWrapper>\n <p>Available Gold:</p>\n <p>${characterAvailableGold}</p>\n </GoldWrapper>\n <TotalWrapper>\n <p>Total:</p>\n <p>${sum}</p>\n </TotalWrapper>\n {!hasGoldForSale() ? (\n <AlertWrapper>\n <p> Sorry, not enough money.</p>\n </AlertWrapper>\n ) : (\n <GoldWrapper>\n <p>Final Gold:</p>\n <p>${getFinalGold()}</p>\n </GoldWrapper>\n )}\n\n <ButtonWrapper>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={!hasGoldForSale()}\n onPointerDown={() => onConfirmClick()}\n >\n Confirm\n </Button>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onClose()}\n >\n Cancel\n </Button>\n </ButtonWrapper>\n </>\n </DraggableContainer>\n );\n};\n\nconst Title = styled.h1`\n z-index: 22;\n font-size: 0.6rem;\n color: yellow !important;\n`;\n\nconst TradingComponentScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n`;\n\nconst ItemWrapper = styled.div`\n margin: auto;\n display: flex;\n justify-content: space-between;\n`;\n\nconst TotalWrapper = styled.div`\n margin-top: 1rem;\n display: flex;\n justify-content: space-between;\n height: 20px;\n p {\n color: white !important;\n }\n width: 100%;\n margin-left: 0.8rem;\n`;\n\nconst GoldWrapper = styled.div`\n margin-top: 1rem;\n display: flex;\n justify-content: space-between;\n height: 20px;\n p {\n color: yellow !important;\n }\n width: 100%;\n margin-left: 0.8rem;\n`;\n\nconst AlertWrapper = styled.div`\n margin-top: 1rem;\n display: flex;\n width: 100%;\n justify-content: center;\n height: 20px;\n p {\n color: red !important;\n }\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n padding-top: 20px;\n width: 100%;\n margin-top: 1rem;\n button {\n padding: 0px 50px;\n }\n`;\n","/* eslint-disable react/require-default-props */\nimport React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n maxLines?: number;\n children: React.ReactNode;\n}\n\nexport const Truncate: React.FC<IProps> = ({ maxLines = 1, children }) => {\n return <Container maxLines={maxLines}>{children}</Container>;\n};\n\ninterface IContainerProps {\n maxLines: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n display: -webkit-box;\n max-width: 100%;\n max-height: 100%;\n -webkit-line-clamp: ${props => props.maxLines};\n -webkit-box-orient: vertical;\n overflow: hidden;\n`;\n","import React, { useEffect, useState } from 'react';\n\nexport interface ICheckItems {\n label: string;\n value: string;\n}\n\nexport interface ICheckProps {\n items: ICheckItems[];\n onChange: (selectedValues: IChecklistSelectedValues) => void;\n}\n\nexport interface IChecklistSelectedValues {\n [label: string]: boolean;\n}\n\nexport const CheckButton: React.FC<ICheckProps> = ({ items, onChange }) => {\n const generateSelectedValuesList = () => {\n const selectedValues: IChecklistSelectedValues = {};\n\n items.forEach(item => {\n selectedValues[item.label] = false;\n });\n\n return selectedValues;\n };\n\n const [selectedValues, setSelectedValues] = useState<\n IChecklistSelectedValues\n >(generateSelectedValuesList());\n\n const handleClick = (label: string) => {\n setSelectedValues({\n ...selectedValues,\n [label]: !selectedValues[label],\n });\n };\n\n useEffect(() => {\n if (selectedValues) {\n onChange(selectedValues);\n }\n }, [selectedValues]);\n\n return (\n <div id=\"elemento-checkbox\">\n {items?.map((element, index) => {\n return (\n <div key={`${element.label}_${index}`}>\n <input\n className=\"rpgui-checkbox\"\n type=\"checkbox\"\n checked={selectedValues[element.label]}\n onChange={() => {}}\n />\n <label onPointerDown={() => handleClick(element.label)}>\n {element.label}\n </label>\n <br />\n </div>\n );\n })}\n </div>\n );\n};\n","import React, { useEffect, useState } from 'react';\n\nexport interface IRadioItems {\n label: string;\n value: string;\n}\n\nexport interface IRadioProps {\n name: string;\n items: IRadioItems[];\n onChange: (value: string) => void;\n}\n\nexport const InputRadio: React.FC<IRadioProps> = ({\n name,\n items,\n onChange,\n}) => {\n const [selectedValue, setSelectedValue] = useState<string>();\n const handleClick = () => {\n let element = document.querySelector(\n `input[name=${name}]:checked`\n ) as HTMLInputElement;\n const elementValue = element.value;\n setSelectedValue(elementValue);\n };\n\n useEffect(() => {\n if (selectedValue) {\n onChange(selectedValue);\n }\n }, [selectedValue]);\n\n return (\n <div id=\"elemento-radio\">\n {items.map(element => {\n return (\n <>\n <input\n key={element.value}\n className=\"rpgui-radio\"\n value={element.value}\n name={name}\n type=\"radio\"\n />\n <label onPointerDown={handleClick}>{element.label}</label>\n <br />\n </>\n );\n })}\n </div>\n );\n};\n","import React from 'react';\n\nexport interface ITextArea\n extends React.DetailedHTMLProps<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n HTMLTextAreaElement\n > {}\n\nexport const TextArea: React.FC<ITextArea> = ({ ...props }) => {\n return <textarea {...props} />;\n};\n"],"names":["ButtonTypes","RPGUIContainerTypes","Button","disabled","children","buttonType","onPointerDown","props","React","ButtonContainer","className","styled","button","displayName","componentId","SpriteFromAtlas","atlasJSON","atlasIMG","spriteKey","_ref$width","width","GRID_WIDTH","_ref$height","height","GRID_HEIGHT","_ref$imgScale","imgScale","imgStyle","containerStyle","_ref$grayScale","grayScale","_ref$opacity","opacity","imgClassname","spriteData","frames","Error","Container","hasHover","style","ImgSprite","frame","scale","div","w","h","x","y","ErrorBoundary","args","_this","state","hasError","getDerivedStateFromError","_","_proto","componentDidCatch","error","errorInfo","console","render","this","Component","SelectArrow","direction","size","LeftArrow","RightArrow","span","Ellipsis","maxWidth","fontSize","center","maxLines","PropertySelect","item","availableProperties","onChange","useState","currentIndex","setCurrentIndex","propertiesLength","length","useEffect","JSON","stringify","TextOverlay","Item","name","index","Column","flex","flexWrap","alignItems","justifyContent","ChatContainer","TextField","input","MessagesContainer","Message","color","Form","form","buttonColor","buttonBackgroundColor","Input","rest","ref","innerRef","RPGUIContainer","type","CloseButton","CustomInput","CustomContainer","MessageText","p","SingleShortcut","CancelButton","ButtonsContainer","ShortcutsContainer","StyledShortcut","useOutsideClick","id","handleClickOutside","event","current","contains","target","CustomEvent","detail","document","dispatchEvent","addEventListener","removeEventListener","NPCDialogType","DraggableContainer","_ref$type","FramedGold","onCloseButton","title","imgSrc","_ref$imgWidth","imgWidth","cancelDrag","onPositionChange","onPositionChangeEnd","onPositionChangeStart","onOutsideClick","_ref$initialPosition","initialPosition","draggableRef","useRef","_e","Draggable","cancel","onDrag","data","onStop","onStart","defaultPosition","TitleContainer","Title","Icon","src","h1","img","Dropdown","options","dropdownId","uuidv4","selectedValue","setSelectedValue","selectedOption","setSelectedOption","opened","setOpened","firstOption","change","filter","o","value","option","onMouseLeave","DropdownSelect","prev","DropdownOptions","map","key","ul","modalRoot","getElementById","ModalPortal","ReactDOM","createPortal","RelativeListMenu","onSelected","_ref$fontSize","pos","overflow","params","ListElement","text","li","MobileItemTooltip","closeTooltip","equipmentSet","_ref$scale","handleFadeOut","_ref$current","classList","add","onTouchEnd","setTimeout","ItemInfoDisplay","isMobile","OptionsContainer","Option","generateContextMenuListOptions","actionsByTypeList","action","ItemSocketEventsDisplayLabels","EquipmentSlotSpriteByType","Neck","LeftHand","Ring","Head","Torso","Legs","Feet","Inventory","RightHand","Accessory","ItemSlot","observer","slotIndex","containerType","itemContainerType","slotSpriteMask","onMouseOver","onMouseOut","_ref$isContextMenuDis","isContextMenuDisabled","onDragEnd","onDragStart","onPlaceDrop","onDrop","onOutsideDrop","checkIfItemCanBeMoved","openQuantitySelector","checkIfItemShouldDragEnd","dragScale","isSelectingShortcut","setItemShortcut","isDepotSystem","isTooltipVisible","setTooltipVisible","isTooltipMobileVisible","setIsTooltipMobileVisible","isContextMenuVisible","setIsContextMenuVisible","contextMenuPosition","setContextMenuPosition","isFocused","setIsFocused","wasDragged","setWasDragged","dragPosition","setDragPosition","dropPosition","setDropPosition","dragContainer","contextActions","setContextActions","contextActionMenu","ItemContainerType","ItemType","Weapon","Armor","Jewelry","ActionsForInventory","Equipment","Consumable","CraftingResource","Tool","Other","push","DepotSocketEvents","Deposit","ActionsForEquipmentSet","Loot","ActionsForLoot","MapContainer","ActionsForMapContainer","contextActionMenuDontHaveUseWith","find","toLowerCase","includes","hasUseWith","Depot","ItemSocketEvents","GetItemInfo","Withdraw","generateContextMenu","getStackInfo","itemId","stackQty","qtyClassName","ItemQtyContainer","ItemQty","Math","round","resetItem","onSuccesfulDrag","quantity","onMouseUp","e","changedTouches","clientX","clientY","simulatedEvent","MouseEvent","bubbles","elementFromPoint","_document$elementFrom","axis","defaultClassName","parseInt","split","isNaN","classes","Array","from","_e$target","some","elm","window","getComputedStyle","matrix","DOMMatrixReadOnly","transform","m41","m42","isTouch","abs","position","ItemContainer","onMouseEnter","itemToRender","texturePath","allowedEquipSlotType","_itemToRender$allowed","element","_id","getItemTextureKeyPath","isStackable","stackInfo","renderEquipment","renderItem","onRenderSlot","ItemTooltip","optionId","rarityColor","rarity","ItemRarities","Uncommon","Rare","Epic","Legendary","statisticsToDisplay","label","higherIsWorse","ItemInfo","itemToCompare","renderMissingStatistic","statistics","stat","itemToCompareStatistic","toUpperCase","slice","Statistic","toString","Header","Rarity","Type","subType","AllowedSlots","slotType","itemStatistic","isItemToCompare","isOnlyInOneItem","statDiff","_itemToCompare$stat$k2","isDifference","isBetter","renderStatistics","isTwoHanded","Description","description","maxStackSize","StackInfo","MissingStatistics","itemSlotTypes","useMemo","_item$allowedEquipSlo","allowedSlotTypeCamelCase","camelCase","itemSubTypeCamelCase","getSlotType","itemFromEquipment","Flex","CompareContainer","Equipped","$isMobile","handleMouseMove","rect","getBoundingClientRect","tooltipWidth","tooltipHeight","isOffScreenRight","innerWidth","isOffScreenBottom","innerHeight","ItemInfoWrapper","setIsTooltipVisible","bind","log","StyledItem","Recipes","Subtitle","RadioInputScroller","SpriteAtlasWrapper","RadioOptionsWrapper","ButtonWrapper","Details","EquipmentSetContainer","EquipmentColumn","IS_MOBILE_OR_TABLET","isMobileOrTablet","DynamicText","onFinish","textState","setTextState","i","interval","setInterval","substring","clearInterval","TextContainer","NPCDialogText","str","charactersPerLine","linesPerDiv","onClose","onEndStep","onStartStep","windowSize","textChunks","floor","match","RegExp","chunkIndex","setChunkIndex","onHandleSpacePress","code","goToNextStep","showGoNextIndicator","setShowGoNextIndicator","PressSpaceIndicator","right","TextOnly","pressSpaceGif","useEventListener","handler","el","savedHandler","listener","QuestionDialog","questions","answers","currentQuestion","setCurrentQuestion","canShowAnswers","setCanShowAnswers","onGetFirstAnswer","answerIds","firstAnswerId","answer","currentAnswer","setCurrentAnswer","onGetAnswers","answerId","nextAnswerIndex","findIndex","nextAnswerID","nextAnswer","previousAnswerIndex","previousAnswerID","previousAnswer","pop","nextQuestionId","question","QuestionContainer","AnswersContainer","isSelected","selectedColor","AnswerRow","AnswerSelectedIcon","Answer","onAnswerClick","onRenderCurrentAnswers","ImgSide","NPCDialog","imagePath","_ref$isQuestionDialog","isQuestionDialog","TextAndThumbnail","ThumbnailContainer","NPCThumbnail","aliceDefaultThumbnail","RangeSliderType","NPCMultiDialog","textAndTypeArray","slide","setSlide","_textAndTypeArray$sli","imageSide","BackgroundContainer","imgPath","DialogContainer","SlotsContainer","Framed","RangeSlider","valueMin","valueMax","sliderId","containerRef","left","setLeft","calculatedWidth","_containerRef$current","clientWidth","max","typeClass","GoldSlider","pointerEvents","min","Number","ItemQuantitySelector","onConfirm","setValue","inputRef","focus","select","closeSelector","StyledContainer","StyledForm","onSubmit","preventDefault","numberValue","noValidate","StyledInput","placeholder","onBlur","newValue","Slider","RPGUIButton","ShortcutsSetter","setSettingShortcutIndex","settingShortcutIndex","shortcuts","removeShortcut","List","Shortcut","ShortcutType","None","isBeingSet","_shortcuts$index","payload","_shortcuts$index2","_shortcuts$index3","magicWords","word","getContent","ItemsContainer","QuantitySelectorContainer","ProgressBarText","minWidth","percentageWidth","QuestDraggableContainer","QuestContainer","QuestsContainer","Content","QuestSplitDiv","QuestColumn","Thumbnail","QuestListContainer","NoQuestContainer","_RPGUI","RPGUI","SimpleProgressBar","_ref$bgColor","bgColor","_ref$margin","margin","ProgressBarContainer","BackgroundBar","Progress","SkillProgressBar","skillName","level","skillPoints","skillPointsToNextLevel","_ref$showSkillPoints","showSkillPoints","getSPForLevel","nextLevelSPWillbe","ratio","ProgressTitle","TitleName","ValueDisplay","ProgressBody","ProgressIconContainer","SpriteContainer","SkillDisplayContainer","SkillPointsDisplay","skillProps","attributes","values","stamina","magic","magicResistance","strength","resistance","dexterity","combat","first","club","sword","axe","distance","shielding","dagger","crafting","fishing","mining","lumberjacking","blacksmithing","cooking","alchemy","skillNameMap","SkillsDraggableContainer","SkillsContainerDiv","SkillSplitDiv","Spell","manaCost","charMana","charMagicLevel","isSettingShortcut","minMagicLevelRequired","spellKey","Overlay","SpellImage","Info","Divider","Cost","SpellList","DayNightPeriod","periodOfDay","periodOfDaySrcFiles","PeriodOfDay","Morning","Afternoon","Night","GifContainer","WidgetContainer","Time","DayNightContainer","TradingItemRow","onQuantityChange","traderItem","selectedQty","onLeftClick","qty","onRightClick","ItemWrapper","ItemIconContainer","ItemNameContainer","NameValue","capitalize","price","QuantityContainer","StyledArrow","QuantityDisplay","TradingComponentScrollWrapper","TotalWrapper","GoldWrapper","AlertWrapper","availableCharacters","propertySelectValues","textureKey","selectedSpriteKey","setSelectedSpriteKey","display","paddingBottom","chatMessages","onSendChatMessage","onFocus","_ref$styles","styles","textColor","message","setMessage","scrollChatToBottom","scrollingElement","querySelector","scrollTop","scrollHeight","fallback","emitter","createdAt","dayjs","Date","format","onRenderMessageLines","onRenderChatMessages","trim","autoComplete","autoFocus","borderRadius","RxPaperPlane","FramedGrey","items","selectedValues","forEach","generateSelectedValuesList","setSelectedValues","checked","onActionClick","onCancelClick","onShortcutClick","mana","inventory","onTouchStart","remove","variant","onShortcutClickBinded","_shortcuts$i","_shortcuts$i2","_shortcuts$i3","itemsFromEquipment","Object","keys","slots","_inventory$slots$inde","totalQty","reduce","acc","_shortcuts$i4","renderShortcut","onSelect","onCraftItem","craftablesItems","optionsId","show","isShown","setIsShown","craftItem","setCraftItem","modifyString","parts","words","replace","concat","join","handleClick","ItemSubType","canCraft","ingredients","details","onItemClick","onItemDragEnd","onItemDragStart","onItemPlaceDrop","onItemOutsideDrop","equipmentData","neck","leftHand","ring","head","armor","legs","boot","rightHand","accessory","equipmentMaskSlots","ItemSlotType","onRenderEquipmentSlotRange","start","end","equipmentRange","slotMaksRange","itemContainer","itemType","ContainerType","backgroundImgPath","fullCoverBackground","setImage","fullImg","_ref$disableContextMe","disableContextMenu","isOpen","maxQuantity","callback","_quantity","quantitySelect","setQuantitySelect","handleSetShortcut","slotQty","_itemContainer$slots","undefined","onRenderSlots","imageKey","_ref$displayText","displayText","_ref$percentageWidth","_ref$minWidth","calculatePercentageValue","quests","buttons","onChangeQuest","questsLength","thumbnail","thumbnailDefault","onClick","npcId","quest","onShortcutCast","_ref$isBlockedCasting","isBlockedCastingByKeyboard","shortcutsRefs","handleKeyDown","shortcutIndex","_shortcutsRefs$curren","_shortcutsRefs$curren2","skill","onRenderSkillCategory","category","skillCategory","skillCategoryColor","output","entries","skillDetails","experience","xpToNextLevel","onInputFocus","onInputBlur","spells","magicLevel","onSpellClick","setSpellShortcut","search","setSearch","handleEscapeClose","spellsToDisplay","sort","a","b","spell","toLocaleLowerCase","setShortcut","Fragment","TimeClock","traderItems","characterAvailableGold","sum","setSum","Map","qtyMap","setQtyMap","set","newSum","get","isBuy","hasGoldForSale","tradeItem","assign"],"mappings":"mkCAAO,ICIKA,0DAAAA,EAAAA,sBAAAA,oDAEVA,4CCHUC,EDcCC,EAAS,oBACpBC,SAAAA,gBACAC,IAAAA,SACAC,IAAAA,WACAC,IAAAA,cACGC,SAEH,OACEC,gBAACC,iBACCC,aAAcL,EACdF,SAAUA,GACNI,GACJD,cAAeA,IAEfE,yBAAIJ,KAKJK,EAAkBE,EAAOC,mBAAMC,sCAAAC,2BAAbH,gCDhCb,QGeEI,EAAoC,gBAC/CC,IAAAA,UACAC,IAAAA,SACAC,IAAAA,UAASC,IACTC,MAAAA,aAAQC,eAAUC,IAClBC,OAAAA,aAASC,gBAAWC,IACpBC,SAAAA,aAAW,IACXC,IAAAA,SACArB,IAAAA,cACAsB,IAAAA,eAAcC,IACdC,UAAAA,gBAAiBC,IACjBC,QAAAA,aAAU,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AChCjF,gBAACoqB,IAAYjf,IAAQyrB,EAAUzrB,QAAOlG,GACpCjF,gBAAC6pB,IACCppB,SAAUA,EACVD,UAAWA,EACXspB,iBAAkBA,EAClBC,WAAY6M,EACZ5M,qBAAaqM,EAAOI,IAAIG,EAAUzrB,QAAQ,EAC1CkB,aAAcA,EACdnK,MAAOA,SAKflC,gBAAC+qB,QACC/qB,4CACAA,6BAAKi2B,IAEPj2B,gBAAC8qB,QACC9qB,mCACAA,6BAAKk2B,IAELS,IAKA32B,gBAAC+qB,QACC/qB,wCACAA,6BArEJ02B,IACKT,EAAyBC,EAEzBD,EAAyBC,IA4D5Bl2B,gBAACgrB,QACChrB,uDASJA,gBAACwa,QACCxa,gBAACN,GACCG,WAAYL,oBAAYqjB,YACxBljB,UAAWg3B,IACX72B,cAAe,WAAA,OAjEjBqtB,EAA6B,GAEnC6I,EAAY3I,SAAQ,SAAAlpB,GAClB,IAAM+lB,EAAMmM,EAAOI,IAAItyB,EAAKgH,KACxB+e,GACFiD,EAAM9b,KAAKid,OAAOuI,OAAO,GAAI1yB,EAAM,CAAE+lB,IAAKA,aAI9CtI,EAAUuL,GAVW,IACfA,eAqEAntB,gBAACN,GACCG,WAAYL,oBAAYqjB,YACxB/iB,cAAe,WAAA,OAAM8b,qCCxIS,oBAAG3X,SAC3C,OAAOjE,gBAAC6B,IAAUoC,oBADoC,OAAGrE"}
|
|
1
|
+
{"version":3,"file":"long-bow.cjs.production.min.js","sources":["../src/constants/uiFonts.ts","../src/components/Button.tsx","../src/components/RPGUIContainer.tsx","../src/components/shared/SpriteFromAtlas.tsx","../src/components/Item/Inventory/ErrorBoundary.tsx","../src/components/Arrow/SelectArrow.tsx","../src/components/shared/Ellipsis.tsx","../src/components/PropertySelect/PropertySelect.tsx","../src/components/Character/CharacterSelection.tsx","../src/components/shared/Column.tsx","../src/components/Chat/Chat.tsx","../src/components/Input.tsx","../src/components/Chatdeprecated/ChatDeprecated.tsx","../src/constants/uiColors.ts","../src/components/Shortcuts/SingleShortcut.ts","../src/components/CircularController/CircularController.tsx","../src/hooks/useOutsideAlerter.ts","../src/components/NPCDialog/NPCDialog.tsx","../src/components/DraggableContainer.tsx","../src/components/Dropdown.tsx","../src/components/Abstractions/ModalPortal.tsx","../src/components/RelativeListMenu.tsx","../src/components/Item/Cards/MobileItemTooltip.tsx","../src/components/Item/Inventory/itemContainerHelper.ts","../src/components/Item/Inventory/ItemSlot.tsx","../src/components/Item/Cards/ItemInfo.tsx","../src/components/Item/Cards/ItemInfoDisplay.tsx","../src/components/Item/Cards/ItemTooltip.tsx","../src/components/Item/Cards/ItemInfoWrapper.tsx","../src/components/CraftBook/CraftBook.tsx","../src/components/DropdownSelectorContainer.tsx","../src/components/Equipment/EquipmentSet.tsx","../src/constants/uiDevices.ts","../src/components/typography/DynamicText.tsx","../src/components/NPCDialog/NPCDialogText.tsx","../src/libs/StringHelpers.ts","../src/hooks/useEventListener.ts","../src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx","../src/components/NPCDialog/NPCMultiDialog.tsx","../src/components/RangeSlider.tsx","../src/components/HistoryDialog.tsx","../src/components/Abstractions/SlotsContainer.tsx","../src/components/Item/Inventory/ItemQuantitySelector.tsx","../src/components/Shortcuts/ShortcutsSetter.tsx","../src/components/Item/Inventory/ItemContainer.tsx","../src/components/itemSelector/ItemSelector.tsx","../src/components/ListMenu.tsx","../src/components/Marketplace/MarketplaceRows.tsx","../src/components/Marketplace/Marketplace.tsx","../src/components/ProgressBar.tsx","../src/components/QuestInfo/QuestInfo.tsx","../src/components/QuestList.tsx","../src/components/RPGUIRoot.tsx","../src/components/Shortcuts/Shortcuts.tsx","../src/components/SimpleProgressBar.tsx","../src/components/SkillProgressBar.tsx","../src/components/SkillsContainer.tsx","../src/components/Spellbook/Spell.tsx","../src/components/Spellbook/Spellbook.tsx","../src/components/TimeWidget/DayNightPeriod/DayNightPeriod.tsx","../src/components/TimeWidget/TimeWidget.tsx","../src/components/TradingMenu/TradingItemRow.tsx","../src/components/TradingMenu/TradingMenu.tsx","../src/components/Truncate.tsx","../src/components/CheckButton.tsx","../src/components/RadioButton.tsx","../src/components/TextArea.tsx"],"sourcesContent":["export const uiFonts = {\n size: {\n xxsmall: '8px',\n xsmall: '9px',\n small: '12px',\n medium: '14px',\n large: '16px',\n xLarge: '18px',\n xxLarge: '20px',\n xxxLarge: '24px',\n },\n};\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\n\nexport enum ButtonTypes {\n RPGUIButton = 'rpgui-button',\n RPGUIGoldButton = 'rpgui-button golden',\n}\n\nexport interface IButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n disabled?: boolean;\n children: React.ReactNode;\n buttonType: ButtonTypes;\n onPointerDown?: (e: any) => void;\n}\n\nexport const Button = ({\n disabled = false,\n children,\n buttonType,\n onPointerDown,\n ...props\n}: IButtonProps) => {\n return (\n <ButtonContainer\n className={`${buttonType}`}\n disabled={disabled}\n {...props}\n onPointerDown={onPointerDown}\n >\n <p>{children}</p>\n </ButtonContainer>\n );\n};\n\nconst ButtonContainer = styled.button`\n height: 45px;\n font-size: ${uiFonts.size.small};\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nexport enum RPGUIContainerTypes {\n Framed = 'framed',\n FramedGold = 'framed-golden',\n FramedGold2 = 'framed-golden-2',\n FramedGrey = 'framed-grey',\n}\nexport interface IRPGUIContainerProps {\n type: RPGUIContainerTypes;\n children: React.ReactNode;\n width?: string;\n height?: string;\n className?: string;\n}\n\nexport const RPGUIContainer: React.FC<IRPGUIContainerProps> = ({\n children,\n type,\n width = '50%',\n height,\n className,\n}) => {\n return (\n <Container\n width={width}\n height={height || 'auto'}\n className={`rpgui-container ${type} ${className}`}\n >\n {children}\n </Container>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n}\n\nconst Container = styled.div<IContainerProps>`\n height: ${props => props.height};\n width: ${({ width }) => width};\n display: flex;\n flex-wrap: wrap;\n image-rendering: pixelated;\n`;\n","import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n atlasJSON: any;\n atlasIMG: any;\n spriteKey: string;\n width?: number;\n height?: number;\n grayScale?: boolean;\n opacity?: number;\n onPointerDown?: () => void;\n containerStyle?: any;\n imgStyle?: any;\n imgScale?: number;\n imgClassname?: string;\n}\n\nexport const SpriteFromAtlas: React.FC<IProps> = ({\n atlasJSON,\n atlasIMG,\n spriteKey,\n width = GRID_WIDTH,\n height = GRID_HEIGHT,\n imgScale = 2,\n imgStyle,\n onPointerDown,\n containerStyle,\n grayScale = false,\n opacity = 1,\n imgClassname,\n}) => {\n //! If an item is not showing, remember that you MUST run yarn atlas:copy everytime you add a new item to the atlas (it will sync our public folder atlas with src/atlas).\n //!Due to React's limitations, we cannot import it from the public folder directly!\n\n const spriteData =\n atlasJSON.frames[spriteKey] || atlasJSON.frames['others/no-image.png'];\n\n if (!spriteData) throw new Error(`Sprite ${spriteKey} not found in atlas!`);\n\n return (\n <Container\n width={width}\n height={height}\n hasHover={grayScale}\n onPointerDown={onPointerDown}\n style={containerStyle}\n >\n <ImgSprite\n className={`sprite-from-atlas-img ${imgClassname || ''}`}\n atlasIMG={atlasIMG}\n frame={spriteData.frame}\n scale={imgScale}\n grayScale={grayScale}\n opacity={opacity}\n style={imgStyle}\n />\n </Container>\n );\n};\n\ninterface IImgSpriteProps {\n atlasIMG: any;\n frame: {\n x: number;\n y: number;\n w: number;\n h: number;\n };\n scale: number;\n grayScale: boolean;\n opacity: number;\n}\n\ninterface IContainerProps {\n width: number;\n height: number;\n hasHover: boolean;\n}\n\nconst Container = styled.div`\n width: ${(props: IContainerProps) => props.width}px;\n height: ${(props: IContainerProps) => props.height}px;\n ${(props: IContainerProps) =>\n !props.hasHover\n ? `&:hover {\n filter: sepia(100%) saturate(300%) brightness(70%) hue-rotate(180deg);\n }`\n : ``}\n`;\n\nconst ImgSprite = styled.div<IImgSpriteProps>`\n width: ${props => props.frame.w}px;\n height: ${props => props.frame.h}px;\n background-image: url(${props => props.atlasIMG});\n background-position: -${props => props.frame.x}px -${props => props.frame.y}px;\n transform: scale(${props => props.scale});\n position: relative;\n top: 8px;\n left: 8px;\n filter: ${props => (props.grayScale ? 'grayscale(100%)' : 'none')};\n opacity: ${props => props.opacity};\n`;\n","import React, { Component, ErrorInfo, ReactNode } from 'react';\nimport atlasJSON from '../../../mocks/atlas/items/items.json';\nimport atlasIMG from '../../../mocks/atlas/items/items.png';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\n\ninterface Props {\n children?: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n}\n\nexport class ErrorBoundary extends Component<Props, State> {\n public state: State = {\n hasError: false,\n };\n\n public static getDerivedStateFromError(_: Error): State {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n public componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error('Uncaught error:', error, errorInfo);\n }\n\n public render() {\n if (this.state.hasError) {\n return (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={'others/no-image.png'}\n imgScale={3}\n />\n );\n }\n\n return this.props.children;\n }\n}\n","import React from 'react';\nimport styled from 'styled-components';\nimport LeftArrowClickIcon from './img/arrow01-left-clicked.png';\nimport LeftArrowIcon from './img/arrow01-left.png';\nimport RightArrowClickIcon from './img/arrow01-right-clicked.png';\nimport RightArrowIcon from './img/arrow01-right.png';\n\nexport interface ArrowBarProps extends React.HTMLAttributes<HTMLDivElement> {\n direction: 'right' | 'left';\n onPointerDown: () => void;\n size?: number;\n}\n\nexport const SelectArrow: React.FC<ArrowBarProps> = ({\n direction = 'left',\n size,\n onPointerDown,\n ...props\n}) => {\n return (\n <>\n {direction === 'left' ? (\n <LeftArrow\n size={size}\n onPointerDown={() => onPointerDown()}\n {...props}\n ></LeftArrow>\n ) : (\n <RightArrow\n size={size}\n onPointerDown={() => onPointerDown()}\n {...props}\n ></RightArrow>\n )}\n </>\n );\n};\n\ninterface IArrowProps {\n size?: number;\n}\n\nconst LeftArrow = styled.span<IArrowProps>`\n background-image: url(${LeftArrowIcon});\n background-size: 100% 100%;\n left: 0;\n position: absolute;\n width: ${props => props.size || 40}px;\n height: ${props => props.size || 42}px;\n :active {\n background-image: url(${LeftArrowClickIcon});\n }\n z-index: 2;\n`;\n\nconst RightArrow = styled.span<IArrowProps>`\n background-image: url(${RightArrowIcon});\n right: 0;\n position: absolute;\n width: ${props => props.size || 40}px;\n height: ${props => props.size || 42}px;\n background-size: 100% 100%;\n :active {\n background-image: url(${RightArrowClickIcon});\n }\n z-index: 2;\n`;\n\nexport default SelectArrow;\n","import React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n children: React.ReactNode;\n maxLines: 1 | 2 | 3;\n maxWidth: string;\n fontSize?: string;\n center?: boolean;\n}\n\nexport const Ellipsis = ({\n children,\n maxLines,\n maxWidth,\n fontSize,\n center,\n}: IProps) => {\n return (\n <Container maxWidth={maxWidth} fontSize={fontSize} center={center}>\n <div className={`ellipsis-${maxLines}-lines`}>{children}</div>\n </Container>\n );\n};\n\ninterface IContainerProps {\n maxWidth?: string;\n fontSize?: string;\n center?: boolean;\n}\n\nconst Container = styled.div<IContainerProps>`\n .ellipsis-1-lines {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: ${props => props.maxWidth};\n font-size: ${props => props.fontSize};\n\n ${props => props.center && `margin: 0 auto;`}\n }\n .ellipsis-2-lines {\n display: -webkit-box;\n max-width: ${props => props.maxWidth}px;\n\n height: 25px;\n margin: 0 auto;\n line-height: 1;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n font-size: ${props => props.fontSize};\n }\n .ellipsis-3-lines {\n display: -webkit-box;\n max-width: ${props => props.maxWidth}px;\n\n height: 43px;\n margin: 0 auto;\n line-height: 1;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n text-overflow: ellipsis;\n overflow: hidden;\n font-size: ${props => props.fontSize};\n }\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../constants/uiFonts';\nimport SelectArrow from '../Arrow/SelectArrow';\nimport { Ellipsis } from '../shared/Ellipsis';\n\nexport interface IPropertySelectProps {\n availableProperties: Array<IPropertiesProps>;\n selectedProperty?: IPropertiesProps;\n children?: React.ReactNode;\n onChange: (selectedProperty: IPropertiesProps) => void;\n}\n\nexport interface IPropertiesProps {\n id: string;\n name: string;\n}\n\nexport const PropertySelect: React.FC<IPropertySelectProps> = ({\n availableProperties,\n onChange,\n}) => {\n const [currentIndex, setCurrentIndex] = useState(0);\n const propertiesLength = availableProperties.length - 1;\n\n const onLeftClick = () => {\n if (currentIndex === 0) setCurrentIndex(propertiesLength);\n else setCurrentIndex(index => index - 1);\n };\n const onRightClick = () => {\n if (currentIndex === propertiesLength) setCurrentIndex(0);\n else setCurrentIndex(index => index + 1);\n };\n\n useEffect(() => {\n onChange(availableProperties[currentIndex]);\n }, [currentIndex]);\n\n useEffect(() => {\n setCurrentIndex(0);\n }, [JSON.stringify(availableProperties)]);\n\n const getCurrentSelectionName = () => {\n const item = availableProperties[currentIndex];\n if (item) {\n return item.name;\n }\n return '';\n };\n\n return (\n <Container>\n <TextOverlay>\n <p>\n <Item>\n <Ellipsis maxLines={1} maxWidth=\"60%\" center>\n {getCurrentSelectionName()}\n </Ellipsis>\n </Item>\n </p>\n </TextOverlay>\n <div className=\"rpgui-progress-track\"></div>\n\n <SelectArrow direction=\"left\" onPointerDown={onLeftClick}></SelectArrow>\n <SelectArrow direction=\"right\" onPointerDown={onRightClick}></SelectArrow>\n </Container>\n );\n};\n\nconst Item = styled.span`\n font-size: 1rem;\n color: white;\n text-align: center;\n z-index: 1;\n position: absolute;\n top: 12px;\n width: 100%;\n\n p {\n margin: 0 auto;\n font-size: ${uiFonts.size.small};\n }\n`;\n\nconst TextOverlay = styled.div`\n width: 100%;\n position: relative;\n`;\n\ninterface IContainerProps {\n percentageWidth?: number;\n minWidth?: number;\n style?: Record<string, any>;\n}\n\nconst Container = styled.div<IContainerProps>`\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: start;\n align-items: flex-start;\n min-width: 100px;\n width: 40%;\n`;\n\nexport default PropertySelect;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\n\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nimport { ErrorBoundary } from '../Item/Inventory/ErrorBoundary';\nimport PropertySelect, {\n IPropertiesProps,\n} from '../PropertySelect/PropertySelect';\n\nexport interface ICharacterProps {\n name: string;\n textureKey: string;\n}\n\nexport interface ICharacterSelectionProps {\n availableCharacters: ICharacterProps[];\n atlasJSON: any;\n atlasIMG: any;\n onChange: (textureKey: string) => void;\n}\n\nexport const CharacterSelection: React.FC<ICharacterSelectionProps> = ({\n availableCharacters,\n atlasJSON,\n atlasIMG,\n onChange,\n}) => {\n const propertySelectValues = availableCharacters.map((item) => {\n return {\n id: item.textureKey,\n name: item.name,\n };\n });\n\n const [selectedValue, setSelectedValue] = useState<IPropertiesProps>();\n const [selectedSpriteKey, setSelectedSpriteKey] = useState('');\n\n const onSelectedValueChange = () => {\n const textureKey = selectedValue ? selectedValue.id : '';\n const spriteKey = textureKey ? textureKey + '/down/standing/0.png' : '';\n\n if (spriteKey === selectedSpriteKey) {\n return;\n }\n\n setSelectedSpriteKey(spriteKey);\n onChange(textureKey);\n };\n\n useEffect(() => {\n onSelectedValueChange();\n }, [selectedValue]);\n\n useEffect(() => {\n setSelectedValue(propertySelectValues[0]);\n }, [availableCharacters]);\n\n return (\n <Container>\n {selectedSpriteKey && atlasIMG && atlasJSON && (\n <ErrorBoundary>\n <SpriteFromAtlas\n spriteKey={selectedSpriteKey}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n imgScale={4}\n height={80}\n width={64}\n containerStyle={{\n display: 'flex',\n alignItems: 'center',\n paddingBottom: '15px',\n }}\n imgStyle={{\n left: '22px',\n }}\n />\n </ErrorBoundary>\n )}\n <PropertySelect\n availableProperties={propertySelectValues}\n onChange={(value) => {\n setSelectedValue(value);\n }}\n />\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n image-rendering: pixelated;\n`;\n\nexport default CharacterSelection;\n","import styled from 'styled-components';\n\ninterface IColumn {\n flex?: number;\n alignItems?: string;\n justifyContent?: string;\n flexWrap?: string;\n}\n\nexport const Column = styled.div<IColumn>`\n flex: ${props => props.flex || 'auto'};\n display: flex;\n flex-wrap: ${props => props.flexWrap || 'nowrap'};\n align-items: ${props => props.alignItems || 'flex-start'};\n justify-content: ${props => props.justifyContent || 'flex-start'};\n`;\n","import { IChatMessage } from '@rpg-engine/shared';\nimport dayjs from 'dayjs';\nimport React, { useEffect, useState } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { RxPaperPlane } from 'react-icons/rx';\nimport styled from 'styled-components';\nimport { Column } from '../shared/Column';\n\ninterface IEmitter {\n _id: string;\n name: string;\n}\n\ninterface IStyles {\n textColor?: string;\n buttonColor?: string;\n buttonBackgroundColor?: string;\n width?: string;\n height?: string;\n}\n\nexport interface IChatProps {\n chatMessages: IChatMessage[];\n onSendChatMessage: (message: string) => void;\n onCloseButton: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n opacity?: number;\n sendMessage: boolean;\n styles?: IStyles;\n}\n\nexport const Chat: React.FC<IChatProps> = ({\n chatMessages,\n onSendChatMessage,\n onFocus,\n onBlur,\n styles = {\n textColor: '#c65102',\n buttonColor: '#005b96',\n buttonBackgroundColor: 'rgba(0,0,0,.2)',\n width: '80%',\n height: 'auto',\n },\n}) => {\n const [message, setMessage] = useState('');\n\n useEffect(() => {\n scrollChatToBottom();\n }, []);\n\n useEffect(() => {\n scrollChatToBottom();\n }, [chatMessages]);\n\n const scrollChatToBottom = () => {\n const scrollingElement = document.querySelector('.chat-body');\n if (scrollingElement) {\n scrollingElement.scrollTop = scrollingElement.scrollHeight;\n }\n };\n\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!message || message.trim() === '') return;\n onSendChatMessage(message);\n setMessage('');\n };\n const getInputValue = (value: string) => {\n setMessage(value);\n };\n\n const onRenderMessageLines = (\n emitter: IEmitter,\n createdAt: string | undefined,\n message: string\n ) => {\n return `${dayjs(createdAt || new Date()).format('HH:mm')} ${\n emitter?.name ? `${emitter.name}: ` : 'Unknown: '\n } ${message}`;\n };\n\n const onRenderChatMessages = (chatMessages: IChatMessage[]) => {\n return chatMessages?.length ? (\n chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (\n <Message color={styles?.textColor || '#c65102'} key={`${_id}_${index}`}>\n {onRenderMessageLines(emitter, createdAt as string, message)}\n </Message>\n ))\n ) : (\n <Message color={styles?.textColor || '#c65102'}>\n No messages available.\n </Message>\n );\n };\n\n return (\n <ChatContainer\n width={styles?.width || '80%'}\n height={styles?.height || 'auto'}\n >\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\n <MessagesContainer className=\"chat-body\">\n {onRenderChatMessages(chatMessages)}\n </MessagesContainer>\n\n <Form onSubmit={handleSubmit}>\n <Column flex={70}>\n <TextField\n value={message}\n id=\"inputMessage\"\n onChange={e => getInputValue(e.target.value)}\n height={20}\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n onPointerDown={onFocus}\n autoFocus\n />\n </Column>\n <Column justifyContent=\"flex-end\">\n <Button\n buttonColor={styles?.buttonColor || '#005b96'}\n buttonBackgroundColor={\n styles?.buttonBackgroundColor || 'rgba(0,0,0,.5)'\n }\n id=\"chat-send-button\"\n style={{ borderRadius: '20%' }}\n >\n <RxPaperPlane size={15} />\n </Button>\n </Column>\n </Form>\n </ErrorBoundary>\n </ChatContainer>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n}\n\ninterface IMessageProps {\n color: string;\n}\n\ninterface IButtonProps {\n buttonColor: string;\n buttonBackgroundColor: string;\n}\n\nconst ChatContainer = styled.div<IContainerProps>`\n height: ${props => props.height};\n width: ${({ width }) => width};\n padding: 10px;\n background-color: rgba(0, 0, 0, 0.2);\n height: auto;\n`;\n\nconst TextField = styled.input`\n width: 100%;\n background-color: rgba(0, 0, 0, 0.25) !important;\n border: none !important;\n max-height: 28px !important;\n`;\n\nconst MessagesContainer = styled.div`\n height: 70%;\n margin-bottom: 10px;\n .chat-body {\n max-height: auto;\n overflow-y: auto;\n }\n`;\n\nconst Message = styled.div<IMessageProps>`\n margin-bottom: 8px;\n color: ${({ color }) => color};\n`;\n\nconst Form = styled.form`\n display: flex;\n width: 100%;\n justify-content: center;\n align-items: center;\n`;\n\nconst Button = styled.button<IButtonProps>`\n color: ${({ buttonColor }) => buttonColor};\n background-color: ${({ buttonBackgroundColor }) => buttonBackgroundColor};\n width: 28px;\n height: 28px;\n border: none !important;\n`;\n","import React from 'react';\n\nexport interface IInputProps\n extends React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n > {\n innerRef?: React.Ref<HTMLInputElement>;\n}\n\nexport const Input: React.FC<IInputProps> = ({ ...props }) => {\n const { innerRef, ...rest } = props;\n\n return <input {...rest} ref={props.innerRef} />;\n};\n","import { IChatMessage } from '@rpg-engine/shared';\nimport dayjs from 'dayjs';\nimport React, { useEffect, useState } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Button, ButtonTypes } from '../Button';\nimport { Input } from '../Input';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';\nimport { Column } from '../shared/Column';\n\ninterface IEmitter {\n _id: string;\n name: string;\n}\nexport interface IChatDeprecatedProps {\n chatMessages: IChatMessage[];\n onSendChatMessage: (message: string) => void;\n onCloseButton: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n opacity?: number;\n width?: string;\n height?: string;\n}\n\nexport const ChatDeprecated: React.FC<IChatDeprecatedProps> = ({\n chatMessages,\n onSendChatMessage,\n opacity = 1,\n width = '100%',\n height = '250px',\n onCloseButton,\n onFocus,\n onBlur,\n}) => {\n const [message, setMessage] = useState('');\n\n useEffect(() => {\n scrollChatToBottom();\n }, []);\n\n useEffect(() => {\n scrollChatToBottom();\n }, [chatMessages]);\n\n const scrollChatToBottom = () => {\n const scrollingElement = document.querySelector('.chat-body');\n if (scrollingElement) {\n scrollingElement.scrollTop = scrollingElement.scrollHeight;\n }\n };\n\n const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {\n event.preventDefault();\n onSendChatMessage(message);\n setMessage('');\n };\n const getInputValue = (value: string) => {\n setMessage(value);\n };\n\n const onRenderMessageLines = (\n emitter: IEmitter,\n createdAt: string | undefined,\n message: string\n ) => {\n return `${dayjs(createdAt || new Date()).format('HH:mm')} ${\n emitter?.name ? `${emitter.name}: ` : 'Unknown: '\n } ${message}`;\n };\n\n const onRenderChatMessages = (chatMessages: IChatMessage[]) => {\n return chatMessages?.length ? (\n chatMessages?.map(({ _id, createdAt, emitter, message }, index) => (\n <MessageText key={`${_id}_${index}`}>\n {onRenderMessageLines(emitter, createdAt as string, message)}\n </MessageText>\n ))\n ) : (\n <MessageText>No messages available.</MessageText>\n );\n };\n\n return (\n <Container>\n <CustomContainer\n type={RPGUIContainerTypes.FramedGrey}\n width={width}\n height={height}\n className=\"chat-container\"\n opacity={opacity}\n >\n <ErrorBoundary fallback={<p>Oops! Your chat has crashed.</p>}>\n {onCloseButton && (\n <CloseButton onPointerDown={onCloseButton}>X</CloseButton>\n )}\n <RPGUIContainer\n type={RPGUIContainerTypes.FramedGrey}\n width={'100%'}\n height={'80%'}\n className=\"chat-body dark-background\"\n >\n {onRenderChatMessages(chatMessages)}\n </RPGUIContainer>\n\n <Form onSubmit={handleSubmit}>\n <Column flex={70}>\n <CustomInput\n value={message}\n id=\"inputMessage\"\n onChange={e => getInputValue(e.target.value)}\n height={20}\n className=\"chat-input dark-background\"\n type=\"text\"\n autoComplete=\"off\"\n onFocus={onFocus}\n onBlur={onBlur}\n />\n </Column>\n <Column justifyContent=\"flex-end\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n id=\"chat-send-button\"\n >\n Send\n </Button>\n </Column>\n </Form>\n </ErrorBoundary>\n </CustomContainer>\n </Container>\n );\n};\n\nconst Container = styled.div`\n position: relative;\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 2px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 0.7rem;\n`;\n\nconst CustomInput = styled(Input)`\n height: 30px;\n width: 100%;\n\n .rpgui-content .input {\n min-height: 39px;\n }\n`;\n\ninterface ICustomContainerProps {\n opacity: number;\n}\n\nconst CustomContainer = styled(RPGUIContainer)`\n display: block;\n\n opacity: ${(props: ICustomContainerProps) => props.opacity};\n\n &:hover {\n opacity: 1;\n }\n\n .dark-background {\n background-color: ${uiColors.darkGray} !important;\n }\n\n .chat-body {\n &.rpgui-container.framed-grey {\n background: unset;\n }\n max-height: 170px;\n overflow-y: auto;\n }\n`;\n\nconst Form = styled.form`\n display: flex;\n width: 100%;\n justify-content: center;\n align-items: center;\n`;\n\nconst MessageText = styled.p`\n display: block !important;\n width: 100%;\n font-size: ${uiFonts.size.xsmall} !important;\n overflow-y: auto;\n margin: 0;\n`;\n","export const uiColors = {\n lightGray: '#757161',\n gray: '#4E4A4E',\n darkGray: '#3e3e3e',\n darkYellow: '#FFC857',\n yellow: '#FFFF00',\n orange: '#D27D2C',\n cardinal: '#C5283D',\n red: '#D04648',\n darkRed: '#442434',\n raisinBlack: '#191923',\n navyBlue: '#0E79B2',\n purple: '#6833A3',\n darkPurple: '#522761',\n blue: '#597DCE',\n darkBlue: '#30346D',\n brown: '#854C30',\n lightGreen: '#6DAA2C',\n brownGreen: '#346524',\n};\n","import styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\n\nexport const SingleShortcut = styled.button`\n width: 3rem;\n height: 3rem;\n background-color: ${uiColors.lightGray};\n border: 2px solid ${uiColors.darkGray};\n border-radius: 50%;\n text-transform: uppercase;\n font-size: 0.7rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n\n span {\n pointer-events: none;\n }\n\n .mana {\n position: absolute;\n top: -5px;\n right: 0;\n font-size: 0.65rem;\n color: ${uiColors.blue};\n }\n\n .qty {\n position: absolute;\n top: -5px;\n right: 0;\n font-size: 0.65rem;\n }\n\n .magicWords {\n margin-top: 4px;\n }\n\n .keyboard {\n position: absolute;\n bottom: -5px;\n left: 0;\n font-size: 0.65rem;\n color: ${uiColors.yellow};\n }\n\n &:hover,\n &:focus {\n background-color: ${uiColors.darkGray};\n }\n\n &:active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n\n &:disabled {\n opacity: 0.5;\n }\n`;\n","import {\n getItemTextureKeyPath,\n IItem,\n IItemContainer,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SingleShortcut } from '../Shortcuts/SingleShortcut';\n\nexport type CircularControllerProps = {\n onActionClick: () => void;\n onCancelClick: () => void;\n onShortcutClick: (index: number) => void;\n mana: number;\n shortcuts: IShortcut[];\n inventory?: IItemContainer | null;\n atlasIMG: any;\n atlasJSON: any;\n};\n\nexport const CircularController: React.FC<CircularControllerProps> = ({\n onActionClick,\n onCancelClick,\n onShortcutClick,\n mana,\n shortcuts,\n inventory,\n atlasIMG,\n atlasJSON,\n}) => {\n const onTouchStart = (e: React.TouchEvent<HTMLButtonElement>) => {\n const target = e.target as HTMLButtonElement;\n target?.classList.add('active');\n };\n\n const onTouchEnd = (\n action: () => void,\n e: React.TouchEvent<HTMLButtonElement>\n ) => {\n const target = e.target as HTMLButtonElement;\n setTimeout(() => {\n target?.classList.remove('active');\n }, 100);\n action();\n };\n\n const renderShortcut = (i: number) => {\n let variant = '';\n\n if (i === 0) variant = 'top';\n else if (i >= 3) variant = `bottom-${i - 3}`;\n\n const onShortcutClickBinded =\n shortcuts[i]?.type !== ShortcutType.None\n ? onShortcutClick.bind(null, i)\n : () => {};\n\n if (shortcuts[i]?.type === ShortcutType.Item) {\n const payload = shortcuts[i]?.payload as IItem | undefined;\n\n let itemsFromEquipment: (IItem | undefined | null)[] = [];\n\n if (inventory) {\n Object.keys(inventory.slots).forEach(i => {\n const index = parseInt(i);\n\n if (inventory.slots[index]?.key === payload?.key) {\n itemsFromEquipment.push(inventory.slots[index]);\n }\n });\n }\n\n const totalQty = itemsFromEquipment.reduce(\n (acc, item) => acc + (item?.stackQty || 1),\n 0\n );\n\n return (\n <StyledShortcut\n key={i}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onShortcutClickBinded)}\n disabled={false}\n className={variant}\n >\n {payload && (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: payload.texturePath,\n texturePath: payload.texturePath,\n stackQty: payload.stackQty || 1,\n isStackable: payload.isStackable,\n },\n atlasJSON\n )}\n width={32}\n height={32}\n imgScale={1.4}\n imgStyle={{ left: '4px' }}\n containerStyle={{ pointerEvents: 'none' }}\n />\n )}\n <span className=\"qty\">{totalQty}</span>\n </StyledShortcut>\n );\n }\n\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\n\n return (\n <StyledShortcut\n key={i}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onShortcutClickBinded)}\n disabled={mana < (payload?.manaCost ?? 0)}\n className={variant}\n >\n <span className=\"mana\">{payload && payload.manaCost}</span>\n <span className=\"magicWords\">\n {payload?.magicWords.split(' ').map(word => word[0])}\n </span>\n </StyledShortcut>\n );\n };\n\n return (\n <ButtonsContainer>\n <ShortcutsContainer>\n {Array.from({ length: 6 }).map((_, i) => renderShortcut(i))}\n </ShortcutsContainer>\n <Button\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onActionClick)}\n >\n <div className=\"rpgui-icon sword\" />\n </Button>\n\n <CancelButton\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd.bind(null, onCancelClick)}\n >\n <span>X</span>\n </CancelButton>\n </ButtonsContainer>\n );\n};\n\nconst Button = styled.button`\n width: 4.3rem;\n height: 4.3rem;\n background-color: ${uiColors.lightGray};\n border: 2px solid ${uiColors.darkGray};\n border-radius: 50%;\n text-transform: uppercase;\n font-size: 0.7rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n transition: all 0.1s;\n margin-top: -3rem;\n\n &.active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n\n .sword {\n transform: rotate(-45deg);\n height: 2.5rem;\n width: 1.9rem;\n pointer-events: none;\n }\n`;\n\nconst CancelButton = styled(Button)`\n width: 3rem;\n height: 3rem;\n font-size: 0.8rem;\n\n span {\n margin-top: 4px;\n margin-left: 2px;\n pointer-events: none;\n }\n`;\n\nconst ButtonsContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n`;\n\nconst ShortcutsContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n flex-direction: column;\n margin-top: 3rem;\n\n .top {\n transform: translate(93%, 25%);\n }\n\n .bottom-0 {\n transform: translate(93%, -25%);\n }\n\n .bottom-1 {\n transform: translate(-120%, calc(-5.5rem));\n }\n\n .bottom-2 {\n transform: translate(-30%, calc(-5.5rem - 25%));\n }\n`;\n\nconst StyledShortcut = styled(SingleShortcut)`\n width: 2.5rem;\n height: 2.5rem;\n transition: all 0.1s;\n\n .mana,\n .qty {\n font-size: 0.5rem;\n }\n\n &:hover,\n &:focus,\n &:active {\n background-color: ${uiColors.lightGray};\n }\n\n &.active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n`;\n","import { useEffect } from 'react';\n\nexport function useOutsideClick(ref: any, id: string) {\n useEffect(() => {\n /**\n * Alert if clicked on outside of element\n */\n function handleClickOutside(event: any) {\n if (ref.current && !ref.current.contains(event.target)) {\n const event = new CustomEvent('clickOutside', {\n detail: {\n id,\n },\n });\n document.dispatchEvent(event);\n }\n }\n // Bind the event listener\n document.addEventListener('pointerdown', handleClickOutside);\n return () => {\n // Unbind the event listener on clean up\n document.removeEventListener('pointerdown', handleClickOutside);\n };\n }, [ref]);\n}\n","import React from 'react';\nimport styled from 'styled-components';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';\nimport { NPCDialogText } from './NPCDialogText';\nimport {\n IQuestionDialog,\n IQuestionDialogAnswer,\n QuestionDialog,\n} from './QuestionDialog/QuestionDialog';\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\n\nexport enum NPCDialogType {\n TextOnly = 'TextOnly',\n TextAndThumbnail = 'TextAndThumbnail',\n}\n\nexport interface INPCDialogProps {\n text?: string;\n type: NPCDialogType;\n imagePath?: string;\n onClose?: () => void;\n isQuestionDialog?: boolean;\n answers?: IQuestionDialogAnswer[];\n questions?: IQuestionDialog[];\n}\n\nexport const NPCDialog: React.FC<INPCDialogProps> = ({\n text,\n type,\n onClose,\n imagePath,\n isQuestionDialog = false,\n questions,\n answers,\n}) => {\n return (\n <RPGUIContainer\n type={RPGUIContainerTypes.FramedGold}\n width={isQuestionDialog ? '600px' : '80%'}\n height={'180px'}\n >\n {isQuestionDialog && questions && answers ? (\n <>\n <TextContainer\n flex={type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'}\n >\n <QuestionDialog\n questions={questions}\n answers={answers}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n {type === NPCDialogType.TextAndThumbnail && (\n <ThumbnailContainer>\n <NPCThumbnail src={imagePath || aliceDefaultThumbnail} />\n </ThumbnailContainer>\n )}\n </>\n ) : (\n <>\n <Container>\n <TextContainer\n flex={type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'}\n >\n <NPCDialogText\n type={type}\n text={text || 'No text provided.'}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n {type === NPCDialogType.TextAndThumbnail && (\n <ThumbnailContainer>\n <NPCThumbnail src={imagePath || aliceDefaultThumbnail} />\n </ThumbnailContainer>\n )}\n </Container>\n </>\n )}\n </RPGUIContainer>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n width: 100%;\n height: 100%;\n\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n position: relative;\n`;\n\ninterface ITextContainerProps {\n flex: string;\n}\n\nconst TextContainer = styled.div<ITextContainerProps>`\n flex: ${({ flex }) => flex} 0 0;\n width: 355px;\n`;\n\nconst ThumbnailContainer = styled.div`\n flex: 30% 0 0;\n display: flex;\n justify-content: flex-end;\n`;\n\nconst NPCThumbnail = styled.img`\n image-rendering: pixelated;\n height: 128px;\n width: 128px;\n`;\n","import React, { useEffect, useRef } from 'react';\nimport Draggable from 'react-draggable';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\nimport { IPosition } from '../types/eventTypes';\nimport { RPGUIContainerTypes } from './RPGUIContainer';\n\nexport interface IDraggableContainerProps {\n children: React.ReactNode;\n width?: string;\n height?: string;\n className?: string;\n type?: RPGUIContainerTypes;\n title?: string;\n imgSrc?: string;\n imgWidth?: string;\n onCloseButton?: () => void;\n cancelDrag?: string;\n onPositionChange?: (position: IPosition) => void;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n onOutsideClick?: () => void;\n initialPosition?: IPosition;\n scale?: number;\n}\n\nexport const DraggableContainer: React.FC<IDraggableContainerProps> = ({\n children,\n width = '50%',\n height,\n className,\n type = RPGUIContainerTypes.FramedGold,\n onCloseButton,\n title,\n imgSrc,\n imgWidth = '20px',\n cancelDrag,\n onPositionChange,\n onPositionChangeEnd,\n onPositionChangeStart,\n onOutsideClick,\n initialPosition = { x: 0, y: 0 },\n scale,\n}) => {\n const draggableRef = useRef(null);\n\n useOutsideClick(draggableRef, 'item-container');\n\n useEffect(() => {\n document.addEventListener('clickOutside', event => {\n const e = event as CustomEvent;\n\n if (e.detail.id === 'item-container') {\n if (onOutsideClick) {\n onOutsideClick();\n }\n }\n });\n\n return () => {\n document.removeEventListener('clickOutside', _e => {});\n };\n }, []);\n\n return (\n <Draggable\n cancel={`.container-close,${cancelDrag}`}\n onDrag={(_e, data) => {\n if (onPositionChange) {\n onPositionChange({\n x: data.x,\n y: data.y,\n });\n }\n }}\n onStop={(_e, data) => {\n if (onPositionChangeEnd) {\n onPositionChangeEnd({\n x: data.x,\n y: data.y,\n });\n }\n }}\n onStart={(_e, data) => {\n if (onPositionChangeStart) {\n onPositionChangeStart({\n x: data.x,\n y: data.y,\n });\n }\n }}\n defaultPosition={initialPosition}\n scale={scale}\n >\n <Container\n ref={draggableRef}\n width={width}\n height={height || 'auto'}\n className={`rpgui-container ${type} ${className}`}\n >\n {title && (\n <TitleContainer className=\"drag-handler\">\n <Title>\n {imgSrc && <Icon src={imgSrc} width={imgWidth} />}\n {title}\n </Title>\n </TitleContainer>\n )}\n {onCloseButton && (\n <CloseButton\n className=\"container-close\"\n onPointerDown={onCloseButton}\n >\n X\n </CloseButton>\n )}\n\n {children}\n </Container>\n </Draggable>\n );\n};\n\ninterface IContainerProps {\n width: string;\n height: string;\n}\n\nconst Container = styled.div<IContainerProps>`\n height: ${props => props.height};\n width: ${({ width }) => width};\n display: flex;\n flex-wrap: wrap;\n image-rendering: pixelated;\n\n &.rpgui-container {\n padding-top: 1.5rem;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 3px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 1.1rem;\n @media (max-width: 768px) {\n font-size: 1.3rem;\n padding: 3px;\n }\n`;\n\nconst TitleContainer = styled.div`\n width: 100%;\n height: 100%;\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n`;\n\nconst Title = styled.h1`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.large};\n`;\n\ninterface ICustomIconProps {\n width: string;\n}\n\nconst Icon = styled.img`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.xsmall};\n width: ${(props: ICustomIconProps) => props.width};\n margin-right: 0.5rem;\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport interface IOptionsProps {\n id: number;\n value: string;\n option: string | JSX.Element;\n}\n\nexport interface IDropdownProps {\n options: IOptionsProps[];\n width?: string;\n onChange: (value: string) => void;\n}\n\nexport const Dropdown: React.FC<IDropdownProps> = ({\n options,\n width,\n onChange,\n}) => {\n const dropdownId = uuidv4();\n\n const [selectedValue, setSelectedValue] = useState<string>('');\n const [selectedOption, setSelectedOption] = useState<string | JSX.Element>(\n ''\n );\n const [opened, setOpened] = useState<boolean>(false);\n\n useEffect(() => {\n const firstOption = options[0];\n\n if (firstOption) {\n let change = !selectedValue;\n if (!change) {\n change = options.filter((o) => o.value === selectedValue).length < 1;\n }\n\n /**\n * make a selection if there is no selected value already present\n * or if there is a selected value but its not in new options\n */\n if (change) {\n setSelectedValue(firstOption.value);\n setSelectedOption(firstOption.option);\n }\n }\n }, [options]);\n\n useEffect(() => {\n if (selectedValue) {\n onChange(selectedValue);\n }\n }, [selectedValue]);\n\n return (\n <Container onMouseLeave={() => setOpened(false)} width={width}>\n <DropdownSelect\n id={`dropdown-${dropdownId}`}\n className=\"rpgui-dropdown-imp rpgui-dropdown-imp-header\"\n onPointerDown={() => setOpened((prev) => !prev)}\n >\n <label>▼</label> {selectedOption}\n </DropdownSelect>\n\n <DropdownOptions className=\"rpgui-dropdown-imp\" opened={opened}>\n {options.map((option) => {\n return (\n <li\n key={option.id}\n onPointerDown={() => {\n setSelectedValue(option.value);\n setSelectedOption(option.option);\n setOpened(false);\n }}\n >\n {option.option}\n </li>\n );\n })}\n </DropdownOptions>\n </Container>\n );\n};\n\nconst Container = styled.div<{ width: string | undefined }>`\n position: relative;\n width: ${(props) => props.width || '100%'};\n`;\n\nconst DropdownSelect = styled.p`\n width: 100%;\n box-sizing: border-box;\n`;\n\nconst DropdownOptions = styled.ul<{\n opened: boolean;\n}>`\n position: absolute;\n width: 100%;\n display: ${(props) => (props.opened ? 'block' : 'none')};\n box-sizing: border-box;\n @media (max-width: 768px) {\n padding: 8px 0;\n }\n`;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport styled from 'styled-components';\n\nconst modalRoot = document.getElementById('modal-root')!;\n\ninterface ModalPortalProps {\n children: React.ReactNode;\n}\n\nconst ModalPortal: React.FC<ModalPortalProps> = ({ children }) => {\n return ReactDOM.createPortal(\n <Container className=\"rpgui-content\">{children}</Container>,\n modalRoot\n );\n};\n\nconst Container = styled.div`\n position: static !important;\n`;\n\nexport default ModalPortal;\n","import React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport { useOutsideClick } from '../hooks/useOutsideAlerter';\nimport ModalPortal from './Abstractions/ModalPortal';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface IRelativeMenuProps {\n options: IListMenuOption[];\n onSelected: (selectedOptionId: string) => void;\n fontSize?: number;\n onOutsideClick?: () => void;\n pos: { x: number; y: number };\n}\n\nexport const RelativeListMenu: React.FC<IRelativeMenuProps> = ({\n options,\n onSelected,\n onOutsideClick,\n fontSize = 0.8,\n pos,\n}) => {\n const ref = useRef(null);\n\n useOutsideClick(ref, 'relative-context-menu');\n\n useEffect(() => {\n document.addEventListener('clickOutside', event => {\n const e = event as CustomEvent;\n\n if (e.detail.id === 'relative-context-menu') {\n if (onOutsideClick) {\n onOutsideClick();\n }\n }\n });\n\n return () => {\n document.removeEventListener('clickOutside', _e => {});\n };\n }, []);\n\n return (\n <ModalPortal>\n <Container fontSize={fontSize} ref={ref} {...pos}>\n <ul className=\"rpgui-list-imp\" style={{ overflow: 'hidden' }}>\n {options.map((params, index) => (\n <ListElement\n key={params?.id || index}\n onPointerDown={() => {\n onSelected(params?.id);\n }}\n >\n {params?.text || 'No text'}\n </ListElement>\n ))}\n </ul>\n </Container>\n </ModalPortal>\n );\n};\n\ninterface IContainerProps {\n fontSize?: number;\n x: number;\n y: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n position: absolute;\n top: ${props => props.y}px;\n left: ${props => props.x}px;\n\n display: flex;\n flex-direction: column;\n width: max-content;\n justify-content: start;\n align-items: flex-start;\n\n li {\n font-size: ${props => props.fontSize}em;\n }\n`;\n\nconst ListElement = styled.li`\n margin-right: 0.5rem;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { ItemInfoDisplay } from './ItemInfoDisplay';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface MobileItemTooltipProps {\n item: IItem;\n atlasIMG: any;\n atlasJSON: any;\n closeTooltip: () => void;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n options?: IListMenuOption[];\n onSelected?: (selectedOptionId: string) => void;\n}\n\nexport const MobileItemTooltip: React.FC<MobileItemTooltipProps> = ({\n item,\n atlasIMG,\n atlasJSON,\n closeTooltip,\n equipmentSet,\n scale = 1,\n options,\n onSelected,\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n\n const handleFadeOut = () => {\n ref.current?.classList.add('fadeOut');\n };\n\n return (\n <ModalPortal>\n <Container\n ref={ref}\n onTouchEnd={() => {\n handleFadeOut();\n setTimeout(() => {\n closeTooltip();\n }, 100);\n }}\n scale={scale}\n >\n <ItemInfoDisplay\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n isMobile\n />\n <OptionsContainer>\n {options?.map(option => (\n <Option\n key={option.id}\n onTouchEnd={() => {\n handleFadeOut();\n setTimeout(() => {\n onSelected?.(option.id);\n closeTooltip();\n }, 100);\n }}\n >\n {option.text}\n </Option>\n ))}\n </OptionsContainer>\n </Container>\n </ModalPortal>\n );\n};\n\nconst Container = styled.div<{ scale: number }>`\n position: absolute;\n z-index: 100;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0 0 0 / 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 0.5rem;\n transition: opacity 0.08s;\n animation: fadeIn 0.1s forwards;\n\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 0.92;\n }\n }\n\n @keyframes fadeOut {\n 0% {\n opacity: 0.92;\n }\n 100% {\n opacity: 0;\n }\n }\n\n &.fadeOut {\n animation: fadeOut 0.1s forwards;\n }\n\n @media (max-width: 580px) {\n flex-direction: column;\n }\n`;\n\nconst OptionsContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n flex-wrap: wrap;\n\n @media (max-width: 580px) {\n flex-direction: row;\n justify-content: center;\n }\n`;\n\nconst Option = styled.button`\n padding: 1rem;\n background-color: #333;\n color: white;\n border: none;\n border-radius: 3px;\n width: 8rem;\n transition: background-color 0.1s;\n\n &:hover {\n background-color: #555;\n }\n\n @media (max-width: 580px) {\n padding: 1rem 0.5rem;\n }\n`;\n","import {\n ActionsForEquipmentSet,\n ActionsForInventory,\n ActionsForLoot,\n ActionsForMapContainer,\n DepotSocketEvents,\n IItem,\n ItemContainerType,\n ItemSocketEvents,\n ItemSocketEventsDisplayLabels,\n ItemType,\n} from '@rpg-engine/shared';\n\nexport interface IContextMenuItem {\n id: string;\n text: string;\n}\n\nconst generateContextMenuListOptions = (actionsByTypeList: any) => {\n const contextMenu: IContextMenuItem[] = actionsByTypeList.map(\n (action: string) => {\n return { id: action, text: ItemSocketEventsDisplayLabels[action] };\n }\n );\n return contextMenu;\n};\n\nexport const generateContextMenu = (\n item: IItem,\n itemContainerType: ItemContainerType | null,\n isDepotSystem?: boolean\n) => {\n let contextActionMenu: IContextMenuItem[] = [];\n\n if (itemContainerType === ItemContainerType.Inventory) {\n switch (item.type) {\n case ItemType.Weapon:\n case ItemType.Armor:\n case ItemType.Accessory:\n case ItemType.Jewelry:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Equipment\n );\n break;\n case ItemType.Container:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Container\n );\n break;\n case ItemType.Consumable:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Consumable\n );\n break;\n case ItemType.CraftingResource:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.CraftingResource\n );\n break;\n case ItemType.Tool:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Tool\n );\n break;\n\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForInventory.Other\n );\n break;\n }\n\n if (isDepotSystem) {\n contextActionMenu.push({\n id: DepotSocketEvents.Deposit,\n text: 'Deposit',\n });\n }\n }\n if (itemContainerType === ItemContainerType.Equipment) {\n switch (item.type) {\n case ItemType.Container:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForEquipmentSet.Container\n );\n\n break;\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForEquipmentSet.Equipment\n );\n }\n }\n if (itemContainerType === ItemContainerType.Loot) {\n switch (item.type) {\n case ItemType.Weapon:\n case ItemType.Armor:\n case ItemType.Accessory:\n case ItemType.Jewelry:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.Equipment\n );\n break;\n case ItemType.Consumable:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.Consumable\n );\n break;\n case ItemType.CraftingResource:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.CraftingResource\n );\n break;\n case ItemType.Tool:\n contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Tool);\n break;\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForLoot.Other\n );\n break;\n }\n }\n if (itemContainerType === ItemContainerType.MapContainer) {\n switch (item.type) {\n case ItemType.Weapon:\n case ItemType.Armor:\n case ItemType.Accessory:\n case ItemType.Jewelry:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Equipment\n );\n break;\n case ItemType.Consumable:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Consumable\n );\n break;\n case ItemType.CraftingResource:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.CraftingResource\n );\n break;\n case ItemType.Tool:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Tool\n );\n break;\n default:\n contextActionMenu = generateContextMenuListOptions(\n ActionsForMapContainer.Other\n );\n break;\n }\n\n const contextActionMenuDontHaveUseWith = !contextActionMenu.find(action =>\n action.text.toLowerCase().includes('use with')\n );\n\n if (item.hasUseWith && contextActionMenuDontHaveUseWith) {\n contextActionMenu.push({ id: 'use-with', text: 'Use with...' });\n }\n }\n if (itemContainerType === ItemContainerType.Depot) {\n contextActionMenu = [\n {\n id: ItemSocketEvents.GetItemInfo,\n text: ItemSocketEventsDisplayLabels.GetItemInfo,\n },\n { id: DepotSocketEvents.Withdraw, text: 'Withdraw' },\n ];\n }\n\n return contextActionMenu;\n};\n","import {\n getItemTextureKeyPath,\n IEquipmentSet,\n IItem,\n IItemContainer,\n ItemContainerType,\n ItemRarities,\n ItemSlotType,\n ItemType,\n} from '@rpg-engine/shared';\n\nimport { observer } from 'mobx-react-lite';\nimport React, { useEffect, useRef, useState } from 'react';\nimport Draggable from 'react-draggable';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport { IPosition } from '../../../types/eventTypes';\nimport { RelativeListMenu } from '../../RelativeListMenu';\nimport { Ellipsis } from '../../shared/Ellipsis';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\nimport { ItemTooltip } from '../Cards/ItemTooltip';\nimport { MobileItemTooltip } from '../Cards/MobileItemTooltip';\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { generateContextMenu, IContextMenuItem } from './itemContainerHelper';\n\nexport const EquipmentSlotSpriteByType: any = {\n Neck: 'accessories/corruption-necklace.png',\n LeftHand: 'swords/broad-sword.png',\n Ring: 'rings/iron-ring.png',\n Head: 'helmets/viking-helmet.png',\n Torso: 'armors/iron-armor.png',\n Legs: 'legs/studded-legs.png',\n Feet: 'boots/iron-boots.png',\n Inventory: 'containers/bag.png',\n RightHand: 'shields/plate-shield.png',\n Accessory: 'ranged-weapons/arrow.png',\n};\n\ninterface IProps {\n slotIndex: number;\n item: IItem | null;\n itemContainer?: IItemContainer | null;\n itemContainerType: ItemContainerType | null;\n slotSpriteMask?: ItemSlotType | null;\n onSelected: (selectedOption: string, item: IItem) => void;\n onMouseOver: (\n event: any,\n slotIndex: number,\n item: IItem | null,\n x: number,\n y: number\n ) => void;\n onMouseOut?: () => void;\n onPointerDown: (\n ItemType: ItemType,\n itemContainerType: ItemContainerType | null,\n item: IItem\n ) => void;\n onDragStart: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onDragEnd: (quantity?: number) => void;\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\n dragScale?: number;\n checkIfItemCanBeMoved: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n openQuantitySelector?: (maxQuantity: number, callback: () => void) => void;\n onPlaceDrop: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n atlasJSON: any;\n atlasIMG: any;\n isContextMenuDisabled?: boolean;\n isSelectingShortcut?: boolean;\n equipmentSet?: IEquipmentSet | null;\n setItemShortcut?: (item: IItem, shortcutIndex: number) => void;\n isDepotSystem?: boolean;\n}\n\nexport const ItemSlot: React.FC<IProps> = observer(\n ({\n slotIndex,\n item,\n itemContainerType: containerType,\n slotSpriteMask,\n onMouseOver,\n onMouseOut,\n onPointerDown,\n onSelected,\n atlasJSON,\n atlasIMG,\n isContextMenuDisabled = false,\n onDragEnd,\n onDragStart,\n onPlaceDrop,\n onOutsideDrop: onDrop,\n checkIfItemCanBeMoved,\n openQuantitySelector,\n checkIfItemShouldDragEnd,\n dragScale,\n isSelectingShortcut,\n equipmentSet,\n setItemShortcut,\n isDepotSystem,\n }) => {\n const [isTooltipVisible, setTooltipVisible] = useState(false);\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\n\n const [isContextMenuVisible, setIsContextMenuVisible] = useState(false);\n const [contextMenuPosition, setContextMenuPosition] = useState({\n x: 0,\n y: 0,\n });\n\n const [isFocused, setIsFocused] = useState(false);\n const [wasDragged, setWasDragged] = useState(false);\n const [dragPosition, setDragPosition] = useState<IPosition>({ x: 0, y: 0 });\n const [dropPosition, setDropPosition] = useState<IPosition | null>(null);\n const dragContainer = useRef<HTMLDivElement>(null);\n\n const [contextActions, setContextActions] = useState<IContextMenuItem[]>(\n []\n );\n\n useEffect(() => {\n setDragPosition({ x: 0, y: 0 });\n setIsFocused(false);\n\n if (item) {\n setContextActions(\n generateContextMenu(item, containerType, isDepotSystem)\n );\n }\n }, [item, isDepotSystem]);\n\n useEffect(() => {\n if (onDrop && item && dropPosition) {\n onDrop(item, dropPosition);\n }\n }, [dropPosition]);\n\n const getStackInfo = (itemId: string, stackQty: number) => {\n const isFractionalStackQty = stackQty % 1 !== 0;\n const isLargerThan999 = stackQty > 999;\n\n let qtyClassName = 'regular';\n if (isLargerThan999) qtyClassName = 'small';\n if (isFractionalStackQty) qtyClassName = 'xsmall';\n\n if (stackQty > 1) {\n return (\n <ItemQtyContainer key={`qty-${itemId}`}>\n <Ellipsis maxLines={1} maxWidth=\"48px\">\n <ItemQty className={qtyClassName}>\n {Math.round(stackQty * 100) / 100}{' '}\n </ItemQty>\n </Ellipsis>\n </ItemQtyContainer>\n );\n }\n return undefined;\n };\n\n const renderItem = (itemToRender: IItem | null) => {\n const element = [];\n\n if (itemToRender?.texturePath) {\n element.push(\n <ErrorBoundary key={itemToRender._id}>\n <SpriteFromAtlas\n key={itemToRender._id}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: itemToRender.texturePath,\n texturePath: itemToRender.texturePath,\n stackQty: itemToRender.stackQty || 1,\n isStackable: itemToRender.isStackable,\n },\n atlasJSON\n )}\n imgScale={3}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </ErrorBoundary>\n );\n }\n const stackInfo = getStackInfo(\n itemToRender?._id ?? '',\n itemToRender?.stackQty ?? 0\n );\n if (stackInfo) {\n element.push(stackInfo);\n }\n\n return element;\n };\n\n const renderEquipment = (itemToRender: IItem | null) => {\n if (\n itemToRender?.texturePath &&\n itemToRender.allowedEquipSlotType?.includes(slotSpriteMask!)\n ) {\n const element = [];\n\n element.push(\n <ErrorBoundary key={itemToRender._id}>\n <SpriteFromAtlas\n key={itemToRender._id}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: itemToRender.texturePath,\n texturePath: itemToRender.texturePath,\n stackQty: itemToRender.stackQty || 1,\n isStackable: itemToRender.isStackable,\n },\n atlasJSON\n )}\n imgScale={3}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </ErrorBoundary>\n );\n const stackInfo = getStackInfo(\n itemToRender?._id ?? '',\n itemToRender?.stackQty ?? 0\n );\n if (stackInfo) {\n element.push(stackInfo);\n }\n return element;\n } else {\n return (\n <ErrorBoundary key={uuidv4()}>\n <SpriteFromAtlas\n key={uuidv4()}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={EquipmentSlotSpriteByType[slotSpriteMask!]}\n imgScale={3}\n grayScale={true}\n opacity={0.4}\n imgClassname=\"sprite-from-atlas-img--item\"\n />\n </ErrorBoundary>\n );\n }\n };\n\n const onRenderSlot = (itemToRender: IItem | null) => {\n switch (containerType) {\n case ItemContainerType.Equipment:\n return renderEquipment(itemToRender);\n case ItemContainerType.Inventory:\n return renderItem(itemToRender);\n default:\n return renderItem(itemToRender);\n }\n };\n\n const resetItem = () => {\n setTooltipVisible(false);\n setWasDragged(false);\n };\n\n const onSuccesfulDrag = (quantity?: number) => {\n resetItem();\n\n if (quantity === -1) {\n setDragPosition({ x: 0, y: 0 });\n setIsFocused(false);\n } else if (item) {\n onDragEnd(quantity);\n }\n };\n\n return (\n <Container\n item={item}\n className=\"rpgui-icon empty-slot\"\n onMouseUp={() => {\n const data = item ? item : null;\n if (onPlaceDrop) onPlaceDrop(data, slotIndex, containerType);\n }}\n onTouchEnd={e => {\n const { clientX, clientY } = e.changedTouches[0];\n const simulatedEvent = new MouseEvent('mouseup', {\n clientX,\n clientY,\n bubbles: true,\n });\n\n document\n .elementFromPoint(clientX, clientY)\n ?.dispatchEvent(simulatedEvent);\n }}\n isSelectingShortcut={\n isSelectingShortcut &&\n (item?.type === ItemType.Consumable || item?.type === ItemType.Tool)\n }\n >\n <Draggable\n axis={isSelectingShortcut ? 'none' : 'both'}\n defaultClassName={item ? 'draggable' : 'empty-slot'}\n scale={dragScale}\n onStop={(e, data) => {\n const target = e.target as HTMLElement;\n if (\n target?.id.includes('shortcutSetter') &&\n setItemShortcut &&\n item\n ) {\n const index = parseInt(target.id.split('_')[1]);\n if (!isNaN(index)) {\n setItemShortcut(item, index);\n }\n }\n\n if (wasDragged && item && !isSelectingShortcut) {\n //@ts-ignore\n const classes: string[] = Array.from(e.target?.classList);\n\n const isOutsideDrop =\n classes.some(elm => {\n return elm.includes('rpgui-content');\n }) || classes.length === 0;\n\n if (isOutsideDrop) {\n setDropPosition({\n x: data.x,\n y: data.y,\n });\n }\n\n setWasDragged(false);\n\n const target = dragContainer.current;\n if (!target || !wasDragged) return;\n\n const style = window.getComputedStyle(target);\n const matrix = new DOMMatrixReadOnly(style.transform);\n const x = matrix.m41;\n const y = matrix.m42;\n\n setDragPosition({ x, y });\n\n setTimeout(() => {\n if (checkIfItemCanBeMoved()) {\n if (checkIfItemShouldDragEnd && !checkIfItemShouldDragEnd())\n return;\n\n if (\n item.stackQty &&\n item.stackQty !== 1 &&\n openQuantitySelector\n )\n openQuantitySelector(item.stackQty, onSuccesfulDrag);\n else onSuccesfulDrag(item.stackQty);\n } else {\n resetItem();\n setIsFocused(false);\n setDragPosition({ x: 0, y: 0 });\n }\n }, 100);\n } else if (item) {\n let isTouch = false;\n if (\n !isContextMenuDisabled &&\n e.type === 'touchend' &&\n !isSelectingShortcut\n ) {\n isTouch = true;\n setIsTooltipMobileVisible(true);\n }\n\n if (!isContextMenuDisabled && !isSelectingShortcut && !isTouch) {\n setIsContextMenuVisible(!isContextMenuVisible);\n const event = e as MouseEvent;\n\n if (event.clientX && event.clientY) {\n setContextMenuPosition({\n x: event.clientX - 10,\n y: event.clientY - 5,\n });\n }\n }\n\n onPointerDown(item.type, containerType, item);\n }\n }}\n onStart={() => {\n if (!item || isSelectingShortcut) {\n return;\n }\n\n if (onDragStart) {\n onDragStart(item, slotIndex, containerType);\n }\n }}\n onDrag={(_e, data) => {\n if (\n Math.abs(data.x - dragPosition.x) > 5 ||\n Math.abs(data.y - dragPosition.y) > 5\n ) {\n setWasDragged(true);\n setIsFocused(true);\n }\n }}\n position={dragPosition}\n cancel=\".empty-slot\"\n >\n <ItemContainer\n ref={dragContainer}\n isFocused={isFocused}\n onMouseOver={event => {\n onMouseOver(event, slotIndex, item, event.clientX, event.clientY);\n }}\n onMouseOut={() => {\n if (onMouseOut) onMouseOut();\n }}\n onMouseEnter={() => {\n setTooltipVisible(true);\n }}\n onMouseLeave={() => {\n setTooltipVisible(false);\n }}\n >\n {onRenderSlot(item)}\n </ItemContainer>\n </Draggable>\n\n {isTooltipVisible && item && !isFocused && (\n <ItemTooltip\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n />\n )}\n\n {isTooltipMobileVisible && item && (\n <MobileItemTooltip\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n closeTooltip={() => {\n setIsTooltipMobileVisible(false);\n }}\n scale={dragScale}\n options={contextActions}\n onSelected={(optionId: string) => {\n setIsContextMenuVisible(false);\n if (item) {\n onSelected(optionId, item);\n }\n }}\n />\n )}\n\n {!isContextMenuDisabled && isContextMenuVisible && contextActions && (\n <RelativeListMenu\n options={contextActions}\n onSelected={(optionId: string) => {\n setIsContextMenuVisible(false);\n if (item) {\n onSelected(optionId, item);\n }\n }}\n onOutsideClick={() => {\n setIsContextMenuVisible(false);\n }}\n pos={contextMenuPosition}\n />\n )}\n </Container>\n );\n }\n);\n\nexport const rarityColor = (item: IItem | null) => {\n switch (item?.rarity) {\n case ItemRarities.Uncommon:\n return 'rgba(13, 193, 13, 0.6)';\n case ItemRarities.Rare:\n return 'rgba(8, 104, 187, 0.6)';\n case ItemRarities.Epic:\n return 'rgba(191, 0, 255, 0.6)';\n case ItemRarities.Legendary:\n return 'rgba(255, 191, 0,0.6)';\n default:\n return null;\n }\n};\n\ninterface ContainerTypes {\n item: IItem | null;\n isSelectingShortcut?: boolean;\n}\n\nconst Container = styled.div<ContainerTypes>`\n margin: 0.1rem;\n .sprite-from-atlas-img--item {\n position: relative;\n top: 1.5rem;\n left: 1.5rem;\n border-color: ${({ item }) => rarityColor(item)};\n box-shadow: ${({ item }) => `0 0 5px 2px ${rarityColor(item)}`} inset, ${({\n item,\n}) => `0 0 4px 3px ${rarityColor(item)}`};\n //background-color: ${({ item }) => rarityColor(item)};\n }\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n border-radius: 12px;\n pointer-events: none;\n animation: ${({ isSelectingShortcut }) =>\n isSelectingShortcut ? 'bg-color-change 1s infinite' : 'none'};\n\n @keyframes bg-color-change {\n 0% {\n background-color: rgba(255 255 255 / 0.5);\n }\n 50% {\n background-color: transparent;\n }\n 100% {\n background-color: rgba(255 255 255 / 0.5);\n }\n }\n }\n`;\n\nconst ItemContainer = styled.div<{ isFocused?: boolean }>`\n width: 100%;\n height: 100%;\n position: relative;\n\n ${props => props.isFocused && 'z-index: 100; pointer-events: none;'}\n`;\n\nconst ItemQtyContainer = styled.div`\n position: relative;\n width: 85%;\n height: 16px;\n top: 25px;\n left: 2px;\n pointer-events: none;\n\n display: flex;\n justify-content: flex-end;\n`;\n\nconst ItemQty = styled.span`\n &.regular {\n font-size: ${uiFonts.size.small};\n }\n &.small {\n font-size: ${uiFonts.size.xsmall};\n }\n &.xsmall {\n font-size: ${uiFonts.size.xxsmall};\n }\n`;\n","import { IItem } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';\nimport { ErrorBoundary } from '../Inventory/ErrorBoundary';\nimport { EquipmentSlotSpriteByType, rarityColor } from '../Inventory/ItemSlot';\n\ninterface IItemInfoProps {\n item: IItem;\n itemToCompare?: IItem;\n atlasIMG: any;\n atlasJSON: any;\n}\n\ninterface IItemStat {\n key: keyof IItem;\n label?: string;\n higherIsWorse?: boolean;\n}\n\nconst statisticsToDisplay: IItemStat[] = [\n { key: 'attack' },\n { key: 'defense' },\n { key: 'maxRange', label: 'Range' },\n { key: 'weight', higherIsWorse: true },\n];\n\nexport const ItemInfo: React.FC<IItemInfoProps> = ({\n item,\n itemToCompare,\n atlasIMG,\n atlasJSON,\n}) => {\n const renderStatistics = () => {\n const statistics = [];\n\n for (const stat of statisticsToDisplay) {\n const itemStatistic = item[stat.key];\n\n if (itemStatistic) {\n const label =\n stat.label || stat.key[0].toUpperCase() + stat.key.slice(1);\n\n const isItemToCompare = !!itemToCompare;\n\n const isOnlyInOneItem = isItemToCompare && !itemToCompare?.[stat.key];\n const statDiff =\n parseInt(itemStatistic.toString()) -\n parseInt(itemToCompare?.[stat.key]?.toString() ?? '0');\n\n const isDifference = isItemToCompare && statDiff !== 0;\n const isBetter =\n (statDiff > 0 && !stat.higherIsWorse) ||\n (statDiff < 0 && stat.higherIsWorse);\n\n statistics.push(\n <Statistic key={stat.key} className={isOnlyInOneItem ? 'better' : ''}>\n <div className=\"label\">{label}:</div>\n <div\n className={`value ${\n isDifference ? (isBetter ? 'better' : 'worse') : ''\n }`}\n >\n {`${itemStatistic.toString()} ${\n isDifference ? `(${statDiff > 0 ? '+' : ''}${statDiff})` : ''\n }`}\n </div>\n </Statistic>\n );\n }\n }\n\n return statistics;\n };\n\n const renderMissingStatistic = () => {\n const statistics = [];\n\n for (const stat of statisticsToDisplay) {\n const itemToCompareStatistic = itemToCompare?.[stat.key];\n\n if (itemToCompareStatistic && !item[stat.key]) {\n const label =\n stat.label || stat.key[0].toUpperCase() + stat.key.slice(1);\n\n statistics.push(\n <Statistic key={stat.key} className=\"worse\">\n <div className=\"label\">{label}:</div>\n <div className=\"value worse\">\n {itemToCompareStatistic.toString()}\n </div>\n </Statistic>\n );\n }\n }\n\n return statistics;\n };\n\n const renderAvaibleSlots = () => {\n if (!item.allowedEquipSlotType) return null;\n\n return item.allowedEquipSlotType.map((slotType, index) => (\n <ErrorBoundary key={index}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={EquipmentSlotSpriteByType[slotType]}\n imgScale={2}\n grayScale={true}\n opacity={0.4}\n containerStyle={{ width: '32px', height: '32px' }}\n />\n </ErrorBoundary>\n ));\n };\n\n return (\n <Container item={item}>\n <Header>\n <div>\n <Title>{item.name}</Title>\n {item.rarity !== 'Common' && (\n <Rarity item={item}>{item.rarity}</Rarity>\n )}\n <Type>{item.subType}</Type>\n </div>\n <AllowedSlots>{renderAvaibleSlots()}</AllowedSlots>\n </Header>\n\n {renderStatistics()}\n {item.isTwoHanded && <Statistic>Two handed</Statistic>}\n\n <Description>{item.description}</Description>\n\n {item.maxStackSize && item.maxStackSize !== 1 && (\n <StackInfo>\n x{Math.round((item.stackQty ?? 1) * 100) / 100}({item.maxStackSize})\n </StackInfo>\n )}\n\n {renderMissingStatistic().length > 0 && (\n <MissingStatistics>\n <Statistic>Equipped Diff</Statistic>\n {itemToCompare && renderMissingStatistic()}\n </MissingStatistics>\n )}\n </Container>\n );\n};\n\nconst Container = styled.div<{ item: IItem }>`\n color: white;\n background-color: #222;\n border-radius: 5px;\n padding: 0.5rem;\n font-size: ${uiFonts.size.small};\n border: 3px solid ${({ item }) => rarityColor(item) ?? uiColors.lightGray};\n height: max-content;\n width: 15rem;\n\n @media (max-width: 580px) {\n width: 80vw;\n }\n`;\n\nconst Title = styled.div`\n font-size: ${uiFonts.size.medium};\n font-weight: bold;\n margin-bottom: 0.5rem;\n display: flex;\n align-items: center;\n margin: 0;\n`;\n\nconst Rarity = styled.div<{ item: IItem }>`\n font-size: ${uiFonts.size.small};\n font-weight: normal;\n margin-top: 0.2rem;\n color: ${({ item }) => rarityColor(item)};\n filter: brightness(1.5);\n`;\n\nconst Type = styled.div`\n font-size: ${uiFonts.size.small};\n margin-top: 0.2rem;\n color: ${uiColors.lightGray};\n`;\n\nconst Statistic = styled.div`\n margin-bottom: 0.4rem;\n width: max-content;\n\n .label {\n display: inline-block;\n margin-right: 0.5rem;\n color: inherit;\n }\n\n .value {\n display: inline-block;\n color: inherit;\n }\n\n &.better,\n .better {\n color: ${uiColors.lightGreen};\n }\n\n &.worse,\n .worse {\n color: ${uiColors.cardinal};\n }\n`;\n\nconst Description = styled.div`\n margin-top: 1.5rem;\n font-size: ${uiFonts.size.small};\n color: ${uiColors.lightGray};\n font-style: italic;\n`;\n\nconst Header = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n`;\n\nconst AllowedSlots = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n margin-left: auto;\n align-self: flex-start;\n`;\n\nconst StackInfo = styled.div`\n width: 100%;\n text-align: right;\n font-size: ${uiFonts.size.small};\n color: ${uiColors.orange};\n margin-top: 1rem;\n`;\n\nconst MissingStatistics = styled.div`\n margin-top: 1rem;\n color: ${uiColors.cardinal};\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport { camelCase } from 'lodash';\nimport React, { useMemo } from 'react';\nimport styled from 'styled-components';\nimport { ItemInfo } from './ItemInfo';\n\nexport interface IItemInfoDisplayProps {\n item: IItem;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n isMobile?: boolean;\n}\n\ntype EquipmentSlotTypes =\n | 'head'\n | 'neck'\n | 'leftHand'\n | 'rightHand'\n | 'ring'\n | 'legs'\n | 'boot'\n | 'accessory'\n | 'armor'\n | 'inventory';\n\nconst itemSlotTypes: EquipmentSlotTypes[] = [\n 'head',\n 'neck',\n 'leftHand',\n 'rightHand',\n 'ring',\n 'legs',\n 'boot',\n 'accessory',\n 'armor',\n 'inventory',\n];\n\nconst getSlotType = (\n itemSlotTypes: string[],\n slotType: string,\n subType: string\n): keyof IEquipmentSet => {\n if (!itemSlotTypes.includes(slotType)) {\n return subType as keyof IEquipmentSet;\n }\n return slotType as keyof IEquipmentSet;\n};\n\nexport const ItemInfoDisplay: React.FC<IItemInfoDisplayProps> = ({\n item,\n atlasIMG,\n atlasJSON,\n equipmentSet,\n isMobile,\n}) => {\n const itemToCompare = useMemo(() => {\n if (equipmentSet && item.allowedEquipSlotType?.length) {\n const allowedSlotTypeCamelCase = camelCase(item.allowedEquipSlotType[0]);\n const itemSubTypeCamelCase = camelCase(item.subType);\n\n const slotType = getSlotType(\n itemSlotTypes,\n allowedSlotTypeCamelCase,\n itemSubTypeCamelCase\n );\n\n const itemFromEquipment = equipmentSet[slotType] as IItem;\n\n if (\n itemFromEquipment &&\n (!item._id || itemFromEquipment._id !== item._id)\n ) {\n return itemFromEquipment;\n }\n }\n\n return undefined;\n }, [equipmentSet, item]);\n\n return (\n <Flex $isMobile={isMobile}>\n <ItemInfo\n item={item}\n itemToCompare={itemToCompare}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n {itemToCompare && (\n <CompareContainer>\n <Equipped>\n <span>Equipped</span>\n </Equipped>\n <ItemInfo\n item={itemToCompare}\n itemToCompare={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n </CompareContainer>\n )}\n </Flex>\n );\n};\n\nconst Flex = styled.div<{ $isMobile?: boolean }>`\n display: flex;\n gap: 0.5rem;\n flex-direction: ${({ $isMobile }) => ($isMobile ? 'row-reverse' : 'row')};\n\n @media (max-width: 580px) {\n flex-direction: column-reverse;\n align-items: center;\n }\n`;\n\nconst Equipped = styled.div`\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n`;\n\nconst CompareContainer = styled.div`\n position: relative;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { ItemInfoDisplay } from './ItemInfoDisplay';\n\nexport interface IItemTooltipProps {\n item: IItem;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n}\n\nconst offset = 20;\n\nexport const ItemTooltip: React.FC<IItemTooltipProps> = ({\n item,\n atlasIMG,\n atlasJSON,\n equipmentSet,\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const { current } = ref;\n\n if (current) {\n const handleMouseMove = (event: MouseEvent) => {\n const { clientX, clientY } = event;\n\n // Adjust the position of the tooltip based on the mouse position\n const rect = current.getBoundingClientRect();\n\n const tooltipWidth = rect.width;\n const tooltipHeight = rect.height;\n const isOffScreenRight =\n clientX + tooltipWidth + offset > window.innerWidth;\n const isOffScreenBottom =\n clientY + tooltipHeight + offset > window.innerHeight;\n const x = isOffScreenRight\n ? clientX - tooltipWidth - offset\n : clientX + offset;\n const y = isOffScreenBottom\n ? clientY - tooltipHeight - offset\n : clientY + offset;\n\n current.style.transform = `translate(${x}px, ${y}px)`;\n current.style.opacity = '1';\n };\n\n window.addEventListener('mousemove', handleMouseMove);\n\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n };\n }\n\n return;\n }, []);\n\n return (\n <ModalPortal>\n <Container ref={ref}>\n <ItemInfoDisplay\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n />\n </Container>\n </ModalPortal>\n );\n};\n\nconst Container = styled.div`\n position: absolute;\n z-index: 100;\n pointer-events: none;\n left: 0;\n top: 0;\n opacity: 0;\n transition: opacity 0.08s;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport { ItemTooltip } from './ItemTooltip';\nimport { MobileItemTooltip } from './MobileItemTooltip';\n\ninterface IItemInfoWrapperProps {\n item: IItem;\n children: React.ReactNode;\n atlasIMG: any;\n atlasJSON: any;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n}\n\nexport const ItemInfoWrapper: React.FC<IItemInfoWrapperProps> = ({\n children,\n atlasIMG,\n atlasJSON,\n item,\n equipmentSet,\n scale,\n}) => {\n const [isTooltipVisible, setIsTooltipVisible] = useState(false);\n const [isTooltipMobileVisible, setIsTooltipMobileVisible] = useState(false);\n\n return (\n <div\n onMouseEnter={() => {\n if (!isTooltipMobileVisible) setIsTooltipVisible(true);\n }}\n onMouseLeave={setIsTooltipVisible.bind(null, false)}\n onTouchEnd={() => {\n setIsTooltipMobileVisible(true);\n setIsTooltipVisible(false);\n }}\n >\n {children}\n\n {isTooltipVisible && !isTooltipMobileVisible && (\n <ItemTooltip\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n item={item}\n />\n )}\n {isTooltipMobileVisible && (\n <MobileItemTooltip\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n closeTooltip={() => {\n setIsTooltipMobileVisible(false);\n console.log('close');\n }}\n item={item}\n scale={scale}\n />\n )}\n </div>\n );\n};\n","import { ICraftableItem, IEquipmentSet, ItemSubType } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Dropdown, IOptionsProps } from '../Dropdown';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nexport interface IItemCraftSelectorProps {\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onSelect: (value: string) => void;\n onCraftItem: (value: string | undefined) => void;\n craftablesItems: ICraftableItem[];\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n}\n\nexport interface ShowMessage {\n show: boolean;\n index: number;\n}\n\nexport const CraftBook: React.FC<IItemCraftSelectorProps> = ({\n atlasIMG,\n atlasJSON,\n onClose,\n onSelect,\n onCraftItem,\n craftablesItems,\n equipmentSet,\n scale,\n}) => {\n let optionsId: number = 0;\n const [isShown, setIsShown] = useState<ShowMessage>({\n show: false,\n index: 200,\n });\n const [craftItem, setCraftItem] = useState<string>();\n\n const getDropdownOptions = () => {\n const options: IOptionsProps[] = [];\n\n Object.keys(ItemSubType).forEach(key => {\n if (key === 'DeadBody') {\n return; // we can't craft crafting resouces...\n }\n\n options.push({\n id: optionsId,\n value: key,\n option: key,\n });\n optionsId += 1;\n });\n\n return options;\n };\n\n const modifyString = (str: string) => {\n // Split the string by \"/\" and \".\"\n let parts = str.split('/');\n let fileName = parts[parts.length - 1];\n parts = fileName.split('.');\n let name = parts[0];\n\n // Replace all occurrences of \"-\" with \" \"\n name = name.replace(/-/g, ' ');\n\n // Uppercase the first word\n let words = name.split(' ');\n let firstWord = words[0].slice(0, 1).toUpperCase() + words[0].slice(1);\n let modifiedWords = [firstWord].concat(words.slice(1));\n name = modifiedWords.join(' ');\n\n return name;\n };\n\n const handleClick = (value: string) => {\n setCraftItem(value);\n };\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n width=\"500px\"\n cancelDrag=\".inputRadioCraftBook\"\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n scale={scale}\n >\n <div style={{ width: '100%' }}>\n <Title>Craftbook</Title>\n <Subtitle>Select an item to craft</Subtitle>\n <hr className=\"golden\" />\n </div>\n <Dropdown\n options={getDropdownOptions()}\n onChange={value => onSelect(value)}\n />\n <RadioInputScroller className=\"inputRadioCraftBook\">\n {craftablesItems?.map((option, index) => (\n <RadioOptionsWrapper key={index}>\n <SpriteAtlasWrapper>\n <ItemInfoWrapper\n item={option}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={option.texturePath}\n imgScale={3}\n grayScale={!option.canCraft}\n />\n </ItemInfoWrapper>\n </SpriteAtlasWrapper>\n <div>\n <div onPointerDown={() => handleClick(option.key)}>\n <input\n className=\"rpgui-radio\"\n type=\"radio\"\n value={option.name}\n name=\"test\"\n disabled={!option.canCraft}\n checked={craftItem === option.key}\n onChange={() => handleClick(option.key)}\n />\n <label\n onPointerDown={() => {\n handleClick(option.key);\n }}\n onTouchEnd={() => {\n setIsShown({ show: true, index: index });\n }}\n style={{ display: 'flex', alignItems: 'center' }}\n onMouseEnter={() => setIsShown({ show: true, index: index })}\n onMouseLeave={() => setIsShown({ show: false, index: index })}\n >\n {modifyString(option.name)}\n </label>\n </div>\n\n {isShown &&\n isShown.index === index &&\n option.ingredients.map((option, index) => (\n <Recipes key={index}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={option.texturePath}\n imgScale={1}\n />\n <StyledItem>\n {modifyString(option.key)} ({option.qty}x)\n </StyledItem>\n </Recipes>\n ))}\n {isShown && isShown.index === index && (\n <MinCraftingRequirementsText\n levelIsOk={option?.levelIsOk ?? false}\n >\n {modifyString(\n `${option?.minCraftingRequirements?.[0] ?? ''} ${option\n ?.minCraftingRequirements?.[1] ?? ''}`\n )}\n </MinCraftingRequirementsText>\n )}\n </div>\n </RadioOptionsWrapper>\n ))}\n </RadioInputScroller>\n <ButtonWrapper>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onCraftItem(craftItem)}\n >\n Craft\n </Button>\n </ButtonWrapper>\n </DraggableContainer>\n );\n};\n\nconst StyledItem = styled.div`\n margin-left: 10px;\n`;\n\nconst Recipes = styled.div`\n font-size: 0.6rem;\n color: yellow !important;\n margin-bottom: 3px;\n display: flex;\n align-items: center;\n\n .sprite-from-atlas-img {\n top: 0px;\n left: 0px;\n }\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: yellow !important;\n`;\nconst Subtitle = styled.h1`\n font-size: 0.4rem;\n color: yellow !important;\n`;\n\nconst RadioInputScroller = styled.div`\n padding-left: 15px;\n padding-top: 10px;\n width: 100%;\n margin-top: 1rem;\n align-items: center;\n margin-left: 20px;\n align-items: flex-start;\n overflow-y: scroll;\n height: 360px;\n -webkit-overflow-scrolling: touch;\n`;\n\nconst SpriteAtlasWrapper = styled.div`\n margin-right: 40px;\n`;\n\nconst RadioOptionsWrapper = styled.div`\n display: flex;\n align-items: stretch;\n margin-bottom: 40px;\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n padding-top: 20px;\n width: 100%;\n button {\n padding: 0px 50px;\n }\n`;\n\nconst MinCraftingRequirementsText = styled.div<{ levelIsOk: boolean }>`\n font-size: 0.6rem;\n font-weight: bold;\n color: ${({ levelIsOk }) => (levelIsOk ? '#72f100' : 'gray')};\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { Dropdown } from './Dropdown';\n\ninterface IDropdownSelectorOption {\n id: string;\n name: string;\n}\n\nexport interface IDropdownSelectorContainer {\n onChange: (id: string) => void;\n options: IDropdownSelectorOption[];\n details?: string;\n title: string;\n}\n\nexport const DropdownSelectorContainer: React.FC<IDropdownSelectorContainer> = ({\n title,\n onChange,\n options,\n details,\n}) => {\n return (\n <div>\n <p>{title}</p>\n <Dropdown\n options={options.map((option, index) => ({\n option: option.name,\n value: option.id,\n id: index,\n }))}\n onChange={onChange}\n />\n <Details>{details}</Details>\n </div>\n );\n};\n\nconst Details = styled.p`\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n","import {\n IEquipmentSet,\n IItem,\n IItemContainer,\n ItemContainerType,\n ItemSlotType,\n ItemType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { IPosition } from '../../types/eventTypes';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { ItemSlot } from '../Item/Inventory/ItemSlot';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\n\nexport interface IEquipmentSetProps {\n equipmentSet: IEquipmentSet;\n onClose?: () => void;\n onItemClick?: (\n ItemType: ItemType,\n item: IItem,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragStart?: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragEnd?: (quantity?: number) => void;\n onItemPlaceDrop?: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemOutsideDrop?: (item: IItem, position: IPosition) => void;\n scale?: number;\n checkIfItemCanBeMoved: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;\n onSelected?: (optionId: string) => void;\n initialPosition?: { x: number; y: number };\n type: ItemContainerType | null;\n atlasIMG: any;\n atlasJSON: any;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n}\n\nexport const EquipmentSet: React.FC<IEquipmentSetProps> = ({\n equipmentSet,\n onClose,\n onMouseOver,\n onSelected,\n onItemClick,\n atlasIMG,\n atlasJSON,\n onItemDragEnd,\n onItemDragStart,\n onItemPlaceDrop,\n onItemOutsideDrop,\n checkIfItemCanBeMoved,\n checkIfItemShouldDragEnd,\n scale,\n initialPosition,\n onPositionChangeEnd,\n onPositionChangeStart,\n}) => {\n const {\n neck,\n leftHand,\n ring,\n head,\n armor,\n legs,\n boot,\n inventory,\n rightHand,\n accessory,\n } = equipmentSet;\n\n const equipmentData = [\n neck,\n leftHand,\n ring,\n head,\n armor,\n legs,\n boot,\n inventory,\n rightHand,\n accessory,\n ];\n\n const equipmentMaskSlots = [\n ItemSlotType.Neck,\n ItemSlotType.LeftHand,\n ItemSlotType.Ring,\n ItemSlotType.Head,\n ItemSlotType.Torso,\n ItemSlotType.Legs,\n ItemSlotType.Feet,\n ItemSlotType.Inventory,\n ItemSlotType.RightHand,\n ItemSlotType.Accessory,\n ];\n\n const onRenderEquipmentSlotRange = (start: number, end: number) => {\n const equipmentRange = equipmentData.slice(start, end);\n const slotMaksRange = equipmentMaskSlots.slice(start, end);\n\n return equipmentRange.map((data, i) => {\n const item = data as IItem;\n const itemContainer =\n (item && (item.itemContainer as IItemContainer)) ?? null;\n\n return (\n <ItemSlot\n key={i}\n slotIndex={i}\n item={item}\n itemContainer={itemContainer}\n itemContainerType={ItemContainerType.Equipment}\n slotSpriteMask={slotMaksRange[i]}\n onMouseOver={(event, slotIndex, item) => {\n if (onMouseOver) onMouseOver(event, slotIndex, item);\n }}\n onPointerDown={(itemType, ContainerType) => {\n if (onItemClick) onItemClick(itemType, item, ContainerType);\n }}\n onSelected={(optionId: string) => {\n if (onSelected) onSelected(optionId);\n }}\n onDragStart={(item, slotIndex, itemContainerType) => {\n if (!item) {\n return;\n }\n\n if (onItemDragStart)\n onItemDragStart(item, slotIndex, itemContainerType);\n }}\n onDragEnd={quantity => {\n if (onItemDragEnd) onItemDragEnd(quantity);\n }}\n dragScale={scale}\n checkIfItemCanBeMoved={checkIfItemCanBeMoved}\n checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}\n onPlaceDrop={(item, slotIndex, itemContainerType) => {\n if (onItemPlaceDrop)\n onItemPlaceDrop(item, slotIndex, itemContainerType);\n }}\n onOutsideDrop={(item, position) => {\n if (onItemOutsideDrop) onItemOutsideDrop(item, position);\n }}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n );\n });\n };\n\n return (\n <DraggableContainer\n title={'Equipments'}\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"330px\"\n cancelDrag=\".equipment-container-body\"\n scale={scale}\n initialPosition={initialPosition}\n onPositionChangeEnd={onPositionChangeEnd}\n onPositionChangeStart={onPositionChangeStart}\n >\n <EquipmentSetContainer className=\"equipment-container-body\">\n <EquipmentColumn>{onRenderEquipmentSlotRange(0, 3)}</EquipmentColumn>\n <EquipmentColumn>{onRenderEquipmentSlotRange(3, 7)}</EquipmentColumn>\n <EquipmentColumn>{onRenderEquipmentSlotRange(7, 10)}</EquipmentColumn>\n </EquipmentSetContainer>\n </DraggableContainer>\n );\n};\n\nconst EquipmentSetContainer = styled.div`\n width: inherit;\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n flex-direction: row;\n touch-action: none;\n`;\n\nconst EquipmentColumn = styled.div`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n flex-direction: column;\n touch-action: none;\n`;\n","import { isMobileOrTablet } from '@rpg-engine/shared';\n\nexport const IS_MOBILE_OR_TABLET = isMobileOrTablet();\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n text: string;\n onFinish?: () => void;\n onStart?: () => void;\n}\n\nexport const DynamicText: React.FC<IProps> = ({ text, onFinish, onStart }) => {\n const [textState, setTextState] = useState<string>('');\n\n useEffect(() => {\n let i = 0;\n const interval = setInterval(() => {\n // on every interval, show one more character\n\n if (i === 0) {\n if (onStart) {\n onStart();\n }\n }\n\n if (i < text.length) {\n setTextState(text.substring(0, i + 1));\n i++;\n } else {\n clearInterval(interval);\n if (onFinish) {\n onFinish();\n }\n }\n }, 50);\n\n return () => {\n clearInterval(interval);\n };\n }, [text]);\n\n return <TextContainer>{textState}</TextContainer>;\n};\n\nconst TextContainer = styled.p`\n font-size: 0.7rem !important;\n color: white;\n text-shadow: 1px 1px 0px #000000;\n letter-spacing: 1.2px;\n word-break: normal;\n`;\n","import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { NPCDialogType } from '../..';\nimport { IS_MOBILE_OR_TABLET } from '../../constants/uiDevices';\nimport { chunkString } from '../../libs/StringHelpers';\nimport { DynamicText } from '../typography/DynamicText';\nimport pressButtonGif from './img/press-button.gif';\nimport pressSpaceGif from './img/space.gif';\n\ninterface IProps {\n text: string;\n onClose: () => void;\n onEndStep?: () => void;\n onStartStep?: () => void;\n type?: NPCDialogType;\n}\n\nexport const NPCDialogText: React.FC<IProps> = ({\n text,\n onClose,\n onEndStep,\n onStartStep,\n type,\n}) => {\n const windowSize = useRef([window.innerWidth, window.innerHeight]);\n function maxCharacters(width: number) {\n // Set the font size to 16 pixels\n var fontSize = 11.2;\n\n // Calculate the number of characters that can fit in one line\n var charactersPerLine = Math.floor(width / 2 / fontSize);\n\n // Calculate the number of lines that can fit in the div\n var linesPerDiv = Math.floor(180 / fontSize);\n\n // Calculate the maximum number of characters that can fit in the div\n var maxCharacters = charactersPerLine * linesPerDiv;\n\n // Return the maximum number of characters\n return Math.round(maxCharacters / 5);\n }\n\n const textChunks = chunkString(text, maxCharacters(windowSize.current[0]));\n\n const [chunkIndex, setChunkIndex] = useState<number>(0);\n const onHandleSpacePress = (event: KeyboardEvent) => {\n if (event.code === 'Space') {\n goToNextStep();\n }\n };\n\n const goToNextStep = () => {\n const hasNextChunk = textChunks?.[chunkIndex + 1] || false;\n\n if (hasNextChunk) {\n setChunkIndex(prev => prev + 1);\n } else {\n // if there's no more text chunks, close the dialog\n onClose();\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onHandleSpacePress);\n\n return () => document.removeEventListener('keydown', onHandleSpacePress);\n }, [chunkIndex]);\n\n const [showGoNextIndicator, setShowGoNextIndicator] = useState<boolean>(\n false\n );\n\n return (\n <Container>\n <DynamicText\n text={textChunks?.[chunkIndex] || ''}\n onFinish={() => {\n setShowGoNextIndicator(true);\n\n onEndStep && onEndStep();\n }}\n onStart={() => {\n setShowGoNextIndicator(false);\n\n onStartStep && onStartStep();\n }}\n />\n {showGoNextIndicator && (\n <PressSpaceIndicator\n right={type === NPCDialogType.TextOnly ? '1rem' : '10.5rem'}\n src={IS_MOBILE_OR_TABLET ? pressButtonGif : pressSpaceGif}\n onPointerDown={() => {\n goToNextStep();\n }}\n />\n )}\n </Container>\n );\n};\n\nconst Container = styled.div``;\n\ninterface IPressSpaceIndicatorProps {\n right: string;\n}\n\nconst PressSpaceIndicator = styled.img<IPressSpaceIndicatorProps>`\n position: absolute;\n right: ${({ right }) => right};\n bottom: 1rem;\n height: 20.7px;\n image-rendering: -webkit-optimize-contrast;\n`;\n","export const chunkString = (str: string, length: number) => {\n return str.match(new RegExp('.{1,' + length + '}', 'g'));\n};\n","import React from 'react';\n\n//@ts-ignore\nexport const useEventListener = (type, handler, el = window) => {\n const savedHandler = React.useRef();\n\n React.useEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n\n React.useEffect(() => {\n //@ts-ignore\n const listener = e => savedHandler.current(e);\n\n el.addEventListener(type, listener);\n\n return () => {\n el.removeEventListener(type, listener);\n };\n }, [type, el]);\n};\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { useEventListener } from '../../../hooks/useEventListener';\nimport { DynamicText } from '../../typography/DynamicText';\n\nexport interface IQuestionDialogAnswer {\n id: number;\n text: string;\n nextQuestionId?: number;\n}\n\nexport interface IQuestionDialog {\n id: number;\n text: string;\n answerIds?: number[];\n}\n\nexport interface IProps {\n questions: IQuestionDialog[];\n answers: IQuestionDialogAnswer[];\n onClose: () => void;\n}\n\nexport const QuestionDialog: React.FC<IProps> = ({\n questions,\n answers,\n onClose,\n}) => {\n const [currentQuestion, setCurrentQuestion] = useState(questions[0]);\n\n const [canShowAnswers, setCanShowAnswers] = useState<boolean>(false);\n\n const onGetFirstAnswer = () => {\n if (!currentQuestion.answerIds || currentQuestion.answerIds.length === 0) {\n return null;\n }\n\n const firstAnswerId = currentQuestion.answerIds![0];\n\n return answers.find(answer => answer.id === firstAnswerId);\n };\n\n const [\n currentAnswer,\n setCurrentAnswer,\n ] = useState<IQuestionDialogAnswer | null>(onGetFirstAnswer()!);\n\n useEffect(() => {\n setCurrentAnswer(onGetFirstAnswer()!);\n }, [currentQuestion]);\n\n const onGetAnswers = (answerIds: number[]) => {\n return answerIds.map((answerId: number) =>\n answers.find(answer => answer.id === answerId)\n );\n };\n\n const onKeyPress = (e: KeyboardEvent) => {\n switch (e.key) {\n case 'ArrowDown':\n // select next answer, if any.\n // if no next answer, select first answer\n // const nextAnswer = onGetAnswers(currentQuestion.answerIds!).find(\n // (answer) => answer?.id === currentAnswer!.id + 1\n // );\n\n const nextAnswerIndex = onGetAnswers(\n currentQuestion.answerIds!\n ).findIndex(answer => answer?.id === currentAnswer!.id + 1);\n\n const nextAnswerID = currentQuestion.answerIds![nextAnswerIndex];\n\n const nextAnswer = onGetAnswers(currentQuestion.answerIds!).find(\n answer => answer?.id === nextAnswerID\n );\n\n setCurrentAnswer(nextAnswer || onGetFirstAnswer()!);\n\n break;\n case 'ArrowUp':\n // select previous answer, if any.\n // if no previous answer, select last answer\n\n const previousAnswerIndex = onGetAnswers(\n currentQuestion.answerIds!\n ).findIndex(answer => answer?.id === currentAnswer!.id - 1);\n\n const previousAnswerID =\n currentQuestion.answerIds &&\n currentQuestion.answerIds[previousAnswerIndex];\n\n const previousAnswer = onGetAnswers(currentQuestion.answerIds!).find(\n answer => answer?.id === previousAnswerID\n );\n\n if (previousAnswer) {\n setCurrentAnswer(previousAnswer);\n } else {\n setCurrentAnswer(onGetAnswers(currentQuestion.answerIds!).pop()!);\n }\n\n break;\n case 'Enter':\n setCanShowAnswers(false);\n\n if (!currentAnswer?.nextQuestionId) {\n onClose();\n return;\n } else {\n setCurrentQuestion(\n questions.find(\n question => question.id === currentAnswer!.nextQuestionId\n )!\n );\n }\n\n break;\n }\n };\n useEventListener('keydown', onKeyPress);\n\n const onAnswerClick = (answer: IQuestionDialogAnswer) => {\n setCanShowAnswers(false);\n if (answer.nextQuestionId) {\n // if there is a next question, go to it\n setCurrentQuestion(\n questions.find(question => question.id === answer.nextQuestionId)!\n );\n } else {\n // else, finish dialog!\n onClose();\n }\n };\n\n const onRenderCurrentAnswers = () => {\n const answerIds = currentQuestion.answerIds;\n if (!answerIds) {\n return null;\n }\n\n const answers = onGetAnswers(answerIds);\n\n if (!answers) {\n return null;\n }\n\n return answers.map(answer => {\n const isSelected = currentAnswer?.id === answer?.id;\n const selectedColor = isSelected ? 'yellow' : 'white';\n\n if (answer) {\n return (\n <AnswerRow key={`answer_${answer.id}`}>\n <AnswerSelectedIcon color={selectedColor}>\n {isSelected ? 'X' : null}\n </AnswerSelectedIcon>\n\n <Answer\n key={answer.id}\n onPointerDown={() => onAnswerClick(answer)}\n color={selectedColor}\n >\n {answer.text}\n </Answer>\n </AnswerRow>\n );\n }\n\n return null;\n });\n };\n\n return (\n <Container>\n <QuestionContainer>\n <DynamicText\n text={currentQuestion.text}\n onStart={() => setCanShowAnswers(false)}\n onFinish={() => setCanShowAnswers(true)}\n />\n </QuestionContainer>\n\n {canShowAnswers && (\n <AnswersContainer>{onRenderCurrentAnswers()}</AnswersContainer>\n )}\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n word-break: break-all;\n box-sizing: border-box;\n justify-content: flex-start;\n align-items: flex-start;\n flex-wrap: wrap;\n`;\n\nconst QuestionContainer = styled.div`\n flex: 100%;\n width: 100%;\n`;\n\nconst AnswersContainer = styled.div`\n flex: 100%;\n`;\n\ninterface IAnswerProps {\n color: string;\n}\n\nconst Answer = styled.p<IAnswerProps>`\n flex: auto;\n color: ${props => props.color} !important;\n font-size: 0.65rem !important;\n background: inherit;\n border: none;\n`;\n\nconst AnswerSelectedIcon = styled.span<IAnswerProps>`\n flex: 5% 0 0;\n color: ${props => props.color} !important;\n`;\n\nconst AnswerRow = styled.div`\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n margin-bottom: 0.5rem;\n height: 22px;\n p {\n line-height: unset;\n margin-top: 0;\n margin-bottom: 0rem;\n }\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../RPGUIContainer';\nimport aliceDefaultThumbnail from './img/npcDialog/npcThumbnails/alice.png';\nimport pressSpaceGif from './img/space.gif';\nimport { NPCDialogText } from './NPCDialogText';\n\nexport enum ImgSide {\n right = 'right',\n left = 'left',\n}\n\nexport interface NPCMultiDialogType {\n text: string;\n imagePath?: string;\n imageSide: ImgSide;\n}\n\nexport interface INPCMultiDialogProps {\n onClose: () => void;\n textAndTypeArray: NPCMultiDialogType[];\n}\n\nexport const NPCMultiDialog: React.FC<INPCMultiDialogProps> = ({\n onClose,\n textAndTypeArray,\n}) => {\n const [showGoNextIndicator, setShowGoNextIndicator] = useState<boolean>(\n false\n );\n const [slide, setSlide] = useState<number>(0);\n\n const onHandleSpacePress = (event: KeyboardEvent) => {\n if (event.code === 'Space') {\n if (slide < textAndTypeArray?.length - 1) {\n setSlide(prev => prev + 1);\n } else {\n // if there's no more text chunks, close the dialog\n onClose();\n }\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onHandleSpacePress);\n\n return () => document.removeEventListener('keydown', onHandleSpacePress);\n }, [slide]);\n\n return (\n <RPGUIContainer\n type={RPGUIContainerTypes.FramedGold}\n width={'50%'}\n height={'180px'}\n >\n <>\n <Container>\n {textAndTypeArray[slide]?.imageSide === 'right' && (\n <>\n <TextContainer flex={'70%'}>\n <NPCDialogText\n onStartStep={() => setShowGoNextIndicator(false)}\n onEndStep={() => setShowGoNextIndicator(true)}\n text={textAndTypeArray[slide].text || 'No text provided.'}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n <ThumbnailContainer>\n <NPCThumbnail\n src={\n textAndTypeArray[slide].imagePath || aliceDefaultThumbnail\n }\n />\n </ThumbnailContainer>\n {showGoNextIndicator && (\n <PressSpaceIndicator right={'10.5rem'} src={pressSpaceGif} />\n )}\n </>\n )}\n {textAndTypeArray[slide].imageSide === 'left' && (\n <>\n <ThumbnailContainer>\n <NPCThumbnail\n src={\n textAndTypeArray[slide].imagePath || aliceDefaultThumbnail\n }\n />\n </ThumbnailContainer>\n <TextContainer flex={'70%'}>\n <NPCDialogText\n onStartStep={() => setShowGoNextIndicator(false)}\n onEndStep={() => setShowGoNextIndicator(true)}\n text={textAndTypeArray[slide].text || 'No text provided.'}\n onClose={() => {\n if (onClose) {\n onClose();\n }\n }}\n />\n </TextContainer>\n {showGoNextIndicator && (\n <PressSpaceIndicator right={'1rem'} src={pressSpaceGif} />\n )}\n </>\n )}\n </Container>\n )\n </>\n </RPGUIContainer>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n width: 100%;\n height: 100%;\n\n box-sizing: border-box;\n justify-content: center;\n align-items: flex-start;\n position: relative;\n`;\n\ninterface ITextContainerProps {\n flex: string;\n}\n\nconst TextContainer = styled.div<ITextContainerProps>`\n flex: ${({ flex }) => flex} 0 0;\n width: 355px;\n`;\n\nconst ThumbnailContainer = styled.div`\n flex: 30% 0 0;\n display: flex;\n justify-content: flex-end;\n`;\n\nconst NPCThumbnail = styled.img`\n image-rendering: pixelated;\n height: 128px;\n width: 128px;\n`;\n\ninterface IPressSpaceIndicatorProps {\n right: string;\n}\n\nconst PressSpaceIndicator = styled.img<IPressSpaceIndicatorProps>`\n position: absolute;\n right: ${({ right }) => right};\n bottom: 1rem;\n height: 20.7px;\n image-rendering: -webkit-optimize-contrast;\n`;\n","import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { v4 as uuidv4 } from 'uuid';\n\nexport enum RangeSliderType {\n Slider = 'rpgui-slider',\n GoldSlider = 'rpgui-slider golden',\n}\n\nexport interface IRangeSliderProps {\n type: RangeSliderType;\n valueMin: number;\n valueMax: number;\n width: string;\n onChange: (value: number) => void;\n value: number;\n}\n\nexport const RangeSlider: React.FC<IRangeSliderProps> = ({\n type,\n valueMin,\n valueMax,\n width,\n onChange,\n value,\n}) => {\n const sliderId = uuidv4();\n\n const containerRef = useRef<HTMLDivElement>(null);\n const [left, setLeft] = useState(0);\n\n useEffect(() => {\n const calculatedWidth = containerRef.current?.clientWidth || 0;\n setLeft(\n Math.max(\n ((value - valueMin) / (valueMax - valueMin)) * (calculatedWidth - 35) +\n 10\n )\n );\n }, [value, valueMin, valueMax]);\n\n const typeClass = type === RangeSliderType.GoldSlider ? 'golden' : '';\n\n return (\n <div\n style={{ width: width, position: 'relative' }}\n className={`rpgui-slider-container ${typeClass}`}\n id={`rpgui-slider-${sliderId}`}\n ref={containerRef}\n >\n <div style={{ pointerEvents: 'none' }}>\n <div className={`rpgui-slider-track ${typeClass}`} />\n <div className={`rpgui-slider-left-edge ${typeClass}`} />\n <div className={`rpgui-slider-right-edge ${typeClass}`} />\n <div className={`rpgui-slider-thumb ${typeClass}`} style={{ left }} />\n </div>\n <Input\n type=\"range\"\n style={{ width: width }}\n min={valueMin}\n max={valueMax}\n onChange={e => onChange(Number(e.target.value))}\n value={value}\n className=\"rpgui-cursor-point\"\n />\n </div>\n );\n};\n\nconst Input = styled.input`\n opacity: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n margin-top: -5px;\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { NPCDialog, NPCDialogType } from './NPCDialog/NPCDialog';\nimport { NPCMultiDialog, NPCMultiDialogType } from './NPCDialog/NPCMultiDialog';\nimport {\n IQuestionDialog,\n IQuestionDialogAnswer,\n QuestionDialog,\n} from './NPCDialog/QuestionDialog/QuestionDialog';\n\nexport interface IHistoryDialogProps {\n backgroundImgPath: string[];\n fullCoverBackground: boolean;\n questions?: IQuestionDialog[];\n answers?: IQuestionDialogAnswer[];\n text?: string;\n imagePath?: string;\n textAndTypeArray?: NPCMultiDialogType[];\n onClose: () => void;\n}\n\nexport const HistoryDialog: React.FC<IHistoryDialogProps> = ({\n backgroundImgPath,\n fullCoverBackground,\n questions,\n answers,\n text,\n imagePath,\n textAndTypeArray,\n onClose,\n}) => {\n const [img, setImage] = useState<number>(0);\n const onHandleSpacePress = (event: KeyboardEvent) => {\n if (event.code === 'Space') {\n if (img < backgroundImgPath?.length - 1) {\n setImage(prev => prev + 1);\n } else {\n // if there's no more text chunks, close the dialog\n onClose();\n }\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onHandleSpacePress);\n\n return () => document.removeEventListener('keydown', onHandleSpacePress);\n }, [backgroundImgPath]);\n return (\n <BackgroundContainer\n imgPath={backgroundImgPath[img]}\n fullImg={fullCoverBackground}\n >\n <DialogContainer>\n {textAndTypeArray ? (\n <NPCMultiDialog\n textAndTypeArray={textAndTypeArray}\n onClose={onClose}\n />\n ) : questions && answers ? (\n <QuestionDialog\n questions={questions}\n answers={answers}\n onClose={onClose}\n />\n ) : text && imagePath ? (\n <NPCDialog\n text={text}\n imagePath={imagePath}\n onClose={onClose}\n type={NPCDialogType.TextAndThumbnail}\n />\n ) : (\n <NPCDialog\n text={text}\n onClose={onClose}\n type={NPCDialogType.TextOnly}\n />\n )}\n </DialogContainer>\n </BackgroundContainer>\n );\n};\n\ninterface IImgContainerProps {\n imgPath: string;\n fullImg: boolean;\n}\n\nconst BackgroundContainer = styled.div<IImgContainerProps>`\n width: 100%;\n height: 100%;\n background-image: url(${props => props.imgPath});\n background-size: ${props => (props.imgPath ? 'cover' : 'auto')};\n display: flex;\n justify-content: space-evenly;\n align-items: center;\n`;\n\nconst DialogContainer = styled.div`\n display: flex;\n justify-content: center;\n padding-top: 200px;\n`;\n","import React from 'react';\nimport { IPosition } from '../../types/eventTypes';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\n\ninterface IProps {\n children: React.ReactNode;\n title: string;\n onClose?: () => void;\n onPositionChange?: (position: IPosition) => void;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n onOutsideClick?: () => void;\n initialPosition?: IPosition;\n scale?: number;\n}\n\nexport const SlotsContainer: React.FC<IProps> = ({\n children,\n title,\n onClose,\n onPositionChange,\n onPositionChangeEnd,\n onPositionChangeStart,\n onOutsideClick,\n initialPosition,\n scale,\n}) => {\n return (\n <DraggableContainer\n title={title}\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n width=\"400px\"\n cancelDrag=\".item-container-body, #shortcuts_list\"\n onPositionChange={({ x, y }) => {\n if (onPositionChange) {\n onPositionChange({ x, y });\n }\n }}\n onPositionChangeEnd={({ x, y }) => {\n if (onPositionChangeEnd) {\n onPositionChangeEnd({ x, y });\n }\n }}\n onPositionChangeStart={({ x, y }) => {\n if (onPositionChangeStart) {\n onPositionChangeStart({ x, y });\n }\n }}\n onOutsideClick={onOutsideClick}\n initialPosition={initialPosition}\n scale={scale}\n >\n {children}\n </DraggableContainer>\n );\n};\n","import React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../../Button';\nimport { Input } from '../../Input';\nimport { RPGUIContainer, RPGUIContainerTypes } from '../../RPGUIContainer';\nimport { RangeSlider, RangeSliderType } from '../../RangeSlider';\n\nexport interface IItemQuantitySelectorProps {\n quantity: number;\n onConfirm: (quantity: number) => void;\n onClose: () => void;\n}\n\nexport const ItemQuantitySelector: React.FC<IItemQuantitySelectorProps> = ({\n quantity,\n onConfirm,\n onClose,\n}) => {\n const [value, setValue] = useState(quantity);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n\n const closeSelector = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose();\n }\n };\n\n document.addEventListener('keydown', closeSelector);\n\n return () => {\n document.removeEventListener('keydown', closeSelector);\n };\n }\n\n return () => {};\n }, []);\n\n return (\n <StyledContainer type={RPGUIContainerTypes.Framed} width=\"25rem\">\n <CloseButton className=\"container-close\" onPointerDown={onClose}>\n X\n </CloseButton>\n <h2>Select quantity to move</h2>\n <StyledForm\n style={{ width: '100%' }}\n onSubmit={e => {\n e.preventDefault();\n\n const numberValue = Number(value);\n\n if (Number.isNaN(numberValue)) {\n return;\n }\n\n onConfirm(Math.max(1, Math.min(quantity, numberValue)));\n }}\n noValidate\n >\n <StyledInput\n innerRef={inputRef}\n placeholder=\"Enter quantity\"\n type=\"number\"\n min={1}\n max={quantity}\n value={value}\n onChange={e => {\n if (Number(e.target.value) >= quantity) {\n setValue(quantity);\n return;\n }\n\n setValue((e.target.value as unknown) as number);\n }}\n onBlur={e => {\n const newValue = Math.max(\n 1,\n Math.min(quantity, Number(e.target.value))\n );\n\n setValue(newValue);\n }}\n />\n <RangeSlider\n type={RangeSliderType.Slider}\n valueMin={1}\n valueMax={quantity}\n width=\"100%\"\n onChange={setValue}\n value={value}\n />\n <Button buttonType={ButtonTypes.RPGUIButton} type=\"submit\">\n Confirm\n </Button>\n </StyledForm>\n </StyledContainer>\n );\n};\n\nconst StyledContainer = styled(RPGUIContainer)`\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\nconst StyledForm = styled.form`\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n`;\nconst StyledInput = styled(Input)`\n text-align: center;\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n &[type='number'] {\n -moz-appearance: textfield;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 3px;\n right: 0px;\n color: white;\n z-index: 22;\n font-size: 0.8rem;\n`;\n","import {\n getItemTextureKeyPath,\n IItem,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\ntype ShortcutsSetterProps = {\n setSettingShortcutIndex: (index: number) => void;\n settingShortcutIndex: number;\n shortcuts: IShortcut[];\n removeShortcut: (index: number) => void;\n atlasJSON: any;\n atlasIMG: any;\n};\n\nexport const ShortcutsSetter: React.FC<ShortcutsSetterProps> = ({\n setSettingShortcutIndex,\n settingShortcutIndex,\n shortcuts,\n removeShortcut,\n atlasJSON,\n atlasIMG,\n}) => {\n const getContent = (index: number) => {\n if (shortcuts[index]?.type === ShortcutType.Item) {\n const payload = shortcuts[index]?.payload as IItem | undefined;\n\n if (!payload) return null;\n\n return (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: payload.texturePath,\n texturePath: payload.texturePath,\n stackQty: payload.stackQty || 1,\n isStackable: payload.isStackable,\n },\n atlasJSON\n )}\n width={32}\n height={32}\n imgScale={1.6}\n imgStyle={{ left: '5px' }}\n />\n );\n }\n\n const payload = shortcuts[index]?.payload as IRawSpell | undefined;\n\n return <span>{payload?.magicWords.split(' ').map(word => word[0])}</span>;\n };\n\n return (\n <Container>\n <p>Shortcuts:</p>\n <List id=\"shortcuts_list\">\n {Array.from({ length: 6 }).map((_, i) => (\n <Shortcut\n key={i}\n onPointerDown={() => {\n if (settingShortcutIndex !== -1) setSettingShortcutIndex(-1);\n\n removeShortcut(i);\n if (\n settingShortcutIndex === -1 &&\n (!shortcuts[i] || shortcuts[i].type === ShortcutType.None)\n )\n setSettingShortcutIndex(i);\n }}\n disabled={settingShortcutIndex !== -1 && settingShortcutIndex !== i}\n isBeingSet={settingShortcutIndex === i}\n id={`shortcutSetter_${i}`}\n >\n {getContent(i)}\n </Shortcut>\n ))}\n </List>\n </Container>\n );\n};\n\nconst Container = styled.div`\n p {\n margin: 0;\n margin-left: 0.5rem;\n }\n`;\n\nconst Shortcut = styled.button<{ isBeingSet?: boolean }>`\n width: 2.6rem;\n height: 2.6rem;\n background-color: ${uiColors.lightGray};\n border: 2px solid\n ${({ isBeingSet }) => (isBeingSet ? uiColors.yellow : uiColors.darkGray)};\n border-radius: 50%;\n text-transform: uppercase;\n font-size: 0.7rem;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n\n span {\n margin-top: 4px;\n }\n\n &:hover,\n &:focus {\n background-color: ${uiColors.darkGray};\n }\n\n &:active {\n background-color: ${uiColors.gray};\n }\n\n &:disabled {\n opacity: 0.5;\n }\n`;\n\nconst List = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding-bottom: 0.5rem;\n padding-left: 0.5rem;\n box-sizing: border-box;\n margin: 0 !important;\n`;\n","import {\n IEquipmentSet,\n IItem,\n IItemContainer,\n IShortcut,\n ItemContainerType,\n ItemType,\n} from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { SlotsContainer } from '../../Abstractions/SlotsContainer';\nimport { ItemQuantitySelector } from './ItemQuantitySelector';\n\nimport { IPosition } from '../../../types/eventTypes';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { ShortcutsSetter } from '../../Shortcuts/ShortcutsSetter';\nimport { ItemSlot } from './ItemSlot';\n\nexport interface IItemContainerProps {\n itemContainer: IItemContainer;\n onClose?: () => void;\n onItemClick?: (\n item: IItem,\n ItemType: IItem['type'],\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragStart?: (\n item: IItem,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n onItemDragEnd?: (quantity?: number) => void;\n onOutsideDrop?: (item: IItem, position: IPosition) => void;\n onItemPlaceDrop?: (\n item: IItem | null,\n slotIndex: number,\n itemContainerType: ItemContainerType | null\n ) => void;\n scale?: number;\n checkIfItemCanBeMoved: () => boolean;\n checkIfItemShouldDragEnd?: () => boolean;\n onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;\n onSelected?: (optionId: string, item: IItem) => void;\n type: ItemContainerType;\n atlasJSON: any;\n atlasIMG: any;\n disableContextMenu?: boolean;\n initialPosition?: { x: number; y: number };\n shortcuts?: IShortcut[];\n setItemShortcut?: (key: string, index: number) => void;\n removeShortcut?: (index: number) => void;\n equipmentSet?: IEquipmentSet | null;\n isDepotSystem?: boolean;\n onPositionChangeEnd?: (position: IPosition) => void;\n onPositionChangeStart?: (position: IPosition) => void;\n}\n\nexport const ItemContainer: React.FC<IItemContainerProps> = ({\n itemContainer,\n onClose,\n onMouseOver,\n onSelected,\n onItemClick,\n type,\n atlasJSON,\n atlasIMG,\n disableContextMenu = false,\n onItemDragEnd,\n onItemDragStart,\n onItemPlaceDrop,\n onOutsideDrop,\n checkIfItemCanBeMoved,\n initialPosition,\n checkIfItemShouldDragEnd,\n scale,\n shortcuts,\n setItemShortcut,\n removeShortcut,\n equipmentSet,\n isDepotSystem,\n onPositionChangeEnd,\n onPositionChangeStart,\n}) => {\n const [quantitySelect, setQuantitySelect] = useState({\n isOpen: false,\n maxQuantity: 1,\n callback: (_quantity: number) => {},\n });\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\n\n const handleSetShortcut = (item: IItem, index: number) => {\n if (item.type === ItemType.Consumable || item.type === ItemType.Tool) {\n setItemShortcut?.(item.key, index);\n }\n };\n\n const onRenderSlots = () => {\n const slots = [];\n\n for (let i = 0; i < itemContainer.slotQty; i++) {\n slots.push(\n <ItemSlot\n isContextMenuDisabled={disableContextMenu}\n key={i}\n slotIndex={i}\n item={itemContainer.slots?.[i] || null}\n itemContainerType={type}\n onMouseOver={(event, slotIndex, item) => {\n if (onMouseOver) onMouseOver(event, slotIndex, item);\n }}\n onPointerDown={(itemType, containerType, item) => {\n if (settingShortcutIndex !== -1) {\n setSettingShortcutIndex(-1);\n\n handleSetShortcut(item, settingShortcutIndex);\n } else if (onItemClick) onItemClick(item, itemType, containerType);\n }}\n onSelected={(optionId: string, item: IItem) => {\n if (onSelected) onSelected(optionId, item);\n }}\n onDragStart={(item, slotIndex, itemContainerType) => {\n if (onItemDragStart)\n onItemDragStart(item, slotIndex, itemContainerType);\n }}\n onDragEnd={quantity => {\n if (onItemDragEnd) onItemDragEnd(quantity);\n }}\n dragScale={scale}\n checkIfItemCanBeMoved={checkIfItemCanBeMoved}\n checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}\n openQuantitySelector={(maxQuantity, callback) => {\n setQuantitySelect({\n isOpen: true,\n maxQuantity,\n callback,\n });\n }}\n onPlaceDrop={(item, slotIndex, itemContainerType) => {\n if (onItemPlaceDrop)\n onItemPlaceDrop(item, slotIndex, itemContainerType);\n }}\n onOutsideDrop={(item, position) => {\n if (onOutsideDrop) onOutsideDrop(item, position);\n }}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n isSelectingShortcut={settingShortcutIndex !== -1}\n equipmentSet={equipmentSet}\n setItemShortcut={\n type === ItemContainerType.Inventory ? handleSetShortcut : undefined\n }\n isDepotSystem={isDepotSystem}\n />\n );\n }\n return slots;\n };\n\n return (\n <>\n <SlotsContainer\n title={itemContainer.name || 'Container'}\n onClose={onClose}\n initialPosition={initialPosition}\n scale={scale}\n onPositionChangeEnd={onPositionChangeEnd}\n onPositionChangeStart={onPositionChangeStart}\n >\n {type === ItemContainerType.Inventory &&\n shortcuts &&\n removeShortcut && (\n <ShortcutsSetter\n setSettingShortcutIndex={setSettingShortcutIndex}\n settingShortcutIndex={settingShortcutIndex}\n shortcuts={shortcuts}\n removeShortcut={removeShortcut}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n )}\n <ItemsContainer className=\"item-container-body\">\n {onRenderSlots()}\n </ItemsContainer>\n </SlotsContainer>\n {quantitySelect.isOpen && (\n <ModalPortal>\n <QuantitySelectorContainer>\n <ItemQuantitySelector\n quantity={quantitySelect.maxQuantity}\n onConfirm={quantity => {\n quantitySelect.callback(quantity);\n setQuantitySelect({\n isOpen: false,\n maxQuantity: 1,\n callback: () => {},\n });\n }}\n onClose={() => {\n quantitySelect.callback(-1);\n setQuantitySelect({\n isOpen: false,\n maxQuantity: 1,\n callback: () => {},\n });\n }}\n />\n </QuantitySelectorContainer>\n </ModalPortal>\n )}\n </>\n );\n};\n\nconst ItemsContainer = styled.div`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n`;\n\nconst QuantitySelectorContainer = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n z-index: 100;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(0, 0, 0, 0.5);\n`;\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nexport interface IOptionsItemSelectorProps {\n name: string;\n description?: string;\n imageKey: string;\n}\n\nexport interface IItemSelectorProps {\n atlasJSON: any;\n atlasIMG: any;\n options: IOptionsItemSelectorProps[];\n onClose: () => void;\n onSelect: (value: string) => void;\n}\n\nexport const ItemSelector: React.FC<IItemSelectorProps> = ({\n atlasIMG,\n atlasJSON,\n options,\n onClose,\n onSelect,\n}) => {\n const [selectedValue, setSelectedValue] = useState<string>();\n\n const handleClick = () => {\n let element = document.querySelector(\n `input[name='test']:checked`\n ) as HTMLInputElement;\n const elementValue = element.value;\n setSelectedValue(elementValue);\n };\n\n useEffect(() => {\n if (selectedValue) {\n onSelect(selectedValue);\n }\n }, [selectedValue]);\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n width=\"500px\"\n cancelDrag=\".equipment-container-body .arrow-selector\"\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n >\n <div style={{ width: '100%' }}>\n <Title>{'Harvesting instruments'}</Title>\n <Subtitle>{'Use the tool, you need it'}</Subtitle>\n <hr className=\"golden\" />\n </div>\n\n <RadioInputScroller>\n {options?.map((option, index) => (\n <RadioOptionsWrapper key={index}>\n <SpriteAtlasWrapper>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={option.imageKey}\n imgScale={3}\n />\n </SpriteAtlasWrapper>\n <div>\n <input\n className=\"rpgui-radio\"\n type=\"radio\"\n value={option.name}\n name=\"test\"\n />\n <label\n onPointerDown={handleClick}\n style={{ display: 'flex', alignItems: 'center' }}\n >\n {option.name} <br />\n {option.description}\n </label>\n </div>\n </RadioOptionsWrapper>\n ))}\n </RadioInputScroller>\n <ButtonWrapper>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n <Button buttonType={ButtonTypes.RPGUIButton}>Select</Button>\n </ButtonWrapper>\n </DraggableContainer>\n );\n};\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: yellow !important;\n`;\nconst Subtitle = styled.h1`\n font-size: 0.4rem;\n color: yellow !important;\n`;\n\nconst RadioInputScroller = styled.div`\n padding-left: 15px;\n padding-top: 10px;\n width: 100%;\n margin-top: 1rem;\n align-items: center;\n margin-left: 20px;\n align-items: flex-start;\n overflow-y: scroll;\n height: 360px;\n`;\n\nconst SpriteAtlasWrapper = styled.div`\n margin-right: 40px;\n`;\n\nconst RadioOptionsWrapper = styled.div`\n display: flex;\n align-items: stretch;\n margin-bottom: 40px;\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n padding-top: 20px;\n width: 100%;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface IListMenuProps {\n x: number;\n y: number;\n options: IListMenuOption[];\n onSelected: (selectedOptionId: string) => void;\n}\n\nexport const ListMenu: React.FC<IListMenuProps> = ({\n options,\n onSelected,\n x,\n y,\n}) => {\n return (\n <Container x={x} y={y}>\n <ul className=\"rpgui-list-imp\" style={{ overflow: 'hidden' }}>\n {options.map((params, index) => (\n <ListElement\n key={params?.id || index}\n onPointerDown={() => {\n onSelected(params?.id);\n }}\n >\n {params?.text || 'No text'}\n </ListElement>\n ))}\n </ul>\n </Container>\n );\n};\n\ninterface IContainerProps {\n x?: number;\n y?: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n display: flex;\n flex-direction: column;\n width: 100%;\n justify-content: start;\n align-items: flex-start;\n position: absolute;\n top: ${props => props.y || 0}px;\n left: ${props => props.x || 0}px;\n\n li {\n font-size: ${uiFonts.size.xsmall};\n }\n`;\n\nconst ListElement = styled.li`\n margin-right: 0.5rem;\n`;\n","import {\n getItemTextureKeyPath,\n IEquipmentSet,\n IItem,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Button, ButtonTypes } from '../Button';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { Ellipsis } from '../shared/Ellipsis';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\nexport interface IMarketPlaceRowsPropos {\n atlasJSON: any;\n atlasIMG: any;\n item: IItem;\n itemPrice: number;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n onHandleClick: (value: string) => void;\n}\n\nexport const MarketplaceRows: React.FC<IMarketPlaceRowsPropos> = ({\n atlasJSON,\n atlasIMG,\n item,\n itemPrice,\n equipmentSet,\n scale,\n onHandleClick,\n}) => {\n return (\n <MarketPlaceWrapper>\n <ItemIconContainer>\n <SpriteContainer>\n <ItemInfoWrapper\n item={item}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: item.key,\n stackQty: item.stackQty || 1,\n texturePath: item.texturePath,\n isStackable: item.isStackable,\n },\n atlasJSON\n )}\n imgScale={2}\n />\n </ItemInfoWrapper>\n </SpriteContainer>\n <PriceValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"150px\" fontSize=\"10px\">\n {item.name}\n </Ellipsis>\n </p>\n </PriceValue>\n </ItemIconContainer>\n <QuantityContainer>\n <QuantityDisplay>\n <TextOverlay>\n <Item>\n <Ellipsis maxLines={1} maxWidth=\"150px\" fontSize=\"10px\">\n {item.rarity}\n </Ellipsis>\n </Item>\n </TextOverlay>\n </QuantityDisplay>\n </QuantityContainer>\n <ItemIconContainer>\n <SpriteContainer>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={'others/gold-coin-qty-4.png'}\n imgScale={2}\n />\n </SpriteContainer>\n <PriceValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"150px\" fontSize=\"10px\">\n ${itemPrice}\n </Ellipsis>\n </p>\n </PriceValue>\n </ItemIconContainer>\n <ButtonContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onClick={() => onHandleClick(item.name)}\n >\n Buy\n </Button>\n </ButtonContainer>\n </MarketPlaceWrapper>\n );\n};\n\nconst MarketPlaceWrapper = styled.div`\n margin: auto;\n display: grid;\n grid-template-columns: 35% 20% 20% 25%;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n padding: 0.5rem;\n p {\n font-size: 0.8rem;\n }\n`;\n\nconst ItemIconContainer = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n`;\n\nconst SpriteContainer = styled.div`\n position: relative;\n top: -0.5rem;\n left: 0.5rem;\n`;\n\nconst Item = styled.span`\n color: white;\n text-align: center;\n z-index: 1;\n width: 100%;\n`;\n\nconst TextOverlay = styled.div`\n width: 100%;\n position: relative;\n`;\n\ninterface IContainerProps {\n percentageWidth?: number;\n minWidth?: number;\n style?: Record<string, any>;\n}\n\nconst QuantityContainer = styled.div<IContainerProps>`\n position: relative;\n display: flex;\n min-width: 100px;\n justify-content: center;\n align-items: center;\n`;\n\nconst QuantityDisplay = styled.div`\n font-size: ${uiFonts.size.small};\n`;\n\nconst PriceValue = styled.div`\n margin-left: 40px;\n`;\n\nconst ButtonContainer = styled.div`\n margin: auto;\n`;\n","import { IEquipmentSet, IItem } from '@rpg-engine/shared';\nimport React, { ChangeEvent } from 'react';\nimport styled from 'styled-components';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Dropdown, IOptionsProps } from '../Dropdown';\nimport { Input } from '../Input';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { MarketplaceRows } from './MarketplaceRows';\n\nexport interface IMarketPlaceProps {\n items: IItem[] | null;\n atlasJSON: any;\n atlasIMG: any;\n optionsType: IOptionsProps[];\n optionsRarity: IOptionsProps[];\n optionsPrice: IOptionsProps[];\n onClose: () => void;\n onChangeType: (value: string) => void;\n onChangeRarity: (value: string) => void;\n onChangeOrder: (value: string) => void;\n onChangeNameInput: (event: ChangeEvent<HTMLInputElement>) => void;\n scale?: number;\n equipmentSet?: IEquipmentSet | null;\n onHandleClick: (value: string) => void;\n}\n\nexport const Marketplace: React.FC<IMarketPlaceProps> = ({\n items,\n atlasIMG,\n atlasJSON,\n onClose,\n optionsType,\n optionsRarity,\n optionsPrice,\n onChangeType,\n onChangeRarity,\n onChangeOrder,\n onChangeNameInput,\n scale,\n equipmentSet,\n onHandleClick,\n}) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"800px\"\n cancelDrag=\"#MarketContainer\"\n scale={scale}\n >\n <>\n <InputWrapper>\n <p> Search By Name</p>\n <Input onChange={onChangeNameInput} placeholder={'Search...'} />\n </InputWrapper>\n\n <WrapperContainer>\n <StyledDropdown\n options={optionsType}\n onChange={onChangeType}\n width={'220px'}\n />\n <StyledDropdown\n options={optionsRarity}\n onChange={onChangeRarity}\n width={'220px'}\n />\n <StyledDropdown\n options={optionsPrice}\n onChange={onChangeOrder}\n width={'220px'}\n />\n </WrapperContainer>\n <ItemComponentScrollWrapper id=\"MarketContainer\">\n {items?.map((item, index) => (\n <MarketplaceRows\n key={`${item.key}_${index}`}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n item={item}\n itemPrice={10}\n equipmentSet={equipmentSet}\n onHandleClick={onHandleClick}\n />\n ))}\n </ItemComponentScrollWrapper>\n </>\n </DraggableContainer>\n );\n};\n\nconst InputWrapper = styled.div`\n width: 95%;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: auto;\n margin-bottom: 10px;\n p {\n width: auto;\n margin-right: 20px;\n }\n input {\n width: 68%;\n height: 10px;\n }\n`;\n\nconst WrapperContainer = styled.div`\n display: grid;\n grid-template-columns: 30% 30% 30%;\n justify-content: space-between;\n width: 90%;\n margin-left: 10px;\n .rpgui-content .rpgui-dropdown-imp-header {\n padding: 0px 10px 0 !important;\n }\n`;\n\nconst ItemComponentScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n`;\n\nconst StyledDropdown = styled(Dropdown)`\n margin: 3px !important;\n width: 170px !important;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\n\nexport interface IBarProps {\n max: number;\n value: number;\n color: 'red' | 'blue' | 'green';\n style?: Record<string, any>;\n displayText?: boolean;\n percentageWidth?: number;\n minWidth?: number;\n}\n\nexport const ProgressBar: React.FC<IBarProps> = ({\n max,\n value,\n color,\n displayText = true,\n percentageWidth = 40,\n minWidth = 100,\n style,\n}) => {\n const calculatePercentageValue = function(max: number, value: number) {\n if (value > max) {\n value = max;\n }\n return (value * 100) / max;\n };\n\n return (\n <Container\n className=\"rpgui-progress\"\n data-value={calculatePercentageValue(max, value) / 100}\n data-rpguitype=\"progress\"\n percentageWidth={percentageWidth}\n minWidth={minWidth}\n style={style}\n >\n {displayText && (\n <TextOverlay>\n <ProgressBarText>\n {value}/{max}\n </ProgressBarText>\n </TextOverlay>\n )}\n <div className=\" rpgui-progress-track\">\n <div\n className={`rpgui-progress-fill ${color} `}\n style={{\n left: '0px',\n width: calculatePercentageValue(max, value) + '%',\n }}\n ></div>\n </div>\n <div className=\" rpgui-progress-left-edge\"></div>\n <div className=\" rpgui-progress-right-edge\"></div>\n </Container>\n );\n};\n\nconst ProgressBarText = styled.span`\n font-size: ${uiFonts.size.small} !important;\n color: white;\n text-align: center;\n z-index: 1;\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n top: 12px;\n`;\n\nconst TextOverlay = styled.div`\n width: 100%;\n position: relative;\n`;\n\ninterface IContainerProps {\n percentageWidth?: number;\n minWidth?: number;\n style?: Record<string, any>;\n}\n\nconst Container = styled.div<IContainerProps>`\n display: flex;\n flex-direction: column;\n min-width: ${props => props.minWidth}px;\n width: ${props => props.percentageWidth}%;\n justify-content: start;\n align-items: flex-start;\n ${props => props.style}\n`;\n","import { IQuest } from '@rpg-engine/shared';\nimport React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport SelectArrow from '../Arrow/SelectArrow';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\n\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { Column } from '../shared/Column';\nimport thumbnailDefault from './img/default.png';\n\nexport interface IQuestsButtonProps {\n disabled: boolean;\n title: string;\n onClick: (questId: string, npcId: string) => void;\n}\n\nexport interface IQuestInfoProps {\n onClose?: () => void;\n buttons?: IQuestsButtonProps[];\n quests: IQuest[];\n onChangeQuest: (currentQuestIndex: number, currentQuestId: string) => void;\n scale?: number;\n}\n\nexport const QuestInfo: React.FC<IQuestInfoProps> = ({\n quests,\n onClose,\n buttons,\n onChangeQuest,\n scale,\n}) => {\n const [currentIndex, setCurrentIndex] = useState(0);\n const questsLength = quests.length - 1;\n\n useEffect(() => {\n if (onChangeQuest) {\n onChangeQuest(currentIndex, quests[currentIndex]._id);\n }\n }, [currentIndex]);\n\n const onLeftClick = () => {\n if (currentIndex === 0) setCurrentIndex(questsLength);\n else setCurrentIndex(index => index - 1);\n };\n const onRightClick = () => {\n if (currentIndex === questsLength) setCurrentIndex(0);\n else setCurrentIndex(index => index + 1);\n };\n\n return (\n <QuestDraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"730px\"\n cancelDrag=\".equipment-container-body .arrow-selector\"\n scale={scale}\n >\n {quests.length >= 2 ? (\n <QuestsContainer>\n {currentIndex !== 0 && (\n <SelectArrow\n direction=\"left\"\n onPointerDown={onLeftClick}\n ></SelectArrow>\n )}\n {currentIndex !== quests.length - 1 && (\n <SelectArrow\n direction=\"right\"\n onPointerDown={onRightClick}\n ></SelectArrow>\n )}\n\n <QuestContainer>\n <TitleContainer className=\"drag-handler\">\n <Title>\n <Thumbnail\n src={quests[currentIndex].thumbnail || thumbnailDefault}\n />\n {quests[currentIndex].title}\n </Title>\n <QuestSplitDiv>\n <hr className=\"golden\" />\n </QuestSplitDiv>\n </TitleContainer>\n <Content>\n <p>{quests[currentIndex].description}</p>\n </Content>\n <QuestColumn className=\"dark-background\" justifyContent=\"flex-end\">\n {buttons &&\n buttons.map((button, index) => (\n <Button\n key={index}\n onPointerDown={() =>\n button.onClick(\n quests[currentIndex]._id,\n quests[currentIndex].npcId\n )\n }\n disabled={button.disabled}\n buttonType={ButtonTypes.RPGUIButton}\n id={`button-${index}`}\n >\n {button.title}\n </Button>\n ))}\n </QuestColumn>\n </QuestContainer>\n </QuestsContainer>\n ) : (\n <QuestsContainer>\n <QuestContainer>\n <TitleContainer className=\"drag-handler\">\n <Title>\n <Thumbnail src={quests[0].thumbnail || thumbnailDefault} />\n {quests[0].title}\n </Title>\n <QuestSplitDiv>\n <hr className=\"golden\" />\n </QuestSplitDiv>\n </TitleContainer>\n <Content>\n <p>{quests[0].description}</p>\n </Content>\n <QuestColumn className=\"dark-background\" justifyContent=\"flex-end\">\n {buttons &&\n buttons.map((button, index) => (\n <Button\n key={index}\n onPointerDown={() =>\n button.onClick(quests[0]._id, quests[0].npcId)\n }\n disabled={button.disabled}\n buttonType={ButtonTypes.RPGUIButton}\n id={`button-${index}`}\n >\n {button.title}\n </Button>\n ))}\n </QuestColumn>\n </QuestContainer>\n </QuestsContainer>\n )}\n </QuestDraggableContainer>\n );\n};\n\nconst QuestDraggableContainer = styled(DraggableContainer)`\n border: 1px solid black;\n width: 600px;\n padding: 0 0 0 0 !important;\n .DraggableContainer__TitleContainer-sc-184mpyl-2 {\n height: auto;\n }\n .container-close {\n position: absolute;\n margin-left: auto;\n top: 20px;\n padding-right: 5px;\n }\n img {\n display: inline-block;\n vertical-align: middle;\n line-height: normal;\n }\n`;\n\nconst QuestContainer = styled.div`\n margin-right: 40px;\n margin-left: 40px;\n`;\n\nconst QuestsContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst Content = styled.div`\n padding: 18px;\n h1 {\n text-align: left;\n margin: 14px 0px;\n }\n`;\n\nconst QuestSplitDiv = styled.div`\n width: 100%;\n font-size: 11px;\n margin-bottom: 10px;\n hr {\n margin: 0px;\n padding: 0px;\n }\n p {\n margin-bottom: 0px;\n }\n`;\n\nconst QuestColumn = styled(Column)`\n padding-top: 5px;\n margin-bottom: 20px;\n display: flex;\n justify-content: space-evenly;\n`;\n\nconst TitleContainer = styled.div`\n width: 100%;\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n margin-top: 1rem;\n`;\n\nconst Title = styled.h1`\n color: white;\n z-index: 22;\n font-size: ${uiFonts.size.medium} !important;\n color: ${uiColors.yellow} !important;\n`;\n\nconst Thumbnail = styled.img`\n color: white;\n z-index: 22;\n width: 32px * 1.5;\n margin-right: 0.5rem;\n position: relative;\n top: -4px;\n`;\n","import { IQuest } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../constants/uiFonts';\nimport { DraggableContainer } from './DraggableContainer';\nimport { RPGUIContainerTypes } from './RPGUIContainer';\n\nexport interface IQuestListProps {\n quests?: IQuest[];\n onClose: () => void;\n scale?: number;\n}\n\nexport const QuestList: React.FC<IQuestListProps> = ({\n quests,\n onClose,\n scale,\n}) => {\n return (\n <QuestDraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"520px\"\n scale={scale}\n >\n <div style={{ width: '100%' }}>\n <Title>Quests</Title>\n <hr className=\"golden\" />\n\n <QuestListContainer>\n {quests ? (\n quests.map((quest, i) => (\n <div className=\"quest-item\" key={i}>\n <span className=\"quest-number\">{i + 1}</span>\n <div className=\"quest-detail\">\n <p className=\"quest-detail__title\">{quest.title}</p>\n <p className=\"quest-detail__description\">\n {quest.description}\n </p>\n </div>\n </div>\n ))\n ) : (\n <NoQuestContainer>\n <p>There are no ongoing quests</p>\n </NoQuestContainer>\n )}\n </QuestListContainer>\n </div>\n </QuestDraggableContainer>\n );\n};\n\nconst QuestDraggableContainer = styled(DraggableContainer)`\n .container-close {\n top: 10px;\n right: 10px;\n }\n\n .quest-title {\n text-align: left;\n margin-left: 44px;\n margin-top: 20px;\n color: yellow;\n }\n\n .quest-desc {\n margin-top: 12px;\n margin-left: 44px;\n }\n\n .rpgui-progress {\n min-width: 80%;\n margin: 0 auto;\n }\n`;\n\nconst Title = styled.h1`\n z-index: 22;\n font-size: ${uiFonts.size.medium} !important;\n color: yellow !important;\n`;\n\nconst QuestListContainer = styled.div`\n margin-top: 20px;\n margin-bottom: 40px;\n overflow-y: auto;\n max-height: 400px;\n\n .quest-item {\n display: flex;\n align-items: flex-start;\n margin-bottom: 12px;\n }\n\n .quest-number {\n border-radius: 50%;\n width: 28px;\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 16px;\n background-color: brown;\n flex-shrink: 0;\n }\n\n .quest-number.completed {\n background-color: yellow;\n }\n\n p {\n margin: 0;\n }\n\n .quest-detail__title {\n color: yellow;\n }\n\n .quest-detail__description {\n margin-top: 5px;\n }\n .Noquest-detail__description {\n margin-top: 5px;\n margin: auto;\n }\n`;\nconst NoQuestContainer = styled.div`\n text-align: center;\n p {\n margin-top: 5px;\n }\n`;\n","import React from 'react';\nimport 'rpgui/rpgui.min.css';\nimport 'rpgui/rpgui.min.js';\n\ninterface IProps {\n children: React.ReactNode;\n}\n\n//@ts-ignore\nexport const _RPGUI = RPGUI;\n\nexport const RPGUIRoot: React.FC<IProps> = ({ children }) => {\n return <div className=\"rpgui-content\">{children}</div>;\n};\n","import {\n getItemTextureKeyPath,\n IItem,\n IItemContainer,\n IRawSpell,\n IShortcut,\n ShortcutType,\n} from '@rpg-engine/shared';\nimport React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SingleShortcut } from './SingleShortcut';\n\nexport type ShortcutsProps = {\n shortcuts: IShortcut[];\n onShortcutCast: (index: number) => void;\n mana: number;\n isBlockedCastingByKeyboard?: boolean;\n inventory?: IItemContainer | null;\n atlasJSON: any;\n atlasIMG: any;\n};\n\nexport const Shortcuts: React.FC<ShortcutsProps> = ({\n shortcuts,\n onShortcutCast,\n mana,\n isBlockedCastingByKeyboard = false,\n atlasJSON,\n atlasIMG,\n inventory,\n}) => {\n const shortcutsRefs = useRef<HTMLButtonElement[]>([]);\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (isBlockedCastingByKeyboard) return;\n\n const shortcutIndex = Number(e.key) - 1;\n if (shortcutIndex >= 0 && shortcutIndex <= 5) {\n onShortcutCast(shortcutIndex);\n shortcutsRefs.current[shortcutIndex]?.classList.add('active');\n setTimeout(() => {\n shortcutsRefs.current[shortcutIndex]?.classList.remove('active');\n }, 150);\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [shortcuts, isBlockedCastingByKeyboard]);\n\n return (\n <List>\n {Array.from({ length: 6 }).map((_, i) => {\n if (shortcuts[i]?.type === ShortcutType.Item) {\n const payload = shortcuts[i]?.payload as IItem | undefined;\n\n let itemsFromEquipment: (IItem | undefined | null)[] = [];\n\n if (inventory) {\n Object.keys(inventory.slots).forEach(i => {\n const index = parseInt(i);\n\n if (inventory.slots[index]?.key === payload?.key) {\n itemsFromEquipment.push(inventory.slots[index]);\n }\n });\n }\n\n const totalQty = itemsFromEquipment.reduce(\n (acc, item) => acc + (item?.stackQty || 1),\n 0\n );\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={onShortcutCast.bind(null, i)}\n disabled={false}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n {payload && (\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: payload.texturePath,\n texturePath: payload.texturePath,\n stackQty: payload.stackQty || 1,\n isStackable: payload.isStackable,\n },\n atlasJSON\n )}\n width={32}\n height={32}\n />\n )}\n <span className=\"qty\">{totalQty}</span>\n <span className=\"keyboard\">{i + 1}</span>\n </StyledShortcut>\n );\n }\n\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={onShortcutCast.bind(null, i)}\n disabled={mana < (payload?.manaCost ?? 0)}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n <span className=\"mana\">{payload && payload.manaCost}</span>\n <span className=\"magicWords\">\n {payload?.magicWords.split(' ').map(word => word[0])}\n </span>\n <span className=\"keyboard\">{i + 1}</span>\n </StyledShortcut>\n );\n })}\n </List>\n );\n};\n\nconst StyledShortcut = styled(SingleShortcut)`\n transition: all 0.15s;\n\n &.active {\n background-color: ${uiColors.gray};\n border-color: ${uiColors.yellow};\n }\n`;\n\nconst List = styled.p`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n box-sizing: border-box;\n margin: 0 !important;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nexport interface ISimpleProgressBarProps {\n value: number;\n bgColor?: string;\n margin?: number;\n}\n\nexport const SimpleProgressBar: React.FC<ISimpleProgressBarProps> = ({\n value,\n bgColor = 'red',\n margin = 20,\n}) => {\n return (\n <Container className=\"simple-progress-bar\">\n <ProgressBarContainer margin={margin}>\n <BackgroundBar>\n <Progress value={value} bgColor={bgColor} />\n </BackgroundBar>\n </ProgressBarContainer>\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n`;\n\nconst BackgroundBar = styled.span`\n background-color: rgba(0, 0, 0, 0.075);\n`;\n\ninterface ISimpleProgressBarThemeProps {\n value: number;\n bgColor: string;\n}\n\nconst Progress = styled.span`\n background-color: ${(props: ISimpleProgressBarThemeProps) => props.bgColor};\n width: ${(props: ISimpleProgressBarThemeProps) => props.value}%;\n`;\n\ninterface ISimpleProgressBarTheme2Props {\n margin: number;\n}\n\nconst ProgressBarContainer = styled.div`\n border-radius: 60px;\n border: 1px solid #282424;\n overflow: hidden;\n width: 100%;\n span {\n display: block;\n height: 100%;\n }\n height: 8px;\n margin-left: ${(props: ISimpleProgressBarTheme2Props) => props.margin}px;\n`;\n","import { getSPForLevel } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { ErrorBoundary } from './Item/Inventory/ErrorBoundary';\nimport { SpriteFromAtlas } from './shared/SpriteFromAtlas';\nimport { SimpleProgressBar } from './SimpleProgressBar';\n\nexport interface ISkillProgressBarProps {\n skillName: string;\n bgColor: string;\n level: number;\n skillPoints: number;\n skillPointsToNextLevel?: number;\n texturePath: string;\n showSkillPoints?: boolean;\n atlasJSON: any;\n atlasIMG: any;\n}\n\nexport const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({\n bgColor,\n skillName,\n level,\n skillPoints,\n skillPointsToNextLevel,\n texturePath,\n showSkillPoints = true,\n atlasIMG,\n atlasJSON,\n}) => {\n if (!skillPointsToNextLevel) {\n skillPointsToNextLevel = getSPForLevel(level + 1);\n }\n\n const nextLevelSPWillbe = skillPoints + skillPointsToNextLevel;\n\n const ratio = (skillPoints / nextLevelSPWillbe) * 100;\n\n return (\n <>\n <ProgressTitle>\n <TitleName>{skillName}</TitleName>\n <ValueDisplay>lv {level}</ValueDisplay>\n </ProgressTitle>\n <ProgressBody>\n <ProgressIconContainer>\n {atlasIMG && atlasJSON ? (\n <SpriteContainer>\n <ErrorBoundary>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={texturePath}\n imgScale={1}\n grayScale\n opacity={0.5}\n />\n </ErrorBoundary>\n </SpriteContainer>\n ) : (\n <></>\n )}\n </ProgressIconContainer>\n\n <ProgressBarContainer>\n <SimpleProgressBar value={ratio} bgColor={bgColor} />\n </ProgressBarContainer>\n </ProgressBody>\n {showSkillPoints && (\n <SkillDisplayContainer>\n <SkillPointsDisplay>\n {skillPoints}/{nextLevelSPWillbe}\n </SkillPointsDisplay>\n </SkillDisplayContainer>\n )}\n </>\n );\n};\n\nconst ProgressBarContainer = styled.div`\n position: relative;\n top: 8px;\n width: 100%;\n height: auto;\n`;\n\nconst SpriteContainer = styled.div`\n position: relative;\n top: -3px;\n left: 0;\n`;\n\nconst SkillDisplayContainer = styled.div`\n margin: 0 auto;\n\n p {\n margin: 0;\n }\n`;\n\nconst SkillPointsDisplay = styled.p`\n font-size: 0.6rem !important;\n font-weight: bold;\n text-align: center;\n`;\n\nconst TitleName = styled.span`\n margin-left: 5px;\n`;\n\nconst ValueDisplay = styled.span``;\n\nconst ProgressIconContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nconst ProgressBody = styled.div`\n display: flex;\n flex-direction: row;\n width: 100%;\n`;\n\nconst ProgressTitle = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n span {\n font-size: 0.6rem;\n }\n`;\n","import { ISkill, ISkillDetails } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../constants/uiColors';\nimport { DraggableContainer } from './DraggableContainer';\nimport { SkillProgressBar } from './SkillProgressBar';\n\nexport interface ISkillContainerProps {\n skill: ISkill;\n onCloseButton: () => void;\n atlasJSON: any;\n atlasIMG: any;\n scale?: number;\n}\n\nconst skillProps = {\n attributes: {\n color: uiColors.purple,\n values: {\n stamina: 'spell-icons/regenerate.png',\n magic: 'spell-icons/fireball.png',\n magicResistance: 'spell-icons/freeze.png',\n strength: 'spell-icons/enchanted-blow.png',\n resistance: 'spell-icons/magic-shield.png',\n dexterity: 'spell-icons/haste.png',\n },\n },\n combat: {\n color: uiColors.cardinal,\n values: {\n first: 'gloves/leather-gloves.png',\n club: 'maces/club.png',\n sword: 'swords/double-edged-sword.png',\n axe: 'axes/double-axe.png',\n distance: 'ranged-weapons/horse-bow.png',\n shielding: 'shields/studded-shield.png',\n dagger: 'daggers/dagger.png',\n },\n },\n crafting: {\n color: uiColors.blue,\n values: {\n fishing: 'foods/fish.png',\n mining: 'crafting-resources/iron-ingot.png',\n lumberjacking: 'crafting-resources/greater-wooden-log.png',\n blacksmithing: 'hammers/hammer.png',\n cooking: 'foods/chickens-meat.png',\n alchemy: 'potions/greater-mana-potion.png',\n },\n },\n};\n\ninterface SkillMap {\n [key: string]: string;\n}\n\nconst skillNameMap: SkillMap = {\n stamina: 'Stamina',\n magic: 'Magic',\n magicResistance: 'Magic Resistance',\n strength: 'Strength',\n resistance: 'Resistance',\n dexterity: 'Dexterity',\n first: 'Fist',\n club: 'Club',\n sword: 'Sword',\n axe: 'Axe',\n distance: 'Distance',\n shielding: 'Shielding',\n dagger: 'Dagger',\n fishing: 'Fishing',\n mining: 'Mining',\n lumberjacking: 'Lumberjacking',\n blacksmithing: 'Blacksmithing',\n cooking: 'Cooking',\n alchemy: 'Alchemy',\n};\n\nexport const SkillsContainer: React.FC<ISkillContainerProps> = ({\n onCloseButton,\n skill,\n atlasIMG,\n atlasJSON,\n scale,\n}) => {\n const onRenderSkillCategory = (\n category: 'attributes' | 'combat' | 'crafting'\n ) => {\n const skillCategory = skillProps[category];\n\n const skillCategoryColor = skillCategory.color;\n\n const output = [];\n\n for (const [key, value] of Object.entries(skillCategory.values)) {\n //@ts-ignore\n const skillDetails = (skill[key] as unknown) as ISkillDetails;\n\n output.push(\n <SkillProgressBar\n key={key}\n skillName={skillNameMap[key]}\n bgColor={skillCategoryColor}\n level={skillDetails.level || 0}\n skillPoints={Math.round(skillDetails.skillPoints) || 0}\n skillPointsToNextLevel={\n Math.round(skillDetails.skillPointsToNextLevel) || 0\n }\n texturePath={value}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n );\n }\n\n return output;\n };\n\n return (\n <SkillsDraggableContainer\n title=\"Skills\"\n cancelDrag=\"#skillsDiv\"\n scale={scale}\n >\n {onCloseButton && (\n <CloseButton onPointerDown={onCloseButton}>X</CloseButton>\n )}\n <SkillsContainerDiv id=\"skillsDiv\">\n <SkillSplitDiv>\n <p>General</p>\n <hr className=\"golden\" />\n\n <SkillProgressBar\n skillName={'Level'}\n bgColor={uiColors.navyBlue}\n level={Math.round(skill.level) || 0}\n skillPoints={Math.round(skill.experience) || 0}\n skillPointsToNextLevel={Math.round(skill.xpToNextLevel) || 0}\n texturePath={'swords/broad-sword.png'}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n <p>Combat Skills</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('combat')}\n\n <SkillSplitDiv>\n <p>Crafting Skills</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('crafting')}\n\n <SkillSplitDiv>\n <p>Basic Attributes</p>\n <hr className=\"golden\" />\n </SkillSplitDiv>\n\n {onRenderSkillCategory('attributes')}\n </SkillsContainerDiv>\n </SkillsDraggableContainer>\n );\n};\n\nconst SkillsDraggableContainer = styled(DraggableContainer)`\n border: 1px solid black;\n width: 400px;\n height: 90%;\n .DraggableContainer__TitleContainer-sc-184mpyl-2 {\n width: auto;\n height: auto;\n }\n`;\n\nconst SkillsContainerDiv = styled.div`\n width: 100%;\n -webkit-overflow-y: scroll;\n overflow-y: scroll;\n height: 90%;\n padding-right: 10px;\n`;\n\nconst SkillSplitDiv = styled.div`\n width: 100%;\n font-size: 11px;\n hr {\n margin: 0;\n margin-bottom: 1rem;\n padding: 0px;\n }\n p {\n margin-bottom: 0px;\n }\n`;\n\nconst CloseButton = styled.div`\n position: absolute;\n top: 2px;\n right: 2px;\n color: white;\n z-index: 22;\n font-size: 1.1rem;\n`;\n","import { IRawSpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\n\ninterface Props extends IRawSpell {\n charMana: number;\n charMagicLevel: number;\n onPointerDown?: (spellKey: string) => void;\n isSettingShortcut?: boolean;\n spellKey: string;\n}\n\nexport const Spell: React.FC<Props> = ({\n spellKey,\n name,\n description,\n magicWords,\n manaCost,\n charMana,\n charMagicLevel,\n onPointerDown,\n isSettingShortcut,\n minMagicLevelRequired,\n}) => {\n const disabled = isSettingShortcut\n ? charMagicLevel < minMagicLevelRequired\n : manaCost > charMana || charMagicLevel < minMagicLevelRequired;\n\n return (\n <Container\n disabled={disabled}\n onPointerDown={onPointerDown?.bind(null, spellKey)}\n isSettingShortcut={isSettingShortcut && !disabled}\n className=\"spell\"\n >\n {disabled && (\n <Overlay>\n {charMagicLevel < minMagicLevelRequired\n ? 'Low magic level'\n : manaCost > charMana && 'No mana'}\n </Overlay>\n )}\n <SpellImage>{magicWords.split(' ').map(word => word[0])}</SpellImage>\n <Info>\n <Title>\n <span>{name}</span>\n <span className=\"spell\">({magicWords})</span>\n </Title>\n <Description>{description}</Description>\n </Info>\n\n <Divider />\n <Cost>\n <span>Mana cost:</span>\n <span className=\"mana\">{manaCost}</span>\n </Cost>\n </Container>\n );\n};\n\nconst Container = styled.button<{ isSettingShortcut?: boolean }>`\n display: block;\n background: none;\n border: 2px solid transparent;\n border-radius: 1rem;\n width: 100%;\n display: flex;\n height: 5rem;\n gap: 1rem;\n align-items: center;\n padding: 0 1rem;\n text-align: left;\n position: relative;\n\n animation: ${({ isSettingShortcut }) =>\n isSettingShortcut ? 'border-color-change 1s infinite' : 'none'};\n\n @keyframes border-color-change {\n 0% {\n border-color: ${uiColors.yellow};\n }\n 50% {\n border-color: transparent;\n }\n 100% {\n border-color: ${uiColors.yellow};\n }\n }\n\n &:hover,\n &:focus {\n background-color: ${uiColors.darkGray};\n }\n\n &:active {\n background: none;\n }\n`;\n\nconst SpellImage = styled.div`\n width: 4rem;\n height: 4rem;\n font-size: ${uiFonts.size.xLarge};\n font-weight: bold;\n background-color: ${uiColors.darkGray};\n color: ${uiColors.lightGray};\n display: flex;\n justify-content: center;\n align-items: center;\n text-transform: uppercase;\n`;\n\nconst Info = styled.span`\n width: 0;\n flex: 1;\n`;\n\nconst Title = styled.p`\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n margin-bottom: 5px;\n margin: 0;\n\n span {\n font-size: ${uiFonts.size.medium} !important;\n font-weight: bold !important;\n color: ${uiColors.yellow} !important;\n margin-right: 0.5rem;\n }\n\n .spell {\n font-size: ${uiFonts.size.small} !important;\n font-weight: normal !important;\n color: ${uiColors.lightGray} !important;\n }\n`;\n\nconst Description = styled.div`\n font-size: ${uiFonts.size.small} !important;\n line-height: 1.1 !important;\n`;\n\nconst Divider = styled.div`\n width: 1px;\n height: 100%;\n margin: 0 1rem;\n background-color: ${uiColors.lightGray};\n`;\n\nconst Cost = styled.p`\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: 0.5rem;\n\n div {\n z-index: 1;\n }\n\n .mana {\n position: relative;\n font-size: ${uiFonts.size.medium};\n font-weight: bold;\n z-index: 1;\n\n &::after {\n position: absolute;\n content: '';\n top: 0;\n left: 0;\n background-color: ${uiColors.blue};\n width: 100%;\n height: 100%;\n border-radius: 50%;\n transform: scale(1.8);\n filter: blur(10px);\n z-index: -1;\n }\n }\n`;\n\nconst Overlay = styled.p`\n margin: 0 !important;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n color: ${uiColors.yellow};\n font-size: ${uiFonts.size.large} !important;\n font-weight: bold;\n z-index: 10;\n background-color: rgba(0 0 0 / 0.2);\n`;\n","import { IRawSpell, IShortcut } from '@rpg-engine/shared';\nimport React, { Fragment, useEffect, useMemo, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Input } from '../Input';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { ShortcutsSetter } from '../Shortcuts/ShortcutsSetter';\nimport { Spell } from './Spell';\n\nexport interface ISpellbookProps {\n onClose?: () => void;\n onInputFocus?: () => void;\n onInputBlur?: () => void;\n spells: IRawSpell[];\n magicLevel: number;\n mana: number;\n onSpellClick: (spellKey: string) => void;\n setSpellShortcut: (key: string, index: number) => void;\n shortcuts: IShortcut[];\n removeShortcut: (index: number) => void;\n atlasIMG: any;\n atlasJSON: any;\n scale?: number;\n}\n\nexport const Spellbook: React.FC<ISpellbookProps> = ({\n onClose,\n onInputFocus,\n onInputBlur,\n spells,\n magicLevel,\n mana,\n onSpellClick,\n setSpellShortcut,\n shortcuts,\n removeShortcut,\n atlasIMG,\n atlasJSON,\n scale,\n}) => {\n const [search, setSearch] = useState('');\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\n\n useEffect(() => {\n const handleEscapeClose = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onClose?.();\n }\n };\n\n document.addEventListener('keydown', handleEscapeClose);\n\n return () => {\n document.removeEventListener('keydown', handleEscapeClose);\n };\n }, [onClose]);\n\n const spellsToDisplay = useMemo(() => {\n return spells\n .sort((a, b) => {\n if (a.minMagicLevelRequired > b.minMagicLevelRequired) return 1;\n if (a.minMagicLevelRequired < b.minMagicLevelRequired) return -1;\n return 0;\n })\n .filter(\n spell =>\n spell.name.toLocaleLowerCase().includes(search.toLocaleLowerCase()) ||\n spell.magicWords\n .toLocaleLowerCase()\n .includes(search.toLocaleLowerCase())\n );\n }, [search, spells]);\n\n const setShortcut = (spellKey: string) => {\n setSpellShortcut?.(spellKey, settingShortcutIndex);\n setSettingShortcutIndex(-1);\n };\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={onClose}\n width=\"inherit\"\n height=\"inherit\"\n cancelDrag=\"#spellbook-search, #shortcuts_list, .spell\"\n scale={scale}\n >\n <Container>\n <Title>Learned Spells</Title>\n\n <ShortcutsSetter\n setSettingShortcutIndex={setSettingShortcutIndex}\n settingShortcutIndex={settingShortcutIndex}\n shortcuts={shortcuts}\n removeShortcut={removeShortcut}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n />\n\n <Input\n placeholder=\"Search for spell\"\n value={search}\n onChange={e => setSearch(e.target.value)}\n onFocus={onInputFocus}\n onBlur={onInputBlur}\n id=\"spellbook-search\"\n />\n\n <SpellList>\n {spellsToDisplay.map(spell => (\n <Fragment key={spell.key}>\n <Spell\n charMana={mana}\n charMagicLevel={magicLevel}\n onPointerDown={\n settingShortcutIndex !== -1 ? setShortcut : onSpellClick\n }\n spellKey={spell.key}\n isSettingShortcut={settingShortcutIndex !== -1}\n {...spell}\n />\n </Fragment>\n ))}\n </SpellList>\n </Container>\n </DraggableContainer>\n );\n};\n\nconst Title = styled.h1`\n font-size: ${uiFonts.size.large} !important;\n margin-bottom: 0 !important;\n`;\n\nconst Container = styled.div`\n width: 100%;\n height: 100%;\n color: white;\n display: flex;\n flex-direction: column;\n`;\n\nconst SpellList = styled.div`\n width: 100%;\n min-height: 0;\n flex: 1;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n margin-top: 1rem;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nimport { PeriodOfDay } from '@rpg-engine/shared';\nimport AfternoonGif from './gif/afternoon.gif';\nimport MorningGif from './gif/morning.gif';\nimport NightGif from './gif/night.gif';\n\nexport interface IPeriodOfDayDisplayProps {\n periodOfDay: PeriodOfDay;\n}\n\nexport const DayNightPeriod: React.FC<IPeriodOfDayDisplayProps> = ({\n periodOfDay,\n}) => {\n const periodOfDaySrcFiles = {\n [PeriodOfDay.Morning]: MorningGif,\n [PeriodOfDay.Afternoon]: AfternoonGif,\n [PeriodOfDay.Night]: NightGif,\n };\n\n return (\n <GifContainer>\n <img src={periodOfDaySrcFiles[periodOfDay]} />\n </GifContainer>\n );\n};\n\nconst GifContainer = styled.div`\n width: 100%;\n\n img {\n width: 67%;\n }\n`;\n","import { PeriodOfDay } from '@rpg-engine/shared';\nimport React from 'react';\nimport Draggable from 'react-draggable';\nimport styled from 'styled-components';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { DayNightPeriod } from './DayNightPeriod/DayNightPeriod';\n\nimport ClockWidgetImg from './img/clockwidget.png';\n\nexport interface IClockWidgetProps {\n onClose?: () => void;\n TimeClock: string;\n periodOfDay: PeriodOfDay;\n scale?: number;\n}\n\nexport const TimeWidget: React.FC<IClockWidgetProps> = ({\n onClose,\n TimeClock,\n periodOfDay,\n scale,\n}) => {\n return (\n <Draggable scale={scale}>\n <WidgetContainer>\n <CloseButton onPointerDown={onClose}>X</CloseButton>\n <DayNightContainer>\n <DayNightPeriod periodOfDay={periodOfDay} />\n </DayNightContainer>\n <Time>{TimeClock}</Time>\n </WidgetContainer>\n </Draggable>\n );\n};\n\nconst WidgetContainer = styled.div`\n background-image: url(${ClockWidgetImg});\n background-size: 10rem;\n background-repeat: no-repeat;\n width: 10rem;\n position: absolute;\n height: 100px;\n`;\n\nconst Time = styled.div`\n top: 0.75rem;\n right: 0.5rem;\n position: absolute;\n font-size: ${uiFonts.size.small};\n color: white;\n`;\n\nconst CloseButton = styled.p`\n position: absolute;\n top: -0.5rem;\n margin: 0;\n right: -0.2rem;\n font-size: ${uiFonts.size.small} !important;\n z-index: 1;\n`;\n\nconst DayNightContainer = styled.div`\n margin-top: -0.3rem;\n margin-left: -0.3rem;\n`;\n","import {\n getItemTextureKeyPath,\n IEquipmentSet,\n ITradeResponseItem,\n} from '@rpg-engine/shared';\nimport capitalize from 'lodash/capitalize';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport SelectArrow from '../Arrow/SelectArrow';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { Ellipsis } from '../shared/Ellipsis';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nexport interface ITradeComponentProps {\n traderItem: ITradeResponseItem;\n onQuantityChange: (\n traderItem: ITradeResponseItem,\n selectedQty: number\n ) => void;\n atlasJSON: any;\n atlasIMG: any;\n selectedQty: number;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n}\n\nconst outerQty = 10;\n\nexport const TradingItemRow: React.FC<ITradeComponentProps> = ({\n atlasIMG,\n atlasJSON,\n onQuantityChange,\n traderItem,\n selectedQty,\n equipmentSet,\n scale,\n}) => {\n const onLeftClick = (qty = 1) => {\n onQuantityChange(traderItem, Math.max(0, selectedQty - qty));\n };\n\n const onRightClick = (qty = 1) => {\n onQuantityChange(\n traderItem,\n Math.min(traderItem.stackQty ?? 999, selectedQty + qty)\n );\n };\n\n return (\n <ItemWrapper>\n <ItemIconContainer>\n <SpriteContainer>\n <ItemInfoWrapper\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n item={traderItem}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={getItemTextureKeyPath(\n {\n key: traderItem.key,\n stackQty: traderItem.stackQty || 1,\n texturePath: traderItem.texturePath,\n isStackable: traderItem.isStackable,\n },\n atlasJSON\n )}\n imgScale={2.5}\n />\n </ItemInfoWrapper>\n </SpriteContainer>\n </ItemIconContainer>\n\n <ItemNameContainer>\n <NameValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"250px\">\n {capitalize(traderItem.name)}\n </Ellipsis>\n </p>\n <p>${traderItem.price}</p>\n </NameValue>\n </ItemNameContainer>\n <QuantityContainer>\n <SelectArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"left\"\n onPointerDown={onLeftClick.bind(null, outerQty)}\n />\n <StyledArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"left\"\n onPointerDown={onLeftClick}\n />\n <QuantityDisplay>\n <TextOverlay>\n <Item>{selectedQty}</Item>\n </TextOverlay>\n </QuantityDisplay>\n <StyledArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"right\"\n onPointerDown={onRightClick}\n />\n <SelectArrow\n size={32}\n className=\"arrow-selector\"\n direction=\"right\"\n onPointerDown={onRightClick.bind(null, outerQty)}\n />\n </QuantityContainer>\n </ItemWrapper>\n );\n};\n\nconst StyledArrow = styled(SelectArrow)`\n margin: 40px;\n`;\n\nconst ItemWrapper = styled.div`\n width: 100%;\n margin: auto;\n display: flex;\n justify-content: space-between;\n margin-bottom: 1rem;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n padding: 0.5rem;\n`;\n\nconst ItemNameContainer = styled.div`\n flex: 60%;\n`;\n\nconst ItemIconContainer = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n\n flex: 0 0 58px;\n`;\n\nconst SpriteContainer = styled.div`\n position: relative;\n top: -0.5rem;\n left: 0.5rem;\n`;\n\nconst NameValue = styled.div`\n p {\n font-size: 0.75rem;\n margin: 0;\n }\n`;\n\nconst Item = styled.span`\n color: white;\n text-align: center;\n z-index: 1;\n\n width: 100%;\n`;\n\nconst TextOverlay = styled.div`\n width: 100%;\n position: relative;\n`;\n\ninterface IContainerProps {\n percentageWidth?: number;\n minWidth?: number;\n style?: Record<string, any>;\n}\n\nconst QuantityContainer = styled.div<IContainerProps>`\n position: relative;\n display: flex;\n\n min-width: 100px;\n width: 40%;\n justify-content: center;\n align-items: center;\n\n flex: 40%;\n`;\n\nconst QuantityDisplay = styled.div`\n font-size: ${uiFonts.size.small};\n`;\n","import {\n IEquipmentSet,\n ITradeRequestItem,\n ITradeResponseItem,\n TradeTransactionType,\n} from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { TradingItemRow } from './TradingItemRow';\n\nexport interface ITradingMenu {\n traderItems: ITradeResponseItem[];\n onClose: () => void;\n onConfirm: (items: ITradeRequestItem[]) => void;\n type: TradeTransactionType;\n atlasJSON: any;\n atlasIMG: any;\n characterAvailableGold: number;\n equipmentSet?: IEquipmentSet | null;\n scale?: number;\n}\n\nexport const TradingMenu: React.FC<ITradingMenu> = ({\n traderItems,\n onClose,\n type,\n atlasJSON,\n atlasIMG,\n characterAvailableGold,\n onConfirm,\n equipmentSet,\n scale,\n}) => {\n const [sum, setSum] = useState(0);\n const [qtyMap, setQtyMap] = useState(new Map());\n\n const onQuantityChange = (item: ITradeResponseItem, selectedQty: number) => {\n setQtyMap(new Map(qtyMap.set(item.key, selectedQty)));\n\n let newSum = 0;\n traderItems.forEach(item => {\n const qty = qtyMap.get(item.key);\n if (qty) newSum += qty * item.price;\n setSum(newSum);\n });\n };\n\n const isBuy = () => {\n return type == 'buy';\n };\n\n const hasGoldForSale = () => {\n if (isBuy()) {\n return !(sum > characterAvailableGold);\n }\n return true;\n };\n\n const getFinalGold = () => {\n if (isBuy()) {\n return characterAvailableGold - sum;\n } else {\n return characterAvailableGold + sum;\n }\n };\n\n const Capitalize = (word: string) => {\n return word[0].toUpperCase() + word.substring(1);\n };\n\n const onConfirmClick = () => {\n const items: ITradeRequestItem[] = [];\n\n traderItems.forEach(item => {\n const qty = qtyMap.get(item.key);\n if (qty) {\n items.push(Object.assign({}, item, { qty: qty }));\n }\n });\n\n onConfirm(items);\n };\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"600px\"\n cancelDrag=\"#TraderContainer\"\n scale={scale}\n >\n <>\n <div style={{ width: '100%' }}>\n <Title>{Capitalize(type)} Menu</Title>\n <hr className=\"golden\" />\n </div>\n <TradingComponentScrollWrapper id=\"TraderContainer\">\n {traderItems.map((tradeItem, index) => (\n <ItemWrapper key={`${tradeItem.key}_${index}`}>\n <TradingItemRow\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n onQuantityChange={onQuantityChange}\n traderItem={tradeItem}\n selectedQty={qtyMap.get(tradeItem.key) ?? 0}\n equipmentSet={equipmentSet}\n scale={scale}\n />\n </ItemWrapper>\n ))}\n </TradingComponentScrollWrapper>\n <GoldWrapper>\n <p>Available Gold:</p>\n <p>${characterAvailableGold}</p>\n </GoldWrapper>\n <TotalWrapper>\n <p>Total:</p>\n <p>${sum}</p>\n </TotalWrapper>\n {!hasGoldForSale() ? (\n <AlertWrapper>\n <p> Sorry, not enough money.</p>\n </AlertWrapper>\n ) : (\n <GoldWrapper>\n <p>Final Gold:</p>\n <p>${getFinalGold()}</p>\n </GoldWrapper>\n )}\n\n <ButtonWrapper>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={!hasGoldForSale()}\n onPointerDown={() => onConfirmClick()}\n >\n Confirm\n </Button>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onClose()}\n >\n Cancel\n </Button>\n </ButtonWrapper>\n </>\n </DraggableContainer>\n );\n};\n\nconst Title = styled.h1`\n z-index: 22;\n font-size: 0.6rem;\n color: yellow !important;\n`;\n\nconst TradingComponentScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n`;\n\nconst ItemWrapper = styled.div`\n margin: auto;\n display: flex;\n justify-content: space-between;\n`;\n\nconst TotalWrapper = styled.div`\n margin-top: 1rem;\n display: flex;\n justify-content: space-between;\n height: 20px;\n p {\n color: white !important;\n }\n width: 100%;\n margin-left: 0.8rem;\n`;\n\nconst GoldWrapper = styled.div`\n margin-top: 1rem;\n display: flex;\n justify-content: space-between;\n height: 20px;\n p {\n color: yellow !important;\n }\n width: 100%;\n margin-left: 0.8rem;\n`;\n\nconst AlertWrapper = styled.div`\n margin-top: 1rem;\n display: flex;\n width: 100%;\n justify-content: center;\n height: 20px;\n p {\n color: red !important;\n }\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n padding-top: 20px;\n width: 100%;\n margin-top: 1rem;\n button {\n padding: 0px 50px;\n }\n`;\n","/* eslint-disable react/require-default-props */\nimport React from 'react';\nimport styled from 'styled-components';\n\ninterface IProps {\n maxLines?: number;\n children: React.ReactNode;\n}\n\nexport const Truncate: React.FC<IProps> = ({ maxLines = 1, children }) => {\n return <Container maxLines={maxLines}>{children}</Container>;\n};\n\ninterface IContainerProps {\n maxLines: number;\n}\n\nconst Container = styled.div<IContainerProps>`\n display: -webkit-box;\n max-width: 100%;\n max-height: 100%;\n -webkit-line-clamp: ${props => props.maxLines};\n -webkit-box-orient: vertical;\n overflow: hidden;\n`;\n","import React, { useEffect, useState } from 'react';\n\nexport interface ICheckItems {\n label: string;\n value: string;\n}\n\nexport interface ICheckProps {\n items: ICheckItems[];\n onChange: (selectedValues: IChecklistSelectedValues) => void;\n}\n\nexport interface IChecklistSelectedValues {\n [label: string]: boolean;\n}\n\nexport const CheckButton: React.FC<ICheckProps> = ({ items, onChange }) => {\n const generateSelectedValuesList = () => {\n const selectedValues: IChecklistSelectedValues = {};\n\n items.forEach(item => {\n selectedValues[item.label] = false;\n });\n\n return selectedValues;\n };\n\n const [selectedValues, setSelectedValues] = useState<\n IChecklistSelectedValues\n >(generateSelectedValuesList());\n\n const handleClick = (label: string) => {\n setSelectedValues({\n ...selectedValues,\n [label]: !selectedValues[label],\n });\n };\n\n useEffect(() => {\n if (selectedValues) {\n onChange(selectedValues);\n }\n }, [selectedValues]);\n\n return (\n <div id=\"elemento-checkbox\">\n {items?.map((element, index) => {\n return (\n <div key={`${element.label}_${index}`}>\n <input\n className=\"rpgui-checkbox\"\n type=\"checkbox\"\n checked={selectedValues[element.label]}\n onChange={() => {}}\n />\n <label onPointerDown={() => handleClick(element.label)}>\n {element.label}\n </label>\n <br />\n </div>\n );\n })}\n </div>\n );\n};\n","import React, { useEffect, useState } from 'react';\n\nexport interface IRadioItems {\n label: string;\n value: string;\n}\n\nexport interface IRadioProps {\n name: string;\n items: IRadioItems[];\n onChange: (value: string) => void;\n}\n\nexport const InputRadio: React.FC<IRadioProps> = ({\n name,\n items,\n onChange,\n}) => {\n const [selectedValue, setSelectedValue] = useState<string>();\n const handleClick = () => {\n let element = document.querySelector(\n `input[name=${name}]:checked`\n ) as HTMLInputElement;\n const elementValue = element.value;\n setSelectedValue(elementValue);\n };\n\n useEffect(() => {\n if (selectedValue) {\n onChange(selectedValue);\n }\n }, [selectedValue]);\n\n return (\n <div id=\"elemento-radio\">\n {items.map(element => {\n return (\n <>\n <input\n key={element.value}\n className=\"rpgui-radio\"\n value={element.value}\n name={name}\n type=\"radio\"\n />\n <label onPointerDown={handleClick}>{element.label}</label>\n <br />\n </>\n );\n })}\n </div>\n );\n};\n","import React from 'react';\n\nexport interface ITextArea\n extends React.DetailedHTMLProps<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n HTMLTextAreaElement\n > {}\n\nexport const TextArea: React.FC<ITextArea> = ({ ...props }) => {\n return <textarea {...props} />;\n};\n"],"names":["ButtonTypes","RPGUIContainerTypes","Button","disabled","children","buttonType","onPointerDown","props","React","ButtonContainer","className","styled","button","displayName","componentId","SpriteFromAtlas","atlasJSON","atlasIMG","spriteKey","_ref$width","width","GRID_WIDTH","_ref$height","height","GRID_HEIGHT","_ref$imgScale","imgScale","imgStyle","containerStyle","_ref$grayScale","grayScale","_ref$opacity","opacity","imgClassname","spriteData","frames","Error","Container","hasHover","style","ImgSprite","frame","scale","div","w","h","x","y","ErrorBoundary","args","_this","state","hasError","getDerivedStateFromError","_","_proto","componentDidCatch","error","errorInfo","console","render","this","Component","SelectArrow","direction","size","LeftArrow","RightArrow","span","Ellipsis","maxWidth","fontSize","center","maxLines","PropertySelect","item","availableProperties","onChange","useState","currentIndex","setCurrentIndex","propertiesLength","length","useEffect","JSON","stringify","TextOverlay","Item","name","index","Column","flex","flexWrap","alignItems","justifyContent","ChatContainer","TextField","input","MessagesContainer","Message","color","Form","form","buttonColor","buttonBackgroundColor","Input","rest","ref","innerRef","RPGUIContainer","type","CloseButton","CustomInput","CustomContainer","MessageText","p","SingleShortcut","CancelButton","ButtonsContainer","ShortcutsContainer","StyledShortcut","useOutsideClick","id","handleClickOutside","event","current","contains","target","CustomEvent","detail","document","dispatchEvent","addEventListener","removeEventListener","NPCDialogType","DraggableContainer","_ref$type","FramedGold","onCloseButton","title","imgSrc","_ref$imgWidth","imgWidth","cancelDrag","onPositionChange","onPositionChangeEnd","onPositionChangeStart","onOutsideClick","_ref$initialPosition","initialPosition","draggableRef","useRef","_e","Draggable","cancel","onDrag","data","onStop","onStart","defaultPosition","TitleContainer","Title","Icon","src","h1","img","Dropdown","options","dropdownId","uuidv4","selectedValue","setSelectedValue","selectedOption","setSelectedOption","opened","setOpened","firstOption","change","filter","o","value","option","onMouseLeave","DropdownSelect","prev","DropdownOptions","map","key","ul","modalRoot","getElementById","ModalPortal","ReactDOM","createPortal","RelativeListMenu","onSelected","_ref$fontSize","pos","overflow","params","ListElement","text","li","MobileItemTooltip","closeTooltip","equipmentSet","_ref$scale","handleFadeOut","_ref$current","classList","add","onTouchEnd","setTimeout","ItemInfoDisplay","isMobile","OptionsContainer","Option","generateContextMenuListOptions","actionsByTypeList","action","ItemSocketEventsDisplayLabels","EquipmentSlotSpriteByType","Neck","LeftHand","Ring","Head","Torso","Legs","Feet","Inventory","RightHand","Accessory","ItemSlot","observer","slotIndex","containerType","itemContainerType","slotSpriteMask","onMouseOver","onMouseOut","_ref$isContextMenuDis","isContextMenuDisabled","onDragEnd","onDragStart","onPlaceDrop","onDrop","onOutsideDrop","checkIfItemCanBeMoved","openQuantitySelector","checkIfItemShouldDragEnd","dragScale","isSelectingShortcut","setItemShortcut","isDepotSystem","isTooltipVisible","setTooltipVisible","isTooltipMobileVisible","setIsTooltipMobileVisible","isContextMenuVisible","setIsContextMenuVisible","contextMenuPosition","setContextMenuPosition","isFocused","setIsFocused","wasDragged","setWasDragged","dragPosition","setDragPosition","dropPosition","setDropPosition","dragContainer","contextActions","setContextActions","contextActionMenu","ItemContainerType","ItemType","Weapon","Armor","Jewelry","ActionsForInventory","Equipment","Consumable","CraftingResource","Tool","Other","push","DepotSocketEvents","Deposit","ActionsForEquipmentSet","Loot","ActionsForLoot","MapContainer","ActionsForMapContainer","contextActionMenuDontHaveUseWith","find","toLowerCase","includes","hasUseWith","Depot","ItemSocketEvents","GetItemInfo","Withdraw","generateContextMenu","getStackInfo","itemId","stackQty","qtyClassName","ItemQtyContainer","ItemQty","Math","round","resetItem","onSuccesfulDrag","quantity","onMouseUp","e","changedTouches","clientX","clientY","simulatedEvent","MouseEvent","bubbles","elementFromPoint","_document$elementFrom","axis","defaultClassName","parseInt","split","isNaN","classes","Array","from","_e$target","some","elm","window","getComputedStyle","matrix","DOMMatrixReadOnly","transform","m41","m42","isTouch","abs","position","ItemContainer","onMouseEnter","itemToRender","texturePath","allowedEquipSlotType","_itemToRender$allowed","element","_id","getItemTextureKeyPath","isStackable","stackInfo","renderEquipment","renderItem","onRenderSlot","ItemTooltip","optionId","rarityColor","rarity","ItemRarities","Uncommon","Rare","Epic","Legendary","statisticsToDisplay","label","higherIsWorse","ItemInfo","itemToCompare","renderMissingStatistic","statistics","stat","itemToCompareStatistic","toUpperCase","slice","Statistic","toString","Header","Rarity","Type","subType","AllowedSlots","slotType","itemStatistic","isItemToCompare","isOnlyInOneItem","statDiff","_itemToCompare$stat$k2","isDifference","isBetter","renderStatistics","isTwoHanded","Description","description","maxStackSize","StackInfo","MissingStatistics","itemSlotTypes","useMemo","_item$allowedEquipSlo","allowedSlotTypeCamelCase","camelCase","itemSubTypeCamelCase","getSlotType","itemFromEquipment","Flex","CompareContainer","Equipped","$isMobile","handleMouseMove","rect","getBoundingClientRect","tooltipWidth","tooltipHeight","isOffScreenRight","innerWidth","isOffScreenBottom","innerHeight","ItemInfoWrapper","setIsTooltipVisible","bind","log","StyledItem","Recipes","Subtitle","RadioInputScroller","SpriteAtlasWrapper","RadioOptionsWrapper","ButtonWrapper","MinCraftingRequirementsText","levelIsOk","Details","EquipmentSetContainer","EquipmentColumn","IS_MOBILE_OR_TABLET","isMobileOrTablet","DynamicText","onFinish","textState","setTextState","i","interval","setInterval","substring","clearInterval","TextContainer","NPCDialogText","str","charactersPerLine","linesPerDiv","onClose","onEndStep","onStartStep","windowSize","textChunks","floor","match","RegExp","chunkIndex","setChunkIndex","onHandleSpacePress","code","goToNextStep","showGoNextIndicator","setShowGoNextIndicator","PressSpaceIndicator","right","TextOnly","pressSpaceGif","useEventListener","handler","el","savedHandler","listener","QuestionDialog","questions","answers","currentQuestion","setCurrentQuestion","canShowAnswers","setCanShowAnswers","onGetFirstAnswer","answerIds","firstAnswerId","answer","currentAnswer","setCurrentAnswer","onGetAnswers","answerId","nextAnswerIndex","findIndex","nextAnswerID","nextAnswer","previousAnswerIndex","previousAnswerID","previousAnswer","pop","nextQuestionId","question","QuestionContainer","AnswersContainer","isSelected","selectedColor","AnswerRow","AnswerSelectedIcon","Answer","onAnswerClick","onRenderCurrentAnswers","ImgSide","NPCDialog","imagePath","_ref$isQuestionDialog","isQuestionDialog","TextAndThumbnail","ThumbnailContainer","NPCThumbnail","aliceDefaultThumbnail","RangeSliderType","NPCMultiDialog","textAndTypeArray","slide","setSlide","_textAndTypeArray$sli","imageSide","BackgroundContainer","imgPath","DialogContainer","SlotsContainer","Framed","RangeSlider","valueMin","valueMax","sliderId","containerRef","left","setLeft","calculatedWidth","_containerRef$current","clientWidth","max","typeClass","GoldSlider","pointerEvents","min","Number","ItemQuantitySelector","onConfirm","setValue","inputRef","focus","select","closeSelector","StyledContainer","StyledForm","onSubmit","preventDefault","numberValue","noValidate","StyledInput","placeholder","onBlur","newValue","Slider","RPGUIButton","ShortcutsSetter","setSettingShortcutIndex","settingShortcutIndex","shortcuts","removeShortcut","List","Shortcut","ShortcutType","None","isBeingSet","_shortcuts$index","payload","_shortcuts$index2","_shortcuts$index3","magicWords","word","getContent","ItemsContainer","QuantitySelectorContainer","MarketplaceRows","itemPrice","onHandleClick","MarketPlaceWrapper","ItemIconContainer","SpriteContainer","PriceValue","QuantityContainer","QuantityDisplay","onClick","InputWrapper","WrapperContainer","ItemComponentScrollWrapper","StyledDropdown","ProgressBarText","minWidth","percentageWidth","QuestDraggableContainer","QuestContainer","QuestsContainer","Content","QuestSplitDiv","QuestColumn","Thumbnail","QuestListContainer","NoQuestContainer","_RPGUI","RPGUI","SimpleProgressBar","_ref$bgColor","bgColor","_ref$margin","margin","ProgressBarContainer","BackgroundBar","Progress","SkillProgressBar","skillName","level","skillPoints","skillPointsToNextLevel","_ref$showSkillPoints","showSkillPoints","getSPForLevel","nextLevelSPWillbe","ratio","ProgressTitle","TitleName","ValueDisplay","ProgressBody","ProgressIconContainer","SkillDisplayContainer","SkillPointsDisplay","skillProps","attributes","values","stamina","magic","magicResistance","strength","resistance","dexterity","combat","first","club","sword","axe","distance","shielding","dagger","crafting","fishing","mining","lumberjacking","blacksmithing","cooking","alchemy","skillNameMap","SkillsDraggableContainer","SkillsContainerDiv","SkillSplitDiv","Spell","manaCost","charMana","charMagicLevel","isSettingShortcut","minMagicLevelRequired","spellKey","Overlay","SpellImage","Info","Divider","Cost","SpellList","DayNightPeriod","periodOfDay","periodOfDaySrcFiles","PeriodOfDay","Morning","Afternoon","Night","GifContainer","WidgetContainer","Time","DayNightContainer","TradingItemRow","onQuantityChange","traderItem","selectedQty","onLeftClick","qty","onRightClick","ItemWrapper","ItemNameContainer","NameValue","capitalize","price","StyledArrow","TradingComponentScrollWrapper","TotalWrapper","GoldWrapper","AlertWrapper","availableCharacters","propertySelectValues","textureKey","selectedSpriteKey","setSelectedSpriteKey","display","paddingBottom","chatMessages","onSendChatMessage","onFocus","_ref$styles","styles","textColor","message","setMessage","scrollChatToBottom","scrollingElement","querySelector","scrollTop","scrollHeight","fallback","emitter","createdAt","dayjs","Date","format","onRenderMessageLines","onRenderChatMessages","trim","autoComplete","autoFocus","borderRadius","RxPaperPlane","FramedGrey","items","selectedValues","forEach","generateSelectedValuesList","setSelectedValues","checked","onActionClick","onCancelClick","onShortcutClick","mana","inventory","onTouchStart","remove","variant","onShortcutClickBinded","_shortcuts$i","_shortcuts$i2","_shortcuts$i3","itemsFromEquipment","Object","keys","slots","_inventory$slots$inde","totalQty","reduce","acc","_shortcuts$i4","renderShortcut","onSelect","onCraftItem","craftablesItems","optionsId","show","isShown","setIsShown","craftItem","setCraftItem","modifyString","parts","words","replace","concat","join","handleClick","ItemSubType","canCraft","ingredients","minCraftingRequirements","_option$minCraftingRe2","_option$minCraftingRe4","details","onItemClick","onItemDragEnd","onItemDragStart","onItemPlaceDrop","onItemOutsideDrop","equipmentData","neck","leftHand","ring","head","armor","legs","boot","rightHand","accessory","equipmentMaskSlots","ItemSlotType","onRenderEquipmentSlotRange","start","end","equipmentRange","slotMaksRange","itemContainer","itemType","ContainerType","backgroundImgPath","fullCoverBackground","setImage","fullImg","_ref$disableContextMe","disableContextMenu","isOpen","maxQuantity","callback","_quantity","quantitySelect","setQuantitySelect","handleSetShortcut","slotQty","_itemContainer$slots","undefined","onRenderSlots","imageKey","optionsType","optionsRarity","optionsPrice","onChangeType","onChangeRarity","onChangeOrder","onChangeNameInput","_ref$displayText","displayText","_ref$percentageWidth","_ref$minWidth","calculatePercentageValue","quests","buttons","onChangeQuest","questsLength","thumbnail","thumbnailDefault","npcId","quest","onShortcutCast","_ref$isBlockedCasting","isBlockedCastingByKeyboard","shortcutsRefs","handleKeyDown","shortcutIndex","_shortcutsRefs$curren","_shortcutsRefs$curren2","skill","onRenderSkillCategory","category","skillCategory","skillCategoryColor","output","entries","skillDetails","experience","xpToNextLevel","onInputFocus","onInputBlur","spells","magicLevel","onSpellClick","setSpellShortcut","search","setSearch","handleEscapeClose","spellsToDisplay","sort","a","b","spell","toLocaleLowerCase","setShortcut","Fragment","TimeClock","traderItems","characterAvailableGold","sum","setSum","Map","qtyMap","setQtyMap","set","newSum","get","isBuy","hasGoldForSale","tradeItem","assign"],"mappings":"mkCAAO,ICIKA,0DAAAA,EAAAA,sBAAAA,oDAEVA,4CCHUC,EDcCC,EAAS,oBACpBC,SAAAA,gBACAC,IAAAA,SACAC,IAAAA,WACAC,IAAAA,cACGC,SAEH,OACEC,gBAACC,iBACCC,aAAcL,EACdF,SAAUA,GACNI,GACJD,cAAeA,IAEfE,yBAAIJ,KAKJK,EAAkBE,EAAOC,mBAAMC,sCAAAC,2BAAbH,gCDhCb,QGeEI,EAAoC,gBAC/CC,IAAAA,UACAC,IAAAA,SACAC,IAAAA,UAASC,IACTC,MAAAA,aAAQC,eAAUC,IAClBC,OAAAA,aAASC,gBAAWC,IACpBC,SAAAA,aAAW,IACXC,IAAAA,SACArB,IAAAA,cACAsB,IAAAA,eAAcC,IACdC,UAAAA,gBAAiBC,IACjBC,QAAAA,aAAU,IACVC,IAAAA,aAKMC,EACJlB,EAAUmB,OAAOjB,IAAcF,EAAUmB,OAAO,uBAElD,IAAKD,EAAY,MAAM,IAAIE,gBAAgBlB,0BAE3C,OACEV,gBAAC6B,GACCjB,MAAOA,EACPG,OAAQA,EACRe,SAAUR,EACVxB,cAAeA,EACfiC,MAAOX,GAEPpB,gBAACgC,GACC9B,oCAAoCuB,GAAgB,IACpDhB,SAAUA,EACVwB,MAAOP,EAAWO,MAClBC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