diff --git a/client/dist/js/TinyMCE_ssembed.js b/client/dist/js/TinyMCE_ssembed.js index ad85c21bd..4f116ac79 100644 --- a/client/dist/js/TinyMCE_ssembed.js +++ b/client/dist/js/TinyMCE_ssembed.js @@ -1 +1 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/entwine/TinyMCE_ssembed.js")}({"./client/src/components/InsertEmbedModal/InsertEmbedModal.js":function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){var n=e.config.sections.find(function(e){return e.name===_}),r=t.fileAttributes?t.fileAttributes.Url:"",i=n.form.remoteEditForm.schemaUrl,o=r&&i+"/?embedurl="+encodeURIComponent(r),a=n.form.remoteCreateForm.schemaUrl;return{sectionConfig:n,schemaUrl:o||a,targetUrl:r}}function l(e){return{actions:{schema:(0,m.bindActionCreators)(C,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var d=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function e(e,t){for(var n=0;n"+e.content+"");t.find(v).each(function(){var e=(0,o.default)(this),t=e.find("img.placeholder");if(0===t.length)return e.removeAttr("data-url"),void e.removeAttr("data-shortcode");var n=e.find(".caption").text(),r=parseInt(t.attr("width"),10),i=parseInt(t.attr("height"),10),a=e.data("url"),s={url:a,thumbnail:t.prop("src"),class:e.prop("class"),width:isNaN(r)?null:r,height:isNaN(i)?null:i,caption:n},l=p.default.serialise({name:"embed",properties:s,wrapped:!0,content:a});e.replaceWith(l)}),e.content=t.html()}),e.on("BeforeSetContent",function(e){for(var t=e.content,n=p.default.match("embed",!0,t);n;){var r=n.properties,i=(0,o.default)("
").attr("data-url",r.url||n.content).attr("data-shortcode","embed").addClass(r.class).addClass("ss-htmleditorfield-file embed"),a=(0,o.default)("").attr("src",r.thumbnail).addClass("placeholder");if(r.width&&(i.width(r.width),a.attr("width",r.width)),r.height&&a.attr("height",r.height),i.append(a),r.caption){var s=(0,o.default)("

").addClass("caption").text(r.caption);i.append(s)}t=t.replace(n.original,(0,o.default)("

").append(i).html()),n=p.default.match("embed",!0,t)}e.content=t})}};tinymce.PluginManager.add("ssembed",function(t){return e.init(t)})}(),o.default.entwine("ss",function(e){e(".js-injector-boot #insert-embed-react__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){d.default.unmountComponentAtNode(this[0])},open:function(){this._renderModal(!0)},close:function(){this.setData({}),this._renderModal(!1)},_renderModal:function(e){var t=this,n=function(){return t.close()},r=function(){return t._handleInsert.apply(t,arguments)},i=function(){return t._handleCreate.apply(t,arguments)},o=function(){return t._handleLoadingError.apply(t,arguments)},a=this.getOriginalAttributes();d.default.render(s.default.createElement(b,{isOpen:e,onCreate:i,onInsert:r,onClosed:n,onLoadingError:o,bodyClassName:"modal__dialog",className:"insert-embed-react__dialog-wrapper",fileAttributes:a}),this[0])},_handleLoadingError:function(){this.setData({}),this.open()},_handleInsert:function(e){var t=this.getData();this.setData(Object.assign({Url:t.Url},e)),this.insertRemote(),this.close()},_handleCreate:function(e){this.setData(Object.assign({},this.getData(),e)),this.open()},getOriginalAttributes:function(){var t=this.getData(),n=this.getElement();if(!n)return t;var r=e(n.getEditor().getSelectedNode());if(!r.length)return t;var i=r.closest(v).add(r.filter(v));if(!i.length)return t;var o=i.find("img.placeholder");if(0===o.length)return t;var a=i.find(".caption").text(),s=parseInt(o.width(),10),l=parseInt(o.height(),10);return{Url:i.data("url")||t.Url,CaptionText:a,PreviewUrl:o.attr("src"),Width:isNaN(s)?null:s,Height:isNaN(l)?null:l,Placement:this.findPosition(i.prop("class"))}},findPosition:function(e){var t=["leftAlone","center","rightAlone","left","right"];if("string"!=typeof e)return"";var n=e.split(" ");return t.find(function(e){return n.indexOf(e)>-1})},insertRemote:function(){var t=this.getElement();if(!t)return!1;var n=t.getEditor();if(!n)return!1;var r=this.getData(),i=(0,o.default)("
").attr("data-url",r.Url).attr("data-shortcode","embed").addClass(r.Placement).addClass("ss-htmleditorfield-file embed"),a=(0,o.default)("").attr("src",r.PreviewUrl).addClass("placeholder");if(r.Width&&(i.width(r.Width),a.attr("width",r.Width)),r.Height&&a.attr("height",r.Height),i.append(a),r.CaptionText){var s=(0,o.default)("

").addClass("caption").text(r.CaptionText);i.append(s)}var l=e(n.getSelectedNode()),d=e(null);return l.length&&(d=l.filter(v),0===d.length&&(d=l.closest(v)),0===d.length&&(d=l.filter("img.placeholder"))),d.length?d.replaceWith(i):(n.repaint(),n.insertContent(e("

").append(i.clone()).html(),{skip_undo:1})),n.addUndo(),n.repaint(),!0}})})},0:function(e,t){e.exports=React},1:function(e,t){e.exports=i18n},10:function(e,t){e.exports=FormBuilderModal},17:function(e,t){e.exports=SchemaActions},2:function(e,t){e.exports=Injector},3:function(e,t){e.exports=ReactRedux},4:function(e,t){e.exports=Redux},5:function(e,t){e.exports=ReactDom},6:function(e,t){e.exports=jQuery},7:function(e,t){e.exports=ShortcodeSerialiser}}); \ No newline at end of file +!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/entwine/TinyMCE_ssembed.js")}({"./client/src/components/InsertEmbedModal/InsertEmbedModal.js":function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){var n=e.config.sections.find(function(e){return e.name===O}),r=t.fileAttributes?t.fileAttributes.Url:"",i=n.form.remoteEditForm.schemaUrl,a=r&&i+"/?embedurl="+encodeURIComponent(r),o=n.form.remoteCreateForm.schemaUrl;return{sectionConfig:n,schemaUrl:a||o,targetUrl:r}}function l(e){return{actions:{schema:(0,m.bindActionCreators)(C,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var d=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function e(e,t){for(var n=0;n"+e.content+"
");t.find(v).each(function(){var e=(0,a.default)(this),t=e.find("img.placeholder");if(0===t.length)return e.removeAttr("data-url"),void e.removeAttr("data-shortcode");var n=e.find(".caption").text(),r=parseInt(t.attr("width"),10),i=parseInt(t.attr("height"),10),o=e.data("url"),s={url:o,thumbnail:t.prop("src"),class:e.prop("class"),width:isNaN(r)?null:r,height:isNaN(i)?null:i,caption:n},l=f.default.serialise({name:"embed",properties:s,wrapped:!0,content:o});e.replaceWith(l)}),e.content=t.html()}),e.on("BeforeSetContent",function(e){for(var t=e.content,n=f.default.match("embed",!0,t);n;){var r=n.properties,i=(0,a.default)("
").attr("data-url",r.url||n.content).attr("data-shortcode","embed").addClass(r.class).addClass("ss-htmleditorfield-file embed"),o=(0,a.default)("").attr("src",r.thumbnail).addClass("placeholder");if(r.width&&(i.width(r.width),o.attr("width",r.width)),r.height&&o.attr("height",r.height),i.append(o),r.caption){var s=(0,a.default)("

").addClass("caption").text(r.caption);i.append(s)}t=t.replace(n.original,(0,a.default)("

").append(i).html()),n=f.default.match("embed",!0,t)}e.content=t})}};tinymce.PluginManager.add("ssembed",function(t){return e.init(t)})}(),a.default.entwine("ss",function(e){e(".js-injector-boot #insert-embed-react__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){d.default.unmountComponentAtNode(this[0])},open:function(){this._renderModal(!0)},close:function(){this.setData({}),this._renderModal(!1)},_renderModal:function(e){var t=this,n=function(){return t.close()},r=function(){return t._handleInsert.apply(t,arguments)},i=function(){return t._handleCreate.apply(t,arguments)},a=function(){return t._handleLoadingError.apply(t,arguments)},o=this.getOriginalAttributes();d.default.render(s.default.createElement(b,{isOpen:e,onCreate:i,onInsert:r,onClosed:n,onLoadingError:a,bodyClassName:"modal__dialog",className:"insert-embed-react__dialog-wrapper",fileAttributes:o}),this[0])},_handleLoadingError:function(){this.setData({}),this.open()},_handleInsert:function(e){var t=this.getData();this.setData(Object.assign({Url:t.Url},e)),this.insertRemote(),this.close()},_handleCreate:function(e){this.setData(Object.assign({},this.getData(),e)),this.open()},getOriginalAttributes:function(){var t=this.getData(),n=this.getElement();if(!n)return t;var r=e(n.getEditor().getSelectedNode());if(!r.length)return t;var i=r.closest(v).add(r.filter(v));if(!i.length)return t;var a=i.find("img.placeholder");if(0===a.length)return t;var o=i.find(".caption").text(),s=parseInt(a.width(),10),l=parseInt(a.height(),10);return{Url:i.data("url")||t.Url,CaptionText:o,PreviewUrl:a.attr("src"),Width:isNaN(s)?null:s,Height:isNaN(l)?null:l,Placement:this.findPosition(i.prop("class"))}},findPosition:function(e){var t=["leftAlone","center","rightAlone","left","right"];if("string"!=typeof e)return"";var n=e.split(" ");return t.find(function(e){return n.indexOf(e)>-1})},insertRemote:function(){var t=this.getElement();if(!t)return!1;var n=t.getEditor();if(!n)return!1;var r=this.getData(),i=(0,a.default)("
").attr("data-url",r.Url).attr("data-shortcode","embed").addClass(r.Placement).addClass("ss-htmleditorfield-file embed"),o=(0,a.default)("").attr("src",r.PreviewUrl).addClass("placeholder");if(r.Width&&(i.width(r.Width),o.attr("width",r.Width)),r.Height&&o.attr("height",r.Height),i.append(o),r.CaptionText){var s=(0,a.default)("

").addClass("caption").text(r.CaptionText);i.append(s)}var l=e(n.getSelectedNode()),d=e(null);return l.length&&(d=l.filter(v),0===d.length&&(d=l.closest(v)),0===d.length&&(d=l.filter("img.placeholder"))),d.length?d.replaceWith(i):(n.repaint(),n.insertContent(e("

").append(i.clone()).html(),{skip_undo:1})),n.addUndo(),n.repaint(),!0}})})},0:function(e,t){e.exports=React},1:function(e,t){e.exports=PropTypes},11:function(e,t){e.exports=FormBuilderModal},18:function(e,t){e.exports=SchemaActions},2:function(e,t){e.exports=i18n},3:function(e,t){e.exports=Injector},4:function(e,t){e.exports=ReactRedux},5:function(e,t){e.exports=Redux},6:function(e,t){e.exports=ReactDom},7:function(e,t){e.exports=jQuery},8:function(e,t){e.exports=ShortcodeSerialiser}}); \ No newline at end of file diff --git a/client/dist/js/TinyMCE_sslink-file.js b/client/dist/js/TinyMCE_sslink-file.js index 14f8b52eb..39b88b243 100644 --- a/client/dist/js/TinyMCE_sslink-file.js +++ b/client/dist/js/TinyMCE_sslink-file.js @@ -1 +1 @@ -!function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/entwine/TinyMCE_sslink-file.js")}({"./client/src/entwine/TinyMCE_sslink-file.js":function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=i(r),l=n(23),a=i(l),s=n(0),u=i(s),c=n(5),d=i(c),f=n(6),p=i(f),g=n(7),_=i(g),m=n(9),k=i(m),h=n(2);a.default.addAction("sslink",{text:o.default._t("AssetAdmin.LINKLABEL_FILE","Link to a file"),onclick:function(e){return e.execCommand("sslinkfile")}}).addCommandWithUrlTest("sslinkfile",/^\[file_link/);var x={init:function(e){e.addCommand("sslinkfile",function(){(0,p.default)("#"+e.id).entwine("ss").openLinkFileDialog()})}},b="insert-link__dialog-wrapper--file",v=(0,h.loadComponent)(k.default);p.default.entwine("ss",function(e){e(".insert-link__dialog-wrapper--internal .nav-link, .insert-media-react__dialog-wrapper .breadcrumb__container a").entwine({onclick:function(e){return e.preventDefault()}}),e("textarea.htmleditor").entwine({openLinkFileDialog:function(){var t=e("#"+b);t.length||(t=e('
'),e("body").append(t)),t.addClass("insert-link__dialog-wrapper"),t.setElement(this),t.open()}}),e(".js-injector-boot #"+b).entwine({renderModal:function(e){var t=this,n=function(){return t.close()},i=function(){return t.handleInsert.apply(t,arguments)},r=this.getOriginalAttributes(),o=tinymce.activeEditor.selection,l=o.getContent()||"",a=o.getNode().tagName,s="A"!==a&&""===l.trim();d.default.render(u.default.createElement(v,{isOpen:e,type:"insert-link",onInsert:i,onClosed:n,title:!1,bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--internal",fileAttributes:r,requireLinkText:s}),this[0])},buildAttributes:function(e){return{href:_.default.serialise({name:"file_link",properties:{id:e.ID}},!0)+(e.Anchor&&e.Anchor.length?"#"+e.Anchor:""),target:e.TargetBlank?"_blank":"",title:e.Description}},getOriginalAttributes:function(){var t=this.getElement().getEditor(),n=e(t.getSelectedNode()),i=(n.attr("href")||"").split("#");if(!i[0])return{};var r=_.default.match("file_link",!1,i[0]);return r?{ID:r.properties.id?parseInt(r.properties.id,10):0,Anchor:i[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}:{}}})}),tinymce.PluginManager.add("sslinkfile",function(e){return x.init(e)}),t.default=x},0:function(e,t){e.exports=React},1:function(e,t){e.exports=i18n},2:function(e,t){e.exports=Injector},23:function(e,t){e.exports=TinyMCEActionRegistrar},5:function(e,t){e.exports=ReactDom},6:function(e,t){e.exports=jQuery},7:function(e,t){e.exports=ShortcodeSerialiser},9:function(e,t){e.exports=InsertMediaModal}}); \ No newline at end of file +!function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/entwine/TinyMCE_sslink-file.js")}({"./client/src/entwine/TinyMCE_sslink-file.js":function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=i(r),l=n(24),a=i(l),s=n(0),u=i(s),c=n(6),d=i(c),f=n(7),p=i(f),g=n(8),_=i(g),m=n(10),k=i(m),h=n(3);a.default.addAction("sslink",{text:o.default._t("AssetAdmin.LINKLABEL_FILE","Link to a file"),onclick:function(e){return e.execCommand("sslinkfile")}}).addCommandWithUrlTest("sslinkfile",/^\[file_link/);var x={init:function(e){e.addCommand("sslinkfile",function(){(0,p.default)("#"+e.id).entwine("ss").openLinkFileDialog()})}},b="insert-link__dialog-wrapper--file",v=(0,h.loadComponent)(k.default);p.default.entwine("ss",function(e){e(".insert-link__dialog-wrapper--internal .nav-link, .insert-media-react__dialog-wrapper .breadcrumb__container a").entwine({onclick:function(e){return e.preventDefault()}}),e("textarea.htmleditor").entwine({openLinkFileDialog:function(){var t=e("#"+b);t.length||(t=e('
'),e("body").append(t)),t.addClass("insert-link__dialog-wrapper"),t.setElement(this),t.open()}}),e(".js-injector-boot #"+b).entwine({renderModal:function(e){var t=this,n=function(){return t.close()},i=function(){return t.handleInsert.apply(t,arguments)},r=this.getOriginalAttributes(),o=tinymce.activeEditor.selection,l=o.getContent()||"",a=o.getNode().tagName,s="A"!==a&&""===l.trim();d.default.render(u.default.createElement(v,{isOpen:e,type:"insert-link",onInsert:i,onClosed:n,title:!1,bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--internal",fileAttributes:r,requireLinkText:s}),this[0])},buildAttributes:function(e){return{href:_.default.serialise({name:"file_link",properties:{id:e.ID}},!0)+(e.Anchor&&e.Anchor.length?"#"+e.Anchor:""),target:e.TargetBlank?"_blank":"",title:e.Description}},getOriginalAttributes:function(){var t=this.getElement().getEditor(),n=e(t.getSelectedNode()),i=(n.attr("href")||"").split("#");if(!i[0])return{};var r=_.default.match("file_link",!1,i[0]);return r?{ID:r.properties.id?parseInt(r.properties.id,10):0,Anchor:i[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}:{}}})}),tinymce.PluginManager.add("sslinkfile",function(e){return x.init(e)}),t.default=x},0:function(e,t){e.exports=React},10:function(e,t){e.exports=InsertMediaModal},2:function(e,t){e.exports=i18n},24:function(e,t){e.exports=TinyMCEActionRegistrar},3:function(e,t){e.exports=Injector},6:function(e,t){e.exports=ReactDom},7:function(e,t){e.exports=jQuery},8:function(e,t){e.exports=ShortcodeSerialiser}}); \ No newline at end of file diff --git a/client/dist/js/TinyMCE_ssmedia.js b/client/dist/js/TinyMCE_ssmedia.js index 36481a20b..e7bc0f3f6 100644 --- a/client/dist/js/TinyMCE_ssmedia.js +++ b/client/dist/js/TinyMCE_ssmedia.js @@ -1 +1 @@ -!function(t){function e(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s="./client/src/entwine/TinyMCE_ssmedia.js")}({"./client/src/entwine/TinyMCE_ssmedia.js":function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}var a=i(6),r=n(a),o=i(1),s=n(o),d=i(0),l=n(d),c=i(5),u=n(c),f=i(2),m=i(9),p=n(m),g=i(7),h=n(g),v=(0,f.loadComponent)(p.default),_='img[data-shortcode="image"]';!function(){var t={init:function(t){var e=s.default._t("AssetAdmin.INSERT_FROM_FILES","Insert from Files");t.addButton("ssmedia",{icon:"image",title:e,cmd:"ssmedia"}),t.addMenuItem("ssmedia",{icon:"image",text:e,cmd:"ssmedia"}),t.addCommand("ssmedia",function(){(0,r.default)("#"+t.id).entwine("ss").openMediaDialog()}),t.on("BeforeExecCommand",function(e){var i=e.command,n=e.ui,a=e.value;"mceAdvImage"!==i&&"mceImage"!==i||(e.preventDefault(),t.execCommand("ssmedia",n,a))}),t.on("SaveContent",function(t){var e=(0,r.default)(t.content);e.find(_).add(e.filter(_)).each(function(){var t=(0,r.default)(this),e={src:t.attr("src"),id:t.data("id"),width:t.attr("width"),height:t.attr("height"),class:t.attr("class"),title:t.attr("title"),alt:t.attr("alt")},i=h.default.serialise({name:"image",properties:e,wrapped:!1});t.replaceWith(i)}),t.content="",e.each(function(){void 0!==this.outerHTML&&(t.content+=this.outerHTML)})}),t.on("BeforeSetContent",function(t){for(var e=t.content,i=h.default.match("image",!1,e);i;){var n=i.properties,a=(0,r.default)("").attr(Object.assign({},n,{id:void 0,"data-id":n.id,"data-shortcode":"image"})).addClass("ss-htmleditorfield-file image");e=e.replace(i.original,(0,r.default)("
").append(a).html()),i=h.default.match("image",!1,e)}t.content=e})}};tinymce.PluginManager.add("ssmedia",function(e){return t.init(e)})}(),r.default.entwine("ss",function(t){t(".insert-media-react__dialog-wrapper .nav-link, .insert-media-react__dialog-wrapper .breadcrumb__container a").entwine({onclick:function(t){return t.preventDefault()}}),t(".js-injector-boot #insert-media-react__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){u.default.unmountComponentAtNode(this[0])},open:function(){this._renderModal(!0)},close:function(){this._renderModal(!1)},_renderModal:function(t){var e=this,i=function(){return e.close()},n=function(){return e._handleInsert.apply(e,arguments)},a=this.getOriginalAttributes(),r=tinymce.activeEditor.selection,o=r.getContent()||"",s=r.getNode().tagName,d="A"!==s&&("IMG"===s||""===o.trim());delete a.url,u.default.render(l.default.createElement(v,{title:!1,type:"insert-media",isOpen:t,onInsert:n,onClosed:i,bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",requireLinkText:d,fileAttributes:a}),this[0])},_handleInsert:function(t,e){var i=!1;this.setData(Object.assign({},t,e));try{switch(e?e.category:"image"){case"image":i=this.insertImage();break;default:i=this.insertFile()}}catch(t){this.statusMessage(t,"bad")}return i&&this.close(),Promise.resolve()},getOriginalAttributes:function(){var e=this.getElement();if(!e)return{};var i=e.getEditor().getSelectedNode();if(!i)return{};var n=t(i),a=(n.attr("href")||"").split("#");if(a[0]){var r=h.default.match("file_link",!1,a[0]);if(r)return{ID:r.properties.id?parseInt(r.properties.id,10):0,Anchor:a[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}}var o=n.parent(".captionImage").find(".caption"),s={url:n.attr("src"),AltText:n.attr("alt"),Width:n.attr("width"),Height:n.attr("height"),TitleTooltip:n.attr("title"),Alignment:this.findPosition(n.attr("class")),Caption:o.text(),ID:n.attr("data-id")};return["Width","Height","ID"].forEach(function(t){s[t]="string"==typeof s[t]?parseInt(s[t],10):null}),s},findPosition:function(t){var e=["leftAlone","center","rightAlone","left","right"];if("string"!=typeof t)return"";var i=t.split(" ");return e.find(function(t){return i.indexOf(t)>-1})},getAttributes:function(){var t=this.getData();return{src:t.url,alt:t.AltText,width:t.Width,height:t.Height,title:t.TitleTooltip,class:t.Alignment,"data-id":t.ID,"data-shortcode":"image"}},getExtraData:function(){var t=this.getData();return{CaptionText:t&&t.Caption}},insertFile:function(){var e=this.getData(),i=this.getElement().getEditor(),n=t(i.getSelectedNode()),a=h.default.serialise({name:"file_link",properties:{id:e.ID}},!0),r=tinymce.activeEditor.selection,o=r.getContent()||"",s=o||e.Text||e.filename;n.is("a")&&n.html()&&(s="");var d={href:a,target:e.TargetBlank?"_blank":"",title:e.Description};if(n.is("img")){s=e.Text||e.filename;var l=t("").attr(d).text(s);n.replaceWith(l),i.addUndo(),i.repaint()}else this.insertLinkInEditor(d,s);return!0},insertImage:function(){var e=this.getElement();if(!e)return!1;var i=e.getEditor();if(!i)return!1;var n=t(i.getSelectedNode()),a=this.getAttributes(),r=this.getExtraData(),o=n&&n.is("img,a")?n:null;o&&o.parent().is(".captionImage")&&(o=o.parent());var s=n&&n.is("img")?n:t("");s.attr(a).addClass("ss-htmleditorfield-file image");var d=s.parent(".captionImage"),l=d.find(".caption");r.CaptionText?(d.length||(d=t("
")),d.attr("class","captionImage "+a.class).removeAttr("data-mce-style").width(a.width),l.length||(l=t('

').appendTo(d)),l.attr("class","caption "+a.class).text(r.CaptionText)):(d=null,l=null);var c=d||s;return o&&o.not(c).length&&o.replaceWith(c),d&&d.prepend(s),o||(i.repaint(),i.insertContent(t("
").append(c).html(),{skip_undo:1})),i.addUndo(),i.repaint(),!0},statusMessage:function(e,i){var n=t("
").text(e).html();t.noticeAdd({text:n,type:i,stayTime:5e3,inEffect:{left:"0",opacity:"show"}})}})})},0:function(t,e){t.exports=React},1:function(t,e){t.exports=i18n},2:function(t,e){t.exports=Injector},5:function(t,e){t.exports=ReactDom},6:function(t,e){t.exports=jQuery},7:function(t,e){t.exports=ShortcodeSerialiser},9:function(t,e){t.exports=InsertMediaModal}}); \ No newline at end of file +!function(t){function e(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s="./client/src/entwine/TinyMCE_ssmedia.js")}({"./client/src/entwine/TinyMCE_ssmedia.js":function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}var a=i(7),r=n(a),o=i(2),s=n(o),d=i(0),l=n(d),c=i(6),u=n(c),f=i(3),m=i(10),p=n(m),g=i(8),h=n(g),v=(0,f.loadComponent)(p.default),_='img[data-shortcode="image"]';!function(){var t={init:function(t){var e=s.default._t("AssetAdmin.INSERT_FROM_FILES","Insert from Files");t.addButton("ssmedia",{icon:"image",title:e,cmd:"ssmedia"}),t.addMenuItem("ssmedia",{icon:"image",text:e,cmd:"ssmedia"}),t.addCommand("ssmedia",function(){(0,r.default)("#"+t.id).entwine("ss").openMediaDialog()}),t.on("BeforeExecCommand",function(e){var i=e.command,n=e.ui,a=e.value;"mceAdvImage"!==i&&"mceImage"!==i||(e.preventDefault(),t.execCommand("ssmedia",n,a))}),t.on("SaveContent",function(t){var e=(0,r.default)(t.content);e.find(_).add(e.filter(_)).each(function(){var t=(0,r.default)(this),e={src:t.attr("src"),id:t.data("id"),width:t.attr("width"),height:t.attr("height"),class:t.attr("class"),title:t.attr("title"),alt:t.attr("alt")},i=h.default.serialise({name:"image",properties:e,wrapped:!1});t.replaceWith(i)}),t.content="",e.each(function(){void 0!==this.outerHTML&&(t.content+=this.outerHTML)})}),t.on("BeforeSetContent",function(t){for(var e=t.content,i=h.default.match("image",!1,e);i;){var n=i.properties,a=(0,r.default)("").attr(Object.assign({},n,{id:void 0,"data-id":n.id,"data-shortcode":"image"})).addClass("ss-htmleditorfield-file image");e=e.replace(i.original,(0,r.default)("
").append(a).html()),i=h.default.match("image",!1,e)}t.content=e})}};tinymce.PluginManager.add("ssmedia",function(e){return t.init(e)})}(),r.default.entwine("ss",function(t){t(".insert-media-react__dialog-wrapper .nav-link, .insert-media-react__dialog-wrapper .breadcrumb__container a").entwine({onclick:function(t){return t.preventDefault()}}),t(".js-injector-boot #insert-media-react__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){u.default.unmountComponentAtNode(this[0])},open:function(){this._renderModal(!0)},close:function(){this._renderModal(!1)},_renderModal:function(t){var e=this,i=function(){return e.close()},n=function(){return e._handleInsert.apply(e,arguments)},a=this.getOriginalAttributes(),r=tinymce.activeEditor.selection,o=r.getContent()||"",s=r.getNode().tagName,d="A"!==s&&("IMG"===s||""===o.trim());delete a.url,u.default.render(l.default.createElement(v,{title:!1,type:"insert-media",isOpen:t,onInsert:n,onClosed:i,bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",requireLinkText:d,fileAttributes:a}),this[0])},_handleInsert:function(t,e){var i=!1;this.setData(Object.assign({},t,e));try{switch(e?e.category:"image"){case"image":i=this.insertImage();break;default:i=this.insertFile()}}catch(t){this.statusMessage(t,"bad")}return i&&this.close(),Promise.resolve()},getOriginalAttributes:function(){var e=this.getElement();if(!e)return{};var i=e.getEditor().getSelectedNode();if(!i)return{};var n=t(i),a=(n.attr("href")||"").split("#");if(a[0]){var r=h.default.match("file_link",!1,a[0]);if(r)return{ID:r.properties.id?parseInt(r.properties.id,10):0,Anchor:a[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}}var o=n.parent(".captionImage").find(".caption"),s={url:n.attr("src"),AltText:n.attr("alt"),Width:n.attr("width"),Height:n.attr("height"),TitleTooltip:n.attr("title"),Alignment:this.findPosition(n.attr("class")),Caption:o.text(),ID:n.attr("data-id")};return["Width","Height","ID"].forEach(function(t){s[t]="string"==typeof s[t]?parseInt(s[t],10):null}),s},findPosition:function(t){var e=["leftAlone","center","rightAlone","left","right"];if("string"!=typeof t)return"";var i=t.split(" ");return e.find(function(t){return i.indexOf(t)>-1})},getAttributes:function(){var t=this.getData();return{src:t.url,alt:t.AltText,width:t.Width,height:t.Height,title:t.TitleTooltip,class:t.Alignment,"data-id":t.ID,"data-shortcode":"image"}},getExtraData:function(){var t=this.getData();return{CaptionText:t&&t.Caption}},insertFile:function(){var e=this.getData(),i=this.getElement().getEditor(),n=t(i.getSelectedNode()),a=h.default.serialise({name:"file_link",properties:{id:e.ID}},!0),r=tinymce.activeEditor.selection,o=r.getContent()||"",s=o||e.Text||e.filename;n.is("a")&&n.html()&&(s="");var d={href:a,target:e.TargetBlank?"_blank":"",title:e.Description};if(n.is("img")){s=e.Text||e.filename;var l=t("").attr(d).text(s);n.replaceWith(l),i.addUndo(),i.repaint()}else this.insertLinkInEditor(d,s);return!0},insertImage:function(){var e=this.getElement();if(!e)return!1;var i=e.getEditor();if(!i)return!1;var n=t(i.getSelectedNode()),a=this.getAttributes(),r=this.getExtraData(),o=n&&n.is("img,a")?n:null;o&&o.parent().is(".captionImage")&&(o=o.parent());var s=n&&n.is("img")?n:t("");s.attr(a).addClass("ss-htmleditorfield-file image");var d=s.parent(".captionImage"),l=d.find(".caption");r.CaptionText?(d.length||(d=t("
")),d.attr("class","captionImage "+a.class).removeAttr("data-mce-style").width(a.width),l.length||(l=t('

').appendTo(d)),l.attr("class","caption "+a.class).text(r.CaptionText)):(d=null,l=null);var c=d||s;return o&&o.not(c).length&&o.replaceWith(c),d&&d.prepend(s),o||(i.repaint(),i.insertContent(t("
").append(c).html(),{skip_undo:1})),i.addUndo(),i.repaint(),!0},statusMessage:function(e,i){var n=t("
").text(e).html();t.noticeAdd({text:n,type:i,stayTime:5e3,inEffect:{left:"0",opacity:"show"}})}})})},0:function(t,e){t.exports=React},10:function(t,e){t.exports=InsertMediaModal},2:function(t,e){t.exports=i18n},3:function(t,e){t.exports=Injector},6:function(t,e){t.exports=ReactDom},7:function(t,e){t.exports=jQuery},8:function(t,e){t.exports=ShortcodeSerialiser}}); \ No newline at end of file diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index fbc0fb4e5..1f5490685 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1 @@ -!function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/bundles/bundle.js")}({"./client/src/boot/applyTransform.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(2),s=n(r),l=o("./client/src/transforms/AssetAdmin/insertAssetModal.js"),i=n(l),a=o("./client/src/transforms/FormAction/ownerAwareUnpublish.js"),d=n(a),u=o("./client/src/transforms/TreeDropdownField/moveTreeDropdownField.js"),c=n(u),p=function(){s.default.transform("insert-media-modal",function(e){e.form.alterSchema("AssetAdmin.EditForm.fileInsertForm",i.default)}),s.default.transform("move-form-disabled",function(e){e.component("TreeDropdownField.AssetAdmin.MoveForm",c.default)}),s.default.transform("owner-unpublishing",function(e){e.component("FormAction.AssetAdmin.EditForm.action_unpublish",d.default)})};t.default=p},"./client/src/boot/index.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var r=o(19),s=n(r),l=o(31),i=n(l),a=o("./client/src/containers/AssetAdmin/AssetAdminRouter.js"),d=n(a),u=o("./client/src/boot/applyTransform.js"),c=n(u),p=o("./client/src/boot/registerReducers.js"),f=n(p),h=o("./client/src/boot/registerComponents.js"),m=n(h),g=o("./client/src/boot/registerQueries.js"),_=n(g);document.addEventListener("DOMContentLoaded",function(){(0,m.default)(),(0,c.default)();var e=s.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdmin");i.default.add({path:e.url,component:d.default,indexRoute:{component:d.default},childRoutes:[{path:"show/:folderId/:viewAction/:fileId",component:d.default},{path:"show/:folderId/:viewAction",component:d.default},{path:"show/:folderId",component:d.default}]}),(0,_.default)(),(0,f.default)()})},"./client/src/boot/registerComponents.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(2),s=n(r),l=o("./client/src/components/UploadField/UploadField.js"),i=n(l),a=o("./client/src/components/UploadField/UploadFieldItem.js"),d=n(a),u=o("./client/src/components/AssetDropzone/AssetDropzone.js"),c=n(u),p=o(9),f=n(p),h=o("./client/src/components/PreviewImageField/PreviewImageField.js"),m=n(h),g=o("./client/src/components/ProportionConstraintField/ProportionConstraintField.js"),_=n(g),y=o("./client/src/containers/HistoryList/HistoryList.js"),v=n(y),b=o("./client/src/components/GalleryToolbar/GalleryToolbar.js"),E=n(b),S=o("./client/src/components/GalleryItem/GalleryItem.js"),j=function(){s.default.component.registerMany({UploadField:i.default,UploadFieldItem:d.default,PreviewImageField:m.default,HistoryList:v.default,ProportionConstraintField:_.default,AssetDropzone:c.default,InsertMediaModal:f.default,GalleryToolbar:E.default,GalleryItemFile:S.File,GalleryItemFolder:S.Folder})};t.default=j},"./client/src/boot/registerQueries.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(2),r=function(e){return e&&e.__esModule?e:{default:e}}(n),s=o("./client/src/lib/fileFragments.js"),l=function(){r.default.query.registerFragment("FileInterfaceFields",s.fileInterface),r.default.query.registerFragment("FileFields",s.file),r.default.query.registerFragment("FolderFields",s.folder)};t.default=l},"./client/src/boot/registerReducers.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(2),s=n(r),l=o(4),i=o("./client/src/state/gallery/GalleryReducer.js"),a=n(i),d=o("./client/src/state/queuedFiles/QueuedFilesReducer.js"),u=n(d),c=o("./client/src/state/uploadField/UploadFieldReducer.js"),p=n(c),f=o("./client/src/state/previewField/PreviewFieldReducer.js"),h=n(f),m=o("./client/src/state/imageLoad/ImageLoadReducer.js"),g=n(m),_=o("./client/src/state/displaySearch/DisplaySearchReducer.js"),y=n(_),v=function(){s.default.reducer.register("assetAdmin",(0,l.combineReducers)({gallery:a.default,queuedFiles:u.default,uploadField:p.default,previewField:h.default,imageLoad:g.default,displaySearch:y.default}))};t.default=v},"./client/src/bundles/bundle.js":function(e,t,o){"use strict";o("./node_modules/expose-loader/index.js?InsertMediaModal!./client/src/containers/InsertMediaModal/InsertMediaModal.js-exposed"),o("./node_modules/expose-loader/index.js?InsertEmbedModal!./client/src/components/InsertEmbedModal/InsertEmbedModal.js-exposed"),o("./client/src/boot/index.js"),o("./client/src/entwine/UploadField/UploadFieldEntwine.js")},"./client/src/components/AssetDropzone/AssetDropzone.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t2});return t<2?p.default.createElement(m.Button,{className:o,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label):p.default.createElement(m.DropdownItem,{type:"button",className:o,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label)}},{key:"render",value:function(){var e=this;if(!this.props.items.length)return null;var t=this.props.actions.filter(function(t){return!t.canApply||t.canApply(e.props.items)});if(t=t.map(this.renderChild),!t.length)return null;var o=this.props,n=o.ActionMenu,r=o.showCount,s=this.props.items.length;return p.default.createElement("div",{className:"bulk-actions fieldholder-small"},r&&p.default.createElement("div",{className:"bulk-actions-counter"},s),t.slice(0,2),t.length>2&&n?p.default.createElement(n,{id:"BulkActions",className:"bulk-actions__more-actions-menu"},t.slice(2)):t.slice(2))}}]),t}(c.Component);y.propTypes={items:c.PropTypes.array,actions:c.PropTypes.arrayOf(c.PropTypes.shape({value:c.PropTypes.string.isRequired,label:c.PropTypes.string.isRequired,className:c.PropTypes.string,destructive:c.PropTypes.bool,callback:c.PropTypes.func,canApply:c.PropTypes.func,confirm:c.PropTypes.func})),ActionMenu:c.PropTypes.oneOfType([c.PropTypes.node,c.PropTypes.func]),showCount:c.PropTypes.bool},y.defaultProps={items:[],actions:[],ActionMenu:null,total:null,showCount:!0,totalReachedMessage:u.default._t("")};var v=(0,f.connect)(i)(y);t.Component=y,t.default=(0,h.inject)(["ActionMenu"],function(e){return{ActionMenu:e}},function(){return"BulkActions"})(v)},"./client/src/components/GalleryItem/GalleryItem.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function s(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e){return e.item.thumbnail&&"image"===e.item.category&&e.item.exists&&!e.item.queuedId&&e.sectionConfig.imageRetry.minRetry&&e.sectionConfig.imageRetry.maxRetry}function u(e,t){if(d(t)){var o=e.assetAdmin.imageLoad,n=o.files.find(function(e){return t.item.thumbnail===e.url});return{loadState:n&&n.status||M.default.NONE}}return{loadState:M.default.DISABLED}}function c(e){return{actions:{imageLoad:(0,D.bindActionCreators)(R,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.File=t.Folder=t.Component=void 0;var p=Object.assign||function(e){for(var t=1;t0}},{key:"missing",value:function(){return!this.exists()&&this.saved()}},{key:"uploading",value:function(){return this.props.item.queuedId&&!this.saved()}},{key:"exists",value:function(){return this.props.item.exists}},{key:"isImage",value:function(){return"image"===this.props.item.category}},{key:"canBatchSelect",value:function(){return this.props.selectable&&this.props.item.canEdit}},{key:"hasError",value:function(){var e=!1;return this.props.item.message&&(e="error"===this.props.item.message.type),e}},{key:"handleActivate",value:function(e){e.stopPropagation(),"function"==typeof this.props.onActivate&&this.saved()&&this.props.onActivate(e,this.props.item)}},{key:"handleSelect",value:function(e){e.stopPropagation(),e.preventDefault(),"function"==typeof this.props.onSelect&&this.props.onSelect(e,this.props.item)}},{key:"handleKeyDown",value:function(e){E.default.SPACE_KEY_CODE===e.keyCode&&(e.preventDefault(),this.canBatchSelect()&&this.handleSelect(e)),E.default.RETURN_KEY_CODE===e.keyCode&&this.handleActivate(e)}},{key:"handleCancelUpload",value:function(e){e.stopPropagation(),e.preventDefault(),this.hasError()?this.props.onRemoveErroredUpload(this.props.item):this.props.onCancelUpload&&this.props.onCancelUpload(this.props.item)}},{key:"render",value:function(){var e=this,t=null,o=null,n=null,r=this.props.item,s=r.id,l=r.queuedId,i=s?"item-"+s:"queued-"+l;if(this.props.selectable&&(this.canBatchSelect()&&(t=this.handleSelect),o="font-icon-tick"),this.uploading())t=this.handleCancelUpload,o="font-icon-cancel";else if(this.exists()){var a=m.default._t("AssetAdmin.DETAILS","Details");n=_.default.createElement("div",{className:"gallery-item--overlay font-icon-edit"},a)}var d=this.props.badge,u={className:"gallery-item__checkbox",type:"checkbox",title:m.default._t("AssetAdmin.SELECT","Select"),tabIndex:-1,onMouseDown:U,id:i},c=["gallery-item__checkbox-label",o];this.canBatchSelect()||(u.disabled=!0,c.push("gallery-item__checkbox-label--disabled"));var f={className:c.join(" "),onClick:t};return _.default.createElement("div",{className:this.getItemClassNames(),"data-id":this.props.item.id,tabIndex:0,role:"button",onKeyDown:this.handleKeyDown,onClick:this.handleActivate},!!d&&_.default.createElement(F.default,{className:"gallery-item__badge",status:d.status,message:d.message}),_.default.createElement("div",{ref:function(t){e.thumbnail=t},className:this.getThumbnailClassNames(),style:this.getThumbnailStyles()},n,this.getStatusFlags()),this.getProgressBar(),this.getErrorMessage(),this.props.children,_.default.createElement("div",{className:"gallery-item__title",ref:function(t){e.title=t}},_.default.createElement("label",p({},f,{htmlFor:i}),_.default.createElement("input",u)),this.props.item.title))}}]),t}(g.Component);G.propTypes={sectionConfig:A.default,item:j.default,loadState:g.PropTypes.oneOf(Object.values(M.default)),highlighted:g.PropTypes.bool,selected:g.PropTypes.bool,isDropping:g.PropTypes.bool,isDragging:g.PropTypes.bool,message:g.PropTypes.shape({value:g.PropTypes.string,type:g.PropTypes.string}),selectable:g.PropTypes.bool,onActivate:g.PropTypes.func,onSelect:g.PropTypes.func,onCancelUpload:g.PropTypes.func,onRemoveErroredUpload:g.PropTypes.func,badge:g.PropTypes.shape({status:g.PropTypes.string,message:g.PropTypes.string}),updateStatusFlags:g.PropTypes.func,updateProgressBar:g.PropTypes.func,updateErrorMessage:g.PropTypes.func},G.defaultProps={item:{},sectionConfig:{imageRetry:{}},updateStatusFlags:function(e){return e},updateProgressBar:function(e){return e},updateErrorMessage:function(e){return e}};var B=(0,x.connect)(u,c)(G),H=(0,k.createSelectable)((0,P.default)("GalleryItem")(B)),q=(0,k.createSelectable)((0,T.default)("GalleryItem")(H));t.Component=G,t.Folder=q,t.File=H,t.default=B},"./client/src/components/GalleryItem/GalleryItemDragLayer.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t1?u.default.createElement("div",{key:"1",className:"gallery-item__drag-shadow"}):null,t>2?u.default.createElement("div",{key:"2",className:"gallery-item__drag-shadow gallery-item__drag-shadow--second"}):null];return u.default.createElement("div",{className:"gallery-item__drag-layer"},u.default.createElement("div",{className:"gallery-item__drag-layer-item",style:this.getOffset()},u.default.createElement("div",{className:"gallery-item__drag-layer-preview"},o,u.default.createElement(f.default,i({},e.props,{isDragging:!0}))),t>1?u.default.createElement(m.default,{className:"gallery-item__drag-layer-count",status:"info",message:""+t}):null))}}]),t}(d.Component);g.propTypes={item:d.PropTypes.object,offset:d.PropTypes.shape({x:d.PropTypes.number.isRequired,y:d.PropTypes.number.isRequired}),isDragging:d.PropTypes.bool.isRequired};var _=function(e){return{item:e.getItem(),offset:e.getInitialClientOffset(),dragged:e.getDifferenceFromInitialOffset(),isDragging:e.isDragging()}};t.default=(0,c.DragLayer)(_)(g)},"./client/src/components/GalleryItem/draggable.js":function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){var t={canDrag:function(e){return e.canDrag},beginDrag:function(e){var t=e.item.id;"function"==typeof e.onDrag&&e.onDrag(!0,t);var o=e.selectedFiles.concat([]);return o.includes(t)||o.push(t),{selected:o,props:e}},endDrag:function(e){var t=e.item.id;"function"==typeof e.onDrag&&e.onDrag(!1,t)}},o=function(e,t){return{connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()}},l=(0,u.DragSource)(e,t,o);return function(e){var t=function(t){function o(){return n(this,o),r(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return s(o,t),i(o,[{key:"componentDidMount",value:function(){this.props.connectDragPreview((0,c.getEmptyImage)(),{captureDraggingState:!0})}},{key:"render",value:function(){var t=this.props.connectDragSource,o=d.default.createElement(e,this.props);return t("string"==typeof o.type?o:d.default.createElement("div",{className:"gallery-item__draggable"},o))}}]),o}(a.Component);return t.propTypes={connectDragSource:a.PropTypes.func.isRequired,connectDragPreview:a.PropTypes.func.isRequired,item:a.PropTypes.shape({id:a.PropTypes.number.isRequired}).isRequired,onDrag:a.PropTypes.func,selectedFiles:a.PropTypes.arrayOf(a.PropTypes.number)},l(t)}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o0&&r<100?f.default.createElement("div",{className:"preview-image-field__progress"},f.default.createElement("div",{className:"preview-image-field__progress-bar",style:{width:r+"%"}})):null,i=this.props.upload.message,a=null;return i?a=f.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--"+i.type},i.value):100===r&&(a=f.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--success"},c.default._t("AssetAdmin.REPlACE_FILE_SUCCESS","Upload successful, the file will be replaced when you Save."))),f.default.createElement("div",{className:"editor__thumbnail-container"},s||n,l,a)}},{key:"renderToolbar",value:function(){var e=this.canEdit();return this.props.data.url||e?f.default.createElement("div",{className:"preview-image-field__toolbar fill-height"},this.props.data.url?f.default.createElement("a",{href:this.props.data.url,target:"_blank",className:this.getButtonClasses("link")},"Open"):null,e?f.default.createElement("button",{id:"preview-replace-button",onClick:this.preventDefault,className:this.getButtonClasses("replace"),type:"button"},"Replace"):null,this.props.upload.progress||this.props.upload.message?f.default.createElement("button",{onClick:this.handleCancelUpload,className:this.getButtonClasses("remove"),type:"button"},"Remove"):null):null}},{key:"render",value:function(){var e=this.getDropzoneProps();if(this.canEdit())return f.default.createElement(m.default,e,this.renderImage(),this.renderToolbar());var t=["preview-image-field__container",this.props.className,this.props.extraClass];return f.default.createElement("div",{className:t.join(" ")},this.renderImage(),this.renderToolbar())}}]),t}(p.Component);O.propTypes={id:p.PropTypes.string.isRequired,name:p.PropTypes.string,className:p.PropTypes.string,extraClass:p.PropTypes.string,readOnly:p.PropTypes.bool,disabled:p.PropTypes.bool,onAutofill:p.PropTypes.func,formid:p.PropTypes.string,nameValue:p.PropTypes.string,data:p.PropTypes.shape({id:p.PropTypes.number,parentid:p.PropTypes.number,version:p.PropTypes.number,url:p.PropTypes.string,mock:p.PropTypes.bool,exists:p.PropTypes.bool,preview:p.PropTypes.string,category:p.PropTypes.string,nameField:p.PropTypes.string,uploadFileEndpoint:p.PropTypes.shape({url:p.PropTypes.string.isRequired,method:p.PropTypes.string.isRequired,payloadFormat:p.PropTypes.string}),initialValues:p.PropTypes.object}).isRequired,upload:p.PropTypes.shape({url:p.PropTypes.string,progress:p.PropTypes.number,xhr:p.PropTypes.object,category:p.PropTypes.string,message:p.PropTypes.shape({type:p.PropTypes.string.isRequired,value:p.PropTypes.string.isRequired})}),actions:p.PropTypes.object,securityID:p.PropTypes.string,confirm:p.PropTypes.func},O.defaultProps={extraClass:"",className:"",data:{},upload:{},confirm:function(e){return window.confirm(e)}},t.Component=O,t.default=(0,y.connect)(i,a)(O)},"./client/src/components/ProportionConstraintField/ProportionConstraintField.js":function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var l=function(){function e(e,t){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:this.props;if("function"==typeof t.onChange){var o=t.files.filter(function(e){return e.id}).map(function(e){return e.id}),n={Files:o};t.onChange(e,{id:t.id,value:n})}}},{key:"handleUploadButton",value:function(e){e.preventDefault()}},{key:"handleAddShow",value:function(e){e.preventDefault(),this.setState({selecting:!0,selectingItem:null})}},{key:"handleHide",value:function(){this.setState({selecting:!1,selectingItem:null})}},{key:"handleAddInsert",value:function(e,t,o){return this.props.actions.uploadField.addFile(this.props.id,o),this.handleHide(),Promise.resolve({})}},{key:"handleInsertMany",value:function(e,t){var o=this;if(this.state.selectingItem)return void this.handleReplace(e,null,t[0]);t.forEach(function(t){o.handleAddInsert(e,null,t)})}},{key:"handleReplace",value:function(e,t,o){var n=this.state.selectingItem,r=this.props,s=r.id,l=r.actions.uploadField,i=l.addFile,a=l.removeFile;if(!n)throw new Error("Tried to replace a file when none was selected.");return a(s,n),i(s,o),this.handleHide(),Promise.resolve({})}},{key:"canEdit",value:function(){return!this.props.disabled&&!this.props.readOnly&&(this.props.data.canUpload||this.props.data.canAttach)}},{key:"canUpload",value:function(){return this.canEdit()&&this.props.data.canUpload}},{key:"canAttach",value:function(){return this.canEdit()&&this.props.data.canAttach}},{key:"renderDropzone",value:function(){var e=this.props.AssetDropzone;if(!this.props.data.createFileEndpoint)return null;var t={height:E.default.SMALL_THUMBNAIL_HEIGHT,width:E.default.SMALL_THUMBNAIL_WIDTH},o=this.getMaxFiles(),n={url:this.props.data.createFileEndpoint.url,method:this.props.data.createFileEndpoint.method,paramName:"Upload",maxFiles:o,thumbnailWidth:E.default.SMALL_THUMBNAIL_WIDTH,thumbnailHeight:E.default.SMALL_THUMBNAIL_HEIGHT},r=["uploadfield__dropzone"];if(0===o&&r.push("uploadfield__dropzone--hidden"),!this.canEdit())return this.props.files.length?null:g.default.createElement("p",null,h.default._t("AssetAdmin.EMPTY","No files"));var s=this.props.securityId,l=[];return this.canUpload()&&l.push(g.default.createElement("button",{key:"uploadbutton",type:"button",onClick:this.handleUploadButton,className:"uploadfield__upload-button"},h.default._t("AssetAdmin.BROWSE","Browse"))),this.canAttach()&&(l.length&&l.push(g.default.createElement("span",{key:"uploadjoin",className:"uploadfield__join"},h.default._t("AssetAdmin.OR","or"))),l.push(g.default.createElement("button",{key:"attachbutton",type:"button",onClick:this.handleAddShow,className:"uploadfield__add-button"},h.default._t("AssetAdmin.ADD_FILES","Add from files")))),g.default.createElement(e,{name:this.props.name,canUpload:this.canUpload(),uploadButton:!1,uploadSelector:".uploadfield__upload-button, .uploadfield__backdrop",folderId:this.props.data.parentid,onAddedFile:this.handleAddedFile,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:t,options:n,securityID:s,className:r.join(" ")},g.default.createElement("div",{className:"uploadfield__backdrop"}),g.default.createElement("span",{className:"uploadfield__droptext"},l))}},{key:"renderModal",value:function(){var e=this.props.InsertMediaModal,t=this.state,o=t.selecting,n=t.selectingItem,r=this.getMaxFiles(),s=this.getFolderId();return g.default.createElement(e,{title:!1,isOpen:o,onInsert:n?this.handleReplace:this.handleAddInsert,onClosed:this.handleHide,onInsertMany:this.handleInsertMany,maxFiles:n?1:r,type:"select",bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",fileAttributes:n?{ID:n.id}:null,folderId:s})}},{key:"renderChild",value:function(e,t){var o=this.props.UploadFieldItem,n={key:e.id?"file-"+e.id:"queued-"+e.queuedId,item:e,name:this.props.name,onRemove:this.handleItemRemove,canEdit:this.canEdit(),onView:this.handleReplaceShow},r=this.props.getItemProps(n,t,this.props);return g.default.createElement(o,r)}},{key:"render",value:function(){return g.default.createElement("div",{className:"uploadfield"},this.renderDropzone(),this.props.files.map(this.renderChild),this.renderModal())}}]),t}(m.Component);O.propTypes={id:m.PropTypes.string.isRequired,name:m.PropTypes.string.isRequired,onChange:m.PropTypes.func,value:m.PropTypes.shape({Files:m.PropTypes.arrayOf(m.PropTypes.number)}),files:m.PropTypes.arrayOf(P.default),readOnly:m.PropTypes.bool,disabled:m.PropTypes.bool,data:m.PropTypes.shape({files:m.PropTypes.arrayOf(P.default),createFileEndpoint:m.PropTypes.shape({url:m.PropTypes.string.isRequired,method:m.PropTypes.string.isRequired,payloadFormat:m.PropTypes.string.isRequired}),multi:m.PropTypes.bool,parentid:m.PropTypes.number,canUpload:m.PropTypes.bool,canAttach:m.PropTypes.bool,maxFiles:m.PropTypes.number}),UploadFieldItem:m.PropTypes.oneOfType([m.PropTypes.node,m.PropTypes.func]),AssetDropzone:m.PropTypes.oneOfType([m.PropTypes.node,m.PropTypes.func]),InsertMediaModal:m.PropTypes.oneOfType([m.PropTypes.node,m.PropTypes.func]),getItemProps:m.PropTypes.func},O.defaultProps={value:{Files:[]},className:"",getItemProps:function(e){return e}};var F=(0,_.connect)(a,d)(O);t.Component=O,t.ConnectedUploadField=F,t.default=(0,y.compose)((0,v.inject)(["UploadFieldItem","AssetDropzone","InsertMediaModal"]),j.default)(F)},"./client/src/components/UploadField/UploadFieldItem.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o0}},{key:"missing",value:function(){return!this.exists()&&this.saved()}},{key:"isImageSmallerThanThumbnail",value:function(){if(!this.isImage()||this.missing())return!1;var e=this.props.item.width,t=this.props.item.height;return t&&e&&t0}).length)return alert(r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_FOLDER","These folders contain files which are currently in use, you must move or delete their contents before you can delete the folder.")),void o("cancelled");var n=e.filter(function(e){return"folder"!==e.type&&e.inUseCount>0}),s=r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_CONFIRM","Are you sure you want to delete these files?");1===e.length&&1===n.length?s=r.default.sprintf(r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to delete it?"),e[0].inUseCount):n.length>0&&(s=r.default.sprintf(r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_MULTI_CONFIRM","There are %s files currently in use, are you sure you want to delete these files?"),n.length)),n.length>0&&(s+="\n\n",s+=r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_WARNING","Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.")),confirm(s)?t():o("cancelled")})})},{value:"edit",label:r.default._t("AssetAdmin.BULK_ACTIONS_EDIT","Edit"),className:"font-icon-edit",destructive:!1,canApply:function(e){return 1===e.length},callback:null},{value:"move",label:r.default._t("AssetAdmin.BULK_ACTIONS_MOVE","Move"),className:"font-icon-folder-move",canApply:function(e){return e.every(function(e){return e&&e.canEdit})},destructive:!1,callback:null},{value:"publish",label:r.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH","Publish"),className:"font-icon-rocket",destructive:!1,callback:null,canApply:function(e){return e.some(function(e){return e&&!e.published})&&e.every(function(e){return e.canEdit&&"folder"!==e.type})},confirm:null},{value:"unpublish",label:r.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH","Unpublish"),className:"font-icon-cancel-circled",destructive:!1,callback:null,canApply:function(e){return e.some(function(e){return e.published})&&e.every(function(e){return e.canEdit&&"folder"!==e.type})},confirm:null},{value:"insert",label:r.default._t("AssetAdmin.BULK_ACTIONS_INSERT","Insert"),className:"font-icon-plus-circled btn-primary",destructive:!1,callback:null,canApply:function(e){return e.length},confirm:null}],BULK_ACTIONS_PLACEHOLDER:r.default._t("AssetAdmin.BULK_ACTIONS_PLACEHOLDER"),SPACE_KEY_CODE:32,RETURN_KEY_CODE:13,DEFAULT_PREVIEW:"framework/client/dist/images/app_icons/generic_92.png",MODAL_MOVE:"MODAL_MOVE"}},"./client/src/containers/AssetAdmin/AssetAdmin.js":function(e,t,o){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function s(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t1&&void 0!==arguments[1])||arguments[1];return b.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:this.props.securityId}}:{}))}},{key:"handleBackButtonClick",value:function(e){e.preventDefault(),this.props.actions.gallery.deselectFiles(),this.props.folder?this.handleOpenFolder(this.props.folder.parentId||0):this.handleOpenFolder(0)}},{key:"resetFile",value:function(e){e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId),this.props.fileId===e.id&&(this.handleCloseFile(),this.handleOpenFile(e.id))}},{key:"handleFolderIcon",value:function(e){e.preventDefault(),this.handleOpenFile(this.getFolderId())}},{key:"handleOpenFile",value:function(e){this.handleBrowse(this.getFolderId(),e,this.props.query)}},{key:"handleSubmitEditor",value:function(e,t,o){var n=this,r=null;if("action_insert"===t&&"select"===this.props.type){var s=this.getFiles(),l=s.find(function(t){return t.id===parseInt(e.ID,10)});return this.props.onInsertMany(null,[l]),Promise.resolve()}if("function"==typeof this.props.onSubmitEditor){var i=this.findFile(this.props.fileId);r=this.props.onSubmitEditor(e,t,o,i)}else r=o();if(!r)throw new Error("Promise was not returned for submitting");return r.then(function(e){return"action_createfolder"===t&&"admin"===n.props.type&&n.handleOpenFile(e.record.id),n.props.actions.files.readFiles().then(function(){return"action_createfolder"===t&&"admin"!==n.props.type&&n.handleOpenFolder(n.getFolderId()),e})})}},{key:"handleCloseFile",value:function(){this.handleBrowse(this.getFolderId(),null,this.props.query)}},{key:"handleOpenFolder",value:function(e){var t=Object.assign({},this.props.query);delete t.page,delete t.filter,this.handleBrowse(e,null,t)}},{key:"handleDelete",value:function(e){var t=this,o=e.map(function(e){var o=t.findFile(e);if(!o)throw new Error("File selected for deletion cannot be found: "+e);return o.queuedId&&t.props.actions.queuedFiles.removeQueuedFile(o.queuedId),o}),n=o.map(function(e){return e.id}),r=this.props.folder?this.props.folder.id:0;return this.props.actions.files.deleteFiles(n).then(function(e){var o=e.data.deleteFiles;return t.handleBrowse(r,null,t.props.query),o})}},{key:"doUnpublish",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.map(function(e){var o=t.findFile(e);if(!o)throw new Error("File selected for unpublishing cannot be found: "+e);if("folder"===o.type)throw new Error("Cannot unpublish folders");return o}),r=n.map(function(e){return e.id});return this.props.actions.files.unpublishFiles(r,o).then(function(e){var o=e.data.unpublishFiles,n=o.filter(function(e){return"File"===e.__typename}),r=o.filter(function(e){return"PublicationNotice"===e.__typename&&"HAS_OWNERS"===e.Type}),s=n.map(function(e){return t.resetFile(e),e}),l=r.slice(0,4),i=r.slice(5),a=l.map(function(e){return e.Message});if(i.length&&a.push(S.default.inject(S.default._t("AssetAdmin.BULK_OWNED_WARNING_REMAINING","And {count} other file(s)"),{count:i.length})),l.length){var d=[S.default.inject(S.default._t("AssetAdmin.BULK_OWNED_WARNING_HEADING","{count} file(s) are being used by other published content."),{count:r.length}),a.join("\n"),S.default._t("AssetAdmin.BULK_OWNED_WARNING_FOOTER","Unpublishing will only remove files from the published version of the content. They will remain on the draft version. Unpublish anyway?")];if(confirm(d.join("\n\n"))){var u=r.reduce(function(e,t){return e.concat(t.IDs)},[]);return t.doUnpublish(u,!0).then(function(e){return s.concat(e)})}}return s})}},{key:"handleUnpublish",value:function(e){var t=this;return this.doUnpublish(e).then(function(e){var o=t.props.fileId;t.props.actions.files.readFiles().then(function(){o&&e.find(function(e){return e.id===o})&&(t.handleCloseFile(),t.handleOpenFile(o))})})}},{key:"doPublish",value:function(e){var t=this,o=e.map(function(e){var o=t.findFile(e);if(!o)throw new Error("File selected for publishing cannot be found: "+e);if("folder"===o.type)throw new Error("Cannot publish folders");return o}),n=o.map(function(e){return e.id});return this.props.actions.files.publishFiles(n).then(function(e){return e.data.publishFiles.filter(function(e){return"File"===e.__typename}).map(function(e){return t.resetFile(e),e})})}},{key:"findFile",value:function(e){return this.getFiles().find(function(t){return t.id===parseInt(e,10)})}},{key:"handleUpload",value:function(){}},{key:"handleCreateFolder",value:function(){this.props.onBrowse(this.getFolderId(),null,this.props.query,te.default.ACTIONS.CREATE_FOLDER)}},{key:"handleMoveFilesSuccess",value:function(e,t){var o=this;this.props.queuedFiles.items.filter(function(e){return t.includes(e.id)}).forEach(function(e){e.queuedId&&o.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}),this.props.actions.gallery.deselectFiles(),this.props.actions.files.readFiles()}},{key:"renderGallery",value:function(){var e=this.props.sectionConfig,t=e.createFileEndpoint.url,o=e.createFileEndpoint.method,n=this.props.query&&parseInt(this.props.query.limit||e.limit,10),r=this.props.query&&parseInt(this.props.query.page||1,10),s=this.props.query&&this.props.query.sort,l=this.props.query&&this.props.query.view,i=this.props.query.filter||{};return g.default.createElement(R.default,{files:this.getFiles(),fileId:this.props.fileId,folderId:this.getFolderId(),folder:this.props.folder,type:this.props.type,limit:n,page:r,totalCount:this.props.filesTotalCount,view:l,filters:i,graphQLErrors:this.props.graphQLErrors,createFileApiUrl:t,createFileApiMethod:o,onDelete:this.handleDelete,onInsertMany:this.props.onInsertMany,onPublish:this.doPublish,onUnpublish:this.doUnpublish,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSuccessfulUpload:this.handleUpload,onCreateFolder:this.handleCreateFolder,onMoveFilesSuccess:this.handleMoveFilesSuccess,onClearSearch:this.handleClearSearch,onSort:this.handleSort,onSetPage:this.handleSetPage,onViewChange:this.handleViewChange,sort:s,sectionConfig:e,loading:this.props.loading,maxFilesSelect:this.props.maxFiles})}},{key:"renderEditor",value:function(){var e=this.props.sectionConfig,t=d({config:e,viewAction:this.props.viewAction,folderId:this.getFolderId(),type:this.props.type,fileId:this.props.fileId}),o=t.schemaUrl,n=t.targetId;return o?g.default.createElement(k.default,{className:this.props.dialog?"editor--dialog":"",targetId:n,file:this.findFile(n),onClose:this.handleCloseFile,schemaUrl:o,schemaUrlQueries:this.props.requireLinkText?[{name:"requireLinkText",value:!0}]:[],onSubmit:this.handleSubmitEditor,onDelete:this.handleDelete,onUnpublish:this.handleUnpublish,addToCampaignSchemaUrl:e.form.addToCampaignForm.schemaUrl}):null}},{key:"render",value:function(){var e=Boolean(this.props.folderId||(0,H.hasFilters)(this.props.query.filter)),t=this.props.sectionConfig.form.fileSearchForm.schemaUrl,o=this.props.query.filter||{},n=(0,C.default)("fill-height asset-admin","select"===this.props.type&&{"asset-admin--single-select":1===this.props.maxFiles,"asset-admin--multi-select":1!==this.props.maxFiles}),r=(0,H.hasFilters)(this.props.query.filter)||this.props.showSearch,s=this.props.actions.displaySearch?this.props.actions.displaySearch.toggleSearch:void 0;return g.default.createElement("div",{className:n},g.default.createElement(G.default,{showBackButton:e,onBackButtonClick:this.handleBackButtonClick},g.default.createElement(M.default,{multiline:!0}),g.default.createElement("div",{className:"asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items"},g.default.createElement(V.default,{toggled:r,onToggle:s}),this.props.toolbarChildren)),r&&g.default.createElement(q.default,{onSearch:this.handleDoSearch,id:"AssetSearchForm",formSchemaUrl:t,onHide:this.handleClearSearch,displayBehavior:"HIDEABLE",filters:o,name:"name"}),g.default.createElement("div",{className:"flexbox-area-grow fill-width fill-height gallery"},this.renderGallery(),this.renderEditor()))}}]),t}(m.Component);re.propTypes={dialog:m.PropTypes.bool,sectionConfig:ne.default,fileId:m.PropTypes.number,folderId:m.PropTypes.number,onBrowse:m.PropTypes.func,onReplaceUrl:m.PropTypes.func,onInsertMany:m.PropTypes.func,graphQLErrors:m.PropTypes.arrayOf(m.PropTypes.string),getUrl:m.PropTypes.func,query:m.PropTypes.shape({sort:m.PropTypes.string,limit:m.PropTypes.oneOfType([m.PropTypes.number,m.PropTypes.string]),page:m.PropTypes.oneOfType([m.PropTypes.number,m.PropTypes.string]),filter:m.PropTypes.object}),onSubmitEditor:m.PropTypes.func,type:m.PropTypes.oneOf(["insert-media","insert-link","select","admin"]),files:m.PropTypes.array,queuedFiles:m.PropTypes.shape({items:m.PropTypes.array.isRequired}),filesTotalCount:m.PropTypes.number,folder:m.PropTypes.shape({id:m.PropTypes.number,title:m.PropTypes.string,parents:m.PropTypes.array,parentId:m.PropTypes.number,canView:m.PropTypes.bool,canEdit:m.PropTypes.bool}),loading:m.PropTypes.bool,actions:m.PropTypes.object,maxFiles:m.PropTypes.number},re.defaultProps={type:"admin",query:{sort:"",limit:null,page:0,filter:{}},maxFiles:null},t.Component=re,t.getFormSchema=d,t.default=(0,y.compose)((0,_.connect)(c,p),K.default,$.default,X.default,J.default,function(e){return(0,B.withApollo)(e)})(re)},"./client/src/containers/AssetAdmin/AssetAdminRouter.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){var t=e.base,o=e.folderId,n=e.fileId,r=e.query,s=e.action;if(s&&-1===C.indexOf(s))throw new Error("Invalid action provided: "+s);var l=null;return l=n?t+"/show/"+o+"/"+b.default.ACTIONS.EDIT_FILE+"/"+n:o?t+"/show/"+o:t+"/",s===b.default.ACTIONS.CREATE_FOLDER&&(l=t+"/show/"+(o||0)+"/"+s),r&&Object.keys(r).length>0&&(l=l+"?"+y.default.stringify(r)),l}function a(e){return{sectionConfig:e.config.sections.find(function(e){return e.name===j})}}Object.defineProperty(t,"__esModule",{value:!0}),t.buildUrl=t.Component=void 0;var d=function(){function e(e,t){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:b.default.ACTIONS.EDIT_FILE,r=parseInt(e||0,10),s=parseInt(t||0,10),l=r!==this.getFolderId(),a=Object.assign({},o);return(l||a.page<=1)&&delete a.page,i({base:this.props.sectionConfig.url,folderId:r,fileId:s,query:a,action:n})}},{key:"getFolderId",value:function(){return this.props.params&&this.props.params.folderId?parseInt(this.props.params.folderId,10):0}},{key:"getFileId",value:function(){return this.props.params&&this.props.params.fileId?parseInt(this.props.params.fileId,10):0}},{key:"getViewAction",value:function(){return this.props.params&&this.props.params.viewAction?this.props.params.viewAction:b.default.ACTIONS.EDIT_FILE}},{key:"getSectionProps",value:function(){return{sectionConfig:this.props.sectionConfig,type:"admin",folderId:this.getFolderId(),viewAction:this.getViewAction(),fileId:this.getFileId(),query:this.getQuery(),getUrl:this.getUrl,onBrowse:this.handleBrowse,onReplaceUrl:this.handleReplaceUrl}}},{key:"getQuery",value:function(){return(0,g.decodeQuery)(this.props.location.search)}},{key:"handleBrowse",value:function(e,t,o,n){var r=this.getUrl(e,t,o,n);this.props.router.push(r)}},{key:"handleReplaceUrl",value:function(e,t,o,n){var r=this.getUrl(e,t,o,n);this.props.router.replace(r)}},{key:"render",value:function(){return this.props.sectionConfig?c.default.createElement(m.default,this.getSectionProps()):null}}]),t}(u.Component);P.propTypes={sectionConfig:S.default,location:u.PropTypes.shape({pathname:u.PropTypes.string,query:u.PropTypes.object,search:u.PropTypes.string}),params:u.PropTypes.object,router:u.PropTypes.object},t.Component=P,t.buildUrl=i,t.default=(0,f.withRouter)((0,p.connect)(a)(P))},"./client/src/containers/AssetAdmin/stateRouter.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){function t(t){var o=t.config.sections.find(function(e){return e.name===m});return{Component:e,sectionConfig:o}}return(0,c.connect)(t)(_)}Object.defineProperty(t,"__esModule",{value:!0}),t.AssetAdminStateRouter=void 0;var a=function(){function e(e,t){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.default.ACTIONS.EDIT_FILE,r=parseInt(e||0,10),s=parseInt(t||0,10),l=this.getFolderId(),i=r!==l&&null!==l,a=Object.assign({},o);return(i||a.page<=1)&&delete a.page,(0,p.buildUrl)({base:this.props.sectionConfig.url,folderId:r,fileId:s,query:a,action:n})}},{key:"getFolderId",value:function(){return null===this.state.folderId?null:parseInt(this.state.folderId||0,10)}},{key:"getFileId",value:function(){return parseInt(this.state.fileId||this.props.fileId||0,10)}},{key:"getViewAction",value:function(){return this.state.action||h.default.ACTIONS.EDIT_FILE}},{key:"getSectionProps",value:function(){var e=Object.assign({},this.props,{folderId:this.getFolderId(),fileId:this.getFileId(),viewAction:this.getViewAction(),query:this.state.query,getUrl:this.getUrl,onBrowse:this.handleBrowse});return delete e.Component,e}},{key:"handleBrowse",value:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.default.ACTIONS.EDIT_FILE;if(n&&-1===Object.values(h.default.ACTIONS).indexOf(n))throw new Error("Invalid action provided: "+n);this.setState({folderId:e,fileId:t,query:o,action:n})}},{key:"render",value:function(){var e=this.getSectionProps(),t=this.props.Component;return u.default.createElement(t,e)}}]),t}(d.Component);_.propTypes={Component:d.PropTypes.oneOfType([d.PropTypes.element,d.PropTypes.func]),sectionConfig:d.PropTypes.shape({url:d.PropTypes.string.isRequired}).isRequired,fileId:d.PropTypes.number},t.AssetAdminStateRouter=_,t.default=i},"./client/src/containers/Editor/Editor.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return{actions:{unsavedForms:(0,f.bindActionCreators)(j,e)}}}function a(e){return{enableDropzone:e.assetAdmin.gallery.enableDropzone}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var d=function(){function e(e,t){for(var o=0;o0&&(n=c.default.sprintf(c.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to delete it?"),this.props.file.inUseCount),n+="\n\n",n+=c.default._t("AssetAdmin.BULK_ACTIONS_DELETE_WARNING","Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.")),confirm(n)&&(this.props.actions.unsavedForms.removeFormChanged("AssetAdmin.EditForm"),this.props.onDelete([t.ID])),e.preventDefault()}}},{key:"handleCancelKeyDown",value:function(e){e.keyCode!==_.default.SPACE_KEY_CODE&&e.keyCode!==_.default.RETURN_KEY_CODE||this.handleClose(e)}},{key:"handleSubmit",value:function(e,t,o){return"function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,o):o()}},{key:"handleClose",value:function(e){this.props.onClose(),this.closeModal(),e&&e.preventDefault()}},{key:"openModal",value:function(){this.setState({openModal:!0})}},{key:"closeModal",value:function(){this.setState({openModal:!1})}},{key:"handleLoadingError",value:function(e){this.setState({loadingForm:!1,loadingError:e.errors[0]})}},{key:"handleLoadingSuccess",value:function(){this.setState({loadingForm:!1,loadingError:null})}},{key:"handleFetchingSchema",value:function(){this.setState({loadingForm:!0})}},{key:"renderCancelButton",value:function(){return m.default.createElement("a",{role:"button",tabIndex:0,className:"btn btn--close-panel btn--no-text font-icon-cancel btn--icon-xl",onClick:this.handleClose,onKeyDown:this.handleCancelKeyDown,type:"button","aria-label":c.default._t("AssetAdmin.CANCEL")})}},{key:"render",value:function(){var e=this.props.schemaUrlQueries.map(function(e){return e.name+"="+e.value}).join("&").trim();e=e?"?"+e:"";var t=this.props.schemaUrl+"/"+this.props.targetId+e,o=this.props.addToCampaignSchemaUrl+"/"+this.props.targetId,n=["panel","form--no-dividers","editor"];this.props.className&&n.push(this.props.className),this.props.enableDropzone||n.push("editor--asset-dropzone--disable");var r=null;if(this.state.loadingError){var s=this.state.loadingError.value;404===this.state.loadingError.code&&(s=c.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),s||(s=c.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")),r=m.default.createElement("div",{className:"editor__file-preview-message--file-missing"},s)}var l=c.default._t("Admin.ADD_TO_CAMPAIGN","Add to campaign");return m.default.createElement("div",{className:n.join(" ")},m.default.createElement("div",{className:"editor__details fill-height"},m.default.createElement(v.default,{identifier:"AssetAdmin.EditForm",schemaUrl:t,afterMessages:this.renderCancelButton(),onSubmit:this.handleSubmit,onAction:this.handleAction,onLoadingSuccess:this.handleLoadingSuccess,onLoadingError:this.handleLoadingError,onFetchingSchema:this.handleFetchingSchema}),r,m.default.createElement(E.default,{title:l,identifier:"AssetAdmin.AddToCampaign",isOpen:this.state.openModal,onClosed:this.closeModal,schemaUrl:o,bodyClassName:"modal__dialog",responseClassBad:"modal__response modal__response--error",responseClassGood:"modal__response modal__response--good"}),this.state.loadingForm&&[m.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),m.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})]))}}]),t}(h.Component);w.propTypes={file:P.default,className:h.PropTypes.string,targetId:h.PropTypes.number.isRequired,enableDropzone:h.PropTypes.bool,onClose:h.PropTypes.func.isRequired,onSubmit:h.PropTypes.func.isRequired,onDelete:h.PropTypes.func.isRequired,schemaUrl:h.PropTypes.string.isRequired,schemaUrlQueries:h.PropTypes.arrayOf(h.PropTypes.shape({name:h.PropTypes.string,value:h.PropTypes.any})),addToCampaignSchemaUrl:h.PropTypes.string,actions:h.PropTypes.object},t.Component=w,t.default=(0,p.connect)(a,i)(w)},"./client/src/containers/Gallery/Gallery.js":function(e,t,o){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){var o=t.sort,n=e.assetAdmin.gallery,r=n.selectedFiles,s=n.errorMessage,l=n.noticeMessage,i=n.enableDropzone,a=n.badges,d=n.concatenateSelect,u=n.loading,c=n.sorters,p=n.lastSelected;return!o&&c&&c[0]&&(o=c[0].field+","+c[0].direction),{lastSelected:p,selectedFiles:r,errorMessage:s,noticeMessage:l,enableDropzone:i,badges:a,concatenateSelect:d,loading:t.loading||u,queuedFiles:e.assetAdmin.queuedFiles,securityId:e.config.SecurityID,sorters:c,sort:o}}function d(e){return{actions:{gallery:(0,w.bindActionCreators)(G,e),queuedFiles:(0,w.bindActionCreators)(H,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.galleryViewDefaultProps=t.galleryViewPropTypes=t.Component=void 0;var u=Object.assign||function(e){for(var t=1;t=s&&t<=l}).map(function(e){return e.id})}},{key:"getSelectableFiles",value:function(){var e=this.props.files.filter(function(e){return e.id});return"select"===this.props.type?e.filter(function(e){return"folder"!==e.type}):e}},{key:"handleBulkInsert",value:function(e,t){this.props.onInsertMany(e,t)}},{key:"handleBulkDelete",value:function(e,t){var o=this;return this.props.onDelete(t.map(function(e){return e.id})).then(function(e){var n=e.filter(function(e){return e}).length;n!==t.length?(o.props.actions.gallery.setErrorMessage(g.default.sprintf(g.default._t("AssetAdmin.BULK_ACTIONS_DELETE_FAIL","%s folders/files were successfully deleted, but %s files were not able to be deleted."),n,t.length-n)),o.props.actions.gallery.setNoticeMessage(null)):(o.props.actions.gallery.setNoticeMessage(g.default.sprintf(g.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SUCCESS","%s folders/files were successfully deleted."),n)),o.props.actions.gallery.setErrorMessage(null),o.props.actions.gallery.deselectFiles())})}},{key:"handleBulkPublish",value:function(e,t){var o=this,n=t.map(function(e){return e.id});return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onPublish(n).then(function(e){o.props.actions.gallery.setLoading(!1),o.props.actions.gallery.setNoticeMessage(g.default.sprintf(g.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH_SUCCESS","%s folders/files were successfully published."),e.length)),o.props.actions.gallery.setErrorMessage(null),o.props.actions.gallery.deselectFiles()})):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}},{key:"handleBulkUnpublish",value:function(e,t){var o=this,n=t.filter(function(e){return e.published}).map(function(e){return e.id});return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onUnpublish(n).then(function(e){o.props.actions.gallery.setLoading(!1),o.props.actions.gallery.setNoticeMessage(g.default.sprintf(g.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_SUCCESS","%s folders/files were successfully unpublished."),e.length)),o.props.actions.gallery.setErrorMessage(null),o.props.actions.gallery.deselectFiles()})):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}},{key:"initSortDropdown",value:function(){if("tile"===this.props.view){var e=this.getSortElement();e.chosen({allow_single_deselect:!0,disable_search_threshold:20}),e.off("change"),e.on("change",function(){return S.default.Simulate.click(e.find(":selected")[0])})}}},{key:"handleSort",value:function(e){this.props.actions.queuedFiles.purgeUploadQueue(),this.props.onSort(e)}},{key:"handleSetPage",value:function(e){this.props.onSetPage(e)}},{key:"handleCancelUpload",value:function(e){e.xhr.abort(),this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}},{key:"handleRemoveErroredUpload",value:function(e){this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}},{key:"handleAddedFile",value:function(e){this.props.actions.queuedFiles.addQueuedFile(e)}},{key:"handlePreviewLoaded",value:function(e,t){this.props.actions.queuedFiles.updateQueuedFile(e.queuedId,t)}},{key:"handleSending",value:function(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{xhr:t})}},{key:"handleUploadProgress",value:function(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{progress:t})}},{key:"handleSuccessfulUpload",value:function(e){var t=JSON.parse(e.xhr.response);if(void 0!==t[0].error)return void this.handleFailedUpload(e);this.props.actions.queuedFiles.succeedUpload(e._queuedId,t[0]),this.props.onSuccessfulUpload&&this.props.onSuccessfulUpload(t);var o=this.props.queuedFiles.items.reduce(function(e,t){return 100!==t.progress?e+1:e},0);if(!this.props.fileId&&!this.props.selectedFiles.length&&0===o){var n=t.pop();this.props.onOpenFile(n.id)}}},{key:"handleFailedUpload",value:function(e,t){this.props.actions.queuedFiles.failUpload(e._queuedId,t)}},{key:"itemIsSelected",value:function(e){return this.props.selectedFiles.indexOf(e)>-1}},{key:"toggleSelectConcat",value:function(e){this.props.actions.gallery.setConcatenateSelect(this.isConcat(e))}},{key:"isConcat",value:function(e){return e.metaKey||e.ctrlKey||e.shiftKey}},{key:"itemIsHighlighted",value:function(e){return this.props.fileId===e}},{key:"hasOpenedItem",value:function(){return!!this.props.fileId}},{key:"handleClearSearch",value:function(e){this.props.onClearSearch(e)}},{key:"handleGroupSelect",value:function(e,t){var o=this,n=this.props.actions.gallery,r=n.setSelectedFiles,s=n.selectFiles,l=this.getSelectableFiles(),i=e.filter(function(t,o){return e.indexOf(t)===o&&l.find(function(e){return e.id===t})}),a=this.props.concatenateSelect||this.isConcat(t);if(null!==this.props.maxFilesSelect){var d=i.length;if(a&&(d=this.props.selectedFiles.filter(function(e){return!o.props.selectedFiles.includes(e)}).concat(this.props.selectedFiles).length),d>=this.props.maxFilesSelect)return}a?r(i):s(i)}},{key:"handleClearSelection",value:function(){this.props.actions.gallery.deselectFiles()}},{key:"handleOpenFolder",value:function(e,t){e.preventDefault(),this.props.actions.gallery.setErrorMessage(null),this.props.actions.gallery.setNoticeMessage(null),this.props.onOpenFolder(t.id)}},{key:"handleOpenFile",value:function(e,t){e.preventDefault(),null!==t.created&&(this.props.selectedFiles.length&&1!==this.props.maxFilesSelect||"select"!==this.props.type||this.handleSelect(e,t),this.props.onOpenFile(t.id,t))}},{key:"handleSelect",value:function(e,t){var o=this.props.maxFilesSelect,n=this.getSelectableFiles(),r=n.filter(function(e){return e.id===t.id}).map(function(e){return e.id});if(1===o)return void this.props.actions.gallery.setSelectedFiles(r);if(-1===this.props.selectedFiles.indexOf(t.id)){if(e.shiftKey&&(r=this.getSelection(this.props.lastSelected,t.id)),this.props.selectedFiles.filter(function(e){return!r.includes(e)}).concat(r).length>o&&null!==o)return;this.props.actions.gallery.selectFiles(r),this.props.actions.gallery.setLastSelected(t.id)}else this.props.actions.gallery.deselectFiles([t.id]),e.shiftKey&&this.props.actions.gallery.setLastSelected(null)}},{key:"handleEnableDropzone",value:function(e){this.props.actions.gallery.setEnableDropzone(e)}},{key:"handleMoveFiles",value:function(e,t){var o=this;this.props.actions.files.moveFiles(e,t).then(function(){var n=R.default.MOVE_SUCCESS_DURATION,r="+"+t.length;o.props.actions.gallery.setFileBadge(e,r,"success",n),"function"==typeof o.props.onMoveFilesSuccess&&o.props.onMoveFilesSuccess(e,t)}).catch(function(){o.props.actions.gallery.setErrorMessage(g.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))})}},{key:"handleBulkEdit",value:function(e,t){this.handleOpenFile(e,t[0])}},{key:"handleBulkMove",value:function(){this.props.actions.gallery.activateModal(R.default.MODAL_MOVE)}},{key:"renderTransitionBulkActions",value:function(){return y.default.createElement(C.default,{transitionName:"bulk-actions",transitionEnterTimeout:R.default.CSS_TRANSITION_TIME,transitionLeaveTimeout:R.default.CSS_TRANSITION_TIME},this.renderBulkActions())}},{key:"renderBulkActions",value:function(){var e=this,t="select"===this.props.type?function(e){return"insert"===e.value}:function(e){return"insert"!==e.value},o=R.default.BULK_ACTIONS.filter(t).map(function(t){if(t.callback)return t;switch(t.value){case"delete":return u({},t,{callback:e.handleBulkDelete});case"edit":return u({},t,{callback:e.handleBulkEdit});case"move":return u({},t,{callback:e.handleBulkMove});case"publish":return u({},t,{callback:e.handleBulkPublish});case"unpublish":return u({},t,{callback:e.handleBulkUnpublish});case"insert":return u({},t,{callback:e.handleBulkInsert});default:return t}}),n=this.props.selectedFiles.map(function(t){return e.props.files.find(function(e){return e&&t===e.id})}).filter(function(e){return e});return n.length>0&&["admin","select"].includes(this.props.type)?y.default.createElement(I.default,{actions:o,items:n,total:this.props.maxFilesSelect,key:n.length>0,container:this.gallery,showCount:1!==this.props.maxFilesSelect}):null}},{key:"renderGalleryView",value:function(){var e=this,t="table"===this.props.view?k.default:x.default,o=this.props.files.map(function(t){return u({},t,{selected:e.itemIsSelected(t.id),highlighted:e.itemIsHighlighted(t.id)})}),n=this.props,r=n.type,s=n.loading,l=n.page,i=n.totalCount,a=n.limit,d=n.sort,c=n.selectedFiles,p=n.badges,f={selectableItems:["admin","select"].includes(r),selectableFolders:"select"!==this.props.type,files:o,loading:s,page:l,totalCount:i,limit:a,sort:d,selectedFiles:c,badges:p,onSort:this.handleSort,onSetPage:this.handleSetPage,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSelect:this.handleSelect,onCancelUpload:this.handleCancelUpload,onDropFiles:this.handleMoveFiles,onRemoveErroredUpload:this.handleRemoveErroredUpload,onEnableDropzone:this.handleEnableDropzone,sectionConfig:this.props.sectionConfig,canDrag:"admin"===this.props.type,maxFilesSelect:this.props.maxFilesSelect};return y.default.createElement(t,f)}},{key:"renderToolbar",value:function(){var e=this.props,t=e.GalleryToolbar,o=e.sort,n=e.view,r=e.folder,s=e.onCreateFolder,l=e.onOpenFolder,i=e.onViewChange,a={onMoveFiles:this.handleMoveFiles,onSort:this.handleSort,onCreateFolder:s,onOpenFolder:l,onViewChange:i,view:n,sort:o,folder:r};return y.default.createElement(t,a)}},{key:"render",value:function(){var e=this,t=this.props,o=t.folder,n=t.loading,r=t.errorMessage,s=t.graphQLErrors,l=t.noticeMessage,i=s&&s.length>0;if(!o)return r||i?y.default.createElement("div",{className:"gallery__error flexbox-area-grow"},y.default.createElement("div",{className:"gallery__error-message"},y.default.createElement("h3",null,g.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error.")),r&&y.default.createElement("p",null,r),i&&s.map(function(e,t){return y.default.createElement("p",{key:t},e)}))):n?y.default.createElement("div",{className:"flexbox-area-grow"},y.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),y.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})):y.default.createElement("div",{className:"flexbox-area-grow"},y.default.createElement("div",{className:"editor__file-preview-message--file-missing m-t-3"},g.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")));var a=y.default.createElement("div",{className:"gallery_messages"},r&&y.default.createElement(M.default,{value:r,type:"danger"}),l&&y.default.createElement(M.default,{value:l,type:"success"})),d={height:R.default.THUMBNAIL_HEIGHT,width:R.default.THUMBNAIL_WIDTH},c=u({url:this.props.createFileApiUrl,method:this.props.createFileApiMethod,paramName:"Upload",clickable:"#upload-button"},this.props.sectionConfig.dropzoneOptions),p=this.props.securityId,f=this.props.folder.canEdit&&this.props.enableDropzone,h=["panel","panel--padded","panel--scrollable","gallery__main","fill-height"];"insert"===this.props.type&&h.push("insert-media-modal__main");var m=h;return this.hasOpenedItem()&&m.push("gallery__main--has-opened-item"),y.default.createElement("div",{className:"flexbox-area-grow gallery__outer",ref:function(t){e.gallery=t}},this.renderTransitionBulkActions(),y.default.createElement(Q.default,{className:h.join(" ")},this.renderToolbar(),y.default.createElement(W.SelectableGroup,{enabled:"tile"===this.props.view&&"admin"===this.props.type,className:"flexbox-area-grow fill-height gallery__main--selectable",onSelection:this.handleGroupSelect,onNonItemClick:this.handleClearSelection,preventDefault:!1,fixedPosition:!0},y.default.createElement(O.default,{name:"gallery-container",className:"flexbox-area-grow",canUpload:f,onAddedFile:this.handleAddedFile,onPreviewLoaded:this.handlePreviewLoaded,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:d,folderId:this.props.folderId,options:c,securityID:p,uploadButton:!1},a,this.renderGalleryView()))),this.props.loading&&[y.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),y.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})],y.default.createElement(Z.default,{sectionConfig:this.props.sectionConfig,folderId:this.props.folderId,onSuccess:this.props.onMoveFilesSuccess,onOpenFolder:this.props.onOpenFolder}))}}]),t}(_.Component),te={page:1,limit:15},oe={sectionConfig:Y.default,loading:_.PropTypes.bool,sort:_.PropTypes.string,files:_.PropTypes.arrayOf(_.PropTypes.shape({id:_.PropTypes.number,parent:_.PropTypes.shape({id:_.PropTypes.number})})).isRequired,selectedFiles:_.PropTypes.arrayOf(_.PropTypes.number),totalCount:_.PropTypes.number,page:_.PropTypes.number,limit:_.PropTypes.number,badges:_.PropTypes.arrayOf(_.PropTypes.shape({id:_.PropTypes.number,message:_.PropTypes.node,status:_.PropTypes.string})),onOpenFile:_.PropTypes.func.isRequired,onOpenFolder:_.PropTypes.func.isRequired,onSort:_.PropTypes.func.isRequired,onSetPage:_.PropTypes.func.isRequired,maxFilesSelect:_.PropTypes.number},ne=Object.assign({},te,{selectableItems:!1}),re=Object.assign({},oe,{selectableItems:_.PropTypes.bool,selectableFolders:_.PropTypes.bool,onSelect:_.PropTypes.func,onCancelUpload:_.PropTypes.func,onDelete:y.default.PropTypes.func,onRemoveErroredUpload:_.PropTypes.func,onEnableDropzone:_.PropTypes.func});ee.defaultProps=Object.assign({},te,{type:"admin",view:"tile",enableDropzone:!0}),ee.propTypes=Object.assign({},oe,{onUploadSuccess:y.default.PropTypes.func,onCreateFolder:y.default.PropTypes.func,onMoveFilesSuccess:y.default.PropTypes.func,onDelete:y.default.PropTypes.func,onPublish:y.default.PropTypes.func,onUnpublish:y.default.PropTypes.func,type:_.PropTypes.oneOf(["insert-media","insert-link","select","admin"]),view:_.PropTypes.oneOf(["tile","table"]),lastSelected:_.PropTypes.number,dialog:_.PropTypes.bool,fileId:_.PropTypes.number,folderId:_.PropTypes.number.isRequired,folder:_.PropTypes.shape({id:_.PropTypes.number,title:_.PropTypes.string,parentId:_.PropTypes.number,canView:_.PropTypes.bool,canEdit:_.PropTypes.bool}),files:_.PropTypes.array,errorMessage:_.PropTypes.string,graphQLErrors:_.PropTypes.arrayOf(_.PropTypes.string),actions:_.PropTypes.object,securityId:_.PropTypes.string,onViewChange:_.PropTypes.func.isRequired,createFileApiUrl:_.PropTypes.string,createFileApiMethod:_.PropTypes.string,search:_.PropTypes.object,enableDropzone:_.PropTypes.bool,concatenateSelect:_.PropTypes.bool,GalleryToolbar:_.PropTypes.func,sorters:_.PropTypes.arrayOf(_.PropTypes.shape({field:_.PropTypes.string.isRequired,direction:_.PropTypes.oneOf(["asc","desc"]).isRequired,label:_.PropTypes.string.isRequired})).isRequired}),t.Component=ee,t.galleryViewPropTypes=re,t.galleryViewDefaultProps=ne,t.default=(0,w.compose)((0,J.inject)(["GalleryToolbar"],null,function(){return"AssetAdmin.Gallery"}),(0,P.connect)(a,d),z.default,function(e){return(0,V.withApollo)(e)})(ee)},"./client/src/containers/Gallery/GalleryDND.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o1&&void 0!==arguments[1])||arguments[1];return h.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:g.default.get("SecurityID")}}:{}))},j=function(e){function t(e){r(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.state={detailView:null,history:[],loadedDetails:!1},o.handleClick=o.handleClick.bind(o),o.handleBack=o.handleBack.bind(o),o.timer=null,o.api=S(e.sectionConfig.historyEndpoint),o}return l(t,e),d(t,[{key:"componentDidMount",value:function(){this.refreshHistoryIfNeeded()}},{key:"componentWillReceiveProps",value:function(e){this.refreshHistoryIfNeeded(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timer),this.timer=null}},{key:"refreshHistoryIfNeeded",value:function(e){var t=this;if(!e&&!this.state.loadedDetails||e.data.fileId!==this.props.data.fileId||e.data.latestVersionId!==this.props.data.latestVersionId){this.setState({loadedDetails:!1});var o=e?e.data.fileId:this.props.data.fileId;clearTimeout(this.timer),this.timer=setTimeout(function(){t.api({fileId:o}).then(function(e){t.timer&&t.setState({history:e,loadedDetails:!0})})},250)}}},{key:"handleClick",value:function(e){this.setState({viewDetails:e})}},{key:"handleBack",value:function(e){e.preventDefault(),this.setState({viewDetails:null})}},{key:"render",value:function(){var e=this;if(!this.state.loadedDetails)return c.default.createElement("div",{className:"history-list history-list--loading"},"Loading...");if(this.state.viewDetails){var t=[this.props.historySchemaUrl,this.props.data.fileId,this.state.viewDetails].join("/"),o=["btn","btn-secondary","btn--icon-xl","btn--no-text","font-icon-left-open-big","history-list__back"].join(" ");return c.default.createElement("div",{className:"history-list"},c.default.createElement("a",{href:"#",className:o,onClick:this.handleBack}),c.default.createElement(b.default,{identifier:"AssetAdmin.HistoryList",schemaUrl:t}))}var n=this.state.history||[];return c.default.createElement("div",{className:"history-list"},c.default.createElement("ul",{className:"list-group list-group-flush history-list__list"},n.map(function(t){return c.default.createElement(y.default,a({key:t.versionid},t,{onClick:e.handleClick}))})))}}]),t}(u.Component);j.propTypes={sectionConfig:c.default.PropTypes.shape({form:c.default.PropTypes.object,historyEndpoint:c.default.PropTypes.shape({url:c.default.PropTypes.string,method:c.default.PropTypes.string,responseFormat:c.default.PropTypes.string})}),historySchemaUrl:c.default.PropTypes.string,data:c.default.PropTypes.object},j.defaultProps={data:{fieldId:0}},t.Component=j,t.default=(0,p.connect)(i)(j)},"./client/src/containers/MoveModal/MoveModal.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){var t=e.assetAdmin.gallery,o=t.modal,n=t.selectedFiles;return{isOpen:o===_.default.MODAL_MOVE,selectedFiles:n,title:m.default.sprintf(m.default._t("AssetAdmin.MOVE_ITEMS_TO","Move %s item(s) to..."),n.length)}}function a(e){return{onClosed:function(){e((0,y.deactivateModal)())},setNotice:function(t){e((0,y.setNoticeMessage)(t))},setError:function(t){e((0,y.setErrorMessage)(t))},setBadge:function(){e(y.setFileBadge.apply(void 0,arguments))}}}Object.defineProperty(t,"__esModule",{value:!0});var d=function(){function e(e,t){for(var o=0;o0)return c.default.createElement("div",{className:"gallery__progress-bar--complete"});var t={className:"gallery__progress-bar-progress",style:{width:e.progress+"%"}};return c.default.createElement("div",{className:"gallery__progress-bar"},c.default.createElement("div",t))}},{key:"renderTitle",value:function(e){var t=this.renderProgressBar(e.rowData);return c.default.createElement("div",{className:"fill-width"},c.default.createElement("div",{className:"flexbox-area-grow"},e.data),t)}},{key:"renderSelect",value:function(e){if(this.props.selectableItems&&(this.props.selectableFolders||"folder"!==e.rowData.type)){var t={type:"checkbox",title:m.default._t("AssetAdmin.SELECT"),checked:e.data,tabIndex:-1,onMouseDown:this.preventFocus};return![null,1].includes(this.props.maxFilesSelect)&&this.props.selectedFiles.length>=this.props.maxFilesSelect&&!e.data&&(t.disabled=!0),c.default.createElement("input",t)}return null}},{key:"renderDate",value:function(e){return"folder"===e.rowData.type?null:c.default.createElement("span",null,e.data)}},{key:"renderThumbnail",value:function(e){var t=e.data||e.rowData.url,o=e.rowData.queuedId&&!e.rowData.id,n=e.rowData.category||"false",r="gallery__table-image",s=[r],l={};return s.push(r+"--"+n),"image"===n&&t&&(l.backgroundImage='url("'+t+'")'),o||t||"folder"===n||s.push(r+"--error"),c.default.createElement("div",{className:s.join(" "),style:l})}},{key:"render",value:function(){return c.default.createElement(f.default,this.getTableProps())}}]),t}(u.Component);y.defaultProps=g.galleryViewDefaultProps,y.propTypes=i({},g.galleryViewPropTypes,{sort:u.PropTypes.string.isRequired}),t.Component=y,t.default=y},"./client/src/containers/ThumbnailView/ThumbnailView.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var i=Object.assign||function(e){for(var t=1;t=this.props.maxFilesSelect,b=1===this.props.maxFilesSelect?c.onActivate:this.props.onSelect;c=i({},c,{selectable:!0,onSelect:b,maxSelected:v})}if("folder"===e.type){var E=this.props.onDropFiles;return c=i({},c,{onDropFiles:E}),p.default.createElement(n,c)}return p.default.createElement(o,c)}},{key:"render",value:function(){return p.default.createElement("div",{className:"gallery__main-view--tile"},p.default.createElement("div",{className:"gallery__folders"},this.props.files.filter(this.folderFilter).map(this.renderItem)),p.default.createElement("div",{className:"gallery__files"},this.props.files.filter(this.fileFilter).map(this.renderItem)),0===this.props.files.length&&!this.props.loading&&p.default.createElement("p",{className:"gallery__no-item-notice"},u.default._t("AssetAdmin.NOITEMSFOUND")),p.default.createElement("div",{className:"gallery__load"},this.renderPagination()))}}]),t}(c.Component);_.defaultProps=h.galleryViewDefaultProps,_.propTypes=i({},h.galleryViewPropTypes,{File:c.PropTypes.oneOfType([c.PropTypes.node,c.PropTypes.func]).isRequired,Folder:c.PropTypes.oneOfType([c.PropTypes.node,c.PropTypes.func]).isRequired});var y=(0,f.inject)(["GalleryItemFile","GalleryItemFolder"],function(e,t){return{File:e,Folder:t}},function(){return"AssetAdmin.Gallery.ThumbnailView"});t.Component=_,t.default=y(_)},"./client/src/entwine/UploadField/UploadFieldEntwine.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var r=Object.assign||function(e){for(var t=1;t
');this.before(o),t=o[0]}return t},onunmatch:function(){this._super(),u.default.unmountComponentAtNode(this.siblings(".uploadfield-holder")[0])},onmatch:function(){var e=this.closest(".cms-content").attr("id"),t=e?{context:e}:{},o=(0,p.loadComponent)("UploadField",t);this.setComponent(o),this._super(),this.hide(),this.refresh()},onclick:function(e){e.preventDefault()},refresh:function(){var t=this.getAttributes(),o=e(this).closest("form"),n=function(){setTimeout(function(){o.trigger("change")},0)},s=this.getComponent();u.default.render(a.default.createElement(s,r({},t,{onChange:n,noHolder:!0})),this.getContainer())},getAttributes:function(){var t=e(this).data("state"),o=e(this).data("schema");return(0,c.schemaMerge)(o,t)}})})},"./client/src/lib/configShape.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(0),r=n.PropTypes.shape({url:n.PropTypes.string,limit:n.PropTypes.number,imageRetry:n.PropTypes.shape({minRetry:n.PropTypes.number,maxRetry:n.PropTypes.number,expiry:n.PropTypes.number}),form:n.PropTypes.object,dropzoneOptions:n.PropTypes.object});t.default=r},"./client/src/lib/fileFragments.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileInterface="\n fragment FileInterfaceFields on FileInterface {\n canDelete\n canEdit\n canView\n category\n exists\n filename\n id\n lastEdited\n name\n parentId\n title\n type\n url\n }\n",t.file="\n fragment FileFields on File {\n draft\n extension\n published\n modified\n size\n smallThumbnail\n thumbnail\n inUseCount\n }\n",t.folder="\n fragment FolderFields on Folder {\n filesInUseCount\n }\n"},"./client/src/lib/fileShape.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(0),r=n.PropTypes.shape({canEdit:n.PropTypes.bool,canDelete:n.PropTypes.bool,canView:n.PropTypes.bool,exists:n.PropTypes.bool,type:n.PropTypes.string,smallThumbnail:n.PropTypes.string,thumbnail:n.PropTypes.string,width:n.PropTypes.number,height:n.PropTypes.number,category:n.PropTypes.oneOfType([n.PropTypes.bool,n.PropTypes.string]),id:n.PropTypes.number,inUseCount:n.PropTypes.number,url:n.PropTypes.string,title:n.PropTypes.string,progress:n.PropTypes.number});t.default=r},"./client/src/lib/fileStructure.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(13),r=function(e){return e&&e.__esModule?e:{default:e}}(n),s=(0,r.default)({name:null,canDelete:!1,canEdit:!1,category:null,created:null,extension:null,filename:null,id:0,lastEdited:null,messages:null,owner:{id:0,title:null},parent:{filename:null,id:0,title:null},queuedId:null,size:null,title:null,type:null,url:null,xhr:null,thumbnail:null,smallThumbnail:null,height:null,width:null});t.default=s},"./client/src/state/displaySearch/DisplaySearchActionTypes.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={TOGGLE_SEARCH:"TOGGLE_SEARCH",OPEN_SEARCH:"OPEN_SEARCH",CLOSE_SEARCH:"CLOSE_SEARCH"}},"./client/src/state/displaySearch/DisplaySearchActions.js":function(e,t,o){"use strict";function n(){return{type:i.default.TOGGLE_SEARCH,payload:null}}function r(){return{type:i.default.OPEN_SEARCH,payload:null}}function s(){return{type:i.default.CLOSE_SEARCH,payload:null}}Object.defineProperty(t,"__esModule",{value:!0}),t.toggleSearch=n,t.openSearch=r,t.closeSearch=s;var l=o("./client/src/state/displaySearch/DisplaySearchActionTypes.js"),i=function(e){return e&&e.__esModule?e:{default:e}}(l)},"./client/src/state/displaySearch/DisplaySearchReducer.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;switch(arguments[1].type){case d.default.TOGGLE_SEARCH:return(0,i.default)(s({},e,{isOpen:!e.isOpen}));case d.default.OPEN_SEARCH:return(0,i.default)(s({},e,{isOpen:!0}));case d.default.CLOSE_SEARCH:return(0,i.default)(s({},e,{isOpen:!1}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return o({variables:{IDs:e,Quiet:n,Force:t}})};return{actions:r({},s,{files:r({},s.files,n({},e,l))})}}}}};t.default=d},"./client/src/state/files/deleteFilesMutation.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.mutation=void 0;var n=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t({type:y.default.SELECT_FILES,payload:{ids:e}})}}function i(e){return function(t){return t({type:y.default.CONCATENATE_SELECT,payload:!!e})}}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t({type:y.default.DESELECT_FILES,payload:{ids:e}})}}function d(e){return function(t){return t({type:y.default.SET_NOTICE_MESSAGE,payload:{message:e}})}}function u(e){return function(t){return t({type:y.default.SET_ERROR_MESSAGE,payload:{message:e}})}}function c(e){return function(t){return t({type:y.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})}}function p(e){return function(t){t({type:y.default.CLEAR_FILE_BADGE,payload:{id:e}})}}function f(e,t,o,n){return function(r,s){var l=s(),i=l.assetAdmin,a=i.gallery.badges.find(function(t){return t.id===e});a&&a.timer&&clearTimeout(a.timer);var d=n>0?setTimeout(function(){return p(e)(r)},n):null;r({type:y.default.SET_FILE_BADGE,payload:{id:e,message:t,status:o,timer:d}})}}function h(e){return function(t){t({type:y.default.ACTIVATE_MODAL,payload:e})}}function m(){return function(e){e({type:y.default.DEACTIVATE_MODAL})}}function g(e){return function(t){t({type:y.default.SET_LOADING,payload:!!e})}}Object.defineProperty(t,"__esModule",{value:!0}),t.setLastSelected=n,t.setSelectedFiles=r,t.loadFile=s,t.selectFiles=l,t.setConcatenateSelect=i,t.deselectFiles=a,t.setNoticeMessage=d,t.setErrorMessage=u,t.setEnableDropzone=c,t.clearFileBadge=p,t.setFileBadge=f,t.activateModal=h,t.deactivateModal=m,t.setLoading=g;var _=o("./client/src/state/gallery/GalleryActionTypes.js"),y=function(e){return e&&e.__esModule?e:{default:e}}(_)},"./client/src/state/gallery/GalleryReducer.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.type,n=t.payload;switch(o){case d.default.SET_LAST_SELECTED:return s({},e,{lastSelected:n.id});case d.default.SET_FILE_BADGE:return s({},e,{badges:e.badges.filter(function(e){return e.id!==n.id}).concat([n])});case d.default.CLEAR_FILE_BADGE:return s({},e,{badges:e.badges.filter(function(e){return e.id!==n.id})});case d.default.SET_ENABLE_DROPZONE:return s({},e,{enableDropzone:n.enableDropzone});case d.default.SET_NOTICE_MESSAGE:return s({},e,{noticeMessage:n.message});case d.default.SET_ERROR_MESSAGE:return s({},e,{errorMessage:n.message});case d.default.LOAD_FILE_SUCCESS:var r=e.files.find(function(e){return e.id===n.id});if(r){var l=s({},r,n.file);return(0,i.default)(s({},e,{files:e.files.map(function(e){return e.id===l.id?l:e})}))}return e.folder.id===n.id?(0,i.default)(s({},e,{folder:s({},e.folder,n.file)})):e;case d.default.SET_SELECTED_FILES:return(0,i.default)(s({},e,{selectedFiles:Array.isArray(n.files)?n.files:[]}));case d.default.SELECT_FILES:var a=null;return a=null===n.ids?e.files.map(function(e){return e.id}):e.selectedFiles.concat(n.ids.filter(function(t){return-1===e.selectedFiles.indexOf(t)})),(0,i.default)(s({},e,{selectedFiles:a}));case d.default.DESELECT_FILES:var u=null;return u=null===n.ids?[]:e.selectedFiles.filter(function(e){return-1===n.ids.indexOf(e)}),(0,i.default)(s({},e,{selectedFiles:u}));case d.default.ACTIVATE_MODAL:return(0,i.default)(s({},e,{modal:n}));case d.default.DEACTIVATE_MODAL:return(0,i.default)(s({},e,{modal:null}));case d.default.CONCATENATE_SELECT:return(0,i.default)(s({},e,{concatenateSelect:n}));case d.default.SET_LOADING:return(0,i.default)(s({},e,{loading:n}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:p;r(this,e),this.options=s({},c,t),this.factory=o}return l(e,[{key:"loadImage",value:function(e){return this.options.minRetry&&u.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}},{key:"loadImageLoop",value:function(e,t){var o=this;return this.options.onStatusChange(e,a.default.LOADING),new Promise(function(t,n){return o.factory(e,t,n)}).then(function(){return o.handleSuccess(e)}).catch(function(){return o.handleError(e,t)})}},{key:"handleReset",value:function(e,t){this.options.onReset(e),t()}},{key:"handleTimeout",value:function(e,t){var o=setTimeout(e,t);return this.options.onTimeout(o,t),o}},{key:"handleSuccess",value:function(e){u.default.unlock(e),this.options.onStatusChange(e,a.default.SUCCESS)}},{key:"handleFailure",value:function(e){var t=this;return u.default.unlock(e),this.options.onStatusChange(e,a.default.FAILED),this.options.expiry?new Promise(function(o){t.handleTimeout(function(){return t.handleReset(e,o)},1e3*t.options.expiry)}):null}},{key:"handleError",value:function(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,a.default.WAITING),this.handleRetry(e,t))}},{key:"handleRetry",value:function(e,t){var o=this,n=new Promise(function(n){o.handleTimeout(function(){return n(o.loadImageLoop(e,2*t))},1e3*t)});return this.options.onRetry(e,t,n),n}},{key:"setOnRetry",value:function(e){this.options.onRetry=e}},{key:"setOnReset",value:function(e){this.options.onReset=e}},{key:"setOnStatusChange",value:function(e){this.options.onStatusChange=e}},{key:"setOnTimeout",value:function(e){this.options.onTimeout=e}}]),e}();t.defaultImageFactory=p,t.default=f},"./client/src/state/imageLoad/ImageLoadActionTypes.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={SET_STATUS:"IMAGE_LOAD_SET_STATUS",RESET:"IMAGE_LOAD_RESET"}},"./client/src/state/imageLoad/ImageLoadActions.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){return function(o,n){if(!e)return null;if(n().assetAdmin.imageLoad.files.find(function(t){return t.url===e}))return null;var r=s({},t,{onStatusChange:function(e,t){return o({type:i.default.SET_STATUS,payload:{status:t,url:e}})},onReset:function(e){return o({type:i.default.RESET,payload:{url:e}})}});return new d.default(r).loadImage(e)}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t=0||(this.urls=[].concat(n(this.urls),[e]),0))}},{key:"unlock",value:function(e){this.urls=this.urls.filter(function(t){return t!==e})}}]),e}();window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new l,t.Component=l,t.default=window.ss.imagelocker},"./client/src/state/imageLoad/ImageLoadReducer.js":function(e,t,o){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.type,r=t.payload;switch(o){case i.default.SET_STATUS:return s({},e,{files:[].concat(n(e.files.filter(function(e){return e.url!==r.url})),[r])});case i.default.RESET:return s({},e,{files:[].concat(n(e.files.filter(function(e){return e.url!==r.url})))});default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments[1];switch(t.type){case d.default.PREVIEWFIELD_ADD_FILE:return(0,i.default)(Object.assign({},e,r({},t.payload.id,t.payload.file)));case d.default.PREVIEWFIELD_FAIL_UPLOAD:return(0,i.default)(Object.assign({},e,r({},t.payload.id,Object.assign({},e[t.payload.id],t.payload.message))));case d.default.PREVIEWFIELD_REMOVE_FILE:return(0,i.default)(Object.assign({},e,r({},t.payload.id,void 0)));case d.default.PREVIEWFIELD_UPDATE_FILE:return(0,i.default)(Object.assign({},e,r({},t.payload.id,Object.assign({},e[t.payload.id],t.payload.data))));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=o(13),i=n(l),a=o("./client/src/state/previewField/PreviewFieldActionTypes.js"),d=n(a),u={};t.default=s},"./client/src/state/queuedFiles/QueuedFilesActionTypes.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={ADD_QUEUED_FILE:"ADD_QUEUED_FILE",FAIL_UPLOAD:"FAIL_UPLOAD",PURGE_UPLOAD_QUEUE:"PURGE_UPLOAD_QUEUE",REMOVE_QUEUED_FILE:"REMOVE_QUEUED_FILE",SUCCEED_UPLOAD:"SUCCEED_UPLOAD",UPDATE_QUEUED_FILE:"UPDATE_QUEUED_FILE"}},"./client/src/state/queuedFiles/QueuedFilesActions.js":function(e,t,o){"use strict";function n(e){return function(t){return t({type:u.default.ADD_QUEUED_FILE,payload:{file:e}})}}function r(e,t){return function(o){var n=t.message;return t.errors&&t.errors.length&&(n=t.errors[0]),"string"==typeof t&&(n={value:t,type:"error"}),o({type:u.default.FAIL_UPLOAD,payload:{queuedId:e,message:n}})}}function s(){return function(e){return e({type:u.default.PURGE_UPLOAD_QUEUE,payload:null})}}function l(e){return function(t){return t({type:u.default.REMOVE_QUEUED_FILE,payload:{queuedId:e}})}}function i(e,t){return function(o){return o({type:u.default.SUCCEED_UPLOAD,payload:{queuedId:e,json:t}})}}function a(e,t){return function(o){return o({type:u.default.UPDATE_QUEUED_FILE,payload:{queuedId:e,updates:t}})}}Object.defineProperty(t,"__esModule",{value:!0}),t.addQueuedFile=n,t.failUpload=r,t.purgeUploadQueue=s,t.removeQueuedFile=l,t.succeedUpload=i,t.updateQueuedFile=a;var d=o("./client/src/state/queuedFiles/QueuedFilesActionTypes.js"),u=function(e){return e&&e.__esModule?e:{default:e}}(d)},"./client/src/state/queuedFiles/QueuedFilesReducer.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:m,t=arguments[1];switch(t.type){case u.default.ADD_QUEUED_FILE:return(0,a.default)(l({},e,{items:[].concat(r(e.items),[l({},p.default,t.payload.file)])}));case u.default.FAIL_UPLOAD:return(0,a.default)(l({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?l({},e,{message:t.payload.message}):e})}));case u.default.PURGE_UPLOAD_QUEUE:return(0,a.default)(l({},e,{items:e.items.filter(function(e){return!e.id})}));case u.default.REMOVE_QUEUED_FILE:return(0,a.default)(l({},e,{items:e.items.filter(function(e){return e.queuedId!==t.payload.queuedId})}));case u.default.SUCCEED_UPLOAD:return(0,a.default)(l({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?l({},e,t.payload.json,{messages:[{value:h.default._t("AssetAdmin.DROPZONE_SUCCESS_UPLOAD"),type:"success",extraClass:"success"}]}):e})}));case u.default.UPDATE_QUEUED_FILE:return(0,a.default)(l({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?l({},e,t.payload.updates):e})}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:f,t=arguments[1],o=(0,p.default)(e,t,h);switch(t.type){case a.default.UPLOADFIELD_ADD_FILE:return o(function(e){return e.files.find(function(e){return e.id===t.payload.file.id})?e:l({},e,{files:[].concat(r(e.files),[l({},u.default,t.payload.file)])})});case a.default.UPLOADFIELD_SET_FILES:return o(function(){return{files:t.payload.files}});case a.default.UPLOADFIELD_UPLOAD_FAILURE:return o(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,{message:t.payload.message}):e})}});case a.default.UPLOADFIELD_REMOVE_FILE:return o(function(e){return{files:e.files.filter(function(e){return!(t.payload.file.queuedId&&e.queuedId===t.payload.file.queuedId||t.payload.file.id&&e.id===t.payload.file.id)})}});case a.default.UPLOADFIELD_UPLOAD_SUCCESS:return o(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.json):e})}});case a.default.UPLOADFIELD_UPDATE_QUEUED_FILE:return o(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.updates):e})}});default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t0?s.default._t("AssetAdmin.UPDATE_FILE","Update file"):s.default._t("AssetAdmin.INSERT_FILE","Insert file");return e.mutateField("action_insert",function(e){return n({},e,{title:r||e.title})}),e.getState()};t.default=l},"./client/src/transforms/FormAction/ownerAwareUnpublish.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0?[a.default.inject(a.default._t("AssetAdmin.SINGLE_OWNED_WARNING_1","This file is being used in {count} other published section(s)."),{count:r}),a.default._t("AssetAdmin.SINGLE_OWNED_WARNING_2","Ensure files are removed from content areas prior to unpublishing them. Otherwise, they will appear as broken links."),a.default._t("AssetAdmin.SINGLE_OWNED_WARNING_3","Do you want to unpublish this file anyway?")].join("\n\n"):a.default._t("AssetAdmin.CONFIRMUNPUBLISH","Are you sure you want to unpublish this record?"),confirm(s)?o(e,n):e.preventDefault()}});return l.default.createElement(e,n)}};t.default=d},"./client/src/transforms/TreeDropdownField/moveTreeDropdownField.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disabledTreeDropdownField=void 0;var n=Object.assign||function(e){for(var t=1;t
'),this.element.appendChild(o)),n=o.getElementsByTagName("span")[0],n&&(null!=n.textContent?n.textContent=this.options.dictFallbackMessage:null!=n.innerText&&(n.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e){var t,o,n;return t={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height,t.optWidth=this.options.thumbnailWidth,t.optHeight=this.options.thumbnailHeight,null==t.optWidth&&null==t.optHeight?(t.optWidth=t.srcWidth,t.optHeight=t.srcHeight):null==t.optWidth?t.optWidth=o*t.optHeight:null==t.optHeight&&(t.optHeight=1/o*t.optWidth),n=t.optWidth/t.optHeight,e.heightn?(t.srcHeight=e.height,t.srcWidth=t.srcHeight*n):(t.srcWidth=e.width,t.srcHeight=t.srcWidth/n),t.srcX=(e.width-t.srcWidth)/2,t.srcY=(e.height-t.srcHeight)/2,t},drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:a,dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:a,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var o,n,r,s,l,i,a,d,u,c,p,f,h;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(e.previewElement=t.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),c=e.previewElement.querySelectorAll("[data-dz-name]"),s=0,a=c.length;s'+this.options.dictRemoveFile+"
"),e.previewElement.appendChild(e._removeLink)),n=function(o){return function(n){return n.preventDefault(),n.stopPropagation(),e.status===t.UPLOADING?t.confirm(o.options.dictCancelUploadConfirmation,function(){return o.removeFile(e)}):o.options.dictRemoveFileConfirmation?t.confirm(o.options.dictRemoveFileConfirmation,function(){return o.removeFile(e)}):o.removeFile(e)}}(this),f=e.previewElement.querySelectorAll("[data-dz-remove]"),h=[],i=0,u=f.length;i\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n
'},o=function(){var e,t,o,n,r,s,l;for(n=arguments[0],o=2<=arguments.length?u.call(arguments,1):[],s=0,l=o.length;s'+this.options.dictDefaultMessage+"
")),this.clickableElements.length&&(n=function(e){return function(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null==e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!=e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!=e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.querySelector(e.options.hiddenInputContainer).appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var t,o,r,s;if(o=e.hiddenFileInput.files,o.length)for(r=0,s=o.length;r',this.options.dictFallbackText&&(n+="

"+this.options.dictFallbackText+"

"),n+='
',o=t.createElement(n),"FORM"!==this.element.tagName?(r=t.createElement('
'),r.appendChild(o)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=r?r:o)},t.prototype.getExistingFallback=function(){var e,t,o,n,r,s;for(t=function(e){var t,o,n;for(o=0,n=e.length;o0){for(l=["TB","GB","MB","KB","b"],o=i=0,a=l.length;i=t){n=e/Math.pow(this.options.filesizeBase,4-o),r=s;break}n=Math.round(10*n)/10}return""+n+" "+r},t.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},t.prototype.drop=function(e){var t,o;e.dataTransfer&&(this.emit("drop",e),t=e.dataTransfer.files,this.emit("addedfiles",t),t.length&&(o=e.dataTransfer.items,o&&o.length&&null!=o[0].webkitGetAsEntry?this._addFilesFromItems(o):this.handleFiles(t)))},t.prototype.paste=function(e){var t,o;if(null!=(null!=e&&null!=(o=e.clipboardData)?o.items:void 0))return this.emit("paste",e),t=e.clipboardData.items,t.length?this._addFilesFromItems(t):void 0},t.prototype.handleFiles=function(e){var t,o,n,r;for(r=[],o=0,n=e.length;o0){for(s=0,l=o.length;s1024*this.options.maxFilesize*1024?o(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):t.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(o(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,o):o(this.options.dictInvalidFileType)},t.prototype.addFile=function(e){return e.upload={progress:0,total:e.size,bytesSent:0},this.files.push(e),e.status=t.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(t){return function(o){return o?(e.accepted=!1,t._errorProcessing([e],o)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()}}(this))},t.prototype.enqueueFiles=function(e){var t,o,n;for(o=0,n=e.length;o=t)&&(n=this.getQueuedFiles(),n.length>0)){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,t-o));for(;e=L;u=0<=L?++A:--A)s.append(this._getParamName(u),e[u],this._renameFilename(e[u].name));return this.submitRequest(S,s,e)},t.prototype.submitRequest=function(e,t,o){return e.send(t)},t.prototype._finished=function(e,o,n){var r,s,l;for(s=0,l=e.length;sd;)t=r[4*(i-1)+3],0===t?s=i:d=i,i=s+d>>1;return a=i/l,0===a?1:a},i=function(e,t,o,n,r,s,i,a,d,u){var c;return c=l(t),e.drawImage(t,o,n,r,s,i,a,d,u/c)},s=function(e,t){var o,n,r,s,l,i,a,d,u;if(r=!1,u=!0,n=e.document,d=n.documentElement,o=n.addEventListener?"addEventListener":"attachEvent",a=n.addEventListener?"removeEventListener":"detachEvent",i=n.addEventListener?"":"on",s=function(o){if("readystatechange"!==o.type||"complete"===n.readyState)return("load"===o.type?e:n)[a](i+o.type,s,!1),!r&&(r=!0)?t.call(e,o.type||o):void 0},l=function(){try{d.doScroll("left")}catch(e){return void setTimeout(l,50)}return s("poll")},"complete"!==n.readyState){if(n.createEventObject&&d.doScroll){try{u=!e.frameElement}catch(e){}u&&l()}return n[o](i+"DOMContentLoaded",s,!1),n[o](i+"readystatechange",s,!1),e[o](i+"load",s,!1)}},o._autoDiscoverFunction=function(){if(o.autoDiscover)return o.discover()},s(window,o._autoDiscoverFunction)}).call(this)}).call(t,o(6),o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/expose-loader/index.js?InsertEmbedModal!./client/src/components/InsertEmbedModal/InsertEmbedModal.js-exposed":function(e,t,o){(function(t){e.exports=t.InsertEmbedModal=o('./node_modules/babel-loader/lib/index.js?{"presets":[["env",{"modules":false}],"react"],"plugins":["transform-object-rest-spread"],"comments":false,"cacheDirectory":false}!./client/src/components/InsertEmbedModal/InsertEmbedModal.js')}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/expose-loader/index.js?InsertMediaModal!./client/src/containers/InsertMediaModal/InsertMediaModal.js-exposed":function(e,t,o){(function(t){e.exports=t.InsertMediaModal=o('./node_modules/babel-loader/lib/index.js?{"presets":[["env",{"modules":false}],"react"],"plugins":["transform-object-rest-spread"],"comments":false,"cacheDirectory":false}!./client/src/containers/InsertMediaModal/InsertMediaModal.js')}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/griddle-react/modules/columnProperties.js":function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0}},{key:"getMetadataColumnProperty",value:function(e,t,o){var n=this.getColumnMetadataByName(e);return void 0===n||null===n?o:n.hasOwnProperty(t)?n[t]:o}},{key:"orderColumns",value:function(e){var t=this;return a(e,function(e){var o=i(t.columnMetadata,{columnName:e});return void 0===o||null===o||isNaN(o.order)?100:o.order})}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=d(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=u},"./node_modules/griddle-react/modules/customFilterContainer.jsx.js":function(e,t,o){"use strict";var n=o(0),r=n.createClass({displayName:"CustomFilterContainer",getDefaultProps:function(){return{placeholderText:""}},render:function(){var e=this;return"function"!=typeof e.props.customFilterComponent?(console.log("Couldn't find valid template."),n.createElement("div",null)):n.createElement(e.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=r},"./node_modules/griddle-react/modules/customPaginationContainer.jsx.js":function(e,t,o){"use strict";var n=Object.assign||function(e){for(var t=1;t0&&(e=n.createElement("button",{type:"button",onClick:this.props.previous,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 0 0 10px"}:null},this.props.previousIconComponent,this.props.previousText)),this.props.currentPage!==this.props.maxPage-1&&(t=n.createElement("button",{type:"button",onClick:this.props.next,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 10px 0 0"}:null},this.props.nextText,this.props.nextIconComponent));var o=null,s=null,l=null;if(!0===this.props.useGriddleStyles){var i={float:"left",minHeight:"1px",marginTop:"5px"};l=r({textAlign:"right",width:"34%"},i),s=r({textAlign:"center",width:"33%"},i),o=r({width:"33%"},i)}for(var a=[],d=1;d<=this.props.maxPage;d++)a.push(n.createElement("option",{value:d,key:d},d));return n.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},n.createElement("div",{className:this.props.previousClassName,style:o},e),n.createElement("div",{className:"griddle-page",style:s},n.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},a)," / ",this.props.maxPage),n.createElement("div",{className:this.props.nextClassName,style:l},t))}});e.exports=s},"./node_modules/griddle-react/modules/gridRow.jsx.js":function(e,t,o){"use strict";var n=o(0),r=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/deep.js")),s=o("./node_modules/griddle-react/node_modules/lodash/isFunction.js"),l=o("./node_modules/griddle-react/node_modules/lodash/zipObject.js"),i=o("./node_modules/griddle-react/node_modules/lodash/assign.js"),a=o("./node_modules/griddle-react/node_modules/lodash/defaults.js"),d=o("./node_modules/griddle-react/node_modules/lodash/toPairs.js"),u=o("./node_modules/griddle-react/node_modules/lodash/without.js"),c=n.createClass({displayName:"GridRow",getDefaultProps:function(){return{isChildRow:!1,showChildren:!1,data:{},columnSettings:null,rowSettings:null,hasChildren:!1,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},handleClick:function(e){null!==this.props.onRowClick&&s(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleSelectionChange:function(e){},handleSelectClick:function(e){this.props.multipleSelectionSettings.isMultipleSelection&&("checkbox"===e.target.type?this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,this.refs.selected.checked):this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,!this.refs.selected.checked))},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRow: The columnSettings prop is null and it shouldn't be")},formatData:function(e){return"boolean"==typeof e?String(e):e},render:function(){var e=this;this.verifyProps();var t=this,o=null;this.props.useGriddleStyles&&(o={margin:"0px",padding:t.props.paddingHeight+"px 5px "+t.props.paddingHeight+"px 5px",height:t.props.rowHeight?this.props.rowHeight-2*t.props.paddingHeight+"px":null,backgroundColor:"#FFF",borderTopColor:"#DDD",color:"#222"});var c=this.props.columnSettings.getColumns(),p=l(c,[]),f=i({},this.props.data);a(f,p);var h,m,g=d(r.pick(f,u(c,"children"))),_=g.map(function(t,r){var s=null,l=e.props.columnSettings.getColumnMetadataByName(t[0]),a=0===r&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?n.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===r&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?n.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===r&&e.props.isChildRow&&e.props.useGriddleStyles&&(o=i(o,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&void 0!==l&&null!==l)if(void 0!==l.customComponent&&null!==l.customComponent){var d=n.createElement(l.customComponent,{data:t[1],rowData:f,metadata:l});s=n.createElement("td",{onClick:e.handleClick,className:l.cssClassName,key:r,style:o},d)}else s=n.createElement("td",{onClick:e.handleClick,className:l.cssClassName,key:r,style:o},a,e.formatData(t[1]));return s||n.createElement("td",{onClick:e.handleClick,key:r,style:o},a,t[1])});null!==this.props.onRowClick&&s(this.props.onRowClick)?(h=null,m=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(h=this.handleSelectClick,m=null):(h=null,m=null),_&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection&&(this.props.multipleSelectionSettings.getSelectedRowIds(),_.unshift(n.createElement("td",{key:"selection",style:o,className:"griddle-select griddle-select-cell",onClick:m},n.createElement("input",{type:"checkbox",checked:this.props.multipleSelectionSettings.getIsRowChecked(f),onChange:this.handleSelectionChange,ref:"selected"}))));var y=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?y="child-row":t.props.hasChildren&&(y=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),n.createElement("tr",{onClick:h,className:y},_)}});e.exports=c},"./node_modules/griddle-react/modules/gridRowContainer.jsx.js":function(e,t,o){"use strict";var n=o(0),r=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/node_modules/lodash/pick.js")),s=n.createClass({displayName:"GridRowContainer",getDefaultProps:function(){return{useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,columnSettings:null,rowSettings:null,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},getInitialState:function(){return{data:{},showChildren:!1}},componentWillReceiveProps:function(){this.setShowChildren(!1)},toggleChildren:function(){this.setShowChildren(!1===this.state.showChildren)},setShowChildren:function(e){this.setState({showChildren:e})},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be")},render:function(){this.verifyProps();var e=this;if(void 0===this.props.data)return n.createElement("tbody",null);var t=[],o=this.props.columnSettings.getColumns();t.push(n.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?r(this.props.data,o):this.props.data,rowData:this.props.rowSettings.isCustom?this.props.data:null,columnSettings:this.props.columnSettings,rowSettings:this.props.rowSettings,hasChildren:e.props.hasChildren,toggleChildren:e.toggleChildren,showChildren:e.state.showChildren,key:e.props.uniqueId+"_base_row",useGriddleIcons:e.props.useGriddleIcons,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedComponent:this.props.parentRowExpandedComponent,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight,onRowClick:e.props.onRowClick,multipleSelectionSettings:this.props.multipleSelectionSettings}));var s=null;return e.state.showChildren&&(s=e.props.hasChildren&&this.props.data.children.map(function(t,o){var r=e.props.rowSettings.getRowKey(t,o);if(void 0!==t.children){var s=e.constructor.Griddle;return n.createElement("tr",{key:r,style:{paddingLeft:5}},n.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},n.createElement(s,{rowMetadata:{key:"id"},isSubGriddle:!0,results:[t],columns:e.props.columnSettings.getColumns(),tableClassName:e.props.tableClassName,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,showTableHeading:!1,showPager:!1,columnMetadata:e.props.columnSettings.columnMetadata,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight})))}return n.createElement(e.props.rowSettings.rowComponent,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,data:t,columnSettings:e.props.columnSettings,isChildRow:!0,columnMetadata:e.props.columnSettings.columnMetadata,key:r})})),!1===e.props.hasChildren?t[0]:n.createElement("tbody",null,e.state.showChildren?t.concat(s):t)}});e.exports=s},"./node_modules/griddle-react/modules/gridSettings.jsx.js":function(e,t,o){"use strict";var n=o(0),r=o("./node_modules/griddle-react/node_modules/lodash/includes.js"),s=o("./node_modules/griddle-react/node_modules/lodash/without.js"),l=o("./node_modules/griddle-react/node_modules/lodash/find.js"),i=n.createClass({displayName:"GridSettings",getDefaultProps:function(){return{columns:[],columnMetadata:[],selectedColumns:[],settingsText:"",maxRowsText:"",resultsPerPage:0,enableToggleCustom:!1,useCustomComponent:!1,useGriddleStyles:!0,toggleCustomComponent:function(){}}},setPageSize:function(e){var t=parseInt(e.target.value,10);this.props.setPageSize(t)},handleChange:function(e){var t=e.target.dataset?e.target.dataset.name:e.target.getAttribute("data-name");!0===e.target.checked&&!1===r(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(s(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map(function(t,o){var s=r(e.props.selectedColumns,t),i=l(e.props.columnMetadata,{columnName:t}),a=t;return void 0!==i&&void 0!==i.displayName&&null!=i.displayName&&(a=i.displayName),void 0!==i&&null!=i&&i.locked?n.createElement("div",{className:"column checkbox"},n.createElement("label",null,n.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:s,"data-name":t}),a)):void 0!==i&&null!=i&&void 0!==i.visible&&!1===i.visible?null:n.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},n.createElement("label",null,n.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:s,"data-name":t}),a))}));var o=e.props.enableToggleCustom?n.createElement("div",{className:"form-group"},n.createElement("label",{htmlFor:"maxRows"},n.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",s=this.props.showSetPageSize?n.createElement("div",null,n.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",n.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},n.createElement("option",{value:"5"},"5"),n.createElement("option",{value:"10"},"10"),n.createElement("option",{value:"25"},"25"),n.createElement("option",{value:"50"},"50"),n.createElement("option",{value:"100"},"100")))):"";return n.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},n.createElement("h6",null,this.props.settingsText),n.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),s,o)}});e.exports=i},"./node_modules/griddle-react/modules/gridTable.jsx.js":function(e,t,o){"use strict";var n=o(0),r=o("./node_modules/griddle-react/modules/gridTitle.jsx.js"),s=o("./node_modules/griddle-react/modules/gridRowContainer.jsx.js"),l=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/rowProperties.js"),n.createClass({displayName:"GridTable",getDefaultProps:function(){return{data:[],columnSettings:null,rowSettings:null,sortSettings:null,multipleSelectionSettings:null,className:"",enableInfiniteScroll:!1,nextPage:null,hasMorePages:!1,useFixedHeader:!1,useFixedLayout:!0,paddingHeight:null,rowHeight:null,filterByColumn:null,infiniteScrollLoadTreshold:null,bodyHeight:null,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",externalLoadingComponent:null,externalIsLoading:!1,onRowClick:null}},getInitialState:function(){return{scrollTop:0,scrollHeight:this.props.bodyHeight,clientHeight:this.props.bodyHeight}},componentDidMount:function(){this.gridScroll()},componentDidUpdate:function(e,t){this.gridScroll()},gridScroll:function(){if(this.props.enableInfiniteScroll&&!this.props.externalIsLoading){var e=this.refs.scrollable,t=e.scrollTop,o=e.scrollHeight,n=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var r={scrollTop:t,scrollHeight:o,clientHeight:n};this.setState(r)}.6*(o-(t+n)-this.props.infiniteScrollLoadTreshold)<=this.props.infiniteScrollLoadTreshold&&this.props.nextPage()}},verifyProps:function(){null===this.props.columnSettings&&console.error("gridTable: The columnSettings prop is null and it shouldn't be"),null===this.props.rowSettings&&console.error("gridTable: The rowSettings prop is null and it shouldn't be")},getAdjustedRowHeight:function(){return this.props.rowHeight+2*this.props.paddingHeight},getNodeContent:function(){this.verifyProps();var e=this,t=!1;if(!this.props.externalIsLoading||this.props.enableInfiniteScroll){var o=e.props.data,r=null,l=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var i=e.getAdjustedRowHeight(),a=Math.ceil(e.state.clientHeight/i),d=Math.max(0,Math.floor(e.state.scrollTop/i)-.25*a),u=Math.min(d+1.25*a,this.props.data.length-1);o=o.slice(d,u+1);var c={height:d*i+"px"};r=n.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-u)*i+"px"};l=n.createElement("tr",{key:"below-"+p.height,style:p})}var f=o.map(function(o,r){var l=void 0!==o.children&&o.children.length>0,i=e.props.rowSettings.getRowKey(o,r);return l&&(t=l),n.createElement(s,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,data:o,key:i+"-container",uniqueId:i,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:l,tableClassName:e.props.className,onRowClick:e.props.onRowClick})});if(this.props.showNoData){var h=this.props.columnSettings.getVisibleColumnCount();f.push(n.createElement("tr",{key:"no-data-section"},n.createElement("td",{colSpan:h},this.props.noDataSection)))}return r&&f.unshift(r),l&&f.push(l),{nodes:f,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,o=this.getNodeContent();o&&(e=o.nodes,t=o.anyHasChildren);var s=null,l=null,i={width:"100%"};if(this.props.useFixedLayout&&(i.tableLayout="fixed"),this.props.enableInfiniteScroll&&(s={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var a=null,d=null;this.props.useGriddleStyles&&(a={textAlign:"center",paddingBottom:"40px"}),d=this.props.columnSettings.getVisibleColumnCount();var u=this.props.externalLoadingComponent?n.createElement(this.props.externalLoadingComponent,null):n.createElement("div",null,"Loading...");l=n.createElement("tbody",null,n.createElement("tr",null,n.createElement("td",{style:a,colSpan:d},u)))}var c=this.props.showTableHeading?n.createElement(r,{useGriddleStyles:this.props.useGriddleStyles,useGriddleIcons:this.props.useGriddleIcons,sortSettings:this.props.sortSettings,multipleSelectionSettings:this.props.multipleSelectionSettings,columnSettings:this.props.columnSettings,filterByColumn:this.props.filterByColumn,rowSettings:this.props.rowSettings}):void 0;t||(e=n.createElement("tbody",null,e));var p=n.createElement("tbody",null);if(this.props.showPager){var f=this.props.useGriddleStyles?{padding:"0px",backgroundColor:"#EDEDED",border:"0px",color:"#222",height:this.props.showNoData?"20px":null}:null;p=n.createElement("tbody",null,n.createElement("tr",null,n.createElement("td",{colSpan:this.props.multipleSelectionSettings.isMultipleSelection?this.props.columnSettings.getVisibleColumnCount()+1:this.props.columnSettings.getVisibleColumnCount(),style:f,className:"footer-container"},this.props.showNoData?null:this.props.pagingContent)))}return this.props.useFixedHeader?(this.props.useGriddleStyles&&(i.tableLayout="fixed"),n.createElement("div",null,n.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c),n.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:s},n.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},e,l,p)))):n.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:s},n.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c,e,l,p))}}));e.exports=l},"./node_modules/griddle-react/modules/gridTitle.jsx.js":function(e,t,o){"use strict";var n=Object.assign||function(e){for(var t=1;t=0)return!0;return!1})},defaultColumnFilter:function(e,t){return x(_.getObjectValues(e),function(e){return e.toString().toLowerCase().indexOf(t.toLowerCase())>=0}).length>0},filterByColumnFilters:function(e){var t=this.defaultColumnFilter,o=Object.keys(e).reduce(function(o,n){return x(o,function(o){var r=_.getAt(o,n||""),s=e[n];return t(r,s)})},this.props.results),n={columnFilters:e};e?(n.filteredResults=o,n.maxPage=this.getMaxPage(n.filteredResults)):this.state.filter?n.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):n.filteredResults=null,this.setState(n)},filterByColumn:function(e,t){var o=this.state.columnFilters;if(o.hasOwnProperty(t)&&!e)o=F(o,t);else{var n={};n[t]=e,o=A({},o,n)}this.filterByColumnFilters(o)},setFilter:function(e){if(this.props.useExternal)return void this.props.externalSetFilter(e);var t=this,o={page:0,filter:e};o.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,e):this.defaultFilter(this.props.results,e),o.maxPage=t.getMaxPage(o.filteredResults),(O(e)||T(e)||w(e))&&(o.filter=e,o.filteredResults=null),t.setState(o),this._resetSelectedRows()},setPageSize:function(e){if(this.props.useExternal)return this.setState({resultsPerPage:e}),void this.props.externalSetPageSize(e);this.state.resultsPerPage=e,this.setMaxPage()},toggleColumnChooser:function(){this.setState({showColumnChooser:!this.state.showColumnChooser})},isNullOrUndefined:function(e){return void 0===e||null===e},shouldUseCustomRowComponent:function(){return this.isNullOrUndefined(this.state.useCustomRowComponent)?this.props.useCustomRowComponent:this.state.useCustomRowComponent},shouldUseCustomGridComponent:function(){return this.isNullOrUndefined(this.state.useCustomGridComponent)?this.props.useCustomGridComponent:this.state.useCustomGridComponent},toggleCustomComponent:function(){"grid"===this.state.customComponentType?this.setState({useCustomGridComponent:!this.shouldUseCustomGridComponent()}):"row"===this.state.customComponentType&&this.setState({useCustomRowComponent:!this.shouldUseCustomRowComponent()})},getMaxPage:function(e,t){return this.props.useExternal?this.props.externalMaxPage:(t||(t=(e||this.getCurrentResults()).length),Math.ceil(t/this.state.resultsPerPage))},setMaxPage:function(e){var t=this.getMaxPage(e);this.state.maxPage!==t&&this.setState({page:0,maxPage:t,filteredColumns:this.columnSettings.filteredColumns})},setPage:function(e){if(this.props.useExternal)return void this.props.externalSetPage(e);if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t=this,o={page:e};t.setState(o)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})},setColumns:function(e){this.columnSettings.filteredColumns=P(e)?e:[e],this.setState({filteredColumns:this.columnSettings.filteredColumns})},nextPage:function(){var e=this.getCurrentPage();e0&&this.setPage(e-1)},changeSort:function(e){if(!1!==this.props.enableSort){if(this.props.useExternal){var t=this.props.externalSortColumn!==e||!this.props.externalSortAscending;return this.setState({sortColumn:e,sortDirection:t?"asc":"desc"}),void this.props.externalChangeSort(e,t)}var o=b(this.props.columnMetadata,{columnName:e})||{},n=o.sortDirectionCycle?o.sortDirectionCycle:[null,"asc","desc"],r=null,s=n.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null);s=(s+1)%n.length,r=n[s]?n[s]:null;var l={page:0,sortColumn:e,sortDirection:r};this.setState(l)}},componentWillReceiveProps:function(e){if(this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=_.keys(e.results[0]);this.columnSettings.allColumns.length==t.length&&this.columnSettings.allColumns.every(function(e,o){return e===t[o]})||(this.columnSettings.allColumns=t)}else this.columnSettings.allColumns.length>0&&(this.columnSettings.allColumns=[]);if(e.selectedRowIds){var o=this.getDataForRender(this.getCurrentResults(e.results),this.columnSettings.getColumns(),!0);this.setState({isSelectAllChecked:this._getAreAllRowsChecked(e.selectedRowIds,I(o,this.props.uniqueIdentifier)),selectedRowIds:e.selectedRowIds})}},getInitialState:function(){return{maxPage:0,page:0,filteredResults:null,filteredColumns:[],filter:"",columnFilters:{},resultsPerPage:this.props.resultsPerPage||5,showColumnChooser:!1,isSelectAllChecked:!1,selectedRowIds:this.props.selectedRowIds}},componentWillMount:function(){this.verifyExternal(),this.verifyCustom(),this.columnSettings=new m(this.props.results.length>0?_.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new g(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:u,this.props.useCustomTableRowComponent),this.props.initialSort&&(this.props.useExternal?this.setState({sortColumn:this.props.externalSortColumn,sortDirection:this.props.externalSortAscending?"asc":"desc"}):this.changeSort(this.props.initialSort)),this.setMaxPage(),this.shouldUseCustomGridComponent()?this.setState({customComponentType:"grid"}):this.shouldUseCustomRowComponent()?this.setState({customComponentType:"row"}):this.setState({filteredColumns:this.columnSettings.filteredColumns})},componentDidMount:function(){if(this.props.componentDidMount&&"function"==typeof this.props.componentDidMount)return this.props.componentDidMount()},componentDidUpdate:function(){if(this.props.componentDidUpdate&&"function"==typeof this.props.componentDidUpdate)return this.props.componentDidUpdate(this.state)},verifyExternal:function(){!0===this.props.useExternal&&(null===this.props.externalSetPage&&console.error("useExternal is set to true but there is no externalSetPage function specified."),null===this.props.externalChangeSort&&console.error("useExternal is set to true but there is no externalChangeSort function specified."),null===this.props.externalSetFilter&&console.error("useExternal is set to true but there is no externalSetFilter function specified."),null===this.props.externalSetPageSize&&console.error("useExternal is set to true but there is no externalSetPageSize function specified."),null===this.props.externalMaxPage&&console.error("useExternal is set to true but externalMaxPage is not set."),null===this.props.externalCurrentPage&&console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."))},verifyCustom:function(){!0===this.props.useCustomGridComponent&&null===this.props.customGridComponent&&console.error("useCustomGridComponent is set to true but no custom component was specified."),!0===this.props.useCustomRowComponent&&null===this.props.customRowComponent&&console.error("useCustomRowComponent is set to true but no custom component was specified."),!0===this.props.useCustomGridComponent&&!0===this.props.useCustomRowComponent&&console.error("Cannot currently use both customGridComponent and customRowComponent."),!0===this.props.useCustomFilterer&&null===this.props.customFilterer&&console.error("useCustomFilterer is set to true but no custom filter function was specified."),!0===this.props.useCustomFilterComponent&&null===this.props.customFilterComponent&&console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified.")},getDataForRender:function(e,t,o){var n=this,r=this;if(""!==this.state.sortColumn){var s,l=this.state.sortColumn,i=x(this.props.columnMetadata,{columnName:l}),a={columns:[],orders:[]};if(i.length>0&&(s=i[0].hasOwnProperty("customCompareFn")&&i[0].customCompareFn,i[0].multiSort&&(a=i[0].multiSort)),this.state.sortDirection)if("function"==typeof s)2===s.length?(e=e.sort(function(e,t){return s(k(e,l),k(t,l))}),"desc"===this.state.sortDirection&&e.reverse()):1===s.length&&(e=D(e,function(e){return s(k(e,l))},[this.state.sortDirection]));else{var d=[function(e){return(k(e,l)||"").toString().toLowerCase()}],u=[this.state.sortDirection];a.columns.forEach(function(e,t){d.push(function(t){return(k(t,e)||"").toString().toLowerCase()}),"asc"===a.orders[t]||"desc"===a.orders[t]?u.push(a.orders[t]):u.push(n.state.sortDirection)}),e=D(e,d,u)}}var c=this.getCurrentPage();if(!this.props.useExternal&&o&&this.state.resultsPerPage*(c+1)<=this.state.resultsPerPage*this.state.maxPage&&c>=0)if(this.isInfiniteScrollEnabled())e=E(e,(c+1)*this.state.resultsPerPage);else{var p=y(e,c*this.state.resultsPerPage);e=(v||j)(p,p.length-this.state.resultsPerPage)}for(var f=(this.columnSettings.getMetadataColumns,[]),h=0;h0&&(m.children=r.getDataForRender(m[r.props.childrenColumnName],t,!1),"children"!==r.props.childrenColumnName&&delete m[r.props.childrenColumnName]),f.push(m)}return f},getCurrentResults:function(e){return this.state.filteredResults||e||this.props.results},getCurrentPage:function(){return this.props.externalCurrentPage||this.state.page},getCurrentSort:function(){return this.props.useExternal?this.props.externalSortColumn:this.state.sortColumn},getCurrentSortAscending:function(){return this.props.useExternal?this.props.externalSortAscending:"asc"===this.state.sortDirection},getCurrentMaxPage:function(){return this.props.useExternal?this.props.externalMaxPage:this.state.maxPage},getSortObject:function(){return{enableSort:this.props.enableSort,changeSort:this.changeSort,sortColumn:this.getCurrentSort(),sortAscending:this.getCurrentSortAscending(),sortDirection:this.state.sortDirection,sortAscendingClassName:this.props.sortAscendingClassName,sortDescendingClassName:this.props.sortDescendingClassName,sortAscendingComponent:this.props.sortAscendingComponent,sortDescendingComponent:this.props.sortDescendingComponent,sortDefaultComponent:this.props.sortDefaultComponent}},_toggleSelectAll:function(){var e=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),t=!this.state.isSelectAllChecked,o=JSON.parse(JSON.stringify(this.state.selectedRowIds)),n=this;S(e,function(e){n._updateSelectedRowIds(e[n.props.uniqueIdentifier],o,t)},this),this.setState({isSelectAllChecked:t,selectedRowIds:o}),this.props.onSelectionChange&&this.props.onSelectionChange(o,t)},_toggleSelectRow:function(e,t){var o=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),n=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],n,t);var r=this._getAreAllRowsChecked(n,I(o,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:r,selectedRowIds:n}),this.props.onSelectionChange&&this.props.onSelectionChange(n,r)},_updateSelectedRowIds:function(e,t,o){o?void 0===b(t,function(t){return e===t})&&t.push(e):t.splice(t.indexOf(e),1)},_getIsSelectAllChecked:function(){return this.state.isSelectAllChecked},_getAreAllRowsChecked:function(e,t){return t.length===C(t,e).length},_getIsRowChecked:function(e){return this.state.selectedRowIds.indexOf(e[this.props.uniqueIdentifier])>-1},getSelectedRowIds:function(){return this.state.selectedRowIds},_resetSelectedRows:function(){this.setState({isSelectAllChecked:!1,selectedRowIds:[]})},getMultipleSelectionObject:function(){return{isMultipleSelection:!b(this.props.results,function(e){return"children"in e})&&this.props.isMultipleSelection,toggleSelectAll:this._toggleSelectAll,getIsSelectAllChecked:this._getIsSelectAllChecked,toggleSelectRow:this._toggleSelectRow,getSelectedRowIds:this.getSelectedRowIds,getIsRowChecked:this._getIsRowChecked}},isInfiniteScrollEnabled:function(){return!this.props.useCustomPagerComponent&&this.props.enableInfiniteScroll},getClearFixStyles:function(){return{clear:"both",display:"table",width:"100%"}},getSettingsStyles:function(){return{float:"left",width:"50%",textAlign:"right"}},getFilterStyles:function(){return{float:"left",width:"50%",textAlign:"left",color:"#222",minHeight:"1px"}},getFilter:function(){return this.props.showFilter&&!1===this.shouldUseCustomGridComponent()?this.props.useCustomFilterComponent?r.createElement(h,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):r.createElement(l,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?r.createElement("button",{type:"button",className:this.props.settingsToggleClassName,onClick:this.toggleColumnChooser,style:this.props.useGriddleStyles?{background:"none",border:"none",padding:0,margin:0,fontSize:14}:null},this.props.settingsText,this.props.settingsIconComponent):""},getTopSection:function(e,t){if(!1===this.props.showFilter&&!1===this.props.showSettings)return"";var o=null,n=null,s=null;return this.props.useGriddleStyles&&(o=this.getFilterStyles(),n=this.getSettingsStyles(),s=this.getClearFixStyles()),r.createElement("div",{className:"top-section",style:s},r.createElement("div",{className:"griddle-filter",style:o},e),r.createElement("div",{className:"griddle-settings-toggle",style:n},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return r.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?r.createElement(f,{customPagerComponentOptions:this.props.customPagerComponentOptions,next:this.nextPage,previous:this.previousPage,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText,customPagerComponent:this.props.customPagerComponent}):r.createElement(i,{useGriddleStyles:this.props.useGriddleStyles,next:this.nextPage,previous:this.previousPage,nextClassName:this.props.nextClassName,nextIconComponent:this.props.nextIconComponent,previousClassName:this.props.previousClassName,previousIconComponent:this.props.previousIconComponent,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText}))},getColumnSelectorSection:function(e,t){return this.state.showColumnChooser?r.createElement(a,{columns:e,selectedColumns:t,setColumns:this.setColumns,settingsText:this.props.settingsText,settingsIconComponent:this.props.settingsIconComponent,maxRowsText:this.props.maxRowsText,setPageSize:this.setPageSize,showSetPageSize:!this.shouldUseCustomGridComponent(),resultsPerPage:this.state.resultsPerPage,enableToggleCustom:this.props.enableToggleCustom,toggleCustomComponent:this.toggleCustomComponent,useCustomComponent:this.shouldUseCustomRowComponent()||this.shouldUseCustomGridComponent(),useGriddleStyles:this.props.useGriddleStyles,enableCustomFormatText:this.props.enableCustomFormatText,columnMetadata:this.props.columnMetadata}):""},getCustomGridSection:function(){return r.createElement(this.props.customGridComponent,n({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,o,n,s){return r.createElement("div",null,r.createElement(p,{data:e,columns:t,metadataColumns:o,globalData:s,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&n)},getStandardGridSection:function(e,t,o,n,l){var i=this.getSortObject(),a=this.getMultipleSelectionObject(),d=this.shouldShowNoDataSection(e),u=this.getNoDataSection();return r.createElement("div",{className:"griddle-body"},r.createElement(s,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:u,showNoData:d,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:i,multipleSelectionSettings:a,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:n,data:e,className:this.props.tableClassName,enableInfiniteScroll:this.isInfiniteScrollEnabled(),nextPage:this.nextPage,showTableHeading:this.props.showTableHeading,useFixedHeader:this.props.useFixedHeader,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,parentRowExpandedComponent:this.props.parentRowExpandedComponent,bodyHeight:this.props.bodyHeight,paddingHeight:this.props.paddingHeight,rowHeight:this.props.rowHeight,infiniteScrollLoadTreshold:this.props.infiniteScrollLoadTreshold,externalLoadingComponent:this.props.externalLoadingComponent,externalIsLoading:this.props.externalIsLoading,hasMorePages:l,onRowClick:this.props.onRowClick}))},getContentSection:function(e,t,o,n,r,s){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,o,n,s):this.getStandardGridSection(e,t,o,n,r)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?r.createElement("div",{className:this.props.noDataClassName},r.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):r.createElement(d,{noDataMessage:this.props.noDataMessage})},shouldShowNoDataSection:function(e){return!this.props.allowEmptyGrid&&(!1===this.props.useExternal&&(void 0===e||0===e.length)||!0===this.props.useExternal&&!1===this.props.externalIsLoading&&0===e.length)},render:function(){var e=this.getCurrentResults(),t=(this.props.tableClassName,this.getFilter()),o=this.getSettings(),n=this.getTopSection(t,o),s=[],l=this.columnSettings.getColumns(),i=this.getDataForRender(e,l,!0),a=this.columnSettings.getMetadataColumns();this.props.columnMetadata?S(this.props.columnMetadata,function(e){"boolean"==typeof e.visible&&!1===e.visible||s.push(e.columnName)}):s=_.keys(F(e[0],a)),s=this.columnSettings.orderColumns(s);var d=this.getCurrentPage(),u=this.getCurrentMaxPage(),c=d+10?"griddle "+this.props.gridClassName:"griddle";return m+=this.shouldUseCustomRowComponent()?" griddle-custom":"",r.createElement("div",{className:m},n,h,r.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},f))}});c.Griddle=e.exports=N},"./node_modules/griddle-react/modules/rowProperties.js":function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o-1}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseIndexOf.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_arrayIncludesWith.js":function(e,t){function o(e,t,o){for(var n=-1,r=null==e?0:e.length;++n=u&&(p=d,f=!1,t=new r(t));e:for(;++c0&&o(u)?t>1?n(u,t-1,o,l,i):r(i,u):l||(i[i.length]=u)}return i}var r=o("./node_modules/griddle-react/node_modules/lodash/_arrayPush.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_isFlattenable.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_baseFor.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_createBaseFor.js"),r=n();e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_baseForOwn.js":function(e,t,o){function n(e,t){return e&&r(e,t,s)}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseFor.js"),s=o("./node_modules/griddle-react/node_modules/lodash/keys.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_baseGet.js":function(e,t,o){function n(e,t){t=r(t,e);for(var o=0,n=t.length;null!=e&&o=120&&_.length>=120)?new r(f&&_):void 0}_=e[0];var y=-1,v=h[0];e:for(;++yr?0:r+t),o=o>r?r:o,o<0&&(o+=r),r=t>o?0:o-t>>>0,t>>>=0;for(var s=Array(r);++nt||l&&i&&d&&!a&&!u||n&&i&&d||!o&&d||!s)return 1;if(!n&&!l&&!u&&e=a?d:d*("desc"==o[n]?-1:1)}return e.index-t.index}var r=o("./node_modules/griddle-react/node_modules/lodash/_compareAscending.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_copyArray.js":function(e,t){function o(e,t){var o=-1,n=e.length;for(t||(t=Array(n));++o1?o[r-1]:void 0,i=r>2?o[2]:void 0;for(l=e.length>3&&"function"==typeof l?(r--,l):void 0,i&&s(o[0],o[1],i)&&(l=r<3?void 0:l,r=1),t=Object(t);++n-1?i[a?t[d]:d]:void 0}}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseIteratee.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),l=o("./node_modules/griddle-react/node_modules/lodash/keys.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_createToPairs.js":function(e,t,o){function n(e){return function(t){var o=s(t);return o==a?l(t):o==d?i(t):r(t,e(t))}}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseToPairs.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_getTag.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_mapToArray.js"),i=o("./node_modules/griddle-react/node_modules/lodash/_setToPairs.js"),a="[object Map]",d="[object Set]";e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_customDefaultsAssignIn.js":function(e,t,o){function n(e,t,o,n){return void 0===e||r(e,s[o])&&!l.call(n,o)?t:e}var r=o("./node_modules/griddle-react/node_modules/lodash/eq.js"),s=Object.prototype,l=s.hasOwnProperty;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_customOmitClone.js":function(e,t,o){function n(e){return r(e)?void 0:e}var r=o("./node_modules/griddle-react/node_modules/lodash/isPlainObject.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_defineProperty.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_getNative.js"),r=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_equalArrays.js":function(e,t,o){function n(e,t,o,n,d,u){var c=o&i,p=e.length,f=t.length;if(p!=f&&!(c&&f>p))return!1;var h=u.get(e);if(h&&u.get(t))return h==t;var m=-1,g=!0,_=o&a?new r:void 0;for(u.set(e,t),u.set(t,e);++m-1&&e%1==0&&e-1}var r=o("./node_modules/griddle-react/node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_listCacheSet.js":function(e,t,o){function n(e,t){var o=this.__data__,n=r(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}var r=o("./node_modules/griddle-react/node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheClear.js":function(e,t,o){function n(){this.size=0,this.__data__={hash:new r,map:new(l||s),string:new r}}var r=o("./node_modules/griddle-react/node_modules/lodash/_Hash.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_ListCache.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_Map.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function n(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}var r=o("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheGet.js":function(e,t,o){function n(e){return r(this,e).get(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheHas.js":function(e,t,o){function n(e){return r(this,e).has(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheSet.js":function(e,t,o){function n(e,t){var o=r(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}var r=o("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapToArray.js":function(e,t){function o(e){var t=-1,o=Array(e.size);return e.forEach(function(e,n){o[++t]=[n,e]}),o}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_matchesStrictComparable.js":function(e,t){function o(e,t){return function(o){return null!=o&&o[e]===t&&(void 0!==t||e in Object(o))}}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_memoizeCapped.js":function(e,t,o){function n(e){var t=r(e,function(e){return o.size===s&&o.clear(),e}),o=t.cache;return t}var r=o("./node_modules/griddle-react/node_modules/lodash/memoize.js"),s=500;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_nativeCreate.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_getNative.js"),r=n(Object,"create");e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_nativeKeys.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_overArg.js"),r=n(Object.keys,Object);e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_nativeKeysIn.js":function(e,t){function o(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_nodeUtil.js":function(e,t,o){(function(e){var n=o("./node_modules/griddle-react/node_modules/lodash/_freeGlobal.js"),r="object"==typeof t&&t&&!t.nodeType&&t,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,l=s&&s.exports===r,i=l&&n.process,a=function(){try{return i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/griddle-react/node_modules/lodash/_objectToString.js":function(e,t){function o(e){return r.call(e)}var n=Object.prototype,r=n.toString;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_overArg.js":function(e,t){function o(e,t){return function(o){return e(t(o))}}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_overRest.js":function(e,t,o){function n(e,t,o){return t=s(void 0===t?e.length-1:t,0),function(){for(var n=arguments,l=-1,i=s(n.length-t,0),a=Array(i);++l0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var n=800,r=16,s=Date.now;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackClear.js":function(e,t,o){function n(){this.__data__=new r,this.size=0}var r=o("./node_modules/griddle-react/node_modules/lodash/_ListCache.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_stackDelete.js":function(e,t){function o(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackGet.js":function(e,t){function o(e){return this.__data__.get(e)}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackHas.js":function(e,t){function o(e){return this.__data__.has(e)}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackSet.js":function(e,t,o){function n(e,t){var o=this.__data__;if(o instanceof r){var n=o.__data__;if(!s||n.length-1:!!u&&r(e,t,o)>-1}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseIndexOf.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isString.js"),i=o("./node_modules/griddle-react/node_modules/lodash/toInteger.js"),a=o("./node_modules/griddle-react/node_modules/lodash/values.js"),d=Math.max;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/initial.js":function(e,t,o){function n(e){return(null==e?0:e.length)?r(e,0,-1):[]}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseSlice.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/intersection.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_arrayMap.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseIntersection.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseRest.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_castArrayLikeObject.js"),i=s(function(e){var t=n(e,l);return t.length&&t[0]===e[0]?r(t):[]});e.exports=i},"./node_modules/griddle-react/node_modules/lodash/isArguments.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_baseIsArguments.js"),r=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),s=Object.prototype,l=s.hasOwnProperty,i=s.propertyIsEnumerable,a=n(function(){return arguments}())?n:function(e){return r(e)&&l.call(e,"callee")&&!i.call(e,"callee")};e.exports=a},"./node_modules/griddle-react/node_modules/lodash/isArray.js":function(e,t){var o=Array.isArray;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isArrayLike.js":function(e,t,o){function n(e){return null!=e&&s(e.length)&&!r(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/isFunction.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isLength.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isArrayLikeObject.js":function(e,t,o){function n(e){return s(e)&&r(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isBuffer.js":function(e,t,o){(function(e){var n=o("./node_modules/griddle-react/node_modules/lodash/_root.js"),r=o("./node_modules/griddle-react/node_modules/lodash/stubFalse.js"),s="object"==typeof t&&t&&!t.nodeType&&t,l=s&&"object"==typeof e&&e&&!e.nodeType&&e,i=l&&l.exports===s,a=i?n.Buffer:void 0,d=a?a.isBuffer:void 0,u=d||r;e.exports=u}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/griddle-react/node_modules/lodash/isEmpty.js":function(e,t,o){function n(e){if(null==e)return!0;if(a(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||d(e)||c(e)||l(e)))return!e.length;var t=s(e);if(t==p||t==f)return!e.size;if(u(e))return!r(e).length;for(var o in e)if(m.call(e,o))return!1;return!0}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseKeys.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_getTag.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isArguments.js"),i=o("./node_modules/griddle-react/node_modules/lodash/isArray.js"),a=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),d=o("./node_modules/griddle-react/node_modules/lodash/isBuffer.js"),u=o("./node_modules/griddle-react/node_modules/lodash/_isPrototype.js"),c=o("./node_modules/griddle-react/node_modules/lodash/isTypedArray.js"),p="[object Map]",f="[object Set]",h=Object.prototype,m=h.hasOwnProperty;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isFunction.js":function(e,t,o){function n(e){if(!s(e))return!1;var t=r(e);return t==i||t==a||t==l||t==d}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isObject.js"),l="[object AsyncFunction]",i="[object Function]",a="[object GeneratorFunction]",d="[object Proxy]";e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isLength.js":function(e,t){function o(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isNull.js":function(e,t){function o(e){return null===e}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isPlainObject.js":function(e,t,o){function n(e){if(!l(e)||r(e)!=i)return!1;var t=s(e);if(null===t)return!0;var o=c.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&u.call(o)==p}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_getPrototype.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),i="[object Object]",a=Function.prototype,d=Object.prototype,u=a.toString,c=d.hasOwnProperty,p=u.call(Object);e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isString.js":function(e,t,o){function n(e){return"string"==typeof e||!s(e)&&l(e)&&r(e)==i}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArray.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),i="[object String]";e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isSymbol.js":function(e,t,o){function n(e){return"symbol"==typeof e||s(e)&&r(e)==l}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),l="[object Symbol]";e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isTypedArray.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_baseIsTypedArray.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseUnary.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_nodeUtil.js"),l=s&&s.isTypedArray,i=l?r(l):n;e.exports=i},"./node_modules/griddle-react/node_modules/lodash/isUndefined.js":function(e,t){function o(e){return void 0===e}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/keys.js":function(e,t,o){function n(e){return l(e)?r(e):s(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_arrayLikeKeys.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseKeys.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/keysIn.js":function(e,t,o){function n(e){return l(e)?r(e,!0):s(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_arrayLikeKeys.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseKeysIn.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/last.js":function(e,t){function o(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/map.js":function(e,t,o){function n(e,t){return(i(e)?r:l)(e,s(t,3))}var r=o("./node_modules/griddle-react/node_modules/lodash/_arrayMap.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseIteratee.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_baseMap.js"),i=o("./node_modules/griddle-react/node_modules/lodash/isArray.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/memoize.js":function(e,t,o){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(s);var o=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=o.cache;if(s.has(r))return s.get(r);var l=e.apply(this,n);return o.cache=s.set(r,l)||s,l};return o.cache=new(n.Cache||r),o}var r=o("./node_modules/griddle-react/node_modules/lodash/_MapCache.js"),s="Expected a function";n.Cache=r,e.exports=n},"./node_modules/griddle-react/node_modules/lodash/omit.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_arrayMap.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseClone.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseUnset.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_castPath.js"),i=o("./node_modules/griddle-react/node_modules/lodash/_copyObject.js"),a=o("./node_modules/griddle-react/node_modules/lodash/_customOmitClone.js"),d=o("./node_modules/griddle-react/node_modules/lodash/_flatRest.js"),u=o("./node_modules/griddle-react/node_modules/lodash/_getAllKeysIn.js"),c=d(function(e,t){var o={};if(null==e)return o;var d=!1;t=n(t,function(t){return t=l(t,e),d||(d=t.length>1),t}),i(e,u(e),o),d&&(o=r(o,7,a));for(var c=t.length;c--;)s(o,t[c]);return o});e.exports=c},"./node_modules/griddle-react/node_modules/lodash/orderBy.js":function(e,t,o){function n(e,t,o,n){return null==e?[]:(s(t)||(t=null==t?[]:[t]),o=n?void 0:o,s(o)||(o=null==o?[]:[o]),r(e,t,o))}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseOrderBy.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArray.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/pick.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_basePick.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_flatRest.js"),s=r(function(e,t){return null==e?{}:n(e,t)});e.exports=s},"./node_modules/griddle-react/node_modules/lodash/property.js":function(e,t,o){function n(e){return l(e)?r(i(e)):s(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseProperty.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_basePropertyDeep.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_isKey.js"),i=o("./node_modules/griddle-react/node_modules/lodash/_toKey.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/sortBy.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_baseFlatten.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseOrderBy.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseRest.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_isIterateeCall.js"),i=s(function(e,t){if(null==e)return[];var o=t.length;return o>1&&l(e,t[0],t[1])?t=[]:o>2&&l(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])});e.exports=i},"./node_modules/griddle-react/node_modules/lodash/stubArray.js":function(e,t){function o(){return[]}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/stubFalse.js":function(e,t){function o(){return!1}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/take.js":function(e,t,o){function n(e,t,o){return e&&e.length?(t=o||void 0===t?1:s(t),r(e,0,t<0?0:t)):[]}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseSlice.js"),s=o("./node_modules/griddle-react/node_modules/lodash/toInteger.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/toFinite.js":function(e,t,o){function n(e){return e?(e=r(e))===s||e===-s?(e<0?-1:1)*l:e===e?e:0:0===e?e:0}var r=o("./node_modules/griddle-react/node_modules/lodash/toNumber.js"),s=1/0,l=1.7976931348623157e308;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/toInteger.js":function(e,t,o){function n(e){var t=r(e),o=t%1;return t===t?o?t-o:t:0}var r=o("./node_modules/griddle-react/node_modules/lodash/toFinite.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/toNumber.js":function(e,t,o){function n(e){if("number"==typeof e)return e;if(s(e))return l;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var o=d.test(e);return o||u.test(e)?c(e.slice(2),o?2:8):a.test(e)?l:+e}var r=o("./node_modules/griddle-react/node_modules/lodash/isObject.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isSymbol.js"),l=NaN,i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/toPairs.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_createToPairs.js"),r=o("./node_modules/griddle-react/node_modules/lodash/keys.js"),s=n(r);e.exports=s},"./node_modules/griddle-react/node_modules/lodash/toString.js":function(e,t,o){function n(e){return null==e?"":r(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseToString.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/uniqueId.js":function(e,t,o){function n(e){var t=++s;return r(e)+t}var r=o("./node_modules/griddle-react/node_modules/lodash/toString.js"),s=0;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/values.js":function(e,t,o){function n(e){return null==e?[]:r(e,s(e))}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseValues.js"),s=o("./node_modules/griddle-react/node_modules/lodash/keys.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/without.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_baseDifference.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseRest.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArrayLikeObject.js"),l=r(function(e,t){return s(e)?n(e,t):[]});e.exports=l},"./node_modules/griddle-react/node_modules/lodash/zipObject.js":function(e,t,o){function n(e,t){return s(e||[],t||[],r)}var r=o("./node_modules/griddle-react/node_modules/lodash/_assignValue.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseZipObject.js");e.exports=n},"./node_modules/react-selectable/dist/react-selectable.js":function(e,t,o){!function(t,n){e.exports=function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.nodeInRoot=t.isNodeIn=t.createSelectable=t.SelectableGroup=void 0;var r=o(1),s=n(r),l=o(9),i=n(l),a=o(5),d=n(a),u=o(4),c=n(u);t.SelectableGroup=s.default,t.createSelectable=i.default,t.isNodeIn=d.default,t.nodeInRoot=c.default},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;oo+i||t+r-an+l)};t.default=function(e,t,o){var n=e instanceof HTMLElement?(0,r.default)(e):e,l=t instanceof HTMLElement?(0,r.default)(t):t;return s(n.top,n.left,l.top,l.left,n.offsetWidth,n.offsetHeight,l.offsetWidth,l.offsetHeight,o)}},function(e,t){(function(t){"use strict";function o(e,t,o){function n(t){var o=m,n=g;return m=g=void 0,E=t,y=e.apply(n,o)}function s(e){return E=e,v=setTimeout(u,t),P?n(e):y}function l(e){var o=e-b,n=e-E,r=t-o;return w?j(r,_-n):r}function a(e){var o=e-b,n=e-E;return void 0===b||o>=t||o<0||w&&n>=_}function u(){var e=C();if(a(e))return c(e);v=setTimeout(u,l(e))}function c(e){return v=void 0,T&&m?n(e):(m=g=void 0,y)}function p(){void 0!==v&&clearTimeout(v),E=0,m=b=g=v=void 0}function f(){return void 0===v?y:c(C())}function h(){var e=C(),o=a(e);if(m=arguments,g=this,b=e,o){if(void 0===v)return s(b);if(w)return v=setTimeout(u,t),n(b)}return void 0===v&&(v=setTimeout(u,t)),y}var m,g,_,y,v,b,E=0,P=!1,w=!1,T=!0;if("function"!=typeof e)throw new TypeError(d);return t=i(t)||0,r(o)&&(P=!!o.leading,w="maxWait"in o,_=w?S(i(o.maxWait)||0,t):_,T="trailing"in o?!!o.trailing:T),h.cancel=p,h.flush=f,h}function n(e,t,n){var s=!0,l=!0;if("function"!=typeof e)throw new TypeError(d);return r(n)&&(s="leading"in n?!!n.leading:s,l="trailing"in n?!!n.trailing:l),o(e,t,{leading:s,maxWait:t,trailing:l})}function r(e){var t=void 0===e?"undefined":a(e);return!!e&&("object"==t||"function"==t)}function s(e){return!!e&&"object"==(void 0===e?"undefined":a(e))}function l(e){return"symbol"==(void 0===e?"undefined":a(e))||s(e)&&E.call(e)==c}function i(e){if("number"==typeof e)return e;if(l(e))return u;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(p,"");var o=h.test(e);return o||m.test(e)?g(e.slice(2),o?2:8):f.test(e)?u:+e}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d="Expected a function",u=NaN,c="[object Symbol]",p=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,m=/^0o[0-7]+$/i,g=parseInt,_="object"==(void 0===t?"undefined":a(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":a(self))&&self&&self.Object===Object&&self,v=_||y||Function("return this")(),b=Object.prototype,E=b.toString,S=Math.max,j=Math.min,C=function(){return v.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o2});return t<2?p.default.createElement(m.Button,{className:n,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label):p.default.createElement(m.DropdownItem,{type:"button",className:n,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label)}},{key:"render",value:function(){var e=this;if(!this.props.items.length)return null;var t=this.props.actions.filter(function(t){return!t.canApply||t.canApply(e.props.items)});if(t=t.map(this.renderChild),!t.length)return null;var n=this.props,o=n.ActionMenu,r=n.showCount,s=this.props.items.length;return p.default.createElement("div",{className:"bulk-actions fieldholder-small"},r&&p.default.createElement("div",{className:"bulk-actions-counter"},s),t.slice(0,2),t.length>2&&o?p.default.createElement(o,{id:"BulkActions",className:"bulk-actions__more-actions-menu"},t.slice(2)):t.slice(2))}}]),t}(c.Component);b.propTypes={items:v.default.array,actions:v.default.arrayOf(v.default.shape({value:v.default.string.isRequired,label:v.default.string.isRequired,className:v.default.string,destructive:v.default.bool,callback:v.default.func,canApply:v.default.func,confirm:v.default.func})),ActionMenu:v.default.oneOfType([v.default.node,v.default.func]),showCount:v.default.bool},b.defaultProps={items:[],actions:[],ActionMenu:null,total:null,showCount:!0,totalReachedMessage:u.default._t("")};var E=(0,f.connect)(i)(b);t.Component=b,t.default=(0,h.inject)(["ActionMenu"],function(e){return{ActionMenu:e}},function(){return"BulkActions"})(E)},"./client/src/components/GalleryItem/GalleryItem.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e){return e.item.thumbnail&&"image"===e.item.category&&e.item.exists&&!e.item.queuedId&&e.sectionConfig.imageRetry.minRetry&&e.sectionConfig.imageRetry.maxRetry}function u(e,t){if(d(t)){var n=e.assetAdmin.imageLoad,o=n.files.find(function(e){return t.item.thumbnail===e.url});return{loadState:o&&o.status||M.default.NONE}}return{loadState:M.default.DISABLED}}function c(e){return{actions:{imageLoad:(0,T.bindActionCreators)(R,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.File=t.Folder=t.Component=void 0;var p=Object.assign||function(e){for(var t=1;t0}},{key:"missing",value:function(){return!this.exists()&&this.saved()}},{key:"uploading",value:function(){return this.props.item.queuedId&&!this.saved()}},{key:"exists",value:function(){return this.props.item.exists}},{key:"isImage",value:function(){return"image"===this.props.item.category}},{key:"canBatchSelect",value:function(){return this.props.selectable&&this.props.item.canEdit}},{key:"hasError",value:function(){var e=!1;return this.props.item.message&&(e="error"===this.props.item.message.type),e}},{key:"handleActivate",value:function(e){e.stopPropagation(),"function"==typeof this.props.onActivate&&this.saved()&&this.props.onActivate(e,this.props.item)}},{key:"handleSelect",value:function(e){e.stopPropagation(),e.preventDefault(),"function"==typeof this.props.onSelect&&this.props.onSelect(e,this.props.item)}},{key:"handleKeyDown",value:function(e){E.default.SPACE_KEY_CODE===e.keyCode&&(e.preventDefault(),this.canBatchSelect()&&this.handleSelect(e)),E.default.RETURN_KEY_CODE===e.keyCode&&this.handleActivate(e)}},{key:"handleCancelUpload",value:function(e){e.stopPropagation(),e.preventDefault(),this.hasError()?this.props.onRemoveErroredUpload(this.props.item):this.props.onCancelUpload&&this.props.onCancelUpload(this.props.item)}},{key:"render",value:function(){var e=this,t=null,n=null,o=null,r=this.props.item,s=r.id,l=r.queuedId,i=s?"item-"+s:"queued-"+l;if(this.props.selectable&&(this.canBatchSelect()&&(t=this.handleSelect),n="font-icon-tick"),this.uploading())t=this.handleCancelUpload,n="font-icon-cancel";else if(this.exists()){var a=m.default._t("AssetAdmin.DETAILS","Details");o=_.default.createElement("div",{className:"gallery-item--overlay font-icon-edit"},a)}var d=this.props.badge,u={className:"gallery-item__checkbox",type:"checkbox",title:m.default._t("AssetAdmin.SELECT","Select"),tabIndex:-1,onMouseDown:B,id:i},c=["gallery-item__checkbox-label",n];this.canBatchSelect()||(u.disabled=!0,c.push("gallery-item__checkbox-label--disabled"));var f={className:c.join(" "),onClick:t};return _.default.createElement("div",{className:this.getItemClassNames(),"data-id":this.props.item.id,tabIndex:0,role:"button",onKeyDown:this.handleKeyDown,onClick:this.handleActivate},!!d&&_.default.createElement(A.default,{className:"gallery-item__badge",status:d.status,message:d.message}),_.default.createElement("div",{ref:function(t){e.thumbnail=t},className:this.getThumbnailClassNames(),style:this.getThumbnailStyles()},o,this.getStatusFlags()),this.getProgressBar(),this.getErrorMessage(),this.props.children,_.default.createElement("div",{className:"gallery-item__title",ref:function(t){e.title=t}},_.default.createElement("label",p({},f,{htmlFor:i}),_.default.createElement("input",u)),this.props.item.title))}}]),t}(g.Component);H.propTypes={sectionConfig:P.default,item:j.default,loadState:G.default.oneOf(Object.values(M.default)),highlighted:G.default.bool,selected:G.default.bool,isDropping:G.default.bool,isDragging:G.default.bool,message:G.default.shape({value:G.default.string,type:G.default.string}),selectable:G.default.bool,onActivate:G.default.func,onSelect:G.default.func,onCancelUpload:G.default.func,onRemoveErroredUpload:G.default.func,badge:G.default.shape({status:G.default.string,message:G.default.string}),updateStatusFlags:G.default.func,updateProgressBar:G.default.func,updateErrorMessage:G.default.func},H.defaultProps={item:{},sectionConfig:{imageRetry:{}},updateStatusFlags:function(e){return e},updateProgressBar:function(e){return e},updateErrorMessage:function(e){return e}};var q=(0,D.connect)(u,c)(H),z=(0,k.createSelectable)((0,w.default)("GalleryItem")(q)),V=(0,k.createSelectable)((0,F.default)("GalleryItem")(z));t.Component=H,t.Folder=V,t.File=z,t.default=q},"./client/src/components/GalleryItem/GalleryItemDragLayer.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t1?u.default.createElement("div",{key:"1",className:"gallery-item__drag-shadow"}):null,t>2?u.default.createElement("div",{key:"2",className:"gallery-item__drag-shadow gallery-item__drag-shadow--second"}):null];return u.default.createElement("div",{className:"gallery-item__drag-layer"},u.default.createElement("div",{className:"gallery-item__drag-layer-item",style:this.getOffset()},u.default.createElement("div",{className:"gallery-item__drag-layer-preview"},n,u.default.createElement(m.default,i({},e.props,{isDragging:!0}))),t>1?u.default.createElement(_.default,{className:"gallery-item__drag-layer-count",status:"info",message:""+t}):null))}}]),t}(d.Component);y.propTypes={item:p.default.object,offset:p.default.shape({x:p.default.number.isRequired,y:p.default.number.isRequired}),isDragging:p.default.bool.isRequired};var v=function(e){return{item:e.getItem(),offset:e.getInitialClientOffset(),dragged:e.getDifferenceFromInitialOffset(),isDragging:e.isDragging()}};t.default=(0,f.DragLayer)(v)(y)},"./client/src/components/GalleryItem/draggable.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){var t={canDrag:function(e){return e.canDrag},beginDrag:function(e){var t=e.item.id;"function"==typeof e.onDrag&&e.onDrag(!0,t);var n=e.selectedFiles.concat([]);return n.includes(t)||n.push(t),{selected:n,props:e}},endDrag:function(e){var t=e.item.id;"function"==typeof e.onDrag&&e.onDrag(!1,t)}},n=function(e,t){return{connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()}},o=(0,f.DragSource)(e,t,n);return function(e){var t=function(t){function n(){return r(this,n),s(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return l(n,t),a(n,[{key:"componentDidMount",value:function(){this.props.connectDragPreview((0,h.getEmptyImage)(),{captureDraggingState:!0})}},{key:"render",value:function(){var t=this.props.connectDragSource,n=u.default.createElement(e,this.props);return t("string"==typeof n.type?n:u.default.createElement("div",{className:"gallery-item__draggable"},n))}}]),n}(d.Component);return t.propTypes={connectDragSource:p.default.func.isRequired,connectDragPreview:p.default.func.isRequired,item:p.default.shape({id:p.default.number.isRequired}).isRequired,onDrag:p.default.func,selectedFiles:p.default.arrayOf(p.default.number)},o(t)}}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0&&r<100?f.default.createElement("div",{className:"preview-image-field__progress"},f.default.createElement("div",{className:"preview-image-field__progress-bar",style:{width:r+"%"}})):null,i=this.props.upload.message,a=null;return i?a=f.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--"+i.type},i.value):100===r&&(a=f.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--success"},c.default._t("AssetAdmin.REPlACE_FILE_SUCCESS","Upload successful, the file will be replaced when you Save."))),f.default.createElement("div",{className:"editor__thumbnail-container"},s||o,l,a)}},{key:"renderToolbar",value:function(){var e=this.canEdit();return this.props.data.url||e?f.default.createElement("div",{className:"preview-image-field__toolbar fill-height"},this.props.data.url?f.default.createElement("a",{href:this.props.data.url,target:"_blank",rel:"noopener noreferrer",className:this.getButtonClasses("link")},"Open"):null,e?f.default.createElement("button",{id:"preview-replace-button",onClick:this.preventDefault,className:this.getButtonClasses("replace"),type:"button"},"Replace"):null,this.props.upload.progress||this.props.upload.message?f.default.createElement("button",{onClick:this.handleCancelUpload,className:this.getButtonClasses("remove"),type:"button"},"Remove"):null):null}},{key:"render",value:function(){var e=this.getDropzoneProps();if(this.canEdit())return f.default.createElement(m.default,e,this.renderImage(),this.renderToolbar());var t=["preview-image-field__container",this.props.className,this.props.extraClass];return f.default.createElement("div",{className:t.join(" ")},this.renderImage(),this.renderToolbar())}}]),t}(p.Component);x.propTypes={id:A.default.string.isRequired,name:A.default.string,className:A.default.string,extraClass:A.default.string,readOnly:A.default.bool,disabled:A.default.bool,onAutofill:A.default.func,formid:A.default.string,nameValue:A.default.string,data:A.default.shape({id:A.default.number,parentid:A.default.number,version:A.default.number,url:A.default.string,mock:A.default.bool,exists:A.default.bool,preview:A.default.string,category:A.default.string,nameField:A.default.string,uploadFileEndpoint:A.default.shape({url:A.default.string.isRequired,method:A.default.string.isRequired,payloadFormat:A.default.string}),initialValues:A.default.object}).isRequired,upload:A.default.shape({url:A.default.string,progress:A.default.number,xhr:A.default.object,category:A.default.string,message:A.default.shape({type:A.default.string.isRequired,value:A.default.string.isRequired})}),actions:A.default.object,securityID:A.default.string,confirm:A.default.func},x.defaultProps={extraClass:"",className:"",data:{},upload:{},confirm:function(e){return window.confirm(e)}},t.Component=x,t.default=(0,y.connect)(i,a)(x)},"./client/src/components/ProportionConstraintField/ProportionConstraintField.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var i=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:this.props;if("function"==typeof t.onChange){var n=t.files.filter(function(e){return e.id}).map(function(e){return e.id}),o={Files:n};t.onChange(e,{id:t.id,value:o})}}},{key:"handleUploadButton",value:function(e){e.preventDefault()}},{key:"handleAddShow",value:function(e){e.preventDefault(),this.setState({selecting:!0,selectingItem:null})}},{key:"handleHide",value:function(){this.setState({selecting:!1,selectingItem:null})}},{key:"handleAddInsert",value:function(e,t,n){return this.props.actions.uploadField.addFile(this.props.id,n),this.handleHide(),Promise.resolve({})}},{key:"handleInsertMany",value:function(e,t){var n=this;if(this.state.selectingItem)return void this.handleReplace(e,null,t[0]);t.forEach(function(t){n.handleAddInsert(e,null,t)})}},{key:"handleReplace",value:function(e,t,n){var o=this.state.selectingItem,r=this.props,s=r.id,l=r.actions.uploadField,i=l.addFile,a=l.removeFile;if(!o)throw new Error("Tried to replace a file when none was selected.");return a(s,o),i(s,n),this.handleHide(),Promise.resolve({})}},{key:"canEdit",value:function(){return!this.props.disabled&&!this.props.readOnly&&(this.props.data.canUpload||this.props.data.canAttach)}},{key:"canUpload",value:function(){return this.canEdit()&&this.props.data.canUpload}},{key:"canAttach",value:function(){return this.canEdit()&&this.props.data.canAttach}},{key:"renderDropzone",value:function(){var e=this.props.AssetDropzone;if(!this.props.data.createFileEndpoint)return null;var t={height:E.default.SMALL_THUMBNAIL_HEIGHT,width:E.default.SMALL_THUMBNAIL_WIDTH},n=this.getMaxFiles(),o={url:this.props.data.createFileEndpoint.url,method:this.props.data.createFileEndpoint.method,paramName:"Upload",maxFiles:n,thumbnailWidth:E.default.SMALL_THUMBNAIL_WIDTH,thumbnailHeight:E.default.SMALL_THUMBNAIL_HEIGHT},r=["uploadfield__dropzone"];if(0===n&&r.push("uploadfield__dropzone--hidden"),!this.canEdit())return this.props.files.length?null:g.default.createElement("p",null,h.default._t("AssetAdmin.EMPTY","No files"));var s=this.props.securityId,l=[];return this.canUpload()&&l.push(g.default.createElement("button",{key:"uploadbutton",type:"button",onClick:this.handleUploadButton,className:"uploadfield__upload-button"},h.default._t("AssetAdmin.BROWSE","Browse"))),this.canAttach()&&(l.length&&l.push(g.default.createElement("span",{key:"uploadjoin",className:"uploadfield__join"},h.default._t("AssetAdmin.OR","or"))),l.push(g.default.createElement("button",{key:"attachbutton",type:"button",onClick:this.handleAddShow,className:"uploadfield__add-button"},h.default._t("AssetAdmin.ADD_FILES","Add from files")))),g.default.createElement(e,{name:this.props.name,canUpload:this.canUpload(),uploadButton:!1,uploadSelector:".uploadfield__upload-button, .uploadfield__backdrop",folderId:this.props.data.parentid,onAddedFile:this.handleAddedFile,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:t,options:o,securityID:s,className:r.join(" ")},g.default.createElement("div",{className:"uploadfield__backdrop"}),g.default.createElement("span",{className:"uploadfield__droptext"},l))}},{key:"renderModal",value:function(){var e=this.props.InsertMediaModal,t=this.state,n=t.selecting,o=t.selectingItem,r=this.getMaxFiles(),s=this.getFolderId();return g.default.createElement(e,{title:!1,isOpen:n,onInsert:o?this.handleReplace:this.handleAddInsert,onClosed:this.handleHide,onInsertMany:this.handleInsertMany,maxFiles:o?1:r,type:"select",bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",fileAttributes:o?{ID:o.id}:null,folderId:s})}},{key:"renderChild",value:function(e,t){var n=this.props.UploadFieldItem,o={key:e.id?"file-"+e.id:"queued-"+e.queuedId,item:e,name:this.props.name,onRemove:this.handleItemRemove,canEdit:this.canEdit(),onView:this.handleReplaceShow},r=this.props.getItemProps(o,t,this.props);return g.default.createElement(n,r)}},{key:"render",value:function(){return g.default.createElement("div",{className:"uploadfield"},this.renderDropzone(),this.props.files.map(this.renderChild),this.renderModal())}}]),t}(m.Component);x.propTypes={id:A.default.string.isRequired,name:A.default.string.isRequired,onChange:A.default.func,value:A.default.shape({Files:A.default.arrayOf(A.default.number)}),files:A.default.arrayOf(w.default),readOnly:A.default.bool,disabled:A.default.bool,data:A.default.shape({files:A.default.arrayOf(w.default),createFileEndpoint:A.default.shape({url:A.default.string.isRequired,method:A.default.string.isRequired,payloadFormat:A.default.string.isRequired}),multi:A.default.bool,parentid:A.default.number,canUpload:A.default.bool,canAttach:A.default.bool,maxFiles:A.default.number}),UploadFieldItem:A.default.oneOfType([A.default.node,A.default.func]),AssetDropzone:A.default.oneOfType([A.default.node,A.default.func]),InsertMediaModal:A.default.oneOfType([A.default.node,A.default.func]),getItemProps:A.default.func},x.defaultProps={value:{Files:[]},className:"",getItemProps:function(e){return e}};var P=(0,_.connect)(a,d)(x);t.Component=x,t.ConnectedUploadField=P,t.default=(0,y.compose)((0,v.inject)(["UploadFieldItem","AssetDropzone","InsertMediaModal"]),j.default)(P)},"./client/src/components/UploadField/UploadFieldItem.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n0}},{key:"missing",value:function(){return!this.exists()&&this.saved()}},{key:"isImageSmallerThanThumbnail",value:function(){if(!this.isImage()||this.missing())return!1;var e=this.props.item.width,t=this.props.item.height;return t&&e&&t0}).length)return alert(r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_FOLDER","These folders contain files which are currently in use, you must move or delete their contents before you can delete the folder.")),void n("cancelled");var o=e.filter(function(e){return"folder"!==e.type&&e.inUseCount>0}),s=r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_CONFIRM","Are you sure you want to delete these files?");1===e.length&&1===o.length?s=r.default.sprintf(r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to delete it?"),e[0].inUseCount):o.length>0&&(s=r.default.sprintf(r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_MULTI_CONFIRM","There are %s files currently in use, are you sure you want to delete these files?"),o.length)),o.length>0&&(s+="\n\n",s+=r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_WARNING","Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.")),confirm(s)?t():n("cancelled")})})},{value:"edit",label:r.default._t("AssetAdmin.BULK_ACTIONS_EDIT","Edit"),className:"font-icon-edit",destructive:!1,canApply:function(e){return 1===e.length},callback:null},{value:"move",label:r.default._t("AssetAdmin.BULK_ACTIONS_MOVE","Move"),className:"font-icon-folder-move",canApply:function(e){return e.every(function(e){return e&&e.canEdit})},destructive:!1,callback:null},{value:"publish",label:r.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH","Publish"),className:"font-icon-rocket",destructive:!1,callback:null,canApply:function(e){return e.some(function(e){return e&&!e.published})&&e.every(function(e){return e.canEdit&&"folder"!==e.type})},confirm:null},{value:"unpublish",label:r.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH","Unpublish"),className:"font-icon-cancel-circled",destructive:!1,callback:null,canApply:function(e){return e.some(function(e){return e.published})&&e.every(function(e){return e.canEdit&&"folder"!==e.type})},confirm:null},{value:"insert",label:r.default._t("AssetAdmin.BULK_ACTIONS_INSERT","Insert"),className:"font-icon-plus-circled btn-primary",destructive:!1,callback:null,canApply:function(e){return e.length},confirm:null}],BULK_ACTIONS_PLACEHOLDER:r.default._t("AssetAdmin.BULK_ACTIONS_PLACEHOLDER"),SPACE_KEY_CODE:32,RETURN_KEY_CODE:13,DEFAULT_PREVIEW:"framework/client/dist/images/app_icons/generic_92.png",MODAL_MOVE:"MODAL_MOVE"}},"./client/src/containers/AssetAdmin/AssetAdmin.js":function(e,t,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function s(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1&&void 0!==arguments[1])||arguments[1];return S.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:this.props.securityId}}:{}))}},{key:"handleBackButtonClick",value:function(e){e.preventDefault(),this.props.actions.gallery.deselectFiles(),this.props.folder?this.handleOpenFolder(this.props.folder.parentId||0):this.handleOpenFolder(0)}},{key:"resetFile",value:function(e){e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId),this.props.fileId===e.id&&(this.handleCloseFile(),this.handleOpenFile(e.id))}},{key:"handleFolderIcon",value:function(e){e.preventDefault(),this.handleOpenFile(this.getFolderId())}},{key:"handleOpenFile",value:function(e){this.handleBrowse(this.getFolderId(),e,this.props.query)}},{key:"handleSubmitEditor",value:function(e,t,n){var o=this,r=null;if("action_insert"===t&&"select"===this.props.type){var s=this.getFiles(),l=s.find(function(t){return t.id===parseInt(e.ID,10)});return this.props.onInsertMany(null,[l]),Promise.resolve()}if("function"==typeof this.props.onSubmitEditor){var i=this.findFile(this.props.fileId);r=this.props.onSubmitEditor(e,t,n,i)}else r=n();if(!r)throw new Error("Promise was not returned for submitting");return r.then(function(e){return"action_createfolder"===t&&"admin"===o.props.type&&o.handleOpenFile(e.record.id),o.props.actions.files.readFiles().then(function(){return"action_createfolder"===t&&"admin"!==o.props.type&&o.handleOpenFolder(o.getFolderId()),e})})}},{key:"handleCloseFile",value:function(){this.handleBrowse(this.getFolderId(),null,this.props.query)}},{key:"handleOpenFolder",value:function(e){var t=Object.assign({},this.props.query);delete t.page,delete t.filter,this.handleBrowse(e,null,t)}},{key:"handleDelete",value:function(e){var t=this,n=e.map(function(e){var n=t.findFile(e);if(!n)throw new Error("File selected for deletion cannot be found: "+e);return n.queuedId&&t.props.actions.queuedFiles.removeQueuedFile(n.queuedId),n}),o=n.map(function(e){return e.id}),r=this.props.folder?this.props.folder.id:0;return this.props.actions.files.deleteFiles(o).then(function(e){var n=e.data.deleteFiles;return t.handleBrowse(r,null,t.props.query),n})}},{key:"doUnpublish",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=e.map(function(e){var n=t.findFile(e);if(!n)throw new Error("File selected for unpublishing cannot be found: "+e);if("folder"===n.type)throw new Error("Cannot unpublish folders");return n}),r=o.map(function(e){return e.id});return this.props.actions.files.unpublishFiles(r,n).then(function(e){var n=e.data.unpublishFiles,o=n.filter(function(e){return"File"===e.__typename}),r=n.filter(function(e){return"PublicationNotice"===e.__typename&&"HAS_OWNERS"===e.Type}),s=o.map(function(e){return t.resetFile(e),e}),l=r.slice(0,4),i=r.slice(5),a=l.map(function(e){return e.Message});if(i.length&&a.push(C.default.inject(C.default._t("AssetAdmin.BULK_OWNED_WARNING_REMAINING","And {count} other file(s)"),{count:i.length})),l.length){var d=[C.default.inject(C.default._t("AssetAdmin.BULK_OWNED_WARNING_HEADING","{count} file(s) are being used by other published content."),{count:r.length}),a.join("\n"),C.default._t("AssetAdmin.BULK_OWNED_WARNING_FOOTER","Unpublishing will only remove files from the published version of the content. They will remain on the draft version. Unpublish anyway?")];if(confirm(d.join("\n\n"))){var u=r.reduce(function(e,t){return e.concat(t.IDs)},[]);return t.doUnpublish(u,!0).then(function(e){return s.concat(e)})}}return s})}},{key:"handleUnpublish",value:function(e){var t=this;return this.doUnpublish(e).then(function(e){var n=t.props.fileId;t.props.actions.files.readFiles().then(function(){n&&e.find(function(e){return e.id===n})&&(t.handleCloseFile(),t.handleOpenFile(n))})})}},{key:"doPublish",value:function(e){var t=this,n=e.map(function(e){var n=t.findFile(e);if(!n)throw new Error("File selected for publishing cannot be found: "+e);if("folder"===n.type)throw new Error("Cannot publish folders");return n}),o=n.map(function(e){return e.id});return this.props.actions.files.publishFiles(o).then(function(e){return e.data.publishFiles.filter(function(e){return"File"===e.__typename}).map(function(e){return t.resetFile(e),e})})}},{key:"findFile",value:function(e){return this.getFiles().find(function(t){return t.id===parseInt(e,10)})}},{key:"handleUpload",value:function(){}},{key:"handleCreateFolder",value:function(){this.props.onBrowse(this.getFolderId(),null,this.props.query,oe.default.ACTIONS.CREATE_FOLDER)}},{key:"handleMoveFilesSuccess",value:function(e,t){var n=this;this.props.queuedFiles.items.filter(function(e){return t.includes(e.id)}).forEach(function(e){e.queuedId&&n.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}),this.props.actions.gallery.deselectFiles(),this.props.actions.files.readFiles()}},{key:"renderGallery",value:function(){var e=this.props.sectionConfig,t=e.createFileEndpoint.url,n=e.createFileEndpoint.method,o=this.props.query&&parseInt(this.props.query.limit||e.limit,10),r=this.props.query&&parseInt(this.props.query.page||1,10),s=this.props.query&&this.props.query.sort,l=this.props.query&&this.props.query.view,i=this.props.query.filter||{};return g.default.createElement(M.default,{files:this.getFiles(),fileId:this.props.fileId,folderId:this.getFolderId(),folder:this.props.folder,type:this.props.type,limit:o,page:r,totalCount:this.props.filesTotalCount,view:l,filters:i,graphQLErrors:this.props.graphQLErrors,createFileApiUrl:t,createFileApiMethod:n,onDelete:this.handleDelete,onInsertMany:this.props.onInsertMany,onPublish:this.doPublish,onUnpublish:this.doUnpublish,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSuccessfulUpload:this.handleUpload,onCreateFolder:this.handleCreateFolder,onMoveFilesSuccess:this.handleMoveFilesSuccess,onClearSearch:this.handleClearSearch,onSort:this.handleSort,onSetPage:this.handleSetPage,onViewChange:this.handleViewChange,sort:s,sectionConfig:e,loading:this.props.loading,maxFilesSelect:this.props.maxFiles})}},{key:"renderEditor",value:function(){var e=this.props.sectionConfig,t=d({config:e,viewAction:this.props.viewAction,folderId:this.getFolderId(),type:this.props.type,fileId:this.props.fileId}),n=t.schemaUrl,o=t.targetId;return n?g.default.createElement(R.default,{className:this.props.dialog?"editor--dialog":"",targetId:o,file:this.findFile(o),onClose:this.handleCloseFile,schemaUrl:n,schemaUrlQueries:this.props.requireLinkText?[{name:"requireLinkText",value:!0}]:[],onSubmit:this.handleSubmitEditor,onDelete:this.handleDelete,onUnpublish:this.handleUnpublish,addToCampaignSchemaUrl:e.form.addToCampaignForm.schemaUrl}):null}},{key:"render",value:function(){var e=Boolean(this.props.folderId||(0,z.hasFilters)(this.props.query.filter)),t=this.props.sectionConfig.form.fileSearchForm.schemaUrl,n=this.props.query.filter||{},o=(0,O.default)("fill-height asset-admin","select"===this.props.type&&{"asset-admin--single-select":1===this.props.maxFiles,"asset-admin--multi-select":1!==this.props.maxFiles}),r=(0,z.hasFilters)(this.props.query.filter)||this.props.showSearch,s=this.props.actions.displaySearch?this.props.actions.displaySearch.toggleSearch:void 0;return g.default.createElement("div",{className:o},g.default.createElement(H.default,{showBackButton:e,onBackButtonClick:this.handleBackButtonClick},g.default.createElement(G.default,{multiline:!0}),g.default.createElement("div",{className:"asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items"},g.default.createElement(K.default,{toggled:r,onToggle:s}),this.props.toolbarChildren)),r&&g.default.createElement(V.default,{onSearch:this.handleDoSearch,id:"AssetSearchForm",formSchemaUrl:t,onHide:this.handleClearSearch,displayBehavior:"HIDEABLE",filters:n,name:"name"}),g.default.createElement("div",{className:"flexbox-area-grow fill-width fill-height gallery"},this.renderGallery(),this.renderEditor()))}}]),t}(m.Component);le.propTypes={dialog:y.default.bool,sectionConfig:se.default,fileId:y.default.number,folderId:y.default.number,onBrowse:y.default.func,onReplaceUrl:y.default.func,onInsertMany:y.default.func,graphQLErrors:y.default.arrayOf(y.default.string),getUrl:y.default.func,query:y.default.shape({sort:y.default.string,limit:y.default.oneOfType([y.default.number,y.default.string]),page:y.default.oneOfType([y.default.number,y.default.string]),filter:y.default.object}),onSubmitEditor:y.default.func,type:y.default.oneOf(["insert-media","insert-link","select","admin"]),files:y.default.array,queuedFiles:y.default.shape({items:y.default.array.isRequired}),filesTotalCount:y.default.number,folder:y.default.shape({id:y.default.number,title:y.default.string,parents:y.default.array,parentId:y.default.number,canView:y.default.bool,canEdit:y.default.bool}),loading:y.default.bool,actions:y.default.object,maxFiles:y.default.number},le.defaultProps={type:"admin",query:{sort:"",limit:null,page:0,filter:{}},maxFiles:null},t.Component=le,t.getFormSchema=d,t.default=(0,b.compose)((0,v.connect)(c,p),$.default,X.default,J.default,te.default,function(e){return(0,q.withApollo)(e)})(le)},"./client/src/containers/AssetAdmin/AssetAdminRouter.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){var t=e.base,n=e.folderId,o=e.fileId,r=e.query,s=e.action;if(s&&-1===O.indexOf(s))throw new Error("Invalid action provided: "+s);var l=null;return l=o?t+"/show/"+n+"/"+S.default.ACTIONS.EDIT_FILE+"/"+o:n?t+"/show/"+n:t+"/",s===S.default.ACTIONS.CREATE_FOLDER&&(l=t+"/show/"+(n||0)+"/"+s),r&&Object.keys(r).length>0&&(l=l+"?"+b.default.stringify(r)),l}function a(e){return{sectionConfig:e.config.sections.find(function(e){return e.name===w})}}Object.defineProperty(t,"__esModule",{value:!0}),t.buildUrl=t.Component=void 0;var d=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:S.default.ACTIONS.EDIT_FILE,r=parseInt(e||0,10),s=parseInt(t||0,10),l=r!==this.getFolderId(),a=Object.assign({},n);return(l||a.page<=1)&&delete a.page,i({base:this.props.sectionConfig.url,folderId:r,fileId:s,query:a,action:o})}},{key:"getFolderId",value:function(){return this.props.params&&this.props.params.folderId?parseInt(this.props.params.folderId,10):0}},{key:"getFileId",value:function(){return this.props.params&&this.props.params.fileId?parseInt(this.props.params.fileId,10):0}},{key:"getViewAction",value:function(){return this.props.params&&this.props.params.viewAction?this.props.params.viewAction:S.default.ACTIONS.EDIT_FILE}},{key:"getSectionProps",value:function(){return{sectionConfig:this.props.sectionConfig,type:"admin",folderId:this.getFolderId(),viewAction:this.getViewAction(),fileId:this.getFileId(),query:this.getQuery(),getUrl:this.getUrl,onBrowse:this.handleBrowse,onReplaceUrl:this.handleReplaceUrl}}},{key:"getQuery",value:function(){return(0,y.decodeQuery)(this.props.location.search)}},{key:"handleBrowse",value:function(e,t,n,o){var r=this.getUrl(e,t,n,o);this.props.router.push(r)}},{key:"handleReplaceUrl",value:function(e,t,n,o){var r=this.getUrl(e,t,n,o);this.props.router.replace(r)}},{key:"render",value:function(){return this.props.sectionConfig?c.default.createElement(_.default,this.getSectionProps()):null}}]),t}(u.Component);F.propTypes={sectionConfig:C.default,location:f.default.shape({pathname:f.default.string,query:f.default.object,search:f.default.string}),params:f.default.object,router:f.default.object},t.Component=F,t.buildUrl=i,t.default=(0,m.withRouter)((0,h.connect)(a)(F))},"./client/src/containers/AssetAdmin/stateRouter.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){function t(t){var n=t.config.sections.find(function(e){return e.name===_});return{Component:e,sectionConfig:n}}return(0,f.connect)(t)(v)}Object.defineProperty(t,"__esModule",{value:!0}),t.AssetAdminStateRouter=void 0;var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:g.default.ACTIONS.EDIT_FILE,r=parseInt(e||0,10),s=parseInt(t||0,10),l=this.getFolderId(),i=r!==l&&null!==l,a=Object.assign({},n);return(i||a.page<=1)&&delete a.page,(0,h.buildUrl)({base:this.props.sectionConfig.url,folderId:r,fileId:s,query:a,action:o})}},{key:"getFolderId",value:function(){return null===this.state.folderId?null:parseInt(this.state.folderId||0,10)}},{key:"getFileId",value:function(){return parseInt(this.state.fileId||this.props.fileId||0,10)}},{key:"getViewAction",value:function(){return this.state.action||g.default.ACTIONS.EDIT_FILE}},{key:"getSectionProps",value:function(){var e=Object.assign({},this.props,{folderId:this.getFolderId(),fileId:this.getFileId(),viewAction:this.getViewAction(),query:this.state.query,getUrl:this.getUrl,onBrowse:this.handleBrowse});return delete e.Component,e}},{key:"handleBrowse",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:g.default.ACTIONS.EDIT_FILE;if(o&&-1===Object.values(g.default.ACTIONS).indexOf(o))throw new Error("Invalid action provided: "+o);this.setState({folderId:e,fileId:t,query:n,action:o})}},{key:"render",value:function(){var e=this.getSectionProps(),t=this.props.Component;return u.default.createElement(t,e)}}]),t}(d.Component);v.propTypes={Component:p.default.oneOfType([p.default.element,p.default.func]),sectionConfig:p.default.shape({url:p.default.string.isRequired}).isRequired,fileId:p.default.number},t.AssetAdminStateRouter=v,t.default=i},"./client/src/containers/Editor/Editor.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return{actions:{unsavedForms:(0,f.bindActionCreators)(j,e)}}}function a(e){return{enableDropzone:e.assetAdmin.gallery.enableDropzone}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var d=function(){function e(e,t){for(var n=0;n0&&(o=c.default.sprintf(c.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to delete it?"),this.props.file.inUseCount),o+="\n\n",o+=c.default._t("AssetAdmin.BULK_ACTIONS_DELETE_WARNING","Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.")),confirm(o)&&(this.props.actions.unsavedForms.removeFormChanged("AssetAdmin.EditForm"),this.props.onDelete([t.ID])),e.preventDefault()}}},{key:"handleCancelKeyDown",value:function(e){e.keyCode!==_.default.SPACE_KEY_CODE&&e.keyCode!==_.default.RETURN_KEY_CODE||this.handleClose(e)}},{key:"handleSubmit",value:function(e,t,n){return"function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,n):n()}},{key:"handleClose",value:function(e){this.props.onClose(),this.closeModal(),e&&e.preventDefault()}},{key:"openModal",value:function(){this.setState({openModal:!0})}},{key:"closeModal",value:function(){this.setState({openModal:!1})}},{key:"handleLoadingError",value:function(e){this.setState({loadingForm:!1,loadingError:e.errors[0]})}},{key:"handleLoadingSuccess",value:function(){this.setState({loadingForm:!1,loadingError:null})}},{key:"handleFetchingSchema",value:function(){this.setState({loadingForm:!0})}},{key:"renderCancelButton",value:function(){return m.default.createElement("a",{role:"button",tabIndex:0,className:"btn btn--close-panel btn--no-text font-icon-cancel btn--icon-xl",onClick:this.handleClose,onKeyDown:this.handleCancelKeyDown,type:"button","aria-label":c.default._t("AssetAdmin.CANCEL")})}},{key:"render",value:function(){var e=this.props.schemaUrlQueries.map(function(e){return e.name+"="+e.value}).join("&").trim();e=e?"?"+e:"";var t=this.props.schemaUrl+"/"+this.props.targetId+e,n=this.props.addToCampaignSchemaUrl+"/"+this.props.targetId,o=["panel","form--no-dividers","editor"];this.props.className&&o.push(this.props.className),this.props.enableDropzone||o.push("editor--asset-dropzone--disable");var r=null;if(this.state.loadingError){var s=this.state.loadingError.value;404===this.state.loadingError.code&&(s=c.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),s||(s=c.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")),r=m.default.createElement("div",{className:"editor__file-preview-message--file-missing"},s)}var l=c.default._t("Admin.ADD_TO_CAMPAIGN","Add to campaign");return m.default.createElement("div",{className:o.join(" ")},m.default.createElement("div",{className:"editor__details fill-height"},m.default.createElement(v.default,{identifier:"AssetAdmin.EditForm",schemaUrl:t,afterMessages:this.renderCancelButton(),onSubmit:this.handleSubmit,onAction:this.handleAction,onLoadingSuccess:this.handleLoadingSuccess,onLoadingError:this.handleLoadingError,onFetchingSchema:this.handleFetchingSchema}),r,m.default.createElement(E.default,{title:l,identifier:"AssetAdmin.AddToCampaign",isOpen:this.state.openModal,onClosed:this.closeModal,schemaUrl:n,bodyClassName:"modal__dialog",responseClassBad:"modal__response modal__response--error",responseClassGood:"modal__response modal__response--good"}),this.state.loadingForm&&[m.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),m.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})]))}}]),t}(h.Component);I.propTypes={file:w.default,className:F.default.string,targetId:F.default.number.isRequired,enableDropzone:F.default.bool,onClose:F.default.func.isRequired,onSubmit:F.default.func.isRequired,onDelete:F.default.func.isRequired,schemaUrl:F.default.string.isRequired,schemaUrlQueries:F.default.arrayOf(F.default.shape({name:F.default.string,value:F.default.any})),addToCampaignSchemaUrl:F.default.string,actions:F.default.object},t.Component=I,t.default=(0,p.connect)(a,i)(I)},"./client/src/containers/Gallery/Gallery.js":function(e,t,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){var n=t.sort,o=e.assetAdmin.gallery,r=o.selectedFiles,s=o.errorMessage,l=o.noticeMessage,i=o.enableDropzone,a=o.badges,d=o.concatenateSelect,u=o.loading,c=o.sorters,p=o.lastSelected;return!n&&c&&c[0]&&(n=c[0].field+","+c[0].direction),{lastSelected:p,selectedFiles:r,errorMessage:s,noticeMessage:l,enableDropzone:i,badges:a,concatenateSelect:d,loading:t.loading||u,queuedFiles:e.assetAdmin.queuedFiles,securityId:e.config.SecurityID,sorters:c,sort:n}}function d(e){return{actions:{gallery:(0,O.bindActionCreators)(G,e),queuedFiles:(0,O.bindActionCreators)(H,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.galleryViewDefaultProps=t.galleryViewPropTypes=t.Component=void 0;var u=Object.assign||function(e){for(var t=1;t=s&&t<=l}).map(function(e){return e.id})}},{key:"getSelectableFiles",value:function(){var e=this.props.files.filter(function(e){return e.id});return"select"===this.props.type?e.filter(function(e){return"folder"!==e.type}):e}},{key:"handleBulkInsert",value:function(e,t){this.props.onInsertMany(e,t)}},{key:"handleBulkDelete",value:function(e,t){var n=this;return this.props.onDelete(t.map(function(e){return e.id})).then(function(e){var o=e.filter(function(e){return e}).length;o!==t.length?(n.props.actions.gallery.setErrorMessage(g.default.sprintf(g.default._t("AssetAdmin.BULK_ACTIONS_DELETE_FAIL","%s folders/files were successfully deleted, but %s files were not able to be deleted."),o,t.length-o)),n.props.actions.gallery.setNoticeMessage(null)):(n.props.actions.gallery.setNoticeMessage(g.default.sprintf(g.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SUCCESS","%s folders/files were successfully deleted."),o)),n.props.actions.gallery.setErrorMessage(null),n.props.actions.gallery.deselectFiles())})}},{key:"handleBulkPublish",value:function(e,t){var n=this,o=t.map(function(e){return e.id});return o.length?(this.props.actions.gallery.setLoading(!0),this.props.onPublish(o).then(function(e){n.props.actions.gallery.setLoading(!1),n.props.actions.gallery.setNoticeMessage(g.default.sprintf(g.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH_SUCCESS","%s folders/files were successfully published."),e.length)),n.props.actions.gallery.setErrorMessage(null),n.props.actions.gallery.deselectFiles()})):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}},{key:"handleBulkUnpublish",value:function(e,t){var n=this,o=t.filter(function(e){return e.published}).map(function(e){return e.id});return o.length?(this.props.actions.gallery.setLoading(!0),this.props.onUnpublish(o).then(function(e){n.props.actions.gallery.setLoading(!1),n.props.actions.gallery.setNoticeMessage(g.default.sprintf(g.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_SUCCESS","%s folders/files were successfully unpublished."),e.length)),n.props.actions.gallery.setErrorMessage(null),n.props.actions.gallery.deselectFiles()})):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}},{key:"initSortDropdown",value:function(){if("tile"===this.props.view){var e=this.getSortElement();e.chosen({allow_single_deselect:!0,disable_search_threshold:20}),e.off("change"),e.on("change",function(){return S.default.Simulate.click(e.find(":selected")[0])})}}},{key:"handleSort",value:function(e){this.props.actions.queuedFiles.purgeUploadQueue(),this.props.onSort(e)}},{key:"handleSetPage",value:function(e){this.props.onSetPage(e)}},{key:"handleCancelUpload",value:function(e){e.xhr.abort(),this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}},{key:"handleRemoveErroredUpload",value:function(e){this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}},{key:"handleAddedFile",value:function(e){this.props.actions.queuedFiles.addQueuedFile(e)}},{key:"handlePreviewLoaded",value:function(e,t){this.props.actions.queuedFiles.updateQueuedFile(e.queuedId,t)}},{key:"handleSending",value:function(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{xhr:t})}},{key:"handleUploadProgress",value:function(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{progress:t})}},{key:"handleSuccessfulUpload",value:function(e){var t=JSON.parse(e.xhr.response);if(void 0!==t[0].error)return void this.handleFailedUpload(e);this.props.actions.queuedFiles.succeedUpload(e._queuedId,t[0]),this.props.onSuccessfulUpload&&this.props.onSuccessfulUpload(t);var n=this.props.queuedFiles.items.reduce(function(e,t){return 100!==t.progress?e+1:e},0);if(!this.props.fileId&&!this.props.selectedFiles.length&&0===n){var o=t.pop();this.props.onOpenFile(o.id)}}},{key:"handleFailedUpload",value:function(e,t){this.props.actions.queuedFiles.failUpload(e._queuedId,t)}},{key:"itemIsSelected",value:function(e){return this.props.selectedFiles.indexOf(e)>-1}},{key:"toggleSelectConcat",value:function(e){this.props.actions.gallery.setConcatenateSelect(this.isConcat(e))}},{key:"isConcat",value:function(e){return e.metaKey||e.ctrlKey||e.shiftKey}},{key:"itemIsHighlighted",value:function(e){return this.props.fileId===e}},{key:"hasOpenedItem",value:function(){return!!this.props.fileId}},{key:"handleClearSearch",value:function(e){this.props.onClearSearch(e)}},{key:"handleGroupSelect",value:function(e,t){var n=this,o=this.props.actions.gallery,r=o.setSelectedFiles,s=o.selectFiles,l=this.getSelectableFiles(),i=e.filter(function(t,n){return e.indexOf(t)===n&&l.find(function(e){return e.id===t})}),a=this.props.concatenateSelect||this.isConcat(t);if(null!==this.props.maxFilesSelect){var d=i.length;if(a&&(d=this.props.selectedFiles.filter(function(e){return!n.props.selectedFiles.includes(e)}).concat(this.props.selectedFiles).length),d>=this.props.maxFilesSelect)return}a?r(i):s(i)}},{key:"handleClearSelection",value:function(){this.props.actions.gallery.deselectFiles()}},{key:"handleOpenFolder",value:function(e,t){e.preventDefault(),this.props.actions.gallery.setErrorMessage(null),this.props.actions.gallery.setNoticeMessage(null),this.props.onOpenFolder(t.id)}},{key:"handleOpenFile",value:function(e,t){e.preventDefault(),null!==t.created&&(this.props.selectedFiles.length&&1!==this.props.maxFilesSelect||"select"!==this.props.type||this.handleSelect(e,t),this.props.onOpenFile(t.id,t))}},{key:"handleSelect",value:function(e,t){var n=this.props.maxFilesSelect,o=this.getSelectableFiles(),r=o.filter(function(e){return e.id===t.id}).map(function(e){return e.id});if(1===n)return void this.props.actions.gallery.setSelectedFiles(r);if(-1===this.props.selectedFiles.indexOf(t.id)){if(e.shiftKey&&(r=this.getSelection(this.props.lastSelected,t.id)),this.props.selectedFiles.filter(function(e){return!r.includes(e)}).concat(r).length>n&&null!==n)return;this.props.actions.gallery.selectFiles(r),this.props.actions.gallery.setLastSelected(t.id)}else this.props.actions.gallery.deselectFiles([t.id]),e.shiftKey&&this.props.actions.gallery.setLastSelected(null)}},{key:"handleEnableDropzone",value:function(e){this.props.actions.gallery.setEnableDropzone(e)}},{key:"handleMoveFiles",value:function(e,t){var n=this;this.props.actions.files.moveFiles(e,t).then(function(){var o=R.default.MOVE_SUCCESS_DURATION,r="+"+t.length;n.props.actions.gallery.setFileBadge(e,r,"success",o),"function"==typeof n.props.onMoveFilesSuccess&&n.props.onMoveFilesSuccess(e,t)}).catch(function(){n.props.actions.gallery.setErrorMessage(g.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))})}},{key:"handleBulkEdit",value:function(e,t){this.handleOpenFile(e,t[0])}},{key:"handleBulkMove",value:function(){this.props.actions.gallery.activateModal(R.default.MODAL_MOVE)}},{key:"renderTransitionBulkActions",value:function(){return y.default.createElement(C.default,{transitionName:"bulk-actions",transitionEnterTimeout:R.default.CSS_TRANSITION_TIME,transitionLeaveTimeout:R.default.CSS_TRANSITION_TIME},this.renderBulkActions())}},{key:"renderBulkActions",value:function(){var e=this,t="select"===this.props.type?function(e){return"insert"===e.value}:function(e){return"insert"!==e.value},n=R.default.BULK_ACTIONS.filter(t).map(function(t){if(t.callback)return t;switch(t.value){case"delete":return u({},t,{callback:e.handleBulkDelete});case"edit":return u({},t,{callback:e.handleBulkEdit});case"move":return u({},t,{callback:e.handleBulkMove});case"publish":return u({},t,{callback:e.handleBulkPublish});case"unpublish":return u({},t,{callback:e.handleBulkUnpublish});case"insert":return u({},t,{callback:e.handleBulkInsert});default:return t}}),o=this.props.selectedFiles.map(function(t){return e.props.files.find(function(e){return e&&t===e.id})}).filter(function(e){return e});return o.length>0&&["admin","select"].includes(this.props.type)?y.default.createElement(x.default,{actions:n,items:o,total:this.props.maxFilesSelect,key:o.length>0,container:this.gallery,showCount:1!==this.props.maxFilesSelect}):null}},{key:"renderGalleryView",value:function(){var e=this,t="table"===this.props.view?k.default:D.default,n=this.props.files.map(function(t){return u({},t,{selected:e.itemIsSelected(t.id),highlighted:e.itemIsHighlighted(t.id)})}),o=this.props,r=o.type,s=o.loading,l=o.page,i=o.totalCount,a=o.limit,d=o.sort,c=o.selectedFiles,p=o.badges,f={selectableItems:["admin","select"].includes(r),selectableFolders:"select"!==this.props.type,files:n,loading:s,page:l,totalCount:i,limit:a,sort:d,selectedFiles:c,badges:p,onSort:this.handleSort,onSetPage:this.handleSetPage,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSelect:this.handleSelect,onCancelUpload:this.handleCancelUpload,onDropFiles:this.handleMoveFiles,onRemoveErroredUpload:this.handleRemoveErroredUpload,onEnableDropzone:this.handleEnableDropzone,sectionConfig:this.props.sectionConfig,canDrag:"admin"===this.props.type,maxFilesSelect:this.props.maxFilesSelect};return y.default.createElement(t,f)}},{key:"renderToolbar",value:function(){var e=this.props,t=e.GalleryToolbar,n=e.sort,o=e.view,r=e.folder,s=e.onCreateFolder,l=e.onOpenFolder,i=e.onViewChange,a={onMoveFiles:this.handleMoveFiles,onSort:this.handleSort,onCreateFolder:s,onOpenFolder:l,onViewChange:i,view:o,sort:n,folder:r};return y.default.createElement(t,a)}},{key:"render",value:function(){var e=this,t=this.props,n=t.folder,o=t.loading,r=t.errorMessage,s=t.graphQLErrors,l=t.noticeMessage,i=s&&s.length>0;if(!n)return r||i?y.default.createElement("div",{className:"gallery__error flexbox-area-grow"},y.default.createElement("div",{className:"gallery__error-message"},y.default.createElement("h3",null,g.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error.")),r&&y.default.createElement("p",null,r),i&&s.map(function(e,t){return y.default.createElement("p",{key:t},e)}))):o?y.default.createElement("div",{className:"flexbox-area-grow"},y.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),y.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})):y.default.createElement("div",{className:"flexbox-area-grow"},y.default.createElement("div",{className:"editor__file-preview-message--file-missing m-t-3"},g.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")));var a=y.default.createElement("div",{className:"gallery_messages"},r&&y.default.createElement(M.default,{value:r,type:"danger"}),l&&y.default.createElement(M.default,{value:l,type:"success"})),d={height:R.default.THUMBNAIL_HEIGHT,width:R.default.THUMBNAIL_WIDTH},c=u({url:this.props.createFileApiUrl,method:this.props.createFileApiMethod,paramName:"Upload",clickable:"#upload-button"},this.props.sectionConfig.dropzoneOptions),p=this.props.securityId,f=this.props.folder.canEdit&&this.props.enableDropzone,h=["panel","panel--padded","panel--scrollable","gallery__main","fill-height"];"insert"===this.props.type&&h.push("insert-media-modal__main");var m=h;return this.hasOpenedItem()&&m.push("gallery__main--has-opened-item"),y.default.createElement("div",{className:"flexbox-area-grow gallery__outer",ref:function(t){e.gallery=t}},this.renderTransitionBulkActions(),y.default.createElement(Q.default,{className:h.join(" ")},this.renderToolbar(),y.default.createElement(W.SelectableGroup,{enabled:"tile"===this.props.view&&"admin"===this.props.type,className:"flexbox-area-grow fill-height gallery__main--selectable",onSelection:this.handleGroupSelect,onNonItemClick:this.handleClearSelection,preventDefault:!1,fixedPosition:!0},y.default.createElement(I.default,{name:"gallery-container",className:"flexbox-area-grow",canUpload:f,onAddedFile:this.handleAddedFile,onPreviewLoaded:this.handlePreviewLoaded,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:d,folderId:this.props.folderId,options:c,securityID:p,uploadButton:!1},a,this.renderGalleryView()))),this.props.loading&&[y.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),y.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})],y.default.createElement(Z.default,{sectionConfig:this.props.sectionConfig,folderId:this.props.folderId,onSuccess:this.props.onMoveFilesSuccess,onOpenFolder:this.props.onOpenFolder}))}}]),t}(_.Component),oe={page:1,limit:15},re={sectionConfig:Y.default,loading:te.default.bool,sort:te.default.string,files:te.default.arrayOf(te.default.shape({id:te.default.number,parent:te.default.shape({id:te.default.number})})).isRequired,selectedFiles:te.default.arrayOf(te.default.number),totalCount:te.default.number,page:te.default.number,limit:te.default.number,badges:te.default.arrayOf(te.default.shape({id:te.default.number,message:te.default.node,status:te.default.string})),onOpenFile:te.default.func.isRequired,onOpenFolder:te.default.func.isRequired,onSort:te.default.func.isRequired,onSetPage:te.default.func.isRequired,maxFilesSelect:te.default.number},se=Object.assign({},oe,{selectableItems:!1}),le=Object.assign({},re,{selectableItems:te.default.bool,selectableFolders:te.default.bool,onSelect:te.default.func,onCancelUpload:te.default.func,onDelete:te.default.func,onRemoveErroredUpload:te.default.func,onEnableDropzone:te.default.func});ne.defaultProps=Object.assign({},oe,{type:"admin",view:"tile",enableDropzone:!0}),ne.propTypes=Object.assign({},re,{onUploadSuccess:te.default.func,onCreateFolder:te.default.func,onMoveFilesSuccess:te.default.func,onDelete:te.default.func,onPublish:te.default.func,onUnpublish:te.default.func,type:te.default.oneOf(["insert-media","insert-link","select","admin"]),view:te.default.oneOf(["tile","table"]),lastSelected:te.default.number,dialog:te.default.bool,fileId:te.default.number,folderId:te.default.number.isRequired,folder:te.default.shape({id:te.default.number,title:te.default.string,parentId:te.default.number,canView:te.default.bool,canEdit:te.default.bool}),files:te.default.array,errorMessage:te.default.string,graphQLErrors:te.default.arrayOf(te.default.string),actions:te.default.object,securityId:te.default.string,onViewChange:te.default.func.isRequired,createFileApiUrl:te.default.string,createFileApiMethod:te.default.string,search:te.default.object,enableDropzone:te.default.bool,concatenateSelect:te.default.bool,GalleryToolbar:te.default.func,sorters:te.default.arrayOf(te.default.shape({field:te.default.string.isRequired,direction:te.default.oneOf(["asc","desc"]).isRequired,label:te.default.string.isRequired})).isRequired}),t.Component=ne,t.galleryViewPropTypes=le,t.galleryViewDefaultProps=se,t.default=(0,O.compose)((0,J.inject)(["GalleryToolbar"],null,function(){return"AssetAdmin.Gallery"}),(0,w.connect)(a,d),z.default,function(e){return(0,V.withApollo)(e)})(ne)},"./client/src/containers/Gallery/GalleryDND.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1])||arguments[1];return h.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:g.default.get("SecurityID")}}:{}))},w=function(e){function t(e){r(this,t);var n=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={detailView:null,history:[],loadedDetails:!1},n.handleClick=n.handleClick.bind(n),n.handleBack=n.handleBack.bind(n),n.timer=null,n.api=C(e.sectionConfig.historyEndpoint),n}return l(t,e),d(t,[{key:"componentDidMount",value:function(){this.refreshHistoryIfNeeded()}},{key:"componentWillReceiveProps",value:function(e){this.refreshHistoryIfNeeded(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timer),this.timer=null}},{key:"refreshHistoryIfNeeded",value:function(e){var t=this;if(!e&&!this.state.loadedDetails||e.data.fileId!==this.props.data.fileId||e.data.latestVersionId!==this.props.data.latestVersionId){this.setState({loadedDetails:!1});var n=e?e.data.fileId:this.props.data.fileId;clearTimeout(this.timer),this.timer=setTimeout(function(){t.api({fileId:n}).then(function(e){t.timer&&t.setState({history:e,loadedDetails:!0})})},250)}}},{key:"handleClick",value:function(e){this.setState({viewDetails:e})}},{key:"handleBack",value:function(e){e.preventDefault(),this.setState({viewDetails:null})}},{key:"render",value:function(){var e=this;if(!this.state.loadedDetails)return c.default.createElement("div",{className:"history-list history-list--loading"},"Loading...");if(this.state.viewDetails){var t=[this.props.historySchemaUrl,this.props.data.fileId,this.state.viewDetails].join("/"),n=["btn","btn-secondary","btn--icon-xl","btn--no-text","font-icon-left-open-big","history-list__back"].join(" ");return c.default.createElement("div",{className:"history-list"},c.default.createElement("a",{href:"#",className:n,onClick:this.handleBack}),c.default.createElement(b.default,{identifier:"AssetAdmin.HistoryList",schemaUrl:t}))}var o=this.state.history||[];return c.default.createElement("div",{className:"history-list"},c.default.createElement("ul",{className:"list-group list-group-flush history-list__list"},o.map(function(t){return c.default.createElement(y.default,a({key:t.versionid},t,{onClick:e.handleClick}))})))}}]),t}(u.Component);w.propTypes={sectionConfig:S.default.shape({form:S.default.object,historyEndpoint:S.default.shape({url:S.default.string,method:S.default.string,responseFormat:S.default.string})}),historySchemaUrl:S.default.string,data:S.default.object},w.defaultProps={data:{fieldId:0}},t.Component=w,t.default=(0,p.connect)(i)(w)},"./client/src/containers/MoveModal/MoveModal.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){var t=e.assetAdmin.gallery,n=t.modal,o=t.selectedFiles;return{isOpen:n===_.default.MODAL_MOVE,selectedFiles:o,title:m.default.sprintf(m.default._t("AssetAdmin.MOVE_ITEMS_TO","Move %s item(s) to..."),o.length)}}function a(e){return{onClosed:function(){e((0,b.deactivateModal)())},setNotice:function(t){e((0,b.setNoticeMessage)(t))},setError:function(t){e((0,b.setErrorMessage)(t))},setBadge:function(){e(b.setFileBadge.apply(void 0,arguments))}}}Object.defineProperty(t,"__esModule",{value:!0});var d=function(){function e(e,t){for(var n=0;n0)return c.default.createElement("div",{className:"gallery__progress-bar--complete"});var t={className:"gallery__progress-bar-progress",style:{width:e.progress+"%"}};return c.default.createElement("div",{className:"gallery__progress-bar"},c.default.createElement("div",t))}},{key:"renderTitle",value:function(e){var t=this.renderProgressBar(e.rowData);return c.default.createElement("div",{className:"fill-width"},c.default.createElement("div",{className:"flexbox-area-grow"},e.data),t)}},{key:"renderSelect",value:function(e){if(this.props.selectableItems&&(this.props.selectableFolders||"folder"!==e.rowData.type)){var t={type:"checkbox",title:_.default._t("AssetAdmin.SELECT"),checked:e.data,tabIndex:-1,onMouseDown:this.preventFocus};return![null,1].includes(this.props.maxFilesSelect)&&this.props.selectedFiles.length>=this.props.maxFilesSelect&&!e.data&&(t.disabled=!0),c.default.createElement("input",t)}return null}},{key:"renderDate",value:function(e){return"folder"===e.rowData.type?null:c.default.createElement("span",null,e.data)}},{key:"renderThumbnail",value:function(e){var t=e.data||e.rowData.url,n=e.rowData.queuedId&&!e.rowData.id,o=e.rowData.category||"false",r="gallery__table-image",s=[r],l={};return s.push(r+"--"+o),"image"===o&&t&&(l.backgroundImage='url("'+t+'")'),n||t||"folder"===o||s.push(r+"--error"),c.default.createElement("div",{className:s.join(" "),style:l})}},{key:"render",value:function(){return c.default.createElement(m.default,this.getTableProps())}}]),t}(u.Component);b.defaultProps=y.galleryViewDefaultProps,b.propTypes=i({},y.galleryViewPropTypes,{sort:f.default.string.isRequired}),t.Component=b,t.default=b},"./client/src/containers/ThumbnailView/ThumbnailView.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var i=Object.assign||function(e){for(var t=1;t=this.props.maxFilesSelect,b=1===this.props.maxFilesSelect?c.onActivate:this.props.onSelect;c=i({},c,{selectable:!0,onSelect:b,maxSelected:v})}if("folder"===e.type){var E=this.props.onDropFiles;return c=i({},c,{onDropFiles:E}),p.default.createElement(o,c)}return p.default.createElement(n,c)}},{key:"render",value:function(){return p.default.createElement("div",{className:"gallery__main-view--tile"},p.default.createElement("div",{className:"gallery__folders"},this.props.files.filter(this.folderFilter).map(this.renderItem)),p.default.createElement("div",{className:"gallery__files"},this.props.files.filter(this.fileFilter).map(this.renderItem)),0===this.props.files.length&&!this.props.loading&&p.default.createElement("p",{className:"gallery__no-item-notice"},u.default._t("AssetAdmin.NOITEMSFOUND")),p.default.createElement("div",{className:"gallery__load"},this.renderPagination()))}}]),t}(c.Component);v.defaultProps=h.galleryViewDefaultProps,v.propTypes=i({},h.galleryViewPropTypes,{File:y.default.oneOfType([y.default.node,y.default.func]).isRequired,Folder:y.default.oneOfType([y.default.node,y.default.func]).isRequired});var b=(0,f.inject)(["GalleryItemFile","GalleryItemFolder"],function(e,t){return{File:e,Folder:t}},function(){return"AssetAdmin.Gallery.ThumbnailView"});t.Component=v,t.default=b(v)},"./client/src/entwine/UploadField/UploadFieldEntwine.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var r=Object.assign||function(e){for(var t=1;t
');this.before(n),t=n[0]}return t},onunmatch:function(){this._super(),u.default.unmountComponentAtNode(this.siblings(".uploadfield-holder")[0])},onmatch:function(){var e=this.closest(".cms-content").attr("id"),t=e?{context:e}:{},n=(0,p.loadComponent)("UploadField",t);this.setComponent(n),this._super(),this.hide(),this.refresh()},onclick:function(e){e.preventDefault()},refresh:function(){var t=this.getAttributes(),n=e(this).closest("form"),o=function(){setTimeout(function(){n.trigger("change")},0)},s=this.getComponent();u.default.render(a.default.createElement(s,r({},t,{onChange:o,noHolder:!0})),this.getContainer())},getAttributes:function(){var t=e(this).data("state"),n=e(this).data("schema");return(0,c.schemaMerge)(n,t)}})})},"./client/src/lib/configShape.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),r=function(e){return e&&e.__esModule?e:{default:e}}(o),s=r.default.shape({url:r.default.string,limit:r.default.number,imageRetry:r.default.shape({minRetry:r.default.number,maxRetry:r.default.number,expiry:r.default.number}),form:r.default.object,dropzoneOptions:r.default.object});t.default=s},"./client/src/lib/fileFragments.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileInterface="\n fragment FileInterfaceFields on FileInterface {\n canDelete\n canEdit\n canView\n category\n exists\n filename\n id\n lastEdited\n name\n parentId\n title\n type\n url\n }\n",t.file="\n fragment FileFields on File {\n draft\n extension\n published\n modified\n size\n smallThumbnail\n thumbnail\n inUseCount\n }\n",t.folder="\n fragment FolderFields on Folder {\n filesInUseCount\n }\n"},"./client/src/lib/fileShape.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),r=function(e){return e&&e.__esModule?e:{default:e}}(o),s=r.default.shape({canEdit:r.default.bool,canDelete:r.default.bool,canView:r.default.bool,exists:r.default.bool,type:r.default.string,smallThumbnail:r.default.string,thumbnail:r.default.string,width:r.default.number,height:r.default.number,category:r.default.oneOfType([r.default.bool,r.default.string]),id:r.default.number,inUseCount:r.default.number,url:r.default.string,title:r.default.string,progress:r.default.number});t.default=s},"./client/src/lib/fileStructure.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(14),r=function(e){return e&&e.__esModule?e:{default:e}}(o),s=(0,r.default)({name:null,canDelete:!1,canEdit:!1,category:null,created:null,extension:null,filename:null,id:0,lastEdited:null,messages:null,owner:{id:0,title:null},parent:{filename:null,id:0,title:null},queuedId:null,size:null,title:null,type:null,url:null,xhr:null,thumbnail:null,smallThumbnail:null,height:null,width:null});t.default=s},"./client/src/state/displaySearch/DisplaySearchActionTypes.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={TOGGLE_SEARCH:"TOGGLE_SEARCH",OPEN_SEARCH:"OPEN_SEARCH",CLOSE_SEARCH:"CLOSE_SEARCH"}},"./client/src/state/displaySearch/DisplaySearchActions.js":function(e,t,n){"use strict";function o(){return{type:i.default.TOGGLE_SEARCH,payload:null}}function r(){return{type:i.default.OPEN_SEARCH,payload:null}}function s(){return{type:i.default.CLOSE_SEARCH,payload:null}}Object.defineProperty(t,"__esModule",{value:!0}),t.toggleSearch=o,t.openSearch=r,t.closeSearch=s;var l=n("./client/src/state/displaySearch/DisplaySearchActionTypes.js"),i=function(e){return e&&e.__esModule?e:{default:e}}(l)},"./client/src/state/displaySearch/DisplaySearchReducer.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;switch(arguments[1].type){case d.default.TOGGLE_SEARCH:return(0,i.default)(s({},e,{isOpen:!e.isOpen}));case d.default.OPEN_SEARCH:return(0,i.default)(s({},e,{isOpen:!0}));case d.default.CLOSE_SEARCH:return(0,i.default)(s({},e,{isOpen:!1}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return n({variables:{IDs:e,Quiet:o,Force:t}})};return{actions:r({},s,{files:r({},s.files,o({},e,l))})}}}}};t.default=d},"./client/src/state/files/deleteFilesMutation.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.mutation=void 0;var o=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t({type:y.default.SELECT_FILES,payload:{ids:e}})}}function i(e){return function(t){return t({type:y.default.CONCATENATE_SELECT,payload:!!e})}}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t({type:y.default.DESELECT_FILES,payload:{ids:e}})}}function d(e){return function(t){return t({type:y.default.SET_NOTICE_MESSAGE,payload:{message:e}})}}function u(e){return function(t){return t({type:y.default.SET_ERROR_MESSAGE,payload:{message:e}})}}function c(e){return function(t){return t({type:y.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})}}function p(e){return function(t){t({type:y.default.CLEAR_FILE_BADGE,payload:{id:e}})}}function f(e,t,n,o){return function(r,s){var l=s(),i=l.assetAdmin,a=i.gallery.badges.find(function(t){return t.id===e});a&&a.timer&&clearTimeout(a.timer);var d=o>0?setTimeout(function(){return p(e)(r)},o):null;r({type:y.default.SET_FILE_BADGE,payload:{id:e,message:t,status:n,timer:d}})}}function h(e){return function(t){t({type:y.default.ACTIVATE_MODAL,payload:e})}}function m(){return function(e){e({type:y.default.DEACTIVATE_MODAL})}}function g(e){return function(t){t({type:y.default.SET_LOADING,payload:!!e})}}Object.defineProperty(t,"__esModule",{value:!0}),t.setLastSelected=o,t.setSelectedFiles=r,t.loadFile=s,t.selectFiles=l,t.setConcatenateSelect=i,t.deselectFiles=a,t.setNoticeMessage=d,t.setErrorMessage=u,t.setEnableDropzone=c,t.clearFileBadge=p,t.setFileBadge=f,t.activateModal=h,t.deactivateModal=m,t.setLoading=g;var _=n("./client/src/state/gallery/GalleryActionTypes.js"),y=function(e){return e&&e.__esModule?e:{default:e}}(_)},"./client/src/state/gallery/GalleryReducer.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,o=t.payload;switch(n){case d.default.SET_LAST_SELECTED:return s({},e,{lastSelected:o.id});case d.default.SET_FILE_BADGE:return s({},e,{badges:e.badges.filter(function(e){return e.id!==o.id}).concat([o])});case d.default.CLEAR_FILE_BADGE:return s({},e,{badges:e.badges.filter(function(e){return e.id!==o.id})});case d.default.SET_ENABLE_DROPZONE:return s({},e,{enableDropzone:o.enableDropzone});case d.default.SET_NOTICE_MESSAGE:return s({},e,{noticeMessage:o.message});case d.default.SET_ERROR_MESSAGE:return s({},e,{errorMessage:o.message});case d.default.LOAD_FILE_SUCCESS:var r=e.files.find(function(e){return e.id===o.id});if(r){var l=s({},r,o.file);return(0,i.default)(s({},e,{files:e.files.map(function(e){return e.id===l.id?l:e})}))}return e.folder.id===o.id?(0,i.default)(s({},e,{folder:s({},e.folder,o.file)})):e;case d.default.SET_SELECTED_FILES:return(0,i.default)(s({},e,{selectedFiles:Array.isArray(o.files)?o.files:[]}));case d.default.SELECT_FILES:var a=null;return a=null===o.ids?e.files.map(function(e){return e.id}):e.selectedFiles.concat(o.ids.filter(function(t){return-1===e.selectedFiles.indexOf(t)})),(0,i.default)(s({},e,{selectedFiles:a}));case d.default.DESELECT_FILES:var u=null;return u=null===o.ids?[]:e.selectedFiles.filter(function(e){return-1===o.ids.indexOf(e)}),(0,i.default)(s({},e,{selectedFiles:u}));case d.default.ACTIVATE_MODAL:return(0,i.default)(s({},e,{modal:o}));case d.default.DEACTIVATE_MODAL:return(0,i.default)(s({},e,{modal:null}));case d.default.CONCATENATE_SELECT:return(0,i.default)(s({},e,{concatenateSelect:o}));case d.default.SET_LOADING:return(0,i.default)(s({},e,{loading:o}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:p;r(this,e),this.options=s({},c,t),this.factory=n}return l(e,[{key:"loadImage",value:function(e){return this.options.minRetry&&u.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}},{key:"loadImageLoop",value:function(e,t){var n=this;return this.options.onStatusChange(e,a.default.LOADING),new Promise(function(t,o){return n.factory(e,t,o)}).then(function(){return n.handleSuccess(e)}).catch(function(){return n.handleError(e,t)})}},{key:"handleReset",value:function(e,t){this.options.onReset(e),t()}},{key:"handleTimeout",value:function(e,t){var n=setTimeout(e,t);return this.options.onTimeout(n,t),n}},{key:"handleSuccess",value:function(e){u.default.unlock(e),this.options.onStatusChange(e,a.default.SUCCESS)}},{key:"handleFailure",value:function(e){var t=this;return u.default.unlock(e),this.options.onStatusChange(e,a.default.FAILED),this.options.expiry?new Promise(function(n){t.handleTimeout(function(){return t.handleReset(e,n)},1e3*t.options.expiry)}):null}},{key:"handleError",value:function(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,a.default.WAITING),this.handleRetry(e,t))}},{key:"handleRetry",value:function(e,t){var n=this,o=new Promise(function(o){n.handleTimeout(function(){return o(n.loadImageLoop(e,2*t))},1e3*t)});return this.options.onRetry(e,t,o),o}},{key:"setOnRetry",value:function(e){this.options.onRetry=e}},{key:"setOnReset",value:function(e){this.options.onReset=e}},{key:"setOnStatusChange",value:function(e){this.options.onStatusChange=e}},{key:"setOnTimeout",value:function(e){this.options.onTimeout=e}}]),e}();t.defaultImageFactory=p,t.default=f},"./client/src/state/imageLoad/ImageLoadActionTypes.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={SET_STATUS:"IMAGE_LOAD_SET_STATUS",RESET:"IMAGE_LOAD_RESET"}},"./client/src/state/imageLoad/ImageLoadActions.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){return function(n,o){if(!e)return null;if(o().assetAdmin.imageLoad.files.find(function(t){return t.url===e}))return null;var r=s({},t,{onStatusChange:function(e,t){return n({type:i.default.SET_STATUS,payload:{status:t,url:e}})},onReset:function(e){return n({type:i.default.RESET,payload:{url:e}})}});return new d.default(r).loadImage(e)}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t=0||(this.urls=[].concat(o(this.urls),[e]),0))}},{key:"unlock",value:function(e){this.urls=this.urls.filter(function(t){return t!==e})}}]),e}();window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new l,t.Component=l,t.default=window.ss.imagelocker},"./client/src/state/imageLoad/ImageLoadReducer.js":function(e,t,n){"use strict";function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,r=t.payload;switch(n){case i.default.SET_STATUS:return s({},e,{files:[].concat(o(e.files.filter(function(e){return e.url!==r.url})),[r])});case i.default.RESET:return s({},e,{files:[].concat(o(e.files.filter(function(e){return e.url!==r.url})))});default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments[1];switch(t.type){case d.default.PREVIEWFIELD_ADD_FILE:return(0,i.default)(Object.assign({},e,r({},t.payload.id,t.payload.file)));case d.default.PREVIEWFIELD_FAIL_UPLOAD:return(0,i.default)(Object.assign({},e,r({},t.payload.id,Object.assign({},e[t.payload.id],t.payload.message))));case d.default.PREVIEWFIELD_REMOVE_FILE:return(0,i.default)(Object.assign({},e,r({},t.payload.id,void 0)));case d.default.PREVIEWFIELD_UPDATE_FILE:return(0,i.default)(Object.assign({},e,r({},t.payload.id,Object.assign({},e[t.payload.id],t.payload.data))));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=n(14),i=o(l),a=n("./client/src/state/previewField/PreviewFieldActionTypes.js"),d=o(a),u={};t.default=s},"./client/src/state/queuedFiles/QueuedFilesActionTypes.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={ADD_QUEUED_FILE:"ADD_QUEUED_FILE",FAIL_UPLOAD:"FAIL_UPLOAD",PURGE_UPLOAD_QUEUE:"PURGE_UPLOAD_QUEUE",REMOVE_QUEUED_FILE:"REMOVE_QUEUED_FILE",SUCCEED_UPLOAD:"SUCCEED_UPLOAD",UPDATE_QUEUED_FILE:"UPDATE_QUEUED_FILE"}},"./client/src/state/queuedFiles/QueuedFilesActions.js":function(e,t,n){"use strict";function o(e){return function(t){return t({type:u.default.ADD_QUEUED_FILE,payload:{file:e}})}}function r(e,t){return function(n){var o=t.message;return t.errors&&t.errors.length&&(o=t.errors[0]),"string"==typeof t&&(o={value:t,type:"error"}),n({type:u.default.FAIL_UPLOAD,payload:{queuedId:e,message:o}})}}function s(){return function(e){return e({type:u.default.PURGE_UPLOAD_QUEUE,payload:null})}}function l(e){return function(t){return t({type:u.default.REMOVE_QUEUED_FILE,payload:{queuedId:e}})}}function i(e,t){return function(n){return n({type:u.default.SUCCEED_UPLOAD,payload:{queuedId:e,json:t}})}}function a(e,t){return function(n){return n({type:u.default.UPDATE_QUEUED_FILE,payload:{queuedId:e,updates:t}})}}Object.defineProperty(t,"__esModule",{value:!0}),t.addQueuedFile=o,t.failUpload=r,t.purgeUploadQueue=s,t.removeQueuedFile=l,t.succeedUpload=i,t.updateQueuedFile=a;var d=n("./client/src/state/queuedFiles/QueuedFilesActionTypes.js"),u=function(e){return e&&e.__esModule?e:{default:e}}(d)},"./client/src/state/queuedFiles/QueuedFilesReducer.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:m,t=arguments[1];switch(t.type){case u.default.ADD_QUEUED_FILE:return(0,a.default)(l({},e,{items:[].concat(r(e.items),[l({},p.default,t.payload.file)])}));case u.default.FAIL_UPLOAD:return(0,a.default)(l({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?l({},e,{message:t.payload.message}):e})}));case u.default.PURGE_UPLOAD_QUEUE:return(0,a.default)(l({},e,{items:e.items.filter(function(e){return!e.id})}));case u.default.REMOVE_QUEUED_FILE:return(0,a.default)(l({},e,{items:e.items.filter(function(e){return e.queuedId!==t.payload.queuedId})}));case u.default.SUCCEED_UPLOAD:return(0,a.default)(l({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?l({},e,t.payload.json,{messages:[{value:h.default._t("AssetAdmin.DROPZONE_SUCCESS_UPLOAD"),type:"success",extraClass:"success"}]}):e})}));case u.default.UPDATE_QUEUED_FILE:return(0,a.default)(l({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?l({},e,t.payload.updates):e})}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:f,t=arguments[1],n=(0,p.default)(e,t,h);switch(t.type){case a.default.UPLOADFIELD_ADD_FILE:return n(function(e){return e.files.find(function(e){return e.id===t.payload.file.id})?e:l({},e,{files:[].concat(r(e.files),[l({},u.default,t.payload.file)])})});case a.default.UPLOADFIELD_SET_FILES:return n(function(){return{files:t.payload.files}});case a.default.UPLOADFIELD_UPLOAD_FAILURE:return n(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,{message:t.payload.message}):e})}});case a.default.UPLOADFIELD_REMOVE_FILE:return n(function(e){return{files:e.files.filter(function(e){return!(t.payload.file.queuedId&&e.queuedId===t.payload.file.queuedId||t.payload.file.id&&e.id===t.payload.file.id)})}});case a.default.UPLOADFIELD_UPLOAD_SUCCESS:return n(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.json):e})}});case a.default.UPLOADFIELD_UPDATE_QUEUED_FILE:return n(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.updates):e})}});default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t0?s.default._t("AssetAdmin.UPDATE_FILE","Update file"):s.default._t("AssetAdmin.INSERT_FILE","Insert file");return e.mutateField("action_insert",function(e){return o({},e,{title:r||e.title})}),e.getState()};t.default=l},"./client/src/transforms/FormAction/ownerAwareUnpublish.js":function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0?[a.default.inject(a.default._t("AssetAdmin.SINGLE_OWNED_WARNING_1","This file is being used in {count} other published section(s)."),{count:r}),a.default._t("AssetAdmin.SINGLE_OWNED_WARNING_2","Ensure files are removed from content areas prior to unpublishing them. Otherwise, they will appear as broken links."),a.default._t("AssetAdmin.SINGLE_OWNED_WARNING_3","Do you want to unpublish this file anyway?")].join("\n\n"):a.default._t("AssetAdmin.CONFIRMUNPUBLISH","Are you sure you want to unpublish this record?"),confirm(s)?n(e,o):e.preventDefault()}});return l.default.createElement(e,o)}};t.default=d},"./client/src/transforms/TreeDropdownField/moveTreeDropdownField.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disabledTreeDropdownField=void 0;var o=Object.assign||function(e){for(var t=1;t
'),this.element.appendChild(n)),o=n.getElementsByTagName("span")[0],o&&(null!=o.textContent?o.textContent=this.options.dictFallbackMessage:null!=o.innerText&&(o.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e){var t,n,o;return t={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},n=e.width/e.height,t.optWidth=this.options.thumbnailWidth,t.optHeight=this.options.thumbnailHeight,null==t.optWidth&&null==t.optHeight?(t.optWidth=t.srcWidth,t.optHeight=t.srcHeight):null==t.optWidth?t.optWidth=n*t.optHeight:null==t.optHeight&&(t.optHeight=1/n*t.optWidth),o=t.optWidth/t.optHeight,e.heighto?(t.srcHeight=e.height,t.srcWidth=t.srcHeight*o):(t.srcWidth=e.width,t.srcHeight=t.srcWidth/o),t.srcX=(e.width-t.srcWidth)/2,t.srcY=(e.height-t.srcHeight)/2,t},drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:a,dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:a,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var n,o,r,s,l,i,a,d,u,c,p,f,h;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(e.previewElement=t.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),c=e.previewElement.querySelectorAll("[data-dz-name]"),s=0,a=c.length;s'+this.options.dictRemoveFile+""),e.previewElement.appendChild(e._removeLink)),o=function(n){return function(o){return o.preventDefault(),o.stopPropagation(),e.status===t.UPLOADING?t.confirm(n.options.dictCancelUploadConfirmation,function(){return n.removeFile(e)}):n.options.dictRemoveFileConfirmation?t.confirm(n.options.dictRemoveFileConfirmation,function(){return n.removeFile(e)}):n.removeFile(e)}}(this),f=e.previewElement.querySelectorAll("[data-dz-remove]"),h=[],i=0,u=f.length;i\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n
'},n=function(){var e,t,n,o,r,s,l;for(o=arguments[0],n=2<=arguments.length?u.call(arguments,1):[],s=0,l=n.length;s'+this.options.dictDefaultMessage+"
")),this.clickableElements.length&&(o=function(e){return function(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null==e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!=e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!=e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.querySelector(e.options.hiddenInputContainer).appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var t,n,r,s;if(n=e.hiddenFileInput.files,n.length)for(r=0,s=n.length;r',this.options.dictFallbackText&&(o+="

"+this.options.dictFallbackText+"

"),o+='
',n=t.createElement(o),"FORM"!==this.element.tagName?(r=t.createElement('
'),r.appendChild(n)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=r?r:n)},t.prototype.getExistingFallback=function(){var e,t,n,o,r,s;for(t=function(e){var t,n,o;for(n=0,o=e.length;n0){for(l=["TB","GB","MB","KB","b"],n=i=0,a=l.length;i=t){o=e/Math.pow(this.options.filesizeBase,4-n),r=s;break}o=Math.round(10*o)/10}return""+o+" "+r},t.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},t.prototype.drop=function(e){var t,n;e.dataTransfer&&(this.emit("drop",e),t=e.dataTransfer.files,this.emit("addedfiles",t),t.length&&(n=e.dataTransfer.items,n&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(t)))},t.prototype.paste=function(e){var t,n;if(null!=(null!=e&&null!=(n=e.clipboardData)?n.items:void 0))return this.emit("paste",e),t=e.clipboardData.items,t.length?this._addFilesFromItems(t):void 0},t.prototype.handleFiles=function(e){var t,n,o,r;for(r=[],n=0,o=e.length;n0){for(s=0,l=n.length;s1024*this.options.maxFilesize*1024?n(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):t.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(n(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,n):n(this.options.dictInvalidFileType)},t.prototype.addFile=function(e){return e.upload={progress:0,total:e.size,bytesSent:0},this.files.push(e),e.status=t.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(t){return function(n){return n?(e.accepted=!1,t._errorProcessing([e],n)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()}}(this))},t.prototype.enqueueFiles=function(e){var t,n,o;for(n=0,o=e.length;n=t)&&(o=this.getQueuedFiles(),o.length>0)){if(this.options.uploadMultiple)return this.processFiles(o.slice(0,t-n));for(;e=L;u=0<=L?++P:--P)s.append(this._getParamName(u),e[u],this._renameFilename(e[u].name));return this.submitRequest(S,s,e)},t.prototype.submitRequest=function(e,t,n){return e.send(t)},t.prototype._finished=function(e,n,o){var r,s,l;for(s=0,l=e.length;sd;)t=r[4*(i-1)+3],0===t?s=i:d=i,i=s+d>>1;return a=i/l,0===a?1:a},i=function(e,t,n,o,r,s,i,a,d,u){var c;return c=l(t),e.drawImage(t,n,o,r,s,i,a,d,u/c)},s=function(e,t){var n,o,r,s,l,i,a,d,u;if(r=!1,u=!0,o=e.document,d=o.documentElement,n=o.addEventListener?"addEventListener":"attachEvent",a=o.addEventListener?"removeEventListener":"detachEvent",i=o.addEventListener?"":"on",s=function(n){if("readystatechange"!==n.type||"complete"===o.readyState)return("load"===n.type?e:o)[a](i+n.type,s,!1),!r&&(r=!0)?t.call(e,n.type||n):void 0},l=function(){try{d.doScroll("left")}catch(e){return void setTimeout(l,50)}return s("poll")},"complete"!==o.readyState){if(o.createEventObject&&d.doScroll){try{u=!e.frameElement}catch(e){}u&&l()}return o[n](i+"DOMContentLoaded",s,!1),o[n](i+"readystatechange",s,!1),e[n](i+"load",s,!1)}},n._autoDiscoverFunction=function(){if(n.autoDiscover)return n.discover()},s(window,n._autoDiscoverFunction)}).call(this)}).call(t,n(7),n("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/expose-loader/index.js?InsertEmbedModal!./client/src/components/InsertEmbedModal/InsertEmbedModal.js-exposed":function(e,t,n){(function(t){e.exports=t.InsertEmbedModal=n('./node_modules/babel-loader/lib/index.js?{"presets":[["env",{"modules":false}],"react"],"plugins":["transform-object-rest-spread"],"comments":false,"cacheDirectory":false}!./client/src/components/InsertEmbedModal/InsertEmbedModal.js')}).call(t,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/expose-loader/index.js?InsertMediaModal!./client/src/containers/InsertMediaModal/InsertMediaModal.js-exposed":function(e,t,n){(function(t){e.exports=t.InsertMediaModal=n('./node_modules/babel-loader/lib/index.js?{"presets":[["env",{"modules":false}],"react"],"plugins":["transform-object-rest-spread"],"comments":false,"cacheDirectory":false}!./client/src/containers/InsertMediaModal/InsertMediaModal.js')}).call(t,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/griddle-react/modules/columnProperties.js":function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n0}},{key:"getMetadataColumnProperty",value:function(e,t,n){var o=this.getColumnMetadataByName(e);return void 0===o||null===o?n:o.hasOwnProperty(t)?o[t]:n}},{key:"orderColumns",value:function(e){var t=this;return a(e,function(e){var n=i(t.columnMetadata,{columnName:e});return void 0===n||null===n||isNaN(n.order)?100:n.order})}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=d(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=u},"./node_modules/griddle-react/modules/customFilterContainer.jsx.js":function(e,t,n){"use strict";var o=n(0),r=o.createClass({displayName:"CustomFilterContainer",getDefaultProps:function(){return{placeholderText:""}},render:function(){var e=this;return"function"!=typeof e.props.customFilterComponent?(console.log("Couldn't find valid template."),o.createElement("div",null)):o.createElement(e.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=r},"./node_modules/griddle-react/modules/customPaginationContainer.jsx.js":function(e,t,n){"use strict";var o=Object.assign||function(e){for(var t=1;t0&&(e=o.createElement("button",{type:"button",onClick:this.props.previous,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 0 0 10px"}:null},this.props.previousIconComponent,this.props.previousText)),this.props.currentPage!==this.props.maxPage-1&&(t=o.createElement("button",{type:"button",onClick:this.props.next,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 10px 0 0"}:null},this.props.nextText,this.props.nextIconComponent));var n=null,s=null,l=null;if(!0===this.props.useGriddleStyles){var i={float:"left",minHeight:"1px",marginTop:"5px"};l=r({textAlign:"right",width:"34%"},i),s=r({textAlign:"center",width:"33%"},i),n=r({width:"33%"},i)}for(var a=[],d=1;d<=this.props.maxPage;d++)a.push(o.createElement("option",{value:d,key:d},d));return o.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},o.createElement("div",{className:this.props.previousClassName,style:n},e),o.createElement("div",{className:"griddle-page",style:s},o.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},a)," / ",this.props.maxPage),o.createElement("div",{className:this.props.nextClassName,style:l},t))}});e.exports=s},"./node_modules/griddle-react/modules/gridRow.jsx.js":function(e,t,n){"use strict";var o=n(0),r=(n("./node_modules/griddle-react/modules/columnProperties.js"),n("./node_modules/griddle-react/modules/deep.js")),s=n("./node_modules/griddle-react/node_modules/lodash/isFunction.js"),l=n("./node_modules/griddle-react/node_modules/lodash/zipObject.js"),i=n("./node_modules/griddle-react/node_modules/lodash/assign.js"),a=n("./node_modules/griddle-react/node_modules/lodash/defaults.js"),d=n("./node_modules/griddle-react/node_modules/lodash/toPairs.js"),u=n("./node_modules/griddle-react/node_modules/lodash/without.js"),c=o.createClass({displayName:"GridRow",getDefaultProps:function(){return{isChildRow:!1,showChildren:!1,data:{},columnSettings:null,rowSettings:null,hasChildren:!1,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},handleClick:function(e){null!==this.props.onRowClick&&s(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleSelectionChange:function(e){},handleSelectClick:function(e){this.props.multipleSelectionSettings.isMultipleSelection&&("checkbox"===e.target.type?this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,this.refs.selected.checked):this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,!this.refs.selected.checked))},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRow: The columnSettings prop is null and it shouldn't be")},formatData:function(e){return"boolean"==typeof e?String(e):e},render:function(){var e=this;this.verifyProps();var t=this,n=null;this.props.useGriddleStyles&&(n={margin:"0px",padding:t.props.paddingHeight+"px 5px "+t.props.paddingHeight+"px 5px",height:t.props.rowHeight?this.props.rowHeight-2*t.props.paddingHeight+"px":null,backgroundColor:"#FFF",borderTopColor:"#DDD",color:"#222"});var c=this.props.columnSettings.getColumns(),p=l(c,[]),f=i({},this.props.data);a(f,p);var h,m,g=d(r.pick(f,u(c,"children"))),_=g.map(function(t,r){var s=null,l=e.props.columnSettings.getColumnMetadataByName(t[0]),a=0===r&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?o.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===r&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?o.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===r&&e.props.isChildRow&&e.props.useGriddleStyles&&(n=i(n,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&void 0!==l&&null!==l)if(void 0!==l.customComponent&&null!==l.customComponent){var d=o.createElement(l.customComponent,{data:t[1],rowData:f,metadata:l});s=o.createElement("td",{onClick:e.handleClick,className:l.cssClassName,key:r,style:n},d)}else s=o.createElement("td",{onClick:e.handleClick,className:l.cssClassName,key:r,style:n},a,e.formatData(t[1]));return s||o.createElement("td",{onClick:e.handleClick,key:r,style:n},a,t[1])});null!==this.props.onRowClick&&s(this.props.onRowClick)?(h=null,m=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(h=this.handleSelectClick,m=null):(h=null,m=null),_&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection&&(this.props.multipleSelectionSettings.getSelectedRowIds(),_.unshift(o.createElement("td",{key:"selection",style:n,className:"griddle-select griddle-select-cell",onClick:m},o.createElement("input",{type:"checkbox",checked:this.props.multipleSelectionSettings.getIsRowChecked(f),onChange:this.handleSelectionChange,ref:"selected"}))));var y=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?y="child-row":t.props.hasChildren&&(y=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),o.createElement("tr",{onClick:h,className:y},_)}});e.exports=c},"./node_modules/griddle-react/modules/gridRowContainer.jsx.js":function(e,t,n){"use strict";var o=n(0),r=(n("./node_modules/griddle-react/modules/columnProperties.js"),n("./node_modules/griddle-react/node_modules/lodash/pick.js")),s=o.createClass({displayName:"GridRowContainer",getDefaultProps:function(){return{useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,columnSettings:null,rowSettings:null,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},getInitialState:function(){return{data:{},showChildren:!1}},componentWillReceiveProps:function(){this.setShowChildren(!1)},toggleChildren:function(){this.setShowChildren(!1===this.state.showChildren)},setShowChildren:function(e){this.setState({showChildren:e})},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be")},render:function(){this.verifyProps();var e=this;if(void 0===this.props.data)return o.createElement("tbody",null);var t=[],n=this.props.columnSettings.getColumns();t.push(o.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?r(this.props.data,n):this.props.data,rowData:this.props.rowSettings.isCustom?this.props.data:null,columnSettings:this.props.columnSettings,rowSettings:this.props.rowSettings,hasChildren:e.props.hasChildren,toggleChildren:e.toggleChildren,showChildren:e.state.showChildren,key:e.props.uniqueId+"_base_row",useGriddleIcons:e.props.useGriddleIcons,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedComponent:this.props.parentRowExpandedComponent,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight,onRowClick:e.props.onRowClick,multipleSelectionSettings:this.props.multipleSelectionSettings}));var s=null;return e.state.showChildren&&(s=e.props.hasChildren&&this.props.data.children.map(function(t,n){var r=e.props.rowSettings.getRowKey(t,n);if(void 0!==t.children){var s=e.constructor.Griddle;return o.createElement("tr",{key:r,style:{paddingLeft:5}},o.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},o.createElement(s,{rowMetadata:{key:"id"},isSubGriddle:!0,results:[t],columns:e.props.columnSettings.getColumns(),tableClassName:e.props.tableClassName,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,showTableHeading:!1,showPager:!1,columnMetadata:e.props.columnSettings.columnMetadata,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight})))}return o.createElement(e.props.rowSettings.rowComponent,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,data:t,columnSettings:e.props.columnSettings,isChildRow:!0,columnMetadata:e.props.columnSettings.columnMetadata,key:r})})),!1===e.props.hasChildren?t[0]:o.createElement("tbody",null,e.state.showChildren?t.concat(s):t)}});e.exports=s},"./node_modules/griddle-react/modules/gridSettings.jsx.js":function(e,t,n){"use strict";var o=n(0),r=n("./node_modules/griddle-react/node_modules/lodash/includes.js"),s=n("./node_modules/griddle-react/node_modules/lodash/without.js"),l=n("./node_modules/griddle-react/node_modules/lodash/find.js"),i=o.createClass({displayName:"GridSettings",getDefaultProps:function(){return{columns:[],columnMetadata:[],selectedColumns:[],settingsText:"",maxRowsText:"",resultsPerPage:0,enableToggleCustom:!1,useCustomComponent:!1,useGriddleStyles:!0,toggleCustomComponent:function(){}}},setPageSize:function(e){var t=parseInt(e.target.value,10);this.props.setPageSize(t)},handleChange:function(e){var t=e.target.dataset?e.target.dataset.name:e.target.getAttribute("data-name");!0===e.target.checked&&!1===r(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(s(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map(function(t,n){var s=r(e.props.selectedColumns,t),i=l(e.props.columnMetadata,{columnName:t}),a=t;return void 0!==i&&void 0!==i.displayName&&null!=i.displayName&&(a=i.displayName),void 0!==i&&null!=i&&i.locked?o.createElement("div",{className:"column checkbox"},o.createElement("label",null,o.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:s,"data-name":t}),a)):void 0!==i&&null!=i&&void 0!==i.visible&&!1===i.visible?null:o.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},o.createElement("label",null,o.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:s,"data-name":t}),a))}));var n=e.props.enableToggleCustom?o.createElement("div",{className:"form-group"},o.createElement("label",{htmlFor:"maxRows"},o.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",s=this.props.showSetPageSize?o.createElement("div",null,o.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",o.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},o.createElement("option",{value:"5"},"5"),o.createElement("option",{value:"10"},"10"),o.createElement("option",{value:"25"},"25"),o.createElement("option",{value:"50"},"50"),o.createElement("option",{value:"100"},"100")))):"";return o.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},o.createElement("h6",null,this.props.settingsText),o.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),s,n)}});e.exports=i},"./node_modules/griddle-react/modules/gridTable.jsx.js":function(e,t,n){"use strict";var o=n(0),r=n("./node_modules/griddle-react/modules/gridTitle.jsx.js"),s=n("./node_modules/griddle-react/modules/gridRowContainer.jsx.js"),l=(n("./node_modules/griddle-react/modules/columnProperties.js"),n("./node_modules/griddle-react/modules/rowProperties.js"),o.createClass({displayName:"GridTable",getDefaultProps:function(){return{data:[],columnSettings:null,rowSettings:null,sortSettings:null,multipleSelectionSettings:null,className:"",enableInfiniteScroll:!1,nextPage:null,hasMorePages:!1,useFixedHeader:!1,useFixedLayout:!0,paddingHeight:null,rowHeight:null,filterByColumn:null,infiniteScrollLoadTreshold:null,bodyHeight:null,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",externalLoadingComponent:null,externalIsLoading:!1,onRowClick:null}},getInitialState:function(){return{scrollTop:0,scrollHeight:this.props.bodyHeight,clientHeight:this.props.bodyHeight}},componentDidMount:function(){this.gridScroll()},componentDidUpdate:function(e,t){this.gridScroll()},gridScroll:function(){if(this.props.enableInfiniteScroll&&!this.props.externalIsLoading){var e=this.refs.scrollable,t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var r={scrollTop:t,scrollHeight:n,clientHeight:o};this.setState(r)}.6*(n-(t+o)-this.props.infiniteScrollLoadTreshold)<=this.props.infiniteScrollLoadTreshold&&this.props.nextPage()}},verifyProps:function(){null===this.props.columnSettings&&console.error("gridTable: The columnSettings prop is null and it shouldn't be"),null===this.props.rowSettings&&console.error("gridTable: The rowSettings prop is null and it shouldn't be")},getAdjustedRowHeight:function(){return this.props.rowHeight+2*this.props.paddingHeight},getNodeContent:function(){this.verifyProps();var e=this,t=!1;if(!this.props.externalIsLoading||this.props.enableInfiniteScroll){var n=e.props.data,r=null,l=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var i=e.getAdjustedRowHeight(),a=Math.ceil(e.state.clientHeight/i),d=Math.max(0,Math.floor(e.state.scrollTop/i)-.25*a),u=Math.min(d+1.25*a,this.props.data.length-1);n=n.slice(d,u+1);var c={height:d*i+"px"};r=o.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-u)*i+"px"};l=o.createElement("tr",{key:"below-"+p.height,style:p})}var f=n.map(function(n,r){var l=void 0!==n.children&&n.children.length>0,i=e.props.rowSettings.getRowKey(n,r);return l&&(t=l),o.createElement(s,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,data:n,key:i+"-container",uniqueId:i,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:l,tableClassName:e.props.className,onRowClick:e.props.onRowClick})});if(this.props.showNoData){var h=this.props.columnSettings.getVisibleColumnCount();f.push(o.createElement("tr",{key:"no-data-section"},o.createElement("td",{colSpan:h},this.props.noDataSection)))}return r&&f.unshift(r),l&&f.push(l),{nodes:f,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,n=this.getNodeContent();n&&(e=n.nodes,t=n.anyHasChildren);var s=null,l=null,i={width:"100%"};if(this.props.useFixedLayout&&(i.tableLayout="fixed"),this.props.enableInfiniteScroll&&(s={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var a=null,d=null;this.props.useGriddleStyles&&(a={textAlign:"center",paddingBottom:"40px"}),d=this.props.columnSettings.getVisibleColumnCount();var u=this.props.externalLoadingComponent?o.createElement(this.props.externalLoadingComponent,null):o.createElement("div",null,"Loading...");l=o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",{style:a,colSpan:d},u)))}var c=this.props.showTableHeading?o.createElement(r,{useGriddleStyles:this.props.useGriddleStyles,useGriddleIcons:this.props.useGriddleIcons,sortSettings:this.props.sortSettings,multipleSelectionSettings:this.props.multipleSelectionSettings,columnSettings:this.props.columnSettings,filterByColumn:this.props.filterByColumn,rowSettings:this.props.rowSettings}):void 0;t||(e=o.createElement("tbody",null,e));var p=o.createElement("tbody",null);if(this.props.showPager){var f=this.props.useGriddleStyles?{padding:"0px",backgroundColor:"#EDEDED",border:"0px",color:"#222",height:this.props.showNoData?"20px":null}:null;p=o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",{colSpan:this.props.multipleSelectionSettings.isMultipleSelection?this.props.columnSettings.getVisibleColumnCount()+1:this.props.columnSettings.getVisibleColumnCount(),style:f,className:"footer-container"},this.props.showNoData?null:this.props.pagingContent)))}return this.props.useFixedHeader?(this.props.useGriddleStyles&&(i.tableLayout="fixed"),o.createElement("div",null,o.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c),o.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:s},o.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},e,l,p)))):o.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:s},o.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c,e,l,p))}}));e.exports=l},"./node_modules/griddle-react/modules/gridTitle.jsx.js":function(e,t,n){"use strict";var o=Object.assign||function(e){for(var t=1;t=0)return!0;return!1})},defaultColumnFilter:function(e,t){return D(_.getObjectValues(e),function(e){return e.toString().toLowerCase().indexOf(t.toLowerCase())>=0}).length>0},filterByColumnFilters:function(e){var t=this.defaultColumnFilter,n=Object.keys(e).reduce(function(n,o){return D(n,function(n){var r=_.getAt(n,o||""),s=e[o];return t(r,s)})},this.props.results),o={columnFilters:e};e?(o.filteredResults=n,o.maxPage=this.getMaxPage(o.filteredResults)):this.state.filter?o.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):o.filteredResults=null,this.setState(o)},filterByColumn:function(e,t){var n=this.state.columnFilters;if(n.hasOwnProperty(t)&&!e)n=A(n,t);else{var o={};o[t]=e,n=P({},n,o)}this.filterByColumnFilters(n)},setFilter:function(e){if(this.props.useExternal)return void this.props.externalSetFilter(e);var t=this,n={page:0,filter:e};n.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,e):this.defaultFilter(this.props.results,e),n.maxPage=t.getMaxPage(n.filteredResults),(I(e)||F(e)||O(e))&&(n.filter=e,n.filteredResults=null),t.setState(n),this._resetSelectedRows()},setPageSize:function(e){if(this.props.useExternal)return this.setState({resultsPerPage:e}),void this.props.externalSetPageSize(e);this.state.resultsPerPage=e,this.setMaxPage()},toggleColumnChooser:function(){this.setState({showColumnChooser:!this.state.showColumnChooser})},isNullOrUndefined:function(e){return void 0===e||null===e},shouldUseCustomRowComponent:function(){return this.isNullOrUndefined(this.state.useCustomRowComponent)?this.props.useCustomRowComponent:this.state.useCustomRowComponent},shouldUseCustomGridComponent:function(){return this.isNullOrUndefined(this.state.useCustomGridComponent)?this.props.useCustomGridComponent:this.state.useCustomGridComponent},toggleCustomComponent:function(){"grid"===this.state.customComponentType?this.setState({useCustomGridComponent:!this.shouldUseCustomGridComponent()}):"row"===this.state.customComponentType&&this.setState({useCustomRowComponent:!this.shouldUseCustomRowComponent()})},getMaxPage:function(e,t){return this.props.useExternal?this.props.externalMaxPage:(t||(t=(e||this.getCurrentResults()).length),Math.ceil(t/this.state.resultsPerPage))},setMaxPage:function(e){var t=this.getMaxPage(e);this.state.maxPage!==t&&this.setState({page:0,maxPage:t,filteredColumns:this.columnSettings.filteredColumns})},setPage:function(e){if(this.props.useExternal)return void this.props.externalSetPage(e);if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t=this,n={page:e};t.setState(n)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})},setColumns:function(e){this.columnSettings.filteredColumns=w(e)?e:[e],this.setState({filteredColumns:this.columnSettings.filteredColumns})},nextPage:function(){var e=this.getCurrentPage();e0&&this.setPage(e-1)},changeSort:function(e){if(!1!==this.props.enableSort){if(this.props.useExternal){var t=this.props.externalSortColumn!==e||!this.props.externalSortAscending;return this.setState({sortColumn:e,sortDirection:t?"asc":"desc"}),void this.props.externalChangeSort(e,t)}var n=b(this.props.columnMetadata,{columnName:e})||{},o=n.sortDirectionCycle?n.sortDirectionCycle:[null,"asc","desc"],r=null,s=o.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null);s=(s+1)%o.length,r=o[s]?o[s]:null;var l={page:0,sortColumn:e,sortDirection:r};this.setState(l)}},componentWillReceiveProps:function(e){if(this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=_.keys(e.results[0]);this.columnSettings.allColumns.length==t.length&&this.columnSettings.allColumns.every(function(e,n){return e===t[n]})||(this.columnSettings.allColumns=t)}else this.columnSettings.allColumns.length>0&&(this.columnSettings.allColumns=[]);if(e.selectedRowIds){var n=this.getDataForRender(this.getCurrentResults(e.results),this.columnSettings.getColumns(),!0);this.setState({isSelectAllChecked:this._getAreAllRowsChecked(e.selectedRowIds,x(n,this.props.uniqueIdentifier)),selectedRowIds:e.selectedRowIds})}},getInitialState:function(){return{maxPage:0,page:0,filteredResults:null,filteredColumns:[],filter:"",columnFilters:{},resultsPerPage:this.props.resultsPerPage||5,showColumnChooser:!1,isSelectAllChecked:!1,selectedRowIds:this.props.selectedRowIds}},componentWillMount:function(){this.verifyExternal(),this.verifyCustom(),this.columnSettings=new m(this.props.results.length>0?_.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new g(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:u,this.props.useCustomTableRowComponent),this.props.initialSort&&(this.props.useExternal?this.setState({sortColumn:this.props.externalSortColumn,sortDirection:this.props.externalSortAscending?"asc":"desc"}):this.changeSort(this.props.initialSort)),this.setMaxPage(),this.shouldUseCustomGridComponent()?this.setState({customComponentType:"grid"}):this.shouldUseCustomRowComponent()?this.setState({customComponentType:"row"}):this.setState({filteredColumns:this.columnSettings.filteredColumns})},componentDidMount:function(){if(this.props.componentDidMount&&"function"==typeof this.props.componentDidMount)return this.props.componentDidMount()},componentDidUpdate:function(){if(this.props.componentDidUpdate&&"function"==typeof this.props.componentDidUpdate)return this.props.componentDidUpdate(this.state)},verifyExternal:function(){!0===this.props.useExternal&&(null===this.props.externalSetPage&&console.error("useExternal is set to true but there is no externalSetPage function specified."),null===this.props.externalChangeSort&&console.error("useExternal is set to true but there is no externalChangeSort function specified."),null===this.props.externalSetFilter&&console.error("useExternal is set to true but there is no externalSetFilter function specified."),null===this.props.externalSetPageSize&&console.error("useExternal is set to true but there is no externalSetPageSize function specified."),null===this.props.externalMaxPage&&console.error("useExternal is set to true but externalMaxPage is not set."),null===this.props.externalCurrentPage&&console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."))},verifyCustom:function(){!0===this.props.useCustomGridComponent&&null===this.props.customGridComponent&&console.error("useCustomGridComponent is set to true but no custom component was specified."),!0===this.props.useCustomRowComponent&&null===this.props.customRowComponent&&console.error("useCustomRowComponent is set to true but no custom component was specified."),!0===this.props.useCustomGridComponent&&!0===this.props.useCustomRowComponent&&console.error("Cannot currently use both customGridComponent and customRowComponent."),!0===this.props.useCustomFilterer&&null===this.props.customFilterer&&console.error("useCustomFilterer is set to true but no custom filter function was specified."),!0===this.props.useCustomFilterComponent&&null===this.props.customFilterComponent&&console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified.")},getDataForRender:function(e,t,n){var o=this,r=this;if(""!==this.state.sortColumn){var s,l=this.state.sortColumn,i=D(this.props.columnMetadata,{columnName:l}),a={columns:[],orders:[]};if(i.length>0&&(s=i[0].hasOwnProperty("customCompareFn")&&i[0].customCompareFn,i[0].multiSort&&(a=i[0].multiSort)),this.state.sortDirection)if("function"==typeof s)2===s.length?(e=e.sort(function(e,t){return s(k(e,l),k(t,l))}),"desc"===this.state.sortDirection&&e.reverse()):1===s.length&&(e=T(e,function(e){return s(k(e,l))},[this.state.sortDirection]));else{var d=[function(e){return(k(e,l)||"").toString().toLowerCase()}],u=[this.state.sortDirection];a.columns.forEach(function(e,t){d.push(function(t){return(k(t,e)||"").toString().toLowerCase()}),"asc"===a.orders[t]||"desc"===a.orders[t]?u.push(a.orders[t]):u.push(o.state.sortDirection)}),e=T(e,d,u)}}var c=this.getCurrentPage();if(!this.props.useExternal&&n&&this.state.resultsPerPage*(c+1)<=this.state.resultsPerPage*this.state.maxPage&&c>=0)if(this.isInfiniteScrollEnabled())e=E(e,(c+1)*this.state.resultsPerPage);else{var p=y(e,c*this.state.resultsPerPage);e=(v||j)(p,p.length-this.state.resultsPerPage)}for(var f=(this.columnSettings.getMetadataColumns,[]),h=0;h0&&(m.children=r.getDataForRender(m[r.props.childrenColumnName],t,!1),"children"!==r.props.childrenColumnName&&delete m[r.props.childrenColumnName]),f.push(m)}return f},getCurrentResults:function(e){return this.state.filteredResults||e||this.props.results},getCurrentPage:function(){return this.props.externalCurrentPage||this.state.page},getCurrentSort:function(){return this.props.useExternal?this.props.externalSortColumn:this.state.sortColumn},getCurrentSortAscending:function(){return this.props.useExternal?this.props.externalSortAscending:"asc"===this.state.sortDirection},getCurrentMaxPage:function(){return this.props.useExternal?this.props.externalMaxPage:this.state.maxPage},getSortObject:function(){return{enableSort:this.props.enableSort,changeSort:this.changeSort,sortColumn:this.getCurrentSort(),sortAscending:this.getCurrentSortAscending(),sortDirection:this.state.sortDirection,sortAscendingClassName:this.props.sortAscendingClassName,sortDescendingClassName:this.props.sortDescendingClassName,sortAscendingComponent:this.props.sortAscendingComponent,sortDescendingComponent:this.props.sortDescendingComponent,sortDefaultComponent:this.props.sortDefaultComponent}},_toggleSelectAll:function(){var e=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),t=!this.state.isSelectAllChecked,n=JSON.parse(JSON.stringify(this.state.selectedRowIds)),o=this;S(e,function(e){o._updateSelectedRowIds(e[o.props.uniqueIdentifier],n,t)},this),this.setState({isSelectAllChecked:t,selectedRowIds:n}),this.props.onSelectionChange&&this.props.onSelectionChange(n,t)},_toggleSelectRow:function(e,t){var n=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),o=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],o,t);var r=this._getAreAllRowsChecked(o,x(n,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:r,selectedRowIds:o}),this.props.onSelectionChange&&this.props.onSelectionChange(o,r)},_updateSelectedRowIds:function(e,t,n){n?void 0===b(t,function(t){return e===t})&&t.push(e):t.splice(t.indexOf(e),1)},_getIsSelectAllChecked:function(){return this.state.isSelectAllChecked},_getAreAllRowsChecked:function(e,t){return t.length===C(t,e).length},_getIsRowChecked:function(e){return this.state.selectedRowIds.indexOf(e[this.props.uniqueIdentifier])>-1},getSelectedRowIds:function(){return this.state.selectedRowIds},_resetSelectedRows:function(){this.setState({isSelectAllChecked:!1,selectedRowIds:[]})},getMultipleSelectionObject:function(){return{isMultipleSelection:!b(this.props.results,function(e){return"children"in e})&&this.props.isMultipleSelection,toggleSelectAll:this._toggleSelectAll,getIsSelectAllChecked:this._getIsSelectAllChecked,toggleSelectRow:this._toggleSelectRow,getSelectedRowIds:this.getSelectedRowIds,getIsRowChecked:this._getIsRowChecked}},isInfiniteScrollEnabled:function(){return!this.props.useCustomPagerComponent&&this.props.enableInfiniteScroll},getClearFixStyles:function(){return{clear:"both",display:"table",width:"100%"}},getSettingsStyles:function(){return{float:"left",width:"50%",textAlign:"right"}},getFilterStyles:function(){return{float:"left",width:"50%",textAlign:"left",color:"#222",minHeight:"1px"}},getFilter:function(){return this.props.showFilter&&!1===this.shouldUseCustomGridComponent()?this.props.useCustomFilterComponent?r.createElement(h,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):r.createElement(l,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?r.createElement("button",{type:"button",className:this.props.settingsToggleClassName,onClick:this.toggleColumnChooser,style:this.props.useGriddleStyles?{background:"none",border:"none",padding:0,margin:0,fontSize:14}:null},this.props.settingsText,this.props.settingsIconComponent):""},getTopSection:function(e,t){if(!1===this.props.showFilter&&!1===this.props.showSettings)return"";var n=null,o=null,s=null;return this.props.useGriddleStyles&&(n=this.getFilterStyles(),o=this.getSettingsStyles(),s=this.getClearFixStyles()),r.createElement("div",{className:"top-section",style:s},r.createElement("div",{className:"griddle-filter",style:n},e),r.createElement("div",{className:"griddle-settings-toggle",style:o},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return r.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?r.createElement(f,{customPagerComponentOptions:this.props.customPagerComponentOptions,next:this.nextPage,previous:this.previousPage,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText,customPagerComponent:this.props.customPagerComponent}):r.createElement(i,{useGriddleStyles:this.props.useGriddleStyles,next:this.nextPage,previous:this.previousPage,nextClassName:this.props.nextClassName,nextIconComponent:this.props.nextIconComponent,previousClassName:this.props.previousClassName,previousIconComponent:this.props.previousIconComponent,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText}))},getColumnSelectorSection:function(e,t){return this.state.showColumnChooser?r.createElement(a,{columns:e,selectedColumns:t,setColumns:this.setColumns,settingsText:this.props.settingsText,settingsIconComponent:this.props.settingsIconComponent,maxRowsText:this.props.maxRowsText,setPageSize:this.setPageSize,showSetPageSize:!this.shouldUseCustomGridComponent(),resultsPerPage:this.state.resultsPerPage,enableToggleCustom:this.props.enableToggleCustom,toggleCustomComponent:this.toggleCustomComponent,useCustomComponent:this.shouldUseCustomRowComponent()||this.shouldUseCustomGridComponent(),useGriddleStyles:this.props.useGriddleStyles,enableCustomFormatText:this.props.enableCustomFormatText,columnMetadata:this.props.columnMetadata}):""},getCustomGridSection:function(){return r.createElement(this.props.customGridComponent,o({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,n,o,s){return r.createElement("div",null,r.createElement(p,{data:e,columns:t,metadataColumns:n,globalData:s,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&o)},getStandardGridSection:function(e,t,n,o,l){var i=this.getSortObject(),a=this.getMultipleSelectionObject(),d=this.shouldShowNoDataSection(e),u=this.getNoDataSection();return r.createElement("div",{className:"griddle-body"},r.createElement(s,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:u,showNoData:d,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:i,multipleSelectionSettings:a,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:o,data:e,className:this.props.tableClassName,enableInfiniteScroll:this.isInfiniteScrollEnabled(),nextPage:this.nextPage,showTableHeading:this.props.showTableHeading,useFixedHeader:this.props.useFixedHeader,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,parentRowExpandedComponent:this.props.parentRowExpandedComponent,bodyHeight:this.props.bodyHeight,paddingHeight:this.props.paddingHeight,rowHeight:this.props.rowHeight,infiniteScrollLoadTreshold:this.props.infiniteScrollLoadTreshold,externalLoadingComponent:this.props.externalLoadingComponent,externalIsLoading:this.props.externalIsLoading,hasMorePages:l,onRowClick:this.props.onRowClick}))},getContentSection:function(e,t,n,o,r,s){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,n,o,s):this.getStandardGridSection(e,t,n,o,r)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?r.createElement("div",{className:this.props.noDataClassName},r.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):r.createElement(d,{noDataMessage:this.props.noDataMessage})},shouldShowNoDataSection:function(e){return!this.props.allowEmptyGrid&&(!1===this.props.useExternal&&(void 0===e||0===e.length)||!0===this.props.useExternal&&!1===this.props.externalIsLoading&&0===e.length)},render:function(){var e=this.getCurrentResults(),t=(this.props.tableClassName,this.getFilter()),n=this.getSettings(),o=this.getTopSection(t,n),s=[],l=this.columnSettings.getColumns(),i=this.getDataForRender(e,l,!0),a=this.columnSettings.getMetadataColumns();this.props.columnMetadata?S(this.props.columnMetadata,function(e){"boolean"==typeof e.visible&&!1===e.visible||s.push(e.columnName)}):s=_.keys(A(e[0],a)),s=this.columnSettings.orderColumns(s);var d=this.getCurrentPage(),u=this.getCurrentMaxPage(),c=d+10?"griddle "+this.props.gridClassName:"griddle";return m+=this.shouldUseCustomRowComponent()?" griddle-custom":"",r.createElement("div",{className:m},o,h,r.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},f))}});c.Griddle=e.exports=N},"./node_modules/griddle-react/modules/rowProperties.js":function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n-1}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseIndexOf.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_arrayIncludesWith.js":function(e,t){function n(e,t,n){for(var o=-1,r=null==e?0:e.length;++o=u&&(p=d,f=!1,t=new r(t));e:for(;++c0&&n(u)?t>1?o(u,t-1,n,l,i):r(i,u):l||(i[i.length]=u)}return i}var r=n("./node_modules/griddle-react/node_modules/lodash/_arrayPush.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_isFlattenable.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_baseFor.js":function(e,t,n){var o=n("./node_modules/griddle-react/node_modules/lodash/_createBaseFor.js"),r=o();e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_baseForOwn.js":function(e,t,n){function o(e,t){return e&&r(e,t,s)}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseFor.js"),s=n("./node_modules/griddle-react/node_modules/lodash/keys.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_baseGet.js":function(e,t,n){function o(e,t){t=r(t,e);for(var n=0,o=t.length;null!=e&&n=120&&_.length>=120)?new r(f&&_):void 0}_=e[0];var y=-1,v=h[0];e:for(;++yr?0:r+t),n=n>r?r:n,n<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(r);++ot||l&&i&&d&&!a&&!u||o&&i&&d||!n&&d||!s)return 1;if(!o&&!l&&!u&&e=a?d:d*("desc"==n[o]?-1:1)}return e.index-t.index}var r=n("./node_modules/griddle-react/node_modules/lodash/_compareAscending.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_copyArray.js":function(e,t){function n(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n1?n[r-1]:void 0,i=r>2?n[2]:void 0;for(l=e.length>3&&"function"==typeof l?(r--,l):void 0,i&&s(n[0],n[1],i)&&(l=r<3?void 0:l,r=1),t=Object(t);++o-1?i[a?t[d]:d]:void 0}}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseIteratee.js"),s=n("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),l=n("./node_modules/griddle-react/node_modules/lodash/keys.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_createToPairs.js":function(e,t,n){function o(e){return function(t){var n=s(t);return n==a?l(t):n==d?i(t):r(t,e(t))}}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseToPairs.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_getTag.js"),l=n("./node_modules/griddle-react/node_modules/lodash/_mapToArray.js"),i=n("./node_modules/griddle-react/node_modules/lodash/_setToPairs.js"),a="[object Map]",d="[object Set]";e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_customDefaultsAssignIn.js":function(e,t,n){function o(e,t,n,o){return void 0===e||r(e,s[n])&&!l.call(o,n)?t:e}var r=n("./node_modules/griddle-react/node_modules/lodash/eq.js"),s=Object.prototype,l=s.hasOwnProperty;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_customOmitClone.js":function(e,t,n){function o(e){return r(e)?void 0:e}var r=n("./node_modules/griddle-react/node_modules/lodash/isPlainObject.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_defineProperty.js":function(e,t,n){var o=n("./node_modules/griddle-react/node_modules/lodash/_getNative.js"),r=function(){try{var e=o(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_equalArrays.js":function(e,t,n){function o(e,t,n,o,d,u){var c=n&i,p=e.length,f=t.length;if(p!=f&&!(c&&f>p))return!1;var h=u.get(e);if(h&&u.get(t))return h==t;var m=-1,g=!0,_=n&a?new r:void 0;for(u.set(e,t),u.set(t,e);++m-1&&e%1==0&&e-1}var r=n("./node_modules/griddle-react/node_modules/lodash/_assocIndexOf.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_listCacheSet.js":function(e,t,n){function o(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}var r=n("./node_modules/griddle-react/node_modules/lodash/_assocIndexOf.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_mapCacheClear.js":function(e,t,n){function o(){this.size=0,this.__data__={hash:new r,map:new(l||s),string:new r}}var r=n("./node_modules/griddle-react/node_modules/lodash/_Hash.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_ListCache.js"),l=n("./node_modules/griddle-react/node_modules/lodash/_Map.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_mapCacheDelete.js":function(e,t,n){function o(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}var r=n("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_mapCacheGet.js":function(e,t,n){function o(e){return r(this,e).get(e)}var r=n("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_mapCacheHas.js":function(e,t,n){function o(e){return r(this,e).has(e)}var r=n("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_mapCacheSet.js":function(e,t,n){function o(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}var r=n("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_mapToArray.js":function(e,t){function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,o){n[++t]=[o,e]}),n}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_matchesStrictComparable.js":function(e,t){function n(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_memoizeCapped.js":function(e,t,n){function o(e){var t=r(e,function(e){return n.size===s&&n.clear(),e}),n=t.cache;return t}var r=n("./node_modules/griddle-react/node_modules/lodash/memoize.js"),s=500;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_nativeCreate.js":function(e,t,n){var o=n("./node_modules/griddle-react/node_modules/lodash/_getNative.js"),r=o(Object,"create");e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_nativeKeys.js":function(e,t,n){var o=n("./node_modules/griddle-react/node_modules/lodash/_overArg.js"),r=o(Object.keys,Object);e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_nativeKeysIn.js":function(e,t){function n(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_nodeUtil.js":function(e,t,n){(function(e){var o=n("./node_modules/griddle-react/node_modules/lodash/_freeGlobal.js"),r="object"==typeof t&&t&&!t.nodeType&&t,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,l=s&&s.exports===r,i=l&&o.process,a=function(){try{return i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}).call(t,n("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/griddle-react/node_modules/lodash/_objectToString.js":function(e,t){function n(e){return r.call(e)}var o=Object.prototype,r=o.toString;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_overArg.js":function(e,t){function n(e,t){return function(n){return e(t(n))}}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_overRest.js":function(e,t,n){function o(e,t,n){return t=s(void 0===t?e.length-1:t,0),function(){for(var o=arguments,l=-1,i=s(o.length-t,0),a=Array(i);++l0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var o=800,r=16,s=Date.now;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_stackClear.js":function(e,t,n){function o(){this.__data__=new r,this.size=0}var r=n("./node_modules/griddle-react/node_modules/lodash/_ListCache.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackDelete.js":function(e,t){function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_stackGet.js":function(e,t){function n(e){return this.__data__.get(e)}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_stackHas.js":function(e,t){function n(e){return this.__data__.has(e)}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_stackSet.js":function(e,t,n){function o(e,t){var n=this.__data__;if(n instanceof r){var o=n.__data__;if(!s||o.length-1:!!u&&r(e,t,n)>-1}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseIndexOf.js"),s=n("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),l=n("./node_modules/griddle-react/node_modules/lodash/isString.js"),i=n("./node_modules/griddle-react/node_modules/lodash/toInteger.js"),a=n("./node_modules/griddle-react/node_modules/lodash/values.js"),d=Math.max;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/initial.js":function(e,t,n){function o(e){return(null==e?0:e.length)?r(e,0,-1):[]}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseSlice.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/intersection.js":function(e,t,n){var o=n("./node_modules/griddle-react/node_modules/lodash/_arrayMap.js"),r=n("./node_modules/griddle-react/node_modules/lodash/_baseIntersection.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_baseRest.js"),l=n("./node_modules/griddle-react/node_modules/lodash/_castArrayLikeObject.js"),i=s(function(e){var t=o(e,l);return t.length&&t[0]===e[0]?r(t):[]});e.exports=i},"./node_modules/griddle-react/node_modules/lodash/isArguments.js":function(e,t,n){var o=n("./node_modules/griddle-react/node_modules/lodash/_baseIsArguments.js"),r=n("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),s=Object.prototype,l=s.hasOwnProperty,i=s.propertyIsEnumerable,a=o(function(){return arguments}())?o:function(e){return r(e)&&l.call(e,"callee")&&!i.call(e,"callee")};e.exports=a},"./node_modules/griddle-react/node_modules/lodash/isArray.js":function(e,t){var n=Array.isArray;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isArrayLike.js":function(e,t,n){function o(e){return null!=e&&s(e.length)&&!r(e)}var r=n("./node_modules/griddle-react/node_modules/lodash/isFunction.js"),s=n("./node_modules/griddle-react/node_modules/lodash/isLength.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isArrayLikeObject.js":function(e,t,n){function o(e){return s(e)&&r(e)}var r=n("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),s=n("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isBuffer.js":function(e,t,n){(function(e){var o=n("./node_modules/griddle-react/node_modules/lodash/_root.js"),r=n("./node_modules/griddle-react/node_modules/lodash/stubFalse.js"),s="object"==typeof t&&t&&!t.nodeType&&t,l=s&&"object"==typeof e&&e&&!e.nodeType&&e,i=l&&l.exports===s,a=i?o.Buffer:void 0,d=a?a.isBuffer:void 0,u=d||r;e.exports=u}).call(t,n("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/griddle-react/node_modules/lodash/isEmpty.js":function(e,t,n){function o(e){if(null==e)return!0;if(a(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||d(e)||c(e)||l(e)))return!e.length;var t=s(e);if(t==p||t==f)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(m.call(e,n))return!1;return!0}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseKeys.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_getTag.js"),l=n("./node_modules/griddle-react/node_modules/lodash/isArguments.js"),i=n("./node_modules/griddle-react/node_modules/lodash/isArray.js"),a=n("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),d=n("./node_modules/griddle-react/node_modules/lodash/isBuffer.js"),u=n("./node_modules/griddle-react/node_modules/lodash/_isPrototype.js"),c=n("./node_modules/griddle-react/node_modules/lodash/isTypedArray.js"),p="[object Map]",f="[object Set]",h=Object.prototype,m=h.hasOwnProperty;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isFunction.js":function(e,t,n){function o(e){if(!s(e))return!1;var t=r(e);return t==i||t==a||t==l||t==d}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=n("./node_modules/griddle-react/node_modules/lodash/isObject.js"),l="[object AsyncFunction]",i="[object Function]",a="[object GeneratorFunction]",d="[object Proxy]";e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isLength.js":function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}var o=9007199254740991;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isNull.js":function(e,t){function n(e){return null===e}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isObject.js":function(e,t){function n(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isObjectLike.js":function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isPlainObject.js":function(e,t,n){function o(e){if(!l(e)||r(e)!=i)return!1;var t=s(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==p}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_getPrototype.js"),l=n("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),i="[object Object]",a=Function.prototype,d=Object.prototype,u=a.toString,c=d.hasOwnProperty,p=u.call(Object);e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isString.js":function(e,t,n){function o(e){return"string"==typeof e||!s(e)&&l(e)&&r(e)==i}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=n("./node_modules/griddle-react/node_modules/lodash/isArray.js"),l=n("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),i="[object String]";e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isSymbol.js":function(e,t,n){function o(e){return"symbol"==typeof e||s(e)&&r(e)==l}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=n("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),l="[object Symbol]";e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isTypedArray.js":function(e,t,n){var o=n("./node_modules/griddle-react/node_modules/lodash/_baseIsTypedArray.js"),r=n("./node_modules/griddle-react/node_modules/lodash/_baseUnary.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_nodeUtil.js"),l=s&&s.isTypedArray,i=l?r(l):o;e.exports=i},"./node_modules/griddle-react/node_modules/lodash/isUndefined.js":function(e,t){function n(e){return void 0===e}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/keys.js":function(e,t,n){function o(e){return l(e)?r(e):s(e)}var r=n("./node_modules/griddle-react/node_modules/lodash/_arrayLikeKeys.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_baseKeys.js"),l=n("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/keysIn.js":function(e,t,n){function o(e){return l(e)?r(e,!0):s(e)}var r=n("./node_modules/griddle-react/node_modules/lodash/_arrayLikeKeys.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_baseKeysIn.js"),l=n("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/last.js":function(e,t){function n(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/map.js":function(e,t,n){function o(e,t){return(i(e)?r:l)(e,s(t,3))}var r=n("./node_modules/griddle-react/node_modules/lodash/_arrayMap.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_baseIteratee.js"),l=n("./node_modules/griddle-react/node_modules/lodash/_baseMap.js"),i=n("./node_modules/griddle-react/node_modules/lodash/isArray.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/memoize.js":function(e,t,n){function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(s);var n=function(){var o=arguments,r=t?t.apply(this,o):o[0],s=n.cache;if(s.has(r))return s.get(r);var l=e.apply(this,o);return n.cache=s.set(r,l)||s,l};return n.cache=new(o.Cache||r),n}var r=n("./node_modules/griddle-react/node_modules/lodash/_MapCache.js"),s="Expected a function";o.Cache=r,e.exports=o},"./node_modules/griddle-react/node_modules/lodash/omit.js":function(e,t,n){var o=n("./node_modules/griddle-react/node_modules/lodash/_arrayMap.js"),r=n("./node_modules/griddle-react/node_modules/lodash/_baseClone.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_baseUnset.js"),l=n("./node_modules/griddle-react/node_modules/lodash/_castPath.js"),i=n("./node_modules/griddle-react/node_modules/lodash/_copyObject.js"),a=n("./node_modules/griddle-react/node_modules/lodash/_customOmitClone.js"),d=n("./node_modules/griddle-react/node_modules/lodash/_flatRest.js"),u=n("./node_modules/griddle-react/node_modules/lodash/_getAllKeysIn.js"),c=d(function(e,t){var n={};if(null==e)return n;var d=!1;t=o(t,function(t){return t=l(t,e),d||(d=t.length>1),t}),i(e,u(e),n),d&&(n=r(n,7,a));for(var c=t.length;c--;)s(n,t[c]);return n});e.exports=c},"./node_modules/griddle-react/node_modules/lodash/orderBy.js":function(e,t,n){function o(e,t,n,o){return null==e?[]:(s(t)||(t=null==t?[]:[t]),n=o?void 0:n,s(n)||(n=null==n?[]:[n]),r(e,t,n))}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseOrderBy.js"),s=n("./node_modules/griddle-react/node_modules/lodash/isArray.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/pick.js":function(e,t,n){var o=n("./node_modules/griddle-react/node_modules/lodash/_basePick.js"),r=n("./node_modules/griddle-react/node_modules/lodash/_flatRest.js"),s=r(function(e,t){return null==e?{}:o(e,t)});e.exports=s},"./node_modules/griddle-react/node_modules/lodash/property.js":function(e,t,n){function o(e){return l(e)?r(i(e)):s(e)}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseProperty.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_basePropertyDeep.js"),l=n("./node_modules/griddle-react/node_modules/lodash/_isKey.js"),i=n("./node_modules/griddle-react/node_modules/lodash/_toKey.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/sortBy.js":function(e,t,n){var o=n("./node_modules/griddle-react/node_modules/lodash/_baseFlatten.js"),r=n("./node_modules/griddle-react/node_modules/lodash/_baseOrderBy.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_baseRest.js"),l=n("./node_modules/griddle-react/node_modules/lodash/_isIterateeCall.js"),i=s(function(e,t){if(null==e)return[];var n=t.length;return n>1&&l(e,t[0],t[1])?t=[]:n>2&&l(t[0],t[1],t[2])&&(t=[t[0]]),r(e,o(t,1),[])});e.exports=i},"./node_modules/griddle-react/node_modules/lodash/stubArray.js":function(e,t){function n(){return[]}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/stubFalse.js":function(e,t){function n(){return!1}e.exports=n},"./node_modules/griddle-react/node_modules/lodash/take.js":function(e,t,n){function o(e,t,n){return e&&e.length?(t=n||void 0===t?1:s(t),r(e,0,t<0?0:t)):[]}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseSlice.js"),s=n("./node_modules/griddle-react/node_modules/lodash/toInteger.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/toFinite.js":function(e,t,n){function o(e){return e?(e=r(e))===s||e===-s?(e<0?-1:1)*l:e===e?e:0:0===e?e:0}var r=n("./node_modules/griddle-react/node_modules/lodash/toNumber.js"),s=1/0,l=1.7976931348623157e308;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/toInteger.js":function(e,t,n){function o(e){var t=r(e),n=t%1;return t===t?n?t-n:t:0}var r=n("./node_modules/griddle-react/node_modules/lodash/toFinite.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/toNumber.js":function(e,t,n){function o(e){if("number"==typeof e)return e;if(s(e))return l;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=d.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):a.test(e)?l:+e}var r=n("./node_modules/griddle-react/node_modules/lodash/isObject.js"),s=n("./node_modules/griddle-react/node_modules/lodash/isSymbol.js"),l=NaN,i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/toPairs.js":function(e,t,n){var o=n("./node_modules/griddle-react/node_modules/lodash/_createToPairs.js"),r=n("./node_modules/griddle-react/node_modules/lodash/keys.js"),s=o(r);e.exports=s},"./node_modules/griddle-react/node_modules/lodash/toString.js":function(e,t,n){function o(e){return null==e?"":r(e)}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseToString.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/uniqueId.js":function(e,t,n){function o(e){var t=++s;return r(e)+t}var r=n("./node_modules/griddle-react/node_modules/lodash/toString.js"),s=0;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/values.js":function(e,t,n){function o(e){return null==e?[]:r(e,s(e))}var r=n("./node_modules/griddle-react/node_modules/lodash/_baseValues.js"),s=n("./node_modules/griddle-react/node_modules/lodash/keys.js");e.exports=o},"./node_modules/griddle-react/node_modules/lodash/without.js":function(e,t,n){var o=n("./node_modules/griddle-react/node_modules/lodash/_baseDifference.js"),r=n("./node_modules/griddle-react/node_modules/lodash/_baseRest.js"),s=n("./node_modules/griddle-react/node_modules/lodash/isArrayLikeObject.js"),l=r(function(e,t){return s(e)?o(e,t):[]});e.exports=l},"./node_modules/griddle-react/node_modules/lodash/zipObject.js":function(e,t,n){function o(e,t){return s(e||[],t||[],r)}var r=n("./node_modules/griddle-react/node_modules/lodash/_assignValue.js"),s=n("./node_modules/griddle-react/node_modules/lodash/_baseZipObject.js");e.exports=o},"./node_modules/react-selectable/dist/react-selectable.js":function(e,t,n){!function(t,o){e.exports=function(e,t){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.nodeInRoot=t.isNodeIn=t.createSelectable=t.SelectableGroup=void 0;var r=n(1),s=o(r),l=n(9),i=o(l),a=n(5),d=o(a),u=n(4),c=o(u);t.SelectableGroup=s.default,t.createSelectable=i.default,t.isNodeIn=d.default,t.nodeInRoot=c.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;nn+i||t+r-ao+l)};t.default=function(e,t,n){var o=e instanceof HTMLElement?(0,r.default)(e):e,l=t instanceof HTMLElement?(0,r.default)(t):t;return s(o.top,o.left,l.top,l.left,o.offsetWidth,o.offsetHeight,l.offsetWidth,l.offsetHeight,n)}},function(e,t){(function(t){"use strict";function n(e,t,n){function o(t){var n=m,o=g;return m=g=void 0,E=t,y=e.apply(o,n)}function s(e){return E=e,v=setTimeout(u,t),w?o(e):y}function l(e){var n=e-b,o=e-E,r=t-n;return O?j(r,_-o):r}function a(e){var n=e-b,o=e-E;return void 0===b||n>=t||n<0||O&&o>=_}function u(){var e=C();if(a(e))return c(e);v=setTimeout(u,l(e))}function c(e){return v=void 0,F&&m?o(e):(m=g=void 0,y)}function p(){void 0!==v&&clearTimeout(v),E=0,m=b=g=v=void 0}function f(){return void 0===v?y:c(C())}function h(){var e=C(),n=a(e);if(m=arguments,g=this,b=e,n){if(void 0===v)return s(b);if(O)return v=setTimeout(u,t),o(b)}return void 0===v&&(v=setTimeout(u,t)),y}var m,g,_,y,v,b,E=0,w=!1,O=!1,F=!0;if("function"!=typeof e)throw new TypeError(d);return t=i(t)||0,r(n)&&(w=!!n.leading,O="maxWait"in n,_=O?S(i(n.maxWait)||0,t):_,F="trailing"in n?!!n.trailing:F),h.cancel=p,h.flush=f,h}function o(e,t,o){var s=!0,l=!0;if("function"!=typeof e)throw new TypeError(d);return r(o)&&(s="leading"in o?!!o.leading:s,l="trailing"in o?!!o.trailing:l),n(e,t,{leading:s,maxWait:t,trailing:l})}function r(e){var t=void 0===e?"undefined":a(e);return!!e&&("object"==t||"function"==t)}function s(e){return!!e&&"object"==(void 0===e?"undefined":a(e))}function l(e){return"symbol"==(void 0===e?"undefined":a(e))||s(e)&&E.call(e)==c}function i(e){if("number"==typeof e)return e;if(l(e))return u;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(p,"");var n=h.test(e);return n||m.test(e)?g(e.slice(2),n?2:8):f.test(e)?u:+e}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d="Expected a function",u=NaN,c="[object Symbol]",p=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,m=/^0o[0-7]+$/i,g=parseInt,_="object"==(void 0===t?"undefined":a(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":a(self))&&self&&self.Object===Object&&self,v=_||y||Function("return this")(),b=Object.prototype,E=b.toString,S=Math.max,j=Math.min,C=function(){return v.Date.now()};e.exports=o}).call(t,function(){return this}())},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n; const progress = this.props.upload.progress; const linkedImage = (data.url && !progress) ? ( - + {image} ) : null; @@ -291,6 +297,7 @@ class PreviewImageField extends Component { Open ) diff --git a/client/src/components/ProportionConstraintField/ProportionConstraintField.js b/client/src/components/ProportionConstraintField/ProportionConstraintField.js index d5f3e6521..9b51fd7a2 100644 --- a/client/src/components/ProportionConstraintField/ProportionConstraintField.js +++ b/client/src/components/ProportionConstraintField/ProportionConstraintField.js @@ -1,4 +1,5 @@ -import React, { PropTypes, Component, Children, cloneElement } from 'react'; +import React, { Component, Children, cloneElement } from 'react'; +import PropTypes from 'prop-types'; import { inject } from 'lib/Injector'; class ProportionConstraintField extends Component { diff --git a/client/src/components/UploadField/UploadField.js b/client/src/components/UploadField/UploadField.js index 0999467c5..2ed66d920 100644 --- a/client/src/components/UploadField/UploadField.js +++ b/client/src/components/UploadField/UploadField.js @@ -1,5 +1,5 @@ import i18n from 'i18n'; -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators, compose } from 'redux'; import { inject } from 'lib/Injector'; @@ -7,6 +7,7 @@ import CONSTANTS from 'constants/index'; import fieldHolder from 'components/FieldHolder/FieldHolder'; import fileShape from 'lib/fileShape'; import * as uploadFieldActions from 'state/uploadField/UploadFieldActions'; +import PropTypes from 'prop-types'; /** * Check if two arrays of file objects have different id keys diff --git a/client/src/components/UploadField/UploadFieldItem.js b/client/src/components/UploadField/UploadFieldItem.js index c0d8141eb..3519f6b92 100644 --- a/client/src/components/UploadField/UploadFieldItem.js +++ b/client/src/components/UploadField/UploadFieldItem.js @@ -3,6 +3,7 @@ import React, { Component } from 'react'; import CONSTANTS from 'constants'; import fileShape from 'lib/fileShape'; import { fileSize } from 'lib/DataFormat'; +import PropTypes from 'prop-types'; class UploadFieldItem extends Component { constructor(props) { @@ -374,12 +375,12 @@ class UploadFieldItem extends Component { } UploadFieldItem.propTypes = { - canEdit: React.PropTypes.bool, - name: React.PropTypes.string.isRequired, + canEdit: PropTypes.bool, + name: PropTypes.string.isRequired, item: fileShape, - onRemove: React.PropTypes.func, - onItemClick: React.PropTypes.func, - onView: React.PropTypes.func, + onRemove: PropTypes.func, + onItemClick: PropTypes.func, + onView: PropTypes.func, }; export default UploadFieldItem; diff --git a/client/src/containers/AssetAdmin/AssetAdmin.js b/client/src/containers/AssetAdmin/AssetAdmin.js index 7c500bcfa..31c4c53b9 100644 --- a/client/src/containers/AssetAdmin/AssetAdmin.js +++ b/client/src/containers/AssetAdmin/AssetAdmin.js @@ -1,5 +1,6 @@ /* global alert, confirm */ -import React, { PropTypes, Component } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { bindActionCreators, compose } from 'redux'; import backend from 'lib/Backend'; diff --git a/client/src/containers/AssetAdmin/AssetAdminRouter.js b/client/src/containers/AssetAdmin/AssetAdminRouter.js index 1240cfabc..893ba422c 100644 --- a/client/src/containers/AssetAdmin/AssetAdminRouter.js +++ b/client/src/containers/AssetAdmin/AssetAdminRouter.js @@ -1,4 +1,5 @@ -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { withRouter } from 'react-router'; import AssetAdmin from 'containers/AssetAdmin/AssetAdmin'; diff --git a/client/src/containers/AssetAdmin/stateRouter.js b/client/src/containers/AssetAdmin/stateRouter.js index 5ce239739..1cd77a9ed 100644 --- a/client/src/containers/AssetAdmin/stateRouter.js +++ b/client/src/containers/AssetAdmin/stateRouter.js @@ -1,4 +1,5 @@ -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { buildUrl } from 'containers/AssetAdmin/AssetAdminRouter'; import CONSTANTS from 'constants/index'; diff --git a/client/src/containers/Editor/Editor.js b/client/src/containers/Editor/Editor.js index 44da86b30..7a74d9d40 100644 --- a/client/src/containers/Editor/Editor.js +++ b/client/src/containers/Editor/Editor.js @@ -2,12 +2,13 @@ import i18n from 'i18n'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; -import React, { PropTypes, Component } from 'react'; +import React, { Component } from 'react'; import CONSTANTS from 'constants/index'; import FormBuilderLoader from 'containers/FormBuilderLoader/FormBuilderLoader'; import FormBuilderModal from 'components/FormBuilderModal/FormBuilderModal'; import * as UnsavedFormsActions from 'state/unsavedForms/UnsavedFormsActions'; import fileShape from 'lib/fileShape'; +import PropTypes from 'prop-types'; class Editor extends Component { constructor(props) { diff --git a/client/src/containers/Gallery/Gallery.js b/client/src/containers/Gallery/Gallery.js index 0cea341d3..591ee7fc2 100644 --- a/client/src/containers/Gallery/Gallery.js +++ b/client/src/containers/Gallery/Gallery.js @@ -1,7 +1,7 @@ /* global window */ import $ from 'jquery'; import i18n from 'i18n'; -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import ReactTestUtils from 'react-addons-test-utils'; import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; @@ -22,6 +22,7 @@ import GalleryDND from './GalleryDND'; import configShape from 'lib/configShape'; import MoveModal from '../MoveModal/MoveModal'; import { inject } from 'lib/Injector'; +import PropTypes from 'prop-types'; class Gallery extends Component { constructor(props) { @@ -1002,7 +1003,7 @@ const galleryViewPropTypes = Object.assign({}, sharedPropTypes, { selectableFolders: PropTypes.bool, onSelect: PropTypes.func, onCancelUpload: PropTypes.func, - onDelete: React.PropTypes.func, + onDelete: PropTypes.func, onRemoveErroredUpload: PropTypes.func, onEnableDropzone: PropTypes.func, }); @@ -1014,12 +1015,12 @@ Gallery.defaultProps = Object.assign({}, sharedDefaultProps, { }); Gallery.propTypes = Object.assign({}, sharedPropTypes, { - onUploadSuccess: React.PropTypes.func, - onCreateFolder: React.PropTypes.func, - onMoveFilesSuccess: React.PropTypes.func, - onDelete: React.PropTypes.func, - onPublish: React.PropTypes.func, - onUnpublish: React.PropTypes.func, + onUploadSuccess: PropTypes.func, + onCreateFolder: PropTypes.func, + onMoveFilesSuccess: PropTypes.func, + onDelete: PropTypes.func, + onPublish: PropTypes.func, + onUnpublish: PropTypes.func, type: PropTypes.oneOf(['insert-media', 'insert-link', 'select', 'admin']), view: PropTypes.oneOf(['tile', 'table']), lastSelected: PropTypes.number, diff --git a/client/src/containers/Gallery/GalleryDND.js b/client/src/containers/Gallery/GalleryDND.js index b76aa0865..14d7dab14 100644 --- a/client/src/containers/Gallery/GalleryDND.js +++ b/client/src/containers/Gallery/GalleryDND.js @@ -1,9 +1,10 @@ /* global window */ -import React, { PropTypes, Component } from 'react'; +import React, { Component } from 'react'; import { DragDropContext } from 'react-dnd'; import HTML5Backend from 'react-dnd-html5-backend'; import classnames from 'classnames'; import GalleryItemDragLayer from 'components/GalleryItem/GalleryItemDragLayer'; +import PropTypes from 'prop-types'; // add middleware to capture the manager that is to be used // eslint-disable-next-line new-cap @@ -75,9 +76,9 @@ GalleryDND.contextTypes = { GalleryDND.propTypes = { className: PropTypes.string, - children: React.PropTypes.oneOfType([ - React.PropTypes.arrayOf(React.PropTypes.node), - React.PropTypes.node, + children: PropTypes.oneOfType([ + PropTypes.arrayOf(PropTypes.node), + PropTypes.node, ]), }; diff --git a/client/src/containers/HistoryList/HistoryItem.js b/client/src/containers/HistoryList/HistoryItem.js index e3f535acf..34bda81db 100644 --- a/client/src/containers/HistoryList/HistoryItem.js +++ b/client/src/containers/HistoryList/HistoryItem.js @@ -1,4 +1,5 @@ -import React, { PropTypes, Component } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; class HistoryItem extends Component { constructor(props) { diff --git a/client/src/containers/HistoryList/HistoryList.js b/client/src/containers/HistoryList/HistoryList.js index 6b14e8a47..50644a8d6 100644 --- a/client/src/containers/HistoryList/HistoryList.js +++ b/client/src/containers/HistoryList/HistoryList.js @@ -4,6 +4,7 @@ import backend from 'lib/Backend'; import Config from 'lib/Config'; import HistoryItem from 'containers/HistoryList/HistoryItem'; import FormBuilderLoader from 'containers/FormBuilderLoader/FormBuilderLoader'; +import PropTypes from 'prop-types'; const sectionConfigKey = 'SilverStripe\\AssetAdmin\\Controller\\AssetAdmin'; @@ -163,16 +164,16 @@ class HistoryList extends Component { } HistoryList.propTypes = { - sectionConfig: React.PropTypes.shape({ - form: React.PropTypes.object, - historyEndpoint: React.PropTypes.shape({ - url: React.PropTypes.string, - method: React.PropTypes.string, - responseFormat: React.PropTypes.string, + sectionConfig: PropTypes.shape({ + form: PropTypes.object, + historyEndpoint: PropTypes.shape({ + url: PropTypes.string, + method: PropTypes.string, + responseFormat: PropTypes.string, }), }), - historySchemaUrl: React.PropTypes.string, - data: React.PropTypes.object, + historySchemaUrl: PropTypes.string, + data: PropTypes.object, }; HistoryList.defaultProps = { diff --git a/client/src/containers/InsertMediaModal/InsertMediaModal.js b/client/src/containers/InsertMediaModal/InsertMediaModal.js index 0177a0553..3e5200c03 100644 --- a/client/src/containers/InsertMediaModal/InsertMediaModal.js +++ b/client/src/containers/InsertMediaModal/InsertMediaModal.js @@ -1,5 +1,5 @@ import i18n from 'i18n'; -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; import { bindActionCreators, compose } from 'redux'; import { connect } from 'react-redux'; import AssetAdmin, { getFormSchema } from 'containers/AssetAdmin/AssetAdmin'; @@ -8,6 +8,7 @@ import fileSchemaModalHandler from 'containers/InsertLinkModal/fileSchemaModalHa import * as galleryActions from 'state/gallery/GalleryActions'; import FormBuilderModal from 'components/FormBuilderModal/FormBuilderModal'; import classnames from 'classnames'; +import PropTypes from 'prop-types'; class InsertMediaModal extends Component { constructor(props) { diff --git a/client/src/containers/MoveModal/MoveModal.js b/client/src/containers/MoveModal/MoveModal.js index f03ef84a7..0c0ad66ff 100644 --- a/client/src/containers/MoveModal/MoveModal.js +++ b/client/src/containers/MoveModal/MoveModal.js @@ -3,6 +3,7 @@ import { connect } from 'react-redux'; import { compose } from 'redux'; import i18n from 'i18n'; import CONSTANTS from 'constants/index'; +import PropTypes from 'prop-types'; import { deactivateModal, setNoticeMessage, @@ -74,19 +75,19 @@ class MoveModal extends React.Component { MoveModal.propTypes = { sectionConfig: configShape, - folderId: React.PropTypes.number.isRequired, - isOpen: React.PropTypes.bool, - onClosed: React.PropTypes.func, - setNotice: React.PropTypes.func, - setBadge: React.PropTypes.func, - setError: React.PropTypes.func, - title: React.PropTypes.string, - onSuccess: React.PropTypes.func, - onOpenFolder: React.PropTypes.func.isRequired, - selectedFiles: React.PropTypes.array.isRequired, - actions: React.PropTypes.shape({ - files: React.PropTypes.shape({ - moveFiles: React.PropTypes.func, + folderId: PropTypes.number.isRequired, + isOpen: PropTypes.bool, + onClosed: PropTypes.func, + setNotice: PropTypes.func, + setBadge: PropTypes.func, + setError: PropTypes.func, + title: PropTypes.string, + onSuccess: PropTypes.func, + onOpenFolder: PropTypes.func.isRequired, + selectedFiles: PropTypes.array.isRequired, + actions: PropTypes.shape({ + files: PropTypes.shape({ + moveFiles: PropTypes.func, }), }).isRequired, }; diff --git a/client/src/containers/TableView/TableView.js b/client/src/containers/TableView/TableView.js index f4f5dba59..0acf3e993 100644 --- a/client/src/containers/TableView/TableView.js +++ b/client/src/containers/TableView/TableView.js @@ -1,4 +1,5 @@ -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import Griddle from 'griddle-react'; import i18n from 'i18n'; import { galleryViewPropTypes, galleryViewDefaultProps } from 'containers/Gallery/Gallery'; diff --git a/client/src/containers/ThumbnailView/ThumbnailView.js b/client/src/containers/ThumbnailView/ThumbnailView.js index 095b73e57..23f235ee8 100644 --- a/client/src/containers/ThumbnailView/ThumbnailView.js +++ b/client/src/containers/ThumbnailView/ThumbnailView.js @@ -1,8 +1,9 @@ import i18n from 'i18n'; -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; import { inject } from 'lib/Injector'; import { galleryViewPropTypes, galleryViewDefaultProps } from 'containers/Gallery/Gallery'; import Griddle from 'griddle-react'; +import PropTypes from 'prop-types'; class ThumbnailView extends Component { constructor(props) { diff --git a/client/src/lib/configShape.js b/client/src/lib/configShape.js index 1dad0f5a0..f5d67f309 100644 --- a/client/src/lib/configShape.js +++ b/client/src/lib/configShape.js @@ -1,4 +1,4 @@ -import { PropTypes } from 'react'; +import PropTypes from 'prop-types'; const configShape = PropTypes.shape({ url: PropTypes.string, diff --git a/client/src/lib/fileShape.js b/client/src/lib/fileShape.js index 0e87b070e..80f6245cc 100644 --- a/client/src/lib/fileShape.js +++ b/client/src/lib/fileShape.js @@ -1,4 +1,4 @@ -import { PropTypes } from 'react'; +import PropTypes from 'prop-types'; const fileShape = PropTypes.shape({ canEdit: PropTypes.bool, diff --git a/package.json b/package.json index a7861b5f0..5b1d820dc 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ }, "devDependencies": { "@silverstripe/eslint-config": "0.0.5", - "@silverstripe/webpack-config": "0.11.0", + "@silverstripe/webpack-config": "^0.12.0", "babel-jest": "^19.0.0", "expose-loader": "^0.7.5", "jest-cli": "^19.0.2", @@ -71,6 +71,7 @@ "griddle-react": "^0.7.0", "jquery": "^3.1.1", "modernizr": "^3.5.0", + "prop-types": "^15.6.2", "qs": "^6.2.1", "react": "15.3.1", "react-addons-css-transition-group": "15.3.1", diff --git a/yarn.lock b/yarn.lock index 45a401092..74554a9df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,9 +18,9 @@ eslint-plugin-jsx-a11y "^5.1.1" eslint-plugin-react "^7.3.0" -"@silverstripe/webpack-config@0.11.0": - version "0.11.0" - resolved "https://registry.yarnpkg.com/@silverstripe/webpack-config/-/webpack-config-0.11.0.tgz#54f083784083e12f4de5b376c0e655a1d8cc5f73" +"@silverstripe/webpack-config@^0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@silverstripe/webpack-config/-/webpack-config-0.12.0.tgz#6e392af52adc81bc4856badc276cf4738b0af7e4" dependencies: autoprefixer "^6.4.0" babel-core "^6.24.1" @@ -7183,6 +7183,13 @@ prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.8, prop-types@^15.5.9, loose-envify "^1.3.1" object-assign "^4.1.1" +prop-types@^15.6.2: + version "15.6.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" + dependencies: + loose-envify "^1.3.1" + object-assign "^4.1.1" + proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849"