@ussebastian/kitdigital
Version:
Kit Digital de la Universidad San Sebastián
3 lines (2 loc) • 35.7 kB
JavaScript
/*! @ussebastian/kitdigital v0.3.7 | MIT (c) Asimov Consultores SpA - 2023 */
var e="top",t="bottom",n="right",r="left",i="auto",o=[e,t,n,r],a="start",s="end",c="clippingParents",u="viewport",p="popper",f="reference",d=o.reduce((function(e,t){return e.concat([t+"-"+a,t+"-"+s])}),[]),l=[].concat(o,[i]).reduce((function(e,t){return e.concat([t,t+"-"+a,t+"-"+s])}),[]),m=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function v(e){return e?(e.nodeName||"").toLowerCase():null}function h(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function g(e){return e instanceof h(e).Element||e instanceof Element}function y(e){return e instanceof h(e).HTMLElement||e instanceof HTMLElement}function b(e){return"undefined"!=typeof ShadowRoot&&(e instanceof h(e).ShadowRoot||e instanceof ShadowRoot)}var w={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];y(i)&&v(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});y(r)&&v(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function x(e){return e.split("-")[0]}var O=Math.max,E=Math.min,A=Math.round;function T(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function D(){return!/^((?!chrome|android).)*safari/i.test(T())}function L(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&y(e)&&(i=e.offsetWidth>0&&A(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&A(r.height)/e.offsetHeight||1);var a=(g(e)?h(e):window).visualViewport,s=!D()&&n,c=(r.left+(s&&a?a.offsetLeft:0))/i,u=(r.top+(s&&a?a.offsetTop:0))/o,p=r.width/i,f=r.height/o;return{width:p,height:f,top:u,right:c+p,bottom:u+f,left:c,x:c,y:u}}function j(e){var t=L(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function C(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&b(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function k(e){return h(e).getComputedStyle(e)}function M(e){return["table","td","th"].indexOf(v(e))>=0}function H(e){return((g(e)?e.ownerDocument:e.document)||window.document).documentElement}function V(e){return"html"===v(e)?e:e.assignedSlot||e.parentNode||(b(e)?e.host:null)||H(e)}function S(e){return y(e)&&"fixed"!==k(e).position?e.offsetParent:null}function W(e){for(var t=h(e),n=S(e);n&&M(n)&&"static"===k(n).position;)n=S(n);return n&&("html"===v(n)||"body"===v(n)&&"static"===k(n).position)?t:n||function(e){var t=/firefox/i.test(T());if(/Trident/i.test(T())&&y(e)&&"fixed"===k(e).position)return null;var n=V(e);for(b(n)&&(n=n.host);y(n)&&["html","body"].indexOf(v(n))<0;){var r=k(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function P(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function N(e,t,n){return O(e,E(t,n))}function B(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function R(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var I={name:"arrow",enabled:!0,phase:"main",fn:function(i){var a,s=i.state,c=i.name,u=i.options,p=s.elements.arrow,f=s.modifiersData.popperOffsets,d=x(s.placement),l=P(d),m=[r,n].indexOf(d)>=0?"height":"width";if(p&&f){var v=function(e,t){return B("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:R(e,o))}(u.padding,s),h=j(p),g="y"===l?e:r,y="y"===l?t:n,b=s.rects.reference[m]+s.rects.reference[l]-f[l]-s.rects.popper[m],w=f[l]-s.rects.reference[l],O=W(p),E=O?"y"===l?O.clientHeight||0:O.clientWidth||0:0,A=b/2-w/2,T=v[g],D=E-h[m]-v[y],L=E/2-h[m]/2+A,C=N(T,L,D),k=l;s.modifiersData[c]=((a={})[k]=C,a.centerOffset=C-L,a)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&C(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function q(e){return e.split("-")[1]}var U={top:"auto",right:"auto",bottom:"auto",left:"auto"};function _(i){var o,a=i.popper,c=i.popperRect,u=i.placement,p=i.variation,f=i.offsets,d=i.position,l=i.gpuAcceleration,m=i.adaptive,v=i.roundOffsets,g=i.isFixed,y=f.x,b=void 0===y?0:y,w=f.y,x=void 0===w?0:w,O="function"==typeof v?v({x:b,y:x}):{x:b,y:x};b=O.x,x=O.y;var E=f.hasOwnProperty("x"),T=f.hasOwnProperty("y"),D=r,L=e,j=window;if(m){var C=W(a),M="clientHeight",V="clientWidth";if(C===h(a)&&"static"!==k(C=H(a)).position&&"absolute"===d&&(M="scrollHeight",V="scrollWidth"),u===e||(u===r||u===n)&&p===s)L=t,x-=(g&&C===j&&j.visualViewport?j.visualViewport.height:C[M])-c.height,x*=l?1:-1;if(u===r||(u===e||u===t)&&p===s)D=n,b-=(g&&C===j&&j.visualViewport?j.visualViewport.width:C[V])-c.width,b*=l?1:-1}var S,P=Object.assign({position:d},m&&U),N=!0===v?function(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:A(n*i)/i||0,y:A(r*i)/i||0}}({x:b,y:x},h(a)):{x:b,y:x};return b=N.x,x=N.y,l?Object.assign({},P,((S={})[L]=T?"0":"",S[D]=E?"0":"",S.transform=(j.devicePixelRatio||1)<=1?"translate("+b+"px, "+x+"px)":"translate3d("+b+"px, "+x+"px, 0)",S)):Object.assign({},P,((o={})[L]=T?x+"px":"",o[D]=E?b+"px":"",o.transform="",o))}var F={passive:!0};var $={left:"right",right:"left",bottom:"top",top:"bottom"};function z(e){return e.replace(/left|right|bottom|top/g,(function(e){return $[e]}))}var X={start:"end",end:"start"};function Y(e){return e.replace(/start|end/g,(function(e){return X[e]}))}function J(e){var t=h(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function G(e){return L(H(e)).left+J(e).scrollLeft}function K(e){var t=k(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Q(e){return["html","body","#document"].indexOf(v(e))>=0?e.ownerDocument.body:y(e)&&K(e)?e:Q(V(e))}function Z(e,t){var n;void 0===t&&(t=[]);var r=Q(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=h(r),a=i?[o].concat(o.visualViewport||[],K(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Z(V(a)))}function ee(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function te(e,t,n){return t===u?ee(function(e,t){var n=h(e),r=H(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,c=0;if(i){o=i.width,a=i.height;var u=D();(u||!u&&"fixed"===t)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:s+G(e),y:c}}(e,n)):g(t)?function(e,t){var n=L(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):ee(function(e){var t,n=H(e),r=J(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=O(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=O(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+G(e),c=-r.scrollTop;return"rtl"===k(i||n).direction&&(s+=O(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(H(e)))}function ne(e,t,n,r){var i="clippingParents"===t?function(e){var t=Z(V(e)),n=["absolute","fixed"].indexOf(k(e).position)>=0&&y(e)?W(e):e;return g(n)?t.filter((function(e){return g(e)&&C(e,n)&&"body"!==v(e)})):[]}(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce((function(t,n){var i=te(e,n,r);return t.top=O(i.top,t.top),t.right=E(i.right,t.right),t.bottom=E(i.bottom,t.bottom),t.left=O(i.left,t.left),t}),te(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function re(i){var o,c=i.reference,u=i.element,p=i.placement,f=p?x(p):null,d=p?q(p):null,l=c.x+c.width/2-u.width/2,m=c.y+c.height/2-u.height/2;switch(f){case e:o={x:l,y:c.y-u.height};break;case t:o={x:l,y:c.y+c.height};break;case n:o={x:c.x+c.width,y:m};break;case r:o={x:c.x-u.width,y:m};break;default:o={x:c.x,y:c.y}}var v=f?P(f):null;if(null!=v){var h="y"===v?"height":"width";switch(d){case a:o[v]=o[v]-(c[h]/2-u[h]/2);break;case s:o[v]=o[v]+(c[h]/2-u[h]/2)}}return o}function ie(r,i){void 0===i&&(i={});var a=i,s=a.placement,d=void 0===s?r.placement:s,l=a.strategy,m=void 0===l?r.strategy:l,v=a.boundary,h=void 0===v?c:v,y=a.rootBoundary,b=void 0===y?u:y,w=a.elementContext,x=void 0===w?p:w,O=a.altBoundary,E=void 0!==O&&O,A=a.padding,T=void 0===A?0:A,D=B("number"!=typeof T?T:R(T,o)),j=x===p?f:p,C=r.rects.popper,k=r.elements[E?j:x],M=ne(g(k)?k:k.contextElement||H(r.elements.popper),h,b,m),V=L(r.elements.reference),S=re({reference:V,element:C,strategy:"absolute",placement:d}),W=ee(Object.assign({},C,S)),P=x===p?W:V,N={top:M.top-P.top+D.top,bottom:P.bottom-M.bottom+D.bottom,left:M.left-P.left+D.left,right:P.right-M.right+D.right},I=r.modifiersData.offset;if(x===p&&I){var q=I[d];Object.keys(N).forEach((function(r){var i=[n,t].indexOf(r)>=0?1:-1,o=[e,t].indexOf(r)>=0?"y":"x";N[r]+=q[o]*i}))}return N}function oe(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,s=n.padding,c=n.flipVariations,u=n.allowedAutoPlacements,p=void 0===u?l:u,f=q(r),m=f?c?d:d.filter((function(e){return q(e)===f})):o,v=m.filter((function(e){return p.indexOf(e)>=0}));0===v.length&&(v=m);var h=v.reduce((function(t,n){return t[n]=ie(e,{placement:n,boundary:i,rootBoundary:a,padding:s})[x(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var ae={name:"flip",enabled:!0,phase:"main",fn:function(o){var s=o.state,c=o.options,u=o.name;if(!s.modifiersData[u]._skip){for(var p=c.mainAxis,f=void 0===p||p,d=c.altAxis,l=void 0===d||d,m=c.fallbackPlacements,v=c.padding,h=c.boundary,g=c.rootBoundary,y=c.altBoundary,b=c.flipVariations,w=void 0===b||b,O=c.allowedAutoPlacements,E=s.options.placement,A=x(E),T=m||(A===E||!w?[z(E)]:function(e){if(x(e)===i)return[];var t=z(e);return[Y(e),t,Y(t)]}(E)),D=[E].concat(T).reduce((function(e,t){return e.concat(x(t)===i?oe(s,{placement:t,boundary:h,rootBoundary:g,padding:v,flipVariations:w,allowedAutoPlacements:O}):t)}),[]),L=s.rects.reference,j=s.rects.popper,C=new Map,k=!0,M=D[0],H=0;H<D.length;H++){var V=D[H],S=x(V),W=q(V)===a,P=[e,t].indexOf(S)>=0,N=P?"width":"height",B=ie(s,{placement:V,boundary:h,rootBoundary:g,altBoundary:y,padding:v}),R=P?W?n:r:W?t:e;L[N]>j[N]&&(R=z(R));var I=z(R),U=[];if(f&&U.push(B[S]<=0),l&&U.push(B[R]<=0,B[I]<=0),U.every((function(e){return e}))){M=V,k=!1;break}C.set(V,U)}if(k)for(var _=function(e){var t=D.find((function(t){var n=C.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return M=t,"break"},F=w?3:1;F>0;F--){if("break"===_(F))break}s.placement!==M&&(s.modifiersData[u]._skip=!0,s.placement=M,s.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function se(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ce(i){return[e,n,t,r].some((function(e){return i[e]>=0}))}var ue={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var i=t.state,o=t.options,a=t.name,s=o.offset,c=void 0===s?[0,0]:s,u=l.reduce((function(t,o){return t[o]=function(t,i,o){var a=x(t),s=[r,e].indexOf(a)>=0?-1:1,c="function"==typeof o?o(Object.assign({},i,{placement:t})):o,u=c[0],p=c[1];return u=u||0,p=(p||0)*s,[r,n].indexOf(a)>=0?{x:p,y:u}:{x:u,y:p}}(o,i.rects,c),t}),{}),p=u[i.placement],f=p.x,d=p.y;null!=i.modifiersData.popperOffsets&&(i.modifiersData.popperOffsets.x+=f,i.modifiersData.popperOffsets.y+=d),i.modifiersData[a]=u}};var pe={name:"preventOverflow",enabled:!0,phase:"main",fn:function(i){var o=i.state,s=i.options,c=i.name,u=s.mainAxis,p=void 0===u||u,f=s.altAxis,d=void 0!==f&&f,l=s.boundary,m=s.rootBoundary,v=s.altBoundary,h=s.padding,g=s.tether,y=void 0===g||g,b=s.tetherOffset,w=void 0===b?0:b,A=ie(o,{boundary:l,rootBoundary:m,padding:h,altBoundary:v}),T=x(o.placement),D=q(o.placement),L=!D,C=P(T),k="x"===C?"y":"x",M=o.modifiersData.popperOffsets,H=o.rects.reference,V=o.rects.popper,S="function"==typeof w?w(Object.assign({},o.rects,{placement:o.placement})):w,B="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),R=o.modifiersData.offset?o.modifiersData.offset[o.placement]:null,I={x:0,y:0};if(M){if(p){var U,_="y"===C?e:r,F="y"===C?t:n,$="y"===C?"height":"width",z=M[C],X=z+A[_],Y=z-A[F],J=y?-V[$]/2:0,G=D===a?H[$]:V[$],K=D===a?-V[$]:-H[$],Q=o.elements.arrow,Z=y&&Q?j(Q):{width:0,height:0},ee=o.modifiersData["arrow#persistent"]?o.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[_],ne=ee[F],re=N(0,H[$],Z[$]),oe=L?H[$]/2-J-re-te-B.mainAxis:G-re-te-B.mainAxis,ae=L?-H[$]/2+J+re+ne+B.mainAxis:K+re+ne+B.mainAxis,se=o.elements.arrow&&W(o.elements.arrow),ce=se?"y"===C?se.clientTop||0:se.clientLeft||0:0,ue=null!=(U=null==R?void 0:R[C])?U:0,pe=z+ae-ue,fe=N(y?E(X,z+oe-ue-ce):X,z,y?O(Y,pe):Y);M[C]=fe,I[C]=fe-z}if(d){var de,le="x"===C?e:r,me="x"===C?t:n,ve=M[k],he="y"===k?"height":"width",ge=ve+A[le],ye=ve-A[me],be=-1!==[e,r].indexOf(T),we=null!=(de=null==R?void 0:R[k])?de:0,xe=be?ge:ve-H[he]-V[he]-we+B.altAxis,Oe=be?ve+H[he]+V[he]-we-B.altAxis:ye,Ee=y&&be?function(e,t,n){var r=N(e,t,n);return r>n?n:r}(xe,ve,Oe):N(y?xe:ge,ve,y?Oe:ye);M[k]=Ee,I[k]=Ee-ve}o.modifiersData[c]=I}},requiresIfExists:["offset"]};function fe(e,t,n){void 0===n&&(n=!1);var r,i,o=y(t),a=y(t)&&function(e){var t=e.getBoundingClientRect(),n=A(t.width)/e.offsetWidth||1,r=A(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=H(t),c=L(e,a,n),u={scrollLeft:0,scrollTop:0},p={x:0,y:0};return(o||!o&&!n)&&(("body"!==v(t)||K(s))&&(u=(r=t)!==h(r)&&y(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:J(r)),y(t)?((p=L(t,!0)).x+=t.clientLeft,p.y+=t.clientTop):s&&(p.x=G(s))),{x:c.left+u.scrollLeft-p.x,y:c.top+u.scrollTop-p.y,width:c.width,height:c.height}}function de(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var le={placement:"bottom",modifiers:[],strategy:"absolute"};function me(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function ve(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?le:i;return function(e,t,n){void 0===n&&(n=o);var i,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},le,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},c=[],u=!1,p={state:s,setOptions:function(n){var i="function"==typeof n?n(s.options):n;f(),s.options=Object.assign({},o,s.options,i),s.scrollParents={reference:g(e)?Z(e):e.contextElement?Z(e.contextElement):[],popper:Z(t)};var a,u,d=function(e){var t=de(e);return m.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((a=[].concat(r,s.options.modifiers),u=a.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(u).map((function(e){return u[e]}))));return s.orderedModifiers=d.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:s,name:t,instance:p,options:r}),a=function(){};c.push(o||a)}})),p.update()},forceUpdate:function(){if(!u){var e=s.elements,t=e.reference,n=e.popper;if(me(t,n)){s.rects={reference:fe(t,W(n),"fixed"===s.options.strategy),popper:j(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<s.orderedModifiers.length;r++)if(!0!==s.reset){var i=s.orderedModifiers[r],o=i.fn,a=i.options,c=void 0===a?{}:a,f=i.name;"function"==typeof o&&(s=o({state:s,options:c,name:f,instance:p})||s)}else s.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){p.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(i())}))}))),a}),destroy:function(){f(),u=!0}};if(!me(e,t))return p;function f(){c.forEach((function(e){return e()})),c=[]}return p.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),p}}var he=ve({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,c=h(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,F)})),s&&c.addEventListener("resize",n.update,F),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,F)})),s&&c.removeEventListener("resize",n.update,F)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=re({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,u={placement:x(t.placement),variation:q(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,_(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,_(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},w,ue,ae,pe,I,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=ie(t,{elementContext:"reference"}),s=ie(t,{altBoundary:!0}),c=se(a,r),u=se(s,i,o),p=ce(c),f=ce(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:p,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":f})}}]}),ge="tippy-content",ye="tippy-backdrop",be="tippy-arrow",we="tippy-svg-arrow",xe={passive:!0,capture:!0},Oe=function(){return document.body};function Ee(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Ae(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Te(e,t){return"function"==typeof e?e.apply(void 0,t):e}function De(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Le(e){return[].concat(e)}function je(e,t){-1===e.indexOf(t)&&e.push(t)}function Ce(e){return[].slice.call(e)}function ke(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Me(){return document.createElement("div")}function He(e){return["Element","Fragment"].some((function(t){return Ae(e,t)}))}function Ve(e){return He(e)?[e]:function(e){return Ae(e,"NodeList")}(e)?Ce(e):Array.isArray(e)?e:Ce(document.querySelectorAll(e))}function Se(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function We(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Pe(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function Ne(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var Be={isTouch:!1},Re=0;function Ie(){Be.isTouch||(Be.isTouch=!0,window.performance&&document.addEventListener("mousemove",qe))}function qe(){var e=performance.now();e-Re<20&&(Be.isTouch=!1,document.removeEventListener("mousemove",qe)),Re=e}function Ue(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var _e=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,Fe=Object.assign({appendTo:Oe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),$e=Object.keys(Fe);function ze(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=Fe[i])?r:o);return t}),{});return Object.assign({},e,t)}function Xe(e,t){var n=Object.assign({},t,{content:Te(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(ze(Object.assign({},Fe,{plugins:t}))):$e).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Fe.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}var Ye=function(){return"innerHTML"};function Je(e,t){e[Ye()]=t}function Ge(e){var t=Me();return!0===e?t.className=be:(t.className=we,He(e)?t.appendChild(e):Je(t,e)),t}function Ke(e,t){He(t.content)?(Je(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Je(e,t.content):e.textContent=t.content)}function Qe(e){var t=e.firstElementChild,n=Ce(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ge)})),arrow:n.find((function(e){return e.classList.contains(be)||e.classList.contains(we)})),backdrop:n.find((function(e){return e.classList.contains(ye)}))}}function Ze(e){var t=Me(),n=Me();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Me();function i(n,r){var i=Qe(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Ke(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(Ge(r.arrow))):o.appendChild(Ge(r.arrow)):s&&o.removeChild(s)}return r.className=ge,r.setAttribute("data-state","hidden"),Ke(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}Ze.$$tippy=!0;var et=1,tt=[],nt=[];function rt(e,t){var n,r,i,o,a,s,c,u,p=Xe(e,Object.assign({},Fe,ze(ke(t)))),f=!1,d=!1,l=!1,m=!1,v=[],h=De(X,p.interactiveDebounce),g=et++,y=(u=p.plugins).filter((function(e,t){return u.indexOf(e)===t})),b={id:g,reference:e,popper:Me(),popperInstance:null,props:p,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){if(b.state.isDestroyed)return;V("onBeforeUpdate",[b,t]),$();var n=b.props,r=Xe(e,Object.assign({},n,ke(t),{ignoreAttributes:!0}));b.props=r,F(),n.interactiveDebounce!==r.interactiveDebounce&&(P(),h=De(X,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?Le(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");W(),H(),O&&O(n,r);b.popperInstance&&(K(),Z().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));V("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){var e=b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=Be.isTouch&&!b.props.touch,i=Ee(b.props.duration,0,Fe.duration);if(e||t||n||r)return;if(j().hasAttribute("disabled"))return;if(V("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,L()&&(x.style.visibility="visible");H(),I(),b.state.isMounted||(x.style.transition="none");if(L()){var o=k();Se([o.box,o.content],0)}s=function(){var e;if(b.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,L()&&b.props.animation){var t=k(),n=t.box,r=t.content;Se([n,r],i),We([n,r],"visible")}S(),W(),je(nt,b),null==(e=b.popperInstance)||e.forceUpdate(),V("onMount",[b]),b.props.animation&&L()&&function(e,t){U(e,t)}(i,(function(){b.state.isShown=!0,V("onShown",[b])}))}},function(){var e,t=b.props.appendTo,n=j();e=b.props.interactive&&t===Oe||"parent"===t?n.parentNode:Te(t,[n]);e.contains(x)||e.appendChild(x);b.state.isMounted=!0,K()}()},hide:function(){var e=!b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=Ee(b.props.duration,1,Fe.duration);if(e||t||n)return;if(V("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,m=!1,f=!1,L()&&(x.style.visibility="hidden");if(P(),q(),H(!0),L()){var i=k(),o=i.box,a=i.content;b.props.animation&&(Se([o,a],r),We([o,a],"hidden"))}S(),W(),b.props.animation?L()&&function(e,t){U(e,(function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,b.unmount):b.unmount()},hideWithInteractivity:function(e){C().addEventListener("mousemove",h),je(tt,h),h(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){b.state.isVisible&&b.hide();if(!b.state.isMounted)return;Q(),Z().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);nt=nt.filter((function(e){return e!==b})),b.state.isMounted=!1,V("onHidden",[b])},destroy:function(){if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),$(),delete e._tippy,b.state.isDestroyed=!0,V("onDestroy",[b])}};if(!p.render)return b;var w=p.render(b),x=w.popper,O=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,e._tippy=b,x._tippy=b;var E=y.map((function(e){return e.fn(b)})),A=e.hasAttribute("aria-expanded");return F(),W(),H(),V("onCreate",[b]),p.showOnCreate&&ee(),x.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&C().addEventListener("mousemove",h)})),b;function T(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function D(){return"hold"===T()[0]}function L(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function j(){return c||e}function C(){var e,t,n=j().parentNode;return n?null!=(t=Le(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function k(){return Qe(x)}function M(e){return b.state.isMounted&&!b.state.isVisible||Be.isTouch||o&&"focus"===o.type?0:Ee(b.props.delay,e?0:1,Fe.delay)}function H(e){void 0===e&&(e=!1),x.style.pointerEvents=b.props.interactive&&!e?"":"none",x.style.zIndex=""+b.props.zIndex}function V(e,t,n){var r;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=b.props)[e].apply(r,t)}function S(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;Le(b.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(b.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function W(){!A&&b.props.aria.expanded&&Le(b.props.triggerTarget||e).forEach((function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===j()?"true":"false"):e.removeAttribute("aria-expanded")}))}function P(){C().removeEventListener("mousemove",h),tt=tt.filter((function(e){return e!==h}))}function N(t){if(!Be.isTouch||!l&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Ne(x,n)){if(Le(b.props.triggerTarget||e).some((function(e){return Ne(e,n)}))){if(Be.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else V("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),d=!0,setTimeout((function(){d=!1})),b.state.isMounted||q())}}}function B(){l=!0}function R(){l=!1}function I(){var e=C();e.addEventListener("mousedown",N,!0),e.addEventListener("touchend",N,xe),e.addEventListener("touchstart",R,xe),e.addEventListener("touchmove",B,xe)}function q(){var e=C();e.removeEventListener("mousedown",N,!0),e.removeEventListener("touchend",N,xe),e.removeEventListener("touchstart",R,xe),e.removeEventListener("touchmove",B,xe)}function U(e,t){var n=k().box;function r(e){e.target===n&&(Pe(n,"remove",r),t())}if(0===e)return t();Pe(n,"remove",a),Pe(n,"add",r),a=r}function _(t,n,r){void 0===r&&(r=!1),Le(b.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function F(){var e;D()&&(_("touchstart",z,{passive:!0}),_("touchend",Y,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(_(e,z),e){case"mouseenter":_("mouseleave",Y);break;case"focus":_(_e?"focusout":"blur",J);break;case"focusin":_("focusout",J)}}))}function $(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),v=[]}function z(e){var t,n=!1;if(b.state.isEnabled&&!G(e)&&!d){var r="focus"===(null==(t=o)?void 0:t.type);o=e,c=e.currentTarget,W(),!b.state.isVisible&&Ae(e,"MouseEvent")&&tt.forEach((function(t){return t(e)})),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||f)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:ee(e),"click"===e.type&&(f=!n),n&&!r&&te(e)}}function X(e){var t=e.target,n=j().contains(t)||x.contains(t);if("mousemove"!==e.type||!n){var r=Z().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:p}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=i.placement.split("-")[0],s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,u="top"===a?s.bottom.y:0,p="right"===a?s.left.x:0,f="left"===a?s.right.x:0,d=t.top-r+c>o,l=r-t.bottom-u>o,m=t.left-n+p>o,v=n-t.right-f>o;return d||l||m||v}))})(r,e)&&(P(),te(e))}}function Y(e){G(e)||b.props.trigger.indexOf("click")>=0&&f||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function J(e){b.props.trigger.indexOf("focusin")<0&&e.target!==j()||b.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function G(e){return!!Be.isTouch&&D()!==e.type.indexOf("touch")>=0}function K(){Q();var t=b.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,c=L()?Qe(x).arrow:null,u=o?{getBoundingClientRect:o,contextElement:o.contextElement||j()}:e,p={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(L()){var n=k().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},f=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},p];L()&&c&&f.push({name:"arrow",options:{element:c,padding:3}}),f.push.apply(f,(null==n?void 0:n.modifiers)||[]),b.popperInstance=he(u,x,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:f}))}function Q(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Z(){return Ce(x.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&V("onTrigger",[b,e]),I();var t=M(!0),r=T(),i=r[0],o=r[1];Be.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){b.show()}),t):b.show()}function te(e){if(b.clearDelayTimeouts(),V("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&f)){var t=M(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):i=requestAnimationFrame((function(){b.hide()}))}}else q()}}function it(e,t){void 0===t&&(t={});var n=Fe.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Ie,xe),window.addEventListener("blur",Ue);var r=Object.assign({},t,{plugins:n}),i=Ve(e).reduce((function(e,t){var n=t&&rt(t,r);return n&&e.push(n),e}),[]);return He(e)?i[0]:i}it.defaultProps=Fe,it.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Fe[t]=e[t]}))},it.currentInput=Be,Object.assign({},w,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),it.setDefaultProps({render:Ze});class ot{constructor(e){this.rootNode=e;const t=e=>this.rootNode.getAttribute(e);this.target=t("data-uss-content-target"),this.placement=t("data-uss-placement");const n=t("data-uss-delay");this.delay=n?n.split(",").map((e=>Number(e))):[0,0];const r=t("data-uss-duration");this.duration=r?r.split(",").map((e=>Number(e))):[0,0],this.inlineContent=t("data-uss-content"),this.targetContent=this.target?document.querySelector(`[data-uss-tooltip-content-id="${this.target}"]`).innerHTML:null,this.tooltipContent=this.inlineContent||this.targetContent}init(){if(!this.tooltipContent)return;const e=document.createElement("div");e.classList.add("uss-tooltip__content"),e.innerHTML=this.tooltipContent,it(this.rootNode,{content:e,allowHTML:!0,arrow:!1,delay:this.delay,duration:this.duration,placement:this.placement||"top",trigger:"mouseenter click"})}}export{ot as default};