New:Socket for Asana Is Now Available.Learn more
Get Started

M2 Zaubertool Add-On

Package Overview
Versions
2
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zaubertool@example.local - firefox Package Compare versions

Comparing version
1.1.0
to
1.1.1
+1
-1
content_scripts_case.js

@@ -1,1 +0,1 @@

(()=>{"use strict";var e={311:(e,t,n)=>{function o(e){const t=document.createElement("style");return t.type="text/css",t.innerText=e,document.head.appendChild(t),t}function r(e){e&&e.parentNode&&e.parentNode.removeChild(e)}n.d(t,{XY:()=>r,db:()=>o}),"undefined"!=typeof window&&(window.zaubertoolInject={injectCSS:o,injectJS:function(e){const t=document.createElement("script");return t.type="text/javascript",t.src=e,t.async=!1,(document.head||document.getElementsByTagName("head")[0]||document.documentElement).appendChild(t),t},injectCSSElement:function(e,t){const n=document.createElement("link");n.rel="stylesheet";try{const t=globalThis.browser;t&&t.runtime&&"function"==typeof t.runtime.getURL?n.href=t.runtime.getURL(e):n.href=e}catch(t){n.href=e}return t&&(n.id=t),(document.head||document.getElementsByTagName("head")[0]||document.documentElement).appendChild(n),n},removeInjectedElement:r})},621:(e,t,n)=>{function o(e,t,n){if(e&&(e.value=t,!n))for(let n in e)if(n.startsWith("__reactProps")){e[n].onChange({target:{value:t},currentTarget:e});break}}n.d(t,{e:()=>o})},900:(e,t,n)=>{n.d(t,{nx:()=>i,aQ:()=>a});var o=n(621);const r="ztMod_",a="\n.autocomplete {\n position: relative;\n display: inline-block;\n}\n\n.autocomplete-items {\n position: absolute;\n border: 1px solid #d4d4d4;\n border-bottom: none;\n border-top: none;\n z-index: 99;\n /*position the autocomplete items to be the same width as the container:*/\n top: 100%;\n left: 0;\n right: 0;\n}\n\n.autocomplete-items div {\n padding: 10px;\n cursor: pointer;\n background-color: #fff;\n border-bottom: 1px solid #d4d4d4;\n}\n\n/*when hovering an item:*/\n.autocomplete-items div:hover {\n background-color: #e9e9e9;\n}\n\n/*when navigating through the items using the arrow keys:*/\n.autocomplete-active {\n background-color: DodgerBlue !important;\n color: #ffffff;\n}";function i(e,t=[],n=!1,a,i,l,c,s){if(!e)return;e.setAttribute("autocomplete","off");let u=-1;function d(t){if(a)return String(t?.[a]??t??"");if(s){const n="string"==typeof s?new RegExp(s,"g"):s,o=e?e.value:"",r=o.match(n);return r&&r.length&&r[0]?o.replace(r[0],"")+String(t??""):String(t??"")}return String(t??"")}function m(e,t){if(!t)return!1;if(t=t.toLowerCase(),s){const e="string"==typeof s?new RegExp(s,"g"):s,n=t.match(e);if(!n||!n.length||!n[0])return!1;t=n[0]}return String(d(e)).toLowerCase().includes(t.toLowerCase())}function g(t){if(l&&l.length){var n="";for(let e=0;e<l.length;e++){const o=t[l[e]];if("string"==typeof o&&(n=n+" "+o),Array.isArray(o))for(let e=0;e<o.length;e++)n=n+" "+o[e]}return n.trim()}if(s){const n="string"==typeof s?new RegExp(s,"g"):s,o=e?e.value:"",r=o.match(n);return r&&r.length&&r[0]?o.replace(r[0],"")+String(t??""):String(t??"")}return String(t??"")}function h(t){for(var n=document.getElementsByClassName("autocomplete-items"),o=0;o<n.length;o++)t!=n[o]&&t!=e&&n[o].parentNode.removeChild(n[o])}function p(n){if(!n||!n.value)return;let a,i;h(),u=-1,a=document.createElement("DIV");const l=r+(n.id||"")+"autocomplete-list";a.setAttribute("id",l),a.setAttribute("class","autocomplete-items"),n.parentNode.appendChild(a);for(let n=0;n<t.length;n++){i=document.createElement("DIV");const r=g(t[n]);i.appendChild(document.createTextNode(r));const l=document.createElement("input");l.type="hidden",l.title=d(t[n]),l.value=r,i.appendChild(l),i.addEventListener("click",function(r){const a=this.getElementsByTagName("input")[0].title;(0,o.e)(e,a),h(),"function"==typeof c&&c(t[n])}),a.appendChild(i)}}function f(e){if(!e)return!1;!function(e){if(e)for(let t=0;t<e.length;t++)e[t].classList.remove("autocomplete-active")}(e),u>=e.length&&(u=0),u<0&&(u=e.length-1),e[u].classList.add("autocomplete-active")}n&&e.addEventListener("focusin",function(e){p(this)}),e.addEventListener("input",function(n){let a,i,l=this.value;if(!l)return void p(this);h(),u=-1,a=document.createElement("DIV");const s=r+(this.id||"")+"autocomplete-list";a.setAttribute("id",s),a.setAttribute("class","autocomplete-items"),this.parentNode.appendChild(a);for(let n=0;n<t.length;n++)if(m(t[n],l)){i=document.createElement("DIV");const r=g(t[n]),s=r.toLowerCase().indexOf(l.toLowerCase());if(s<0)i.appendChild(document.createTextNode(r));else{s>0&&i.appendChild(document.createTextNode(r.substring(0,s)));const e=document.createElement("strong");e.textContent=r.substring(s,s+l.length),i.appendChild(e),i.appendChild(document.createTextNode(r.substring(s+l.length)))}const u=document.createElement("input");u.type="hidden",u.title=d(t[n]),u.value=g(t[n]),i.appendChild(u),i.addEventListener("click",function(r){const a=this.getElementsByTagName("input")[0].title;(0,o.e)(e,a),h(),"function"==typeof c&&c(t[n])}),a.appendChild(i)}}),e.addEventListener("keydown",function(e){const t=document.getElementById(r+(this.id||"")+"autocomplete-list");let n=t?t.getElementsByTagName("div"):null;40==e.keyCode?(u++,f(n)):38==e.keyCode?(u--,f(n)):13==e.keyCode&&(e.preventDefault(),u>-1&&n&&n[u].click())}),document.addEventListener("click",function(e){h(e.target&&e.target instanceof Element?e.target:null)})}"undefined"!=typeof window&&(window.zaubertoolAutocomplete={autocomplete:i})}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const o=["team.m2-loesung.de","team-staging.m2-loesung.de"];function r(e){try{if(!e)return"undefined"!=typeof location&&o.includes(location.hostname);let t="";return t="string"==typeof e?e:e instanceof URL?e.hostname:e.hostname||"",o.includes(t)}catch(e){return!1}}function a(){try{const e=new URL(location.href);if(!r(e))return!1;if(!/\/cases\/[^\/]+\/processing\/[^\/]+/i.test(e.pathname))return!1;const t=e.searchParams.get("tab");return!!(t&&"overview"===t.toLowerCase()||e.hash&&e.hash.toLowerCase().includes("overview")||location.href.includes("tab=overview")||document.getElementById("comments")||document.querySelector("textarea#comments"))}catch(e){return!1}}const i=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});function l(){const e=["#comments","textarea#comments"];for(let t of e){const e=document.querySelector(t);if(e)return e}return null}function c(e){const t="zt-large-comments-style",n=document.getElementById(t);if(a())if(e){if(n)return;const e=document.createElement("style");e.id=t,e.textContent="textarea#comments, #comments { height: 350px !important; max-height: 350px !important; }",(document.head||document.documentElement).appendChild(e);const o=l();o&&o.style.removeProperty("height"),console.log("Zaubertool: applied large comments style")}else{n&&n.remove();const e=l();e&&e.style.removeProperty("height"),console.log("Zaubertool: removed large comments style")}else if(!e){n&&n.remove();const e=l();e&&e.style.removeProperty("height")}}i.largeCase||(i.largeCase=!0);try{browser.storage.local.get({largeComments:!1}).then(e=>{Boolean(e.largeComments)&&c(!0)}).catch(()=>{})}catch(e){}try{browser.storage.onChanged.addListener((e,t)=>{if("local"===t&&"largeComments"in e){const t=e.largeComments.newValue;c(Boolean(t))}})}catch(e){}const s=()=>{try{browser.storage.local.get({largeComments:!1}).then(e=>{Boolean(e.largeComments)&&c(!0)}).catch(()=>{})}catch(e){}};window.addEventListener("popstate",s);const u=history.pushState;history.pushState=function(){const e=u.apply(this,arguments);return s(),e};const d=history.replaceState;history.replaceState=function(){const e=d.apply(this,arguments);return s(),e};var m=n(311),g=n(900);const h=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});h.tasksSuggestions||(h.tasksSuggestions=!0);const p=["auf Antwort von VN warten","auf Antwort von KP warten","Klagereife hergestellt","auf Daten von VN warten","spätestens rückmelden bis","VN nicht erreichbar, löschen","KP anrufen","VN anrufen","schließen, wenn keine Rückmeldung","Posteingang prüfen","Posteingang prüfen (beA)","Achtung! Frist bis","Status Abfragen"];let f=null,b=null,y=!1;function E(){try{const e=new URL(location.href);if(!r(e))return!1;const t=/\/cases\/[^\/]+\/processing\/[^\/]+/i.test(e.pathname);if(!t)return!1;const n=e.searchParams.get("tab");if(n&&"processing"===n.toLowerCase())return!0;if(e.hash&&e.hash.toLowerCase().includes("processing"))return!0;const o=location.href.includes("tab=processing"),a=Boolean(n&&"processing"===n.toLowerCase())||Boolean(e.hash&&e.hash.toLowerCase().includes("processing"))||o;return console.debug("Zaubertool(tasks): isProcessingTabPage",{href:location.href,hostname:e.hostname,pathMatches:t,queryTab:n,result:a}),!(!document.getElementById("tasks-content")&&!document.querySelector("form[id='add-task-form']"))}catch(e){return console.debug("Zaubertool(tasks): isProcessingTabPage - error",e),!1}}function v(){try{b||(b=(0,m.db)(g.aQ)),console.debug("Zaubertool(tasks): suggestionSetterTasks - injected CSS",{cssElId:b?.id||null});const e=document.getElementById("tasks-content")||document.body,t={attributes:!1,childList:!0,subtree:!0},n=(e,t)=>{console.debug("Zaubertool(tasks): mutation callback",{mutationCount:e?.length||0});const n=document.querySelectorAll("form[id='add-task-form']");console.debug("Zaubertool(tasks): found add-task forms",{count:n?.length||0}),n&&n.length&&n.forEach(e=>{!function(e){if(e)try{console.debug("Zaubertool(tasks): attachToAddTaskForm called",{formId:e.id});const t=e.dataset?e.dataset.zaubertoolAutocomplete:void 0,n=e.getAttribute("data-zaubertool-autocomplete");if(t||"1"===n)return;const o=e.querySelector('input[type="text"], input:not([type]), textarea');if(!o)return;console.debug("Zaubertool(tasks): attachToAddTaskForm - attaching autocomplete",{formId:e.id,inputId:o.id||null,tagName:o.tagName});try{e.dataset?e.dataset.zaubertoolAutocomplete="1":e.setAttribute("data-zaubertool-autocomplete","1")}catch(t){e.setAttribute("data-zaubertool-autocomplete","1")}(0,g.nx)(o,p,!0)}catch(e){console.error("Zaubertool(tasks): attachToAddTaskForm error",e)}}(e)})};n(),f=new MutationObserver(n),f.observe(e,t),console.debug("Zaubertool(tasks): suggestionSetterTasks - MutationObserver connected",{target:e?.id||e?.tagName})}catch(e){console.error("Zaubertool(tasks): suggestionSetterTasks - error",e)}}function w(){try{b||(b=(0,m.db)(g.aQ)),console.debug("Zaubertool(tasks): suggestionSetterFirstContactTask - injected CSS",{cssElId:b?.id||null});const e=document.getElementById("nextTaskAtTitle");console.debug("Zaubertool(tasks): suggestionSetterFirstContactTask - found nextTaskAtTitle",{found:!!e,elId:e?.id||null}),e&&(0,g.nx)(e,p,!0)}catch(e){console.error("Zaubertool(tasks): suggestionSetterFirstContactTask - error",e)}}function x(){y?console.debug("Zaubertool(tasks): init - already initialized"):(y=!0,E()?(console.log("Zaubertool(tasks): init - initializing suggestions"),v(),w()):console.debug("Zaubertool(tasks): init - not a processing page; aborting init"))}const S={init:x,destroy:function(){y=!1,console.log("Zaubertool(tasks): destroy - cleaning up");try{f&&(console.debug("Zaubertool(tasks): destroy - disconnecting observer"),f.disconnect(),f=null)}catch(e){console.error("Zaubertool(tasks): destroy - observer disconnect error",e)}try{b&&(console.debug("Zaubertool(tasks): destroy - removing injected css"),(0,m.XY)(b),b=null)}catch(e){console.error("Zaubertool(tasks): destroy - css removal error",e)}},suggestionSetterTasks:v,suggestionSetterFirstContactTask:w,isProcessingTabPage:E};try{E()&&x()}catch(e){}var L=n(621);const M=["@kabelmail.de","@arcor.de","@netcologne.de","@yahoo.com","@myyahoo.com","@gmail.com","@outlook.de","@outlook.com","@web.de","@live.com","@live.de","@icloud.com","@hotmail.com","@hotmail.de","@protonmail.com","@t-online.de","@freenet.de","@unitybox.de","@gmx.de","@gmx.net","@posteo.de","@aol.com"],A=["policyholderAttributes.email","conflictPartnerAttributes.email","contactPersonAttributes.email","conflictContactAttributes.email"],O=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});O.emailAutocomplete||(O.emailAutocomplete=!0);let D=null,T=null,k=!1;const _=new Map;function C(e){try{let t=document.getElementById(e);if(t)return t;if(t=document.querySelector(`input[name="${e}"], textarea[name="${e}"]`),t)return t;const n=document.getElementById(e);if(n){const e=n.querySelector("input, textarea");if(e)return e}const o=e.split("."),r=o[o.length-1];return document.querySelector(`input[id$="-${r}"]`)||null}catch(e){return null}}function Z(e){if(!e)return;if(_.has(e))return;console.debug("Zaubertool(email): setup for",{id:e.id,name:e.getAttribute("name")}),D||(D=(0,m.db)(g.aQ));const t=t=>{try{const n=t.clipboardData?.getData("text")||"",o=n.replace(/\(\s*at\s*\)|\[\s*at\s*\]/gi,"@");if(o!==n){t.preventDefault();const r=e.selectionStart||0,a=e.selectionEnd||0,i=e.value.substring(0,r)+o+e.value.substring(a||r);(0,L.e)(e,i);try{const t=r+o.length;e.selectionStart=e.selectionEnd=t}catch(e){}console.debug("Zaubertool(email): paste sanitized",{pasteText:n,sanitized:o,newVal:i})}}catch(e){console.error("Zaubertool(email): paste handler error",e)}},n=t=>{try{let t=e.value||"";const n=/\(\s*at\s*\)|\[\s*at\s*\]/gi;if(n.test(t))try{const o=e.selectionStart||0;let r=0;for(const e of Array.from(t.matchAll(n)))"number"==typeof e.index&&e.index<o&&(r+=e[0].length-1);const a=t.replace(n,"@");if(a!==t){(0,L.e)(e,a);const n=Math.max(0,o-r);setTimeout(()=>{try{e.selectionStart=e.selectionEnd=n}catch(e){}},0),t=a,console.debug("Zaubertool(email): live paste replacement performed",{old:e.value,newValue:a})}}catch(e){console.error("Zaubertool(email): live replacement error",e)}const o=t.trim();t!==o&&((0,L.e)(e,o),t=o,console.debug("Zaubertool(email): trimmed value",{newValue:o})),/@\s*$/.test(t)&&console.debug("Zaubertool(email): found trailing @ - suggestions available",{id:e.id,value:t})}catch(e){console.error("Zaubertool(email): input handler error",e)}},o=()=>{try{const n=e.value||"",o=(t=n)?t.replace(/\(\s*at\s*\)|\[\s*at\s*\]/gi,"@").trim():t;n!==o&&((0,L.e)(e,o),console.debug("Zaubertool(email): blur sanitized",{old:n,new:o}))}catch(e){console.error("Zaubertool(email): blur error",e)}var t};e.addEventListener("paste",t),e.addEventListener("input",n),e.addEventListener("blur",o);try{(0,g.nx)(e,M,!1,void 0,void 0,void 0,void 0,"@(.*)")}catch(e){}_.set(e,{input:n,paste:t,blur:o})}function B(){k||(k=!0,a()?(console.log("Zaubertool(email): initializing"),D||(D=(0,m.db)(g.aQ)),function(){for(let e of A){const t=C(e);t?Z(t):console.debug("Zaubertool(email): field not found",{id:e})}}(),T=new MutationObserver(e=>{try{for(let t of e)for(let e of A){const t=C(e);t&&!_.has(t)&&(console.debug("Zaubertool(email): MutationObserver found field; attaching",{id:e}),Z(t))}}catch(e){console.error("Zaubertool(email): mutation observer error",e)}}),T.observe(document.body,{childList:!0,subtree:!0})):console.debug("Zaubertool(email): not on overview processing page, skipping init"))}const q={init:B,destroy:function(){k=!1,console.log("Zaubertool(email): destroy");try{T&&(T.disconnect(),T=null)}catch(e){console.error("Zaubertool(email): destroy observer error",e)}try{for(const[e,t]of _.entries())try{e.removeEventListener("input",t.input),e.removeEventListener("paste",t.paste),e.removeEventListener("blur",t.blur)}catch(e){}_.clear()}catch(e){console.error("Zaubertool(email): destroy handlers error",e)}try{D&&((0,m.XY)(D),D=null)}catch(e){console.error("Zaubertool(email): destroy css error",e)}}};try{browser.storage.local.get({emailAutocomplete:!1}).then(e=>{Boolean(e.emailAutocomplete)&&a()&&B()}).catch(()=>{})}catch(e){}const P=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});P.relationAutocomplete||(P.relationAutocomplete=!0);const U=["Ehefrau","Ehemann","Tochter","Sohn","Vater","Mutter","Partnerin","Partner","Prokurist/in","Vertreter/in","Übersetzer/in"],R=["contactPersonAttributes.relationToPolicyholder"];let z=null,I=null,N=!1;const $=new Map;function F(e){try{let t=document.getElementById(e);if(t)return t;if(t=document.querySelector(`input[name="${e}"], textarea[name="${e}"]`),t)return t;const n=document.getElementById(e);if(n){const e=n.querySelector("input, textarea");if(e)return e}const o=e.split("."),r=o[o.length-1];return document.querySelector(`input[id$="-${r}"]`)||null}catch(e){return null}}function V(e){if(!e)return;if($.has(e))return;console.debug("Zaubertool(relation): setup for",{id:e.id,name:e.getAttribute("name")}),z||(z=(0,m.db)(g.aQ));const t=t=>{try{const t=e.value||"";t&&t.trim().length}catch(e){console.error("Zaubertool(relation) input handler error",e)}};e.addEventListener("input",t);try{(0,g.nx)(e,U,!0)}catch(e){}$.set(e,{input:t})}function j(){N||(N=!0,a()?(console.log("Zaubertool(relation): initializing"),z||(z=(0,m.db)(g.aQ)),function(){for(let e of R){const t=F(e);t?V(t):console.debug("Zaubertool(relation): field not found",{id:e})}}(),I=new MutationObserver(e=>{try{for(let t of e)for(let e of R){const t=F(e);t&&!$.has(t)&&(console.debug("Zaubertool(relation): MutationObserver found field; attaching",{id:e}),V(t))}}catch(e){console.error("Zaubertool(relation): mutation observer error",e)}}),I.observe(document.body,{childList:!0,subtree:!0})):console.debug("Zaubertool(relation): not on overview processing page, skipping init"))}const H={init:j,destroy:function(){N=!1,console.log("Zaubertool(relation): destroy");try{I&&(I.disconnect(),I=null)}catch(e){console.error("Zaubertool(relation): destroy observer error",e)}try{for(const[e,t]of $.entries())try{e.removeEventListener("input",t.input)}catch(e){}$.clear()}catch(e){console.error("Zaubertool(relation): destroy handlers error",e)}try{z&&((0,m.XY)(z),z=null)}catch(e){console.error("Zaubertool(relation): destroy css error",e)}}};try{browser.storage.local.get({relationSuggestions:!1}).then(e=>{Boolean(e.relationSuggestions)&&a()&&j()}).catch(()=>{})}catch(e){}function W(e){return function(e){if(!e)return"unknown";const t=e.toLowerCase().trim();return t.includes("dokumentation kontakt")?"contact_documentation":t.includes("nachricht an versicherungsnehmer")?"contact_vn":t.includes("dokumentation erstkontakt versicherungsnehmer")?"first_contact_vn":t.includes("vollmacht")&&t.includes("anfordern")?"letter_of_attorney":t.includes("notiz anlegen")?"note":"unknown"}(function(e){try{const t=e||document.querySelector('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');if(!t)return null;const n=["h2.MuiDialogTitle-root",'h2[role="heading"]',"h2"];for(const e of n){const n=t.querySelector(e);if(n){const e=(n.textContent||"").trim();if(e.length>0)return e}}const o=t.querySelector(".MuiTypography-root.MuiTypography-h6, .MuiDialogTitle-root, .dialog-title, .modal-title");return o&&(o.textContent||"").trim()||null}catch(e){return null}}(e))}let K=null;const G=new Map;function Q(e){const t=e;if(!t)return{destroy:()=>{}};if(G.has(t))return G.get(t);const n=t.querySelector(".MuiDialogTitle-root")||t.querySelector("h2")||null;if(!n)return{destroy:()=>{}};n.classList.add("zt-draggable-handle");try{const e=W(t);console.debug("Zaubertool(draggable): attach for modal type",e)}catch(e){}let o=0,r=0,a=0,i=0,l=!1,c="",s="",u="",d="",m="",g="",h="";function p(e){try{e.preventDefault(),l=!0;const n=e.touches?e.touches[0]:e;o=n.clientX,r=n.clientY;const p=t.getBoundingClientRect(),y=window.getComputedStyle(t);a=p.left,i=p.top,c=t.style.position||"",s=t.style.left||"",u=t.style.top||"",d=t.style.width||"",m=t.style.height||"",g=t.style.maxHeight||"",h=t.style.transform||"",t.style.position="fixed",t.style.width=`${Math.round(p.width)}px`,t.style.height=`${Math.round(p.height)}px`,y&&y.maxHeight&&(t.style.maxHeight=y.maxHeight),t.style.transform="none",t.style.left=`${a}px`,t.style.top=`${i}px`,window.addEventListener("mousemove",f,!0),window.addEventListener("mouseup",b,!0),window.addEventListener("touchmove",f,{passive:!1}),window.addEventListener("touchend",b,!0)}catch(e){}}function f(e){if(l)try{const n=e.touches?e.touches[0]:e,l=n.clientX-o,c=n.clientY-r;t.style.left=`${a+l}px`,t.style.top=`${i+c}px`,e.preventDefault()}catch(e){}}function b(){l&&(l=!1,window.removeEventListener("mousemove",f,!0),window.removeEventListener("mouseup",b,!0),window.removeEventListener("touchmove",f,!0),window.removeEventListener("touchend",b,!0))}n.addEventListener("mousedown",p,!0),n.addEventListener("touchstart",p,{passive:!1});const y={destroy:()=>{try{n.removeEventListener("mousedown",p,!0),n.removeEventListener("touchstart",p,!0),window.removeEventListener("mousemove",f,!0),window.removeEventListener("mouseup",b,!0),window.removeEventListener("touchmove",f,!0),window.removeEventListener("touchend",b,!0),n.classList.remove("zt-draggable-handle"),""===c?t.style.removeProperty("position"):t.style.position=c,""===s?t.style.removeProperty("left"):t.style.left=s,""===u?t.style.removeProperty("top"):t.style.top=u,""===d?t.style.removeProperty("width"):t.style.width=d,""===m?t.style.removeProperty("height"):t.style.height=m,""===g?t.style.removeProperty("max-height"):t.style.maxHeight=g,""===h?t.style.removeProperty("transform"):t.style.transform=h}catch(e){}}};return G.set(t,y),y}function X(){try{!function(){const e="zt-draggable-modal-css";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n .zt-draggable-handle { cursor: move; user-select: none; }\n ",document.head.appendChild(t)}();const e=Array.from(document.querySelectorAll(".MuiDialog-paper, dialog, .dialog, .modal"));for(const t of e)G.has(t)||Q(t)}catch(e){}}const Y={init:function(){try{if(X(),K)return;K=new MutationObserver(e=>{for(const t of e)t.target.querySelector&&X()}),K.observe(document.body,{childList:!0,subtree:!0})}catch(e){}},destroy:function(){try{K&&(K.disconnect(),K=null);for(const[e,t]of G.entries())try{t.destroy()}catch(e){}G.clear()}catch(e){}}};globalThis.__ZAUBERTOOL_MODULE_LOADED=globalThis.__ZAUBERTOOL_MODULE_LOADED||{},globalThis.__ZAUBERTOOL_MODULE_LOADED.draggableModals=!0;let J=null,ee=null,te=!1;function ne(){if(!J)return;const e=window.devicePixelRatio||1;J.width=Math.floor(window.innerWidth*e),J.height=Math.floor(window.innerHeight*e),J.style.width=`${window.innerWidth}px`,J.style.height=`${window.innerHeight}px`;const t=J.getContext("2d");t&&t.scale(e,e)}function oe(){te&&(ee&&cancelAnimationFrame(ee),ee=null,J&&(J.remove(),J=null),window.removeEventListener("resize",ne),te=!1)}function re(e){return"zt_case_settings_"+e}async function ae(e){try{const t=re(e),n=await browser.storage.local.get(t);if(console.debug("zt.caseSettings.getCaseSettings",{key:t,obj:n}),n&&Object.prototype.hasOwnProperty.call(n,t)){return n[t]||null}return null}catch(t){return console.warn("zt.caseSettings.getCaseSettings error",{caseId:e,error:t}),null}}async function ie(e){return async function(e,t){try{const n=await ae(e);return n&&Object.prototype.hasOwnProperty.call(n,t)?n[t]:null}catch(n){return console.warn("zt.caseSettings.getCaseSetting error",{caseId:e,name:t,error:n}),null}}(e,"progressState")}async function le(e,t){try{if(null==t)return;const n=await ae(e)||{};n.progressState=t,n.updatedAt=new Date,await async function(e,t){try{const n=re(e);null==t?(await browser.storage.local.remove(n),console.debug("zt.caseSettings.setCaseSettings remove",{key:n})):(await browser.storage.local.set({[n]:t}),console.debug("zt.caseSettings.setCaseSettings set",{key:n,settings:t}))}catch(t){console.warn("zt.caseSettings.setCaseSettings error",{caseId:e,error:t})}}(e,n)}catch(e){}}new Map;const ce=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});ce.gamefication||(ce.gamefication=!0);let se=null,ue=null,de=null,me=!1,ge=null,he=null,pe=null;async function fe(){try{const e=function(){try{const e=location.pathname.match(/\/cases\/([^/]+)/i)||location.pathname.match(/\/case\/([^/]+)/i);if(e&&e[1])return e[1]}catch(e){}return null}();if(!e)return void(de=null);de=e;const t=document.querySelector("header.MuiPaper-root.MuiPaper")||document.querySelector("header")||document.querySelector(".MuiPaper-root.MuiPaper"),n=function(e){if(!e)return"none";try{const t=Array.from(e.querySelectorAll('button, a, [role="button"]'));let n=!1,o=!1;for(const e of t){const t=(e.textContent||"").trim(),r=(t.normalize&&t.normalize("NFKD")?t.normalize("NFKD"):t).replace(/[\u0300-\u036f]/g,"").toLowerCase();r&&(r.includes("nachricht")&&r.includes("m2")&&(o=!0),r.includes("bearbeitung")&&r.includes("abschliessen")&&(n=!0))}return o?"completed":n?"in_progress":"none"}catch(e){return"none"}}(t),o=await ie(e);if(await ae(e),o!==n&&(o||"none"!==n?await le(e,"none"===n?null:n):await le(e,"in_progress"),"in_progress"===o&&"completed"===n))try{!function(e=4e3){if(te)return;te=!0,J=function(){const e=document.createElement("canvas");e.id="zt-gamification-canvas",e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.width="100%",e.style.height="100%",e.style.zIndex="999999999",e.style.pointerEvents="none";const t=window.devicePixelRatio||1;e.width=Math.floor(window.innerWidth*t),e.height=Math.floor(window.innerHeight*t),e.style.width=`${window.innerWidth}px`,e.style.height=`${window.innerHeight}px`;const n=e.getContext("2d");return n&&n.scale(t,t),e}(),document.body.appendChild(J);const t=J.getContext("2d"),n=[],o=(e,t)=>Math.random()*(t-e)+e,r=Math.max(3,Math.floor(window.innerWidth/300));let a=0;const i=setInterval(()=>{!function(e,t){for(let r=0;r<40;r++){const r=Math.random()*Math.PI*2,a=o(2,8),i={x:e,y:t,vx:Math.cos(r)*a,vy:Math.sin(r)*a,life:o(60,120),age:0,size:o(1,3),color:`hsl(${o(0,360)}, ${o(50,100)}%, ${o(50,70)}%)`};n.push(i)}}(o(100,window.innerWidth-100),o(100,window.innerHeight/2)),a++,a>=r&&clearInterval(i)},300);!function e(){if(J){t.clearRect(0,0,J.width,J.height);for(let e=n.length-1;e>=0;e--){const o=n[e];o.x+=o.vx,o.y+=o.vy,o.vy+=.05,o.vx*=.99,o.vy*=.99,o.age++;const r=Math.max(0,1-o.age/o.life);t.beginPath(),t.fillStyle=o.color,t.globalAlpha=r,t.arc(o.x,o.y,o.size,0,2*Math.PI),t.fill(),t.globalAlpha=1,o.age>o.life&&n.splice(e,1)}ee=requestAnimationFrame(e)}}(),window.addEventListener("resize",ne),setTimeout(()=>{oe()},e+500)}(3e3)}catch(e){}if(ue){try{ue.disconnect()}catch(e){}ue=null}t&&(ue=new MutationObserver(()=>{setTimeout(()=>fe(),40)}),ue.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","aria-hidden"]}))}catch(e){}}async function be(){try{await fe()}catch(e){}}function ye(){if(!se)try{fe(),me||(ge=history.pushState,history.pushState=function(){const e=ge.apply(this,arguments);return setTimeout(()=>{fe()},40),e},he=history.replaceState,history.replaceState=function(){const e=he.apply(this,arguments);return setTimeout(()=>{fe()},40),e},pe=()=>{fe()},window.addEventListener("popstate",pe),me=!0)}catch(e){}}const Ee={init:ye,destroy:function(){se&&(document.body.removeEventListener("click",se,!0),se=null);try{oe()}catch(e){}try{ue&&(ue.disconnect(),ue=null)}catch(e){}try{me&&(ge&&(history.pushState=ge),he&&(history.replaceState=he),pe&&window.removeEventListener("popstate",pe),me=!1,ge=null,he=null,pe=null)}catch(e){}}};try{browser.storage.local.get({gamification:!1}).then(e=>{Boolean(e.gamification)&&ye()}).catch(()=>{})}catch(e){}const ve="zt-contact-doc-toolbar",we="zt-contact-doc-toolbar",xe=[{label:"eingehend beA",text:"eingegangen bei und per beA"},{label:"ausgehend beA",text:"per beA gesendet"},{label:"eingehend E-Mail",text:"eingegangen bei und per E-Mail"},{label:"ausgehend E-Mail",text:"per E-Mail gesendet"},{label:"eingehend Post",text:"eingegangen bei und per Post"},{label:"ausgehend Post",text:"per Post gesendet"},{label:"Leeren",text:""}],Se=`\n .${ve} { display:flex; gap:8px; margin-top:6px; margin-bottom:6px; }\n .${ve} button { padding:4px 8px; border-radius:4px; border:1px solid rgba(0,0,0,0.08); background:#fff; cursor:pointer; }\n .${ve} button:hover { background: #f3f3f3; }\n`;let Le=null,Me=!1,Ae=null;const Oe="contactDocumentationSuggestions";function De(e){try{if("contact_documentation"!==W(e))return;const t=function(e){try{const t=Array.from(e.querySelectorAll("p, h1, h2, h3, div"));for(const e of t){const t=(e.textContent||"").trim().toLowerCase();if("notiz"===t||t.startsWith("notiz")||"note"===t||t.startsWith("note"))return e}return null}catch(e){return null}}(e);if(!t)return;if(e.querySelector(`#${we}`))return;const n=function(){const e=document.createElement("div");e.className=ve,e.id=we;for(const t of xe){const n=document.createElement("button");n.type="button",n.textContent=t.label,n.dataset.template=t.text,n.dataset.replace=t.replace?"1":"0",n.addEventListener("click",e=>{try{const t=e.currentTarget,n=t.closest('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');if(!n)return;const o=n.querySelector('.tiptap.ProseMirror[contenteditable="true"], .tiptap .ProseMirror[contenteditable="true"], .rich-text-field [contenteditable="true"]');if(!o)return;const r=t.dataset.template||"",a="1"===t.dataset.replace;if(""===r)return void(o.innerHTML='<p><br class="ProseMirror-trailingBreak"></p>');o.focus();try{a?o.innerText=r:document.execCommand("insertText",!1,r)}catch(e){o.innerText=a?r:(o.innerText||"")+r}try{const e=new InputEvent("input",{bubbles:!0,cancelable:!0});o.dispatchEvent(e)}catch(e){}}catch(e){}}),e.appendChild(n)}return e}();let o=function(e){try{if(!e)return null;let t=e.nextElementSibling,n=0;for(;t&&n<6;){if(n++,t.matches&&(t.matches(".tiptap")||t.querySelector&&(t.querySelector(".tiptap")||t.querySelector(".ProseMirror")||t.querySelector("[contenteditable]"))))return t;const e=t.querySelector&&t.querySelector(".ProseMirror, .tiptap, [contenteditable]");if(e)return e;t=t.nextElementSibling}const o=e.parentElement;if(o){const e=o.querySelector(".tiptap, .ProseMirror, [contenteditable], .rich-text-field, .MuiTiptap-RichTextContent-root");if(e)return e;let t=o.nextElementSibling;for(n=0;t&&n<5;){if(n++,t.querySelector&&(t.querySelector(".tiptap")||t.querySelector(".ProseMirror")||t.querySelector("[contenteditable]")))return t.querySelector(".tiptap, .ProseMirror, [contenteditable]");t=t.nextElementSibling}}return null}catch(e){return null}}(t);if(!o){const e=t.nextElementSibling;o=e&&e.matches&&(e.matches(".tiptap")||e.querySelector&&e.querySelector(".tiptap"))&&e||t.parentElement&&t.parentElement.querySelector(".tiptap")}const r=function(e,t,n){try{if(!e||!t)return null;const o=new Set;let r=e;for(;r&&n.contains(r);)o.add(r),r=r.parentElement;for(r=t;r&&n.contains(r);){if(o.has(r))return r;r=r.parentElement}return null}catch(e){return null}}(t,o,e)||function(e){try{if(!e)return null;let t=e.parentElement,n=0;for(;t&&n<8;){if(n++,t.querySelector&&t.querySelector(".tiptap, .ProseMirror, [contenteditable], .MuiTiptap-FieldContainer-root"))return t;t=t.parentElement}return e.closest(".MuiStack-root, .MuiGrid-root, .MuiBox-root, .MuiFormControl-root")}catch(e){return null}}(t)||(o?o.closest(".MuiStack-root, .MuiGrid-root, .MuiTiptap-FieldContainer-root, .MuiTiptap-RichTextField-root"):null);if(r)if(o&&r.contains(o)&&o.parentElement)o.parentElement.insertBefore(n,o),console.debug("Zaubertool(contactDocs): toolbar inserted before rich editor inside block");else if(t.parentElement){const e=t.nextElementSibling;e&&r.contains(e)&&t.parentElement?(t.parentElement.insertBefore(n,e),console.debug("Zaubertool(contactDocs): toolbar inserted after heading inside block")):(t.parentElement.appendChild(n),console.debug("Zaubertool(contactDocs): toolbar appended to heading parent as fallback"))}else r.appendChild(n),console.debug("Zaubertool(contactDocs): toolbar appended to block fallback");else if(o&&o.parentElement)o.parentElement.insertBefore(n,o),console.debug("Zaubertool(contactDocs): toolbar inserted above rich editor");else{const o=t.parentElement?.nextElementSibling||t.nextElementSibling;o&&o.parentElement?(o.parentElement.insertBefore(n,o),console.debug("Zaubertool(contactDocs): toolbar inserted (via fallback insertion)")):t.parentElement?(t.parentElement.appendChild(n),console.debug("Zaubertool(contactDocs): toolbar appended to notiz parent")):(e.appendChild(n),console.debug("Zaubertool(contactDocs): toolbar appended to modal as last fallback"))}}catch(e){}}globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});const Te={init:function(){Me||globalThis.__ZAUBERTOOL_MODULE_LOADED[Oe]||(globalThis.__ZAUBERTOOL_MODULE_LOADED[Oe]=!0,Me=!0,console.debug("Zaubertool(contactDocs): init"),Ae=(0,m.db)(Se),function(){try{const e=Array.from(document.querySelectorAll('[role="dialog"], .MuiDialog-root, .MuiDialog-paper'));for(const t of e)De(t)}catch(e){}}(),Le=new MutationObserver(e=>{for(const t of e)if(t.addedNodes&&t.addedNodes.length>0)for(const e of Array.from(t.addedNodes)){if(!(e instanceof Element))continue;const t=e;if(t.matches&&(t.matches('[role="dialog"]')||t.matches(".MuiDialog-root")||t.matches(".MuiDialog-paper"))){De(t);continue}const n=t.querySelector&&t.querySelector('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');n&&De(n)}}),Le.observe(document.body,{childList:!0,subtree:!0}))},destroy:function(){Me=!1,console.debug("Zaubertool(contactDocs): destroy");try{Le&&(Le.disconnect(),Le=null),Ae&&(Ae.remove(),Ae=null);const e=document.querySelectorAll(`#${we}`);for(const t of Array.from(e))t.parentElement&&t.parentElement.removeChild(t);globalThis.__ZAUBERTOOL_MODULE_LOADED[Oe]=!1}catch(e){}}},ke="zt-attorney-toolbar",_e="zt-attorney-toolbar",Ce=[{label:"Unberechtigte Forderung",text:"Unberechtigte Forderung",replace:!1},{label:"Mängel Kaufvertrag",text:"Mängel Kaufvertrag",replace:!1},{label:"Leeren",text:"",replace:!0}],Ze=`\n .${ke} { display:flex; gap:8px; margin-top:6px; margin-bottom:6px; }\n .${ke} button { padding:4px 8px; border-radius:4px; border:1px solid rgba(0,0,0,0.08); background:#fff; cursor:pointer; }\n .${ke} button:hover { background: #f3f3f3; }\n`;let Be=null,qe=null,Pe=!1;const Ue="letterOfAttorneySuggestions";function Re(e){try{const t=Array.from(e.querySelectorAll("label, p, h1, h2, h3, div"));for(const e of t){const t=(e.textContent||"").trim().toLowerCase();if("begründung"===t||t.startsWith("begründung")||"grund"===t||"reason"===t)return e}}catch(e){}return null}function ze(e){if(!e)return null;const t=e.parentElement;if(t){const e=Array.from(t.querySelectorAll("textarea"));for(const t of e){if("true"===t.getAttribute("aria-hidden"))continue;const e=t.getBoundingClientRect&&t.getBoundingClientRect();if(!e||0!==e.height)return t}}const n=e.nextElementSibling;if(n){const e=Array.from(n.querySelectorAll("textarea"));for(const t of e){if("true"===t.getAttribute("aria-hidden"))continue;const e=t.getBoundingClientRect&&t.getBoundingClientRect();if(!e||0!==e.height)return t}if(n.tagName&&"textarea"===n.tagName.toLowerCase())return n}const o=Array.from(document.querySelectorAll('textarea#attorneyReason, textarea[name*="attorney"], textarea[name*="reason"], textarea[id*="attorney"], textarea[id*="reason"]'));for(const e of o){if("true"===e.getAttribute("aria-hidden"))continue;const t=e.getBoundingClientRect&&e.getBoundingClientRect();if(!t||0!==t.height)return e}return null}function Ie(e){try{if("letter_of_attorney"!==W(e))return;const t=Re(e);if(!t)return;if(e.querySelector(`#${_e}`))return;const n=function(){const e=document.createElement("div");e.className=ke,e.id=_e;for(const t of Ce){const n=document.createElement("button");n.type="button",n.textContent=t.label,n.dataset.template=t.text,n.dataset.replace=t.replace?"1":"0",n.addEventListener("click",e=>{try{const t=e.currentTarget,n=t.closest('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');if(!n)return;const o=ze(Re(n))||n.querySelector("textarea");if(!o)return;const r=t.dataset.template||"",a="1"===t.dataset.replace;if(""===r)o.value="";else{o.focus();try{o.value=a?r:(o.value||"")+(o.value?"\n":"")+r}catch(e){o.value=a?r:(o.value||"")+(o.value?"\n":"")+r}}try{const e=new InputEvent("input",{bubbles:!0,cancelable:!0});o.dispatchEvent(e)}catch(e){}try{for(const e in o)if(e.startsWith("__reactProps")){o[e].onChange&&o[e].onChange({target:o,currentTarget:o});break}}catch(e){}}catch(e){}}),e.appendChild(n)}return e}(),o=ze(t),r=function(e,t,n){try{if(!e||!t)return null;const o=new Set;let r=e;for(;r&&n.contains(r);)o.add(r),r=r.parentElement;for(r=t;r&&n.contains(r);){if(o.has(r))return r;r=r.parentElement}return null}catch(e){return null}}(t,o,e)||function(e){try{if(!e)return null;let t=e.parentElement,n=0;for(;t&&n<8;){if(n++,t.querySelector&&t.querySelector("textarea, input, .MuiInputBase-root, .MuiFormControl-root"))return t;t=t.parentElement}return e.closest(".MuiStack-root, .MuiGrid-root, .MuiBox-root, .MuiFormControl-root")}catch(e){return null}}(t)||(o?o.closest(".MuiInputBase-root, .MuiFormControl-root"):null);r?t&&r.contains(t)&&t.parentElement?(t.parentElement.insertBefore(n,t),console.debug("Zaubertool(letterOfAttorney): toolbar inserted before label inside block")):o&&r.contains(o)&&o.parentElement?(o.parentElement.insertBefore(n,o),console.debug("Zaubertool(letterOfAttorney): toolbar inserted before textarea inside block")):(r.appendChild(n),console.debug("Zaubertool(letterOfAttorney): toolbar appended to block fallback")):o&&o.parentElement?(o.parentElement.insertBefore(n,o),console.debug("Zaubertool(letterOfAttorney): toolbar inserted above textarea")):t.parentElement?t.parentElement.appendChild(n):e.appendChild(n),console.debug("Zaubertool(letterOfAttorney): toolbar inserted")}catch(e){}}globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});const Ne={init:function(){Pe||globalThis.__ZAUBERTOOL_MODULE_LOADED[Ue]||(globalThis.__ZAUBERTOOL_MODULE_LOADED[Ue]=!0,Pe=!0,qe=(0,m.db)(Ze),function(){try{const e=Array.from(document.querySelectorAll('[role="dialog"], .MuiDialog-root, .MuiDialog-paper'));for(const t of e)Ie(t)}catch(e){}}(),Be=new MutationObserver(e=>{for(const t of e)if(t.addedNodes&&t.addedNodes.length>0)for(const e of Array.from(t.addedNodes)){if(!(e instanceof Element))continue;const t=e;if(t.matches&&(t.matches('[role="dialog"]')||t.matches(".MuiDialog-root")||t.matches(".MuiDialog-paper"))){Ie(t);continue}const n=t.querySelector&&t.querySelector('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');n&&Ie(n)}}),Be.observe(document.body,{childList:!0,subtree:!0}))},destroy:function(){Pe=!1;try{Be&&(Be.disconnect(),Be=null),qe&&(qe.remove(),qe=null);const e=document.querySelectorAll(`#${_e}`);for(const t of Array.from(e))t.parentElement&&t.parentElement.removeChild(t);globalThis.__ZAUBERTOOL_MODULE_LOADED[Ue]=!1}catch(e){}}},$e="zt-contact-vn-toolbar",Fe="zt-contact-vn-toolbar",Ve=[{label:"Anrede Herr",text:"Sehr geehrter Herr\n ",replace:!1},{label:"Anrede Frau",text:"Sehr geehrte Frau\n ",replace:!1},{label:"Keine Rückmeldung",text:"leider erfolgte bisher keine Rückmeldung.\n ",replace:!1},{label:"RA vor Ort",text:"leider kam keine Rückmeldung der Gegenseite. Ich fürchte, dass das gerichtlich geklärt werden muss.\n\nMeine Zuständigkeit umfasst lediglich die außergerichtliche Konfliktlösung. In so einem Fall muss ich Sie daher an einer Kanzlei Ihrer Wahl vor Ort verweisen, die die Sache gerichtlich durchsetzen kann. Hierbei kann je nach Ihrem Vertrag mit der Rechtsschutzversicherung eine Selbstbeteiligung anfallen. Bezüglich der generellen Deckung kann ich Ihnen leider keine Information geben. Geben Sie mir gern kurz Bescheid.",replace:!1},{label:"Leeren",text:"",replace:!0}],je=`\n .${$e} { display:flex; gap:8px; margin-top:6px; margin-bottom:6px; }\n .${$e} button { padding:4px 8px; border-radius:4px; border:1px solid rgba(0,0,0,0.08); background:#fff; cursor:pointer; }\n .${$e} button:hover { background: #f3f3f3; }\n`;let He=null,We=!1,Ke=null;const Ge="contactVnSuggestions";function Qe(e){try{if("contact_vn"!==W(e))return;const t=function(e){try{const t=Array.from(e.querySelectorAll("p, h1, h2, h3, div"));for(const e of t){const t=(e.textContent||"").trim().toLowerCase();if("nachricht"===t||t.startsWith("nachricht")||"message"===t||t.startsWith("message"))return e}return null}catch(e){return null}}(e);if(!t)return;if(e.querySelector(`#${Fe}`))return;const n=function(){const e=document.createElement("div");e.className=$e,e.id=Fe;for(const t of Ve){const n=document.createElement("button");n.type="button",n.textContent=t.label,n.dataset.template=t.text,n.dataset.replace=t.replace?"1":"0",n.addEventListener("click",e=>{try{const t=e.currentTarget,n=t.closest('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');if(!n)return;const o=n.querySelector('.tiptap.ProseMirror[contenteditable="true"], .tiptap .ProseMirror[contenteditable="true"], .rich-text-field [contenteditable="true"]');if(!o)return;const r=t.dataset.template||"",a="1"===t.dataset.replace;if(""===r)return void(o.innerHTML='<p><br class="ProseMirror-trailingBreak"></p>');o.focus();try{a?o.innerText=r:document.execCommand("insertText",!1,r)}catch(e){o.innerText=a?r:(o.innerText||"")+r}try{o.dispatchEvent(new InputEvent("input",{bubbles:!0,cancelable:!0}))}catch(e){}}catch(e){}}),e.appendChild(n)}return e}(),o=function(e){try{if(!e)return null;let t=e.nextElementSibling,n=0;for(;t&&n<6;){if(n++,t.matches&&(t.matches(".tiptap")||t.querySelector&&t.querySelector(".tiptap, .ProseMirror, [contenteditable]")))return t;const e=t.querySelector&&t.querySelector(".ProseMirror, .tiptap, [contenteditable]");if(e)return e;t=t.nextElementSibling}const o=e.parentElement;if(o){const e=o.querySelector(".tiptap, .ProseMirror, [contenteditable]");if(e)return e;let t=o.nextElementSibling;for(n=0;t&&n<5;){n++;const e=t.querySelector&&t.querySelector(".tiptap, .ProseMirror, [contenteditable]");if(e)return e;t=t.nextElementSibling}}return null}catch(e){return null}}(t)||t.nextElementSibling||t.parentElement?.querySelector(".tiptap"),r=function(e,t,n){try{if(!e||!t)return null;const o=new Set;let r=e;for(;r&&n.contains(r);)o.add(r),r=r.parentElement;for(r=t;r&&n.contains(r);){if(o.has(r))return r;r=r.parentElement}return null}catch(e){return null}}(t,o,e)||function(e){try{if(!e)return null;let t=e.parentElement,n=0;for(;t&&n<8;){if(n++,t.querySelector(".tiptap, .ProseMirror, [contenteditable], textarea"))return t;t=t.parentElement}return e.closest(".MuiStack-root, .MuiGrid-root, .MuiBox-root, .MuiFormControl-root")}catch(e){return null}}(t)||(o?o.closest(".MuiStack-root, .MuiGrid-root, .MuiTiptap-FieldContainer-root, .MuiTiptap-RichTextField-root"):null);if(r)if(o&&r.contains(o)&&o.parentElement)o.parentElement.insertBefore(n,o),console.debug("Zaubertool(contactVn): toolbar inserted before editor inside block");else if(t&&t.parentElement){const e=t.nextElementSibling;e&&r.contains(e)&&t.parentElement?(t.parentElement.insertBefore(n,e),console.debug("Zaubertool(contactVn): toolbar inserted after heading inside block")):(t.parentElement.appendChild(n),console.debug("Zaubertool(contactVn): toolbar appended to heading parent fallback"))}else r.appendChild(n),console.debug("Zaubertool(contactVn): toolbar appended to block fallback");else o&&o.parentElement?(o.parentElement.insertBefore(n,o),console.debug("Zaubertool(contactVn): toolbar inserted above editor")):t.parentElement?(t.parentElement.appendChild(n),console.debug("Zaubertool(contactVn): toolbar appended to heading parent")):(e.appendChild(n),console.debug("Zaubertool(contactVn): toolbar appended to modal"))}catch(e){}}globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});const Xe={init:function(){We||globalThis.__ZAUBERTOOL_MODULE_LOADED[Ge]||(globalThis.__ZAUBERTOOL_MODULE_LOADED[Ge]=!0,We=!0,Ke=(0,m.db)(je),function(){try{const e=Array.from(document.querySelectorAll('[role="dialog"], .MuiDialog-root, .MuiDialog-paper'));for(const t of e)Qe(t)}catch(e){}}(),He=new MutationObserver(e=>{for(const t of e)if(t.addedNodes&&t.addedNodes.length>0)for(const e of Array.from(t.addedNodes)){if(!(e instanceof Element))continue;const t=e;if(t.matches&&(t.matches('[role="dialog"]')||t.matches(".MuiDialog-root")||t.matches(".MuiDialog-paper"))){Qe(t);continue}const n=t.querySelector&&t.querySelector('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');n&&Qe(n)}}),He.observe(document.body,{childList:!0,subtree:!0}))},destroy:function(){We=!1,globalThis.__ZAUBERTOOL_MODULE_LOADED[Ge]=!1;try{He&&(He.disconnect(),He=null),Ke&&(Ke.remove(),Ke=null);const e=document.querySelectorAll(`#${Fe}`);for(const t of Array.from(e))t.parentElement&&t.parentElement.removeChild(t)}catch(e){}}};let Ye=!1,Je=!1,et=!1,tt=!1,nt=!1,ot=null,rt=null,at=null;async function it(){if(!Ye){Ye=!0;try{Ee&&Ee.init&&Ee.init()}catch(e){console.error("Zaubertool(case): enableGamification error",e)}}}async function lt(){if(Ye){Ye=!1;try{Ee&&Ee.destroy&&Ee.destroy()}catch(e){console.error("Zaubertool(case): disableGamification error",e)}}}async function ct(){try{const e=await browser.storage.local.get({gamification:!1,emailAutocomplete:!1,relationSuggestions:!1,draggableModals:!1});Ye=Boolean(e.gamification),Je=Boolean(e.emailAutocomplete),tt=Boolean(e.relationSuggestions),et=Boolean(e.draggableModals),Ye&&await it(),Je&&a()&&q&&q.init&&q.init(),tt&&a()&&H&&H.init&&H.init(),et&&Y&&Y.init&&Y.init();try{Te&&Te.init&&Te.init()}catch(e){}try{Ne&&Ne.init&&Ne.init()}catch(e){}try{Xe&&Xe.init&&Xe.init()}catch(e){}}catch(e){}}browser.runtime.onMessage.addListener(async e=>{if(e&&e.id)switch(e.id){case"large-comments":c("On"===e.value);break;case"gamification":"On"===e.value?await it():await lt();break;case"email-autocomplete":Je="On"===e.value,Je&&a()?q&&q.init&&q.init():q&&q.destroy&&q.destroy();break;case"relation-suggestions":tt="On"===e.value,tt&&a()?H&&H.init&&H.init():H&&H.destroy&&H.destroy();break;case"draggable-modals":et="On"===e.value,et?Y&&Y.init&&Y.init():Y&&Y.destroy&&Y.destroy()}});try{S&&S.isProcessingTabPage&&S.isProcessingTabPage()&&S.init&&S.init(),et&&Y&&Y.init&&Y.init&&Y.init()}catch(e){}const st=async()=>{try{await ct(),S&&S.isProcessingTabPage&&S.isProcessingTabPage()?S.init&&S.init():S.destroy&&S.destroy(),Je&&a()?q&&q.init&&q.init():q&&q.destroy&&q.destroy(),tt&&a()?H&&H.init&&H.init():H&&H.destroy&&H.destroy(),et?Y.init&&Y.init():Y.destroy&&Y.destroy(),Ye&&be&&be&&be()}catch(e){}};window.addEventListener("popstate",st);const ut=history.pushState;history.pushState=function(){const e=ut.apply(this,arguments);return st(),e};const dt=history.replaceState;history.replaceState=function(){const e=dt.apply(this,arguments);return st(),e};try{browser.storage.onChanged.addListener((e,t)=>{if("local"===t){if("gamification"in e){const t=e.gamification.newValue;Boolean(t)?it():lt()}if("emailAutocomplete"in e){const t=e.emailAutocomplete.newValue;Je=Boolean(t),Je&&a()?q.init&&q.init():q.destroy&&q.destroy()}if("draggableModals"in e){const t=e.draggableModals.newValue;et=Boolean(t),et?Y.init&&Y.init():Y&&Y.destroy&&Y.destroy()}if("relationSuggestions"in e){const t=e.relationSuggestions.newValue;tt=Boolean(t),tt&&a()?H.init&&H.init():H.destroy&&H.destroy()}}})}catch(e){}try{(function(){try{if(nt)return;nt=!0;const e=e=>{try{const t=e.target;if(!t)return;t.closest('[role="tab"], [data-tab], a[href*="tab="]')&&(at&&window.clearTimeout(at),at=window.setTimeout(()=>st(),40))}catch(e){}};document.body.addEventListener("click",e,!0),ot=e,document.addEventListener("visibilitychange",st),window.addEventListener("focus",st);const t=e=>{try{for(const t of e){if("attributes"===t.type){const e=t.attributeName;if("class"===e||"aria-selected"===e){at&&window.clearTimeout(at),at=window.setTimeout(()=>st(),40);break}}if("childList"===t.type&&t.addedNodes&&t.addedNodes.length>0){at&&window.clearTimeout(at),at=window.setTimeout(()=>st(),40);break}}}catch(e){}};let n=document;const o=document.querySelector('[role="tablist"]');if(o)n=o;else{const e=document.querySelector("#tabs, .tabs, .tablist, [data-tabs]");e&&(n=e)}rt=new MutationObserver(t),rt.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","aria-selected"]})}catch(e){}})(),ct().then(()=>st()).catch(()=>{})}catch(e){}})();
(()=>{"use strict";var e={311:(e,t,n)=>{function o(e){const t=document.createElement("style");return t.type="text/css",t.innerText=e,document.head.appendChild(t),t}function r(e){e&&e.parentNode&&e.parentNode.removeChild(e)}n.d(t,{XY:()=>r,db:()=>o}),"undefined"!=typeof window&&(window.zaubertoolInject={injectCSS:o,injectJS:function(e){const t=document.createElement("script");return t.type="text/javascript",t.src=e,t.async=!1,(document.head||document.getElementsByTagName("head")[0]||document.documentElement).appendChild(t),t},injectCSSElement:function(e,t){const n=document.createElement("link");n.rel="stylesheet";try{const t=globalThis.browser;t&&t.runtime&&"function"==typeof t.runtime.getURL?n.href=t.runtime.getURL(e):n.href=e}catch(t){n.href=e}return t&&(n.id=t),(document.head||document.getElementsByTagName("head")[0]||document.documentElement).appendChild(n),n},removeInjectedElement:r})},621:(e,t,n)=>{function o(e,t,n){if(e&&(e.value=t,!n))for(let n in e)if(n.startsWith("__reactProps")){e[n].onChange({target:{value:t},currentTarget:e});break}}n.d(t,{e:()=>o})},900:(e,t,n)=>{n.d(t,{nx:()=>i,aQ:()=>a});var o=n(621);const r="ztMod_",a="\n.autocomplete {\n position: relative;\n display: inline-block;\n}\n\n.autocomplete-items {\n position: absolute;\n border: 1px solid #d4d4d4;\n border-bottom: none;\n border-top: none;\n z-index: 99;\n /*position the autocomplete items to be the same width as the container:*/\n top: 100%;\n left: 0;\n right: 0;\n}\n\n.autocomplete-items div {\n padding: 10px;\n cursor: pointer;\n background-color: #fff;\n border-bottom: 1px solid #d4d4d4;\n}\n\n/*when hovering an item:*/\n.autocomplete-items div:hover {\n background-color: #e9e9e9;\n}\n\n/*when navigating through the items using the arrow keys:*/\n.autocomplete-active {\n background-color: DodgerBlue !important;\n color: #ffffff;\n}";function i(e,t=[],n=!1,a,i,l,c,s){if(!e)return;e.setAttribute("autocomplete","off");let u=-1;function d(t){if(a)return String(t?.[a]??t??"");if(s){const n="string"==typeof s?new RegExp(s,"g"):s,o=e?e.value:"",r=o.match(n);return r&&r.length&&r[0]?o.replace(r[0],"")+String(t??""):String(t??"")}return String(t??"")}function m(e,t){if(!t)return!1;if(t=t.toLowerCase(),s){const e="string"==typeof s?new RegExp(s,"g"):s,n=t.match(e);if(!n||!n.length||!n[0])return!1;t=n[0]}return String(d(e)).toLowerCase().includes(t.toLowerCase())}function g(t){if(l&&l.length){var n="";for(let e=0;e<l.length;e++){const o=t[l[e]];if("string"==typeof o&&(n=n+" "+o),Array.isArray(o))for(let e=0;e<o.length;e++)n=n+" "+o[e]}return n.trim()}if(s){const n="string"==typeof s?new RegExp(s,"g"):s,o=e?e.value:"",r=o.match(n);return r&&r.length&&r[0]?o.replace(r[0],"")+String(t??""):String(t??"")}return String(t??"")}function h(t){for(var n=document.getElementsByClassName("autocomplete-items"),o=0;o<n.length;o++)t!=n[o]&&t!=e&&n[o].parentNode.removeChild(n[o])}function p(n){if(!n||!n.value)return;let a,i;h(),u=-1,a=document.createElement("DIV");const l=r+(n.id||"")+"autocomplete-list";a.setAttribute("id",l),a.setAttribute("class","autocomplete-items"),n.parentNode.appendChild(a);for(let n=0;n<t.length;n++){i=document.createElement("DIV");const r=g(t[n]);i.appendChild(document.createTextNode(r));const l=document.createElement("input");l.type="hidden",l.title=d(t[n]),l.value=r,i.appendChild(l),i.addEventListener("click",function(r){const a=this.getElementsByTagName("input")[0].title;(0,o.e)(e,a),h(),"function"==typeof c&&c(t[n])}),a.appendChild(i)}}function f(e){if(!e)return!1;!function(e){if(e)for(let t=0;t<e.length;t++)e[t].classList.remove("autocomplete-active")}(e),u>=e.length&&(u=0),u<0&&(u=e.length-1),e[u].classList.add("autocomplete-active")}n&&e.addEventListener("focusin",function(e){p(this)}),e.addEventListener("input",function(n){let a,i,l=this.value;if(!l)return void p(this);h(),u=-1,a=document.createElement("DIV");const s=r+(this.id||"")+"autocomplete-list";a.setAttribute("id",s),a.setAttribute("class","autocomplete-items"),this.parentNode.appendChild(a);for(let n=0;n<t.length;n++)if(m(t[n],l)){i=document.createElement("DIV");const r=g(t[n]),s=r.toLowerCase().indexOf(l.toLowerCase());if(s<0)i.appendChild(document.createTextNode(r));else{s>0&&i.appendChild(document.createTextNode(r.substring(0,s)));const e=document.createElement("strong");e.textContent=r.substring(s,s+l.length),i.appendChild(e),i.appendChild(document.createTextNode(r.substring(s+l.length)))}const u=document.createElement("input");u.type="hidden",u.title=d(t[n]),u.value=g(t[n]),i.appendChild(u),i.addEventListener("click",function(r){const a=this.getElementsByTagName("input")[0].title;(0,o.e)(e,a),h(),"function"==typeof c&&c(t[n])}),a.appendChild(i)}}),e.addEventListener("keydown",function(e){const t=document.getElementById(r+(this.id||"")+"autocomplete-list");let n=t?t.getElementsByTagName("div"):null;40==e.keyCode?(u++,f(n)):38==e.keyCode?(u--,f(n)):13==e.keyCode&&(e.preventDefault(),u>-1&&n&&n[u].click())}),document.addEventListener("click",function(e){h(e.target&&e.target instanceof Element?e.target:null)})}"undefined"!=typeof window&&(window.zaubertoolAutocomplete={autocomplete:i})}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const o=["team.m2-loesung.de","team-staging.m2-loesung.de"];function r(e){try{if(!e)return"undefined"!=typeof location&&o.includes(location.hostname);let t="";return t="string"==typeof e?e:e instanceof URL?e.hostname:e.hostname||"",o.includes(t)}catch(e){return!1}}function a(){try{const e=new URL(location.href);if(!r(e))return!1;if(!/\/cases\/[^\/]+\/processing\/[^\/]+/i.test(e.pathname))return!1;const t=e.searchParams.get("tab");return!!(t&&"overview"===t.toLowerCase()||e.hash&&e.hash.toLowerCase().includes("overview")||location.href.includes("tab=overview")||document.getElementById("comments")||document.querySelector("textarea#comments"))}catch(e){return!1}}const i=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});function l(){const e=["#comments","textarea#comments"];for(let t of e){const e=document.querySelector(t);if(e)return e}return null}function c(e){const t="zt-large-comments-style",n=document.getElementById(t);if(a())if(e){if(n)return;const e=document.createElement("style");e.id=t,e.textContent="textarea#comments, #comments { height: 350px !important; max-height: 350px !important; }",(document.head||document.documentElement).appendChild(e);const o=l();o&&o.style.removeProperty("height"),console.log("Zaubertool: applied large comments style")}else{n&&n.remove();const e=l();e&&e.style.removeProperty("height"),console.log("Zaubertool: removed large comments style")}else if(!e){n&&n.remove();const e=l();e&&e.style.removeProperty("height")}}i.largeCase||(i.largeCase=!0);try{browser.storage.local.get({largeComments:!1}).then(e=>{Boolean(e.largeComments)&&c(!0)}).catch(()=>{})}catch(e){}try{browser.storage.onChanged.addListener((e,t)=>{if("local"===t&&"largeComments"in e){const t=e.largeComments.newValue;c(Boolean(t))}})}catch(e){}const s=()=>{try{browser.storage.local.get({largeComments:!1}).then(e=>{Boolean(e.largeComments)&&c(!0)}).catch(()=>{})}catch(e){}};window.addEventListener("popstate",s);const u=history.pushState;history.pushState=function(){const e=u.apply(this,arguments);return s(),e};const d=history.replaceState;history.replaceState=function(){const e=d.apply(this,arguments);return s(),e};var m=n(311),g=n(900);const h=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});h.tasksSuggestions||(h.tasksSuggestions=!0);const p=["auf Antwort von VN warten","auf Antwort von KP warten","Klagereife hergestellt","auf Daten von VN warten","spätestens rückmelden bis","VN nicht erreichbar, löschen","KP anrufen","VN anrufen","schließen, wenn keine Rückmeldung","Posteingang prüfen","Posteingang prüfen (beA)","Achtung! Frist bis","Status Abfragen"];let f=null,b=null,y=!1;function E(){try{const e=new URL(location.href);if(!r(e))return!1;const t=/\/cases\/[^\/]+\/processing\/[^\/]+/i.test(e.pathname);if(!t)return!1;const n=e.searchParams.get("tab");if(n&&"processing"===n.toLowerCase())return!0;if(e.hash&&e.hash.toLowerCase().includes("processing"))return!0;const o=location.href.includes("tab=processing"),a=Boolean(n&&"processing"===n.toLowerCase())||Boolean(e.hash&&e.hash.toLowerCase().includes("processing"))||o;return console.debug("Zaubertool(tasks): isProcessingTabPage",{href:location.href,hostname:e.hostname,pathMatches:t,queryTab:n,result:a}),!(!document.getElementById("tasks-content")&&!document.querySelector("form[id='add-task-form']"))}catch(e){return console.debug("Zaubertool(tasks): isProcessingTabPage - error",e),!1}}function v(){try{b||(b=(0,m.db)(g.aQ)),console.debug("Zaubertool(tasks): suggestionSetterTasks - injected CSS",{cssElId:b?.id||null});const e=document.getElementById("tasks-content")||document.body,t={attributes:!1,childList:!0,subtree:!0},n=(e,t)=>{console.debug("Zaubertool(tasks): mutation callback",{mutationCount:e?.length||0});const n=document.querySelectorAll("form[id='add-task-form']");console.debug("Zaubertool(tasks): found add-task forms",{count:n?.length||0}),n&&n.length&&n.forEach(e=>{!function(e){if(e)try{console.debug("Zaubertool(tasks): attachToAddTaskForm called",{formId:e.id});const t=e.dataset?e.dataset.zaubertoolAutocomplete:void 0,n=e.getAttribute("data-zaubertool-autocomplete");if(t||"1"===n)return;const o=e.querySelector('input[type="text"], input:not([type]), textarea');if(!o)return;console.debug("Zaubertool(tasks): attachToAddTaskForm - attaching autocomplete",{formId:e.id,inputId:o.id||null,tagName:o.tagName});try{e.dataset?e.dataset.zaubertoolAutocomplete="1":e.setAttribute("data-zaubertool-autocomplete","1")}catch(t){e.setAttribute("data-zaubertool-autocomplete","1")}(0,g.nx)(o,p,!0)}catch(e){console.error("Zaubertool(tasks): attachToAddTaskForm error",e)}}(e)})};n(),f=new MutationObserver(n),f.observe(e,t),console.debug("Zaubertool(tasks): suggestionSetterTasks - MutationObserver connected",{target:e?.id||e?.tagName})}catch(e){console.error("Zaubertool(tasks): suggestionSetterTasks - error",e)}}function w(){try{b||(b=(0,m.db)(g.aQ)),console.debug("Zaubertool(tasks): suggestionSetterFirstContactTask - injected CSS",{cssElId:b?.id||null});const e=document.getElementById("nextTaskAtTitle");console.debug("Zaubertool(tasks): suggestionSetterFirstContactTask - found nextTaskAtTitle",{found:!!e,elId:e?.id||null}),e&&(0,g.nx)(e,p,!0)}catch(e){console.error("Zaubertool(tasks): suggestionSetterFirstContactTask - error",e)}}function x(){y?console.debug("Zaubertool(tasks): init - already initialized"):(y=!0,E()?(console.log("Zaubertool(tasks): init - initializing suggestions"),v(),w()):console.debug("Zaubertool(tasks): init - not a processing page; aborting init"))}const S={init:x,destroy:function(){y=!1,console.log("Zaubertool(tasks): destroy - cleaning up");try{f&&(console.debug("Zaubertool(tasks): destroy - disconnecting observer"),f.disconnect(),f=null)}catch(e){console.error("Zaubertool(tasks): destroy - observer disconnect error",e)}try{b&&(console.debug("Zaubertool(tasks): destroy - removing injected css"),(0,m.XY)(b),b=null)}catch(e){console.error("Zaubertool(tasks): destroy - css removal error",e)}},suggestionSetterTasks:v,suggestionSetterFirstContactTask:w,isProcessingTabPage:E};try{E()&&x()}catch(e){}var L=n(621);const M=["@kabelmail.de","@arcor.de","@netcologne.de","@yahoo.com","@myyahoo.com","@gmail.com","@outlook.de","@outlook.com","@web.de","@live.com","@live.de","@icloud.com","@hotmail.com","@hotmail.de","@protonmail.com","@t-online.de","@freenet.de","@unitybox.de","@gmx.de","@gmx.net","@posteo.de","@aol.com"],A=["policyholderAttributes.email","conflictPartnerAttributes.email","contactPersonAttributes.email","conflictContactAttributes.email"],O=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});O.emailAutocomplete||(O.emailAutocomplete=!0);let D=null,T=null,k=!1;const _=new Map;function C(e){try{let t=document.getElementById(e);if(t)return t;if(t=document.querySelector(`input[name="${e}"], textarea[name="${e}"]`),t)return t;const n=document.getElementById(e);if(n){const e=n.querySelector("input, textarea");if(e)return e}const o=e.split("."),r=o[o.length-1];return document.querySelector(`input[id$="-${r}"]`)||null}catch(e){return null}}function Z(e){if(!e)return;if(_.has(e))return;console.debug("Zaubertool(email): setup for",{id:e.id,name:e.getAttribute("name")}),D||(D=(0,m.db)(g.aQ));const t=t=>{try{const n=t.clipboardData?.getData("text")||"",o=n.replace(/\(\s*at\s*\)|\[\s*at\s*\]/gi,"@");if(o!==n){t.preventDefault();const r=e.selectionStart||0,a=e.selectionEnd||0,i=e.value.substring(0,r)+o+e.value.substring(a||r);(0,L.e)(e,i);try{const t=r+o.length;e.selectionStart=e.selectionEnd=t}catch(e){}console.debug("Zaubertool(email): paste sanitized",{pasteText:n,sanitized:o,newVal:i})}}catch(e){console.error("Zaubertool(email): paste handler error",e)}},n=t=>{try{let t=e.value||"";const n=/\(\s*at\s*\)|\[\s*at\s*\]/gi;if(n.test(t))try{const o=e.selectionStart||0;let r=0;for(const e of Array.from(t.matchAll(n)))"number"==typeof e.index&&e.index<o&&(r+=e[0].length-1);const a=t.replace(n,"@");if(a!==t){(0,L.e)(e,a);const n=Math.max(0,o-r);setTimeout(()=>{try{e.selectionStart=e.selectionEnd=n}catch(e){}},0),t=a,console.debug("Zaubertool(email): live paste replacement performed",{old:e.value,newValue:a})}}catch(e){console.error("Zaubertool(email): live replacement error",e)}const o=t.trim();t!==o&&((0,L.e)(e,o),t=o,console.debug("Zaubertool(email): trimmed value",{newValue:o})),/@\s*$/.test(t)&&console.debug("Zaubertool(email): found trailing @ - suggestions available",{id:e.id,value:t})}catch(e){console.error("Zaubertool(email): input handler error",e)}},o=()=>{try{const n=e.value||"",o=(t=n)?t.replace(/\(\s*at\s*\)|\[\s*at\s*\]/gi,"@").trim():t;n!==o&&((0,L.e)(e,o),console.debug("Zaubertool(email): blur sanitized",{old:n,new:o}))}catch(e){console.error("Zaubertool(email): blur error",e)}var t};e.addEventListener("paste",t),e.addEventListener("input",n),e.addEventListener("blur",o);try{(0,g.nx)(e,M,!1,void 0,void 0,void 0,void 0,"@(.*)")}catch(e){}_.set(e,{input:n,paste:t,blur:o})}function B(){k||(k=!0,a()?(console.log("Zaubertool(email): initializing"),D||(D=(0,m.db)(g.aQ)),function(){for(let e of A){const t=C(e);t?Z(t):console.debug("Zaubertool(email): field not found",{id:e})}}(),T=new MutationObserver(e=>{try{for(let t of e)for(let e of A){const t=C(e);t&&!_.has(t)&&(console.debug("Zaubertool(email): MutationObserver found field; attaching",{id:e}),Z(t))}}catch(e){console.error("Zaubertool(email): mutation observer error",e)}}),T.observe(document.body,{childList:!0,subtree:!0})):console.debug("Zaubertool(email): not on overview processing page, skipping init"))}const q={init:B,destroy:function(){k=!1,console.log("Zaubertool(email): destroy");try{T&&(T.disconnect(),T=null)}catch(e){console.error("Zaubertool(email): destroy observer error",e)}try{for(const[e,t]of _.entries())try{e.removeEventListener("input",t.input),e.removeEventListener("paste",t.paste),e.removeEventListener("blur",t.blur)}catch(e){}_.clear()}catch(e){console.error("Zaubertool(email): destroy handlers error",e)}try{D&&((0,m.XY)(D),D=null)}catch(e){console.error("Zaubertool(email): destroy css error",e)}}};try{browser.storage.local.get({emailAutocomplete:!1}).then(e=>{Boolean(e.emailAutocomplete)&&a()&&B()}).catch(()=>{})}catch(e){}const P=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});P.relationAutocomplete||(P.relationAutocomplete=!0);const U=["Ehefrau","Ehemann","Tochter","Sohn","Vater","Mutter","Partnerin","Partner","Prokurist/in","Vertreter/in","Übersetzer/in"],R=["contactPersonAttributes.relationToPolicyholder"];let z=null,I=null,N=!1;const $=new Map;function F(e){try{let t=document.getElementById(e);if(t)return t;if(t=document.querySelector(`input[name="${e}"], textarea[name="${e}"]`),t)return t;const n=document.getElementById(e);if(n){const e=n.querySelector("input, textarea");if(e)return e}const o=e.split("."),r=o[o.length-1];return document.querySelector(`input[id$="-${r}"]`)||null}catch(e){return null}}function V(e){if(!e)return;if($.has(e))return;console.debug("Zaubertool(relation): setup for",{id:e.id,name:e.getAttribute("name")}),z||(z=(0,m.db)(g.aQ));const t=t=>{try{const t=e.value||"";t&&t.trim().length}catch(e){console.error("Zaubertool(relation) input handler error",e)}};e.addEventListener("input",t);try{(0,g.nx)(e,U,!0)}catch(e){}$.set(e,{input:t})}function j(){N||(N=!0,a()?(console.log("Zaubertool(relation): initializing"),z||(z=(0,m.db)(g.aQ)),function(){for(let e of R){const t=F(e);t?V(t):console.debug("Zaubertool(relation): field not found",{id:e})}}(),I=new MutationObserver(e=>{try{for(let t of e)for(let e of R){const t=F(e);t&&!$.has(t)&&(console.debug("Zaubertool(relation): MutationObserver found field; attaching",{id:e}),V(t))}}catch(e){console.error("Zaubertool(relation): mutation observer error",e)}}),I.observe(document.body,{childList:!0,subtree:!0})):console.debug("Zaubertool(relation): not on overview processing page, skipping init"))}const H={init:j,destroy:function(){N=!1,console.log("Zaubertool(relation): destroy");try{I&&(I.disconnect(),I=null)}catch(e){console.error("Zaubertool(relation): destroy observer error",e)}try{for(const[e,t]of $.entries())try{e.removeEventListener("input",t.input)}catch(e){}$.clear()}catch(e){console.error("Zaubertool(relation): destroy handlers error",e)}try{z&&((0,m.XY)(z),z=null)}catch(e){console.error("Zaubertool(relation): destroy css error",e)}}};try{browser.storage.local.get({relationSuggestions:!1}).then(e=>{Boolean(e.relationSuggestions)&&a()&&j()}).catch(()=>{})}catch(e){}function W(e){return function(e){if(!e)return"unknown";const t=e.toLowerCase().trim();return t.includes("dokumentation kontakt")?"contact_documentation":t.includes("nachricht an versicherungsnehmer")?"contact_vn":t.includes("dokumentation erstkontakt versicherungsnehmer")?"first_contact_vn":t.includes("vollmacht")&&t.includes("anfordern")?"letter_of_attorney":t.includes("notiz anlegen")?"note":"unknown"}(function(e){try{const t=e||document.querySelector('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');if(!t)return null;const n=["h2.MuiDialogTitle-root",'h2[role="heading"]',"h2"];for(const e of n){const n=t.querySelector(e);if(n){const e=(n.textContent||"").trim();if(e.length>0)return e}}const o=t.querySelector(".MuiTypography-root.MuiTypography-h6, .MuiDialogTitle-root, .dialog-title, .modal-title");return o&&(o.textContent||"").trim()||null}catch(e){return null}}(e))}let K=null;const G=new Map;function Q(e){const t=e;if(!t)return{destroy:()=>{}};if(G.has(t))return G.get(t);const n=t.querySelector(".MuiDialogTitle-root")||t.querySelector("h2")||null;if(!n)return{destroy:()=>{}};n.classList.add("zt-draggable-handle");try{const e=W(t);console.debug("Zaubertool(draggable): attach for modal type",e)}catch(e){}let o=0,r=0,a=0,i=0,l=!1,c="",s="",u="",d="",m="",g="",h="";function p(e){try{e.preventDefault(),l=!0;const n=e.touches?e.touches[0]:e;o=n.clientX,r=n.clientY;const p=t.getBoundingClientRect(),y=window.getComputedStyle(t);a=p.left,i=p.top,c=t.style.position||"",s=t.style.left||"",u=t.style.top||"",d=t.style.width||"",m=t.style.height||"",g=t.style.maxHeight||"",h=t.style.transform||"",t.style.position="fixed",t.style.width=`${Math.round(p.width)}px`,t.style.height=`${Math.round(p.height)}px`,y&&y.maxHeight&&(t.style.maxHeight=y.maxHeight),t.style.transform="none",t.style.left=`${a}px`,t.style.top=`${i}px`,window.addEventListener("mousemove",f,!0),window.addEventListener("mouseup",b,!0),window.addEventListener("touchmove",f,{passive:!1}),window.addEventListener("touchend",b,!0)}catch(e){}}function f(e){if(l)try{const n=e.touches?e.touches[0]:e,l=n.clientX-o,c=n.clientY-r;t.style.left=`${a+l}px`,t.style.top=`${i+c}px`,e.preventDefault()}catch(e){}}function b(){l&&(l=!1,window.removeEventListener("mousemove",f,!0),window.removeEventListener("mouseup",b,!0),window.removeEventListener("touchmove",f,!0),window.removeEventListener("touchend",b,!0))}n.addEventListener("mousedown",p,!0),n.addEventListener("touchstart",p,{passive:!1});const y={destroy:()=>{try{n.removeEventListener("mousedown",p,!0),n.removeEventListener("touchstart",p,!0),window.removeEventListener("mousemove",f,!0),window.removeEventListener("mouseup",b,!0),window.removeEventListener("touchmove",f,!0),window.removeEventListener("touchend",b,!0),n.classList.remove("zt-draggable-handle"),""===c?t.style.removeProperty("position"):t.style.position=c,""===s?t.style.removeProperty("left"):t.style.left=s,""===u?t.style.removeProperty("top"):t.style.top=u,""===d?t.style.removeProperty("width"):t.style.width=d,""===m?t.style.removeProperty("height"):t.style.height=m,""===g?t.style.removeProperty("max-height"):t.style.maxHeight=g,""===h?t.style.removeProperty("transform"):t.style.transform=h}catch(e){}}};return G.set(t,y),y}function X(){try{!function(){const e="zt-draggable-modal-css";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n .zt-draggable-handle { cursor: move; user-select: none; }\n ",document.head.appendChild(t)}();const e=Array.from(document.querySelectorAll(".MuiDialog-paper, dialog, .dialog, .modal"));for(const t of e)G.has(t)||Q(t)}catch(e){}}const Y={init:function(){try{if(X(),K)return;K=new MutationObserver(e=>{for(const t of e)t.target.querySelector&&X()}),K.observe(document.body,{childList:!0,subtree:!0})}catch(e){}},destroy:function(){try{K&&(K.disconnect(),K=null);for(const[e,t]of G.entries())try{t.destroy()}catch(e){}G.clear()}catch(e){}}};globalThis.__ZAUBERTOOL_MODULE_LOADED=globalThis.__ZAUBERTOOL_MODULE_LOADED||{},globalThis.__ZAUBERTOOL_MODULE_LOADED.draggableModals=!0;let J=null,ee=null,te=!1;function ne(){if(!J)return;const e=window.devicePixelRatio||1;J.width=Math.floor(window.innerWidth*e),J.height=Math.floor(window.innerHeight*e),J.style.width=`${window.innerWidth}px`,J.style.height=`${window.innerHeight}px`;const t=J.getContext("2d");t&&t.scale(e,e)}function oe(){te&&(ee&&cancelAnimationFrame(ee),ee=null,J&&(J.remove(),J=null),window.removeEventListener("resize",ne),te=!1)}function re(e){return"zt_case_settings_"+e}async function ae(e){try{const t=re(e),n=await browser.storage.local.get(t);if(console.debug("zt.caseSettings.getCaseSettings",{key:t,obj:n}),n&&Object.prototype.hasOwnProperty.call(n,t)){return n[t]||null}return null}catch(t){return console.warn("zt.caseSettings.getCaseSettings error",{caseId:e,error:t}),null}}async function ie(e){return async function(e,t){try{const n=await ae(e);return n&&Object.prototype.hasOwnProperty.call(n,t)?n[t]:null}catch(n){return console.warn("zt.caseSettings.getCaseSetting error",{caseId:e,name:t,error:n}),null}}(e,"progressState")}async function le(e,t){try{if(null==t)return;const n=await ae(e)||{};n.progressState=t,n.updatedAt=new Date,await async function(e,t){try{const n=re(e);null==t?(await browser.storage.local.remove(n),console.debug("zt.caseSettings.setCaseSettings remove",{key:n})):(await browser.storage.local.set({[n]:t}),console.debug("zt.caseSettings.setCaseSettings set",{key:n,settings:t}))}catch(t){console.warn("zt.caseSettings.setCaseSettings error",{caseId:e,error:t})}}(e,n)}catch(e){}}new Map;const ce=globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});ce.gamefication||(ce.gamefication=!0);let se=null,ue=null,de=null,me=!1,ge=null,he=null,pe=null;async function fe(){try{const e=function(){try{const e=location.pathname.match(/\/cases\/([^/]+)/i)||location.pathname.match(/\/case\/([^/]+)/i);if(e&&e[1])return e[1]}catch(e){}return null}();if(!e)return void(de=null);de=e;const t=document.querySelector("header.MuiPaper-root.MuiPaper")||document.querySelector("header")||document.querySelector(".MuiPaper-root.MuiPaper"),n=function(e){if(!e)return"none";try{const t=Array.from(e.querySelectorAll('button, a, [role="button"]'));let n=!1,o=!1;for(const e of t){const t=(e.textContent||"").trim(),r=(t.normalize&&t.normalize("NFKD")?t.normalize("NFKD"):t).replace(/[\u0300-\u036f]/g,"").toLowerCase();r&&(r.includes("nachricht")&&r.includes("m2")&&(o=!0),r.includes("bearbeitung")&&r.includes("abschliessen")&&(n=!0))}return o?"completed":n?"in_progress":"none"}catch(e){return"none"}}(t),o=await ie(e);if(await ae(e),o!==n&&(o||"none"!==n?await le(e,"none"===n?null:n):await le(e,"in_progress"),"in_progress"===o&&"completed"===n))try{!function(e=4e3){if(te)return;te=!0,J=function(){const e=document.createElement("canvas");e.id="zt-gamification-canvas",e.style.position="fixed",e.style.left="0",e.style.top="0",e.style.width="100%",e.style.height="100%",e.style.zIndex="999999999",e.style.pointerEvents="none";const t=window.devicePixelRatio||1;e.width=Math.floor(window.innerWidth*t),e.height=Math.floor(window.innerHeight*t),e.style.width=`${window.innerWidth}px`,e.style.height=`${window.innerHeight}px`;const n=e.getContext("2d");return n&&n.scale(t,t),e}(),document.body.appendChild(J);const t=J.getContext("2d"),n=[],o=(e,t)=>Math.random()*(t-e)+e,r=Math.max(3,Math.floor(window.innerWidth/300));let a=0;const i=setInterval(()=>{!function(e,t){for(let r=0;r<40;r++){const r=Math.random()*Math.PI*2,a=o(2,8),i={x:e,y:t,vx:Math.cos(r)*a,vy:Math.sin(r)*a,life:o(60,120),age:0,size:o(1,3),color:`hsl(${o(0,360)}, ${o(50,100)}%, ${o(50,70)}%)`};n.push(i)}}(o(100,window.innerWidth-100),o(100,window.innerHeight/2)),a++,a>=r&&clearInterval(i)},300);!function e(){if(J){t.clearRect(0,0,J.width,J.height);for(let e=n.length-1;e>=0;e--){const o=n[e];o.x+=o.vx,o.y+=o.vy,o.vy+=.05,o.vx*=.99,o.vy*=.99,o.age++;const r=Math.max(0,1-o.age/o.life);t.beginPath(),t.fillStyle=o.color,t.globalAlpha=r,t.arc(o.x,o.y,o.size,0,2*Math.PI),t.fill(),t.globalAlpha=1,o.age>o.life&&n.splice(e,1)}ee=requestAnimationFrame(e)}}(),window.addEventListener("resize",ne),setTimeout(()=>{oe()},e+500)}(3e3)}catch(e){}if(ue){try{ue.disconnect()}catch(e){}ue=null}t&&(ue=new MutationObserver(()=>{setTimeout(()=>fe(),40)}),ue.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","aria-hidden"]}))}catch(e){}}async function be(){try{await fe()}catch(e){}}function ye(){if(!se)try{fe(),me||(ge=history.pushState,history.pushState=function(){const e=ge.apply(this,arguments);return setTimeout(()=>{fe()},40),e},he=history.replaceState,history.replaceState=function(){const e=he.apply(this,arguments);return setTimeout(()=>{fe()},40),e},pe=()=>{fe()},window.addEventListener("popstate",pe),me=!0)}catch(e){}}const Ee={init:ye,destroy:function(){se&&(document.body.removeEventListener("click",se,!0),se=null);try{oe()}catch(e){}try{ue&&(ue.disconnect(),ue=null)}catch(e){}try{me&&(ge&&(history.pushState=ge),he&&(history.replaceState=he),pe&&window.removeEventListener("popstate",pe),me=!1,ge=null,he=null,pe=null)}catch(e){}}};try{browser.storage.local.get({gamification:!1}).then(e=>{Boolean(e.gamification)&&ye()}).catch(()=>{})}catch(e){}const ve="zt-contact-doc-toolbar",we="zt-contact-doc-toolbar",xe=[{label:"eingehend beA",text:"eingegangen bei uns per beA"},{label:"ausgehend beA",text:"per beA gesendet"},{label:"eingehend E-Mail",text:"eingegangen bei uns per E-Mail"},{label:"ausgehend E-Mail",text:"per E-Mail gesendet"},{label:"eingehend Post",text:"eingegangen bei uns per Post"},{label:"ausgehend Post",text:"per Post gesendet"},{label:"Leeren",text:""}],Se=`\n .${ve} { display:flex; gap:8px; margin-top:6px; margin-bottom:6px; }\n .${ve} button { padding:4px 8px; border-radius:4px; border:1px solid rgba(0,0,0,0.08); background:#fff; cursor:pointer; }\n .${ve} button:hover { background: #f3f3f3; }\n`;let Le=null,Me=!1,Ae=null;const Oe="contactDocumentationSuggestions";function De(e){try{if("contact_documentation"!==W(e))return;const t=function(e){try{const t=Array.from(e.querySelectorAll("p, h1, h2, h3, div"));for(const e of t){const t=(e.textContent||"").trim().toLowerCase();if("notiz"===t||t.startsWith("notiz")||"note"===t||t.startsWith("note"))return e}return null}catch(e){return null}}(e);if(!t)return;if(e.querySelector(`#${we}`))return;const n=function(){const e=document.createElement("div");e.className=ve,e.id=we;for(const t of xe){const n=document.createElement("button");n.type="button",n.textContent=t.label,n.dataset.template=t.text,n.dataset.replace=t.replace?"1":"0",n.addEventListener("click",e=>{try{const t=e.currentTarget,n=t.closest('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');if(!n)return;const o=n.querySelector('.tiptap.ProseMirror[contenteditable="true"], .tiptap .ProseMirror[contenteditable="true"], .rich-text-field [contenteditable="true"]');if(!o)return;const r=t.dataset.template||"",a="1"===t.dataset.replace;if(""===r)return void(o.innerHTML='<p><br class="ProseMirror-trailingBreak"></p>');o.focus();try{a?o.innerText=r:document.execCommand("insertText",!1,r)}catch(e){o.innerText=a?r:(o.innerText||"")+r}try{const e=new InputEvent("input",{bubbles:!0,cancelable:!0});o.dispatchEvent(e)}catch(e){}}catch(e){}}),e.appendChild(n)}return e}();let o=function(e){try{if(!e)return null;let t=e.nextElementSibling,n=0;for(;t&&n<6;){if(n++,t.matches&&(t.matches(".tiptap")||t.querySelector&&(t.querySelector(".tiptap")||t.querySelector(".ProseMirror")||t.querySelector("[contenteditable]"))))return t;const e=t.querySelector&&t.querySelector(".ProseMirror, .tiptap, [contenteditable]");if(e)return e;t=t.nextElementSibling}const o=e.parentElement;if(o){const e=o.querySelector(".tiptap, .ProseMirror, [contenteditable], .rich-text-field, .MuiTiptap-RichTextContent-root");if(e)return e;let t=o.nextElementSibling;for(n=0;t&&n<5;){if(n++,t.querySelector&&(t.querySelector(".tiptap")||t.querySelector(".ProseMirror")||t.querySelector("[contenteditable]")))return t.querySelector(".tiptap, .ProseMirror, [contenteditable]");t=t.nextElementSibling}}return null}catch(e){return null}}(t);if(!o){const e=t.nextElementSibling;o=e&&e.matches&&(e.matches(".tiptap")||e.querySelector&&e.querySelector(".tiptap"))&&e||t.parentElement&&t.parentElement.querySelector(".tiptap")}const r=function(e,t,n){try{if(!e||!t)return null;const o=new Set;let r=e;for(;r&&n.contains(r);)o.add(r),r=r.parentElement;for(r=t;r&&n.contains(r);){if(o.has(r))return r;r=r.parentElement}return null}catch(e){return null}}(t,o,e)||function(e){try{if(!e)return null;let t=e.parentElement,n=0;for(;t&&n<8;){if(n++,t.querySelector&&t.querySelector(".tiptap, .ProseMirror, [contenteditable], .MuiTiptap-FieldContainer-root"))return t;t=t.parentElement}return e.closest(".MuiStack-root, .MuiGrid-root, .MuiBox-root, .MuiFormControl-root")}catch(e){return null}}(t)||(o?o.closest(".MuiStack-root, .MuiGrid-root, .MuiTiptap-FieldContainer-root, .MuiTiptap-RichTextField-root"):null);if(r)if(o&&r.contains(o)&&o.parentElement)o.parentElement.insertBefore(n,o),console.debug("Zaubertool(contactDocs): toolbar inserted before rich editor inside block");else if(t.parentElement){const e=t.nextElementSibling;e&&r.contains(e)&&t.parentElement?(t.parentElement.insertBefore(n,e),console.debug("Zaubertool(contactDocs): toolbar inserted after heading inside block")):(t.parentElement.appendChild(n),console.debug("Zaubertool(contactDocs): toolbar appended to heading parent as fallback"))}else r.appendChild(n),console.debug("Zaubertool(contactDocs): toolbar appended to block fallback");else if(o&&o.parentElement)o.parentElement.insertBefore(n,o),console.debug("Zaubertool(contactDocs): toolbar inserted above rich editor");else{const o=t.parentElement?.nextElementSibling||t.nextElementSibling;o&&o.parentElement?(o.parentElement.insertBefore(n,o),console.debug("Zaubertool(contactDocs): toolbar inserted (via fallback insertion)")):t.parentElement?(t.parentElement.appendChild(n),console.debug("Zaubertool(contactDocs): toolbar appended to notiz parent")):(e.appendChild(n),console.debug("Zaubertool(contactDocs): toolbar appended to modal as last fallback"))}}catch(e){}}globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});const Te={init:function(){Me||globalThis.__ZAUBERTOOL_MODULE_LOADED[Oe]||(globalThis.__ZAUBERTOOL_MODULE_LOADED[Oe]=!0,Me=!0,console.debug("Zaubertool(contactDocs): init"),Ae=(0,m.db)(Se),function(){try{const e=Array.from(document.querySelectorAll('[role="dialog"], .MuiDialog-root, .MuiDialog-paper'));for(const t of e)De(t)}catch(e){}}(),Le=new MutationObserver(e=>{for(const t of e)if(t.addedNodes&&t.addedNodes.length>0)for(const e of Array.from(t.addedNodes)){if(!(e instanceof Element))continue;const t=e;if(t.matches&&(t.matches('[role="dialog"]')||t.matches(".MuiDialog-root")||t.matches(".MuiDialog-paper"))){De(t);continue}const n=t.querySelector&&t.querySelector('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');n&&De(n)}}),Le.observe(document.body,{childList:!0,subtree:!0}))},destroy:function(){Me=!1,console.debug("Zaubertool(contactDocs): destroy");try{Le&&(Le.disconnect(),Le=null),Ae&&(Ae.remove(),Ae=null);const e=document.querySelectorAll(`#${we}`);for(const t of Array.from(e))t.parentElement&&t.parentElement.removeChild(t);globalThis.__ZAUBERTOOL_MODULE_LOADED[Oe]=!1}catch(e){}}},ke="zt-attorney-toolbar",_e="zt-attorney-toolbar",Ce=[{label:"Unberechtigte Forderung",text:"Unberechtigte Forderung",replace:!1},{label:"Mängel Kaufvertrag",text:"Mängel Kaufvertrag",replace:!1},{label:"Leeren",text:"",replace:!0}],Ze=`\n .${ke} { display:flex; gap:8px; margin-top:6px; margin-bottom:6px; }\n .${ke} button { padding:4px 8px; border-radius:4px; border:1px solid rgba(0,0,0,0.08); background:#fff; cursor:pointer; }\n .${ke} button:hover { background: #f3f3f3; }\n`;let Be=null,qe=null,Pe=!1;const Ue="letterOfAttorneySuggestions";function Re(e){try{const t=Array.from(e.querySelectorAll("label, p, h1, h2, h3, div"));for(const e of t){const t=(e.textContent||"").trim().toLowerCase();if("begründung"===t||t.startsWith("begründung")||"grund"===t||"reason"===t)return e}}catch(e){}return null}function ze(e){if(!e)return null;const t=e.parentElement;if(t){const e=Array.from(t.querySelectorAll("textarea"));for(const t of e){if("true"===t.getAttribute("aria-hidden"))continue;const e=t.getBoundingClientRect&&t.getBoundingClientRect();if(!e||0!==e.height)return t}}const n=e.nextElementSibling;if(n){const e=Array.from(n.querySelectorAll("textarea"));for(const t of e){if("true"===t.getAttribute("aria-hidden"))continue;const e=t.getBoundingClientRect&&t.getBoundingClientRect();if(!e||0!==e.height)return t}if(n.tagName&&"textarea"===n.tagName.toLowerCase())return n}const o=Array.from(document.querySelectorAll('textarea#attorneyReason, textarea[name*="attorney"], textarea[name*="reason"], textarea[id*="attorney"], textarea[id*="reason"]'));for(const e of o){if("true"===e.getAttribute("aria-hidden"))continue;const t=e.getBoundingClientRect&&e.getBoundingClientRect();if(!t||0!==t.height)return e}return null}function Ie(e){try{if("letter_of_attorney"!==W(e))return;const t=Re(e);if(!t)return;if(e.querySelector(`#${_e}`))return;const n=function(){const e=document.createElement("div");e.className=ke,e.id=_e;for(const t of Ce){const n=document.createElement("button");n.type="button",n.textContent=t.label,n.dataset.template=t.text,n.dataset.replace=t.replace?"1":"0",n.addEventListener("click",e=>{try{const t=e.currentTarget,n=t.closest('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');if(!n)return;const o=ze(Re(n))||n.querySelector("textarea");if(!o)return;const r=t.dataset.template||"",a="1"===t.dataset.replace;if(""===r)o.value="";else{o.focus();try{o.value=a?r:(o.value||"")+(o.value?"\n":"")+r}catch(e){o.value=a?r:(o.value||"")+(o.value?"\n":"")+r}}try{const e=new InputEvent("input",{bubbles:!0,cancelable:!0});o.dispatchEvent(e)}catch(e){}try{for(const e in o)if(e.startsWith("__reactProps")){o[e].onChange&&o[e].onChange({target:o,currentTarget:o});break}}catch(e){}}catch(e){}}),e.appendChild(n)}return e}(),o=ze(t),r=function(e,t,n){try{if(!e||!t)return null;const o=new Set;let r=e;for(;r&&n.contains(r);)o.add(r),r=r.parentElement;for(r=t;r&&n.contains(r);){if(o.has(r))return r;r=r.parentElement}return null}catch(e){return null}}(t,o,e)||function(e){try{if(!e)return null;let t=e.parentElement,n=0;for(;t&&n<8;){if(n++,t.querySelector&&t.querySelector("textarea, input, .MuiInputBase-root, .MuiFormControl-root"))return t;t=t.parentElement}return e.closest(".MuiStack-root, .MuiGrid-root, .MuiBox-root, .MuiFormControl-root")}catch(e){return null}}(t)||(o?o.closest(".MuiInputBase-root, .MuiFormControl-root"):null);r?t&&r.contains(t)&&t.parentElement?(t.parentElement.insertBefore(n,t),console.debug("Zaubertool(letterOfAttorney): toolbar inserted before label inside block")):o&&r.contains(o)&&o.parentElement?(o.parentElement.insertBefore(n,o),console.debug("Zaubertool(letterOfAttorney): toolbar inserted before textarea inside block")):(r.appendChild(n),console.debug("Zaubertool(letterOfAttorney): toolbar appended to block fallback")):o&&o.parentElement?(o.parentElement.insertBefore(n,o),console.debug("Zaubertool(letterOfAttorney): toolbar inserted above textarea")):t.parentElement?t.parentElement.appendChild(n):e.appendChild(n),console.debug("Zaubertool(letterOfAttorney): toolbar inserted")}catch(e){}}globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});const Ne={init:function(){Pe||globalThis.__ZAUBERTOOL_MODULE_LOADED[Ue]||(globalThis.__ZAUBERTOOL_MODULE_LOADED[Ue]=!0,Pe=!0,qe=(0,m.db)(Ze),function(){try{const e=Array.from(document.querySelectorAll('[role="dialog"], .MuiDialog-root, .MuiDialog-paper'));for(const t of e)Ie(t)}catch(e){}}(),Be=new MutationObserver(e=>{for(const t of e)if(t.addedNodes&&t.addedNodes.length>0)for(const e of Array.from(t.addedNodes)){if(!(e instanceof Element))continue;const t=e;if(t.matches&&(t.matches('[role="dialog"]')||t.matches(".MuiDialog-root")||t.matches(".MuiDialog-paper"))){Ie(t);continue}const n=t.querySelector&&t.querySelector('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');n&&Ie(n)}}),Be.observe(document.body,{childList:!0,subtree:!0}))},destroy:function(){Pe=!1;try{Be&&(Be.disconnect(),Be=null),qe&&(qe.remove(),qe=null);const e=document.querySelectorAll(`#${_e}`);for(const t of Array.from(e))t.parentElement&&t.parentElement.removeChild(t);globalThis.__ZAUBERTOOL_MODULE_LOADED[Ue]=!1}catch(e){}}},$e="zt-contact-vn-toolbar",Fe="zt-contact-vn-toolbar",Ve=[{label:"Anrede Herr",text:"Sehr geehrter Herr\n ",replace:!1},{label:"Anrede Frau",text:"Sehr geehrte Frau\n ",replace:!1},{label:"Keine Rückmeldung",text:"leider erfolgte bisher keine Rückmeldung.\n ",replace:!1},{label:"RA vor Ort",text:"leider kam keine Rückmeldung der Gegenseite. Ich fürchte, dass das gerichtlich geklärt werden muss.\n\nMeine Zuständigkeit umfasst lediglich die außergerichtliche Konfliktlösung. In so einem Fall muss ich Sie daher an einer Kanzlei Ihrer Wahl vor Ort verweisen, die die Sache gerichtlich durchsetzen kann. Hierbei kann je nach Ihrem Vertrag mit der Rechtsschutzversicherung eine Selbstbeteiligung anfallen. Bezüglich der generellen Deckung kann ich Ihnen leider keine Information geben. Geben Sie mir gern kurz Bescheid.",replace:!1},{label:"Leeren",text:"",replace:!0}],je=`\n .${$e} { display:flex; gap:8px; margin-top:6px; margin-bottom:6px; }\n .${$e} button { padding:4px 8px; border-radius:4px; border:1px solid rgba(0,0,0,0.08); background:#fff; cursor:pointer; }\n .${$e} button:hover { background: #f3f3f3; }\n`;let He=null,We=!1,Ke=null;const Ge="contactVnSuggestions";function Qe(e){try{if("contact_vn"!==W(e))return;const t=function(e){try{const t=Array.from(e.querySelectorAll("p, h1, h2, h3, div"));for(const e of t){const t=(e.textContent||"").trim().toLowerCase();if("nachricht"===t||t.startsWith("nachricht")||"message"===t||t.startsWith("message"))return e}return null}catch(e){return null}}(e);if(!t)return;if(e.querySelector(`#${Fe}`))return;const n=function(){const e=document.createElement("div");e.className=$e,e.id=Fe;for(const t of Ve){const n=document.createElement("button");n.type="button",n.textContent=t.label,n.dataset.template=t.text,n.dataset.replace=t.replace?"1":"0",n.addEventListener("click",e=>{try{const t=e.currentTarget,n=t.closest('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');if(!n)return;const o=n.querySelector('.tiptap.ProseMirror[contenteditable="true"], .tiptap .ProseMirror[contenteditable="true"], .rich-text-field [contenteditable="true"]');if(!o)return;const r=t.dataset.template||"",a="1"===t.dataset.replace;if(""===r)return void(o.innerHTML='<p><br class="ProseMirror-trailingBreak"></p>');o.focus();try{a?o.innerText=r:document.execCommand("insertText",!1,r)}catch(e){o.innerText=a?r:(o.innerText||"")+r}try{o.dispatchEvent(new InputEvent("input",{bubbles:!0,cancelable:!0}))}catch(e){}}catch(e){}}),e.appendChild(n)}return e}(),o=function(e){try{if(!e)return null;let t=e.nextElementSibling,n=0;for(;t&&n<6;){if(n++,t.matches&&(t.matches(".tiptap")||t.querySelector&&t.querySelector(".tiptap, .ProseMirror, [contenteditable]")))return t;const e=t.querySelector&&t.querySelector(".ProseMirror, .tiptap, [contenteditable]");if(e)return e;t=t.nextElementSibling}const o=e.parentElement;if(o){const e=o.querySelector(".tiptap, .ProseMirror, [contenteditable]");if(e)return e;let t=o.nextElementSibling;for(n=0;t&&n<5;){n++;const e=t.querySelector&&t.querySelector(".tiptap, .ProseMirror, [contenteditable]");if(e)return e;t=t.nextElementSibling}}return null}catch(e){return null}}(t)||t.nextElementSibling||t.parentElement?.querySelector(".tiptap"),r=function(e,t,n){try{if(!e||!t)return null;const o=new Set;let r=e;for(;r&&n.contains(r);)o.add(r),r=r.parentElement;for(r=t;r&&n.contains(r);){if(o.has(r))return r;r=r.parentElement}return null}catch(e){return null}}(t,o,e)||function(e){try{if(!e)return null;let t=e.parentElement,n=0;for(;t&&n<8;){if(n++,t.querySelector(".tiptap, .ProseMirror, [contenteditable], textarea"))return t;t=t.parentElement}return e.closest(".MuiStack-root, .MuiGrid-root, .MuiBox-root, .MuiFormControl-root")}catch(e){return null}}(t)||(o?o.closest(".MuiStack-root, .MuiGrid-root, .MuiTiptap-FieldContainer-root, .MuiTiptap-RichTextField-root"):null);if(r)if(o&&r.contains(o)&&o.parentElement)o.parentElement.insertBefore(n,o),console.debug("Zaubertool(contactVn): toolbar inserted before editor inside block");else if(t&&t.parentElement){const e=t.nextElementSibling;e&&r.contains(e)&&t.parentElement?(t.parentElement.insertBefore(n,e),console.debug("Zaubertool(contactVn): toolbar inserted after heading inside block")):(t.parentElement.appendChild(n),console.debug("Zaubertool(contactVn): toolbar appended to heading parent fallback"))}else r.appendChild(n),console.debug("Zaubertool(contactVn): toolbar appended to block fallback");else o&&o.parentElement?(o.parentElement.insertBefore(n,o),console.debug("Zaubertool(contactVn): toolbar inserted above editor")):t.parentElement?(t.parentElement.appendChild(n),console.debug("Zaubertool(contactVn): toolbar appended to heading parent")):(e.appendChild(n),console.debug("Zaubertool(contactVn): toolbar appended to modal"))}catch(e){}}globalThis.__ZAUBERTOOL_MODULE_LOADED||(globalThis.__ZAUBERTOOL_MODULE_LOADED={});const Xe={init:function(){We||globalThis.__ZAUBERTOOL_MODULE_LOADED[Ge]||(globalThis.__ZAUBERTOOL_MODULE_LOADED[Ge]=!0,We=!0,Ke=(0,m.db)(je),function(){try{const e=Array.from(document.querySelectorAll('[role="dialog"], .MuiDialog-root, .MuiDialog-paper'));for(const t of e)Qe(t)}catch(e){}}(),He=new MutationObserver(e=>{for(const t of e)if(t.addedNodes&&t.addedNodes.length>0)for(const e of Array.from(t.addedNodes)){if(!(e instanceof Element))continue;const t=e;if(t.matches&&(t.matches('[role="dialog"]')||t.matches(".MuiDialog-root")||t.matches(".MuiDialog-paper"))){Qe(t);continue}const n=t.querySelector&&t.querySelector('[role="dialog"], .MuiDialog-root, .MuiDialog-paper');n&&Qe(n)}}),He.observe(document.body,{childList:!0,subtree:!0}))},destroy:function(){We=!1,globalThis.__ZAUBERTOOL_MODULE_LOADED[Ge]=!1;try{He&&(He.disconnect(),He=null),Ke&&(Ke.remove(),Ke=null);const e=document.querySelectorAll(`#${Fe}`);for(const t of Array.from(e))t.parentElement&&t.parentElement.removeChild(t)}catch(e){}}};let Ye=!1,Je=!1,et=!1,tt=!1,nt=!1,ot=null,rt=null,at=null;async function it(){if(!Ye){Ye=!0;try{Ee&&Ee.init&&Ee.init()}catch(e){console.error("Zaubertool(case): enableGamification error",e)}}}async function lt(){if(Ye){Ye=!1;try{Ee&&Ee.destroy&&Ee.destroy()}catch(e){console.error("Zaubertool(case): disableGamification error",e)}}}async function ct(){try{const e=await browser.storage.local.get({gamification:!1,emailAutocomplete:!1,relationSuggestions:!1,draggableModals:!1});Ye=Boolean(e.gamification),Je=Boolean(e.emailAutocomplete),tt=Boolean(e.relationSuggestions),et=Boolean(e.draggableModals),Ye&&await it(),Je&&a()&&q&&q.init&&q.init(),tt&&a()&&H&&H.init&&H.init(),et&&Y&&Y.init&&Y.init();try{Te&&Te.init&&Te.init()}catch(e){}try{Ne&&Ne.init&&Ne.init()}catch(e){}try{Xe&&Xe.init&&Xe.init()}catch(e){}}catch(e){}}browser.runtime.onMessage.addListener(async e=>{if(e&&e.id)switch(e.id){case"large-comments":c("On"===e.value);break;case"gamification":"On"===e.value?await it():await lt();break;case"email-autocomplete":Je="On"===e.value,Je&&a()?q&&q.init&&q.init():q&&q.destroy&&q.destroy();break;case"relation-suggestions":tt="On"===e.value,tt&&a()?H&&H.init&&H.init():H&&H.destroy&&H.destroy();break;case"draggable-modals":et="On"===e.value,et?Y&&Y.init&&Y.init():Y&&Y.destroy&&Y.destroy()}});try{S&&S.isProcessingTabPage&&S.isProcessingTabPage()&&S.init&&S.init(),et&&Y&&Y.init&&Y.init&&Y.init()}catch(e){}const st=async()=>{try{await ct(),S&&S.isProcessingTabPage&&S.isProcessingTabPage()?S.init&&S.init():S.destroy&&S.destroy(),Je&&a()?q&&q.init&&q.init():q&&q.destroy&&q.destroy(),tt&&a()?H&&H.init&&H.init():H&&H.destroy&&H.destroy(),et?Y.init&&Y.init():Y.destroy&&Y.destroy(),Ye&&be&&be&&be()}catch(e){}};window.addEventListener("popstate",st);const ut=history.pushState;history.pushState=function(){const e=ut.apply(this,arguments);return st(),e};const dt=history.replaceState;history.replaceState=function(){const e=dt.apply(this,arguments);return st(),e};try{browser.storage.onChanged.addListener((e,t)=>{if("local"===t){if("gamification"in e){const t=e.gamification.newValue;Boolean(t)?it():lt()}if("emailAutocomplete"in e){const t=e.emailAutocomplete.newValue;Je=Boolean(t),Je&&a()?q.init&&q.init():q.destroy&&q.destroy()}if("draggableModals"in e){const t=e.draggableModals.newValue;et=Boolean(t),et?Y.init&&Y.init():Y&&Y.destroy&&Y.destroy()}if("relationSuggestions"in e){const t=e.relationSuggestions.newValue;tt=Boolean(t),tt&&a()?H.init&&H.init():H.destroy&&H.destroy()}}})}catch(e){}try{(function(){try{if(nt)return;nt=!0;const e=e=>{try{const t=e.target;if(!t)return;t.closest('[role="tab"], [data-tab], a[href*="tab="]')&&(at&&window.clearTimeout(at),at=window.setTimeout(()=>st(),40))}catch(e){}};document.body.addEventListener("click",e,!0),ot=e,document.addEventListener("visibilitychange",st),window.addEventListener("focus",st);const t=e=>{try{for(const t of e){if("attributes"===t.type){const e=t.attributeName;if("class"===e||"aria-selected"===e){at&&window.clearTimeout(at),at=window.setTimeout(()=>st(),40);break}}if("childList"===t.type&&t.addedNodes&&t.addedNodes.length>0){at&&window.clearTimeout(at),at=window.setTimeout(()=>st(),40);break}}}catch(e){}};let n=document;const o=document.querySelector('[role="tablist"]');if(o)n=o;else{const e=document.querySelector("#tabs, .tabs, .tablist, [data-tabs]");e&&(n=e)}rt=new MutationObserver(t),rt.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","aria-selected"]})}catch(e){}})(),ct().then(()=>st()).catch(()=>{})}catch(e){}})();
{
"manifest_version": 2,
"name": "Zaubertool Add-On",
"version": "1.1.0",
"version": "1.1.1",
"description": "Add-On f\u00fcr das M2-Zaubertool",

@@ -6,0 +6,0 @@ "icons": {

@@ -76,4 +76,4 @@ <!DOCTYPE html>

<p style="font-size: small">Version: 1.1.0</p>
<p style="font-size: small">Version: 1.1.1</p>
</body>
</html>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet