(()=>{var mt=Object.create;var D=Object.defineProperty,Rt=Object.defineProperties,ut=Object.getOwnPropertyDescriptor,Vt=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertyNames,$=Object.getOwnPropertySymbols,Zt=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable;var tt=(a,t,i)=>t in a?D(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,j=(a,t)=>{for(var i in t||(t={}))et.call(t,i)&&tt(a,i,t[i]);if($)for(var i of $(t))Yt.call(t,i)&&tt(a,i,t[i]);return a},it=(a,t)=>Rt(a,Vt(t));var E=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports);var xt=(a,t,i,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of gt(t))!et.call(a,n)&&n!==i&&D(a,n,{get:()=>t[n],enumerable:!(e=ut(t,n))||e.enumerable});return a};var O=(a,t,i)=>(i=a!=null?mt(Zt(a)):{},xt(t||!a||!a.__esModule?D(i,"default",{value:a,enumerable:!0}):i,a));var nt=(a,t,i)=>new Promise((e,n)=>{var o=r=>{try{s(i.next(r))}catch(h){n(h)}},l=r=>{try{s(i.throw(r))}catch(h){n(h)}},s=r=>r.done?e(r.value):Promise.resolve(r.value).then(o,l);s((i=i.apply(a,t)).next())});var at=E((L,A)=>{(function(a){"use strict";var t=function(){},i=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.msRequestAnimationFrame||function(h){return setTimeout(h,16)};function e(){var h=this;h.reads=[],h.writes=[],h.raf=i.bind(a),t("initialized",h)}e.prototype={constructor:e,runTasks:function(h){t("run tasks");for(var d;d=h.shift();)d()},measure:function(h,d){t("measure");var c=d?h.bind(d):h;return this.reads.push(c),n(this),c},mutate:function(h,d){t("mutate");var c=d?h.bind(d):h;return this.writes.push(c),n(this),c},clear:function(h){return t("clear",h),l(this.reads,h)||l(this.writes,h)},extend:function(h){if(t("extend",h),typeof h!="object")throw new Error("expected object");var d=Object.create(this);return s(d,h),d.fastdom=this,d.initialize&&d.initialize(),d},catch:null};function n(h){h.scheduled||(h.scheduled=!0,h.raf(o.bind(null,h)),t("flush scheduled"))}function o(h){t("flush");var d=h.writes,c=h.reads,b;try{t("flushing reads",c.length),h.runTasks(c),t("flushing writes",d.length),h.runTasks(d)}catch(p){b=p}if(h.scheduled=!1,(c.length||d.length)&&n(h),b)if(t("task errored",b.message),h.catch)h.catch(b);else throw b}function l(h,d){var c=h.indexOf(d);return!!~c&&!!h.splice(c,1)}function s(h,d){for(var c in d)d.hasOwnProperty(c)&&(h[c]=d[c])}var r=a.fastdom=a.fastdom||new e;typeof A=="object"&&(A.exports=r)})(typeof window!="undefined"?window:typeof L!="undefined"?L:globalThis)});var lt=E((Mt,Q)=>{(function(){"use strict";var a=function(){function t(){}t.prototype=Object.create(null);function i(d,c){for(var b=c.length,p=0;p{(function(a){var t={browser:[[/msie ([\.\_\d]+)/,"ie"],[/trident\/.*?rv:([\.\_\d]+)/,"ie"],[/firefox\/([\.\_\d]+)/,"firefox"],[/chrome\/([\.\_\d]+)/,"chrome"],[/version\/([\.\_\d]+).*?safari/,"safari"],[/mobile safari ([\.\_\d]+)/,"safari"],[/android.*?version\/([\.\_\d]+).*?safari/,"com.android.browser"],[/crios\/([\.\_\d]+).*?safari/,"chrome"],[/opera/,"opera"],[/opera\/([\.\_\d]+)/,"opera"],[/opera ([\.\_\d]+)/,"opera"],[/opera mini.*?version\/([\.\_\d]+)/,"opera.mini"],[/opios\/([a-z\.\_\d]+)/,"opera"],[/blackberry/,"blackberry"],[/blackberry.*?version\/([\.\_\d]+)/,"blackberry"],[/bb\d+.*?version\/([\.\_\d]+)/,"blackberry"],[/rim.*?version\/([\.\_\d]+)/,"blackberry"],[/iceweasel\/([\.\_\d]+)/,"iceweasel"],[/edge\/([\.\d]+)/,"edge"]],os:[[/linux ()([a-z\.\_\d]+)/,"linux"],[/mac os x/,"macos"],[/mac os x.*?([\.\_\d]+)/,"macos"],[/os ([\.\_\d]+) like mac os/,"ios"],[/openbsd ()([a-z\.\_\d]+)/,"openbsd"],[/android/,"android"],[/android ([a-z\.\_\d]+);/,"android"],[/mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/,"firefoxos"],[/windows\s*(?:nt)?\s*([\.\_\d]+)/,"windows"],[/windows phone.*?([\.\_\d]+)/,"windows.phone"],[/windows mobile/,"windows.mobile"],[/blackberry/,"blackberryos"],[/bb\d+/,"blackberryos"],[/rim.*?os\s*([\.\_\d]+)/,"blackberryos"]],device:[[/ipad/,"ipad"],[/iphone/,"iphone"],[/lumia/,"lumia"],[/htc/,"htc"],[/nexus/,"nexus"],[/galaxy nexus/,"galaxy.nexus"],[/nokia/,"nokia"],[/ gt\-/,"galaxy"],[/ sm\-/,"galaxy"],[/xbox/,"xbox"],[/(?:bb\d+)|(?:blackberry)|(?: rim )/,"blackberry"]]},i="Unknown",e=Object.keys(t);function n(){var s=this;e.forEach(function(r){s[r]={name:i,version:[],versionString:i}})}function o(s,r,h){t[r].forEach(function(d){var c=d[0],b=d[1],p=h.match(c);p&&(s[r].name=b,p[2]?(s[r].versionString=p[2],s[r].version=[]):p[1]?(s[r].versionString=p[1].replace(/_/g,"."),s[r].version=l(p[1])):(s[r].versionString=i,s[r].version=[]))})}function l(s){return s.split(/[\._]/).map(function(r){return parseInt(r)})}n.prototype.sniff=function(s){var r=this,h=typeof window!="undefined",d=h?navigator.userAgent:"",c=(s||d).toLowerCase();return e.forEach(function(b){o(r,b,c)}),this},typeof C!="undefined"&&C.exports?C.exports=n:(a.Sniffr=new n,a.Sniffr.sniff(navigator.userAgent))})(ot)});var dt=E((ne,ht)=>{ht.exports=Nt;function Nt(a,t,i){return ti?i:a:at?t:a}});window.hasOwnProperty("Shorthand")||(window.Shorthand={});var Xt=O(at());var Ut=O(lt());var Qt=st();function T(a,t=null){let i=Ft(t);return Array.from(i.querySelectorAll(a))}function Ft(a){var t;return(t=a!=null?a:window.__shadowRoot)!=null?t:document}var f={getOrientation(){return window.Shorthand.displayContainer?f.getWidth()>f.getHeight()?"landscape":"portrait":window.innerWidth>window.innerHeight?"landscape":"portrait"},getHeight(){return window.Shorthand.displayContainer.getCache().height},getWidth(){return window.Shorthand.displayContainer.getCache().width},getTop(){return window.Shorthand.displayContainer.getCache().top},getBottom(){return window.Shorthand.displayContainer.getCache().bottom},getVhUnitsInPixels(a){return f.getHeight()*(a/100)},getDisplayContainer(){return window.Shorthand.displayContainer}},X=f;var K=O(dt());function W(a){return typeof a=="number"?Math.round(a):{x:W(a.x),y:W(a.y),z:a.z}}function P(){return{noHighlightsBehaviour:"contain",lineWidth:10,lineColor:"#12bf9c",markerSize:30,markerColor:"#12bf9c",transitionDuration:1}}var N=null;function z(a=!1){return new Promise(t=>{if(N===null||a){N=P();let i=document.createElement("div");i.className="Theme-Scrollpoints-Highlight",i.style.display="none",i.style.pointerEvents="none",document.body.appendChild(i);let e=document.createElement("div");e.className="Theme-Scrollpoints-Marker",e.style.display="none",e.style.pointerEvents="none",document.body.appendChild(e),setTimeout(()=>{let n=window.getComputedStyle(e);return N.markerSize=parseInt(n.getPropertyValue("width"),10),N.markerColor=n.getPropertyValue("background-color"),n=window.getComputedStyle(i),N.lineWidth=parseInt(n.getPropertyValue("border-width"),10),N.lineColor=n.getPropertyValue("border-color"),N.noHighlightsBehaviour=n.getPropertyValue("background-size")==="cover"?"cover":"contain",t(N)},50)}else return t(N)})}function rt(a,t){if(t<=0)return;let{height:i,width:e}=a.canvas,n=a.getImageData(0,0,e,i),{data:o}=n,l=e-1,s=i-1,r=t+1,d=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1][t],b=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18][t],p=[],G=[],u=[],y=[],J=[],m=[],Gt=3,g,U,F,I;for(;Gt-- >0;){let k=0,V=0;for(let x=0;xl?l:R)<<2),Z+=o[g++],H+=o[g++],B+=o[g++],S+=o[g];for(let R=0;R0?g<<2:0),U=k+J[R],F=k+m[R],Z+=o[U++]-o[F++],H+=o[U++]-o[F++],B+=o[U++]-o[F++],S+=o[U]-o[F],V++;k+=e<<2}for(let x=0;xs?0:e,H+=p[Z],B+=G[Z],S+=u[Z],R+=y[Z];V=x<<2;for(let Y=0;Y>>b,I>0?(I=255/I,o[V]=(H*d>>>b)*I,o[V+1]=(B*d>>>b)*I,o[V+2]=(S*d>>>b)*I):o[V]=o[V+1]=o[V+2]=0,x===0&&(J[Y]=((g=Y+r)0?g*e:0),U=x+J[Y],F=x+m[Y],H+=p[U]-p[F],B+=G[U]-G[F],S+=u[U]-u[F],R+=y[U]-y[F],V+=e<<2}}a.putImageData(n,0,0)}var M=class{constructor(t){this.onTick=t}start(t,i,e){this.from=W(t),this.to=W(i),this.duration=e,!(isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(i.x)||isNaN(i.y)||isNaN(i.z))&&(this.secondsRemaining=this.duration,this.lastTickAt=new Date().getTime(),this.tick=this.tick.bind(this),this.tick())}tick(){if(this.duration===0)this.onTick({x:this.to.x,y:this.to.y,z:this.to.z});else{let t=new Date().getTime(),i=(t-this.lastTickAt)/1e3;if(this.lastTickAt=t,this.secondsRemaining>0){this.secondsRemaining=this.secondsRemaining-i;let e=1-Math.max(0,this.secondsRemaining)/this.duration,n=ct(e);this.onTick({x:W(this.from.x+(this.to.x-this.from.x)*n),y:W(this.from.y+(this.to.y-this.from.y)*n),z:this.from.z+(this.to.z-this.from.z)*ct(e)}),requestAnimationFrame(this.tick)}}}},ct=a=>1-(1-a)*(1-a);var _="NO_SCROLLPOINT_FRAMES_KEY",bt=.01,pt=2.5,w=class{constructor(t,i,e,n){this.isHidden=!1;this.pixelDensity=1;this.canvasWidth=0;this.canvasHeight=0;this.x=0;this.y=0;this.zoom=1;this.noHighlightsBehaviour="contain";this.maxX=0;this.maxY=0;this.setHighlightsAt=0;this._style=P();this._isReady=!1;this._isRendering=!1;this._paused=!1;typeof window.devicePixelRatio=="number"&&(this.pixelDensity=Math.min(2,window.devicePixelRatio)),this.canvas=t,this.initStyle().catch(console.error),this.offscreenCanvas=document.createElement("canvas"),this.ctx=this.offscreenCanvas.getContext("2d",{alpha:!1}),this.ctx.imageSmoothingEnabled=!0,this.finalCtx=this.canvas.getContext("2d",{alpha:!1}),this.image=i,this.highlights=[],this.backgroundColor=e,this.backgroundOpacity=n,this.bias="none",this.x=0,this.y=0,this.zoom=1,this.maxX=0,this.maxY=0,this.tween=new M(this.onTweenTick.bind(this)),this._render=this._render.bind(this),this.render=this.render.bind(this),this.adjustSize(),this._isReady=!0,this.render()}get paused(){return this._paused}set paused(t){t!==this._paused&&t===!1&&this.render(),this._paused=t}initStyle(){return nt(this,null,function*(){this._computedStyle=getComputedStyle(this.canvas),this._style=yield z(!0)})}getColor(t,i){return t?this._computedStyle.getPropertyValue(`--${t}`):i}hide(){this.isHidden=!0,this.canvas.style.display="none"}show(){this.isHidden&&this.render(),this.isHidden=!1,this.canvas.style.display="initial"}setInstantSrc(t){if(t===this.backgroundImageSrc)return;this.backgroundImageSrc=t,this.isBackgroundImageReady=!1,this.backgroundImage||(this.backgroundImage=document.createElement("canvas"));let i=document.createElement("img");i.crossOrigin="use-credentials",i.addEventListener("load",()=>{if(i.width<=0)return;this.backgroundImage.width=300,this.backgroundImage.height=300;let e=this.backgroundImage.getContext("2d",{alpha:!1});e.drawImage(i,0,0,this.backgroundImage.width,this.backgroundImage.height),rt(e,10),this.isBackgroundImageReady=!0}),i.src=t}adjustSize(t=-1,i=-1){let e=t>-1?t:this.canvas.parentElement.getBoundingClientRect().width,n=i>-1?i:window.innerHeight;this.canvas.width=e*this.pixelDensity,this.canvas.height=n*this.pixelDensity,this.canvas.style.width=`${e}px`,this.canvas.style.height=`${n}px`,this.canvasWidth=e*this.pixelDensity,this.canvasHeight=n*this.pixelDensity,this.offscreenCanvas.width=e*this.pixelDensity,this.offscreenCanvas.height=n*this.pixelDensity}render(){this._isReady?requestAnimationFrame(this._render):requestAnimationFrame(this.render)}_render(t){if(!this.paused&&!this.isHidden){if(!this._isRendering){this._isRendering=!0;let i=(t-this.setHighlightsAt)/60,e=this.ctx;if(e.fillStyle="black",e.fillRect(0,0,this.canvasWidth,this.canvasHeight),this.isBackgroundImageReady&&this.backgroundImage.width>0&&this.backgroundOpacity<1&&e.drawImage(this.backgroundImage,0,0,this.backgroundImage.width,this.backgroundImage.height,0,0,this.canvasWidth,this.canvasHeight),this.key===_){this.offscreenCanvas.width>0&&this.finalCtx.drawImage(this.offscreenCanvas,0,0),this._isRendering=!1,this.render();return}let n=this.highlights.filter(l=>l.darkenAroundHighlight);n.length>0&&(e.fillStyle="rgba(0,0,0,0.6)",e.fillRect(0,0,this.canvasWidth,this.canvasHeight)),e.fillStyle=this.backgroundColor,e.globalAlpha=this.backgroundOpacity,e.fillRect(0,0,this.canvasWidth,this.canvasHeight),e.globalAlpha=1,e.transform(this.zoom,0,0,this.zoom,W(this.canvasWidth/2),W(this.canvasHeight/2)),this.image.width>0&&e.drawImage(this.image,-this.x,-this.y);let o=10*this.pixelDensity/this.zoom;if(n.length>0){e.fillStyle="rgba(0,0,0,0.6)",e.setTransform(1,0,0,1,0,0),e.fillRect(0,0,this.canvasWidth,this.canvasHeight),e.transform(this.zoom,0,0,this.zoom,W(this.canvasWidth/2),W(this.canvasHeight/2)),e.save();let l=new Path2D;n.forEach(s=>{v(l,-this.x+s.x,-this.y+s.y,s.width,s.height,o)}),e.clip(l),this.image.width>0&&e.drawImage(this.image,-this.x,-this.y),e.restore()}this.highlights.forEach(l=>{var h;let s=new Path2D;switch(e.lineWidth=W(this._style.lineWidth/2*this.pixelDensity/this.zoom),(h=l.effect)!=null?h:l.isHidden?"hidden":"solid"){case"hidden":break;case"ants":e.strokeStyle=this.getColor(l.color,this._style.lineColor),e.setLineDash([40/this.zoom,20/this.zoom]),e.lineDashOffset=-(i*5%60)/this.zoom,v(s,-this.x+l.x,-this.y+l.y,l.width,l.height,o),e.stroke(s);break;case"draw":let d=(l.width+l.height)*2;e.strokeStyle=this.getColor(l.color,this._style.lineColor),e.setLineDash([d]),e.lineDashOffset=Math.max(0,d-i*(d/60)),v(s,-this.x+l.x,-this.y+l.y,l.width,l.height,o),e.stroke(s);break;case"flash":e.strokeStyle=this.getColor(l.color,this._style.lineColor),e.setLineDash([]),v(s,-this.x+l.x,-this.y+l.y,l.width,l.height,o),e.globalAlpha=(1+Math.sin(i/4))/2,e.stroke(s),e.globalAlpha=1;break;case"solid":default:e.strokeStyle=this.getColor(l.color,this._style.lineColor),e.setLineDash([]),v(s,-this.x+l.x,-this.y+l.y,l.width,l.height,o),e.stroke(s);break}e.setLineDash([]),e.lineDashOffset=0}),this.highlights.forEach(l=>{if(l.hasDot){let s=(this._style.markerSize/2-2)*this.pixelDensity/this.zoom,r=2*this.pixelDensity*((1+Math.sin(i/4))/2)/this.zoom,h=new Path2D;h.arc(-this.x+l.dotX,-this.y+l.dotY,W(s+r),0,2*Math.PI),e.fillStyle=this.getColor(l.dotColor,this._style.lineColor),e.fill(h),e.lineWidth=4*this.pixelDensity/this.zoom,e.strokeStyle="black",e.stroke(h)}}),this.canvas.width>400&&(this.ctx.lineJoin="round",this.ctx.lineCap="square",this.highlights.forEach(l=>{let s=18*this.pixelDensity-4;if(e.font=`bold ${s/this.zoom}px Arial`,e.textAlign="center",e.fillStyle="white",e.strokeStyle="black",e.lineWidth=6*this.pixelDensity/this.zoom,l.label){let r=this.ensureLabelXIsInsideBoundaries(e.measureText(l.label).width,-this.x+l.x+l.width*.5);e.strokeText(l.label,r,-this.y+l.y+l.height-(s+5)/this.zoom),e.fillText(l.label,r,-this.y+l.y+l.height-(s+5)/this.zoom)}if(l.hasDot&&l.dotLabel){let r=this.ensureLabelXIsInsideBoundaries(e.measureText(l.dotLabel).width,-this.x+l.dotX);e.strokeText(l.dotLabel,r,-this.y+l.dotY-(s+10)/this.zoom),e.fillText(l.dotLabel,r,-this.y+l.dotY-(s+10)/this.zoom)}})),e.setTransform(1,0,0,1,0,0),this.offscreenCanvas.width>0&&this.finalCtx.drawImage(this.offscreenCanvas,0,0),this._isRendering=!1}this.render()}}setBounds(t,i){this.maxX=t,this.maxY=i}setHighlights(t,i){var l;this.noHighlightsBehaviour=this._style.noHighlightsBehaviour,this.highlights=[];let e=this.getDimensions(),n=this.getAutoZoom(e.width,e.height),o=window.__prefersReducedMotion||(l=window.matchMedia("(prefers-reduced-motion: reduce)"))!=null&&l.matches?0:this._style.transitionDuration;t.length>0&&(this.highlights=t.map(s=>it(j({},s),{x:W(s.x/100*this.maxX),y:W(s.y/100*this.maxY),width:W(s.width/100*this.maxX),height:W(s.height/100*this.maxY),dotX:W(s.dotX/100*this.maxX),dotY:W(s.dotY/100*this.maxY)})),e=this.getDimensions(),n=this.getAutoZoom(e.width,e.height)),this.tween.start({x:this.x,y:this.y,z:this.zoom},{x:e.x+e.width/2,y:e.y+e.height/2,z:n},i===this.key?0:o),this.key=i,this.setHighlightsAt=performance.now()}getDimensions(){let t=this.highlights.reduce((i,e)=>{let n=j({},i);return(n.x===-1||e.xn.x+n.width&&(n.width=e.x-n.x+e.width),e.y+e.height>n.y+n.height&&(n.height=e.y-n.y+e.height),n},{x:-1,y:-1,width:0,height:0});return this.highlights.length===0&&(t.x=0,t.y=0,t.width=this.maxX,t.height=this.maxY),this.applyBias(t),t}applyBias(t){if(X.getWidth()<900)return;let i=t.width>t.height;this.bias==="left"?t.width*=i?2.1:2.4:this.bias==="right"&&(t.width*=i?2.1:2.4,t.x-=t.width/(i?1.9:1.7))}getAutoZoom(t,i){(typeof t=="undefined"||typeof i=="undefined")&&(t=this.maxX,i=this.maxY);let e=t===this.maxX,n=this.noHighlightsBehaviour==="contain"||this.highlights.length>0;n&&(t*=e?1.05:1.2,i*=e?1.05:1.2);let o=this.canvasWidth/t,l=this.canvasHeight/i,s=n?Math.min(l,o):Math.max(l,o);return(0,K.default)(s,bt,pt)}setZoom(t){typeof t=="undefined"?this.zoom=this.getAutoZoom():this.zoom=t,this.zoom=(0,K.default)(this.zoom,bt,pt),this.setCenter(this.x,this.y)}setCenter(t,i){typeof t!="undefined"?(this.x=W(t),this.y=W(i)):(this.x=W(this.maxX/2),this.y=W(this.maxY/2))}onTweenTick(t){isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||(this.setCenter(t.x,t.y),this.setZoom(t.z))}hasHighlightAtScreenPosition(t){let i=n=>(n-this.x)*this.zoom+this.canvasWidth/2,e=n=>(n-this.y)*this.zoom+this.canvasHeight/2;return this.highlights.reduce((n,o)=>n?!0:!(t.xi(o.x+o.width)||t.ye(o.y+o.height)),!1)}ensureLabelXIsInsideBoundaries(t,i){let e=this.getDimensions(),n=-this.x+e.x,o=n+e.width;return i-t*.5o&&(i=o-t*.5),i}};function v(a,t,i,e,n,o){"roundRect"in a?a.roundRect(t,i,e,n,o):a.rect(t,i,e,n,o)}function q(){T("[data-scrollpoints]").forEach(a=>kt(a))}function kt(a){var p;let t=a.querySelector("[data-media]"),i=document.createElement("canvas");t.appendChild(i);let e,n,o=new Image;o.addEventListener("load",()=>{l.setBounds(o.naturalWidth,o.naturalHeight),l.adjustSize(),r(!0)}),o.src=t.getAttribute("data-media"),i.setAttribute("role","img"),i.setAttribute("aria-label",t.getAttribute("data-alt-text"));let l=new w(i,o,t.getAttribute("data-color"),parseFloat(t.getAttribute("data-opacity")||"10")/100);l.setInstantSrc(t.getAttribute("data-instant")),yt(a,i,l);let s=T("[data-box]",a);l.key=s.length===0?_:(p=s[0])==null?void 0:p.getAttribute("data-item-id");function r(G=!1){if(n=Wt(a),n===e&&!G||(e=n,!n))return;window.dispatchEvent(new CustomEvent("panel-item-selected",{detail:{id:n.getAttribute("data-item-id"),source:"scroll"}})),It(n,l);let u=n.getAttribute("data-item-id");if(u&&window.dispatchEvent(new CustomEvent("scrollpoint:active-point-changed",{detail:{itemId:u}})),n.getAttribute("data-box")==="")l.setHighlights([],u);else{let{highlights:y}=JSON.parse(n.getAttribute("data-box")),J=y.map(m=>({x:parseFloat(m.x),y:parseFloat(m.y),width:parseFloat(m.width),height:parseFloat(m.height),effect:m.effect,color:m.color||"red",label:m.label||"",hasDot:!!m.hasDot,dotX:parseFloat(m.dotX),dotY:parseFloat(m.dotY),dotColor:m.dotColor,dotLabel:m.dotLabel||"",darkenAroundHighlight:m.darkenAroundHighlight||!1}));l.setHighlights(J,u)}}function h(){r();let{top:G,bottom:u}=a.getBoundingClientRect();G>X.getHeight()||u{l.adjustSize(),r(!0)},200)}return(document.getElementById("editor-viewport")||document).addEventListener("scroll",h,{passive:!0}),window.addEventListener("resize",c,{passive:!0}),{camera:l,update(){z(!0).catch(console.error);let G=t.getAttribute("data-media");o.src!==G&&(o.src=G),l.setInstantSrc(t.getAttribute("data-instant")),s=T("[data-box]",a),l.backgroundColor=t.getAttribute("data-color"),l.backgroundOpacity=parseFloat(t.getAttribute("data-opacity"))/100,r(!0)}}}function yt(a,t,i){if(!document.getElementById("editor-viewport"))return;let e=a.getAttribute("data-section-id");t.addEventListener("mousemove",n=>{i.hasHighlightAtScreenPosition({x:n.offsetX,y:n.offsetY})?document.body.style.setProperty("cursor","zoom-in"):document.body.style.setProperty("cursor","auto")},{passive:!0}),t.addEventListener("click",n=>{if(i.hasHighlightAtScreenPosition({x:n.offsetX,y:n.offsetY})){let o=Wt(a);window.dispatchEvent(new CustomEvent("scrollpoint:manage-highlights",{detail:{sectionId:e,activeItemId:o.getAttribute("data-item-id")}}))}})}function Wt(a){let t=window.innerHeight*.9,i=T("[data-box]",a),e,n=a.getBoundingClientRect();return n.bottoml.getBoundingClientRect().top