System.register(["./index-legacy-BiCnHnDr.js","./containers-legacy-DlhFG1K3.js","./_plugin-vue_export-helper-legacy-BVIICed7.js"],function(e,t){"use strict";var n,o,a,i,d,r,l,c,s,u,v,p,h,f,w,y,g,b,x,k,m,C,$,_;return{setters:[e=>{n=e.u,o=e.r,a=e.a,i=e.c,d=e.n,r=e.o,l=e.b,c=e.d,s=e.w,u=e.e,v=e.v,p=e.f,h=e.g,f=e.j,w=e.h,y=e.l,g=e.i,b=e.p,x=e.q,k=e.s,m=e.x},e=>{C=e.l,$=e.a},e=>{_=e._}],execute:function(){var t=document.createElement("style");t.textContent='@charset "UTF-8";.container[data-v-eed3807a]{position:absolute;overflow:hidden}.content[data-v-eed3807a]{width:100%;height:100%;color:#000}.content[data-v-eed3807a] *{color:inherit}.content.original[data-v-eed3807a]{display:block;margin:auto}.content.stretch[data-v-eed3807a]{width:100%;height:100%}.content.crop[data-v-eed3807a]{width:100%;height:100%;overflow:hidden}iframe[data-v-eed3807a],html[data-v-eed3807a],body[data-v-eed3807a]{overflow:hidden}.settings-btn[data-v-eed3807a]{position:absolute;bottom:20px;left:50%;transform:translate(-50%);z-index:99999999;padding:4px 15px;font-size:40px;border-radius:12px;opacity:.35;transition:opacity .25s,transform .25s;background:rgba(0,0,0,.45);color:#fff;border:none;backdrop-filter:blur(4px)}.container:hover .settings-btn[data-v-eed3807a]{opacity:1;transform:translate(-50%) scale(1.05)}\n/*$vite$:1*/',document.head.appendChild(t);const I=["src"];e("default",_({__name:"LinkContainer",props:{id:String,layoutId:String,partner:String,code:String},emits:["context"],setup(e,{emit:t}){n();const _="https://display24.ru",S=o(!1);let L=null;const j=t;function D(e){e.preventDefault(),j("context")}const z=e,O=a({id:null,displayCode:null,layoutId:null,content:null,code:null}),T=i(()=>{var e,t,n,o,a,i,r,l,c;return{top:O.top+"px",left:O.left+"px",width:O.width+"px",height:O.height+"px",backgroundColor:d(null===(e=O.background)||void 0===e?void 0:e.color)||"#000",zIndex:O.zIndex||0,borderColor:(null===(t=O.border)||void 0===t?void 0:t.color)||"#fff",borderStyle:(null===(n=O.border)||void 0===n?void 0:n.style)||"solid",borderWidth:((null===(o=O.border)||void 0===o?void 0:o.width)||0)+"px",borderRadius:(null===(a=O.border)||void 0===a?void 0:a.radius)+"px",boxShadow:`${null===(i=O.shadow)||void 0===i?void 0:i.x}px ${null===(r=O.shadow)||void 0===r?void 0:r.y}px ${null===(l=O.shadow)||void 0===l?void 0:l.b}px ${null===(c=O.shadow)||void 0===c?void 0:c.color}`}}),E=i(()=>{const e=O.content.code||"",t=e.includes("?")?"&":"?";return`${e}${t}code=${z.code}&v=`+Date.now()}),F=i(()=>{if(!O.content)return"";switch(O.content.mediaMode){case 1:return"stretch";case 2:return"crop";default:return"original"}});return r(async()=>{O.id=z.id,O.displayCode=z.code,O.layoutId=z.layoutId,await C(O,_,"LinkContainer (layouts)"),await $(O,S,_,"LinkContainer (schedule)"),await async function(){var e;const t=null===(e=O.content)||void 0===e?void 0:e.id;try{const e=(await b.get(`${_}/api/v1/player/links/${t}?v=`+Date.now(),{headers:{"Content-Type":"application/json"},timeout:5e3})).data;if(!e||"object"!=typeof e||!0!==e.online)throw new Error("OFFLINE_OR_HTML_STUB_200");if(200==(null==e?void 0:e.code)){var n;let o=e.data||[];O.data=o.find(e=>{var t;return e.id==(null===(t=O.content)||void 0===t?void 0:t.id)})||null,O.content.code=x(null===(n=O.data)||void 0===n?void 0:n.code),k("links",t,O.data).then(e=>e&&console.info("LinkContainer (links): Сохранение данных в кэш")).catch(console.error)}else console.warn("LinkContainer (links): Нет данных")}catch(a){let e=await m("links",t)||[];var o;return e=JSON.parse(JSON.stringify(e)),e?(O.data=e.find(e=>{var t;return e.id==(null===(t=O.content)||void 0===t?void 0:t.id)})||null,O.content.code=x(null===(o=O.data)||void 0===o?void 0:o.code),console.warn("LinkContainer (links): Данные загружены из кэша"),!0):(console.error("LinkContainer (links): Нет данных в кэше"),!1)}}(),L=setInterval(()=>{S.value=l(null==O?void 0:O.scheduleData)},1e3)}),c(()=>{L&&clearInterval(L)}),s(()=>O.scheduleData,e=>{S.value=l(e)}),(e,t)=>{var n;return u((h(),p("div",{class:"container",onContextmenu:D,style:g(T.value)},[f("div",{class:"settings-btn",onClick:t[0]||(t[0]=e=>j("context"))},"⚙"),w("",!0),null!==(n=O.content)&&void 0!==n&&n.code?(h(),p("div",{key:1,class:y(["content",F.value])},[f("iframe",{src:E.value,frameborder:"0",style:{width:"100%",height:"100%"},sandbox:"allow-same-origin allow-scripts allow-popups",allow:"encrypted-media",scrolling:"no"},null,8,I)],2)):w("",!0)],36)),[[v,S.value]])}}},[["__scopeId","data-v-eed3807a"]]))}}});
