import{q as n,I as c,t as r,x as s,z as d,O as m,L as u,a1 as p,a2 as h,N as f}from"./vue.02ad7c87.js";import{_ as y,c0 as _,h as v,I as x}from"./index.f2790301.js";import{s as g}from"./startCase.0949da17.js";import"./sentry.13e8e62e.js";const b={name:"PolicyViewer",inject:["app"],props:{urlName:{type:String,required:!0},updateTitle:{type:Boolean,default:!1},padding:{type:Boolean,default:!0},index:{type:Boolean,default:!1}},data(){return{policy:null,scrolledToBottom:!1,intersectionObserver:null}},watch:{policy(){this.intersectionObserver=new IntersectionObserver(e=>{e.forEach(o=>{o.intersectionRatio>0&&this.$emit("read",!0)})},{rootMargin:"500px",trackVisibility:!1,threshold:[0]}),this.intersectionObserver.observe(this.$refs.endOfPolicyMarker)},urlName(){this.getPolicy()}},mounted(){this.getPolicy()},created(){_(n(()=>{const e={title:$store.state.title};return this.index||(e.meta=[{name:"robots",content:"noindex"}]),e}))},methods:{getPolicy(){this.axios.post(v("/omnis/v3/eula/getFromUrl/"),{url:this.urlName}).success(e=>{this.policy=e,this.updateTitle&&(document.title=`${this.policy.name} | ${g(this.app.name)}`),this.$emit("loaded")}).validation(()=>{this.$router.replace("/404/")}).oops()},maxDevice:x}},w={ref:"endOfPolicyMarker",class:"w-full",style:{height:"10px"}};function B(e,o,t,N,a,i){const l=c("tml-render-html-editor-output");return r(),s("div",null,[a.policy?(r(),s("div",{key:0,class:d({"mt-8":!i.maxDevice("md")&&t.padding,"mt-4":i.maxDevice("md")&&t.padding,"mx-auto":!i.app.isTeemill&&t.padding,container:i.app.isTeemill&&t.padding,"mb-16 mt-16":t.padding})},[m(l,{id:"policy",html:a.policy.contents},null,8,["html"])],2)):u("",!0),p(f("div",w,null,512),[[h,a.policy]])])}const T=y(b,[["render",B]]);export{T as default};
//# sourceMappingURL=PolicyViewer.3afae1ce.js.map
