mediacms/static/js/index.js

1 line
12 KiB
JavaScript

!function(){"use strict";var e,t={55579:function(e,t,r){var n=r(92541),i=r(65020);(0,n.X)("page-home",i.HomePage)},84234:function(e,t,r){r.r(t),r.d(t,{CircleIconButton:function(){return n.M},FilterOptions:function(){return i.j},FiltersToggleButton:function(){return a._},MaterialIcon:function(){return o.O},NavigationContentApp:function(){return l.o},NavigationMenuList:function(){return u.S},Notifications:function(){return c.T},NumericInputWithUnit:function(){return s.O},PopupMain:function(){return f.W8},PopupTop:function(){return f.HF},SpinnerLoader:function(){return d.i},UserThumbnail:function(){return m.q}});var n=r(17714),i=r(47446),a=r(2915),o=r(2299),l=r(72917),u=r(5671),c=r(72436),s=r(15517),f=r(60940),d=r(26309),m=r(86142)},8897:function(e,t,r){r.r(t),r.d(t,{InlineSliderItemListAsync:function(){return g}}),r(92070),r(52004),r(28407),r(56394),r(38288),r(55677),r(92129),r(24655),r(20288),r(54458),r(23675),r(74517),r(99751),r(38833),r(10815),r(55090),r(79174);var n=r(35466),i=r(98578),a=r(62546),o=r(58982),l=r(32832),u=r(83632),c=r(28986);function s(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?s(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function g(e){var t,r,o=(0,a.useLayout)().visibleSidebar,s=(t=(0,a.useItemListInlineSlider)(e),r=13,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw i}}return a}}(t,r)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=s[0],d=s[1],g=s[2],y=s[3],v=s[4],b=s[5],h=s[6],O=s[7],P=s[8],w=s[9],S=s[10],j=s[11],E=s[12];return(0,n.useEffect)((function(){P()}),[o]),(0,n.useEffect)((function(){return v(new c.g(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,b,h)),i.PageStore.on("window_resize",O),function(){i.PageStore.removeListener("window_resize",O),g&&(g.cancelAll(),v(null))}}),[]),d?f.length?n.createElement("div",{className:y.listOuter},j(),n.createElement("div",{ref:w,className:"items-list-wrap"},n.createElement("div",{ref:S,className:y.list},f.map((function(t,r){return n.createElement(u.H,m({key:r},(0,u.j)(e,t,r)))})))),E()):null:n.createElement(l.K,{className:y.listOuter})}g.propTypes=f({},o.ItemListAsync.propTypes),g.defaultProps=f(f({},o.ItemListAsync.defaultProps),{},{pageItems:12})},58982:function(e,t,r){r.r(t),r.d(t,{ItemListAsync:function(){return y}}),r(92070),r(52004),r(28407),r(56394),r(38288),r(55677),r(92129),r(24655),r(20288),r(54458),r(23675),r(74517),r(99751),r(38833),r(10815),r(55090),r(79174);var n=r(35466),i=r(3074),a=r.n(i),o=r(62546),l=r(67777),u=r(32832),c=r(83632),s=r(28986);function f(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 d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function y(e){var t,r,i=(t=(0,o.useItemListSync)(e),r=11,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw i}}return a}}(t,r)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],l=i[1],f=i[2],d=i[3],m=i[4],y=i[5],v=i[6],b=i[7],h=i[8],O=i[9],P=i[10];return(0,n.useEffect)((function(){return d(new s.g(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,b,h)),function(){f&&(f.cancelAll(),d(null))}}),[]),a?l.length?n.createElement("div",{className:m.listOuter},O(),n.createElement("div",{ref:y,className:"items-list-wrap"},n.createElement("div",{ref:v,className:m.list},l.map((function(t,r){return n.createElement(c.H,p({key:r},(0,c.j)(e,t,r)))})))),P()):null:n.createElement(u.K,{className:m.listOuter})}y.propTypes=d(d({},l.s.propTypes),{},{items:a().array,requestUrl:a().string.isRequired,firstItemRequestUrl:a().string}),y.defaultProps=d(d({},l.s.defaultProps),{},{requestUrl:null,firstItemRequestUrl:null,pageItems:24})},36191:function(e,t,r){r.r(t),r.d(t,{PageHeader:function(){return n.m},PageMain:function(){return i.r},PageSidebar:function(){return a.$},PageSidebarContentOverlay:function(){return o.a}});var n=r(56006),i=r(29198),a=r(22947),o=r(41542)},90:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MediaMultiListWrapper=void 0;var i=n(r(35466));r(23804),t.MediaMultiListWrapper=function(e){var t=e.className,r=e.style,n=e.children;return i.default.createElement("div",{className:(t?t+" ":"")+"media-list-wrapper",style:r},n||null)}},65020:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.HomePage=void 0;var o=a(r(35466)),l=r(43613),u=r(98578),c=r(27180),s=r(90),f=r(58982),d=r(8897),m=r(37637),p=r(80473),g=function(e){return o.default.createElement(l.LinksConsumer,null,(function(e){return o.default.createElement("div",{className:"empty-media"},o.default.createElement("div",{className:"welcome-title"},"Welcome to MediaCMS!"),o.default.createElement("div",{className:"start-uploading"},"Start uploading media and sharing your work!"),o.default.createElement("a",{href:e.user.addMedia,title:"Upload media",className:"button-link"},o.default.createElement("i",{className:"material-icons","data-icon":"video_call"}),"UPLOAD MEDIA"))}))};t.HomePage=function(e){var t=e.id,r=void 0===t?"home":t,n=e.featured_title,i=void 0===n?p.translateString("Featured"):n,a=e.recommended_title,y=void 0===a?p.translateString("Recommended"):a,v=e.latest_title,b=void 0===v?p.translateString("Latest"):v,h=e.latest_view_all_link,O=void 0!==h&&h,P=e.featured_view_all_link,w=void 0===P||P,S=e.recommended_view_all_link,j=void 0===S||S,E=o.useState(!1),_=E[0],A=E[1],I=o.useState(!1),M=I[0],L=I[1],k=o.useState(!1),N=k[0],D=k[1],U=o.useState(!1),C=U[0],T=U[1],q=function(e){L(0<e),A(0===e)},x=function(e){D(0<e)},R=function(e){T(0<e)};return o.default.createElement(m.Page,{id:r},o.default.createElement(l.LinksConsumer,null,(function(e){return o.default.createElement(l.ApiUrlConsumer,null,(function(t){return o.default.createElement(s.MediaMultiListWrapper,{className:"items-list-ver"},u.PageStore.get("config-enabled").pages.featured&&u.PageStore.get("config-enabled").pages.featured.enabled&&o.default.createElement(c.MediaListRow,{title:i,style:N?void 0:{display:"none"},viewAllLink:w?e.featured:null},o.default.createElement(d.InlineSliderItemListAsync,{requestUrl:t.featured,itemsCountCallback:x,hideViews:!u.PageStore.get("config-media-item").displayViews,hideAuthor:!u.PageStore.get("config-media-item").displayAuthor,hideDate:!u.PageStore.get("config-media-item").displayPublishDate})),u.PageStore.get("config-enabled").pages.recommended&&u.PageStore.get("config-enabled").pages.recommended.enabled&&o.default.createElement(c.MediaListRow,{title:y,style:C?void 0:{display:"none"},viewAllLink:j?e.recommended:null},o.default.createElement(d.InlineSliderItemListAsync,{requestUrl:t.recommended,itemsCountCallback:R,hideViews:!u.PageStore.get("config-media-item").displayViews,hideAuthor:!u.PageStore.get("config-media-item").displayAuthor,hideDate:!u.PageStore.get("config-media-item").displayPublishDate})),o.default.createElement(c.MediaListRow,{title:b,style:M?void 0:{display:"none"},viewAllLink:O?e.latest:null},o.default.createElement(f.ItemListAsync,{pageItems:30,requestUrl:t.media,itemsCountCallback:q,hideViews:!u.PageStore.get("config-media-item").displayViews,hideAuthor:!u.PageStore.get("config-media-item").displayAuthor,hideDate:!u.PageStore.get("config-media-item").displayPublishDate})),_&&o.default.createElement(g,null))}))})))}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e].call(a.exports,a,a.exports,n),a.exports}n.m=t,e=[],n.O=function(t,r,i,a){if(!r){var o=1/0;for(c=0;c<e.length;c++){r=e[c][0],i=e[c][1],a=e[c][2];for(var l=!0,u=0;u<r.length;u++)(!1&a||o>=a)&&Object.keys(n.O).every((function(e){return n.O[e](r[u])}))?r.splice(u--,1):(l=!1,a<o&&(o=a));l&&(e.splice(c--,1),t=i())}return t}a=a||0;for(var c=e.length;c>0&&e[c-1][2]>a;c--)e[c]=e[c-1];e[c]=[r,i,a]},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=826,function(){var e={826:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var i,a,o=r[0],l=r[1],u=r[2],c=0;for(i in l)n.o(l,i)&&(n.m[i]=l[i]);if(u)var s=u(n);for(t&&t(r);c<o.length;c++)a=o[c],n.o(e,a)&&e[a]&&e[a][0](),e[o[c]]=0;return n.O(s)},r=self.webpackChunkmediacms_frontend=self.webpackChunkmediacms_frontend||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var i=n.O(void 0,[431],(function(){return n(55579)}));i=n.O(i)}();