diff --git a/build/entryx64.nsi b/build/entryx64.nsi index 9b99dac7b..09a4374fa 100644 --- a/build/entryx64.nsi +++ b/build/entryx64.nsi @@ -13,7 +13,7 @@ !define MUI_UNICON "icon.ico" !define PRODUCT_NAME "Entry" !define APP_NAME "Entry.exe" -!define PRODUCT_VERSION "2.1.11" +!define PRODUCT_VERSION "2.1.12" !define PRODUCT_PUBLISHER "EntryLabs" !define PRODUCT_WEB_SITE "http://www.playentry.org/" diff --git a/build/entryx86.nsi b/build/entryx86.nsi index 58465d3d2..a1ab3dc72 100644 --- a/build/entryx86.nsi +++ b/build/entryx86.nsi @@ -13,7 +13,7 @@ !define MUI_UNICON "icon.ico" !define PRODUCT_NAME "Entry" !define APP_NAME "Entry.exe" -!define PRODUCT_VERSION "2.1.11" +!define PRODUCT_VERSION "2.1.12" !define PRODUCT_PUBLISHER "EntryLabs" !define PRODUCT_WEB_SITE "http://www.playentry.org/" diff --git a/package.json b/package.json index 6aeeac5cf..ef08b7597 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "productName": "Entry", "name": "entry", - "version": "2.1.11", + "version": "2.1.12", "description": "Entry for offline", "main": "src/main_build/main.bundle.js", "scripts": { @@ -33,13 +33,17 @@ "@babel/core": "^7.20.7", "@electron/remote": "^2.0.8", "@entrylabs/modal": "^1.2.7", + "@ffmpeg-installer/ffmpeg": "^1.1.0", + "@ffprobe-installer/ffprobe": "^2.1.2", + "@types/fluent-ffmpeg": "^2.1.24", "async-csv": "^2.1.3", "axios": "^0.19.2", "cross-spawn": "^7.0.3", - "entry-hw": "git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.49", - "entry-js": "git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.11", + "entry-hw": "git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.50", + "entry-js": "git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.12", "entry-tool": "git+https://github.com/entrylabs/entry-tool.git#dist/20231026", "excel4node": "^1.7.0", + "fluent-ffmpeg": "^2.1.2", "fs-extra": "^8.1.0", "image-size": "^0.8.3", "jquery": "^3.4.1", diff --git a/src/main/fileUtils.ts b/src/main/fileUtils.ts index 70604f19b..9b8c2633d 100644 --- a/src/main/fileUtils.ts +++ b/src/main/fileUtils.ts @@ -5,12 +5,26 @@ import rimraf from 'rimraf'; import tar, { CreateOptions, FileOptions } from 'tar'; import { nativeImage, NativeImage } from 'electron'; import createLogger from './utils/functions/createLogger'; +import ffmpeg from 'fluent-ffmpeg'; +import ffmpegInstaller from '@ffmpeg-installer/ffmpeg' +import ffprobeInstaller from '@ffprobe-installer/ffprobe' +import get from 'lodash/get'; type tarCreateOption = FileOptions & CreateOptions; type readFileOption = { encoding?: string | null; flag?: string } | string | undefined | null; type Dimension = { width: number; height: number }; const logger = createLogger('main/fileUtils.ts'); +const ffmpegPath = ffmpegInstaller.path.replace( + 'app.asar', + 'app.asar.unpacked' +); +const ffprobePath = ffprobeInstaller.path.replace( + 'app.asar', + 'app.asar.unpacked' +); +ffmpeg.setFfmpegPath(ffmpegPath); +ffmpeg.setFfprobePath(ffprobePath); export const ImageResizeSize: { [key: string]: Dimension } = { thumbnail: { width: 96, height: 96 }, @@ -282,4 +296,44 @@ export default class { logger.info(`moveFile to ${src} to ${dest}`); fse.moveSync(src, dest, { overwrite: true }); } + + static getSoundInfo = (filePath: string, isExtCheck = true): Promise => + new Promise((resolve, reject) => { + ffmpeg.ffprobe(filePath, (err: any, probeData: any) => { + if (err) { + return reject(err); + } + const { format = {} } = probeData; + const { format_name: formatName } = format; + if (isExtCheck && formatName !== 'mp3') { + return reject(new Error('업로드 파일이 MP3 파일이 아닙니다.')); + } + resolve(probeData); + }); + }); + + static getDuration = (soundInfo: any) => { + const duration = get(soundInfo, ['format', 'duration'], 0); + return Number(duration).toFixed(1); + }; + + static convertStreamToMp3AndSave = (filePath: string, targetPath: string): Promise => { + return new Promise((resolve, reject) => { + // INFO : targetPath경로에 해당하는 디렉토리를 미리 만들어 줘야함 + this.ensureDirectoryExistence(targetPath); + ffmpeg(filePath) + .audioCodec('libmp3lame') + .toFormat('mp3') + .output(targetPath) + .on('end', () => resolve(targetPath)) + .on('error', (err: any) => { + if (err && err.message) { + console.error(`Error: ${err.message}`); + logger.error(`Error: ${err.message}`); + } + reject(err); + }) + .run(); + }); + }; } diff --git a/src/main/ipcMainHelper.ts b/src/main/ipcMainHelper.ts index 017d4548d..2d5e0c119 100644 --- a/src/main/ipcMainHelper.ts +++ b/src/main/ipcMainHelper.ts @@ -45,6 +45,7 @@ new (class { ipcMain.handle('checkPermission', this.checkPermission.bind(this)); ipcMain.handle('getOpenSourceText', () => ''); // 별다른 표기 필요없음 ipcMain.handle('isValidAsarFile', this.checkIsValidAsarFile.bind(this)); + ipcMain.handle('saveSoundBuffer', this.saveSoundBuffer.bind(this)); } async saveProject(event: IpcMainInvokeEvent, project: ObjectLike, targetPath: string) { @@ -56,8 +57,8 @@ new (class { logger.verbose(`loadProject called, ${filePath}`); try { return await MainUtils.loadProject(filePath); - } catch (e: any) { - logger.error(`loadProject failed, ${e.message}`); + } catch (e) { + logger.error('loadProject failed, ${e.message}'); throw e; } } @@ -248,6 +249,10 @@ new (class { return [global.sharedObject.version, data]; } + async saveSoundBuffer(event: IpcMainInvokeEvent, buffer: ArrayBuffer, prevFileUrl: string) { + return MainUtils.saveSoundBuffer(buffer, prevFileUrl); + } + openUrl(event: IpcMainInvokeEvent, url: string) { logger.info(`openUrl called : ${url}`); shell.openExternal(url); diff --git a/src/main/mainUtils.ts b/src/main/mainUtils.ts index f9dafecc5..88a87898c 100644 --- a/src/main/mainUtils.ts +++ b/src/main/mainUtils.ts @@ -171,10 +171,10 @@ export default class MainUtils { }); Promise.all(copyObjectPromise) - .then(function () { + .then(function() { resolve('success'); }) - .catch(function (err) { + .catch(function(err) { reject(err); }); } catch (e) { @@ -574,32 +574,46 @@ export default class MainUtils { 'src', 'preload_build', 'preload.bundle.js' - ) + ), }, - }) + }); const windowId = captureWindow.id; remoteMain.enable(captureWindow.webContents); captureWindow.loadURL( - `file:///${path.resolve(app.getAppPath(), 'src', 'main', 'views', 'capture.html')}` - ) + `file:///${path.resolve( + app.getAppPath(), + 'src', + 'main', + 'views', + 'capture.html' + )}` + ); // captureWindow의 송수신 및 라이프사이클 관련 함수 ipcMain.handle(`getImageString_${windowId}`, () => { return image; - }) + }); ipcMain.on(`captureAndSave_${windowId}`, async () => { // 렌더러에서 svg를 그리는데 다소 시간이 걸리므로 대기 후 실행 await setTimeout(async () => { - const capturedImage = await captureWindow.webContents.capturePage({ x: 0, y: 0, width, height }); - await FileUtils.writeFile(capturedImage.toPNG(), `${filePath}${index}${'.png'}`); + const capturedImage = await captureWindow.webContents.capturePage({ + x: 0, + y: 0, + width, + height, + }); + await FileUtils.writeFile( + capturedImage.toPNG(), + `${filePath}${index}${'.png'}` + ); captureWindow.close(); }, WAITING_TIME); - }) + }); captureWindow.addListener('closed', () => { ipcMain.removeAllListeners(`captureAndSave_${windowId}`); ipcMain.removeHandler(`getImageString_${windowId}`); - }) - }) + }); + }); } catch (error) { console.error(error); } @@ -827,4 +841,55 @@ export default class MainUtils { }; } } + + static saveSoundBuffer(arrayBuffer: ArrayBuffer, prevFileUrl: string) { + return new Promise(async (resolve, reject) => { + let tempBufferPath; + let saveFilePath; + try { + // 1. buffer상태로 임시 저장 + const tempBufferId = CommonUtils.createFileId(); + tempBufferPath = path.join( + Constants.tempSoundPath(tempBufferId), + `${tempBufferId}` + ); + const buffer = Buffer.from(arrayBuffer); + await FileUtils.writeFile(buffer, tempBufferPath); + + // 2. 최종저장 경로 생성 + const filename = CommonUtils.createFileId(); + const filePath = path.join(Constants.tempSoundPath(filename), `${filename}.mp3`); + + // 3. 유효성 검사 + const soundInfo = await FileUtils.getSoundInfo(tempBufferPath, false); + if (soundInfo?.format?.format_name !== 'wav') { + throw new Error('sound not supported'); + } + + // 5. buffer파일 mp3로 변환 후 저장 + saveFilePath = await FileUtils.convertStreamToMp3AndSave(tempBufferPath, filePath); + + // 6. response 작성 + const sound = { + duration: FileUtils.getDuration(soundInfo), + filename, + filePath: saveFilePath, + }; + resolve(sound); + } catch (err) { + console.error(err); + reject(err); + } finally { + try { + // INFO: 기존파일과 임시버퍼 제거, fileurl이 temp로 시작하는 경우에만 제거됨 + const prevTempPath = path.join(Constants.appPath, prevFileUrl); + saveFilePath && (await FileUtils.deleteFile(prevTempPath)); + tempBufferPath && (await FileUtils.deleteFile(tempBufferPath)); + } catch (e) { + console.error('sound file unlink fail', e); + reject(e); + } + } + }); + } } diff --git a/src/main/views/main.html b/src/main/views/main.html index 94d8ba7d9..98772f237 100644 --- a/src/main/views/main.html +++ b/src/main/views/main.html @@ -46,6 +46,9 @@ + + + diff --git a/src/renderer/components/workspace.tsx b/src/renderer/components/workspace.tsx index 66a39c679..f1b93e79d 100644 --- a/src/renderer/components/workspace.tsx +++ b/src/renderer/components/workspace.tsx @@ -24,7 +24,7 @@ import DragAndDropContainer from './DragAndDropContainer'; import EntryModalHelper from '../helper/entry/entryModalHelper'; import ipcRendererHelper from '../helper/ipcRendererHelper'; -interface IProps extends IReduxDispatch, IReduxState { } +interface IProps extends IReduxDispatch, IReduxState {} class Workspace extends Component { private lastHwName?: string; @@ -94,7 +94,7 @@ class Workspace extends Component { 'error', RendererUtils.getLang('Workspace.loading_fail_msg'), RendererUtils.getLang('Workspace.fail_contact_msg'), - { height: 190, width: 365, padding: 30 }, + { height: 190, width: 365, padding: 30 } ); await RendererUtils.clearTempProject(); @@ -120,7 +120,7 @@ class Workspace extends Component { 'progress', RendererUtils.getLang('Workspace.uploading_msg'), RendererUtils.getLang('Workspace.fail_contact_msg'), - { width: 220 }, + { width: 220 } ); const project = await readProjectFunction; await this.loadProject(project); @@ -194,6 +194,23 @@ class Workspace extends Component { ModalHelper.showPaintPopup(); }); + // INFO: 사운드에디터 관련 이벤트 + addEventListener('startLoading', (msg) => { + this.showModalProgress('loading', msg); + }); + addEventListener('endLoading', () => { + this.hideModalProgress(); + }); + addEventListener('beforeSaveSoundBuffer', () => { + this.showModalProgress('progress', RendererUtils.getLang('Workspace.saving_msg')); + }); + addEventListener( + 'saveSoundBuffer', + (buffer: any, file: any, isSelect: boolean, callback: Function) => { + this.handleSaveSoundBuffer(buffer, file, isSelect, callback); + } + ); + if (!Entry.creationChangedEvent) { Entry.creationChangedEvent = new Entry.Event(window); } @@ -206,6 +223,74 @@ class Workspace extends Component { } } + async handleSaveSoundBuffer( + buffer: ArrayBuffer, + file: any, + isSelect: boolean, + callback: Function + ) { + try { + this.showModalProgress('progress', RendererUtils.getLang('Workspace.saving_msg'), '', { + width: 220, + }); + // INFO: 용량제한 렌더링 파트에서 선작업 + if (buffer.byteLength > 30 * 1024 * 1024) { + throw new Error('413: too large buffer size'); + } + + const { duration, filename, filePath } = await ipcRendererHelper.saveSoundBuffer( + buffer, + file.fileurl + ); + + const { playground } = Entry; + const sound = { + fileurl: Constants.tempSoundPath(filename), + id: file.id, + name: file.name, + objectId: file.objectId, + ext: file.ext, + label: file.label, + type: file.type, + specials: file.specials, + path: filePath, + duration, + filename, + }; + + // eslint-disable-next-line prefer-const + let delegate: any; + const soundPlay = () => { + callback(); + const entrySound = playground.setSound(sound); + Entry.soundQueue.off('fileload', delegate); + if (isSelect) { + playground.selectSound(entrySound); + } + this.hideModalProgress(); + entrySound.objectId = file.objectId; + Entry.dispatchEvent('saveCompleteSound', entrySound); + }; + delegate = Entry.soundQueue.on('fileload', soundPlay); + Entry.soundQueue.loadFile({ + id: sound.id, + src: sound.path, + type: createjs.LoadQueue.SOUND, + }); + } catch (error) { + let message: string; + if (error instanceof Error && error.message === '413: too large buffer size') { + message = RendererUtils.getLang('Msgs.msg_err_sound_too_large'); + } else { + message = RendererUtils.getLang('Msgs.error_occured'); + } + console.log(error); + EntryModalHelper.getAlertModal(message); + } finally { + this.hideModalProgress(); + } + } + async handleCanvasImageSave(data: any) { if (this.isSavingCanvasData) { EntryModalHelper.getAlertModal(RendererUtils.getLang('Msgs.save_canvas_alert')); @@ -216,7 +301,7 @@ class Workspace extends Component { '', { width: 220, - }, + } ); this.isSavingCanvasData = true; try { @@ -326,13 +411,13 @@ class Workspace extends Component { if (hw.programConnected && hw.hwModule) { const hwName = hw.hwModule.name; if (_includes(EntryStatic.hwMiniSupportList, hwName)) { - hwCategoryList.forEach(function (categoryName: string) { + hwCategoryList.forEach(function(categoryName: string) { blockMenu.unbanCategory(categoryName); }); blockMenu.banCategory('arduino'); blockMenu.banCategory('hw_robot'); } else { - hwCategoryList.forEach(function (categoryName: string) { + hwCategoryList.forEach(function(categoryName: string) { blockMenu.banCategory(categoryName); }); blockMenu.banCategory('hw_robot'); @@ -340,7 +425,7 @@ class Workspace extends Component { } this.lastHwName = hwName; } else { - hwCategoryList.forEach(function (categoryName: string) { + hwCategoryList.forEach(function(categoryName: string) { blockMenu.banCategory(categoryName); }); blockMenu.banCategory('arduino'); @@ -363,7 +448,7 @@ class Workspace extends Component { 'progress', RendererUtils.getLang('Workspace.saving_msg'), RendererUtils.getLang('Workspace.fail_contact_msg'), - { width: 220 }, + { width: 220 } ); try { @@ -387,7 +472,7 @@ class Workspace extends Component { Entry.stateManager.addStamp(); Entry.toast.success( RendererUtils.getLang('Workspace.saved'), - `${projectName} ${RendererUtils.getLang('Workspace.saved_msg')}`, + `${projectName} ${RendererUtils.getLang('Workspace.saved_msg')}` ); } catch (err) { console.error(err); @@ -395,7 +480,7 @@ class Workspace extends Component { 'error', RendererUtils.getLang('Workspace.saving_fail_msg'), RendererUtils.getLang('Workspace.fail_contact_msg'), - { height: 190, width: 365, padding: 30 }, + { height: 190, width: 365, padding: 30 } ); } finally { this.isSaveProject = false; @@ -417,7 +502,7 @@ class Workspace extends Component { defaultPath, filters: [{ name: 'Entry File', extensions: ['ent'] }], }, - saveFunction, + saveFunction ); } LocalStorageManager.clearSavedProject(); @@ -440,7 +525,7 @@ class Workspace extends Component { }).then(({ filePaths }) => { resolve(filePaths[0]); }); - }), + }) ); } }; @@ -454,7 +539,7 @@ class Workspace extends Component { 'progress', RendererUtils.getLang('Workspace.uploading_msg'), RendererUtils.getLang('Workspace.fail_contact_msg'), - { width: 220 }, + { width: 220 } ); try { @@ -472,7 +557,7 @@ class Workspace extends Component { 'error', RendererUtils.getLang('Workspace.loading_fail_msg'), RendererUtils.getLang('Workspace.fail_contact_msg'), - { height: 190, width: 365, padding: 30 }, + { height: 190, width: 365, padding: 30 } ); } } @@ -510,6 +595,8 @@ class Workspace extends Component { Entry.disposeContainer(); // zoom 스케일이 변경된 상태에서 new project 한 경우 블록메뉴에 스케일정보가 남아서 초기화 Entry.getMainWS().setScale(1); + // INFO: 사운드에디터 인스턴스 초기화, 3월 정기배포에 변동가능성 있음 + window?.EntrySoundEditor.destroy(); } Entry.reloadBlock(); this.isFirstRender = false; @@ -617,7 +704,7 @@ class Workspace extends Component { await this._loadProjectFromFile(filePath); } else { EntryModalHelper.getAlertModal( - RendererUtils.getLang('Workspace.upload_not_supported_file_msg'), + RendererUtils.getLang('Workspace.upload_not_supported_file_msg') ); } }} diff --git a/src/renderer/helper/constants.ts b/src/renderer/helper/constants.ts index fa7a5c699..faec03fa6 100644 --- a/src/renderer/helper/constants.ts +++ b/src/renderer/helper/constants.ts @@ -1,4 +1,3 @@ - export default class { static get sep() { return window.isOsx ? '/' : '\\'; @@ -9,7 +8,9 @@ export default class { } static resourceImagePath(filename: string) { - return `..${this.sep}..${this.sep}${this.resourcePath}${this.resourceSubDirectoryPath(filename)}image${this.sep}`; + return `..${this.sep}..${this.sep}${this.resourcePath}${this.resourceSubDirectoryPath( + filename + )}image${this.sep}`; } static resourceThumbnailPath(filename: string) { @@ -17,10 +18,22 @@ export default class { } static resourceSoundPath(filename: string) { - return `..${this.sep}..${this.sep}${this.resourcePath}${this.resourceSubDirectoryPath(filename)}`; + return `..${this.sep}..${this.sep}${this.resourcePath}${this.resourceSubDirectoryPath( + filename + )}`; + } + + static tempSoundPath(filename: string) { + return `temp${this.sep}${this.tempSubDirectoryPath(filename)}sound${ + this.sep + }${filename}.mp3`; } static resourceSubDirectoryPath(filename: string) { return `${filename.substr(0, 2)}${this.sep}${filename.substr(2, 2)}${this.sep}`; } + + static tempSubDirectoryPath(filename: string) { + return `${filename.substr(0, 2)}${this.sep}${filename.substr(2, 2)}${this.sep}`; + } } diff --git a/src/renderer/helper/entry/entryUtils.ts b/src/renderer/helper/entry/entryUtils.ts index 632d2d4a5..bd5886098 100644 --- a/src/renderer/helper/entry/entryUtils.ts +++ b/src/renderer/helper/entry/entryUtils.ts @@ -20,7 +20,7 @@ export default class { let confirmProjectDismiss = true; if (!Entry.stateManager.isSaved()) { confirmProjectDismiss = await EntryModalHelper.getConfirmModal( - RendererUtils.getLang('Menus.save_dismiss'), + RendererUtils.getLang('Menus.save_dismiss') ); } @@ -63,7 +63,7 @@ export default class { try { confirm = await EntryModalHelper.getConfirmModal( RendererUtils.getLang('Workspace.confirm_load_temporary'), - RendererUtils.getLang('Workspace.confirm_load_header'), + RendererUtils.getLang('Workspace.confirm_load_header') ); if (confirm) { @@ -129,7 +129,7 @@ export default class { console.log('object exported successfully'); }); } - }, + } ); } @@ -149,95 +149,95 @@ export default class { } const { sprite } = item; - if (sprite) { - const objects = sprite.objects; - const functions = sprite.functions; - const messages = sprite.messages; - const variables = sprite.variables; - - if ( - Entry.getMainWS().mode === Entry.Workspace.MODE_VIMBOARD && - (!Entry.TextCodingUtil.canUsePythonVariables(variables) || - !Entry.TextCodingUtil.canUsePythonFunctions(functions)) - ) { - return window.EntryModal.alert(Lang.Menus.object_import_syntax_error); - } + if (sprite) { + const objects = sprite.objects; + const functions = sprite.functions; + const messages = sprite.messages; + const variables = sprite.variables; - const objectIdMap = {} as any; - variables.forEach((variable: any) => { - const { object } = variable; - if (object) { - const id = variable.id; - const idMap = objectIdMap[object]; - variable.id = Entry.generateHash(); - if (!idMap) { - variable.object = Entry.generateHash(); - objectIdMap[object] = { - objectId: variable.object, - variableOriginId: [id], - variableId: [variable.id], - }; - } else { - variable.object = idMap.objectId; - idMap.variableOriginId.push(id); - idMap.variableId.push(variable.id); - } - } - }); - Entry.variableContainer.appendMessages(messages); - Entry.variableContainer.appendVariables(variables); - Entry.variableContainer.appendFunctions(functions); + if ( + Entry.getMainWS().mode === Entry.Workspace.MODE_VIMBOARD && + (!Entry.TextCodingUtil.canUsePythonVariables(variables) || + !Entry.TextCodingUtil.canUsePythonFunctions(functions)) + ) { + return window.EntryModal.alert(Lang.Menus.object_import_syntax_error); + } - objects.forEach((object: any) => { - const idMap = objectIdMap[object.id]; - if (idMap) { - let script = object.script; - idMap.variableOriginId.forEach((id: string, idx: number) => { - const regex = new RegExp(id, 'gi'); - script = script.replace(regex, idMap.variableId[idx]); - }); - object.script = script; - object.id = idMap.objectId; - } else if (Entry.container.getObject(object.id)) { - object.id = Entry.generateHash(); - } - if (item.objectType === 'textBox') { - const text = item.text ? item.text : Lang.Blocks.TEXT; - const options = item.options; - object.objectType = 'textBox'; - Object.assign(object, { - text, - options, - name: Lang.Workspace.textbox, - }); + const objectIdMap = {} as any; + variables.forEach((variable: any) => { + const { object } = variable; + if (object) { + const id = variable.id; + const idMap = objectIdMap[object]; + variable.id = Entry.generateHash(); + if (!idMap) { + variable.object = Entry.generateHash(); + objectIdMap[object] = { + objectId: variable.object, + variableOriginId: [id], + variableId: [variable.id], + }; } else { - object.objectType = 'sprite'; - } - // TODO: 첫번째 이미지에 sprite가 추가되는 원인 코드 찾아서 제거 - if (object.sprite.pictures.length > 0) { - object.sprite.pictures.forEach((picture: any) => { - delete picture.sprite; - }); + variable.object = idMap.objectId; + idMap.variableOriginId.push(id); + idMap.variableId.push(variable.id); } - Entry.container.addObject(object, 0); - }); - } else { - if (!item.id) { - item.id = Entry.generateHash(); } + }); + Entry.variableContainer.appendMessages(messages); + Entry.variableContainer.appendVariables(variables); + Entry.variableContainer.appendFunctions(functions); - const object = { - id: Entry.generateHash(), - objectType: 'sprite', - sprite: { - name: item.name, - pictures: [item], - sounds: [], - category: {}, - }, - }; + objects.forEach((object: any) => { + const idMap = objectIdMap[object.id]; + if (idMap) { + let script = object.script; + idMap.variableOriginId.forEach((id: string, idx: number) => { + const regex = new RegExp(id, 'gi'); + script = script.replace(regex, idMap.variableId[idx]); + }); + object.script = script; + object.id = idMap.objectId; + } else if (Entry.container.getObject(object.id)) { + object.id = Entry.generateHash(); + } + if (item.objectType === 'textBox') { + const text = item.text ? item.text : Lang.Blocks.TEXT; + const options = item.options; + object.objectType = 'textBox'; + Object.assign(object, { + text, + options, + name: Lang.Workspace.textbox, + }); + } else { + object.objectType = 'sprite'; + } + // TODO: 첫번째 이미지에 sprite가 추가되는 원인 코드 찾아서 제거 + if (object.sprite.pictures.length > 0) { + object.sprite.pictures.forEach((picture: any) => { + delete picture.sprite; + }); + } Entry.container.addObject(object, 0); + }); + } else { + if (!item.id) { + item.id = Entry.generateHash(); } + + const object = { + id: Entry.generateHash(), + objectType: 'sprite', + sprite: { + name: item.name, + pictures: [item], + sounds: [], + category: {}, + }, + }; + Entry.container.addObject(object, 0); + } } static addPictureObjectToEntry(picture: IEntry.Picture) { @@ -275,7 +275,7 @@ export default class { const croppedImageData = await RendererUtils.cropImageFromCanvas(image); const imageBuffer = Uint8Array.from( atob(croppedImageData.replace(/^data:image\/(png|gif|jpeg);base64,/, '')), - (chr) => chr.charCodeAt(0), + (chr) => chr.charCodeAt(0) ); // 만약 이전 파일명이 존재하는 경우 삭제처리를 위함 @@ -325,7 +325,7 @@ export default class { const filename = entryObject.name || 'nonamed'; const extension = RendererUtils.sanitizeExtension( entryObject.ext || entryObject.extension, - defaultExtension, + defaultExtension ); return `${filename}${extension}`; diff --git a/src/renderer/helper/ipcRendererHelper.ts b/src/renderer/helper/ipcRendererHelper.ts index 2a9eeeb38..b0daca9ee 100644 --- a/src/renderer/helper/ipcRendererHelper.ts +++ b/src/renderer/helper/ipcRendererHelper.ts @@ -115,10 +115,9 @@ export default class { } static async checkUpdate() { - const [ - currentVersion, - { hasNewVersion, recentVersion: latestVersion }, - ] = await ipcInvoke<[string, { hasNewVersion: string, recentVersion: string }]>('checkUpdate'); + const [currentVersion, { hasNewVersion, recentVersion: latestVersion }] = await ipcInvoke< + [string, { hasNewVersion: string; recentVersion: string }] + >('checkUpdate'); /** latestVersion properties @property hasNewVersion{boolean} 요청을 보냈을때의 버전과 비교하여 업데이트가 필요한지 여부 @@ -127,15 +126,13 @@ export default class { @property _id{string} ex) 저장된 mongoDB 오브젝트 ID */ console.log( - `currentVersion : ${currentVersion - }\nrecentVersion: ${latestVersion - }\nneedUpdate: ${hasNewVersion - }`); + `currentVersion : ${currentVersion}\nrecentVersion: ${latestVersion}\nneedUpdate: ${hasNewVersion}` + ); const lastDontShowCheckedVersion = StorageManager.getLastDontShowVersion(); // 다시보지않음을 클릭하지 않았거나, 클릭했지만 당시보다 더 높은 버전이 나온 경우 출력 if ( latestVersion > currentVersion && - (!lastDontShowCheckedVersion || (latestVersion > lastDontShowCheckedVersion)) + (!lastDontShowCheckedVersion || latestVersion > lastDontShowCheckedVersion) ) { EntryModalHelper.showUpdateCheckModal(latestVersion); StorageManager.setLastCheckedVersion(latestVersion); @@ -152,4 +149,8 @@ export default class { static checkVideoPermission() { return window.checkPermission('camera'); } + + static saveSoundBuffer(buffer: ArrayBuffer, prevFileUrl: string) { + return ipcInvoke('saveSoundBuffer', buffer, prevFileUrl); + } } diff --git a/src/renderer/resources/lang/en.json b/src/renderer/resources/lang/en.json index 8b4d8d68c..850fea914 100644 --- a/src/renderer/resources/lang/en.json +++ b/src/renderer/resources/lang/en.json @@ -3741,7 +3741,11 @@ "create_new_table": "Create", "add_variable": "Add variable", "add_list": "Add list", - "add_message": "Add Message" + "add_message": "Add Message", + "sound_menu_trim": "Trim", + "sound_menu_adjust": "Adjust", + "sound_button_reset": "Reset", + "sound_button_save": "Save" }, "Menus": { "ask_captcha": "Please Enter the letters as seen in the Image", @@ -6295,7 +6299,7 @@ "solve_henesys_desc_1": "Venture into the town, and help PINK BEAN to have enough food!", "solve_ellinia_desc_1": "Venture into the forest, and fight against the bad monsters to save the good monsters!", "solve_elnath_desc_1": "Passing through the snow mountain occupied by bad monsters, go find another portal to start a new adventure!", - "save_modified_shape": "Do you want to save the modified shape?", + "save_modified_shape": "You have unsaved changes.\nDo you want to save?", "save_modified_table": "Do you want to save the modified table?", "attach_file": "File", "enter_discuss_title": "Please enter the title(in 40 characters or less)", @@ -6480,6 +6484,12 @@ "ai_utilize_face_landmarker_description": "It is a collection of blocks that detect human faces using camera.", "ai_utilize_object_detector_description": "It is a collection of blocks that detect objects using camera.", "ai_utilize_gesture_recognition_description": "It is a collection of blocks that detect human hands using camera.", + "sound_empty1": "Click [Add Sound] to add sound.", + "sound_empty2": "How to add sound", + "sound_empty3": "1. On the 'Select sound' tab, select the default sound provided by the Entry.", + "sound_empty4": "2. On the 'Upload files' tab, upload the MP3 file directly.", + "sound_empty5": "You can cut only the parts you need in the 'Trim' mode, or adjust the volume, speed and pitch in the 'Adjust' mode.", + "sound_loading": "Loading sound", "lecture_header_restart_msg": "Do you want to restart from the beginning?", "ai_utilize_train_pop_error": "The model applied to the project has been deactivated or deleted." }, @@ -6635,6 +6645,12 @@ "face_landmarker_title_text": "Face Detection", "object_detector_title_text": "Object detection", "gesture_recognition_title_text": "Hand detection", + "sound_start_point": "Start point", + "sound_end_point": "End point", + "sound_selection": "Selection", + "sound_volume": "Volume", + "sound_speed": "Speed", + "sound_pitch": "Pitch", "no_message_to_remove": "There is no message to remove.", "no_use": "Not assembled on object.", "no_variable_to_rename": "There is no varibale to remove", diff --git a/src/renderer/resources/lang/ko.json b/src/renderer/resources/lang/ko.json index 463963fe8..0e44b7bd2 100644 --- a/src/renderer/resources/lang/ko.json +++ b/src/renderer/resources/lang/ko.json @@ -1344,6 +1344,10 @@ "create_new_table": "테이블 새로 만들기", "add_variable": "변수 추가", "add_message": "신호 추가", + "sound_menu_trim": "다듬기", + "sound_menu_adjust": "조정하기", + "sound_button_reset": "원래대로", + "sound_button_save": "저장하기", "add_list": "리스트 추가", "duplication": "복사하기", "share_policy": "이것만은 꼭!", @@ -1476,7 +1480,7 @@ "lecture_finish_popup_content_2": "* 다시 실습해도 실습 완료 상태는 유지됩니다.", "in_progress2": "학습중", "completed": "완료", - "save_modified_shape": "수정된 내용을 저장하시겠습니까?", + "save_modified_shape": "저장하지 않은 변경 사항이 있습니다.\n변경 사항을 저장할까요?", "save_as_image": "이미지로 저장하기", "function": "함수", "lecture_build_tab_attribute": "속성", @@ -1563,6 +1567,12 @@ "ai_utilize_face_landmarker_description": "카메라를 이용하여 얼굴을 인식하는 블록들의 모음입니다.", "ai_utilize_object_detector_description": "카메라를 이용하여 사물을 인식하는 블록들의 모음입니다.", "ai_utilize_gesture_recognition_description": "카메라를 이용하여 손을 인식하는 블록들의 모음입니다.", + "sound_empty1": "[소리 추가하기]를 눌러 소리를 추가해 주세요.", + "sound_empty2": "소리를 추가하는 방법", + "sound_empty3": "1. '소리 선택' 탭에서 엔트리가 제공하는 기본 소리를 선택합니다.", + "sound_empty4": "2. '파일 올리기' 탭에서 MP3 파일을 직접 업로드합니다.", + "sound_empty5": "추가한 소리는 '다듬기'에서 필요한 부분만 자르거나, '조정하기'에서 크기와 빠르기 등을 조정할 수 있습니다.", + "sound_loading": "소리를 불러오고 있어요", "version_update_msg1": "엔트리 오프라인 새 버전(%1)을\n사용하실 수 있습니다.", "version_update_msg2": "엔트리 하드웨어 새 버전(%1)을\n사용하실 수 있습니다.", "version_update_msg3": "지금 업데이트 하시겠습니까?", @@ -1638,6 +1648,12 @@ "face_landmarker_title_text": "얼굴 인식", "object_detector_title_text": "사물 인식", "gesture_recognition_title_text": "손 인식", + "sound_start_point": "시작 지점", + "sound_end_point": "끝 지점", + "sound_selection": "남길 영역", + "sound_volume": "크기", + "sound_speed": "빠르기", + "sound_pitch": "음높이", "SelectShape": "이동", "SelectCut": "자르기", "Pencil": "펜", diff --git a/src/renderer/resources/vendor/react18/react-dom.production.min.js b/src/renderer/resources/vendor/react18/react-dom.production.min.js new file mode 100644 index 000000000..e8a0213d7 --- /dev/null +++ b/src/renderer/resources/vendor/react18/react-dom.production.min.js @@ -0,0 +1,267 @@ +/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +(function(){/* + Modernizr 3.0.0pre (Custom Build) | MIT +*/ +'use strict';(function(Q,mb){"object"===typeof exports&&"undefined"!==typeof module?mb(exports,require("react")):"function"===typeof define&&define.amd?define(["exports","react"],mb):(Q=Q||self,mb(Q.ReactDOM={},Q.React))})(this,function(Q,mb){function n(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;cb}return!1}function Y(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}function $d(a,b,c,d){var e=R.hasOwnProperty(b)?R[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k="\n"+e[g].replace(" at new "," at ");a.displayName&&k.includes("")&&(k=k.replace("",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{ce=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?bc(a): +""}function gj(a){switch(a.tag){case 5:return bc(a.type);case 16:return bc("Lazy");case 13:return bc("Suspense");case 19:return bc("SuspenseList");case 0:case 2:case 15:return a=be(a.type,!1),a;case 11:return a=be(a.type.render,!1),a;case 1:return a=be(a.type,!0),a;default:return""}}function de(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case Bb:return"Fragment";case Cb:return"Portal";case ee:return"Profiler";case fe:return"StrictMode"; +case ge:return"Suspense";case he:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case gg:return(a.displayName||"Context")+".Consumer";case hg:return(a._context.displayName||"Context")+".Provider";case ie:var b=a.render;a=a.displayName;a||(a=b.displayName||b.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case je:return b=a.displayName||null,null!==b?b:de(a.type)||"Memo";case Ta:b=a._payload;a=a._init;try{return de(a(b))}catch(c){}}return null}function hj(a){var b=a.type; +switch(a.tag){case 24:return"Cache";case 9:return(b.displayName||"Context")+".Consumer";case 10:return(b._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=b.render,a=a.displayName||a.name||"",b.displayName||(""!==a?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return b;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(b);case 8:return b===fe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler"; +case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof b)return b.displayName||b.name||null;if("string"===typeof b)return b}return null}function Ua(a){switch(typeof a){case "boolean":case "number":case "string":case "undefined":return a;case "object":return a;default:return""}}function ig(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"=== +b)}function ij(a){var b=ig(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker= +null;delete a[b]}}}}function Pc(a){a._valueTracker||(a._valueTracker=ij(a))}function jg(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=ig(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Qc(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function ke(a,b){var c=b.checked;return E({},b,{defaultChecked:void 0,defaultValue:void 0, +value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function kg(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Ua(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function lg(a,b){b=b.checked;null!=b&&$d(a,"checked",b,!1)}function le(a,b){lg(a,b);var c=Ua(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!= +c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?me(a,b.type,c):b.hasOwnProperty("defaultValue")&&me(a,b.type,Ua(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}function mg(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue; +c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}function me(a,b,c){if("number"!==b||Qc(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}function Db(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e>>=0;return 0===a?32:31-(rj(a)/sj|0)|0}function hc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a& +4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Vc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=hc(h):(f&=g,0!==f&&(d=hc(f)))}else g=c&~e,0!==g?d=hc(g):0!==f&&(d=hc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&& +(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a); +return b}function ic(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-ta(b);a[b]=c}function vj(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=$g(c)}}function bh(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?bh(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function ch(){for(var a=window,b=Qc();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break; +b=Qc(a.document)}return b}function Ie(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}function Uj(a){var b=ch(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&bh(c.ownerDocument.documentElement,c)){if(null!==d&&Ie(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length); +else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=ah(c,f);var g=ah(c,d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset), +a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;cMb||(a.current=Se[Mb],Se[Mb]=null,Mb--)} +function y(a,b,c){Mb++;Se[Mb]=a.current;a.current=b}function Nb(a,b){var c=a.type.contextTypes;if(!c)return cb;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function ea(a){a=a.childContextTypes;return null!==a&&void 0!==a}function th(a,b,c){if(J.current!==cb)throw Error(n(168)); +y(J,b);y(S,c)}function uh(a,b,c){var d=a.stateNode;b=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(n(108,hj(a)||"Unknown",e));return E({},c,d)}function ld(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||cb;qb=J.current;y(J,a);y(S,S.current);return!0}function vh(a,b,c){var d=a.stateNode;if(!d)throw Error(n(169));c?(a=uh(a,b,qb),d.__reactInternalMemoizedMergedChildContext=a,w(S),w(J),y(J,a)):w(S); +y(S,c)}function wh(a){null===La?La=[a]:La.push(a)}function kk(a){md=!0;wh(a)}function db(){if(!Te&&null!==La){Te=!0;var a=0,b=z;try{var c=La;for(z=1;a>=g;e-=g;Ma=1<<32-ta(b)+e|c<q?(v=l,l=null):v=l.sibling;var A=r(e,l,h[q],k);if(null===A){null===l&&(l=v);break}a&&l&&null===A.alternate&&b(e,l);g=f(A,g,q);null===m?n=A:m.sibling=A;m=A;l=v}if(q===h.length)return c(e,l),D&&rb(e,q),n;if(null===l){for(;qv?(A=q,q=null):A=q.sibling;var x=r(e,q,t.value,k);if(null===x){null===q&&(q=A);break}a&&q&&null===x.alternate&&b(e,q);g=f(x,g,v);null===l?m=x:l.sibling=x;l=x;q=A}if(t.done)return c(e,q),D&&rb(e,v),m; +if(null===q){for(;!t.done;v++,t=h.next())t=u(e,t.value,k),null!==t&&(g=f(t,g,v),null===l?m=t:l.sibling=t,l=t);D&&rb(e,v);return m}for(q=d(e,q);!t.done;v++,t=h.next())t=p(q,e,v,t.value,k),null!==t&&(a&&null!==t.alternate&&q.delete(null===t.key?v:t.key),g=f(t,g,v),null===l?m=t:l.sibling=t,l=t);a&&q.forEach(function(a){return b(e,a)});D&&rb(e,v);return m}function w(a,d,f,h){"object"===typeof f&&null!==f&&f.type===Bb&&null===f.key&&(f=f.props.children);if("object"===typeof f&&null!==f){switch(f.$$typeof){case xd:a:{for(var k= +f.key,m=d;null!==m;){if(m.key===k){k=f.type;if(k===Bb){if(7===m.tag){c(a,m.sibling);d=e(m,f.props.children);d.return=a;a=d;break a}}else if(m.elementType===k||"object"===typeof k&&null!==k&&k.$$typeof===Ta&&Kh(k)===m.type){c(a,m.sibling);d=e(m,f.props);d.ref=vc(a,m,f);d.return=a;a=d;break a}c(a,m);break}else b(a,m);m=m.sibling}f.type===Bb?(d=ub(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=wd(f.type,f.key,f.props,null,a.mode,h),h.ref=vc(a,d,f),h.return=a,a=h)}return g(a);case Cb:a:{for(m=f.key;null!== +d;){if(d.key===m)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=hf(f,a.mode,h);d.return=a;a=d}return g(a);case Ta:return m=f._init,w(a,d,m(f._payload),h)}if(cc(f))return x(a,d,f,h);if(ac(f))return F(a,d,f,h);vd(a,f)}return"string"===typeof f&&""!==f||"number"===typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d): +(c(a,d),d=gf(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return w}function vb(a){if(a===wc)throw Error(n(174));return a}function jf(a,b){y(xc,b);y(yc,a);y(Ea,wc);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:oe(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=oe(b,a)}w(Ea);y(Ea,b)}function Tb(a){w(Ea);w(yc);w(xc)}function Mh(a){vb(xc.current);var b=vb(Ea.current);var c=oe(b,a.type);b!==c&&(y(yc,a),y(Ea,c))}function kf(a){yc.current===a&& +(w(Ea),w(yc))}function yd(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}function lf(){for(var a=0;ac?c:4;a(!0);var d=uf.transition;uf.transition={};try{a(!1),b()}finally{z=c,uf.transition=d}}function di(){return sa().memoizedState}function rk(a,b, +c){var d=hb(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(ei(a))fi(b,c);else if(c=Ch(a,b,c,d),null!==c){var e=Z();ya(c,a,d,e);gi(c,b,d)}}function pk(a,b,c){var d=hb(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(ei(a))fi(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(ua(h,g)){var k=b.interleaved;null===k?(e.next=e,cf(b)): +(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(m){}finally{}c=Ch(a,b,e,d);null!==c&&(e=Z(),ya(c,a,d,e),gi(c,b,d))}}function ei(a){var b=a.alternate;return a===C||null!==b&&b===C}function fi(a,b){zc=Bd=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function gi(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;xe(a,c)}}function Ub(a,b){try{var c="",d=b;do c+=gj(d),d=d.return;while(d);var e=c}catch(f){e="\nError generating stack: "+f.message+ +"\n"+f.stack}return{value:a,source:b,stack:e,digest:null}}function vf(a,b,c){return{value:a,source:null,stack:null!=c?c:null,digest:null!=b?b:null}}function wf(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}function hi(a,b,c){c=Pa(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Ed||(Ed=!0,xf=d);wf(a,b)};return c}function ii(a,b,c){c=Pa(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){return d(e)}; +c.callback=function(){wf(a,b)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){wf(a,b);"function"!==typeof d&&(null===ib?ib=new Set([this]):ib.add(this));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})});return c}function ji(a,b,c){var d=a.pingCache;if(null===d){d=a.pingCache=new sk;var e=new Set;d.set(b,e)}else e=d.get(b),void 0===e&&(e=new Set,d.set(b,e));e.has(c)||(e.add(c),a=tk.bind(null,a,b,c),b.then(a,a))}function ki(a){do{var b; +if(b=13===a.tag)b=a.memoizedState,b=null!==b?null!==b.dehydrated?!0:!1:!0;if(b)return a;a=a.return}while(null!==a);return null}function li(a,b,c,d,e){if(0===(a.mode&1))return a===b?a.flags|=65536:(a.flags|=128,c.flags|=131072,c.flags&=-52805,1===c.tag&&(null===c.alternate?c.tag=17:(b=Pa(-1,1),b.tag=2,eb(c,b,1))),c.lanes|=1),a;a.flags|=65536;a.lanes=e;return a}function aa(a,b,c,d){b.child=null===a?mi(b,null,c,d):Vb(b,a.child,c,d)}function ni(a,b,c,d,e){c=c.render;var f=b.ref;Sb(b,e);d=of(a,b,c,d,f, +e);c=pf();if(null!==a&&!ha)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Qa(a,b,e);D&&c&&Ue(b);b.flags|=1;aa(a,b,d,e);return b.child}function oi(a,b,c,d,e){if(null===a){var f=c.type;if("function"===typeof f&&!yf(f)&&void 0===f.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=f,pi(a,b,f,d,e);a=wd(c.type,null,d,b,b.mode,e);a.ref=b.ref;a.return=b;return b.child=a}f=a.child;if(0===(a.lanes&e)){var g=f.memoizedProps;c=c.compare;c=null!==c?c:qc;if(c(g,d)&&a.ref=== +b.ref)return Qa(a,b,e)}b.flags|=1;a=gb(f,d);a.ref=b.ref;a.return=b;return b.child=a}function pi(a,b,c,d,e){if(null!==a){var f=a.memoizedProps;if(qc(f,d)&&a.ref===b.ref)if(ha=!1,b.pendingProps=d=f,0!==(a.lanes&e))0!==(a.flags&131072)&&(ha=!0);else return b.lanes=a.lanes,Qa(a,b,e)}return zf(a,b,c,d,e)}function qi(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if("hidden"===d.mode)if(0===(b.mode&1))b.memoizedState={baseLanes:0,cachePool:null,transitions:null},y(Ga,ba),ba|=c; +else{if(0===(c&1073741824))return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a,cachePool:null,transitions:null},b.updateQueue=null,y(Ga,ba),ba|=a,null;b.memoizedState={baseLanes:0,cachePool:null,transitions:null};d=null!==f?f.baseLanes:c;y(Ga,ba);ba|=d}else null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,y(Ga,ba),ba|=d;aa(a,b,e,c);return b.child}function ri(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=512,b.flags|=2097152}function zf(a, +b,c,d,e){var f=ea(c)?qb:J.current;f=Nb(b,f);Sb(b,e);c=of(a,b,c,d,f,e);d=pf();if(null!==a&&!ha)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Qa(a,b,e);D&&d&&Ue(b);b.flags|=1;aa(a,b,c,e);return b.child}function si(a,b,c,d,e){if(ea(c)){var f=!0;ld(b)}else f=!1;Sb(b,e);if(null===b.stateNode)Fd(a,b),Hh(b,c,d),ff(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,m=c.contextType;"object"===typeof m&&null!==m?m=qa(m):(m=ea(c)?qb:J.current,m=Nb(b, +m));var l=c.getDerivedStateFromProps,n="function"===typeof l||"function"===typeof g.getSnapshotBeforeUpdate;n||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==d||k!==m)&&Ih(b,g,d,m);fb=!1;var r=b.memoizedState;g.state=r;td(b,d,g,e);k=b.memoizedState;h!==d||r!==k||S.current||fb?("function"===typeof l&&(ef(b,c,l,d),k=b.memoizedState),(h=fb||Gh(b,c,h,d,r,k,m))?(n||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount|| +("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.flags|=4194308)):("function"===typeof g.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=m,d=h):("function"===typeof g.componentDidMount&&(b.flags|=4194308),d=!1)}else{g=b.stateNode;Dh(a,b);h=b.memoizedProps;m=b.type===b.elementType?h:xa(b.type,h);g.props= +m;n=b.pendingProps;r=g.context;k=c.contextType;"object"===typeof k&&null!==k?k=qa(k):(k=ea(c)?qb:J.current,k=Nb(b,k));var p=c.getDerivedStateFromProps;(l="function"===typeof p||"function"===typeof g.getSnapshotBeforeUpdate)||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==n||r!==k)&&Ih(b,g,d,k);fb=!1;r=b.memoizedState;g.state=r;td(b,d,g,e);var x=b.memoizedState;h!==n||r!==x||S.current||fb?("function"===typeof p&&(ef(b,c,p,d),x=b.memoizedState), +(m=fb||Gh(b,c,m,d,r,x,k)||!1)?(l||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,x,k),"function"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,x,k)),"function"===typeof g.componentDidUpdate&&(b.flags|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=1024)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|= +4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=x),g.props=d,g.state=x,g.context=k,d=m):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),d=!1)}return Af(a,b,c,d,f,e)}function Af(a,b,c,d,e,f){ri(a,b);var g=0!==(b.flags&128);if(!d&&!g)return e&&vh(b,c,!1), +Qa(a,b,f);d=b.stateNode;uk.current=b;var h=g&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=Vb(b,a.child,null,f),b.child=Vb(b,null,h,f)):aa(a,b,h,f);b.memoizedState=d.state;e&&vh(b,c,!0);return b.child}function ti(a){var b=a.stateNode;b.pendingContext?th(a,b.pendingContext,b.pendingContext!==b.context):b.context&&th(a,b.context,!1);jf(a,b.containerInfo)}function ui(a,b,c,d,e){Qb();Ye(e);b.flags|=256;aa(a,b,c,d);return b.child}function Bf(a){return{baseLanes:a, +cachePool:null,transitions:null}}function vi(a,b,c){var d=b.pendingProps,e=G.current,f=!1,g=0!==(b.flags&128),h;(h=g)||(h=null!==a&&null===a.memoizedState?!1:0!==(e&2));if(h)f=!0,b.flags&=-129;else if(null===a||null!==a.memoizedState)e|=1;y(G,e&1);if(null===a){Xe(b);a=b.memoizedState;if(null!==a&&(a=a.dehydrated,null!==a))return 0===(b.mode&1)?b.lanes=1:"$!"===a.data?b.lanes=8:b.lanes=1073741824,null;g=d.children;a=d.fallback;return f?(d=b.mode,f=b.child,g={mode:"hidden",children:g},0===(d&1)&&null!== +f?(f.childLanes=0,f.pendingProps=g):f=Gd(g,d,0,null),a=ub(a,d,c,null),f.return=b,a.return=b,f.sibling=a,b.child=f,b.child.memoizedState=Bf(c),b.memoizedState=Cf,a):Df(b,g)}e=a.memoizedState;if(null!==e&&(h=e.dehydrated,null!==h))return vk(a,b,g,d,h,e,c);if(f){f=d.fallback;g=b.mode;e=a.child;h=e.sibling;var k={mode:"hidden",children:d.children};0===(g&1)&&b.child!==e?(d=b.child,d.childLanes=0,d.pendingProps=k,b.deletions=null):(d=gb(e,k),d.subtreeFlags=e.subtreeFlags&14680064);null!==h?f=gb(h,f):(f= +ub(f,g,c,null),f.flags|=2);f.return=b;d.return=b;d.sibling=f;b.child=d;d=f;f=b.child;g=a.child.memoizedState;g=null===g?Bf(c):{baseLanes:g.baseLanes|c,cachePool:null,transitions:g.transitions};f.memoizedState=g;f.childLanes=a.childLanes&~c;b.memoizedState=Cf;return d}f=a.child;a=f.sibling;d=gb(f,{mode:"visible",children:d.children});0===(b.mode&1)&&(d.lanes=c);d.return=b;d.sibling=null;null!==a&&(c=b.deletions,null===c?(b.deletions=[a],b.flags|=16):c.push(a));b.child=d;b.memoizedState=null;return d} +function Df(a,b,c){b=Gd({mode:"visible",children:b},a.mode,0,null);b.return=a;return a.child=b}function Hd(a,b,c,d){null!==d&&Ye(d);Vb(b,a.child,null,c);a=Df(b,b.pendingProps.children);a.flags|=2;b.memoizedState=null;return a}function vk(a,b,c,d,e,f,g){if(c){if(b.flags&256)return b.flags&=-257,d=vf(Error(n(422))),Hd(a,b,g,d);if(null!==b.memoizedState)return b.child=a.child,b.flags|=128,null;f=d.fallback;e=b.mode;d=Gd({mode:"visible",children:d.children},e,0,null);f=ub(f,e,g,null);f.flags|=2;d.return= +b;f.return=b;d.sibling=f;b.child=d;0!==(b.mode&1)&&Vb(b,a.child,null,g);b.child.memoizedState=Bf(g);b.memoizedState=Cf;return f}if(0===(b.mode&1))return Hd(a,b,g,null);if("$!"===e.data){d=e.nextSibling&&e.nextSibling.dataset;if(d)var h=d.dgst;d=h;f=Error(n(419));d=vf(f,d,void 0);return Hd(a,b,g,d)}h=0!==(g&a.childLanes);if(ha||h){d=O;if(null!==d){switch(g&-g){case 4:e=2;break;case 16:e=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:e= +32;break;case 536870912:e=268435456;break;default:e=0}e=0!==(e&(d.suspendedLanes|g))?0:e;0!==e&&e!==f.retryLane&&(f.retryLane=e,Oa(a,e),ya(d,a,e,-1))}Ef();d=vf(Error(n(421)));return Hd(a,b,g,d)}if("$?"===e.data)return b.flags|=128,b.child=a.child,b=wk.bind(null,a),e._reactRetry=b,null;a=f.treeContext;fa=Ka(e.nextSibling);la=b;D=!0;wa=null;null!==a&&(na[oa++]=Ma,na[oa++]=Na,na[oa++]=sb,Ma=a.id,Na=a.overflow,sb=b);b=Df(b,d.children);b.flags|=4096;return b}function wi(a,b,c){a.lanes|=b;var d=a.alternate; +null!==d&&(d.lanes|=b);bf(a.return,b,c)}function Ff(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.renderingStartTime=0,f.last=d,f.tail=c,f.tailMode=e)}function xi(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;aa(a,b,d.children,c);d=G.current;if(0!==(d&2))d=d&1|2,b.flags|=128;else{if(null!==a&&0!==(a.flags&128))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&& +wi(a,c,b);else if(19===a.tag)wi(a,c,b);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}y(G,d);if(0===(b.mode&1))b.memoizedState=null;else switch(e){case "forwards":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===yd(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);Ff(b,!1,e,c,f);break;case "backwards":c= +null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===yd(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}Ff(b,!0,c,null,f);break;case "together":Ff(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child}function Fd(a,b){0===(b.mode&1)&&null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2)}function Qa(a,b,c){null!==a&&(b.dependencies=a.dependencies);ra|=b.lanes;if(0===(c&b.childLanes))return null;if(null!==a&&b.child!==a.child)throw Error(n(153));if(null!== +b.child){a=b.child;c=gb(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=gb(a,a.pendingProps),c.return=b;c.sibling=null}return b.child}function xk(a,b,c){switch(b.tag){case 3:ti(b);Qb();break;case 5:Mh(b);break;case 1:ea(b.type)&&ld(b);break;case 4:jf(b,b.stateNode.containerInfo);break;case 10:var d=b.type._context,e=b.memoizedProps.value;y(rd,d._currentValue);d._currentValue=e;break;case 13:d=b.memoizedState;if(null!==d){if(null!==d.dehydrated)return y(G,G.current& +1),b.flags|=128,null;if(0!==(c&b.child.childLanes))return vi(a,b,c);y(G,G.current&1);a=Qa(a,b,c);return null!==a?a.sibling:null}y(G,G.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&128)){if(d)return xi(a,b,c);b.flags|=128}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);y(G,G.current);if(d)break;else return null;case 22:case 23:return b.lanes=0,qi(a,b,c)}return Qa(a,b,c)}function Dc(a,b){if(!D)switch(a.tailMode){case "hidden":b=a.tail;for(var c=null;null!== +b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case "collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}function W(a){var b=null!==a.alternate&&a.alternate.child===a.child,c=0,d=0;if(b)for(var e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags&14680064,d|=e.flags&14680064,e.return=a,e=e.sibling;else for(e=a.child;null!==e;)c|=e.lanes|e.childLanes, +d|=e.subtreeFlags,d|=e.flags,e.return=a,e=e.sibling;a.subtreeFlags|=d;a.childLanes=c;return b}function yk(a,b,c){var d=b.pendingProps;Ve(b);switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return W(b),null;case 1:return ea(b.type)&&(w(S),w(J)),W(b),null;case 3:d=b.stateNode;Tb();w(S);w(J);lf();d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)pd(b)?b.flags|=4:null===a||a.memoizedState.isDehydrated&&0===(b.flags& +256)||(b.flags|=1024,null!==wa&&(Gf(wa),wa=null));yi(a,b);W(b);return null;case 5:kf(b);var e=vb(xc.current);c=b.type;if(null!==a&&null!=b.stateNode)zk(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=512,b.flags|=2097152);else{if(!d){if(null===b.stateNode)throw Error(n(166));W(b);return null}a=vb(Ea.current);if(pd(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[Da]=b;d[uc]=f;a=0!==(b.mode&1);switch(c){case "dialog":B("cancel",d);B("close",d);break;case "iframe":case "object":case "embed":B("load",d);break; +case "video":case "audio":for(e=0;e\x3c/script>",a=a.removeChild(a.firstChild)):"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Da]=b;a[uc]=d;Ak(a,b,!1,!1);b.stateNode=a;a:{g=qe(c,d);switch(c){case "dialog":B("cancel",a);B("close",a);e=d;break;case "iframe":case "object":case "embed":B("load",a);e=d;break; +case "video":case "audio":for(e=0;eHf&&(b.flags|=128,d=!0,Dc(f,!1),b.lanes=4194304)}else{if(!d)if(a=yd(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Dc(f,!0),null===f.tail&&"hidden"===f.tailMode&&!g.alternate&&!D)return W(b),null}else 2*P()-f.renderingStartTime>Hf&&1073741824!==c&&(b.flags|= +128,d=!0,Dc(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=b,f.tail=b.sibling,f.renderingStartTime=P(),b.sibling=null,c=G.current,y(G,d?c&1|2:c&1),b;W(b);return null;case 22:case 23:return ba=Ga.current,w(Ga),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(ba&1073741824)&&(W(b),b.subtreeFlags&6&&(b.flags|=8192)):W(b),null;case 24:return null; +case 25:return null}throw Error(n(156,b.tag));}function Ck(a,b,c){Ve(b);switch(b.tag){case 1:return ea(b.type)&&(w(S),w(J)),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Tb(),w(S),w(J),lf(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return kf(b),null;case 13:w(G);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(n(340));Qb()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return w(G),null;case 4:return Tb(), +null;case 10:return af(b.type._context),null;case 22:case 23:return ba=Ga.current,w(Ga),null;case 24:return null;default:return null}}function Wb(a,b){var c=a.ref;if(null!==c)if("function"===typeof c)try{c(null)}catch(d){H(a,b,d)}else c.current=null}function If(a,b,c){try{c()}catch(d){H(a,b,d)}}function Dk(a,b){Jf=Zc;a=ch();if(Ie(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection(); +if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(M){c=null;break a}var g=0,h=-1,k=-1,m=0,t=0,u=a,r=null;b:for(;;){for(var p;;){u!==c||0!==e&&3!==u.nodeType||(h=g+e);u!==f||0!==d&&3!==u.nodeType||(k=g+d);3===u.nodeType&&(g+=u.nodeValue.length);if(null===(p=u.firstChild))break;r=u;u=p}for(;;){if(u===a)break b;r===c&&++m===e&&(h=g);r===f&&++t===d&&(k=g);if(null!==(p=u.nextSibling))break;u=r;r=u.parentNode}u=p}c=-1===h||-1===k?null: +{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Kf={focusedElem:a,selectionRange:c};Zc=!1;for(l=b;null!==l;)if(b=l,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,l=a;else for(;null!==l;){b=l;try{var x=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;case 1:if(null!==x){var w=x.memoizedProps,z=x.memoizedState,A=b.stateNode,v=A.getSnapshotBeforeUpdate(b.elementType===b.type?w:xa(b.type,w),z);A.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var q= +b.stateNode.containerInfo;1===q.nodeType?q.textContent="":9===q.nodeType&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163));}}catch(M){H(b,b.return,M)}a=b.sibling;if(null!==a){a.return=b.return;l=a;break}l=b.return}x=Ai;Ai=!1;return x}function Gc(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&If(b,c,f)}e=e.next}while(e!==d)}} +function Id(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Lf(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}"function"===typeof b?b(a):b.current=a}}function Bi(a){var b=a.alternate;null!==b&&(a.alternate=null,Bi(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Da],delete b[uc],delete b[Me],delete b[Ek], +delete b[Fk]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Ci(a){return 5===a.tag||3===a.tag||4===a.tag}function Di(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Ci(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags& +2))return a.stateNode}}function Mf(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=kd));else if(4!==d&&(a=a.child,null!==a))for(Mf(a,b,c),a=a.sibling;null!==a;)Mf(a,b,c),a=a.sibling}function Nf(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a); +else if(4!==d&&(a=a.child,null!==a))for(Nf(a,b,c),a=a.sibling;null!==a;)Nf(a,b,c),a=a.sibling}function jb(a,b,c){for(c=c.child;null!==c;)Ei(a,b,c),c=c.sibling}function Ei(a,b,c){if(Ca&&"function"===typeof Ca.onCommitFiberUnmount)try{Ca.onCommitFiberUnmount(Uc,c)}catch(h){}switch(c.tag){case 5:X||Wb(c,b);case 6:var d=T,e=za;T=null;jb(a,b,c);T=d;za=e;null!==T&&(za?(a=T,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):T.removeChild(c.stateNode));break;case 18:null!==T&&(za? +(a=T,c=c.stateNode,8===a.nodeType?Re(a.parentNode,c):1===a.nodeType&&Re(a,c),nc(a)):Re(T,c.stateNode));break;case 4:d=T;e=za;T=c.stateNode.containerInfo;za=!0;jb(a,b,c);T=d;za=e;break;case 0:case 11:case 14:case 15:if(!X&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?If(c,b,g):0!==(f&4)&&If(c,b,g));e=e.next}while(e!==d)}jb(a,b,c);break;case 1:if(!X&&(Wb(c,b),d=c.stateNode,"function"===typeof d.componentWillUnmount))try{d.props= +c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){H(c,b,h)}jb(a,b,c);break;case 21:jb(a,b,c);break;case 22:c.mode&1?(X=(d=X)||null!==c.memoizedState,jb(a,b,c),X=d):jb(a,b,c);break;default:jb(a,b,c)}}function Fi(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Gk);b.forEach(function(b){var d=Hk.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}function Aa(a,b,c){c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=P()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*Nk(d/1960))-d;if(10a?16:a;if(null===lb)var d=!1;else{a=lb;lb=null;Qd=0;if(0!==(p&6))throw Error(n(331));var e=p;p|=4;for(l=a.current;null!==l;){var f=l,g=f.child;if(0!==(l.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kP()-Of?xb(a,0):Sf|=c);ia(a,b)}function Ui(a,b){0===b&&(0===(a.mode&1)?b=1:(b=Rd,Rd<<=1,0===(Rd&130023424)&&(Rd=4194304)));var c=Z();a=Oa(a,b);null!==a&&(ic(a,b,c),ia(a,c))}function wk(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Ui(a,c)}function Hk(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane); +break;case 19:d=a.stateNode;break;default:throw Error(n(314));}null!==d&&d.delete(b);Ui(a,c)}function Ni(a,b){return xh(a,b)}function Uk(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function yf(a){a= +a.prototype;return!(!a||!a.isReactComponent)}function Vk(a){if("function"===typeof a)return yf(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===ie)return 11;if(a===je)return 14}return 2}function gb(a,b){var c=a.alternate;null===c?(c=pa(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child= +a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}function wd(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)yf(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case Bb:return ub(c.children,e,f,b);case fe:g=8;e|=8;break;case ee:return a=pa(12,c,b,e|2),a.elementType=ee,a.lanes=f,a;case ge:return a= +pa(13,c,b,e),a.elementType=ge,a.lanes=f,a;case he:return a=pa(19,c,b,e),a.elementType=he,a.lanes=f,a;case Vi:return Gd(c,e,f,b);default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case hg:g=10;break a;case gg:g=9;break a;case ie:g=11;break a;case je:g=14;break a;case Ta:g=16;d=null;break a}throw Error(n(130,null==a?a:typeof a,""));}b=pa(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function ub(a,b,c,d){a=pa(7,a,d,b);a.lanes=c;return a}function Gd(a,b,c,d){a=pa(22,a,d,b);a.elementType= +Vi;a.lanes=c;a.stateNode={isHidden:!1};return a}function gf(a,b,c){a=pa(6,a,null,b);a.lanes=c;return a}function hf(a,b,c){b=pa(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function Wk(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority= +0;this.eventTimes=we(0);this.expirationTimes=we(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=we(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=null}function Vf(a,b,c,d,e,f,g,h,k,m){a=new Wk(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=pa(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null, +pendingSuspenseBoundaries:null};df(f);return a}function Xk(a,b,c){var d=3