"use strict";(self.webpackChunklernplattform_frontend=self.webpackChunklernplattform_frontend||[]).push([[99113],{826330:function(t,e,s){s.r(e),s.d(e,{annotate:function(){return v},annotationGroup:function(){return b}});const n="http://www.w3.org/2000/svg";class i{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}function o(t,e,s,n,i){return{type:"path",ops:l(t,e,s,n,i)}}function r(t,e,s){const n=(t||[]).length;if(n>2){const i=[];for(let e=0;e<n-1;e++)i.push(...l(t[e][0],t[e][1],t[e+1][0],t[e+1][1],s));return e&&i.push(...l(t[n-1][0],t[n-1][1],t[0][0],t[0][1],s)),{type:"path",ops:i}}return 2===n?o(t[0][0],t[0][1],t[1][0],t[1][1],s):{type:"path",ops:[]}}function h(t,e,s,n,i){return function(t,e){return r(t,!0,e)}([[t,e],[t+s,e],[t+s,e+n],[t,e+n]],i)}function a(t,e,s,n,i){return function(t,e,s,n){const[i,o]=p(n.increment,t,e,n.rx,n.ry,1,n.increment*u(.1,u(.4,1,s),s),s);let r=d(i,null,s);if(!s.disableMultiStroke){const[i]=p(n.increment,t,e,n.rx,n.ry,1.5,0,s),o=d(i,null,s);r=r.concat(o)}return{estimatedPoints:o,opset:{type:"path",ops:r}}}(t,e,i,function(t,e,s){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),i=Math.max(s.curveStepCount,s.curveStepCount/Math.sqrt(200)*n),o=2*Math.PI/i;let r=Math.abs(t/2),h=Math.abs(e/2);const a=1-s.curveFitting;return r+=f(r*a,s),h+=f(h*a,s),{increment:o,rx:r,ry:h}}(s,n,i)).opset}function c(t){return t.randomizer||(t.randomizer=new i(t.seed||0)),t.randomizer.next()}function u(t,e,s,n=1){return s.roughness*n*(c(s)*(e-t)+t)}function f(t,e,s=1){return u(-t,t,e,s)}function l(t,e,s,n,i,o=!1){const r=o?i.disableMultiStrokeFill:i.disableMultiStroke,h=g(t,e,s,n,i,!0,!1);if(r)return h;const a=g(t,e,s,n,i,!0,!0);return h.concat(a)}function g(t,e,s,n,i,o,r){const h=Math.pow(t-s,2)+Math.pow(e-n,2),a=Math.sqrt(h);let u=1;u=a<200?1:a>500?.4:-.0016668*a+1.233334;let l=i.maxRandomnessOffset||0;l*l*100>h&&(l=a/10);const g=l/2,d=.2+.2*c(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,_=i.bowing*i.maxRandomnessOffset*(t-s)/200;p=f(p,i,u),_=f(_,i,u);const m=[],w=()=>f(g,i,u),v=()=>f(l,i,u);return o&&(r?m.push({op:"move",data:[t+w(),e+w()]}):m.push({op:"move",data:[t+f(l,i,u),e+f(l,i,u)]})),r?m.push({op:"bcurveTo",data:[p+t+(s-t)*d+w(),_+e+(n-e)*d+w(),p+t+2*(s-t)*d+w(),_+e+2*(n-e)*d+w(),s+w(),n+w()]}):m.push({op:"bcurveTo",data:[p+t+(s-t)*d+v(),_+e+(n-e)*d+v(),p+t+2*(s-t)*d+v(),_+e+2*(n-e)*d+v(),s+v(),n+v()]}),m}function d(t,e,s){const n=t.length,i=[];if(n>3){const o=[],r=1-s.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const s=t[e];o[0]=[s[0],s[1]],o[1]=[s[0]+(r*t[e+1][0]-r*t[e-1][0])/6,s[1]+(r*t[e+1][1]-r*t[e-1][1])/6],o[2]=[t[e+1][0]+(r*t[e][0]-r*t[e+2][0])/6,t[e+1][1]+(r*t[e][1]-r*t[e+2][1])/6],o[3]=[t[e+1][0],t[e+1][1]],i.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}if(e&&2===e.length){const t=s.maxRandomnessOffset;i.push({op:"lineTo",data:[e[0]+f(t,s),e[1]+f(t,s)]})}}else 3===n?(i.push({op:"move",data:[t[1][0],t[1][1]]}),i.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&i.push(...l(t[0][0],t[0][1],t[1][0],t[1][1],s));return i}function p(t,e,s,n,i,o,r,h){const a=[],c=[],u=f(.5,h)-Math.PI/2;c.push([f(o,h)+e+.9*n*Math.cos(u-t),f(o,h)+s+.9*i*Math.sin(u-t)]);for(let r=u;r<2*Math.PI+u-.01;r+=t){const t=[f(o,h)+e+n*Math.cos(r),f(o,h)+s+i*Math.sin(r)];a.push(t),c.push(t)}return c.push([f(o,h)+e+n*Math.cos(u+2*Math.PI+.5*r),f(o,h)+s+i*Math.sin(u+2*Math.PI+.5*r)]),c.push([f(o,h)+e+.98*n*Math.cos(u+r),f(o,h)+s+.98*i*Math.sin(u+r)]),c.push([f(o,h)+e+.9*n*Math.cos(u+.5*r),f(o,h)+s+.9*i*Math.sin(u+.5*r)]),[c,a]}function _(t,e){return{maxRandomnessOffset:2,roughness:"highlight"===t?3:1.5,bowing:1,stroke:"#000",strokeWidth:1.5,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,combineNestedSvgPaths:!1,disableMultiStroke:"double"!==t,disableMultiStrokeFill:!1,seed:e}}function m(t,e,s,i,c,u){const f=[];let l=s.strokeWidth||2;const g=function(t){const e=t.padding;if(e||0===e){if("number"==typeof e)return[e,e,e,e];if(Array.isArray(e)){const t=e;if(t.length)switch(t.length){case 4:return[...t];case 1:return[t[0],t[0],t[0],t[0]];case 2:return[...t,...t];case 3:return[...t,t[1]];default:return[t[0],t[1],t[2],t[3]]}}}return[5,5,5,5]}(s),d=void 0===s.animate||!!s.animate,p=s.iterations||2,m=s.rtl?1:0,w=_("single",u);switch(s.type){case"underline":{const t=e.y+e.h+g[2];for(let s=m;s<p+m;s++)s%2?f.push(o(e.x+e.w,t,e.x,t,w)):f.push(o(e.x,t,e.x+e.w,t,w));break}case"strike-through":{const t=e.y+e.h/2;for(let s=m;s<p+m;s++)s%2?f.push(o(e.x+e.w,t,e.x,t,w)):f.push(o(e.x,t,e.x+e.w,t,w));break}case"box":{const t=e.x-g[3],s=e.y-g[0],n=e.w+(g[1]+g[3]),i=e.h+(g[0]+g[2]);for(let e=0;e<p;e++)f.push(h(t,s,n,i,w));break}case"bracket":{const t=Array.isArray(s.brackets)?s.brackets:s.brackets?[s.brackets]:["right"],n=e.x-2*g[3],i=e.x+e.w+2*g[1],o=e.y-2*g[0],h=e.y+e.h+2*g[2];for(const s of t){let t;switch(s){case"bottom":t=[[n,e.y+e.h],[n,h],[i,h],[i,e.y+e.h]];break;case"top":t=[[n,e.y],[n,o],[i,o],[i,e.y]];break;case"left":t=[[e.x,o],[n,o],[n,h],[e.x,h]];break;case"right":t=[[e.x+e.w,o],[i,o],[i,h],[e.x+e.w,h]]}t&&f.push(r(t,!1,w))}break}case"crossed-off":{const t=e.x,s=e.y,n=t+e.w,i=s+e.h;for(let e=m;e<p+m;e++)e%2?f.push(o(n,i,t,s,w)):f.push(o(t,s,n,i,w));for(let e=m;e<p+m;e++)e%2?f.push(o(t,i,n,s,w)):f.push(o(n,s,t,i,w));break}case"circle":{const t=_("double",u),s=e.w+(g[1]+g[3]),n=e.h+(g[0]+g[2]),i=e.x-g[3]+s/2,o=e.y-g[0]+n/2,r=Math.floor(p/2),h=p-2*r;for(let e=0;e<r;e++)f.push(a(i,o,s,n,t));for(let t=0;t<h;t++)f.push(a(i,o,s,n,w));break}case"highlight":{const t=_("highlight",u);l=.95*e.h;const s=e.y+e.h/2;for(let n=m;n<p+m;n++)n%2?f.push(o(e.x+e.w,s,e.x,s,t)):f.push(o(e.x,s,e.x+e.w,s,t));break}}if(f.length){const e=function(t){const e=[];for(const s of t){let t="";for(const n of s.ops){const s=n.data;switch(n.op){case"move":t.trim()&&e.push(t.trim()),t=`M${s[0]} ${s[1]} `;break;case"bcurveTo":t+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":t+=`L${s[0]} ${s[1]} `}}t.trim()&&e.push(t.trim())}return e}(f),o=[],r=[];let h=0;const a=(t,e,s)=>t.setAttribute(e,s);for(const i of e){const e=document.createElementNS(n,"path");if(a(e,"d",i),a(e,"fill","none"),a(e,"stroke",s.color||"currentColor"),a(e,"stroke-width",""+l),d){const t=e.getTotalLength();o.push(t),h+=t}t.appendChild(e),r.push(e)}if(d){let t=0;for(let e=0;e<r.length;e++){const s=r[e],n=o[e],a=h?c*(n/h):0,u=i+t,f=s.style;f.strokeDashoffset=""+n,f.strokeDasharray=""+n,f.animation=`rough-notation-dash ${a}ms ease-out ${u}ms forwards`,t+=a}}}}class w{constructor(t,e){this._state="unattached",this._resizing=!1,this._seed=Math.floor(Math.random()*2**31),this._lastSizes=[],this._animationDelay=0,this._resizeListener=()=>{this._resizing||(this._resizing=!0,setTimeout((()=>{this._resizing=!1,"showing"===this._state&&this.haveRectsChanged()&&this.show()}),400))},this._e=t,this._config=JSON.parse(JSON.stringify(e)),this.attach()}get animate(){return this._config.animate}set animate(t){this._config.animate=t}get animationDuration(){return this._config.animationDuration}set animationDuration(t){this._config.animationDuration=t}get iterations(){return this._config.iterations}set iterations(t){this._config.iterations=t}get color(){return this._config.color}set color(t){this._config.color!==t&&(this._config.color=t,this.refresh())}get strokeWidth(){return this._config.strokeWidth}set strokeWidth(t){this._config.strokeWidth!==t&&(this._config.strokeWidth=t,this.refresh())}get padding(){return this._config.padding}set padding(t){this._config.padding!==t&&(this._config.padding=t,this.refresh())}attach(){if("unattached"===this._state&&this._e.parentElement){!function(){if(!window.__rno_kf_s){const t=window.__rno_kf_s=document.createElement("style");t.textContent="@keyframes rough-notation-dash { to { stroke-dashoffset: 0; } }",document.head.appendChild(t)}}();const t=this._svg=document.createElementNS(n,"svg");t.setAttribute("class","rough-annotation");const e=t.style;e.position="absolute",e.top="0",e.left="0",e.overflow="visible",e.pointerEvents="none",e.width="100px",e.height="100px";const s="highlight"===this._config.type;if(this._e.insertAdjacentElement(s?"beforebegin":"afterend",t),this._state="not-showing",s){const t=window.getComputedStyle(this._e).position;(!t||"static"===t)&&(this._e.style.position="relative")}this.attachListeners()}}detachListeners(){window.removeEventListener("resize",this._resizeListener),this._ro&&this._ro.unobserve(this._e)}attachListeners(){this.detachListeners(),window.addEventListener("resize",this._resizeListener,{passive:!0}),!this._ro&&"ResizeObserver"in window&&(this._ro=new window.ResizeObserver((t=>{for(const e of t)e.contentRect&&this._resizeListener()}))),this._ro&&this._ro.observe(this._e)}haveRectsChanged(){if(this._lastSizes.length){const t=this.rects();if(t.length!==this._lastSizes.length)return!0;for(let e=0;e<t.length;e++)if(!this.isSameRect(t[e],this._lastSizes[e]))return!0}return!1}isSameRect(t,e){const s=(t,e)=>Math.round(t)===Math.round(e);return s(t.x,e.x)&&s(t.y,e.y)&&s(t.w,e.w)&&s(t.h,e.h)}isShowing(){return"not-showing"!==this._state}refresh(){this.isShowing()&&!this.pendingRefresh&&(this.pendingRefresh=Promise.resolve().then((()=>{this.isShowing()&&this.show(),delete this.pendingRefresh})))}show(){switch(this._state){case"unattached":break;case"showing":this.hide(),this._svg&&this.render(this._svg,!0);break;case"not-showing":this.attach(),this._svg&&this.render(this._svg,!1)}}hide(){if(this._svg)for(;this._svg.lastChild;)this._svg.removeChild(this._svg.lastChild);this._state="not-showing"}remove(){this._svg&&this._svg.parentElement&&this._svg.parentElement.removeChild(this._svg),this._svg=void 0,this._state="unattached",this.detachListeners()}render(t,e){let s=this._config;e&&(s=JSON.parse(JSON.stringify(this._config)),s.animate=!1);const n=this.rects();let i=0;n.forEach((t=>i+=t.w));const o=s.animationDuration||800;let r=0;for(let e=0;e<n.length;e++){const h=o*(n[e].w/i);m(t,n[e],s,r+this._animationDelay,h,this._seed),r+=h}this._lastSizes=n,this._state="showing"}rects(){const t=[];if(this._svg)if(this._config.multiline){const e=this._e.getClientRects();for(let s=0;s<e.length;s++)t.push(this.svgRect(this._svg,e[s]))}else t.push(this.svgRect(this._svg,this._e.getBoundingClientRect()));return t}svgRect(t,e){const s=t.getBoundingClientRect(),n=e;return{x:(n.x||n.left)-(s.x||s.left),y:(n.y||n.top)-(s.y||s.top),w:n.width,h:n.height}}}function v(t,e){return new w(t,e)}function b(t){let e=0;for(const s of t){const t=s;t._animationDelay=e,e+=0===t.animationDuration?0:t.animationDuration||800}const s=[...t];return{show(){for(const t of s)t.show()},hide(){for(const t of s)t.hide()}}}}}]);