solorice/config/spicetify/Extracted/Raw/xpui/lottie-animation.js

2 lines
2.8 KiB
JavaScript
Executable File

"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[7067],{31573:(e,t,r)=>{r.r(t),r.d(t,{LottieAnimation:()=>g});r(7651),r(30456),r(26701),r(37417),r(11737),r(51691),r(702),r(5672),r(43379),r(34192),r(88856),r(51565),r(18316);var n=r(52542),o=r(13734),c=r(30758),i=r(12341),l=r(8143),s=r(86070),u=["children"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(e){var t=e.children,r=(0,o.A)(e,u),n=(0,c.useState)(null),a=(0,i.A)(n,2),p=a[0],d=a[1],y=(0,c.useRef)(null);return(0,c.useLayoutEffect)((function(){var e,t,r;null!==(e=y.current)&&void 0!==e&&e.shadowRoot||d(null!==(t=null===(r=y.current)||void 0===r?void 0:r.attachShadow({mode:"open"}))&&void 0!==t?t:null)}),[]),(0,s.jsx)("div",f(f({ref:y},r),{},{children:p&&(0,l.createPortal)(t,p)}))},d=r(63638),y=r.n(d),b=r(88308),O=["style","className","onAnimationEnd"],v=["withShadowRoot","className","style"];function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var w=function(){},m=function(e){var t=e.style,r=e.className,n=e.onAnimationEnd,i=void 0===n?w:n,l=(0,o.A)(e,O),u=(0,c.useRef)(null),a=(0,c.useRef)(null),f=(0,b.lB)((function(){return l}),[l]);return(0,c.useLayoutEffect)((function(){var e;if(!u.current)return function(){};null===(e=a.current)||void 0===e||e.destroy();var t=a.current=y().loadAnimation(h(h({},f),{},{container:u.current,renderer:"svg"}));return t.addEventListener("complete",i),function(){t.removeEventListener("complete",i),t.destroy()}}),[f,i]),(0,s.jsx)("div",{ref:u,className:r,style:t})},g=function(e){var t=e.withShadowRoot,r=void 0===t||t,n=e.className,c=e.style,i=(0,o.A)(e,v);return r?(0,s.jsx)(p,{className:n,children:(0,s.jsx)(m,h(h({},i),{},{style:c}))}):(0,s.jsx)(m,h({className:n,style:c},i))}}}]);
//# sourceMappingURL=lottie-animation.js.map