import{d as g,r as y,aD as _,k as d,w as m,aq as k,o as n,c as o,a as w,F as I,a8 as O,P as c,U as v,O as x,V as L,a0 as P,n as R}from"./vue.adf17aba.js";const b={class:"layout-padding layout-padding-unset layout-iframe"},B={class:"layout-padding-auto layout-padding-view"},D=["src","data-url"],T=g({__name:"iframes",props:{refreshKey:{type:String,default:()=>""},name:{type:String,default:()=>"slide-right"},list:{type:Array,default:()=>[]}},setup(f){const r=f,l=y(),i=_(),p=d(()=>r.list.filter(e=>{var a;return(a=e.meta)==null?void 0:a.isIframeOpen})),h=d(()=>i.path),u=(e,a)=>{R(()=>{if(!l.value)return!1;l.value.forEach(s=>{s.dataset.url===e&&(s.onload=()=>{var t;(t=a.meta)!=null&&t.isIframeOpen&&a.meta.loading&&(a.meta.loading=!1)})})})};return m(()=>i.fullPath,e=>{const a=r.list.find(s=>s.path===e);if(!a)return!1;a.meta.isIframeOpen||(a.meta.isIframeOpen=!0),u(e,a)},{immediate:!0}),m(()=>r.refreshKey,()=>{const e=r.list.find(a=>a.path===i.path);if(!e)return!1;e.meta.isIframeOpen&&(e.meta.isIframeOpen=!1),setTimeout(()=>{e.meta.isIframeOpen=!0,e.meta.loading=!0,u(i.fullPath,e)})},{deep:!0}),(e,a)=>{const s=k("loading");return n(),o("div",b,[w("div",B,[(n(!0),o(I,null,O(p.value,t=>c((n(),o("div",{class:"w100",key:t.path,"element-loading-background":"white"},[v(P,{name:f.name,mode:"out-in"},{default:x(()=>[c((n(),o("iframe",{src:t.meta.isLink,key:t.path,frameborder:"0",height:"100%",width:"100%",style:{position:"absolute"},"data-url":t.path,ref_for:!0,ref_key:"iframeRef",ref:l},null,8,D)),[[L,h.value===t.path]])]),_:2},1032,["name"])])),[[s,t.meta.loading]])),128))])])}}});export{T as default};
