"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1950],{31950:(e,t,r)=>{r.r(t),r.d(t,{default:()=>I,lineColItem:()=>R});var o=r(89965),n=r(115),i=r(1103),a=r(98836),s=r(4844),l=r(6513),d=r(14039),c=r(17176),u=r(89319),m=r.n(u),g=r(78156),p=r.n(g);const f="@jupyterlab/codemirror-extension:plugin",h={id:"@jupyterlab/codemirror-extension:languages",provides:s.IEditorLanguageRegistry,optional:[a.ITranslator],activate:(e,t)=>{const o=new s.EditorLanguageRegistry;for(const e of s.EditorLanguageRegistry.getDefaultLanguages(t))o.addLanguage(e);return o.addLanguage({name:"ipythongfm",mime:"text/x-ipythongfm",load:async()=>(await Promise.all([r.e(2979),r.e(4205),r.e(4785),r.e(1584),r.e(9799),r.e(6271),r.e(8653),r.e(4837),r.e(2308),r.e(6945)]).then(r.bind(r,76271))).markdown({codeLanguages:e=>o.findBest(e)})}),o}},E={id:"@jupyterlab/codemirror-extension:themes",provides:s.IEditorThemeRegistry,optional:[a.ITranslator],activate:(e,t)=>{const r=new s.EditorThemeRegistry;for(const e of s.EditorThemeRegistry.getDefaultThemes(t))r.addTheme(e);return r}},y={id:"@jupyterlab/codemirror-extension:extensions",provides:s.IEditorExtensionRegistry,requires:[s.IEditorThemeRegistry],optional:[a.ITranslator,l.ISettingRegistry,d.IFormRendererRegistry],activate:(e,t,r,o,n)=>{const i=new s.EditorExtensionRegistry;for(const e of s.EditorExtensionRegistry.getDefaultExtensions({themes:t,translator:r}))i.addExtension(e);if(o){const t=e=>{var t;i.baseConfiguration=null!==(t=e.get("defaultConfig").composite)&&void 0!==t?t:{}};Promise.all([o.load(f),e.restored]).then((([e])=>{t(e),e.changed.connect(t)})),null==n||n.addRenderer(`${f}.defaultConfig`,{fieldRenderer:e=>{const t=p().useMemo((()=>i.settingsSchema),[]),o=e.formContext.settings.id===f?i.baseConfiguration:i.defaultConfiguration,n={};for(const[e,r]of Object.entries(o))void 0!==t[e]&&(n[e]=r);return p().createElement("div",{className:"jp-FormGroup-contentNormal"},p().createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},e.schema.title),e.schema.description&&p().createElement("div",{className:"jp-FormGroup-description"},e.schema.description),p().createElement(d.FormComponent,{schema:{title:e.schema.title,description:e.schema.description,type:"object",properties:t,additionalProperties:!1},validator:m(),formData:{...n,...e.formData},formContext:{defaultFormData:n},liveValidate:!0,onChange:t=>{var r;const o={};for(const[e,i]of Object.entries(null!==(r=t.formData)&&void 0!==r?r:{})){const t=n[e];void 0!==t&&c.JSONExt.deepEqual(i,t)||(o[e]=i)}e.onChange(o)},tagName:"div",translator:null!=r?r:a.nullTranslator}))}})}return i}},v={id:"@jupyterlab/codemirror-extension:binding",autoStart:!0,requires:[s.IEditorExtensionRegistry],activate:(e,t)=>{t.addExtension({name:"yjs-binding",factory:e=>{var t;const r=e.model.sharedModel;return s.EditorExtensionRegistry.createImmutableExtension((0,s.ybinding)({ytext:r.ysource,undoManager:null!==(t=r.undoManager)&&void 0!==t?t:void 0}))}})}},x={id:"@jupyterlab/codemirror-extension:services",provides:n.IEditorServices,requires:[s.IEditorLanguageRegistry,s.IEditorExtensionRegistry,s.IEditorThemeRegistry],optional:[a.ITranslator],activate:(e,t,r,o)=>({factoryService:new s.CodeMirrorEditorFactory({extensions:r,languages:t,translator:null!=o?o:a.nullTranslator}),mimeTypeService:new s.CodeMirrorMimeTypeService(t)})},R={id:"@jupyterlab/codemirror-extension:line-col-status",autoStart:!0,requires:[a.ITranslator],optional:[o.ILabShell,i.IStatusBar],provides:n.IPositionModel,activate:(e,t,r,o)=>{const i=new n.LineCol(t),a=new Set;function s(e,t){Promise.all([...a].map((e=>e(t.newValue)))).then((e=>{var t;i.model.editor=null!==(t=e.filter((e=>null!==e))[0])&&void 0!==t?t:null})).catch((e=>{console.error("Get editors",e)}))}return o&&o.registerStatusItem(R.id,{item:i,align:"right",rank:2,isActive:()=>!!i.model.editor}),r&&r.currentChanged.connect(s),{addEditorProvider:t=>{a.add(t),e.shell.currentWidget&&s(e.shell,{newValue:e.shell.currentWidget,oldValue:null})},update:()=>{s(e.shell,{oldValue:e.shell.currentWidget,newValue:e.shell.currentWidget})}}}},I=[h,E,v,y,x,R]}}]);