From 65c26d299e51a94d3b78cb1ec6d20acafb94fbfd Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 7 Sep 2023 16:59:59 +1200 Subject: [PATCH] FIX Allow wrapping an image in a link --- client/dist/js/TinyMCE_sslink-file.js | 2 +- client/src/entwine/TinyMCE_sslink-file.js | 6 +- tests/behat/features/insert-an-image.feature | 24 ++++++++ tests/behat/src/FixtureContext.php | 64 -------------------- 4 files changed, 26 insertions(+), 70 deletions(-) diff --git a/client/dist/js/TinyMCE_sslink-file.js b/client/dist/js/TinyMCE_sslink-file.js index 06284b76a..be1f018d0 100644 --- a/client/dist/js/TinyMCE_sslink-file.js +++ b/client/dist/js/TinyMCE_sslink-file.js @@ -27,4 +27,4 @@ } ${s.fileInterface} ${s.file} -`;t.mutation=l;const a={props:e=>{let{mutate:t,ownProps:{actions:n={}}}=e;return{actions:Object.assign({},n,{files:Object.assign({},n.files,{moveFiles:(e,n)=>t({variables:{folderId:e,fileIds:n},update:()=>{window.ss.apolloClient.resetStore()}})})})}}};t.config=a;var u=(0,o.graphql)(l,a);t.default=u},6307:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mutation=t.default=t.config=void 0;var r,o=n(3732),i=(r=n(6821))&&r.__esModule?r:{default:r};const{mutation:s,config:l}=(0,i.default)("publishFiles");t.config=l,t.mutation=s;var a=(0,o.graphql)(s,l);t.default=a},168:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mutation=t.default=t.config=void 0;var r,o=n(3732),i=(r=n(6821))&&r.__esModule?r:{default:r};const{mutation:s,config:l}=(0,i.default)("unpublishFiles");t.config=l,t.mutation=s;var a=(0,o.graphql)(s,l);t.default=a},8750:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=["SET_LAST_SELECTED","SET_SELECTED_FILES","DESELECT_FILES","SELECT_FILES","LOAD_FILE_REQUEST","LOAD_FILE_SUCCESS","HIGHLIGHT_FILES","UPDATE_BATCH_ACTIONS","SET_NOTICE_MESSAGE","SET_ERROR_MESSAGE","SET_ENABLE_DROPZONE","SET_FILE_BADGE","CLEAR_FILE_BADGE","ACTIVATE_MODAL","DEACTIVATE_MODAL","CONCATENATE_SELECT","SET_LOADING"].reduce(((e,t)=>Object.assign(e,{[t]:`GALLERY.${t}`})),{});t.default=n},3669:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activateModal=function(e){return t=>{t({type:o.default.ACTIVATE_MODAL,payload:e})}},t.clearFileBadge=i,t.deactivateModal=function(){return e=>{e({type:o.default.DEACTIVATE_MODAL})}},t.deselectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:o.default.DESELECT_FILES,payload:{ids:e}})},t.loadFile=function(e,t){return n=>{n({type:o.default.LOAD_FILE_SUCCESS,payload:{id:e,file:t}})}},t.selectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:o.default.SELECT_FILES,payload:{ids:e}})},t.setConcatenateSelect=function(e){return t=>t({type:o.default.CONCATENATE_SELECT,payload:!!e})},t.setEnableDropzone=function(e){return t=>t({type:o.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})},t.setErrorMessage=function(e){return t=>t({type:o.default.SET_ERROR_MESSAGE,payload:{message:e}})},t.setFileBadge=function(e,t,n,r){return(s,l)=>{const{assetAdmin:a}=l(),u=a.gallery.badges.find((t=>t.id===e));u&&u.timer&&clearTimeout(u.timer);const d=r>0?setTimeout((()=>i(e)(s)),r):null;s({type:o.default.SET_FILE_BADGE,payload:{id:e,message:t,status:n,timer:d}})}},t.setLastSelected=function(e){return t=>{t({type:o.default.SET_LAST_SELECTED,payload:{id:e}})}},t.setLoading=function(e){return t=>{t({type:o.default.SET_LOADING,payload:!!e})}},t.setNoticeMessage=function(e){return t=>t({type:o.default.SET_NOTICE_MESSAGE,payload:{message:e}})},t.setSelectedFiles=function(e){return t=>{t({type:o.default.SET_SELECTED_FILES,payload:{files:e}})}};var r,o=(r=n(8750))&&r.__esModule?r:{default:r};function i(e){return t=>{t({type:o.default.CLEAR_FILE_BADGE,payload:{id:e}})}}},9905:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultImageFactory=t.default=void 0;var r=i(n(2175)),o=i(n(270));function i(e){return e&&e.__esModule?e:{default:e}}const s={minRetry:0,maxRetry:0,expiry:0,onStatusChange:()=>null,onRetry:()=>null,onReset:()=>null,onTimeout:()=>null},l=(e,t,n)=>{const r=new Image;r.onload=t,r.onerror=n,r.src=e};t.defaultImageFactory=l;var a=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;this.options={...s,...e},this.factory=t}loadImage(e){return this.options.minRetry&&o.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}loadImageLoop(e,t){return this.options.onStatusChange(e,r.default.LOADING),new Promise(((t,n)=>this.factory(e,t,n))).then((()=>this.handleSuccess(e))).catch((()=>this.handleError(e,t)))}handleReset(e,t){this.options.onReset(e),t()}handleTimeout(e,t){const n=setTimeout(e,t);return this.options.onTimeout(n,t),n}handleSuccess(e){o.default.unlock(e),this.options.onStatusChange(e,r.default.SUCCESS)}handleFailure(e){return o.default.unlock(e),this.options.onStatusChange(e,r.default.FAILED),this.options.expiry?new Promise((t=>{this.handleTimeout((()=>this.handleReset(e,t)),1e3*this.options.expiry)})):null}handleError(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,r.default.WAITING),this.handleRetry(e,t))}handleRetry(e,t){const n=new Promise((n=>{this.handleTimeout((()=>n(this.loadImageLoop(e,2*t))),1e3*t)}));return this.options.onRetry(e,t,n),n}setOnRetry(e){this.options.onRetry=e}setOnReset(e){this.options.onReset=e}setOnStatusChange(e){this.options.onStatusChange=e}setOnTimeout(e){this.options.onTimeout=e}};t.default=a},9505:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={SET_STATUS:"IMAGE_LOAD_SET_STATUS",RESET:"IMAGE_LOAD_RESET"}},3521:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadImage=function(e,t){return(n,i)=>{if(!e)return null;if(i().assetAdmin.imageLoad.files.find((t=>t.url===e)))return null;const s={...t,onStatusChange:(e,t)=>n({type:r.default.SET_STATUS,payload:{status:t,url:e}}),onReset:e=>n({type:r.default.RESET,payload:{url:e}})};return new o.default(s).loadImage(e)}};var r=i(n(9505)),o=i(n(9905));function i(e){return e&&e.__esModule?e:{default:e}}},270:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;class n{constructor(){this.urls=[]}lock(e){return!(this.urls.indexOf(e)>=0)&&(this.urls=[...this.urls,e],!0)}unlock(e){this.urls=this.urls.filter((t=>t!==e))}}t.Component=n,window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new n;var r=window.ss.imagelocker;t.default=r},2175:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DISABLED:"DISABLED",NONE:"NONE",SUCCESS:"SUCCESS",LOADING:"LOADING",WAITING:"WAITING",FAILED:"FAILED"}},3576:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DEFINE_IMAGE_SIZE_PRESETS:"DEFINE_IMAGE_SIZE_PRESETS",INIT_FORM_SCHEMA_STACK:"INIT_FORM_SCHEMA_STACK",POP_FORM_SCHEMA:"POP_FORM_SCHEMA",PUSH_FORM_SCHEMA:"PUSH_FORM_SCHEMA",RESET:"RESET",RESET_FORM_STACK:"RESET_FORM_STACK"}},4478:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defineImageSizePresets=function(e){return{type:r.default.DEFINE_IMAGE_SIZE_PRESETS,payload:{imageSizePresets:e}}},t.initFormStack=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:r.default.INIT_FORM_SCHEMA_STACK,payload:{formSchema:{type:e,nextType:t}}}},t.popFormStackEntry=function(){return{type:r.default.POP_FORM_SCHEMA}},t.pushFormStackEntry=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:r.default.PUSH_FORM_SCHEMA,payload:{formSchema:{type:e,nextType:t}}}},t.reset=function(){return{type:r.default.RESET}},t.resetFormStack=function(){return{type:r.default.RESET_FORM_STACK}},t.stashFormValues=function(e,t){return(n,r)=>{const l=r(),a=(0,o.default)(l.form.formState,`${e}.values`),u=(0,o.default)(l.form.formSchemas,`${t}.schema.fields`);if(a){const e=Object.keys(a).filter((e=>null!==a[e]&&(0,s.default)(e,u))).map((e=>({name:e,value:a[e]})));n((0,i.setSchemaStateOverrides)(t,{fields:e}))}}};var r=l(n(3576)),o=l(n(9298)),i=n(3573),s=l(n(4916));function l(e){return e&&e.__esModule?e:{default:e}}},4916:function(e,t){"use strict";function n(e,t){let r;for(r=0;rt({type:o.default.ADD_QUEUED_FILE,payload:{file:e}})},t.failUpload=function(e,t,n){return r=>{let i=t.message;return t.errors&&t.errors.length&&(i=t.errors[0]),"string"==typeof t&&(i={value:n||t,type:"error"}),r({type:o.default.FAIL_UPLOAD,payload:{queuedId:e,message:i}})}},t.purgeUploadQueue=function(){return e=>e({type:o.default.PURGE_UPLOAD_QUEUE,payload:null})},t.removeQueuedFile=function(e){return t=>t({type:o.default.REMOVE_QUEUED_FILE,payload:{queuedId:e}})},t.succeedUpload=function(e,t){return n=>n({type:o.default.SUCCEED_UPLOAD,payload:{queuedId:e,json:t}})},t.updateQueuedFile=function(e,t){return n=>n({type:o.default.UPDATE_QUEUED_FILE,payload:{queuedId:e,updates:t}})};var r,o=(r=n(4973))&&r.__esModule?r:{default:r}},6511:function(e,t,n){"use strict";var r=n(7418),o={};function i(e,t,n,r,o,i,s,l){if(!e){var a;if(void 0===t)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,s,l],d=0;(a=new Error(t.replace(/%s/g,(function(){return u[d++]})))).name="Invariant Violation"}throw a.framesToPop=1,a}}var s="mixins";e.exports=function(e,t,n){var l=[],a={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},u={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},d={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n0}},{key:"getMetadataColumnProperty",value:function(e,t,n){var r=this.getColumnMetadataByName(e);return null==r?n:r.hasOwnProperty(t)?r[t]:n}},{key:"orderColumns",value:function(e){var t=this;return a(e,(function(e){var n=l(t.columnMetadata,{columnName:e});return null==n||isNaN(n.order)?100:n.order}))}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=u(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=d},1172:function(e,t,n){"use strict";var r=n(7363),o=n(2555)({getDefaultProps:function(){return{placeholderText:""}},render:function(){return"function"!=typeof this.props.customFilterComponent?(console.log("Couldn't find valid template."),r.createElement("div",null)):r.createElement(this.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=o},2039:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t0&&(e=r.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=r.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,o=null,s=null;if(!0===this.props.useGriddleStyles){var l={float:"left",minHeight:"1px",marginTop:"5px"};s=i({textAlign:"right",width:"34%"},l),o=i({textAlign:"center",width:"33%"},l),n=i({width:"33%"},l)}for(var a=[],u=1;u<=this.props.maxPage;u++)a.push(r.createElement("option",{value:u,key:u},u));return r.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},r.createElement("div",{className:this.props.previousClassName,style:n},e),r.createElement("div",{className:"griddle-page",style:o},r.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},a)," / ",this.props.maxPage),r.createElement("div",{className:this.props.nextClassName,style:s},t))}});e.exports=s},344:function(e,t,n){"use strict";var r=n(7363),o=n(2555),i=(n(3059),n(7024)),s=n(3560),l=n(7287),a=n(8583),u=n(1747),d=n(3220),c=n(2569),p=o({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,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount:null}},componentWillMount:function(){null!==this.props.onRowWillMount&&s(this.props.onRowWillMount)&&this.props.onRowWillMount(this)},componentWillUnmount:function(){null!==this.props.onRowWillUnmount&&s(this.props.onRowWillUnmount)&&this.props.onRowWillUnmount(this)},handleClick:function(e){null!==this.props.onRowClick&&s(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleMouseEnter:function(e){null!==this.props.onRowMouseEnter&&s(this.props.onRowMouseEnter)&&this.props.onRowMouseEnter(this,e)},handleMouseLeave:function(e){null!==this.props.onRowMouseLeave&&s(this.props.onRowMouseLeave)&&this.props.onRowMouseLeave(this,e)},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 o=this.props.columnSettings.getColumns(),p=l(o,[]),f=a({},this.props.data);u(f,p);var h,m,g=d(i.pick(f,c(o,"children"))).map((function(t,o){var i=null,s=e.props.columnSettings.getColumnMetadataByName(t[0]),l=0===o&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?r.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===o&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?r.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===o&&e.props.isChildRow&&e.props.useGriddleStyles&&(n=a(n,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&null!=s)if(void 0!==s.customComponent&&null!==s.customComponent){var u=r.createElement(s.customComponent,{data:t[1],rowData:f,metadata:s});i=r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,className:s.cssClassName,key:o,style:n},u)}else i=r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,className:s.cssClassName,key:o,style:n},l,e.formatData(t[1]));return i||r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,key:o,style:n},l,t[1])}));if(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),g&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection){this.props.multipleSelectionSettings.getSelectedRowIds();g.unshift(r.createElement("td",{key:"selection",style:n,className:"griddle-select griddle-select-cell",onClick:m},r.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),r.createElement("tr",{onClick:h,className:y},g)}});e.exports=p},3302:function(e,t,n){"use strict";var r=n(7363),o=n(2555),i=(n(3059),n(8718)),s=o({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,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount: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 r.createElement("tbody",null);var t=[],n=this.props.columnSettings.getColumns();t.push(r.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?i(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,onRowMouseEnter:e.props.onRowMouseEnter,onRowMouseLeave:e.props.onRowMouseLeave,multipleSelectionSettings:this.props.multipleSelectionSettings,onRowWillMount:e.props.onRowWillMount,onRowWillUnmount:e.props.onRowWillUnmount}));var o=null;return e.state.showChildren&&(o=e.props.hasChildren&&this.props.data.children.map((function(t,n){var o=e.props.rowSettings.getRowKey(t,n);if(void 0!==t.children){var i=e.constructor.Griddle;return r.createElement("tr",{key:o,style:{paddingLeft:5}},r.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},r.createElement(i,{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 r.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:o})}))),!1===e.props.hasChildren?t[0]:r.createElement("tbody",null,e.state.showChildren?t.concat(o):t)}});e.exports=s},7033:function(e,t,n){"use strict";var r=n(7363),o=n(2555),i=n(4721),s=n(2569),l=n(3311),a=o({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===i(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 o=i(e.props.selectedColumns,t),s=l(e.props.columnMetadata,{columnName:t}),a=t;return void 0!==s&&void 0!==s.displayName&&null!=s.displayName&&(a=s.displayName),void 0!==s&&null!=s&&s.locked?r.createElement("div",{className:"column checkbox"},r.createElement("label",null,r.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:o,"data-name":t}),a)):void 0!==s&&null!=s&&void 0!==s.visible&&!1===s.visible?null:r.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},r.createElement("label",null,r.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:o,"data-name":t}),a))})));var n=e.props.enableToggleCustom?r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:"maxRows"},r.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",o=this.props.showSetPageSize?r.createElement("div",null,r.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",r.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},r.createElement("option",{value:"5"},"5"),r.createElement("option",{value:"10"},"10"),r.createElement("option",{value:"25"},"25"),r.createElement("option",{value:"50"},"50"),r.createElement("option",{value:"100"},"100")))):"";return r.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},r.createElement("h6",null,this.props.settingsText),r.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),o,n)}});e.exports=a},1277:function(e,t,n){"use strict";var r=n(7363),o=n(2555),i=n(4769),s=n(3302),l=(n(3059),n(5203),o({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,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount: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,r=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var o={scrollTop:t,scrollHeight:n,clientHeight:r};this.setState(o)}.6*(n-(t+r)-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,o=null,i=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var l=e.getAdjustedRowHeight(),a=Math.ceil(e.state.clientHeight/l),u=Math.max(0,Math.floor(e.state.scrollTop/l)-.25*a),d=Math.min(u+1.25*a,this.props.data.length-1);n=n.slice(u,d+1);var c={height:u*l+"px"};o=r.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-d)*l+"px"};i=r.createElement("tr",{key:"below-"+p.height,style:p})}var f=n.map((function(n,o){var i=void 0!==n.children&&n.children.length>0,l=e.props.rowSettings.getRowKey(n,o);return i&&(t=i),r.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:l+"-container",uniqueId:l,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:i,tableClassName:e.props.className,onRowClick:e.props.onRowClick,onRowMouseEnter:e.props.onRowMouseEnter,onRowMouseLeave:e.props.onRowMouseLeave,onRowWillMount:e.props.onRowWillMount,onRowWillUnmount:e.props.onRowWillUnmount})}));if(this.props.showNoData){var h=this.props.columnSettings.getVisibleColumnCount();f.push(r.createElement("tr",{key:"no-data-section"},r.createElement("td",{colSpan:h},this.props.noDataSection)))}return o&&f.unshift(o),i&&f.push(i),{nodes:f,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,n=this.getNodeContent();n&&(e=n.nodes,t=n.anyHasChildren);var o=null,s=null,l={width:"100%"};if(this.props.useFixedLayout&&(l.tableLayout="fixed"),this.props.enableInfiniteScroll&&(o={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var a,u=null;this.props.useGriddleStyles&&(u={textAlign:"center",paddingBottom:"40px"}),a=this.props.columnSettings.getVisibleColumnCount();var d=this.props.externalLoadingComponent?r.createElement(this.props.externalLoadingComponent,null):r.createElement("div",null,"Loading...");s=r.createElement("tbody",null,r.createElement("tr",null,r.createElement("td",{style:u,colSpan:a},d)))}var c=this.props.showTableHeading?r.createElement(i,{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=r.createElement("tbody",null,e));var p=r.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=r.createElement("tbody",null,r.createElement("tr",null,r.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&&(l.tableLayout="fixed"),r.createElement("div",null,r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},c),r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:o},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},e,s,p)))):r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:o},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},c,e,s,p))}}));e.exports=l},4769:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t=0)return!0}return!1}))},defaultColumnFilter:function(e,t,n){var r=N(O(n)?n:[n],(function(e){return(e||"").toLowerCase()}));return j(b.getObjectValues(t),(function(e){return e=e.toString().toLowerCase(),j(r,(function(t){return e.indexOf(t)>=0}))}))},filterByColumnFilters:function(e){var t=this.props.columnFilterFunc||this.defaultColumnFilter,n=Object.keys(e).reduce((function(n,r){return R(n,(function(n){var o=b.getAt(n,r||""),i=e[r];return t(r||"",o,i)}))}),this.props.results),r={columnFilters:e};e?(r.filteredResults=n,r.maxPage=this.getMaxPage(r.filteredResults)):this.state.filter?r.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):r.filteredResults=null,this.setState(r)},filterByColumn:function(e,t){var n=this.state.columnFilters;if(n.hasOwnProperty(t)&&!e)n=M(n,t);else{var r={};r[t]=e,n=T({},n,r)}this.filterByColumnFilters(n)},setFilter:function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(this.props.useExternal)this.props.externalSetFilter(e);else{var n=this,r={page:0,filter:e};r.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(t||this.props.results,e):this.defaultFilter(t||this.props.results,e),r.maxPage=n.getMaxPage(r.filteredResults),(D(e)||I(e)||A(e))&&(r.filter=e,r.filteredResults=null),n.setState(r),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 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)this.props.externalSetPage(e);else{if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t={page:e};this.setState(t)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})}},setColumns:function(e){this.columnSettings.filteredColumns=O(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=S(this.props.columnMetadata,{columnName:e})||{},r=n.sortDirectionCycle?n.sortDirectionCycle:[null,"asc","desc"],o=r.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null),i={page:0,sortColumn:e,sortDirection:r[o=(o+1)%r.length]?r[o]:null};this.setState(i)}},componentWillReceiveProps:function(e){if(e.results!==this.props.results&&this.setFilter(this.state.filter,e.results),this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=b.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,N(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 y(this.props.results.length>0?b.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new v(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:p,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 r=this,o=this;if(!this.props.useExternal){if(""!==this.state.sortColumn){var i,s=this.state.sortColumn,l=R(this.props.columnMetadata,{columnName:s}),a={columns:[],orders:[]};if(l.length>0&&(i=l[0].hasOwnProperty("customCompareFn")&&l[0].customCompareFn,l[0].multiSort&&(a=l[0].multiSort)),this.state.sortDirection)if("function"==typeof i)2===i.length?(e=e.sort((function(e,t){return i(k(e,s),k(t,s))})),"desc"===this.state.sortDirection&&e.reverse()):1===i.length&&(e=P(e,(function(e){return i(k(e,s))}),[this.state.sortDirection]));else{var u=[function(e){return(k(e,s)||"").toString().toLowerCase()}],d=[this.state.sortDirection];a.columns.forEach((function(e,t){u.push((function(t){return(k(t,e)||"").toString().toLowerCase()})),"asc"===a.orders[t]||"desc"===a.orders[t]?d.push(a.orders[t]):d.push(r.state.sortDirection)})),e=P(e,u,d)}}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,(c+1)*this.state.resultsPerPage);else{var p=C(e,c*this.state.resultsPerPage);e=(E||x)(p,p.length-this.state.resultsPerPage)}}for(var f=[],h=0;h0&&(m.children=o.getDataForRender(m[o.props.childrenColumnName],t,!1),"children"!==o.props.childrenColumnName&&delete m[o.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)),r=this;w(e,(function(e){r._updateSelectedRowIds(e[r.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),r=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],r,t);var o=this._getAreAllRowsChecked(r,N(n,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:o,selectedRowIds:r}),this.props.onSelectionChange&&this.props.onSelectionChange(r,o)},_updateSelectedRowIds:function(e,t,n){n?void 0===S(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===F(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:!S(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?o.createElement(g,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):o.createElement(a,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?o.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,r=null,i=null;return this.props.useGriddleStyles&&(n=this.getFilterStyles(),r=this.getSettingsStyles(),i=this.getClearFixStyles()),o.createElement("div",{className:"top-section",style:i},o.createElement("div",{className:"griddle-filter",style:n},e),o.createElement("div",{className:"griddle-settings-toggle",style:r},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return o.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?o.createElement(m,{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}):o.createElement(u,{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?o.createElement(d,{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 o.createElement(this.props.customGridComponent,r({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,n,r,i){return o.createElement("div",null,o.createElement(h,{data:e,columns:t,metadataColumns:n,globalData:i,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&r)},getStandardGridSection:function(e,t,n,r,i){var s=this.getSortObject(),a=this.getMultipleSelectionObject(),u=this.shouldShowNoDataSection(e),d=this.getNoDataSection();return o.createElement("div",{className:"griddle-body"},o.createElement(l,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:d,showNoData:u,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:s,multipleSelectionSettings:a,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:r,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:i,onRowClick:this.props.onRowClick,onRowMouseEnter:this.props.onRowMouseEnter,onRowMouseLeave:this.props.onRowMouseLeave,onRowWillMount:this.props.onRowWillMount,onRowWillUnmount:this.props.onRowWillUnmount}))},getContentSection:function(e,t,n,r,o,i){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,n,r,i):this.getStandardGridSection(e,t,n,r,o)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?o.createElement("div",{className:this.props.noDataClassName},o.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):o.createElement(c,{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(),r=this.getTopSection(t,n),i=[],s=this.columnSettings.getColumns(),l=this.getDataForRender(e,s,!0),a=this.columnSettings.getMetadataColumns();this.props.columnMetadata?w(this.props.columnMetadata,(function(e){"boolean"==typeof e.visible&&!1===e.visible||i.push(e.columnName)})):i=b.keys(M(e[0],a)),i=this.columnSettings.orderColumns(i);var u=this.getCurrentPage(),d=this.getCurrentMaxPage(),c=u+10?"griddle "+this.props.gridClassName:"griddle";return m+=this.shouldUseCustomRowComponent()?" griddle-custom":"",o.createElement("div",{className:m},r,h,o.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},f))}});f.Griddle=e.exports=L},5203:function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n-1}},1196:function(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r=200&&(c=a,p=!1,t=new r(t));e:for(;++d0&&i(d)?n>1?e(d,n-1,i,s,l):r(l,d):s||(l[l.length]=d)}return l}},8483:function(e,t,n){var r=n(5063)();e.exports=r},7816:function(e,t,n){var r=n(8483),o=n(3674);e.exports=function(e,t){return e&&r(e,t,o)}},7786:function(e,t,n){var r=n(1811),o=n(327);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n=120&&y.length>=120)?new r(f&&y):void 0}y=e[0];var v=-1,b=h[0];e:for(;++vo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++rt||s&&l&&u&&!a&&!d||o&&l&&u||!n&&u||!i)return 1;if(!o&&!s&&!d&&e=a?u:u*("desc"==n[o]?-1:1)}return e.index-t.index}},278:function(e){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n1?n[i-1]:void 0,l=i>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,l&&o(n[0],n[1],l)&&(s=i<3?void 0:s,i=1),t=Object(t);++r-1?l[a?t[u]:u]:void 0}}},3866:function(e,t,n){var r=n(8969),o=n(4160),i=n(8776),s=n(9294);e.exports=function(e){return function(t){var n=o(t);return"[object Map]"==n?i(t):"[object Set]"==n?s(t):r(t,e(t))}}},696:function(e,t,n){var r=n(8630);e.exports=function(e){return r(e)?void 0:e}},8777:function(e,t,n){var r=n(852),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},7114:function(e,t,n){var r=n(8668),o=n(2908),i=n(4757);e.exports=function(e,t,n,s,l,a){var u=1&n,d=e.length,c=t.length;if(d!=c&&!(u&&c>d))return!1;var p=a.get(e),f=a.get(t);if(p&&f)return p==t&&f==e;var h=-1,m=!0,g=2&n?new r:void 0;for(a.set(e,t),a.set(t,e);++h-1&&e%1==0&&e-1}},4705:function(e,t,n){var r=n(8470);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},4785:function(e,t,n){var r=n(1989),o=n(8407),i=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},1285:function(e,t,n){var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:function(e,t,n){var r=n(5050);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},8776:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},2634:function(e){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},4523:function(e,t,n){var r=n(8306);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},4536:function(e,t,n){var r=n(852)(Object,"create");e.exports=r},6916:function(e,t,n){var r=n(5569)(Object.keys,Object);e.exports=r},3498:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},1167:function(e,t,n){e=n.nmd(e);var r=n(1957),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o&&r.process,l=function(){try{var e=i&&i.require&&i.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=l},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5357:function(e,t,n){var r=n(6874),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,s=-1,l=o(i.length-t,0),a=Array(l);++s0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},7465:function(e,t,n){var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,n){var r=n(8407),o=n(7071),i=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(e,t),this.size=n.size,this}},2351:function(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r2?t[2]:void 0;for(u&&i(t[0],t[1],u)&&(r=1);++n-1:!!d&&r(e,t,n)>-1}},8125:function(e,t,n){var r=n(4259);e.exports=function(e){return(null==e?0:e.length)?r(e,0,-1):[]}},5325:function(e,t,n){var r=n(9932),o=n(7556),i=n(5976),s=n(4387),l=i((function(e){var t=r(e,s);return t.length&&t[0]===e[0]?o(t):[]}));e.exports=l},5694:function(e,t,n){var r=n(9454),o=n(7005),i=Object.prototype,s=i.hasOwnProperty,l=i.propertyIsEnumerable,a=r(function(){return arguments}())?r:function(e){return o(e)&&s.call(e,"callee")&&!l.call(e,"callee")};e.exports=a},1469:function(e){var t=Array.isArray;e.exports=t},8612:function(e,t,n){var r=n(3560),o=n(1780);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},9246:function(e,t,n){var r=n(8612),o=n(7005);e.exports=function(e){return o(e)&&r(e)}},4144:function(e,t,n){e=n.nmd(e);var r=n(5639),o=n(5062),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,l=s&&s.exports===i?r.Buffer:void 0,a=(l?l.isBuffer:void 0)||o;e.exports=a},1609:function(e,t,n){var r=n(280),o=n(4160),i=n(5694),s=n(1469),l=n(8612),a=n(4144),u=n(5726),d=n(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(l(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||a(e)||d(e)||i(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(c.call(e,n))return!1;return!0}},3560:function(e,t,n){var r=n(4239),o=n(3218);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},6688:function(e,t,n){var r=n(5588),o=n(1717),i=n(1167),s=i&&i.isMap,l=s?o(s):r;e.exports=l},5220:function(e){e.exports=function(e){return null===e}},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8630:function(e,t,n){var r=n(4239),o=n(5924),i=n(7005),s=Function.prototype,l=Object.prototype,a=s.toString,u=l.hasOwnProperty,d=a.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&a.call(n)==d}},2928:function(e,t,n){var r=n(9221),o=n(1717),i=n(1167),s=i&&i.isSet,l=s?o(s):r;e.exports=l},7037:function(e,t,n){var r=n(4239),o=n(1469),i=n(7005);e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&"[object String]"==r(e)}},3448:function(e,t,n){var r=n(4239),o=n(7005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},6719:function(e,t,n){var r=n(8749),o=n(1717),i=n(1167),s=i&&i.isTypedArray,l=s?o(s):r;e.exports=l},2353:function(e){e.exports=function(e){return void 0===e}},3674:function(e,t,n){var r=n(4636),o=n(280),i=n(8612);e.exports=function(e){return i(e)?r(e):o(e)}},1704:function(e,t,n){var r=n(4636),o=n(313),i=n(8612);e.exports=function(e){return i(e)?r(e,!0):o(e)}},928:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5161:function(e,t,n){var r=n(9932),o=n(7206),i=n(9199),s=n(1469);e.exports=function(e,t){return(s(e)?r:i)(e,o(t,3))}},8306:function(e,t,n){var r=n(3369);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},7557:function(e,t,n){var r=n(9932),o=n(5990),i=n(7406),s=n(1811),l=n(8363),a=n(696),u=n(9021),d=n(6904),c=u((function(e,t){var n={};if(null==e)return n;var u=!1;t=r(t,(function(t){return t=s(t,e),u||(u=t.length>1),t})),l(e,d(e),n),u&&(n=o(n,7,a));for(var c=t.length;c--;)i(n,t[c]);return n}));e.exports=c},5472:function(e,t,n){var r=n(2689),o=n(1469);e.exports=function(e,t,n,i){return null==e?[]:(o(t)||(t=null==t?[]:[t]),o(n=i?void 0:n)||(n=null==n?[]:[n]),r(e,t,n))}},8718:function(e,t,n){var r=n(5970),o=n(9021)((function(e,t){return null==e?{}:r(e,t)}));e.exports=o},9601:function(e,t,n){var r=n(371),o=n(9152),i=n(5403),s=n(327);e.exports=function(e){return i(e)?r(s(e)):o(e)}},9704:function(e,t,n){var r=n(2908),o=n(7206),i=n(5076),s=n(1469),l=n(6612);e.exports=function(e,t,n){var a=s(e)?r:i;return n&&l(e,t,n)&&(t=void 0),a(e,o(t,3))}},9734:function(e,t,n){var r=n(1078),o=n(2689),i=n(5976),s=n(6612),l=i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&s(e,t[0],t[1])?t=[]:n>2&&s(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])}));e.exports=l},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},9572:function(e,t,n){var r=n(4259),o=n(554);e.exports=function(e,t,n){return e&&e.length?(t=n||void 0===t?1:o(t),r(e,0,t<0?0:t)):[]}},8601:function(e,t,n){var r=n(4841),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},554:function(e,t,n){var r=n(8601);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},4841:function(e,t,n){var r=n(7561),o=n(3218),i=n(3448),s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,a=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||a.test(e)?u(e.slice(2),n?2:8):s.test(e)?NaN:+e}},3220:function(e,t,n){var r=n(3866)(n(3674));e.exports=r},84:function(e,t,n){var r=n(9932),o=n(278),i=n(1469),s=n(3448),l=n(5514),a=n(327),u=n(9833);e.exports=function(e){return i(e)?r(e,a):s(e)?[e]:o(l(u(e)))}},9833:function(e,t,n){var r=n(531);e.exports=function(e){return null==e?"":r(e)}},3955:function(e,t,n){var r=n(9833),o=0;e.exports=function(e){var t=++o;return r(e)+t}},2628:function(e,t,n){var r=n(7415),o=n(3674);e.exports=function(e){return null==e?[]:r(e,o(e))}},2569:function(e,t,n){var r=n(731),o=n(5976),i=n(9246),s=o((function(e,t){return i(e)?r(e,t):[]}));e.exports=s},7287:function(e,t,n){var r=n(4865),o=n(1757);e.exports=function(e,t){return o(e||[],t||[],r)}},7418:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var s,l,a=o(e),u=1;u1)for(var n=1;n1?t-1:0),r=1;r2?n-2:0),i=2;i1&&void 0!==arguments[1]&&arguments[1],n=this.props,r=n.tolerance,o=n.onSelection,i=n.onEndSelection,s=[],l=(0,d.findDOMNode)(this.refs.selectbox);l&&(this._registry.forEach((function(e){e.domNode&&(0,g.default)(l,e.domNode,r)&&!s.includes(e.key)&&s.push(e.key)})),t?"function"==typeof i&&i(s,e):"function"==typeof o&&o(s,e))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.enabled,r=e.fixedPosition,o=e.className,i=e.selectingClassName,s=this.state,l=s.isBoxSelecting,a=s.boxLeft,d=s.boxTop,c=s.boxWidth,f=s.boxHeight,h=this.props.component;if(!n)return u.default.createElement(h,{className:o},t);var m={left:a,top:d,width:c,height:f,zIndex:9e3,position:r?"fixed":"absolute",cursor:"default"},g={backgroundColor:"transparent",border:"1px dashed #999",width:"100%",height:"100%",float:"left"},y={position:"relative",overflow:"visible"};return u.default.createElement(h,{className:(0,p.default)(o,l?i:null),style:y},l?u.default.createElement("div",{style:m,ref:"selectbox"},u.default.createElement("span",{style:g})):null,t)}}]),t}(a.Component);v.propTypes={children:c.default.node,onBeginSelection:c.default.func,onEndSelection:c.default.func,onSelection:c.default.func,component:c.default.node,tolerance:c.default.number,fixedPosition:c.default.bool,preventDefault:c.default.bool,onNonItemClick:c.default.func,enabled:c.default.bool,className:c.default.string,selectingClassName:c.default.string},v.defaultProps={component:"div",tolerance:0,fixedPosition:!1,preventDefault:!0,enabled:!0},v.childContextTypes={selectable:c.default.object},t.default=v},function(e,t,n){"use strict";(function(t){var r="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},o=n(1),i=n(2),s=n(8),l=n(15),a=n(3),u=n(16);e.exports=function(e,n){function d(e){var t=e&&(A&&e[A]||e[I]);if("function"==typeof t)return t}function c(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e){this.message=e,this.stack=""}function f(e){function r(r,u,d,c,f,h,m){if(c=c||D,h=h||d,m!==a)if(n)i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var g=c+":"+d;!o[g]&&l<3&&(s(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",h,c),o[g]=!0,l++)}return null==u[d]?r?new p(null===u[d]?"The "+f+" `"+h+"` is marked as required in `"+c+"`, but its value is `null`.":"The "+f+" `"+h+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(u,d,c,f,h)}if("production"!==t.env.NODE_ENV)var o={},l=0;var u=r.bind(null,!1);return u.isRequired=r.bind(null,!0),u}function h(e){function t(t,n,r,o,i,s){var l=t[n];return w(l)!==e?new p("Invalid "+o+" `"+i+"` of type `"+x(l)+"` supplied to `"+r+"`, expected `"+e+"`."):null}return f(t)}function m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new p("Invalid "+o+" `"+i+"` of type `"+w(s)+"` supplied to `"+r+"`, expected an array.");for(var l=0;ln+l||t+o-ar+s)};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=e instanceof HTMLElement?(0,r.default)(e):e,s=t instanceof HTMLElement?(0,r.default)(t):t;return o(i.top,i.left,s.top,s.left,i.offsetWidth,i.offsetHeight,s.offsetWidth,s.offsetHeight,n)}},function(e,t,n){"use strict";(function(t){function n(e,t,n){function r(t){var n=m,r=g;return m=g=void 0,w=t,v=e.apply(r,n)}function i(e){return w=e,b=setTimeout(d,t),x?r(e):v}function s(e){var n=t-(e-C);return F?S(n,y-(e-w)):n}function a(e){var n=e-C;return void 0===C||n>=t||n<0||F&&e-w>=y}function d(){var e=_();if(a(e))return c(e);b=setTimeout(d,s(e))}function c(e){return b=void 0,O&&m?r(e):(m=g=void 0,v)}function p(){void 0!==b&&clearTimeout(b),w=0,m=C=g=b=void 0}function f(){return void 0===b?v:c(_())}function h(){var e=_(),n=a(e);if(m=arguments,g=this,C=e,n){if(void 0===b)return i(C);if(F)return b=setTimeout(d,t),r(C)}return void 0===b&&(b=setTimeout(d,t)),v}var m,g,y,v,b,C,w=0,x=!1,F=!1,O=!0;if("function"!=typeof e)throw new TypeError(u);return t=l(t)||0,o(n)&&(x=!!n.leading,y=(F="maxWait"in n)?E(l(n.maxWait)||0,t):y,O="trailing"in n?!!n.trailing:O),h.cancel=p,h.flush=f,h}function r(e,t,r){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError(u);return o(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),n(e,t,{leading:i,maxWait:t,trailing:s})}function o(e){var t=void 0===e?"undefined":a(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==(void 0===e?"undefined":a(e))}function s(e){return"symbol"==(void 0===e?"undefined":a(e))||i(e)&&C.call(e)==c}function l(e){if("number"==typeof e)return e;if(s(e))return d;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(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)?d:+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},u="Expected a function",d=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,y="object"==(void 0===t?"undefined":a(t))&&t&&t.Object===Object&&t,v="object"==("undefined"==typeof self?"undefined":a(self))&&self&&self.Object===Object&&self,b=y||v||Function("return this")(),C=Object.prototype.toString,E=Math.max,S=Math.min,_=function(){return b.Date.now()};e.exports=r}).call(t,n(21))},function(e,t,n){"use strict";var r,o="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};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(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 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});var l=function(){function e(e,t){for(var n=0;n'),this.element.appendChild(e));let t=e.getElementsByTagName("span")[0];return t&&(null!=t.textContent?t.textContent=this.options.dictFallbackMessage:null!=t.innerText&&(t.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize(e,t,n,r){let o={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},i=e.width/e.height;null==t&&null==n?(t=o.srcWidth,n=o.srcHeight):null==t?t=n*i:null==n&&(n=t/i);let s=(t=Math.min(t,o.srcWidth))/(n=Math.min(n,o.srcHeight));if(o.srcWidth>t||o.srcHeight>n)if("crop"===r)i>s?(o.srcHeight=e.height,o.srcWidth=o.srcHeight*s):(o.srcWidth=e.width,o.srcHeight=o.srcWidth/s);else{if("contain"!==r)throw new Error(`Unknown resizeMethod '${r}'`);i>s?n=t/i:t=n*i}return o.srcX=(e.width-o.srcWidth)/2,o.srcY=(e.height-o.srcHeight)/2,o.trgWidth=t,o.trgHeight=n,o},transformFile(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:s('
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n'),drop(e){return this.element.classList.remove("dz-drag-hover")},dragstart(e){},dragend(e){return this.element.classList.remove("dz-drag-hover")},dragenter(e){return this.element.classList.add("dz-drag-hover")},dragover(e){return this.element.classList.add("dz-drag-hover")},dragleave(e){return this.element.classList.remove("dz-drag-hover")},paste(e){},reset(){return this.element.classList.remove("dz-started")},addedfile(e){if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){for(var t of(e.previewElement=u.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),e.previewElement.querySelectorAll("[data-dz-name]")))t.textContent=e.name;for(t of e.previewElement.querySelectorAll("[data-dz-size]"))t.innerHTML=this.filesize(e.size);this.options.addRemoveLinks&&(e._removeLink=u.createElement(`${this.options.dictRemoveFile}`),e.previewElement.appendChild(e._removeLink));let n=t=>(t.preventDefault(),t.stopPropagation(),e.status===u.UPLOADING?u.confirm(this.options.dictCancelUploadConfirmation,(()=>this.removeFile(e))):this.options.dictRemoveFileConfirmation?u.confirm(this.options.dictRemoveFileConfirmation,(()=>this.removeFile(e))):this.removeFile(e));for(let t of e.previewElement.querySelectorAll("[data-dz-remove]"))t.addEventListener("click",n)}},removedfile(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");for(let n of e.previewElement.querySelectorAll("[data-dz-thumbnail]"))n.alt=e.name,n.src=t;return setTimeout((()=>e.previewElement.classList.add("dz-image-preview")),1)}},error(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"string"!=typeof t&&t.error&&(t=t.error);for(let n of e.previewElement.querySelectorAll("[data-dz-errormessage]"))n.textContent=t}},errormultiple(){},processing(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple(){},uploadprogress(e,t,n){if(e.previewElement)for(let n of e.previewElement.querySelectorAll("[data-dz-uploadprogress]"))"PROGRESS"===n.nodeName?n.value=t:n.style.width=`${t}%`},totaluploadprogress(){},sending(){},sendingmultiple(){},success(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple(){},canceled(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple(){},complete(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple(){},maxfilesexceeded(){},maxfilesreached(){},queuecomplete(){},addedfiles(){}};class u extends l{static initClass(){this.prototype.Emitter=l,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}getAcceptedFiles(){return this.files.filter((e=>e.accepted)).map((e=>e))}getRejectedFiles(){return this.files.filter((e=>!e.accepted)).map((e=>e))}getFilesWithStatus(e){return this.files.filter((t=>t.status===e)).map((e=>e))}getQueuedFiles(){return this.getFilesWithStatus(u.QUEUED)}getUploadingFiles(){return this.getFilesWithStatus(u.UPLOADING)}getAddedFiles(){return this.getFilesWithStatus(u.ADDED)}getActiveFiles(){return this.files.filter((e=>e.status===u.UPLOADING||e.status===u.QUEUED)).map((e=>e))}init(){if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(u.createElement(`
`)),this.clickableElements.length){let e=()=>{this.hiddenFileInput&&this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=document.createElement("input"),this.hiddenFileInput.setAttribute("type","file"),(null===this.options.maxFiles||this.options.maxFiles>1)&&this.hiddenFileInput.setAttribute("multiple","multiple"),this.hiddenFileInput.className="dz-hidden-input",null!==this.options.acceptedFiles&&this.hiddenFileInput.setAttribute("accept",this.options.acceptedFiles),null!==this.options.capture&&this.hiddenFileInput.setAttribute("capture",this.options.capture),this.hiddenFileInput.setAttribute("tabindex","-1"),this.hiddenFileInput.style.visibility="hidden",this.hiddenFileInput.style.position="absolute",this.hiddenFileInput.style.top="0",this.hiddenFileInput.style.left="0",this.hiddenFileInput.style.height="0",this.hiddenFileInput.style.width="0",u.getElement(this.options.hiddenInputContainer,"hiddenInputContainer").appendChild(this.hiddenFileInput),this.hiddenFileInput.addEventListener("change",(()=>{let{files:t}=this.hiddenFileInput;if(t.length)for(let e of t)this.addFile(e);this.emit("addedfiles",t),e()}))};e()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(let e of this.events)this.on(e,this.options[e]);this.on("uploadprogress",(()=>this.updateTotalUploadProgress())),this.on("removedfile",(()=>this.updateTotalUploadProgress())),this.on("canceled",(e=>this.emit("complete",e))),this.on("complete",(e=>{if(0===this.getAddedFiles().length&&0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length)return setTimeout((()=>this.emit("queuecomplete")),0)}));let e=function(e){if(function(e){if(e.dataTransfer.types)for(var t=0;tthis.emit("dragstart",e),dragenter:t=>(e(t),this.emit("dragenter",t)),dragover:t=>{let n;try{n=t.dataTransfer.effectAllowed}catch(e){}return t.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",e(t),this.emit("dragover",t)},dragleave:e=>this.emit("dragleave",e),drop:t=>(e(t),this.drop(t)),dragend:e=>this.emit("dragend",e)}}],this.clickableElements.forEach((e=>this.listeners.push({element:e,events:{click:t=>((e!==this.element||t.target===this.element||u.elementInside(t.target,this.element.querySelector(".dz-message")))&&this.hiddenFileInput.click(),!0)}}))),this.enable(),this.options.init.call(this)}destroy(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,u.instances.splice(u.instances.indexOf(this),1)}updateTotalUploadProgress(){let e,t=0,n=0;if(this.getActiveFiles().length){for(let e of this.getActiveFiles())t+=e.upload.bytesSent,n+=e.upload.total;e=100*t/n}else e=100;return this.emit("totaluploadprogress",e,n,t)}_getParamName(e){return"function"==typeof this.options.paramName?this.options.paramName(e):`${this.options.paramName}${this.options.uploadMultiple?`[${e}]`:""}`}_renameFile(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}getFallbackForm(){let e,t;if(e=this.getExistingFallback())return e;let n='
';this.options.dictFallbackText&&(n+=`

${this.options.dictFallbackText}

`),n+=`
`;let r=u.createElement(n);return"FORM"!==this.element.tagName?(t=u.createElement(`
`),t.appendChild(r)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:r}getExistingFallback(){let e=function(e){for(let t of e)if(/(^| )fallback($| )/.test(t.className))return t};for(let n of["div","form"]){var t;if(t=e(this.element.getElementsByTagName(n)))return t}}setupEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let r=e.events[n];t.push(e.element.addEventListener(n,r,!1))}return t})()))}removeEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let r=e.events[n];t.push(e.element.removeEventListener(n,r,!1))}return t})()))}disable(){return this.clickableElements.forEach((e=>e.classList.remove("dz-clickable"))),this.removeEventListeners(),this.disabled=!0,this.files.map((e=>this.cancelUpload(e)))}enable(){return delete this.disabled,this.clickableElements.forEach((e=>e.classList.add("dz-clickable"))),this.setupEventListeners()}filesize(e){let t=0,n="b";if(e>0){let r=["tb","gb","mb","kb","b"];for(let o=0;o=Math.pow(this.options.filesizeBase,4-o)/10){t=e/Math.pow(this.options.filesizeBase,4-o),n=i;break}}t=Math.round(10*t)/10}return`${t} ${this.options.dictFileSizeUnits[n]}`}_updateMaxFilesReachedClass(){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")}drop(e){if(!e.dataTransfer)return;this.emit("drop",e);let t=[];for(let n=0;ne.items,null!=t?n(t):void 0))return;var t,n;this.emit("paste",e);let{items:r}=e.clipboardData;return r.length?this._addFilesFromItems(r):void 0}handleFiles(e){for(let t of e)this.addFile(t)}_addFilesFromItems(e){return(()=>{let t=[];for(let r of e){var n;null!=r.webkitGetAsEntry&&(n=r.webkitGetAsEntry())?n.isFile?t.push(this.addFile(r.getAsFile())):n.isDirectory?t.push(this._addFilesFromDirectory(n,n.name)):t.push(void 0):null!=r.getAsFile&&(null==r.kind||"file"===r.kind)?t.push(this.addFile(r.getAsFile())):t.push(void 0)}return t})()}_addFilesFromDirectory(e,t){let n=e.createReader(),r=e=>{return t=console,n="log",r=t=>t.log(e),null!=t&&"function"==typeof t[n]?r(t,n):void 0;var t,n,r};var o=()=>n.readEntries((e=>{if(e.length>0){for(let n of e)n.isFile?n.file((e=>{if(!this.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=`${t}/${e.name}`,this.addFile(e)})):n.isDirectory&&this._addFilesFromDirectory(n,`${t}/${n.name}`);o()}return null}),r);return o()}accept(e,t){this.options.maxFilesize&&e.size>1048576*this.options.maxFilesize?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):u.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}addFile(e){e.upload={uuid:u.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=u.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,(t=>{t?(e.accepted=!1,this._errorProcessing([e],t)):(e.accepted=!0,this.options.autoQueue&&this.enqueueFile(e)),this._updateMaxFilesReachedClass()}))}enqueueFiles(e){for(let t of e)this.enqueueFile(t);return null}enqueueFile(e){if(e.status!==u.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=u.QUEUED,this.options.autoProcessQueue)return setTimeout((()=>this.processQueue()),0)}_enqueueThumbnail(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1048576*this.options.maxThumbnailFilesize)return this._thumbnailQueue.push(e),setTimeout((()=>this._processThumbnailQueue()),0)}_processThumbnailQueue(){if(this._processingThumbnail||0===this._thumbnailQueue.length)return;this._processingThumbnail=!0;let e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,(t=>(this.emit("thumbnail",e,t),this._processingThumbnail=!1,this._processThumbnailQueue())))}removeFile(e){if(e.status===u.UPLOADING&&this.cancelUpload(e),this.files=d(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}removeAllFiles(e){null==e&&(e=!1);for(let t of this.files.slice())(t.status!==u.UPLOADING||e)&&this.removeFile(t);return null}resizeImage(e,t,n,r,o){return this.createThumbnail(e,t,n,r,!0,((t,n)=>{if(null==n)return o(e);{let{resizeMimeType:t}=this.options;null==t&&(t=e.type);let r=n.toDataURL(t,this.options.resizeQuality);return"image/jpeg"!==t&&"image/jpg"!==t||(r=f.restore(e.dataURL,r)),o(u.dataURItoBlob(r))}}))}createThumbnail(e,t,n,r,o,i){let s=new FileReader;s.onload=()=>{e.dataURL=s.result,"image/svg+xml"!==e.type?this.createThumbnailFromUrl(e,t,n,r,o,i):null!=i&&i(s.result)},s.readAsDataURL(e)}displayExistingFile(e,t,n,r,o=!0){if(this.emit("addedfile",e),this.emit("complete",e),o){let o=t=>{this.emit("thumbnail",e,t),n&&n()};e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,o,r)}else this.emit("thumbnail",e,t),n&&n()}createThumbnailFromUrl(e,t,n,r,o,i,s){let l=document.createElement("img");return s&&(l.crossOrigin=s),o="from-image"!=getComputedStyle(document.body).imageOrientation&&o,l.onload=()=>{let s=e=>e(1);return"undefined"!=typeof EXIF&&null!==EXIF&&o&&(s=e=>EXIF.getData(l,(function(){return e(EXIF.getTag(this,"Orientation"))}))),s((o=>{e.width=l.width,e.height=l.height;let s=this.options.resize.call(this,e,t,n,r),a=document.createElement("canvas"),u=a.getContext("2d");switch(a.width=s.trgWidth,a.height=s.trgHeight,o>4&&(a.width=s.trgHeight,a.height=s.trgWidth),o){case 2:u.translate(a.width,0),u.scale(-1,1);break;case 3:u.translate(a.width,a.height),u.rotate(Math.PI);break;case 4:u.translate(0,a.height),u.scale(1,-1);break;case 5:u.rotate(.5*Math.PI),u.scale(1,-1);break;case 6:u.rotate(.5*Math.PI),u.translate(0,-a.width);break;case 7:u.rotate(.5*Math.PI),u.translate(a.height,-a.width),u.scale(-1,1);break;case 8:u.rotate(-.5*Math.PI),u.translate(-a.height,0)}p(u,l,null!=s.srcX?s.srcX:0,null!=s.srcY?s.srcY:0,s.srcWidth,s.srcHeight,null!=s.trgX?s.trgX:0,null!=s.trgY?s.trgY:0,s.trgWidth,s.trgHeight);let d=a.toDataURL("image/png");if(null!=i)return i(d,a)}))},null!=i&&(l.onerror=i),l.src=e.dataURL}processQueue(){let{parallelUploads:e}=this.options,t=this.getUploadingFiles().length,n=t;if(t>=e)return;let r=this.getQueuedFiles();if(r.length>0){if(this.options.uploadMultiple)return this.processFiles(r.slice(0,e-t));for(;nt.xhr===e)).map((e=>e))}cancelUpload(e){if(e.status===u.UPLOADING){let t=this._getFilesWithXhr(e.xhr);for(let e of t)e.status=u.CANCELED;void 0!==e.xhr&&e.xhr.abort();for(let e of t)this.emit("canceled",e);this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else e.status!==u.ADDED&&e.status!==u.QUEUED||(e.status=u.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}resolveOption(e,...t){return"function"==typeof e?e.apply(this,t):e}uploadFile(e){return this.uploadFiles([e])}uploadFiles(e){this._transformFiles(e,(t=>{if(this.options.chunking){let n=t[0];e[0].upload.chunked=this.options.chunking&&(this.options.forceChunking||n.size>this.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(n.size/this.options.chunkSize)}if(e[0].upload.chunked){let n=e[0],r=t[0],o=0;n.upload.chunks=[];let i=()=>{let t=0;for(;void 0!==n.upload.chunks[t];)t++;if(t>=n.upload.totalChunkCount)return;o++;let i=t*this.options.chunkSize,s=Math.min(i+this.options.chunkSize,r.size),l={name:this._getParamName(0),data:r.webkitSlice?r.webkitSlice(i,s):r.slice(i,s),filename:n.upload.filename,chunkIndex:t};n.upload.chunks[t]={file:n,index:t,dataBlock:l,status:u.UPLOADING,progress:0,retries:0},this._uploadData(e,[l])};if(n.upload.finishedChunkUpload=(t,r)=>{let o=!0;t.status=u.SUCCESS,t.dataBlock=null,t.response=t.xhr.responseText,t.responseHeaders=t.xhr.getAllResponseHeaders(),t.xhr=null;for(let e=0;e{this._finished(e,r,null)}))},this.options.parallelChunkUploads)for(let e=0;e{this._finishedUploading(e,n,t)},n.ontimeout=()=>{this._handleUploadError(e,n,`Request timedout after ${this.options.timeout/1e3} seconds`)},n.onerror=()=>{this._handleUploadError(e,n)},(null!=n.upload?n.upload:n).onprogress=t=>this._updateFilesUploadProgress(e,n,t);let s=this.options.defaultHeaders?{Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}:{};this.options.binaryBody&&(s["Content-Type"]=e[0].type),this.options.headers&&r(s,this.options.headers);for(let e in s){let t=s[e];t&&n.setRequestHeader(e,t)}if(this.options.binaryBody){for(let t of e)this.emit("sending",t,n);this.options.uploadMultiple&&this.emit("sendingmultiple",e,n),this.submitRequest(n,null,e)}else{let r=new FormData;if(this.options.params){let t=this.options.params;"function"==typeof t&&(t=t.call(this,e,n,e[0].upload.chunked?this._getChunk(e[0],n):null));for(let e in t){let n=t[e];if(Array.isArray(n))for(let t=0;t{n[o]=i,++r===e.length&&t(n)}))}_addFormElementData(e){if("FORM"===this.element.tagName)for(let t of this.element.querySelectorAll("input, textarea, select, button")){let n=t.getAttribute("name"),r=t.getAttribute("type");if(r&&(r=r.toLowerCase()),null!=n)if("SELECT"===t.tagName&&t.hasAttribute("multiple"))for(let r of t.options)r.selected&&e.append(n,r.value);else(!r||"checkbox"!==r&&"radio"!==r||t.checked)&&e.append(n,t.value)}}_updateFilesUploadProgress(e,t,n){if(e[0].upload.chunked){let r=e[0],o=this._getChunk(r,t);n?(o.progress=100*n.loaded/n.total,o.total=n.total,o.bytesSent=n.loaded):(o.progress=100,o.bytesSent=o.total),r.upload.progress=0,r.upload.total=0,r.upload.bytesSent=0;for(let e=0;ethis.options.renameFilename.call(this,e.name,e)),"string"==typeof this.options.method&&(this.options.method=this.options.method.toUpperCase()),(n=this.getExistingFallback())&&n.parentNode&&n.parentNode.removeChild(n),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=u.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=u.getElements(this.options.clickable,"clickable")),this.init()}}u.initClass(),u.options={},u.optionsForElement=function(e){return e.getAttribute("id")?u.options[c(e.getAttribute("id"))]:void 0},u.instances=[],u.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},u.discover=function(){let e;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];let t=t=>(()=>{let n=[];for(let r of t)/(^| )dropzone($| )/.test(r.className)?n.push(e.push(r)):n.push(void 0);return n})();t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return(()=>{let t=[];for(let n of e)!1!==u.optionsForElement(n)?t.push(new u(n)):t.push(void 0);return t})()},u.blockedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],u.isBrowserSupported=function(){let e=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){void 0!==u.blacklistedBrowsers&&(u.blockedBrowsers=u.blacklistedBrowsers);for(let t of u.blockedBrowsers)if(t.test(navigator.userAgent)){e=!1;continue}}else e=!1;else e=!1;return e},u.dataURItoBlob=function(e){let t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),o=new Uint8Array(r);for(let e=0,n=t.length,r=0<=n;r?e<=n:e>=n;r?e++:e--)o[e]=t.charCodeAt(e);return new Blob([r],{type:n})};const d=(e,t)=>e.filter((e=>e!==t)).map((e=>e)),c=e=>e.replace(/[\-_](\w)/g,(e=>e.charAt(1).toUpperCase()));u.createElement=function(e){let t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},u.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},u.getElement=function(e,t){let n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector or a plain HTML element.`);return n},u.getElements=function(e,t){let n,r;if(e instanceof Array){r=[];try{for(n of e)r.push(this.getElement(n,t))}catch(e){r=null}}else if("string"==typeof e)for(n of(r=[],document.querySelectorAll(e)))r.push(n);else null!=e.nodeType&&(r=[e]);if(null==r||!r.length)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);return r},u.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},u.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");let n=e.type,r=n.replace(/\/.*$/,"");for(let o of t)if(o=o.trim(),"."===o.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(o.toLowerCase(),e.name.length-o.length))return!0}else if(/\/\*$/.test(o)){if(r===o.replace(/\/.*$/,""))return!0}else if(n===o)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each((function(){return new u(this,e)}))}),u.ADDED="added",u.QUEUED="queued",u.ACCEPTED=u.QUEUED,u.UPLOADING="uploading",u.PROCESSING=u.UPLOADING,u.CANCELED="canceled",u.ERROR="error",u.SUCCESS="success";var p=function(e,t,n,r,o,i,s,l,a,u){let d=function(e){e.naturalWidth;let t=e.naturalHeight,n=document.createElement("canvas");n.width=1,n.height=t;let r=n.getContext("2d");r.drawImage(e,0,0);let{data:o}=r.getImageData(1,0,1,t),i=0,s=t,l=t;for(;l>i;)0===o[4*(l-1)+3]?s=l:i=l,l=s+i>>1;let a=l/t;return 0===a?1:a}(t);return e.drawImage(t,n,r,o,i,s,l,a,u/d)};class f{static initClass(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}static encode64(e){let t,n,r,o,i,s="",l="",a="",u=0;for(;t=e[u++],n=e[u++],l=e[u++],r=t>>2,o=(3&t)<<4|n>>4,i=(15&n)<<2|l>>6,a=63&l,isNaN(n)?i=a=64:isNaN(l)&&(a=64),s=s+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(i)+this.KEY_STR.charAt(a),t=n=l="",r=o=i=a="",ue.length)break}return n}static decode64(e){let t,n,r,o,i,s="",l="",a=0,u=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");r=this.KEY_STR.indexOf(e.charAt(a++)),o=this.KEY_STR.indexOf(e.charAt(a++)),i=this.KEY_STR.indexOf(e.charAt(a++)),l=this.KEY_STR.indexOf(e.charAt(a++)),t=r<<2|o>>4,n=(15&o)<<4|i>>2,s=(3&i)<<6|l,u.push(t),64!==i&&u.push(n),64!==l&&u.push(s),t=n=s="",r=o=i=l="",ae.execCommand(f),priority:80},editorIdentifier).addCommandWithUrlTest(f,/^\[file_link/);const h={init(e){e.addCommand(f,(()=>{(0,i.default)(`#${e.id}`).entwine("ss").openLinkFileDialog()}))}},m="insert-link__dialog-wrapper--file",g=(0,a.loadComponent)(l.default);i.default.entwine("ss",(e=>{e("textarea.htmleditor").entwine({openLinkFileDialog(){let t=e(`#${m}`);t.length||(t=e(`
`),e("body").append(t)),t.addClass("insert-link__dialog-wrapper"),t.setElement(this),t.open()}}),e(`.js-injector-boot #${m}`).entwine({ReactRoot:null,renderModal(e){var t=this;const{dispatch:n}=a.default.reducer.store;n(u.initFormStack("insert-link","admin"));const i=this.getOriginalAttributes(),s=this.getElement().getEditor(),l=s.getInstance().selection,d=s.getSelection(),c=this.getFolderId(),p="A"!==l.getNode().tagName&&""===d.trim();let f=this.getReactRoot();f||(f=(0,o.createRoot)(this[0]),this.setReactRoot(f)),f.render(r.default.createElement(g,{isOpen:e,type:"insert-link",folderId:c,onInsert:function(){return t.handleInsert(...arguments)},onClosed:()=>{n(u.reset()),this.close()},title:!1,bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--internal",fileAttributes:i,requireLinkText:p}))},buildAttributes(e){return{href:`${s.default.serialise({name:"file_link",properties:{id:e.ID}},!0)}${e.Anchor&&e.Anchor.length?`#${e.Anchor}`:""}`,target:e.TargetBlank?"_blank":"",title:e.Description}},getFolderId(){const e=this.getElement();if(!e)return null;const t=Number(e.data("config").upload_folder_id);return isNaN(t)?null:t},getOriginalAttributes(){const t=this.getElement().getEditor(),n=e(t.getSelectedNode()),r=(n.attr("href")||"").split("#");if(!r[0])return{};const o=s.default.match("file_link",!1,r[0]);return o?{ID:o.properties.id?parseInt(o.properties.id,10):0,Anchor:r[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}:{}}})})),tinymce.PluginManager.add(f,(e=>h.init(e)))}()}(); \ No newline at end of file +`;t.mutation=l;const a={props:e=>{let{mutate:t,ownProps:{actions:n={}}}=e;return{actions:Object.assign({},n,{files:Object.assign({},n.files,{moveFiles:(e,n)=>t({variables:{folderId:e,fileIds:n},update:()=>{window.ss.apolloClient.resetStore()}})})})}}};t.config=a;var u=(0,o.graphql)(l,a);t.default=u},6307:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mutation=t.default=t.config=void 0;var r,o=n(3732),i=(r=n(6821))&&r.__esModule?r:{default:r};const{mutation:s,config:l}=(0,i.default)("publishFiles");t.config=l,t.mutation=s;var a=(0,o.graphql)(s,l);t.default=a},168:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mutation=t.default=t.config=void 0;var r,o=n(3732),i=(r=n(6821))&&r.__esModule?r:{default:r};const{mutation:s,config:l}=(0,i.default)("unpublishFiles");t.config=l,t.mutation=s;var a=(0,o.graphql)(s,l);t.default=a},8750:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=["SET_LAST_SELECTED","SET_SELECTED_FILES","DESELECT_FILES","SELECT_FILES","LOAD_FILE_REQUEST","LOAD_FILE_SUCCESS","HIGHLIGHT_FILES","UPDATE_BATCH_ACTIONS","SET_NOTICE_MESSAGE","SET_ERROR_MESSAGE","SET_ENABLE_DROPZONE","SET_FILE_BADGE","CLEAR_FILE_BADGE","ACTIVATE_MODAL","DEACTIVATE_MODAL","CONCATENATE_SELECT","SET_LOADING"].reduce(((e,t)=>Object.assign(e,{[t]:`GALLERY.${t}`})),{});t.default=n},3669:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activateModal=function(e){return t=>{t({type:o.default.ACTIVATE_MODAL,payload:e})}},t.clearFileBadge=i,t.deactivateModal=function(){return e=>{e({type:o.default.DEACTIVATE_MODAL})}},t.deselectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:o.default.DESELECT_FILES,payload:{ids:e}})},t.loadFile=function(e,t){return n=>{n({type:o.default.LOAD_FILE_SUCCESS,payload:{id:e,file:t}})}},t.selectFiles=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>t({type:o.default.SELECT_FILES,payload:{ids:e}})},t.setConcatenateSelect=function(e){return t=>t({type:o.default.CONCATENATE_SELECT,payload:!!e})},t.setEnableDropzone=function(e){return t=>t({type:o.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})},t.setErrorMessage=function(e){return t=>t({type:o.default.SET_ERROR_MESSAGE,payload:{message:e}})},t.setFileBadge=function(e,t,n,r){return(s,l)=>{const{assetAdmin:a}=l(),u=a.gallery.badges.find((t=>t.id===e));u&&u.timer&&clearTimeout(u.timer);const d=r>0?setTimeout((()=>i(e)(s)),r):null;s({type:o.default.SET_FILE_BADGE,payload:{id:e,message:t,status:n,timer:d}})}},t.setLastSelected=function(e){return t=>{t({type:o.default.SET_LAST_SELECTED,payload:{id:e}})}},t.setLoading=function(e){return t=>{t({type:o.default.SET_LOADING,payload:!!e})}},t.setNoticeMessage=function(e){return t=>t({type:o.default.SET_NOTICE_MESSAGE,payload:{message:e}})},t.setSelectedFiles=function(e){return t=>{t({type:o.default.SET_SELECTED_FILES,payload:{files:e}})}};var r,o=(r=n(8750))&&r.__esModule?r:{default:r};function i(e){return t=>{t({type:o.default.CLEAR_FILE_BADGE,payload:{id:e}})}}},9905:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultImageFactory=t.default=void 0;var r=i(n(2175)),o=i(n(270));function i(e){return e&&e.__esModule?e:{default:e}}const s={minRetry:0,maxRetry:0,expiry:0,onStatusChange:()=>null,onRetry:()=>null,onReset:()=>null,onTimeout:()=>null},l=(e,t,n)=>{const r=new Image;r.onload=t,r.onerror=n,r.src=e};t.defaultImageFactory=l;var a=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;this.options={...s,...e},this.factory=t}loadImage(e){return this.options.minRetry&&o.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}loadImageLoop(e,t){return this.options.onStatusChange(e,r.default.LOADING),new Promise(((t,n)=>this.factory(e,t,n))).then((()=>this.handleSuccess(e))).catch((()=>this.handleError(e,t)))}handleReset(e,t){this.options.onReset(e),t()}handleTimeout(e,t){const n=setTimeout(e,t);return this.options.onTimeout(n,t),n}handleSuccess(e){o.default.unlock(e),this.options.onStatusChange(e,r.default.SUCCESS)}handleFailure(e){return o.default.unlock(e),this.options.onStatusChange(e,r.default.FAILED),this.options.expiry?new Promise((t=>{this.handleTimeout((()=>this.handleReset(e,t)),1e3*this.options.expiry)})):null}handleError(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,r.default.WAITING),this.handleRetry(e,t))}handleRetry(e,t){const n=new Promise((n=>{this.handleTimeout((()=>n(this.loadImageLoop(e,2*t))),1e3*t)}));return this.options.onRetry(e,t,n),n}setOnRetry(e){this.options.onRetry=e}setOnReset(e){this.options.onReset=e}setOnStatusChange(e){this.options.onStatusChange=e}setOnTimeout(e){this.options.onTimeout=e}};t.default=a},9505:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={SET_STATUS:"IMAGE_LOAD_SET_STATUS",RESET:"IMAGE_LOAD_RESET"}},3521:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadImage=function(e,t){return(n,i)=>{if(!e)return null;if(i().assetAdmin.imageLoad.files.find((t=>t.url===e)))return null;const s={...t,onStatusChange:(e,t)=>n({type:r.default.SET_STATUS,payload:{status:t,url:e}}),onReset:e=>n({type:r.default.RESET,payload:{url:e}})};return new o.default(s).loadImage(e)}};var r=i(n(9505)),o=i(n(9905));function i(e){return e&&e.__esModule?e:{default:e}}},270:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;class n{constructor(){this.urls=[]}lock(e){return!(this.urls.indexOf(e)>=0)&&(this.urls=[...this.urls,e],!0)}unlock(e){this.urls=this.urls.filter((t=>t!==e))}}t.Component=n,window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new n;var r=window.ss.imagelocker;t.default=r},2175:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DISABLED:"DISABLED",NONE:"NONE",SUCCESS:"SUCCESS",LOADING:"LOADING",WAITING:"WAITING",FAILED:"FAILED"}},3576:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={DEFINE_IMAGE_SIZE_PRESETS:"DEFINE_IMAGE_SIZE_PRESETS",INIT_FORM_SCHEMA_STACK:"INIT_FORM_SCHEMA_STACK",POP_FORM_SCHEMA:"POP_FORM_SCHEMA",PUSH_FORM_SCHEMA:"PUSH_FORM_SCHEMA",RESET:"RESET",RESET_FORM_STACK:"RESET_FORM_STACK"}},4478:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defineImageSizePresets=function(e){return{type:r.default.DEFINE_IMAGE_SIZE_PRESETS,payload:{imageSizePresets:e}}},t.initFormStack=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:r.default.INIT_FORM_SCHEMA_STACK,payload:{formSchema:{type:e,nextType:t}}}},t.popFormStackEntry=function(){return{type:r.default.POP_FORM_SCHEMA}},t.pushFormStackEntry=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:r.default.PUSH_FORM_SCHEMA,payload:{formSchema:{type:e,nextType:t}}}},t.reset=function(){return{type:r.default.RESET}},t.resetFormStack=function(){return{type:r.default.RESET_FORM_STACK}},t.stashFormValues=function(e,t){return(n,r)=>{const l=r(),a=(0,o.default)(l.form.formState,`${e}.values`),u=(0,o.default)(l.form.formSchemas,`${t}.schema.fields`);if(a){const e=Object.keys(a).filter((e=>null!==a[e]&&(0,s.default)(e,u))).map((e=>({name:e,value:a[e]})));n((0,i.setSchemaStateOverrides)(t,{fields:e}))}}};var r=l(n(3576)),o=l(n(9298)),i=n(3573),s=l(n(4916));function l(e){return e&&e.__esModule?e:{default:e}}},4916:function(e,t){"use strict";function n(e,t){let r;for(r=0;rt({type:o.default.ADD_QUEUED_FILE,payload:{file:e}})},t.failUpload=function(e,t,n){return r=>{let i=t.message;return t.errors&&t.errors.length&&(i=t.errors[0]),"string"==typeof t&&(i={value:n||t,type:"error"}),r({type:o.default.FAIL_UPLOAD,payload:{queuedId:e,message:i}})}},t.purgeUploadQueue=function(){return e=>e({type:o.default.PURGE_UPLOAD_QUEUE,payload:null})},t.removeQueuedFile=function(e){return t=>t({type:o.default.REMOVE_QUEUED_FILE,payload:{queuedId:e}})},t.succeedUpload=function(e,t){return n=>n({type:o.default.SUCCEED_UPLOAD,payload:{queuedId:e,json:t}})},t.updateQueuedFile=function(e,t){return n=>n({type:o.default.UPDATE_QUEUED_FILE,payload:{queuedId:e,updates:t}})};var r,o=(r=n(4973))&&r.__esModule?r:{default:r}},6511:function(e,t,n){"use strict";var r=n(7418),o={};function i(e,t,n,r,o,i,s,l){if(!e){var a;if(void 0===t)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,s,l],d=0;(a=new Error(t.replace(/%s/g,(function(){return u[d++]})))).name="Invariant Violation"}throw a.framesToPop=1,a}}var s="mixins";e.exports=function(e,t,n){var l=[],a={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},u={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},d={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n0}},{key:"getMetadataColumnProperty",value:function(e,t,n){var r=this.getColumnMetadataByName(e);return null==r?n:r.hasOwnProperty(t)?r[t]:n}},{key:"orderColumns",value:function(e){var t=this;return a(e,(function(e){var n=l(t.columnMetadata,{columnName:e});return null==n||isNaN(n.order)?100:n.order}))}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=u(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=d},1172:function(e,t,n){"use strict";var r=n(7363),o=n(2555)({getDefaultProps:function(){return{placeholderText:""}},render:function(){return"function"!=typeof this.props.customFilterComponent?(console.log("Couldn't find valid template."),r.createElement("div",null)):r.createElement(this.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=o},2039:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t0&&(e=r.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=r.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,o=null,s=null;if(!0===this.props.useGriddleStyles){var l={float:"left",minHeight:"1px",marginTop:"5px"};s=i({textAlign:"right",width:"34%"},l),o=i({textAlign:"center",width:"33%"},l),n=i({width:"33%"},l)}for(var a=[],u=1;u<=this.props.maxPage;u++)a.push(r.createElement("option",{value:u,key:u},u));return r.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},r.createElement("div",{className:this.props.previousClassName,style:n},e),r.createElement("div",{className:"griddle-page",style:o},r.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},a)," / ",this.props.maxPage),r.createElement("div",{className:this.props.nextClassName,style:s},t))}});e.exports=s},344:function(e,t,n){"use strict";var r=n(7363),o=n(2555),i=(n(3059),n(7024)),s=n(3560),l=n(7287),a=n(8583),u=n(1747),d=n(3220),c=n(2569),p=o({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,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount:null}},componentWillMount:function(){null!==this.props.onRowWillMount&&s(this.props.onRowWillMount)&&this.props.onRowWillMount(this)},componentWillUnmount:function(){null!==this.props.onRowWillUnmount&&s(this.props.onRowWillUnmount)&&this.props.onRowWillUnmount(this)},handleClick:function(e){null!==this.props.onRowClick&&s(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleMouseEnter:function(e){null!==this.props.onRowMouseEnter&&s(this.props.onRowMouseEnter)&&this.props.onRowMouseEnter(this,e)},handleMouseLeave:function(e){null!==this.props.onRowMouseLeave&&s(this.props.onRowMouseLeave)&&this.props.onRowMouseLeave(this,e)},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 o=this.props.columnSettings.getColumns(),p=l(o,[]),f=a({},this.props.data);u(f,p);var h,m,g=d(i.pick(f,c(o,"children"))).map((function(t,o){var i=null,s=e.props.columnSettings.getColumnMetadataByName(t[0]),l=0===o&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?r.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===o&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?r.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===o&&e.props.isChildRow&&e.props.useGriddleStyles&&(n=a(n,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&null!=s)if(void 0!==s.customComponent&&null!==s.customComponent){var u=r.createElement(s.customComponent,{data:t[1],rowData:f,metadata:s});i=r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,className:s.cssClassName,key:o,style:n},u)}else i=r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,className:s.cssClassName,key:o,style:n},l,e.formatData(t[1]));return i||r.createElement("td",{onClick:e.handleClick,onMouseEnter:e.handleMouseEnter,onMouseLeave:e.handleMouseLeave,key:o,style:n},l,t[1])}));if(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),g&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection){this.props.multipleSelectionSettings.getSelectedRowIds();g.unshift(r.createElement("td",{key:"selection",style:n,className:"griddle-select griddle-select-cell",onClick:m},r.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),r.createElement("tr",{onClick:h,className:y},g)}});e.exports=p},3302:function(e,t,n){"use strict";var r=n(7363),o=n(2555),i=(n(3059),n(8718)),s=o({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,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount: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 r.createElement("tbody",null);var t=[],n=this.props.columnSettings.getColumns();t.push(r.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?i(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,onRowMouseEnter:e.props.onRowMouseEnter,onRowMouseLeave:e.props.onRowMouseLeave,multipleSelectionSettings:this.props.multipleSelectionSettings,onRowWillMount:e.props.onRowWillMount,onRowWillUnmount:e.props.onRowWillUnmount}));var o=null;return e.state.showChildren&&(o=e.props.hasChildren&&this.props.data.children.map((function(t,n){var o=e.props.rowSettings.getRowKey(t,n);if(void 0!==t.children){var i=e.constructor.Griddle;return r.createElement("tr",{key:o,style:{paddingLeft:5}},r.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},r.createElement(i,{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 r.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:o})}))),!1===e.props.hasChildren?t[0]:r.createElement("tbody",null,e.state.showChildren?t.concat(o):t)}});e.exports=s},7033:function(e,t,n){"use strict";var r=n(7363),o=n(2555),i=n(4721),s=n(2569),l=n(3311),a=o({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===i(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 o=i(e.props.selectedColumns,t),s=l(e.props.columnMetadata,{columnName:t}),a=t;return void 0!==s&&void 0!==s.displayName&&null!=s.displayName&&(a=s.displayName),void 0!==s&&null!=s&&s.locked?r.createElement("div",{className:"column checkbox"},r.createElement("label",null,r.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:o,"data-name":t}),a)):void 0!==s&&null!=s&&void 0!==s.visible&&!1===s.visible?null:r.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},r.createElement("label",null,r.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:o,"data-name":t}),a))})));var n=e.props.enableToggleCustom?r.createElement("div",{className:"form-group"},r.createElement("label",{htmlFor:"maxRows"},r.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",o=this.props.showSetPageSize?r.createElement("div",null,r.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",r.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},r.createElement("option",{value:"5"},"5"),r.createElement("option",{value:"10"},"10"),r.createElement("option",{value:"25"},"25"),r.createElement("option",{value:"50"},"50"),r.createElement("option",{value:"100"},"100")))):"";return r.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},r.createElement("h6",null,this.props.settingsText),r.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),o,n)}});e.exports=a},1277:function(e,t,n){"use strict";var r=n(7363),o=n(2555),i=n(4769),s=n(3302),l=(n(3059),n(5203),o({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,onRowMouseEnter:null,onRowMouseLeave:null,onRowWillMount:null,onRowWillUnmount: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,r=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var o={scrollTop:t,scrollHeight:n,clientHeight:r};this.setState(o)}.6*(n-(t+r)-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,o=null,i=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var l=e.getAdjustedRowHeight(),a=Math.ceil(e.state.clientHeight/l),u=Math.max(0,Math.floor(e.state.scrollTop/l)-.25*a),d=Math.min(u+1.25*a,this.props.data.length-1);n=n.slice(u,d+1);var c={height:u*l+"px"};o=r.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-d)*l+"px"};i=r.createElement("tr",{key:"below-"+p.height,style:p})}var f=n.map((function(n,o){var i=void 0!==n.children&&n.children.length>0,l=e.props.rowSettings.getRowKey(n,o);return i&&(t=i),r.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:l+"-container",uniqueId:l,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:i,tableClassName:e.props.className,onRowClick:e.props.onRowClick,onRowMouseEnter:e.props.onRowMouseEnter,onRowMouseLeave:e.props.onRowMouseLeave,onRowWillMount:e.props.onRowWillMount,onRowWillUnmount:e.props.onRowWillUnmount})}));if(this.props.showNoData){var h=this.props.columnSettings.getVisibleColumnCount();f.push(r.createElement("tr",{key:"no-data-section"},r.createElement("td",{colSpan:h},this.props.noDataSection)))}return o&&f.unshift(o),i&&f.push(i),{nodes:f,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,n=this.getNodeContent();n&&(e=n.nodes,t=n.anyHasChildren);var o=null,s=null,l={width:"100%"};if(this.props.useFixedLayout&&(l.tableLayout="fixed"),this.props.enableInfiniteScroll&&(o={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var a,u=null;this.props.useGriddleStyles&&(u={textAlign:"center",paddingBottom:"40px"}),a=this.props.columnSettings.getVisibleColumnCount();var d=this.props.externalLoadingComponent?r.createElement(this.props.externalLoadingComponent,null):r.createElement("div",null,"Loading...");s=r.createElement("tbody",null,r.createElement("tr",null,r.createElement("td",{style:u,colSpan:a},d)))}var c=this.props.showTableHeading?r.createElement(i,{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=r.createElement("tbody",null,e));var p=r.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=r.createElement("tbody",null,r.createElement("tr",null,r.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&&(l.tableLayout="fixed"),r.createElement("div",null,r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},c),r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:o},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},e,s,p)))):r.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:o},r.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&l||null},c,e,s,p))}}));e.exports=l},4769:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t=0)return!0}return!1}))},defaultColumnFilter:function(e,t,n){var r=N(O(n)?n:[n],(function(e){return(e||"").toLowerCase()}));return j(b.getObjectValues(t),(function(e){return e=e.toString().toLowerCase(),j(r,(function(t){return e.indexOf(t)>=0}))}))},filterByColumnFilters:function(e){var t=this.props.columnFilterFunc||this.defaultColumnFilter,n=Object.keys(e).reduce((function(n,r){return R(n,(function(n){var o=b.getAt(n,r||""),i=e[r];return t(r||"",o,i)}))}),this.props.results),r={columnFilters:e};e?(r.filteredResults=n,r.maxPage=this.getMaxPage(r.filteredResults)):this.state.filter?r.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):r.filteredResults=null,this.setState(r)},filterByColumn:function(e,t){var n=this.state.columnFilters;if(n.hasOwnProperty(t)&&!e)n=M(n,t);else{var r={};r[t]=e,n=T({},n,r)}this.filterByColumnFilters(n)},setFilter:function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(this.props.useExternal)this.props.externalSetFilter(e);else{var n=this,r={page:0,filter:e};r.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(t||this.props.results,e):this.defaultFilter(t||this.props.results,e),r.maxPage=n.getMaxPage(r.filteredResults),(D(e)||I(e)||A(e))&&(r.filter=e,r.filteredResults=null),n.setState(r),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 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)this.props.externalSetPage(e);else{if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t={page:e};this.setState(t)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})}},setColumns:function(e){this.columnSettings.filteredColumns=O(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=S(this.props.columnMetadata,{columnName:e})||{},r=n.sortDirectionCycle?n.sortDirectionCycle:[null,"asc","desc"],o=r.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null),i={page:0,sortColumn:e,sortDirection:r[o=(o+1)%r.length]?r[o]:null};this.setState(i)}},componentWillReceiveProps:function(e){if(e.results!==this.props.results&&this.setFilter(this.state.filter,e.results),this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=b.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,N(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 y(this.props.results.length>0?b.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new v(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:p,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 r=this,o=this;if(!this.props.useExternal){if(""!==this.state.sortColumn){var i,s=this.state.sortColumn,l=R(this.props.columnMetadata,{columnName:s}),a={columns:[],orders:[]};if(l.length>0&&(i=l[0].hasOwnProperty("customCompareFn")&&l[0].customCompareFn,l[0].multiSort&&(a=l[0].multiSort)),this.state.sortDirection)if("function"==typeof i)2===i.length?(e=e.sort((function(e,t){return i(k(e,s),k(t,s))})),"desc"===this.state.sortDirection&&e.reverse()):1===i.length&&(e=P(e,(function(e){return i(k(e,s))}),[this.state.sortDirection]));else{var u=[function(e){return(k(e,s)||"").toString().toLowerCase()}],d=[this.state.sortDirection];a.columns.forEach((function(e,t){u.push((function(t){return(k(t,e)||"").toString().toLowerCase()})),"asc"===a.orders[t]||"desc"===a.orders[t]?d.push(a.orders[t]):d.push(r.state.sortDirection)})),e=P(e,u,d)}}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,(c+1)*this.state.resultsPerPage);else{var p=C(e,c*this.state.resultsPerPage);e=(E||x)(p,p.length-this.state.resultsPerPage)}}for(var f=[],h=0;h0&&(m.children=o.getDataForRender(m[o.props.childrenColumnName],t,!1),"children"!==o.props.childrenColumnName&&delete m[o.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)),r=this;w(e,(function(e){r._updateSelectedRowIds(e[r.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),r=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],r,t);var o=this._getAreAllRowsChecked(r,N(n,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:o,selectedRowIds:r}),this.props.onSelectionChange&&this.props.onSelectionChange(r,o)},_updateSelectedRowIds:function(e,t,n){n?void 0===S(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===F(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:!S(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?o.createElement(g,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):o.createElement(a,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?o.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,r=null,i=null;return this.props.useGriddleStyles&&(n=this.getFilterStyles(),r=this.getSettingsStyles(),i=this.getClearFixStyles()),o.createElement("div",{className:"top-section",style:i},o.createElement("div",{className:"griddle-filter",style:n},e),o.createElement("div",{className:"griddle-settings-toggle",style:r},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return o.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?o.createElement(m,{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}):o.createElement(u,{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?o.createElement(d,{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 o.createElement(this.props.customGridComponent,r({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,n,r,i){return o.createElement("div",null,o.createElement(h,{data:e,columns:t,metadataColumns:n,globalData:i,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&r)},getStandardGridSection:function(e,t,n,r,i){var s=this.getSortObject(),a=this.getMultipleSelectionObject(),u=this.shouldShowNoDataSection(e),d=this.getNoDataSection();return o.createElement("div",{className:"griddle-body"},o.createElement(l,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:d,showNoData:u,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:s,multipleSelectionSettings:a,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:r,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:i,onRowClick:this.props.onRowClick,onRowMouseEnter:this.props.onRowMouseEnter,onRowMouseLeave:this.props.onRowMouseLeave,onRowWillMount:this.props.onRowWillMount,onRowWillUnmount:this.props.onRowWillUnmount}))},getContentSection:function(e,t,n,r,o,i){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,n,r,i):this.getStandardGridSection(e,t,n,r,o)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?o.createElement("div",{className:this.props.noDataClassName},o.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):o.createElement(c,{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(),r=this.getTopSection(t,n),i=[],s=this.columnSettings.getColumns(),l=this.getDataForRender(e,s,!0),a=this.columnSettings.getMetadataColumns();this.props.columnMetadata?w(this.props.columnMetadata,(function(e){"boolean"==typeof e.visible&&!1===e.visible||i.push(e.columnName)})):i=b.keys(M(e[0],a)),i=this.columnSettings.orderColumns(i);var u=this.getCurrentPage(),d=this.getCurrentMaxPage(),c=u+10?"griddle "+this.props.gridClassName:"griddle";return m+=this.shouldUseCustomRowComponent()?" griddle-custom":"",o.createElement("div",{className:m},r,h,o.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},f))}});f.Griddle=e.exports=L},5203:function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n-1}},1196:function(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r=200&&(c=a,p=!1,t=new r(t));e:for(;++d0&&i(d)?n>1?e(d,n-1,i,s,l):r(l,d):s||(l[l.length]=d)}return l}},8483:function(e,t,n){var r=n(5063)();e.exports=r},7816:function(e,t,n){var r=n(8483),o=n(3674);e.exports=function(e,t){return e&&r(e,t,o)}},7786:function(e,t,n){var r=n(1811),o=n(327);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n=120&&y.length>=120)?new r(f&&y):void 0}y=e[0];var v=-1,b=h[0];e:for(;++vo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++rt||s&&l&&u&&!a&&!d||o&&l&&u||!n&&u||!i)return 1;if(!o&&!s&&!d&&e=a?u:u*("desc"==n[o]?-1:1)}return e.index-t.index}},278:function(e){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n1?n[i-1]:void 0,l=i>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,l&&o(n[0],n[1],l)&&(s=i<3?void 0:s,i=1),t=Object(t);++r-1?l[a?t[u]:u]:void 0}}},3866:function(e,t,n){var r=n(8969),o=n(4160),i=n(8776),s=n(9294);e.exports=function(e){return function(t){var n=o(t);return"[object Map]"==n?i(t):"[object Set]"==n?s(t):r(t,e(t))}}},696:function(e,t,n){var r=n(8630);e.exports=function(e){return r(e)?void 0:e}},8777:function(e,t,n){var r=n(852),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},7114:function(e,t,n){var r=n(8668),o=n(2908),i=n(4757);e.exports=function(e,t,n,s,l,a){var u=1&n,d=e.length,c=t.length;if(d!=c&&!(u&&c>d))return!1;var p=a.get(e),f=a.get(t);if(p&&f)return p==t&&f==e;var h=-1,m=!0,g=2&n?new r:void 0;for(a.set(e,t),a.set(t,e);++h-1&&e%1==0&&e-1}},4705:function(e,t,n){var r=n(8470);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},4785:function(e,t,n){var r=n(1989),o=n(8407),i=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},1285:function(e,t,n){var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:function(e,t,n){var r=n(5050);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},8776:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},2634:function(e){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},4523:function(e,t,n){var r=n(8306);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},4536:function(e,t,n){var r=n(852)(Object,"create");e.exports=r},6916:function(e,t,n){var r=n(5569)(Object.keys,Object);e.exports=r},3498:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},1167:function(e,t,n){e=n.nmd(e);var r=n(1957),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o&&r.process,l=function(){try{var e=i&&i.require&&i.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=l},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5357:function(e,t,n){var r=n(6874),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,s=-1,l=o(i.length-t,0),a=Array(l);++s0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},7465:function(e,t,n){var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,n){var r=n(8407),o=n(7071),i=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(e,t),this.size=n.size,this}},2351:function(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r2?t[2]:void 0;for(u&&i(t[0],t[1],u)&&(r=1);++n-1:!!d&&r(e,t,n)>-1}},8125:function(e,t,n){var r=n(4259);e.exports=function(e){return(null==e?0:e.length)?r(e,0,-1):[]}},5325:function(e,t,n){var r=n(9932),o=n(7556),i=n(5976),s=n(4387),l=i((function(e){var t=r(e,s);return t.length&&t[0]===e[0]?o(t):[]}));e.exports=l},5694:function(e,t,n){var r=n(9454),o=n(7005),i=Object.prototype,s=i.hasOwnProperty,l=i.propertyIsEnumerable,a=r(function(){return arguments}())?r:function(e){return o(e)&&s.call(e,"callee")&&!l.call(e,"callee")};e.exports=a},1469:function(e){var t=Array.isArray;e.exports=t},8612:function(e,t,n){var r=n(3560),o=n(1780);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},9246:function(e,t,n){var r=n(8612),o=n(7005);e.exports=function(e){return o(e)&&r(e)}},4144:function(e,t,n){e=n.nmd(e);var r=n(5639),o=n(5062),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,l=s&&s.exports===i?r.Buffer:void 0,a=(l?l.isBuffer:void 0)||o;e.exports=a},1609:function(e,t,n){var r=n(280),o=n(4160),i=n(5694),s=n(1469),l=n(8612),a=n(4144),u=n(5726),d=n(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(l(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||a(e)||d(e)||i(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(c.call(e,n))return!1;return!0}},3560:function(e,t,n){var r=n(4239),o=n(3218);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},6688:function(e,t,n){var r=n(5588),o=n(1717),i=n(1167),s=i&&i.isMap,l=s?o(s):r;e.exports=l},5220:function(e){e.exports=function(e){return null===e}},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8630:function(e,t,n){var r=n(4239),o=n(5924),i=n(7005),s=Function.prototype,l=Object.prototype,a=s.toString,u=l.hasOwnProperty,d=a.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&a.call(n)==d}},2928:function(e,t,n){var r=n(9221),o=n(1717),i=n(1167),s=i&&i.isSet,l=s?o(s):r;e.exports=l},7037:function(e,t,n){var r=n(4239),o=n(1469),i=n(7005);e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&"[object String]"==r(e)}},3448:function(e,t,n){var r=n(4239),o=n(7005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},6719:function(e,t,n){var r=n(8749),o=n(1717),i=n(1167),s=i&&i.isTypedArray,l=s?o(s):r;e.exports=l},2353:function(e){e.exports=function(e){return void 0===e}},3674:function(e,t,n){var r=n(4636),o=n(280),i=n(8612);e.exports=function(e){return i(e)?r(e):o(e)}},1704:function(e,t,n){var r=n(4636),o=n(313),i=n(8612);e.exports=function(e){return i(e)?r(e,!0):o(e)}},928:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5161:function(e,t,n){var r=n(9932),o=n(7206),i=n(9199),s=n(1469);e.exports=function(e,t){return(s(e)?r:i)(e,o(t,3))}},8306:function(e,t,n){var r=n(3369);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},7557:function(e,t,n){var r=n(9932),o=n(5990),i=n(7406),s=n(1811),l=n(8363),a=n(696),u=n(9021),d=n(6904),c=u((function(e,t){var n={};if(null==e)return n;var u=!1;t=r(t,(function(t){return t=s(t,e),u||(u=t.length>1),t})),l(e,d(e),n),u&&(n=o(n,7,a));for(var c=t.length;c--;)i(n,t[c]);return n}));e.exports=c},5472:function(e,t,n){var r=n(2689),o=n(1469);e.exports=function(e,t,n,i){return null==e?[]:(o(t)||(t=null==t?[]:[t]),o(n=i?void 0:n)||(n=null==n?[]:[n]),r(e,t,n))}},8718:function(e,t,n){var r=n(5970),o=n(9021)((function(e,t){return null==e?{}:r(e,t)}));e.exports=o},9601:function(e,t,n){var r=n(371),o=n(9152),i=n(5403),s=n(327);e.exports=function(e){return i(e)?r(s(e)):o(e)}},9704:function(e,t,n){var r=n(2908),o=n(7206),i=n(5076),s=n(1469),l=n(6612);e.exports=function(e,t,n){var a=s(e)?r:i;return n&&l(e,t,n)&&(t=void 0),a(e,o(t,3))}},9734:function(e,t,n){var r=n(1078),o=n(2689),i=n(5976),s=n(6612),l=i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&s(e,t[0],t[1])?t=[]:n>2&&s(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])}));e.exports=l},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},9572:function(e,t,n){var r=n(4259),o=n(554);e.exports=function(e,t,n){return e&&e.length?(t=n||void 0===t?1:o(t),r(e,0,t<0?0:t)):[]}},8601:function(e,t,n){var r=n(4841),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},554:function(e,t,n){var r=n(8601);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},4841:function(e,t,n){var r=n(7561),o=n(3218),i=n(3448),s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,a=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||a.test(e)?u(e.slice(2),n?2:8):s.test(e)?NaN:+e}},3220:function(e,t,n){var r=n(3866)(n(3674));e.exports=r},84:function(e,t,n){var r=n(9932),o=n(278),i=n(1469),s=n(3448),l=n(5514),a=n(327),u=n(9833);e.exports=function(e){return i(e)?r(e,a):s(e)?[e]:o(l(u(e)))}},9833:function(e,t,n){var r=n(531);e.exports=function(e){return null==e?"":r(e)}},3955:function(e,t,n){var r=n(9833),o=0;e.exports=function(e){var t=++o;return r(e)+t}},2628:function(e,t,n){var r=n(7415),o=n(3674);e.exports=function(e){return null==e?[]:r(e,o(e))}},2569:function(e,t,n){var r=n(731),o=n(5976),i=n(9246),s=o((function(e,t){return i(e)?r(e,t):[]}));e.exports=s},7287:function(e,t,n){var r=n(4865),o=n(1757);e.exports=function(e,t){return o(e||[],t||[],r)}},7418:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var s,l,a=o(e),u=1;u1)for(var n=1;n1?t-1:0),r=1;r2?n-2:0),i=2;i1&&void 0!==arguments[1]&&arguments[1],n=this.props,r=n.tolerance,o=n.onSelection,i=n.onEndSelection,s=[],l=(0,d.findDOMNode)(this.refs.selectbox);l&&(this._registry.forEach((function(e){e.domNode&&(0,g.default)(l,e.domNode,r)&&!s.includes(e.key)&&s.push(e.key)})),t?"function"==typeof i&&i(s,e):"function"==typeof o&&o(s,e))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.enabled,r=e.fixedPosition,o=e.className,i=e.selectingClassName,s=this.state,l=s.isBoxSelecting,a=s.boxLeft,d=s.boxTop,c=s.boxWidth,f=s.boxHeight,h=this.props.component;if(!n)return u.default.createElement(h,{className:o},t);var m={left:a,top:d,width:c,height:f,zIndex:9e3,position:r?"fixed":"absolute",cursor:"default"},g={backgroundColor:"transparent",border:"1px dashed #999",width:"100%",height:"100%",float:"left"},y={position:"relative",overflow:"visible"};return u.default.createElement(h,{className:(0,p.default)(o,l?i:null),style:y},l?u.default.createElement("div",{style:m,ref:"selectbox"},u.default.createElement("span",{style:g})):null,t)}}]),t}(a.Component);v.propTypes={children:c.default.node,onBeginSelection:c.default.func,onEndSelection:c.default.func,onSelection:c.default.func,component:c.default.node,tolerance:c.default.number,fixedPosition:c.default.bool,preventDefault:c.default.bool,onNonItemClick:c.default.func,enabled:c.default.bool,className:c.default.string,selectingClassName:c.default.string},v.defaultProps={component:"div",tolerance:0,fixedPosition:!1,preventDefault:!0,enabled:!0},v.childContextTypes={selectable:c.default.object},t.default=v},function(e,t,n){"use strict";(function(t){var r="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},o=n(1),i=n(2),s=n(8),l=n(15),a=n(3),u=n(16);e.exports=function(e,n){function d(e){var t=e&&(A&&e[A]||e[I]);if("function"==typeof t)return t}function c(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e){this.message=e,this.stack=""}function f(e){function r(r,u,d,c,f,h,m){if(c=c||D,h=h||d,m!==a)if(n)i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var g=c+":"+d;!o[g]&&l<3&&(s(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",h,c),o[g]=!0,l++)}return null==u[d]?r?new p(null===u[d]?"The "+f+" `"+h+"` is marked as required in `"+c+"`, but its value is `null`.":"The "+f+" `"+h+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(u,d,c,f,h)}if("production"!==t.env.NODE_ENV)var o={},l=0;var u=r.bind(null,!1);return u.isRequired=r.bind(null,!0),u}function h(e){function t(t,n,r,o,i,s){var l=t[n];return w(l)!==e?new p("Invalid "+o+" `"+i+"` of type `"+x(l)+"` supplied to `"+r+"`, expected `"+e+"`."):null}return f(t)}function m(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new p("Invalid "+o+" `"+i+"` of type `"+w(s)+"` supplied to `"+r+"`, expected an array.");for(var l=0;ln+l||t+o-ar+s)};t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=e instanceof HTMLElement?(0,r.default)(e):e,s=t instanceof HTMLElement?(0,r.default)(t):t;return o(i.top,i.left,s.top,s.left,i.offsetWidth,i.offsetHeight,s.offsetWidth,s.offsetHeight,n)}},function(e,t,n){"use strict";(function(t){function n(e,t,n){function r(t){var n=m,r=g;return m=g=void 0,w=t,v=e.apply(r,n)}function i(e){return w=e,b=setTimeout(d,t),x?r(e):v}function s(e){var n=t-(e-C);return F?S(n,y-(e-w)):n}function a(e){var n=e-C;return void 0===C||n>=t||n<0||F&&e-w>=y}function d(){var e=_();if(a(e))return c(e);b=setTimeout(d,s(e))}function c(e){return b=void 0,O&&m?r(e):(m=g=void 0,v)}function p(){void 0!==b&&clearTimeout(b),w=0,m=C=g=b=void 0}function f(){return void 0===b?v:c(_())}function h(){var e=_(),n=a(e);if(m=arguments,g=this,C=e,n){if(void 0===b)return i(C);if(F)return b=setTimeout(d,t),r(C)}return void 0===b&&(b=setTimeout(d,t)),v}var m,g,y,v,b,C,w=0,x=!1,F=!1,O=!0;if("function"!=typeof e)throw new TypeError(u);return t=l(t)||0,o(n)&&(x=!!n.leading,y=(F="maxWait"in n)?E(l(n.maxWait)||0,t):y,O="trailing"in n?!!n.trailing:O),h.cancel=p,h.flush=f,h}function r(e,t,r){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError(u);return o(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),n(e,t,{leading:i,maxWait:t,trailing:s})}function o(e){var t=void 0===e?"undefined":a(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==(void 0===e?"undefined":a(e))}function s(e){return"symbol"==(void 0===e?"undefined":a(e))||i(e)&&C.call(e)==c}function l(e){if("number"==typeof e)return e;if(s(e))return d;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(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)?d:+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},u="Expected a function",d=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,y="object"==(void 0===t?"undefined":a(t))&&t&&t.Object===Object&&t,v="object"==("undefined"==typeof self?"undefined":a(self))&&self&&self.Object===Object&&self,b=y||v||Function("return this")(),C=Object.prototype.toString,E=Math.max,S=Math.min,_=function(){return b.Date.now()};e.exports=r}).call(t,n(21))},function(e,t,n){"use strict";var r,o="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};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(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 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});var l=function(){function e(e,t){for(var n=0;n
'),this.element.appendChild(e));let t=e.getElementsByTagName("span")[0];return t&&(null!=t.textContent?t.textContent=this.options.dictFallbackMessage:null!=t.innerText&&(t.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize(e,t,n,r){let o={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},i=e.width/e.height;null==t&&null==n?(t=o.srcWidth,n=o.srcHeight):null==t?t=n*i:null==n&&(n=t/i);let s=(t=Math.min(t,o.srcWidth))/(n=Math.min(n,o.srcHeight));if(o.srcWidth>t||o.srcHeight>n)if("crop"===r)i>s?(o.srcHeight=e.height,o.srcWidth=o.srcHeight*s):(o.srcWidth=e.width,o.srcHeight=o.srcWidth/s);else{if("contain"!==r)throw new Error(`Unknown resizeMethod '${r}'`);i>s?n=t/i:t=n*i}return o.srcX=(e.width-o.srcWidth)/2,o.srcY=(e.height-o.srcHeight)/2,o.trgWidth=t,o.trgHeight=n,o},transformFile(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:s('
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n'),drop(e){return this.element.classList.remove("dz-drag-hover")},dragstart(e){},dragend(e){return this.element.classList.remove("dz-drag-hover")},dragenter(e){return this.element.classList.add("dz-drag-hover")},dragover(e){return this.element.classList.add("dz-drag-hover")},dragleave(e){return this.element.classList.remove("dz-drag-hover")},paste(e){},reset(){return this.element.classList.remove("dz-started")},addedfile(e){if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){for(var t of(e.previewElement=u.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),e.previewElement.querySelectorAll("[data-dz-name]")))t.textContent=e.name;for(t of e.previewElement.querySelectorAll("[data-dz-size]"))t.innerHTML=this.filesize(e.size);this.options.addRemoveLinks&&(e._removeLink=u.createElement(`${this.options.dictRemoveFile}`),e.previewElement.appendChild(e._removeLink));let n=t=>(t.preventDefault(),t.stopPropagation(),e.status===u.UPLOADING?u.confirm(this.options.dictCancelUploadConfirmation,(()=>this.removeFile(e))):this.options.dictRemoveFileConfirmation?u.confirm(this.options.dictRemoveFileConfirmation,(()=>this.removeFile(e))):this.removeFile(e));for(let t of e.previewElement.querySelectorAll("[data-dz-remove]"))t.addEventListener("click",n)}},removedfile(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");for(let n of e.previewElement.querySelectorAll("[data-dz-thumbnail]"))n.alt=e.name,n.src=t;return setTimeout((()=>e.previewElement.classList.add("dz-image-preview")),1)}},error(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"string"!=typeof t&&t.error&&(t=t.error);for(let n of e.previewElement.querySelectorAll("[data-dz-errormessage]"))n.textContent=t}},errormultiple(){},processing(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple(){},uploadprogress(e,t,n){if(e.previewElement)for(let n of e.previewElement.querySelectorAll("[data-dz-uploadprogress]"))"PROGRESS"===n.nodeName?n.value=t:n.style.width=`${t}%`},totaluploadprogress(){},sending(){},sendingmultiple(){},success(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple(){},canceled(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple(){},complete(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple(){},maxfilesexceeded(){},maxfilesreached(){},queuecomplete(){},addedfiles(){}};class u extends l{static initClass(){this.prototype.Emitter=l,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}getAcceptedFiles(){return this.files.filter((e=>e.accepted)).map((e=>e))}getRejectedFiles(){return this.files.filter((e=>!e.accepted)).map((e=>e))}getFilesWithStatus(e){return this.files.filter((t=>t.status===e)).map((e=>e))}getQueuedFiles(){return this.getFilesWithStatus(u.QUEUED)}getUploadingFiles(){return this.getFilesWithStatus(u.UPLOADING)}getAddedFiles(){return this.getFilesWithStatus(u.ADDED)}getActiveFiles(){return this.files.filter((e=>e.status===u.UPLOADING||e.status===u.QUEUED)).map((e=>e))}init(){if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(u.createElement(`
`)),this.clickableElements.length){let e=()=>{this.hiddenFileInput&&this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=document.createElement("input"),this.hiddenFileInput.setAttribute("type","file"),(null===this.options.maxFiles||this.options.maxFiles>1)&&this.hiddenFileInput.setAttribute("multiple","multiple"),this.hiddenFileInput.className="dz-hidden-input",null!==this.options.acceptedFiles&&this.hiddenFileInput.setAttribute("accept",this.options.acceptedFiles),null!==this.options.capture&&this.hiddenFileInput.setAttribute("capture",this.options.capture),this.hiddenFileInput.setAttribute("tabindex","-1"),this.hiddenFileInput.style.visibility="hidden",this.hiddenFileInput.style.position="absolute",this.hiddenFileInput.style.top="0",this.hiddenFileInput.style.left="0",this.hiddenFileInput.style.height="0",this.hiddenFileInput.style.width="0",u.getElement(this.options.hiddenInputContainer,"hiddenInputContainer").appendChild(this.hiddenFileInput),this.hiddenFileInput.addEventListener("change",(()=>{let{files:t}=this.hiddenFileInput;if(t.length)for(let e of t)this.addFile(e);this.emit("addedfiles",t),e()}))};e()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(let e of this.events)this.on(e,this.options[e]);this.on("uploadprogress",(()=>this.updateTotalUploadProgress())),this.on("removedfile",(()=>this.updateTotalUploadProgress())),this.on("canceled",(e=>this.emit("complete",e))),this.on("complete",(e=>{if(0===this.getAddedFiles().length&&0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length)return setTimeout((()=>this.emit("queuecomplete")),0)}));let e=function(e){if(function(e){if(e.dataTransfer.types)for(var t=0;tthis.emit("dragstart",e),dragenter:t=>(e(t),this.emit("dragenter",t)),dragover:t=>{let n;try{n=t.dataTransfer.effectAllowed}catch(e){}return t.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",e(t),this.emit("dragover",t)},dragleave:e=>this.emit("dragleave",e),drop:t=>(e(t),this.drop(t)),dragend:e=>this.emit("dragend",e)}}],this.clickableElements.forEach((e=>this.listeners.push({element:e,events:{click:t=>((e!==this.element||t.target===this.element||u.elementInside(t.target,this.element.querySelector(".dz-message")))&&this.hiddenFileInput.click(),!0)}}))),this.enable(),this.options.init.call(this)}destroy(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,u.instances.splice(u.instances.indexOf(this),1)}updateTotalUploadProgress(){let e,t=0,n=0;if(this.getActiveFiles().length){for(let e of this.getActiveFiles())t+=e.upload.bytesSent,n+=e.upload.total;e=100*t/n}else e=100;return this.emit("totaluploadprogress",e,n,t)}_getParamName(e){return"function"==typeof this.options.paramName?this.options.paramName(e):`${this.options.paramName}${this.options.uploadMultiple?`[${e}]`:""}`}_renameFile(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}getFallbackForm(){let e,t;if(e=this.getExistingFallback())return e;let n='
';this.options.dictFallbackText&&(n+=`

${this.options.dictFallbackText}

`),n+=`
`;let r=u.createElement(n);return"FORM"!==this.element.tagName?(t=u.createElement(`
`),t.appendChild(r)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:r}getExistingFallback(){let e=function(e){for(let t of e)if(/(^| )fallback($| )/.test(t.className))return t};for(let n of["div","form"]){var t;if(t=e(this.element.getElementsByTagName(n)))return t}}setupEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let r=e.events[n];t.push(e.element.addEventListener(n,r,!1))}return t})()))}removeEventListeners(){return this.listeners.map((e=>(()=>{let t=[];for(let n in e.events){let r=e.events[n];t.push(e.element.removeEventListener(n,r,!1))}return t})()))}disable(){return this.clickableElements.forEach((e=>e.classList.remove("dz-clickable"))),this.removeEventListeners(),this.disabled=!0,this.files.map((e=>this.cancelUpload(e)))}enable(){return delete this.disabled,this.clickableElements.forEach((e=>e.classList.add("dz-clickable"))),this.setupEventListeners()}filesize(e){let t=0,n="b";if(e>0){let r=["tb","gb","mb","kb","b"];for(let o=0;o=Math.pow(this.options.filesizeBase,4-o)/10){t=e/Math.pow(this.options.filesizeBase,4-o),n=i;break}}t=Math.round(10*t)/10}return`${t} ${this.options.dictFileSizeUnits[n]}`}_updateMaxFilesReachedClass(){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")}drop(e){if(!e.dataTransfer)return;this.emit("drop",e);let t=[];for(let n=0;ne.items,null!=t?n(t):void 0))return;var t,n;this.emit("paste",e);let{items:r}=e.clipboardData;return r.length?this._addFilesFromItems(r):void 0}handleFiles(e){for(let t of e)this.addFile(t)}_addFilesFromItems(e){return(()=>{let t=[];for(let r of e){var n;null!=r.webkitGetAsEntry&&(n=r.webkitGetAsEntry())?n.isFile?t.push(this.addFile(r.getAsFile())):n.isDirectory?t.push(this._addFilesFromDirectory(n,n.name)):t.push(void 0):null!=r.getAsFile&&(null==r.kind||"file"===r.kind)?t.push(this.addFile(r.getAsFile())):t.push(void 0)}return t})()}_addFilesFromDirectory(e,t){let n=e.createReader(),r=e=>{return t=console,n="log",r=t=>t.log(e),null!=t&&"function"==typeof t[n]?r(t,n):void 0;var t,n,r};var o=()=>n.readEntries((e=>{if(e.length>0){for(let n of e)n.isFile?n.file((e=>{if(!this.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=`${t}/${e.name}`,this.addFile(e)})):n.isDirectory&&this._addFilesFromDirectory(n,`${t}/${n.name}`);o()}return null}),r);return o()}accept(e,t){this.options.maxFilesize&&e.size>1048576*this.options.maxFilesize?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):u.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}addFile(e){e.upload={uuid:u.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=u.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,(t=>{t?(e.accepted=!1,this._errorProcessing([e],t)):(e.accepted=!0,this.options.autoQueue&&this.enqueueFile(e)),this._updateMaxFilesReachedClass()}))}enqueueFiles(e){for(let t of e)this.enqueueFile(t);return null}enqueueFile(e){if(e.status!==u.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=u.QUEUED,this.options.autoProcessQueue)return setTimeout((()=>this.processQueue()),0)}_enqueueThumbnail(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1048576*this.options.maxThumbnailFilesize)return this._thumbnailQueue.push(e),setTimeout((()=>this._processThumbnailQueue()),0)}_processThumbnailQueue(){if(this._processingThumbnail||0===this._thumbnailQueue.length)return;this._processingThumbnail=!0;let e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,(t=>(this.emit("thumbnail",e,t),this._processingThumbnail=!1,this._processThumbnailQueue())))}removeFile(e){if(e.status===u.UPLOADING&&this.cancelUpload(e),this.files=d(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}removeAllFiles(e){null==e&&(e=!1);for(let t of this.files.slice())(t.status!==u.UPLOADING||e)&&this.removeFile(t);return null}resizeImage(e,t,n,r,o){return this.createThumbnail(e,t,n,r,!0,((t,n)=>{if(null==n)return o(e);{let{resizeMimeType:t}=this.options;null==t&&(t=e.type);let r=n.toDataURL(t,this.options.resizeQuality);return"image/jpeg"!==t&&"image/jpg"!==t||(r=f.restore(e.dataURL,r)),o(u.dataURItoBlob(r))}}))}createThumbnail(e,t,n,r,o,i){let s=new FileReader;s.onload=()=>{e.dataURL=s.result,"image/svg+xml"!==e.type?this.createThumbnailFromUrl(e,t,n,r,o,i):null!=i&&i(s.result)},s.readAsDataURL(e)}displayExistingFile(e,t,n,r,o=!0){if(this.emit("addedfile",e),this.emit("complete",e),o){let o=t=>{this.emit("thumbnail",e,t),n&&n()};e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,o,r)}else this.emit("thumbnail",e,t),n&&n()}createThumbnailFromUrl(e,t,n,r,o,i,s){let l=document.createElement("img");return s&&(l.crossOrigin=s),o="from-image"!=getComputedStyle(document.body).imageOrientation&&o,l.onload=()=>{let s=e=>e(1);return"undefined"!=typeof EXIF&&null!==EXIF&&o&&(s=e=>EXIF.getData(l,(function(){return e(EXIF.getTag(this,"Orientation"))}))),s((o=>{e.width=l.width,e.height=l.height;let s=this.options.resize.call(this,e,t,n,r),a=document.createElement("canvas"),u=a.getContext("2d");switch(a.width=s.trgWidth,a.height=s.trgHeight,o>4&&(a.width=s.trgHeight,a.height=s.trgWidth),o){case 2:u.translate(a.width,0),u.scale(-1,1);break;case 3:u.translate(a.width,a.height),u.rotate(Math.PI);break;case 4:u.translate(0,a.height),u.scale(1,-1);break;case 5:u.rotate(.5*Math.PI),u.scale(1,-1);break;case 6:u.rotate(.5*Math.PI),u.translate(0,-a.width);break;case 7:u.rotate(.5*Math.PI),u.translate(a.height,-a.width),u.scale(-1,1);break;case 8:u.rotate(-.5*Math.PI),u.translate(-a.height,0)}p(u,l,null!=s.srcX?s.srcX:0,null!=s.srcY?s.srcY:0,s.srcWidth,s.srcHeight,null!=s.trgX?s.trgX:0,null!=s.trgY?s.trgY:0,s.trgWidth,s.trgHeight);let d=a.toDataURL("image/png");if(null!=i)return i(d,a)}))},null!=i&&(l.onerror=i),l.src=e.dataURL}processQueue(){let{parallelUploads:e}=this.options,t=this.getUploadingFiles().length,n=t;if(t>=e)return;let r=this.getQueuedFiles();if(r.length>0){if(this.options.uploadMultiple)return this.processFiles(r.slice(0,e-t));for(;nt.xhr===e)).map((e=>e))}cancelUpload(e){if(e.status===u.UPLOADING){let t=this._getFilesWithXhr(e.xhr);for(let e of t)e.status=u.CANCELED;void 0!==e.xhr&&e.xhr.abort();for(let e of t)this.emit("canceled",e);this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else e.status!==u.ADDED&&e.status!==u.QUEUED||(e.status=u.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}resolveOption(e,...t){return"function"==typeof e?e.apply(this,t):e}uploadFile(e){return this.uploadFiles([e])}uploadFiles(e){this._transformFiles(e,(t=>{if(this.options.chunking){let n=t[0];e[0].upload.chunked=this.options.chunking&&(this.options.forceChunking||n.size>this.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(n.size/this.options.chunkSize)}if(e[0].upload.chunked){let n=e[0],r=t[0],o=0;n.upload.chunks=[];let i=()=>{let t=0;for(;void 0!==n.upload.chunks[t];)t++;if(t>=n.upload.totalChunkCount)return;o++;let i=t*this.options.chunkSize,s=Math.min(i+this.options.chunkSize,r.size),l={name:this._getParamName(0),data:r.webkitSlice?r.webkitSlice(i,s):r.slice(i,s),filename:n.upload.filename,chunkIndex:t};n.upload.chunks[t]={file:n,index:t,dataBlock:l,status:u.UPLOADING,progress:0,retries:0},this._uploadData(e,[l])};if(n.upload.finishedChunkUpload=(t,r)=>{let o=!0;t.status=u.SUCCESS,t.dataBlock=null,t.response=t.xhr.responseText,t.responseHeaders=t.xhr.getAllResponseHeaders(),t.xhr=null;for(let e=0;e{this._finished(e,r,null)}))},this.options.parallelChunkUploads)for(let e=0;e{this._finishedUploading(e,n,t)},n.ontimeout=()=>{this._handleUploadError(e,n,`Request timedout after ${this.options.timeout/1e3} seconds`)},n.onerror=()=>{this._handleUploadError(e,n)},(null!=n.upload?n.upload:n).onprogress=t=>this._updateFilesUploadProgress(e,n,t);let s=this.options.defaultHeaders?{Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}:{};this.options.binaryBody&&(s["Content-Type"]=e[0].type),this.options.headers&&r(s,this.options.headers);for(let e in s){let t=s[e];t&&n.setRequestHeader(e,t)}if(this.options.binaryBody){for(let t of e)this.emit("sending",t,n);this.options.uploadMultiple&&this.emit("sendingmultiple",e,n),this.submitRequest(n,null,e)}else{let r=new FormData;if(this.options.params){let t=this.options.params;"function"==typeof t&&(t=t.call(this,e,n,e[0].upload.chunked?this._getChunk(e[0],n):null));for(let e in t){let n=t[e];if(Array.isArray(n))for(let t=0;t{n[o]=i,++r===e.length&&t(n)}))}_addFormElementData(e){if("FORM"===this.element.tagName)for(let t of this.element.querySelectorAll("input, textarea, select, button")){let n=t.getAttribute("name"),r=t.getAttribute("type");if(r&&(r=r.toLowerCase()),null!=n)if("SELECT"===t.tagName&&t.hasAttribute("multiple"))for(let r of t.options)r.selected&&e.append(n,r.value);else(!r||"checkbox"!==r&&"radio"!==r||t.checked)&&e.append(n,t.value)}}_updateFilesUploadProgress(e,t,n){if(e[0].upload.chunked){let r=e[0],o=this._getChunk(r,t);n?(o.progress=100*n.loaded/n.total,o.total=n.total,o.bytesSent=n.loaded):(o.progress=100,o.bytesSent=o.total),r.upload.progress=0,r.upload.total=0,r.upload.bytesSent=0;for(let e=0;ethis.options.renameFilename.call(this,e.name,e)),"string"==typeof this.options.method&&(this.options.method=this.options.method.toUpperCase()),(n=this.getExistingFallback())&&n.parentNode&&n.parentNode.removeChild(n),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=u.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=u.getElements(this.options.clickable,"clickable")),this.init()}}u.initClass(),u.options={},u.optionsForElement=function(e){return e.getAttribute("id")?u.options[c(e.getAttribute("id"))]:void 0},u.instances=[],u.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},u.discover=function(){let e;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];let t=t=>(()=>{let n=[];for(let r of t)/(^| )dropzone($| )/.test(r.className)?n.push(e.push(r)):n.push(void 0);return n})();t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return(()=>{let t=[];for(let n of e)!1!==u.optionsForElement(n)?t.push(new u(n)):t.push(void 0);return t})()},u.blockedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],u.isBrowserSupported=function(){let e=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){void 0!==u.blacklistedBrowsers&&(u.blockedBrowsers=u.blacklistedBrowsers);for(let t of u.blockedBrowsers)if(t.test(navigator.userAgent)){e=!1;continue}}else e=!1;else e=!1;return e},u.dataURItoBlob=function(e){let t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),o=new Uint8Array(r);for(let e=0,n=t.length,r=0<=n;r?e<=n:e>=n;r?e++:e--)o[e]=t.charCodeAt(e);return new Blob([r],{type:n})};const d=(e,t)=>e.filter((e=>e!==t)).map((e=>e)),c=e=>e.replace(/[\-_](\w)/g,(e=>e.charAt(1).toUpperCase()));u.createElement=function(e){let t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},u.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},u.getElement=function(e,t){let n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector or a plain HTML element.`);return n},u.getElements=function(e,t){let n,r;if(e instanceof Array){r=[];try{for(n of e)r.push(this.getElement(n,t))}catch(e){r=null}}else if("string"==typeof e)for(n of(r=[],document.querySelectorAll(e)))r.push(n);else null!=e.nodeType&&(r=[e]);if(null==r||!r.length)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);return r},u.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},u.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");let n=e.type,r=n.replace(/\/.*$/,"");for(let o of t)if(o=o.trim(),"."===o.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(o.toLowerCase(),e.name.length-o.length))return!0}else if(/\/\*$/.test(o)){if(r===o.replace(/\/.*$/,""))return!0}else if(n===o)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each((function(){return new u(this,e)}))}),u.ADDED="added",u.QUEUED="queued",u.ACCEPTED=u.QUEUED,u.UPLOADING="uploading",u.PROCESSING=u.UPLOADING,u.CANCELED="canceled",u.ERROR="error",u.SUCCESS="success";var p=function(e,t,n,r,o,i,s,l,a,u){let d=function(e){e.naturalWidth;let t=e.naturalHeight,n=document.createElement("canvas");n.width=1,n.height=t;let r=n.getContext("2d");r.drawImage(e,0,0);let{data:o}=r.getImageData(1,0,1,t),i=0,s=t,l=t;for(;l>i;)0===o[4*(l-1)+3]?s=l:i=l,l=s+i>>1;let a=l/t;return 0===a?1:a}(t);return e.drawImage(t,n,r,o,i,s,l,a,u/d)};class f{static initClass(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}static encode64(e){let t,n,r,o,i,s="",l="",a="",u=0;for(;t=e[u++],n=e[u++],l=e[u++],r=t>>2,o=(3&t)<<4|n>>4,i=(15&n)<<2|l>>6,a=63&l,isNaN(n)?i=a=64:isNaN(l)&&(a=64),s=s+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(i)+this.KEY_STR.charAt(a),t=n=l="",r=o=i=a="",ue.length)break}return n}static decode64(e){let t,n,r,o,i,s="",l="",a=0,u=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");r=this.KEY_STR.indexOf(e.charAt(a++)),o=this.KEY_STR.indexOf(e.charAt(a++)),i=this.KEY_STR.indexOf(e.charAt(a++)),l=this.KEY_STR.indexOf(e.charAt(a++)),t=r<<2|o>>4,n=(15&o)<<4|i>>2,s=(3&i)<<6|l,u.push(t),64!==i&&u.push(n),64!==l&&u.push(s),t=n=s="",r=o=i=l="",ae.execCommand(f),priority:80},editorIdentifier).addCommandWithUrlTest(f,/^\[file_link/);const h={init(e){e.addCommand(f,(()=>{(0,i.default)(`#${e.id}`).entwine("ss").openLinkFileDialog()}))}},m="insert-link__dialog-wrapper--file",g=(0,a.loadComponent)(l.default);i.default.entwine("ss",(e=>{e("textarea.htmleditor").entwine({openLinkFileDialog(){let t=e(`#${m}`);t.length||(t=e(`
`),e("body").append(t)),t.addClass("insert-link__dialog-wrapper"),t.setElement(this),t.open()}}),e(`.js-injector-boot #${m}`).entwine({ReactRoot:null,renderModal(e){var t=this;const{dispatch:n}=a.default.reducer.store;n(u.initFormStack("insert-link","admin"));const i=this.getOriginalAttributes(),s=this.getFolderId(),l=this.getRequireLinkText();let d=this.getReactRoot();d||(d=(0,o.createRoot)(this[0]),this.setReactRoot(d)),d.render(r.default.createElement(g,{isOpen:e,type:"insert-link",folderId:s,onInsert:function(){return t.handleInsert(...arguments)},onClosed:()=>{n(u.reset()),this.close()},title:!1,bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--internal",fileAttributes:i,requireLinkText:l}))},buildAttributes(e){return{href:`${s.default.serialise({name:"file_link",properties:{id:e.ID}},!0)}${e.Anchor&&e.Anchor.length?`#${e.Anchor}`:""}`,target:e.TargetBlank?"_blank":"",title:e.Description}},getFolderId(){const e=this.getElement();if(!e)return null;const t=Number(e.data("config").upload_folder_id);return isNaN(t)?null:t},getOriginalAttributes(){const t=this.getElement().getEditor(),n=e(t.getSelectedNode()),r=(n.attr("href")||"").split("#");if(!r[0])return{};const o=s.default.match("file_link",!1,r[0]);return o?{ID:o.properties.id?parseInt(o.properties.id,10):0,Anchor:r[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}:{}}})})),tinymce.PluginManager.add(f,(e=>h.init(e)))}()}(); \ No newline at end of file diff --git a/client/src/entwine/TinyMCE_sslink-file.js b/client/src/entwine/TinyMCE_sslink-file.js index b4a497505..c31af3eb1 100644 --- a/client/src/entwine/TinyMCE_sslink-file.js +++ b/client/src/entwine/TinyMCE_sslink-file.js @@ -70,12 +70,8 @@ jQuery.entwine('ss', ($) => { const handleInsert = (...args) => this.handleInsert(...args); const attrs = this.getOriginalAttributes(); - const editor = this.getElement().getEditor(); - const selection = editor.getInstance().selection; - const selectionContent = editor.getSelection(); const folderId = this.getFolderId(); - const tagName = selection.getNode().tagName; - const requireLinkText = tagName !== 'A' && selectionContent.trim() === ''; + const requireLinkText = this.getRequireLinkText(); // create/update the react component let root = this.getReactRoot(); diff --git a/tests/behat/features/insert-an-image.feature b/tests/behat/features/insert-an-image.feature index f28e1d2de..552446bb1 100644 --- a/tests/behat/features/insert-an-image.feature +++ b/tests/behat/features/insert-an-image.feature @@ -154,3 +154,27 @@ Feature: Insert an image into a page Then I should see the "Form_fileInsertForm" form And the "Description" field should contain "My file" And I should see "Link to file" in the "button[name=action_insert]" element + + Scenario: I can wrap an image in a link to a file + # Add an actual image to the WYSIWYG + Given I press the "Insert from Files" HTML field button + And I select the file named "folder1" in the gallery + And I click on the file named "file1" in the gallery + And I press the "Insert file" button + # Required to avoid "unsaved changes" browser dialog + And I press the "Save" button + # Validate that everything is ready for the test + Then I should not see a ".tox-pop__dialog .tox-toolbar" element + And I should not see the "Form_fileInsertForm" form + And the "Content" HTML field should contain "file1.jpg" + When I select the image "file1.jpg" in the "Content" HTML field + And I press the "Insert link" HTML field button + And I click "Link to a file" in the ".tox-collection__group" element + And I select the file named "folder1" in the gallery + And I click on the file named "file1" in the gallery + Then I should see the "Form_fileInsertForm" form + And I should not see "Link text" + And I press the "Link to file" button + Then the "Content" HTML field should contain "[image src="/assets/folder1/3d0ef6ec37/file1.jpg" id="2" width="50" height="50" class="leftAlone ss-htmleditorfield-file image"]" + # Required to avoid "unsaved changed" browser dialog + And I press the "Save" button diff --git a/tests/behat/src/FixtureContext.php b/tests/behat/src/FixtureContext.php index 549cdc0a2..7fd16bbdb 100644 --- a/tests/behat/src/FixtureContext.php +++ b/tests/behat/src/FixtureContext.php @@ -446,18 +446,6 @@ public function iShouldSeeTheTableGalleryFolderInPosition(string $name, string $ Assert::assertNotNull($title, sprintf('Folder at position %s should be named %s', $position, $name)); } - /** - * Selects the first image match in the HTML editor (tinymce) - * - * @When /^I select the image "([^"]+)" in the "([^"]+)" HTML field$/ - * @param string $filename - * @param string $field - */ - public function iSelectTheImageInHtmlField($filename, $field) - { - $this->selectInTheHtmlField("img[src*='$filename']", $field); - } - /** * Selects the first media embed match in the HTML editor (tinymce) * @@ -468,58 +456,6 @@ public function iSelectTheMediaInHtmlField(string $url, string $field) $this->selectInTheHtmlField("div.embed[data-url='$url']", $field); } - /** - * Selects the first match of $select in the given HTML editor (tinymce) - */ - protected function selectInTheHtmlField(string $select, string $field) - { - $inputField = $this->getHtmlField($field); - $inputField->getParent()->find('css', 'iframe')->click(); - $inputFieldId = $inputField->getAttribute('id'); - $js = <<getMainContext()->getSession()->executeScript($js); - } - - /** - * Locate an HTML editor field - * - * @param string $locator Raw html field identifier as passed from - * @return NodeElement - */ - protected function getHtmlField($locator) - { - $locator = str_replace('\\"', '"', $locator ?? ''); - $page = $this->getMainContext()->getSession()->getPage(); - $element = $page->find('css', 'textarea.htmleditor[name=\'' . $locator . '\']'); - if ($element) { - return $element; - } - $label = $page->findAll('xpath', sprintf('//label[contains(text(), \'%s\')]', $locator)); - if (!empty($label)) { - Assert::assertCount(1, $label, "Found more than one element containing the phrase \"$locator\""); - $label = array_shift($label); - $fieldId = $label->getAttribute('for'); - $element = $page->find('css', '#' . $fieldId); - } - Assert::assertNotNull($element, sprintf('HTML field "%s" not found', $locator)); - return $element; - } - /** * @When /^I scroll the editor details panel to the top$/ */