import{j as d}from"./jsx-runtime-CLpGMVip.js";import{r as p}from"./index-B-SYruCi.js";import{d as x,m as b,S as k,P as q,c as R,a as W,b as M}from"./config-DN7VXKqt.js";const _={title:"stories/VanillaJS/pythonEditorFrameDriver",argTypes:{version:{options:["2.0.0","2.2.2","3","beta"],defaultValue:"2.0.0",name:"version",control:{type:"radio"}}}},i=e=>{const l=p.useRef(new Map),c=p.useRef(null),L=m=>{if(!m)return;const r=document.createElement("iframe");r.title="PythonEditor",r.allow="usb; autoplay; camera; microphone;";const w=R(e.version??"3",e.lang,e.controller??1,e.queryParams);r.src=w,r.width="100%",r.height="100%",m.replaceChildren(r),c.current=new W({initialProjects:async()=>e.project?[e.project]:[x],onWorkspaceLoaded:o=>console.log("workspaceLoaded",o),onWorkspaceSync:o=>console.log("workspaceSync",o),onWorkspaceSave:o=>{l.current.set(M,o.project),console.log(l)}},()=>r),c.current.initialize()};return d.jsxs(k,{children:[d.jsx(q,{driver:c}),d.jsx("div",{ref:L,style:{flexGrow:1}})]})},n={name:"Python Editor versions",render:i,args:{version:"3",project:x}},t={name:"Python Editor multi-file project",render:i,args:{version:"3",project:b}},a={name:"Python Editor V3 lang via query string",render:i,args:{version:"3",lang:"fr"}},s={name:"Python Editor V3 noLang flag",render:i,args:{version:"3",queryParams:{flag:"noLang"}}};var u,y,g;n.parameters={...n.parameters,docs:{...(u=n.parameters)==null?void 0:u.docs,source:{originalSource:`{
  name: 'Python Editor versions',
  render: renderEditor,
  args: {
    version: '3',
    project: defaultPythonProject
  }
}`,...(g=(y=n.parameters)==null?void 0:y.docs)==null?void 0:g.source}}};var P,h,f;t.parameters={...t.parameters,docs:{...(P=t.parameters)==null?void 0:P.docs,source:{originalSource:`{
  name: 'Python Editor multi-file project',
  render: renderEditor,
  args: {
    version: '3',
    project: multiFilePythonProject
  }
}`,...(f=(h=t.parameters)==null?void 0:h.docs)==null?void 0:f.source}}};var E,j,v;a.parameters={...a.parameters,docs:{...(E=a.parameters)==null?void 0:E.docs,source:{originalSource:`{
  name: 'Python Editor V3 lang via query string',
  render: renderEditor,
  args: {
    version: '3',
    lang: 'fr'
  }
}`,...(v=(j=a.parameters)==null?void 0:j.docs)==null?void 0:v.source}}};var S,F,V;s.parameters={...s.parameters,docs:{...(S=s.parameters)==null?void 0:S.docs,source:{originalSource:`{
  name: 'Python Editor V3 noLang flag',
  render: renderEditor,
  args: {
    version: '3',
    queryParams: {
      flag: 'noLang'
    }
  }
}`,...(V=(F=s.parameters)==null?void 0:F.docs)==null?void 0:V.source}}};const z=["PythonEditorStory","MultiFileProject","V3French","V3NoLangFlag"];export{t as MultiFileProject,n as PythonEditorStory,a as V3French,s as V3NoLangFlag,z as __namedExportsOrder,_ as default};
