pages/htdocs/assets/floatbox/floatbox.js

7 lines
8.5 KiB
JavaScript
Raw Normal View History

2023-04-02 08:31:07 +00:00
/*
* Floatbox 8.5.2 - 2021-10-05
* Copyright (c) 2021 Byron McGregor
* License: MIT (see LICENSE.txt for details)
* Website: https://floatboxjs.com/
*/
!function(){var l=window,p=l.document,a=l.parent!=l&&K(l.parent)||{},h=l.fb||{},m=h.data||{},g=[],s=Array.isArray,c=Date.now,d=void 0,v=function(){var e,t=a.fb&&a.fb.smallScreen,n=window.matchMedia;!!t===t?e=t:n&&window.innerWidth&&(e=!n("(min-width:512px)").matches||!n("(min-height:512px)").matches);return!!e}(),e=l.fbOptions||{},b={},n=[],t=[],r=s(e.ready)?e.ready:[],u={},y={},o={},i=F(l.location.href),f=F(e.scriptPath||(D('script[src*="floatbox.js"]')[0]||D("script",0,-1)).src),x=f.$,w=/\s+/g,$="floatbox",E=!1;function L(e){if(t.push(e),E=E||"loading"!=p.readyState)for(;t.length;)X(t.shift())}function O(e,t){if((t?n:r).push(e),m.Z&&E)for(r=n.concat(r),n.length=0;r.length;)X(r.shift())}function N(){var e,t,n,r=[].slice.call(arguments),o=1<r.length&&r.shift()||{};for(n=0;n<r.length;n++)for(t in e=r[n])e[t]!==d&&(o[t]=e[t]);return o}function j(e,t){var n,r,o=typeof e;try{!!e===e||+e===e||""+e===e?n=o:e?e==e.window?n="window":(r=K(e))&&(n=e==r.document?"document":"node"):n=""+e}catch(e){}return n=n||/\s(\w+)/.exec({}.toString.call(e))[1].toLowerCase(),t&&(n=-1<(s(t)?t:[t]).indexOf(n)),n}function C(e,t){var n,r,o=e,i=[];if(e&&"string"==typeof e){if(e=re(e,"#",""),o=null,t)i.push(t);else for(i.push(p),a.document&&i.push(a.document),n=D("iframe"),r=0;r<n.length;r++)(t=n[r].contentDocument)&&i.push(t);for(r=0;r<i.length&&!o;r++)o=i[r].getElementById(e)}return o}function D(e,t,n){e=s(e)?e.join(","):""+e;var r,o,i,a,f=(K(t=C(t))||l).document;ne(t)&&(a=(i=H(t,"id"))||"fb"+c(),e=(o="#"+(t.id=a)+" ")+re(e,/,/g,","+o));try{r=[].slice.call(f.querySelectorAll(e))}catch(e){r=[]}return o&&H(t,"id",i),+n===n&&(r=r[n<0?n+r.length:n]),r}function M(e,t,n){var r,o,i,a,f;if(s(e)){for(f=0;f<e.length;f++)M(e[f],d,n);M(d,t)}else(r=C("fb"+e,p))?(te(r),X(u[e]),le(u,e)):!e||+e===e||!n&&y[e]?t&&(""+t===t?o="text":X(t)):(o="src",y[e]=!0);o&&(i=c(),(r=ee("script")).id="fb"+i,"src"==o?(r.async=!1,a=T(r,["load","error"],function(){S(a),M(i)}),u[i]=t):e=t+";fb.require("+i+")",r[o]=e,te(r,p.head))}function T(e,t,n,r,o){var i;if(e=C(e)||D(e))if(o=o||[e,t,n,r],s(e))for(i=e.length;i--;)T(e[i],t,n,r,o);else if(s(t))for(i=t.length;i--;)T(e,t[i],n,r,o);else e.addEventListener&&!/^on/.test(t)?e.addEventListener(t,n,r):e[t]=n;return o}function S(e,t,n,r){var o;if(e=C(e)||D(e))if(n)if(s(e))for(o=e.length;o--;)S(e[o],t,n,r);else if(s(t))for(o=t.length;o--;)S(e,t[o],n,r);else e.removeEventListener&&!/^on/.test(t)?e.removeEventListener(t,n,r):e[t]=d;else if(s(e))if(!e[2]||s(e[2]))for(o=e.length;e.length;)S(e.pop());else S.apply(l,e)}function _(e,t,n){e&&(t&&e.stopPropagation&&e.stopPropagation(),!1!==n&&e.preventDefault&&e.preventDefault())}function z(e){var t=[];return(e=C(e))&&(e.classList?t=[].slice.call(e.classList):e.className&&(t=e.className.split(w))),t}function R(e,t){return!!t&&-1<z(e).indexOf(t)}function q(e,t,n){var r,o;if((e=C(e)||D(e))&&t&&(t.split&&(t=t.split(w)),s(t)))if(s(e))for(o=e.length;o--;)q(e[o],t,n);else for(o=0;o<t.length;o++)(r=t[o])&&(e.classList?e.classList[n?"add":"remove"](r):n?R(e,r)||(e.className=se((e.className||"")+" "+r)):e.className&&(e.className=se(re(e.className,w," ",RegExp("(^| )("+r+")( |$)","g"),"$1$3"))))}function P(e,t){q(e,t,!0)}function A(e,t){q(e,t,!1)}function H(e,t,n){var r,o;if(e=C(e)||D(e),s(e))for(o=0;o<e.length;o++)r=H(e[o],t,n);else if(j(t,"object"))for(o in t)H(e,o,t[o]);else t&&(r=e[(null===n?"remove":n===d?"get":"set")+"Attribute"](t,n));return r}function k(e,t){e=C(e);var n,r,o,i,a,f,l,s,c,u=[];function d(e){_(e),h.start(this)}if(i=b._){for(ne(e)||(e=p.body,g.length=0),!R(e,$)&&!1===i.activateMedia||(u=[e]),u=u.concat(D("."+$,e)),s=0;s<u.length;s++)if(!ne(n=u[s],["a","area"])){for(P(f=J(n),H(n,"class")),A(f,$),f.className||le(f,"className"),a=z(f),c=0;c<a.length;c++)f=N({},b.$[a[c]],f);for(r=D(["a","area"],n),c=0;c<r.length;c++)l=H(o=r[c],"href")||H(o,"xlink:href"),R(o,"nofloatbox")||/^mailto:/.test(l)||!R(n,$)&&!F(l).Y||(H(o,"data-fb-inherit",Q(N(J(H(o,"data-fb-inherit")),f))||null),P(o,$))}for(r=D("a."+$+",area."+$,e),s=0;s<r.length;s++)o=r[s],g[o.fbx]||(m.$(o,t),o.onclick||T(o,"onclick",d))}}function B(e,