PageSourceSearch

https://www.rech-consulting.de/securewebapps/evercdn/assets/notificationsjs/v1/scripts/main.min.js

js rech-consulting.de collected 2026-10-02 01:52:06 UTC 5,238 bytes, 6 lines download raw bytes

1/**
2 * @preserve
3 * @desc display custom user notifications
4 * @author Dominik Kressler, Dario Rieke
5 * @version 1.4.6
6 */class NotificationArea{language;container;previouslyFocusedElement;version="1.4.6";options={focusResetSelector:"[data-reset-focus]",translations:{de:{notification:"Benachrichtigung",closeNotification:"Benachrichtigung schlie\xDFen",noLocalStorage:"Cookies und/oder der lokale Speicher sind deaktiviert. Dies kann dazu f\xFChren, dass die Seite nicht ordnungsgem\xE4\xDF funktioniert. Bitte \xFCberpr\xFCfen Sie Ihre Einstellungen."},en:{notification:"Notification",closeNotification:"Close notification",noLocalStorage:"Cookies and/or local storage are deactivated. This may prevent the site from working properly. Please check your settings."}}};constructor(e){this.options={...this.options,...e},this.language=document.documentElement.lang.split("_")[0].toLowerCase(),this.#t(),this.#s(),this.#i()}#t(){const e=document.createElement("notifications");e.classList.add("notification-area"),document.body.insertAdjacentElement("beforeend",e),this.container=e}#s(){try{window.localStorage,window.localStorage.setItem,window._storageDisabled=!1,this.localStorage=window.localStorage}catch(e){this.localStorage={_items:new Map,setItem(i,t){this._items.set(i,t)},getItem(i){return this._items.has(i)?this._items.get(i):null}},window._storageDisabled=!0,console.log("sessionStorage and/or localStorage not available, falling back to in-memory storage: ",e),this.add({message:this.#e("noLocalStorage"),classNames:"error"})}}#i(){this.previouslyFocusedElement=document.activeElement,document.addEventListener("focus",e=>{this.container.contains(e.target)||(this.previouslyFocusedElement=e.target)},{capture:!0})}async add(e){const t={...{id:"",classNames:"",message:"",saveState:!1,remove:!0,discard:!1,nosnippet:!0,delay:300,sessionName:"",role:"status",focus:!1,label:""},...e},s=document.createElement("notification");s.classList.add("hide");const r=`id-${Math.floor(Math.random()*Date.now())}`;s.setAttribute("uuid",r),s.setAttribute("aria-labelledby",`${r}-label`),s.setAttribute("tabindex","0"),t.label&&s.setAttribute("label",t.label),s.setAttribute("role",t.role),t.id&&(s.id=t.id),t.sessionName||(t.sessionName=t.id),t.nosnippet&&(s.dataset.nosnippet="");const o=document.createElement("note-content");o.classList.add("note-content"),s.toggleAttribute("saveState",t.saveState),s.setAttribute("sessionName",t.sessionName),s.toggleAttribute("remove",t.remove),s.toggleAttribute("focus",t.focus),s.setAttribute("delay",t.delay),s.className="notification "+t.classNames,typeof t.message=="string"?o.innerHTML=t.message:o.appendChild(t.message),s.appendChild(o);const a=document.createElement("close");return a.classList.add("close"),a.innerHTML="&times;",a.setAttribute("aria-label",this.#e("closeNotification")),a.setAttribute("title",this.#e("closeNotification")),a.setAttribute("role","button"),a.setAttribute("tabindex","0"),s.appendChild(a),a.addEventListener("click",n=>{this.close(s)}),this.#a(s),this.container.appendChild(s),new Promise(n=>{this.localStorage.getItem("note-"+t.sessionName)=="discarded"?(this.close(s),n(s)):t.discard?(n(this.open(s)),setTimeout(()=>{this.close(s)},t.discard+t.delay)):n(this.open(s))})}get notifications(){return Array.from(this.container.children)}async close(e){return new Promise(i=>{if(e=this.getNotification(e),e){const t=!e.hasAttribute("open");e.hasAttribute("saveState")?this.localStorage.setItem("note-"+e.getAttribute("sessionName"),"discarded"):this.localStorage.setItem("note-"+e.getAttribute("sessionName"),""),e.toggleAttribute("open",!1),e.classList.add("hide"),e.hasAttribute("focus")&&!t&&this.#o(),e.hasAttribute("remove")&&e.remove(),i()}})}getNotification(e){const i=e;return typeof e=="string"&&(e=this.notifications.find(t=>t.id===e),e||console.warn("Notification not found:",i)),e}async open(e,i=null,t=null){return new Promise(s=>{if(e=this.getNotification(e),this.isOpen(e)){s(e);return}t===null&&(t=e.getAttribute("delay")),i===null&&(i=e.hasAttribute("focus")),setTimeout(()=>{e.toggleAttribute("open",!0),e.addEventListener("transitionend",o=>{i&&e.focus();const a=e.querySelector(".notification-visually-hidden");a&&a.remove(),e.insertAdjacentHTML("afterbegin",`<p class="notification-visually-hidden" id="${e.getAttribute("aria-labelledby")}">${e.getAttribute("label")??this.#e("notification")}</p>`),s(e)},{once:!0}),e.classList.add("transition-in"),e.classList.remove("hide")},t)})}#a(e){const i=e;let t=i.classList.contains("hide");new MutationObserver(r=>{r.forEach(o=>{const{target:a}=o;if(o.attributeName==="class"){const n=a.classList.contains("hide");t!==n&&(t=n,t?this.close(e):this.open(e))}})}).observe(i,{attributes:!0,attributeFilter:["class"]})}isOpen(e){return e=this.getNotification(e),e?e.hasAttribute("open"):!1}#e(e){return this.language in this.options.translations?this.options.translations[this.language][e]??this.options.translations.en[e]??e:e}#o(){if(this.previouslyFocusedElement&&this.previouslyFocusedElement!==document.body)this.previouslyFocusedElement.focus();else{const e=document.querySelector(this.options.focusResetSelector);e?e.focus():document.activeElement.blur()}}}window.notification=new NotificationArea;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.