1import{d as S,A as b,D as A,O as T,a1 as k,a2 as M,o as R,a3 as x,f as B,w as P,S as C,a4 as r,a5 as L,e as c,i as U,g as d,m as g,t as v,x as D}from"./BqOKZ5Z7.js";import{u as O}from"./BsXYQyNV.js";const Y={class:"container__stage"},q={key:0,id:"my-piano-account",class:"my-account-container"},N={key:1},z=S({__name:"index",setup(W){b().value="default",A().useDefaults("userCompanyLicence",{noIndex:!0});const{d:l}=O("general"),h=T("userRules",()=>({superUser:null,hasAbo:null})),_=D(()=>!!h.value.superUser),E=k();let u=!1;const p=a=>{const s="dfv:seat-availability:limit-reached",t=a.data;if(!t||t.type!==s||typeof t.templateId!="string")return;const e=/^OT[A-Z0-9]+$/i.test(t.templateId)?t.templateId:"";if(!e){r("seat-availability","limit-reached without valid templateId");return}window.tp?.template?.show({templateId:e,displayMode:"modal",showCloseButton:!0})},y=async a=>{const s="dfv:seat-availability:request",t="dfv:seat-availability:response",e="dfv:seat-availability:error",n=a.data;if(!n||n.type!==s)return;const o=typeof n.contractId=="string"?n.contractId:"";if(!o){r("seat-availability","request without contractId");return}const f=a.source,m=a.origin,{data:w,error:i}=await E.runWithContext(()=>L("/api/users/site-license/seat-availability",{method:"GET",query:{contractId:o}}));if(i||!w){r("seat-availability","fetch failed",{contractId:o},i),f?.postMessage({type:e,contractId:o,error:i??"unknown"},m);return}f?.postMessage({type:t,...w},m)},I=()=>{u||(u=!0,window.addEventListener("message",y),window.addEventListener("message",p))};return M(()=>{window.removeEventListener("message",y),window.removeEventListener("message",p)}),R(()=>{const a=x("dfv_piano_token");s(async()=>{const e=window.tp||[];window.tp=e,e.pianoId.getUser()===null&&a.value?e.pianoId.loginByToken(a.value).then(()=>{t()}).catch(()=>{t()}):t()});function s(e){const n=()=>{typeof window<"u"&&typeof window.tp=="object"&&typeof window.tp.myaccount<"u"&&typeof window.tp.pianoId<"u"?e():setTimeout(n,250)};n()}function t(){const e=window.tp||[];e&&e.myaccount&&(I(),e.myaccount.show({displayMode:"inline",containerSelector:"#my-piano-account"}))}}),(a,s)=>(c(),B(C,null,{default:P(()=>[U("section",Y,[d(_)?(c(),g("div",q,v(d(l)("loading")),1)):(c(),g("div",N,v(d(l)("notAuthorized")),1))])]),_:1}))}});export{z as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.