import{r as n,h as e,H as o}from"./p-bace3d90.js";import"./p-7bff44eb.js";import{r as t}from"./p-b9bb59f0.js";import{c as a}from"./p-053ca481.js";import"./p-0bc4f624.js";import{s}from"./p-e2d30bd7.js";const r=(n,e,o)=>{let t="";return e.forEach((n=>{t+=n.outerHTML})),`\n<html>\n    <head>\n        <title>${o}</title>\n        ${t}\n        <script type="module" src="https://unpkg.com/@corejam/core-components@latest/web-components/index.js"><\/script>\n        <script nomodule src="https://unpkg.com/@corejam/core-components@latest/web-components/index.cjs"><\/script>\n    </head>\n    <body>\n        ${n}\n    </body>\n</html>\n`},c=class{constructor(e){n(this,e)}async deploy(n){n.preventDefault();const e=document.querySelectorAll("style"),o=document.getElementsByTagName("corejam-canvas")[0].outerHTML,c=window.prompt("name");c&&(await a.client.mutate({mutation:s("\n    mutation createCanvas($canvasPageInput: CanvasPageInput!) {\n        canvasPageCreate(canvasPageInput: $canvasPageInput) {\n            id\n            seo {\n                url\n            }\n            canvas\n        }\n    }\n"),variables:{canvasPageInput:{canvas:JSON.stringify(r(o,e,c)),seo:{url:c}}}})).data.canvasPageCreate.id&&(t.routes=[{url:`/${c}`,canvasPage:!0,component:JSON.stringify(o),exact:!0}],t.router.push(`/${c}`))}render(){return e(o,null,e("corejam-box",{flex:!0,direction:"col",pt:24},e("corejam-type",{as:"h3",size:"lg",weight:"hairline"},"Deploy to CDN"),e("corejam-button",{w:"6",bg:"green-200",hoverBg:"green-300",p:"2",color:"gray-700",hoverColor:"white",onPointerUp:this.deploy},"Deploy")))}};export{c as corejam_deploy}