siteguide.js 0.10.0 → 0.10.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 +5 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +181 -179
- package/package.json +71 -71
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Gt=Object.defineProperty,Jt=Object.defineProperties;var Qt=Object.getOwnPropertyDescriptors;var st=Object.getOwnPropertySymbols;var Et=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable;var Pt=Math.pow,ut=(i,e,t)=>e in i?Gt(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,$=(i,e)=>{for(var t in e||(e={}))Et.call(e,t)&&ut(i,t,e[t]);if(st)for(var t of st(e))Tt.call(e,t)&&ut(i,t,e[t]);return i},Z=(i,e)=>Jt(i,Qt(e));var Lt=(i,e)=>{var t={};for(var n in i)Et.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&st)for(var n of st(i))e.indexOf(n)<0&&Tt.call(i,n)&&(t[n]=i[n]);return t};var y=(i,e,t)=>ut(i,typeof e!="symbol"?e+"":e,t);var A=(i,e,t)=>new Promise((n,s)=>{var r=a=>{try{c(t.next(a))}catch(l){s(l)}},o=a=>{try{c(t.throw(a))}catch(l){s(l)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(r,o);c((t=t.apply(i,e)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Zt=["top","right","bottom","left"],Ot=["start","end"],Rt=Zt.reduce((i,e)=>i.concat(e,e+"-"+Ot[0],e+"-"+Ot[1]),[]),tt=Math.min,X=Math.max,rt=Math.round,F=i=>({x:i,y:i}),te={left:"right",right:"left",bottom:"top",top:"bottom"},ee={start:"end",end:"start"};function ie(i,e,t){return X(i,tt(e,t))}function lt(i,e){return typeof i=="function"?i(e):i}function it(i){return i.split("-")[0]}function V(i){return i.split("-")[1]}function ne(i){return i==="x"?"y":"x"}function yt(i){return i==="y"?"height":"width"}function xt(i){return["top","bottom"].includes(it(i))?"y":"x"}function wt(i){return ne(xt(i))}function se(i,e,t){t===void 0&&(t=!1);const n=V(i),s=wt(i),r=yt(s);let o=s==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=kt(o)),[o,kt(o)]}function oe(i){return i.replace(/start|end/g,e=>ee[e])}function kt(i){return i.replace(/left|right|bottom|top/g,e=>te[e])}function re(i){return $({top:0,right:0,bottom:0,left:0},i)}function Ft(i){return typeof i!="number"?re(i):{top:i,right:i,bottom:i,left:i}}function ct(i){const{x:e,y:t,width:n,height:s}=i;return{width:n,height:s,top:t,left:e,right:e+n,bottom:t+s,x:e,y:t}}function $t(i,e,t){let{reference:n,floating:s}=i;const r=xt(e),o=wt(e),c=yt(o),a=it(e),l=r==="y",f=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,g=n[c]/2-s[c]/2;let u;switch(a){case"top":u={x:f,y:n.y-s.height};break;case"bottom":u={x:f,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:h};break;case"left":u={x:n.x-s.width,y:h};break;default:u={x:n.x,y:n.y}}switch(V(e)){case"start":u[o]-=g*(t&&l?-1:1);break;case"end":u[o]+=g*(t&&l?-1:1);break}return u}const ce=(i,e,t)=>A(exports,null,function*(){const{placement:n="bottom",strategy:s="absolute",middleware:r=[],platform:o}=t,c=r.filter(Boolean),a=yield o.isRTL==null?void 0:o.isRTL(e);let l=yield o.getElementRects({reference:i,floating:e,strategy:s}),{x:f,y:h}=$t(l,n,a),g=n,u={},d=0;for(let p=0;p<c.length;p++){const{name:m,fn:x}=c[p],{x:S,y:v,data:C,reset:_}=yield x({x:f,y:h,initialPlacement:n,placement:g,strategy:s,middlewareData:u,rects:l,platform:o,elements:{reference:i,floating:e}});f=S!=null?S:f,h=v!=null?v:h,u=Z($({},u),{[m]:$($({},u[m]),C)}),_&&d<=50&&(d++,typeof _=="object"&&(_.placement&&(g=_.placement),_.rects&&(l=_.rects===!0?yield o.getElementRects({reference:i,floating:e,strategy:s}):_.rects),{x:f,y:h}=$t(l,g,a)),p=-1)}return{x:f,y:h,placement:g,strategy:s,middlewareData:u}});function le(i,e){return A(this,null,function*(){var t;e===void 0&&(e={});const{x:n,y:s,platform:r,rects:o,elements:c,strategy:a}=i,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:g=!1,padding:u=0}=lt(e,i),d=Ft(u),m=c[g?h==="floating"?"reference":"floating":h],x=ct(yield r.getClippingRect({element:(t=yield r.isElement==null?void 0:r.isElement(m))==null||t?m:m.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:l,rootBoundary:f,strategy:a})),S=h==="floating"?{x:n,y:s,width:o.floating.width,height:o.floating.height}:o.reference,v=yield r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating),C=(yield r.isElement==null?void 0:r.isElement(v))?(yield r.getScale==null?void 0:r.getScale(v))||{x:1,y:1}:{x:1,y:1},_=ct(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:S,offsetParent:v,strategy:a}):S);return{top:(x.top-_.top+d.top)/C.y,bottom:(_.bottom-x.bottom+d.bottom)/C.y,left:(x.left-_.left+d.left)/C.x,right:(_.right-x.right+d.right)/C.x}})}const ae=i=>({name:"arrow",options:i,fn(t){return A(this,null,function*(){const{x:n,y:s,placement:r,rects:o,platform:c,elements:a,middlewareData:l}=t,{element:f,padding:h=0}=lt(i,t)||{};if(f==null)return{};const g=Ft(h),u={x:n,y:s},d=wt(r),p=yt(d),m=yield c.getDimensions(f),x=d==="y",S=x?"top":"left",v=x?"bottom":"right",C=x?"clientHeight":"clientWidth",_=o.reference[p]+o.reference[d]-u[d]-o.floating[p],w=u[d]-o.reference[d],E=yield c.getOffsetParent==null?void 0:c.getOffsetParent(f);let P=E?E[C]:0;(!P||!(yield c.isElement==null?void 0:c.isElement(E)))&&(P=a.floating[C]||o.floating[p]);const W=_/2-w/2,N=P/2-m[p]/2-1,I=tt(g[S],N),T=tt(g[v],N),O=I,Y=P-m[p]-T,k=P/2-m[p]/2+W,q=ie(O,k,Y),U=!l.arrow&&V(r)!=null&&k!==q&&o.reference[p]/2-(k<O?I:T)-m[p]/2<0,K=U?k<O?k-O:k-Y:0;return{[d]:u[d]+K,data:$({[d]:q,centerOffset:k-q-K},U&&{alignmentOffset:K}),reset:U}})}});function he(i,e,t){return(i?[...t.filter(s=>V(s)===i),...t.filter(s=>V(s)!==i)]:t.filter(s=>it(s)===s)).filter(s=>i?V(s)===i||(e?oe(s)!==s:!1):!0)}const fe=function(i){return i===void 0&&(i={}),{name:"autoPlacement",options:i,fn(t){return A(this,null,function*(){var n,s,r;const{rects:o,middlewareData:c,placement:a,platform:l,elements:f}=t,I=lt(i,t),{crossAxis:h=!1,alignment:g,allowedPlacements:u=Rt,autoAlignment:d=!0}=I,p=Lt(I,["crossAxis","alignment","allowedPlacements","autoAlignment"]),m=g!==void 0||u===Rt?he(g||null,d,u):u,x=yield le(t,p),S=((n=c.autoPlacement)==null?void 0:n.index)||0,v=m[S];if(v==null)return{};const C=se(v,o,yield l.isRTL==null?void 0:l.isRTL(f.floating));if(a!==v)return{reset:{placement:m[0]}};const _=[x[it(v)],x[C[0]],x[C[1]]],w=[...((s=c.autoPlacement)==null?void 0:s.overflows)||[],{placement:v,overflows:_}],E=m[S+1];if(E)return{data:{index:S+1,overflows:w},reset:{placement:E}};const P=w.map(T=>{const O=V(T.placement);return[T.placement,O&&h?T.overflows.slice(0,2).reduce((Y,k)=>Y+k,0):T.overflows[0],T.overflows]}).sort((T,O)=>T[1]-O[1]),N=((r=P.filter(T=>T[2].slice(0,V(T[0])?2:3).every(O=>O<=0))[0])==null?void 0:r[0])||P[0][0];return N!==a?{data:{index:S+1,overflows:w},reset:{placement:N}}:{}})}}};function ue(i,e){return A(this,null,function*(){const{placement:t,platform:n,elements:s}=i,r=yield n.isRTL==null?void 0:n.isRTL(s.floating),o=it(t),c=V(t),a=xt(t)==="y",l=["left","top"].includes(o)?-1:1,f=r&&a?-1:1,h=lt(e,i);let{mainAxis:g,crossAxis:u,alignmentAxis:d}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof d=="number"&&(u=c==="end"?d*-1:d),a?{x:u*f,y:g*l}:{x:g*l,y:u*f}})}const de=function(i){return i===void 0&&(i=0),{name:"offset",options:i,fn(t){return A(this,null,function*(){var n,s;const{x:r,y:o,placement:c,middlewareData:a}=t,l=yield ue(t,i);return c===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:Z($({},l),{placement:c})}})}}};function at(){return typeof window!="undefined"}function Q(i){return Mt(i)?(i.nodeName||"").toLowerCase():"#document"}function R(i){var e;return(i==null||(e=i.ownerDocument)==null?void 0:e.defaultView)||window}function z(i){var e;return(e=(Mt(i)?i.ownerDocument:i.document)||window.document)==null?void 0:e.documentElement}function Mt(i){return at()?i instanceof Node||i instanceof R(i).Node:!1}function B(i){return at()?i instanceof Element||i instanceof R(i).Element:!1}function M(i){return at()?i instanceof HTMLElement||i instanceof R(i).HTMLElement:!1}function At(i){return!at()||typeof ShadowRoot=="undefined"?!1:i instanceof ShadowRoot||i instanceof R(i).ShadowRoot}function nt(i){const{overflow:e,overflowX:t,overflowY:n,display:s}=H(i);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!["inline","contents"].includes(s)}function ge(i){return["table","td","th"].includes(Q(i))}function ht(i){return[":popover-open",":modal"].some(e=>{try{return i.matches(e)}catch(t){return!1}})}function bt(i){const e=vt(),t=B(i)?H(i):i;return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(t.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(t.contain||"").includes(n))}function pe(i){let e=j(i);for(;M(e)&&!J(e);){if(bt(e))return e;if(ht(e))return null;e=j(e)}return null}function vt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function J(i){return["html","body","#document"].includes(Q(i))}function H(i){return R(i).getComputedStyle(i)}function ft(i){return B(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function j(i){if(Q(i)==="html")return i;const e=i.assignedSlot||i.parentNode||At(i)&&i.host||z(i);return At(e)?e.host:e}function Nt(i){const e=j(i);return J(e)?i.ownerDocument?i.ownerDocument.body:i.body:M(e)&&nt(e)?e:Nt(e)}function pt(i,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);const s=Nt(i),r=s===((n=i.ownerDocument)==null?void 0:n.body),o=R(s);if(r){const c=mt(o);return e.concat(o,o.visualViewport||[],nt(s)?s:[],c&&t?pt(c):[])}return e.concat(s,pt(s,[],t))}function mt(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function Vt(i){const e=H(i);let t=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=M(i),r=s?i.offsetWidth:t,o=s?i.offsetHeight:n,c=rt(t)!==r||rt(n)!==o;return c&&(t=r,n=o),{width:t,height:n,$:c}}function zt(i){return B(i)?i:i.contextElement}function G(i){const e=zt(i);if(!M(e))return F(1);const t=e.getBoundingClientRect(),{width:n,height:s,$:r}=Vt(e);let o=(r?rt(t.width):t.width)/n,c=(r?rt(t.height):t.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const me=F(0);function Wt(i){const e=R(i);return!vt()||!e.visualViewport?me:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ye(i,e,t){return e===void 0&&(e=!1),!t||e&&t!==R(i)?!1:e}function et(i,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);const s=i.getBoundingClientRect(),r=zt(i);let o=F(1);e&&(n?B(n)&&(o=G(n)):o=G(i));const c=ye(r,t,n)?Wt(r):F(0);let a=(s.left+c.x)/o.x,l=(s.top+c.y)/o.y,f=s.width/o.x,h=s.height/o.y;if(r){const g=R(r),u=n&&B(n)?R(n):n;let d=g,p=mt(d);for(;p&&n&&u!==d;){const m=G(p),x=p.getBoundingClientRect(),S=H(p),v=x.left+(p.clientLeft+parseFloat(S.paddingLeft))*m.x,C=x.top+(p.clientTop+parseFloat(S.paddingTop))*m.y;a*=m.x,l*=m.y,f*=m.x,h*=m.y,a+=v,l+=C,d=R(p),p=mt(d)}}return ct({width:f,height:h,x:a,y:l})}function _t(i,e){const t=ft(i).scrollLeft;return e?e.left+t:et(z(i)).left+t}function It(i,e,t){t===void 0&&(t=!1);const n=i.getBoundingClientRect(),s=n.left+e.scrollLeft-(t?0:_t(i,n)),r=n.top+e.scrollTop;return{x:s,y:r}}function xe(i){let{elements:e,rect:t,offsetParent:n,strategy:s}=i;const r=s==="fixed",o=z(n),c=e?ht(e.floating):!1;if(n===o||c&&r)return t;let a={scrollLeft:0,scrollTop:0},l=F(1);const f=F(0),h=M(n);if((h||!h&&!r)&&((Q(n)!=="body"||nt(o))&&(a=ft(n)),M(n))){const u=et(n);l=G(n),f.x=u.x+n.clientLeft,f.y=u.y+n.clientTop}const g=o&&!h&&!r?It(o,a,!0):F(0);return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+f.x+g.x,y:t.y*l.y-a.scrollTop*l.y+f.y+g.y}}function we(i){return Array.from(i.getClientRects())}function be(i){const e=z(i),t=ft(i),n=i.ownerDocument.body,s=X(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=X(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+_t(i);const c=-t.scrollTop;return H(n).direction==="rtl"&&(o+=X(e.clientWidth,n.clientWidth)-s),{width:s,height:r,x:o,y:c}}function ve(i,e){const t=R(i),n=z(i),s=t.visualViewport;let r=n.clientWidth,o=n.clientHeight,c=0,a=0;if(s){r=s.width,o=s.height;const l=vt();(!l||l&&e==="fixed")&&(c=s.offsetLeft,a=s.offsetTop)}return{width:r,height:o,x:c,y:a}}function _e(i,e){const t=et(i,!0,e==="fixed"),n=t.top+i.clientTop,s=t.left+i.clientLeft,r=M(i)?G(i):F(1),o=i.clientWidth*r.x,c=i.clientHeight*r.y,a=s*r.x,l=n*r.y;return{width:o,height:c,x:a,y:l}}function Dt(i,e,t){let n;if(e==="viewport")n=ve(i,t);else if(e==="document")n=be(z(i));else if(B(e))n=_e(e,t);else{const s=Wt(i);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return ct(n)}function jt(i,e){const t=j(i);return t===e||!B(t)||J(t)?!1:H(t).position==="fixed"||jt(t,e)}function Se(i,e){const t=e.get(i);if(t)return t;let n=pt(i,[],!1).filter(c=>B(c)&&Q(c)!=="body"),s=null;const r=H(i).position==="fixed";let o=r?j(i):i;for(;B(o)&&!J(o);){const c=H(o),a=bt(o);!a&&c.position==="fixed"&&(s=null),(r?!a&&!s:!a&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||nt(o)&&!a&&jt(i,o))?n=n.filter(f=>f!==o):s=c,o=j(o)}return e.set(i,n),n}function Ce(i){let{element:e,boundary:t,rootBoundary:n,strategy:s}=i;const o=[...t==="clippingAncestors"?ht(e)?[]:Se(e,this._c):[].concat(t),n],c=o[0],a=o.reduce((l,f)=>{const h=Dt(e,f,s);return l.top=X(h.top,l.top),l.right=tt(h.right,l.right),l.bottom=tt(h.bottom,l.bottom),l.left=X(h.left,l.left),l},Dt(e,c,s));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Ee(i){const{width:e,height:t}=Vt(i);return{width:e,height:t}}function Te(i,e,t){const n=M(e),s=z(e),r=t==="fixed",o=et(i,!0,r,e);let c={scrollLeft:0,scrollTop:0};const a=F(0);if(n||!n&&!r)if((Q(e)!=="body"||nt(s))&&(c=ft(e)),n){const g=et(e,!0,r,e);a.x=g.x+e.clientLeft,a.y=g.y+e.clientTop}else s&&(a.x=_t(s));const l=s&&!n&&!r?It(s,c):F(0),f=o.left+c.scrollLeft-a.x-l.x,h=o.top+c.scrollTop-a.y-l.y;return{x:f,y:h,width:o.width,height:o.height}}function dt(i){return H(i).position==="static"}function Bt(i,e){if(!M(i)||H(i).position==="fixed")return null;if(e)return e(i);let t=i.offsetParent;return z(i)===t&&(t=t.ownerDocument.body),t}function Yt(i,e){const t=R(i);if(ht(i))return t;if(!M(i)){let s=j(i);for(;s&&!J(s);){if(B(s)&&!dt(s))return s;s=j(s)}return t}let n=Bt(i,e);for(;n&&ge(n)&&dt(n);)n=Bt(n,e);return n&&J(n)&&dt(n)&&!bt(n)?t:n||pe(i)||t}const Pe=function(i){return A(this,null,function*(){const e=this.getOffsetParent||Yt,t=this.getDimensions,n=yield t(i.floating);return{reference:Te(i.reference,yield e(i.floating),i.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}})};function Le(i){return H(i).direction==="rtl"}const Oe={convertOffsetParentRelativeRectToViewportRelativeRect:xe,getDocumentElement:z,getClippingRect:Ce,getOffsetParent:Yt,getElementRects:Pe,getClientRects:we,getDimensions:Ee,getScale:G,isElement:B,isRTL:Le},Re=de,ke=fe,$e=ae,Ae=(i,e,t)=>{const n=new Map,s=$({platform:Oe},t),r=Z($({},s.platform),{_c:n});return ce(i,e,Z($({},s),{platform:r}))};function D(i){return i===null||typeof i=="undefined"}function b(i){return!D(i)}function Ht(i){return new Promise(e=>setTimeout(e,i))}function qt(i){var n;const e=i.parentElement;return!e||e.nodeName==="HTML"?!1:((n=document.defaultView)==null?void 0:n.getComputedStyle(i,null).getPropertyValue("position"))==="fixed"?!0:qt(e)}function St(i){return qt(i)?"fixed":"absolute"}class De{renderContent(e,t,n){e.querySelector(`.${n.classPrefix}-content`).appendChild(t.node)}}function L(i,e){const t=document.createElement(i);return e&&e.length>0&&(e=e.filter(n=>n),t.classList.add(...e)),t}class Be{renderContent(e,t,n){var r,o,c,a;const s=e.querySelector(`.${n.classPrefix}-content`);if(t.imgSrc){const l=L("img",[`${n.classPrefix}-image`,`${(o=(r=t.customization)==null?void 0:r.imageClass)!=null?o:""}`]);l.src=t.imgSrc,s.appendChild(l)}if(t.text){const l=L("p",[`${n.classPrefix}-description`,`${(a=(c=t.customization)==null?void 0:c.descriptionClass)!=null?a:""}`]);l.innerHTML=n.translateFn(t.text),s.appendChild(l)}}}function He(i,e,t){var c,a,l,f,h,g,u,d,p,m,x,S,v,C,_;if(i.innerHTML="",i.className=`${(c=t.config.class)!=null?c:""} siteguide-pos ${t.config.classPrefix} ${t.config.animationClass}`,!t.config.arrow.disable&&((a=t.activeStep)!=null&&a.hasHost)){const w=L("div",[(l=t.config.arrow.class)!=null?l:"",`${t.config.classPrefix}-arrow`]);i.appendChild(w)}(f=e.customization)!=null&&f.class&&i.classList.add(e.customization.class);const n=L("div",[`${t.config.classPrefix}-header`,`${(g=(h=e.customization)==null?void 0:h.headerClass)!=null?g:""}`]);i.appendChild(n);const s=L("h1",[`${t.config.classPrefix}-title`,`${(d=(u=e.customization)==null?void 0:u.titleClass)!=null?d:""}`]);s.innerHTML=t.config.translateFn((p=e.title)!=null?p:""),n.appendChild(s),t.config.close.button&&(t.config.closeIcon.onclick=t.close.bind(t),n.appendChild(t.config.closeIcon));const r=L("div",[`${t.config.classPrefix}-content`,`${(x=(m=e.customization)==null?void 0:m.contentClass)!=null?x:""}`]);i.appendChild(r);const o=L("div",[`${t.config.classPrefix}-footer`,`${(v=(S=e.customization)==null?void 0:S.footerClass)!=null?v:""}`]);if(D(e.buttonList)&&(e.buttonList=Fe(t)),e.buttonList.forEach(w=>{var W;const E=[`${t.config.classPrefix}-button`,(W=w.class)!=null?W:""];D(w.type)||w.type==="secondary"?E.push(`${t.config.classPrefix}-button-secondary`):w.type==="primary"?E.push(`${t.config.classPrefix}-button-primary`):w.type==="link"&&E.push(`${t.config.classPrefix}-button-link`),!D(w.class)&&w.class!==""&&E.push(w.class);const P=L("button",E);P.innerHTML=t.config.translateFn(w.text),P.onclick=N=>{w.action.call(t)},o.appendChild(P)}),!t.config.progress.disable&&t.config.progress.text&&b(t.activeStepIndex)){const w=L("p",[`${t.config.classPrefix}-progress`,`${(_=(C=e.customization)==null?void 0:C.progressClass)!=null?_:""}`]),E=t.config.translateFn(t.config.progress.text);w.innerHTML=Me(E,t.activeStepIndex+1,t.stepList.length),o.appendChild(w)}i.appendChild(o)}function Fe(i){return[{text:i.config.buttons.prevText,action:i.prev},{text:i.config.buttons.nextText,type:"primary",action:i.next}]}function Me(i,e,t){return i.replace("{{currentStep}}",e.toString()).replace("{{totalSteps}}",t.toString())}class Ne{constructor(){y(this,"_renderContentStrategy",new Map);y(this,"_staticSides",{top:"bottom",right:"left",bottom:"top",left:"right"});this.setUpStrategies()}render(e,t){return new Promise(n=>{var s,r;if(!this._renderContentStrategy.has(t.popupData.type))throw new Error("Missing popup creator strategy");e.style.display="none",e.classList.remove(t.tour.config.animationClass),t.hostElement?e.style.position=St(t.hostElement):e.style.position="fixed",He(e,t.popupData,t.tour),(s=this._renderContentStrategy.get(t.popupData.type))==null||s.renderContent(e,t.popupData,t.tour.config),(r=t.hostElement)==null||r.scrollIntoView(t.tour.config.scrollTo),n()}).then(()=>t.isFirst&&t.direction==="toNext"?Ht(0):Ht(400)).then(()=>{e.style.display="flex",this.updatePosition(e,t),e.classList.add(t.tour.config.animationClass)})}updatePosition(e,t){b(t.hostElement)?this.renderFloatingPopup(e,t):this.renderCenterPopup(e)}renderFloatingPopup(e,t){var l;const n=e.style.position==="fixed"?window.scrollY||document.documentElement.scrollTop:0,s=e.querySelector(`.${t.tour.config.classPrefix}-arrow`),r=[],o=b(t.popupData.position)&&t.popupData.position!=="auto"?t.popupData.position:void 0,c=(l=s==null?void 0:s.offsetWidth)!=null?l:10,a=Math.sqrt(2*Pt(c,2))/2+t.tour.config.highlight.padding;r.push(Re(a)),(t.popupData.position==="auto"||D(o))&&r.push(ke()),!t.tour.config.arrow.disable&&b(s)&&r.push($e({element:s})),Ae(t.hostElement,e,{placement:o,middleware:[...r]}).then(({x:f,y:h,middlewareData:g,placement:u})=>{Object.assign(e.style,{top:`${h-n}px`,left:`${f}px`,marginTop:"0",marginLeft:"0"});const d=u.split("-")[0],p=this._staticSides[d];if(g.arrow&&b(s)){const{x:m,y:x}=g.arrow;Object.assign(s.style,{left:m!=null?`${m}px`:"",top:x!=null?`${x}px`:"",right:"",bottom:"",[p]:`${-c/2}px`,transform:"rotate(45deg)"})}})}renderCenterPopup(e){Object.assign(e.style,{top:"50%",left:"50%",marginTop:`-${e.clientHeight/2}px`,marginLeft:`-${e.clientWidth/2}px`})}setUpStrategies(){this._renderContentStrategy.set("text",new Be),this._renderContentStrategy.set("custom",new De)}}class Ve{render(e,t){return new Promise(n=>{t.hostElement&&(e.style.position=St(t.hostElement)),n()}).then(()=>{this.updatePosition(e,t)})}updatePosition(e,t){var o,c;if(!t.hostElement){e.style.width="0",e.style.height="0",e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)",e.style.opacity="0";return}const n=t.hostElement.getBoundingClientRect(),s=(c=(o=t.tour.config.highlight)==null?void 0:o.padding)!=null?c:8,r=e.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;e.style.transform="",e.style.left=`${n.left-s}px`,e.style.top=`${n.top+r-s}px`,e.style.width=`${n.width+2*s}px`,e.style.height=`${n.height+2*s}px`,e.style.opacity="1"}}class ze{render(e,t){return new Promise(n=>{t.hostElement&&(e.style.position=St(t.hostElement)),n()}).then(()=>{this.updatePosition(e,t)})}updatePosition(e,t){var o,c;if(!t.hostElement){e.style.width="0",e.style.height="0",e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)";return}const n=t.hostElement.getBoundingClientRect(),s=(c=(o=t.tour.config.highlight)==null?void 0:o.padding)!=null?c:8,r=e.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;e.style.transform="",e.style.left=`${n.left-s}px`,e.style.top=`${n.top+r-s}px`,e.style.width=`${n.width+2*s}px`,e.style.height=`${n.height+2*s}px`}}class Ut{constructor(e,t){y(this,"popupData");y(this,"tour");y(this,"_index");y(this,"_hostElement",null);y(this,"_direction","toNext");y(this,"_hostData");y(this,"_resizeObserver",null);var n;this.popupData=t.popup,this.tour=e,this._index=(n=t.index)!=null?n:null,this._hostData=t.host}get isFirst(){return this.tour.stepList.indexOf(this)===0}get direction(){return this._direction}get hasHost(){return b(this._hostElement)}get hostElement(){return this._hostElement}get index(){return this._index}set index(e){this._index=e}show(e){return A(this,null,function*(){var n;if(D(this.tour.popup))return;this._direction=e,this._hostData&&(this._hostElement=this.resolveHostElement(typeof this._hostData=="function"?this._hostData():(n=this._hostData)!=null?n:null)),this._resizeObserver=this.listenHostResize();const t=[];b(this.tour.background)&&t.push(this.tour.backgroundRenderer.render(this.tour.background,this)),!this.tour.config.highlight.disable&&!D(this.tour.highlight)&&t.push(this.tour.highlightRenderer.render(this.tour.highlight,this)),this.tour.config.highlight.disable&&b(this.tour.highlight)&&this.tour.highlightRenderer.render(this.tour.highlight,{}),this.tour.config.interaction.disable&&b(this.tour.interaction)?t.push(this.tour.interactionRenderer.render(this.tour.interaction,this)):!this.tour.config.interaction.disable&&b(this.tour.interaction)&&t.push(this.tour.interactionRenderer.render(this.tour.interaction,{})),t.push(this.tour.popupRenderer.render(this.tour.popup,this)),yield Promise.all(t),this.toggleHostClass(!0)})}hide(){return A(this,null,function*(){var e;(e=this._resizeObserver)==null||e.disconnect(),this.toggleHostClass(!1)})}toggleHostClass(e){var t,n;D(this._hostElement)||(e?(this._hostElement.classList.add("siteguide-host"),(t=this._hostElement.parentElement)==null||t.classList.add("siteguide-host-parent")):(this._hostElement.classList.remove("siteguide-host"),(n=this._hostElement.parentElement)==null||n.classList.remove("siteguide-host-parent")))}resolveHostElement(e){return typeof this._hostData=="string"?document.querySelector(this._hostData):e}listenHostResize(){const e=new ResizeObserver(()=>{D(this.tour.activeStep)||(b(this.tour.popup)&&this.tour.popupRenderer.updatePosition(this.tour.popup,this.tour.activeStep),b(this.tour.highlight)&&!this.tour.config.highlight.disable&&this.tour.highlightRenderer.updatePosition(this.tour.highlight,this.tour.activeStep),b(this.tour.interaction)&&this.tour.config.interaction.disable&&this.tour.interactionRenderer.updatePosition(this.tour.interaction,this.tour.activeStep))});return b(this._hostElement)&&e.observe(this._hostElement),e}}function gt(i){return i&&typeof i=="object"&&!Array.isArray(i)}function Kt(i,e){const t=$({},i);return gt(i)&>(e)&&Object.keys(e).forEach(n=>{const s=n,r=n;gt(e[s])?(r in i||Object.assign(t,{[r]:{}}),t[r]=Kt(i[r],e[s])):Object.assign(t,{[r]:e[s]})}),t}function We(i){const e=L("button",[`${i}-close`]);return e.innerHTML="✖",e}class Ie{render(e,t){return t.tour.config.background.disable?e.style.pointerEvents="none":e.style.pointerEvents="auto",Promise.resolve()}updatePosition(e,t){}}class je{constructor(e){y(this,"_event",null);y(this,"_callbacks",[]);this._event=e}get callbacks(){return this._callbacks}registerCallback(e){this._callbacks.push(e)}unregisterCallback(e){const t=this.callbacks.indexOf(e);t>-1&&this._callbacks.splice(t,1)}fire(){this._callbacks.slice(0).forEach(t=>{t()})}}class Ye{constructor(){y(this,"_events",new Map)}on(e,t){let n=this._events.get(e);n||(n=new je(e),this._events.set(e,n)),n.registerCallback(t)}off(e,t){const n=this._events.get(e);if(b(n)&&D(t)){this._events.delete(e);return}n&&b(t)&&n.callbacks.indexOf(t)>-1&&(n.unregisterCallback(t),n.callbacks.length===0&&this._events.delete(e))}dispatch(e){const t=this._events.get(e);t&&t.fire()}}class qe{constructor(){y(this,"_activeTour",null)}get isActive(){return b(this.activeTour)}get activeTour(){return this._activeTour}setActiveTour(e){this._activeTour=e}}const ot=new qe;class Ue extends Ye{constructor(t){var n,s,r,o,c,a,l,f,h,g,u,d,p,m,x,S,v,C,_,w,E,P,W,N,I,T,O,Y,k,q,U,K,Ct;super();y(this,"popupRenderer",new Ne);y(this,"highlightRenderer",new Ve);y(this,"interactionRenderer",new ze);y(this,"backgroundRenderer",new Ie);y(this,"_popup",null);y(this,"_highlight",null);y(this,"_interaction",null);y(this,"_background",null);y(this,"_stepList",[]);y(this,"_activeStep",null);y(this,"_bodyResizeObserver",null);y(this,"_config");y(this,"closeOnEsc",t=>{t.key==="Escape"&&this.close()});y(this,"closeOnClick",()=>{this.close()});y(this,"keyboardControl",t=>{t.key==="ArrowRight"?this.next():t.key==="ArrowLeft"&&this.prev()});this._config={classPrefix:(n=t.classPrefix)!=null?n:"siteguide",class:"",buttons:{nextText:(r=(s=t.buttons)==null?void 0:s.nextText)!=null?r:"Next",prevText:(c=(o=t.buttons)==null?void 0:o.prevText)!=null?c:"Back"},animationClass:(a=t.animationClass)!=null?a:"siteguide-animation",close:{button:(f=(l=t.close)==null?void 0:l.button)!=null?f:!0,clickout:(g=(h=t.close)==null?void 0:h.clickout)!=null?g:!1,esc:(d=(u=t.close)==null?void 0:u.esc)!=null?d:!0},scrollTo:(p=t.scrollTo)!=null?p:{behavior:"smooth",block:"center",inline:"center"},closeIcon:(x=t.closeIcon)!=null?x:We((m=t.classPrefix)!=null?m:"siteguide"),arrow:{disable:(v=(S=t.arrow)==null?void 0:S.disable)!=null?v:!1,class:(_=(C=t.arrow)==null?void 0:C.class)!=null?_:""},highlight:{disable:(E=(w=t.highlight)==null?void 0:w.disable)!=null?E:!1,padding:(W=(P=t.highlight)==null?void 0:P.padding)!=null?W:8,class:(I=(N=t.highlight)==null?void 0:N.class)!=null?I:""},progress:{disable:(O=(T=t.progress)==null?void 0:T.disable)!=null?O:!0,text:"Step {{currentStep}} of {{totalSteps}}"},interaction:{disable:(k=(Y=t.interaction)==null?void 0:Y.disable)!=null?k:!0},background:{disable:(U=(q=t.background)==null?void 0:q.disable)!=null?U:!0},keyboardControl:(K=t.keyboardControl)!=null?K:!1,translateFn:(Ct=t.translateFn)!=null?Ct:Xt=>Xt}}get stepList(){return this._stepList}get config(){return this._config}get popup(){return this._popup}get highlight(){return this._highlight}get interaction(){return this._interaction}get background(){return this._background}get activeStep(){return this._activeStep}get activeStepIndex(){return this._activeStep?this.stepList.indexOf(this._activeStep):null}addStep(t){if(D(t.index)){const s=this._stepList.reduce((r,o)=>o.index!==null&&o.index!==void 0&&o.index>r?o.index:r,-1);t.index=s+1}const n=new Ut(this,t);this._stepList.push(n),this._stepList.sort((s,r)=>s.index-r.index)}addSteps(t){t.forEach(n=>this.addStep(n))}removeStep(t){this._stepList=this._stepList.filter(n=>t!==n.index)}start(){ot.isActive||this._stepList.length===0||(ot.setActiveTour(this),this._bodyResizeObserver=this.getBodyResizeObserver(),this.config.close.esc&&document.addEventListener("keydown",this.closeOnEsc),this.config.keyboardControl&&document.addEventListener("keydown",this.keyboardControl),this._background=L("div",["siteguide-background"]),document.body.appendChild(this._background),this.config.close.clickout&&this._background.addEventListener("click",this.closeOnClick),this._config.highlight.disable||(this._highlight=L("div",[this._config.highlight.class,"siteguide-highlight-pos",`${this._config.classPrefix}-highlight`]),document.body.appendChild(this._highlight)),this._config.interaction.disable&&(this._interaction=L("div",["siteguide-interaction"]),document.body.appendChild(this._interaction)),this._popup=L("div",["siteguide-pos",this._config.classPrefix]),document.body.appendChild(this._popup),this.dispatch("start"),this.next())}complete(){this.completeTour(),this.dispatch("complete")}close(){this.completeTour(),this.dispatch("close")}prev(){const t=b(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"),this.dispatch("prev"),this.dispatch("changeStep")}next(){return A(this,null,function*(){var n,s,r;const t=b(this._activeStep)?this._stepList.indexOf(this._activeStep)+1:this._stepList.indexOf(this._stepList[0]);if(t>=this._stepList.length){this.complete();return}b((n=this._activeStep)==null?void 0:n.popupData.allowNext)&&!((r=yield(s=this._activeStep)==null?void 0:s.popupData.allowNext.call(this))==null||r)||(this.changeStepTo(t,"toNext"),this.dispatch("next"),this.dispatch("changeStep"))})}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 s;(s=this._activeStep)==null||s.hide(),this._activeStep=this._stepList[t],this._activeStep.show(n)}completeTour(){var t,n;this._popup&&document.body.removeChild(this._popup),this._highlight&&document.body.removeChild(this._highlight),this._interaction&&document.body.removeChild(this._interaction),this._background&&document.body.removeChild(this._background),(t=this._bodyResizeObserver)==null||t.disconnect(),(n=this._activeStep)==null||n.hide(),this._activeStep=null,ot.setActiveTour(null),this.config.close.esc&&document.removeEventListener("keydown",this.closeOnEsc),this.config.keyboardControl&&document.removeEventListener("keydown",this.keyboardControl)}getBodyResizeObserver(){const t=new ResizeObserver(()=>{this._activeStep&&(b(this._popup)&&this.popupRenderer.updatePosition(this._popup,this._activeStep),b(this._highlight)&&!this.config.highlight.disable&&this.highlightRenderer.updatePosition(this._highlight,this._activeStep),b(this._interaction)&&this.config.interaction.disable&&this.interactionRenderer.updatePosition(this._interaction,this._activeStep))});return t.observe(document.body),t}}const Ke=ot;exports.Siteguide=Ke;exports.Tour=Ue;exports.TourStep=Ut;exports.createElement=L;
|
|
1
|
+
"use strict";var Zt=Object.defineProperty,te=Object.defineProperties;var ee=Object.getOwnPropertyDescriptors;var st=Object.getOwnPropertySymbols;var Tt=Object.prototype.hasOwnProperty,Lt=Object.prototype.propertyIsEnumerable;var Ot=Math.pow,dt=(i,e,t)=>e in i?Zt(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,$=(i,e)=>{for(var t in e||(e={}))Tt.call(e,t)&&dt(i,t,e[t]);if(st)for(var t of st(e))Lt.call(e,t)&&dt(i,t,e[t]);return i},Z=(i,e)=>te(i,ee(e));var Rt=(i,e)=>{var t={};for(var n in i)Tt.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&st)for(var n of st(i))e.indexOf(n)<0&&Lt.call(i,n)&&(t[n]=i[n]);return t};var x=(i,e,t)=>dt(i,typeof e!="symbol"?e+"":e,t);var A=(i,e,t)=>new Promise((n,s)=>{var r=a=>{try{c(t.next(a))}catch(l){s(l)}},o=a=>{try{c(t.throw(a))}catch(l){s(l)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(r,o);c((t=t.apply(i,e)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ie=["top","right","bottom","left"],kt=["start","end"],$t=ie.reduce((i,e)=>i.concat(e,e+"-"+kt[0],e+"-"+kt[1]),[]),tt=Math.min,X=Math.max,rt=Math.round,F=i=>({x:i,y:i}),ne={left:"right",right:"left",bottom:"top",top:"bottom"},se={start:"end",end:"start"};function oe(i,e,t){return X(i,tt(e,t))}function lt(i,e){return typeof i=="function"?i(e):i}function it(i){return i.split("-")[0]}function V(i){return i.split("-")[1]}function re(i){return i==="x"?"y":"x"}function xt(i){return i==="y"?"height":"width"}function yt(i){return["top","bottom"].includes(it(i))?"y":"x"}function wt(i){return re(yt(i))}function ce(i,e,t){t===void 0&&(t=!1);const n=V(i),s=wt(i),r=xt(s);let o=s==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=At(o)),[o,At(o)]}function le(i){return i.replace(/start|end/g,e=>se[e])}function At(i){return i.replace(/left|right|bottom|top/g,e=>ne[e])}function ae(i){return $({top:0,right:0,bottom:0,left:0},i)}function Vt(i){return typeof i!="number"?ae(i):{top:i,right:i,bottom:i,left:i}}function ct(i){const{x:e,y:t,width:n,height:s}=i;return{width:n,height:s,top:t,left:e,right:e+n,bottom:t+s,x:e,y:t}}function Dt(i,e,t){let{reference:n,floating:s}=i;const r=yt(e),o=wt(e),c=xt(o),a=it(e),l=r==="y",f=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,g=n[c]/2-s[c]/2;let d;switch(a){case"top":d={x:f,y:n.y-s.height};break;case"bottom":d={x:f,y:n.y+n.height};break;case"right":d={x:n.x+n.width,y:h};break;case"left":d={x:n.x-s.width,y:h};break;default:d={x:n.x,y:n.y}}switch(V(e)){case"start":d[o]-=g*(t&&l?-1:1);break;case"end":d[o]+=g*(t&&l?-1:1);break}return d}const he=(i,e,t)=>A(exports,null,function*(){const{placement:n="bottom",strategy:s="absolute",middleware:r=[],platform:o}=t,c=r.filter(Boolean),a=yield o.isRTL==null?void 0:o.isRTL(e);let l=yield o.getElementRects({reference:i,floating:e,strategy:s}),{x:f,y:h}=Dt(l,n,a),g=n,d={},u=0;for(let p=0;p<c.length;p++){const{name:m,fn:y}=c[p],{x:S,y:v,data:C,reset:_}=yield y({x:f,y:h,initialPlacement:n,placement:g,strategy:s,middlewareData:d,rects:l,platform:o,elements:{reference:i,floating:e}});f=S!=null?S:f,h=v!=null?v:h,d=Z($({},d),{[m]:$($({},d[m]),C)}),_&&u<=50&&(u++,typeof _=="object"&&(_.placement&&(g=_.placement),_.rects&&(l=_.rects===!0?yield o.getElementRects({reference:i,floating:e,strategy:s}):_.rects),{x:f,y:h}=Dt(l,g,a)),p=-1)}return{x:f,y:h,placement:g,strategy:s,middlewareData:d}});function fe(i,e){return A(this,null,function*(){var t;e===void 0&&(e={});const{x:n,y:s,platform:r,rects:o,elements:c,strategy:a}=i,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:g=!1,padding:d=0}=lt(e,i),u=Vt(d),m=c[g?h==="floating"?"reference":"floating":h],y=ct(yield r.getClippingRect({element:(t=yield r.isElement==null?void 0:r.isElement(m))==null||t?m:m.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:l,rootBoundary:f,strategy:a})),S=h==="floating"?{x:n,y:s,width:o.floating.width,height:o.floating.height}:o.reference,v=yield r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating),C=(yield r.isElement==null?void 0:r.isElement(v))?(yield r.getScale==null?void 0:r.getScale(v))||{x:1,y:1}:{x:1,y:1},_=ct(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:S,offsetParent:v,strategy:a}):S);return{top:(y.top-_.top+u.top)/C.y,bottom:(_.bottom-y.bottom+u.bottom)/C.y,left:(y.left-_.left+u.left)/C.x,right:(_.right-y.right+u.right)/C.x}})}const de=i=>({name:"arrow",options:i,fn(t){return A(this,null,function*(){const{x:n,y:s,placement:r,rects:o,platform:c,elements:a,middlewareData:l}=t,{element:f,padding:h=0}=lt(i,t)||{};if(f==null)return{};const g=Vt(h),d={x:n,y:s},u=wt(r),p=xt(u),m=yield c.getDimensions(f),y=u==="y",S=y?"top":"left",v=y?"bottom":"right",C=y?"clientHeight":"clientWidth",_=o.reference[p]+o.reference[u]-d[u]-o.floating[p],w=d[u]-o.reference[u],P=yield c.getOffsetParent==null?void 0:c.getOffsetParent(f);let T=P?P[C]:0;(!T||!(yield c.isElement==null?void 0:c.isElement(P)))&&(T=a.floating[C]||o.floating[p]);const W=_/2-w/2,N=T/2-m[p]/2-1,I=tt(g[S],N),E=tt(g[v],N),O=I,Y=T-m[p]-E,k=T/2-m[p]/2+W,q=oe(O,k,Y),U=!l.arrow&&V(r)!=null&&k!==q&&o.reference[p]/2-(k<O?I:E)-m[p]/2<0,K=U?k<O?k-O:k-Y:0;return{[u]:d[u]+K,data:$({[u]:q,centerOffset:k-q-K},U&&{alignmentOffset:K}),reset:U}})}});function ue(i,e,t){return(i?[...t.filter(s=>V(s)===i),...t.filter(s=>V(s)!==i)]:t.filter(s=>it(s)===s)).filter(s=>i?V(s)===i||(e?le(s)!==s:!1):!0)}const ge=function(i){return i===void 0&&(i={}),{name:"autoPlacement",options:i,fn(t){return A(this,null,function*(){var n,s,r;const{rects:o,middlewareData:c,placement:a,platform:l,elements:f}=t,I=lt(i,t),{crossAxis:h=!1,alignment:g,allowedPlacements:d=$t,autoAlignment:u=!0}=I,p=Rt(I,["crossAxis","alignment","allowedPlacements","autoAlignment"]),m=g!==void 0||d===$t?ue(g||null,u,d):d,y=yield fe(t,p),S=((n=c.autoPlacement)==null?void 0:n.index)||0,v=m[S];if(v==null)return{};const C=ce(v,o,yield l.isRTL==null?void 0:l.isRTL(f.floating));if(a!==v)return{reset:{placement:m[0]}};const _=[y[it(v)],y[C[0]],y[C[1]]],w=[...((s=c.autoPlacement)==null?void 0:s.overflows)||[],{placement:v,overflows:_}],P=m[S+1];if(P)return{data:{index:S+1,overflows:w},reset:{placement:P}};const T=w.map(E=>{const O=V(E.placement);return[E.placement,O&&h?E.overflows.slice(0,2).reduce((Y,k)=>Y+k,0):E.overflows[0],E.overflows]}).sort((E,O)=>E[1]-O[1]),N=((r=T.filter(E=>E[2].slice(0,V(E[0])?2:3).every(O=>O<=0))[0])==null?void 0:r[0])||T[0][0];return N!==a?{data:{index:S+1,overflows:w},reset:{placement:N}}:{}})}}};function pe(i,e){return A(this,null,function*(){const{placement:t,platform:n,elements:s}=i,r=yield n.isRTL==null?void 0:n.isRTL(s.floating),o=it(t),c=V(t),a=yt(t)==="y",l=["left","top"].includes(o)?-1:1,f=r&&a?-1:1,h=lt(e,i);let{mainAxis:g,crossAxis:d,alignmentAxis:u}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof u=="number"&&(d=c==="end"?u*-1:u),a?{x:d*f,y:g*l}:{x:g*l,y:d*f}})}const me=function(i){return i===void 0&&(i=0),{name:"offset",options:i,fn(t){return A(this,null,function*(){var n,s;const{x:r,y:o,placement:c,middlewareData:a}=t,l=yield pe(t,i);return c===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:Z($({},l),{placement:c})}})}}};function at(){return typeof window!="undefined"}function Q(i){return zt(i)?(i.nodeName||"").toLowerCase():"#document"}function R(i){var e;return(i==null||(e=i.ownerDocument)==null?void 0:e.defaultView)||window}function z(i){var e;return(e=(zt(i)?i.ownerDocument:i.document)||window.document)==null?void 0:e.documentElement}function zt(i){return at()?i instanceof Node||i instanceof R(i).Node:!1}function B(i){return at()?i instanceof Element||i instanceof R(i).Element:!1}function M(i){return at()?i instanceof HTMLElement||i instanceof R(i).HTMLElement:!1}function Bt(i){return!at()||typeof ShadowRoot=="undefined"?!1:i instanceof ShadowRoot||i instanceof R(i).ShadowRoot}function nt(i){const{overflow:e,overflowX:t,overflowY:n,display:s}=H(i);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!["inline","contents"].includes(s)}function xe(i){return["table","td","th"].includes(Q(i))}function ht(i){return[":popover-open",":modal"].some(e=>{try{return i.matches(e)}catch(t){return!1}})}function bt(i){const e=vt(),t=B(i)?H(i):i;return t.transform!=="none"||t.perspective!=="none"||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(t.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(t.contain||"").includes(n))}function ye(i){let e=j(i);for(;M(e)&&!J(e);){if(bt(e))return e;if(ht(e))return null;e=j(e)}return null}function vt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function J(i){return["html","body","#document"].includes(Q(i))}function H(i){return R(i).getComputedStyle(i)}function ft(i){return B(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function j(i){if(Q(i)==="html")return i;const e=i.assignedSlot||i.parentNode||Bt(i)&&i.host||z(i);return Bt(e)?e.host:e}function Wt(i){const e=j(i);return J(e)?i.ownerDocument?i.ownerDocument.body:i.body:M(e)&&nt(e)?e:Wt(e)}function pt(i,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);const s=Wt(i),r=s===((n=i.ownerDocument)==null?void 0:n.body),o=R(s);if(r){const c=mt(o);return e.concat(o,o.visualViewport||[],nt(s)?s:[],c&&t?pt(c):[])}return e.concat(s,pt(s,[],t))}function mt(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function It(i){const e=H(i);let t=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=M(i),r=s?i.offsetWidth:t,o=s?i.offsetHeight:n,c=rt(t)!==r||rt(n)!==o;return c&&(t=r,n=o),{width:t,height:n,$:c}}function jt(i){return B(i)?i:i.contextElement}function G(i){const e=jt(i);if(!M(e))return F(1);const t=e.getBoundingClientRect(),{width:n,height:s,$:r}=It(e);let o=(r?rt(t.width):t.width)/n,c=(r?rt(t.height):t.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const we=F(0);function Yt(i){const e=R(i);return!vt()||!e.visualViewport?we:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function be(i,e,t){return e===void 0&&(e=!1),!t||e&&t!==R(i)?!1:e}function et(i,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);const s=i.getBoundingClientRect(),r=jt(i);let o=F(1);e&&(n?B(n)&&(o=G(n)):o=G(i));const c=be(r,t,n)?Yt(r):F(0);let a=(s.left+c.x)/o.x,l=(s.top+c.y)/o.y,f=s.width/o.x,h=s.height/o.y;if(r){const g=R(r),d=n&&B(n)?R(n):n;let u=g,p=mt(u);for(;p&&n&&d!==u;){const m=G(p),y=p.getBoundingClientRect(),S=H(p),v=y.left+(p.clientLeft+parseFloat(S.paddingLeft))*m.x,C=y.top+(p.clientTop+parseFloat(S.paddingTop))*m.y;a*=m.x,l*=m.y,f*=m.x,h*=m.y,a+=v,l+=C,u=R(p),p=mt(u)}}return ct({width:f,height:h,x:a,y:l})}function _t(i,e){const t=ft(i).scrollLeft;return e?e.left+t:et(z(i)).left+t}function qt(i,e,t){t===void 0&&(t=!1);const n=i.getBoundingClientRect(),s=n.left+e.scrollLeft-(t?0:_t(i,n)),r=n.top+e.scrollTop;return{x:s,y:r}}function ve(i){let{elements:e,rect:t,offsetParent:n,strategy:s}=i;const r=s==="fixed",o=z(n),c=e?ht(e.floating):!1;if(n===o||c&&r)return t;let a={scrollLeft:0,scrollTop:0},l=F(1);const f=F(0),h=M(n);if((h||!h&&!r)&&((Q(n)!=="body"||nt(o))&&(a=ft(n)),M(n))){const d=et(n);l=G(n),f.x=d.x+n.clientLeft,f.y=d.y+n.clientTop}const g=o&&!h&&!r?qt(o,a,!0):F(0);return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+f.x+g.x,y:t.y*l.y-a.scrollTop*l.y+f.y+g.y}}function _e(i){return Array.from(i.getClientRects())}function Se(i){const e=z(i),t=ft(i),n=i.ownerDocument.body,s=X(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=X(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+_t(i);const c=-t.scrollTop;return H(n).direction==="rtl"&&(o+=X(e.clientWidth,n.clientWidth)-s),{width:s,height:r,x:o,y:c}}function Ce(i,e){const t=R(i),n=z(i),s=t.visualViewport;let r=n.clientWidth,o=n.clientHeight,c=0,a=0;if(s){r=s.width,o=s.height;const l=vt();(!l||l&&e==="fixed")&&(c=s.offsetLeft,a=s.offsetTop)}return{width:r,height:o,x:c,y:a}}function Pe(i,e){const t=et(i,!0,e==="fixed"),n=t.top+i.clientTop,s=t.left+i.clientLeft,r=M(i)?G(i):F(1),o=i.clientWidth*r.x,c=i.clientHeight*r.y,a=s*r.x,l=n*r.y;return{width:o,height:c,x:a,y:l}}function Ht(i,e,t){let n;if(e==="viewport")n=Ce(i,t);else if(e==="document")n=Se(z(i));else if(B(e))n=Pe(e,t);else{const s=Yt(i);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return ct(n)}function Ut(i,e){const t=j(i);return t===e||!B(t)||J(t)?!1:H(t).position==="fixed"||Ut(t,e)}function Ee(i,e){const t=e.get(i);if(t)return t;let n=pt(i,[],!1).filter(c=>B(c)&&Q(c)!=="body"),s=null;const r=H(i).position==="fixed";let o=r?j(i):i;for(;B(o)&&!J(o);){const c=H(o),a=bt(o);!a&&c.position==="fixed"&&(s=null),(r?!a&&!s:!a&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||nt(o)&&!a&&Ut(i,o))?n=n.filter(f=>f!==o):s=c,o=j(o)}return e.set(i,n),n}function Te(i){let{element:e,boundary:t,rootBoundary:n,strategy:s}=i;const o=[...t==="clippingAncestors"?ht(e)?[]:Ee(e,this._c):[].concat(t),n],c=o[0],a=o.reduce((l,f)=>{const h=Ht(e,f,s);return l.top=X(h.top,l.top),l.right=tt(h.right,l.right),l.bottom=tt(h.bottom,l.bottom),l.left=X(h.left,l.left),l},Ht(e,c,s));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Le(i){const{width:e,height:t}=It(i);return{width:e,height:t}}function Oe(i,e,t){const n=M(e),s=z(e),r=t==="fixed",o=et(i,!0,r,e);let c={scrollLeft:0,scrollTop:0};const a=F(0);if(n||!n&&!r)if((Q(e)!=="body"||nt(s))&&(c=ft(e)),n){const g=et(e,!0,r,e);a.x=g.x+e.clientLeft,a.y=g.y+e.clientTop}else s&&(a.x=_t(s));const l=s&&!n&&!r?qt(s,c):F(0),f=o.left+c.scrollLeft-a.x-l.x,h=o.top+c.scrollTop-a.y-l.y;return{x:f,y:h,width:o.width,height:o.height}}function ut(i){return H(i).position==="static"}function Ft(i,e){if(!M(i)||H(i).position==="fixed")return null;if(e)return e(i);let t=i.offsetParent;return z(i)===t&&(t=t.ownerDocument.body),t}function Kt(i,e){const t=R(i);if(ht(i))return t;if(!M(i)){let s=j(i);for(;s&&!J(s);){if(B(s)&&!ut(s))return s;s=j(s)}return t}let n=Ft(i,e);for(;n&&xe(n)&&ut(n);)n=Ft(n,e);return n&&J(n)&&ut(n)&&!bt(n)?t:n||ye(i)||t}const Re=function(i){return A(this,null,function*(){const e=this.getOffsetParent||Kt,t=this.getDimensions,n=yield t(i.floating);return{reference:Oe(i.reference,yield e(i.floating),i.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}})};function ke(i){return H(i).direction==="rtl"}const $e={convertOffsetParentRelativeRectToViewportRelativeRect:ve,getDocumentElement:z,getClippingRect:Te,getOffsetParent:Kt,getElementRects:Re,getClientRects:_e,getDimensions:Le,getScale:G,isElement:B,isRTL:ke},Ae=me,De=ge,Be=de,He=(i,e,t)=>{const n=new Map,s=$({platform:$e},t),r=Z($({},s.platform),{_c:n});return he(i,e,Z($({},s),{platform:r}))};function D(i){return i===null||typeof i=="undefined"}function b(i){return!D(i)}function Mt(i){return new Promise(e=>setTimeout(e,i))}function Xt(i){var n;const e=i.parentElement;return!e||e.nodeName==="HTML"?!1:((n=document.defaultView)==null?void 0:n.getComputedStyle(i,null).getPropertyValue("position"))==="fixed"?!0:Xt(e)}function St(i){return Xt(i)?"fixed":"absolute"}class Fe{renderContent(e,t,n){e.querySelector(`.${n.classPrefix}-content`).appendChild(t.node)}}function L(i,e){const t=document.createElement(i);return e&&e.length>0&&(e=e.filter(n=>n),t.classList.add(...e)),t}class Me{renderContent(e,t,n){var r,o,c,a;const s=e.querySelector(`.${n.classPrefix}-content`);if(t.imgSrc){const l=L("img",[`${n.classPrefix}-image`,`${(o=(r=t.customization)==null?void 0:r.imageClass)!=null?o:""}`]);l.src=t.imgSrc,s.appendChild(l)}if(t.text){const l=L("p",[`${n.classPrefix}-description`,`${(a=(c=t.customization)==null?void 0:c.descriptionClass)!=null?a:""}`]);l.innerHTML=n.translateFn(t.text),s.appendChild(l)}}}function Ne(i,e,t){var c,a,l,f,h,g,d,u,p,m,y,S,v,C,_;if(i.innerHTML="",i.className=`${(c=t.config.class)!=null?c:""} siteguide-pos ${t.config.classPrefix} ${t.config.animationClass}`,!t.config.arrow.disable&&((a=t.activeStep)!=null&&a.hasHost)){const w=L("div",[(l=t.config.arrow.class)!=null?l:"",`${t.config.classPrefix}-arrow`]);i.appendChild(w)}(f=e.customization)!=null&&f.class&&i.classList.add(e.customization.class);const n=L("div",[`${t.config.classPrefix}-header`,`${(g=(h=e.customization)==null?void 0:h.headerClass)!=null?g:""}`]);i.appendChild(n);const s=L("h1",[`${t.config.classPrefix}-title`,`${(u=(d=e.customization)==null?void 0:d.titleClass)!=null?u:""}`]);s.innerHTML=t.config.translateFn((p=e.title)!=null?p:""),n.appendChild(s),t.config.close.button&&(t.config.closeIcon.onclick=t.close.bind(t),n.appendChild(t.config.closeIcon));const r=L("div",[`${t.config.classPrefix}-content`,`${(y=(m=e.customization)==null?void 0:m.contentClass)!=null?y:""}`]);i.appendChild(r);const o=L("div",[`${t.config.classPrefix}-footer`,`${(v=(S=e.customization)==null?void 0:S.footerClass)!=null?v:""}`]);if(D(e.buttonList)&&(e.buttonList=Ve(t)),e.buttonList.forEach(w=>{var W;const P=[`${t.config.classPrefix}-button`,(W=w.class)!=null?W:""];D(w.type)||w.type==="secondary"?P.push(`${t.config.classPrefix}-button-secondary`):w.type==="primary"?P.push(`${t.config.classPrefix}-button-primary`):w.type==="link"&&P.push(`${t.config.classPrefix}-button-link`),!D(w.class)&&w.class!==""&&P.push(w.class);const T=L("button",P);T.innerHTML=t.config.translateFn(w.text),T.onclick=N=>{w.action.call(t)},o.appendChild(T)}),!t.config.progress.disable&&t.config.progress.text&&b(t.activeStepIndex)){const w=L("p",[`${t.config.classPrefix}-progress`,`${(_=(C=e.customization)==null?void 0:C.progressClass)!=null?_:""}`]),P=t.config.translateFn(t.config.progress.text);w.innerHTML=ze(P,t.activeStepIndex+1,t.stepList.length),o.appendChild(w)}i.appendChild(o)}function Ve(i){return[{text:i.config.buttons.prevText,action:i.prev},{text:i.config.buttons.nextText,type:"primary",action:i.next}]}function ze(i,e,t){return i.replace("{{currentStep}}",e.toString()).replace("{{totalSteps}}",t.toString())}class We{constructor(){x(this,"_renderContentStrategy",new Map);x(this,"_staticSides",{top:"bottom",right:"left",bottom:"top",left:"right"});this.setUpStrategies()}render(e,t){return new Promise(n=>{var s,r;if(!this._renderContentStrategy.has(t.popupData.type))throw new Error("Missing popup creator strategy");e.style.display="none",e.classList.remove(t.tour.config.animationClass),t.hostElement?e.style.position=St(t.hostElement):e.style.position="fixed",Ne(e,t.popupData,t.tour),(s=this._renderContentStrategy.get(t.popupData.type))==null||s.renderContent(e,t.popupData,t.tour.config),(r=t.hostElement)==null||r.scrollIntoView(t.tour.config.scrollTo),n()}).then(()=>t.isFirst&&t.direction==="toNext"?Mt(0):Mt(400)).then(()=>{e.style.display="flex",this.updatePosition(e,t),e.classList.add(t.tour.config.animationClass)})}updatePosition(e,t){b(t.hostElement)?this.renderFloatingPopup(e,t):this.renderCenterPopup(e)}renderFloatingPopup(e,t){var l;const n=e.style.position==="fixed"?window.scrollY||document.documentElement.scrollTop:0,s=e.querySelector(`.${t.tour.config.classPrefix}-arrow`),r=[],o=b(t.popupData.position)&&t.popupData.position!=="auto"?t.popupData.position:void 0,c=(l=s==null?void 0:s.offsetWidth)!=null?l:10,a=Math.sqrt(2*Ot(c,2))/2+t.tour.config.highlight.padding;r.push(Ae(a)),(t.popupData.position==="auto"||D(o))&&r.push(De()),!t.tour.config.arrow.disable&&b(s)&&r.push(Be({element:s,padding:t.tour.config.arrow.padding})),He(t.hostElement,e,{placement:o,middleware:[...r]}).then(({x:f,y:h,middlewareData:g,placement:d})=>{Object.assign(e.style,{top:`${h-n}px`,left:`${f}px`,marginTop:"0",marginLeft:"0"});const u=d.split("-")[0],p=this._staticSides[u];if(g.arrow&&b(s)){const{x:m,y}=g.arrow;Object.assign(s.style,{left:m!=null?`${m}px`:"",top:y!=null?`${y}px`:"",right:"",bottom:"",[p]:`${-c/2}px`,transform:"rotate(45deg)"})}})}renderCenterPopup(e){Object.assign(e.style,{top:"50%",left:"50%",marginTop:`-${e.clientHeight/2}px`,marginLeft:`-${e.clientWidth/2}px`})}setUpStrategies(){this._renderContentStrategy.set("text",new Me),this._renderContentStrategy.set("custom",new Fe)}}class Ie{render(e,t){return new Promise(n=>{t.hostElement&&(e.style.position=St(t.hostElement)),n()}).then(()=>{this.updatePosition(e,t)})}updatePosition(e,t){var o,c;if(!t.hostElement){e.style.width="0",e.style.height="0",e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)",e.style.opacity="0";return}const n=t.hostElement.getBoundingClientRect(),s=(c=(o=t.tour.config.highlight)==null?void 0:o.padding)!=null?c:8,r=e.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;e.style.transform="",e.style.left=`${n.left-s}px`,e.style.top=`${n.top+r-s}px`,e.style.width=`${n.width+2*s}px`,e.style.height=`${n.height+2*s}px`,e.style.opacity="1"}}class je{render(e,t){return new Promise(n=>{t.hostElement&&(e.style.position=St(t.hostElement)),n()}).then(()=>{this.updatePosition(e,t)})}updatePosition(e,t){var o,c;if(!t.hostElement){e.style.width="0",e.style.height="0",e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)";return}const n=t.hostElement.getBoundingClientRect(),s=(c=(o=t.tour.config.highlight)==null?void 0:o.padding)!=null?c:8,r=e.style.position==="fixed"?0:window.scrollY||document.documentElement.scrollTop;e.style.transform="",e.style.left=`${n.left-s}px`,e.style.top=`${n.top+r-s}px`,e.style.width=`${n.width+2*s}px`,e.style.height=`${n.height+2*s}px`}}class Gt{constructor(e,t){x(this,"popupData");x(this,"tour");x(this,"_index");x(this,"_hostElement",null);x(this,"_direction","toNext");x(this,"_hostData");x(this,"_resizeObserver",null);var n;this.popupData=t.popup,this.tour=e,this._index=(n=t.index)!=null?n:null,this._hostData=t.host}get isFirst(){return this.tour.stepList.indexOf(this)===0}get direction(){return this._direction}get hasHost(){return b(this._hostElement)}get hostElement(){return this._hostElement}get index(){return this._index}set index(e){this._index=e}show(e){return A(this,null,function*(){var n;if(D(this.tour.popup))return;this._direction=e,this._hostData&&(this._hostElement=this.resolveHostElement(typeof this._hostData=="function"?this._hostData():(n=this._hostData)!=null?n:null)),this._resizeObserver=this.listenHostResize();const t=[];b(this.tour.background)&&t.push(this.tour.backgroundRenderer.render(this.tour.background,this)),!this.tour.config.highlight.disable&&!D(this.tour.highlight)&&t.push(this.tour.highlightRenderer.render(this.tour.highlight,this)),this.tour.config.highlight.disable&&b(this.tour.highlight)&&this.tour.highlightRenderer.render(this.tour.highlight,{}),this.tour.config.interaction.disable&&b(this.tour.interaction)?t.push(this.tour.interactionRenderer.render(this.tour.interaction,this)):!this.tour.config.interaction.disable&&b(this.tour.interaction)&&t.push(this.tour.interactionRenderer.render(this.tour.interaction,{})),t.push(this.tour.popupRenderer.render(this.tour.popup,this)),yield Promise.all(t),this.toggleHostClass(!0)})}hide(){return A(this,null,function*(){var e;(e=this._resizeObserver)==null||e.disconnect(),this.toggleHostClass(!1)})}toggleHostClass(e){var t,n;D(this._hostElement)||(e?(this._hostElement.classList.add("siteguide-host"),(t=this._hostElement.parentElement)==null||t.classList.add("siteguide-host-parent")):(this._hostElement.classList.remove("siteguide-host"),(n=this._hostElement.parentElement)==null||n.classList.remove("siteguide-host-parent")))}resolveHostElement(e){return typeof this._hostData=="string"?document.querySelector(this._hostData):e}listenHostResize(){const e=new ResizeObserver(()=>{D(this.tour.activeStep)||(b(this.tour.popup)&&this.tour.popupRenderer.updatePosition(this.tour.popup,this.tour.activeStep),b(this.tour.highlight)&&!this.tour.config.highlight.disable&&this.tour.highlightRenderer.updatePosition(this.tour.highlight,this.tour.activeStep),b(this.tour.interaction)&&this.tour.config.interaction.disable&&this.tour.interactionRenderer.updatePosition(this.tour.interaction,this.tour.activeStep))});return b(this._hostElement)&&e.observe(this._hostElement),e}}function gt(i){return i&&typeof i=="object"&&!Array.isArray(i)}function Jt(i,e){const t=$({},i);return gt(i)&>(e)&&Object.keys(e).forEach(n=>{const s=n,r=n;gt(e[s])?(r in i||Object.assign(t,{[r]:{}}),t[r]=Jt(i[r],e[s])):Object.assign(t,{[r]:e[s]})}),t}function Nt(i){const e=L("button",[`${i}-close`]);return e.innerHTML="✖",e}class Ye{render(e,t){return t.tour.config.background.disable?e.style.pointerEvents="none":e.style.pointerEvents="auto",Promise.resolve()}updatePosition(e,t){}}class qe{constructor(e){x(this,"_event",null);x(this,"_callbacks",[]);this._event=e}get callbacks(){return this._callbacks}registerCallback(e){this._callbacks.push(e)}unregisterCallback(e){const t=this.callbacks.indexOf(e);t>-1&&this._callbacks.splice(t,1)}fire(){this._callbacks.slice(0).forEach(t=>{t()})}}class Ue{constructor(){x(this,"_events",new Map)}on(e,t){let n=this._events.get(e);n||(n=new qe(e),this._events.set(e,n)),n.registerCallback(t)}off(e,t){const n=this._events.get(e);if(b(n)&&D(t)){this._events.delete(e);return}n&&b(t)&&n.callbacks.indexOf(t)>-1&&(n.unregisterCallback(t),n.callbacks.length===0&&this._events.delete(e))}dispatch(e){const t=this._events.get(e);t&&t.fire()}}class Ke{constructor(){x(this,"_activeTour",null)}get isActive(){return b(this.activeTour)}get activeTour(){return this._activeTour}setActiveTour(e){this._activeTour=e}}const ot=new Ke;class Xe extends Ue{constructor(t){var n,s,r,o,c,a,l,f,h,g,d,u,p,m,y,S,v,C,_,w,P,T,W,N,I,E,O,Y,k,q,U,K,Ct,Pt,Et;super();x(this,"popupRenderer",new We);x(this,"highlightRenderer",new Ie);x(this,"interactionRenderer",new je);x(this,"backgroundRenderer",new Ye);x(this,"_popup",null);x(this,"_highlight",null);x(this,"_interaction",null);x(this,"_background",null);x(this,"_stepList",[]);x(this,"_activeStep",null);x(this,"_bodyResizeObserver",null);x(this,"_config");x(this,"closeOnEsc",t=>{t.key==="Escape"&&this.close()});x(this,"closeOnClick",()=>{this.close()});x(this,"keyboardControl",t=>{t.key==="ArrowRight"?this.next():t.key==="ArrowLeft"&&this.prev()});this._config={classPrefix:(n=t.classPrefix)!=null?n:"siteguide",class:"",buttons:{nextText:(r=(s=t.buttons)==null?void 0:s.nextText)!=null?r:"Next",prevText:(c=(o=t.buttons)==null?void 0:o.prevText)!=null?c:"Back"},animationClass:(a=t.animationClass)!=null?a:"siteguide-animation",close:{button:(f=(l=t.close)==null?void 0:l.button)!=null?f:!0,clickout:(g=(h=t.close)==null?void 0:h.clickout)!=null?g:!1,esc:(u=(d=t.close)==null?void 0:d.esc)!=null?u:!0},scrollTo:(p=t.scrollTo)!=null?p:{behavior:"smooth",block:"center",inline:"center"},closeIcon:(y=t.closeIcon)!=null?y:Nt((m=t.classPrefix)!=null?m:"siteguide"),arrow:{disable:(v=(S=t.arrow)==null?void 0:S.disable)!=null?v:!1,class:(_=(C=t.arrow)==null?void 0:C.class)!=null?_:"",padding:(P=(w=t.arrow)==null?void 0:w.padding)!=null?P:24},highlight:{disable:(W=(T=t.highlight)==null?void 0:T.disable)!=null?W:!1,padding:(I=(N=t.highlight)==null?void 0:N.padding)!=null?I:8,class:(O=(E=t.highlight)==null?void 0:E.class)!=null?O:""},progress:{disable:(k=(Y=t.progress)==null?void 0:Y.disable)!=null?k:!0,text:"Step {{currentStep}} of {{totalSteps}}"},interaction:{disable:(U=(q=t.interaction)==null?void 0:q.disable)!=null?U:!0},background:{disable:(Ct=(K=t.background)==null?void 0:K.disable)!=null?Ct:!0},keyboardControl:(Pt=t.keyboardControl)!=null?Pt:!1,translateFn:(Et=t.translateFn)!=null?Et:Qt=>Qt}}get stepList(){return this._stepList}get config(){return this._config}get popup(){return this._popup}get highlight(){return this._highlight}get interaction(){return this._interaction}get background(){return this._background}get activeStep(){return this._activeStep}get activeStepIndex(){return this._activeStep?this.stepList.indexOf(this._activeStep):null}addStep(t){if(D(t.index)){const s=this._stepList.reduce((r,o)=>o.index!==null&&o.index!==void 0&&o.index>r?o.index:r,-1);t.index=s+1}const n=new Gt(this,t);this._stepList.push(n),this._stepList.sort((s,r)=>s.index-r.index)}addSteps(t){t.forEach(n=>this.addStep(n))}removeStep(t){this._stepList=this._stepList.filter(n=>t!==n.index)}start(){ot.isActive||this._stepList.length===0||(ot.setActiveTour(this),this._bodyResizeObserver=this.getBodyResizeObserver(),this.config.close.esc&&document.addEventListener("keydown",this.closeOnEsc),this.config.keyboardControl&&document.addEventListener("keydown",this.keyboardControl),this._background=L("div",["siteguide-background"]),document.body.appendChild(this._background),this.config.close.clickout&&this._background.addEventListener("click",this.closeOnClick),this._config.highlight.disable||(this._highlight=L("div",[this._config.highlight.class,"siteguide-highlight-pos",`${this._config.classPrefix}-highlight`]),document.body.appendChild(this._highlight)),this._config.interaction.disable&&(this._interaction=L("div",["siteguide-interaction"]),document.body.appendChild(this._interaction)),this._popup=L("div",["siteguide-pos",this._config.classPrefix]),document.body.appendChild(this._popup),this.dispatch("start"),this.next())}complete(){this.completeTour(),this.dispatch("complete")}close(){this.completeTour(),this.dispatch("close")}prev(){const t=b(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"),this.dispatch("prev"),this.dispatch("changeStep")}next(){return A(this,null,function*(){var n,s,r;const t=b(this._activeStep)?this._stepList.indexOf(this._activeStep)+1:this._stepList.indexOf(this._stepList[0]);if(t>=this._stepList.length){this.complete();return}b((n=this._activeStep)==null?void 0:n.popupData.allowNext)&&!((r=yield(s=this._activeStep)==null?void 0:s.popupData.allowNext.call(this))==null||r)||(this.changeStepTo(t,"toNext"),this.dispatch("next"),this.dispatch("changeStep"))})}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){var n,s;b(t.classPrefix)&&this._config.classPrefix!==t.classPrefix&&(this._config.closeIcon=(s=t.closeIcon)!=null?s:Nt((n=t.classPrefix)!=null?n:"siteguide")),this._config=Jt(this._config,t)}changeStepTo(t,n){var s;(s=this._activeStep)==null||s.hide(),this._activeStep=this._stepList[t],this._activeStep.show(n)}completeTour(){var t,n;this._popup&&document.body.removeChild(this._popup),this._highlight&&document.body.removeChild(this._highlight),this._interaction&&document.body.removeChild(this._interaction),this._background&&document.body.removeChild(this._background),(t=this._bodyResizeObserver)==null||t.disconnect(),(n=this._activeStep)==null||n.hide(),this._activeStep=null,ot.setActiveTour(null),this.config.close.esc&&document.removeEventListener("keydown",this.closeOnEsc),this.config.keyboardControl&&document.removeEventListener("keydown",this.keyboardControl)}getBodyResizeObserver(){const t=new ResizeObserver(()=>{this._activeStep&&(b(this._popup)&&this.popupRenderer.updatePosition(this._popup,this._activeStep),b(this._highlight)&&!this.config.highlight.disable&&this.highlightRenderer.updatePosition(this._highlight,this._activeStep),b(this._interaction)&&this.config.interaction.disable&&this.interactionRenderer.updatePosition(this._interaction,this._activeStep))});return t.observe(document.body),t}}const Ge=ot;exports.Siteguide=Ge;exports.Tour=Xe;exports.TourStep=Gt;exports.createElement=L;
|
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Qt = Object.defineProperty, Zt = Object.defineProperties;
|
|
2
|
+
var te = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var st = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var Tt = Object.prototype.hasOwnProperty, Lt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Ot = Math.pow, dt = (i, e, t) => e in i ? Qt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, $ = (i, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
|
-
|
|
7
|
+
Tt.call(e, t) && dt(i, t, e[t]);
|
|
8
8
|
if (st)
|
|
9
9
|
for (var t of st(e))
|
|
10
|
-
|
|
10
|
+
Lt.call(e, t) && dt(i, t, e[t]);
|
|
11
11
|
return i;
|
|
12
|
-
}, Z = (i, e) =>
|
|
13
|
-
var
|
|
12
|
+
}, Z = (i, e) => Zt(i, te(e));
|
|
13
|
+
var Rt = (i, e) => {
|
|
14
14
|
var t = {};
|
|
15
15
|
for (var n in i)
|
|
16
|
-
|
|
16
|
+
Tt.call(i, n) && e.indexOf(n) < 0 && (t[n] = i[n]);
|
|
17
17
|
if (i != null && st)
|
|
18
18
|
for (var n of st(i))
|
|
19
|
-
e.indexOf(n) < 0 &&
|
|
19
|
+
e.indexOf(n) < 0 && Lt.call(i, n) && (t[n] = i[n]);
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
var x = (i, e, t) => dt(i, typeof e != "symbol" ? e + "" : e, t);
|
|
@@ -36,19 +36,19 @@ var A = (i, e, t) => new Promise((n, s) => {
|
|
|
36
36
|
}, c = (a) => a.done ? n(a.value) : Promise.resolve(a.value).then(r, o);
|
|
37
37
|
c((t = t.apply(i, e)).next());
|
|
38
38
|
});
|
|
39
|
-
const
|
|
39
|
+
const ee = ["top", "right", "bottom", "left"], kt = ["start", "end"], $t = /* @__PURE__ */ ee.reduce((i, e) => i.concat(e, e + "-" + kt[0], e + "-" + kt[1]), []), tt = Math.min, X = Math.max, rt = Math.round, F = (i) => ({
|
|
40
40
|
x: i,
|
|
41
41
|
y: i
|
|
42
|
-
}),
|
|
42
|
+
}), ie = {
|
|
43
43
|
left: "right",
|
|
44
44
|
right: "left",
|
|
45
45
|
bottom: "top",
|
|
46
46
|
top: "bottom"
|
|
47
|
-
},
|
|
47
|
+
}, ne = {
|
|
48
48
|
start: "end",
|
|
49
49
|
end: "start"
|
|
50
50
|
};
|
|
51
|
-
function
|
|
51
|
+
function se(i, e, t) {
|
|
52
52
|
return X(i, tt(e, t));
|
|
53
53
|
}
|
|
54
54
|
function lt(i, e) {
|
|
@@ -60,7 +60,7 @@ function it(i) {
|
|
|
60
60
|
function V(i) {
|
|
61
61
|
return i.split("-")[1];
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function oe(i) {
|
|
64
64
|
return i === "x" ? "y" : "x";
|
|
65
65
|
}
|
|
66
66
|
function xt(i) {
|
|
@@ -70,21 +70,21 @@ function yt(i) {
|
|
|
70
70
|
return ["top", "bottom"].includes(it(i)) ? "y" : "x";
|
|
71
71
|
}
|
|
72
72
|
function wt(i) {
|
|
73
|
-
return
|
|
73
|
+
return oe(yt(i));
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function re(i, e, t) {
|
|
76
76
|
t === void 0 && (t = !1);
|
|
77
77
|
const n = V(i), s = wt(i), r = xt(s);
|
|
78
78
|
let o = s === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
79
|
-
return e.reference[r] > e.floating[r] && (o =
|
|
79
|
+
return e.reference[r] > e.floating[r] && (o = At(o)), [o, At(o)];
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
return i.replace(/start|end/g, (e) =>
|
|
81
|
+
function ce(i) {
|
|
82
|
+
return i.replace(/start|end/g, (e) => ne[e]);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
return i.replace(/left|right|bottom|top/g, (e) =>
|
|
84
|
+
function At(i) {
|
|
85
|
+
return i.replace(/left|right|bottom|top/g, (e) => ie[e]);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function le(i) {
|
|
88
88
|
return $({
|
|
89
89
|
top: 0,
|
|
90
90
|
right: 0,
|
|
@@ -92,8 +92,8 @@ function oe(i) {
|
|
|
92
92
|
left: 0
|
|
93
93
|
}, i);
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
return typeof i != "number" ?
|
|
95
|
+
function Vt(i) {
|
|
96
|
+
return typeof i != "number" ? le(i) : {
|
|
97
97
|
top: i,
|
|
98
98
|
right: i,
|
|
99
99
|
bottom: i,
|
|
@@ -118,7 +118,7 @@ function ct(i) {
|
|
|
118
118
|
y: t
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function Dt(i, e, t) {
|
|
122
122
|
let {
|
|
123
123
|
reference: n,
|
|
124
124
|
floating: s
|
|
@@ -166,7 +166,7 @@ function $t(i, e, t) {
|
|
|
166
166
|
}
|
|
167
167
|
return d;
|
|
168
168
|
}
|
|
169
|
-
const
|
|
169
|
+
const ae = (i, e, t) => A(void 0, null, function* () {
|
|
170
170
|
const {
|
|
171
171
|
placement: n = "bottom",
|
|
172
172
|
strategy: s = "absolute",
|
|
@@ -180,7 +180,7 @@ const re = (i, e, t) => A(void 0, null, function* () {
|
|
|
180
180
|
}), {
|
|
181
181
|
x: f,
|
|
182
182
|
y: h
|
|
183
|
-
} =
|
|
183
|
+
} = Dt(l, n, a), g = n, d = {}, u = 0;
|
|
184
184
|
for (let p = 0; p < c.length; p++) {
|
|
185
185
|
const {
|
|
186
186
|
name: m,
|
|
@@ -213,7 +213,7 @@ const re = (i, e, t) => A(void 0, null, function* () {
|
|
|
213
213
|
}) : _.rects), {
|
|
214
214
|
x: f,
|
|
215
215
|
y: h
|
|
216
|
-
} =
|
|
216
|
+
} = Dt(l, g, a)), p = -1);
|
|
217
217
|
}
|
|
218
218
|
return {
|
|
219
219
|
x: f,
|
|
@@ -223,7 +223,7 @@ const re = (i, e, t) => A(void 0, null, function* () {
|
|
|
223
223
|
middlewareData: d
|
|
224
224
|
};
|
|
225
225
|
});
|
|
226
|
-
function
|
|
226
|
+
function he(i, e) {
|
|
227
227
|
return A(this, null, function* () {
|
|
228
228
|
var t;
|
|
229
229
|
e === void 0 && (e = {});
|
|
@@ -240,7 +240,7 @@ function ce(i, e) {
|
|
|
240
240
|
elementContext: h = "floating",
|
|
241
241
|
altBoundary: g = !1,
|
|
242
242
|
padding: d = 0
|
|
243
|
-
} = lt(e, i), u =
|
|
243
|
+
} = lt(e, i), u = Vt(d), m = c[g ? h === "floating" ? "reference" : "floating" : h], y = ct(yield r.getClippingRect({
|
|
244
244
|
element: (t = yield r.isElement == null ? void 0 : r.isElement(m)) == null || t ? m : m.contextElement || (yield r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
|
|
245
245
|
boundary: l,
|
|
246
246
|
rootBoundary: f,
|
|
@@ -270,7 +270,7 @@ function ce(i, e) {
|
|
|
270
270
|
};
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
|
-
const
|
|
273
|
+
const fe = (i) => ({
|
|
274
274
|
name: "arrow",
|
|
275
275
|
options: i,
|
|
276
276
|
fn(t) {
|
|
@@ -289,13 +289,13 @@ const le = (i) => ({
|
|
|
289
289
|
} = lt(i, t) || {};
|
|
290
290
|
if (f == null)
|
|
291
291
|
return {};
|
|
292
|
-
const g =
|
|
292
|
+
const g = Vt(h), d = {
|
|
293
293
|
x: n,
|
|
294
294
|
y: s
|
|
295
|
-
}, u = wt(r), p = xt(u), m = yield c.getDimensions(f), y = u === "y", C = y ? "top" : "left", v = y ? "bottom" : "right", S = y ? "clientHeight" : "clientWidth", _ = o.reference[p] + o.reference[u] - d[u] - o.floating[p], w = d[u] - o.reference[u],
|
|
296
|
-
let T =
|
|
297
|
-
(!T || !(yield c.isElement == null ? void 0 : c.isElement(
|
|
298
|
-
const W = _ / 2 - w / 2, M = T / 2 - m[p] / 2 - 1, I = tt(g[C], M),
|
|
295
|
+
}, u = wt(r), p = xt(u), m = yield c.getDimensions(f), y = u === "y", C = y ? "top" : "left", v = y ? "bottom" : "right", S = y ? "clientHeight" : "clientWidth", _ = o.reference[p] + o.reference[u] - d[u] - o.floating[p], w = d[u] - o.reference[u], P = yield c.getOffsetParent == null ? void 0 : c.getOffsetParent(f);
|
|
296
|
+
let T = P ? P[S] : 0;
|
|
297
|
+
(!T || !(yield c.isElement == null ? void 0 : c.isElement(P))) && (T = a.floating[S] || o.floating[p]);
|
|
298
|
+
const W = _ / 2 - w / 2, M = T / 2 - m[p] / 2 - 1, I = tt(g[C], M), E = tt(g[v], M), O = I, Y = T - m[p] - E, k = T / 2 - m[p] / 2 + W, q = se(O, k, Y), U = !l.arrow && V(r) != null && k !== q && o.reference[p] / 2 - (k < O ? I : E) - m[p] / 2 < 0, K = U ? k < O ? k - O : k - Y : 0;
|
|
299
299
|
return {
|
|
300
300
|
[u]: d[u] + K,
|
|
301
301
|
data: $({
|
|
@@ -309,10 +309,10 @@ const le = (i) => ({
|
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
|
-
function
|
|
313
|
-
return (i ? [...t.filter((s) => V(s) === i), ...t.filter((s) => V(s) !== i)] : t.filter((s) => it(s) === s)).filter((s) => i ? V(s) === i || (e ?
|
|
312
|
+
function de(i, e, t) {
|
|
313
|
+
return (i ? [...t.filter((s) => V(s) === i), ...t.filter((s) => V(s) !== i)] : t.filter((s) => it(s) === s)).filter((s) => i ? V(s) === i || (e ? ce(s) !== s : !1) : !0);
|
|
314
314
|
}
|
|
315
|
-
const
|
|
315
|
+
const ue = function(i) {
|
|
316
316
|
return i === void 0 && (i = {}), {
|
|
317
317
|
name: "autoPlacement",
|
|
318
318
|
options: i,
|
|
@@ -328,17 +328,17 @@ const he = function(i) {
|
|
|
328
328
|
} = t, I = lt(i, t), {
|
|
329
329
|
crossAxis: h = !1,
|
|
330
330
|
alignment: g,
|
|
331
|
-
allowedPlacements: d =
|
|
331
|
+
allowedPlacements: d = $t,
|
|
332
332
|
autoAlignment: u = !0
|
|
333
|
-
} = I, p =
|
|
333
|
+
} = I, p = Rt(I, [
|
|
334
334
|
"crossAxis",
|
|
335
335
|
"alignment",
|
|
336
336
|
"allowedPlacements",
|
|
337
337
|
"autoAlignment"
|
|
338
|
-
]), m = g !== void 0 || d ===
|
|
338
|
+
]), m = g !== void 0 || d === $t ? de(g || null, u, d) : d, y = yield he(t, p), C = ((n = c.autoPlacement) == null ? void 0 : n.index) || 0, v = m[C];
|
|
339
339
|
if (v == null)
|
|
340
340
|
return {};
|
|
341
|
-
const S =
|
|
341
|
+
const S = re(v, o, yield l.isRTL == null ? void 0 : l.isRTL(f.floating));
|
|
342
342
|
if (a !== v)
|
|
343
343
|
return {
|
|
344
344
|
reset: {
|
|
@@ -348,31 +348,31 @@ const he = function(i) {
|
|
|
348
348
|
const _ = [y[it(v)], y[S[0]], y[S[1]]], w = [...((s = c.autoPlacement) == null ? void 0 : s.overflows) || [], {
|
|
349
349
|
placement: v,
|
|
350
350
|
overflows: _
|
|
351
|
-
}],
|
|
352
|
-
if (
|
|
351
|
+
}], P = m[C + 1];
|
|
352
|
+
if (P)
|
|
353
353
|
return {
|
|
354
354
|
data: {
|
|
355
355
|
index: C + 1,
|
|
356
356
|
overflows: w
|
|
357
357
|
},
|
|
358
358
|
reset: {
|
|
359
|
-
placement:
|
|
359
|
+
placement: P
|
|
360
360
|
}
|
|
361
361
|
};
|
|
362
|
-
const T = w.map((
|
|
363
|
-
const O = V(
|
|
364
|
-
return [
|
|
362
|
+
const T = w.map((E) => {
|
|
363
|
+
const O = V(E.placement);
|
|
364
|
+
return [E.placement, O && h ? (
|
|
365
365
|
// Check along the mainAxis and main crossAxis side.
|
|
366
|
-
|
|
366
|
+
E.overflows.slice(0, 2).reduce((Y, k) => Y + k, 0)
|
|
367
367
|
) : (
|
|
368
368
|
// Check only the mainAxis.
|
|
369
|
-
|
|
370
|
-
),
|
|
371
|
-
}).sort((
|
|
369
|
+
E.overflows[0]
|
|
370
|
+
), E.overflows];
|
|
371
|
+
}).sort((E, O) => E[1] - O[1]), M = ((r = T.filter((E) => E[2].slice(
|
|
372
372
|
0,
|
|
373
373
|
// Aligned placements should not check their opposite crossAxis
|
|
374
374
|
// side.
|
|
375
|
-
V(
|
|
375
|
+
V(E[0]) ? 2 : 3
|
|
376
376
|
).every((O) => O <= 0))[0]) == null ? void 0 : r[0]) || T[0][0];
|
|
377
377
|
return M !== a ? {
|
|
378
378
|
data: {
|
|
@@ -387,7 +387,7 @@ const he = function(i) {
|
|
|
387
387
|
}
|
|
388
388
|
};
|
|
389
389
|
};
|
|
390
|
-
function
|
|
390
|
+
function ge(i, e) {
|
|
391
391
|
return A(this, null, function* () {
|
|
392
392
|
const {
|
|
393
393
|
placement: t,
|
|
@@ -416,7 +416,7 @@ function fe(i, e) {
|
|
|
416
416
|
};
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
|
-
const
|
|
419
|
+
const pe = function(i) {
|
|
420
420
|
return i === void 0 && (i = 0), {
|
|
421
421
|
name: "offset",
|
|
422
422
|
options: i,
|
|
@@ -428,7 +428,7 @@ const de = function(i) {
|
|
|
428
428
|
y: o,
|
|
429
429
|
placement: c,
|
|
430
430
|
middlewareData: a
|
|
431
|
-
} = t, l = yield
|
|
431
|
+
} = t, l = yield ge(t, i);
|
|
432
432
|
return c === ((n = a.offset) == null ? void 0 : n.placement) && (s = a.arrow) != null && s.alignmentOffset ? {} : {
|
|
433
433
|
x: r + l.x,
|
|
434
434
|
y: o + l.y,
|
|
@@ -444,7 +444,7 @@ function at() {
|
|
|
444
444
|
return typeof window != "undefined";
|
|
445
445
|
}
|
|
446
446
|
function Q(i) {
|
|
447
|
-
return
|
|
447
|
+
return zt(i) ? (i.nodeName || "").toLowerCase() : "#document";
|
|
448
448
|
}
|
|
449
449
|
function R(i) {
|
|
450
450
|
var e;
|
|
@@ -452,9 +452,9 @@ function R(i) {
|
|
|
452
452
|
}
|
|
453
453
|
function z(i) {
|
|
454
454
|
var e;
|
|
455
|
-
return (e = (
|
|
455
|
+
return (e = (zt(i) ? i.ownerDocument : i.document) || window.document) == null ? void 0 : e.documentElement;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function zt(i) {
|
|
458
458
|
return at() ? i instanceof Node || i instanceof R(i).Node : !1;
|
|
459
459
|
}
|
|
460
460
|
function B(i) {
|
|
@@ -463,7 +463,7 @@ function B(i) {
|
|
|
463
463
|
function N(i) {
|
|
464
464
|
return at() ? i instanceof HTMLElement || i instanceof R(i).HTMLElement : !1;
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function Bt(i) {
|
|
467
467
|
return !at() || typeof ShadowRoot == "undefined" ? !1 : i instanceof ShadowRoot || i instanceof R(i).ShadowRoot;
|
|
468
468
|
}
|
|
469
469
|
function nt(i) {
|
|
@@ -475,7 +475,7 @@ function nt(i) {
|
|
|
475
475
|
} = H(i);
|
|
476
476
|
return /auto|scroll|overlay|hidden|clip/.test(e + n + t) && !["inline", "contents"].includes(s);
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function me(i) {
|
|
479
479
|
return ["table", "td", "th"].includes(Q(i));
|
|
480
480
|
}
|
|
481
481
|
function ht(i) {
|
|
@@ -491,7 +491,7 @@ function bt(i) {
|
|
|
491
491
|
const e = vt(), t = B(i) ? H(i) : i;
|
|
492
492
|
return t.transform !== "none" || t.perspective !== "none" || (t.containerType ? t.containerType !== "normal" : !1) || !e && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !e && (t.filter ? t.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((n) => (t.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (t.contain || "").includes(n));
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function xe(i) {
|
|
495
495
|
let e = j(i);
|
|
496
496
|
for (; N(e) && !J(e); ) {
|
|
497
497
|
if (bt(e))
|
|
@@ -527,19 +527,19 @@ function j(i) {
|
|
|
527
527
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
528
528
|
i.assignedSlot || // DOM Element detected.
|
|
529
529
|
i.parentNode || // ShadowRoot detected.
|
|
530
|
-
|
|
530
|
+
Bt(i) && i.host || // Fallback.
|
|
531
531
|
z(i)
|
|
532
532
|
);
|
|
533
|
-
return
|
|
533
|
+
return Bt(e) ? e.host : e;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function Wt(i) {
|
|
536
536
|
const e = j(i);
|
|
537
|
-
return J(e) ? i.ownerDocument ? i.ownerDocument.body : i.body : N(e) && nt(e) ? e :
|
|
537
|
+
return J(e) ? i.ownerDocument ? i.ownerDocument.body : i.body : N(e) && nt(e) ? e : Wt(e);
|
|
538
538
|
}
|
|
539
539
|
function pt(i, e, t) {
|
|
540
540
|
var n;
|
|
541
541
|
e === void 0 && (e = []), t === void 0 && (t = !0);
|
|
542
|
-
const s =
|
|
542
|
+
const s = Wt(i), r = s === ((n = i.ownerDocument) == null ? void 0 : n.body), o = R(s);
|
|
543
543
|
if (r) {
|
|
544
544
|
const c = mt(o);
|
|
545
545
|
return e.concat(o, o.visualViewport || [], nt(s) ? s : [], c && t ? pt(c) : []);
|
|
@@ -549,7 +549,7 @@ function pt(i, e, t) {
|
|
|
549
549
|
function mt(i) {
|
|
550
550
|
return i.parent && Object.getPrototypeOf(i.parent) ? i.frameElement : null;
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function It(i) {
|
|
553
553
|
const e = H(i);
|
|
554
554
|
let t = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
|
|
555
555
|
const s = N(i), r = s ? i.offsetWidth : t, o = s ? i.offsetHeight : n, c = rt(t) !== r || rt(n) !== o;
|
|
@@ -559,41 +559,41 @@ function Vt(i) {
|
|
|
559
559
|
$: c
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function jt(i) {
|
|
563
563
|
return B(i) ? i : i.contextElement;
|
|
564
564
|
}
|
|
565
565
|
function G(i) {
|
|
566
|
-
const e =
|
|
566
|
+
const e = jt(i);
|
|
567
567
|
if (!N(e))
|
|
568
568
|
return F(1);
|
|
569
569
|
const t = e.getBoundingClientRect(), {
|
|
570
570
|
width: n,
|
|
571
571
|
height: s,
|
|
572
572
|
$: r
|
|
573
|
-
} =
|
|
573
|
+
} = It(e);
|
|
574
574
|
let o = (r ? rt(t.width) : t.width) / n, c = (r ? rt(t.height) : t.height) / s;
|
|
575
575
|
return (!o || !Number.isFinite(o)) && (o = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
576
576
|
x: o,
|
|
577
577
|
y: c
|
|
578
578
|
};
|
|
579
579
|
}
|
|
580
|
-
const
|
|
581
|
-
function
|
|
580
|
+
const ye = /* @__PURE__ */ F(0);
|
|
581
|
+
function Yt(i) {
|
|
582
582
|
const e = R(i);
|
|
583
|
-
return !vt() || !e.visualViewport ?
|
|
583
|
+
return !vt() || !e.visualViewport ? ye : {
|
|
584
584
|
x: e.visualViewport.offsetLeft,
|
|
585
585
|
y: e.visualViewport.offsetTop
|
|
586
586
|
};
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function we(i, e, t) {
|
|
589
589
|
return e === void 0 && (e = !1), !t || e && t !== R(i) ? !1 : e;
|
|
590
590
|
}
|
|
591
591
|
function et(i, e, t, n) {
|
|
592
592
|
e === void 0 && (e = !1), t === void 0 && (t = !1);
|
|
593
|
-
const s = i.getBoundingClientRect(), r =
|
|
593
|
+
const s = i.getBoundingClientRect(), r = jt(i);
|
|
594
594
|
let o = F(1);
|
|
595
595
|
e && (n ? B(n) && (o = G(n)) : o = G(i));
|
|
596
|
-
const c =
|
|
596
|
+
const c = we(r, t, n) ? Yt(r) : F(0);
|
|
597
597
|
let a = (s.left + c.x) / o.x, l = (s.top + c.y) / o.y, f = s.width / o.x, h = s.height / o.y;
|
|
598
598
|
if (r) {
|
|
599
599
|
const g = R(r), d = n && B(n) ? R(n) : n;
|
|
@@ -614,7 +614,7 @@ function _t(i, e) {
|
|
|
614
614
|
const t = ft(i).scrollLeft;
|
|
615
615
|
return e ? e.left + t : et(z(i)).left + t;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function qt(i, e, t) {
|
|
618
618
|
t === void 0 && (t = !1);
|
|
619
619
|
const n = i.getBoundingClientRect(), s = n.left + e.scrollLeft - (t ? 0 : (
|
|
620
620
|
// RTL <body> scrollbar.
|
|
@@ -625,7 +625,7 @@ function It(i, e, t) {
|
|
|
625
625
|
y: r
|
|
626
626
|
};
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function be(i) {
|
|
629
629
|
let {
|
|
630
630
|
elements: e,
|
|
631
631
|
rect: t,
|
|
@@ -644,7 +644,7 @@ function xe(i) {
|
|
|
644
644
|
const d = et(n);
|
|
645
645
|
l = G(n), f.x = d.x + n.clientLeft, f.y = d.y + n.clientTop;
|
|
646
646
|
}
|
|
647
|
-
const g = o && !h && !r ?
|
|
647
|
+
const g = o && !h && !r ? qt(o, a, !0) : F(0);
|
|
648
648
|
return {
|
|
649
649
|
width: t.width * l.x,
|
|
650
650
|
height: t.height * l.y,
|
|
@@ -652,10 +652,10 @@ function xe(i) {
|
|
|
652
652
|
y: t.y * l.y - a.scrollTop * l.y + f.y + g.y
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function ve(i) {
|
|
656
656
|
return Array.from(i.getClientRects());
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function _e(i) {
|
|
659
659
|
const e = z(i), t = ft(i), n = i.ownerDocument.body, s = X(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = X(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
|
|
660
660
|
let o = -t.scrollLeft + _t(i);
|
|
661
661
|
const c = -t.scrollTop;
|
|
@@ -666,7 +666,7 @@ function we(i) {
|
|
|
666
666
|
y: c
|
|
667
667
|
};
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function Ce(i, e) {
|
|
670
670
|
const t = R(i), n = z(i), s = t.visualViewport;
|
|
671
671
|
let r = n.clientWidth, o = n.clientHeight, c = 0, a = 0;
|
|
672
672
|
if (s) {
|
|
@@ -681,7 +681,7 @@ function be(i, e) {
|
|
|
681
681
|
y: a
|
|
682
682
|
};
|
|
683
683
|
}
|
|
684
|
-
function
|
|
684
|
+
function Se(i, e) {
|
|
685
685
|
const t = et(i, !0, e === "fixed"), n = t.top + i.clientTop, s = t.left + i.clientLeft, r = N(i) ? G(i) : F(1), o = i.clientWidth * r.x, c = i.clientHeight * r.y, a = s * r.x, l = n * r.y;
|
|
686
686
|
return {
|
|
687
687
|
width: o,
|
|
@@ -690,16 +690,16 @@ function ve(i, e) {
|
|
|
690
690
|
y: l
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function Ht(i, e, t) {
|
|
694
694
|
let n;
|
|
695
695
|
if (e === "viewport")
|
|
696
|
-
n =
|
|
696
|
+
n = Ce(i, t);
|
|
697
697
|
else if (e === "document")
|
|
698
|
-
n =
|
|
698
|
+
n = _e(z(i));
|
|
699
699
|
else if (B(e))
|
|
700
|
-
n =
|
|
700
|
+
n = Se(e, t);
|
|
701
701
|
else {
|
|
702
|
-
const s =
|
|
702
|
+
const s = Yt(i);
|
|
703
703
|
n = {
|
|
704
704
|
x: e.x - s.x,
|
|
705
705
|
y: e.y - s.y,
|
|
@@ -709,11 +709,11 @@ function Dt(i, e, t) {
|
|
|
709
709
|
}
|
|
710
710
|
return ct(n);
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function Ut(i, e) {
|
|
713
713
|
const t = j(i);
|
|
714
|
-
return t === e || !B(t) || J(t) ? !1 : H(t).position === "fixed" ||
|
|
714
|
+
return t === e || !B(t) || J(t) ? !1 : H(t).position === "fixed" || Ut(t, e);
|
|
715
715
|
}
|
|
716
|
-
function
|
|
716
|
+
function Pe(i, e) {
|
|
717
717
|
const t = e.get(i);
|
|
718
718
|
if (t)
|
|
719
719
|
return t;
|
|
@@ -722,21 +722,21 @@ function _e(i, e) {
|
|
|
722
722
|
let o = r ? j(i) : i;
|
|
723
723
|
for (; B(o) && !J(o); ) {
|
|
724
724
|
const c = H(o), a = bt(o);
|
|
725
|
-
!a && c.position === "fixed" && (s = null), (r ? !a && !s : !a && c.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || nt(o) && !a &&
|
|
725
|
+
!a && c.position === "fixed" && (s = null), (r ? !a && !s : !a && c.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || nt(o) && !a && Ut(i, o)) ? n = n.filter((f) => f !== o) : s = c, o = j(o);
|
|
726
726
|
}
|
|
727
727
|
return e.set(i, n), n;
|
|
728
728
|
}
|
|
729
|
-
function
|
|
729
|
+
function Ee(i) {
|
|
730
730
|
let {
|
|
731
731
|
element: e,
|
|
732
732
|
boundary: t,
|
|
733
733
|
rootBoundary: n,
|
|
734
734
|
strategy: s
|
|
735
735
|
} = i;
|
|
736
|
-
const o = [...t === "clippingAncestors" ? ht(e) ? [] :
|
|
737
|
-
const h =
|
|
736
|
+
const o = [...t === "clippingAncestors" ? ht(e) ? [] : Pe(e, this._c) : [].concat(t), n], c = o[0], a = o.reduce((l, f) => {
|
|
737
|
+
const h = Ht(e, f, s);
|
|
738
738
|
return l.top = X(h.top, l.top), l.right = tt(h.right, l.right), l.bottom = tt(h.bottom, l.bottom), l.left = X(h.left, l.left), l;
|
|
739
|
-
},
|
|
739
|
+
}, Ht(e, c, s));
|
|
740
740
|
return {
|
|
741
741
|
width: a.right - a.left,
|
|
742
742
|
height: a.bottom - a.top,
|
|
@@ -744,17 +744,17 @@ function Ce(i) {
|
|
|
744
744
|
y: a.top
|
|
745
745
|
};
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function Te(i) {
|
|
748
748
|
const {
|
|
749
749
|
width: e,
|
|
750
750
|
height: t
|
|
751
|
-
} =
|
|
751
|
+
} = It(i);
|
|
752
752
|
return {
|
|
753
753
|
width: e,
|
|
754
754
|
height: t
|
|
755
755
|
};
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function Le(i, e, t) {
|
|
758
758
|
const n = N(e), s = z(e), r = t === "fixed", o = et(i, !0, r, e);
|
|
759
759
|
let c = {
|
|
760
760
|
scrollLeft: 0,
|
|
@@ -766,7 +766,7 @@ function Ee(i, e, t) {
|
|
|
766
766
|
const g = et(e, !0, r, e);
|
|
767
767
|
a.x = g.x + e.clientLeft, a.y = g.y + e.clientTop;
|
|
768
768
|
} else s && (a.x = _t(s));
|
|
769
|
-
const l = s && !n && !r ?
|
|
769
|
+
const l = s && !n && !r ? qt(s, c) : F(0), f = o.left + c.scrollLeft - a.x - l.x, h = o.top + c.scrollTop - a.y - l.y;
|
|
770
770
|
return {
|
|
771
771
|
x: f,
|
|
772
772
|
y: h,
|
|
@@ -777,7 +777,7 @@ function Ee(i, e, t) {
|
|
|
777
777
|
function ut(i) {
|
|
778
778
|
return H(i).position === "static";
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function Ft(i, e) {
|
|
781
781
|
if (!N(i) || H(i).position === "fixed")
|
|
782
782
|
return null;
|
|
783
783
|
if (e)
|
|
@@ -785,7 +785,7 @@ function Bt(i, e) {
|
|
|
785
785
|
let t = i.offsetParent;
|
|
786
786
|
return z(i) === t && (t = t.ownerDocument.body), t;
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function Kt(i, e) {
|
|
789
789
|
const t = R(i);
|
|
790
790
|
if (ht(i))
|
|
791
791
|
return t;
|
|
@@ -798,16 +798,16 @@ function Yt(i, e) {
|
|
|
798
798
|
}
|
|
799
799
|
return t;
|
|
800
800
|
}
|
|
801
|
-
let n =
|
|
802
|
-
for (; n &&
|
|
803
|
-
n =
|
|
804
|
-
return n && J(n) && ut(n) && !bt(n) ? t : n ||
|
|
801
|
+
let n = Ft(i, e);
|
|
802
|
+
for (; n && me(n) && ut(n); )
|
|
803
|
+
n = Ft(n, e);
|
|
804
|
+
return n && J(n) && ut(n) && !bt(n) ? t : n || xe(i) || t;
|
|
805
805
|
}
|
|
806
|
-
const
|
|
806
|
+
const Oe = function(i) {
|
|
807
807
|
return A(this, null, function* () {
|
|
808
|
-
const e = this.getOffsetParent ||
|
|
808
|
+
const e = this.getOffsetParent || Kt, t = this.getDimensions, n = yield t(i.floating);
|
|
809
809
|
return {
|
|
810
|
-
reference:
|
|
810
|
+
reference: Le(i.reference, yield e(i.floating), i.strategy),
|
|
811
811
|
floating: {
|
|
812
812
|
x: 0,
|
|
813
813
|
y: 0,
|
|
@@ -817,27 +817,27 @@ const Pe = function(i) {
|
|
|
817
817
|
};
|
|
818
818
|
});
|
|
819
819
|
};
|
|
820
|
-
function
|
|
820
|
+
function Re(i) {
|
|
821
821
|
return H(i).direction === "rtl";
|
|
822
822
|
}
|
|
823
|
-
const
|
|
824
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
823
|
+
const ke = {
|
|
824
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: be,
|
|
825
825
|
getDocumentElement: z,
|
|
826
|
-
getClippingRect:
|
|
827
|
-
getOffsetParent:
|
|
828
|
-
getElementRects:
|
|
829
|
-
getClientRects:
|
|
830
|
-
getDimensions:
|
|
826
|
+
getClippingRect: Ee,
|
|
827
|
+
getOffsetParent: Kt,
|
|
828
|
+
getElementRects: Oe,
|
|
829
|
+
getClientRects: ve,
|
|
830
|
+
getDimensions: Te,
|
|
831
831
|
getScale: G,
|
|
832
832
|
isElement: B,
|
|
833
|
-
isRTL:
|
|
834
|
-
},
|
|
833
|
+
isRTL: Re
|
|
834
|
+
}, $e = pe, Ae = ue, De = fe, Be = (i, e, t) => {
|
|
835
835
|
const n = /* @__PURE__ */ new Map(), s = $({
|
|
836
|
-
platform:
|
|
836
|
+
platform: ke
|
|
837
837
|
}, t), r = Z($({}, s.platform), {
|
|
838
838
|
_c: n
|
|
839
839
|
});
|
|
840
|
-
return
|
|
840
|
+
return ae(i, e, Z($({}, s), {
|
|
841
841
|
platform: r
|
|
842
842
|
}));
|
|
843
843
|
};
|
|
@@ -847,18 +847,18 @@ function D(i) {
|
|
|
847
847
|
function b(i) {
|
|
848
848
|
return !D(i);
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function Nt(i) {
|
|
851
851
|
return new Promise((e) => setTimeout(e, i));
|
|
852
852
|
}
|
|
853
|
-
function
|
|
853
|
+
function Xt(i) {
|
|
854
854
|
var n;
|
|
855
855
|
const e = i.parentElement;
|
|
856
|
-
return !e || e.nodeName === "HTML" ? !1 : ((n = document.defaultView) == null ? void 0 : n.getComputedStyle(i, null).getPropertyValue("position")) === "fixed" ? !0 :
|
|
856
|
+
return !e || e.nodeName === "HTML" ? !1 : ((n = document.defaultView) == null ? void 0 : n.getComputedStyle(i, null).getPropertyValue("position")) === "fixed" ? !0 : Xt(e);
|
|
857
857
|
}
|
|
858
858
|
function Ct(i) {
|
|
859
|
-
return
|
|
859
|
+
return Xt(i) ? "fixed" : "absolute";
|
|
860
860
|
}
|
|
861
|
-
class
|
|
861
|
+
class He {
|
|
862
862
|
/** @inheritdoc */
|
|
863
863
|
renderContent(e, t, n) {
|
|
864
864
|
e.querySelector(`.${n.classPrefix}-content`).appendChild(t.node);
|
|
@@ -868,7 +868,7 @@ function L(i, e) {
|
|
|
868
868
|
const t = document.createElement(i);
|
|
869
869
|
return e && e.length > 0 && (e = e.filter((n) => n), t.classList.add(...e)), t;
|
|
870
870
|
}
|
|
871
|
-
class
|
|
871
|
+
class Fe {
|
|
872
872
|
/** @inheritdoc */
|
|
873
873
|
renderContent(e, t, n) {
|
|
874
874
|
var r, o, c, a;
|
|
@@ -889,7 +889,7 @@ class De {
|
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
}
|
|
892
|
-
function
|
|
892
|
+
function Ne(i, e, t) {
|
|
893
893
|
var c, a, l, f, h, g, d, u, p, m, y, C, v, S, _;
|
|
894
894
|
if (i.innerHTML = "", i.className = `${(c = t.config.class) != null ? c : ""} siteguide-pos ${t.config.classPrefix} ${t.config.animationClass}`, !t.config.arrow.disable && ((a = t.activeStep) != null && a.hasHost)) {
|
|
895
895
|
const w = L("div", [
|
|
@@ -918,11 +918,11 @@ function Be(i, e, t) {
|
|
|
918
918
|
`${t.config.classPrefix}-footer`,
|
|
919
919
|
`${(v = (C = e.customization) == null ? void 0 : C.footerClass) != null ? v : ""}`
|
|
920
920
|
]);
|
|
921
|
-
if (D(e.buttonList) && (e.buttonList =
|
|
921
|
+
if (D(e.buttonList) && (e.buttonList = Me(t)), e.buttonList.forEach((w) => {
|
|
922
922
|
var W;
|
|
923
|
-
const
|
|
924
|
-
D(w.type) || w.type === "secondary" ?
|
|
925
|
-
const T = L("button",
|
|
923
|
+
const P = [`${t.config.classPrefix}-button`, (W = w.class) != null ? W : ""];
|
|
924
|
+
D(w.type) || w.type === "secondary" ? P.push(`${t.config.classPrefix}-button-secondary`) : w.type === "primary" ? P.push(`${t.config.classPrefix}-button-primary`) : w.type === "link" && P.push(`${t.config.classPrefix}-button-link`), !D(w.class) && w.class !== "" && P.push(w.class);
|
|
925
|
+
const T = L("button", P);
|
|
926
926
|
T.innerHTML = t.config.translateFn(w.text), T.onclick = (M) => {
|
|
927
927
|
w.action.call(t);
|
|
928
928
|
}, o.appendChild(T);
|
|
@@ -930,12 +930,12 @@ function Be(i, e, t) {
|
|
|
930
930
|
const w = L("p", [
|
|
931
931
|
`${t.config.classPrefix}-progress`,
|
|
932
932
|
`${(_ = (S = e.customization) == null ? void 0 : S.progressClass) != null ? _ : ""}`
|
|
933
|
-
]),
|
|
934
|
-
w.innerHTML =
|
|
933
|
+
]), P = t.config.translateFn(t.config.progress.text);
|
|
934
|
+
w.innerHTML = Ve(P, t.activeStepIndex + 1, t.stepList.length), o.appendChild(w);
|
|
935
935
|
}
|
|
936
936
|
i.appendChild(o);
|
|
937
937
|
}
|
|
938
|
-
function
|
|
938
|
+
function Me(i) {
|
|
939
939
|
return [
|
|
940
940
|
{
|
|
941
941
|
text: i.config.buttons.prevText,
|
|
@@ -948,10 +948,10 @@ function He(i) {
|
|
|
948
948
|
}
|
|
949
949
|
];
|
|
950
950
|
}
|
|
951
|
-
function
|
|
951
|
+
function Ve(i, e, t) {
|
|
952
952
|
return i.replace("{{currentStep}}", e.toString()).replace("{{totalSteps}}", t.toString());
|
|
953
953
|
}
|
|
954
|
-
class
|
|
954
|
+
class ze {
|
|
955
955
|
constructor() {
|
|
956
956
|
x(this, "_renderContentStrategy", /* @__PURE__ */ new Map());
|
|
957
957
|
x(this, "_staticSides", {
|
|
@@ -968,8 +968,8 @@ class Ne {
|
|
|
968
968
|
var s, r;
|
|
969
969
|
if (!this._renderContentStrategy.has(t.popupData.type))
|
|
970
970
|
throw new Error("Missing popup creator strategy");
|
|
971
|
-
e.style.display = "none", e.classList.remove(t.tour.config.animationClass), t.hostElement ? e.style.position = Ct(t.hostElement) : e.style.position = "fixed",
|
|
972
|
-
}).then(() => t.isFirst && t.direction === "toNext" ?
|
|
971
|
+
e.style.display = "none", e.classList.remove(t.tour.config.animationClass), t.hostElement ? e.style.position = Ct(t.hostElement) : e.style.position = "fixed", Ne(e, t.popupData, t.tour), (s = this._renderContentStrategy.get(t.popupData.type)) == null || s.renderContent(e, t.popupData, t.tour.config), (r = t.hostElement) == null || r.scrollIntoView(t.tour.config.scrollTo), n();
|
|
972
|
+
}).then(() => t.isFirst && t.direction === "toNext" ? Nt(0) : Nt(400)).then(() => {
|
|
973
973
|
e.style.display = "flex", this.updatePosition(e, t), e.classList.add(t.tour.config.animationClass);
|
|
974
974
|
});
|
|
975
975
|
}
|
|
@@ -979,8 +979,8 @@ class Ne {
|
|
|
979
979
|
}
|
|
980
980
|
renderFloatingPopup(e, t) {
|
|
981
981
|
var l;
|
|
982
|
-
const n = e.style.position === "fixed" ? window.scrollY || document.documentElement.scrollTop : 0, s = e.querySelector(`.${t.tour.config.classPrefix}-arrow`), r = [], o = b(t.popupData.position) && t.popupData.position !== "auto" ? t.popupData.position : void 0, c = (l = s == null ? void 0 : s.offsetWidth) != null ? l : 10, a = Math.sqrt(2 *
|
|
983
|
-
r.push(
|
|
982
|
+
const n = e.style.position === "fixed" ? window.scrollY || document.documentElement.scrollTop : 0, s = e.querySelector(`.${t.tour.config.classPrefix}-arrow`), r = [], o = b(t.popupData.position) && t.popupData.position !== "auto" ? t.popupData.position : void 0, c = (l = s == null ? void 0 : s.offsetWidth) != null ? l : 10, a = Math.sqrt(2 * Ot(c, 2)) / 2 + t.tour.config.highlight.padding;
|
|
983
|
+
r.push($e(a)), (t.popupData.position === "auto" || D(o)) && r.push(Ae()), !t.tour.config.arrow.disable && b(s) && r.push(De({ element: s, padding: t.tour.config.arrow.padding })), Be(t.hostElement, e, {
|
|
984
984
|
placement: o,
|
|
985
985
|
middleware: [...r]
|
|
986
986
|
}).then(({ x: f, y: h, middlewareData: g, placement: d }) => {
|
|
@@ -1013,10 +1013,10 @@ class Ne {
|
|
|
1013
1013
|
});
|
|
1014
1014
|
}
|
|
1015
1015
|
setUpStrategies() {
|
|
1016
|
-
this._renderContentStrategy.set("text", new
|
|
1016
|
+
this._renderContentStrategy.set("text", new Fe()), this._renderContentStrategy.set("custom", new He());
|
|
1017
1017
|
}
|
|
1018
1018
|
}
|
|
1019
|
-
class
|
|
1019
|
+
class We {
|
|
1020
1020
|
/** @inheritdoc */
|
|
1021
1021
|
render(e, t) {
|
|
1022
1022
|
return new Promise((n) => {
|
|
@@ -1036,7 +1036,7 @@ class Me {
|
|
|
1036
1036
|
e.style.transform = "", e.style.left = `${n.left - s}px`, e.style.top = `${n.top + r - s}px`, e.style.width = `${n.width + 2 * s}px`, e.style.height = `${n.height + 2 * s}px`, e.style.opacity = "1";
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
class
|
|
1039
|
+
class Ie {
|
|
1040
1040
|
/** @inheritdoc */
|
|
1041
1041
|
render(e, t) {
|
|
1042
1042
|
return new Promise((n) => {
|
|
@@ -1056,7 +1056,7 @@ class Ve {
|
|
|
1056
1056
|
e.style.transform = "", e.style.left = `${n.left - s}px`, e.style.top = `${n.top + r - s}px`, e.style.width = `${n.width + 2 * s}px`, e.style.height = `${n.height + 2 * s}px`;
|
|
1057
1057
|
}
|
|
1058
1058
|
}
|
|
1059
|
-
class
|
|
1059
|
+
class je {
|
|
1060
1060
|
constructor(e, t) {
|
|
1061
1061
|
x(this, "popupData");
|
|
1062
1062
|
x(this, "tour");
|
|
@@ -1121,18 +1121,18 @@ class ze {
|
|
|
1121
1121
|
function gt(i) {
|
|
1122
1122
|
return i && typeof i == "object" && !Array.isArray(i);
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1124
|
+
function Gt(i, e) {
|
|
1125
1125
|
const t = $({}, i);
|
|
1126
1126
|
return gt(i) && gt(e) && Object.keys(e).forEach((n) => {
|
|
1127
1127
|
const s = n, r = n;
|
|
1128
|
-
gt(e[s]) ? (r in i || Object.assign(t, { [r]: {} }), t[r] =
|
|
1128
|
+
gt(e[s]) ? (r in i || Object.assign(t, { [r]: {} }), t[r] = Gt(i[r], e[s])) : Object.assign(t, { [r]: e[s] });
|
|
1129
1129
|
}), t;
|
|
1130
1130
|
}
|
|
1131
|
-
function
|
|
1131
|
+
function Mt(i) {
|
|
1132
1132
|
const e = L("button", [`${i}-close`]);
|
|
1133
1133
|
return e.innerHTML = "✖", e;
|
|
1134
1134
|
}
|
|
1135
|
-
class
|
|
1135
|
+
class Ye {
|
|
1136
1136
|
/** @inheritdoc */
|
|
1137
1137
|
render(e, t) {
|
|
1138
1138
|
return t.tour.config.background.disable ? e.style.pointerEvents = "none" : e.style.pointerEvents = "auto", Promise.resolve();
|
|
@@ -1141,7 +1141,7 @@ class Ie {
|
|
|
1141
1141
|
updatePosition(e, t) {
|
|
1142
1142
|
}
|
|
1143
1143
|
}
|
|
1144
|
-
class
|
|
1144
|
+
class qe {
|
|
1145
1145
|
constructor(e) {
|
|
1146
1146
|
x(this, "_event", null);
|
|
1147
1147
|
x(this, "_callbacks", []);
|
|
@@ -1163,13 +1163,13 @@ class je {
|
|
|
1163
1163
|
});
|
|
1164
1164
|
}
|
|
1165
1165
|
}
|
|
1166
|
-
class
|
|
1166
|
+
class Ue {
|
|
1167
1167
|
constructor() {
|
|
1168
1168
|
x(this, "_events", /* @__PURE__ */ new Map());
|
|
1169
1169
|
}
|
|
1170
1170
|
on(e, t) {
|
|
1171
1171
|
let n = this._events.get(e);
|
|
1172
|
-
n || (n = new
|
|
1172
|
+
n || (n = new qe(e), this._events.set(e, n)), n.registerCallback(t);
|
|
1173
1173
|
}
|
|
1174
1174
|
off(e, t) {
|
|
1175
1175
|
const n = this._events.get(e);
|
|
@@ -1184,7 +1184,7 @@ class Ye {
|
|
|
1184
1184
|
t && t.fire();
|
|
1185
1185
|
}
|
|
1186
1186
|
}
|
|
1187
|
-
class
|
|
1187
|
+
class Ke {
|
|
1188
1188
|
constructor() {
|
|
1189
1189
|
x(this, "_activeTour", null);
|
|
1190
1190
|
}
|
|
@@ -1198,15 +1198,15 @@ class qe {
|
|
|
1198
1198
|
this._activeTour = e;
|
|
1199
1199
|
}
|
|
1200
1200
|
}
|
|
1201
|
-
const ot = new
|
|
1202
|
-
class
|
|
1201
|
+
const ot = new Ke();
|
|
1202
|
+
class Ge extends Ue {
|
|
1203
1203
|
constructor(t) {
|
|
1204
|
-
var n, s, r, o, c, a, l, f, h, g, d, u, p, m, y, C, v, S, _, w,
|
|
1204
|
+
var n, s, r, o, c, a, l, f, h, g, d, u, p, m, y, C, v, S, _, w, P, T, W, M, I, E, O, Y, k, q, U, K, St, Pt, Et;
|
|
1205
1205
|
super();
|
|
1206
|
-
x(this, "popupRenderer", new
|
|
1207
|
-
x(this, "highlightRenderer", new
|
|
1208
|
-
x(this, "interactionRenderer", new
|
|
1209
|
-
x(this, "backgroundRenderer", new
|
|
1206
|
+
x(this, "popupRenderer", new ze());
|
|
1207
|
+
x(this, "highlightRenderer", new We());
|
|
1208
|
+
x(this, "interactionRenderer", new Ie());
|
|
1209
|
+
x(this, "backgroundRenderer", new Ye());
|
|
1210
1210
|
x(this, "_popup", null);
|
|
1211
1211
|
x(this, "_highlight", null);
|
|
1212
1212
|
x(this, "_interaction", null);
|
|
@@ -1244,28 +1244,29 @@ class Ke extends Ye {
|
|
|
1244
1244
|
inline: "center"
|
|
1245
1245
|
},
|
|
1246
1246
|
// @ts-expect-error
|
|
1247
|
-
closeIcon: (y = t.closeIcon) != null ? y :
|
|
1247
|
+
closeIcon: (y = t.closeIcon) != null ? y : Mt((m = t.classPrefix) != null ? m : "siteguide"),
|
|
1248
1248
|
arrow: {
|
|
1249
1249
|
disable: (v = (C = t.arrow) == null ? void 0 : C.disable) != null ? v : !1,
|
|
1250
|
-
class: (_ = (S = t.arrow) == null ? void 0 : S.class) != null ? _ : ""
|
|
1250
|
+
class: (_ = (S = t.arrow) == null ? void 0 : S.class) != null ? _ : "",
|
|
1251
|
+
padding: (P = (w = t.arrow) == null ? void 0 : w.padding) != null ? P : 24
|
|
1251
1252
|
},
|
|
1252
1253
|
highlight: {
|
|
1253
|
-
disable: (
|
|
1254
|
-
padding: (
|
|
1255
|
-
class: (
|
|
1254
|
+
disable: (W = (T = t.highlight) == null ? void 0 : T.disable) != null ? W : !1,
|
|
1255
|
+
padding: (I = (M = t.highlight) == null ? void 0 : M.padding) != null ? I : 8,
|
|
1256
|
+
class: (O = (E = t.highlight) == null ? void 0 : E.class) != null ? O : ""
|
|
1256
1257
|
},
|
|
1257
1258
|
progress: {
|
|
1258
|
-
disable: (
|
|
1259
|
+
disable: (k = (Y = t.progress) == null ? void 0 : Y.disable) != null ? k : !0,
|
|
1259
1260
|
text: "Step {{currentStep}} of {{totalSteps}}"
|
|
1260
1261
|
},
|
|
1261
1262
|
interaction: {
|
|
1262
|
-
disable: (
|
|
1263
|
+
disable: (U = (q = t.interaction) == null ? void 0 : q.disable) != null ? U : !0
|
|
1263
1264
|
},
|
|
1264
1265
|
background: {
|
|
1265
|
-
disable: (
|
|
1266
|
+
disable: (St = (K = t.background) == null ? void 0 : K.disable) != null ? St : !0
|
|
1266
1267
|
},
|
|
1267
|
-
keyboardControl: (
|
|
1268
|
-
translateFn: (
|
|
1268
|
+
keyboardControl: (Pt = t.keyboardControl) != null ? Pt : !1,
|
|
1269
|
+
translateFn: (Et = t.translateFn) != null ? Et : (Jt) => Jt
|
|
1269
1270
|
};
|
|
1270
1271
|
}
|
|
1271
1272
|
get stepList() {
|
|
@@ -1297,7 +1298,7 @@ class Ke extends Ye {
|
|
|
1297
1298
|
const s = this._stepList.reduce((r, o) => o.index !== null && o.index !== void 0 && o.index > r ? o.index : r, -1);
|
|
1298
1299
|
t.index = s + 1;
|
|
1299
1300
|
}
|
|
1300
|
-
const n = new
|
|
1301
|
+
const n = new je(this, t);
|
|
1301
1302
|
this._stepList.push(n), this._stepList.sort((s, r) => s.index - r.index);
|
|
1302
1303
|
}
|
|
1303
1304
|
addSteps(t) {
|
|
@@ -1347,7 +1348,8 @@ class Ke extends Ye {
|
|
|
1347
1348
|
this.changeStepTo(t, t > ((n = this.activeStepIndex) != null ? n : -1) ? "toNext" : "fromBack");
|
|
1348
1349
|
}
|
|
1349
1350
|
setConfig(t) {
|
|
1350
|
-
|
|
1351
|
+
var n, s;
|
|
1352
|
+
b(t.classPrefix) && this._config.classPrefix !== t.classPrefix && (this._config.closeIcon = (s = t.closeIcon) != null ? s : Mt((n = t.classPrefix) != null ? n : "siteguide")), this._config = Gt(this._config, t);
|
|
1351
1353
|
}
|
|
1352
1354
|
changeStepTo(t, n) {
|
|
1353
1355
|
var s;
|
|
@@ -1364,10 +1366,10 @@ class Ke extends Ye {
|
|
|
1364
1366
|
return t.observe(document.body), t;
|
|
1365
1367
|
}
|
|
1366
1368
|
}
|
|
1367
|
-
const
|
|
1369
|
+
const Je = ot;
|
|
1368
1370
|
export {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1371
|
+
Je as Siteguide,
|
|
1372
|
+
Ge as Tour,
|
|
1373
|
+
je as TourStep,
|
|
1372
1374
|
L as createElement
|
|
1373
1375
|
};
|
package/package.json
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "siteguide.js",
|
|
3
|
-
"version": "0.10.
|
|
4
|
-
"description": "Open source library made with vanilla Javascript and CSS to help you build website guides and onboarding tours.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"siteguide",
|
|
8
|
-
"siteguide.js",
|
|
9
|
-
"site tour",
|
|
10
|
-
"tour",
|
|
11
|
-
"tutorial",
|
|
12
|
-
"tour",
|
|
13
|
-
"guide",
|
|
14
|
-
"onboarding tour"
|
|
15
|
-
],
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/handeh0ch/siteguide.js.git"
|
|
19
|
-
},
|
|
20
|
-
"author": {
|
|
21
|
-
"name": "Borislav Shelanov",
|
|
22
|
-
"email": "borislav.shelanov@gmail.com"
|
|
23
|
-
},
|
|
24
|
-
"main": "./dist/index.cjs",
|
|
25
|
-
"module": "./dist/index.mjs",
|
|
26
|
-
"types": "./dist/index.d.ts",
|
|
27
|
-
"type": "module",
|
|
28
|
-
"exports": {
|
|
29
|
-
".": {
|
|
30
|
-
"types": "./dist/index.d.ts",
|
|
31
|
-
"require": "./dist/index.js",
|
|
32
|
-
"import": "./dist/index.mjs",
|
|
33
|
-
"default": "./dist/index.mjs"
|
|
34
|
-
},
|
|
35
|
-
"./dist/css/siteguide.css": "./dist/css/siteguide.css"
|
|
36
|
-
},
|
|
37
|
-
"files": [
|
|
38
|
-
"dist"
|
|
39
|
-
],
|
|
40
|
-
"private": false,
|
|
41
|
-
"publishConfig": {
|
|
42
|
-
"registry": "https://registry.npmjs.org/",
|
|
43
|
-
"access": "public"
|
|
44
|
-
},
|
|
45
|
-
"scripts": {
|
|
46
|
-
"clean": "rimraf dist",
|
|
47
|
-
"dev": "vite build --watch",
|
|
48
|
-
"start": "vite --host --open",
|
|
49
|
-
"publish": "npm run build && npm publish",
|
|
50
|
-
"build": "npm run clean && vite build",
|
|
51
|
-
"rollup:dts": "api-extractor run",
|
|
52
|
-
"append:dts": "npm run rollup:dts",
|
|
53
|
-
"lint:scripts": "eslint ./src --ext .ts",
|
|
54
|
-
"lint:styles": "stylelint ./**/*.{css,scss}",
|
|
55
|
-
"format:scripts": "prettier ./src --write",
|
|
56
|
-
"format:styles": "stylelint ./**/*.{css,scss} --fix",
|
|
57
|
-
"check-circular": "madge --circular --extensions ts ./src"
|
|
58
|
-
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"@floating-ui/dom": "^1.6.12"
|
|
61
|
-
},
|
|
62
|
-
"devDependencies": {
|
|
63
|
-
"@types/node": "^22.9.1",
|
|
64
|
-
"postcss": "^8.4.49",
|
|
65
|
-
"rollup": "^4.27.4",
|
|
66
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
67
|
-
"typescript": "^5.4.2",
|
|
68
|
-
"vite": "^5.4.10",
|
|
69
|
-
"vite-plugin-dts": "^4.3.0"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "siteguide.js",
|
|
3
|
+
"version": "0.10.2",
|
|
4
|
+
"description": "Open source library made with vanilla Javascript and CSS to help you build website guides and onboarding tours.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"siteguide",
|
|
8
|
+
"siteguide.js",
|
|
9
|
+
"site tour",
|
|
10
|
+
"tour",
|
|
11
|
+
"tutorial",
|
|
12
|
+
"tour",
|
|
13
|
+
"guide",
|
|
14
|
+
"onboarding tour"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/handeh0ch/siteguide.js.git"
|
|
19
|
+
},
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "Borislav Shelanov",
|
|
22
|
+
"email": "borislav.shelanov@gmail.com"
|
|
23
|
+
},
|
|
24
|
+
"main": "./dist/index.cjs",
|
|
25
|
+
"module": "./dist/index.mjs",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"type": "module",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"require": "./dist/index.js",
|
|
32
|
+
"import": "./dist/index.mjs",
|
|
33
|
+
"default": "./dist/index.mjs"
|
|
34
|
+
},
|
|
35
|
+
"./dist/css/siteguide.css": "./dist/css/siteguide.css"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist"
|
|
39
|
+
],
|
|
40
|
+
"private": false,
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"registry": "https://registry.npmjs.org/",
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"clean": "rimraf dist",
|
|
47
|
+
"dev": "vite build --watch",
|
|
48
|
+
"start": "vite --host --open",
|
|
49
|
+
"publish": "npm run build && npm publish",
|
|
50
|
+
"build": "npm run clean && vite build",
|
|
51
|
+
"rollup:dts": "api-extractor run",
|
|
52
|
+
"append:dts": "npm run rollup:dts",
|
|
53
|
+
"lint:scripts": "eslint ./src --ext .ts",
|
|
54
|
+
"lint:styles": "stylelint ./**/*.{css,scss}",
|
|
55
|
+
"format:scripts": "prettier ./src --write",
|
|
56
|
+
"format:styles": "stylelint ./**/*.{css,scss} --fix",
|
|
57
|
+
"check-circular": "madge --circular --extensions ts ./src"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@floating-ui/dom": "^1.6.12"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/node": "^22.9.1",
|
|
64
|
+
"postcss": "^8.4.49",
|
|
65
|
+
"rollup": "^4.27.4",
|
|
66
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
67
|
+
"typescript": "^5.4.2",
|
|
68
|
+
"vite": "^5.4.10",
|
|
69
|
+
"vite-plugin-dts": "^4.3.0"
|
|
70
|
+
}
|
|
71
|
+
}
|