@rpg-engine/long-bow 0.4.87 → 0.4.89

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.
@@ -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/Shortcuts/useShortcutCooldown.ts","../src/components/CircularController/CircularController.tsx","../src/hooks/useOutsideAlerter.ts","../src/components/NPCDialog/NPCDialog.tsx","../src/components/DraggableContainer.tsx","../src/components/InputRadio.tsx","../src/libs/itemCounter.ts","../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/CraftingRecipe.tsx","../src/components/CraftBook/CraftBook.tsx","../src/components/Dropdown.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/Marketplace/filters/index.tsx","../src/components/Item/Inventory/ItemQuantitySelector.tsx","../src/components/Shortcuts/ShortcutsSetter.tsx","../src/components/Item/Inventory/ItemContainer.tsx","../src/components/ListMenu.tsx","../src/components/Pager.tsx","../src/components/ConfirmModal.tsx","../src/components/Marketplace/MarketplaceRows.tsx","../src/components/Marketplace/BuyPanel.tsx","../src/components/Marketplace/ManagmentPanel.tsx","../src/components/Marketplace/Marketplace.tsx","../src/components/PartySystem/PartyCreate/PartyCreate.tsx","../src/components/PartySystem/PartyDashboard/PartyRows.tsx","../src/components/PartySystem/PartyDashboard/PartyDashboard.tsx","../src/components/PartySystem/PartyInvite/PlayersRows.tsx","../src/components/PartySystem/PartyInvite/PartyInvite.tsx","../src/components/PartySystem/PartyManager/PartyManagerRows.tsx","../src/components/PartySystem/PartyManager/PartyManager.tsx","../src/components/PartySystem/mockedConstantes/mockedValues.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/cards/SpellInfo.tsx","../src/libs/CastingTypeHelper.ts","../src/components/Spellbook/cards/SpellInfoDisplay.tsx","../src/components/Spellbook/cards/MobileSpellTooltip.tsx","../src/components/Spellbook/cards/SpellTooltip.tsx","../src/components/Spellbook/cards/SpellInfoWrapper.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/itemSelector/ItemSelector.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 <span className={`ellipsis-${maxLines}-lines`}>{children}</span>\n </Container>\n );\n};\n\ninterface IContainerProps {\n maxWidth?: string;\n fontSize?: string;\n center?: boolean;\n}\n\nconst Container = styled.span<IContainerProps>`\n display: block;\n margin: 0;\n\n .ellipsis-1-lines {\n display: block;\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\n .ellipsis-2-lines {\n display: block;\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\n .ellipsis-3-lines {\n display: block;\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: '#888',\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: '#66cd1c',\n brownGreen: '#346524',\n white: '#fff'\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 .onCooldown {\n color: ${uiColors.gray};\n }\n\n .cooldown {\n position: absolute;\n z-index: 1;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n background-color: rgba(0 0 0 / 60%);\n font-size: 0.7rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ${uiColors.darkYellow};\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 { useEffect, useRef, useState } from \"react\";\n\nexport const useShortcutCooldown = (onShortcutCast: (index: number) => void) => {\n const [shortcutCooldown, setShortcutCooldown] = useState(0);\n const cooldownTimeout = useRef<NodeJS.Timeout | null>(null);\n\n const handleShortcutCast = (index: number) => {\n console.log(shortcutCooldown);\n if (shortcutCooldown <= 0) setShortcutCooldown(1.5);\n onShortcutCast(index);\n };\n\n useEffect(() => {\n if (cooldownTimeout.current) clearTimeout(cooldownTimeout.current);\n\n if (shortcutCooldown > 0) {\n cooldownTimeout.current = setTimeout(() => {\n setShortcutCooldown(shortcutCooldown - 0.1);\n }, 100);\n }\n }, [shortcutCooldown]);\n\n return { shortcutCooldown, handleShortcutCast };\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';\nimport { useShortcutCooldown } from '../Shortcuts/useShortcutCooldown';\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 spellCooldowns?: Record<string, number>;\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 spellCooldowns,\n}) => {\n const { handleShortcutCast, shortcutCooldown } = useShortcutCooldown(\n onShortcutClick\n );\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 const buildClassName = (classBase: string, isOnCooldown: boolean) => {\n return `${classBase} ${isOnCooldown ? 'onCooldown' : ''}`;\n };\n\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 ? handleShortcutCast.bind(null, i)\n : () => {};\n\n const isOnShortcutCooldown = shortcutCooldown > 0;\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 {isOnShortcutCooldown && (\n <span className=\"cooldown\">{shortcutCooldown.toFixed(1)}</span>\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={buildClassName('qty', isOnShortcutCooldown)}>\n {totalQty}\n </span>\n </StyledShortcut>\n );\n }\n\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\n\n const spellCooldown = !payload\n ? 0\n : spellCooldowns?.[payload.magicWords.replaceAll(' ', '_')] ??\n shortcutCooldown;\n const cooldown =\n spellCooldown > shortcutCooldown ? spellCooldown : shortcutCooldown;\n const isOnCooldown = cooldown > 0 && !!payload;\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 {isOnCooldown && (\n <span className=\"cooldown\">\n {cooldown.toFixed(cooldown < 10 ? 1 : 0)}\n </span>\n )}\n <span className={buildClassName('mana', isOnCooldown)}>\n {payload && payload.manaCost}\n </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 dragDisabled?: boolean;\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 dragDisabled = false,\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 disabled={dragDisabled}\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: 950px) {\n font-size: 1.7rem;\n padding: 12px;\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 from 'react';\n\ninterface IProps\n extends React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n > {\n label: string;\n name: string;\n value: string;\n isChecked: boolean;\n onRadioSelect: (value: string) => void;\n}\n\nexport const InputRadio: React.FC<IProps> = ({\n label,\n name,\n value,\n isChecked,\n onRadioSelect,\n}) => {\n const onRadioClick = (): void => {\n onRadioSelect(value);\n };\n\n return (\n <div onPointerUp={onRadioClick}>\n <input\n className=\"rpgui-radio\"\n name={name}\n value={value}\n type=\"radio\"\n data-rpguitype=\"radio\"\n checked={isChecked}\n // rpgui breaks onChange on this input (doesn't work). That's why I had to wrap it with a div and a onClick listener.\n readOnly\n ></input>\n <label>{label}</label>\n </div>\n );\n};\n","import { IItem, IItemContainer } from \"@rpg-engine/shared\";\n\nexport const countItemFromInventory = (itemKey: string, inventory: IItemContainer) => {\n let itemsFromInventory: (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 === itemKey) {\n itemsFromInventory.push(inventory.slots[index]);\n }\n });\n }\n\n const totalQty = itemsFromInventory.reduce(\n (acc, item) => acc + (item?.stackQty || 1),\n 0\n );\n\n return totalQty;\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: 640px) {\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: 640px) {\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: 640px) {\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 && containerType) {\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 && containerType)\n 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 onPointerDown={\n onDragStart !== undefined && onDragEnd !== undefined\n ? undefined\n : () => {\n if (item) onPointerDown(item.type, containerType ?? null, item);\n }\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 disabled={onDragStart === undefined || onDragEnd === undefined}\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 ?? null, item);\n }\n }}\n onStart={() => {\n if (!item || isSelectingShortcut) {\n return;\n }\n\n if (onDragStart && containerType) {\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?.(\n event,\n slotIndex,\n item,\n event.clientX,\n event.clientY\n );\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 renderEntityEffects = () => {\n if (!item.entityEffects || !item.entityEffectChance) return null;\n\n return item.entityEffects.map((effect, index) => (\n <Statistic key={index} $isSpecial>\n {effect[0].toUpperCase() + effect.slice(1)} ({item.entityEffectChance}%)\n </Statistic>\n ));\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 {item.minRequirements && (\n <LevelRequirement>\n <div className=\"title\">Requirements:</div>\n <div>- Level: {item.minRequirements.level}</div>\n <div>\n -{' '}\n {item.minRequirements.skill.name[0].toUpperCase() +\n item.minRequirements.skill.name.slice(1)}\n : {item.minRequirements.skill.level}\n </div>\n </LevelRequirement>\n )}\n\n {renderStatistics()}\n {renderEntityEffects()}\n {item.usableEffectDescription && (\n <Statistic $isSpecial>{item.usableEffectDescription}</Statistic>\n )}\n {item.equippedBuffDescription && (\n <Statistic $isSpecial>{item.equippedBuffDescription}</Statistic>\n )}\n {item.isTwoHanded && <Statistic $isSpecial>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: 18rem;\n\n @media (max-width: 640px) {\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 LevelRequirement = styled.div`\n font-size: ${uiFonts.size.small};\n margin-top: 0.2rem;\n margin-bottom: 1rem;\n color: ${uiColors.orange};\n\n .title {\n margin-bottom: 4px;\n }\n\n div {\n margin-bottom: 2px;\n }\n`;\n\nconst Statistic = styled.div<{ $isSpecial?: boolean }>`\n margin-bottom: 0.4rem;\n width: 100%;\n color: ${({ $isSpecial }) => ($isSpecial ? uiColors.darkYellow : 'inherit')};\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 itemSubTypeFromEquipment = Object.values(equipmentSet).find(\n item => camelCase(item?.subType ?? '') === itemSubTypeCamelCase\n );\n\n const itemFromEquipment = itemSubTypeFromEquipment\n ? itemSubTypeFromEquipment\n : (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 align-items: center;\n\n @media (max-width: 640px) {\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 {\n ICraftableItem,\n IEquipmentSet,\n IItemContainer,\n ISkill,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { countItemFromInventory } from '../../libs/itemCounter';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\ninterface ICraftingRecipeProps {\n atlasJSON: any;\n atlasIMG: any;\n equipmentSet?: IEquipmentSet | null;\n recipe: ICraftableItem;\n scale?: number;\n handleRecipeSelect: () => void;\n selectedCraftItemKey?: string;\n inventory?: IItemContainer | null;\n skills?: ISkill | null;\n}\n\nexport const CraftingRecipe: React.FC<ICraftingRecipeProps> = ({\n atlasIMG,\n atlasJSON,\n equipmentSet,\n recipe,\n scale,\n handleRecipeSelect,\n selectedCraftItemKey,\n inventory,\n skills,\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 levelInSkill =\n (skills?.[\n (recipe?.minCraftingRequirements?.[0] ?? '') as keyof ISkill\n ] as any)?.level ?? 1;\n\n return (\n <RadioOptionsWrapper>\n <SpriteAtlasWrapper>\n <ItemInfoWrapper\n item={recipe}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={recipe.texturePath}\n imgScale={3}\n grayScale={!recipe.canCraft}\n />\n </ItemInfoWrapper>\n </SpriteAtlasWrapper>\n <div>\n <div onPointerUp={recipe.canCraft ? handleRecipeSelect : undefined}>\n <input\n className=\"rpgui-radio\"\n type=\"radio\"\n value={recipe.name}\n name=\"test\"\n disabled={!recipe.canCraft}\n checked={selectedCraftItemKey === recipe.key}\n onChange={handleRecipeSelect}\n />\n <label style={{ display: 'flex', alignItems: 'center' }}>\n {modifyString(recipe.name)}\n </label>\n </div>\n\n <MinCraftingRequirementsText levelIsOk={recipe?.levelIsOk ?? false}>\n {modifyString(`${recipe?.minCraftingRequirements?.[0] ?? ''}`)} lvl{' '}\n {recipe?.minCraftingRequirements?.[1] ?? 0} ({levelInSkill})\n </MinCraftingRequirementsText>\n\n {recipe.ingredients.map((ingredient, index) => {\n const itemQtyInInventory = !inventory\n ? 0\n : countItemFromInventory(ingredient.key, inventory);\n\n return (\n <Recipe key={index}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={ingredient.texturePath}\n imgScale={1.2}\n />\n <Ingredient isQuantityOk={ingredient.qty <= itemQtyInInventory}>\n {modifyString(ingredient.key)} x{ingredient.qty} (\n {itemQtyInInventory})\n </Ingredient>\n </Recipe>\n );\n })}\n </div>\n </RadioOptionsWrapper>\n );\n};\n\nconst Ingredient = styled.p<{ isQuantityOk: boolean }>`\n margin: 0;\n margin-left: 14px;\n color: ${({ isQuantityOk }) =>\n isQuantityOk ? uiColors.lightGreen : uiColors.lightGray} !important;\n`;\n\nconst Recipe = styled.div`\n font-size: 0.6rem;\n margin-bottom: 3px;\n display: flex;\n align-items: center;\n margin-left: 4px;\n\n .sprite-from-atlas-img {\n top: 0px;\n left: 0px;\n }\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 MinCraftingRequirementsText = styled.p<{ levelIsOk: boolean }>`\n font-size: 0.6rem !important;\n margin: 0 5px 0 35px;\n color: ${({ levelIsOk }) =>\n levelIsOk ? uiColors.lightGreen : uiColors.lightGray} !important;\n`;\n","import {\n ICraftableItem,\n IEquipmentSet,\n IItemContainer,\n ISkill,\n ItemSubType,\n} from '@rpg-engine/shared';\nimport React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { InputRadio } from '../InputRadio';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { CraftingRecipe } from './CraftingRecipe';\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 inventory?: IItemContainer | null;\n scale?: number;\n skills?: ISkill | null;\n savedSelectedType?: string;\n}\n\nexport interface ShowMessage {\n show: boolean;\n index: number;\n}\n\nconst desktop = {\n width: 'min(900px, 80%)',\n height: 'min(700px, 80%)',\n};\n\nconst mobileLanscape = {\n width: '800px',\n height: '500px',\n};\n\nconst mobilePortrait = {\n width: '500px',\n height: '700px',\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 inventory,\n skills,\n savedSelectedType,\n}) => {\n const [craftItemKey, setCraftItemKey] = useState<string>();\n const [selectedType, setSelectedType] = useState<string>(\n savedSelectedType ?? Object.keys(ItemSubType)[0]\n );\n const [size, setSize] = useState<{ width: string; height: string }>();\n\n useEffect(() => {\n const handleResize = (): void => {\n if (\n window.innerWidth < 500 &&\n size?.width !== mobilePortrait.width &&\n (!scale || scale < 1)\n ) {\n setSize(mobilePortrait);\n } else if (\n (!scale || scale < 1) &&\n size?.width !== mobileLanscape.width\n ) {\n setSize(mobileLanscape);\n } else if (size?.width !== desktop.width) {\n setSize(desktop);\n }\n };\n handleResize();\n\n window.addEventListener('resize', handleResize);\n\n return () => window.removeEventListener('resize', handleResize);\n }, [scale]);\n\n const renderItemTypes = () => {\n const itemTypes = ['Suggested', ...Object.keys(ItemSubType)]\n .filter(type => type !== 'DeadBody')\n .sort((a, b) => {\n if (a === 'Suggested') return -1;\n if (b === 'Suggested') return 1;\n return a.localeCompare(b);\n });\n\n if (window.innerWidth > parseInt(mobilePortrait.width)) {\n return itemTypes.map(type => {\n return (\n <InputRadio\n key={type}\n value={type}\n label={type}\n name={type}\n isChecked={selectedType === type}\n onRadioSelect={value => {\n setSelectedType(value);\n onSelect(value);\n }}\n />\n );\n });\n }\n\n const rows: JSX.Element[][] = [[], []];\n\n itemTypes.forEach((type, index) => {\n let row = 0;\n\n if (index % 2 === 1) row = 1;\n\n rows[row].push(\n <InputRadio\n key={type}\n value={type}\n label={type}\n name={type}\n isChecked={selectedType === type}\n onRadioSelect={value => {\n setSelectedType(value);\n onSelect(value);\n }}\n />\n );\n });\n\n return rows.map((row, index) => (\n <div key={index} style={{ display: 'flex', gap: '10px' }}>\n {row}\n </div>\n ));\n };\n\n if (!size) return null;\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n width={size.width}\n height={size.height}\n cancelDrag=\".inputRadioCraftBook\"\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n scale={scale}\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Craftbook</Title>\n <Subtitle>Select an item to craft</Subtitle>\n <hr className=\"golden\" />\n </div>\n\n <ContentContainer>\n <ItemTypes className=\"inputRadioCraftBook\">\n {renderItemTypes()}\n </ItemTypes>\n\n <RadioInputScroller className=\"inputRadioCraftBook\">\n {craftablesItems?.map(item => (\n <CraftingRecipe\n key={item.key}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n recipe={item}\n scale={scale}\n handleRecipeSelect={setCraftItemKey.bind(null, item.key)}\n selectedCraftItemKey={craftItemKey}\n inventory={inventory}\n skills={skills}\n />\n ))}\n </RadioInputScroller>\n </ContentContainer>\n <ButtonWrapper>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n <Button\n disabled={!craftItemKey}\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onCraftItem(craftItemKey)}\n >\n Craft\n </Button>\n </ButtonWrapper>\n </Wrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst Subtitle = styled.h1`\n font-size: 0.4rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst RadioInputScroller = styled.div`\n padding-left: 15px;\n padding-top: 10px;\n margin-top: 1rem;\n align-items: center;\n align-items: flex-start;\n overflow-y: scroll;\n min-height: 0;\n flex: 1;\n margin-left: 10px;\n -webkit-overflow-scrolling: touch;\n\n @media (max-width: ${mobilePortrait.width}) {\n margin-left: 0;\n }\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: flex-end;\n margin-top: 10px;\n width: 100%;\n\n button {\n padding: 0px 50px;\n margin: 5px;\n }\n\n @media (max-width: ${mobilePortrait.width}) {\n justify-content: center;\n }\n`;\n\nconst ContentContainer = styled.div`\n display: flex;\n width: 100%;\n min-height: 0;\n flex: 1;\n\n @media (max-width: ${mobilePortrait.width}) {\n flex-direction: column;\n }\n`;\n\nconst ItemTypes = styled.div`\n display: flex;\n overflow-y: scroll;\n overflow-x: hidden;\n width: max-content;\n flex-direction: column;\n padding-right: 5px;\n\n @media (max-width: ${mobilePortrait.width}) {\n overflow-x: scroll;\n overflow-y: hidden;\n padding-right: 0;\n width: 100%;\n }\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 onPointerUp={() => 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 onPointerUp={() => {\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 label {\n display: inline-block;\n transform: translateY(-2px);\n }\n`;\n\nconst DropdownOptions = styled.ul<{\n opened: boolean;\n}>`\n position: absolute;\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n display: ${props => (props.opened ? 'block' : 'none')};\n box-sizing: border-box;\n\n @media (max-width: 768px) {\n padding: 8px 0;\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 { ItemRarities, ItemSubType } from '@rpg-engine/shared';\nimport React from 'react';\nimport { IOptionsProps } from '../../Dropdown';\n\nexport enum OrderByType {\n Name = 'Name',\n Price = 'Price',\n}\n\nexport const itemTypeOptions: IOptionsProps[] = [\n 'Type',\n ...Object.keys(ItemSubType),\n]\n .filter(type => type !== 'DeadBody')\n .map((itemType, index) => ({\n id: index + 1,\n value: itemType,\n option: itemType,\n }));\n\nexport const itemRarityOptions: IOptionsProps[] = [\n 'Rarity',\n ...Object.values(ItemRarities),\n].map((itemRarity, index) => ({\n id: index + 1,\n value: itemRarity,\n option: itemRarity,\n}));\n\nexport const orderByOptions: IOptionsProps[] = Object.values(\n OrderByType\n).flatMap((orderBy, index) => [\n {\n id: index * 2 + 1,\n value: orderBy.toLowerCase(),\n option: (\n <>\n {orderBy}{' '}\n <span\n style={{\n transform: 'translateY(-2px)',\n display: 'inline-block',\n }}\n >\n ↑\n </span>\n </>\n ),\n },\n {\n id: index * 2 + 2,\n value: '-' + orderBy.toLowerCase(),\n option: (\n <>\n {orderBy}{' '}\n <span\n style={{\n transform: 'translateY(-2px)',\n display: 'inline-block',\n }}\n >\n ↓\n </span>\n </>\n ),\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 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 { uiColors } from '../constants/uiColors';\nimport { uiFonts } from '../constants/uiFonts';\n\ninterface PagerProps {\n totalItems: number;\n currentPage: number;\n itemsPerPage: number;\n onPageChange: (page: number) => void;\n}\n\nexport const Pager: React.FC<PagerProps> = ({\n totalItems,\n currentPage,\n itemsPerPage,\n onPageChange,\n}) => {\n const totalPages = Math.ceil(totalItems / itemsPerPage);\n\n return (\n <Container>\n <p>Total items: {totalItems}</p>\n <PagerContainer>\n <button\n disabled={currentPage === 1}\n onPointerDown={() => onPageChange(Math.max(currentPage - 1, 1))}\n >\n {'<'}\n </button>\n\n <div className=\"rpgui-container framed-grey\">{currentPage}</div>\n\n <button\n disabled={currentPage === totalPages}\n onPointerDown={() =>\n onPageChange(Math.min(currentPage + 1, totalPages))\n }\n >\n {'>'}\n </button>\n </PagerContainer>\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n\n p {\n margin: 0;\n font-size: ${uiFonts.size.xsmall};\n }\n`;\n\nconst PagerContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 5px;\n\n p {\n margin: 0;\n }\n\n div {\n color: white;\n }\n\n button {\n width: 40px;\n height: 40px;\n background-color: ${uiColors.darkGray};\n border: none;\n border-radius: 5px;\n color: white;\n\n :hover {\n background-color: ${uiColors.lightGray};\n }\n\n :disabled {\n opacity: 0.5;\n }\n\n &.active {\n background-color: ${uiColors.orange};\n font-weight: bold;\n color: black;\n }\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from './Abstractions/ModalPortal';\nimport { Button, ButtonTypes } from './Button';\nimport { DraggableContainer } from './DraggableContainer';\n\ninterface IConfirmModalProps {\n onConfirm: () => void;\n onClose: () => void;\n message?: string;\n}\n\nexport const ConfirmModal: React.FC<IConfirmModalProps> = ({\n onConfirm,\n onClose,\n message,\n}) => {\n return (\n <ModalPortal>\n <Background />\n <Container onPointerDown={onClose}>\n <DraggableContainer width=\"auto\" dragDisabled>\n <Wrapper onPointerDown={e => e.stopPropagation()}>\n <p>{message ?? 'Are you sure?'}</p>\n\n <ButtonsWrapper>\n <div className=\"cancel-button\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={onClose}\n >\n No\n </Button>\n </div>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={onConfirm}\n >\n Yes\n </Button>\n </ButtonsWrapper>\n </Wrapper>\n </DraggableContainer>\n </Container>\n </ModalPortal>\n );\n};\n\nconst Background = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: #000000;\n opacity: 0.5;\n left: 0;\n top: 0;\n z-index: 1000;\n`;\n\nconst Container = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1001;\n`;\n\nconst Wrapper = styled.div`\n p {\n margin: 0;\n }\n`;\n\nconst ButtonsWrapper = styled.div`\n display: flex;\n justify-content: flex-end;\n gap: 5px;\n margin-top: 5px;\n\n .cancel-button {\n filter: grayscale(0.7);\n }\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 { rarityColor } from '../Item/Inventory/ItemSlot';\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 onMarketPlaceItemBuy?: () => void;\n onMarketPlaceItemRemove?: () => void;\n disabled?: boolean;\n}\n\nexport const MarketplaceRows: React.FC<IMarketPlaceRowsPropos> = ({\n atlasJSON,\n atlasIMG,\n item,\n itemPrice,\n equipmentSet,\n scale,\n onMarketPlaceItemBuy,\n onMarketPlaceItemRemove,\n disabled,\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 <RarityContainer item={item}>\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 </RarityContainer>\n <QuantityContainer>\n {item.stackQty &&\n item.stackQty > 1 &&\n `x${Math.round(item.stackQty * 10) / 10}`}\n </QuantityContainer>\n </ItemInfoWrapper>\n </SpriteContainer>\n <PriceValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n {item.name}\n </Ellipsis>\n </p>\n </PriceValue>\n </ItemIconContainer>\n\n <Flex>\n <ItemIconContainer>\n <GoldContainer>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey=\"others/gold-coin-qty-5.png\"\n imgScale={2}\n />\n </GoldContainer>\n <PriceValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n ${itemPrice}\n </Ellipsis>\n </p>\n </PriceValue>\n </ItemIconContainer>\n <ButtonContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={disabled}\n onPointerDown={() => {\n if (disabled) return;\n\n onMarketPlaceItemBuy?.();\n onMarketPlaceItemRemove?.();\n }}\n >\n {onMarketPlaceItemBuy ? 'Buy' : 'Remove'}\n </Button>\n </ButtonContainer>\n </Flex>\n </MarketplaceWrapper>\n );\n};\n\nconst MarketplaceWrapper = styled.div`\n margin: auto;\n display: flex;\n justify-content: space-between;\n padding: 0.5rem;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n\n p {\n font-size: 0.8rem;\n }\n`;\n\nconst QuantityContainer = styled.p`\n position: absolute;\n display: block;\n top: 15px;\n left: 25px;\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n\nconst Flex = styled.div`\n display: flex;\n gap: 24px;\n`;\n\nconst ItemIconContainer = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n`;\n\nconst GoldContainer = styled.div`\n position: relative;\n top: -0.5rem;\n left: 0.5rem;\n`;\nconst SpriteContainer = styled.div`\n position: relative;\n left: 0.5rem;\n`;\n\nconst PriceValue = styled.div`\n margin-left: 40px;\n`;\n\nconst ButtonContainer = styled.div`\n margin: auto;\n`;\n\nconst RarityContainer = styled.div<{ item: IItem }>`\n border-color: ${({ item }) => rarityColor(item)};\n box-shadow: ${({ item }) => `0 0 5px 8px ${rarityColor(item)}`} inset,\n ${({ item }) => `0 0 8px 6px ${rarityColor(item)}`};\n width: 32px;\n height: 32px;\n`;\n","import { IEquipmentSet, IMarketplaceItem } from '@rpg-engine/shared';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { AiFillCaretRight } from 'react-icons/ai';\nimport styled from 'styled-components';\nimport { ConfirmModal } from '../ConfirmModal';\nimport { Dropdown } from '../Dropdown';\nimport { Input } from '../Input';\nimport { MarketplaceRows } from './MarketplaceRows';\nimport { itemRarityOptions, itemTypeOptions, orderByOptions } from './filters';\n\nexport interface IBuyPanelProps {\n items: IMarketplaceItem[];\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onChangeType: (value: string) => void;\n onChangeRarity: (value: string) => void;\n onChangeOrder: (value: string) => void;\n onChangeNameInput: (value: string) => void;\n onChangeMainLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangeSecondaryLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangePriceInput: (value: [number | undefined, number | undefined]) => void;\n scale?: number;\n equipmentSet?: IEquipmentSet | null;\n onMarketPlaceItemBuy?: (marketPlaceItemId: string) => void;\n characterId: string;\n enableHotkeys?: () => void;\n disableHotkeys?: () => void;\n currentPage: number;\n}\n\nexport const BuyPanel: React.FC<IBuyPanelProps> = ({\n items,\n atlasIMG,\n atlasJSON,\n onChangeType,\n onChangeRarity,\n onChangeOrder,\n onChangeNameInput,\n onChangeMainLevelInput,\n onChangeSecondaryLevelInput,\n onChangePriceInput,\n equipmentSet,\n onMarketPlaceItemBuy,\n characterId,\n enableHotkeys,\n disableHotkeys,\n currentPage,\n}) => {\n const [name, setName] = useState('');\n const [mainLevel, setMainLevel] = useState<\n [number | undefined, number | undefined]\n >([undefined, undefined]);\n const [secondaryLevel, setSecondaryLevel] = useState<\n [number | undefined, number | undefined]\n >([undefined, undefined]);\n const [price, setPrice] = useState<[number | undefined, number | undefined]>([\n undefined,\n undefined,\n ]);\n const [buyingItemId, setBuyingItemId] = useState<string | null>(null);\n\n const itemsContainer = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n itemsContainer.current?.scrollTo(0, 0);\n }, [currentPage]);\n\n return (\n <>\n {buyingItemId && (\n <ConfirmModal\n onClose={setBuyingItemId.bind(null, null)}\n onConfirm={() => {\n onMarketPlaceItemBuy?.(buyingItemId);\n setBuyingItemId(null);\n enableHotkeys?.();\n }}\n message=\"Are you sure to buy this item?\"\n />\n )}\n <InputWrapper>\n <p>Search By Name</p>\n <Input\n onChange={e => {\n setName(e.target.value);\n onChangeNameInput(e.target.value);\n }}\n value={name}\n placeholder=\"Enter name...\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </InputWrapper>\n\n <OptionsWrapper>\n <FilterInputsWrapper>\n <div>\n <p>Main level</p>\n <Input\n onChange={e => {\n setMainLevel([Number(e.target.value), mainLevel[1]]);\n onChangeMainLevelInput([Number(e.target.value), mainLevel[1]]);\n }}\n placeholder=\"Min\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <AiFillCaretRight />\n <Input\n onChange={e => {\n setMainLevel([mainLevel[0], Number(e.target.value)]);\n onChangeMainLevelInput([mainLevel[0], Number(e.target.value)]);\n }}\n placeholder=\"Max\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </div>\n\n <div>\n <p>Secondary level</p>\n <Input\n onChange={e => {\n setSecondaryLevel([Number(e.target.value), secondaryLevel[1]]);\n onChangeSecondaryLevelInput([\n Number(e.target.value),\n secondaryLevel[1],\n ]);\n }}\n placeholder=\"Min\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <AiFillCaretRight />\n <Input\n onChange={e => {\n setSecondaryLevel([secondaryLevel[0], Number(e.target.value)]);\n onChangeSecondaryLevelInput([\n secondaryLevel[0],\n Number(e.target.value),\n ]);\n }}\n placeholder=\"Max\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </div>\n\n <div>\n <p>Price</p>\n <Input\n onChange={e => {\n setPrice([Number(e.target.value), price[1]]);\n onChangePriceInput([Number(e.target.value), price[1]]);\n }}\n placeholder=\"Min\"\n type=\"number\"\n min={0}\n className=\"big-input\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <AiFillCaretRight />\n <Input\n onChange={e => {\n setPrice([price[0], Number(e.target.value)]);\n onChangePriceInput([price[0], Number(e.target.value)]);\n }}\n placeholder=\"Max\"\n type=\"number\"\n min={0}\n className=\"big-input\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </div>\n </FilterInputsWrapper>\n\n <WrapperContainer>\n <StyledDropdown\n options={itemTypeOptions}\n onChange={onChangeType}\n width=\"95%\"\n />\n <StyledDropdown\n options={itemRarityOptions}\n onChange={onChangeRarity}\n width=\"95%\"\n />\n <StyledDropdown\n options={orderByOptions}\n onChange={onChangeOrder}\n width=\"100%\"\n />\n </WrapperContainer>\n </OptionsWrapper>\n\n <ItemComponentScrollWrapper id=\"MarketContainer\" ref={itemsContainer}>\n {items?.map(({ item, price, _id, owner }, index) => (\n <MarketplaceRows\n key={`${item.key}_${index}`}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n item={item}\n itemPrice={price}\n equipmentSet={equipmentSet}\n onMarketPlaceItemBuy={setBuyingItemId.bind(null, _id)}\n disabled={owner === characterId}\n />\n ))}\n </ItemComponentScrollWrapper>\n </>\n );\n};\n\nconst InputWrapper = styled.div`\n width: 95%;\n display: flex !important;\n justify-content: flex-start;\n align-items: center;\n margin: auto;\n\n p {\n width: auto;\n margin-right: 20px;\n }\n\n input {\n width: 68%;\n height: 10px;\n }\n`;\n\nconst OptionsWrapper = styled.div`\n width: 100%;\n height: 100px;\n`;\n\nconst FilterInputsWrapper = styled.div`\n width: 95%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n margin-left: 10px;\n gap: 5px;\n color: white;\n flex-wrap: wrap;\n\n p {\n width: auto;\n margin: 0;\n }\n\n input {\n width: 75px;\n height: 10px;\n }\n\n .big-input {\n width: 130px;\n }\n`;\n\nconst WrapperContainer = styled.div`\n display: grid;\n grid-template-columns: 40% 30% 30%;\n justify-content: space-between;\n width: calc(100% - 40px);\n margin-left: 10px;\n\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 @media (max-width: 950px) {\n height: 250px;\n }\n`;\n\nconst StyledDropdown = styled(Dropdown)`\n margin: 3px !important;\n width: 170px !important;\n`;\n","import { IEquipmentSet, IItem, IMarketplaceItem } from '@rpg-engine/shared';\nimport React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Button, ButtonTypes } from '../Button';\nimport { ConfirmModal } from '../ConfirmModal';\nimport { Input } from '../Input';\nimport { ItemSlot } from '../Item/Inventory/ItemSlot';\nimport { MarketplaceRows } from './MarketplaceRows';\n\nexport interface IManagmentPanelProps {\n items: IMarketplaceItem[];\n atlasJSON: any;\n atlasIMG: any;\n onChangeNameInput: (value: string) => void;\n equipmentSet?: IEquipmentSet | null;\n availableGold: number;\n onMarketPlaceItemRemove?: (marketPlaceItemId: string) => void;\n selectedItemToSell: IItem | null;\n onSelectedItemToSellRemove: (item: IItem) => void;\n onAddItemToMarketplace: (item: IItem, price: number) => void;\n enableHotkeys?: () => void;\n disableHotkeys?: () => void;\n onMoneyWithdraw: () => void;\n currentPage: number;\n}\n\nexport const ManagmentPanel: React.FC<IManagmentPanelProps> = ({\n items,\n atlasIMG,\n atlasJSON,\n onChangeNameInput,\n equipmentSet,\n availableGold,\n onMarketPlaceItemRemove,\n selectedItemToSell,\n onSelectedItemToSellRemove,\n onAddItemToMarketplace,\n enableHotkeys,\n disableHotkeys,\n onMoneyWithdraw,\n currentPage,\n}) => {\n const [name, setName] = useState('');\n const [price, setPrice] = useState('');\n const [isCreatingOffer, setIsCreatingOffer] = useState(false);\n const [removingItemId, setRemovingItemId] = useState<string | null>(null);\n\n const itemsContainer = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n itemsContainer.current?.scrollTo(0, 0);\n }, [currentPage]);\n\n return (\n <>\n {isCreatingOffer && (\n <ConfirmModal\n onClose={setIsCreatingOffer.bind(null, false)}\n onConfirm={() => {\n if (selectedItemToSell && price && Number(price)) {\n onAddItemToMarketplace(selectedItemToSell, Number(price));\n setPrice('');\n onSelectedItemToSellRemove(selectedItemToSell);\n setIsCreatingOffer(false);\n enableHotkeys?.();\n }\n }}\n message=\"Are you sure to create this offer?\"\n />\n )}\n {removingItemId && (\n <ConfirmModal\n onClose={setRemovingItemId.bind(null, null)}\n onConfirm={() => {\n onMarketPlaceItemRemove?.(removingItemId);\n setRemovingItemId(null);\n enableHotkeys?.();\n }}\n message=\"Are you sure to remove this item?\"\n />\n )}\n <InputWrapper>\n <p>Search By Name</p>\n <Input\n onChange={e => {\n setName(e.target.value);\n onChangeNameInput(e.target.value);\n }}\n value={name}\n placeholder=\"Enter name...\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </InputWrapper>\n\n <OptionsWrapper>\n <InnerOptionsWrapper>\n <SellDescription>\n Click on item in inventory to sell it\n </SellDescription>\n <Flex>\n <ItemSlot\n slotIndex={0}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n onPointerDown={(_, __, item) => onSelectedItemToSellRemove(item)}\n item={selectedItemToSell}\n />\n <PriceInputWrapper>\n <p>Enter price</p>\n <Flex>\n <Input\n onChange={e => {\n setPrice(e.target.value);\n }}\n value={price}\n placeholder=\"Enter price...\"\n type=\"number\"\n disabled={!selectedItemToSell}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={!selectedItemToSell || !price}\n onPointerDown={() => {\n if (selectedItemToSell && price && Number(price)) {\n setIsCreatingOffer(true);\n }\n }}\n >\n Create offer\n </Button>\n </Flex>\n </PriceInputWrapper>\n </Flex>\n </InnerOptionsWrapper>\n <InnerOptionsWrapper>\n <AvailableGold $disabled={availableGold === 0}>\n <p>Available gold</p>\n <p className=\"center\">${availableGold}</p>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={availableGold === 0}\n onPointerDown={() => availableGold > 0 && onMoneyWithdraw()}\n >\n Withdraw\n </Button>\n </AvailableGold>\n </InnerOptionsWrapper>\n </OptionsWrapper>\n\n <ItemComponentScrollWrapper id=\"MarketContainer\" ref={itemsContainer}>\n {items?.map(({ item, price, _id }, index) => (\n <MarketplaceRows\n key={`${item.key}_${index}`}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n item={item}\n itemPrice={price}\n equipmentSet={equipmentSet}\n onMarketPlaceItemRemove={setRemovingItemId.bind(null, _id)}\n />\n ))}\n </ItemComponentScrollWrapper>\n </>\n );\n};\n\nconst Flex = styled.div`\n display: flex;\n gap: 5px;\n align-items: center;\n`;\n\nconst InputWrapper = styled.div`\n width: 95%;\n display: flex !important;\n justify-content: flex-start;\n align-items: center;\n margin: auto;\n\n p {\n width: auto;\n margin-right: 20px;\n }\n\n input {\n width: 68%;\n height: 10px;\n }\n`;\n\nconst OptionsWrapper = styled.div`\n width: 100%;\n height: 100px;\n display: flex;\n align-items: center;\n justify-content: space-around;\n`;\n\nconst InnerOptionsWrapper = styled.div`\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n height: 100%;\n`;\n\nconst ItemComponentScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n\n @media (max-width: 950px) {\n height: 250px;\n }\n`;\n\nconst PriceInputWrapper = styled.div`\n p {\n margin: 0;\n }\n\n input {\n width: 200px;\n }\n`;\n\nconst SellDescription = styled.p`\n margin: 0;\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n\nconst AvailableGold = styled.div<{ $disabled: boolean }>`\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n p {\n margin: 0;\n color: ${props =>\n props.$disabled ? uiColors.lightGray : 'white'} !important;\n }\n\n .center {\n text-align: center;\n font-size: ${uiFonts.size.large} !important;\n color: ${props =>\n props.$disabled ? uiColors.lightGray : uiColors.lightGreen} !important;\n }\n`;\n","import { IEquipmentSet, IItem, IMarketplaceItem } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Pager } from '../Pager';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { BuyPanel } from './BuyPanel';\nimport { ManagmentPanel } from './ManagmentPanel';\n\nexport interface IMarketPlaceProps {\n items: IMarketplaceItem[];\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onChangeType: (value: string) => void;\n onChangeRarity: (value: string) => void;\n onChangeOrder: (value: string) => void;\n onChangeNameInput: (value: string) => void;\n onChangeMainLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangeSecondaryLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangePriceInput: (value: [number | undefined, number | undefined]) => void;\n scale?: number;\n equipmentSet?: IEquipmentSet | null;\n onMarketPlaceItemBuy?: (marketPlaceItemId: string) => void;\n onMarketPlaceItemRemove?: (marketPlaceItemId: string) => void;\n availableGold: number;\n selectedItemToSell: IItem | null;\n onSelectedItemToSellRemove: (item: IItem) => void;\n onYourPanelToggle: (yourPanel: boolean) => void;\n onAddItemToMarketplace: (item: IItem, price: number) => void;\n characterId: string;\n enableHotkeys?: () => void;\n disableHotkeys?: () => void;\n onMoneyWithdraw: () => void;\n totalItems: number;\n currentPage: number;\n itemsPerPage: number;\n onPageChange: (page: number) => void;\n}\n\nexport const Marketplace: React.FC<IMarketPlaceProps> = props => {\n const { onClose, scale, onYourPanelToggle } = props;\n\n const [isYourPanel, setIsYourPanel] = useState(false);\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"800px\"\n cancelDrag=\"#MarketContainer, .rpgui-dropdown-imp, input, .empty-slot, button\"\n scale={scale}\n >\n {isYourPanel && (\n <>\n <ManagmentPanel {...props} />\n\n <PagerContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n onYourPanelToggle(false);\n setIsYourPanel(false);\n }}\n >\n Go to marketplace\n </Button>\n <Pager {...props} />\n </PagerContainer>\n </>\n )}\n {!isYourPanel && (\n <>\n <BuyPanel {...props} />\n\n <PagerContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n onYourPanelToggle(true);\n setIsYourPanel(true);\n }}\n >\n Go to your panel\n </Button>\n <Pager {...props} />\n </PagerContainer>\n </>\n )}\n </DraggableContainer>\n );\n};\n\nconst PagerContainer = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: calc(100% - 30px);\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { Input } from '../../Input';\nimport { RPGUIContainerTypes } from '../../RPGUIContainer';\n\nexport interface IPartyCreateProps {\n onClose: () => void;\n onCreate: () => void;\n}\n\nexport const PartyCreate: React.FC<IPartyCreateProps> = ({\n onClose,\n onCreate,\n}) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"500px\"\n height=\"300px\"\n cancelDrag=\".partyRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Create Party</Title>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <h1>Type your party name</h1>\n <Input placeholder=\"Type party name\" type=\"text\" />\n <ButtonWrapper>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n onCreate();\n }}\n >\n Confirm\n </Button>\n <div className=\"cancel-button\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n close();\n }}\n >\n Cancel\n </Button>\n </div>\n </ButtonWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst ButtonWrapper = styled.div`\n margin-top: 10px;\n width: 100%;\n display: flex;\n justify-content: space-around;\n align-items: center;\n .cancel-button {\n filter: grayscale(0.7);\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\n\nexport interface IPartyRowProps {\n id: string;\n charName: string;\n charClass: string;\n charLevel: number;\n playerQty: number;\n isInvited: boolean;\n partyName: string;\n}\n\nexport const PartyRow: React.FC<IPartyRowProps> = ({\n charName,\n charClass,\n charLevel,\n playerQty,\n isInvited,\n partyName,\n}) => {\n return (\n <PartyWrapper>\n <TextContainer>{partyName}</TextContainer>\n <TextContainer>{charName}</TextContainer>\n <TextContainer>{charClass}</TextContainer>\n <TextContainer>{charLevel}</TextContainer>\n <TextContainer>{playerQty}/5</TextContainer>\n {isInvited ? (\n <>\n <Button buttonType={ButtonTypes.RPGUIButton}>Accept</Button>\n <div className=\"cancel-button\">\n <Button buttonType={ButtonTypes.RPGUIButton}>Decline</Button>\n </div>\n </>\n ) : (\n <Button buttonType={ButtonTypes.RPGUIButton}>Join</Button>\n )}\n </PartyWrapper>\n );\n};\n\nconst PartyWrapper = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-around;\n .cancel-button {\n filter: grayscale(0.7);\n }\n`;\n\nconst TextContainer = styled.div`\n color: ${uiColors.white};\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { RPGUIContainerTypes } from '../../RPGUIContainer';\nimport { IPartyRowProps, PartyRow } from './PartyRows';\n\nexport interface IPartyDashboardProps {\n partyRows: IPartyRowProps[];\n}\n\nexport const PartyDashboard: React.FC<IPartyDashboardProps> = ({\n partyRows,\n}) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n console.log('Close');\n }}\n width=\"800px\"\n height=\"400px\"\n cancelDrag=\".partyRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Party Dashboard</Title>\n <Button buttonType={ButtonTypes.RPGUIButton}>Create</Button>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <RowsWrapper className=\"partyRows\">\n {partyRows.map(partyRows => (\n <PartyRow\n key={partyRows.id}\n charName={partyRows.charName}\n charClass={partyRows.charClass}\n charLevel={partyRows.charLevel}\n playerQty={partyRows.playerQty}\n id={partyRows.id}\n isInvited={partyRows.isInvited}\n partyName={partyRows.partyName}\n />\n ))}\n </RowsWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\n\nconst RowsWrapper = styled.div`\n overflow-y: scroll;\n -webkit-overflow-scrolling: touch;\n width: 100%;\n height: 200px;\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\n\nexport interface IPlayersRowProps {\n id: string;\n charName: string;\n charClass: string;\n charLevel: number;\n isNotInvited: boolean;\n}\n\nexport const PlayersRow: React.FC<IPlayersRowProps> = ({\n charName,\n charClass,\n charLevel,\n isNotInvited,\n}) => {\n return (\n <PartyWrapper>\n <TextContainer>{charName}</TextContainer>\n <TextContainer>{charClass}</TextContainer>\n <TextContainer>{charLevel}</TextContainer>\n {isNotInvited ? (\n <>\n <Button buttonType={ButtonTypes.RPGUIButton}>Invite</Button>\n </>\n ) : (\n <TextContainer>Invited</TextContainer>\n )}\n </PartyWrapper>\n );\n};\n\nconst PartyWrapper = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-around;\n flex-direction: row;\n flex: auto;\n`;\n\nconst TextContainer = styled.div`\n color: ${uiColors.white};\n flex: auto;\n margin: auto;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { RPGUIContainerTypes } from '../../RPGUIContainer';\nimport { IPlayersRowProps, PlayersRow } from './PlayersRows';\n\nexport interface IPartyInviteProps {\n playersRows: IPlayersRowProps[];\n}\n\nexport const PartyInvite: React.FC<IPartyInviteProps> = ({ playersRows }) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n console.log('Close');\n }}\n width=\"600px\"\n height=\"400px\"\n cancelDrag=\".playersRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Invite for Party</Title>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <RowsWrapper className=\"playersRows\">\n {playersRows.map(playersRows => (\n <PlayersRow\n key={playersRows.id}\n charName={playersRows.charName}\n charClass={playersRows.charClass}\n charLevel={playersRows.charLevel}\n id={playersRows.id}\n isNotInvited={playersRows.isNotInvited}\n />\n ))}\n </RowsWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst RowsWrapper = styled.div`\n overflow-y: scroll;\n -webkit-overflow-scrolling: touch;\n width: 100%;\n height: 200px;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\n\nexport interface IPartyManagerRowProps {\n id: string;\n charName: string;\n charClass: string;\n charLevel: number;\n}\n\nexport const PartyManagerRow: React.FC<IPartyManagerRowProps> = ({\n charName,\n charClass,\n charLevel,\n}) => {\n return (\n <PartyWrapper>\n <TextContainer>{charName}</TextContainer>\n <TextContainer>{charClass}</TextContainer>\n <TextContainer>{charLevel}</TextContainer>\n <div className=\"cancel-button\">\n <Button buttonType={ButtonTypes.RPGUIButton}>Remove</Button>\n </div>\n <Button buttonType={ButtonTypes.RPGUIButton}>New Leader</Button>\n </PartyWrapper>\n );\n};\n\nconst PartyWrapper = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-around;\n .cancel-button {\n filter: grayscale(0.7);\n }\n`;\n\nconst TextContainer = styled.div`\n color: ${uiColors.white};\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { RPGUIContainerTypes } from '../../RPGUIContainer';\nimport { IPartyManagerRowProps, PartyManagerRow } from './PartyManagerRows';\n\nexport interface IPartyManagerProps {\n partyRows: IPartyManagerRowProps[];\n}\n\nexport const PartyManager: React.FC<IPartyManagerProps> = ({ partyRows }) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n console.log('Close');\n }}\n width=\"800px\"\n height=\"400px\"\n cancelDrag=\".partyRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Party Dashboard</Title>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <RowsWrapper className=\"partyRows\">\n {partyRows.map(partyRows => (\n <PartyManagerRow\n key={partyRows.id}\n charName={partyRows.charName}\n charClass={partyRows.charClass}\n charLevel={partyRows.charLevel}\n id={partyRows.id}\n />\n ))}\n </RowsWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\n\nconst RowsWrapper = styled.div`\n width: 100%;\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n","import { v4 as uuidv4 } from 'uuid';\nimport { IPartyRowProps } from '../PartyDashboard/PartyRows';\nimport { IPlayersRowProps } from '../PartyInvite';\nimport { IPartyManagerRowProps } from '../PartyManager';\n\nexport const mockedPartyRows: IPartyRowProps[] = [\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n];\n\nexport const mockedPlayersRows: IPlayersRowProps[] = [\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n];\n\nexport const mockedPartyManager: IPartyManagerRowProps[] = [\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n },\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 mobileScale?: 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 mobileScale,\n}) => {\n value = Math.round(value);\n max = Math.round(max);\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 mobileScale={mobileScale}\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 mobileScale?: number;\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 @media (max-width: 950px) {\n transform: scale(${props => props.mobileScale});\n }\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 { countItemFromInventory } from '../../libs/itemCounter';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SingleShortcut } from './SingleShortcut';\nimport { useShortcutCooldown } from './useShortcutCooldown';\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 spellCooldowns?: Record<string, number>;\n};\n\nexport const Shortcuts: React.FC<ShortcutsProps> = ({\n shortcuts,\n onShortcutCast,\n mana,\n isBlockedCastingByKeyboard = false,\n atlasJSON,\n atlasIMG,\n inventory,\n spellCooldowns,\n}) => {\n const shortcutsRefs = useRef<HTMLButtonElement[]>([]);\n\n const { handleShortcutCast, shortcutCooldown } = useShortcutCooldown(\n onShortcutCast\n );\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 handleShortcutCast(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, shortcutCooldown]);\n\n return (\n <List>\n {Array.from({ length: 6 }).map((_, i) => {\n const buildClassName = (classBase: string, isOnCooldown: boolean) => {\n return `${classBase} ${isOnCooldown ? 'onCooldown' : ''}`;\n };\n\n const isOnShortcutCooldown = shortcutCooldown > 0;\n\n if (shortcuts && 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 =\n payload && inventory\n ? countItemFromInventory(payload.key, inventory)\n : 0;\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={handleShortcutCast.bind(null, i)}\n disabled={false}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n {isOnShortcutCooldown && (\n <span className=\"cooldown\">{shortcutCooldown.toFixed(1)}</span>\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={buildClassName('qty', isOnShortcutCooldown)}>\n {totalQty}\n </span>\n <span\n className={buildClassName('keyboard', isOnShortcutCooldown)}\n >\n {i + 1}\n </span>\n </StyledShortcut>\n );\n }\n\n const payload =\n shortcuts && (shortcuts[i]?.payload as IRawSpell | undefined); //check if shortcuts exists before using the ? operator.\n\n const spellCooldown = !payload\n ? 0\n : spellCooldowns?.[payload.magicWords.replaceAll(' ', '_')] ??\n shortcutCooldown;\n const cooldown =\n spellCooldown > shortcutCooldown ? spellCooldown : shortcutCooldown;\n const isOnCooldown = cooldown > 0 && !!payload;\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={handleShortcutCast.bind(null, i)}\n disabled={mana < (payload?.manaCost ?? 0)}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n {isOnCooldown && (\n <span className=\"cooldown\">\n {cooldown.toFixed(cooldown < 10 ? 1 : 0)}\n </span>\n )}\n <span className={buildClassName('mana', isOnCooldown)}>\n {payload && payload.manaCost}\n </span>\n <span className=\"magicWords\">\n {payload?.magicWords.split(' ').map(word => word[0])}\n </span>\n <span className={buildClassName('keyboard', isOnCooldown)}>\n {i + 1}\n </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 { uiColors } from '../constants/uiColors';\nimport { ErrorBoundary } from './Item/Inventory/ErrorBoundary';\nimport { SimpleProgressBar } from './SimpleProgressBar';\nimport { SpriteFromAtlas } from './shared/SpriteFromAtlas';\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 buffAndDebuff?: number;\n ratio: number;\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 buffAndDebuff,\n ratio,\n}) => {\n if (!skillPointsToNextLevel) {\n skillPointsToNextLevel = getSPForLevel(level + 1);\n }\n\n const skillsBuffsCalc = (level: number, buffAndDebuff: number): string => {\n const result = level * (buffAndDebuff / 100);\n\n if (result > 0) {\n return `+${result.toFixed(2)}`;\n } else {\n return `${result.toFixed(2)}`;\n }\n };\n\n return (\n <>\n <ProgressTitle>\n {buffAndDebuff !== undefined && (\n <>\n {buffAndDebuff > 0 ? (\n <BuffAndDebuffContainer>\n <TitleNameContainer>\n <TitleNameBuff>{skillName}</TitleNameBuff>\n <TitleNameBuff>\n lv {level} ({skillsBuffsCalc(level, buffAndDebuff)})\n </TitleNameBuff>\n </TitleNameContainer>\n <TitleNameBuffContainer>\n <TitleNameBuff>(+{buffAndDebuff}%)</TitleNameBuff>\n </TitleNameBuffContainer>\n </BuffAndDebuffContainer>\n ) : buffAndDebuff < 0 ? (\n <>\n <TitleNameContainer>\n <TitleNameDebuff>{skillName}</TitleNameDebuff>\n <TitleNameDebuff>\n lv {level} ({skillsBuffsCalc(level, buffAndDebuff)})\n </TitleNameDebuff>\n </TitleNameContainer>\n <div>\n <TitleNameDebuff>({buffAndDebuff}%)</TitleNameDebuff>\n </div>\n </>\n ) : (\n <TitleName>{skillName}</TitleName>\n )}\n </>\n )}\n {!buffAndDebuff && (\n <TitleNameContainer>\n <TitleName>{skillName}</TitleName>\n <ValueDisplay>lv {level}</ValueDisplay>\n </TitleNameContainer>\n )}\n </ProgressTitle>\n\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}/{skillPointsToNextLevel}\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 TitleNameBuff = styled.span`\n margin-left: 5px;\n color: ${uiColors.lightGreen} !important;\n`;\n\nconst TitleNameDebuff = styled.span`\n margin-left: 5px;\n color: ${uiColors.red} !important;\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: column;\n justify-content: space-between;\n span {\n font-size: 0.6rem;\n }\n`;\n\nconst BuffAndDebuffContainer = styled.div``;\n\nconst TitleNameBuffContainer = styled.div``;\n\nconst TitleNameContainer = styled.div`\n display: flex;\n justify-content: space-between;\n`;\n","import {\n ISkill,\n ISkillDetails,\n getSPForLevel,\n getXPForLevel,\n} 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 SPRatio = (level: number, skillPoints: number) => {\n const SPLevelActual = getSPForLevel(level + 1);\n const SPLevelBefore = getSPForLevel(level);\n const SPCalc = SPLevelActual - SPLevelBefore;\n if (level === 1) {\n return (skillPoints / SPLevelActual) * 100;\n }\n return ((skillPoints - SPLevelBefore) / SPCalc) * 100;\n };\n\n const XPRatio = (level: number, skillPoints: number) => {\n const XPLevelActual = getXPForLevel(level + 1);\n const XPLevelBefore = getXPForLevel(level);\n const XPCalc = XPLevelActual - XPLevelBefore;\n if (level === 1) {\n return (skillPoints / XPLevelActual) * 100;\n }\n return ((skillPoints - XPLevelBefore) / XPCalc) * 100;\n };\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 if (key === 'stamina') {\n continue;\n }\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(getSPForLevel(skillDetails.level + 1)) || 0\n }\n texturePath={value}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n buffAndDebuff={skillDetails.buffAndDebuff}\n ratio={SPRatio(skillDetails.level, skillDetails.skillPoints)}\n />\n );\n }\n\n return output;\n };\n\n return (\n <SkillsDraggableContainer\n title=\"Skills\"\n cancelDrag=\"#skillsDiv\"\n scale={scale}\n width=\"100%\"\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={\n Math.round(getXPForLevel(skill.level + 1)) || 0\n }\n texturePath={'swords/broad-sword.png'}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n ratio={XPRatio(skill.level, skill.experience)}\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\n max-width: 450px;\n\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 { ISpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport { formatSpellCastingType } from '../../../libs/CastingTypeHelper';\n\ninterface ISpellInfoProps {\n spell: ISpell;\n}\n\nexport const SpellInfo: React.FC<ISpellInfoProps> = ({ spell }) => {\n const {\n magicWords,\n name,\n manaCost,\n requiredItem,\n description,\n castingType,\n cooldown,\n maxDistanceGrid,\n } = spell;\n return (\n <Container>\n <Header>\n <div>\n <Title>{name}</Title>\n <Type>{magicWords}</Type>\n </div>\n </Header>\n <Statistic>\n <div className=\"label\">Casting Type:</div>\n <div className=\"value\">{formatSpellCastingType(castingType)}</div>\n </Statistic>\n <Statistic>\n <div className=\"label\">Magic words:</div>\n <div className=\"value\">{magicWords}</div>\n </Statistic>\n <Statistic>\n <div className=\"label\">Mana cost:</div>\n <div className=\"value\">{manaCost}</div>\n </Statistic>\n <Statistic>\n <div className=\"label\">Cooldown:</div>\n <div className=\"value\">{cooldown}</div>\n </Statistic>\n {maxDistanceGrid && (\n <Statistic>\n <div className=\"label\">Max Distance Grid:</div>\n <div className=\"value\">{maxDistanceGrid}</div>\n </Statistic>\n )}\n <Statistic>\n {requiredItem && (\n <>\n <div className=\"label\">Required Item:</div>\n <div className=\"value\">{requiredItem}</div>\n </>\n )}\n </Statistic>\n <Description>{description}</Description>\n </Container>\n );\n};\n\nconst Container = styled.div`\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 ${uiColors.lightGray};\n height: max-content;\n width: 30rem;\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 Type = styled.div`\n font-size: ${uiFonts.size.small};\n margin-top: 0.2rem;\n color: ${uiColors.lightGray};\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 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","export const formatSpellCastingType = (castingType: string): string => {\n const formattedCastingType = castingType\n .split(\"-\")\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n \n return formattedCastingType;\n };","import { ISpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { SpellInfo } from './SpellInfo';\n\nexport interface ISpellInfoDisplayProps {\n spell: ISpell;\n isMobile?: boolean;\n}\n\nexport const SpellInfoDisplay: React.FC<ISpellInfoDisplayProps> = ({\n spell,\n isMobile,\n}) => {\n return (\n <Flex $isMobile={isMobile}>\n <SpellInfo spell={spell} />\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","import { ISpell } from '@rpg-engine/shared';\nimport React, { useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { SpellInfoDisplay } from './SpellInfoDisplay';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface MobileSpellTooltipProps {\n spell: ISpell;\n closeTooltip: () => void;\n scale?: number;\n options?: IListMenuOption[];\n onSelected?: (selectedOptionId: string) => void;\n}\n\nexport const MobileSpellTooltip: React.FC<MobileSpellTooltipProps> = ({\n spell,\n closeTooltip,\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 <SpellInfoDisplay spell={spell} isMobile />\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 { ISpell } from '@rpg-engine/shared';\nimport React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { SpellInfoDisplay } from './SpellInfoDisplay';\n\nexport interface IMagicTooltipProps {\n spell: ISpell;\n}\n\nconst offset = 20;\n\nexport const MagicTooltip: React.FC<IMagicTooltipProps> = ({ spell }) => {\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 <SpellInfoDisplay spell={spell} />\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 { ISpell } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport { MobileSpellTooltip } from './MobileSpellTooltip';\nimport { MagicTooltip } from './SpellTooltip';\n\ninterface ISpellInfoWrapperProps {\n spell: ISpell;\n children: React.ReactNode;\n scale?: number;\n}\n\nexport const SpellInfoWrapper: React.FC<ISpellInfoWrapperProps> = ({\n children,\n spell,\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 <MagicTooltip spell={spell} />\n )}\n {isTooltipMobileVisible && (\n <MobileSpellTooltip\n closeTooltip={() => {\n setIsTooltipMobileVisible(false);\n console.log('close');\n }}\n spell={spell}\n scale={scale}\n />\n )}\n </div>\n );\n};\n","import { ISpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { SpellInfoWrapper } from './cards/SpellInfoWrapper';\n\nexport interface ISpellProps {\n charMana: number;\n charMagicLevel: number;\n onPointerUp?: (spellKey: string) => void;\n isSettingShortcut?: boolean;\n spellKey: string;\n spell: ISpell;\n activeCooldown?: number;\n}\n\nexport const Spell: React.FC<ISpellProps> = ({\n spellKey,\n charMana,\n charMagicLevel,\n onPointerUp,\n isSettingShortcut,\n spell,\n activeCooldown,\n}) => {\n const {\n manaCost,\n minMagicLevelRequired,\n magicWords,\n name,\n description,\n } = spell;\n const disabled = isSettingShortcut\n ? charMagicLevel < minMagicLevelRequired\n : manaCost > charMana || charMagicLevel < minMagicLevelRequired;\n\n return (\n <SpellInfoWrapper spell={spell}>\n <Container\n onPointerUp={onPointerUp?.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>\n {activeCooldown && activeCooldown > 0 ? (\n <span className=\"cooldown\">\n {activeCooldown.toFixed(activeCooldown > 10 ? 0 : 1)}\n </span>\n ) : null}\n {magicWords.split(' ').map(word => word[0])}\n </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 </SpellInfoWrapper>\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\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 position: relative;\n overflow: hidden;\n\n .cooldown {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0 0 0 / 20%);\n color: ${uiColors.darkYellow};\n font-weight: bold;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n`;\n\nconst Info = styled.span`\n width: 0;\n flex: 1;\n\n @media (orientation: portrait) {\n display: none;\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 { IShortcut, ISpell } from '@rpg-engine/shared';\nimport React, { Fragment, 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: ISpell[];\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 spellCooldowns?: Record<string, 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 spellCooldowns,\n}) => {\n const [search, setSearch] = useState('');\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\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 onPointerUp={\n settingShortcutIndex !== -1 ? setShortcut : onSpellClick\n }\n spellKey={spell.key}\n isSettingShortcut={settingShortcutIndex !== -1}\n spell={spell}\n activeCooldown={\n spellCooldowns?.[spell.magicWords.replaceAll(' ', '_')]\n }\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';\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, { 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","useShortcutCooldown","onShortcutCast","shortcutCooldown","setShortcutCooldown","cooldownTimeout","useRef","current","clearTimeout","setTimeout","handleShortcutCast","log","CancelButton","ButtonsContainer","ShortcutsContainer","StyledShortcut","useOutsideClick","id","handleClickOutside","event","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","_ref$dragDisabled","dragDisabled","draggableRef","_e","Draggable","cancel","onDrag","data","onStop","onStart","defaultPosition","TitleContainer","Title","Icon","src","h1","img","InputRadio","label","value","onRadioSelect","onPointerUp","checked","isChecked","readOnly","countItemFromInventory","itemKey","inventory","itemsFromInventory","Object","keys","slots","forEach","i","parseInt","_inventory$slots$inde","key","push","reduce","acc","stackQty","modalRoot","getElementById","ModalPortal","ReactDOM","createPortal","RelativeListMenu","options","onSelected","_ref$fontSize","pos","overflow","map","params","ListElement","text","li","MobileItemTooltip","closeTooltip","equipmentSet","_ref$scale","handleFadeOut","_ref$current","classList","add","onTouchEnd","ItemInfoDisplay","isMobile","OptionsContainer","option","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","DepotSocketEvents","Deposit","ActionsForEquipmentSet","Loot","ActionsForLoot","MapContainer","ActionsForMapContainer","contextActionMenuDontHaveUseWith","find","toLowerCase","includes","hasUseWith","Depot","ItemSocketEvents","GetItemInfo","Withdraw","generateContextMenu","getStackInfo","itemId","qtyClassName","ItemQtyContainer","ItemQty","Math","round","resetItem","onSuccesfulDrag","quantity","onMouseUp","e","changedTouches","clientX","clientY","simulatedEvent","MouseEvent","bubbles","elementFromPoint","_document$elementFrom","undefined","axis","defaultClassName","split","isNaN","classes","Array","from","_e$target","some","elm","window","getComputedStyle","matrix","DOMMatrixReadOnly","transform","m41","m42","isTouch","abs","position","ItemContainer","onMouseEnter","onMouseLeave","itemToRender","texturePath","allowedEquipSlotType","_itemToRender$allowed","element","_id","getItemTextureKeyPath","isStackable","stackInfo","uuidv4","renderEquipment","renderItem","onRenderSlot","ItemTooltip","optionId","rarityColor","rarity","ItemRarities","Uncommon","Rare","Epic","Legendary","statisticsToDisplay","higherIsWorse","ItemInfo","itemToCompare","renderMissingStatistic","statistics","stat","itemToCompareStatistic","toUpperCase","slice","Statistic","toString","Header","Rarity","Type","subType","AllowedSlots","slotType","minRequirements","LevelRequirement","level","skill","itemStatistic","isItemToCompare","isOnlyInOneItem","statDiff","_itemToCompare$stat$k2","isDifference","isBetter","renderStatistics","entityEffects","entityEffectChance","effect","usableEffectDescription","equippedBuffDescription","isTwoHanded","Description","description","maxStackSize","StackInfo","MissingStatistics","$isSpecial","itemSlotTypes","useMemo","_item$allowedEquipSlo","allowedSlotTypeCamelCase","camelCase","itemSubTypeCamelCase","getSlotType","itemFromEquipment","values","Flex","CompareContainer","Equipped","$isMobile","handleMouseMove","rect","getBoundingClientRect","tooltipWidth","tooltipHeight","isOffScreenRight","innerWidth","isOffScreenBottom","innerHeight","ItemInfoWrapper","setIsTooltipVisible","bind","CraftingRecipe","recipe","handleRecipeSelect","selectedCraftItemKey","skills","modifyString","str","parts","words","replace","concat","join","levelInSkill","minCraftingRequirements","_recipe$minCraftingRe2","_skills","RadioOptionsWrapper","SpriteAtlasWrapper","canCraft","display","MinCraftingRequirementsText","levelIsOk","_recipe$minCraftingRe4","_recipe$minCraftingRe6","ingredients","ingredient","itemQtyInInventory","Recipe","Ingredient","isQuantityOk","qty","desktop","mobileLanscape","mobilePortrait","Wrapper","Subtitle","RadioInputScroller","ButtonWrapper","ContentContainer","ItemTypes","Dropdown","dropdownId","selectedValue","setSelectedValue","selectedOption","setSelectedOption","opened","setOpened","firstOption","change","filter","o","DropdownSelect","prev","DropdownOptions","ul","Details","EquipmentSetContainer","EquipmentColumn","IS_MOBILE_OR_TABLET","isMobileOrTablet","DynamicText","onFinish","textState","setTextState","interval","setInterval","substring","clearInterval","TextContainer","NPCDialogText","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","OrderByType","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","Pager","totalItems","currentPage","onPageChange","totalPages","ceil","itemsPerPage","PagerContainer","ConfirmModal","message","Background","stopPropagation","ButtonsWrapper","MarketplaceRows","itemPrice","onMarketPlaceItemBuy","onMarketPlaceItemRemove","MarketplaceWrapper","ItemIconContainer","SpriteContainer","RarityContainer","QuantityContainer","PriceValue","GoldContainer","itemTypeOptions","ItemSubType","itemType","itemRarityOptions","itemRarity","orderByOptions","flatMap","orderBy","BuyPanel","items","onChangeType","onChangeRarity","onChangeOrder","onChangeNameInput","onChangeMainLevelInput","onChangeSecondaryLevelInput","onChangePriceInput","characterId","enableHotkeys","disableHotkeys","setName","mainLevel","setMainLevel","secondaryLevel","setSecondaryLevel","price","setPrice","buyingItemId","setBuyingItemId","itemsContainer","_itemsContainer$curre","scrollTo","InputWrapper","onFocus","OptionsWrapper","FilterInputsWrapper","AiFillCaretRight","WrapperContainer","StyledDropdown","ItemComponentScrollWrapper","owner","ManagmentPanel","availableGold","selectedItemToSell","onSelectedItemToSellRemove","onAddItemToMarketplace","onMoneyWithdraw","isCreatingOffer","setIsCreatingOffer","removingItemId","setRemovingItemId","InnerOptionsWrapper","SellDescription","__","PriceInputWrapper","AvailableGold","$disabled","PartyRow","charName","charClass","charLevel","playerQty","isInvited","PartyWrapper","partyName","RowsWrapper","PlayersRow","isNotInvited","PartyManagerRow","mockedPartyRows","mockedPlayersRows","mockedPartyManager","ProgressBarText","minWidth","percentageWidth","mobileScale","QuestDraggableContainer","QuestContainer","QuestsContainer","Content","QuestSplitDiv","QuestColumn","Thumbnail","QuestListContainer","NoQuestContainer","_RPGUI","RPGUI","SimpleProgressBar","_ref$bgColor","bgColor","_ref$margin","margin","ProgressBarContainer","BackgroundBar","Progress","SkillProgressBar","skillName","skillPoints","skillPointsToNextLevel","_ref$showSkillPoints","showSkillPoints","buffAndDebuff","ratio","getSPForLevel","skillsBuffsCalc","result","toFixed","ProgressTitle","BuffAndDebuffContainer","TitleNameContainer","TitleNameBuff","TitleNameBuffContainer","TitleNameDebuff","TitleName","ValueDisplay","ProgressBody","ProgressIconContainer","SkillDisplayContainer","SkillPointsDisplay","skillProps","attributes","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","SpellInfo","spell","manaCost","requiredItem","castingType","cooldown","maxDistanceGrid","charAt","formatSpellCastingType","SpellInfoDisplay","MobileSpellTooltip","MagicTooltip","SpellInfoWrapper","Spell","charMana","charMagicLevel","isSettingShortcut","activeCooldown","minMagicLevelRequired","spellKey","Overlay","SpellImage","Info","Divider","Cost","SpellList","DayNightPeriod","periodOfDay","periodOfDaySrcFiles","PeriodOfDay","Morning","Afternoon","Night","GifContainer","WidgetContainer","Time","DayNightContainer","TradingItemRow","onQuantityChange","traderItem","selectedQty","onLeftClick","onRightClick","ItemWrapper","ItemNameContainer","NameValue","capitalize","StyledArrow","QuantityDisplay","TradingComponentScrollWrapper","TotalWrapper","GoldWrapper","AlertWrapper","availableCharacters","propertySelectValues","textureKey","selectedSpriteKey","setSelectedSpriteKey","paddingBottom","chatMessages","onSendChatMessage","_ref$styles","styles","textColor","setMessage","scrollChatToBottom","scrollingElement","querySelector","scrollTop","scrollHeight","fallback","emitter","createdAt","dayjs","Date","format","onRenderMessageLines","onRenderChatMessages","trim","autoComplete","autoFocus","borderRadius","RxPaperPlane","FramedGrey","selectedValues","generateSelectedValuesList","setSelectedValues","onActionClick","onCancelClick","mana","spellCooldowns","onShortcutClick","onTouchStart","remove","buildClassName","classBase","isOnCooldown","variant","onShortcutClickBinded","_shortcuts$i","isOnShortcutCooldown","_shortcuts$i2","_shortcuts$i3","itemsFromEquipment","totalQty","_shortcuts$i4","spellCooldown","replaceAll","renderShortcut","onSelect","onCraftItem","craftablesItems","savedSelectedType","craftItemKey","setCraftItemKey","selectedType","setSelectedType","setSize","handleResize","itemTypes","sort","a","b","localeCompare","rows","row","gap","renderItemTypes","details","onItemClick","onItemDragEnd","onItemDragStart","onItemPlaceDrop","onItemOutsideDrop","equipmentData","neck","leftHand","ring","head","armor","legs","boot","rightHand","accessory","equipmentMaskSlots","ItemSlotType","onRenderEquipmentSlotRange","start","end","equipmentRange","slotMaksRange","itemContainer","ContainerType","backgroundImgPath","fullCoverBackground","setImage","fullImg","handleClick","_ref$disableContextMe","disableContextMenu","isOpen","maxQuantity","callback","_quantity","quantitySelect","setQuantitySelect","handleSetShortcut","slotQty","_itemContainer$slots","onRenderSlots","imageKey","onYourPanelToggle","isYourPanel","setIsYourPanel","onCreate","close","partyRows","playersRows","_ref$displayText","displayText","_ref$percentageWidth","_ref$minWidth","calculatePercentageValue","quests","buttons","onChangeQuest","questsLength","thumbnail","thumbnailDefault","onClick","npcId","quest","_ref$isBlockedCasting","isBlockedCastingByKeyboard","shortcutsRefs","handleKeyDown","shortcutIndex","_shortcutsRefs$curren","_shortcutsRefs$curren2","XPLevelActual","XPLevelBefore","onRenderSkillCategory","category","SPLevelActual","SPLevelBefore","skillCategory","skillCategoryColor","output","entries","skillDetails","experience","getXPForLevel","onInputFocus","onInputBlur","spells","magicLevel","onSpellClick","setSpellShortcut","search","setSearch","spellsToDisplay","toLocaleLowerCase","setShortcut","Fragment","TimeClock","traderItems","characterAvailableGold","sum","setSum","Map","qtyMap","setQtyMap","set","newSum","get","isBuy","hasGoldForSale","tradeItem","assign"],"mappings":"+lCAAO,ICIKA,0DAAAA,EAAAA,sBAA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QACCr2B,4CACAA,6BAAKohC,IAEPphC,gBAACo2B,QACCp2B,mCACAA,6BAAKqhC,IAELS,IAKA9hC,gBAACq2B,QACCr2B,wCACAA,6BArEJ6hC,IACKT,EAAyBC,EAEzBD,EAAyBC,IA4D5BrhC,gBAACs2B,QACCt2B,uDASJA,gBAAC8d,QACC9d,gBAACN,GACCG,WAAYL,oBAAY4nB,YACxBznB,UAAWmiC,IACXhiC,cAAe,WAAA,OAjEjB2qB,EAA6B,GAEnC0W,EAAY31B,SAAQ,SAAArH,GAClB,IAAMoZ,EAAMikB,EAAOI,IAAIz9B,EAAKyH,KACxB2R,GACFkN,EAAM5e,KAAKR,OAAO22B,OAAO,GAAI79B,EAAM,CAAEoZ,IAAKA,aAI9C4I,EAAUsE,GAVW,IACfA,eAqEAzqB,gBAACN,GACCG,WAAYL,oBAAY4nB,YACxBtnB,cAAe,WAAA,OAAMogB,qCCxIS,oBAAGjc,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/Shortcuts/useShortcutCooldown.ts","../src/components/CircularController/CircularController.tsx","../src/hooks/useOutsideAlerter.ts","../src/components/NPCDialog/NPCDialog.tsx","../src/components/DraggableContainer.tsx","../src/components/InputRadio.tsx","../src/libs/itemCounter.ts","../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/CraftingRecipe.tsx","../src/components/CraftBook/CraftBook.tsx","../src/components/Dropdown.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/Marketplace/filters/index.tsx","../src/components/Item/Inventory/ItemQuantitySelector.tsx","../src/components/Shortcuts/ShortcutsSetter.tsx","../src/components/Item/Inventory/ItemContainer.tsx","../src/components/ListMenu.tsx","../src/components/Pager.tsx","../src/components/ConfirmModal.tsx","../src/components/Marketplace/MarketplaceRows.tsx","../src/components/Marketplace/BuyPanel.tsx","../src/components/Marketplace/ManagmentPanel.tsx","../src/components/Marketplace/Marketplace.tsx","../src/components/PartySystem/PartyCreate/PartyCreate.tsx","../src/components/PartySystem/PartyDashboard/PartyRows.tsx","../src/components/PartySystem/PartyDashboard/PartyDashboard.tsx","../src/components/PartySystem/PartyInvite/PlayersRows.tsx","../src/components/PartySystem/PartyInvite/PartyInvite.tsx","../src/components/PartySystem/PartyManager/PartyManagerRows.tsx","../src/components/PartySystem/PartyManager/PartyManager.tsx","../src/components/PartySystem/mockedConstantes/mockedValues.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/cards/SpellInfo.tsx","../src/libs/CastingTypeHelper.ts","../src/components/Spellbook/cards/SpellInfoDisplay.tsx","../src/components/Spellbook/cards/MobileSpellTooltip.tsx","../src/components/Spellbook/cards/SpellTooltip.tsx","../src/components/Spellbook/cards/SpellInfoWrapper.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/itemSelector/ItemSelector.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 <span className={`ellipsis-${maxLines}-lines`}>{children}</span>\n </Container>\n );\n};\n\ninterface IContainerProps {\n maxWidth?: string;\n fontSize?: string;\n center?: boolean;\n}\n\nconst Container = styled.span<IContainerProps>`\n display: block;\n margin: 0;\n\n .ellipsis-1-lines {\n display: block;\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\n .ellipsis-2-lines {\n display: block;\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\n .ellipsis-3-lines {\n display: block;\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: '#888',\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: '#66cd1c',\n brownGreen: '#346524',\n white: '#fff'\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 .onCooldown {\n color: ${uiColors.gray};\n }\n\n .cooldown {\n position: absolute;\n z-index: 1;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: inherit;\n background-color: rgba(0 0 0 / 60%);\n font-size: 0.7rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ${uiColors.darkYellow};\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 { useEffect, useRef, useState } from \"react\";\n\nexport const useShortcutCooldown = (onShortcutCast: (index: number) => void) => {\n const [shortcutCooldown, setShortcutCooldown] = useState(0);\n const cooldownTimeout = useRef<NodeJS.Timeout | null>(null);\n\n const handleShortcutCast = (index: number) => {\n console.log(shortcutCooldown);\n if (shortcutCooldown <= 0) setShortcutCooldown(1.5);\n onShortcutCast(index);\n };\n\n useEffect(() => {\n if (cooldownTimeout.current) clearTimeout(cooldownTimeout.current);\n\n if (shortcutCooldown > 0) {\n cooldownTimeout.current = setTimeout(() => {\n setShortcutCooldown(shortcutCooldown - 0.1);\n }, 100);\n }\n }, [shortcutCooldown]);\n\n return { shortcutCooldown, handleShortcutCast };\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';\nimport { useShortcutCooldown } from '../Shortcuts/useShortcutCooldown';\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 spellCooldowns?: Record<string, number>;\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 spellCooldowns,\n}) => {\n const { handleShortcutCast, shortcutCooldown } = useShortcutCooldown(\n onShortcutClick\n );\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 const buildClassName = (classBase: string, isOnCooldown: boolean) => {\n return `${classBase} ${isOnCooldown ? 'onCooldown' : ''}`;\n };\n\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 ? handleShortcutCast.bind(null, i)\n : () => {};\n\n const isOnShortcutCooldown = shortcutCooldown > 0;\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 {isOnShortcutCooldown && (\n <span className=\"cooldown\">{shortcutCooldown.toFixed(1)}</span>\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={buildClassName('qty', isOnShortcutCooldown)}>\n {totalQty}\n </span>\n </StyledShortcut>\n );\n }\n\n const payload = shortcuts[i]?.payload as IRawSpell | undefined;\n\n const spellCooldown = !payload\n ? 0\n : spellCooldowns?.[payload.magicWords.replaceAll(' ', '_')] ??\n shortcutCooldown;\n const cooldown =\n spellCooldown > shortcutCooldown ? spellCooldown : shortcutCooldown;\n const isOnCooldown = cooldown > 0 && !!payload;\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 {isOnCooldown && (\n <span className=\"cooldown\">\n {cooldown.toFixed(cooldown < 10 ? 1 : 0)}\n </span>\n )}\n <span className={buildClassName('mana', isOnCooldown)}>\n {payload && payload.manaCost}\n </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 dragDisabled?: boolean;\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 dragDisabled = false,\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 disabled={dragDisabled}\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: 950px) {\n font-size: 1.7rem;\n padding: 12px;\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 from 'react';\n\ninterface IProps\n extends React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n > {\n label: string;\n name: string;\n value: string;\n isChecked: boolean;\n onRadioSelect: (value: string) => void;\n}\n\nexport const InputRadio: React.FC<IProps> = ({\n label,\n name,\n value,\n isChecked,\n onRadioSelect,\n}) => {\n const onRadioClick = (): void => {\n onRadioSelect(value);\n };\n\n return (\n <div onPointerUp={onRadioClick}>\n <input\n className=\"rpgui-radio\"\n name={name}\n value={value}\n type=\"radio\"\n data-rpguitype=\"radio\"\n checked={isChecked}\n // rpgui breaks onChange on this input (doesn't work). That's why I had to wrap it with a div and a onClick listener.\n readOnly\n ></input>\n <label>{label}</label>\n </div>\n );\n};\n","import { IItem, IItemContainer } from \"@rpg-engine/shared\";\n\nexport const countItemFromInventory = (itemKey: string, inventory: IItemContainer) => {\n let itemsFromInventory: (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 === itemKey) {\n itemsFromInventory.push(inventory.slots[index]);\n }\n });\n }\n\n const totalQty = itemsFromInventory.reduce(\n (acc, item) => acc + (item?.stackQty || 1),\n 0\n );\n\n return totalQty;\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: 640px) {\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: 640px) {\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: 640px) {\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 && containerType) {\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 && containerType)\n 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 onPointerDown={\n onDragStart !== undefined && onDragEnd !== undefined\n ? undefined\n : () => {\n if (item) onPointerDown(item.type, containerType ?? null, item);\n }\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 disabled={onDragStart === undefined || onDragEnd === undefined}\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 ?? null, item);\n }\n }}\n onStart={() => {\n if (!item || isSelectingShortcut) {\n return;\n }\n\n if (onDragStart && containerType) {\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?.(\n event,\n slotIndex,\n item,\n event.clientX,\n event.clientY\n );\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 renderEntityEffects = () => {\n if (!item.entityEffects || !item.entityEffectChance) return null;\n\n return item.entityEffects.map((effect, index) => (\n <Statistic key={index} $isSpecial>\n {effect[0].toUpperCase() + effect.slice(1)} ({item.entityEffectChance}%)\n </Statistic>\n ));\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 {item.minRequirements && (\n <LevelRequirement>\n <div className=\"title\">Requirements:</div>\n <div>- Level: {item.minRequirements.level}</div>\n <div>\n -{' '}\n {item.minRequirements.skill.name[0].toUpperCase() +\n item.minRequirements.skill.name.slice(1)}\n : {item.minRequirements.skill.level}\n </div>\n </LevelRequirement>\n )}\n\n {renderStatistics()}\n {renderEntityEffects()}\n {item.usableEffectDescription && (\n <Statistic $isSpecial>{item.usableEffectDescription}</Statistic>\n )}\n {item.equippedBuffDescription && (\n <Statistic $isSpecial>{item.equippedBuffDescription}</Statistic>\n )}\n {item.isTwoHanded && <Statistic $isSpecial>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: 18rem;\n\n @media (max-width: 640px) {\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 LevelRequirement = styled.div`\n font-size: ${uiFonts.size.small};\n margin-top: 0.2rem;\n margin-bottom: 1rem;\n color: ${uiColors.orange};\n\n .title {\n margin-bottom: 4px;\n }\n\n div {\n margin-bottom: 2px;\n }\n`;\n\nconst Statistic = styled.div<{ $isSpecial?: boolean }>`\n margin-bottom: 0.4rem;\n width: 100%;\n color: ${({ $isSpecial }) => ($isSpecial ? uiColors.darkYellow : 'inherit')};\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 itemSubTypeFromEquipment = Object.values(equipmentSet).find(\n item => camelCase(item?.subType ?? '') === itemSubTypeCamelCase\n );\n\n const itemFromEquipment = itemSubTypeFromEquipment\n ? itemSubTypeFromEquipment\n : (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 align-items: center;\n\n @media (max-width: 640px) {\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 {\n ICraftableItem,\n IEquipmentSet,\n IItemContainer,\n ISkill,\n} from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { countItemFromInventory } from '../../libs/itemCounter';\nimport { ItemInfoWrapper } from '../Item/Cards/ItemInfoWrapper';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\n\ninterface ICraftingRecipeProps {\n atlasJSON: any;\n atlasIMG: any;\n equipmentSet?: IEquipmentSet | null;\n recipe: ICraftableItem;\n scale?: number;\n handleRecipeSelect: () => void;\n selectedCraftItemKey?: string;\n inventory?: IItemContainer | null;\n skills?: ISkill | null;\n}\n\nexport const CraftingRecipe: React.FC<ICraftingRecipeProps> = ({\n atlasIMG,\n atlasJSON,\n equipmentSet,\n recipe,\n scale,\n handleRecipeSelect,\n selectedCraftItemKey,\n inventory,\n skills,\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 levelInSkill =\n (skills?.[\n (recipe?.minCraftingRequirements?.[0] ?? '') as keyof ISkill\n ] as any)?.level ?? 1;\n\n return (\n <RadioOptionsWrapper>\n <SpriteAtlasWrapper>\n <ItemInfoWrapper\n item={recipe}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n scale={scale}\n >\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={recipe.texturePath}\n imgScale={3}\n grayScale={!recipe.canCraft}\n />\n </ItemInfoWrapper>\n </SpriteAtlasWrapper>\n <div>\n <div onPointerUp={recipe.canCraft ? handleRecipeSelect : undefined}>\n <input\n className=\"rpgui-radio\"\n type=\"radio\"\n value={recipe.name}\n name=\"test\"\n disabled={!recipe.canCraft}\n checked={selectedCraftItemKey === recipe.key}\n onChange={handleRecipeSelect}\n />\n <label style={{ display: 'flex', alignItems: 'center' }}>\n {modifyString(recipe.name)}\n </label>\n </div>\n\n <MinCraftingRequirementsText levelIsOk={recipe?.levelIsOk ?? false}>\n {modifyString(`${recipe?.minCraftingRequirements?.[0] ?? ''}`)} lvl{' '}\n {recipe?.minCraftingRequirements?.[1] ?? 0} ({levelInSkill})\n </MinCraftingRequirementsText>\n\n {recipe.ingredients.map((ingredient, index) => {\n const itemQtyInInventory = !inventory\n ? 0\n : countItemFromInventory(ingredient.key, inventory);\n\n return (\n <Recipe key={index}>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey={ingredient.texturePath}\n imgScale={1.2}\n />\n <Ingredient isQuantityOk={ingredient.qty <= itemQtyInInventory}>\n {modifyString(ingredient.key)} x{ingredient.qty} (\n {itemQtyInInventory})\n </Ingredient>\n </Recipe>\n );\n })}\n </div>\n </RadioOptionsWrapper>\n );\n};\n\nconst Ingredient = styled.p<{ isQuantityOk: boolean }>`\n margin: 0;\n margin-left: 14px;\n color: ${({ isQuantityOk }) =>\n isQuantityOk ? uiColors.lightGreen : uiColors.lightGray} !important;\n`;\n\nconst Recipe = styled.div`\n font-size: 0.6rem;\n margin-bottom: 3px;\n display: flex;\n align-items: center;\n margin-left: 4px;\n\n .sprite-from-atlas-img {\n top: 0px;\n left: 0px;\n }\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 MinCraftingRequirementsText = styled.p<{ levelIsOk: boolean }>`\n font-size: 0.6rem !important;\n margin: 0 5px 0 35px;\n color: ${({ levelIsOk }) =>\n levelIsOk ? uiColors.lightGreen : uiColors.lightGray} !important;\n`;\n","import {\n ICraftableItem,\n IEquipmentSet,\n IItemContainer,\n ISkill,\n ItemSubType,\n} from '@rpg-engine/shared';\nimport React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { InputRadio } from '../InputRadio';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { CraftingRecipe } from './CraftingRecipe';\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 inventory?: IItemContainer | null;\n scale?: number;\n skills?: ISkill | null;\n savedSelectedType?: string;\n}\n\nexport interface ShowMessage {\n show: boolean;\n index: number;\n}\n\nconst desktop = {\n width: 'min(900px, 80%)',\n height: 'min(700px, 80%)',\n};\n\nconst mobileLanscape = {\n width: '800px',\n height: '500px',\n};\n\nconst mobilePortrait = {\n width: '500px',\n height: '700px',\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 inventory,\n skills,\n savedSelectedType,\n}) => {\n const [craftItemKey, setCraftItemKey] = useState<string>();\n const [selectedType, setSelectedType] = useState<string>(\n savedSelectedType ?? Object.keys(ItemSubType)[0]\n );\n const [size, setSize] = useState<{ width: string; height: string }>();\n\n useEffect(() => {\n const handleResize = (): void => {\n if (\n window.innerWidth < 500 &&\n size?.width !== mobilePortrait.width &&\n (!scale || scale < 1)\n ) {\n setSize(mobilePortrait);\n } else if (\n (!scale || scale < 1) &&\n size?.width !== mobileLanscape.width\n ) {\n setSize(mobileLanscape);\n } else if (size?.width !== desktop.width) {\n setSize(desktop);\n }\n };\n handleResize();\n\n window.addEventListener('resize', handleResize);\n\n return () => window.removeEventListener('resize', handleResize);\n }, [scale]);\n\n const renderItemTypes = () => {\n const itemTypes = ['Suggested', ...Object.keys(ItemSubType)]\n .filter(type => type !== 'DeadBody')\n .sort((a, b) => {\n if (a === 'Suggested') return -1;\n if (b === 'Suggested') return 1;\n return a.localeCompare(b);\n });\n\n if (window.innerWidth > parseInt(mobilePortrait.width)) {\n return itemTypes.map(type => {\n return (\n <InputRadio\n key={type}\n value={type}\n label={type}\n name={type}\n isChecked={selectedType === type}\n onRadioSelect={value => {\n setSelectedType(value);\n onSelect(value);\n }}\n />\n );\n });\n }\n\n const rows: JSX.Element[][] = [[], []];\n\n itemTypes.forEach((type, index) => {\n let row = 0;\n\n if (index % 2 === 1) row = 1;\n\n rows[row].push(\n <InputRadio\n key={type}\n value={type}\n label={type}\n name={type}\n isChecked={selectedType === type}\n onRadioSelect={value => {\n setSelectedType(value);\n onSelect(value);\n }}\n />\n );\n });\n\n return rows.map((row, index) => (\n <div key={index} style={{ display: 'flex', gap: '10px' }}>\n {row}\n </div>\n ));\n };\n\n if (!size) return null;\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n width={size.width}\n height={size.height}\n cancelDrag=\".inputRadioCraftBook\"\n onCloseButton={() => {\n if (onClose) {\n onClose();\n }\n }}\n scale={scale}\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Craftbook</Title>\n <Subtitle>Select an item to craft</Subtitle>\n <hr className=\"golden\" />\n </div>\n\n <ContentContainer>\n <ItemTypes className=\"inputRadioCraftBook\">\n {renderItemTypes()}\n </ItemTypes>\n\n <RadioInputScroller className=\"inputRadioCraftBook\">\n {craftablesItems?.map(item => (\n <CraftingRecipe\n key={item.key}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n equipmentSet={equipmentSet}\n recipe={item}\n scale={scale}\n handleRecipeSelect={setCraftItemKey.bind(null, item.key)}\n selectedCraftItemKey={craftItemKey}\n inventory={inventory}\n skills={skills}\n />\n ))}\n </RadioInputScroller>\n </ContentContainer>\n <ButtonWrapper>\n <Button buttonType={ButtonTypes.RPGUIButton} onPointerDown={onClose}>\n Cancel\n </Button>\n <Button\n disabled={!craftItemKey}\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => onCraftItem(craftItemKey)}\n >\n Craft\n </Button>\n </ButtonWrapper>\n </Wrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst Subtitle = styled.h1`\n font-size: 0.4rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst RadioInputScroller = styled.div`\n padding-left: 15px;\n padding-top: 10px;\n margin-top: 1rem;\n align-items: center;\n align-items: flex-start;\n overflow-y: scroll;\n min-height: 0;\n flex: 1;\n margin-left: 10px;\n -webkit-overflow-scrolling: touch;\n\n @media (max-width: ${mobilePortrait.width}) {\n margin-left: 0;\n }\n`;\n\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: flex-end;\n margin-top: 10px;\n width: 100%;\n\n button {\n padding: 0px 50px;\n margin: 5px;\n }\n\n @media (max-width: ${mobilePortrait.width}) {\n justify-content: center;\n }\n`;\n\nconst ContentContainer = styled.div`\n display: flex;\n width: 100%;\n min-height: 0;\n flex: 1;\n\n @media (max-width: ${mobilePortrait.width}) {\n flex-direction: column;\n }\n`;\n\nconst ItemTypes = styled.div`\n display: flex;\n overflow-y: scroll;\n overflow-x: hidden;\n width: max-content;\n flex-direction: column;\n padding-right: 5px;\n\n @media (max-width: ${mobilePortrait.width}) {\n overflow-x: scroll;\n overflow-y: hidden;\n padding-right: 0;\n width: 100%;\n }\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 onPointerUp={() => 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 onPointerUp={() => {\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 label {\n display: inline-block;\n transform: translateY(-2px);\n }\n`;\n\nconst DropdownOptions = styled.ul<{\n opened: boolean;\n}>`\n position: absolute;\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n display: ${props => (props.opened ? 'block' : 'none')};\n box-sizing: border-box;\n\n @media (max-width: 768px) {\n padding: 8px 0;\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 { ItemRarities, ItemSubType } from '@rpg-engine/shared';\nimport React from 'react';\nimport { IOptionsProps } from '../../Dropdown';\n\nexport enum OrderByType {\n Name = 'Name',\n Price = 'Price',\n}\n\nexport const itemTypeOptions: IOptionsProps[] = [\n 'Type',\n ...Object.keys(ItemSubType),\n]\n .filter(type => type !== 'DeadBody')\n .map((itemType, index) => ({\n id: index + 1,\n value: itemType,\n option: itemType,\n }));\n\nexport const itemRarityOptions: IOptionsProps[] = [\n 'Rarity',\n ...Object.values(ItemRarities),\n].map((itemRarity, index) => ({\n id: index + 1,\n value: itemRarity,\n option: itemRarity,\n}));\n\nexport const orderByOptions: IOptionsProps[] = Object.values(\n OrderByType\n).flatMap((orderBy, index) => [\n {\n id: index * 2 + 1,\n value: orderBy.toLowerCase(),\n option: (\n <>\n {orderBy}{' '}\n <span\n style={{\n transform: 'translateY(-2px)',\n display: 'inline-block',\n }}\n >\n ↑\n </span>\n </>\n ),\n },\n {\n id: index * 2 + 2,\n value: '-' + orderBy.toLowerCase(),\n option: (\n <>\n {orderBy}{' '}\n <span\n style={{\n transform: 'translateY(-2px)',\n display: 'inline-block',\n }}\n >\n ↓\n </span>\n </>\n ),\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 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 { uiColors } from '../constants/uiColors';\nimport { uiFonts } from '../constants/uiFonts';\n\ninterface PagerProps {\n totalItems: number;\n currentPage: number;\n itemsPerPage: number;\n onPageChange: (page: number) => void;\n}\n\nexport const Pager: React.FC<PagerProps> = ({\n totalItems,\n currentPage,\n itemsPerPage,\n onPageChange,\n}) => {\n const totalPages = Math.ceil(totalItems / itemsPerPage);\n\n return (\n <Container>\n <p>Total items: {totalItems}</p>\n <PagerContainer>\n <button\n disabled={currentPage === 1}\n onPointerDown={() => onPageChange(Math.max(currentPage - 1, 1))}\n >\n {'<'}\n </button>\n\n <div className=\"rpgui-container framed-grey\">{currentPage}</div>\n\n <button\n disabled={currentPage === totalPages}\n onPointerDown={() =>\n onPageChange(Math.min(currentPage + 1, totalPages))\n }\n >\n {'>'}\n </button>\n </PagerContainer>\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n\n p {\n margin: 0;\n font-size: ${uiFonts.size.xsmall};\n }\n`;\n\nconst PagerContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 5px;\n\n p {\n margin: 0;\n }\n\n div {\n color: white;\n }\n\n button {\n width: 40px;\n height: 40px;\n background-color: ${uiColors.darkGray};\n border: none;\n border-radius: 5px;\n color: white;\n\n :hover {\n background-color: ${uiColors.lightGray};\n }\n\n :disabled {\n opacity: 0.5;\n }\n\n &.active {\n background-color: ${uiColors.orange};\n font-weight: bold;\n color: black;\n }\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from './Abstractions/ModalPortal';\nimport { Button, ButtonTypes } from './Button';\nimport { DraggableContainer } from './DraggableContainer';\n\ninterface IConfirmModalProps {\n onConfirm: () => void;\n onClose: () => void;\n message?: string;\n}\n\nexport const ConfirmModal: React.FC<IConfirmModalProps> = ({\n onConfirm,\n onClose,\n message,\n}) => {\n return (\n <ModalPortal>\n <Background />\n <Container onPointerDown={onClose}>\n <DraggableContainer width=\"auto\" dragDisabled>\n <Wrapper onPointerDown={e => e.stopPropagation()}>\n <p>{message ?? 'Are you sure?'}</p>\n\n <ButtonsWrapper>\n <div className=\"cancel-button\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={onClose}\n >\n No\n </Button>\n </div>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={onConfirm}\n >\n Yes\n </Button>\n </ButtonsWrapper>\n </Wrapper>\n </DraggableContainer>\n </Container>\n </ModalPortal>\n );\n};\n\nconst Background = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: #000000;\n opacity: 0.5;\n left: 0;\n top: 0;\n z-index: 1000;\n`;\n\nconst Container = styled.div`\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1001;\n`;\n\nconst Wrapper = styled.div`\n p {\n margin: 0;\n }\n`;\n\nconst ButtonsWrapper = styled.div`\n display: flex;\n justify-content: flex-end;\n gap: 5px;\n margin-top: 5px;\n\n .cancel-button {\n filter: grayscale(0.7);\n }\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 { rarityColor } from '../Item/Inventory/ItemSlot';\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 onMarketPlaceItemBuy?: () => void;\n onMarketPlaceItemRemove?: () => void;\n disabled?: boolean;\n}\n\nexport const MarketplaceRows: React.FC<IMarketPlaceRowsPropos> = ({\n atlasJSON,\n atlasIMG,\n item,\n itemPrice,\n equipmentSet,\n scale,\n onMarketPlaceItemBuy,\n onMarketPlaceItemRemove,\n disabled,\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 <RarityContainer item={item}>\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 </RarityContainer>\n <QuantityContainer>\n {item.stackQty &&\n item.stackQty > 1 &&\n `x${Math.round(item.stackQty * 10) / 10}`}\n </QuantityContainer>\n </ItemInfoWrapper>\n </SpriteContainer>\n <PriceValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n {item.name}\n </Ellipsis>\n </p>\n </PriceValue>\n </ItemIconContainer>\n\n <Flex>\n <ItemIconContainer>\n <GoldContainer>\n <SpriteFromAtlas\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n spriteKey=\"others/gold-coin-qty-5.png\"\n imgScale={2}\n />\n </GoldContainer>\n <PriceValue>\n <p>\n <Ellipsis maxLines={1} maxWidth=\"200px\" fontSize=\"10px\">\n ${itemPrice}\n </Ellipsis>\n </p>\n </PriceValue>\n </ItemIconContainer>\n <ButtonContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={disabled}\n onPointerDown={() => {\n if (disabled) return;\n\n onMarketPlaceItemBuy?.();\n onMarketPlaceItemRemove?.();\n }}\n >\n {onMarketPlaceItemBuy ? 'Buy' : 'Remove'}\n </Button>\n </ButtonContainer>\n </Flex>\n </MarketplaceWrapper>\n );\n};\n\nconst MarketplaceWrapper = styled.div`\n margin: auto;\n display: flex;\n justify-content: space-between;\n padding: 0.5rem;\n\n &:hover {\n background-color: ${uiColors.darkGray};\n }\n\n p {\n font-size: 0.8rem;\n }\n`;\n\nconst QuantityContainer = styled.p`\n position: absolute;\n display: block;\n top: 15px;\n left: 25px;\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n\nconst Flex = styled.div`\n display: flex;\n gap: 24px;\n`;\n\nconst ItemIconContainer = styled.div`\n display: flex;\n justify-content: flex-start;\n align-items: center;\n`;\n\nconst GoldContainer = styled.div`\n position: relative;\n top: -0.5rem;\n left: 0.5rem;\n`;\nconst SpriteContainer = styled.div`\n position: relative;\n left: 0.5rem;\n`;\n\nconst PriceValue = styled.div`\n margin-left: 40px;\n`;\n\nconst ButtonContainer = styled.div`\n margin: auto;\n`;\n\nconst RarityContainer = styled.div<{ item: IItem }>`\n border-color: ${({ item }) => rarityColor(item)};\n box-shadow: ${({ item }) => `0 0 5px 8px ${rarityColor(item)}`} inset,\n ${({ item }) => `0 0 8px 6px ${rarityColor(item)}`};\n width: 32px;\n height: 32px;\n`;\n","import { IEquipmentSet, IMarketplaceItem } from '@rpg-engine/shared';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { AiFillCaretRight } from 'react-icons/ai';\nimport styled from 'styled-components';\nimport { ConfirmModal } from '../ConfirmModal';\nimport { Dropdown } from '../Dropdown';\nimport { Input } from '../Input';\nimport { MarketplaceRows } from './MarketplaceRows';\nimport { itemRarityOptions, itemTypeOptions, orderByOptions } from './filters';\n\nexport interface IBuyPanelProps {\n items: IMarketplaceItem[];\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onChangeType: (value: string) => void;\n onChangeRarity: (value: string) => void;\n onChangeOrder: (value: string) => void;\n onChangeNameInput: (value: string) => void;\n onChangeMainLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangeSecondaryLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangePriceInput: (value: [number | undefined, number | undefined]) => void;\n scale?: number;\n equipmentSet?: IEquipmentSet | null;\n onMarketPlaceItemBuy?: (marketPlaceItemId: string) => void;\n characterId: string;\n enableHotkeys?: () => void;\n disableHotkeys?: () => void;\n currentPage: number;\n}\n\nexport const BuyPanel: React.FC<IBuyPanelProps> = ({\n items,\n atlasIMG,\n atlasJSON,\n onChangeType,\n onChangeRarity,\n onChangeOrder,\n onChangeNameInput,\n onChangeMainLevelInput,\n onChangeSecondaryLevelInput,\n onChangePriceInput,\n equipmentSet,\n onMarketPlaceItemBuy,\n characterId,\n enableHotkeys,\n disableHotkeys,\n currentPage,\n}) => {\n const [name, setName] = useState('');\n const [mainLevel, setMainLevel] = useState<\n [number | undefined, number | undefined]\n >([undefined, undefined]);\n const [secondaryLevel, setSecondaryLevel] = useState<\n [number | undefined, number | undefined]\n >([undefined, undefined]);\n const [price, setPrice] = useState<[number | undefined, number | undefined]>([\n undefined,\n undefined,\n ]);\n const [buyingItemId, setBuyingItemId] = useState<string | null>(null);\n\n const itemsContainer = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n itemsContainer.current?.scrollTo(0, 0);\n }, [currentPage]);\n\n return (\n <>\n {buyingItemId && (\n <ConfirmModal\n onClose={setBuyingItemId.bind(null, null)}\n onConfirm={() => {\n onMarketPlaceItemBuy?.(buyingItemId);\n setBuyingItemId(null);\n enableHotkeys?.();\n }}\n message=\"Are you sure to buy this item?\"\n />\n )}\n <InputWrapper>\n <p>Search By Name</p>\n <Input\n onChange={e => {\n setName(e.target.value);\n onChangeNameInput(e.target.value);\n }}\n value={name}\n placeholder=\"Enter name...\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </InputWrapper>\n\n <OptionsWrapper>\n <FilterInputsWrapper>\n <div>\n <p>Main level</p>\n <Input\n onChange={e => {\n setMainLevel([Number(e.target.value), mainLevel[1]]);\n onChangeMainLevelInput([Number(e.target.value), mainLevel[1]]);\n }}\n placeholder=\"Min\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <AiFillCaretRight />\n <Input\n onChange={e => {\n setMainLevel([mainLevel[0], Number(e.target.value)]);\n onChangeMainLevelInput([mainLevel[0], Number(e.target.value)]);\n }}\n placeholder=\"Max\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </div>\n\n <div>\n <p>Secondary level</p>\n <Input\n onChange={e => {\n setSecondaryLevel([Number(e.target.value), secondaryLevel[1]]);\n onChangeSecondaryLevelInput([\n Number(e.target.value),\n secondaryLevel[1],\n ]);\n }}\n placeholder=\"Min\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <AiFillCaretRight />\n <Input\n onChange={e => {\n setSecondaryLevel([secondaryLevel[0], Number(e.target.value)]);\n onChangeSecondaryLevelInput([\n secondaryLevel[0],\n Number(e.target.value),\n ]);\n }}\n placeholder=\"Max\"\n type=\"number\"\n min={0}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </div>\n\n <div>\n <p>Price</p>\n <Input\n onChange={e => {\n setPrice([Number(e.target.value), price[1]]);\n onChangePriceInput([Number(e.target.value), price[1]]);\n }}\n placeholder=\"Min\"\n type=\"number\"\n min={0}\n className=\"big-input\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <AiFillCaretRight />\n <Input\n onChange={e => {\n setPrice([price[0], Number(e.target.value)]);\n onChangePriceInput([price[0], Number(e.target.value)]);\n }}\n placeholder=\"Max\"\n type=\"number\"\n min={0}\n className=\"big-input\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </div>\n </FilterInputsWrapper>\n\n <WrapperContainer>\n <StyledDropdown\n options={itemTypeOptions}\n onChange={onChangeType}\n width=\"95%\"\n />\n <StyledDropdown\n options={itemRarityOptions}\n onChange={onChangeRarity}\n width=\"95%\"\n />\n <StyledDropdown\n options={orderByOptions}\n onChange={onChangeOrder}\n width=\"100%\"\n />\n </WrapperContainer>\n </OptionsWrapper>\n\n <ItemComponentScrollWrapper id=\"MarketContainer\" ref={itemsContainer}>\n {items?.map(({ item, price, _id, owner }, index) => (\n <MarketplaceRows\n key={`${item.key}_${index}`}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n item={item}\n itemPrice={price}\n equipmentSet={equipmentSet}\n onMarketPlaceItemBuy={setBuyingItemId.bind(null, _id)}\n disabled={owner === characterId}\n />\n ))}\n </ItemComponentScrollWrapper>\n </>\n );\n};\n\nconst InputWrapper = styled.div`\n width: 95%;\n display: flex !important;\n justify-content: flex-start;\n align-items: center;\n margin: auto;\n\n p {\n width: auto;\n margin-right: 20px;\n }\n\n input {\n width: 68%;\n height: 10px;\n }\n`;\n\nconst OptionsWrapper = styled.div`\n width: 100%;\n height: 100px;\n`;\n\nconst FilterInputsWrapper = styled.div`\n width: 95%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n margin-left: 10px;\n gap: 5px;\n color: white;\n flex-wrap: wrap;\n\n p {\n width: auto;\n margin: 0;\n }\n\n input {\n width: 75px;\n height: 10px;\n }\n\n .big-input {\n width: 130px;\n }\n`;\n\nconst WrapperContainer = styled.div`\n display: grid;\n grid-template-columns: 40% 30% 30%;\n justify-content: space-between;\n width: calc(100% - 40px);\n margin-left: 10px;\n\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 @media (max-width: 950px) {\n height: 250px;\n }\n`;\n\nconst StyledDropdown = styled(Dropdown)`\n margin: 3px !important;\n width: 170px !important;\n`;\n","import { IEquipmentSet, IItem, IMarketplaceItem } from '@rpg-engine/shared';\nimport React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { Button, ButtonTypes } from '../Button';\nimport { ConfirmModal } from '../ConfirmModal';\nimport { Input } from '../Input';\nimport { ItemSlot } from '../Item/Inventory/ItemSlot';\nimport { MarketplaceRows } from './MarketplaceRows';\n\nexport interface IManagmentPanelProps {\n items: IMarketplaceItem[];\n atlasJSON: any;\n atlasIMG: any;\n onChangeNameInput: (value: string) => void;\n equipmentSet?: IEquipmentSet | null;\n availableGold: number;\n onMarketPlaceItemRemove?: (marketPlaceItemId: string) => void;\n selectedItemToSell: IItem | null;\n onSelectedItemToSellRemove: (item: IItem) => void;\n onAddItemToMarketplace: (item: IItem, price: number) => void;\n enableHotkeys?: () => void;\n disableHotkeys?: () => void;\n onMoneyWithdraw: () => void;\n currentPage: number;\n}\n\nexport const ManagmentPanel: React.FC<IManagmentPanelProps> = ({\n items,\n atlasIMG,\n atlasJSON,\n onChangeNameInput,\n equipmentSet,\n availableGold,\n onMarketPlaceItemRemove,\n selectedItemToSell,\n onSelectedItemToSellRemove,\n onAddItemToMarketplace,\n enableHotkeys,\n disableHotkeys,\n onMoneyWithdraw,\n currentPage,\n}) => {\n const [name, setName] = useState('');\n const [price, setPrice] = useState('');\n const [isCreatingOffer, setIsCreatingOffer] = useState(false);\n const [removingItemId, setRemovingItemId] = useState<string | null>(null);\n\n const itemsContainer = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n itemsContainer.current?.scrollTo(0, 0);\n }, [currentPage]);\n\n return (\n <>\n {isCreatingOffer && (\n <ConfirmModal\n onClose={setIsCreatingOffer.bind(null, false)}\n onConfirm={() => {\n if (selectedItemToSell && price && Number(price)) {\n onAddItemToMarketplace(selectedItemToSell, Number(price));\n setPrice('');\n onSelectedItemToSellRemove(selectedItemToSell);\n setIsCreatingOffer(false);\n enableHotkeys?.();\n }\n }}\n message=\"Are you sure to create this offer?\"\n />\n )}\n {removingItemId && (\n <ConfirmModal\n onClose={setRemovingItemId.bind(null, null)}\n onConfirm={() => {\n onMarketPlaceItemRemove?.(removingItemId);\n setRemovingItemId(null);\n enableHotkeys?.();\n }}\n message=\"Are you sure to remove this item?\"\n />\n )}\n <InputWrapper>\n <p>Search By Name</p>\n <Input\n onChange={e => {\n setName(e.target.value);\n onChangeNameInput(e.target.value);\n }}\n value={name}\n placeholder=\"Enter name...\"\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n </InputWrapper>\n\n <OptionsWrapper>\n <InnerOptionsWrapper>\n <SellDescription>\n Click on item in inventory to sell it\n </SellDescription>\n <Flex>\n <ItemSlot\n slotIndex={0}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n onPointerDown={(_, __, item) => onSelectedItemToSellRemove(item)}\n item={selectedItemToSell}\n />\n <PriceInputWrapper>\n <p>Enter price</p>\n <Flex>\n <Input\n onChange={e => {\n setPrice(e.target.value);\n }}\n value={price}\n placeholder=\"Enter price...\"\n type=\"number\"\n disabled={!selectedItemToSell}\n onBlur={enableHotkeys}\n onFocus={disableHotkeys}\n />\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={!selectedItemToSell || !price}\n onPointerDown={() => {\n if (selectedItemToSell && price && Number(price)) {\n setIsCreatingOffer(true);\n }\n }}\n >\n Create offer\n </Button>\n </Flex>\n </PriceInputWrapper>\n </Flex>\n </InnerOptionsWrapper>\n <InnerOptionsWrapper>\n <AvailableGold $disabled={availableGold === 0}>\n <p>Available gold</p>\n <p className=\"center\">${availableGold}</p>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n disabled={availableGold === 0}\n onPointerDown={() => availableGold > 0 && onMoneyWithdraw()}\n >\n Withdraw\n </Button>\n </AvailableGold>\n </InnerOptionsWrapper>\n </OptionsWrapper>\n\n <ItemComponentScrollWrapper id=\"MarketContainer\" ref={itemsContainer}>\n {items?.map(({ item, price, _id }, index) => (\n <MarketplaceRows\n key={`${item.key}_${index}`}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n item={item}\n itemPrice={price}\n equipmentSet={equipmentSet}\n onMarketPlaceItemRemove={setRemovingItemId.bind(null, _id)}\n />\n ))}\n </ItemComponentScrollWrapper>\n </>\n );\n};\n\nconst Flex = styled.div`\n display: flex;\n gap: 5px;\n align-items: center;\n`;\n\nconst InputWrapper = styled.div`\n width: 95%;\n display: flex !important;\n justify-content: flex-start;\n align-items: center;\n margin: auto;\n\n p {\n width: auto;\n margin-right: 20px;\n }\n\n input {\n width: 68%;\n height: 10px;\n }\n`;\n\nconst OptionsWrapper = styled.div`\n width: 100%;\n height: 100px;\n display: flex;\n align-items: center;\n justify-content: space-around;\n`;\n\nconst InnerOptionsWrapper = styled.div`\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n height: 100%;\n`;\n\nconst ItemComponentScrollWrapper = styled.div`\n overflow-y: scroll;\n height: 390px;\n width: 100%;\n margin-top: 1rem;\n\n @media (max-width: 950px) {\n height: 250px;\n }\n`;\n\nconst PriceInputWrapper = styled.div`\n p {\n margin: 0;\n }\n\n input {\n width: 200px;\n }\n`;\n\nconst SellDescription = styled.p`\n margin: 0;\n font-size: ${uiFonts.size.xsmall} !important;\n`;\n\nconst AvailableGold = styled.div<{ $disabled: boolean }>`\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n p {\n margin: 0;\n color: ${props =>\n props.$disabled ? uiColors.lightGray : 'white'} !important;\n }\n\n .center {\n text-align: center;\n font-size: ${uiFonts.size.large} !important;\n color: ${props =>\n props.$disabled ? uiColors.lightGray : uiColors.lightGreen} !important;\n }\n`;\n","import { IEquipmentSet, IItem, IMarketplaceItem } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button, ButtonTypes } from '../Button';\nimport { DraggableContainer } from '../DraggableContainer';\nimport { Pager } from '../Pager';\nimport { RPGUIContainerTypes } from '../RPGUIContainer';\nimport { BuyPanel } from './BuyPanel';\nimport { ManagmentPanel } from './ManagmentPanel';\n\nexport interface IMarketPlaceProps {\n items: IMarketplaceItem[];\n atlasJSON: any;\n atlasIMG: any;\n onClose: () => void;\n onChangeType: (value: string) => void;\n onChangeRarity: (value: string) => void;\n onChangeOrder: (value: string) => void;\n onChangeNameInput: (value: string) => void;\n onChangeMainLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangeSecondaryLevelInput: (\n value: [number | undefined, number | undefined]\n ) => void;\n onChangePriceInput: (value: [number | undefined, number | undefined]) => void;\n scale?: number;\n equipmentSet?: IEquipmentSet | null;\n onMarketPlaceItemBuy?: (marketPlaceItemId: string) => void;\n onMarketPlaceItemRemove?: (marketPlaceItemId: string) => void;\n availableGold: number;\n selectedItemToSell: IItem | null;\n onSelectedItemToSellRemove: (item: IItem) => void;\n onYourPanelToggle: (yourPanel: boolean) => void;\n onAddItemToMarketplace: (item: IItem, price: number) => void;\n characterId: string;\n enableHotkeys?: () => void;\n disableHotkeys?: () => void;\n onMoneyWithdraw: () => void;\n totalItems: number;\n currentPage: number;\n itemsPerPage: number;\n onPageChange: (page: number) => void;\n}\n\nexport const Marketplace: React.FC<IMarketPlaceProps> = props => {\n const { onClose, scale, onYourPanelToggle } = props;\n\n const [isYourPanel, setIsYourPanel] = useState(false);\n\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"800px\"\n cancelDrag=\"#MarketContainer, .rpgui-dropdown-imp, input, .empty-slot, button\"\n scale={scale}\n >\n {isYourPanel && (\n <>\n <ManagmentPanel {...props} />\n\n <PagerContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n onYourPanelToggle(false);\n setIsYourPanel(false);\n }}\n >\n Go to marketplace\n </Button>\n <Pager {...props} />\n </PagerContainer>\n </>\n )}\n {!isYourPanel && (\n <>\n <BuyPanel {...props} />\n\n <PagerContainer>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n onYourPanelToggle(true);\n setIsYourPanel(true);\n }}\n >\n Go to your panel\n </Button>\n <Pager {...props} />\n </PagerContainer>\n </>\n )}\n </DraggableContainer>\n );\n};\n\nconst PagerContainer = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: calc(100% - 30px);\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { Input } from '../../Input';\nimport { RPGUIContainerTypes } from '../../RPGUIContainer';\n\nexport interface IPartyCreateProps {\n onClose: () => void;\n onCreate: () => void;\n}\n\nexport const PartyCreate: React.FC<IPartyCreateProps> = ({\n onClose,\n onCreate,\n}) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n if (onClose) onClose();\n }}\n width=\"500px\"\n height=\"300px\"\n cancelDrag=\".partyRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Create Party</Title>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <h1>Type your party name</h1>\n <Input placeholder=\"Type party name\" type=\"text\" />\n <ButtonWrapper>\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n onCreate();\n }}\n >\n Confirm\n </Button>\n <div className=\"cancel-button\">\n <Button\n buttonType={ButtonTypes.RPGUIButton}\n onPointerDown={() => {\n close();\n }}\n >\n Cancel\n </Button>\n </div>\n </ButtonWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst ButtonWrapper = styled.div`\n margin-top: 10px;\n width: 100%;\n display: flex;\n justify-content: space-around;\n align-items: center;\n .cancel-button {\n filter: grayscale(0.7);\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\n\nexport interface IPartyRowProps {\n id: string;\n charName: string;\n charClass: string;\n charLevel: number;\n playerQty: number;\n isInvited: boolean;\n partyName: string;\n}\n\nexport const PartyRow: React.FC<IPartyRowProps> = ({\n charName,\n charClass,\n charLevel,\n playerQty,\n isInvited,\n partyName,\n}) => {\n return (\n <PartyWrapper>\n <TextContainer>{partyName}</TextContainer>\n <TextContainer>{charName}</TextContainer>\n <TextContainer>{charClass}</TextContainer>\n <TextContainer>{charLevel}</TextContainer>\n <TextContainer>{playerQty}/5</TextContainer>\n {isInvited ? (\n <>\n <Button buttonType={ButtonTypes.RPGUIButton}>Accept</Button>\n <div className=\"cancel-button\">\n <Button buttonType={ButtonTypes.RPGUIButton}>Decline</Button>\n </div>\n </>\n ) : (\n <Button buttonType={ButtonTypes.RPGUIButton}>Join</Button>\n )}\n </PartyWrapper>\n );\n};\n\nconst PartyWrapper = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-around;\n .cancel-button {\n filter: grayscale(0.7);\n }\n`;\n\nconst TextContainer = styled.div`\n color: ${uiColors.white};\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { RPGUIContainerTypes } from '../../RPGUIContainer';\nimport { IPartyRowProps, PartyRow } from './PartyRows';\n\nexport interface IPartyDashboardProps {\n partyRows: IPartyRowProps[];\n}\n\nexport const PartyDashboard: React.FC<IPartyDashboardProps> = ({\n partyRows,\n}) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n console.log('Close');\n }}\n width=\"800px\"\n height=\"400px\"\n cancelDrag=\".partyRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Party Dashboard</Title>\n <Button buttonType={ButtonTypes.RPGUIButton}>Create</Button>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <RowsWrapper className=\"partyRows\">\n {partyRows.map(partyRows => (\n <PartyRow\n key={partyRows.id}\n charName={partyRows.charName}\n charClass={partyRows.charClass}\n charLevel={partyRows.charLevel}\n playerQty={partyRows.playerQty}\n id={partyRows.id}\n isInvited={partyRows.isInvited}\n partyName={partyRows.partyName}\n />\n ))}\n </RowsWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\n\nconst RowsWrapper = styled.div`\n overflow-y: scroll;\n -webkit-overflow-scrolling: touch;\n width: 100%;\n height: 200px;\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\n\nexport interface IPlayersRowProps {\n id: string;\n charName: string;\n charClass: string;\n charLevel: number;\n isNotInvited: boolean;\n}\n\nexport const PlayersRow: React.FC<IPlayersRowProps> = ({\n charName,\n charClass,\n charLevel,\n isNotInvited,\n}) => {\n return (\n <PartyWrapper>\n <TextContainer>{charName}</TextContainer>\n <TextContainer>{charClass}</TextContainer>\n <TextContainer>{charLevel}</TextContainer>\n {isNotInvited ? (\n <>\n <Button buttonType={ButtonTypes.RPGUIButton}>Invite</Button>\n </>\n ) : (\n <TextContainer>Invited</TextContainer>\n )}\n </PartyWrapper>\n );\n};\n\nconst PartyWrapper = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-around;\n flex-direction: row;\n flex: auto;\n`;\n\nconst TextContainer = styled.div`\n color: ${uiColors.white};\n flex: auto;\n margin: auto;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { RPGUIContainerTypes } from '../../RPGUIContainer';\nimport { IPlayersRowProps, PlayersRow } from './PlayersRows';\n\nexport interface IPartyInviteProps {\n playersRows: IPlayersRowProps[];\n}\n\nexport const PartyInvite: React.FC<IPartyInviteProps> = ({ playersRows }) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n console.log('Close');\n }}\n width=\"600px\"\n height=\"400px\"\n cancelDrag=\".playersRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Invite for Party</Title>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <RowsWrapper className=\"playersRows\">\n {playersRows.map(playersRows => (\n <PlayersRow\n key={playersRows.id}\n charName={playersRows.charName}\n charClass={playersRows.charClass}\n charLevel={playersRows.charLevel}\n id={playersRows.id}\n isNotInvited={playersRows.isNotInvited}\n />\n ))}\n </RowsWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst RowsWrapper = styled.div`\n overflow-y: scroll;\n -webkit-overflow-scrolling: touch;\n width: 100%;\n height: 200px;\n`;\n","import React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { Button, ButtonTypes } from '../../Button';\n\nexport interface IPartyManagerRowProps {\n id: string;\n charName: string;\n charClass: string;\n isLeader: boolean;\n isLeaderRow?: boolean;\n}\n\nexport const PartyManagerRow: React.FC<IPartyManagerRowProps> = ({\n charName,\n charClass,\n isLeader,\n isLeaderRow,\n}) => {\n return (\n <PartyWrapper>\n <TextContainer>{charName}</TextContainer>\n <TextContainer>{charClass}</TextContainer>\n <div className=\"cancel-button\">\n <Button buttonType={ButtonTypes.RPGUIButton} disabled={!isLeader}>\n {isLeaderRow ? 'Leader' : 'Remove'}\n </Button>\n </div>\n <Button buttonType={ButtonTypes.RPGUIButton} disabled={!isLeader}>\n New Leader\n </Button>\n </PartyWrapper>\n );\n};\n\nconst PartyWrapper = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-around;\n .cancel-button {\n filter: grayscale(0.7);\n }\n`;\n\nconst TextContainer = styled.div`\n color: ${uiColors.white};\n`;\n","import { ICharacterPartyShared } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { DraggableContainer } from '../../DraggableContainer';\nimport { RPGUIContainerTypes } from '../../RPGUIContainer';\nimport { PartyManagerRow } from './PartyManagerRows';\n\nexport interface IPartyManagerProps {\n partyRows: ICharacterPartyShared | null;\n isLeader: boolean;\n onClose?: () => void;\n}\n\nexport const PartyManager: React.FC<IPartyManagerProps> = ({\n partyRows,\n isLeader,\n}) => {\n return (\n <DraggableContainer\n type={RPGUIContainerTypes.Framed}\n onCloseButton={() => {\n console.log('Close');\n }}\n width=\"800px\"\n height=\"400px\"\n cancelDrag=\".partyRows\"\n >\n <Wrapper>\n <div style={{ width: '100%' }}>\n <Title>Party Dashboard</Title>\n <hr className=\"golden\" />\n </div>\n </Wrapper>\n <RowsWrapper className=\"partyRows\">\n {partyRows ? (\n <>\n <PartyManagerRow\n key={partyRows.leader._id}\n id={partyRows.leader._id}\n charName={partyRows.leader.name}\n charClass={partyRows.leader.class}\n isLeader={isLeader}\n isLeaderRow={true}\n />\n {partyRows.members.map(partyRows => (\n <PartyManagerRow\n key={partyRows._id}\n charName={partyRows.name}\n charClass={partyRows.class}\n id={partyRows._id}\n isLeader={isLeader}\n />\n ))}\n </>\n ) : (\n <>\n <NotinParty>\n You are not in party. <br />\n Please create a new party\n </NotinParty>\n </>\n )}\n </RowsWrapper>\n </DraggableContainer>\n );\n};\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n`;\n\nconst RowsWrapper = styled.div`\n width: 100%;\n`;\n\nconst Title = styled.h1`\n font-size: 0.6rem;\n color: ${uiColors.yellow} !important;\n`;\n\nconst NotinParty = styled.h1`\n font-size: 0.6rem;\n margin: auto;\n`;\n","import { CharacterClass, ICharacterPartyShared } from '@rpg-engine/shared';\nimport { v4 as uuidv4 } from 'uuid';\nimport { IPartyRowProps } from '../PartyDashboard/PartyRows';\nimport { IPlayersRowProps } from '../PartyInvite';\nimport { IPartyManagerRowProps } from '../PartyManager';\n\nexport const mockedPartyRows: IPartyRowProps[] = [\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n playerQty: 3,\n isInvited: true,\n partyName: 'Party',\n },\n];\n\nexport const mockedPlayersRows2: ICharacterPartyShared = {\n id: uuidv4(),\n leader: {\n _id: uuidv4(),\n class: CharacterClass.Druid,\n name: 'leader',\n },\n members: [\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n { _id: uuidv4(), class: CharacterClass.Druid, name: 'blblb' },\n ],\n maxSize: 5,\n size: 4,\n};\n\nexport const mockedPlayersRows: IPlayersRowProps[] = [\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n charLevel: 1,\n isNotInvited: true,\n },\n];\n\nexport const mockedPartyManager: IPartyManagerRowProps[] = [\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\n {\n id: uuidv4(),\n charName: 'CharNome',\n charClass: 'CharClass',\n isLeader: false,\n },\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 mobileScale?: 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 mobileScale,\n}) => {\n value = Math.round(value);\n max = Math.round(max);\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 mobileScale={mobileScale}\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 mobileScale?: number;\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 @media (max-width: 950px) {\n transform: scale(${props => props.mobileScale});\n }\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 { countItemFromInventory } from '../../libs/itemCounter';\nimport { SpriteFromAtlas } from '../shared/SpriteFromAtlas';\nimport { SingleShortcut } from './SingleShortcut';\nimport { useShortcutCooldown } from './useShortcutCooldown';\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 spellCooldowns?: Record<string, number>;\n};\n\nexport const Shortcuts: React.FC<ShortcutsProps> = ({\n shortcuts,\n onShortcutCast,\n mana,\n isBlockedCastingByKeyboard = false,\n atlasJSON,\n atlasIMG,\n inventory,\n spellCooldowns,\n}) => {\n const shortcutsRefs = useRef<HTMLButtonElement[]>([]);\n\n const { handleShortcutCast, shortcutCooldown } = useShortcutCooldown(\n onShortcutCast\n );\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 handleShortcutCast(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, shortcutCooldown]);\n\n return (\n <List>\n {Array.from({ length: 6 }).map((_, i) => {\n const buildClassName = (classBase: string, isOnCooldown: boolean) => {\n return `${classBase} ${isOnCooldown ? 'onCooldown' : ''}`;\n };\n\n const isOnShortcutCooldown = shortcutCooldown > 0;\n\n if (shortcuts && 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 =\n payload && inventory\n ? countItemFromInventory(payload.key, inventory)\n : 0;\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={handleShortcutCast.bind(null, i)}\n disabled={false}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n {isOnShortcutCooldown && (\n <span className=\"cooldown\">{shortcutCooldown.toFixed(1)}</span>\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={buildClassName('qty', isOnShortcutCooldown)}>\n {totalQty}\n </span>\n <span\n className={buildClassName('keyboard', isOnShortcutCooldown)}\n >\n {i + 1}\n </span>\n </StyledShortcut>\n );\n }\n\n const payload =\n shortcuts && (shortcuts[i]?.payload as IRawSpell | undefined); //check if shortcuts exists before using the ? operator.\n\n const spellCooldown = !payload\n ? 0\n : spellCooldowns?.[payload.magicWords.replaceAll(' ', '_')] ??\n shortcutCooldown;\n const cooldown =\n spellCooldown > shortcutCooldown ? spellCooldown : shortcutCooldown;\n const isOnCooldown = cooldown > 0 && !!payload;\n\n return (\n <StyledShortcut\n key={i}\n onPointerDown={handleShortcutCast.bind(null, i)}\n disabled={mana < (payload?.manaCost ?? 0)}\n ref={el => {\n if (el) shortcutsRefs.current[i] = el;\n }}\n >\n {isOnCooldown && (\n <span className=\"cooldown\">\n {cooldown.toFixed(cooldown < 10 ? 1 : 0)}\n </span>\n )}\n <span className={buildClassName('mana', isOnCooldown)}>\n {payload && payload.manaCost}\n </span>\n <span className=\"magicWords\">\n {payload?.magicWords.split(' ').map(word => word[0])}\n </span>\n <span className={buildClassName('keyboard', isOnCooldown)}>\n {i + 1}\n </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 { uiColors } from '../constants/uiColors';\nimport { ErrorBoundary } from './Item/Inventory/ErrorBoundary';\nimport { SimpleProgressBar } from './SimpleProgressBar';\nimport { SpriteFromAtlas } from './shared/SpriteFromAtlas';\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 buffAndDebuff?: number;\n ratio: number;\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 buffAndDebuff,\n ratio,\n}) => {\n if (!skillPointsToNextLevel) {\n skillPointsToNextLevel = getSPForLevel(level + 1);\n }\n\n const skillsBuffsCalc = () => {\n if (buffAndDebuff) {\n return 1 + buffAndDebuff / 100;\n }\n return;\n };\n\n return (\n <>\n <ProgressTitle>\n {buffAndDebuff !== undefined && (\n <>\n {buffAndDebuff > 0 ? (\n <BuffAndDebuffContainer>\n <TitleNameContainer>\n <TitleNameBuff>{skillName}</TitleNameBuff>\n <TitleNameBuff>\n lv {level} ({skillsBuffsCalc()})\n </TitleNameBuff>\n </TitleNameContainer>\n <TitleNameBuffContainer>\n <TitleNameBuff>(+{buffAndDebuff}%)</TitleNameBuff>\n </TitleNameBuffContainer>\n </BuffAndDebuffContainer>\n ) : buffAndDebuff < 0 ? (\n <>\n <TitleNameContainer>\n <TitleNameDebuff>{skillName}</TitleNameDebuff>\n <TitleNameDebuff>\n lv {level} ({skillsBuffsCalc()})\n </TitleNameDebuff>\n </TitleNameContainer>\n <div>\n <TitleNameDebuff>({buffAndDebuff}%)</TitleNameDebuff>\n </div>\n </>\n ) : (\n <TitleName>{skillName}</TitleName>\n )}\n </>\n )}\n {!buffAndDebuff && (\n <TitleNameContainer>\n <TitleName>{skillName}</TitleName>\n <ValueDisplay>lv {level}</ValueDisplay>\n </TitleNameContainer>\n )}\n </ProgressTitle>\n\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}/{skillPointsToNextLevel}\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 TitleNameBuff = styled.span`\n margin-left: 5px;\n color: ${uiColors.lightGreen} !important;\n`;\n\nconst TitleNameDebuff = styled.span`\n margin-left: 5px;\n color: ${uiColors.red} !important;\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: column;\n justify-content: space-between;\n span {\n font-size: 0.6rem;\n }\n`;\n\nconst BuffAndDebuffContainer = styled.div``;\n\nconst TitleNameBuffContainer = styled.div``;\n\nconst TitleNameContainer = styled.div`\n display: flex;\n justify-content: space-between;\n`;\n","import {\n ISkill,\n ISkillDetails,\n getSPForLevel,\n getXPForLevel,\n} 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 SPRatio = (level: number, skillPoints: number) => {\n const SPLevelActual = getSPForLevel(level + 1);\n const SPLevelBefore = getSPForLevel(level);\n const SPCalc = SPLevelActual - SPLevelBefore;\n if (level === 1) {\n return (skillPoints / SPLevelActual) * 100;\n }\n return ((skillPoints - SPLevelBefore) / SPCalc) * 100;\n };\n\n const XPRatio = (level: number, skillPoints: number) => {\n const XPLevelActual = getXPForLevel(level + 1);\n const XPLevelBefore = getXPForLevel(level);\n const XPCalc = XPLevelActual - XPLevelBefore;\n if (level === 1) {\n return (skillPoints / XPLevelActual) * 100;\n }\n return ((skillPoints - XPLevelBefore) / XPCalc) * 100;\n };\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 if (key === 'stamina') {\n continue;\n }\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(getSPForLevel(skillDetails.level + 1)) || 0\n }\n texturePath={value}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n buffAndDebuff={skillDetails.buffAndDebuff}\n ratio={SPRatio(skillDetails.level, skillDetails.skillPoints)}\n />\n );\n }\n\n return output;\n };\n\n return (\n <SkillsDraggableContainer\n title=\"Skills\"\n cancelDrag=\"#skillsDiv\"\n scale={scale}\n width=\"100%\"\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={\n Math.round(getXPForLevel(skill.level + 1)) || 0\n }\n texturePath={'swords/broad-sword.png'}\n atlasIMG={atlasIMG}\n atlasJSON={atlasJSON}\n ratio={XPRatio(skill.level, skill.experience)}\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\n max-width: 450px;\n\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 { ISpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../../constants/uiColors';\nimport { uiFonts } from '../../../constants/uiFonts';\nimport { formatSpellCastingType } from '../../../libs/CastingTypeHelper';\n\ninterface ISpellInfoProps {\n spell: ISpell;\n}\n\nexport const SpellInfo: React.FC<ISpellInfoProps> = ({ spell }) => {\n const {\n magicWords,\n name,\n manaCost,\n requiredItem,\n description,\n castingType,\n cooldown,\n maxDistanceGrid,\n } = spell;\n return (\n <Container>\n <Header>\n <div>\n <Title>{name}</Title>\n <Type>{magicWords}</Type>\n </div>\n </Header>\n <Statistic>\n <div className=\"label\">Casting Type:</div>\n <div className=\"value\">{formatSpellCastingType(castingType)}</div>\n </Statistic>\n <Statistic>\n <div className=\"label\">Magic words:</div>\n <div className=\"value\">{magicWords}</div>\n </Statistic>\n <Statistic>\n <div className=\"label\">Mana cost:</div>\n <div className=\"value\">{manaCost}</div>\n </Statistic>\n <Statistic>\n <div className=\"label\">Cooldown:</div>\n <div className=\"value\">{cooldown}</div>\n </Statistic>\n {maxDistanceGrid && (\n <Statistic>\n <div className=\"label\">Max Distance Grid:</div>\n <div className=\"value\">{maxDistanceGrid}</div>\n </Statistic>\n )}\n <Statistic>\n {requiredItem && (\n <>\n <div className=\"label\">Required Item:</div>\n <div className=\"value\">{requiredItem}</div>\n </>\n )}\n </Statistic>\n <Description>{description}</Description>\n </Container>\n );\n};\n\nconst Container = styled.div`\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 ${uiColors.lightGray};\n height: max-content;\n width: 30rem;\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 Type = styled.div`\n font-size: ${uiFonts.size.small};\n margin-top: 0.2rem;\n color: ${uiColors.lightGray};\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 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","export const formatSpellCastingType = (castingType: string): string => {\n const formattedCastingType = castingType\n .split(\"-\")\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n \n return formattedCastingType;\n };","import { ISpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { SpellInfo } from './SpellInfo';\n\nexport interface ISpellInfoDisplayProps {\n spell: ISpell;\n isMobile?: boolean;\n}\n\nexport const SpellInfoDisplay: React.FC<ISpellInfoDisplayProps> = ({\n spell,\n isMobile,\n}) => {\n return (\n <Flex $isMobile={isMobile}>\n <SpellInfo spell={spell} />\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","import { ISpell } from '@rpg-engine/shared';\nimport React, { useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { SpellInfoDisplay } from './SpellInfoDisplay';\n\ninterface IListMenuOption {\n id: string;\n text: string;\n}\n\nexport interface MobileSpellTooltipProps {\n spell: ISpell;\n closeTooltip: () => void;\n scale?: number;\n options?: IListMenuOption[];\n onSelected?: (selectedOptionId: string) => void;\n}\n\nexport const MobileSpellTooltip: React.FC<MobileSpellTooltipProps> = ({\n spell,\n closeTooltip,\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 <SpellInfoDisplay spell={spell} isMobile />\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 { ISpell } from '@rpg-engine/shared';\nimport React, { useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport ModalPortal from '../../Abstractions/ModalPortal';\nimport { SpellInfoDisplay } from './SpellInfoDisplay';\n\nexport interface IMagicTooltipProps {\n spell: ISpell;\n}\n\nconst offset = 20;\n\nexport const MagicTooltip: React.FC<IMagicTooltipProps> = ({ spell }) => {\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 <SpellInfoDisplay spell={spell} />\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 { ISpell } from '@rpg-engine/shared';\nimport React, { useState } from 'react';\nimport { MobileSpellTooltip } from './MobileSpellTooltip';\nimport { MagicTooltip } from './SpellTooltip';\n\ninterface ISpellInfoWrapperProps {\n spell: ISpell;\n children: React.ReactNode;\n scale?: number;\n}\n\nexport const SpellInfoWrapper: React.FC<ISpellInfoWrapperProps> = ({\n children,\n spell,\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 <MagicTooltip spell={spell} />\n )}\n {isTooltipMobileVisible && (\n <MobileSpellTooltip\n closeTooltip={() => {\n setIsTooltipMobileVisible(false);\n console.log('close');\n }}\n spell={spell}\n scale={scale}\n />\n )}\n </div>\n );\n};\n","import { ISpell } from '@rpg-engine/shared';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { uiColors } from '../../constants/uiColors';\nimport { uiFonts } from '../../constants/uiFonts';\nimport { SpellInfoWrapper } from './cards/SpellInfoWrapper';\n\nexport interface ISpellProps {\n charMana: number;\n charMagicLevel: number;\n onPointerUp?: (spellKey: string) => void;\n isSettingShortcut?: boolean;\n spellKey: string;\n spell: ISpell;\n activeCooldown?: number;\n}\n\nexport const Spell: React.FC<ISpellProps> = ({\n spellKey,\n charMana,\n charMagicLevel,\n onPointerUp,\n isSettingShortcut,\n spell,\n activeCooldown,\n}) => {\n const {\n manaCost,\n minMagicLevelRequired,\n magicWords,\n name,\n description,\n } = spell;\n const disabled = isSettingShortcut\n ? charMagicLevel < minMagicLevelRequired\n : manaCost > charMana || charMagicLevel < minMagicLevelRequired;\n\n return (\n <SpellInfoWrapper spell={spell}>\n <Container\n onPointerUp={onPointerUp?.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>\n {activeCooldown && activeCooldown > 0 ? (\n <span className=\"cooldown\">\n {activeCooldown.toFixed(activeCooldown > 10 ? 0 : 1)}\n </span>\n ) : null}\n {magicWords.split(' ').map(word => word[0])}\n </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 </SpellInfoWrapper>\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\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 position: relative;\n overflow: hidden;\n\n .cooldown {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0 0 0 / 20%);\n color: ${uiColors.darkYellow};\n font-weight: bold;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n`;\n\nconst Info = styled.span`\n width: 0;\n flex: 1;\n\n @media (orientation: portrait) {\n display: none;\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 { IShortcut, ISpell } from '@rpg-engine/shared';\nimport React, { Fragment, 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: ISpell[];\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 spellCooldowns?: Record<string, 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 spellCooldowns,\n}) => {\n const [search, setSearch] = useState('');\n const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);\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 onPointerUp={\n settingShortcutIndex !== -1 ? setShortcut : onSpellClick\n }\n spellKey={spell.key}\n isSettingShortcut={settingShortcutIndex !== -1}\n spell={spell}\n activeCooldown={\n spellCooldowns?.[spell.magicWords.replaceAll(' ', '_')]\n }\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';\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, { 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","useShortcutCooldown","onShortcutCast","shortcutCooldown","setShortcutCooldown","cooldownTimeout","useRef","current","clearTimeout","setTimeout","handleShortcutCast","log","CancelButton","ButtonsContainer","ShortcutsContainer","StyledShortcut","useOutsideClick","id","handleClickOutside","event","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","_ref$dragDisabled","dragDisabled","draggableRef","_e","Draggable","cancel","onDrag","data","onStop","onStart","defaultPosition","TitleContainer","Title","Icon","src","h1","img","InputRadio","label","value","onRadioSelect","onPointerUp","checked","isChecked","readOnly","countItemFromInventory","itemKey","inventory","itemsFromInventory","Object","keys","slots","forEach","i","parseInt","_inventory$slots$inde","key","push","reduce","acc","stackQty","modalRoot","getElementById","ModalPortal","ReactDOM","createPortal","RelativeListMenu","options","onSelected","_ref$fontSize","pos","overflow","map","params","ListElement","text","li","MobileItemTooltip","closeTooltip","equipmentSet","_ref$scale","handleFadeOut","_ref$current","classList","add","onTouchEnd","ItemInfoDisplay","isMobile","OptionsContainer","option","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","DepotSocketEvents","Deposit","ActionsForEquipmentSet","Loot","ActionsForLoot","MapContainer","ActionsForMapContainer","contextActionMenuDontHaveUseWith","find","toLowerCase","includes","hasUseWith","Depot","ItemSocketEvents","GetItemInfo","Withdraw","generateContextMenu","getStackInfo","itemId","qtyClassName","ItemQtyContainer","ItemQty","Math","round","resetItem","onSuccesfulDrag","quantity","onMouseUp","e","changedTouches","clientX","clientY","simulatedEvent","MouseEvent","bubbles","elementFromPoint","_document$elementFrom","undefined","axis","defaultClassName","split","isNaN","classes","Array","from","_e$target","some","elm","window","getComputedStyle","matrix","DOMMatrixReadOnly","transform","m41","m42","isTouch","abs","position","ItemContainer","onMouseEnter","onMouseLeave","itemToRender","texturePath","allowedEquipSlotType","_itemToRender$allowed","element","_id","getItemTextureKeyPath","isStackable","stackInfo","uuidv4","renderEquipment","renderItem","onRenderSlot","ItemTooltip","optionId","rarityColor","rarity","ItemRarities","Uncommon","Rare","Epic","Legendary","statisticsToDisplay","higherIsWorse","ItemInfo","itemToCompare","renderMissingStatistic","statistics","stat","itemToCompareStatistic","toUpperCase","slice","Statistic","toString","Header","Rarity","Type","subType","AllowedSlots","slotType","minRequirements","LevelRequirement","level","skill","itemStatistic","isItemToCompare","isOnlyInOneItem","statDiff","_itemToCompare$stat$k2","isDifference","isBetter","renderStatistics","entityEffects","entityEffectChance","effect","usableEffectDescription","equippedBuffDescription","isTwoHanded","Description","description","maxStackSize","StackInfo","MissingStatistics","$isSpecial","itemSlotTypes","useMemo","_item$allowedEquipSlo","allowedSlotTypeCamelCase","camelCase","itemSubTypeCamelCase","getSlotType","itemFromEquipment","values","Flex","CompareContainer","Equipped","$isMobile","handleMouseMove","rect","getBoundingClientRect","tooltipWidth","tooltipHeight","isOffScreenRight","innerWidth","isOffScreenBottom","innerHeight","ItemInfoWrapper","setIsTooltipVisible","bind","CraftingRecipe","recipe","handleRecipeSelect","selectedCraftItemKey","skills","modifyString","str","parts","words","replace","concat","join","levelInSkill","minCraftingRequirements","_recipe$minCraftingRe2","_skills","RadioOptionsWrapper","SpriteAtlasWrapper","canCraft","display","MinCraftingRequirementsText","levelIsOk","_recipe$minCraftingRe4","_recipe$minCraftingRe6","ingredients","ingredient","itemQtyInInventory","Recipe","Ingredient","isQuantityOk","qty","desktop","mobileLanscape","mobilePortrait","Wrapper","Subtitle","RadioInputScroller","ButtonWrapper","ContentContainer","ItemTypes","Dropdown","dropdownId","selectedValue","setSelectedValue","selectedOption","setSelectedOption","opened","setOpened","firstOption","change","filter","o","DropdownSelect","prev","DropdownOptions","ul","Details","EquipmentSetContainer","EquipmentColumn","IS_MOBILE_OR_TABLET","isMobileOrTablet","DynamicText","onFinish","textState","setTextState","interval","setInterval","substring","clearInterval","TextContainer","NPCDialogText","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","OrderByType","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","Pager","totalItems","currentPage","onPageChange","totalPages","ceil","itemsPerPage","PagerContainer","ConfirmModal","message","Background","stopPropagation","ButtonsWrapper","MarketplaceRows","itemPrice","onMarketPlaceItemBuy","onMarketPlaceItemRemove","MarketplaceWrapper","ItemIconContainer","SpriteContainer","RarityContainer","QuantityContainer","PriceValue","GoldContainer","itemTypeOptions","ItemSubType","itemType","itemRarityOptions","itemRarity","orderByOptions","flatMap","orderBy","BuyPanel","items","onChangeType","onChangeRarity","onChangeOrder","onChangeNameInput","onChangeMainLevelInput","onChangeSecondaryLevelInput","onChangePriceInput","characterId","enableHotkeys","disableHotkeys","setName","mainLevel","setMainLevel","secondaryLevel","setSecondaryLevel","price","setPrice","buyingItemId","setBuyingItemId","itemsContainer","_itemsContainer$curre","scrollTo","InputWrapper","onFocus","OptionsWrapper","FilterInputsWrapper","AiFillCaretRight","WrapperContainer","StyledDropdown","ItemComponentScrollWrapper","owner","ManagmentPanel","availableGold","selectedItemToSell","onSelectedItemToSellRemove","onAddItemToMarketplace","onMoneyWithdraw","isCreatingOffer","setIsCreatingOffer","removingItemId","setRemovingItemId","InnerOptionsWrapper","SellDescription","__","PriceInputWrapper","AvailableGold","$disabled","PartyRow","charName","charClass","charLevel","playerQty","isInvited","PartyWrapper","partyName","RowsWrapper","PlayersRow","isNotInvited","PartyManagerRow","isLeader","isLeaderRow","NotinParty","mockedPartyRows","mockedPlayersRows2","leader","class","CharacterClass","Druid","members","maxSize","mockedPlayersRows","mockedPartyManager","ProgressBarText","minWidth","percentageWidth","mobileScale","QuestDraggableContainer","QuestContainer","QuestsContainer","Content","QuestSplitDiv","QuestColumn","Thumbnail","QuestListContainer","NoQuestContainer","_RPGUI","RPGUI","SimpleProgressBar","_ref$bgColor","bgColor","_ref$margin","margin","ProgressBarContainer","BackgroundBar","Progress","SkillProgressBar","skillName","skillPoints","skillPointsToNextLevel","_ref$showSkillPoints","showSkillPoints","buffAndDebuff","ratio","getSPForLevel","skillsBuffsCalc","ProgressTitle","BuffAndDebuffContainer","TitleNameContainer","TitleNameBuff","TitleNameBuffContainer","TitleNameDebuff","TitleName","ValueDisplay","ProgressBody","ProgressIconContainer","SkillDisplayContainer","SkillPointsDisplay","skillProps","attributes","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","SpellInfo","spell","manaCost","requiredItem","castingType","cooldown","maxDistanceGrid","charAt","formatSpellCastingType","SpellInfoDisplay","MobileSpellTooltip","MagicTooltip","SpellInfoWrapper","Spell","charMana","charMagicLevel","isSettingShortcut","activeCooldown","minMagicLevelRequired","spellKey","Overlay","SpellImage","toFixed","Info","Divider","Cost","SpellList","DayNightPeriod","periodOfDay","periodOfDaySrcFiles","PeriodOfDay","Morning","Afternoon","Night","GifContainer","WidgetContainer","Time","DayNightContainer","TradingItemRow","onQuantityChange","traderItem","selectedQty","onLeftClick","onRightClick","ItemWrapper","ItemNameContainer","NameValue","capitalize","StyledArrow","QuantityDisplay","TradingComponentScrollWrapper","TotalWrapper","GoldWrapper","AlertWrapper","availableCharacters","propertySelectValues","textureKey","selectedSpriteKey","setSelectedSpriteKey","paddingBottom","chatMessages","onSendChatMessage","_ref$styles","styles","textColor","setMessage","scrollChatToBottom","scrollingElement","querySelector","scrollTop","scrollHeight","fallback","emitter","createdAt","dayjs","Date","format","onRenderMessageLines","onRenderChatMessages","trim","autoComplete","autoFocus","borderRadius","RxPaperPlane","FramedGrey","selectedValues","generateSelectedValuesList","setSelectedValues","onActionClick","onCancelClick","mana","spellCooldowns","onShortcutClick","onTouchStart","remove","buildClassName","classBase","isOnCooldown","variant","onShortcutClickBinded","_shortcuts$i","isOnShortcutCooldown","_shortcuts$i2","_shortcuts$i3","itemsFromEquipment","totalQty","_shortcuts$i4","spellCooldown","replaceAll","renderShortcut","onSelect","onCraftItem","craftablesItems","savedSelectedType","craftItemKey","setCraftItemKey","selectedType","setSelectedType","setSize","handleResize","itemTypes","sort","a","b","localeCompare","rows","row","gap","renderItemTypes","details","onItemClick","onItemDragEnd","onItemDragStart","onItemPlaceDrop","onItemOutsideDrop","equipmentData","neck","leftHand","ring","head","armor","legs","boot","rightHand","accessory","equipmentMaskSlots","ItemSlotType","onRenderEquipmentSlotRange","start","end","equipmentRange","slotMaksRange","itemContainer","ContainerType","backgroundImgPath","fullCoverBackground","setImage","fullImg","handleClick","_ref$disableContextMe","disableContextMenu","isOpen","maxQuantity","callback","_quantity","quantitySelect","setQuantitySelect","handleSetShortcut","slotQty","_itemContainer$slots","onRenderSlots","imageKey","onYourPanelToggle","isYourPanel","setIsYourPanel","onCreate","close","partyRows","playersRows","_ref$displayText","displayText","_ref$percentageWidth","_ref$minWidth","calculatePercentageValue","quests","buttons","onChangeQuest","questsLength","thumbnail","thumbnailDefault","onClick","npcId","quest","_ref$isBlockedCasting","isBlockedCastingByKeyboard","shortcutsRefs","handleKeyDown","shortcutIndex","_shortcutsRefs$curren","_shortcutsRefs$curren2","XPLevelActual","XPLevelBefore","onRenderSkillCategory","category","SPLevelActual","SPLevelBefore","skillCategory","skillCategoryColor","output","entries","skillDetails","experience","getXPForLevel","onInputFocus","onInputBlur","spells","magicLevel","onSpellClick","setSpellShortcut","search","setSearch","spellsToDisplay","toLocaleLowerCase","setShortcut","Fragment","TimeClock","traderItems","characterAvailableGold","sum","setSum","Map","qtyMap","setQtyMap","set","newSum","get","isBuy","hasGoldForSale","tradeItem","assign"],"mappings":"+lCAAO,ICIKA,0DAAAA,EAAAA,sBAAAA,oDAEVA,4CCHUC,EDcCC,EAAS,oBACpBC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