@oiz/stzh-components 4.4.2 → 4.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-14d9de84.js → app-globals-f41fe9b1.js} +2 -2
- package/dist/cjs/{app-globals-14d9de84.js.map → app-globals-f41fe9b1.js.map} +1 -1
- package/dist/cjs/{axios-0a08e254.js → axios-7101b594.js} +361 -229
- package/dist/cjs/axios-7101b594.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stzh-bathstatus-list.cjs.entry.js +1 -1
- package/dist/cjs/stzh-components.cjs.js +1 -1
- package/dist/cjs/stzh-microsite-teaserlist.cjs.entry.js +1 -1
- package/dist/cjs/stzh-poilist.cjs.entry.js +1 -1
- package/dist/cjs/stzh-search.cjs.entry.js +1 -1
- package/dist/cjs/stzh-vbz-majorticker.cjs.entry.js +1 -1
- package/dist/cjs/stzh-vbz-ticker.cjs.entry.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-1b0f45c6.js → p-30d100f4.js} +361 -229
- package/dist/components/p-30d100f4.js.map +1 -0
- package/dist/components/stzh-bathstatus-list.js +1 -1
- package/dist/components/stzh-microsite-teaserlist.js +1 -1
- package/dist/components/stzh-poilist.js +1 -1
- package/dist/components/stzh-search.js +1 -1
- package/dist/components/stzh-vbz-majorticker.js +1 -1
- package/dist/components/stzh-vbz-ticker.js +1 -1
- package/dist/esm/{app-globals-611adbd0.js → app-globals-4d8695ba.js} +2 -2
- package/dist/esm/{app-globals-611adbd0.js.map → app-globals-4d8695ba.js.map} +1 -1
- package/dist/esm/{axios-8bc4215c.js → axios-b144d3e0.js} +361 -229
- package/dist/esm/axios-b144d3e0.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stzh-bathstatus-list.entry.js +1 -1
- package/dist/esm/stzh-components.js +1 -1
- package/dist/esm/stzh-microsite-teaserlist.entry.js +1 -1
- package/dist/esm/stzh-poilist.entry.js +1 -1
- package/dist/esm/stzh-search.entry.js +1 -1
- package/dist/esm/stzh-vbz-majorticker.entry.js +1 -1
- package/dist/esm/stzh-vbz-ticker.entry.js +1 -1
- package/dist/stzh-components/p-30d100f4.js +2 -0
- package/dist/stzh-components/p-30d100f4.js.map +1 -0
- package/dist/stzh-components/p-357ce1c2.entry.js +2 -0
- package/dist/stzh-components/{p-435f3927.entry.js.map → p-357ce1c2.entry.js.map} +1 -1
- package/dist/stzh-components/{p-7be5d916.entry.js → p-81223fd0.entry.js} +2 -2
- package/dist/stzh-components/{p-d08a74fe.entry.js → p-98eb5017.entry.js} +2 -2
- package/dist/stzh-components/{p-97a6fbc6.entry.js → p-a45f19b5.entry.js} +2 -2
- package/dist/stzh-components/{p-035cdba2.entry.js → p-adcf8c10.entry.js} +2 -2
- package/dist/stzh-components/{p-c6a770a6.js → p-bac2e98e.js} +2 -2
- package/dist/stzh-components/{p-ec1efeb8.entry.js → p-d71d4d86.entry.js} +2 -2
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/axios-0a08e254.js.map +0 -1
- package/dist/components/p-1b0f45c6.js.map +0 -1
- package/dist/esm/axios-8bc4215c.js.map +0 -1
- package/dist/stzh-components/p-1b0f45c6.js +0 -2
- package/dist/stzh-components/p-1b0f45c6.js.map +0 -1
- package/dist/stzh-components/p-435f3927.entry.js +0 -2
- /package/dist/stzh-components/{p-7be5d916.entry.js.map → p-81223fd0.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-d08a74fe.entry.js.map → p-98eb5017.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-97a6fbc6.entry.js.map → p-a45f19b5.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-035cdba2.entry.js.map → p-adcf8c10.entry.js.map} +0 -0
- /package/dist/stzh-components/{p-c6a770a6.js.map → p-bac2e98e.js.map} +0 -0
- /package/dist/stzh-components/{p-ec1efeb8.entry.js.map → p-d71d4d86.entry.js.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,h as e,F as s,a as i,g as a}from"./p-ef5985a3.js";import{a as c}from"./p-30d100f4.js";import{VBZ as r}from"./index.esm.js";const h=".sc-stzh-vbz-ticker-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-vbz-ticker-h,[stzh-hidden].sc-stzh-vbz-ticker-h{display:none}.sc-stzh-vbz-ticker-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-vbz-ticker-h *.sc-stzh-vbz-ticker,.sc-stzh-vbz-ticker-h *.sc-stzh-vbz-ticker::before,.sc-stzh-vbz-ticker-h *.sc-stzh-vbz-ticker::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-vbz-ticker-h .has-focus.sc-stzh-vbz-ticker{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-vbz-ticker-h .stzh-fylingfocus-focused.sc-stzh-vbz-ticker{outline-style:none !important}.sc-stzh-vbz-ticker-h .stzh-fylingfocus-focused.sc-stzh-vbz-ticker::-moz-focus-inner{border:0 !important}.stzh-vbz-ticker.sc-stzh-vbz-ticker{display:flex;flex-direction:column;position:relative}@media screen and (min-width: 900px){.stzh-vbz-ticker.sc-stzh-vbz-ticker{flex-direction:row;align-items:flex-start}}.stzh-vbz-ticker__content.sc-stzh-vbz-ticker{display:flex;flex-direction:column;gap:var(--stzh-space-xsmall)}.stzh-vbz-ticker__icon.sc-stzh-vbz-ticker{--size:var(--stzh-icon-size-small);margin-right:var(--stzh-space-xsmall)}.stzh-vbz-ticker__title.sc-stzh-vbz-ticker{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);font-size:var(--stzh-font-curve-p1-default-font-size, var(--stzh-font-milli-font-size));line-height:var(--stzh-font-curve-p1-default-text-line-height, var(--stzh-font-milli-text-line-height));letter-spacing:var(--stzh-font-curve-p1-default-text-letter-spacing);display:flex;flex-wrap:wrap}@media screen and (min-width: 900px){.stzh-vbz-ticker__title.sc-stzh-vbz-ticker{font-size:var(--stzh-font-curve-p1-medium-font-size, var(--stzh-font-centi-font-size));line-height:var(--stzh-font-curve-p1-medium-text-line-height, var(--stzh-font-centi-text-line-height));letter-spacing:var(--stzh-font-curve-p1-medium-text-letter-spacing)}}.stzh-vbz-ticker__title-parts.sc-stzh-vbz-ticker{display:flex;flex-wrap:wrap;margin:calc(var(--stzh-space-xxxsmall) / -1) 0}.stzh-vbz-ticker__title-part.sc-stzh-vbz-ticker{display:flex;align-items:center;white-space:nowrap;margin:var(--stzh-space-xxxsmall) 0;color:var(--stzh-color-grey90)}.stzh-vbz-ticker__title-part.sc-stzh-vbz-ticker:not(:last-child){margin-right:var(--stzh-space-large)}.stzh-vbz-ticker__title-part--major-events.sc-stzh-vbz-ticker{color:var(--stzh-color-coral)}.stzh-vbz-ticker__title-part--disturbances.sc-stzh-vbz-ticker{color:var(--stzh-color-error60)}.stzh-vbz-ticker__chips.sc-stzh-vbz-ticker{display:flex;flex-wrap:wrap;gap:0 var(--stzh-space-xsmall)}.stzh-vbz-ticker__tooltip.sc-stzh-vbz-ticker{--width:20.875rem}.stzh-vbz-ticker__disturbance.sc-stzh-vbz-ticker{display:flex;align-items:flex-start}.stzh-vbz-ticker__disturbance.sc-stzh-vbz-ticker:not(:first-child){margin-top:var(--stzh-space-small)}.stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);display:flex}.stzh-vbz-ticker__disturbance-date.sc-stzh-vbz-ticker{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);margin-top:var(--stzh-space-xsmall)}.stzh-vbz-ticker__disturbance--type0.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker,.stzh-vbz-ticker__disturbance--type2.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-vbz-ticker__disturbance-icon.sc-stzh-vbz-ticker{--size:var(--stzh-icon-size-xsmall);margin-top:var(--stzh-space-xxxsmall);margin-right:var(--stzh-space-xsmall)}.stzh-vbz-ticker__disturbance-link.sc-stzh-vbz-ticker{margin-top:var(--stzh-space-xsmall)}";const n=h;const z=class{constructor(e){t(this,e);this.globalDisturbances=[];this.linesWithDisturbances=[];this.linesWithConstructions=[];this.counter={[`${r.DISTURBANCE_GLOBAL}`]:0,[`${r.DISTURBANCE_INFORMATION}`]:0,[`${r.DISTURBANCE_CONSTRUCTION}`]:0,[`${r.DISTURBANCE_NORMAL}`]:0,[`${r.DISTURBANCE_EVENT}`]:0,[`${r.DISTURBANCE_BUS}`]:0};this.api="https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}";this.data="";this.moreInfoLink="https://zvv.ch/{lang}/fahrplan-und-informationen/verkehrslage.html?himIds={id}";this.dateAdapter=undefined;this.localization=undefined}localizationWatcher(){this.collator=new Intl.Collator(this.localization.$locale,{numeric:true})}async apiWatcher(t){if(!t){return}let e=this.api.replace(/\{lang\}/,this.localization.$locale);e=e+(e.includes("?")?"&":"?")+Date.now();const{data:s}=await c.get(e);this.data=s}dateAdapterWatcher(t){if(!t){this.dateAdapter=window.stzhComponents.utils.createFormatParseAdapter(this.localization.$formats,this.localization.$globals)}}async dataWatcher(t){var e,s;if(typeof t==="string"){this._data=JSON.parse(t)}else{this._data=t}const i={};(s=(e=this._data)===null||e===void 0?void 0:e.Message)===null||s===void 0?void 0:s.forEach((t=>{const e=t.channel.filter((t=>t.name===r.CHANNEL_TICKER&&t.url)).map((t=>t.url)).reduce(((t,e)=>t.concat(e)),[]);const s=e.find((t=>t.url.indexOf(r.CHANNEL_INFO_URL_FILTER)!==-1));if(t.baseType===r.BASE_TYPE_GLOBAL){this.counter[r.DISTURBANCE_GLOBAL]++;this.globalDisturbances.push({id:t.id,head:t.head,category:t.category,baseType:t.baseType,startDate:new Date(`${t.sDate}T${t.sTime}+02:00`),endDate:new Date(`${t.eDate}T${t.eTime}+02:00`),altStart:t.altStart,altEnd:t.altEnd,infoUrl:s})}else{this.counter[t.category]++}if(t.affectedProduct&&t.category!==r.DISTURBANCE_INFORMATION&&t.baseType!==r.BASE_TYPE_GLOBAL){const e=[];t.affectedProduct.forEach((a=>{if(typeof i[a.lineId]==="undefined"){i[a.lineId]={line:a.line,name:a.name,category:a.cls,disturbances:[],alert:false}}if(t.category===r.DISTURBANCE_EVENT||t.category===r.DISTURBANCE_GLOBAL){i[a.lineId].alert=true}if(!e.includes(a.lineId)){e.push(a.lineId);i[a.lineId].disturbances.push({id:t.id,head:t.head,category:t.category,baseType:t.baseType,startDate:new Date(`${t.sDate}T${t.sTime}+02:00`),endDate:new Date(`${t.eDate}T${t.eTime}+02:00`),altStart:t.altStart,altEnd:t.altEnd,infoUrl:s})}}))}}));this.linesWithDisturbances=Object.keys(i).map((t=>i[t])).filter((t=>t.disturbances.findIndex((t=>t.category!==r.DISTURBANCE_CONSTRUCTION))>-1));this.linesWithConstructions=Object.keys(i).map((t=>i[t])).filter((t=>t.disturbances.findIndex((t=>t.category===r.DISTURBANCE_CONSTRUCTION))>-1));this.linesWithDisturbances.sort(((t,e)=>this.collator.compare(t.line,e.line)));this.linesWithConstructions.sort(((t,e)=>this.collator.compare(t.line,e.line)))}async componentWillLoad(){if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"vbz-ticker");this.localizationWatcher()}this.dateAdapterWatcher(this.dateAdapter);if(this.data){await this.dataWatcher(this.data)}else{await this.apiWatcher(this.api)}}renderDisturbance(t){return e("div",{class:{"stzh-vbz-ticker__disturbance":true,[`stzh-vbz-ticker__disturbance--type${t.category}`]:!!t.category}},e("div",{class:"stzh-vbz-ticker__disturbance-text"},e("div",{class:"stzh-vbz-ticker__disturbance-title"},t.head),e("div",{class:"stzh-vbz-ticker__disturbance-date"},this.dateAdapter.formatSpan(t.altStart||t.startDate,t.altEnd||t.endDate,"date")),t.infoUrl?e("stzh-link",{class:"stzh-vbz-ticker__disturbance-link",size:"small",href:t.infoUrl.url},this.localization.moreInfo):e("stzh-link",{class:"stzh-vbz-ticker__disturbance-link",size:"small",target:"_blank",icon:"external-link",href:this.moreInfoLink.replace(/\{lang\}/,this.localization.$locale).replace(/\{id\}/,t.id)},this.localization.moreInfo)))}render(){const t={"stzh-vbz-ticker":true};return e(i,{key:"59af531ed3220f9a6b7c4149d9f1466961169f5b"},e("div",{key:"9cd7af7a18de3859391a3f77d921a1fc587f49c3",class:t},e("div",{key:"8e2ed0c9b36b68d1bac2a47357dba2b4d78e6c92",class:"stzh-vbz-ticker__content"},this.counter[r.DISTURBANCE_NORMAL]>0&&e(s,{key:"91f40a4c2325b25bc11fc57397436cc30352eda7"},e("div",{key:"b3f767763567eda3717d1493558da256de6dd171",class:"stzh-vbz-ticker__title"},e("div",{key:"42f59a4efe55121a0ffcacb7e1139806e52bd5f9",class:"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--disturbances"},e("stzh-icon",{key:"a4dfdd034f9d9d3a36c36ac9368c647296686334",class:"stzh-vbz-ticker__icon",name:"warning"}),this.localization.disturbancesTitle)),e("div",{key:"f7a1626d27f3d0f71d68bc3407dd01b12c4f67ee",class:"stzh-vbz-ticket__lines"},e("div",{key:"1098fbec72fa57236b91fcb52f958bb07aab56d8",class:"stzh-vbz-ticker__chips",role:"list"},this.linesWithDisturbances.map((t=>e("div",{class:"stzh-vbz-ticker__chip",role:"listitem"},e("stzh-tooltip",{class:"stzh-vbz-ticker__tooltip"},e("stzh-vbz-linechip",{line:t.line,alert:t.alert}),e("div",{class:"stzh-vbz-ticker__tooltip-content",slot:"content"},t.disturbances.map((t=>this.renderDisturbance(t))))))))))),(this.counter[r.DISTURBANCE_CONSTRUCTION]>0||this.counter[r.DISTURBANCE_EVENT]>0||this.counter[r.DISTURBANCE_BUS]>0)&&e(s,{key:"8c84b0cc56c8885553aba9220944ce92b3dffbb8"},e("div",{key:"93e3724521af51004c5558bd792968294d67fd63",class:"stzh-vbz-ticker__title"},e("div",{key:"06384269973a23aad0ebc0a5e84e70a93d12e74d",class:"stzh-vbz-ticker__title-parts"},e("div",{key:"56d0438edcdb01a2e08cd94b088d5c6c22865d6e",class:"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--others"},e("stzh-icon",{key:"5679cf8ef19da6cd00f58d6d0a8e8f39b9c1ab11",class:"stzh-vbz-ticker__icon",name:"construction"}),this.localization.constructionsTitle))),e("div",{key:"44a4551299a32dfc3ae518cce39a7bce8748961a",class:"stzh-vbz-ticket__lines"},e("div",{key:"5be3b7afc315cd63c45cabd6446f4d70489ae2e3",class:"stzh-vbz-ticker__chips",role:"list"},this.linesWithConstructions.map((t=>e("div",{class:"stzh-vbz-ticker__chip",role:"listitem"},e("stzh-tooltip",{class:"stzh-vbz-ticker__tooltip"},e("stzh-vbz-linechip",{line:t.line,alert:t.alert}),e("div",{class:"stzh-vbz-ticker__tooltip-content",slot:"content"},t.disturbances.map((t=>this.renderDisturbance(t))))))))))),e("div",{key:"3fb0a52e39a6f86cce7a9a30934b38451f254735",class:"stzh-vbz-ticker__link"},e("slot",{key:"cced6614e92101ac671c0186ab9e8c51bd4a4634",name:"link"})))))}get element(){return a(this)}static get watchers(){return{localization:["localizationWatcher"],api:["apiWatcher"],dateAdapter:["dateAdapterWatcher"],data:["dataWatcher"]}}};z.style=n;export{z as stzh_vbz_ticker};
|
|
2
|
+
//# sourceMappingURL=p-357ce1c2.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["stzhVbzTickerCss","StzhVbzTickerStyle0","StzhVbzTicker","this","globalDisturbances","linesWithDisturbances","linesWithConstructions","counter","VBZ","DISTURBANCE_GLOBAL","DISTURBANCE_INFORMATION","DISTURBANCE_CONSTRUCTION","DISTURBANCE_NORMAL","DISTURBANCE_EVENT","DISTURBANCE_BUS","localizationWatcher","collator","Intl","Collator","localization","$locale","numeric","apiWatcher","newValue","apiUrl","api","replace","includes","Date","now","data","axios","get","dateAdapterWatcher","dateAdapter","window","stzhComponents","utils","createFormatParseAdapter","$formats","$globals","dataWatcher","_data","JSON","parse","linesToDisplay","_b","_a","Message","forEach","message","urls","channel","filter","name","CHANNEL_TICKER","url","map","reduce","a","b","concat","infoUrl","find","indexOf","CHANNEL_INFO_URL_FILTER","baseType","BASE_TYPE_GLOBAL","push","id","head","category","startDate","sDate","sTime","endDate","eDate","eTime","altStart","altEnd","affectedProduct","affectedLines","product","lineId","line","cls","disturbances","alert","Object","keys","key","findIndex","disturbance","sort","compare","componentWillLoad","fetchTranslations","element","renderDisturbance","h","class","formatSpan","size","href","moreInfo","target","icon","moreInfoLink","render","classes","Host","Fragment","disturbancesTitle","role","slot","constructionsTitle"],"sources":["src/components/CMS/VBZ/stzh-vbz-ticker/stzh-vbz-ticker.scss?tag=stzh-vbz-ticker&encapsulation=scoped","src/components/CMS/VBZ/stzh-vbz-ticker/stzh-vbz-ticker.tsx"],"sourcesContent":[":host {\n}\n\n.stzh-vbz-ticker {\n display: flex;\n flex-direction: column;\n position: relative;\n\n @include mq($from: medium) {\n flex-direction: row;\n align-items: flex-start;\n }\n\n &__content {\n display: flex;\n flex-direction: column;\n gap: var(--stzh-space-xsmall);\n }\n\n &__icon {\n --size: #{iconSize(\"small\")};\n margin-right: space(\"xsmall\");\n }\n\n &__title {\n @include font;\n @include fontCurve(\"p1\");\n display: flex;\n flex-wrap: wrap;\n }\n\n &__title-parts {\n display: flex;\n flex-wrap: wrap;\n margin: calc(#{space(\"xxxsmall\")} / -1) 0;\n }\n\n &__title-part {\n display: flex;\n align-items: center;\n white-space: nowrap;\n margin: space(\"xxxsmall\") 0;\n color: $colorGrey90;\n\n &:not(:last-child) {\n margin-right: space(\"large\");\n }\n\n &--major-events {\n color: $colorCoral;\n }\n\n &--disturbances {\n color: $colorError60;\n }\n }\n\n &__chips {\n display: flex;\n flex-wrap: wrap;\n gap: 0 var(--stzh-space-xsmall);\n }\n\n &__tooltip {\n --width: 334px;\n }\n\n &__disturbance {\n display: flex;\n align-items: flex-start;\n\n &:not(:first-child) {\n margin-top: space(\"small\");\n }\n }\n\n &__disturbance-title {\n @include font;\n @include fontSize(\"micro\");\n display: flex;\n }\n\n &__disturbance-date {\n @include font;\n @include fontSize(\"micro\");\n margin-top: space(\"xsmall\");\n }\n\n &__disturbance--type0 &__disturbance-title,\n &__disturbance--type2 &__disturbance-title {\n @include font(\"heavy\");\n }\n\n &__disturbance-icon {\n --size: #{iconSize(\"xsmall\")};\n margin-top: space(\"xxxsmall\");\n margin-right: space(\"xsmall\");\n }\n\n &__disturbance-link {\n margin-top: space(\"xsmall\");\n }\n}\n","import { Component, Element, Fragment, h, Host, Prop, Watch } from \"@stencil/core\";\n\nimport axios from \"axios\";\n\nimport { StzhLocaleAdapter } from \"../../../../index\";\n\nimport { VBZ, VbzTickerDisturbance, VbzTickerInfoUrl, VbzTickerLine } from \"../../../../index\";\n\nimport { StzhVbzTickerLocalizedText } from \"./stzh-vbz-ticker.localization\";\n\n/**\n * @slot link - Optional link to traffic situation\n */\n@Component({\n tag: \"stzh-vbz-ticker\",\n styleUrl: \"stzh-vbz-ticker.scss\",\n scoped: true,\n})\nexport class StzhVbzTicker {\n /** API URL (`{lang}` is replaced in the URL) */\n @Prop() api: string =\n \"https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}\";\n\n /** Data to pass in directly (alternative for API call) */\n @Prop() data: any = \"\";\n private _data: any;\n\n /** More info link (`{lang}` and `{id}` are replaced in the URL) */\n @Prop() moreInfoLink: string = \"https://zvv.ch/{lang}/fahrplan-und-informationen/verkehrslage.html?himIds={id}\";\n\n /**\n * Date adapter, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n */\n @Prop() dateAdapter: StzhLocaleAdapter;\n\n /** Translation strings. */\n @Prop() localization: StzhVbzTickerLocalizedText;\n\n @Element() element: HTMLStzhVbzTickerElement;\n\n private globalDisturbances: VbzTickerDisturbance[] = [];\n private linesWithDisturbances: VbzTickerLine[] = [];\n private linesWithConstructions: VbzTickerLine[] = [];\n private collator: Intl.Collator;\n\n private counter = {\n [`${VBZ.DISTURBANCE_GLOBAL}`]: 0,\n [`${VBZ.DISTURBANCE_INFORMATION}`]: 0,\n [`${VBZ.DISTURBANCE_CONSTRUCTION}`]: 0,\n [`${VBZ.DISTURBANCE_NORMAL}`]: 0,\n [`${VBZ.DISTURBANCE_EVENT}`]: 0,\n [`${VBZ.DISTURBANCE_BUS}`]: 0,\n };\n\n @Watch(\"localization\")\n localizationWatcher() {\n this.collator = new Intl.Collator(this.localization.$locale, {\n numeric: true,\n });\n }\n\n @Watch(\"api\")\n async apiWatcher(newValue: string) {\n if (!newValue) {\n return;\n }\n\n let apiUrl = this.api.replace(/\\{lang\\}/, this.localization.$locale);\n apiUrl = apiUrl + (apiUrl.includes(\"?\") ? \"&\" : \"?\") + Date.now();\n\n // load data from API\n const { data } = await axios.get(apiUrl);\n\n this.data = data;\n }\n\n @Watch(\"dateAdapter\")\n dateAdapterWatcher(newValue: StzhLocaleAdapter) {\n if (!newValue) {\n this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formats,\n this.localization.$globals,\n );\n }\n }\n\n @Watch(\"data\")\n async dataWatcher(newValue: any) {\n if (typeof newValue === \"string\") {\n this._data = JSON.parse(newValue);\n } else {\n this._data = newValue;\n }\n\n const linesToDisplay: { [key: string]: VbzTickerLine } = {};\n\n this._data?.Message?.forEach(message => {\n const urls: VbzTickerInfoUrl[] = message.channel\n .filter(channel => channel.name === VBZ.CHANNEL_TICKER && channel.url)\n .map(channel => channel.url)\n .reduce((a, b) => a.concat(b), []);\n\n const infoUrl = urls.find(url => url.url.indexOf(VBZ.CHANNEL_INFO_URL_FILTER) !== -1);\n\n if (message.baseType === VBZ.BASE_TYPE_GLOBAL) {\n this.counter[VBZ.DISTURBANCE_GLOBAL]++;\n\n this.globalDisturbances.push({\n id: message.id,\n head: message.head,\n category: message.category,\n baseType: message.baseType,\n startDate: new Date(`${message.sDate}T${message.sTime}+02:00`),\n endDate: new Date(`${message.eDate}T${message.eTime}+02:00`),\n altStart: message.altStart,\n altEnd: message.altEnd,\n infoUrl: infoUrl,\n });\n } else {\n this.counter[message.category]++;\n }\n\n // don't add to linesWithDisturbances if no line/product has been linked to\n // or if it is a information disturbance or global\n if (\n message.affectedProduct &&\n message.category !== VBZ.DISTURBANCE_INFORMATION &&\n message.baseType !== VBZ.BASE_TYPE_GLOBAL\n ) {\n const affectedLines = [];\n\n message.affectedProduct.forEach(product => {\n if (typeof linesToDisplay[product.lineId] === \"undefined\") {\n linesToDisplay[product.lineId] = {\n line: product.line,\n name: product.name,\n category: product.cls,\n disturbances: [],\n alert: false,\n };\n }\n\n if (message.category === VBZ.DISTURBANCE_EVENT || message.category === VBZ.DISTURBANCE_GLOBAL) {\n linesToDisplay[product.lineId].alert = true;\n }\n\n // only add disturbance message to line if it was not already added (avoiding same message twice)\n if (!affectedLines.includes(product.lineId)) {\n affectedLines.push(product.lineId);\n\n linesToDisplay[product.lineId].disturbances.push({\n id: message.id,\n head: message.head,\n category: message.category,\n baseType: message.baseType,\n startDate: new Date(`${message.sDate}T${message.sTime}+02:00`),\n endDate: new Date(`${message.eDate}T${message.eTime}+02:00`),\n altStart: message.altStart,\n altEnd: message.altEnd,\n infoUrl: infoUrl,\n });\n }\n });\n }\n });\n\n this.linesWithDisturbances = Object.keys(linesToDisplay)\n .map(key => linesToDisplay[key])\n .filter(\n line => line.disturbances.findIndex(disturbance => disturbance.category !== VBZ.DISTURBANCE_CONSTRUCTION) > -1,\n );\n\n this.linesWithConstructions = Object.keys(linesToDisplay)\n .map(key => linesToDisplay[key])\n .filter(\n line => line.disturbances.findIndex(disturbance => disturbance.category === VBZ.DISTURBANCE_CONSTRUCTION) > -1,\n );\n\n // sort by line name\n this.linesWithDisturbances.sort((a, b) => this.collator.compare(a.line, b.line));\n this.linesWithConstructions.sort((a, b) => this.collator.compare(a.line, b.line));\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"vbz-ticker\");\n this.localizationWatcher();\n }\n\n this.dateAdapterWatcher(this.dateAdapter);\n\n if (this.data) {\n await this.dataWatcher(this.data);\n } else {\n await this.apiWatcher(this.api);\n }\n }\n\n renderDisturbance(disturbance: VbzTickerDisturbance) {\n return (\n <div\n class={{\n \"stzh-vbz-ticker__disturbance\": true,\n [`stzh-vbz-ticker__disturbance--type${disturbance.category}`]: !!disturbance.category,\n }}\n >\n <div class=\"stzh-vbz-ticker__disturbance-text\">\n <div class=\"stzh-vbz-ticker__disturbance-title\">{disturbance.head}</div>\n\n <div class=\"stzh-vbz-ticker__disturbance-date\">\n {this.dateAdapter.formatSpan(\n disturbance.altStart || disturbance.startDate,\n disturbance.altEnd || disturbance.endDate,\n \"date\",\n )}\n </div>\n\n {disturbance.infoUrl ? (\n <stzh-link class=\"stzh-vbz-ticker__disturbance-link\" size=\"small\" href={disturbance.infoUrl.url}>\n {this.localization.moreInfo}\n </stzh-link>\n ) : (\n <stzh-link\n class=\"stzh-vbz-ticker__disturbance-link\"\n size=\"small\"\n target=\"_blank\"\n icon=\"external-link\"\n href={this.moreInfoLink.replace(/\\{lang\\}/, this.localization.$locale).replace(/\\{id\\}/, disturbance.id)}\n >\n {this.localization.moreInfo}\n </stzh-link>\n )}\n </div>\n </div>\n );\n }\n\n render() {\n const classes = {\n \"stzh-vbz-ticker\": true,\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-vbz-ticker__content\">\n {/* TODO: Old stuff currently in verification whether to redesign or remove. */}\n\n {/*{this.linesWithDisturbances.length === 0 && this.counter[VBZ.DISTURBANCE_GLOBAL] === 0 && (*/}\n {/* <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--no-disturbances\">*/}\n {/* <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"checkmark-circle\"></stzh-icon>*/}\n {/* {this.localization.noDisturbances}*/}\n {/* </div>*/}\n {/*)}*/}\n\n {/*{this.counter[DISTURBANCE_GLOBAL] > 0 && (*/}\n {/* <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--major-events\">*/}\n {/* <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"important-warning\"></stzh-icon>*/}\n {/* {this.localization.majorEventTitle}*/}\n {/* </div>*/}\n {/*)}*/}\n\n {/*<div class=\"stzh-vbz-ticker__description\">*/}\n {/* {this.counter[VBZ.DISTURBANCE_GLOBAL] > 0*/}\n {/* ? this.localization.globalDisturbance*/}\n {/* : this.localization.affectedLines}*/}\n {/*</div>*/}\n\n {/*{this.counter[VBZ.DISTURBANCE_GLOBAL] > 0 && (*/}\n {/* <div class=\"stzh-vbz-ticker__chip\" role=\"listitem\">*/}\n {/* <stzh-tooltip class=\"stzh-vbz-ticker__tooltip\">*/}\n {/* <stzh-vbz-linechip global></stzh-vbz-linechip>*/}\n {/* <div class=\"stzh-vbz-ticker__tooltip-content\" slot=\"content\">*/}\n {/* {this.globalDisturbances.map(disturbance => this.renderDisturbance(disturbance))}*/}\n {/* </div>*/}\n {/* </stzh-tooltip>*/}\n {/* </div>*/}\n {/*)}*/}\n\n {this.counter[VBZ.DISTURBANCE_NORMAL] > 0 && (\n <Fragment>\n <div class=\"stzh-vbz-ticker__title\">\n <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--disturbances\">\n <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"warning\"></stzh-icon>\n {this.localization.disturbancesTitle}\n </div>\n </div>\n <div class=\"stzh-vbz-ticket__lines\">\n <div class=\"stzh-vbz-ticker__chips\" role=\"list\">\n {this.linesWithDisturbances.map(line => (\n <div class=\"stzh-vbz-ticker__chip\" role=\"listitem\">\n <stzh-tooltip class=\"stzh-vbz-ticker__tooltip\">\n <stzh-vbz-linechip line={line.line} alert={line.alert}></stzh-vbz-linechip>\n <div class=\"stzh-vbz-ticker__tooltip-content\" slot=\"content\">\n {line.disturbances.map(disturbance => this.renderDisturbance(disturbance))}\n </div>\n </stzh-tooltip>\n </div>\n ))}\n </div>\n </div>\n </Fragment>\n )}\n\n {/* Constructions etc. */}\n {(this.counter[VBZ.DISTURBANCE_CONSTRUCTION] > 0 ||\n this.counter[VBZ.DISTURBANCE_EVENT] > 0 ||\n this.counter[VBZ.DISTURBANCE_BUS] > 0) && (\n <Fragment>\n <div class=\"stzh-vbz-ticker__title\">\n <div class=\"stzh-vbz-ticker__title-parts\">\n <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--others\">\n <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"construction\"></stzh-icon>\n {this.localization.constructionsTitle}\n </div>\n </div>\n </div>\n <div class=\"stzh-vbz-ticket__lines\">\n <div class=\"stzh-vbz-ticker__chips\" role=\"list\">\n {this.linesWithConstructions.map(line => (\n <div class=\"stzh-vbz-ticker__chip\" role=\"listitem\">\n <stzh-tooltip class=\"stzh-vbz-ticker__tooltip\">\n <stzh-vbz-linechip line={line.line} alert={line.alert}></stzh-vbz-linechip>\n <div class=\"stzh-vbz-ticker__tooltip-content\" slot=\"content\">\n {line.disturbances.map(disturbance => this.renderDisturbance(disturbance))}\n </div>\n </stzh-tooltip>\n </div>\n ))}\n </div>\n </div>\n </Fragment>\n )}\n\n <div class=\"stzh-vbz-ticker__link\">\n <slot name=\"link\"></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"names":["stzhVbzTickerCss","StzhVbzTickerStyle0","StzhVbzTicker","this","globalDisturbances","linesWithDisturbances","linesWithConstructions","counter","VBZ","DISTURBANCE_GLOBAL","DISTURBANCE_INFORMATION","DISTURBANCE_CONSTRUCTION","DISTURBANCE_NORMAL","DISTURBANCE_EVENT","DISTURBANCE_BUS","localizationWatcher","collator","Intl","Collator","localization","$locale","numeric","apiWatcher","newValue","apiUrl","api","replace","includes","Date","now","data","axios","get","dateAdapterWatcher","dateAdapter","window","stzhComponents","utils","createFormatParseAdapter","$formats","$globals","dataWatcher","_data","JSON","parse","linesToDisplay","_b","_a","Message","forEach","message","urls","channel","filter","name","CHANNEL_TICKER","url","map","reduce","a","b","concat","infoUrl","find","indexOf","CHANNEL_INFO_URL_FILTER","baseType","BASE_TYPE_GLOBAL","push","id","head","category","startDate","sDate","sTime","endDate","eDate","eTime","altStart","altEnd","affectedProduct","affectedLines","product","lineId","line","cls","disturbances","alert","Object","keys","key","findIndex","disturbance","sort","compare","componentWillLoad","fetchTranslations","element","renderDisturbance","h","class","formatSpan","size","href","moreInfo","target","icon","moreInfoLink","render","classes","Host","Fragment","disturbancesTitle","role","slot","constructionsTitle"],"sources":["src/components/CMS/VBZ/stzh-vbz-ticker/stzh-vbz-ticker.scss?tag=stzh-vbz-ticker&encapsulation=scoped","src/components/CMS/VBZ/stzh-vbz-ticker/stzh-vbz-ticker.tsx"],"sourcesContent":[":host {\n}\n\n.stzh-vbz-ticker {\n display: flex;\n flex-direction: column;\n position: relative;\n\n @include mq($from: medium) {\n flex-direction: row;\n align-items: flex-start;\n }\n\n &__content {\n display: flex;\n flex-direction: column;\n gap: var(--stzh-space-xsmall);\n }\n\n &__icon {\n --size: #{iconSize(\"small\")};\n margin-right: space(\"xsmall\");\n }\n\n &__title {\n @include font;\n @include fontCurve(\"p1\");\n display: flex;\n flex-wrap: wrap;\n }\n\n &__title-parts {\n display: flex;\n flex-wrap: wrap;\n margin: calc(#{space(\"xxxsmall\")} / -1) 0;\n }\n\n &__title-part {\n display: flex;\n align-items: center;\n white-space: nowrap;\n margin: space(\"xxxsmall\") 0;\n color: $colorGrey90;\n\n &:not(:last-child) {\n margin-right: space(\"large\");\n }\n\n &--major-events {\n color: $colorCoral;\n }\n\n &--disturbances {\n color: $colorError60;\n }\n }\n\n &__chips {\n display: flex;\n flex-wrap: wrap;\n gap: 0 var(--stzh-space-xsmall);\n }\n\n &__tooltip {\n --width: 334px;\n }\n\n &__disturbance {\n display: flex;\n align-items: flex-start;\n\n &:not(:first-child) {\n margin-top: space(\"small\");\n }\n }\n\n &__disturbance-title {\n @include font;\n @include fontSize(\"micro\");\n display: flex;\n }\n\n &__disturbance-date {\n @include font;\n @include fontSize(\"micro\");\n margin-top: space(\"xsmall\");\n }\n\n &__disturbance--type0 &__disturbance-title,\n &__disturbance--type2 &__disturbance-title {\n @include font(\"heavy\");\n }\n\n &__disturbance-icon {\n --size: #{iconSize(\"xsmall\")};\n margin-top: space(\"xxxsmall\");\n margin-right: space(\"xsmall\");\n }\n\n &__disturbance-link {\n margin-top: space(\"xsmall\");\n }\n}\n","import { Component, Element, Fragment, h, Host, Prop, Watch } from \"@stencil/core\";\n\nimport axios from \"axios\";\n\nimport { StzhLocaleAdapter } from \"../../../../index\";\n\nimport { VBZ, VbzTickerDisturbance, VbzTickerInfoUrl, VbzTickerLine } from \"../../../../index\";\n\nimport { StzhVbzTickerLocalizedText } from \"./stzh-vbz-ticker.localization\";\n\n/**\n * @slot link - Optional link to traffic situation\n */\n@Component({\n tag: \"stzh-vbz-ticker\",\n styleUrl: \"stzh-vbz-ticker.scss\",\n scoped: true,\n})\nexport class StzhVbzTicker {\n /** API URL (`{lang}` is replaced in the URL) */\n @Prop() api: string =\n \"https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}\";\n\n /** Data to pass in directly (alternative for API call) */\n @Prop() data: any = \"\";\n private _data: any;\n\n /** More info link (`{lang}` and `{id}` are replaced in the URL) */\n @Prop() moreInfoLink: string = \"https://zvv.ch/{lang}/fahrplan-und-informationen/verkehrslage.html?himIds={id}\";\n\n /**\n * Date adapter, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n */\n @Prop() dateAdapter: StzhLocaleAdapter;\n\n /** Translation strings. */\n @Prop() localization: StzhVbzTickerLocalizedText;\n\n @Element() element: HTMLStzhVbzTickerElement;\n\n private globalDisturbances: VbzTickerDisturbance[] = [];\n private linesWithDisturbances: VbzTickerLine[] = [];\n private linesWithConstructions: VbzTickerLine[] = [];\n private collator: Intl.Collator;\n\n private counter = {\n [`${VBZ.DISTURBANCE_GLOBAL}`]: 0,\n [`${VBZ.DISTURBANCE_INFORMATION}`]: 0,\n [`${VBZ.DISTURBANCE_CONSTRUCTION}`]: 0,\n [`${VBZ.DISTURBANCE_NORMAL}`]: 0,\n [`${VBZ.DISTURBANCE_EVENT}`]: 0,\n [`${VBZ.DISTURBANCE_BUS}`]: 0,\n };\n\n @Watch(\"localization\")\n localizationWatcher() {\n this.collator = new Intl.Collator(this.localization.$locale, {\n numeric: true,\n });\n }\n\n @Watch(\"api\")\n async apiWatcher(newValue: string) {\n if (!newValue) {\n return;\n }\n\n let apiUrl = this.api.replace(/\\{lang\\}/, this.localization.$locale);\n apiUrl = apiUrl + (apiUrl.includes(\"?\") ? \"&\" : \"?\") + Date.now();\n\n // load data from API\n const { data } = await axios.get(apiUrl);\n\n this.data = data;\n }\n\n @Watch(\"dateAdapter\")\n dateAdapterWatcher(newValue: StzhLocaleAdapter) {\n if (!newValue) {\n this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formats,\n this.localization.$globals,\n );\n }\n }\n\n @Watch(\"data\")\n async dataWatcher(newValue: any) {\n if (typeof newValue === \"string\") {\n this._data = JSON.parse(newValue);\n } else {\n this._data = newValue;\n }\n\n const linesToDisplay: { [key: string]: VbzTickerLine } = {};\n\n this._data?.Message?.forEach(message => {\n const urls: VbzTickerInfoUrl[] = message.channel\n .filter(channel => channel.name === VBZ.CHANNEL_TICKER && channel.url)\n .map(channel => channel.url)\n .reduce((a, b) => a.concat(b), []);\n\n const infoUrl = urls.find(url => url.url.indexOf(VBZ.CHANNEL_INFO_URL_FILTER) !== -1);\n\n if (message.baseType === VBZ.BASE_TYPE_GLOBAL) {\n this.counter[VBZ.DISTURBANCE_GLOBAL]++;\n\n this.globalDisturbances.push({\n id: message.id,\n head: message.head,\n category: message.category,\n baseType: message.baseType,\n startDate: new Date(`${message.sDate}T${message.sTime}+02:00`),\n endDate: new Date(`${message.eDate}T${message.eTime}+02:00`),\n altStart: message.altStart,\n altEnd: message.altEnd,\n infoUrl: infoUrl,\n });\n } else {\n this.counter[message.category]++;\n }\n\n // don't add to linesWithDisturbances if no line/product has been linked to\n // or if it is a information disturbance or global\n if (\n message.affectedProduct &&\n message.category !== VBZ.DISTURBANCE_INFORMATION &&\n message.baseType !== VBZ.BASE_TYPE_GLOBAL\n ) {\n const affectedLines = [];\n\n message.affectedProduct.forEach(product => {\n if (typeof linesToDisplay[product.lineId] === \"undefined\") {\n linesToDisplay[product.lineId] = {\n line: product.line,\n name: product.name,\n category: product.cls,\n disturbances: [],\n alert: false,\n };\n }\n\n if (message.category === VBZ.DISTURBANCE_EVENT || message.category === VBZ.DISTURBANCE_GLOBAL) {\n linesToDisplay[product.lineId].alert = true;\n }\n\n // only add disturbance message to line if it was not already added (avoiding same message twice)\n if (!affectedLines.includes(product.lineId)) {\n affectedLines.push(product.lineId);\n\n linesToDisplay[product.lineId].disturbances.push({\n id: message.id,\n head: message.head,\n category: message.category,\n baseType: message.baseType,\n startDate: new Date(`${message.sDate}T${message.sTime}+02:00`),\n endDate: new Date(`${message.eDate}T${message.eTime}+02:00`),\n altStart: message.altStart,\n altEnd: message.altEnd,\n infoUrl: infoUrl,\n });\n }\n });\n }\n });\n\n this.linesWithDisturbances = Object.keys(linesToDisplay)\n .map(key => linesToDisplay[key])\n .filter(\n line => line.disturbances.findIndex(disturbance => disturbance.category !== VBZ.DISTURBANCE_CONSTRUCTION) > -1,\n );\n\n this.linesWithConstructions = Object.keys(linesToDisplay)\n .map(key => linesToDisplay[key])\n .filter(\n line => line.disturbances.findIndex(disturbance => disturbance.category === VBZ.DISTURBANCE_CONSTRUCTION) > -1,\n );\n\n // sort by line name\n this.linesWithDisturbances.sort((a, b) => this.collator.compare(a.line, b.line));\n this.linesWithConstructions.sort((a, b) => this.collator.compare(a.line, b.line));\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"vbz-ticker\");\n this.localizationWatcher();\n }\n\n this.dateAdapterWatcher(this.dateAdapter);\n\n if (this.data) {\n await this.dataWatcher(this.data);\n } else {\n await this.apiWatcher(this.api);\n }\n }\n\n renderDisturbance(disturbance: VbzTickerDisturbance) {\n return (\n <div\n class={{\n \"stzh-vbz-ticker__disturbance\": true,\n [`stzh-vbz-ticker__disturbance--type${disturbance.category}`]: !!disturbance.category,\n }}\n >\n <div class=\"stzh-vbz-ticker__disturbance-text\">\n <div class=\"stzh-vbz-ticker__disturbance-title\">{disturbance.head}</div>\n\n <div class=\"stzh-vbz-ticker__disturbance-date\">\n {this.dateAdapter.formatSpan(\n disturbance.altStart || disturbance.startDate,\n disturbance.altEnd || disturbance.endDate,\n \"date\",\n )}\n </div>\n\n {disturbance.infoUrl ? (\n <stzh-link class=\"stzh-vbz-ticker__disturbance-link\" size=\"small\" href={disturbance.infoUrl.url}>\n {this.localization.moreInfo}\n </stzh-link>\n ) : (\n <stzh-link\n class=\"stzh-vbz-ticker__disturbance-link\"\n size=\"small\"\n target=\"_blank\"\n icon=\"external-link\"\n href={this.moreInfoLink.replace(/\\{lang\\}/, this.localization.$locale).replace(/\\{id\\}/, disturbance.id)}\n >\n {this.localization.moreInfo}\n </stzh-link>\n )}\n </div>\n </div>\n );\n }\n\n render() {\n const classes = {\n \"stzh-vbz-ticker\": true,\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-vbz-ticker__content\">\n {/* TODO: Old stuff currently in verification whether to redesign or remove. */}\n\n {/*{this.linesWithDisturbances.length === 0 && this.counter[VBZ.DISTURBANCE_GLOBAL] === 0 && (*/}\n {/* <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--no-disturbances\">*/}\n {/* <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"checkmark-circle\"></stzh-icon>*/}\n {/* {this.localization.noDisturbances}*/}\n {/* </div>*/}\n {/*)}*/}\n\n {/*{this.counter[DISTURBANCE_GLOBAL] > 0 && (*/}\n {/* <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--major-events\">*/}\n {/* <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"important-warning\"></stzh-icon>*/}\n {/* {this.localization.majorEventTitle}*/}\n {/* </div>*/}\n {/*)}*/}\n\n {/*<div class=\"stzh-vbz-ticker__description\">*/}\n {/* {this.counter[VBZ.DISTURBANCE_GLOBAL] > 0*/}\n {/* ? this.localization.globalDisturbance*/}\n {/* : this.localization.affectedLines}*/}\n {/*</div>*/}\n\n {/*{this.counter[VBZ.DISTURBANCE_GLOBAL] > 0 && (*/}\n {/* <div class=\"stzh-vbz-ticker__chip\" role=\"listitem\">*/}\n {/* <stzh-tooltip class=\"stzh-vbz-ticker__tooltip\">*/}\n {/* <stzh-vbz-linechip global></stzh-vbz-linechip>*/}\n {/* <div class=\"stzh-vbz-ticker__tooltip-content\" slot=\"content\">*/}\n {/* {this.globalDisturbances.map(disturbance => this.renderDisturbance(disturbance))}*/}\n {/* </div>*/}\n {/* </stzh-tooltip>*/}\n {/* </div>*/}\n {/*)}*/}\n\n {this.counter[VBZ.DISTURBANCE_NORMAL] > 0 && (\n <Fragment>\n <div class=\"stzh-vbz-ticker__title\">\n <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--disturbances\">\n <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"warning\"></stzh-icon>\n {this.localization.disturbancesTitle}\n </div>\n </div>\n <div class=\"stzh-vbz-ticket__lines\">\n <div class=\"stzh-vbz-ticker__chips\" role=\"list\">\n {this.linesWithDisturbances.map(line => (\n <div class=\"stzh-vbz-ticker__chip\" role=\"listitem\">\n <stzh-tooltip class=\"stzh-vbz-ticker__tooltip\">\n <stzh-vbz-linechip line={line.line} alert={line.alert}></stzh-vbz-linechip>\n <div class=\"stzh-vbz-ticker__tooltip-content\" slot=\"content\">\n {line.disturbances.map(disturbance => this.renderDisturbance(disturbance))}\n </div>\n </stzh-tooltip>\n </div>\n ))}\n </div>\n </div>\n </Fragment>\n )}\n\n {/* Constructions etc. */}\n {(this.counter[VBZ.DISTURBANCE_CONSTRUCTION] > 0 ||\n this.counter[VBZ.DISTURBANCE_EVENT] > 0 ||\n this.counter[VBZ.DISTURBANCE_BUS] > 0) && (\n <Fragment>\n <div class=\"stzh-vbz-ticker__title\">\n <div class=\"stzh-vbz-ticker__title-parts\">\n <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--others\">\n <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"construction\"></stzh-icon>\n {this.localization.constructionsTitle}\n </div>\n </div>\n </div>\n <div class=\"stzh-vbz-ticket__lines\">\n <div class=\"stzh-vbz-ticker__chips\" role=\"list\">\n {this.linesWithConstructions.map(line => (\n <div class=\"stzh-vbz-ticker__chip\" role=\"listitem\">\n <stzh-tooltip class=\"stzh-vbz-ticker__tooltip\">\n <stzh-vbz-linechip line={line.line} alert={line.alert}></stzh-vbz-linechip>\n <div class=\"stzh-vbz-ticker__tooltip-content\" slot=\"content\">\n {line.disturbances.map(disturbance => this.renderDisturbance(disturbance))}\n </div>\n </stzh-tooltip>\n </div>\n ))}\n </div>\n </div>\n </Fragment>\n )}\n\n <div class=\"stzh-vbz-ticker__link\">\n <slot name=\"link\"></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as s,a as e,g as i}from"./p-ef5985a3.js";import{a as r}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as s,a as e,g as i}from"./p-ef5985a3.js";import{a as r}from"./p-30d100f4.js";const a=".sc-stzh-microsite-teaserlist-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-microsite-teaserlist-h,[stzh-hidden].sc-stzh-microsite-teaserlist-h{display:none}.sc-stzh-microsite-teaserlist-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-microsite-teaserlist-h *.sc-stzh-microsite-teaserlist,.sc-stzh-microsite-teaserlist-h *.sc-stzh-microsite-teaserlist::before,.sc-stzh-microsite-teaserlist-h *.sc-stzh-microsite-teaserlist::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-microsite-teaserlist-h .has-focus.sc-stzh-microsite-teaserlist{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-microsite-teaserlist-h .stzh-fylingfocus-focused.sc-stzh-microsite-teaserlist{outline-style:none !important}.sc-stzh-microsite-teaserlist-h .stzh-fylingfocus-focused.sc-stzh-microsite-teaserlist::-moz-focus-inner{border:0 !important}.stzh-microsite-teaserlist__filter.sc-stzh-microsite-teaserlist{margin-bottom:var(--stzh-space-large)}@media screen and (min-width: 600px){.stzh-microsite-teaserlist__filter.sc-stzh-microsite-teaserlist{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-microsite-teaserlist__filter.sc-stzh-microsite-teaserlist{margin-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-microsite-teaserlist__filter.sc-stzh-microsite-teaserlist{margin-bottom:var(--stzh-space-xxxlarge)}}.stzh-microsite-teaserlist__show-more.sc-stzh-microsite-teaserlist{margin-top:var(--stzh-space-large);display:grid}@media screen and (min-width: 600px){.stzh-microsite-teaserlist__show-more.sc-stzh-microsite-teaserlist{margin-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-microsite-teaserlist__show-more.sc-stzh-microsite-teaserlist{margin-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-microsite-teaserlist__show-more.sc-stzh-microsite-teaserlist{margin-top:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 600px){.stzh-microsite-teaserlist__show-more.sc-stzh-microsite-teaserlist{justify-content:center}}";const h=a;const o=class{constructor(s){t(this,s);this._tags=[];this._tagChips=[];this._filteredItems=[];this._filteredSlicedItems=[];this._showMoreLink=false;this.handleChange=t=>{this.showItems=this._initialShowItems;this.activeFilter=typeof t.detail.value==="string"?t.detail.value:t.detail.value[0]||""};this.handleMoreClick=()=>{this.showItems=this.showItems+this.stepItems};this.localization=undefined;this.api=undefined;this.tags=[];this.showItems=6;this.stepItems=6;this.activeFilter="";this.items=[]}async filterHandler(){this._filteredItems=this.items.filter((t=>this.activeFilter!==""?t.tags.some((t=>this.activeFilter===t)):true));this._filteredSlicedItems=this._filteredItems.slice(0,this.showItems);this._showMoreLink=this.showItems<this._filteredItems.length}async tagsWatcher(){if(typeof this.tags==="string"){this._tags=JSON.parse(this.tags)}else{this._tags=this.tags}this._tagChips=this._tags.map((t=>({label:t.name,value:t.id,variant:"filter",size:"large",counter:(t.id?this.items.filter((s=>s.tags.indexOf(t.id)>-1)).length:this.items.length).toString()})))}async apiWatcher(t){if(!t){return}let s=this.api.replace(/\{lang\}/,this.localization.$locale);const{data:e}=await r.get(s);this.items=e.items;this.showItems=this._initialShowItems}async componentWillLoad(){this._initialShowItems=this.showItems;if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"microsite-teaserlist")}await this.apiWatcher(this.api)}render(){const t={"stzh-microsite-teaserlist":true};return s(e,{key:"b53c6510bccb9ee924437b95c7c002b4620a5ec4"},s("div",{key:"b6ba7dbb1ebcd2f4a6bed1e662382a8958dac522",class:t},this._tagChips.length>0&&s("stzh-chipselect",{key:"b2bae6e0822a2aa9b15dad2f43a703a2688c5fbd","hide-optional":true,"label-hidden":true,class:"stzh-microsite-teaserlist__filter",label:this.localization.tagsLabel,data:this._tagChips,onStzhChange:this.handleChange}),s("stzh-cardlist",{key:"d01547769339006074ad6d69bf43b38b3a05e055",layout:"teasers"},this._filteredSlicedItems.map((t=>s("stzh-card",{href:t.link},t.image&&s("stzh-ratio",{slot:"image"},s("img",{src:t.image})),t.title&&s("div",{slot:"heading"},t.title),t.description&&s("div",{slot:"content"},t.description))))),this._showMoreLink&&s("div",{key:"66b59a4ee337a02ee14e7024bccc6c15d440de56",class:"stzh-microsite-teaserlist__show-more"},s("stzh-button",{key:"2a92713a2e4df43de97fb29b0a416e63ff275690",variant:"secondary",label:this.localization.showMore,onClick:this.handleMoreClick}))))}get element(){return i(this)}static get watchers(){return{items:["filterHandler","tagsWatcher"],showItems:["filterHandler"],activeFilter:["filterHandler"],tags:["tagsWatcher"],api:["apiWatcher"]}}};o.style=h;export{o as stzh_microsite_teaserlist};
|
|
2
|
+
//# sourceMappingURL=p-81223fd0.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,c as e,h as t,F as a,a as i,g as r}from"./p-ef5985a3.js";import{a as h}from"./p-1b0f45c6.js";import{r as n,h as c}from"./p-09b5eb01.js";import{m as d,a as l,r as o}from"./p-f4adb3cd.js";import{d as m}from"./p-6997324b.js";import"./p-dae15605.js";import"./p-1ab64d01.js";const f=':host{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;}:host[hidden],:host[stzh-hidden]{display:none}:host::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host *,:host *::before,:host *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-search{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;--filter-background-color:var(\n --stzh-search-filter-background-color,\n var(--stzh-color-grey10)\n );--grid-template-areas:"filters-main filters-main filters-main filters-main"\n "results results results results"}stzh-search[hidden],stzh-search[stzh-hidden]{display:none}stzh-search::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}stzh-search *,stzh-search *::before,stzh-search *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}stzh-search .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}stzh-search .stzh-fylingfocus-focused{outline-style:none !important}stzh-search .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}@media screen and (min-width: 900px){stzh-search{--grid-template-areas:"filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main"\n "results results results results results results results results"}}@media screen and (min-width: 1260px){stzh-search{--grid-template-areas:"filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main"\n ". . results results results results results results results results . ."}}stzh-search:where([has-aside-filters]:not([hide-aside-filters]:not([hide-aside-filters=false]))){--grid-template-areas:"filters-main filters-main filters-main filters-main"\n "filters-aside filters-aside filters-aside filters-aside"\n "results results results results"}@media screen and (min-width: 900px){stzh-search:where([has-aside-filters]:not([hide-aside-filters]:not([hide-aside-filters=false]))){--grid-template-areas:"filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main"\n "filters-aside filters-aside filters-aside filters-aside filters-aside filters-aside filters-aside filters-aside"\n "results results results results results results results results"}}@media screen and (min-width: 1260px){stzh-search:where([has-aside-filters]:not([hide-aside-filters]:not([hide-aside-filters=false]))){--grid-template-areas:"filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main"\n "filters-aside filters-aside filters-aside filters-aside results results results results results results results results"}}@media screen and (min-width: 1260px){stzh-search:where([variant=teaser]:not([has-aside-filters])),stzh-search:where([fullwidth=true]:not([has-aside-filters])){--grid-template-areas:"filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main"\n "results results results results results results results results results results results results"}}.stzh-search{column-gap:var(--stzh-grid-gutter);display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));grid-template-areas:var(--grid-template-areas);}@media screen and (min-width: 600px){.stzh-search{column-gap:var(--stzh-grid-gutter-small)}}@media screen and (min-width: 900px){.stzh-search{column-gap:var(--stzh-grid-gutter-medium)}}@media screen and (min-width: 1260px){.stzh-search{column-gap:var(--stzh-grid-gutter-large)}}@media screen and (min-width: 1600px){.stzh-search{column-gap:var(--stzh-grid-gutter-ultra)}}@media screen and (min-width: 900px){.stzh-search{grid-template-columns:repeat(8, minmax(0, 1fr))}}@media screen and (min-width: 1260px){.stzh-search{grid-template-columns:repeat(12, minmax(0, 1fr))}}.stzh-search__header-heading{margin-bottom:var(--stzh-space-xsmall)}@media screen and (min-width: 600px){.stzh-search__header-heading{margin-bottom:var(--stzh-space-small)}}@media screen and (min-width: 900px){.stzh-search__header-heading{margin-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-search__header-heading{margin-bottom:var(--stzh-space-xlarge)}}.stzh-search__filters-main{grid-area:filters-main}.stzh-search__filters-main:not(:empty){padding:var(--stzh-space-large);background-color:var(--filter-background-color)}@media screen and (min-width: 600px){.stzh-search__filters-main:not(:empty){padding:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search__filters-main:not(:empty){padding:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-search__filters-main:not(:empty){padding:var(--stzh-space-xxxlarge)}}.stzh-search__filters-aside{grid-area:filters-aside}.stzh-search__filters-aside:not(:empty){padding:var(--stzh-space-large);background-color:var(--filter-background-color)}@media screen and (min-width: 600px){.stzh-search__filters-aside:not(:empty){padding:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search__filters-aside:not(:empty){padding:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-search__filters-aside:not(:empty){padding:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 1260px){.stzh-search__filters-aside:not(:empty){background-color:transparent;padding:0}}.stzh-search__filters-aside-heading{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-curve-h4-default-font-size, var(--stzh-font-milli-font-size));line-height:var(--stzh-font-curve-h4-default-text-line-height, var(--stzh-font-milli-text-line-height));letter-spacing:var(--stzh-font-curve-h4-default-text-letter-spacing);padding-bottom:var(--stzh-space-xxsmall);color:var(--stzh-color-primary70);display:none}@media screen and (min-width: 600px){.stzh-search__filters-aside-heading{font-size:var(--stzh-font-curve-h4-small-font-size, var(--stzh-font-centi-font-size));line-height:var(--stzh-font-curve-h4-small-text-line-height, var(--stzh-font-centi-text-line-height));letter-spacing:var(--stzh-font-curve-h4-small-text-letter-spacing)}}@media screen and (min-width: 1260px){.stzh-search__filters-aside-heading{font-size:var(--stzh-font-curve-h4-large-font-size, var(--stzh-font-deci-font-size));line-height:var(--stzh-font-curve-h4-large-text-line-height, var(--stzh-font-deci-text-line-height));letter-spacing:var(--stzh-font-curve-h4-large-text-letter-spacing)}}@media screen and (min-width: 1600px){.stzh-search__filters-aside-heading{font-size:var(--stzh-font-curve-h4-ultra-font-size, var(--stzh-font-deca-font-size));line-height:var(--stzh-font-curve-h4-ultra-text-line-height, var(--stzh-font-deca-text-line-height));letter-spacing:var(--stzh-font-curve-h4-ultra-text-letter-spacing, var(--stzh-font-deca-text-letter-spacing))}}@media screen and (min-width: 900px){.stzh-search__filters-aside-heading{padding-bottom:var(--stzh-space-xsmall)}}@media screen and (min-width: 1260px){.stzh-search__filters-aside-heading{padding-bottom:var(--stzh-space-small)}}@media screen and (min-width: 1260px){.stzh-search__filters-aside-heading{display:block}}@media screen and (min-width: 1260px){.stzh-search stzh-button.stzh-search__filters-aside-details-trigger{display:none}}@media screen and (min-width: 1260px){.stzh-search__filters-aside-inner{position:sticky;top:calc(\n var(--stzh-header-metabar-height, 0px) *\n var(--stzh-header-is-stuck, 0) + var(--stzh-space-medium)\n );transition:top var(--stzh-base-transition-animation-speed);width:calc(\n 100% + var(--stzh-grid-gutter-large) - var(--stzh-space-xxxxlarge)\n )}}@media screen and (min-width: 1600px){.stzh-search__filters-aside-inner{width:calc(\n 100% + var(--stzh-grid-gutter-ultra) - var(--stzh-space-xxxxlarge)\n )}}.stzh-search__results-wrapper{grid-area:results;display:grid;--stzh-datalist-grid-template-areas:"list list list list list list list list"}.stzh-search__results-header{display:flex;flex-direction:column}@media screen and (min-width: 900px){.stzh-search__results-header{flex-direction:row;align-items:center}}.stzh-search__results-sort{display:flex}.stzh-search__results-heading,.stzh-search__results-empty,.stzh-search__results,.stzh-search__action-more{transition-property:opacity;transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-search__results-text,.stzh-search__results-sort,.stzh-search__results-subscribe{margin-bottom:var(--stzh-space-medium)}@media screen and (min-width: 600px){.stzh-search__results-text,.stzh-search__results-sort,.stzh-search__results-subscribe{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-search__results-text,.stzh-search__results-sort,.stzh-search__results-subscribe{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-search__results-text,.stzh-search__results-sort,.stzh-search__results-subscribe{margin-bottom:var(--stzh-space-xxlarge)}}.stzh-search__results-heading{margin-bottom:var(--stzh-space-xsmall)}@media screen and (min-width: 600px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-small)}}@media screen and (min-width: 900px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 900px) and (min-width: 600px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 900px) and (min-width: 900px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px) and (min-width: 1260px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-xxlarge)}}.stzh-search__results-item{display:contents}.stzh-search__actions-wrapper{display:flex;justify-content:center}.stzh-search__actions-wrapper:not(:empty){margin-top:var(--stzh-space-large)}@media screen and (min-width: 600px){.stzh-search__actions-wrapper:not(:empty){margin-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search__actions-wrapper:not(:empty){margin-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-search__actions-wrapper:not(:empty){margin-top:var(--stzh-space-xxxlarge)}}.stzh-search__empty-text{margin-bottom:var(--stzh-space-medium)}@media screen and (min-width: 600px){.stzh-search__empty-text{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-search__empty-text{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-search__empty-text{margin-bottom:var(--stzh-space-xxlarge)}}.stzh-search__loader{margin-top:var(--stzh-space-large)}@media screen and (min-width: 600px){.stzh-search__loader{margin-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search__loader{margin-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-search__loader{margin-top:var(--stzh-space-xxxlarge)}}.stzh-search__filters-main-chips{margin-top:var(--stzh-space-large)}@media screen and (min-width: 600px){.stzh-search__filters-main-chips{margin-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search__filters-main-chips{margin-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-search__filters-main-chips{margin-top:var(--stzh-space-xxxlarge)}}.stzh-search--teaser .stzh-search__actions-wrapper{justify-content:flex-start}@media screen and (max-width: 1259px){.stzh-search--has-results-shown .stzh-search__results-wrapper{margin-top:var(--stzh-space-xxxxlarge)}}@media screen and (max-width: 1259px) and (min-width: 600px){.stzh-search--has-results-shown .stzh-search__results-wrapper{margin-top:var(--stzh-space-big)}}@media screen and (max-width: 1259px) and (min-width: 900px){.stzh-search--has-results-shown .stzh-search__results-wrapper{margin-top:var(--stzh-space-big)}}@media screen and (max-width: 1259px) and (min-width: 1260px){.stzh-search--has-results-shown .stzh-search__results-wrapper{margin-top:var(--stzh-space-huge)}}@media screen and (min-width: 1260px){.stzh-search--has-results-shown .stzh-search__filters-main,.stzh-search--has-filters-aside .stzh-search__filters-main{margin-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px) and (min-width: 900px){.stzh-search--has-results-shown .stzh-search__filters-main,.stzh-search--has-filters-aside .stzh-search__filters-main{margin-bottom:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 1260px) and (min-width: 1260px){.stzh-search--has-results-shown .stzh-search__filters-main,.stzh-search--has-filters-aside .stzh-search__filters-main{margin-bottom:var(--stzh-space-xxxxlarge)}}@media screen and (max-width: 1259px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__results-wrapper{margin-top:var(--stzh-space-large)}}@media screen and (max-width: 1259px) and (min-width: 600px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__results-wrapper{margin-top:var(--stzh-space-xlarge)}}@media screen and (max-width: 1259px) and (min-width: 900px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__results-wrapper{margin-top:var(--stzh-space-xxlarge)}}@media screen and (max-width: 1259px) and (min-width: 1260px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__results-wrapper{margin-top:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 1260px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__filters-main,.stzh-search--has-filters-aside.stzh-search--teaser .stzh-search__filters-main{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 1260px) and (min-width: 600px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__filters-main,.stzh-search--has-filters-aside.stzh-search--teaser .stzh-search__filters-main{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px) and (min-width: 900px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__filters-main,.stzh-search--has-filters-aside.stzh-search--teaser .stzh-search__filters-main{margin-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px) and (min-width: 1260px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__filters-main,.stzh-search--has-filters-aside.stzh-search--teaser .stzh-search__filters-main{margin-bottom:var(--stzh-space-xxxlarge)}}.stzh-search--has-filters-main.stzh-search--has-filters-aside .stzh-search__filters-main:not(:empty){padding-bottom:var(--stzh-space-medium)}@media screen and (min-width: 600px){.stzh-search--has-filters-main.stzh-search--has-filters-aside .stzh-search__filters-main:not(:empty){padding-bottom:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-search--has-filters-main.stzh-search--has-filters-aside .stzh-search__filters-main:not(:empty){padding-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-search--has-filters-main.stzh-search--has-filters-aside .stzh-search__filters-main:not(:empty){padding-bottom:var(--stzh-space-xxlarge)}}.stzh-search--has-filters-main.stzh-search--has-filters-aside .stzh-search__filters-aside:not(:empty){padding-top:0px}.stzh-search--has-hidden-main-filters .stzh-search__filters-main{display:none}.stzh-search--has-hidden-aside-filters .stzh-search__filters-aside{display:none}.stzh-search--has-hidden-main-filters .stzh-search__results-wrapper,.stzh-search--has-hidden-main-filters.stzh-search--teaser .stzh-search__results-wrapper{margin-top:0px}.stzh-search--is-loading .stzh-search__results-heading,.stzh-search--is-loading .stzh-search__results-sort,.stzh-search--is-loading .stzh-search__results-empty,.stzh-search--is-loading .stzh-search__results,.stzh-search--is-loading .stzh-search__action-more{opacity:0.5}.stzh-search--is-breakout{--filter-background-color:var(--stzh-color-cobaltblue20);background-color:var(--stzh-color-white)}.stzh-search--is-breakout .stzh-search{padding-left:1.25rem;padding-right:1.25rem}@media screen and (min-width: 600px){.stzh-search--is-breakout .stzh-search{padding-left:2rem;padding-right:2rem}}@media screen and (min-width: 900px){.stzh-search--is-breakout .stzh-search{padding-left:2.5rem;padding-right:2.5rem}}@media screen and (min-width: 1260px){.stzh-search--is-breakout .stzh-search{padding-left:4rem;padding-right:4rem}}@media screen and (min-width: 1600px){.stzh-search--is-breakout .stzh-search{padding-left:calc((100vw - 84.25rem) / 2);padding-right:calc((100vw - 84.25rem) / 2)}}.stzh-search--is-breakout .stzh-search__header-wrapper{background-color:var(--stzh-color-cobaltblue20)}.stzh-search--is-breakout .stzh-search__filters-main{padding-left:1.25rem;padding-right:1.25rem;position:relative;left:50%;right:50%;margin-left:calc(-50vw + var(--stzh-scrollbar-width) / 2);margin-right:calc(-50vw + var(--stzh-scrollbar-width) / 2);width:calc(100vw - var(--stzh-scrollbar-width));max-width:calc(100vw - var(--stzh-scrollbar-width))}@media screen and (min-width: 600px){.stzh-search--is-breakout .stzh-search__filters-main{padding-left:2rem;padding-right:2rem}}@media screen and (min-width: 900px){.stzh-search--is-breakout .stzh-search__filters-main{padding-left:2.5rem;padding-right:2.5rem}}@media screen and (min-width: 1260px){.stzh-search--is-breakout .stzh-search__filters-main{padding-left:4rem;padding-right:4rem}}@media screen and (min-width: 1600px){.stzh-search--is-breakout .stzh-search__filters-main{padding-left:calc((100vw - 84.25rem) / 2);padding-right:calc((100vw - 84.25rem) / 2)}}.stzh-search--is-breakout .stzh-search__header{margin-left:1.25rem;margin-right:1.25rem;padding-top:var(--stzh-space-large);background-color:var(--stzh-color-cobaltblue20);display:flex;justify-content:space-between}@media screen and (min-width: 600px){.stzh-search--is-breakout .stzh-search__header{margin-left:2rem;margin-right:2rem}}@media screen and (min-width: 900px){.stzh-search--is-breakout .stzh-search__header{margin-left:2.5rem;margin-right:2.5rem}}@media screen and (min-width: 1260px){.stzh-search--is-breakout .stzh-search__header{margin-left:4rem;margin-right:4rem}}@media screen and (min-width: 1600px){.stzh-search--is-breakout .stzh-search__header{margin-left:auto;margin-right:auto;max-width:84.25rem}}@media screen and (min-width: 600px){.stzh-search--is-breakout .stzh-search__header{padding-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search--is-breakout .stzh-search__header{padding-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-search--is-breakout .stzh-search__header{padding-top:var(--stzh-space-xxxlarge)}}';const z=f;function p(s,e){return`\n <stzh-card-${s.variant==="teaser"?"superteaser":"searchresult"}\n href="{href}"\n dateline="{dateline}"\n tag="{tag}"\n topic="{topic}"\n service="{service}"\n event-location="{eventLocation}"\n hyphens-enabled="${this.hyphensEnabled}"\n ${e.eventDateStart&&'event-date-start="{eventDateStart}"'}\n ${e.eventDateEnd&&'event-date-end="{eventDateEnd}"'}\n download-heading="{downloadHeading}"\n meta='{meta}'\n breadcrumb-items='{breadcrumbItems}'\n download-meta='{downloadMeta}'\n datalist-items='{datalistItems}'\n ${e.imagePosition&&'image-position="{imagePosition}"'}\n ${e.download&&'download="{download}"'}\n style="\n ${e.serviceBackgroundColor?"--service-background-color: {serviceBackgroundColor};":""}\n ${e.serviceColor?"--service-color: {serviceColor};":""}\n "\n >\n <div slot="heading">{heading}</div>\n <div slot="description">{description}</div>\n ${e.image?e.imagePosition==="right"?`<img src="${e.image}" slot="image" />`:`<stzh-ratio ${s.variant==="teaser"?'ratio="2:1"':'ratio="21:9" ratio-small="1:1"'} slot="image"><img src="${e.image}" /></stzh-ratio>`:""}\n </stzh-card-${s.variant==="teaser"?"superteaser":"searchresult"}>\n `}function u(s){return{layout:s.variant==="teaser"?"teasers":"searchresults"}}const g=class{constructor(t){s(this,t);this.stzhOverlayCloseClick=e(this,"stzhOverlayCloseClick",7);this._sortOptions=[];this._showMoreLink=false;this.fetch=async(s=false,e=false)=>{var t,a;this.loading=true;this.error="";if(this.currentController){this.currentController.abort()}if(!this.hasRequiredParams&&!s){this.loading=false;return}let i=this.api.replace(/\{lang\}/gi,this.localization.$locale);let r=this.limit.toString();this.params.set("offset",s?this.results.length.toString():"0");if(e){const s=new URLSearchParams(location.search).get("search");if(s){const e=new URLSearchParams(s).get("limit");if(e){r=e}}}this.params.set("limit",r);this.currentController=new AbortController;let n={};try{const s=await h(i,{params:this.params,signal:this.currentController.signal});n=s.data}catch(s){this.error=this.localization.error}this.resultsHeading=n.resultsHeading||"";this.resultsText=n.resultsText||"";this.totalCount=((t=n.meta)===null||t===void 0?void 0:t.total)||0;if(n.error){this.error=n.message||this.localization.error}if(n.chipResults&&n.chipResults.length){this.chipResultsHeading=(a=n.chipResultsHeading)!==null&&a!==void 0?a:"";this.chipResults=n.chipResults}else{this.chipResultsHeading="";this.chipResults=[]}if(n.results){if(s){this.results=[...this.results,...n.results.map((s=>{var e;return Object.assign(Object.assign({},s),{html:this.renderResultTemplate(s.html||((e=n.templates)===null||e===void 0?void 0:e.result),s)})}))]}else{this.results=n.results.map((s=>{var e;return Object.assign(Object.assign({},s),{html:this.renderResultTemplate(s.html||((e=n.templates)===null||e===void 0?void 0:e.result),s)})}))}}if(!e&&!this.preventUpdateUrl){const s=new URLSearchParams(location.search);const e=new URLSearchParams(this.params);e.delete("offset");e.set("limit",this.results.length.toString());s.set("search",e.toString());window.history.replaceState(null,"",`${location.pathname}?${s}`)}if(e||!this.firstFetched){this.loading=false}else{window.setTimeout((()=>{this.loading=false}),this.debounceTime)}this.firstFetched=true};this.debouncedFetch=m(this.fetch,this.debounceTime);this.onDropdownSortChange=async s=>{const e=s.target;const t=await e.getValue();if(t){this._sortBy=t}await this.updateParams();this.debouncedFetch()};this.handleMainFilterChange=async()=>{if(this.autofetchMainFilters){await this.updateParams();this.debouncedFetch()}};this.handleAsideFilterChange=async()=>{if(this.autofetchAsideFilters){await this.updateParams();this.debouncedFetch()}};this.handleFormSubmit=async s=>{s.preventDefault();await this.updateParams();this.fetch()};this.handleMoreClick=()=>{this.fetch(true)};this.handleMediaChange=()=>{this.isDetailsOpen=d("large").matches};this.handleFormReset=async()=>{requestAnimationFrame((()=>{requestAnimationFrame((async()=>{await this.updateParams()}))}))};this.localization=undefined;this.variant="default";this.autofetchMainFilters=false;this.autofetchAsideFilters=false;this.hideMainFilters=false;this.hideAsideFilters=false;this.hideResultsHeading=false;this.sortBy=undefined;this.sortOptions=[];this.api="";this.debounceTime=500;this.limit=6;this.initialFetch=false;this.preventUpdateUrl=false;this.hyphensEnabled=false;this.templateResult=p;this.templateResultWrapperElement=function(){return"stzh-cardlist"};this.templateResultWrapperProps=u;this.resultHeadingLevel="3";this.emptyText=undefined;this.heading=undefined;this.emptyLinkHref=undefined;this.emptyLinkLabel=undefined;this.subscribeLabel="Subscribe";this.subscribePath=undefined;this.subscribeAdditionalQueryParameters=undefined;this.totalCount=0;this.loading=false;this.error="";this.results=[];this.chipResultsHeading=undefined;this.chipResults=[];this.resultsHeading=undefined;this.resultsText=undefined;this.hasRequiredParams=false;this.firstFetched=false;this.initiallyFetched=false;this.isDetailsOpen=false;this.isStzhAnchornavVisible=false}totalCountWatcher(){this._showMoreLink=this.totalCount>this.results.length}preventUpdateUrlWatcher(){this.updateParams()}sortOptionsWatcher(s){if(typeof s==="string"){this._sortOptions=JSON.parse(s)}else{this._sortOptions=s}}sortByWatcher(s){if(typeof s==="string"){this._sortBy=s}else{this._sortBy=undefined}}renderResultTemplate(s,e){let t=s||(typeof this.templateResult==="function"?this.templateResult(this.element,e):this.templateResult);["href","heading","name","additionalInformation","numbers","dateline","description","image","imagePosition","tag","topic","service","serviceColor","serviceBackgroundColor","meta","breadcrumbItems","eventLocation","eventDateStart","eventDateEnd","download","downloadHeading","downloadMeta","datalistItems"].forEach((s=>{const a=new RegExp(`{${s}}`,"gi");let i=e[s]||"";if(["meta","breadcrumbItems","downloadMeta","datalistItems","numbers"].includes(s)&&i){i=JSON.stringify(i)}t=t.replace(a,i)}));return t}async updateParams(s=false){const e=()=>{const s=new FormData(this.formElement);this.params=new URLSearchParams(s);this.params.set("variant",this.variant)};if(s){const s=new URLSearchParams(location.search);let e=s.get("search");const t=s.get("q");const a=s.get("query");if(!e){if(a){e=`query=${a}`}else if(t){e=`q=${t}`}}if(e){this.initialFetch=true;const s=new URLSearchParams(e);[...new Set(s.keys())].forEach((e=>{const t=s.getAll(e);const a=Array.from(document.querySelectorAll(`:where(stzh-input,stzh-radiogroup,stzh-chipselect,stzh-amount,stzh-datepicker,stzh-monthyearpicker,stzh-timepicker,stzh-pagination,stzh-toggle)[name="${e}"]`));const i=Array.from(document.querySelectorAll(`:where(stzh-checkboxgroup)[name="${e}"]`));const r=Array.from(document.querySelectorAll(`:where(stzh-dropdown)[name="${e}"]`));a.forEach((s=>{s.value=t[0]}));i.forEach((s=>{s.value=t}));r.forEach((s=>{s.items=t}))}))}}await n();e();let t=true;const a=Array.from(this.element.querySelectorAll(":where(stzh-input)[required]"));const i=Array.from(this.element.querySelectorAll(":where(stzh-dropdown)[required]"));const r=Array.from(this.element.querySelectorAll(":where(stzh-monthyearpicker)[required]"));const h=Array.from(this.element.querySelectorAll(":where(stzh-amount,stzh-radiogroup,stzh-chipselect,stzh-datepicker,stzh-monthyearpicker,stzh-timepicker,stzh-pagination,stzh-toggle)[required]"));const c=Array.from(this.element.querySelectorAll(":where(stzh-checkbox)[required]"));c.forEach((e=>{const a=!e.checked;if(!s){e.invalid=a}if(a){t=false}}));a.forEach((e=>{const a=e.value===""||e.minlength&&e.minlength>e.value.length||e.maxlength&&e.maxlength<e.value.length;if(!s){e.invalid=a}if(a){t=false}}));i.forEach((e=>{const a=e.items.length===0;if(!s){e.invalid=a}if(a){t=false}}));h.forEach((e=>{const a=e.value.toString().length===0;if(!s){e.invalid=a}if(a){t=false}}));r.forEach((e=>{const a=e.value.toString().length===0;if(!s){e.invalidYear=a;e.invalidMonth=a}if(a){t=false}}));this.hasRequiredParams=t}async componentDidLoad(){this.isStzhAnchornavVisible=document.documentElement.style.getPropertyValue("--stzh-anchornav-is-visible")==="1";await this.updateParams(true);if(this.initialFetch){await this.fetch(false,true);this.initiallyFetched=true}else{this.initiallyFetched=true}}async componentWillLoad(){if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"search")}this.isStzhAnchornavVisible=document.documentElement.style.getPropertyValue("--stzh-anchornav-is-visible")==="1";this.sortOptionsWatcher(this.sortOptions);this.sortByWatcher(this.sortBy)}connectedCallback(){l(this.handleMediaChange);this.handleMediaChange()}disconnectedCallback(){o(this.handleMediaChange)}renderResultsText(){return t("stzh-text",{class:"stzh-search__results-text",color:"primary",innerHTML:this.resultsText})}renderSubscribeButton(){const s=new URLSearchParams;let e=this.subscribeAdditionalQueryParameters;if(typeof this.subscribeAdditionalQueryParameters==="string"){try{e=JSON.parse(this.subscribeAdditionalQueryParameters)}catch(s){}}for(const t of e){for(const[e,a]of Object.entries(t)){if(a){s.set(e,a)}}}const a=new URLSearchParams(window.location.search);const i=a.get("search");if(i){const e=new URLSearchParams(i);for(const[t,a]of e.entries()){if(["variant","limit"].indexOf(t)===-1&&a){s.append(t,a)}}}const r=`${this.subscribePath}?${s.toString()}`;return t("div",{class:"stzh-search__results-subscribe"},t("stzh-button",{variant:"secondary",size:"small",href:r},this.subscribeLabel))}render(){const s=c(this.element,"filters-main");const e=c(this.element,"filters-aside");let r=true;if(s){const s=this.element.querySelector("[slot='filters-main'] stzh-chipselect");const e=this.element.querySelector("[slot='filters-main'] stzh-chipgroup");if(!s&&!e){r=false}}else{r=false}const h=(this.hasRequiredParams||this.firstFetched)&&this.firstFetched&&this.initiallyFetched;const n={"stzh-search":true,"stzh-search--has-filters-main":s,"stzh-search--has-filters-aside":e,"stzh-search--has-hidden-main-filters":this.hideMainFilters,"stzh-search--has-hidden-aside-filters":this.hideAsideFilters,"stzh-search--has-results-shown":h,"stzh-search--has-error-shown":!!this.error,"stzh-search--is-loading":this.loading,[`stzh-search--${this.variant}`]:!!this.variant};const d=typeof this.templateResultWrapperElement==="function"?this.templateResultWrapperElement(this.element):this.templateResultWrapperElement;const l=typeof this.templateResultWrapperProps==="function"?this.templateResultWrapperProps(this.element):this.templateResultWrapperProps;return t(i,{key:"0a3d32cfe0e507375c50c5ff7ce9091befca0b52","has-aside-filters":e,fullwidth:this.isStzhAnchornavVisible.toString()},t("form",{key:"4c95a41b47e3b77473142e0eebd8f9ebdfda5445",ref:s=>this.formElement=s,novalidate:true,class:n,onSubmit:this.handleFormSubmit,onReset:this.handleFormReset},t("div",{key:"f7bf9ce30724bf80e7a423d43b621f8c17e293cc",class:"stzh-search__filters-main",onStzhChange:this.handleMainFilterChange},!!this.heading&&t("stzh-heading",{key:"616b0091ee0dfef3b5d8f1f341411cdccb0a8503",class:"stzh-search__header-heading",curve:"h2"},this.heading),t("slot",{key:"3be1e0837eb14f81de6bfa4681b1fb99cd204ff2",name:"filters-main"}),!r&&this.chipResults.length>0&&t("div",{key:"debc00542d88235ad6dde745257d7bd0a595472e",class:"stzh-search__filters-main-chips"},this.chipResultsHeading&&t("stzh-text",{key:"42495008b843208affbb51a1b4150ae7635beaaf",font:"heavy",size:"milli",color:"primary"},this.chipResultsHeading),this.chipResults[0].options?t("stzh-chipgroup",null,this.chipResults.map((s=>t("stzh-dropdown",{label:s.label,name:s.value,variant:"filter",size:"large","no-search":true,"hide-optional":true,inline:true,options:s.options})))):t("stzh-chipselect",{multiple:true,name:"subject",label:this.chipResultsHeading,"label-hidden":true,data:this.chipResults.map((s=>({label:s.label,value:s.value,counter:`${s.amount}`,variant:"filter",size:"large"})))}))),e&&t(a,{key:"2da210bbda212eae023ffea44aab2d6924e3aa40"},t("div",{key:"b90d83f9bc098ff2ead2f63c4aa3931017120fa5",class:"stzh-search__filters-aside",onStzhChange:this.handleAsideFilterChange},t("div",{key:"f3f1c38058650652e12fe58b73cf7c776451bf9a",class:"stzh-search__filters-aside-inner"},t("div",{key:"475978cb850a3a6f96ae4402d174a0ea97e0bd77",class:"stzh-search__filters-aside-heading"},this.localization.moreFilter),t("stzh-details",{key:"dc2aa28b62b72f4b14e3ff6e40a802dc93a00baa",open:this.isDetailsOpen,class:"stzh-search__filters-aside-details"},t("stzh-button",{key:"f9fda211f32f6b262c855021a09d8ec54067b837",class:"stzh-search__filters-aside-details-trigger",variant:"tertiary-plain",size:"small",noPaddingLeft:true,showToggleIcon:true,iconPosition:"right",label:this.localization.moreFilter}),t("div",{key:"cf3a55b3f0a61bd63674b0d84c774fcc90b98f07",slot:"content"},t("slot",{key:"0186b6ccf32ceee9956b2879d55fd09dbb619843",name:"filters-aside"})))))),t("div",{key:"372b4529dcc1666085217d03b639c6a45c929cc6",class:"stzh-search__results-wrapper"},h&&t(a,{key:"5e4486f56a3218e9be6867140b5500234dc3be2a"},this.results.length===0?t(a,null,this.variant!=="teaser"&&this.resultsHeading&&!this.hideResultsHeading&&t("stzh-heading",{class:"stzh-search__results-heading",curve:"h3",level:this.resultHeadingLevel,innerHTML:this.resultsHeading}),this.resultsText&&this.renderResultsText(),this.subscribePath&&this.renderSubscribeButton(),this.emptyText&&t("stzh-text",{class:"stzh-search__empty-text",innerHTML:this.emptyText}),this.emptyLinkLabel&&this.emptyLinkHref&&t("div",{class:"stzh-search__empty-link-wrapper"},t("stzh-link",{href:this.emptyLinkHref,label:this.emptyLinkLabel}))):t(a,null,t("div",{class:"stzh-search__results-header"},this.variant!=="teaser"&&this.resultsHeading&&!this.hideResultsHeading&&t("stzh-heading",{class:"stzh-search__results-heading",curve:"h3",level:this.resultHeadingLevel,htmlContent:this.resultsHeading}),this._sortOptions.length>0&&t("div",{class:"stzh-search__results-sort"},t("stzh-dropdown",{"hide-optional":true,inline:true,"no-search":true,"no-wrap":true,class:"stzh-search__results-sort-dropdown",variant:"plain",size:"small",sizeMedium:"tiny",name:"sortby",items:[this._sortBy],options:this._sortOptions,onStzhChange:this.onDropdownSortChange}))),this.resultsText&&this.renderResultsText(),this.subscribePath&&this.renderSubscribeButton(),t(d,Object.assign({class:"stzh-search__results","max-3-columns":e},l),this.results.map((s=>t("div",{class:"stzh-search__results-item",innerHTML:s.html||""})))),t("div",{class:"stzh-search__actions-wrapper"},this._showMoreLink&&t("stzh-button",{variant:"secondary",class:"stzh-search__action-more",label:this.localization.showMore,onClick:this.handleMoreClick,disabled:this.loading,a11yDisabled:this.loading})))),this.error&&t("div",{key:"d27e6ae900e6f0e6b44f2c37df481e097ffcf038",class:"stzh-search__error"},t("stzh-message",{key:"a8a9900e69a167236ddd39d35a65adb28e8342c0",type:"error",label:this.error})),this.loading&&t("stzh-loader",{key:"f41802e338e0be014d37ee29dab344c8dfb5eec7",class:"stzh-search__loader"})),t("slot",{key:"081efb0cf4dd847771e0270c0d88483c7fd94ec9"})))}get element(){return r(this)}static get watchers(){return{totalCount:["totalCountWatcher"],results:["totalCountWatcher"],preventUpdateUrl:["preventUpdateUrlWatcher"],sortOptions:["sortOptionsWatcher"],sortBy:["sortByWatcher"]}}};g.style=z;export{g as stzh_search};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as s,c as e,h as t,F as a,a as i,g as r}from"./p-ef5985a3.js";import{a as h}from"./p-30d100f4.js";import{r as n,h as c}from"./p-09b5eb01.js";import{m as d,a as l,r as o}from"./p-f4adb3cd.js";import{d as m}from"./p-6997324b.js";import"./p-dae15605.js";import"./p-1ab64d01.js";const f=':host{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;}:host[hidden],:host[stzh-hidden]{display:none}:host::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host *,:host *::before,:host *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-search{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;--filter-background-color:var(\n --stzh-search-filter-background-color,\n var(--stzh-color-grey10)\n );--grid-template-areas:"filters-main filters-main filters-main filters-main"\n "results results results results"}stzh-search[hidden],stzh-search[stzh-hidden]{display:none}stzh-search::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}stzh-search *,stzh-search *::before,stzh-search *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}stzh-search .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}stzh-search .stzh-fylingfocus-focused{outline-style:none !important}stzh-search .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}@media screen and (min-width: 900px){stzh-search{--grid-template-areas:"filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main"\n "results results results results results results results results"}}@media screen and (min-width: 1260px){stzh-search{--grid-template-areas:"filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main"\n ". . results results results results results results results results . ."}}stzh-search:where([has-aside-filters]:not([hide-aside-filters]:not([hide-aside-filters=false]))){--grid-template-areas:"filters-main filters-main filters-main filters-main"\n "filters-aside filters-aside filters-aside filters-aside"\n "results results results results"}@media screen and (min-width: 900px){stzh-search:where([has-aside-filters]:not([hide-aside-filters]:not([hide-aside-filters=false]))){--grid-template-areas:"filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main"\n "filters-aside filters-aside filters-aside filters-aside filters-aside filters-aside filters-aside filters-aside"\n "results results results results results results results results"}}@media screen and (min-width: 1260px){stzh-search:where([has-aside-filters]:not([hide-aside-filters]:not([hide-aside-filters=false]))){--grid-template-areas:"filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main"\n "filters-aside filters-aside filters-aside filters-aside results results results results results results results results"}}@media screen and (min-width: 1260px){stzh-search:where([variant=teaser]:not([has-aside-filters])),stzh-search:where([fullwidth=true]:not([has-aside-filters])){--grid-template-areas:"filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main filters-main"\n "results results results results results results results results results results results results"}}.stzh-search{column-gap:var(--stzh-grid-gutter);display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));grid-template-areas:var(--grid-template-areas);}@media screen and (min-width: 600px){.stzh-search{column-gap:var(--stzh-grid-gutter-small)}}@media screen and (min-width: 900px){.stzh-search{column-gap:var(--stzh-grid-gutter-medium)}}@media screen and (min-width: 1260px){.stzh-search{column-gap:var(--stzh-grid-gutter-large)}}@media screen and (min-width: 1600px){.stzh-search{column-gap:var(--stzh-grid-gutter-ultra)}}@media screen and (min-width: 900px){.stzh-search{grid-template-columns:repeat(8, minmax(0, 1fr))}}@media screen and (min-width: 1260px){.stzh-search{grid-template-columns:repeat(12, minmax(0, 1fr))}}.stzh-search__header-heading{margin-bottom:var(--stzh-space-xsmall)}@media screen and (min-width: 600px){.stzh-search__header-heading{margin-bottom:var(--stzh-space-small)}}@media screen and (min-width: 900px){.stzh-search__header-heading{margin-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-search__header-heading{margin-bottom:var(--stzh-space-xlarge)}}.stzh-search__filters-main{grid-area:filters-main}.stzh-search__filters-main:not(:empty){padding:var(--stzh-space-large);background-color:var(--filter-background-color)}@media screen and (min-width: 600px){.stzh-search__filters-main:not(:empty){padding:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search__filters-main:not(:empty){padding:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-search__filters-main:not(:empty){padding:var(--stzh-space-xxxlarge)}}.stzh-search__filters-aside{grid-area:filters-aside}.stzh-search__filters-aside:not(:empty){padding:var(--stzh-space-large);background-color:var(--filter-background-color)}@media screen and (min-width: 600px){.stzh-search__filters-aside:not(:empty){padding:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search__filters-aside:not(:empty){padding:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-search__filters-aside:not(:empty){padding:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 1260px){.stzh-search__filters-aside:not(:empty){background-color:transparent;padding:0}}.stzh-search__filters-aside-heading{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-curve-h4-default-font-size, var(--stzh-font-milli-font-size));line-height:var(--stzh-font-curve-h4-default-text-line-height, var(--stzh-font-milli-text-line-height));letter-spacing:var(--stzh-font-curve-h4-default-text-letter-spacing);padding-bottom:var(--stzh-space-xxsmall);color:var(--stzh-color-primary70);display:none}@media screen and (min-width: 600px){.stzh-search__filters-aside-heading{font-size:var(--stzh-font-curve-h4-small-font-size, var(--stzh-font-centi-font-size));line-height:var(--stzh-font-curve-h4-small-text-line-height, var(--stzh-font-centi-text-line-height));letter-spacing:var(--stzh-font-curve-h4-small-text-letter-spacing)}}@media screen and (min-width: 1260px){.stzh-search__filters-aside-heading{font-size:var(--stzh-font-curve-h4-large-font-size, var(--stzh-font-deci-font-size));line-height:var(--stzh-font-curve-h4-large-text-line-height, var(--stzh-font-deci-text-line-height));letter-spacing:var(--stzh-font-curve-h4-large-text-letter-spacing)}}@media screen and (min-width: 1600px){.stzh-search__filters-aside-heading{font-size:var(--stzh-font-curve-h4-ultra-font-size, var(--stzh-font-deca-font-size));line-height:var(--stzh-font-curve-h4-ultra-text-line-height, var(--stzh-font-deca-text-line-height));letter-spacing:var(--stzh-font-curve-h4-ultra-text-letter-spacing, var(--stzh-font-deca-text-letter-spacing))}}@media screen and (min-width: 900px){.stzh-search__filters-aside-heading{padding-bottom:var(--stzh-space-xsmall)}}@media screen and (min-width: 1260px){.stzh-search__filters-aside-heading{padding-bottom:var(--stzh-space-small)}}@media screen and (min-width: 1260px){.stzh-search__filters-aside-heading{display:block}}@media screen and (min-width: 1260px){.stzh-search stzh-button.stzh-search__filters-aside-details-trigger{display:none}}@media screen and (min-width: 1260px){.stzh-search__filters-aside-inner{position:sticky;top:calc(\n var(--stzh-header-metabar-height, 0px) *\n var(--stzh-header-is-stuck, 0) + var(--stzh-space-medium)\n );transition:top var(--stzh-base-transition-animation-speed);width:calc(\n 100% + var(--stzh-grid-gutter-large) - var(--stzh-space-xxxxlarge)\n )}}@media screen and (min-width: 1600px){.stzh-search__filters-aside-inner{width:calc(\n 100% + var(--stzh-grid-gutter-ultra) - var(--stzh-space-xxxxlarge)\n )}}.stzh-search__results-wrapper{grid-area:results;display:grid;--stzh-datalist-grid-template-areas:"list list list list list list list list"}.stzh-search__results-header{display:flex;flex-direction:column}@media screen and (min-width: 900px){.stzh-search__results-header{flex-direction:row;align-items:center}}.stzh-search__results-sort{display:flex}.stzh-search__results-heading,.stzh-search__results-empty,.stzh-search__results,.stzh-search__action-more{transition-property:opacity;transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-search__results-text,.stzh-search__results-sort,.stzh-search__results-subscribe{margin-bottom:var(--stzh-space-medium)}@media screen and (min-width: 600px){.stzh-search__results-text,.stzh-search__results-sort,.stzh-search__results-subscribe{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-search__results-text,.stzh-search__results-sort,.stzh-search__results-subscribe{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-search__results-text,.stzh-search__results-sort,.stzh-search__results-subscribe{margin-bottom:var(--stzh-space-xxlarge)}}.stzh-search__results-heading{margin-bottom:var(--stzh-space-xsmall)}@media screen and (min-width: 600px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-small)}}@media screen and (min-width: 900px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 900px) and (min-width: 600px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 900px) and (min-width: 900px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px) and (min-width: 1260px){.stzh-search__results-heading{margin-bottom:var(--stzh-space-xxlarge)}}.stzh-search__results-item{display:contents}.stzh-search__actions-wrapper{display:flex;justify-content:center}.stzh-search__actions-wrapper:not(:empty){margin-top:var(--stzh-space-large)}@media screen and (min-width: 600px){.stzh-search__actions-wrapper:not(:empty){margin-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search__actions-wrapper:not(:empty){margin-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-search__actions-wrapper:not(:empty){margin-top:var(--stzh-space-xxxlarge)}}.stzh-search__empty-text{margin-bottom:var(--stzh-space-medium)}@media screen and (min-width: 600px){.stzh-search__empty-text{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-search__empty-text{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-search__empty-text{margin-bottom:var(--stzh-space-xxlarge)}}.stzh-search__loader{margin-top:var(--stzh-space-large)}@media screen and (min-width: 600px){.stzh-search__loader{margin-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search__loader{margin-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-search__loader{margin-top:var(--stzh-space-xxxlarge)}}.stzh-search__filters-main-chips{margin-top:var(--stzh-space-large)}@media screen and (min-width: 600px){.stzh-search__filters-main-chips{margin-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search__filters-main-chips{margin-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-search__filters-main-chips{margin-top:var(--stzh-space-xxxlarge)}}.stzh-search--teaser .stzh-search__actions-wrapper{justify-content:flex-start}@media screen and (max-width: 1259px){.stzh-search--has-results-shown .stzh-search__results-wrapper{margin-top:var(--stzh-space-xxxxlarge)}}@media screen and (max-width: 1259px) and (min-width: 600px){.stzh-search--has-results-shown .stzh-search__results-wrapper{margin-top:var(--stzh-space-big)}}@media screen and (max-width: 1259px) and (min-width: 900px){.stzh-search--has-results-shown .stzh-search__results-wrapper{margin-top:var(--stzh-space-big)}}@media screen and (max-width: 1259px) and (min-width: 1260px){.stzh-search--has-results-shown .stzh-search__results-wrapper{margin-top:var(--stzh-space-huge)}}@media screen and (min-width: 1260px){.stzh-search--has-results-shown .stzh-search__filters-main,.stzh-search--has-filters-aside .stzh-search__filters-main{margin-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px) and (min-width: 900px){.stzh-search--has-results-shown .stzh-search__filters-main,.stzh-search--has-filters-aside .stzh-search__filters-main{margin-bottom:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 1260px) and (min-width: 1260px){.stzh-search--has-results-shown .stzh-search__filters-main,.stzh-search--has-filters-aside .stzh-search__filters-main{margin-bottom:var(--stzh-space-xxxxlarge)}}@media screen and (max-width: 1259px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__results-wrapper{margin-top:var(--stzh-space-large)}}@media screen and (max-width: 1259px) and (min-width: 600px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__results-wrapper{margin-top:var(--stzh-space-xlarge)}}@media screen and (max-width: 1259px) and (min-width: 900px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__results-wrapper{margin-top:var(--stzh-space-xxlarge)}}@media screen and (max-width: 1259px) and (min-width: 1260px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__results-wrapper{margin-top:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 1260px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__filters-main,.stzh-search--has-filters-aside.stzh-search--teaser .stzh-search__filters-main{margin-bottom:var(--stzh-space-large)}}@media screen and (min-width: 1260px) and (min-width: 600px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__filters-main,.stzh-search--has-filters-aside.stzh-search--teaser .stzh-search__filters-main{margin-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px) and (min-width: 900px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__filters-main,.stzh-search--has-filters-aside.stzh-search--teaser .stzh-search__filters-main{margin-bottom:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px) and (min-width: 1260px){.stzh-search--has-results-shown.stzh-search--teaser .stzh-search__filters-main,.stzh-search--has-filters-aside.stzh-search--teaser .stzh-search__filters-main{margin-bottom:var(--stzh-space-xxxlarge)}}.stzh-search--has-filters-main.stzh-search--has-filters-aside .stzh-search__filters-main:not(:empty){padding-bottom:var(--stzh-space-medium)}@media screen and (min-width: 600px){.stzh-search--has-filters-main.stzh-search--has-filters-aside .stzh-search__filters-main:not(:empty){padding-bottom:var(--stzh-space-large)}}@media screen and (min-width: 900px){.stzh-search--has-filters-main.stzh-search--has-filters-aside .stzh-search__filters-main:not(:empty){padding-bottom:var(--stzh-space-xlarge)}}@media screen and (min-width: 1260px){.stzh-search--has-filters-main.stzh-search--has-filters-aside .stzh-search__filters-main:not(:empty){padding-bottom:var(--stzh-space-xxlarge)}}.stzh-search--has-filters-main.stzh-search--has-filters-aside .stzh-search__filters-aside:not(:empty){padding-top:0px}.stzh-search--has-hidden-main-filters .stzh-search__filters-main{display:none}.stzh-search--has-hidden-aside-filters .stzh-search__filters-aside{display:none}.stzh-search--has-hidden-main-filters .stzh-search__results-wrapper,.stzh-search--has-hidden-main-filters.stzh-search--teaser .stzh-search__results-wrapper{margin-top:0px}.stzh-search--is-loading .stzh-search__results-heading,.stzh-search--is-loading .stzh-search__results-sort,.stzh-search--is-loading .stzh-search__results-empty,.stzh-search--is-loading .stzh-search__results,.stzh-search--is-loading .stzh-search__action-more{opacity:0.5}.stzh-search--is-breakout{--filter-background-color:var(--stzh-color-cobaltblue20);background-color:var(--stzh-color-white)}.stzh-search--is-breakout .stzh-search{padding-left:1.25rem;padding-right:1.25rem}@media screen and (min-width: 600px){.stzh-search--is-breakout .stzh-search{padding-left:2rem;padding-right:2rem}}@media screen and (min-width: 900px){.stzh-search--is-breakout .stzh-search{padding-left:2.5rem;padding-right:2.5rem}}@media screen and (min-width: 1260px){.stzh-search--is-breakout .stzh-search{padding-left:4rem;padding-right:4rem}}@media screen and (min-width: 1600px){.stzh-search--is-breakout .stzh-search{padding-left:calc((100vw - 84.25rem) / 2);padding-right:calc((100vw - 84.25rem) / 2)}}.stzh-search--is-breakout .stzh-search__header-wrapper{background-color:var(--stzh-color-cobaltblue20)}.stzh-search--is-breakout .stzh-search__filters-main{padding-left:1.25rem;padding-right:1.25rem;position:relative;left:50%;right:50%;margin-left:calc(-50vw + var(--stzh-scrollbar-width) / 2);margin-right:calc(-50vw + var(--stzh-scrollbar-width) / 2);width:calc(100vw - var(--stzh-scrollbar-width));max-width:calc(100vw - var(--stzh-scrollbar-width))}@media screen and (min-width: 600px){.stzh-search--is-breakout .stzh-search__filters-main{padding-left:2rem;padding-right:2rem}}@media screen and (min-width: 900px){.stzh-search--is-breakout .stzh-search__filters-main{padding-left:2.5rem;padding-right:2.5rem}}@media screen and (min-width: 1260px){.stzh-search--is-breakout .stzh-search__filters-main{padding-left:4rem;padding-right:4rem}}@media screen and (min-width: 1600px){.stzh-search--is-breakout .stzh-search__filters-main{padding-left:calc((100vw - 84.25rem) / 2);padding-right:calc((100vw - 84.25rem) / 2)}}.stzh-search--is-breakout .stzh-search__header{margin-left:1.25rem;margin-right:1.25rem;padding-top:var(--stzh-space-large);background-color:var(--stzh-color-cobaltblue20);display:flex;justify-content:space-between}@media screen and (min-width: 600px){.stzh-search--is-breakout .stzh-search__header{margin-left:2rem;margin-right:2rem}}@media screen and (min-width: 900px){.stzh-search--is-breakout .stzh-search__header{margin-left:2.5rem;margin-right:2.5rem}}@media screen and (min-width: 1260px){.stzh-search--is-breakout .stzh-search__header{margin-left:4rem;margin-right:4rem}}@media screen and (min-width: 1600px){.stzh-search--is-breakout .stzh-search__header{margin-left:auto;margin-right:auto;max-width:84.25rem}}@media screen and (min-width: 600px){.stzh-search--is-breakout .stzh-search__header{padding-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-search--is-breakout .stzh-search__header{padding-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-search--is-breakout .stzh-search__header{padding-top:var(--stzh-space-xxxlarge)}}';const z=f;function p(s,e){return`\n <stzh-card-${s.variant==="teaser"?"superteaser":"searchresult"}\n href="{href}"\n dateline="{dateline}"\n tag="{tag}"\n topic="{topic}"\n service="{service}"\n event-location="{eventLocation}"\n hyphens-enabled="${this.hyphensEnabled}"\n ${e.eventDateStart&&'event-date-start="{eventDateStart}"'}\n ${e.eventDateEnd&&'event-date-end="{eventDateEnd}"'}\n download-heading="{downloadHeading}"\n meta='{meta}'\n breadcrumb-items='{breadcrumbItems}'\n download-meta='{downloadMeta}'\n datalist-items='{datalistItems}'\n ${e.imagePosition&&'image-position="{imagePosition}"'}\n ${e.download&&'download="{download}"'}\n style="\n ${e.serviceBackgroundColor?"--service-background-color: {serviceBackgroundColor};":""}\n ${e.serviceColor?"--service-color: {serviceColor};":""}\n "\n >\n <div slot="heading">{heading}</div>\n <div slot="description">{description}</div>\n ${e.image?e.imagePosition==="right"?`<img src="${e.image}" slot="image" />`:`<stzh-ratio ${s.variant==="teaser"?'ratio="2:1"':'ratio="21:9" ratio-small="1:1"'} slot="image"><img src="${e.image}" /></stzh-ratio>`:""}\n </stzh-card-${s.variant==="teaser"?"superteaser":"searchresult"}>\n `}function u(s){return{layout:s.variant==="teaser"?"teasers":"searchresults"}}const g=class{constructor(t){s(this,t);this.stzhOverlayCloseClick=e(this,"stzhOverlayCloseClick",7);this._sortOptions=[];this._showMoreLink=false;this.fetch=async(s=false,e=false)=>{var t,a;this.loading=true;this.error="";if(this.currentController){this.currentController.abort()}if(!this.hasRequiredParams&&!s){this.loading=false;return}let i=this.api.replace(/\{lang\}/gi,this.localization.$locale);let r=this.limit.toString();this.params.set("offset",s?this.results.length.toString():"0");if(e){const s=new URLSearchParams(location.search).get("search");if(s){const e=new URLSearchParams(s).get("limit");if(e){r=e}}}this.params.set("limit",r);this.currentController=new AbortController;let n={};try{const s=await h(i,{params:this.params,signal:this.currentController.signal});n=s.data}catch(s){this.error=this.localization.error}this.resultsHeading=n.resultsHeading||"";this.resultsText=n.resultsText||"";this.totalCount=((t=n.meta)===null||t===void 0?void 0:t.total)||0;if(n.error){this.error=n.message||this.localization.error}if(n.chipResults&&n.chipResults.length){this.chipResultsHeading=(a=n.chipResultsHeading)!==null&&a!==void 0?a:"";this.chipResults=n.chipResults}else{this.chipResultsHeading="";this.chipResults=[]}if(n.results){if(s){this.results=[...this.results,...n.results.map((s=>{var e;return Object.assign(Object.assign({},s),{html:this.renderResultTemplate(s.html||((e=n.templates)===null||e===void 0?void 0:e.result),s)})}))]}else{this.results=n.results.map((s=>{var e;return Object.assign(Object.assign({},s),{html:this.renderResultTemplate(s.html||((e=n.templates)===null||e===void 0?void 0:e.result),s)})}))}}if(!e&&!this.preventUpdateUrl){const s=new URLSearchParams(location.search);const e=new URLSearchParams(this.params);e.delete("offset");e.set("limit",this.results.length.toString());s.set("search",e.toString());window.history.replaceState(null,"",`${location.pathname}?${s}`)}if(e||!this.firstFetched){this.loading=false}else{window.setTimeout((()=>{this.loading=false}),this.debounceTime)}this.firstFetched=true};this.debouncedFetch=m(this.fetch,this.debounceTime);this.onDropdownSortChange=async s=>{const e=s.target;const t=await e.getValue();if(t){this._sortBy=t}await this.updateParams();this.debouncedFetch()};this.handleMainFilterChange=async()=>{if(this.autofetchMainFilters){await this.updateParams();this.debouncedFetch()}};this.handleAsideFilterChange=async()=>{if(this.autofetchAsideFilters){await this.updateParams();this.debouncedFetch()}};this.handleFormSubmit=async s=>{s.preventDefault();await this.updateParams();this.fetch()};this.handleMoreClick=()=>{this.fetch(true)};this.handleMediaChange=()=>{this.isDetailsOpen=d("large").matches};this.handleFormReset=async()=>{requestAnimationFrame((()=>{requestAnimationFrame((async()=>{await this.updateParams()}))}))};this.localization=undefined;this.variant="default";this.autofetchMainFilters=false;this.autofetchAsideFilters=false;this.hideMainFilters=false;this.hideAsideFilters=false;this.hideResultsHeading=false;this.sortBy=undefined;this.sortOptions=[];this.api="";this.debounceTime=500;this.limit=6;this.initialFetch=false;this.preventUpdateUrl=false;this.hyphensEnabled=false;this.templateResult=p;this.templateResultWrapperElement=function(){return"stzh-cardlist"};this.templateResultWrapperProps=u;this.resultHeadingLevel="3";this.emptyText=undefined;this.heading=undefined;this.emptyLinkHref=undefined;this.emptyLinkLabel=undefined;this.subscribeLabel="Subscribe";this.subscribePath=undefined;this.subscribeAdditionalQueryParameters=undefined;this.totalCount=0;this.loading=false;this.error="";this.results=[];this.chipResultsHeading=undefined;this.chipResults=[];this.resultsHeading=undefined;this.resultsText=undefined;this.hasRequiredParams=false;this.firstFetched=false;this.initiallyFetched=false;this.isDetailsOpen=false;this.isStzhAnchornavVisible=false}totalCountWatcher(){this._showMoreLink=this.totalCount>this.results.length}preventUpdateUrlWatcher(){this.updateParams()}sortOptionsWatcher(s){if(typeof s==="string"){this._sortOptions=JSON.parse(s)}else{this._sortOptions=s}}sortByWatcher(s){if(typeof s==="string"){this._sortBy=s}else{this._sortBy=undefined}}renderResultTemplate(s,e){let t=s||(typeof this.templateResult==="function"?this.templateResult(this.element,e):this.templateResult);["href","heading","name","additionalInformation","numbers","dateline","description","image","imagePosition","tag","topic","service","serviceColor","serviceBackgroundColor","meta","breadcrumbItems","eventLocation","eventDateStart","eventDateEnd","download","downloadHeading","downloadMeta","datalistItems"].forEach((s=>{const a=new RegExp(`{${s}}`,"gi");let i=e[s]||"";if(["meta","breadcrumbItems","downloadMeta","datalistItems","numbers"].includes(s)&&i){i=JSON.stringify(i)}t=t.replace(a,i)}));return t}async updateParams(s=false){const e=()=>{const s=new FormData(this.formElement);this.params=new URLSearchParams(s);this.params.set("variant",this.variant)};if(s){const s=new URLSearchParams(location.search);let e=s.get("search");const t=s.get("q");const a=s.get("query");if(!e){if(a){e=`query=${a}`}else if(t){e=`q=${t}`}}if(e){this.initialFetch=true;const s=new URLSearchParams(e);[...new Set(s.keys())].forEach((e=>{const t=s.getAll(e);const a=Array.from(document.querySelectorAll(`:where(stzh-input,stzh-radiogroup,stzh-chipselect,stzh-amount,stzh-datepicker,stzh-monthyearpicker,stzh-timepicker,stzh-pagination,stzh-toggle)[name="${e}"]`));const i=Array.from(document.querySelectorAll(`:where(stzh-checkboxgroup)[name="${e}"]`));const r=Array.from(document.querySelectorAll(`:where(stzh-dropdown)[name="${e}"]`));a.forEach((s=>{s.value=t[0]}));i.forEach((s=>{s.value=t}));r.forEach((s=>{s.items=t}))}))}}await n();e();let t=true;const a=Array.from(this.element.querySelectorAll(":where(stzh-input)[required]"));const i=Array.from(this.element.querySelectorAll(":where(stzh-dropdown)[required]"));const r=Array.from(this.element.querySelectorAll(":where(stzh-monthyearpicker)[required]"));const h=Array.from(this.element.querySelectorAll(":where(stzh-amount,stzh-radiogroup,stzh-chipselect,stzh-datepicker,stzh-monthyearpicker,stzh-timepicker,stzh-pagination,stzh-toggle)[required]"));const c=Array.from(this.element.querySelectorAll(":where(stzh-checkbox)[required]"));c.forEach((e=>{const a=!e.checked;if(!s){e.invalid=a}if(a){t=false}}));a.forEach((e=>{const a=e.value===""||e.minlength&&e.minlength>e.value.length||e.maxlength&&e.maxlength<e.value.length;if(!s){e.invalid=a}if(a){t=false}}));i.forEach((e=>{const a=e.items.length===0;if(!s){e.invalid=a}if(a){t=false}}));h.forEach((e=>{const a=e.value.toString().length===0;if(!s){e.invalid=a}if(a){t=false}}));r.forEach((e=>{const a=e.value.toString().length===0;if(!s){e.invalidYear=a;e.invalidMonth=a}if(a){t=false}}));this.hasRequiredParams=t}async componentDidLoad(){this.isStzhAnchornavVisible=document.documentElement.style.getPropertyValue("--stzh-anchornav-is-visible")==="1";await this.updateParams(true);if(this.initialFetch){await this.fetch(false,true);this.initiallyFetched=true}else{this.initiallyFetched=true}}async componentWillLoad(){if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"search")}this.isStzhAnchornavVisible=document.documentElement.style.getPropertyValue("--stzh-anchornav-is-visible")==="1";this.sortOptionsWatcher(this.sortOptions);this.sortByWatcher(this.sortBy)}connectedCallback(){l(this.handleMediaChange);this.handleMediaChange()}disconnectedCallback(){o(this.handleMediaChange)}renderResultsText(){return t("stzh-text",{class:"stzh-search__results-text",color:"primary",innerHTML:this.resultsText})}renderSubscribeButton(){const s=new URLSearchParams;let e=this.subscribeAdditionalQueryParameters;if(typeof this.subscribeAdditionalQueryParameters==="string"){try{e=JSON.parse(this.subscribeAdditionalQueryParameters)}catch(s){}}for(const t of e){for(const[e,a]of Object.entries(t)){if(a){s.set(e,a)}}}const a=new URLSearchParams(window.location.search);const i=a.get("search");if(i){const e=new URLSearchParams(i);for(const[t,a]of e.entries()){if(["variant","limit"].indexOf(t)===-1&&a){s.append(t,a)}}}const r=`${this.subscribePath}?${s.toString()}`;return t("div",{class:"stzh-search__results-subscribe"},t("stzh-button",{variant:"secondary",size:"small",href:r},this.subscribeLabel))}render(){const s=c(this.element,"filters-main");const e=c(this.element,"filters-aside");let r=true;if(s){const s=this.element.querySelector("[slot='filters-main'] stzh-chipselect");const e=this.element.querySelector("[slot='filters-main'] stzh-chipgroup");if(!s&&!e){r=false}}else{r=false}const h=(this.hasRequiredParams||this.firstFetched)&&this.firstFetched&&this.initiallyFetched;const n={"stzh-search":true,"stzh-search--has-filters-main":s,"stzh-search--has-filters-aside":e,"stzh-search--has-hidden-main-filters":this.hideMainFilters,"stzh-search--has-hidden-aside-filters":this.hideAsideFilters,"stzh-search--has-results-shown":h,"stzh-search--has-error-shown":!!this.error,"stzh-search--is-loading":this.loading,[`stzh-search--${this.variant}`]:!!this.variant};const d=typeof this.templateResultWrapperElement==="function"?this.templateResultWrapperElement(this.element):this.templateResultWrapperElement;const l=typeof this.templateResultWrapperProps==="function"?this.templateResultWrapperProps(this.element):this.templateResultWrapperProps;return t(i,{key:"0a3d32cfe0e507375c50c5ff7ce9091befca0b52","has-aside-filters":e,fullwidth:this.isStzhAnchornavVisible.toString()},t("form",{key:"4c95a41b47e3b77473142e0eebd8f9ebdfda5445",ref:s=>this.formElement=s,novalidate:true,class:n,onSubmit:this.handleFormSubmit,onReset:this.handleFormReset},t("div",{key:"f7bf9ce30724bf80e7a423d43b621f8c17e293cc",class:"stzh-search__filters-main",onStzhChange:this.handleMainFilterChange},!!this.heading&&t("stzh-heading",{key:"616b0091ee0dfef3b5d8f1f341411cdccb0a8503",class:"stzh-search__header-heading",curve:"h2"},this.heading),t("slot",{key:"3be1e0837eb14f81de6bfa4681b1fb99cd204ff2",name:"filters-main"}),!r&&this.chipResults.length>0&&t("div",{key:"debc00542d88235ad6dde745257d7bd0a595472e",class:"stzh-search__filters-main-chips"},this.chipResultsHeading&&t("stzh-text",{key:"42495008b843208affbb51a1b4150ae7635beaaf",font:"heavy",size:"milli",color:"primary"},this.chipResultsHeading),this.chipResults[0].options?t("stzh-chipgroup",null,this.chipResults.map((s=>t("stzh-dropdown",{label:s.label,name:s.value,variant:"filter",size:"large","no-search":true,"hide-optional":true,inline:true,options:s.options})))):t("stzh-chipselect",{multiple:true,name:"subject",label:this.chipResultsHeading,"label-hidden":true,data:this.chipResults.map((s=>({label:s.label,value:s.value,counter:`${s.amount}`,variant:"filter",size:"large"})))}))),e&&t(a,{key:"2da210bbda212eae023ffea44aab2d6924e3aa40"},t("div",{key:"b90d83f9bc098ff2ead2f63c4aa3931017120fa5",class:"stzh-search__filters-aside",onStzhChange:this.handleAsideFilterChange},t("div",{key:"f3f1c38058650652e12fe58b73cf7c776451bf9a",class:"stzh-search__filters-aside-inner"},t("div",{key:"475978cb850a3a6f96ae4402d174a0ea97e0bd77",class:"stzh-search__filters-aside-heading"},this.localization.moreFilter),t("stzh-details",{key:"dc2aa28b62b72f4b14e3ff6e40a802dc93a00baa",open:this.isDetailsOpen,class:"stzh-search__filters-aside-details"},t("stzh-button",{key:"f9fda211f32f6b262c855021a09d8ec54067b837",class:"stzh-search__filters-aside-details-trigger",variant:"tertiary-plain",size:"small",noPaddingLeft:true,showToggleIcon:true,iconPosition:"right",label:this.localization.moreFilter}),t("div",{key:"cf3a55b3f0a61bd63674b0d84c774fcc90b98f07",slot:"content"},t("slot",{key:"0186b6ccf32ceee9956b2879d55fd09dbb619843",name:"filters-aside"})))))),t("div",{key:"372b4529dcc1666085217d03b639c6a45c929cc6",class:"stzh-search__results-wrapper"},h&&t(a,{key:"5e4486f56a3218e9be6867140b5500234dc3be2a"},this.results.length===0?t(a,null,this.variant!=="teaser"&&this.resultsHeading&&!this.hideResultsHeading&&t("stzh-heading",{class:"stzh-search__results-heading",curve:"h3",level:this.resultHeadingLevel,innerHTML:this.resultsHeading}),this.resultsText&&this.renderResultsText(),this.subscribePath&&this.renderSubscribeButton(),this.emptyText&&t("stzh-text",{class:"stzh-search__empty-text",innerHTML:this.emptyText}),this.emptyLinkLabel&&this.emptyLinkHref&&t("div",{class:"stzh-search__empty-link-wrapper"},t("stzh-link",{href:this.emptyLinkHref,label:this.emptyLinkLabel}))):t(a,null,t("div",{class:"stzh-search__results-header"},this.variant!=="teaser"&&this.resultsHeading&&!this.hideResultsHeading&&t("stzh-heading",{class:"stzh-search__results-heading",curve:"h3",level:this.resultHeadingLevel,htmlContent:this.resultsHeading}),this._sortOptions.length>0&&t("div",{class:"stzh-search__results-sort"},t("stzh-dropdown",{"hide-optional":true,inline:true,"no-search":true,"no-wrap":true,class:"stzh-search__results-sort-dropdown",variant:"plain",size:"small",sizeMedium:"tiny",name:"sortby",items:[this._sortBy],options:this._sortOptions,onStzhChange:this.onDropdownSortChange}))),this.resultsText&&this.renderResultsText(),this.subscribePath&&this.renderSubscribeButton(),t(d,Object.assign({class:"stzh-search__results","max-3-columns":e},l),this.results.map((s=>t("div",{class:"stzh-search__results-item",innerHTML:s.html||""})))),t("div",{class:"stzh-search__actions-wrapper"},this._showMoreLink&&t("stzh-button",{variant:"secondary",class:"stzh-search__action-more",label:this.localization.showMore,onClick:this.handleMoreClick,disabled:this.loading,a11yDisabled:this.loading})))),this.error&&t("div",{key:"d27e6ae900e6f0e6b44f2c37df481e097ffcf038",class:"stzh-search__error"},t("stzh-message",{key:"a8a9900e69a167236ddd39d35a65adb28e8342c0",type:"error",label:this.error})),this.loading&&t("stzh-loader",{key:"f41802e338e0be014d37ee29dab344c8dfb5eec7",class:"stzh-search__loader"})),t("slot",{key:"081efb0cf4dd847771e0270c0d88483c7fd94ec9"})))}get element(){return r(this)}static get watchers(){return{totalCount:["totalCountWatcher"],results:["totalCountWatcher"],preventUpdateUrl:["preventUpdateUrlWatcher"],sortOptions:["sortOptionsWatcher"],sortBy:["sortByWatcher"]}}};g.style=z;export{g as stzh_search};
|
|
2
|
+
//# sourceMappingURL=p-98eb5017.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as s,F as a,a as e,g as i}from"./p-ef5985a3.js";import{a as h}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as s,F as a,a as e,g as i}from"./p-ef5985a3.js";import{a as h}from"./p-30d100f4.js";import{s as l}from"./p-09b5eb01.js";import"./p-dae15605.js";const c=".sc-stzh-bathstatus-list-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-bathstatus-list-h,[stzh-hidden].sc-stzh-bathstatus-list-h{display:none}.sc-stzh-bathstatus-list-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-bathstatus-list-h *.sc-stzh-bathstatus-list,.sc-stzh-bathstatus-list-h *.sc-stzh-bathstatus-list::before,.sc-stzh-bathstatus-list-h *.sc-stzh-bathstatus-list::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-bathstatus-list-h .has-focus.sc-stzh-bathstatus-list{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-bathstatus-list-h .stzh-fylingfocus-focused.sc-stzh-bathstatus-list{outline-style:none !important}.sc-stzh-bathstatus-list-h .stzh-fylingfocus-focused.sc-stzh-bathstatus-list::-moz-focus-inner{border:0 !important}.stzh-bathstatus-list__header.sc-stzh-bathstatus-list{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));gap:var(--stzh-space-small) var(--stzh-space-xlarge);align-items:center;padding-top:var(--stzh-space-small);padding-right:var(--stzh-space-xsmall);padding-bottom:var(--stzh-space-small);padding-left:var(--stzh-space-xsmall)}@media screen and (min-width: 900px){.stzh-bathstatus-list__header.sc-stzh-bathstatus-list{padding-top:var(--stzh-space-medium);padding-right:var(--stzh-space-large);padding-bottom:var(--stzh-space-medium);padding-left:var(--stzh-space-large)}}.stzh-bathstatus-list__column-name.sc-stzh-bathstatus-list{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);color:var(--stzh-color-primary70)}@media screen and (min-width: 900px){.stzh-bathstatus-list__column-name.sc-stzh-bathstatus-list{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing)}}.stzh-bathstatus-list__list.sc-stzh-bathstatus-list{display:flex;flex-direction:column;gap:var(--stzh-space-xxsmall)}";const n=c;const o=class{constructor(s){t(this,s);this.init=()=>{const t=this.element.querySelectorAll("stzh-bathstatus-item");t.forEach((t=>{l(t,{variant:"list"})}))};this.localization=undefined;this.api=undefined;this.items=[];this.isLoading=true;this.loadingText=""}async apiWatcher(t){this.loadingText=this.localization.dataLoading;if(!t){this.isLoading=false;return}const{data:s}=await h.get(this.api);this.items=s.items;this.isLoading=false}async componentWillLoad(){if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"bathstatus-list")}}async componentDidLoad(){await this.apiWatcher(this.api)}connectedCallback(){this.init()}render(){const t={"stzh-bathstatus-list":true};return s(e,{key:"b9cff6372116ca549aa308341ff92d380fbcc632"},s("div",{key:"a6153fdd9425def7d42ddca415f4ddca3ca9c52e",class:t},s("stzh-overlay",{key:"f44bd56482dde583f6cde10be05554899e5a0484",open:this.isLoading},s("stzh-loader",{key:"c4674457d352f16dc981e5606ff7b7a6a34260eb",label:this.loadingText})),s("div",{key:"161160331abe63b34e0ca9016117efb1abade501",class:"stzh-bathstatus-list__header"},s("div",{key:"a8e3ff7ba47114c9609e438386b989535665defc",class:"stzh-bathstatus-list__column-name"},this.localization.bath),s("div",{key:"c21127a2167a7329525f3c9a3e45e718d8f2bfe9",class:"stzh-bathstatus-list__column-name"},this.localization.water),s("div",{key:"fa907650aeed5b0bc3ac0d844235de6f280858fd",class:"stzh-bathstatus-list__column-name"},this.localization.status),s("div",{key:"0bbe23c4a04ede32ee23edd6db31d9ef02c1a4e8",class:"stzh-bathstatus-list__column-name"},this.localization.lastUpdate)),s("div",{key:"ce1a7c98d52cbe88a534eb12d431ca5f700b9339",class:"stzh-bathstatus-list__list",role:"list"},s("slot",{key:"d8061459273d61212b55023d55146da0cefd579a"}),this.items.length>0&&s(a,{key:"7ad1c81c99ab590e70bc439e42b1489e3ec3c8be"},this.items.map((t=>s("stzh-bathstatus-item",{item:t,variant:"list"})))))))}get element(){return i(this)}static get watchers(){return{api:["apiWatcher"]}}};o.style=n;export{o as stzh_bathstatus_list};
|
|
2
|
+
//# sourceMappingURL=p-a45f19b5.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as s,F as i,a as e,g as o}from"./p-ef5985a3.js";import{a as h}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as s,F as i,a as e,g as o}from"./p-ef5985a3.js";import{a as h}from"./p-30d100f4.js";const a=".sc-stzh-poilist-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-poilist-h,[stzh-hidden].sc-stzh-poilist-h{display:none}.sc-stzh-poilist-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-poilist-h *.sc-stzh-poilist,.sc-stzh-poilist-h *.sc-stzh-poilist::before,.sc-stzh-poilist-h *.sc-stzh-poilist::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-poilist-h .has-focus.sc-stzh-poilist{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-poilist-h .stzh-fylingfocus-focused.sc-stzh-poilist{outline-style:none !important}.sc-stzh-poilist-h .stzh-fylingfocus-focused.sc-stzh-poilist::-moz-focus-inner{border:0 !important}.stzh-poilist__header.sc-stzh-poilist{margin-bottom:var(--stzh-space-xsmall);display:flex;justify-content:space-between;align-items:center}@media screen and (min-width: 600px){.stzh-poilist__header.sc-stzh-poilist{margin-bottom:var(--stzh-space-small)}}@media screen and (min-width: 900px){.stzh-poilist__header.sc-stzh-poilist{margin-bottom:var(--stzh-space-medium)}}@media screen and (min-width: 1260px){.stzh-poilist__header.sc-stzh-poilist{margin-bottom:var(--stzh-space-xlarge)}}.stzh-poilist__header.sc-stzh-poilist stzh-text.sc-stzh-poilist{--color:var(--stzh-color-grey80);font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-poilist__show-more.sc-stzh-poilist{margin-top:var(--stzh-space-large);display:grid}@media screen and (min-width: 600px){.stzh-poilist__show-more.sc-stzh-poilist{margin-top:var(--stzh-space-xlarge)}}@media screen and (min-width: 900px){.stzh-poilist__show-more.sc-stzh-poilist{margin-top:var(--stzh-space-xxlarge)}}@media screen and (min-width: 1260px){.stzh-poilist__show-more.sc-stzh-poilist{margin-top:var(--stzh-space-xxxlarge)}}@media screen and (min-width: 600px){.stzh-poilist__show-more.sc-stzh-poilist{justify-content:center}}.stzh-poilist.sc-stzh-poilist stzh-dropdown.sc-stzh-poilist{--color:var(--stzh-color-primary90);--icon-color:var(--stzh-color-primary90);--icon-angle-color:var(--stzh-color-primary90)}";const r=a;const n=class{constructor(s){t(this,s);this.handleMoreClick=async()=>{this.loadingText=this.localization.dataLoading;this.isLoading=true;this.currentOffset++;const{data:t}=await h.get(this.getCurrentApiUrl());this.meta=t.meta;this.items=this.items.concat(t.items);this.isLoading=false};this.onSortChange=async t=>{this.activeSorting=t.detail.value;this.currentOffset=0;this.items=[];await this.apiWatcher(this.api)};this.localization=undefined;this.api=undefined;this.currentOffset=0;this.meta=undefined;this.items=[];this.isLoading=true;this.dropdownOptions=[];this.activeSorting=undefined;this.latitude=47.3714332;this.longitude=8.542093;this.geopositionError="";this.loadingText=""}async apiWatcher(t){this.loadingText=this.localization.dataLoading;if(!t){return}const{data:s}=await h.get(this.getCurrentApiUrl());this.meta=s.meta;this.items=s.items;this.isLoading=false}getCurrentApiUrl(){return`${this.api}?offset=${this.currentOffset}&sort=${this.activeSorting}:DESC&latitude=${this.latitude}&longitude=${this.longitude}`}getNumberOfLoadedItems(){if(this.meta.currentPage!==this.meta.totalPages){return this.meta.itemsPerPage*this.meta.currentPage}else{return this.meta.totalItems}}async getUserPosition(){this.loadingText=this.localization.geopositionLoading;try{const t=await this.getPositionAsync();this.latitude=t.coords.latitude;this.longitude=t.coords.longitude}catch(t){console.error("geopositionNotFoundException",t);this.geopositionError=this.localization.geopositionError}}getPositionAsync(){return new Promise(((t,s)=>{if(navigator.geolocation){navigator.geolocation.getCurrentPosition((s=>t(s)),(t=>s(t)))}else{s(new Error("Geolocation is not supported by this browser."))}}))}async componentWillLoad(){if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"poilist")}this.dropdownOptions=[{text:this.localization.sortByDistance,value:"distance"},{text:this.localization.sortByName,value:"name"}];this.activeSorting=this.dropdownOptions[0].value}async componentDidLoad(){await this.getUserPosition();await this.apiWatcher(this.api)}render(){const t={"stzh-poilist":true};return s(e,{key:"65e2a8f607b975f506ab0e3a63c49dcf1dac1a33"},s("div",{key:"9b722dbf1b5133c704815072a4a7a6f8606c2dbc",class:t},s("stzh-overlay",{key:"dc139fba676d9081b0d3bc5d1de87675473e0e4a",open:this.isLoading},s("stzh-loader",{key:"cd07a000b1905452a43aebcb879957785b25e1db",label:this.loadingText})),this.geopositionError&&s("stzh-message",{key:"51694301b52d0767d2d7564a3efa95f5e04d3a44",type:"error",label:this.geopositionError}),(this.items.length>0||this.meta)&&s(i,{key:"b52b8406bd47fe6188d1b1138cea314419bb54c8"},s("div",{key:"159e31443e09503a4e3d72cac0df90a03064664c",class:"stzh-poilist__header"},s("stzh-text",{key:"083417e9da14d3c7220e23045a99a4160db9dfe3",size:"micro"},this.getNumberOfLoadedItems()," ",this.localization.of," ",this.meta.totalItems),s("stzh-dropdown",{key:"0778c4015ccab6196240630674ff00cda015ed87",label:"Sortierung","hide-optional":true,variant:"plain",noSearch:true,inline:true,noWrap:true,onStzhChange:this.onSortChange,items:Array.isArray(this.activeSorting)?this.activeSorting:[this.activeSorting],options:this.dropdownOptions})),s("stzh-cardlist",{key:"b294dc9dc9556501f124fb82a8cea245a9cf512c",layout:"teasers"},this.items.map((t=>s("stzh-poicard",{item:t})))),this.meta.currentPage!==this.meta.totalPages&&s("div",{key:"86b26ae169acc375ccc20581628d4678e2565409",class:"stzh-poilist__show-more"},s("stzh-button",{key:"a29c4ea0e7cf6f9a723ed26a8c22500b0b0836ec",variant:"secondary",label:this.localization.showMore,onClick:this.handleMoreClick})))))}get element(){return o(this)}static get watchers(){return{api:["apiWatcher"]}}};n.style=r;export{n as stzh_poilist};
|
|
2
|
+
//# sourceMappingURL=p-adcf8c10.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const t="@oiz/stzh-components";const n="4.4.
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
const t="@oiz/stzh-components";const n="4.4.3";const o=t.substring(t.indexOf("/")+1);const e=t=>{const n=document.querySelector("[autofocus]");if(window.stzhComponents.fixAutofocus&&!document.location.hash&&n&&t.detail.namespace===o&&n.tagName.toLowerCase().indexOf("stzh-")===0&&"focus"in n){n.focus()}else if(window.stzhComponents.fixHashfocus&&document.location.hash){const t=document.querySelector(document.location.hash);if(t){t.scrollIntoView()}}};function s(){window.addEventListener("appload",e)}function i(){const t={threshold:1};const n=t=>{t.forEach((t=>{let n=0;if(t.intersectionRatio<1){n=window.innerWidth-document.documentElement.clientWidth}document.documentElement.style.setProperty("--stzh-scrollbar-width",n+"px");document.documentElement.style.setProperty("--stzh-scrollbar-active",n>0?"1":"0")}))};const o=new IntersectionObserver(n,t);o.observe(document.body)}function a(t,n="datetime"){if(!window.stzhComponents.translations){console.log("Translations not loaded yet, check for Promise `window.stzhComponents.translationsLoading`");return}const{$formats:o,$globals:e}=window.stzhComponents.translations;const s=f(o,e);return s.format(t,n)}function r(t,n="datetime"){if(!window.stzhComponents.translations){console.log("Translations not loaded yet, check for Promise `window.stzhComponents.translationsLoading`");return}const{$formats:o,$globals:e}=window.stzhComponents.translations;const s=f(o,e);return s.parse(t,n)}function c(t,n,o="datetime"){if(!window.stzhComponents.translations){console.log("Translations not loaded yet, check for Promise `window.stzhComponents.translationsLoading`");return}const{$formats:e,$globals:s}=window.stzhComponents.translations;const i=f(e,s);return i.formatSpan(t,n,o)}function l(t,n="datetime"){if(!window.stzhComponents.translations){console.log("Translations not loaded yet, check for Promise `window.stzhComponents.translationsLoading`");return}const{$formats:o,$globals:e}=window.stzhComponents.translations;const s=f(o,e);return s.parseSpan(t,n)}function f(t,n){const o=function(t,o){if(!o||!(o instanceof Date)||isNaN(o.getTime())){return""}let e=o.getDate().toString(10);let s=e;let i=(o.getMonth()+1).toString(10);let a=i;let r=o.getFullYear().toString(10);let c=o.getHours().toString(10);let l=c;let f=o.getMinutes().toString(10);let u=n.monthNames[o.getMonth()];let d=n.monthNamesShort[o.getMonth()];let w=n.dayNames[o.getDay()];let m=n.dayNamesShort[o.getDay()];if(o.getMonth()<9){a=`0${a}`}if(o.getDate()<10){s=`0${s}`}if(o.getHours()<10){l=`0${l}`}if(o.getMinutes()<10){f=`0${f}`}return t.replace(/\{j\}/g,e).replace(/\{d\}/g,s).replace(/\{D\}/g,m).replace(/\{l\}/g,w).replace(/\{n\}/g,i).replace(/\{m\}/g,a).replace(/\{F\}/g,u).replace(/\{M\}/g,d).replace(/\{Y\}/g,r).replace(/\{H\}/g,l).replace(/\{G\}/g,c).replace(/\{i\}/g,f)};const e=function(t,n){if(!n){return}const o=new RegExp(t);const e=n.match(o);if(e){const{groups:t}=e;const n=parseInt(t.Y||"",10);const o=parseInt(t.n||t.m||"",10);const s=parseInt(t.j||t.d||"",10);const i=parseInt(t.G||t.H||"",10);const a=parseInt(t.i||"",10);if(!isNaN(n)&&(n<1e3||n>9999)){return}if(!isNaN(o)&&(o<1||o>12)){return}if(!isNaN(s)&&(s<1||s>31)){return}if(!isNaN(i)&&(i<0||i>23)){return}if(!isNaN(a)&&(a<0||a>59)){return}const r=new Date(!isNaN(n)?n:null,!isNaN(o)?o-1:null,!isNaN(s)?s:null,!isNaN(i)?i:null,!isNaN(a)?a:null);if(r.getMonth()+1!==o){return}return r}};const s={format:function(n,e="datetime"){const s={...t[e],...window.stzhComponents?.formats[e]||{}};if(typeof s.format==="string"){return o(s.format,n)}else{return s.format(n)}},parse:function(n,o="datetime"){const s={...t[o],...window.stzhComponents?.formats[o]||{}};if(typeof s.parse==="string"){return e(s.parse,n)}else{return s.parse(n)}},formatSpan:function(t,o,e="datetime"){let s=t;let i=o;if(t instanceof Date&&!isNaN(t.getTime())){s=this.format(t,e)}if(o instanceof Date&&!isNaN(o.getTime())){i=this.format(o,e)}let a=n.dateRange;if(e.startsWith("time")){a=n.timeRange}return s+(i&&(!(i instanceof Date)||i instanceof Date&&!isNaN(t.getTime()))?a+i:"")},parseSpan:function(t,o){let e=n.dateRange;if(o.startsWith("time")){e=n.timeRange}const s=t.split(e);const i=this.parse(s[0],o);const a=this.parse(s[1],o);return[i,a,e]}};return s}function u(t){const n=t.closest("[lang]");const o=n&&n.lang.split("-")[0];if(window.stzhComponents.supportedLocales.indexOf(o)===-1||!o){return window.stzhComponents.defaultLocale}else{return o}}async function d(t,n){const o=u(t);const e=JSON.parse(sessionStorage.getItem(`stzhComponents.v${window.stzhComponents.version}.i18n.${o}`));if(window.stzhComponents.cacheTranslations&&e&&Object.keys(e).length>0){return{...e[n]||{},$globals:e.$globals,$locale:e.$code,$formats:e.$formats,$formatsIso:e.$formatsIso,$formatsLegacy:e.$formatsLegacy}}try{const t=await fetch(`${window.stzhComponents.pathTranslations}/${o}.json`);if(t.ok){const e=await t.json();sessionStorage.setItem(`stzhComponents.v${window.stzhComponents.version}.i18n.${o}`,JSON.stringify(e));return{...e[n]||{},$globals:e.$globals,$locale:e.$code,$formats:e.$formats,$formatsIso:e.$formatsIso,$formatsLegacy:e.$formatsLegacy}}}catch(t){console.error(`Error loading locale: ${o}`,t)}}const w=Object.freeze({__proto__:null,format:a,parse:r,formatSpan:c,parseSpan:l,createFormatParseAdapter:f,getLocale:u,fetchTranslations:d});function m(){window.stzhComponents=Object.assign(Object.assign({defaultLocale:"de",pathMedia:"/",pathTranslations:"/",cacheTranslations:true,formats:{},translations:null,fixAutofocus:true,fixHashfocus:true},window.stzhComponents||{}),{version:n,supportedLocales:["de","en"],utils:w});if(window.stzhComponents.translations===null){window.stzhComponents.translationsLoading=d(document.documentElement).then((t=>{window.stzhComponents.translations=t})).catch((t=>{console.error("Translations couldn't load:",t)}))}s();i()}const g=m;export{g};
|
|
2
|
+
//# sourceMappingURL=p-bac2e98e.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as s,h as e,a as i,g as r}from"./p-ef5985a3.js";import{a as o}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as s,h as e,a as i,g as r}from"./p-ef5985a3.js";import{a as o}from"./p-30d100f4.js";import{a}from"./p-dae15605.js";import{VBZ as h}from"./index.esm.js";const c=".sc-stzh-vbz-majorticker-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-vbz-majorticker-h,[stzh-hidden].sc-stzh-vbz-majorticker-h{display:none}.sc-stzh-vbz-majorticker-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-vbz-majorticker-h *.sc-stzh-vbz-majorticker,.sc-stzh-vbz-majorticker-h *.sc-stzh-vbz-majorticker::before,.sc-stzh-vbz-majorticker-h *.sc-stzh-vbz-majorticker::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-vbz-majorticker-h .has-focus.sc-stzh-vbz-majorticker{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-vbz-majorticker-h .stzh-fylingfocus-focused.sc-stzh-vbz-majorticker{outline-style:none !important}.sc-stzh-vbz-majorticker-h .stzh-fylingfocus-focused.sc-stzh-vbz-majorticker::-moz-focus-inner{border:0 !important}.stzh-vbz-majorticker__ghettobox.sc-stzh-vbz-majorticker{--stzh-base-invert-color:var(--stzh-color-black);--color:var(--stzh-color-black);--background-color:var(--stzh-color-coral)}";const n=c;const d=class{constructor(e){t(this,e);this.stzhDisturbanceFetched=s(this,"stzhDisturbanceFetched",7);this.disturbance=null;this.onGhettoboxOpen=()=>{this.ghettoboxShown=true};this.onGhettoboxClose=()=>{this.ghettoboxShown=false};this.api="https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}";this.data="";this.moreInfoLink="https://zvv.ch/zvv/{lang}/fahrplan/vl.html?himIds={id}";this.dateAdapter=undefined;this.localization=undefined;this.showCloseKey=undefined;this.ghettoboxShown=true}async getGhettoboxShown(){return this.ghettoboxShown}async getDisturbance(){return this.disturbance}async apiWatcher(t){if(!t){return}let s=this.api.replace(/\{lang\}/,this.localization.$locale);s=s+(s.includes("?")?"&":"?")+Date.now();const{data:e}=await o.get(s);this.data=e}dateAdapterWatcher(t){if(!t){this.dateAdapter=window.stzhComponents.utils.createFormatParseAdapter(this.localization.$formats,this.localization.$globals)}}async dataWatcher(t){var s,e;if(typeof t==="string"){this._data=JSON.parse(t)}else{this._data=t}const i=(e=(s=this._data)===null||s===void 0?void 0:s.Message)===null||e===void 0?void 0:e.find((t=>t.category===h.DISTURBANCE_INFORMATION&&t.baseType===h.BASE_TYPE_GLOBAL));if(i){const t=i.channel.filter((t=>t.name===h.CHANNEL_TICKER&&t.url)).map((t=>t.url)).reduce(((t,s)=>t.concat(s)),[]);const s=t.find((t=>t.url.indexOf(h.CHANNEL_INFO_URL_FILTER)!==-1));this.disturbance={id:i.id,head:i.head,text:a(i.text),startDate:new Date(`${i.sDate}T${i.sTime}+02:00`),endDate:new Date(`${i.eDate}T${i.eTime}+02:00`),altStart:i.altStart,altEnd:i.altEnd,infoUrl:s}}this.stzhDisturbanceFetched.emit({component:"stzh-vbz-majorticker",disturbance:this.disturbance})}async componentWillLoad(){if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"vbz-majorticker")}this.dateAdapterWatcher(this.dateAdapter);if(this.data){await this.dataWatcher(this.data)}else{await this.apiWatcher(this.api)}}render(){const t={"stzh-vbz-majorticker":true};return e(i,{key:"8db6939f8e760ebcce492098b439ad9a821d49b6",hidden:!this.disturbance||!this.ghettoboxShown},e("div",{key:"d79c60cae875127356b1c20b7a556919a6decf58",class:t},this.disturbance&&e("stzh-show",{key:"6cfd95ccead38193fc1105dc34016e7d81e2eb6c",mikro:true,closeKey:this.showCloseKey,showFromDate:this.disturbance.startDate},e("stzh-ghettobox",{key:"456acca37d461b62cdca1060c35f3ba3a3c7ae87",onStzhOpen:this.onGhettoboxOpen,onStzhClose:this.onGhettoboxClose,class:"stzh-vbz-majorticker__ghettobox",hideClose:true,mainTitle:this.disturbance.head},e("stzh-richtext",{key:"af9792b8f95cba278d5205b7b4a9f4f9a695d128",innerHTML:this.disturbance.text}),this.disturbance.infoUrl?e("stzh-button",{slot:"button",href:this.disturbance.infoUrl.url},this.disturbance.infoUrl.name):e("stzh-button",{slot:"button",target:"_blank",href:this.moreInfoLink.replace(/\{lang\}/,this.localization.$locale).replace(/\{id\}/,this.disturbance.id)},this.localization.moreInfo)))))}get element(){return r(this)}static get watchers(){return{api:["apiWatcher"],dateAdapter:["dateAdapterWatcher"],data:["dataWatcher"]}}};d.style=n;export{d as stzh_vbz_majorticker};
|
|
2
|
+
//# sourceMappingURL=p-d71d4d86.entry.js.map
|