Files
liceo-ariosto/media/plg_system_guidedtours/js/guidedtours.min.js
2025-06-17 11:53:18 +02:00

1 line
63 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var isMergeableObject=function(e){return isNonNullObject(e)&&!isSpecial(e)};function isNonNullObject(e){return!!e&&"object"==typeof e}function isSpecial(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||isReactElement(e)}var canUseSymbol="function"==typeof Symbol&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(e){return e.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(e){return Array.isArray(e)?[]:{}}function cloneUnlessOtherwiseSpecified(e,t){return!1!==t.clone&&t.isMergeableObject(e)?deepmerge(emptyTarget(e),e,t):e}function defaultArrayMerge(e,t,n){return e.concat(t).map((function(e){return cloneUnlessOtherwiseSpecified(e,n)}))}function getMergeFunction(e,t){if(!t.customMerge)return deepmerge;var n=t.customMerge(e);return"function"==typeof n?n:deepmerge}function getEnumerableOwnPropertySymbols(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}function getKeys(e){return Object.keys(e).concat(getEnumerableOwnPropertySymbols(e))}function propertyIsOnObject(e,t){try{return t in e}catch(e){return!1}}function propertyIsUnsafe(e,t){return propertyIsOnObject(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function mergeObject(e,t,n){var o={};return n.isMergeableObject(e)&&getKeys(e).forEach((function(t){o[t]=cloneUnlessOtherwiseSpecified(e[t],n)})),getKeys(t).forEach((function(i){propertyIsUnsafe(e,i)||(propertyIsOnObject(e,i)&&n.isMergeableObject(t[i])?o[i]=getMergeFunction(i,n)(e[i],t[i],n):o[i]=cloneUnlessOtherwiseSpecified(t[i],n))})),o}function deepmerge(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||defaultArrayMerge,n.isMergeableObject=n.isMergeableObject||isMergeableObject,n.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var o=Array.isArray(t);return o===Array.isArray(e)?o?n.arrayMerge(e,t,n):mergeObject(e,t,n):cloneUnlessOtherwiseSpecified(t,n)}deepmerge.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return deepmerge(e,n,t)}),{})};var deepmerge_1=deepmerge,cjs=deepmerge_1;function isElement$1(e){return e instanceof Element}function isHTMLElement$1(e){return e instanceof HTMLElement}function isFunction(e){return"function"==typeof e}function isString(e){return"string"==typeof e}function isUndefined(e){return void 0===e}class Evented{on(e,t,n,o=!1){return isUndefined(this.bindings)&&(this.bindings={}),isUndefined(this.bindings[e])&&(this.bindings[e]=[]),this.bindings[e].push({handler:t,ctx:n,once:o}),this}once(e,t,n){return this.on(e,t,n,!0)}off(e,t){return isUndefined(this.bindings)||isUndefined(this.bindings[e])||(isUndefined(t)?delete this.bindings[e]:this.bindings[e].forEach(((n,o)=>{n.handler===t&&this.bindings[e].splice(o,1)}))),this}trigger(e,...t){return!isUndefined(this.bindings)&&this.bindings[e]&&this.bindings[e].forEach(((n,o)=>{const{ctx:i,handler:s,once:r}=n,a=i||this;s.apply(a,t),r&&this.bindings[e].splice(o,1)})),this}}function autoBind(e){const t=Object.getOwnPropertyNames(e.constructor.prototype);for(let n=0;n<t.length;n++){const o=t[n],i=e[o];"constructor"!==o&&"function"==typeof i&&(e[o]=i.bind(e))}return e}function _setupAdvanceOnHandler(e,t){return n=>{if(t.isOpen()){const o=t.el&&n.currentTarget===t.el;(!isUndefined(e)&&n.currentTarget.matches(e)||o)&&t.tour.next()}}}function bindAdvance(e){const{event:t,selector:n}=e.options.advanceOn||{};if(!t)return console.error("advanceOn was defined, but no event name was passed.");{const o=_setupAdvanceOnHandler(n,e);let i;try{i=document.querySelector(n)}catch(e){}if(!isUndefined(n)&&!i)return console.error(`No element was found for the selector supplied to advanceOn: ${n}`);i?(i.addEventListener(t,o),e.on("destroy",(()=>i.removeEventListener(t,o)))):(document.body.addEventListener(t,o,!0),e.on("destroy",(()=>document.body.removeEventListener(t,o,!0))))}}function normalizePrefix(e){return isString(e)&&""!==e?"-"!==e.charAt(e.length-1)?`${e}-`:e:""}function parseAttachTo(e){const t=e.options.attachTo||{},n=Object.assign({},t);if(isFunction(n.element)&&(n.element=n.element.call(e)),isString(n.element)){try{n.element=document.querySelector(n.element)}catch(e){}n.element||console.error(`The element for this Shepherd step was not found ${t.element}`)}return n}function shouldCenterStep(e){return null==e||(!e.element||!e.on)}function uuid(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n,o,i={},s=Object.keys(e);for(o=0;o<s.length;o++)n=s[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}const min=Math.min,max=Math.max,round=Math.round,floor=Math.floor,createCoords=e=>({x:e,y:e}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp(e,t,n){return max(e,min(t,n))}function evaluate(e,t){return"function"==typeof e?e(t):e}function getSide(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getOppositeAxis(e){return"x"===e?"y":"x"}function getAxisLength(e){return"y"===e?"height":"width"}function getSideAxis(e){return["top","bottom"].includes(getSide(e))?"y":"x"}function getAlignmentAxis(e){return getOppositeAxis(getSideAxis(e))}function getAlignmentSides(e,t,n){void 0===n&&(n=!1);const o=getAlignment(e),i=getAlignmentAxis(e),s=getAxisLength(i);let r="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=getOppositePlacement(r)),[r,getOppositePlacement(r)]}function getExpandedPlacements(e){const t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}function getOppositeAlignmentPlacement(e){return e.replace(/start|end/g,(e=>oppositeAlignmentMap[e]))}function getSideList(e,t,n){const o=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?s:r;default:return[]}}function getOppositeAxisPlacements(e,t,n,o){const i=getAlignment(e);let s=getSideList(getSide(e),"start"===n,o);return i&&(s=s.map((e=>e+"-"+i)),t&&(s=s.concat(s.map(getOppositeAlignmentPlacement)))),s}function getOppositePlacement(e){return e.replace(/left|right|bottom|top/g,(e=>oppositeSideMap[e]))}function expandPaddingObject(e){return _extends({top:0,right:0,bottom:0,left:0},e)}function getPaddingObject(e){return"number"!=typeof e?expandPaddingObject(e):{top:e,right:e,bottom:e,left:e}}function rectToClientRect(e){return _extends({},e,{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}const _excluded2=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],_excluded4=["mainAxis","crossAxis","limiter"];function computeCoordsFromPlacement(e,t,n){let{reference:o,floating:i}=e;const s=getSideAxis(t),r=getAlignmentAxis(t),a=getAxisLength(r),c=getSide(t),l="y"===s,u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,p=o[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:o.y-i.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-i.width,y:d};break;default:h={x:o.x,y:o.y}}switch(getAlignment(t)){case"start":h[r]-=p*(n&&l?-1:1);break;case"end":h[r]+=p*(n&&l?-1:1)}return h}const computePosition$1=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,a=s.filter(Boolean),c=await(null==r.isRTL?void 0:r.isRTL(t));let l=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=computeCoordsFromPlacement(l,o,c),p=o,h={},f=0;for(let n=0;n<a.length;n++){const{name:s,fn:m}=a[n],{x:g,y:_,data:b,reset:y}=await m({x:u,y:d,initialPlacement:o,placement:p,strategy:i,middlewareData:h,rects:l,platform:r,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=_?_:d,h=_extends({},h,{[s]:_extends({},h[s],b)}),y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(p=y.placement),y.rects&&(l=!0===y.rects?await r.getElementRects({reference:e,floating:t,strategy:i}):y.rects),({x:u,y:d}=computeCoordsFromPlacement(l,p,c))),n=-1)}return{x:u,y:d,placement:p,strategy:i,middlewareData:h}};async function detectOverflow(e,t){var n;void 0===t&&(t={});const{x:o,y:i,platform:s,rects:r,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=evaluate(t,e),f=getPaddingObject(h),m=a[p?"floating"===d?"reference":"floating":d],g=rectToClientRect(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(m)))||n?m:m.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),_="floating"===d?_extends({},r.floating,{x:o,y:i}):r.reference,b=await(null==s.getOffsetParent?void 0:s.getOffsetParent(a.floating)),y=await(null==s.isElement?void 0:s.isElement(b))&&await(null==s.getScale?void 0:s.getScale(b))||{x:1,y:1},x=rectToClientRect(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:b,strategy:c}):_);return{top:(g.top-x.top+f.top)/y.y,bottom:(x.bottom-g.bottom+f.bottom)/y.y,left:(g.left-x.left+f.left)/y.x,right:(x.right-g.right+f.right)/y.x}}const arrow=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:s,platform:r,elements:a}=t,{element:c,padding:l=0}=evaluate(e,t)||{};if(null==c)return{};const u=getPaddingObject(l),d={x:n,y:o},p=getAlignmentAxis(i),h=getAxisLength(p),f=await r.getDimensions(c),m="y"===p,g=m?"top":"left",_=m?"bottom":"right",b=m?"clientHeight":"clientWidth",y=s.reference[h]+s.reference[p]-d[p]-s.floating[h],x=d[p]-s.reference[p],S=await(null==r.getOffsetParent?void 0:r.getOffsetParent(c));let v=S?S[b]:0;v&&await(null==r.isElement?void 0:r.isElement(S))||(v=a.floating[b]||s.floating[h]);const w=y/2-x/2,$=v/2-f[h]/2-1,E=min(u[g],$),T=min(u[_],$),O=E,A=v-f[h]-T,I=v/2-f[h]/2+w,C=clamp(O,I,A),k=null!=getAlignment(i)&&I!=C&&s.reference[h]/2-(I<O?E:T)-f[h]/2<0?I<O?O-I:A-I:0;return{[p]:d[p]-k,data:{[p]:C,centerOffset:I-C+k}}}}),flip=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:o,middlewareData:i,rects:s,initialPlacement:r,platform:a,elements:c}=t,l=evaluate(e,t),{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0}=l,g=_objectWithoutPropertiesLoose(l,_excluded2),_=getSide(o),b=getSide(r)===r,y=await(null==a.isRTL?void 0:a.isRTL(c.floating)),x=p||(b||!m?[getOppositePlacement(r)]:getExpandedPlacements(r));p||"none"===f||x.push(...getOppositeAxisPlacements(r,m,f,y));const S=[r,...x],v=await detectOverflow(t,g),w=[];let $=(null==(n=i.flip)?void 0:n.overflows)||[];if(u&&w.push(v[_]),d){const e=getAlignmentSides(o,s,y);w.push(v[e[0]],v[e[1]])}if($=[...$,{placement:o,overflows:w}],!w.every((e=>e<=0))){var E,T;const e=((null==(E=i.flip)?void 0:E.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:$},reset:{placement:t}};let n=null==(T=$.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(h){case"bestFit":{var O;const e=null==(O=$.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=r}if(o!==n)return{reset:{placement:n}}}return{}}}},shift=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,s=evaluate(e,t),{mainAxis:r=!0,crossAxis:a=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=s,l=_objectWithoutPropertiesLoose(s,_excluded4),u={x:n,y:o},d=await detectOverflow(t,l),p=getSideAxis(getSide(i)),h=getOppositeAxis(p);let f=u[h],m=u[p];if(r){const e="y"===h?"bottom":"right";f=clamp(f+d["y"===h?"top":"left"],f,f-d[e])}if(a){const e="y"===p?"bottom":"right";m=clamp(m+d["y"===p?"top":"left"],m,m-d[e])}const g=c.fn(_extends({},t,{[h]:f,[p]:m}));return _extends({},g,{data:{x:g.x-n,y:g.y-o}})}}},limitShift=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:s,middlewareData:r}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=evaluate(e,t),u={x:n,y:o},d=getSideAxis(i),p=getOppositeAxis(d);let h=u[p],f=u[d];const m=evaluate(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:_extends({mainAxis:0,crossAxis:0},m);if(c){const e="y"===p?"height":"width",t=s.reference[p]-s.floating[e]+g.mainAxis,n=s.reference[p]+s.reference[e]-g.mainAxis;h<t?h=t:h>n&&(h=n)}if(l){var _,b;const e="y"===p?"width":"height",t=["top","left"].includes(getSide(i)),n=s.reference[d]-s.floating[e]+(t&&(null==(_=r.offset)?void 0:_[d])||0)+(t?0:g.crossAxis),o=s.reference[d]+s.reference[e]+(t?0:(null==(b=r.offset)?void 0:b[d])||0)-(t?g.crossAxis:0);f<n?f=n:f>o&&(f=o)}return{[p]:h,[d]:f}}}};function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():"#document"}function getWindow(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function getDocumentElement(e){var t;return null==(t=(isNode(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function isNode(e){return e instanceof Node||e instanceof getWindow(e).Node}function isElement(e){return e instanceof Element||e instanceof getWindow(e).Element}function isHTMLElement(e){return e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement}function isShadowRoot(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot)}function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=getComputedStyle(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function isTableElement(e){return["table","td","th"].includes(getNodeName(e))}function isContainingBlock(e){const t=isWebKit(),n=getComputedStyle(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;t=getParentNode(t)}return null}function isWebKit(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(e){return["html","body","#document"].includes(getNodeName(e))}function getComputedStyle(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function getParentNode(e){if("html"===getNodeName(e))return e;const t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument?e.ownerDocument.body:e.body:isHTMLElement(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t){var n;void 0===t&&(t=[]);const o=getNearestOverflowAncestor(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),s=getWindow(o);return i?t.concat(s,s.visualViewport||[],isOverflowElement(o)?o:[]):t.concat(o,getOverflowAncestors(o))}function getCssDimensions(e){const t=getComputedStyle(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=isHTMLElement(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,a=round(n)!==s||round(o)!==r;return a&&(n=s,o=r),{width:n,height:o,$:a}}function unwrapElement(e){return isElement(e)?e:e.contextElement}function getScale(e){const t=unwrapElement(e);if(!isHTMLElement(t))return createCoords(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:s}=getCssDimensions(t);let r=(s?round(n.width):n.width)/o,a=(s?round(n.height):n.height)/i;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const noOffsets=createCoords(0);function getVisualOffsets(e){const t=getWindow(e);return isWebKit()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:noOffsets}function shouldAddVisualOffsets(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==getWindow(e))&&t}function getBoundingClientRect(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),s=unwrapElement(e);let r=createCoords(1);t&&(o?isElement(o)&&(r=getScale(o)):r=getScale(e));const a=shouldAddVisualOffsets(s,n,o)?getVisualOffsets(s):createCoords(0);let c=(i.left+a.x)/r.x,l=(i.top+a.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(s){const e=getWindow(s),t=o&&isElement(o)?getWindow(o):o;let n=e.frameElement;for(;n&&o&&t!==e;){const e=getScale(n),t=n.getBoundingClientRect(),o=getComputedStyle(n),i=t.left+(n.clientLeft+parseFloat(o.paddingLeft))*e.x,s=t.top+(n.clientTop+parseFloat(o.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=i,l+=s,n=getWindow(n).frameElement}}return rectToClientRect({width:u,height:d,x:c,y:l})}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{rect:t,offsetParent:n,strategy:o}=e;const i=isHTMLElement(n),s=getDocumentElement(n);if(n===s)return t;let r={scrollLeft:0,scrollTop:0},a=createCoords(1);const c=createCoords(0);if((i||!i&&"fixed"!==o)&&(("body"!==getNodeName(n)||isOverflowElement(s))&&(r=getNodeScroll(n)),isHTMLElement(n))){const e=getBoundingClientRect(n);a=getScale(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-r.scrollLeft*a.x+c.x,y:t.y*a.y-r.scrollTop*a.y+c.y}}function getClientRects(e){return Array.from(e.getClientRects())}function getWindowScrollBarX(e){return getBoundingClientRect(getDocumentElement(e)).left+getNodeScroll(e).scrollLeft}function getDocumentRect(e){const t=getDocumentElement(e),n=getNodeScroll(e),o=e.ownerDocument.body,i=max(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=max(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+getWindowScrollBarX(e);const a=-n.scrollTop;return"rtl"===getComputedStyle(o).direction&&(r+=max(t.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:a}}function getViewportRect(e,t){const n=getWindow(e),o=getDocumentElement(e),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,a=0,c=0;if(i){s=i.width,r=i.height;const e=isWebKit();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:r,x:a,y:c}}function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,"fixed"===t),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=isHTMLElement(e)?getScale(e):createCoords(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:i*s.x,y:o*s.y}}function getClientRectFromClippingAncestor(e,t,n){let o;if("viewport"===t)o=getViewportRect(e,n);else if("document"===t)o=getDocumentRect(getDocumentElement(e));else if(isElement(t))o=getInnerBoundingClientRect(t,n);else{const n=getVisualOffsets(e);o=_extends({},t,{x:t.x-n.x,y:t.y-n.y})}return rectToClientRect(o)}function hasFixedPositionAncestor(e,t){const n=getParentNode(e);return!(n===t||!isElement(n)||isLastTraversableNode(n))&&("fixed"===getComputedStyle(n).position||hasFixedPositionAncestor(n,t))}function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let o=getOverflowAncestors(e).filter((e=>isElement(e)&&"body"!==getNodeName(e))),i=null;const s="fixed"===getComputedStyle(e).position;let r=s?getParentNode(e):e;for(;isElement(r)&&!isLastTraversableNode(r);){const t=getComputedStyle(r),n=isContainingBlock(r);n||"fixed"!==t.position||(i=null);(s?!n&&!i:!n&&"static"===t.position&&!!i&&["absolute","fixed"].includes(i.position)||isOverflowElement(r)&&!n&&hasFixedPositionAncestor(e,r))?o=o.filter((e=>e!==r)):i=t,r=getParentNode(r)}return t.set(e,o),o}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const s=[..."clippingAncestors"===n?getClippingElementAncestors(t,this._c):[].concat(n),o],r=s[0],a=s.reduce(((e,n)=>{const o=getClientRectFromClippingAncestor(t,n,i);return e.top=max(o.top,e.top),e.right=min(o.right,e.right),e.bottom=min(o.bottom,e.bottom),e.left=max(o.left,e.left),e}),getClientRectFromClippingAncestor(t,r,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function getDimensions(e){return getCssDimensions(e)}function getRectRelativeToOffsetParent(e,t,n){const o=isHTMLElement(t),i=getDocumentElement(t),s="fixed"===n,r=getBoundingClientRect(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=createCoords(0);if(o||!o&&!s)if(("body"!==getNodeName(t)||isOverflowElement(i))&&(a=getNodeScroll(t)),o){const e=getBoundingClientRect(t,!0,s,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&(c.x=getWindowScrollBarX(i));return{x:r.left+a.scrollLeft-c.x,y:r.top+a.scrollTop-c.y,width:r.width,height:r.height}}function getTrueOffsetParent(e,t){return isHTMLElement(e)&&"fixed"!==getComputedStyle(e).position?t?t(e):e.offsetParent:null}function getOffsetParent(e,t){const n=getWindow(e);if(!isHTMLElement(e))return n;let o=getTrueOffsetParent(e,t);for(;o&&isTableElement(o)&&"static"===getComputedStyle(o).position;)o=getTrueOffsetParent(o,t);return o&&("html"===getNodeName(o)||"body"===getNodeName(o)&&"static"===getComputedStyle(o).position&&!isContainingBlock(o))?n:o||getContainingBlock(e)||n}const getElementRects=async function(e){let{reference:t,floating:n,strategy:o}=e;const i=this.getOffsetParent||getOffsetParent,s=this.getDimensions;return{reference:getRectRelativeToOffsetParent(t,await i(n),o),floating:_extends({x:0,y:0},await s(n))}};function isRTL(e){return"rtl"===getComputedStyle(e).direction}const platform={convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement,getClippingRect:getClippingRect,getOffsetParent:getOffsetParent,getElementRects:getElementRects,getClientRects:getClientRects,getDimensions:getDimensions,getScale:getScale,isElement:isElement,isRTL:isRTL};function observeMove(e,t){let n,o=null;const i=getDocumentElement(e);function s(){clearTimeout(n),o&&o.disconnect(),o=null}return function r(a,c){void 0===a&&(a=!1),void 0===c&&(c=1),s();const{left:l,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const h={rootMargin:-floor(u)+"px "+-floor(i.clientWidth-(l+d))+"px "+-floor(i.clientHeight-(u+p))+"px "+-floor(l)+"px",threshold:max(0,min(1,c))||1};let f=!0;function m(e){const t=e[0].intersectionRatio;if(t!==c){if(!f)return r();t?r(!1,t):n=setTimeout((()=>{r(!1,1e-7)}),100)}f=!1}try{o=new IntersectionObserver(m,_extends({},h,{root:i.ownerDocument}))}catch(e){o=new IntersectionObserver(m,h)}o.observe(e)}(!0),s}function autoUpdate(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:c=!1}=o,l=unwrapElement(e),u=i||s?[...l?getOverflowAncestors(l):[],...getOverflowAncestors(t)]:[];u.forEach((e=>{i&&e.addEventListener("scroll",n,{passive:!0}),s&&e.addEventListener("resize",n)}));const d=l&&a?observeMove(l,n):null;let p,h=-1,f=null;r&&(f=new ResizeObserver((e=>{let[o]=e;o&&o.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{f&&f.observe(t)}))),n()})),l&&!c&&f.observe(l),f.observe(t));let m=c?getBoundingClientRect(e):null;return c&&function t(){const o=getBoundingClientRect(e);!m||o.x===m.x&&o.y===m.y&&o.width===m.width&&o.height===m.height||n();m=o,p=requestAnimationFrame(t)}(),n(),()=>{u.forEach((e=>{i&&e.removeEventListener("scroll",n),s&&e.removeEventListener("resize",n)})),d&&d(),f&&f.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const computePosition=(e,t,n)=>{const o=new Map,i=_extends({platform:platform},n),s=_extends({},i.platform,{_c:o});return computePosition$1(e,t,_extends({},i,{platform:s}))};function setupTooltip(e){e.cleanup&&e.cleanup();const t=e._getResolvedAttachToOptions();let n=t.element;const o=getFloatingUIOptions(t,e),i=shouldCenterStep(t);if(i){n=document.body;e.shepherdElementComponent.getElement().classList.add("shepherd-centered")}return e.cleanup=autoUpdate(n,e.el,(()=>{e.el?setPosition(n,e,o,i):e.cleanup()})),e.target=t.element,o}function mergeTooltipConfig(e,t){return{floatingUIOptions:cjs(e.floatingUIOptions||{},t.floatingUIOptions||{})}}function destroyTooltip(e){e.cleanup&&e.cleanup(),e.cleanup=null}function setPosition(e,t,n,o){return computePosition(e,t.el,n).then(floatingUIposition(t,o)).then((e=>new Promise((t=>{setTimeout((()=>t(e)),300)})))).then((e=>{e&&e.el&&e.el.focus({preventScroll:!0})}))}function floatingUIposition(e,t){return({x:n,y:o,placement:i,middlewareData:s})=>e.el?(t?Object.assign(e.el.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}):Object.assign(e.el.style,{position:"absolute",left:`${n}px`,top:`${o}px`}),e.el.dataset.popperPlacement=i,placeArrow(e.el,s),e):e}function placeArrow(e,t){const n=e.querySelector(".shepherd-arrow");if(n&&t.arrow){const{x:e,y:o}=t.arrow;Object.assign(n.style,{left:null!=e?`${e}px`:"",top:null!=o?`${o}px`:""})}}function getFloatingUIOptions(e,t){const n={strategy:"absolute",middleware:[]},o=addArrow(t);return shouldCenterStep(e)||(n.middleware.push(flip(),shift({limiter:limitShift(),crossAxis:!0})),o&&n.middleware.push(arrow({element:o})),n.placement=e.on),cjs(t.options.floatingUIOptions||{},n)}function addArrow(e){return!(!e.options.arrow||!e.el)&&e.el.querySelector(".shepherd-arrow")}function noop(){}function assign(e,t){for(const n in t)e[n]=t[n];return e}function run(e){return e()}function blank_object(){return Object.create(null)}function run_all(e){e.forEach(run)}function is_function(e){return"function"==typeof e}function safe_not_equal(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function is_empty(e){return 0===Object.keys(e).length}function append(e,t){e.appendChild(t)}function insert(e,t,n){e.insertBefore(t,n||null)}function detach(e){e.parentNode&&e.parentNode.removeChild(e)}function destroy_each(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function element(e){return document.createElement(e)}function svg_element(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function text(e){return document.createTextNode(e)}function space(){return text(" ")}function empty(){return text("")}function listen(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function attr(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const always_set_through_set_attribute=["width","height"];function set_attributes(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const o in t)null==t[o]?e.removeAttribute(o):"style"===o?e.style.cssText=t[o]:"__value"===o?e.value=e[o]=t[o]:n[o]&&n[o].set&&-1===always_set_through_set_attribute.indexOf(o)?e[o]=t[o]:attr(e,o,t[o])}function children(e){return Array.from(e.childNodes)}function toggle_class(e,t,n){e.classList[n?"add":"remove"](t)}let current_component;function set_current_component(e){current_component=e}function get_current_component(){if(!current_component)throw new Error("Function called outside component initialization");return current_component}function onMount(e){get_current_component().$$.on_mount.push(e)}function afterUpdate(e){get_current_component().$$.after_update.push(e)}const dirty_components=[],binding_callbacks=[];let render_callbacks=[];const flush_callbacks=[],resolved_promise=Promise.resolve();let update_scheduled=!1;function schedule_update(){update_scheduled||(update_scheduled=!0,resolved_promise.then(flush))}function add_render_callback(e){render_callbacks.push(e)}const seen_callbacks=new Set;let flushidx=0;function flush(){if(0!==flushidx)return;const e=current_component;do{try{for(;flushidx<dirty_components.length;){const e=dirty_components[flushidx];flushidx++,set_current_component(e),update(e.$$)}}catch(e){throw dirty_components.length=0,flushidx=0,e}for(set_current_component(null),dirty_components.length=0,flushidx=0;binding_callbacks.length;)binding_callbacks.pop()();for(let e=0;e<render_callbacks.length;e+=1){const t=render_callbacks[e];seen_callbacks.has(t)||(seen_callbacks.add(t),t())}render_callbacks.length=0}while(dirty_components.length);for(;flush_callbacks.length;)flush_callbacks.pop()();update_scheduled=!1,seen_callbacks.clear(),set_current_component(e)}function update(e){if(null!==e.fragment){e.update(),run_all(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(add_render_callback)}}function flush_render_callbacks(e){const t=[],n=[];render_callbacks.forEach((o=>-1===e.indexOf(o)?t.push(o):n.push(o))),n.forEach((e=>e())),render_callbacks=t}const outroing=new Set;let outros;function group_outros(){outros={r:0,c:[],p:outros}}function check_outros(){outros.r||run_all(outros.c),outros=outros.p}function transition_in(e,t){e&&e.i&&(outroing.delete(e),e.i(t))}function transition_out(e,t,n,o){if(e&&e.o){if(outroing.has(e))return;outroing.add(e),outros.c.push((()=>{outroing.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}else o&&o()}function get_spread_update(e,t){const n={},o={},i={$$scope:1};let s=e.length;for(;s--;){const r=e[s],a=t[s];if(a){for(const e in r)e in a||(o[e]=1);for(const e in a)i[e]||(n[e]=a[e],i[e]=1);e[s]=a}else for(const e in r)i[e]=1}for(const e in o)e in n||(n[e]=void 0);return n}function create_component(e){e&&e.c()}function mount_component(e,t,n,o){const{fragment:i,after_update:s}=e.$$;i&&i.m(t,n),o||add_render_callback((()=>{const t=e.$$.on_mount.map(run).filter(is_function);e.$$.on_destroy?e.$$.on_destroy.push(...t):run_all(t),e.$$.on_mount=[]})),s.forEach(add_render_callback)}function destroy_component(e,t){const n=e.$$;null!==n.fragment&&(flush_render_callbacks(n.after_update),run_all(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function make_dirty(e,t){-1===e.$$.dirty[0]&&(dirty_components.push(e),schedule_update(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function init(e,t,n,o,i,s,r,a=[-1]){const c=current_component;set_current_component(e);const l=e.$$={fragment:null,ctx:[],props:s,update:noop,not_equal:i,bound:blank_object(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:blank_object(),dirty:a,skip_bound:!1,root:t.target||c.$$.root};r&&r(l.root);let u=!1;if(l.ctx=n?n(e,t.props||{},((t,n,...o)=>{const s=o.length?o[0]:n;return l.ctx&&i(l.ctx[t],l.ctx[t]=s)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](s),u&&make_dirty(e,t)),n})):[],l.update(),u=!0,run_all(l.before_update),l.fragment=!!o&&o(l.ctx),t.target){if(t.hydrate){const e=children(t.target);l.fragment&&l.fragment.l(e),e.forEach(detach)}else l.fragment&&l.fragment.c();t.intro&&transition_in(e.$$.fragment),mount_component(e,t.target,t.anchor,t.customElement),flush()}set_current_component(c)}class SvelteComponent{$destroy(){destroy_component(this,1),this.$destroy=noop}$on(e,t){if(!is_function(t))return noop;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){this.$$set&&!is_empty(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function create_fragment$8(e){let t,n,o,i,s;return{c(){t=element("button"),attr(t,"aria-label",n=e[3]?e[3]:null),attr(t,"class",o=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`),t.disabled=e[2],attr(t,"tabindex","0")},m(n,o){insert(n,t,o),t.innerHTML=e[5],i||(s=listen(t,"click",(function(){is_function(e[0])&&e[0].apply(this,arguments)})),i=!0)},p(i,[s]){e=i,32&s&&(t.innerHTML=e[5]),8&s&&n!==(n=e[3]?e[3]:null)&&attr(t,"aria-label",n),18&s&&o!==(o=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`)&&attr(t,"class",o),4&s&&(t.disabled=e[2])},i:noop,o:noop,d(e){e&&detach(t),i=!1,s()}}}function instance$8(e,t,n){let o,i,s,r,a,c,{config:l,step:u}=t;function d(e){return isFunction(e)?e.call(u):e}return e.$$set=e=>{"config"in e&&n(6,l=e.config),"step"in e&&n(7,u=e.step)},e.$$.update=()=>{192&e.$$.dirty&&(n(0,o=l.action?l.action.bind(u.tour):null),n(1,i=l.classes),n(2,s=!!l.disabled&&d(l.disabled)),n(3,r=l.label?d(l.label):null),n(4,a=l.secondary),n(5,c=l.text?d(l.text):null))},[o,i,s,r,a,c,l,u]}class Shepherd_button extends SvelteComponent{constructor(e){super(),init(this,e,instance$8,create_fragment$8,safe_not_equal,{config:6,step:7})}}function get_each_context(e,t,n){const o=e.slice();return o[2]=t[n],o}function create_if_block$3(e){let t,n,o=e[1],i=[];for(let t=0;t<o.length;t+=1)i[t]=create_each_block(get_each_context(e,o,t));const s=e=>transition_out(i[e],1,1,(()=>{i[e]=null}));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=empty()},m(e,o){for(let t=0;t<i.length;t+=1)i[t]&&i[t].m(e,o);insert(e,t,o),n=!0},p(e,n){if(3&n){let r;for(o=e[1],r=0;r<o.length;r+=1){const s=get_each_context(e,o,r);i[r]?(i[r].p(s,n),transition_in(i[r],1)):(i[r]=create_each_block(s),i[r].c(),transition_in(i[r],1),i[r].m(t.parentNode,t))}for(group_outros(),r=o.length;r<i.length;r+=1)s(r);check_outros()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)transition_in(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)transition_out(i[e]);n=!1},d(e){destroy_each(i,e),e&&detach(t)}}}function create_each_block(e){let t,n;return t=new Shepherd_button({props:{config:e[2],step:e[0]}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};2&n&&(o.config=e[2]),1&n&&(o.step=e[0]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$7(e){let t,n,o=e[1]&&create_if_block$3(e);return{c(){t=element("footer"),o&&o.c(),attr(t,"class","shepherd-footer")},m(e,i){insert(e,t,i),o&&o.m(t,null),n=!0},p(e,[n]){e[1]?o?(o.p(e,n),2&n&&transition_in(o,1)):(o=create_if_block$3(e),o.c(),transition_in(o,1),o.m(t,null)):o&&(group_outros(),transition_out(o,1,1,(()=>{o=null})),check_outros())},i(e){n||(transition_in(o),n=!0)},o(e){transition_out(o),n=!1},d(e){e&&detach(t),o&&o.d()}}}function instance$7(e,t,n){let o,{step:i}=t;return e.$$set=e=>{"step"in e&&n(0,i=e.step)},e.$$.update=()=>{1&e.$$.dirty&&n(1,o=i.options.buttons)},[i,o]}class Shepherd_footer extends SvelteComponent{constructor(e){super(),init(this,e,instance$7,create_fragment$7,safe_not_equal,{step:0})}}function create_fragment$6(e){let t,n,o,i,s;return{c(){t=element("button"),n=element("span"),n.textContent="×",attr(n,"aria-hidden","true"),attr(t,"aria-label",o=e[0].label?e[0].label:"Close Tour"),attr(t,"class","shepherd-cancel-icon"),attr(t,"type","button")},m(o,r){insert(o,t,r),append(t,n),i||(s=listen(t,"click",e[1]),i=!0)},p(e,[n]){1&n&&o!==(o=e[0].label?e[0].label:"Close Tour")&&attr(t,"aria-label",o)},i:noop,o:noop,d(e){e&&detach(t),i=!1,s()}}}function instance$6(e,t,n){let{cancelIcon:o,step:i}=t;return e.$$set=e=>{"cancelIcon"in e&&n(0,o=e.cancelIcon),"step"in e&&n(2,i=e.step)},[o,e=>{e.preventDefault(),i.cancel()},i]}class Shepherd_cancel_icon extends SvelteComponent{constructor(e){super(),init(this,e,instance$6,create_fragment$6,safe_not_equal,{cancelIcon:0,step:2})}}function create_fragment$5(e){let t;return{c(){t=element("h3"),attr(t,"id",e[1]),attr(t,"class","shepherd-title")},m(n,o){insert(n,t,o),e[3](t)},p(e,[n]){2&n&&attr(t,"id",e[1])},i:noop,o:noop,d(n){n&&detach(t),e[3](null)}}}function instance$5(e,t,n){let{labelId:o,element:i,title:s}=t;return afterUpdate((()=>{isFunction(s)&&n(2,s=s()),n(0,i.innerHTML=s,i)})),e.$$set=e=>{"labelId"in e&&n(1,o=e.labelId),"element"in e&&n(0,i=e.element),"title"in e&&n(2,s=e.title)},[i,o,s,function(e){binding_callbacks[e?"unshift":"push"]((()=>{i=e,n(0,i)}))}]}class Shepherd_title extends SvelteComponent{constructor(e){super(),init(this,e,instance$5,create_fragment$5,safe_not_equal,{labelId:1,element:0,title:2})}}function create_if_block_1$1(e){let t,n;return t=new Shepherd_title({props:{labelId:e[0],title:e[2]}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};1&n&&(o.labelId=e[0]),4&n&&(o.title=e[2]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block$2(e){let t,n;return t=new Shepherd_cancel_icon({props:{cancelIcon:e[3],step:e[1]}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};8&n&&(o.cancelIcon=e[3]),2&n&&(o.step=e[1]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$4(e){let t,n,o,i=e[2]&&create_if_block_1$1(e),s=e[3]&&e[3].enabled&&create_if_block$2(e);return{c(){t=element("header"),i&&i.c(),n=space(),s&&s.c(),attr(t,"class","shepherd-header")},m(e,r){insert(e,t,r),i&&i.m(t,null),append(t,n),s&&s.m(t,null),o=!0},p(e,[o]){e[2]?i?(i.p(e,o),4&o&&transition_in(i,1)):(i=create_if_block_1$1(e),i.c(),transition_in(i,1),i.m(t,n)):i&&(group_outros(),transition_out(i,1,1,(()=>{i=null})),check_outros()),e[3]&&e[3].enabled?s?(s.p(e,o),8&o&&transition_in(s,1)):(s=create_if_block$2(e),s.c(),transition_in(s,1),s.m(t,null)):s&&(group_outros(),transition_out(s,1,1,(()=>{s=null})),check_outros())},i(e){o||(transition_in(i),transition_in(s),o=!0)},o(e){transition_out(i),transition_out(s),o=!1},d(e){e&&detach(t),i&&i.d(),s&&s.d()}}}function instance$4(e,t,n){let o,i,{labelId:s,step:r}=t;return e.$$set=e=>{"labelId"in e&&n(0,s=e.labelId),"step"in e&&n(1,r=e.step)},e.$$.update=()=>{2&e.$$.dirty&&(n(2,o=r.options.title),n(3,i=r.options.cancelIcon))},[s,r,o,i]}class Shepherd_header extends SvelteComponent{constructor(e){super(),init(this,e,instance$4,create_fragment$4,safe_not_equal,{labelId:0,step:1})}}function create_fragment$3(e){let t;return{c(){t=element("div"),attr(t,"class","shepherd-text"),attr(t,"id",e[1])},m(n,o){insert(n,t,o),e[3](t)},p(e,[n]){2&n&&attr(t,"id",e[1])},i:noop,o:noop,d(n){n&&detach(t),e[3](null)}}}function instance$3(e,t,n){let{descriptionId:o,element:i,step:s}=t;return afterUpdate((()=>{let{text:e}=s.options;isFunction(e)&&(e=e.call(s)),isHTMLElement$1(e)?i.appendChild(e):n(0,i.innerHTML=e,i)})),e.$$set=e=>{"descriptionId"in e&&n(1,o=e.descriptionId),"element"in e&&n(0,i=e.element),"step"in e&&n(2,s=e.step)},[i,o,s,function(e){binding_callbacks[e?"unshift":"push"]((()=>{i=e,n(0,i)}))}]}class Shepherd_text extends SvelteComponent{constructor(e){super(),init(this,e,instance$3,create_fragment$3,safe_not_equal,{descriptionId:1,element:0,step:2})}}function create_if_block_2(e){let t,n;return t=new Shepherd_header({props:{labelId:e[1],step:e[2]}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};2&n&&(o.labelId=e[1]),4&n&&(o.step=e[2]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block_1(e){let t,n;return t=new Shepherd_text({props:{descriptionId:e[0],step:e[2]}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};1&n&&(o.descriptionId=e[0]),4&n&&(o.step=e[2]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_if_block$1(e){let t,n;return t=new Shepherd_footer({props:{step:e[2]}}),{c(){create_component(t.$$.fragment)},m(e,o){mount_component(t,e,o),n=!0},p(e,n){const o={};4&n&&(o.step=e[2]),t.$set(o)},i(e){n||(transition_in(t.$$.fragment,e),n=!0)},o(e){transition_out(t.$$.fragment,e),n=!1},d(e){destroy_component(t,e)}}}function create_fragment$2(e){let t,n,o,i,s=!isUndefined(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled,r=!isUndefined(e[2].options.text),a=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length,c=s&&create_if_block_2(e),l=r&&create_if_block_1(e),u=a&&create_if_block$1(e);return{c(){t=element("div"),c&&c.c(),n=space(),l&&l.c(),o=space(),u&&u.c(),attr(t,"class","shepherd-content")},m(e,s){insert(e,t,s),c&&c.m(t,null),append(t,n),l&&l.m(t,null),append(t,o),u&&u.m(t,null),i=!0},p(e,[i]){4&i&&(s=!isUndefined(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled),s?c?(c.p(e,i),4&i&&transition_in(c,1)):(c=create_if_block_2(e),c.c(),transition_in(c,1),c.m(t,n)):c&&(group_outros(),transition_out(c,1,1,(()=>{c=null})),check_outros()),4&i&&(r=!isUndefined(e[2].options.text)),r?l?(l.p(e,i),4&i&&transition_in(l,1)):(l=create_if_block_1(e),l.c(),transition_in(l,1),l.m(t,o)):l&&(group_outros(),transition_out(l,1,1,(()=>{l=null})),check_outros()),4&i&&(a=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length),a?u?(u.p(e,i),4&i&&transition_in(u,1)):(u=create_if_block$1(e),u.c(),transition_in(u,1),u.m(t,null)):u&&(group_outros(),transition_out(u,1,1,(()=>{u=null})),check_outros())},i(e){i||(transition_in(c),transition_in(l),transition_in(u),i=!0)},o(e){transition_out(c),transition_out(l),transition_out(u),i=!1},d(e){e&&detach(t),c&&c.d(),l&&l.d(),u&&u.d()}}}function instance$2(e,t,n){let{descriptionId:o,labelId:i,step:s}=t;return e.$$set=e=>{"descriptionId"in e&&n(0,o=e.descriptionId),"labelId"in e&&n(1,i=e.labelId),"step"in e&&n(2,s=e.step)},[o,i,s]}class Shepherd_content extends SvelteComponent{constructor(e){super(),init(this,e,instance$2,create_fragment$2,safe_not_equal,{descriptionId:0,labelId:1,step:2})}}function create_if_block(e){let t;return{c(){t=element("div"),attr(t,"class","shepherd-arrow"),attr(t,"data-popper-arrow","")},m(e,n){insert(e,t,n)},d(e){e&&detach(t)}}}function create_fragment$1(e){let t,n,o,i,s,r,a,c,l=e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on&&create_if_block();o=new Shepherd_content({props:{descriptionId:e[2],labelId:e[3],step:e[4]}});let u=[{"aria-describedby":i=isUndefined(e[4].options.text)?null:e[2]},{"aria-labelledby":s=e[4].options.title?e[3]:null},e[1],{role:"dialog"},{tabindex:"0"}],d={};for(let e=0;e<u.length;e+=1)d=assign(d,u[e]);return{c(){t=element("div"),l&&l.c(),n=space(),create_component(o.$$.fragment),set_attributes(t,d),toggle_class(t,"shepherd-has-cancel-icon",e[5]),toggle_class(t,"shepherd-has-title",e[6]),toggle_class(t,"shepherd-element",!0)},m(i,s){insert(i,t,s),l&&l.m(t,null),append(t,n),mount_component(o,t,null),e[13](t),r=!0,a||(c=listen(t,"keydown",e[7]),a=!0)},p(e,[a]){e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on?l||(l=create_if_block(),l.c(),l.m(t,n)):l&&(l.d(1),l=null);const c={};4&a&&(c.descriptionId=e[2]),8&a&&(c.labelId=e[3]),16&a&&(c.step=e[4]),o.$set(c),set_attributes(t,d=get_spread_update(u,[(!r||20&a&&i!==(i=isUndefined(e[4].options.text)?null:e[2]))&&{"aria-describedby":i},(!r||24&a&&s!==(s=e[4].options.title?e[3]:null))&&{"aria-labelledby":s},2&a&&e[1],{role:"dialog"},{tabindex:"0"}])),toggle_class(t,"shepherd-has-cancel-icon",e[5]),toggle_class(t,"shepherd-has-title",e[6]),toggle_class(t,"shepherd-element",!0)},i(e){r||(transition_in(o.$$.fragment,e),r=!0)},o(e){transition_out(o.$$.fragment,e),r=!1},d(n){n&&detach(t),l&&l.d(),destroy_component(o),e[13](null),a=!1,c()}}}const KEY_TAB=9,KEY_ESC=27,LEFT_ARROW=37,RIGHT_ARROW=39;function getClassesArray(e){return e.split(" ").filter((e=>!!e.length))}function instance$1(e,t,n){let o,i,s,{classPrefix:r,element:a,descriptionId:c,firstFocusableElement:l,focusableElements:u,labelId:d,lastFocusableElement:p,step:h,dataStepId:f}=t;onMount((()=>{n(1,f={[`data-${r}shepherd-step-id`]:h.id}),n(9,u=a.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,l=u[0]),n(10,p=u[u.length-1])})),afterUpdate((()=>{s!==h.options.classes&&(function(e){if(isString(e)){const t=getClassesArray(e);t.length&&a.classList.remove(...t)}}(s),s=h.options.classes,function(e){if(isString(e)){const t=getClassesArray(e);t.length&&a.classList.add(...t)}}(s))}));return e.$$set=e=>{"classPrefix"in e&&n(11,r=e.classPrefix),"element"in e&&n(0,a=e.element),"descriptionId"in e&&n(2,c=e.descriptionId),"firstFocusableElement"in e&&n(8,l=e.firstFocusableElement),"focusableElements"in e&&n(9,u=e.focusableElements),"labelId"in e&&n(3,d=e.labelId),"lastFocusableElement"in e&&n(10,p=e.lastFocusableElement),"step"in e&&n(4,h=e.step),"dataStepId"in e&&n(1,f=e.dataStepId)},e.$$.update=()=>{16&e.$$.dirty&&(n(5,o=h.options&&h.options.cancelIcon&&h.options.cancelIcon.enabled),n(6,i=h.options&&h.options.title))},[a,f,c,d,h,o,i,e=>{const{tour:t}=h;switch(e.keyCode){case 9:if(0===u.length){e.preventDefault();break}e.shiftKey?(document.activeElement===l||document.activeElement.classList.contains("shepherd-element"))&&(e.preventDefault(),p.focus()):document.activeElement===p&&(e.preventDefault(),l.focus());break;case 27:t.options.exitOnEsc&&(e.stopPropagation(),h.cancel());break;case 37:t.options.keyboardNavigation&&(e.stopPropagation(),t.back());break;case 39:t.options.keyboardNavigation&&(e.stopPropagation(),t.next())}},l,u,p,r,()=>a,function(e){binding_callbacks[e?"unshift":"push"]((()=>{a=e,n(0,a)}))}]}class Shepherd_element extends SvelteComponent{constructor(e){super(),init(this,e,instance$1,create_fragment$1,safe_not_equal,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}class Step extends Evented{constructor(e,t={}){return super(e,t),this.tour=e,this.classPrefix=this.tour.options?normalizePrefix(this.tour.options.classPrefix):"",this.styles=e.styles,this._resolvedAttachTo=null,autoBind(this),this._setOptions(t),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){destroyTooltip(this),isHTMLElement$1(this.el)&&(this.el.remove(),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){this.tour.modal.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveAttachToOptions(){return this._resolvedAttachTo=parseAttachTo(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return null===this._resolvedAttachTo?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){return isFunction(this.options.beforeShowPromise)?Promise.resolve(this.options.beforeShowPromise()).then((()=>this._show())):Promise.resolve(this._show())}updateStepOptions(e){Object.assign(this.options,e),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const e=`${this.id}-description`,t=`${this.id}-label`;return this.shepherdElementComponent=new Shepherd_element({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:e,labelId:t,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(e){const{element:t}=this._getResolvedAttachToOptions();isFunction(this.options.scrollToHandler)?this.options.scrollToHandler(t):isElement$1(t)&&"function"==typeof t.scrollIntoView&&t.scrollIntoView(e)}_getClassOptions(e){const t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=e.classes?e.classes:"",o=t&&t.classes?t.classes:"",i=[...n.split(" "),...o.split(" ")],s=new Set(i);return Array.from(s).join(" ").trim()}_setOptions(e={}){let t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;t=cjs({},t||{}),this.options=Object.assign({arrow:!0},t,e,mergeTooltipConfig(t,e));const{when:n}=this.options;this.options.classes=this._getClassOptions(e),this.destroy(),this.id=this.options.id||`step-${uuid()}`,n&&Object.keys(n).forEach((e=>{this.on(e,n[e],this)}))}_setupElements(){isUndefined(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&bindAdvance(this),setupTooltip(this)}_show(){this.trigger("before-show"),this._resolveAttachToOptions(),this._setupElements(),this.tour.modal||this.tour._setupModal(),this.tour.modal.setupForStep(this),this._styleTargetElementForStep(this),this.el.hidden=!1,this.options.scrollTo&&setTimeout((()=>{this._scrollTo(this.options.scrollTo)})),this.el.hidden=!1;const e=this.shepherdElementComponent.getElement(),t=this.target||document.body;t.classList.add(`${this.classPrefix}shepherd-enabled`),t.classList.add(`${this.classPrefix}shepherd-target`),e.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(e){const t=e.target;t&&(e.options.highlightClass&&t.classList.add(e.options.highlightClass),t.classList.remove("shepherd-target-click-disabled"),!1===e.options.canClickTarget&&t.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const e=this.target||document.body;this.options.highlightClass&&e.classList.remove(this.options.highlightClass),e.classList.remove("shepherd-target-click-disabled",`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`)}}function cleanupSteps(e){if(e){const{steps:t}=e;t.forEach((e=>{e.options&&!1===e.options.canClickTarget&&e.options.attachTo&&e.target instanceof HTMLElement&&e.target.classList.remove("shepherd-target-click-disabled")}))}}function makeOverlayPath({width:e,height:t,x:n=0,y:o=0,r:i=0}){const{innerWidth:s,innerHeight:r}=window,{topLeft:a=0,topRight:c=0,bottomRight:l=0,bottomLeft:u=0}="number"==typeof i?{topLeft:i,topRight:i,bottomRight:i,bottomLeft:i}:i;return`M${s},${r}H0V0H${s}V${r}ZM${n+a},${o}a${a},${a},0,0,0-${a},${a}V${t+o-u}a${u},${u},0,0,0,${u},${u}H${e+n-l}a${l},${l},0,0,0,${l}-${l}V${o+c}a${c},${c},0,0,0-${c}-${c}Z`}function create_fragment(e){let t,n,o,i,s;return{c(){t=svg_element("svg"),n=svg_element("path"),attr(n,"d",e[2]),attr(t,"class",o=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")},m(o,r){insert(o,t,r),append(t,n),e[11](t),i||(s=listen(t,"touchmove",e[3]),i=!0)},p(e,[i]){4&i&&attr(n,"d",e[2]),2&i&&o!==(o=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")&&attr(t,"class",o)},i:noop,o:noop,d(n){n&&detach(t),e[11](null),i=!1,s()}}}function _getScrollParent(e){if(!e)return null;const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return"hidden"!==t&&"visible"!==t&&e.scrollHeight>=e.clientHeight?e:_getScrollParent(e.parentElement)}function _getVisibleHeight(e,t){const n=e.getBoundingClientRect();let o=n.y||n.top,i=n.bottom||o+n.height;if(t){const e=t.getBoundingClientRect(),n=e.y||e.top,s=e.bottom||n+e.height;o=Math.max(o,n),i=Math.min(i,s)}return{y:o,height:Math.max(i-o,0)}}function instance(e,t,n){let{element:o,openingProperties:i}=t;uuid();let s,r,a=!1;c();function c(){n(4,i={width:0,height:0,x:0,y:0,r:0})}function l(){n(1,a=!1),h()}function u(e=0,t=0,o,s){if(s){const{y:r,height:a}=_getVisibleHeight(s,o),{x:c,width:l,left:u}=s.getBoundingClientRect();n(4,i={width:l+2*e,height:a+2*e,x:(c||u)-e,y:r-e,r:t})}else c()}function d(){n(1,a=!0)}const p=e=>{e.preventDefault()};function h(){s&&(cancelAnimationFrame(s),s=void 0),window.removeEventListener("touchmove",p,{passive:!1})}return e.$$set=e=>{"element"in e&&n(0,o=e.element),"openingProperties"in e&&n(4,i=e.openingProperties)},e.$$.update=()=>{16&e.$$.dirty&&n(2,r=makeOverlayPath(i))},[o,a,r,e=>{e.stopPropagation()},i,()=>o,c,l,u,function(e){h(),e.tour.options.useModalOverlay?(!function(e){const{modalOverlayOpeningPadding:t,modalOverlayOpeningRadius:n}=e.options,o=_getScrollParent(e.target),i=()=>{s=void 0,u(t,n,o,e.target),s=requestAnimationFrame(i)};i(),window.addEventListener("touchmove",p,{passive:!1})}(e),d()):l()},d,function(e){binding_callbacks[e?"unshift":"push"]((()=>{o=e,n(0,o)}))}]}class Shepherd_modal extends SvelteComponent{constructor(e){super(),init(this,e,instance,create_fragment,safe_not_equal,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}const Shepherd=new Evented;class Tour extends Evented{constructor(e={}){super(e),autoBind(this);this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},e),this.classPrefix=normalizePrefix(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps);return["active","cancel","complete","inactive","show","start"].map((e=>{(e=>{this.on(e,(t=>{(t=t||{}).tour=this,Shepherd.trigger(e,t)}))})(e)})),this._setTourID(),this}addStep(e,t){let n=e;return n instanceof Step?n.tour=this:n=new Step(this,n),isUndefined(t)?this.steps.push(n):this.steps.splice(t,0,n),n}addSteps(e){return Array.isArray(e)&&e.forEach((e=>{this.addStep(e)})),this}back(){const e=this.steps.indexOf(this.currentStep);this.show(e-1,!1)}async cancel(){if(this.options.confirmCancel){const e="function"==typeof this.options.confirmCancel,t=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";(e?await this.options.confirmCancel():window.confirm(t))&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(e){return this.steps.find((t=>t.id===e))}getCurrentStep(){return this.currentStep}hide(){const e=this.getCurrentStep();if(e)return e.hide()}isActive(){return Shepherd.activeTour===this}next(){const e=this.steps.indexOf(this.currentStep);e===this.steps.length-1?this.complete():this.show(e+1,!0)}removeStep(e){const t=this.getCurrentStep();this.steps.some(((t,n)=>{if(t.id===e)return t.isOpen()&&t.hide(),t.destroy(),this.steps.splice(n,1),!0})),t&&t.id===e&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(e=0,t=!0){const n=isString(e)?this.getById(e):this.steps[e];if(n){this._updateStateBeforeShow();isFunction(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,t):(this.trigger("show",{step:n,previous:this.currentStep}),this.currentStep=n,n.show())}}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(e){const t=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach((e=>e.destroy())),cleanupSteps(this),this.trigger(e,{index:t}),Shepherd.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===e||"complete"===e)&&this.modal){const e=document.querySelector(".shepherd-modal-overlay-container");e&&e.remove()}isHTMLElement$1(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),Shepherd.activeTour=this}_setupModal(){this.modal=new Shepherd_modal({target:this.options.modalContainer||document.body,props:{classPrefix:this.classPrefix,styles:this.styles}})}_skipStep(e,t){const n=this.steps.indexOf(e);if(n===this.steps.length-1)this.complete();else{const e=t?n+1:n-1;this.show(e,t)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const e=this.options.tourName||"tour";this.id=`${e}--${uuid()}`}}const isServerSide="undefined"==typeof window;class NoOp{constructor(){}}if(isServerSide?Object.assign(Shepherd,{Tour:NoOp,Step:NoOp}):Object.assign(Shepherd,{Tour:Tour,Step:Step}),!Joomla)throw new Error("Joomla API is not properly initialised");function emptyStorage(){sessionStorage.removeItem("currentStepId"),sessionStorage.removeItem("stepCount"),sessionStorage.removeItem("tourId"),sessionStorage.removeItem("tourToken"),sessionStorage.removeItem("previousStepUrl")}function getTourInstance(){const e=new Shepherd.Tour({defaultStepOptions:{cancelIcon:{enabled:!0,label:Joomla.Text._("JCANCEL")},classes:"shepherd-theme-arrows",scrollTo:{behavior:"smooth",block:"center"}},useModalOverlay:!0,keyboardNavigation:!0});return e.on("cancel",(()=>{emptyStorage(),e.steps=[]})),e}function addProgressIndicator(e,t,n){const o=e.querySelector(".shepherd-header"),i=document.createElement("div");i.classList.add("shepherd-progress"),i.setAttribute("role","status"),i.setAttribute("aria-label",Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_STEP_NUMBER_OF").replace("{number}",t).replace("{total}",n));const s=document.createElement("span");s.setAttribute("aria-hidden",!0),s.innerText=`${t}/${n}`,i.appendChild(s),o.insertBefore(i,e.querySelector(".shepherd-cancel-icon"))}function setFocus(e,t,n){e&&!e.disabled?e.focus():t&&!t.disabled?t.focus():n.focus()}function addStepToTourButton(e,t,n){const o=new Shepherd.Step(e,{title:t.title,text:t.description,classes:"shepherd-theme-arrows",buttons:n,id:t.id,arrow:!0,beforeShowPromise:()=>new Promise((t=>{if(e.currentStep.options.attachTo.element){const t=e.currentStep.options.attachTo.element.split(","),n=e.currentStep.options.attachTo.on;e.currentStep.options.attachTo.element="",e.currentStep.options.attachTo.on="center";for(let o=0;o<t.length;o+=1){const i=document.querySelector(t[o]);if(null!=i&&!i.disabled&&!i.readonly&&"none"!==i.style.display){e.currentStep.options.attachTo.element=t[o],e.currentStep.options.attachTo.on=n;break}}}if("redirect"===e.currentStep.options.attachTo.type){const n=Joomla.getOptions("system.paths").rootFull+e.currentStep.options.attachTo.url;window.location.href!==n?(sessionStorage.setItem("currentStepId",e.currentStep.id),sessionStorage.setItem("previousStepUrl",window.location.href),window.location.href=n):t()}else t()})).catch((()=>{})),when:{show(){const e=this.getElement(),t=this.getTarget();if(e.setAttribute("aria-live","assertive"),sessionStorage.setItem("currentStepId",this.id),addProgressIndicator(e,this.id+1,sessionStorage.getItem("stepCount")),t&&"interactive"===this.options.attachTo.type){const n=e.querySelector(".shepherd-cancel-icon"),o=e.querySelector(".shepherd-button-primary"),i=e.querySelector(".shepherd-button-secondary");"input"===t.tagName.toLowerCase()&&t.hasAttribute("required")&&["email","password","search","tel","text","url"].includes(t.type)&&(t.value.trim().length?(o.removeAttribute("disabled"),o.classList.remove("disabled")):(o.setAttribute("disabled","disabled"),o.classList.add("disabled"))),n.addEventListener("keydown",(e=>{"Tab"===e.key&&("joomla-field-fancy-select"===t.tagName.toLowerCase()?(t.querySelector(".choices").click(),t.querySelector(".choices input").focus()):"joomla-field-fancy-select"===t.parentElement.tagName.toLowerCase()?(t.click(),t.querySelector("input").focus()):(t.focus(),e.preventDefault()))})),"iframe"===t.tagName.toLowerCase()?t.contentWindow.document.body.addEventListener("blur",(e=>{sessionStorage.getItem("tourId")&&(setTimeout((()=>{setFocus(o,i,n)}),1),e.preventDefault())})):"joomla-field-fancy-select"===t.tagName.toLowerCase()?t.querySelector(".choices input").addEventListener("blur",(e=>{sessionStorage.getItem("tourId")&&(setFocus(o,i,n),e.preventDefault())})):"joomla-field-fancy-select"===t.parentElement.tagName.toLowerCase()?t.querySelector("input").addEventListener("blur",(e=>{sessionStorage.getItem("tourId")&&(setFocus(o,i,n),e.preventDefault())})):t.addEventListener("blur",(e=>{sessionStorage.getItem("tourId")&&(setFocus(o,i,n),e.preventDefault())}))}}}});if(t.target?o.updateStepOptions({attachTo:{element:t.target,on:t.position,url:t.url,type:t.type,interactive_type:t.interactive_type}}):o.updateStepOptions({attachTo:{url:t.url,type:t.type,interactive_type:t.interactive_type}}),"next"!==t.type){const e=`${Joomla.getOptions("system.paths").root}/${t.url}`;sessionStorage.getItem(e)&&sessionStorage.removeItem(e)}e.addStep(o)}function showTourInfo(e,t){e.addStep({title:t.title,text:t.description,classes:"shepherd-theme-arrows",buttons:[{classes:"btn btn-primary shepherd-button-primary",action(){return this.next()},text:Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_START")}],id:"tourinfo",when:{show(){sessionStorage.setItem("currentStepId","tourinfo"),addProgressIndicator(this.getElement(),1,sessionStorage.getItem("stepCount"))}}})}function pushCompleteButton(e){e.push({text:Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_COMPLETE"),classes:"btn btn-primary shepherd-button-primary",action(){return this.cancel()}})}function pushNextButton(e,t,n=!1,o=""){e.push({text:Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_NEXT"),classes:`btn btn-primary shepherd-button-primary step-next-button-${t.id} ${o}`,action(){return this.next()},disabled:n})}function addBackButton(e,t){e.push({text:Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_BACK"),classes:"btn btn-secondary shepherd-button-secondary",action(){if("redirect"===t.type){sessionStorage.setItem("currentStepId",t.id-1);const e=sessionStorage.getItem("previousStepUrl");e&&(sessionStorage.removeItem("previousStepUrl"),window.location.href=e)}return this.back()}})}function enableButton(e){const t=document.querySelector(`.step-next-button-${e.currentTarget.step_id}`);t.removeAttribute("disabled"),t.classList.remove("disabled")}function disableButton(e){const t=document.querySelector(`.step-next-button-${e.currentTarget.step_id}`);t.setAttribute("disabled","disabled"),t.classList.add("disabled")}function startTour(e){sessionStorage.setItem("tourId",e.id),sessionStorage.setItem("stepCount",String(e.steps.length));const t=sessionStorage.getItem("currentStepId");let n=null,o=-1;null!=t&&Number(t)>-1&&(o=void 0!==e.steps[t]?Number(t):-1,o>0&&(n=e.steps[o-1]));const i=getTourInstance();if(o<0){const t=Joomla.getOptions("system.paths").rootFull;if(window.location.href!==t+e.steps[0].url)return void(window.location.href=t+e.steps[0].url);showTourInfo(i,e.steps[0]),o=1}const s=e.steps.length;let r;for(let t=o;t<s;t+=1){if(r=[],(null===n||t>o||"redirect"===e.steps[t].type)&&addBackButton(r,e.steps[t]),e&&e.steps[t].target&&"interactive"===e.steps[t].type){const n=document.querySelector(e.steps[t].target);if(n&&e&&e.steps&&e.steps[t]&&e.steps[t].interactive_type)switch(e.steps[t].interactive_type){case"submit":n.addEventListener("click",(()=>{sessionStorage.getItem("tourId")&&sessionStorage.setItem("currentStepId",e.steps[t].id+1)}));break;case"text":n.step_id=t,n.hasAttribute("required")&&["email","password","search","tel","text","url"].includes(n.type)&&["input","focus"].forEach((e=>n.addEventListener(e,(e=>{sessionStorage.getItem("tourId")&&(e.target.value.trim().length?enableButton(e):disableButton(e))}))));break;case"button":n.addEventListener("click",(()=>{sessionStorage.setItem("currentStepId",e.steps[t].id+1),i.next()}))}}t<s-1?(e&&"interactive"!==e.steps[t].type||e&&"text"===e.steps[t].interactive_type||e&&"other"===e.steps[t].interactive_type)&&pushNextButton(r,e.steps[t]):pushCompleteButton(r),addStepToTourButton(i,e.steps[t],r),n=e.steps[t]}i.start()}function loadTour(e){const t=Number.parseInt(e,10)>0?"":encodeURI(e),n=Number.parseInt(e,10)>0?Number.parseInt(e,10):0;if(n>0||""!==t){let e=`${Joomla.getOptions("system.paths").rootFull}administrator/index.php?option=com_ajax&plugin=guidedtours&group=system&format=json`;e+=n>0?`&id=${n}`:`&uid=${t}`,fetch(e).then((e=>e.json())).then((e=>{e.success||(e.messages&&Joomla.renderMessages(e.messages),emptyStorage()),startTour(e.data)})).catch((e=>{emptyStorage();const t={error:[Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_TOUR_ERROR")]};throw Joomla.renderMessages(t),new Error(e)}))}}document.querySelector("body").addEventListener("click",(e=>{e.target&&e.target.classList.contains("button-start-guidedtour")&&(e.target.hasAttribute("data-id")&&!(e.target.getAttribute("data-id")<=0)||e.target.hasAttribute("data-gt-uid")&&""!==e.target.getAttribute("data-gt-uid")?(sessionStorage.setItem("tourToken",String(Joomla.getOptions("com_guidedtours.token"))),loadTour(e.target.getAttribute("data-id")||e.target.getAttribute("data-gt-uid"))):Joomla.renderMessages({error:[Joomla.Text._("PLG_SYSTEM_GUIDEDTOURS_COULD_NOT_LOAD_THE_TOUR")]}))}));const tourId=sessionStorage.getItem("tourId");(Number.parseInt(tourId,10)>0||""!==tourId)&&sessionStorage.getItem("tourToken")===String(Joomla.getOptions("com_guidedtours.token"))?loadTour(tourId):emptyStorage();