tweb/public/3.793e215e3d9630206e52.chun...

2 lines
9.8 KiB
JavaScript
Raw Normal View History

2022-03-25 16:07:29 +01:00
(this.webpackJsonp=this.webpackJsonp||[]).push([[3],{120:function(t,e,n){"use strict";var i=n(45),s=n(52),o=n(30),a=n(90);const r=new class{constructor(){this.promises={},this.raf=i.b.bind(null),this.scheduled=!1}do(t,e){let n=this.promises[t];return n||(this.scheduleFlush(),n=this.promises[t]=Object(s.a)()),void 0!==e&&n.then(()=>e()),n}measure(t){return this.do("read",t)}mutate(t){return this.do("write",t)}mutateElement(t,e){const n=Object(a.a)(t),i=n?this.mutate():Promise.resolve();return void 0!==e&&(n?e():i.then(()=>e())),i}scheduleFlush(){this.scheduled||(this.scheduled=!0,this.raf(()=>{this.promises.read&&this.promises.read.resolve(),this.promises.write&&this.promises.write.resolve(),this.scheduled=!1,this.promises={}}))}};o.a&&(o.a.sequentialDom=r),e.a=r},170:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(0);function s(t){return i.IS_MOBILE_SAFARI&&t instanceof TouchEvent&&t.touches[0].clientX<30}},18:function(t,e,n){"use strict";n.r(e),n.d(e,"ripple",(function(){return d}));var i=n(6),s=n(120),o=n(1),a=n(15),r=n(96);let c=0;function d(t,e=(()=>Promise.resolve()),n=null,d=!1,l=t){if(t.querySelector(".c-ripple"))return;t.classList.add("rp");let u=document.createElement("div");u.classList.add("c-ripple");let h;t.classList.contains("rp-square")&&u.classList.add("is-square"),t[d?"prepend":"append"](u);const m=(t,i)=>{const a=Date.now(),r=document.createElement("div"),d=c++,l=1e3*+window.getComputedStyle(u).getPropertyValue("--ripple-duration").replace("s","");h=()=>{let t=Date.now()-a;const e=()=>{s.a.mutate(()=>{r.remove()}),n&&n(d)};if(t<l){let n=Math.max(l-t,l/2);setTimeout(()=>r.classList.add("hiding"),Math.max(n-l/2,0)),setTimeout(e,n)}else r.classList.add("hiding"),setTimeout(e,l/2);o.IS_TOUCH_SUPPORTED||window.removeEventListener("contextmenu",h),h=null,v=!1},e&&e(d),window.requestAnimationFrame(()=>{const e=u.getBoundingClientRect();r.classList.add("c-ripple__circle");const n=t-e.left,s=i-e.top,o=Math.sqrt(Math.pow(Math.abs(s-e.height/2)+e.height/2,2)+Math.pow(Math.abs(n-e.width/2)+e.width/2,2)),a=n-o/2,c=s-o/2;r.style.width=r.style.height=o+"px",r.style.left=a+"px",r.style.top=c+"px",u.append(r)})},p=e=>e.target!==t&&(["BUTTON","A"].includes(e.target.tagName)||Object(i.a)(e.target,"c-ripple")!==u)&&(l===t||!Object(r.a)(e.target,l));let v=!1;if(o.IS_TOUCH_SUPPORTED){let t=()=>{h&&h()};l.addEventListener("touchstart",e=>{if(!a.default.settings.animationsEnabled)return;if(e.touches.length>1||v||p(e))return;v=!0;let{clientX:n,clientY:i}=e.touches[0];m(n,i),l.addEventListener("touchend",t,{once:!0}),window.addEventListener("touchmove",e=>{e.cancelBubble=!0,e.stopPropagation(),t(),l.removeEventListener("touchend",t)},{once:!0})},{passive:!0})}else l.addEventListener("mousedown",t=>{if(![0,2].includes(t.button))return;if(!a.default.settings.animationsEnabled)return;if("0"===l.dataset.ripple||p(t))return;if(v)return void(v=!1);let{clientX:e,clientY:n}=t;m(e,n),window.addEventListener("mouseup",h,{once:!0,passive:!0}),window.addEventListener("contextmenu",h,{once:!0,passive:!0})},{passive:!0})}},29:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"d",(function(){return c}));var i=n(1),s=n(81);const o=i.IS_TOUCH_SUPPORTED?"mousedown":"click";function a(t,e,n={}){const i=n.listenerSetter?n.listenerSetter.add(t):t.addEventListener.bind(t);n.touchMouseDown=!0,i(o,e,n)}function r(t,e,n){t.removeEventListener(o,e,n)}function c(t){Object(s.a)(t,o)}},34:function(t,e,n){"use strict";var i=n(16),s=n(18);e.a=(t,e={})=>{const n=document.createElement(e.asDiv?"div":"button");return n.className=t+(e.icon?" tgico-"+e.icon:""),e.noRipple||(e.rippleSquare&&n.classList.add("rp-square"),Object(s.ripple)(n)),e.onlyMobile&&n.classList.add("only-handhelds"),e.disabled&&n.setAttribute("disabled","true"),e.text&&n.append(Object(i.i18n)(e.text)),n}},35:function(t,e,n){"use strict";n.d(e,"f",(function(){return u})),n.d(e,"g",(function(){return h})),n.d(e,"c",(function(){return v})),n.d(e,"d",(function(){return w})),n.d(e,"e",(funct
//# sourceMappingURL=3.793e215e3d9630206e52.chunk.js.map