import{d as F,r as s,c as _,e as b,n as h,f as t,t as m,A as y,k as u,v as z,j as p}from"./index-8a41d130.js";import{s as v}from"./state-3bef9fa3.js";const S="_wrap_rryzt_1",R="_previewWindow_rryzt_12",k="_previewIframe_rryzt_16",g="_removeVisiable_rryzt_21",q="_studentRemove_rryzt_27",x="_btnGroupModal_rryzt_39",o={wrap:S,previewWindow:R,previewIframe:k,removeVisiable:g,studentRemove:q,btnGroupModal:x},N=F({name:"notation-a",setup(){const n=s(!1),l=s(!1),r=s({}),a=s(!1),i=_().getToken||"",c=s();console.log(i);const f=b({src:`${/(192|localhost)/.test(location.origin)?"http://localhost:3050":location.origin}/notation/#/create?Authorization=${i}`}),d=()=>{const e=document.documentElement;document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen?document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():e.requestFullscreen&&e.requestFullscreen()||e.mozRequestFullScreen&&e.mozRequestFullScreen()||e.webkitRequestFullscreen&&e.webkitRequestFullscreen()||e.msRequestFullscreen&&e.msRequestFullscreen()},w=e=>{console.log(e.data,"data"),e.data.api==="notation_open"?v.application?(n.value=!0,l.value=!0,r.value={url:e.data.url},d()):window.open(e.data.url):e.data.api==="notation_exit"&&(a.value=!0)};return h(()=>{window.addEventListener("message",w)}),()=>t("div",{class:o.wrap},[t("iframe",{ref:c,src:f.src},null),t(m,{show:l.value,"onUpdate:show":e=>l.value=e,class:o.previewWindow,showIcon:!1,displayDirective:"show"},{default:()=>[t(y,{show:n.value,style:"--n-opacity-spinning: 1;"},{default:()=>[t("iframe",{class:o.previewIframe,onLoad:()=>{n.value=!1},frameborder:"0",src:r.value.url},null)]})]}),t(m,{show:a.value,"onUpdate:show":e=>a.value=e,preset:"card",class:["modalTitle",o.removeVisiable],title:"退出制谱"},{default:()=>[t("div",{class:o.studentRemove},[t("p",null,[u("是否退出制谱功能?")]),t(z,{class:o.btnGroupModal,justify:"center"},{default:()=>[t(p,{round:!0,type:"primary",onClick:()=>{l.value=!1,r.value.url="",a.value=!1,c.value.contentWindow.postMessage({api:"reload"},"*"),v.application&&d()}},{default:()=>[u("确定")]}),t(p,{round:!0,onClick:()=>a.value=!1},{default:()=>[u("取消")]})]})])]})])}});export{N as default};