{"version":3,"file":"editor-c7EFz7o3.js","sources":["../../../resources/js/editor.js"],"sourcesContent":["import _ from 'lodash';\nimport * as ace from 'ace-builds';\nimport themeXCodeUrl from 'ace-builds/src-noconflict/theme-xcode.js?url';\nimport monokaiCodeUrl from 'ace-builds/src-noconflict/theme-monokai.js?url';\nimport modePythonUrl from 'ace-builds/src-noconflict/mode-python?url';\nimport modeC_cppUrl from 'ace-builds/src-noconflict/mode-c_cpp?url';\n\nace.config.setModuleUrl('ace/mode/c_cpp', modeC_cppUrl);\nace.config.setModuleUrl('ace/mode/python', modePythonUrl);\nace.config.setModuleUrl('ace/theme/xcode', themeXCodeUrl);\nace.config.setModuleUrl('ace/theme/monokai', monokaiCodeUrl);\n\nconst modes = {\n py: 'ace/mode/python',\n cpp: 'ace/mode/c_cpp',\n};\n\nlet files;\nlet editor;\nlet currentTab;\nlet editorSessions = [];\nlet tabs;\nlet storage;\nlet explorer = [];\nconst editorInput = document.getElementById('editorInput');\nconst editorOutput = document.getElementById('editorOutput');\n\ndocument.addEventListener('DOMContentLoaded', async () => {\n editorInput.addEventListener('input', () => {\n if (editorInput.value == '') {\n editorInput.dir = document.dir;\n editorInput.classList.add('ltr:font-Nunito');\n editorInput.classList.remove('font-Consolas');\n } else {\n editorInput.dir = 'ltr';\n editorInput.classList.remove('ltr:font-Nunito');\n editorInput.classList.add('font-Consolas');\n }\n });\n});\n\nlet tabsUpdatedEvent = new Event('tabs_updated');\nconst loadFiles = (filesJson, storageId) => {\n initializeExplorer(filesJson);\n storage = storageId;\n files = filesJson;\n currentTab = files.files.find((file) => file.id === files.currentTab);\n tabs = initializeTabs();\n let editorSession = initializeEditor();\n editorSession.on('change', (delta) => {\n _.debounce(saveEditorContent, 10)();\n });\n Alpine.data('tabs', () => ({\n data: tabs,\n current: currentTab,\n init() {\n window.addEventListener('tabs_updated', () => {\n this.data = initializeTabs();\n this.changeTab(currentTab);\n localStorage.setItem(storage, JSON.stringify(files));\n });\n },\n changeTab(tab) {\n if (this.current !== tab) {\n this.current = tab;\n files.currentTab = this.current.id;\n currentTab = this.current;\n editorSession = setEditorSession(tab.id);\n localStorage.setItem(storage, JSON.stringify(files));\n }\n },\n closeTab(tab) {\n if (this.data.length > 1) {\n files.tabs = files.tabs.filter((id) => {\n return id !== tab.id;\n });\n this.data = initializeTabs();\n if (this.current === tab) {\n this.changeTab(this.data[0]);\n }\n localStorage.setItem(storage, JSON.stringify(files));\n }\n },\n }));\n Alpine.data('explorer', () => ({\n isShown: false,\n explorer: explorer[0].children,\n render: render,\n openFile(id) {\n let file = files.files.find((file) => file.id === id);\n if (!files.tabs.includes(file.id)) {\n files.tabs.push(file.id);\n }\n currentTab = file;\n let tabs = files.files\n .filter((file) => {\n return files.tabs.includes(file.id);\n })\n .sort((a, b) => files.tabs.indexOf(b.id) - files.tabs.indexOf(a.id));\n createTabsSession(tabs);\n setEditorSession(file.id);\n window.dispatchEvent(tabsUpdatedEvent);\n this.hideExplorer();\n },\n toggleHidden(el, childrenEl) {\n el.classList.toggle('active');\n childrenEl.classList.toggle('hidden');\n },\n toggleExplorer() {\n this.isShown = !this.isShown;\n },\n showExplorer() {\n this.isShown = true;\n },\n hideExplorer() {\n this.isShown = false;\n editor.focus();\n },\n }));\n let sendBtn = document.getElementById('sendBtn');\n if (sendBtn) {\n sendBtn.onclick = () => {\n localStorage.setItem(storage, JSON.stringify(files));\n Livewire.dispatch('submitCode', {\n files: JSON.parse(localStorage.getItem(storage))['files'],\n });\n };\n }\n};\n\nfunction saveEditorContent() {\n let currentFile = files.files.find((file) => file.id === files.currentTab);\n files.files.find((file) => file.id === files.currentTab).content =\n editor.session.getValue();\n saveFilesToLocalStorage();\n}\n\nfunction saveFilesToLocalStorage() {\n localStorage.setItem(storage, JSON.stringify(files));\n}\n\nconst initializeEditor = () => {\n const editorElement = document.getElementById('editor');\n if (editorElement) {\n editor = ace.edit(document.getElementById('editor'), {\n useWorker: false,\n mode: modes[currentTab.mode],\n theme: document.body.classList.contains('dark')\n ? 'ace/theme/monokai'\n : 'ace/theme/xcode',\n minLines: 10,\n fontSize: 14,\n enableAutoIndent: true,\n });\n editor.setOptions({\n autoScrollEditorIntoView: true,\n showPrintMargin: false,\n });\n document.addEventListener('setTheme', function (e) {\n editor.setTheme(\n e.detail === 'dark' ? 'ace/theme/monokai' : 'ace/theme/xcode',\n );\n });\n setEditorSession(currentTab.id);\n }\n return editor.session;\n};\n\nfunction createTabsSession(tabs) {\n tabs.forEach((tab) => {\n editorSessions[tab.id] = ace.createEditSession(\n tab.content,\n modes[tab.mode],\n );\n });\n}\n\nconst setEditorSession = (id) => {\n if (!editorSessions[id]) {\n let tab = files.files.find((file) => file.id === id);\n editorSessions[id] = ace.createEditSession(tab.content, modes[tab.mode]);\n }\n if (editor) {\n editor.setSession(editorSessions[id]);\n }\n editor.session.on('change', (delta) => {\n _.debounce(saveEditorContent, 10)();\n });\n editor.focus();\n editor.navigateFileEnd();\n return editor.session;\n};\n\nconst initializeTabs = () => {\n let tabs = files.files.filter((file) => {\n return files.tabs.includes(file.id);\n });\n createTabsSession(tabs);\n return tabs;\n};\n\nfunction initializeExplorer(json) {\n let availableFiles = json.files;\n let availableDirectories = json.directories;\n function fillDirectory(parent, id) {\n availableDirectories\n .filter((dir) => dir.parentId === id)\n .sort((a, b) => {\n if (a.name < b.name) {\n return 1;\n }\n if (a.name > b.name) {\n return -1;\n }\n return 0;\n })\n .forEach((dir) => {\n parent.children.unshift({\n id: dir.id,\n name: dir.name,\n parentId: parent.id,\n children: availableFiles\n .filter((file) => file.dirId === dir.id)\n .sort((a, b) => {\n if (a.name < b.name) {\n return 1;\n }\n if (a.name > b.name) {\n return -1;\n }\n return 0;\n }),\n });\n fillDirectory(\n parent.children.find((item) => item.id === dir.id),\n dir.id,\n );\n });\n }\n explorer = [\n {\n id: 'root',\n name: 'root',\n children: availableFiles\n .filter((file) => file.dirId === 'root')\n .sort((a, b) => {\n if (a.name < b.name) {\n return -1;\n }\n if (a.name > b.name) {\n return 1;\n }\n return 0;\n }),\n },\n ];\n fillDirectory(explorer[0], 'root');\n}\n\nfunction render(obj, key) {\n let isDirectory = obj.children;\n\n let html;\n if (isDirectory) {\n let isInRoot = obj.parentId === 'root';\n html = ``;\n if (obj.children) {\n html += ``;\n }\n } else {\n let isInRoot = obj.dirId === 'root';\n html = ``;\n }\n return html;\n}\n\nwindow.loadFiles = loadFiles;\n\nfunction setCookie(cname, cvalue, exseconds) {\n const d = new Date();\n d.setTime(d.getTime() + exseconds * 1000);\n let expires = 'expires=' + d.toUTCString();\n document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/';\n}\n\nconst initializeDivider = () => {\n const topSectionMaxHeightPercent = 60;\n const wrapperSelector = '#editorWrapper';\n const dividerSelector = '#editorDivider';\n\n const mainSectionMinHeightInPercent = 25;\n\n const divider = document.querySelector(\n wrapperSelector + ' ' + dividerSelector,\n );\n\n const topSection = divider.previousElementSibling;\n const bottomSection = divider.nextElementSibling;\n\n let y = 0;\n\n let prevSiblingHeight = 0;\n\n const getClientY = (e) => {\n return e.touches ? e.touches[0].clientY : e.clientY;\n };\n\n const mouseDownHandler = function (e) {\n // Get the current mouse position\n y = getClientY(e);\n const rect = topSection.getBoundingClientRect();\n prevSiblingHeight = rect.height;\n\n // Attach the listeners to `document`\n document.addEventListener('mousemove', mouseMoveHandler);\n document.addEventListener('touchmove', mouseMoveHandler);\n document.addEventListener('mouseup', mouseUpHandler);\n document.addEventListener('touchend', mouseUpHandler);\n };\n const mouseMoveHandler = function (e) {\n // How far the mouse has been moved\n const dy = getClientY(e) - y;\n\n let h =\n ((prevSiblingHeight + dy) * 100) /\n divider.parentNode.getBoundingClientRect().height;\n h = h >= mainSectionMinHeightInPercent ? h : mainSectionMinHeightInPercent;\n topSection.style.height = Math.min(h, topSectionMaxHeightPercent) + '%';\n const cursor = 'row-resize';\n divider.style.cursor = cursor;\n document.body.style.cursor = cursor;\n\n topSection.style.userSelect = 'none';\n topSection.style.pointerEvents = 'none';\n\n bottomSection.style.userSelect = 'none';\n bottomSection.style.pointerEvents = 'none';\n };\n\n const mouseUpHandler = function () {\n divider.style.removeProperty('cursor');\n document.body.style.removeProperty('cursor');\n\n topSection.style.removeProperty('user-select');\n topSection.style.removeProperty('pointer-events');\n\n bottomSection.style.removeProperty('user-select');\n bottomSection.style.removeProperty('pointer-events');\n\n // Remove the handlers of mousemove and mouseup\n document.removeEventListener('mousemove', mouseMoveHandler);\n document.removeEventListener('touchmove', mouseMoveHandler);\n document.removeEventListener('mouseup', mouseUpHandler);\n document.removeEventListener('touched', mouseUpHandler);\n setCookie('editor-height', topSection.style.height, 365 * 24 * 60 * 60);\n };\n\n // Attach the handler\n divider.addEventListener('mousedown', mouseDownHandler);\n divider.addEventListener('touchstart', mouseDownHandler);\n};\n\nconst initializeIoTabs = () => {\n const tabsContentsClassnamePrefix = 'editor-io-tab-content-';\n const tabTriggersClassnamePrefix = 'editor-io-tab-trigger-';\n\n let triggers = document.querySelectorAll(\"[class^='editor-io-tab-trigger-']\");\n let contents = document.querySelectorAll(\"[class^='editor-io-tab-content-']\");\n\n for (let i = 0; i < triggers.length; i++) {\n let trigger = triggers[i];\n trigger.onclick = () => {\n for (let trigger of triggers) {\n trigger.classList.remove('active');\n }\n trigger.classList.add('active');\n for (let content of contents) {\n content.classList.add('hidden');\n }\n contents[i].classList.remove('hidden');\n };\n }\n};\n\nconst load = () => {\n initializeDivider();\n initializeIoTabs();\n};\n\ndocument.addEventListener('livewire:initialized', () => {\n load();\n Livewire.hook('component.init', ({ component, cleanup }) => {\n if (component.name === 'platform.editor.editor') {\n load();\n }\n });\n});\n"],"names":["ace.config","modeC_cppUrl","modePythonUrl","themeXCodeUrl","monokaiCodeUrl","modes","files","editor","currentTab","editorSessions","tabs","storage","explorer","editorInput","tabsUpdatedEvent","loadFiles","filesJson","storageId","initializeExplorer","file","initializeTabs","editorSession","initializeEditor","delta","_","saveEditorContent","tab","setEditorSession","id","render","a","b","createTabsSession","el","childrenEl","sendBtn","saveFilesToLocalStorage","ace.edit","e","ace.createEditSession","json","availableFiles","availableDirectories","fillDirectory","parent","dir","item","obj","key","isDirectory","html","isInRoot","setCookie","cname","cvalue","exseconds","d","expires","initializeDivider","divider","topSection","bottomSection","y","prevSiblingHeight","getClientY","mouseDownHandler","mouseMoveHandler","mouseUpHandler","dy","h","cursor","initializeIoTabs","triggers","contents","i","trigger","content","load","component","cleanup"],"mappings":"uMAOAA,EAAAA,OAAW,aAAa,iBAAkBC,CAAY,EACtDD,EAAAA,OAAW,aAAa,kBAAmBE,CAAa,EACxDF,EAAAA,OAAW,aAAa,kBAAmBG,CAAa,EACxDH,EAAAA,OAAW,aAAa,oBAAqBI,CAAc,EAE3D,MAAMC,EAAQ,CACZ,GAAI,kBACJ,IAAK,gBACP,EAEA,IAAIC,EACAC,EACAC,EACAC,EAAiB,CAAE,EACnBC,EACAC,EACAC,EAAW,CAAE,EACjB,MAAMC,EAAc,SAAS,eAAe,aAAa,EACpC,SAAS,eAAe,cAAc,EAE3D,SAAS,iBAAiB,mBAAoB,SAAY,CACxDA,EAAY,iBAAiB,QAAS,IAAM,CACtCA,EAAY,OAAS,IACvBA,EAAY,IAAM,SAAS,IAC3BA,EAAY,UAAU,IAAI,iBAAiB,EAC3CA,EAAY,UAAU,OAAO,eAAe,IAE5CA,EAAY,IAAM,MAClBA,EAAY,UAAU,OAAO,iBAAiB,EAC9CA,EAAY,UAAU,IAAI,eAAe,EAE/C,CAAG,CACH,CAAC,EAED,IAAIC,EAAmB,IAAI,MAAM,cAAc,EAC/C,MAAMC,EAAY,CAACC,EAAWC,IAAc,CAC1CC,EAAmBF,CAAS,EAC5BL,EAAUM,EACVX,EAAQU,EACRR,EAAaF,EAAM,MAAM,KAAMa,GAASA,EAAK,KAAOb,EAAM,UAAU,EACpEI,EAAOU,EAAgB,EACvB,IAAIC,EAAgBC,EAAkB,EACtCD,EAAc,GAAG,SAAWE,GAAU,CACpCC,EAAE,SAASC,EAAmB,EAAE,EAAG,CACvC,CAAG,EACD,OAAO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