"use strict";(self.webpackChunk_elyra_python_editor_extension=self.webpackChunk_elyra_python_editor_extension||[]).push([[509],{74:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PythonEditor=void 0;const o=n(85),a=n(460);class r extends o.ScriptEditor{constructor(e){super(e)}getLanguage(){return"python"}getIcon(){return a.pythonIcon}}t.PythonEditor=r},509:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const o=n(85),a=n(909),r=n(200),i=n(131),c=n(313),d=n(710),s=n(887),l=n(241),y=n(614),p=n(460),h=n(74),m="Python Editor",u="python",g="elyra-python-editor-extension",f="script-editor:create-new-python-editor",x="docmanager:open",E={fontFamily:null,fontSize:null,lineHeight:null,lineNumbers:!1,lineWrap:"on",wordWrapColumn:80,readOnly:!1,tabSize:4,insertSpaces:!0,matchBrackets:!0,autoClosingBrackets:!0,handlePaste:!0,rulers:[],codeFolding:!1},P={id:g,autoStart:!0,requires:[i.IEditorServices,d.IEditorTracker,r.ICommandPalette,y.ISettingRegistry,c.IDefaultFileBrowser],optional:[a.ILayoutRestorer,l.IMainMenu,s.ILauncher],activate:(e,t,n,a,i,c,d,s,l)=>{console.log("Elyra - python-editor extension is activated!");const y=new o.ScriptEditorWidgetFactory({editorServices:t,factoryOptions:{name:m,fileTypes:[u],defaultFor:[u]},instanceCreator:e=>new h.PythonEditor(e)});e.docRegistry.addFileType({name:u,displayName:"Python File",extensions:[".py"],pattern:".*\\.py$",mimeTypes:["text/x-python"],icon:p.pythonIcon});const{restored:P}=e,w=new r.WidgetTracker({namespace:g});let C=Object.assign({},E);d&&d.restore(w,{command:x,args:e=>({path:e.context.path,factory:m}),name:e=>e.context.path});const I=t=>{C=Object.assign(Object.assign({},E),t.get("editorConfig").composite),e.commands.notifyCommandChanged()},b=()=>{w.forEach((e=>{_(e)}))},_=e=>{n.has(e)||n.add(e);const t=e.content.editor;Object.keys(C).forEach((e=>{const n=e;t.setOption(n,C[n])}))};Promise.all([i.load("@jupyterlab/fileeditor-extension:plugin"),P]).then((([e])=>{I(e),b(),e.changed.connect((()=>{I(e),b()}))})).catch((e=>{console.error(e.message),b()})),e.docRegistry.addWidgetFactory(y),y.widgetCreated.connect(((e,t)=>{w.add(t),t.context.pathChanged.connect((()=>{w.save(t)})),_(t)})),w.widgetAdded.connect(((e,t)=>{_(t)})),l&&l.add({command:f,category:"Elyra",rank:4}),s&&s.fileMenu.newMenu.addGroup([{command:f,args:{isMenu:!0}}],92),e.commands.addCommand(f,{label:e=>e.isPalette?"New Python Editor":"Python Editor",caption:"Create a new Python Editor",icon:e=>e.isPalette?void 0:p.pythonIcon,execute:t=>{return n=t.cwd||c.model.path,e.commands.execute("docmanager:new-untitled",{path:n,type:"file",ext:".py"}).then((t=>e.commands.execute(x,{path:t.path,factory:m})));var n}}),a.addItem({command:f,args:{isPalette:!0},category:"Elyra"})}};t.default=P}}]);