import{s as i}from"./pageScrolling-DKoKIacQ.js";import{_ as c,o as n,b as s,p as a,n as o,t as g,r as m,a as y,q as l,f as p,v as d}from"./main-DHoZdmBw.js";const v={name:"HeadlineH3",props:{headline:{type:String,required:!0},headlineClass:{type:String,default:""},headlineStyle:{type:String,default:null}}},k=["innerHTML"];function C(t,h,e,u,r,_){return n(),s("div",null,[a("p",{class:o([e.headlineClass,"h3"]),style:g(e.headlineStyle),innerHTML:e.headline},null,14,k)])}const S=c(v,[["render",C],["__scopeId","data-v-5d29a94b"]]),T={name:"ErrorMessage",components:{HeadlineH3:S},props:{title:{type:String,required:!1,default:null},inline:{type:Boolean},code:{type:String,default:null},hideInitially:Boolean,dataTest:{type:String,default:null},triggerOnCreation:Boolean,scrollTo:{type:String,default:""}},data(){return{revealed:!1,triggerCount:0}},mounted(){this.triggerOnCreation&&this.trigger()},methods:{async trigger(){if(this.triggerCount+=1,this.revealed=!0,await this.$nextTick(),this.scrollTo)i(document.querySelector(`#${this.scrollTo}`));else{const t=this.$refs.container.getBoundingClientRect();t.y<=200?i(this.$refs.topMarker,{offset:200}):t.bottom>document.documentElement.clientHeight-200&&i(this.$refs.bottomMarker)}},hide(){this.revealed=!1,this.shake=!1}}},b=["data-test"],B={ref:"topMarker"},M={class:"error-message__text"},E={key:1,class:"error-message__code pt-3"},H={ref:"bottomMarker"};function x(t,h,e,u,r,_){const f=m("headline-h3");return!e.hideInitially||r.revealed?(n(),s("div",{key:0,class:o(["error-message d-flex justify-center",{"error-message--inline":e.inline}]),"data-test":e.dataTest},[a("div",B,null,512),(n(),s("div",{ref:"container",key:r.triggerCount,class:o([{shake:r.triggerCount},"error-message__container animated fast"])},[e.title?(n(),y(f,{key:0,"headline-class":"error-headline ma-0","headline-seo":"",headline:e.title},null,8,["headline"])):l("",!0),a("div",M,[p(t.$slots,"default",{},void 0,!0)]),e.code?(n(),s("div",E,d(t.$dict.get("online-Shop.Global-Labels.Error-Code"))+" "+d(e.code),1)):l("",!0)],2)),a("div",H,null,512)],10,b)):l("",!0)}const I=c(T,[["render",x],["__scopeId","data-v-a796131f"]]);export{I as E};