Spotify.NET/assets/js/56.11f007b6.js

1 line
20 KiB
JavaScript
Raw Normal View History

(window.webpackJsonp=window.webpackJsonp||[]).push([[56,57],{123:function(e,t,n){"use strict";n.r(t);var a=n(0),r=n.n(a),o=n(124),c=n(16),l=n(26),i=n(141),s=n(3),u=n(7),d=n(127),p=n(125),m=n(134),b=n(149),h=n(150),f=n(148),y=n(130),g=n(128),v=n(151),j=function(e){return r.a.createElement("svg",Object(s.a)({width:"20",height:"20",role:"img"},e),r.a.createElement("g",{fill:"#7a7a7a"},r.a.createElement("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),r.a.createElement("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})))},k=n(153),O=n(129),E=n(76),C=n.n(E);var N=function e(t,n){return"link"===t.type?Object(p.isSamePath)(t.href,n):"category"===t.type&&t.items.some((function(t){return e(t,n)}))};function T(e){var t,n,o,c=e.item,l=e.onItemClick,i=e.collapsible,p=e.activePath,m=Object(u.a)(e,["item","onItemClick","collapsible","activePath"]),b=c.items,h=c.label,f=N(c,p),y=(n=f,o=Object(a.useRef)(n),Object(a.useEffect)((function(){o.current=n}),[n]),o.current),g=Object(a.useState)((function(){return!!i&&(!f&&c.collapsed)})),v=g[0],j=g[1],k=Object(a.useRef)(null),O=Object(a.useState)(void 0),E=O[0],T=O[1],x=function(e){var t;void 0===e&&(e=!0),T(e?(null===(t=k.current)||void 0===t?void 0:t.scrollHeight)+"px":void 0)};Object(a.useEffect)((function(){f&&!y&&v&&j(!1)}),[f,y,v]);var P=Object(a.useCallback)((function(e){e.preventDefault(),E||x(),setTimeout((function(){return j((function(e){return!e}))}),100)}),[E]);return 0===b.length?null:r.a.createElement("li",{className:Object(d.a)("menu__list-item",{"menu__list-item--collapsed":v}),key:h},r.a.createElement("a",Object(s.a)({className:Object(d.a)("menu__link",(t={"menu__link--sublist":i,"menu__link--active":i&&f},t[C.a.menuLinkText]=!i,t)),onClick:i?P:void 0,href:i?"#!":void 0},m),h),r.a.createElement("ul",{className:"menu__list",ref:k,style:{height:E},onTransitionEnd:function(){v||x(!1)}},b.map((function(e){return r.a.createElement(w,{tabIndex:v?"-1":"0",key:e.label,item:e,onItemClick:l,collapsible:i,activePath:p})}))))}function x(e){var t,n=e.item,a=e.onItemClick,o=e.activePath,c=(e.collapsible,Object(u.a)(e,["item","onItemClick","activePath","collapsible"])),l=n.href,i=n.label,p=N(n,o);return r.a.createElement("li",{className:"menu__list-item",key:i},r.a.createElement(y.a,Object(s.a)({className:Object(d.a)("menu__link",(t={"menu__link--active":p},t[C.a.menuLinkExternal]=!Object(g.a)(l),t)),to:l},Object(g.a)(l)&&{isNavLink:!0,exact:!0,onClick:a},c),i))}function w(e){switch(e.item.type){case"category":return r.a.createElement(T,e);case"link":default:return r.a.createElement(x,e)}}var P=function(e){var t,n,o=e.path,c=e.sidebar,l=e.sidebarCollapsible,i=void 0===l||l,s=e.onCollapse,u=e.isHidden,y=Object(a.useState)(!1),g=y[0],E=y[1],N=Object(p.useThemeConfig)(),T=N.navbar.hideOnScroll,x=N.hideableSidebar,P=Object(m.a)().isAnnouncementBarClosed,S=Object(f.a)().scrollY;Object(b.a)(g);var I=Object(h.a)();return Object(a.useEffect)((function(){I===h.b.desktop&&E(!1)}),[I]),r.a.createElement("div",{className:Object(d.a)(C.a.sidebar,(t={},t[C.a.sidebarWithHideableNavbar]=T,t[C.a.sidebarHidden]=u,t))},T&&r.a.createElement(v.a,{tabIndex:-1,className:C.a.sidebarLogo}),r.a.createElement("div",{className:Object(d.a)("menu","menu--responsive","thin-scrollbar",C.a.menu,(n={"menu--show":g},n[C.a.menuWithAnnouncementBar]=!P&&0===S,n))},r.a.createElement("button",{"aria-label":g?Object(O.b)({id:"theme.docs.sidebar.responsiveCloseButtonLabel",message:"Close menu",description:"The ARIA label for close button of mobile doc sidebar"}):Object(O.b)({id:"theme.docs.sidebar.responsiveOpenButtonLabel",message:"Open menu",description:"The ARIA label for open button of mobile doc sidebar"}