bpm-presentation/plugin/zoom/zoom.js
2022-01-19 21:19:28 -05:00

6 lines
16 KiB
JavaScript

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).RevealZoom=e()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math==Math&&t},n=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),r={},o=function(t){try{return!!t()}catch(t){return!0}},i=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),c=u,a=Function.prototype.call,l=c?a.bind(a):function(){return a.apply(a,arguments)},s={},f={}.propertyIsEnumerable,d=Object.getOwnPropertyDescriptor,y=d&&!f.call({1:2},1);s.f=y?function(t){var e=d(this,t);return!!e&&e.enumerable}:f;var m,p,b=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},g=u,v=Function.prototype,h=v.bind,w=v.call,x=g&&h.bind(w,w),O=g?function(t){return t&&x(t)}:function(t){return t&&function(){return w.apply(t,arguments)}},S=O,T=S({}.toString),E=S("".slice),j=function(t){return E(T(t),8,-1)},I=O,P=o,z=j,R=n.Object,k=I("".split),C=P((function(){return!R("z").propertyIsEnumerable(0)}))?function(t){return"String"==z(t)?k(t,""):R(t)}:R,L=n.TypeError,M=function(t){if(null==t)throw L("Can't call method on "+t);return t},W=C,A=M,F=function(t){return W(A(t))},_=function(t){return"function"==typeof t},N=_,D=function(t){return"object"==typeof t?null!==t:N(t)},Y=n,K=_,X=function(t){return K(t)?t:void 0},B=function(t,e){return arguments.length<2?X(Y[t]):Y[t]&&Y[t][e]},H=O({}.isPrototypeOf),U=n,G=B("navigator","userAgent")||"",$=U.process,q=U.Deno,V=$&&$.versions||q&&q.version,Z=V&&V.v8;Z&&(p=(m=Z.split("."))[0]>0&&m[0]<4?1:+(m[0]+m[1])),!p&&G&&(!(m=G.match(/Edge\/(\d+)/))||m[1]>=74)&&(m=G.match(/Chrome\/(\d+)/))&&(p=+m[1]);var J=p,Q=o,tt=!!Object.getOwnPropertySymbols&&!Q((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&J&&J<41})),et=tt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,nt=B,rt=_,ot=H,it=et,ut=n.Object,ct=it?function(t){return"symbol"==typeof t}:function(t){var e=nt("Symbol");return rt(e)&&ot(e.prototype,ut(t))},at=n.String,lt=_,st=function(t){try{return at(t)}catch(t){return"Object"}},ft=n.TypeError,dt=function(t){if(lt(t))return t;throw ft(st(t)+" is not a function")},yt=l,mt=_,pt=D,bt=n.TypeError,gt={exports:{}},vt=n,ht=Object.defineProperty,wt=function(t,e){try{ht(vt,t,{value:e,configurable:!0,writable:!0})}catch(n){vt[t]=e}return e},xt=wt,Ot="__core-js_shared__",St=n[Ot]||xt(Ot,{}),Tt=St;(gt.exports=function(t,e){return Tt[t]||(Tt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.20.3",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"});var Et=M,jt=n.Object,It=function(t){return jt(Et(t))},Pt=O({}.hasOwnProperty),zt=Object.hasOwn||function(t,e){return Pt(It(t),e)},Rt=O,kt=0,Ct=Math.random(),Lt=Rt(1..toString),Mt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Lt(++kt+Ct,36)},Wt=n,At=gt.exports,Ft=zt,_t=Mt,Nt=tt,Dt=et,Yt=At("wks"),Kt=Wt.Symbol,Xt=Kt&&Kt.for,Bt=Dt?Kt:Kt&&Kt.withoutSetter||_t,Ht=function(t){if(!Ft(Yt,t)||!Nt&&"string"!=typeof Yt[t]){var e="Symbol."+t;Nt&&Ft(Kt,t)?Yt[t]=Kt[t]:Yt[t]=Dt&&Xt?Xt(e):Bt(e)}return Yt[t]},Ut=l,Gt=D,$t=ct,qt=function(t,e){var n=t[e];return null==n?void 0:dt(n)},Vt=function(t,e){var n,r;if("string"===e&&mt(n=t.toString)&&!pt(r=yt(n,t)))return r;if(mt(n=t.valueOf)&&!pt(r=yt(n,t)))return r;if("string"!==e&&mt(n=t.toString)&&!pt(r=yt(n,t)))return r;throw bt("Can't convert object to primitive value")},Zt=Ht,Jt=n.TypeError,Qt=Zt("toPrimitive"),te=function(t,e){if(!Gt(t)||$t(t))return t;var n,r=qt(t,Qt);if(r){if(void 0===e&&(e="default"),n=Ut(r,t,e),!Gt(n)||$t(n))return n;throw Jt("Can't convert object to primitive value")}return void 0===e&&(e="number"),Vt(t,e)},ee=ct,ne=function(t){var e=te(t,"string");return ee(e)?e:e+""},re=D,oe=n.document,ie=re(oe)&&re(oe.createElement),ue=function(t){return ie?oe.createElement(t):{}},ce=ue,ae=!i&&!o((function(){return 7!=Object.defineProperty(ce("div"),"a",{get:function(){return 7}}).a})),le=i,se=l,fe=s,de=b,ye=F,me=ne,pe=zt,be=ae,ge=Object.getOwnPropertyDescriptor;r.f=le?ge:function(t,e){if(t=ye(t),e=me(e),be)try{return ge(t,e)}catch(t){}if(pe(t,e))return de(!se(fe.f,t,e),t[e])};var ve={},he=i&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),we=n,xe=D,Oe=we.String,Se=we.TypeError,Te=function(t){if(xe(t))return t;throw Se(Oe(t)+" is not an object")},Ee=i,je=ae,Ie=he,Pe=Te,ze=ne,Re=n.TypeError,ke=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,Le="enumerable",Me="configurable",We="writable";ve.f=Ee?Ie?function(t,e,n){if(Pe(t),e=ze(e),Pe(n),"function"==typeof t&&"prototype"===e&&"value"in n&&We in n&&!n.writable){var r=Ce(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:Me in n?n.configurable:r.configurable,enumerable:Le in n?n.enumerable:r.enumerable,writable:!1})}return ke(t,e,n)}:ke:function(t,e,n){if(Pe(t),e=ze(e),Pe(n),je)try{return ke(t,e,n)}catch(t){}if("get"in n||"set"in n)throw Re("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var Ae=ve,Fe=b,_e=i?function(t,e,n){return Ae.f(t,e,Fe(1,n))}:function(t,e,n){return t[e]=n,t},Ne={exports:{}},De=_,Ye=St,Ke=O(Function.toString);De(Ye.inspectSource)||(Ye.inspectSource=function(t){return Ke(t)});var Xe,Be,He,Ue=Ye.inspectSource,Ge=_,$e=Ue,qe=n.WeakMap,Ve=Ge(qe)&&/native code/.test($e(qe)),Ze=gt.exports,Je=Mt,Qe=Ze("keys"),tn=function(t){return Qe[t]||(Qe[t]=Je(t))},en={},nn=Ve,rn=n,on=O,un=D,cn=_e,an=zt,ln=St,sn=tn,fn=en,dn="Object already initialized",yn=rn.TypeError,mn=rn.WeakMap;if(nn||ln.state){var pn=ln.state||(ln.state=new mn),bn=on(pn.get),gn=on(pn.has),vn=on(pn.set);Xe=function(t,e){if(gn(pn,t))throw new yn(dn);return e.facade=t,vn(pn,t,e),e},Be=function(t){return bn(pn,t)||{}},He=function(t){return gn(pn,t)}}else{var hn=sn("state");fn[hn]=!0,Xe=function(t,e){if(an(t,hn))throw new yn(dn);return e.facade=t,cn(t,hn,e),e},Be=function(t){return an(t,hn)?t[hn]:{}},He=function(t){return an(t,hn)}}var wn={set:Xe,get:Be,has:He,enforce:function(t){return He(t)?Be(t):Xe(t,{})},getterFor:function(t){return function(e){var n;if(!un(e)||(n=Be(e)).type!==t)throw yn("Incompatible receiver, "+t+" required");return n}}},xn=i,On=zt,Sn=Function.prototype,Tn=xn&&Object.getOwnPropertyDescriptor,En=On(Sn,"name"),jn=En&&"something"===function(){}.name,In=En&&(!xn||xn&&Tn(Sn,"name").configurable),Pn=n,zn=_,Rn=zt,kn=_e,Cn=wt,Ln=Ue,Mn={EXISTS:En,PROPER:jn,CONFIGURABLE:In}.CONFIGURABLE,Wn=wn.get,An=wn.enforce,Fn=String(String).split("String");(Ne.exports=function(t,e,n,r){var o,i=!!r&&!!r.unsafe,u=!!r&&!!r.enumerable,c=!!r&&!!r.noTargetGet,a=r&&void 0!==r.name?r.name:e;zn(n)&&("Symbol("===String(a).slice(0,7)&&(a="["+String(a).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Rn(n,"name")||Mn&&n.name!==a)&&kn(n,"name",a),(o=An(n)).source||(o.source=Fn.join("string"==typeof a?a:""))),t!==Pn?(i?!c&&t[e]&&(u=!0):delete t[e],u?t[e]=n:kn(t,e,n)):u?t[e]=n:Cn(e,n)})(Function.prototype,"toString",(function(){return zn(this)&&Wn(this).source||Ln(this)}));var _n={},Nn=Math.ceil,Dn=Math.floor,Yn=function(t){var e=+t;return e!=e||0===e?0:(e>0?Dn:Nn)(e)},Kn=Yn,Xn=Math.max,Bn=Math.min,Hn=Yn,Un=Math.min,Gn=function(t){return t>0?Un(Hn(t),9007199254740991):0},$n=F,qn=function(t,e){var n=Kn(t);return n<0?Xn(n+e,0):Bn(n,e)},Vn=function(t){return Gn(t.length)},Zn=function(t){return function(e,n,r){var o,i=$n(e),u=Vn(i),c=qn(r,u);if(t&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},Jn={includes:Zn(!0),indexOf:Zn(!1)},Qn=zt,tr=F,er=Jn.indexOf,nr=en,rr=O([].push),or=function(t,e){var n,r=tr(t),o=0,i=[];for(n in r)!Qn(nr,n)&&Qn(r,n)&&rr(i,n);for(;e.length>o;)Qn(r,n=e[o++])&&(~er(i,n)||rr(i,n));return i},ir=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ur=or,cr=ir.concat("length","prototype");_n.f=Object.getOwnPropertyNames||function(t){return ur(t,cr)};var ar={};ar.f=Object.getOwnPropertySymbols;var lr=B,sr=_n,fr=ar,dr=Te,yr=O([].concat),mr=lr("Reflect","ownKeys")||function(t){var e=sr.f(dr(t)),n=fr.f;return n?yr(e,n(t)):e},pr=zt,br=mr,gr=r,vr=ve,hr=o,wr=_,xr=/#|\.prototype\./,Or=function(t,e){var n=Tr[Sr(t)];return n==jr||n!=Er&&(wr(e)?hr(e):!!e)},Sr=Or.normalize=function(t){return String(t).replace(xr,".").toLowerCase()},Tr=Or.data={},Er=Or.NATIVE="N",jr=Or.POLYFILL="P",Ir=Or,Pr=n,zr=r.f,Rr=_e,kr=Ne.exports,Cr=wt,Lr=function(t,e,n){for(var r=br(e),o=vr.f,i=gr.f,u=0;u<r.length;u++){var c=r[u];pr(t,c)||n&&pr(n,c)||o(t,c,i(e,c))}},Mr=Ir,Wr={};Wr[Ht("toStringTag")]="z";var Ar=n,Fr="[object z]"===String(Wr),_r=_,Nr=j,Dr=Ht("toStringTag"),Yr=Ar.Object,Kr="Arguments"==Nr(function(){return arguments}()),Xr=Fr?Nr:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Yr(t),Dr))?n:Kr?Nr(e):"Object"==(r=Nr(e))&&_r(e.callee)?"Arguments":r},Br=n.String,Hr=Te,Ur=o,Gr=n.RegExp,$r=Ur((function(){var t=Gr("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),qr=$r||Ur((function(){return!Gr("a","y").sticky})),Vr={BROKEN_CARET:$r||Ur((function(){var t=Gr("^r","gy");return t.lastIndex=2,null!=t.exec("str")})),MISSED_STICKY:qr,UNSUPPORTED_Y:$r},Zr={},Jr=or,Qr=ir,to=Object.keys||function(t){return Jr(t,Qr)},eo=i,no=he,ro=ve,oo=Te,io=F,uo=to;Zr.f=eo&&!no?Object.defineProperties:function(t,e){oo(t);for(var n,r=io(e),o=uo(e),i=o.length,u=0;i>u;)ro.f(t,n=o[u++],r[n]);return t};var co,ao=B("document","documentElement"),lo=Te,so=Zr,fo=ir,yo=en,mo=ao,po=ue,bo=tn("IE_PROTO"),go=function(){},vo=function(t){return"<script>"+t+"</"+"script>"},ho=function(t){t.write(vo("")),t.close();var e=t.parentWindow.Object;return t=null,e},wo=function(){try{co=new ActiveXObject("htmlfile")}catch(t){}var t,e;wo="undefined"!=typeof document?document.domain&&co?ho(co):((e=po("iframe")).style.display="none",mo.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(vo("document.F=Object")),t.close(),t.F):ho(co);for(var n=fo.length;n--;)delete wo.prototype[fo[n]];return wo()};yo[bo]=!0;var xo,Oo,So=Object.create||function(t,e){var n;return null!==t?(go.prototype=lo(t),n=new go,go.prototype=null,n[bo]=t):n=wo(),void 0===e?n:so.f(n,e)},To=o,Eo=n.RegExp,jo=To((function(){var t=Eo(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),Io=o,Po=n.RegExp,zo=Io((function(){var t=Po("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})),Ro=l,ko=O,Co=function(t){if("Symbol"===Xr(t))throw TypeError("Cannot convert a Symbol value to a string");return Br(t)},Lo=function(){var t=Hr(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},Mo=Vr,Wo=gt.exports,Ao=So,Fo=wn.get,_o=jo,No=zo,Do=Wo("native-string-replace",String.prototype.replace),Yo=RegExp.prototype.exec,Ko=Yo,Xo=ko("".charAt),Bo=ko("".indexOf),Ho=ko("".replace),Uo=ko("".slice),Go=(Oo=/b*/g,Ro(Yo,xo=/a/,"a"),Ro(Yo,Oo,"a"),0!==xo.lastIndex||0!==Oo.lastIndex),$o=Mo.BROKEN_CARET,qo=void 0!==/()??/.exec("")[1];(Go||qo||$o||_o||No)&&(Ko=function(t){var e,n,r,o,i,u,c,a=this,l=Fo(a),s=Co(t),f=l.raw;if(f)return f.lastIndex=a.lastIndex,e=Ro(Ko,f,s),a.lastIndex=f.lastIndex,e;var d=l.groups,y=$o&&a.sticky,m=Ro(Lo,a),p=a.source,b=0,g=s;if(y&&(m=Ho(m,"y",""),-1===Bo(m,"g")&&(m+="g"),g=Uo(s,a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==Xo(s,a.lastIndex-1))&&(p="(?: "+p+")",g=" "+g,b++),n=new RegExp("^(?:"+p+")",m)),qo&&(n=new RegExp("^"+p+"$(?!\\s)",m)),Go&&(r=a.lastIndex),o=Ro(Yo,y?n:a,g),y?o?(o.input=Uo(o.input,b),o[0]=Uo(o[0],b),o.index=a.lastIndex,a.lastIndex+=o[0].length):a.lastIndex=0:Go&&o&&(a.lastIndex=a.global?o.index+o[0].length:r),qo&&o&&o.length>1&&Ro(Do,o[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(o[i]=void 0)})),o&&d)for(o.groups=u=Ao(null),i=0;i<d.length;i++)u[(c=d[i])[0]]=o[c[1]];return o});(function(t,e){var n,r,o,i,u,c=t.target,a=t.global,l=t.stat;if(n=a?Pr:l?Pr[c]||Cr(c,{}):(Pr[c]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(u=zr(n,r))&&u.value:n[r],!Mr(a?r:c+(l?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Lr(i,o)}(t.sham||o&&o.sham)&&Rr(i,"sham",!0),kr(n,r,i,t)}})({target:"RegExp",proto:!0,forced:/./.exec!==Ko},{exec:Ko});
/*!
* reveal.js Zoom plugin
*/
var Vo={id:"zoom",init:function(t){t.getRevealElement().addEventListener("mousedown",(function(e){var n=/Linux/.test(window.navigator.platform)?"ctrl":"alt",r=(t.getConfig().zoomKey?t.getConfig().zoomKey:n)+"Key",o=t.getConfig().zoomLevel?t.getConfig().zoomLevel:2;e[r]&&!t.isOverview()&&(e.preventDefault(),Zo.to({x:e.clientX,y:e.clientY,scale:o,pan:!1}))}))}},Zo=function(){var t=1,e=0,n=0,r=-1,o=-1,i="WebkitTransform"in document.body.style||"MozTransform"in document.body.style||"msTransform"in document.body.style||"OTransform"in document.body.style||"transform"in document.body.style;function u(e,n){var r=a();if(e.width=e.width||1,e.height=e.height||1,e.x-=(window.innerWidth-e.width*n)/2,e.y-=(window.innerHeight-e.height*n)/2,i)if(1===n)document.body.style.transform="",document.body.style.OTransform="",document.body.style.msTransform="",document.body.style.MozTransform="",document.body.style.WebkitTransform="";else{var o=r.x+"px "+r.y+"px",u="translate("+-e.x+"px,"+-e.y+"px) scale("+n+")";document.body.style.transformOrigin=o,document.body.style.OTransformOrigin=o,document.body.style.msTransformOrigin=o,document.body.style.MozTransformOrigin=o,document.body.style.WebkitTransformOrigin=o,document.body.style.transform=u,document.body.style.OTransform=u,document.body.style.msTransform=u,document.body.style.MozTransform=u,document.body.style.WebkitTransform=u}else 1===n?(document.body.style.position="",document.body.style.left="",document.body.style.top="",document.body.style.width="",document.body.style.height="",document.body.style.zoom=""):(document.body.style.position="relative",document.body.style.left=-(r.x+e.x)/n+"px",document.body.style.top=-(r.y+e.y)/n+"px",document.body.style.width=100*n+"%",document.body.style.height=100*n+"%",document.body.style.zoom=n);t=n,document.documentElement.classList&&(1!==t?document.documentElement.classList.add("zoomed"):document.documentElement.classList.remove("zoomed"))}function c(){var r=.12*window.innerWidth,o=.12*window.innerHeight,i=a();n<o?window.scroll(i.x,i.y-14/t*(1-n/o)):n>window.innerHeight-o&&window.scroll(i.x,i.y+(1-(window.innerHeight-n)/o)*(14/t)),e<r?window.scroll(i.x-14/t*(1-e/r),i.y):e>window.innerWidth-r&&window.scroll(i.x+(1-(window.innerWidth-e)/r)*(14/t),i.y)}function a(){return{x:void 0!==window.scrollX?window.scrollX:window.pageXOffset,y:void 0!==window.scrollY?window.scrollY:window.pageYOffset}}return i&&(document.body.style.transition="transform 0.8s ease",document.body.style.OTransition="-o-transform 0.8s ease",document.body.style.msTransition="-ms-transform 0.8s ease",document.body.style.MozTransition="-moz-transform 0.8s ease",document.body.style.WebkitTransition="-webkit-transform 0.8s ease"),document.addEventListener("keyup",(function(e){1!==t&&27===e.keyCode&&Zo.out()})),document.addEventListener("mousemove",(function(r){1!==t&&(e=r.clientX,n=r.clientY)})),{to:function(e){if(1!==t)Zo.out();else{if(e.x=e.x||0,e.y=e.y||0,e.element){var n=e.element.getBoundingClientRect();e.x=n.left-20,e.y=n.top-20,e.width=n.width+40,e.height=n.height+40}void 0!==e.width&&void 0!==e.height&&(e.scale=Math.max(Math.min(window.innerWidth/e.width,window.innerHeight/e.height),1)),e.scale>1&&(e.x*=e.scale,e.y*=e.scale,u(e,e.scale),!1!==e.pan&&(r=setTimeout((function(){o=setInterval(c,1e3/60)}),800)))}},out:function(){clearTimeout(r),clearInterval(o),u({x:0,y:0},1),t=1},magnify:function(t){this.to(t)},reset:function(){this.out()},zoomLevel:function(){return t}}}();return function(){return Vo}}));