siteguide.js 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -339,9 +339,9 @@ export declare type TourConfig = {
|
|
|
339
339
|
text?: string;
|
|
340
340
|
};
|
|
341
341
|
/**
|
|
342
|
-
* Configuration for the
|
|
342
|
+
* Configuration for the interaction
|
|
343
343
|
*/
|
|
344
|
-
|
|
344
|
+
interaction?: {
|
|
345
345
|
/**
|
|
346
346
|
* Disabling interaction with host element
|
|
347
347
|
* @default false
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Xt=Object.defineProperty,Zt=Object.defineProperties;var Gt=Object.getOwnPropertyDescriptors;var et=Object.getOwnPropertySymbols;var St=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable;var Lt=Math.pow,dt=(e,t,n)=>t in e?Xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t)=>{for(var n in t||(t={}))St.call(t,n)&&dt(e,n,t[n]);if(et)for(var n of et(t))Ct.call(t,n)&&dt(e,n,t[n]);return e},X=(e,t)=>Zt(e,Gt(t));var Pt=(e,t)=>{var n={};for(var i in e)St.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&et)for(var i of et(e))t.indexOf(i)<0&&Ct.call(e,i)&&(n[i]=e[i]);return n};var y=(e,t,n)=>dt(e,typeof t!="symbol"?t+"":t,n);var A=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{c(n.next(a))}catch(l){o(l)}},r=a=>{try{c(n.throw(a))}catch(l){o(l)}},c=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);c((n=n.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Jt=["top","right","bottom","left"],Tt=["start","end"],Et=Jt.reduce((e,t)=>e.concat(t,t+"-"+Tt[0],t+"-"+Tt[1]),[]),Z=Math.min,Y=Math.max,it=Math.round,N=e=>({x:e,y:e}),Qt={left:"right",right:"left",bottom:"top",top:"bottom"},te={start:"end",end:"start"};function ee(e,t,n){return Y(e,Z(t,n))}function st(e,t){return typeof e=="function"?e(t):e}function J(e){return e.split("-")[0]}function M(e){return e.split("-")[1]}function ne(e){return e==="x"?"y":"x"}function xt(e){return e==="y"?"height":"width"}function yt(e){return["top","bottom"].includes(J(e))?"y":"x"}function wt(e){return ne(yt(e))}function ie(e,t,n){n===void 0&&(n=!1);const i=M(e),o=wt(e),s=xt(o);let r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Rt(r)),[r,Rt(r)]}function oe(e){return e.replace(/start|end/g,t=>te[t])}function Rt(e){return e.replace(/left|right|bottom|top/g,t=>Qt[t])}function se(e){return $({top:0,right:0,bottom:0,left:0},e)}function Bt(e){return typeof e!="number"?se(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:i,height:o}=e;return{width:i,height:o,top:n,left:t,right:t+i,bottom:n+o,x:t,y:n}}function Ot(e,t,n){let{reference:i,floating:o}=e;const s=yt(t),r=wt(t),c=xt(r),a=J(t),l=s==="y",h=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,g=i[c]/2-o[c]/2;let d;switch(a){case"top":d={x:h,y:i.y-o.height};break;case"bottom":d={x:h,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-o.width,y:f};break;default:d={x:i.x,y:i.y}}switch(M(t)){case"start":d[r]-=g*(n&&l?-1:1);break;case"end":d[r]+=g*(n&&l?-1:1);break}return d}const re=(e,t,n)=>A(exports,null,function*(){const{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,c=s.filter(Boolean),a=yield r.isRTL==null?void 0:r.isRTL(t);let l=yield r.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:f}=Ot(l,i,a),g=i,d={},u=0;for(let p=0;p<c.length;p++){const{name:m,fn:x}=c[p],{x:b,y:v,data:S,reset:_}=yield x({x:h,y:f,initialPlacement:i,placement:g,strategy:o,middlewareData:d,rects:l,platform:r,elements:{reference:e,floating:t}});h=b!=null?b:h,f=v!=null?v:f,d=X($({},d),{[m]:$($({},d[m]),S)}),_&&u<=50&&(u++,typeof _=="object"&&(_.placement&&(g=_.placement),_.rects&&(l=_.rects===!0?yield r.getElementRects({reference:e,floating:t,strategy:o}):_.rects),{x:h,y:f}=Ot(l,g,a)),p=-1)}return{x:h,y:f,placement:g,strategy:o,middlewareData:d}});function ce(e,t){return A(this,null,function*(){var n;t===void 0&&(t={});const{x:i,y:o,platform:s,rects:r,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:g=!1,padding:d=0}=st(t,e),u=Bt(d),m=c[g?f==="floating"?"reference":"floating":f],x=ot(yield s.getClippingRect({element:(n=yield s.isElement==null?void 0:s.isElement(m))==null||n?m:m.contextElement||(yield s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:h,strategy:a})),b=f==="floating"?{x:i,y:o,width:r.floating.width,height:r.floating.height}:r.reference,v=yield s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating),S=(yield s.isElement==null?void 0:s.isElement(v))?(yield s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},_=ot(s.convertOffsetParentRelativeRectToViewportRelativeRect?yield s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:v,strategy:a}):b);return{top:(x.top-_.top+u.top)/S.y,bottom:(_.bottom-x.bottom+u.bottom)/S.y,left:(x.left-_.left+u.left)/S.x,right:(_.right-x.right+u.right)/S.x}})}const le=e=>({name:"arrow",options:e,fn(n){return A(this,null,function*(){const{x:i,y:o,placement:s,rects:r,platform:c,elements:a,middlewareData:l}=n,{element:h,padding:f=0}=st(e,n)||{};if(h==null)return{};const g=Bt(f),d={x:i,y:o},u=wt(s),p=xt(u),m=yield c.getDimensions(h),x=u==="y",b=x?"top":"left",v=x?"bottom":"right",S=x?"clientHeight":"clientWidth",_=r.reference[p]+r.reference[u]-d[u]-r.floating[p],w=d[u]-r.reference[u],L=yield c.getOffsetParent==null?void 0:c.getOffsetParent(h);let P=L?L[S]:0;(!P||!(yield c.isElement==null?void 0:c.isElement(L)))&&(P=a.floating[S]||r.floating[p]);const I=_/2-w/2,F=P/2-m[p]/2-1,z=Z(g[b],F),C=Z(g[v],F),O=z,tt=P-m[p]-C,H=P/2-m[p]/2+I,at=ee(O,H,tt),ft=!l.arrow&&M(s)!=null&&H!==at&&r.reference[p]/2-(H<O?z:C)-m[p]/2<0,ht=ft?H<O?H-O:H-tt:0;return{[u]:d[u]+ht,data:$({[u]:at,centerOffset:H-at-ht},ft&&{alignmentOffset:ht}),reset:ft}})}});function ae(e,t,n){return(e?[...n.filter(o=>M(o)===e),...n.filter(o=>M(o)!==e)]:n.filter(o=>J(o)===o)).filter(o=>e?M(o)===e||(t?oe(o)!==o:!1):!0)}const fe=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,fn(n){return A(this,null,function*(){var i,o,s;const{rects:r,middlewareData:c,placement:a,platform:l,elements:h}=n,z=st(e,n),{crossAxis:f=!1,alignment:g,allowedPlacements:d=Et,autoAlignment:u=!0}=z,p=Pt(z,["crossAxis","alignment","allowedPlacements","autoAlignment"]),m=g!==void 0||d===Et?ae(g||null,u,d):d,x=yield ce(n,p),b=((i=c.autoPlacement)==null?void 0:i.index)||0,v=m[b];if(v==null)return{};const S=ie(v,r,yield l.isRTL==null?void 0:l.isRTL(h.floating));if(a!==v)return{reset:{placement:m[0]}};const _=[x[J(v)],x[S[0]],x[S[1]]],w=[...((o=c.autoPlacement)==null?void 0:o.overflows)||[],{placement:v,overflows:_}],L=m[b+1];if(L)return{data:{index:b+1,overflows:w},reset:{placement:L}};const P=w.map(C=>{const O=M(C.placement);return[C.placement,O&&f?C.overflows.slice(0,2).reduce((tt,H)=>tt+H,0):C.overflows[0],C.overflows]}).sort((C,O)=>C[1]-O[1]),F=((s=P.filter(C=>C[2].slice(0,M(C[0])?2:3).every(O=>O<=0))[0])==null?void 0:s[0])||P[0][0];return F!==a?{data:{index:b+1,overflows:w},reset:{placement:F}}:{}})}}};function he(e,t){return A(this,null,function*(){const{placement:n,platform:i,elements:o}=e,s=yield i.isRTL==null?void 0:i.isRTL(o.floating),r=J(n),c=M(n),a=yt(n)==="y",l=["left","top"].includes(r)?-1:1,h=s&&a?-1:1,f=st(t,e);let{mainAxis:g,crossAxis:d,alignmentAxis:u}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof u=="number"&&(d=c==="end"?u*-1:u),a?{x:d*h,y:g*l}:{x:g*l,y:d*h}})}const de=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return A(this,null,function*(){var i,o;const{x:s,y:r,placement:c,middlewareData:a}=n,l=yield he(n,e);return c===((i=a.offset)==null?void 0:i.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:s+l.x,y:r+l.y,data:X($({},l),{placement:c})}})}}};function rt(){return typeof window!="undefined"}function K(e){return Ft(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function W(e){var t;return(t=(Ft(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ft(e){return rt()?e instanceof Node||e instanceof R(e).Node:!1}function D(e){return rt()?e instanceof Element||e instanceof R(e).Element:!1}function B(e){return rt()?e instanceof HTMLElement||e instanceof R(e).HTMLElement:!1}function $t(e){return!rt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof R(e).ShadowRoot}function Q(e){const{overflow:t,overflowX:n,overflowY:i,display:o}=k(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(o)}function ue(e){return["table","td","th"].includes(K(e))}function ct(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function vt(e){const t=_t(),n=D(e)?k(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function ge(e){let t=j(e);for(;B(t)&&!U(t);){if(vt(t))return t;if(ct(t))return null;t=j(t)}return null}function _t(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function U(e){return["html","body","#document"].includes(K(e))}function k(e){return R(e).getComputedStyle(e)}function lt(e){return D(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function j(e){if(K(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$t(e)&&e.host||W(e);return $t(t)?t.host:t}function Ht(e){const t=j(e);return U(t)?e.ownerDocument?e.ownerDocument.body:e.body:B(t)&&Q(t)?t:Ht(t)}function pt(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ht(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),r=R(o);if(s){const c=mt(r);return t.concat(r,r.visualViewport||[],Q(o)?o:[],c&&n?pt(c):[])}return t.concat(o,pt(o,[],n))}function mt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mt(e){const t=k(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=B(e),s=o?e.offsetWidth:n,r=o?e.offsetHeight:i,c=it(n)!==s||it(i)!==r;return c&&(n=s,i=r),{width:n,height:i,$:c}}function Vt(e){return D(e)?e:e.contextElement}function q(e){const t=Vt(e);if(!B(t))return N(1);const n=t.getBoundingClientRect(),{width:i,height:o,$:s}=Mt(t);let r=(s?it(n.width):n.width)/i,c=(s?it(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const pe=N(0);function Wt(e){const t=R(e);return!_t()||!t.visualViewport?pe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function me(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==R(e)?!1:t}function G(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Vt(e);let r=N(1);t&&(i?D(i)&&(r=q(i)):r=q(e));const c=me(s,n,i)?Wt(s):N(0);let a=(o.left+c.x)/r.x,l=(o.top+c.y)/r.y,h=o.width/r.x,f=o.height/r.y;if(s){const g=R(s),d=i&&D(i)?R(i):i;let u=g,p=mt(u);for(;p&&i&&d!==u;){const m=q(p),x=p.getBoundingClientRect(),b=k(p),v=x.left+(p.clientLeft+parseFloat(b.paddingLeft))*m.x,S=x.top+(p.clientTop+parseFloat(b.paddingTop))*m.y;a*=m.x,l*=m.y,h*=m.x,f*=m.y,a+=v,l+=S,u=R(p),p=mt(u)}}return ot({width:h,height:f,x:a,y:l})}function bt(e,t){const n=lt(e).scrollLeft;return t?t.left+n:G(W(e)).left+n}function It(e,t,n){n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=i.left+t.scrollLeft-(n?0:bt(e,i)),s=i.top+t.scrollTop;return{x:o,y:s}}function xe(e){let{elements:t,rect:n,offsetParent:i,strategy:o}=e;const s=o==="fixed",r=W(i),c=t?ct(t.floating):!1;if(i===r||c&&s)return n;let a={scrollLeft:0,scrollTop:0},l=N(1);const h=N(0),f=B(i);if((f||!f&&!s)&&((K(i)!=="body"||Q(r))&&(a=lt(i)),B(i))){const d=G(i);l=q(i),h.x=d.x+i.clientLeft,h.y=d.y+i.clientTop}const g=r&&!f&&!s?It(r,a,!0):N(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+h.x+g.x,y:n.y*l.y-a.scrollTop*l.y+h.y+g.y}}function ye(e){return Array.from(e.getClientRects())}function we(e){const t=W(e),n=lt(e),i=e.ownerDocument.body,o=Y(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),s=Y(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+bt(e);const c=-n.scrollTop;return k(i).direction==="rtl"&&(r+=Y(t.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:c}}function ve(e,t){const n=R(e),i=W(e),o=n.visualViewport;let s=i.clientWidth,r=i.clientHeight,c=0,a=0;if(o){s=o.width,r=o.height;const l=_t();(!l||l&&t==="fixed")&&(c=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:c,y:a}}function _e(e,t){const n=G(e,!0,t==="fixed"),i=n.top+e.clientTop,o=n.left+e.clientLeft,s=B(e)?q(e):N(1),r=e.clientWidth*s.x,c=e.clientHeight*s.y,a=o*s.x,l=i*s.y;return{width:r,height:c,x:a,y:l}}function At(e,t,n){let i;if(t==="viewport")i=ve(e,n);else if(t==="document")i=we(W(e));else if(D(t))i=_e(t,n);else{const o=Wt(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ot(i)}function zt(e,t){const n=j(e);return n===t||!D(n)||U(n)?!1:k(n).position==="fixed"||zt(n,t)}function be(e,t){const n=t.get(e);if(n)return n;let i=pt(e,[],!1).filter(c=>D(c)&&K(c)!=="body"),o=null;const s=k(e).position==="fixed";let r=s?j(e):e;for(;D(r)&&!U(r);){const c=k(r),a=vt(r);!a&&c.position==="fixed"&&(o=null),(s?!a&&!o:!a&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Q(r)&&!a&&zt(e,r))?i=i.filter(h=>h!==r):o=c,r=j(r)}return t.set(e,i),i}function Se(e){let{element:t,boundary:n,rootBoundary:i,strategy:o}=e;const r=[...n==="clippingAncestors"?ct(t)?[]:be(t,this._c):[].concat(n),i],c=r[0],a=r.reduce((l,h)=>{const f=At(t,h,o);return l.top=Y(f.top,l.top),l.right=Z(f.right,l.right),l.bottom=Z(f.bottom,l.bottom),l.left=Y(f.left,l.left),l},At(t,c,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Ce(e){const{width:t,height:n}=Mt(e);return{width:t,height:n}}function Le(e,t,n){const i=B(t),o=W(t),s=n==="fixed",r=G(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=N(0);if(i||!i&&!s)if((K(t)!=="body"||Q(o))&&(c=lt(t)),i){const g=G(t,!0,s,t);a.x=g.x+t.clientLeft,a.y=g.y+t.clientTop}else o&&(a.x=bt(o));const l=o&&!i&&!s?It(o,c):N(0),h=r.left+c.scrollLeft-a.x-l.x,f=r.top+c.scrollTop-a.y-l.y;return{x:h,y:f,width:r.width,height:r.height}}function ut(e){return k(e).position==="static"}function Dt(e,t){if(!B(e)||k(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return W(e)===n&&(n=n.ownerDocument.body),n}function jt(e,t){const n=R(e);if(ct(e))return n;if(!B(e)){let o=j(e);for(;o&&!U(o);){if(D(o)&&!ut(o))return o;o=j(o)}return n}let i=Dt(e,t);for(;i&&ue(i)&&ut(i);)i=Dt(i,t);return i&&U(i)&&ut(i)&&!vt(i)?n:i||ge(e)||n}const Pe=function(e){return A(this,null,function*(){const t=this.getOffsetParent||jt,n=this.getDimensions,i=yield n(e.floating);return{reference:Le(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})};function Te(e){return k(e).direction==="rtl"}const Ee={convertOffsetParentRelativeRectToViewportRelativeRect:xe,getDocumentElement:W,getClippingRect:Se,getOffsetParent:jt,getElementRects:Pe,getClientRects:ye,getDimensions:Ce,getScale:q,isElement:D,isRTL:Te},Re=de,Oe=fe,$e=le,Ae=(e,t,n)=>{const i=new Map,o=$({platform:Ee},n),s=X($({},o.platform),{_c:i});return re(e,t,X($({},o),{platform:s}))};function V(e){return e===null||typeof e=="undefined"}function E(e){return!V(e)}function kt(e){return new Promise(t=>setTimeout(t,e))}function Yt(e){var i;const t=e.parentElement;return!t||t.nodeName==="HTML"?!1:((i=document.defaultView)==null?void 0:i.getComputedStyle(e,null).getPropertyValue("position"))==="fixed"?!0:Yt(t)}function qt(e){return Yt(e)?"fixed":"absolute"}class De{renderContent(t,n,i){t.querySelector(`.${i.classPrefix}-content`).appendChild(n.node)}}function T(e,t){const n=document.createElement(e);return t&&t.length>0&&(t=t.filter(i=>i),n.classList.add(...t)),n}class ke{renderContent(t,n,i){var s,r,c,a;const o=t.querySelector(`.${i.classPrefix}-content`);if(n.imgSrc){const l=T("img",[`${i.classPrefix}-image`,`${(r=(s=n.customization)==null?void 0:s.imageClass)!=null?r:""}`]);l.src=n.imgSrc,o.appendChild(l)}if(n.text){const l=T("p",[`${i.classPrefix}-description`,`${(a=(c=n.customization)==null?void 0:c.descriptionClass)!=null?a:""}`]);l.innerHTML=i.translateFn(n.text),o.appendChild(l)}}}function Ne(e,t,n){var c,a,l,h,f,g,d,u,p,m,x,b,v,S,_;if(e.innerHTML="",e.className=`${(c=n.config.class)!=null?c:""} ${n.config.classPrefix} ${n.config.animationClass}`,!n.config.arrow.disable&&((a=n.activeStep)!=null&&a.hasHost)){const w=T("div",[(l=n.config.arrow.class)!=null?l:"",`${n.config.classPrefix}-arrow`]);e.appendChild(w)}(h=t.customization)!=null&&h.class&&e.classList.add(t.customization.class);const i=T("div",[`${n.config.classPrefix}-header`,`${(g=(f=t.customization)==null?void 0:f.headerClass)!=null?g:""}`]);e.appendChild(i);const o=T("h1",[`${n.config.classPrefix}-title`,`${(u=(d=t.customization)==null?void 0:d.titleClass)!=null?u:""}`]);o.innerHTML=n.config.translateFn((p=t.title)!=null?p:""),i.appendChild(o),n.config.close.button&&(n.config.closeIcon.onclick=n.complete.bind(n),i.appendChild(n.config.closeIcon));const s=T("div",[`${n.config.classPrefix}-content`,`${(x=(m=t.customization)==null?void 0:m.contentClass)!=null?x:""}`]);e.appendChild(s);const r=T("div",[`${n.config.classPrefix}-footer`,`${(v=(b=t.customization)==null?void 0:b.footerClass)!=null?v:""}`]);if(V(t.buttonList)&&(t.buttonList=Be(n)),t.buttonList.forEach(w=>{var I;const L=[`${n.config.classPrefix}-button`,(I=w.class)!=null?I:""];V(w.type)||w.type==="secondary"?L.push(`${n.config.classPrefix}-button-secondary`):w.type==="primary"?L.push(`${n.config.classPrefix}-button-primary`):w.type==="link"&&L.push(`${n.config.classPrefix}-button-link`),!V(w.class)&&w.class!==""&&L.push(w.class);const P=T("button",L);P.innerHTML=n.config.translateFn(w.text),P.onclick=F=>{w.action.call(n)},r.appendChild(P)}),!n.config.progress.disable&&n.config.progress.text&&E(n.activeStepIndex)){const w=T("p",[`${n.config.classPrefix}-progress`,`${(_=(S=t.customization)==null?void 0:S.progressClass)!=null?_:""}`]);w.innerHTML=n.config.translateFn(Fe(n.config.progress.text,n.activeStepIndex+1,n.stepList.length)),r.appendChild(w)}e.appendChild(r)}function Be(e){return[{text:"Back",action:e.prev},{text:"Next",type:"primary",action:e.next}]}function Fe(e,t,n){return e.replace("{{currentStep}}",t.toString()).replace("{{totalSteps}}",n.toString())}class He{constructor(){y(this,"_renderContentStrategy",new Map);y(this,"_staticSides",{top:"bottom",right:"left",bottom:"top",left:"right"});this.setUpStrategies()}render(t,n){return new Promise(i=>{var o,s;if(!this._renderContentStrategy.has(n.popupData.type))throw new Error("Missing popup creator strategy");t.style.display="none",t.classList.remove(n.tour.config.animationClass),n.hostElement?t.style.position=qt(n.hostElement):t.style.position="fixed",Ne(t,n.popupData,n.tour),(o=this._renderContentStrategy.get(n.popupData.type))==null||o.renderContent(t,n.popupData,n.tour.config),(s=n.hostElement)==null||s.scrollIntoView(n.tour.config.scrollTo),i()}).then(()=>n.isFirst&&n.direction==="toNext"?kt(0):kt(400)).then(()=>{t.style.display="flex",this.updatePosition(t,n),t.classList.add(n.tour.config.animationClass)})}updatePosition(t,n){E(n.hostElement)?this.renderFloatingPopup(t,n):this.renderCenterPopup(t)}renderFloatingPopup(t,n){var l;const i=t.style.position==="fixed"?window.scrollY||document.documentElement.scrollTop:0,o=t.querySelector(`.${n.tour.config.classPrefix}-arrow`),s=[],r=E(n.popupData.position)&&n.popupData.position!=="auto"?n.popupData.position:void 0,c=(l=o==null?void 0:o.offsetWidth)!=null?l:10,a=Math.sqrt(2*Lt(c,2))/2+n.tour.config.highlight.padding;s.push(Re(a)),(n.popupData.position==="auto"||V(r))&&s.push(Oe()),!n.tour.config.arrow.disable&&E(o)&&s.push($e({element:o})),Ae(n.hostElement,t,{placement:r,middleware:[...s]}).then(({x:h,y:f,middlewareData:g,placement:d})=>{Object.assign(t.style,{top:`${f-i}px`,left:`${h}px`,marginTop:"0",marginLeft:"0"});const u=d.split("-")[0],p=this._staticSides[u];if(g.arrow&&E(o)){const{x:m,y:x}=g.arrow;Object.assign(o.style,{left:m!=null?`${m}px`:"",top:x!=null?`${x}px`:"",right:"",bottom:"",[p]:`${-c/2}px`,transform:"rotate(45deg)"})}})}renderCenterPopup(t){Object.assign(t.style,{top:"50%",left:"50%",marginTop:`-${t.clientHeight/2}px`,marginLeft:`-${t.clientWidth/2}px`})}setUpStrategies(){this._renderContentStrategy.set("text",new ke),this._renderContentStrategy.set("custom",new De)}}class Nt{render(t,n){return new Promise(i=>{n.hostElement&&(t.style.position=qt(n.hostElement)),i()}).then(()=>{this.updatePosition(t,n)})}updatePosition(t,n){var r,c;if(!n.hostElement){t.style.width="0",t.style.height="0",t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",t.style.opacity="0";return}const i=n.hostElement.getBoundingClientRect(),o=(c=(r=n.tour.config.highlight)==null?void 0:r.padding)!=null?c:8,s=t.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;t.style.transform="",t.style.left=`${i.left-o}px`,t.style.top=`${i.top+s-o}px`,t.style.width=`${i.width+2*o}px`,t.style.height=`${i.height+2*o}px`,t.style.opacity="1"}}class Ut{constructor(t,n){y(this,"popupData");y(this,"tour");y(this,"_index");y(this,"_hostElement",null);y(this,"_direction","toNext");y(this,"_hostData");y(this,"_popupRenderer");y(this,"_highlightRenderer");y(this,"_intersectionRenderer");var i;this.popupData=n.popup,this.tour=t,this._index=(i=n.index)!=null?i:null,this._hostData=n.host,this._popupRenderer=t.popupRenderer,this._highlightRenderer=t.highlightRenderer,this._intersectionRenderer=t.intersectionRenderer}get isFirst(){return this._index===0}get nextStep(){var t;return(t=this.tour.stepList[this.tour.stepList.indexOf(this)+1])!=null?t:null}get prevStep(){var t;return(t=this.tour.stepList[this.tour.stepList.indexOf(this)-1])!=null?t:null}get direction(){return this._direction}get hasHost(){return E(this._hostElement)}get hostElement(){return this._hostElement}get index(){return this._index}set index(t){this._index=t}show(t){return A(this,null,function*(){var i;if(V(this.tour.popup))return;this._direction=t,this._hostData&&(this._hostElement=this.resolveHostElement(typeof this._hostData=="function"?this._hostData():(i=this._hostData)!=null?i:null));const n=[this._popupRenderer.render(this.tour.popup,this)];this.tour.config.intersection.disable&&E(this.tour.intersection)&&n.push(this._intersectionRenderer.render(this.tour.intersection,this)),!this.tour.config.highlight.disable&&!V(this.tour.highlight)&&n.push(this._highlightRenderer.render(this.tour.highlight,this)),this.tour.config.highlight.disable&&E(this.tour.highlight)&&this._highlightRenderer.render(this.tour.highlight,{}),yield Promise.all(n),this.toggleZIndex(!0)})}hide(){return A(this,null,function*(){this.toggleZIndex(!1)})}toggleZIndex(t){V(this._hostElement)||(t?this._hostElement.classList.add("siteguide-host"):this._hostElement.classList.remove("siteguide-host"))}resolveHostElement(t){return typeof this._hostData=="string"?document.querySelector(this._hostData):t}}function gt(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Kt(e,t){const n=$({},e);return gt(e)&>(t)&&Object.keys(t).forEach(i=>{const o=i,s=i;gt(t[o])?(s in e||Object.assign(n,{[s]:{}}),n[s]=Kt(e[s],t[o])):Object.assign(n,{[s]:t[o]})}),n}function Me(e){const t=T("button",[`${e}-close`]);return t.innerHTML="✖",t}class Ve{constructor(){y(this,"_activeTour",null)}get isActive(){return E(this.activeTour)}get activeTour(){return this._activeTour}setActiveTour(t){this._activeTour=t}}const nt=new Ve;class We{constructor(t){y(this,"popupRenderer",new He);y(this,"highlightRenderer",new Nt);y(this,"intersectionRenderer",new Nt);y(this,"_popup",null);y(this,"_highlight",null);y(this,"_intersection",null);y(this,"_stepList",[]);y(this,"_activeStep",null);y(this,"_bodyResizeObserver");y(this,"_config");y(this,"closeOnEsc",t=>{t.key==="Escape"&&this.complete()});y(this,"keyboardControl",t=>{t.key==="ArrowRight"?this.next():t.key==="ArrowLeft"&&this.prev()});var n,i,o,s,r,c,a,l,h,f,g,d,u,p,m,x,b,v,S,_,w,L,P,I,F,z,C;this._bodyResizeObserver=this.getBodyResizeObserver(),this._config={classPrefix:(n=t.classPrefix)!=null?n:"siteguide",class:"",animationClass:(i=t.animationClass)!=null?i:"siteguide-animation",close:{button:(s=(o=t.close)==null?void 0:o.button)!=null?s:!0,clickout:(c=(r=t.close)==null?void 0:r.clickout)!=null?c:!1,esc:(l=(a=t.close)==null?void 0:a.esc)!=null?l:!0},scrollTo:(h=t.scrollTo)!=null?h:{behavior:"smooth",block:"center",inline:"center"},closeIcon:(g=t.closeIcon)!=null?g:Me((f=t.classPrefix)!=null?f:"siteguide"),arrow:{disable:(u=(d=t.arrow)==null?void 0:d.disable)!=null?u:!1,class:(m=(p=t.arrow)==null?void 0:p.class)!=null?m:""},highlight:{disable:(b=(x=t.highlight)==null?void 0:x.disable)!=null?b:!1,padding:(S=(v=t.highlight)==null?void 0:v.padding)!=null?S:8,class:(w=(_=t.highlight)==null?void 0:_.class)!=null?w:""},progress:{disable:(P=(L=t.progress)==null?void 0:L.disable)!=null?P:!0,text:"Step {{currentStep}} of {{totalSteps}}"},intersection:{disable:(F=(I=t.intersection)==null?void 0:I.disable)!=null?F:!1},keyboardControl:(z=t.keyboardControl)!=null?z:!1,translateFn:(C=t.translateFn)!=null?C:O=>O}}get stepList(){return this._stepList}get config(){return this._config}get popup(){return this._popup}get highlight(){return this._highlight}get intersection(){return this._intersection}get activeStep(){return this._activeStep}get activeStepIndex(){return this._activeStep?this.stepList.indexOf(this._activeStep):null}addStep(t){if(V(t.index)){const i=this._stepList.reduce((o,s)=>s.index!==null&&s.index!==void 0&&s.index>o?s.index:o,-1);t.index=i+1}const n=new Ut(this,t);this._stepList.push(n),this._stepList.sort((i,o)=>i.index-o.index)}addSteps(t){t.forEach(n=>this.addStep(n))}removeStep(t){this._stepList=this._stepList.filter(n=>t!==n.index)}start(){nt.isActive||(this.config.close.esc&&document.addEventListener("keydown",this.closeOnEsc),this.config.keyboardControl&&document.addEventListener("keydown",this.keyboardControl),nt.setActiveTour(this),this._popup=T("div",[this._config.classPrefix]),document.body.appendChild(this._popup),this._config.highlight.disable||(this._highlight=T("div",[this._config.highlight.class,`${this._config.classPrefix}-highlight`]),document.body.appendChild(this._highlight)),this._config.intersection.disable&&(this._intersection=T("div",["siteguide-intersection"]),document.body.appendChild(this._intersection)),this.next())}complete(){var t;this._popup&&document.body.removeChild(this._popup),this._highlight&&document.body.removeChild(this._highlight),(t=this._activeStep)==null||t.hide(),this._activeStep=null,nt.setActiveTour(null),this.config.close.esc&&document.removeEventListener("keydown",this.closeOnEsc),this.config.keyboardControl&&document.removeEventListener("keydown",this.keyboardControl)}prev(){const t=E(this._activeStep)?this._stepList.indexOf(this._activeStep)-1:this._stepList.indexOf(this._stepList[this._stepList.length-1]);if(t<0){this.complete();return}this.changeStepTo(t,"fromBack")}next(){return A(this,null,function*(){var n,i,o;const t=E(this._activeStep)?this._stepList.indexOf(this._activeStep)+1:this._stepList.indexOf(this._stepList[0]);if(t>=this._stepList.length){this.complete();return}E((n=this._activeStep)==null?void 0:n.popupData.allowNext)&&!((o=yield(i=this._activeStep)==null?void 0:i.popupData.allowNext.call(this))==null||o)||this.changeStepTo(t,"toNext")})}goTo(t){var n;if(t>this._stepList.length-1){console.error("Provided index was larger than steps amount");return}this.changeStepTo(t,t>((n=this.activeStepIndex)!=null?n:-1)?"toNext":"fromBack")}setConfig(t){this._config=Kt(this._config,t)}changeStepTo(t,n){var i;(i=this._activeStep)==null||i.hide(),this._activeStep=this._stepList[t],this._activeStep.show(n)}getBodyResizeObserver(){const t=new ResizeObserver(()=>{this._activeStep&&(E(this._popup)&&this.popupRenderer.updatePosition(this._popup,this._activeStep),E(this._highlight)&&!this.config.highlight.disable&&this.highlightRenderer.updatePosition(this._highlight,this._activeStep))});return t.observe(document.body),t}}const Ie=nt;exports.Siteguide=Ie;exports.Tour=We;exports.TourStep=Ut;exports.createElement=T;
|
|
1
|
+
"use strict";var Xt=Object.defineProperty,Zt=Object.defineProperties;var Gt=Object.getOwnPropertyDescriptors;var et=Object.getOwnPropertySymbols;var St=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable;var Lt=Math.pow,dt=(e,t,n)=>t in e?Xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t)=>{for(var n in t||(t={}))St.call(t,n)&&dt(e,n,t[n]);if(et)for(var n of et(t))Ct.call(t,n)&&dt(e,n,t[n]);return e},X=(e,t)=>Zt(e,Gt(t));var Pt=(e,t)=>{var n={};for(var i in e)St.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&et)for(var i of et(e))t.indexOf(i)<0&&Ct.call(e,i)&&(n[i]=e[i]);return n};var y=(e,t,n)=>dt(e,typeof t!="symbol"?t+"":t,n);var A=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{c(n.next(a))}catch(l){o(l)}},r=a=>{try{c(n.throw(a))}catch(l){o(l)}},c=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);c((n=n.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Jt=["top","right","bottom","left"],Tt=["start","end"],Et=Jt.reduce((e,t)=>e.concat(t,t+"-"+Tt[0],t+"-"+Tt[1]),[]),Z=Math.min,Y=Math.max,it=Math.round,N=e=>({x:e,y:e}),Qt={left:"right",right:"left",bottom:"top",top:"bottom"},te={start:"end",end:"start"};function ee(e,t,n){return Y(e,Z(t,n))}function st(e,t){return typeof e=="function"?e(t):e}function J(e){return e.split("-")[0]}function M(e){return e.split("-")[1]}function ne(e){return e==="x"?"y":"x"}function xt(e){return e==="y"?"height":"width"}function yt(e){return["top","bottom"].includes(J(e))?"y":"x"}function wt(e){return ne(yt(e))}function ie(e,t,n){n===void 0&&(n=!1);const i=M(e),o=wt(e),s=xt(o);let r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Rt(r)),[r,Rt(r)]}function oe(e){return e.replace(/start|end/g,t=>te[t])}function Rt(e){return e.replace(/left|right|bottom|top/g,t=>Qt[t])}function se(e){return $({top:0,right:0,bottom:0,left:0},e)}function Bt(e){return typeof e!="number"?se(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:i,height:o}=e;return{width:i,height:o,top:n,left:t,right:t+i,bottom:n+o,x:t,y:n}}function Ot(e,t,n){let{reference:i,floating:o}=e;const s=yt(t),r=wt(t),c=xt(r),a=J(t),l=s==="y",h=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,g=i[c]/2-o[c]/2;let d;switch(a){case"top":d={x:h,y:i.y-o.height};break;case"bottom":d={x:h,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-o.width,y:f};break;default:d={x:i.x,y:i.y}}switch(M(t)){case"start":d[r]-=g*(n&&l?-1:1);break;case"end":d[r]+=g*(n&&l?-1:1);break}return d}const re=(e,t,n)=>A(exports,null,function*(){const{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,c=s.filter(Boolean),a=yield r.isRTL==null?void 0:r.isRTL(t);let l=yield r.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:f}=Ot(l,i,a),g=i,d={},u=0;for(let p=0;p<c.length;p++){const{name:m,fn:x}=c[p],{x:b,y:v,data:S,reset:_}=yield x({x:h,y:f,initialPlacement:i,placement:g,strategy:o,middlewareData:d,rects:l,platform:r,elements:{reference:e,floating:t}});h=b!=null?b:h,f=v!=null?v:f,d=X($({},d),{[m]:$($({},d[m]),S)}),_&&u<=50&&(u++,typeof _=="object"&&(_.placement&&(g=_.placement),_.rects&&(l=_.rects===!0?yield r.getElementRects({reference:e,floating:t,strategy:o}):_.rects),{x:h,y:f}=Ot(l,g,a)),p=-1)}return{x:h,y:f,placement:g,strategy:o,middlewareData:d}});function ce(e,t){return A(this,null,function*(){var n;t===void 0&&(t={});const{x:i,y:o,platform:s,rects:r,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:g=!1,padding:d=0}=st(t,e),u=Bt(d),m=c[g?f==="floating"?"reference":"floating":f],x=ot(yield s.getClippingRect({element:(n=yield s.isElement==null?void 0:s.isElement(m))==null||n?m:m.contextElement||(yield s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:h,strategy:a})),b=f==="floating"?{x:i,y:o,width:r.floating.width,height:r.floating.height}:r.reference,v=yield s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating),S=(yield s.isElement==null?void 0:s.isElement(v))?(yield s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},_=ot(s.convertOffsetParentRelativeRectToViewportRelativeRect?yield s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:v,strategy:a}):b);return{top:(x.top-_.top+u.top)/S.y,bottom:(_.bottom-x.bottom+u.bottom)/S.y,left:(x.left-_.left+u.left)/S.x,right:(_.right-x.right+u.right)/S.x}})}const le=e=>({name:"arrow",options:e,fn(n){return A(this,null,function*(){const{x:i,y:o,placement:s,rects:r,platform:c,elements:a,middlewareData:l}=n,{element:h,padding:f=0}=st(e,n)||{};if(h==null)return{};const g=Bt(f),d={x:i,y:o},u=wt(s),p=xt(u),m=yield c.getDimensions(h),x=u==="y",b=x?"top":"left",v=x?"bottom":"right",S=x?"clientHeight":"clientWidth",_=r.reference[p]+r.reference[u]-d[u]-r.floating[p],w=d[u]-r.reference[u],L=yield c.getOffsetParent==null?void 0:c.getOffsetParent(h);let P=L?L[S]:0;(!P||!(yield c.isElement==null?void 0:c.isElement(L)))&&(P=a.floating[S]||r.floating[p]);const I=_/2-w/2,F=P/2-m[p]/2-1,z=Z(g[b],F),C=Z(g[v],F),O=z,tt=P-m[p]-C,H=P/2-m[p]/2+I,at=ee(O,H,tt),ft=!l.arrow&&M(s)!=null&&H!==at&&r.reference[p]/2-(H<O?z:C)-m[p]/2<0,ht=ft?H<O?H-O:H-tt:0;return{[u]:d[u]+ht,data:$({[u]:at,centerOffset:H-at-ht},ft&&{alignmentOffset:ht}),reset:ft}})}});function ae(e,t,n){return(e?[...n.filter(o=>M(o)===e),...n.filter(o=>M(o)!==e)]:n.filter(o=>J(o)===o)).filter(o=>e?M(o)===e||(t?oe(o)!==o:!1):!0)}const fe=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,fn(n){return A(this,null,function*(){var i,o,s;const{rects:r,middlewareData:c,placement:a,platform:l,elements:h}=n,z=st(e,n),{crossAxis:f=!1,alignment:g,allowedPlacements:d=Et,autoAlignment:u=!0}=z,p=Pt(z,["crossAxis","alignment","allowedPlacements","autoAlignment"]),m=g!==void 0||d===Et?ae(g||null,u,d):d,x=yield ce(n,p),b=((i=c.autoPlacement)==null?void 0:i.index)||0,v=m[b];if(v==null)return{};const S=ie(v,r,yield l.isRTL==null?void 0:l.isRTL(h.floating));if(a!==v)return{reset:{placement:m[0]}};const _=[x[J(v)],x[S[0]],x[S[1]]],w=[...((o=c.autoPlacement)==null?void 0:o.overflows)||[],{placement:v,overflows:_}],L=m[b+1];if(L)return{data:{index:b+1,overflows:w},reset:{placement:L}};const P=w.map(C=>{const O=M(C.placement);return[C.placement,O&&f?C.overflows.slice(0,2).reduce((tt,H)=>tt+H,0):C.overflows[0],C.overflows]}).sort((C,O)=>C[1]-O[1]),F=((s=P.filter(C=>C[2].slice(0,M(C[0])?2:3).every(O=>O<=0))[0])==null?void 0:s[0])||P[0][0];return F!==a?{data:{index:b+1,overflows:w},reset:{placement:F}}:{}})}}};function he(e,t){return A(this,null,function*(){const{placement:n,platform:i,elements:o}=e,s=yield i.isRTL==null?void 0:i.isRTL(o.floating),r=J(n),c=M(n),a=yt(n)==="y",l=["left","top"].includes(r)?-1:1,h=s&&a?-1:1,f=st(t,e);let{mainAxis:g,crossAxis:d,alignmentAxis:u}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof u=="number"&&(d=c==="end"?u*-1:u),a?{x:d*h,y:g*l}:{x:g*l,y:d*h}})}const de=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return A(this,null,function*(){var i,o;const{x:s,y:r,placement:c,middlewareData:a}=n,l=yield he(n,e);return c===((i=a.offset)==null?void 0:i.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:s+l.x,y:r+l.y,data:X($({},l),{placement:c})}})}}};function rt(){return typeof window!="undefined"}function K(e){return Ft(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function W(e){var t;return(t=(Ft(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ft(e){return rt()?e instanceof Node||e instanceof R(e).Node:!1}function D(e){return rt()?e instanceof Element||e instanceof R(e).Element:!1}function B(e){return rt()?e instanceof HTMLElement||e instanceof R(e).HTMLElement:!1}function $t(e){return!rt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof R(e).ShadowRoot}function Q(e){const{overflow:t,overflowX:n,overflowY:i,display:o}=k(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(o)}function ue(e){return["table","td","th"].includes(K(e))}function ct(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function vt(e){const t=_t(),n=D(e)?k(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function ge(e){let t=j(e);for(;B(t)&&!U(t);){if(vt(t))return t;if(ct(t))return null;t=j(t)}return null}function _t(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function U(e){return["html","body","#document"].includes(K(e))}function k(e){return R(e).getComputedStyle(e)}function lt(e){return D(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function j(e){if(K(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$t(e)&&e.host||W(e);return $t(t)?t.host:t}function Ht(e){const t=j(e);return U(t)?e.ownerDocument?e.ownerDocument.body:e.body:B(t)&&Q(t)?t:Ht(t)}function pt(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ht(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),r=R(o);if(s){const c=mt(r);return t.concat(r,r.visualViewport||[],Q(o)?o:[],c&&n?pt(c):[])}return t.concat(o,pt(o,[],n))}function mt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mt(e){const t=k(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=B(e),s=o?e.offsetWidth:n,r=o?e.offsetHeight:i,c=it(n)!==s||it(i)!==r;return c&&(n=s,i=r),{width:n,height:i,$:c}}function Vt(e){return D(e)?e:e.contextElement}function q(e){const t=Vt(e);if(!B(t))return N(1);const n=t.getBoundingClientRect(),{width:i,height:o,$:s}=Mt(t);let r=(s?it(n.width):n.width)/i,c=(s?it(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const pe=N(0);function Wt(e){const t=R(e);return!_t()||!t.visualViewport?pe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function me(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==R(e)?!1:t}function G(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Vt(e);let r=N(1);t&&(i?D(i)&&(r=q(i)):r=q(e));const c=me(s,n,i)?Wt(s):N(0);let a=(o.left+c.x)/r.x,l=(o.top+c.y)/r.y,h=o.width/r.x,f=o.height/r.y;if(s){const g=R(s),d=i&&D(i)?R(i):i;let u=g,p=mt(u);for(;p&&i&&d!==u;){const m=q(p),x=p.getBoundingClientRect(),b=k(p),v=x.left+(p.clientLeft+parseFloat(b.paddingLeft))*m.x,S=x.top+(p.clientTop+parseFloat(b.paddingTop))*m.y;a*=m.x,l*=m.y,h*=m.x,f*=m.y,a+=v,l+=S,u=R(p),p=mt(u)}}return ot({width:h,height:f,x:a,y:l})}function bt(e,t){const n=lt(e).scrollLeft;return t?t.left+n:G(W(e)).left+n}function It(e,t,n){n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=i.left+t.scrollLeft-(n?0:bt(e,i)),s=i.top+t.scrollTop;return{x:o,y:s}}function xe(e){let{elements:t,rect:n,offsetParent:i,strategy:o}=e;const s=o==="fixed",r=W(i),c=t?ct(t.floating):!1;if(i===r||c&&s)return n;let a={scrollLeft:0,scrollTop:0},l=N(1);const h=N(0),f=B(i);if((f||!f&&!s)&&((K(i)!=="body"||Q(r))&&(a=lt(i)),B(i))){const d=G(i);l=q(i),h.x=d.x+i.clientLeft,h.y=d.y+i.clientTop}const g=r&&!f&&!s?It(r,a,!0):N(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+h.x+g.x,y:n.y*l.y-a.scrollTop*l.y+h.y+g.y}}function ye(e){return Array.from(e.getClientRects())}function we(e){const t=W(e),n=lt(e),i=e.ownerDocument.body,o=Y(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),s=Y(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+bt(e);const c=-n.scrollTop;return k(i).direction==="rtl"&&(r+=Y(t.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:c}}function ve(e,t){const n=R(e),i=W(e),o=n.visualViewport;let s=i.clientWidth,r=i.clientHeight,c=0,a=0;if(o){s=o.width,r=o.height;const l=_t();(!l||l&&t==="fixed")&&(c=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:c,y:a}}function _e(e,t){const n=G(e,!0,t==="fixed"),i=n.top+e.clientTop,o=n.left+e.clientLeft,s=B(e)?q(e):N(1),r=e.clientWidth*s.x,c=e.clientHeight*s.y,a=o*s.x,l=i*s.y;return{width:r,height:c,x:a,y:l}}function At(e,t,n){let i;if(t==="viewport")i=ve(e,n);else if(t==="document")i=we(W(e));else if(D(t))i=_e(t,n);else{const o=Wt(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ot(i)}function zt(e,t){const n=j(e);return n===t||!D(n)||U(n)?!1:k(n).position==="fixed"||zt(n,t)}function be(e,t){const n=t.get(e);if(n)return n;let i=pt(e,[],!1).filter(c=>D(c)&&K(c)!=="body"),o=null;const s=k(e).position==="fixed";let r=s?j(e):e;for(;D(r)&&!U(r);){const c=k(r),a=vt(r);!a&&c.position==="fixed"&&(o=null),(s?!a&&!o:!a&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Q(r)&&!a&&zt(e,r))?i=i.filter(h=>h!==r):o=c,r=j(r)}return t.set(e,i),i}function Se(e){let{element:t,boundary:n,rootBoundary:i,strategy:o}=e;const r=[...n==="clippingAncestors"?ct(t)?[]:be(t,this._c):[].concat(n),i],c=r[0],a=r.reduce((l,h)=>{const f=At(t,h,o);return l.top=Y(f.top,l.top),l.right=Z(f.right,l.right),l.bottom=Z(f.bottom,l.bottom),l.left=Y(f.left,l.left),l},At(t,c,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Ce(e){const{width:t,height:n}=Mt(e);return{width:t,height:n}}function Le(e,t,n){const i=B(t),o=W(t),s=n==="fixed",r=G(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=N(0);if(i||!i&&!s)if((K(t)!=="body"||Q(o))&&(c=lt(t)),i){const g=G(t,!0,s,t);a.x=g.x+t.clientLeft,a.y=g.y+t.clientTop}else o&&(a.x=bt(o));const l=o&&!i&&!s?It(o,c):N(0),h=r.left+c.scrollLeft-a.x-l.x,f=r.top+c.scrollTop-a.y-l.y;return{x:h,y:f,width:r.width,height:r.height}}function ut(e){return k(e).position==="static"}function Dt(e,t){if(!B(e)||k(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return W(e)===n&&(n=n.ownerDocument.body),n}function jt(e,t){const n=R(e);if(ct(e))return n;if(!B(e)){let o=j(e);for(;o&&!U(o);){if(D(o)&&!ut(o))return o;o=j(o)}return n}let i=Dt(e,t);for(;i&&ue(i)&&ut(i);)i=Dt(i,t);return i&&U(i)&&ut(i)&&!vt(i)?n:i||ge(e)||n}const Pe=function(e){return A(this,null,function*(){const t=this.getOffsetParent||jt,n=this.getDimensions,i=yield n(e.floating);return{reference:Le(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}})};function Te(e){return k(e).direction==="rtl"}const Ee={convertOffsetParentRelativeRectToViewportRelativeRect:xe,getDocumentElement:W,getClippingRect:Se,getOffsetParent:jt,getElementRects:Pe,getClientRects:ye,getDimensions:Ce,getScale:q,isElement:D,isRTL:Te},Re=de,Oe=fe,$e=le,Ae=(e,t,n)=>{const i=new Map,o=$({platform:Ee},n),s=X($({},o.platform),{_c:i});return re(e,t,X($({},o),{platform:s}))};function V(e){return e===null||typeof e=="undefined"}function E(e){return!V(e)}function kt(e){return new Promise(t=>setTimeout(t,e))}function Yt(e){var i;const t=e.parentElement;return!t||t.nodeName==="HTML"?!1:((i=document.defaultView)==null?void 0:i.getComputedStyle(e,null).getPropertyValue("position"))==="fixed"?!0:Yt(t)}function qt(e){return Yt(e)?"fixed":"absolute"}class De{renderContent(t,n,i){t.querySelector(`.${i.classPrefix}-content`).appendChild(n.node)}}function T(e,t){const n=document.createElement(e);return t&&t.length>0&&(t=t.filter(i=>i),n.classList.add(...t)),n}class ke{renderContent(t,n,i){var s,r,c,a;const o=t.querySelector(`.${i.classPrefix}-content`);if(n.imgSrc){const l=T("img",[`${i.classPrefix}-image`,`${(r=(s=n.customization)==null?void 0:s.imageClass)!=null?r:""}`]);l.src=n.imgSrc,o.appendChild(l)}if(n.text){const l=T("p",[`${i.classPrefix}-description`,`${(a=(c=n.customization)==null?void 0:c.descriptionClass)!=null?a:""}`]);l.innerHTML=i.translateFn(n.text),o.appendChild(l)}}}function Ne(e,t,n){var c,a,l,h,f,g,d,u,p,m,x,b,v,S,_;if(e.innerHTML="",e.className=`${(c=n.config.class)!=null?c:""} ${n.config.classPrefix} ${n.config.animationClass}`,!n.config.arrow.disable&&((a=n.activeStep)!=null&&a.hasHost)){const w=T("div",[(l=n.config.arrow.class)!=null?l:"",`${n.config.classPrefix}-arrow`]);e.appendChild(w)}(h=t.customization)!=null&&h.class&&e.classList.add(t.customization.class);const i=T("div",[`${n.config.classPrefix}-header`,`${(g=(f=t.customization)==null?void 0:f.headerClass)!=null?g:""}`]);e.appendChild(i);const o=T("h1",[`${n.config.classPrefix}-title`,`${(u=(d=t.customization)==null?void 0:d.titleClass)!=null?u:""}`]);o.innerHTML=n.config.translateFn((p=t.title)!=null?p:""),i.appendChild(o),n.config.close.button&&(n.config.closeIcon.onclick=n.complete.bind(n),i.appendChild(n.config.closeIcon));const s=T("div",[`${n.config.classPrefix}-content`,`${(x=(m=t.customization)==null?void 0:m.contentClass)!=null?x:""}`]);e.appendChild(s);const r=T("div",[`${n.config.classPrefix}-footer`,`${(v=(b=t.customization)==null?void 0:b.footerClass)!=null?v:""}`]);if(V(t.buttonList)&&(t.buttonList=Be(n)),t.buttonList.forEach(w=>{var I;const L=[`${n.config.classPrefix}-button`,(I=w.class)!=null?I:""];V(w.type)||w.type==="secondary"?L.push(`${n.config.classPrefix}-button-secondary`):w.type==="primary"?L.push(`${n.config.classPrefix}-button-primary`):w.type==="link"&&L.push(`${n.config.classPrefix}-button-link`),!V(w.class)&&w.class!==""&&L.push(w.class);const P=T("button",L);P.innerHTML=n.config.translateFn(w.text),P.onclick=F=>{w.action.call(n)},r.appendChild(P)}),!n.config.progress.disable&&n.config.progress.text&&E(n.activeStepIndex)){const w=T("p",[`${n.config.classPrefix}-progress`,`${(_=(S=t.customization)==null?void 0:S.progressClass)!=null?_:""}`]);w.innerHTML=n.config.translateFn(Fe(n.config.progress.text,n.activeStepIndex+1,n.stepList.length)),r.appendChild(w)}e.appendChild(r)}function Be(e){return[{text:"Back",action:e.prev},{text:"Next",type:"primary",action:e.next}]}function Fe(e,t,n){return e.replace("{{currentStep}}",t.toString()).replace("{{totalSteps}}",n.toString())}class He{constructor(){y(this,"_renderContentStrategy",new Map);y(this,"_staticSides",{top:"bottom",right:"left",bottom:"top",left:"right"});this.setUpStrategies()}render(t,n){return new Promise(i=>{var o,s;if(!this._renderContentStrategy.has(n.popupData.type))throw new Error("Missing popup creator strategy");t.style.display="none",t.classList.remove(n.tour.config.animationClass),n.hostElement?t.style.position=qt(n.hostElement):t.style.position="fixed",Ne(t,n.popupData,n.tour),(o=this._renderContentStrategy.get(n.popupData.type))==null||o.renderContent(t,n.popupData,n.tour.config),(s=n.hostElement)==null||s.scrollIntoView(n.tour.config.scrollTo),i()}).then(()=>n.isFirst&&n.direction==="toNext"?kt(0):kt(400)).then(()=>{t.style.display="flex",this.updatePosition(t,n),t.classList.add(n.tour.config.animationClass)})}updatePosition(t,n){E(n.hostElement)?this.renderFloatingPopup(t,n):this.renderCenterPopup(t)}renderFloatingPopup(t,n){var l;const i=t.style.position==="fixed"?window.scrollY||document.documentElement.scrollTop:0,o=t.querySelector(`.${n.tour.config.classPrefix}-arrow`),s=[],r=E(n.popupData.position)&&n.popupData.position!=="auto"?n.popupData.position:void 0,c=(l=o==null?void 0:o.offsetWidth)!=null?l:10,a=Math.sqrt(2*Lt(c,2))/2+n.tour.config.highlight.padding;s.push(Re(a)),(n.popupData.position==="auto"||V(r))&&s.push(Oe()),!n.tour.config.arrow.disable&&E(o)&&s.push($e({element:o})),Ae(n.hostElement,t,{placement:r,middleware:[...s]}).then(({x:h,y:f,middlewareData:g,placement:d})=>{Object.assign(t.style,{top:`${f-i}px`,left:`${h}px`,marginTop:"0",marginLeft:"0"});const u=d.split("-")[0],p=this._staticSides[u];if(g.arrow&&E(o)){const{x:m,y:x}=g.arrow;Object.assign(o.style,{left:m!=null?`${m}px`:"",top:x!=null?`${x}px`:"",right:"",bottom:"",[p]:`${-c/2}px`,transform:"rotate(45deg)"})}})}renderCenterPopup(t){Object.assign(t.style,{top:"50%",left:"50%",marginTop:`-${t.clientHeight/2}px`,marginLeft:`-${t.clientWidth/2}px`})}setUpStrategies(){this._renderContentStrategy.set("text",new ke),this._renderContentStrategy.set("custom",new De)}}class Nt{render(t,n){return new Promise(i=>{n.hostElement&&(t.style.position=qt(n.hostElement)),i()}).then(()=>{this.updatePosition(t,n)})}updatePosition(t,n){var r,c;if(!n.hostElement){t.style.width="0",t.style.height="0",t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",t.style.opacity="0";return}const i=n.hostElement.getBoundingClientRect(),o=(c=(r=n.tour.config.highlight)==null?void 0:r.padding)!=null?c:8,s=t.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;t.style.transform="",t.style.left=`${i.left-o}px`,t.style.top=`${i.top+s-o}px`,t.style.width=`${i.width+2*o}px`,t.style.height=`${i.height+2*o}px`,t.style.opacity="1"}}class Ut{constructor(t,n){y(this,"popupData");y(this,"tour");y(this,"_index");y(this,"_hostElement",null);y(this,"_direction","toNext");y(this,"_hostData");y(this,"_popupRenderer");y(this,"_highlightRenderer");y(this,"_intersectionRenderer");var i;this.popupData=n.popup,this.tour=t,this._index=(i=n.index)!=null?i:null,this._hostData=n.host,this._popupRenderer=t.popupRenderer,this._highlightRenderer=t.highlightRenderer,this._intersectionRenderer=t.intersectionRenderer}get isFirst(){return this._index===0}get nextStep(){var t;return(t=this.tour.stepList[this.tour.stepList.indexOf(this)+1])!=null?t:null}get prevStep(){var t;return(t=this.tour.stepList[this.tour.stepList.indexOf(this)-1])!=null?t:null}get direction(){return this._direction}get hasHost(){return E(this._hostElement)}get hostElement(){return this._hostElement}get index(){return this._index}set index(t){this._index=t}show(t){return A(this,null,function*(){var i;if(V(this.tour.popup))return;this._direction=t,this._hostData&&(this._hostElement=this.resolveHostElement(typeof this._hostData=="function"?this._hostData():(i=this._hostData)!=null?i:null));const n=[this._popupRenderer.render(this.tour.popup,this)];!this.tour.config.interaction.disable&&E(this.tour.intersection)&&n.push(this._intersectionRenderer.render(this.tour.intersection,this)),!this.tour.config.highlight.disable&&!V(this.tour.highlight)&&n.push(this._highlightRenderer.render(this.tour.highlight,this)),this.tour.config.highlight.disable&&E(this.tour.highlight)&&this._highlightRenderer.render(this.tour.highlight,{}),yield Promise.all(n),this.toggleZIndex(!0)})}hide(){return A(this,null,function*(){this.toggleZIndex(!1)})}toggleZIndex(t){V(this._hostElement)||(t?this._hostElement.classList.add("siteguide-host"):this._hostElement.classList.remove("siteguide-host"))}resolveHostElement(t){return typeof this._hostData=="string"?document.querySelector(this._hostData):t}}function gt(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Kt(e,t){const n=$({},e);return gt(e)&>(t)&&Object.keys(t).forEach(i=>{const o=i,s=i;gt(t[o])?(s in e||Object.assign(n,{[s]:{}}),n[s]=Kt(e[s],t[o])):Object.assign(n,{[s]:t[o]})}),n}function Me(e){const t=T("button",[`${e}-close`]);return t.innerHTML="✖",t}class Ve{constructor(){y(this,"_activeTour",null)}get isActive(){return E(this.activeTour)}get activeTour(){return this._activeTour}setActiveTour(t){this._activeTour=t}}const nt=new Ve;class We{constructor(t){y(this,"popupRenderer",new He);y(this,"highlightRenderer",new Nt);y(this,"intersectionRenderer",new Nt);y(this,"_popup",null);y(this,"_highlight",null);y(this,"_intersection",null);y(this,"_stepList",[]);y(this,"_activeStep",null);y(this,"_bodyResizeObserver");y(this,"_config");y(this,"closeOnEsc",t=>{t.key==="Escape"&&this.complete()});y(this,"keyboardControl",t=>{t.key==="ArrowRight"?this.next():t.key==="ArrowLeft"&&this.prev()});var n,i,o,s,r,c,a,l,h,f,g,d,u,p,m,x,b,v,S,_,w,L,P,I,F,z,C;this._bodyResizeObserver=this.getBodyResizeObserver(),this._config={classPrefix:(n=t.classPrefix)!=null?n:"siteguide",class:"",animationClass:(i=t.animationClass)!=null?i:"siteguide-animation",close:{button:(s=(o=t.close)==null?void 0:o.button)!=null?s:!0,clickout:(c=(r=t.close)==null?void 0:r.clickout)!=null?c:!1,esc:(l=(a=t.close)==null?void 0:a.esc)!=null?l:!0},scrollTo:(h=t.scrollTo)!=null?h:{behavior:"smooth",block:"center",inline:"center"},closeIcon:(g=t.closeIcon)!=null?g:Me((f=t.classPrefix)!=null?f:"siteguide"),arrow:{disable:(u=(d=t.arrow)==null?void 0:d.disable)!=null?u:!1,class:(m=(p=t.arrow)==null?void 0:p.class)!=null?m:""},highlight:{disable:(b=(x=t.highlight)==null?void 0:x.disable)!=null?b:!1,padding:(S=(v=t.highlight)==null?void 0:v.padding)!=null?S:8,class:(w=(_=t.highlight)==null?void 0:_.class)!=null?w:""},progress:{disable:(P=(L=t.progress)==null?void 0:L.disable)!=null?P:!0,text:"Step {{currentStep}} of {{totalSteps}}"},interaction:{disable:(F=(I=t.interaction)==null?void 0:I.disable)!=null?F:!1},keyboardControl:(z=t.keyboardControl)!=null?z:!1,translateFn:(C=t.translateFn)!=null?C:O=>O}}get stepList(){return this._stepList}get config(){return this._config}get popup(){return this._popup}get highlight(){return this._highlight}get intersection(){return this._intersection}get activeStep(){return this._activeStep}get activeStepIndex(){return this._activeStep?this.stepList.indexOf(this._activeStep):null}addStep(t){if(V(t.index)){const i=this._stepList.reduce((o,s)=>s.index!==null&&s.index!==void 0&&s.index>o?s.index:o,-1);t.index=i+1}const n=new Ut(this,t);this._stepList.push(n),this._stepList.sort((i,o)=>i.index-o.index)}addSteps(t){t.forEach(n=>this.addStep(n))}removeStep(t){this._stepList=this._stepList.filter(n=>t!==n.index)}start(){nt.isActive||(this.config.close.esc&&document.addEventListener("keydown",this.closeOnEsc),this.config.keyboardControl&&document.addEventListener("keydown",this.keyboardControl),nt.setActiveTour(this),this._popup=T("div",[this._config.classPrefix]),document.body.appendChild(this._popup),this._config.highlight.disable||(this._highlight=T("div",[this._config.highlight.class,`${this._config.classPrefix}-highlight`]),document.body.appendChild(this._highlight)),this._config.interaction.disable||(this._intersection=T("div",["siteguide-intersection"]),document.body.appendChild(this._intersection)),this.next())}complete(){var t;this._popup&&document.body.removeChild(this._popup),this._highlight&&document.body.removeChild(this._highlight),(t=this._activeStep)==null||t.hide(),this._activeStep=null,nt.setActiveTour(null),this.config.close.esc&&document.removeEventListener("keydown",this.closeOnEsc),this.config.keyboardControl&&document.removeEventListener("keydown",this.keyboardControl)}prev(){const t=E(this._activeStep)?this._stepList.indexOf(this._activeStep)-1:this._stepList.indexOf(this._stepList[this._stepList.length-1]);if(t<0){this.complete();return}this.changeStepTo(t,"fromBack")}next(){return A(this,null,function*(){var n,i,o;const t=E(this._activeStep)?this._stepList.indexOf(this._activeStep)+1:this._stepList.indexOf(this._stepList[0]);if(t>=this._stepList.length){this.complete();return}E((n=this._activeStep)==null?void 0:n.popupData.allowNext)&&!((o=yield(i=this._activeStep)==null?void 0:i.popupData.allowNext.call(this))==null||o)||this.changeStepTo(t,"toNext")})}goTo(t){var n;if(t>this._stepList.length-1){console.error("Provided index was larger than steps amount");return}this.changeStepTo(t,t>((n=this.activeStepIndex)!=null?n:-1)?"toNext":"fromBack")}setConfig(t){this._config=Kt(this._config,t)}changeStepTo(t,n){var i;(i=this._activeStep)==null||i.hide(),this._activeStep=this._stepList[t],this._activeStep.show(n)}getBodyResizeObserver(){const t=new ResizeObserver(()=>{this._activeStep&&(E(this._popup)&&this.popupRenderer.updatePosition(this._popup,this._activeStep),E(this._highlight)&&!this.config.highlight.disable&&this.highlightRenderer.updatePosition(this._highlight,this._activeStep))});return t.observe(document.body),t}}const Ie=nt;exports.Siteguide=Ie;exports.Tour=We;exports.TourStep=Ut;exports.createElement=T;
|
package/dist/index.mjs
CHANGED
|
@@ -1087,7 +1087,7 @@ class He {
|
|
|
1087
1087
|
typeof this._hostData == "function" ? this._hostData() : (i = this._hostData) != null ? i : null
|
|
1088
1088
|
));
|
|
1089
1089
|
const n = [this._popupRenderer.render(this.tour.popup, this)];
|
|
1090
|
-
this.tour.config.
|
|
1090
|
+
!this.tour.config.interaction.disable && T(this.tour.intersection) && n.push(this._intersectionRenderer.render(this.tour.intersection, this)), !this.tour.config.highlight.disable && !V(this.tour.highlight) && n.push(this._highlightRenderer.render(this.tour.highlight, this)), this.tour.config.highlight.disable && T(this.tour.highlight) && this._highlightRenderer.render(this.tour.highlight, {}), yield Promise.all(n), this.toggleZIndex(!0);
|
|
1091
1091
|
});
|
|
1092
1092
|
}
|
|
1093
1093
|
hide() {
|
|
@@ -1180,8 +1180,8 @@ class Ie {
|
|
|
1180
1180
|
disable: (P = (L = t.progress) == null ? void 0 : L.disable) != null ? P : !0,
|
|
1181
1181
|
text: "Step {{currentStep}} of {{totalSteps}}"
|
|
1182
1182
|
},
|
|
1183
|
-
|
|
1184
|
-
disable: (F = (I = t.
|
|
1183
|
+
interaction: {
|
|
1184
|
+
disable: (F = (I = t.interaction) == null ? void 0 : I.disable) != null ? F : !1
|
|
1185
1185
|
},
|
|
1186
1186
|
keyboardControl: (z = t.keyboardControl) != null ? z : !1,
|
|
1187
1187
|
translateFn: (C = t.translateFn) != null ? C : (O) => O
|
|
@@ -1226,7 +1226,7 @@ class Ie {
|
|
|
1226
1226
|
nt.isActive || (this.config.close.esc && document.addEventListener("keydown", this.closeOnEsc), this.config.keyboardControl && document.addEventListener("keydown", this.keyboardControl), nt.setActiveTour(this), this._popup = E("div", [this._config.classPrefix]), document.body.appendChild(this._popup), this._config.highlight.disable || (this._highlight = E("div", [
|
|
1227
1227
|
this._config.highlight.class,
|
|
1228
1228
|
`${this._config.classPrefix}-highlight`
|
|
1229
|
-
]), document.body.appendChild(this._highlight)), this._config.
|
|
1229
|
+
]), document.body.appendChild(this._highlight)), this._config.interaction.disable || (this._intersection = E("div", ["siteguide-intersection"]), document.body.appendChild(this._intersection)), this.next());
|
|
1230
1230
|
}
|
|
1231
1231
|
complete() {
|
|
1232
1232
|
var t;
|
package/package.json
CHANGED