Merge pull request #5408 from open-sausages/pulls/4.0/changeset-preview

API Implement basic preview behaviour
This commit is contained in:
Hamish Friedlander 2016-05-02 16:29:57 +12:00
commit feca77c902
19 changed files with 345 additions and 178 deletions

View File

@ -1,5 +1,5 @@
!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj["default"]=obj,newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function appBoot(){_ReducerRegister2["default"].add("config",_ConfigReducer2["default"]),_ReducerRegister2["default"].add("form",_FormReducer2["default"]),_ReducerRegister2["default"].add("schemas",_SchemaReducer2["default"]),_ReducerRegister2["default"].add("records",_RecordsReducer2["default"]),_ReducerRegister2["default"].add("campaign",_CampaignReducer2["default"]);var initialState={},rootReducer=(0,_redux.combineReducers)(_ReducerRegister2["default"].getAll()),middleware=[_reduxThunk2["default"]];"dev"===window.ss.config.environment&&middleware.push((0,_reduxLogger2["default"])());var createStoreWithMiddleware=_redux.applyMiddleware.apply(void 0,middleware)(_redux.createStore);window.store=createStoreWithMiddleware(rootReducer,initialState),window.store.dispatch(configActions.setConfig(window.ss.config))}var _jQuery=require("jQuery"),_jQuery2=_interopRequireDefault(_jQuery),_redux=require("redux"),_reduxThunk=require("redux-thunk"),_reduxThunk2=_interopRequireDefault(_reduxThunk),_reduxLogger=require("redux-logger"),_reduxLogger2=_interopRequireDefault(_reduxLogger),_ReducerRegister=require("lib/ReducerRegister"),_ReducerRegister2=_interopRequireDefault(_ReducerRegister),_ConfigActions=require("state/config/ConfigActions"),configActions=_interopRequireWildcard(_ConfigActions),_ConfigReducer=require("state/config/ConfigReducer"),_ConfigReducer2=_interopRequireDefault(_ConfigReducer),_FormReducer=require("state/form/FormReducer"),_FormReducer2=_interopRequireDefault(_FormReducer),_SchemaReducer=require("state/schema/SchemaReducer"),_SchemaReducer2=_interopRequireDefault(_SchemaReducer),_RecordsReducer=require("state/records/RecordsReducer"),_RecordsReducer2=_interopRequireDefault(_RecordsReducer),_CampaignReducer=require("state/campaign/CampaignReducer"),_CampaignReducer2=_interopRequireDefault(_CampaignReducer),_index=require("containers/CampaignAdmin/index");_interopRequireDefault(_index);(0,_jQuery2["default"])("body").entwine({onadd:function(){return appBoot()}})},{"containers/CampaignAdmin/index":10,jQuery:"jQuery","lib/ReducerRegister":"lib/ReducerRegister",redux:"redux","redux-logger":34,"redux-thunk":"redux-thunk","state/campaign/CampaignReducer":14,"state/config/ConfigActions":16,"state/config/ConfigReducer":17,"state/form/FormReducer":19,"state/records/RecordsReducer":22,"state/schema/SchemaReducer":24}],2:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),Accordion=function(_SilverStripeComponen){function Accordion(){return _classCallCheck(this,Accordion),_possibleConstructorReturn(this,_SilverStripeComponen.apply(this,arguments))}return _inherits(Accordion,_SilverStripeComponen),Accordion.prototype.render=function(){return _react2["default"].createElement("div",{role:"tablist","aria-multiselectable":"true"},this.props.children)},Accordion}(_SilverStripeComponent2["default"]);exports["default"]=Accordion},{"lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],3:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent);require("bootstrap-collapse");var AccordionGroup=function(_SilverStripeComponen){function AccordionGroup(){return _classCallCheck(this,AccordionGroup),_possibleConstructorReturn(this,_SilverStripeComponen.apply(this,arguments))}return _inherits(AccordionGroup,_SilverStripeComponen),AccordionGroup.prototype.render=function(){var headerID=this.props.groupid+"_Header",listID=this.props.groupid+"_Items",href="#"+listID,groupProps={id:listID,"aria-expanded":!0,className:"list-group list-group-flush collapse in",role:"tabpanel","aria-labelledby":headerID};return _react2["default"].createElement("div",{className:"accordion-group"},_react2["default"].createElement("h6",{className:"accordion-group__title",role:"tab",id:headerID},_react2["default"].createElement("a",{"data-toggle":"collapse",href:href,"aria-expanded":"true","aria-controls":listID},this.props.title)),_react2["default"].createElement("div",groupProps,this.props.children))},AccordionGroup}(_SilverStripeComponent2["default"]);exports["default"]=AccordionGroup},{"bootstrap-collapse":"bootstrap-collapse","lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],4:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),AccordionItem=function(_SilverStripeComponen){function AccordionItem(){return _classCallCheck(this,AccordionItem),_possibleConstructorReturn(this,_SilverStripeComponen.apply(this,arguments))}return _inherits(AccordionItem,_SilverStripeComponen),AccordionItem.prototype.render=function(){var className="list-group-item "+this.props.className;return _react2["default"].createElement("a",{tabIndex:"0",className:className},this.props.children)},AccordionItem}(_SilverStripeComponent2["default"]);exports["default"]=AccordionItem},{"lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],5:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),Breadcrumb=function(_SilverStripeComponen){function Breadcrumb(){return _classCallCheck(this,Breadcrumb),_possibleConstructorReturn(this,_SilverStripeComponen.apply(this,arguments))}return _inherits(Breadcrumb,_SilverStripeComponen),Breadcrumb.prototype.render=function(){return _react2["default"].createElement("ol",{className:"breadcrumb"},this.getBreadcrumbs())},Breadcrumb.prototype.getBreadcrumbs=function(){return"undefined"==typeof this.props.crumbs?null:[].concat(this.props.crumbs.slice(0,-1).map(function(crumb,index){return[_react2["default"].createElement("li",{className:"breadcrumb__item"},_react2["default"].createElement("a",{key:index,className:"breadcrumb__item-title",href:crumb.href},crumb.text))]}),this.props.crumbs.slice(-1).map(function(crumb,index){return[_react2["default"].createElement("li",{className:"breadcrumb__item breadcrumb__item--last"},_react2["default"].createElement("h2",{className:"breadcrumb__item-title breadcrumb__item-title--last",key:index},crumb.text))]}))},Breadcrumb}(_SilverStripeComponent2["default"]);Breadcrumb.propTypes={crumbs:_react2["default"].PropTypes.array},exports["default"]=Breadcrumb},{"lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],6:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),Preview=function(_SilverStripeComponen){function Preview(){return _classCallCheck(this,Preview),_possibleConstructorReturn(this,_SilverStripeComponen.apply(this,arguments))}return _inherits(Preview,_SilverStripeComponen),Preview.prototype.render=function(){return _react2["default"].createElement("div",{className:"cms-content__right preview"},_react2["default"].createElement("iframe",{className:"preview__iframe",src:this.props.previewUrl}),_react2["default"].createElement("div",{className:"preview__overlay"},_react2["default"].createElement("h3",{className:"preview__overlay-text"},"There is no preview available for this item.")),_react2["default"].createElement("div",{className:"preview__file-container panel-scrollable"},_react2["default"].createElement("img",{className:"preview__file--fits-space",src:"http://placehold.it/250x150"})),_react2["default"].createElement("a",{href:"",className:"cms-content__back-btn font-icon-left-open-big"}),_react2["default"].createElement("div",{className:"toolbar--south"},_react2["default"].createElement("div",{className:"btn-toolbar"},_react2["default"].createElement("button",{className:"btn btn-secondary btn-secondary",type:"button"},_react2["default"].createElement("i",{className:"font-icon-edit"})," Edit"),_react2["default"].createElement("button",{type:"button","data-container":"body",className:"btn btn-link btn--options","data-toggle":"popover",title:"Page actions","data-placement":"top","data-content":"<a href=''>Add to campaign</a><a href=''>Remove from campaign</a>"},_react2["default"].createElement("i",{className:"font-icon-dot-3"})))))},Preview}(_SilverStripeComponent2["default"]);exports["default"]=Preview},{"lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],7:[function(require,module,exports){"use strict";function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj["default"]=obj,newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}function mapStateToProps(state,ownProps){return{config:state.config,sectionConfig:state.config.sections[ownProps.sectionConfigKey],campaignId:state.campaign.campaignId,view:state.campaign.view}}function mapDispatchToProps(dispatch){return{actions:(0,_redux.bindActionCreators)(actions,dispatch)}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_react=require("react"),_react2=_interopRequireDefault(_react),_redux=require("redux"),_reactRedux=require("react-redux"),_Backend=require("lib/Backend"),_Backend2=_interopRequireDefault(_Backend),_CampaignActions=require("state/campaign/CampaignActions"),actions=_interopRequireWildcard(_CampaignActions),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),_FormAction=require("components/FormAction/FormAction"),_FormAction2=_interopRequireDefault(_FormAction),_i18n=require("i18n"),_i18n2=_interopRequireDefault(_i18n),_Toolbar=require("components/Toolbar/Toolbar"),_Toolbar2=_interopRequireDefault(_Toolbar),_FormBuilder=require("components/FormBuilder/FormBuilder"),_FormBuilder2=_interopRequireDefault(_FormBuilder),_CampaignAdminList=require("./CampaignAdminList"),_CampaignAdminList2=_interopRequireDefault(_CampaignAdminList),CampaignAdmin=function(_SilverStripeComponen){function CampaignAdmin(props){_classCallCheck(this,CampaignAdmin);var _this=_possibleConstructorReturn(this,_SilverStripeComponen.call(this,props));return _this.addCampaign=_this.addCampaign.bind(_this),_this.publishApi=_Backend2["default"].createEndpointFetcher({url:_this.props.sectionConfig.publishEndpoint.url,method:_this.props.sectionConfig.publishEndpoint.method,defaultData:{SecurityID:_this.props.config.SecurityID},payloadSchema:{id:{urlReplacement:":id",remove:!0}}}),_this.campaignListCreateFn=_this.campaignListCreateFn.bind(_this),_this.campaignAddCreateFn=_this.campaignAddCreateFn.bind(_this),_this.campaignEditCreateFn=_this.campaignEditCreateFn.bind(_this),_this}return _inherits(CampaignAdmin,_SilverStripeComponen),CampaignAdmin.prototype.componentDidMount=function(){var _this2=this;_SilverStripeComponen.prototype.componentDidMount.call(this);var captureRoute=!0,route=window.ss.router.resolveURLToBase(this.props.sectionConfig.campaignViewRoute);window.ss.router(route,function(ctx,next){captureRoute?_this2.props.actions.showCampaignView(ctx.params.id,ctx.params.view):next()}),window.ss.router.exit(route,function(ctx,next){var applies=window.ss.router.routeAppliesToCurrentLocation(route);applies||(captureRoute=!1),next()})},CampaignAdmin.prototype.render=function(){var view=null;switch(this.props.view){case"show":view=this.renderItemListView();break;case"edit":view=this.renderDetailEditView();break;case"create":view=this.renderCreateView();break;default:view=this.renderIndexView()}return view},CampaignAdmin.prototype.renderIndexView=function(){var schemaUrl=this.props.sectionConfig.form.EditForm.schemaUrl,formActionProps={label:_i18n2["default"]._t("Campaigns.ADDCAMPAIGN"),icon:"plus",handleClick:this.addCampaign},formBuilderProps={createFn:this.campaignListCreateFn,schemaUrl:schemaUrl};return _react2["default"].createElement("div",{className:"cms-content__inner no-preview"},_react2["default"].createElement("div",{className:"cms-content__left cms-campaigns collapse in","aria-expanded":"true"},_react2["default"].createElement(_Toolbar2["default"],null,_react2["default"].createElement("div",{className:"breadcrumb breadcrumb--current-only"},_react2["default"].createElement("h2",{className:"breadcrumb__item-title breadcrumb__item-title--last"},"Campaigns"))),_react2["default"].createElement("div",{className:"panel-scrollable--single-toolbar"},_react2["default"].createElement("div",{className:"toolbar--content"},_react2["default"].createElement("div",{className:"btn-toolbar"},_react2["default"].createElement(_FormAction2["default"],formActionProps))),_react2["default"].createElement(_FormBuilder2["default"],formBuilderProps))))},CampaignAdmin.prototype.renderItemListView=function(){var props={campaignId:this.props.campaignId,itemListViewEndpoint:this.props.sectionConfig.itemListViewEndpoint,publishApi:this.publishApi,breadcrumbs:this.getBreadcrumbs()};return _react2["default"].createElement(_CampaignAdminList2["default"],props)},CampaignAdmin.prototype.renderDetailEditView=function(){var baseSchemaUrl=this.props.sectionConfig.form.DetailEditForm.schemaUrl,formBuilderProps={createFn:this.campaignEditCreateFn,schemaUrl:baseSchemaUrl+"/ChangeSet/"+this.props.campaignId};return _react2["default"].createElement("div",{className:"cms-middle no-preview"},_react2["default"].createElement("div",{className:"cms-campaigns collapse in","aria-expanded":"true"},_react2["default"].createElement(_Toolbar2["default"],{showBackButton:!0},_react2["default"].createElement("div",{className:"breadcrumb breadcrumb--current-only"},_react2["default"].createElement("h2",{className:"text-truncate breadcrumb__item-title--last"},"Campaigns"))),_react2["default"].createElement(_FormBuilder2["default"],formBuilderProps)))},CampaignAdmin.prototype.renderCreateView=function(){var baseSchemaUrl=this.props.sectionConfig.form.DetailEditForm.schemaUrl,formBuilderProps={createFn:this.campaignAddCreateFn,schemaUrl:baseSchemaUrl+"/ChangeSet"};return _react2["default"].createElement("div",{className:"cms-middle no-preview"},_react2["default"].createElement("div",{className:"cms-campaigns collapse in","aria-expanded":"true"},_react2["default"].createElement(_Toolbar2["default"],{showBackButton:!0},_react2["default"].createElement("div",{className:"breadcrumb breadcrumb--current-only"},_react2["default"].createElement("h2",{className:"text-truncate breadcrumb__item-title--last"},"Campaigns"))),_react2["default"].createElement("div",{className:"cms-middle__scrollable"},_react2["default"].createElement(_FormBuilder2["default"],formBuilderProps))))},CampaignAdmin.prototype.campaignEditCreateFn=function(Component,props){var indexRoute=this.props.sectionConfig.route;if("action_cancel"===props.name){var extendedProps=_extends({},props,{handleClick:function(event){event.preventDefault(),window.ss.router.show(indexRoute)}});return _react2["default"].createElement(Component,_extends({key:props.name},extendedProps))}return _react2["default"].createElement(Component,_extends({key:props.name},props))},CampaignAdmin.prototype.campaignAddCreateFn=function(Component,props){var indexRoute=this.props.sectionConfig.route;if("action_cancel"===props.name){var extendedProps=_extends({},props,{handleClick:function(event){event.preventDefault(),window.ss.router.show(indexRoute)}});return _react2["default"].createElement(Component,_extends({key:props.name},extendedProps))}return _react2["default"].createElement(Component,_extends({key:props.name},props))},CampaignAdmin.prototype.campaignListCreateFn=function(Component,props){var campaignViewRoute=this.props.sectionConfig.campaignViewRoute,typeUrlParam="set";if("GridField"===props.component){var extendedProps=_extends({},props,{data:_extends({},props.data,{handleDrillDown:function(event,record){var path=campaignViewRoute.replace(/:type\?/,typeUrlParam).replace(/:id\?/,record.ID).replace(/:view\?/,"show");window.ss.router.show(path)},handleEditRecord:function(event,id){var path=campaignViewRoute.replace(/:type\?/,typeUrlParam).replace(/:id\?/,id).replace(/:view\?/,"edit");window.ss.router.show(path)}})});return _react2["default"].createElement(Component,_extends({key:extendedProps.name},extendedProps))}return _react2["default"].createElement(Component,_extends({key:props.name},props))},CampaignAdmin.prototype.getBreadcrumbs=function(){return[{text:"Campaigns",href:"admin/campaigns"},{text:"March release",href:"admin/campaigns/show/1"}]},CampaignAdmin.prototype.previewURLForItem=function(id){return id?document.getElementsByTagName("base")[0].href:""},CampaignAdmin.prototype.addCampaign=function(){var path=this.props.sectionConfig.campaignViewRoute.replace(/:type\?/,"set").replace(/:id\?/,0).replace(/:view\?/,"create");window.ss.router.show(path)},CampaignAdmin}(_SilverStripeComponent2["default"]);CampaignAdmin.propTypes={actions:_react2["default"].PropTypes.object.isRequired,campaignId:_react2["default"].PropTypes.string,config:_react2["default"].PropTypes.shape({form:_react2["default"].PropTypes.shape({editForm:_react2["default"].PropTypes.shape({schemaUrl:_react2["default"].PropTypes.string})}),SecurityID:_react2["default"].PropTypes.string}),sectionConfig:_react2["default"].PropTypes.object.isRequired,sectionConfigKey:_react2["default"].PropTypes.string.isRequired,view:_react2["default"].PropTypes.string},exports["default"]=(0,_reactRedux.connect)(mapStateToProps,mapDispatchToProps)(CampaignAdmin)},{"./CampaignAdminList":9,"components/FormAction/FormAction":"components/FormAction/FormAction","components/FormBuilder/FormBuilder":"components/FormBuilder/FormBuilder","components/Toolbar/Toolbar":"components/Toolbar/Toolbar",i18n:"i18n","lib/Backend":"lib/Backend","lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react","react-redux":"react-redux",redux:"redux","state/campaign/CampaignActions":13}],8:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),_i18n=require("i18n"),_i18n2=_interopRequireDefault(_i18n),CampaignAdminItem=function(_SilverStripeComponen){function CampaignAdminItem(){return _classCallCheck(this,CampaignAdminItem),_possibleConstructorReturn(this,_SilverStripeComponen.apply(this,arguments))}return _inherits(CampaignAdminItem,_SilverStripeComponen),CampaignAdminItem.prototype.render=function(){var thumbnail=null,badge={},item=this.props.item,campaign=this.props.campaign;if("open"===campaign.State)switch(item.ChangeType){case"created":badge.className="label label-warning list-group-item__status",badge.Title=_i18n2["default"]._t("CampaignItem.DRAFT","Draft");break;case"modified":badge.className="label label-warning list-group-item__status",badge.Title=_i18n2["default"]._t("CampaignItem.MODIFIED","Modified");break;case"deleted":badge.className="label label-error list-group-item__status",badge.Title=_i18n2["default"]._t("CampaignItem.REMOVED","Removed");break;case"none":default:badge.className="label label-success list-group-item__status",badge.Title=_i18n2["default"]._t("CampaignItem.NO_CHANGES","No changes")}var links=_react2["default"].createElement("span",{className:"list-group-item--has-links"},_react2["default"].createElement("i",{className:"font-icon-link"}),"3 linked items");return item.Thumbnail&&(thumbnail=_react2["default"].createElement("span",{className:"list-group-item__thumbnail"},_react2["default"].createElement("img",{src:item.Thumbnail}))),_react2["default"].createElement("div",null,thumbnail,_react2["default"].createElement("h4",{className:"list-group-item__heading"},item.Title),_react2["default"].createElement("span",{className:"list-group-item--is-linked"},_react2["default"].createElement("i",{className:"font-icon-link"})),links,badge.className&&badge.Title&&_react2["default"].createElement("span",{className:badge.className},badge.Title))},CampaignAdminItem}(_SilverStripeComponent2["default"]);CampaignAdminItem.propTypes={campaign:_react2["default"].PropTypes.object.isRequired,item:_react2["default"].PropTypes.object.isRequired},exports["default"]=CampaignAdminItem},{i18n:"i18n","lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],9:[function(require,module,exports){"use strict";function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj["default"]=obj,newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}function mapStateToProps(state,ownProps){var record=null;return state.records&&state.records.ChangeSet&&ownProps.campaignId&&(record=state.records.ChangeSet[parseInt(ownProps.campaignId,10)]),{record:record||{},campaign:state.campaign}}function mapDispatchToProps(dispatch){return{recordActions:(0,_redux.bindActionCreators)(recordActions,dispatch),campaignActions:(0,_redux.bindActionCreators)(campaignActions,dispatch)}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){
var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_react=require("react"),_react2=_interopRequireDefault(_react),_redux=require("redux"),_reactRedux=require("react-redux"),_RecordsActions=require("state/records/RecordsActions"),recordActions=_interopRequireWildcard(_RecordsActions),_CampaignActions=require("state/campaign/CampaignActions"),campaignActions=_interopRequireWildcard(_CampaignActions),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),_Accordion=require("components/Accordion/Accordion"),_Accordion2=_interopRequireDefault(_Accordion),_AccordionGroup=require("components/Accordion/AccordionGroup"),_AccordionGroup2=_interopRequireDefault(_AccordionGroup),_AccordionItem=require("components/Accordion/AccordionItem"),_AccordionItem2=_interopRequireDefault(_AccordionItem),_Toolbar=require("components/Toolbar/Toolbar"),_Toolbar2=_interopRequireDefault(_Toolbar),_FormAction=require("components/FormAction/FormAction"),_FormAction2=_interopRequireDefault(_FormAction),_CampaignAdminItem=require("./CampaignAdminItem"),_CampaignAdminItem2=_interopRequireDefault(_CampaignAdminItem),_Breadcrumb=require("components/Breadcrumb/Breadcrumb"),_Breadcrumb2=_interopRequireDefault(_Breadcrumb),_Preview=require("components/Preview/Preview"),_Preview2=_interopRequireDefault(_Preview),_i18n=require("i18n"),_i18n2=_interopRequireDefault(_i18n),CampaignAdminList=function(_SilverStripeComponen){function CampaignAdminList(props){_classCallCheck(this,CampaignAdminList);var _this=_possibleConstructorReturn(this,_SilverStripeComponen.call(this,props));return _this.handlePublish=_this.handlePublish.bind(_this),_this}return _inherits(CampaignAdminList,_SilverStripeComponen),CampaignAdminList.prototype.componentDidMount=function(){var fetchURL=this.props.itemListViewEndpoint.replace(/:id/,this.props.campaignId);_SilverStripeComponen.prototype.componentDidMount.call(this),this.props.recordActions.fetchRecord("ChangeSet","get",fetchURL)},CampaignAdminList.prototype.render=function(){var _this2=this,itemID=1,campaignId=this.props.campaignId,campaign=this.props.record,previewUrl=this.previewURLForItem(itemID),itemGroups=this.groupItemsForSet(),classNames=previewUrl?"cms-content__split cms-content__split--left-sm":"cms-content__split cms-content__split--none",accordionGroups=[];return Object.keys(itemGroups).forEach(function(className){var group=itemGroups[className],groupCount=group.items.length,accordionItems=[],title=groupCount+" "+(1===groupCount?group.singular:group.plural),groupid="Set_"+campaignId+"_Group_"+className;group.items.forEach(function(item){var itemClassName="";"none"!==item.ChangeType&&"published"!==campaign.State||(itemClassName="list-group-item--published"),accordionItems.push(_react2["default"].createElement(_AccordionItem2["default"],{key:item.ID,className:itemClassName},_react2["default"].createElement(_CampaignAdminItem2["default"],{item:item,campaign:_this2.props.record})))}),accordionGroups.push(_react2["default"].createElement(_AccordionGroup2["default"],{key:groupid,groupid:groupid,title:title},accordionItems))}),_react2["default"].createElement("div",{className:classNames},_react2["default"].createElement("div",{className:"cms-content__left collapse in","aria-expanded":"true"},_react2["default"].createElement(_Toolbar2["default"],null,_react2["default"].createElement(_Breadcrumb2["default"],{crumbs:this.props.breadcrumbs,multiline:!0})),_react2["default"].createElement("div",{className:"container-fluid campaign-items panel-scrollable--double-toolbar"},_react2["default"].createElement(_Accordion2["default"],null,accordionGroups)),_react2["default"].createElement("div",{className:"toolbar--south"},this.renderButtonToolbar())),previewUrl&&_react2["default"].createElement(_Preview2["default"],{previewUrl:previewUrl}))},CampaignAdminList.prototype.renderButtonToolbar=function(){var items=this.getItems();if(!items)return _react2["default"].createElement("div",{className:"btn-toolbar"});var actionProps={};return"open"===this.props.record.State?actionProps=_extends(actionProps,{label:_i18n2["default"]._t("Campaigns.PUBLISHCAMPAIGN"),bootstrapButtonStyle:"success",loading:this.props.campaign.isPublishing,handleClick:this.handlePublish,icon:"rocket"}):"published"===this.props.record.State&&(actionProps=_extends(actionProps,{label:_i18n2["default"]._t("Campaigns.REVERTCAMPAIGN"),bootstrapButtonStyle:"default",icon:"back-in-time",disabled:!0})),_react2["default"].createElement("div",{className:"btn-toolbar"},_react2["default"].createElement(_FormAction2["default"],actionProps))},CampaignAdminList.prototype.previewURLForItem=function(id){return id?document.getElementsByTagName("base")[0].href:""},CampaignAdminList.prototype.getItems=function(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.ChangeSetItems:null},CampaignAdminList.prototype.groupItemsForSet=function(){var groups={},items=this.getItems();return items?(items.forEach(function(item){var classname=item.BaseClass;groups[classname]||(groups[classname]={singular:item.Singular,plural:item.Plural,items:[]}),groups[classname].items.push(item)}),groups):groups},CampaignAdminList.prototype.handlePublish=function(e){e.preventDefault(),this.props.campaignActions.publishCampaign(this.props.publishApi,this.props.campaignId)},CampaignAdminList}(_SilverStripeComponent2["default"]);CampaignAdminList.propTypes={campaign:_react2["default"].PropTypes.shape({isPublishing:_react2["default"].PropTypes.bool.isRequired}),campaignActions:_react2["default"].PropTypes.object.isRequired,publishApi:_react2["default"].PropTypes.func.isRequired,record:_react2["default"].PropTypes.object.isRequired,recordActions:_react2["default"].PropTypes.object.isRequired},exports["default"]=(0,_reactRedux.connect)(mapStateToProps,mapDispatchToProps)(CampaignAdminList)},{"./CampaignAdminItem":8,"components/Accordion/Accordion":2,"components/Accordion/AccordionGroup":3,"components/Accordion/AccordionItem":4,"components/Breadcrumb/Breadcrumb":5,"components/FormAction/FormAction":"components/FormAction/FormAction","components/Preview/Preview":6,"components/Toolbar/Toolbar":"components/Toolbar/Toolbar",i18n:"i18n","lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react","react-redux":"react-redux",redux:"redux","state/campaign/CampaignActions":13,"state/records/RecordsActions":21}],10:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _jQuery=require("jQuery"),_jQuery2=_interopRequireDefault(_jQuery),_react=require("react"),_react2=_interopRequireDefault(_react),_reactDom=require("react-dom"),_reactDom2=_interopRequireDefault(_reactDom),_reactRedux=require("react-redux"),_CampaignAdmin=require("./CampaignAdmin"),_CampaignAdmin2=_interopRequireDefault(_CampaignAdmin);_jQuery2["default"].entwine("ss",function($){$(".cms-content.CampaignAdmin").entwine({onadd:function(){_reactDom2["default"].render(_react2["default"].createElement(_reactRedux.Provider,{store:window.store},_react2["default"].createElement(_CampaignAdmin2["default"],{sectionConfigKey:"CampaignAdmin"})),this[0])},onremove:function(){_reactDom2["default"].unmountComponentAtNode(this[0])}})})},{"./CampaignAdmin":7,jQuery:"jQuery",react:"react","react-dom":"react-dom","react-redux":"react-redux"}],11:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function checkStatus(response){var ret=void 0,error=void 0;if(!(response.status>=200&&response.status<300))throw error=new Error(response.statusText),error.response=response,error;return ret=response}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_isomorphicFetch=require("isomorphic-fetch"),_isomorphicFetch2=_interopRequireDefault(_isomorphicFetch),_es6Promise=require("es6-promise"),_es6Promise2=_interopRequireDefault(_es6Promise),_qs=require("qs"),_qs2=_interopRequireDefault(_qs),_merge=require("merge"),_merge2=_interopRequireDefault(_merge);_es6Promise2["default"].polyfill();var Backend=function(){function Backend(){_classCallCheck(this,Backend),this.fetch=_isomorphicFetch2["default"]}return Backend.prototype.createEndpointFetcher=function(endpointSpec){function encode(contentType,data){switch(contentType){case"application/x-www-form-urlencoded":return _qs2["default"].stringify(data);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.stringify(data);default:throw new Error("Can't encode format: "+contentType)}}function decode(contentType,text){switch(contentType){case"application/x-www-form-urlencoded":return _qs2["default"].parse(text);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.parse(text);default:throw new Error("Can't decode format: "+contentType)}}function addQuerystring(url,querystring){return""===querystring?url:url.match(/\?/)?url+"&"+querystring:url+"?"+querystring}function parseResponse(response){return response.text().then(function(body){return decode(response.headers.get("Content-Type"),body)})}function applySchemaToData(payloadSchema,data){return Object.keys(data).reduce(function(prev,key){var schema=payloadSchema[key];return!schema||schema.remove!==!0&&schema.querystring!==!0?_extends(prev,_defineProperty({},key,data[key])):prev},{})}function applySchemaToUrl(payloadSchema,url,data){var opts=arguments.length<=3||void 0===arguments[3]?{setFromData:!1}:arguments[3],newUrl=url,queryData=Object.keys(data).reduce(function(prev,key){var schema=payloadSchema[key],includeThroughSetFromData=opts.setFromData===!0&&!(schema&&schema.remove===!0),includeThroughSpec=schema&&schema.querystring===!0&&schema.remove!==!0;return includeThroughSetFromData||includeThroughSpec?_extends(prev,_defineProperty({},key,data[key])):prev},{});return newUrl=addQuerystring(newUrl,encode("application/x-www-form-urlencoded",queryData)),newUrl=Object.keys(payloadSchema).reduce(function(prev,key){var replacement=payloadSchema[key].urlReplacement;return replacement?prev.replace(replacement,data[key]):prev},newUrl)}var _this=this,refinedSpec=_extends({method:"get",payloadFormat:"application/x-www-form-urlencoded",responseFormat:"application/json",payloadSchema:{},defaultData:{}},endpointSpec),formatShortcuts={json:"application/json",urlencoded:"application/x-www-form-urlencoded"};return["payloadFormat","responseFormat"].forEach(function(key){formatShortcuts[refinedSpec[key]]&&(refinedSpec[key]=formatShortcuts[refinedSpec[key]])}),function(){var data=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],headers=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],mergedHeaders=_extends({},headers,{Accept:refinedSpec.responseFormat,"Content-Type":refinedSpec.payloadFormat}),mergedData=_merge2["default"].recursive({},refinedSpec.defaultData,data),url=applySchemaToUrl(refinedSpec.payloadSchema,refinedSpec.url,mergedData,{setFromData:"get"===refinedSpec.method.toLowerCase()}),encodedData=encode(refinedSpec.payloadFormat,applySchemaToData(refinedSpec.payloadSchema,mergedData)),args="get"===refinedSpec.method.toLowerCase()?[url,mergedHeaders]:[url,encodedData,mergedHeaders];return _this[refinedSpec.method.toLowerCase()].apply(_this,args).then(parseResponse)}},Backend.prototype.get=function(url){var headers=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return this.fetch(url,{method:"get",credentials:"same-origin",headers:headers}).then(checkStatus)},Backend.prototype.post=function(url){var data=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],headers=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],defaultHeaders={"Content-Type":"application/x-www-form-urlencoded"};return this.fetch(url,{method:"post",headers:_extends({},defaultHeaders,headers),credentials:"same-origin",body:data}).then(checkStatus)},Backend.prototype.put=function(url){var data=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],headers=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(url,{method:"put",credentials:"same-origin",body:data,headers:headers}).then(checkStatus)},Backend.prototype["delete"]=function(url){var data=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],headers=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(url,{method:"delete",credentials:"same-origin",body:data,headers:headers}).then(checkStatus)},Backend}(),backend=new Backend;exports["default"]=backend},{"es6-promise":26,"isomorphic-fetch":27,merge:29,qs:30}],12:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]={SET_CAMPAIGN_ACTIVE_CHANGESET:"SET_CAMPAIGN_ACTIVE_CHANGESET",PUBLISH_CAMPAIGN_REQUEST:"PUBLISH_CAMPAIGN_REQUEST",PUBLISH_CAMPAIGN_SUCCESS:"PUBLISH_CAMPAIGN_SUCCESS",PUBLISH_CAMPAIGN_FAILURE:"PUBLISH_CAMPAIGN_FAILURE"}},{}],13:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function showCampaignView(campaignId,view){return{type:_CampaignActionTypes2["default"].SET_CAMPAIGN_ACTIVE_CHANGESET,payload:{campaignId:campaignId,view:view}}}function publishCampaign(publishApi,campaignId){return function(dispatch){dispatch({type:_CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_REQUEST,payload:{campaignId:campaignId}}),publishApi({id:campaignId}).then(function(data){dispatch({type:_CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_SUCCESS,payload:{campaignId:campaignId}}),dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORD_SUCCESS,payload:{recordType:"ChangeSet",data:data}})})["catch"](function(error){dispatch({type:_CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_FAILURE,payload:{error:error}})})}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.showCampaignView=showCampaignView,exports.publishCampaign=publishCampaign;var _CampaignActionTypes=require("./CampaignActionTypes"),_CampaignActionTypes2=_interopRequireDefault(_CampaignActionTypes),_RecordsActionTypes=require("state/records/RecordsActionTypes"),_RecordsActionTypes2=_interopRequireDefault(_RecordsActionTypes)},{"./CampaignActionTypes":12,"state/records/RecordsActionTypes":20}],14:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function reducer(){var state=arguments.length<=0||void 0===arguments[0]?initialState:arguments[0],action=arguments[1];switch(action.type){case _CampaignActionTypes2["default"].SET_CAMPAIGN_ACTIVE_CHANGESET:return(0,_deepFreeze2["default"])(_extends({},state,{campaignId:action.payload.campaignId,view:action.payload.view}));case _CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_REQUEST:return(0,_deepFreeze2["default"])(_extends({},state,{isPublishing:!0}));case _CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_SUCCESS:case _CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_FAILURE:return(0,_deepFreeze2["default"])(_extends({},state,{isPublishing:!1}));default:return state}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_deepFreeze=require("deep-freeze"),_deepFreeze2=_interopRequireDefault(_deepFreeze),_CampaignActionTypes=require("./CampaignActionTypes"),_CampaignActionTypes2=_interopRequireDefault(_CampaignActionTypes),initialState=(0,_deepFreeze2["default"])({campaignId:null,isPublishing:!1,view:null});exports["default"]=reducer},{"./CampaignActionTypes":12,"deep-freeze":"deep-freeze"}],15:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]={SET_CONFIG:"SET_CONFIG"}},{}],16:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function setConfig(config){return{type:_ConfigActionTypes2["default"].SET_CONFIG,payload:{config:config}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.setConfig=setConfig;var _ConfigActionTypes=require("./ConfigActionTypes"),_ConfigActionTypes2=_interopRequireDefault(_ConfigActionTypes)},{"./ConfigActionTypes":15}],17:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function configReducer(){var state=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],action=arguments[1];switch(action.type){case _ConfigActionTypes2["default"].SET_CONFIG:return(0,_deepFreeze2["default"])(_extends({},state,action.payload.config));default:return state}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_deepFreeze=require("deep-freeze"),_deepFreeze2=_interopRequireDefault(_deepFreeze),_ConfigActionTypes=require("./ConfigActionTypes"),_ConfigActionTypes2=_interopRequireDefault(_ConfigActionTypes);exports["default"]=configReducer},{"./ConfigActionTypes":15,"deep-freeze":"deep-freeze"}],18:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.ACTION_TYPES={ADD_FORM:"ADD_FORM",REMOVE_FORM:"REMOVE_FORM",SUBMIT_FORM_FAILURE:"SUBMIT_FORM_FAILURE",SUBMIT_FORM_REQUEST:"SUBMIT_FORM_REQUEST",SUBMIT_FORM_SUCCESS:"SUBMIT_FORM_SUCCESS",UPDATE_FIELD:"UPDATE_FIELD"}},{}],19:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function formReducer(){var state=arguments.length<=0||void 0===arguments[0]?initialState:arguments[0],action=arguments[1];switch(action.type){case _FormActionTypes.ACTION_TYPES.SUBMIT_FORM_REQUEST:return(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},action.payload.formId,{submitting:!0})));case _FormActionTypes.ACTION_TYPES.REMOVE_FORM:return(0,_deepFreeze2["default"])(Object.keys(state).reduce(function(previous,current){return current===action.payload.formId?previous:_extends({},previous,_defineProperty({},current,state[current]))},{}));case _FormActionTypes.ACTION_TYPES.ADD_FORM:return(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},action.payload.formState.id,{fields:action.payload.formState.fields,submitting:!1})));case _FormActionTypes.ACTION_TYPES.UPDATE_FIELD:return(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},action.payload.formId,_extends({},state[action.payload.formId],{fields:state[action.payload.formId].fields.map(function(field){return field.id===action.payload.updates.id?_extends({},field,action.payload.updates):field})}))));case _FormActionTypes.ACTION_TYPES.SUBMIT_FORM_SUCCESS:return(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},action.payload.response.id,{fields:action.payload.response.state.fields,messages:action.payload.response.state.messages,submitting:!1})));case _FormActionTypes.ACTION_TYPES.SUBMIT_FORM_FAILURE:return(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},action.payload.formId,{submitting:!1})));default:return state}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_deepFreeze=require("deep-freeze"),_deepFreeze2=_interopRequireDefault(_deepFreeze),_FormActionTypes=require("./FormActionTypes"),initialState=(0,_deepFreeze2["default"])({});exports["default"]=formReducer},{"./FormActionTypes":18,"deep-freeze":"deep-freeze"}],20:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]={CREATE_RECORD:"CREATE_RECORD",UPDATE_RECORD:"UPDATE_RECORD",DELETE_RECORD:"DELETE_RECORD",FETCH_RECORDS_REQUEST:"FETCH_RECORDS_REQUEST",FETCH_RECORDS_FAILURE:"FETCH_RECORDS_FAILURE",FETCH_RECORDS_SUCCESS:"FETCH_RECORDS_SUCCESS",FETCH_RECORD_REQUEST:"FETCH_RECORD_REQUEST",FETCH_RECORD_FAILURE:"FETCH_RECORD_FAILURE",FETCH_RECORD_SUCCESS:"FETCH_RECORD_SUCCESS",DELETE_RECORD_REQUEST:"DELETE_RECORD_REQUEST",DELETE_RECORD_FAILURE:"DELETE_RECORD_FAILURE",DELETE_RECORD_SUCCESS:"DELETE_RECORD_SUCCESS"}},{}],21:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function populate(str,params){var names=["id"];return names.reduce(function(acc,name){return acc.replace(":"+name,params[name])},str)}function fetchRecords(recordType,method,url){var payload={recordType:recordType},headers={Accept:"text/json"},methodToLowerCase=method.toLowerCase();return function(dispatch){dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORDS_REQUEST,payload:payload});var args="get"===methodToLowerCase?[populate(url,payload),headers]:[populate(url,payload),{},headers];return _Backend2["default"][methodToLowerCase].apply(_Backend2["default"],args).then(function(response){return response.json()}).then(function(json){dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORDS_SUCCESS,payload:{recordType:recordType,data:json}})})["catch"](function(err){dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORDS_FAILURE,payload:{error:err,recordType:recordType}})})}}function fetchRecord(recordType,method,url){var payload={recordType:recordType},headers={Accept:"text/json"},methodToLowerCase=method.toLowerCase();return function(dispatch){dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORD_REQUEST,payload:payload});var args="get"===methodToLowerCase?[populate(url,payload),headers]:[populate(url,payload),{},headers];return _Backend2["default"][methodToLowerCase].apply(_Backend2["default"],args).then(function(response){return response.json()}).then(function(json){dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORD_SUCCESS,payload:{recordType:recordType,data:json}})})["catch"](function(err){dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORD_FAILURE,payload:{error:err,recordType:recordType}})})}}function deleteRecord(recordType,id,method,url){var payload={recordType:recordType,id:id};return function(dispatch){return dispatch({type:_RecordsActionTypes2["default"].DELETE_RECORD_REQUEST,payload:payload}),_Backend2["default"][method.toLowerCase()](populate(url,payload)).then(function(){dispatch({type:_RecordsActionTypes2["default"].DELETE_RECORD_SUCCESS,payload:{recordType:recordType,id:id}})})["catch"](function(err){dispatch({type:_RecordsActionTypes2["default"].DELETE_RECORD_FAILURE,payload:{error:err,recordType:recordType,id:id}})})}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.fetchRecords=fetchRecords,exports.fetchRecord=fetchRecord,exports.deleteRecord=deleteRecord;var _RecordsActionTypes=require("./RecordsActionTypes"),_RecordsActionTypes2=_interopRequireDefault(_RecordsActionTypes),_Backend=require("lib/Backend.js"),_Backend2=_interopRequireDefault(_Backend)},{"./RecordsActionTypes":20,"lib/Backend.js":11}],22:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function recordsReducer(){var state=arguments.length<=0||void 0===arguments[0]?initialState:arguments[0],action=arguments[1],records=void 0,recordType=void 0,record=void 0;switch(action.type){case _RecordsActionTypes2["default"].CREATE_RECORD:return(0,_deepFreeze2["default"])(_extends({},state,{}));case _RecordsActionTypes2["default"].UPDATE_RECORD:return(0,_deepFreeze2["default"])(_extends({},state,{}));case _RecordsActionTypes2["default"].DELETE_RECORD:return(0,_deepFreeze2["default"])(_extends({},state,{}));case _RecordsActionTypes2["default"].FETCH_RECORDS_REQUEST:return state;case _RecordsActionTypes2["default"].FETCH_RECORDS_FAILURE:return state;case _RecordsActionTypes2["default"].FETCH_RECORDS_SUCCESS:return recordType=action.payload.recordType,records=action.payload.data._embedded[recordType+"s"]||{},records=records.reduce(function(prev,val){return _extends({},prev,_defineProperty({},val.ID,val))},{}),(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},recordType,records)));case _RecordsActionTypes2["default"].FETCH_RECORD_REQUEST:return state;case _RecordsActionTypes2["default"].FETCH_RECORD_FAILURE:return state;case _RecordsActionTypes2["default"].FETCH_RECORD_SUCCESS:return recordType=action.payload.recordType,record=action.payload.data,(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},recordType,_extends({},state[recordType],_defineProperty({},record.ID,record)))));case _RecordsActionTypes2["default"].DELETE_RECORD_REQUEST:return state;case _RecordsActionTypes2["default"].DELETE_RECORD_FAILURE:return state;case _RecordsActionTypes2["default"].DELETE_RECORD_SUCCESS:return recordType=action.payload.recordType,records=state[recordType],records=Object.keys(records).reduce(function(result,key){return parseInt(key,10)!==parseInt(action.payload.id,10)?_extends({},result,_defineProperty({},key,records[key])):result},{}),(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},recordType,records)));default:return state}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_deepFreeze=require("deep-freeze"),_deepFreeze2=_interopRequireDefault(_deepFreeze),_RecordsActionTypes=require("./RecordsActionTypes"),_RecordsActionTypes2=_interopRequireDefault(_RecordsActionTypes),initialState={};exports["default"]=recordsReducer},{"./RecordsActionTypes":20,"deep-freeze":"deep-freeze"}],23:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ACTION_TYPES={SET_SCHEMA:"SET_SCHEMA"};exports["default"]=ACTION_TYPES},{}],24:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function schemaReducer(){var state=arguments.length<=0||void 0===arguments[0]?initialState:arguments[0],action=arguments.length<=1||void 0===arguments[1]?null:arguments[1];switch(action.type){case _SchemaActionTypes2["default"].SET_SCHEMA:var id=action.payload.schema.schema_url;return(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},id,action.payload)));default:return state}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target};exports["default"]=schemaReducer;var _deepFreeze=require("deep-freeze"),_deepFreeze2=_interopRequireDefault(_deepFreeze),_SchemaActionTypes=require("./SchemaActionTypes"),_SchemaActionTypes2=_interopRequireDefault(_SchemaActionTypes),initialState=(0,_deepFreeze2["default"])({})},{"./SchemaActionTypes":23,"deep-freeze":"deep-freeze"}],25:[function(require,module,exports){function cleanUpNextTick(){draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue()}function drainQueue(){if(!draining){var timeout=setTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,clearTimeout(timeout)}}function Item(fun,array){this.fun=fun,this.array=array}function noop(){}var currentQueue,process=module.exports={},queue=[],draining=!1,queueIndex=-1;process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args)),1!==queue.length||draining||setTimeout(drainQueue,0)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.binding=function(name){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(dir){throw new Error("process.chdir is not supported")},process.umask=function(){return 0}},{}],26:[function(require,module,exports){(function(process,global){(function(){"use strict";function lib$es6$promise$utils$$objectOrFunction(x){return"function"==typeof x||"object"==typeof x&&null!==x}function lib$es6$promise$utils$$isFunction(x){return"function"==typeof x}function lib$es6$promise$asap$$setScheduler(scheduleFn){lib$es6$promise$asap$$customSchedulerFn=scheduleFn}function lib$es6$promise$asap$$setAsap(asapFn){lib$es6$promise$asap$$asap=asapFn}function lib$es6$promise$asap$$useNextTick(){return function(){process.nextTick(lib$es6$promise$asap$$flush)}}function lib$es6$promise$asap$$useVertxTimer(){return function(){lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush)}}function lib$es6$promise$asap$$useMutationObserver(){var iterations=0,observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush),node=document.createTextNode("");return observer.observe(node,{characterData:!0}),function(){node.data=iterations=++iterations%2}}function lib$es6$promise$asap$$useMessageChannel(){var channel=new MessageChannel;return channel.port1.onmessage=lib$es6$promise$asap$$flush,function(){channel.port2.postMessage(0)}}function lib$es6$promise$asap$$useSetTimeout(){return function(){setTimeout(lib$es6$promise$asap$$flush,1)}}function lib$es6$promise$asap$$flush(){for(var i=0;lib$es6$promise$asap$$len>i;i+=2){var callback=lib$es6$promise$asap$$queue[i],arg=lib$es6$promise$asap$$queue[i+1];callback(arg),lib$es6$promise$asap$$queue[i]=void 0,lib$es6$promise$asap$$queue[i+1]=void 0}lib$es6$promise$asap$$len=0}function lib$es6$promise$asap$$attemptVertx(){try{var r=require,vertx=r("vertx");return lib$es6$promise$asap$$vertxNext=vertx.runOnLoop||vertx.runOnContext,lib$es6$promise$asap$$useVertxTimer()}catch(e){return lib$es6$promise$asap$$useSetTimeout()}}function lib$es6$promise$then$$then(onFulfillment,onRejection){var parent=this,state=parent._state;if(state===lib$es6$promise$$internal$$FULFILLED&&!onFulfillment||state===lib$es6$promise$$internal$$REJECTED&&!onRejection)return this;
var child=new this.constructor(lib$es6$promise$$internal$$noop),result=parent._result;if(state){var callback=arguments[state-1];lib$es6$promise$asap$$asap(function(){lib$es6$promise$$internal$$invokeCallback(state,child,callback,result)})}else lib$es6$promise$$internal$$subscribe(parent,child,onFulfillment,onRejection);return child}function lib$es6$promise$promise$resolve$$resolve(object){var Constructor=this;if(object&&"object"==typeof object&&object.constructor===Constructor)return object;var promise=new Constructor(lib$es6$promise$$internal$$noop);return lib$es6$promise$$internal$$resolve(promise,object),promise}function lib$es6$promise$$internal$$noop(){}function lib$es6$promise$$internal$$selfFulfillment(){return new TypeError("You cannot resolve a promise with itself")}function lib$es6$promise$$internal$$cannotReturnOwn(){return new TypeError("A promises callback cannot return that same promise.")}function lib$es6$promise$$internal$$getThen(promise){try{return promise.then}catch(error){return lib$es6$promise$$internal$$GET_THEN_ERROR.error=error,lib$es6$promise$$internal$$GET_THEN_ERROR}}function lib$es6$promise$$internal$$tryThen(then,value,fulfillmentHandler,rejectionHandler){try{then.call(value,fulfillmentHandler,rejectionHandler)}catch(e){return e}}function lib$es6$promise$$internal$$handleForeignThenable(promise,thenable,then){lib$es6$promise$asap$$asap(function(promise){var sealed=!1,error=lib$es6$promise$$internal$$tryThen(then,thenable,function(value){sealed||(sealed=!0,thenable!==value?lib$es6$promise$$internal$$resolve(promise,value):lib$es6$promise$$internal$$fulfill(promise,value))},function(reason){sealed||(sealed=!0,lib$es6$promise$$internal$$reject(promise,reason))},"Settle: "+(promise._label||" unknown promise"));!sealed&&error&&(sealed=!0,lib$es6$promise$$internal$$reject(promise,error))},promise)}function lib$es6$promise$$internal$$handleOwnThenable(promise,thenable){thenable._state===lib$es6$promise$$internal$$FULFILLED?lib$es6$promise$$internal$$fulfill(promise,thenable._result):thenable._state===lib$es6$promise$$internal$$REJECTED?lib$es6$promise$$internal$$reject(promise,thenable._result):lib$es6$promise$$internal$$subscribe(thenable,void 0,function(value){lib$es6$promise$$internal$$resolve(promise,value)},function(reason){lib$es6$promise$$internal$$reject(promise,reason)})}function lib$es6$promise$$internal$$handleMaybeThenable(promise,maybeThenable,then){maybeThenable.constructor===promise.constructor&&then===lib$es6$promise$then$$default&&constructor.resolve===lib$es6$promise$promise$resolve$$default?lib$es6$promise$$internal$$handleOwnThenable(promise,maybeThenable):then===lib$es6$promise$$internal$$GET_THEN_ERROR?lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$GET_THEN_ERROR.error):void 0===then?lib$es6$promise$$internal$$fulfill(promise,maybeThenable):lib$es6$promise$utils$$isFunction(then)?lib$es6$promise$$internal$$handleForeignThenable(promise,maybeThenable,then):lib$es6$promise$$internal$$fulfill(promise,maybeThenable)}function lib$es6$promise$$internal$$resolve(promise,value){promise===value?lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$selfFulfillment()):lib$es6$promise$utils$$objectOrFunction(value)?lib$es6$promise$$internal$$handleMaybeThenable(promise,value,lib$es6$promise$$internal$$getThen(value)):lib$es6$promise$$internal$$fulfill(promise,value)}function lib$es6$promise$$internal$$publishRejection(promise){promise._onerror&&promise._onerror(promise._result),lib$es6$promise$$internal$$publish(promise)}function lib$es6$promise$$internal$$fulfill(promise,value){promise._state===lib$es6$promise$$internal$$PENDING&&(promise._result=value,promise._state=lib$es6$promise$$internal$$FULFILLED,0!==promise._subscribers.length&&lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish,promise))}function lib$es6$promise$$internal$$reject(promise,reason){promise._state===lib$es6$promise$$internal$$PENDING&&(promise._state=lib$es6$promise$$internal$$REJECTED,promise._result=reason,lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection,promise))}function lib$es6$promise$$internal$$subscribe(parent,child,onFulfillment,onRejection){var subscribers=parent._subscribers,length=subscribers.length;parent._onerror=null,subscribers[length]=child,subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment,subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection,0===length&&parent._state&&lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish,parent)}function lib$es6$promise$$internal$$publish(promise){var subscribers=promise._subscribers,settled=promise._state;if(0!==subscribers.length){for(var child,callback,detail=promise._result,i=0;i<subscribers.length;i+=3)child=subscribers[i],callback=subscribers[i+settled],child?lib$es6$promise$$internal$$invokeCallback(settled,child,callback,detail):callback(detail);promise._subscribers.length=0}}function lib$es6$promise$$internal$$ErrorObject(){this.error=null}function lib$es6$promise$$internal$$tryCatch(callback,detail){try{return callback(detail)}catch(e){return lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e,lib$es6$promise$$internal$$TRY_CATCH_ERROR}}function lib$es6$promise$$internal$$invokeCallback(settled,promise,callback,detail){var value,error,succeeded,failed,hasCallback=lib$es6$promise$utils$$isFunction(callback);if(hasCallback){if(value=lib$es6$promise$$internal$$tryCatch(callback,detail),value===lib$es6$promise$$internal$$TRY_CATCH_ERROR?(failed=!0,error=value.error,value=null):succeeded=!0,promise===value)return void lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$cannotReturnOwn())}else value=detail,succeeded=!0;promise._state!==lib$es6$promise$$internal$$PENDING||(hasCallback&&succeeded?lib$es6$promise$$internal$$resolve(promise,value):failed?lib$es6$promise$$internal$$reject(promise,error):settled===lib$es6$promise$$internal$$FULFILLED?lib$es6$promise$$internal$$fulfill(promise,value):settled===lib$es6$promise$$internal$$REJECTED&&lib$es6$promise$$internal$$reject(promise,value))}function lib$es6$promise$$internal$$initializePromise(promise,resolver){try{resolver(function(value){lib$es6$promise$$internal$$resolve(promise,value)},function(reason){lib$es6$promise$$internal$$reject(promise,reason)})}catch(e){lib$es6$promise$$internal$$reject(promise,e)}}function lib$es6$promise$promise$all$$all(entries){return new lib$es6$promise$enumerator$$default(this,entries).promise}function lib$es6$promise$promise$race$$race(entries){function onFulfillment(value){lib$es6$promise$$internal$$resolve(promise,value)}function onRejection(reason){lib$es6$promise$$internal$$reject(promise,reason)}var Constructor=this,promise=new Constructor(lib$es6$promise$$internal$$noop);if(!lib$es6$promise$utils$$isArray(entries))return lib$es6$promise$$internal$$reject(promise,new TypeError("You must pass an array to race.")),promise;for(var length=entries.length,i=0;promise._state===lib$es6$promise$$internal$$PENDING&&length>i;i++)lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]),void 0,onFulfillment,onRejection);return promise}function lib$es6$promise$promise$reject$$reject(reason){var Constructor=this,promise=new Constructor(lib$es6$promise$$internal$$noop);return lib$es6$promise$$internal$$reject(promise,reason),promise}function lib$es6$promise$promise$$needsResolver(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function lib$es6$promise$promise$$needsNew(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function lib$es6$promise$promise$$Promise(resolver){this._id=lib$es6$promise$promise$$counter++,this._state=void 0,this._result=void 0,this._subscribers=[],lib$es6$promise$$internal$$noop!==resolver&&("function"!=typeof resolver&&lib$es6$promise$promise$$needsResolver(),this instanceof lib$es6$promise$promise$$Promise?lib$es6$promise$$internal$$initializePromise(this,resolver):lib$es6$promise$promise$$needsNew())}function lib$es6$promise$enumerator$$Enumerator(Constructor,input){this._instanceConstructor=Constructor,this.promise=new Constructor(lib$es6$promise$$internal$$noop),Array.isArray(input)?(this._input=input,this.length=input.length,this._remaining=input.length,this._result=new Array(this.length),0===this.length?lib$es6$promise$$internal$$fulfill(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&lib$es6$promise$$internal$$fulfill(this.promise,this._result))):lib$es6$promise$$internal$$reject(this.promise,this._validationError())}function lib$es6$promise$polyfill$$polyfill(){var local;if("undefined"!=typeof global)local=global;else if("undefined"!=typeof self)local=self;else try{local=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var P=local.Promise;P&&"[object Promise]"===Object.prototype.toString.call(P.resolve())&&!P.cast||(local.Promise=lib$es6$promise$promise$$default)}var lib$es6$promise$utils$$_isArray;lib$es6$promise$utils$$_isArray=Array.isArray?Array.isArray:function(x){return"[object Array]"===Object.prototype.toString.call(x)};var lib$es6$promise$asap$$vertxNext,lib$es6$promise$asap$$customSchedulerFn,lib$es6$promise$asap$$scheduleFlush,lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray,lib$es6$promise$asap$$len=0,lib$es6$promise$asap$$asap=function(callback,arg){lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback,lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg,lib$es6$promise$asap$$len+=2,2===lib$es6$promise$asap$$len&&(lib$es6$promise$asap$$customSchedulerFn?lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush):lib$es6$promise$asap$$scheduleFlush())},lib$es6$promise$asap$$browserWindow="undefined"!=typeof window?window:void 0,lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow||{},lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver||lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver,lib$es6$promise$asap$$isNode="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),lib$es6$promise$asap$$isWorker="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,lib$es6$promise$asap$$queue=new Array(1e3);lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$isNode?lib$es6$promise$asap$$useNextTick():lib$es6$promise$asap$$BrowserMutationObserver?lib$es6$promise$asap$$useMutationObserver():lib$es6$promise$asap$$isWorker?lib$es6$promise$asap$$useMessageChannel():void 0===lib$es6$promise$asap$$browserWindow&&"function"==typeof require?lib$es6$promise$asap$$attemptVertx():lib$es6$promise$asap$$useSetTimeout();var lib$es6$promise$then$$default=lib$es6$promise$then$$then,lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve,lib$es6$promise$$internal$$PENDING=void 0,lib$es6$promise$$internal$$FULFILLED=1,lib$es6$promise$$internal$$REJECTED=2,lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject,lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject,lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all,lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race,lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject,lib$es6$promise$promise$$counter=0,lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise;lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default,lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default,lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default,lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default,lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler,lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap,lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap,lib$es6$promise$promise$$Promise.prototype={constructor:lib$es6$promise$promise$$Promise,then:lib$es6$promise$then$$default,"catch":function(onRejection){return this.then(null,onRejection)}};var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator;lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function(){for(var length=this.length,input=this._input,i=0;this._state===lib$es6$promise$$internal$$PENDING&&length>i;i++)this._eachEntry(input[i],i)},lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function(entry,i){var c=this._instanceConstructor,resolve=c.resolve;if(resolve===lib$es6$promise$promise$resolve$$default){var then=lib$es6$promise$$internal$$getThen(entry);if(then===lib$es6$promise$then$$default&&entry._state!==lib$es6$promise$$internal$$PENDING)this._settledAt(entry._state,i,entry._result);else if("function"!=typeof then)this._remaining--,this._result[i]=entry;else if(c===lib$es6$promise$promise$$default){var promise=new c(lib$es6$promise$$internal$$noop);lib$es6$promise$$internal$$handleMaybeThenable(promise,entry,then),this._willSettleAt(promise,i)}else this._willSettleAt(new c(function(resolve){resolve(entry)}),i)}else this._willSettleAt(resolve(entry),i)},lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function(state,i,value){var promise=this.promise;promise._state===lib$es6$promise$$internal$$PENDING&&(this._remaining--,state===lib$es6$promise$$internal$$REJECTED?lib$es6$promise$$internal$$reject(promise,value):this._result[i]=value),0===this._remaining&&lib$es6$promise$$internal$$fulfill(promise,this._result)},lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function(promise,i){var enumerator=this;lib$es6$promise$$internal$$subscribe(promise,void 0,function(value){enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED,i,value)},function(reason){enumerator._settledAt(lib$es6$promise$$internal$$REJECTED,i,reason)})};var lib$es6$promise$polyfill$$default=lib$es6$promise$polyfill$$polyfill,lib$es6$promise$umd$$ES6Promise={Promise:lib$es6$promise$promise$$default,polyfill:lib$es6$promise$polyfill$$default};"function"==typeof define&&define.amd?define(function(){return lib$es6$promise$umd$$ES6Promise}):"undefined"!=typeof module&&module.exports?module.exports=lib$es6$promise$umd$$ES6Promise:"undefined"!=typeof this&&(this.ES6Promise=lib$es6$promise$umd$$ES6Promise),lib$es6$promise$polyfill$$default()}).call(this)}).call(this,require("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:25}],27:[function(require,module,exports){require("whatwg-fetch"),module.exports=self.fetch.bind(self)},{"whatwg-fetch":28}],28:[function(require,module,exports){!function(self){"use strict";function normalizeName(name){if("string"!=typeof name&&(name=String(name)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name))throw new TypeError("Invalid character in header field name");return name.toLowerCase()}function normalizeValue(value){return"string"!=typeof value&&(value=String(value)),value}function Headers(headers){this.map={},headers instanceof Headers?headers.forEach(function(value,name){this.append(name,value)},this):headers&&Object.getOwnPropertyNames(headers).forEach(function(name){this.append(name,headers[name])},this)}function consumed(body){return body.bodyUsed?Promise.reject(new TypeError("Already read")):void(body.bodyUsed=!0)}function fileReaderReady(reader){return new Promise(function(resolve,reject){reader.onload=function(){resolve(reader.result)},reader.onerror=function(){reject(reader.error)}})}function readBlobAsArrayBuffer(blob){var reader=new FileReader;return reader.readAsArrayBuffer(blob),fileReaderReady(reader)}function readBlobAsText(blob){var reader=new FileReader;return reader.readAsText(blob),fileReaderReady(reader)}function Body(){return this.bodyUsed=!1,this._initBody=function(body){if(this._bodyInit=body,"string"==typeof body)this._bodyText=body;else if(support.blob&&Blob.prototype.isPrototypeOf(body))this._bodyBlob=body;else if(support.formData&&FormData.prototype.isPrototypeOf(body))this._bodyFormData=body;else if(body){if(!support.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(body))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof body?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type&&this.headers.set("content-type",this._bodyBlob.type))},support.blob?(this.blob=function(){var rejected=consumed(this);if(rejected)return rejected;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(readBlobAsArrayBuffer)},this.text=function(){var rejected=consumed(this);if(rejected)return rejected;if(this._bodyBlob)return readBlobAsText(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var rejected=consumed(this);return rejected?rejected:Promise.resolve(this._bodyText)},support.formData&&(this.formData=function(){return this.text().then(decode)}),this.json=function(){return this.text().then(JSON.parse)},this}function normalizeMethod(method){var upcased=method.toUpperCase();return methods.indexOf(upcased)>-1?upcased:method}function Request(input,options){options=options||{};var body=options.body;if(Request.prototype.isPrototypeOf(input)){if(input.bodyUsed)throw new TypeError("Already read");this.url=input.url,this.credentials=input.credentials,options.headers||(this.headers=new Headers(input.headers)),this.method=input.method,this.mode=input.mode,body||(body=input._bodyInit,input.bodyUsed=!0)}else this.url=input;if(this.credentials=options.credentials||this.credentials||"omit",!options.headers&&this.headers||(this.headers=new Headers(options.headers)),this.method=normalizeMethod(options.method||this.method||"GET"),this.mode=options.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&body)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(body)}function decode(body){var form=new FormData;return body.trim().split("&").forEach(function(bytes){if(bytes){var split=bytes.split("="),name=split.shift().replace(/\+/g," "),value=split.join("=").replace(/\+/g," ");form.append(decodeURIComponent(name),decodeURIComponent(value))}}),form}function headers(xhr){var head=new Headers,pairs=xhr.getAllResponseHeaders().trim().split("\n");return pairs.forEach(function(header){var split=header.trim().split(":"),key=split.shift().trim(),value=split.join(":").trim();head.append(key,value)}),head}function Response(bodyInit,options){options||(options={}),this.type="default",this.status=options.status,this.ok=this.status>=200&&this.status<300,this.statusText=options.statusText,this.headers=options.headers instanceof Headers?options.headers:new Headers(options.headers),this.url=options.url||"",this._initBody(bodyInit)}if(!self.fetch){Headers.prototype.append=function(name,value){name=normalizeName(name),value=normalizeValue(value);var list=this.map[name];list||(list=[],this.map[name]=list),list.push(value)},Headers.prototype["delete"]=function(name){delete this.map[normalizeName(name)]},Headers.prototype.get=function(name){var values=this.map[normalizeName(name)];return values?values[0]:null},Headers.prototype.getAll=function(name){return this.map[normalizeName(name)]||[]},Headers.prototype.has=function(name){return this.map.hasOwnProperty(normalizeName(name))},Headers.prototype.set=function(name,value){this.map[normalizeName(name)]=[normalizeValue(value)]},Headers.prototype.forEach=function(callback,thisArg){Object.getOwnPropertyNames(this.map).forEach(function(name){this.map[name].forEach(function(value){callback.call(thisArg,value,name,this)},this)},this)};var support={blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self},methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];Request.prototype.clone=function(){return new Request(this)},Body.call(Request.prototype),Body.call(Response.prototype),Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})},Response.error=function(){var response=new Response(null,{status:0,statusText:""});return response.type="error",response};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(url,status){if(-1===redirectStatuses.indexOf(status))throw new RangeError("Invalid status code");return new Response(null,{status:status,headers:{location:url}})},self.Headers=Headers,self.Request=Request,self.Response=Response,self.fetch=function(input,init){return new Promise(function(resolve,reject){function responseURL(){return"responseURL"in xhr?xhr.responseURL:/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())?xhr.getResponseHeader("X-Request-URL"):void 0}var request;request=Request.prototype.isPrototypeOf(input)&&!init?input:new Request(input,init);var xhr=new XMLHttpRequest;xhr.onload=function(){var status=1223===xhr.status?204:xhr.status;if(100>status||status>599)return void reject(new TypeError("Network request failed"));var options={status:status,statusText:xhr.statusText,headers:headers(xhr),url:responseURL()},body="response"in xhr?xhr.response:xhr.responseText;resolve(new Response(body,options))},xhr.onerror=function(){reject(new TypeError("Network request failed"))},xhr.open(request.method,request.url,!0),"include"===request.credentials&&(xhr.withCredentials=!0),"responseType"in xhr&&support.blob&&(xhr.responseType="blob"),request.headers.forEach(function(value,name){xhr.setRequestHeader(name,value)}),xhr.send("undefined"==typeof request._bodyInit?null:request._bodyInit)})},self.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},{}],29:[function(require,module,exports){!function(isNode){function merge_recursive(base,extend){if("object"!==typeOf(base))return extend;for(var key in extend)"object"===typeOf(base[key])&&"object"===typeOf(extend[key])?base[key]=merge_recursive(base[key],extend[key]):base[key]=extend[key];return base}function merge(clone,recursive,argv){var result=argv[0],size=argv.length;(clone||"object"!==typeOf(result))&&(result={});for(var index=0;size>index;++index){var item=argv[index],type=typeOf(item);if("object"===type)for(var key in item){var sitem=clone?Public.clone(item[key]):item[key];recursive?result[key]=merge_recursive(result[key],sitem):result[key]=sitem}}return result}function typeOf(input){return{}.toString.call(input).slice(8,-1).toLowerCase()}var Public=function(clone){return merge(clone===!0,!1,arguments)},publicName="merge";Public.recursive=function(clone){return merge(clone===!0,!0,arguments)},Public.clone=function(input){var index,size,output=input,type=typeOf(input);if("array"===type)for(output=[],size=input.length,index=0;size>index;++index)output[index]=Public.clone(input[index]);else if("object"===type){output={};for(index in input)output[index]=Public.clone(input[index])}return output},isNode?module.exports=Public:window[publicName]=Public}("object"==typeof module&&module&&"object"==typeof module.exports&&module.exports)},{}],30:[function(require,module,exports){"use strict";var Stringify=require("./stringify"),Parse=require("./parse");module.exports={stringify:Stringify,parse:Parse}},{"./parse":31,"./stringify":32}],31:[function(require,module,exports){"use strict";var Utils=require("./utils"),internals={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1,allowDots:!1};internals.parseValues=function(str,options){for(var obj={},parts=str.split(options.delimiter,options.parameterLimit===1/0?void 0:options.parameterLimit),i=0;i<parts.length;++i){var part=parts[i],pos=-1===part.indexOf("]=")?part.indexOf("="):part.indexOf("]=")+1;if(-1===pos)obj[Utils.decode(part)]="",options.strictNullHandling&&(obj[Utils.decode(part)]=null);else{var key=Utils.decode(part.slice(0,pos)),val=Utils.decode(part.slice(pos+1));Object.prototype.hasOwnProperty.call(obj,key)?obj[key]=[].concat(obj[key]).concat(val):obj[key]=val}}return obj},internals.parseObject=function(chain,val,options){if(!chain.length)return val;var obj,root=chain.shift();if("[]"===root)obj=[],obj=obj.concat(internals.parseObject(chain,val,options));else{obj=options.plainObjects?Object.create(null):{};var cleanRoot="["===root[0]&&"]"===root[root.length-1]?root.slice(1,root.length-1):root,index=parseInt(cleanRoot,10);!isNaN(index)&&root!==cleanRoot&&String(index)===cleanRoot&&index>=0&&options.parseArrays&&index<=options.arrayLimit?(obj=[],obj[index]=internals.parseObject(chain,val,options)):obj[cleanRoot]=internals.parseObject(chain,val,options)}return obj},internals.parseKeys=function(givenKey,val,options){if(givenKey){var key=options.allowDots?givenKey.replace(/\.([^\.\[]+)/g,"[$1]"):givenKey,parent=/^([^\[\]]*)/,child=/(\[[^\[\]]*\])/g,segment=parent.exec(key),keys=[];if(segment[1]){if(!options.plainObjects&&Object.prototype.hasOwnProperty(segment[1])&&!options.allowPrototypes)return;keys.push(segment[1])}for(var i=0;null!==(segment=child.exec(key))&&i<options.depth;)i+=1,(options.plainObjects||!Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g,""))||options.allowPrototypes)&&keys.push(segment[1]);return segment&&keys.push("["+key.slice(segment.index)+"]"),internals.parseObject(keys,val,options)}},module.exports=function(str,opts){var options=opts||{};if(options.delimiter="string"==typeof options.delimiter||Utils.isRegExp(options.delimiter)?options.delimiter:internals.delimiter,options.depth="number"==typeof options.depth?options.depth:internals.depth,options.arrayLimit="number"==typeof options.arrayLimit?options.arrayLimit:internals.arrayLimit,options.parseArrays=options.parseArrays!==!1,options.allowDots="boolean"==typeof options.allowDots?options.allowDots:internals.allowDots,options.plainObjects="boolean"==typeof options.plainObjects?options.plainObjects:internals.plainObjects,options.allowPrototypes="boolean"==typeof options.allowPrototypes?options.allowPrototypes:internals.allowPrototypes,options.parameterLimit="number"==typeof options.parameterLimit?options.parameterLimit:internals.parameterLimit,options.strictNullHandling="boolean"==typeof options.strictNullHandling?options.strictNullHandling:internals.strictNullHandling,""===str||null===str||"undefined"==typeof str)return options.plainObjects?Object.create(null):{};for(var tempObj="string"==typeof str?internals.parseValues(str,options):str,obj=options.plainObjects?Object.create(null):{},keys=Object.keys(tempObj),i=0;i<keys.length;++i){var key=keys[i],newObj=internals.parseKeys(key,tempObj[key],options);obj=Utils.merge(obj,newObj,options)}return Utils.compact(obj)}},{"./utils":33}],32:[function(require,module,exports){"use strict";var Utils=require("./utils"),internals={delimiter:"&",arrayPrefixGenerators:{brackets:function(prefix){return prefix+"[]"},indices:function(prefix,key){return prefix+"["+key+"]"},repeat:function(prefix){return prefix}},strictNullHandling:!1,skipNulls:!1,encode:!0};internals.stringify=function(object,prefix,generateArrayPrefix,strictNullHandling,skipNulls,encode,filter,sort,allowDots){var obj=object;if("function"==typeof filter)obj=filter(prefix,obj);else if(Utils.isBuffer(obj))obj=String(obj);else if(obj instanceof Date)obj=obj.toISOString();else if(null===obj){if(strictNullHandling)return encode?Utils.encode(prefix):prefix;obj=""}if("string"==typeof obj||"number"==typeof obj||"boolean"==typeof obj)return encode?[Utils.encode(prefix)+"="+Utils.encode(obj)]:[prefix+"="+obj];var values=[];if("undefined"==typeof obj)return values;var objKeys;if(Array.isArray(filter))objKeys=filter;else{var keys=Object.keys(obj);objKeys=sort?keys.sort(sort):keys}for(var i=0;i<objKeys.length;++i){var key=objKeys[i];skipNulls&&null===obj[key]||(values=Array.isArray(obj)?values.concat(internals.stringify(obj[key],generateArrayPrefix(prefix,key),generateArrayPrefix,strictNullHandling,skipNulls,encode,filter,sort,allowDots)):values.concat(internals.stringify(obj[key],prefix+(allowDots?"."+key:"["+key+"]"),generateArrayPrefix,strictNullHandling,skipNulls,encode,filter,sort,allowDots)))}return values},module.exports=function(object,opts){var objKeys,filter,obj=object,options=opts||{},delimiter="undefined"==typeof options.delimiter?internals.delimiter:options.delimiter,strictNullHandling="boolean"==typeof options.strictNullHandling?options.strictNullHandling:internals.strictNullHandling,skipNulls="boolean"==typeof options.skipNulls?options.skipNulls:internals.skipNulls,encode="boolean"==typeof options.encode?options.encode:internals.encode,sort="function"==typeof options.sort?options.sort:null,allowDots="undefined"==typeof options.allowDots?!1:options.allowDots;"function"==typeof options.filter?(filter=options.filter,obj=filter("",obj)):Array.isArray(options.filter)&&(objKeys=filter=options.filter);var keys=[];if("object"!=typeof obj||null===obj)return"";var arrayFormat;arrayFormat=options.arrayFormat in internals.arrayPrefixGenerators?options.arrayFormat:"indices"in options?options.indices?"indices":"repeat":"indices";var generateArrayPrefix=internals.arrayPrefixGenerators[arrayFormat];objKeys||(objKeys=Object.keys(obj)),sort&&objKeys.sort(sort);for(var i=0;i<objKeys.length;++i){var key=objKeys[i];skipNulls&&null===obj[key]||(keys=keys.concat(internals.stringify(obj[key],key,generateArrayPrefix,strictNullHandling,skipNulls,encode,filter,sort,allowDots)))}return keys.join(delimiter)}},{"./utils":33}],33:[function(require,module,exports){"use strict";var hexTable=function(){for(var array=new Array(256),i=0;256>i;++i)array[i]="%"+((16>i?"0":"")+i.toString(16)).toUpperCase();return array}();exports.arrayToObject=function(source,options){for(var obj=options.plainObjects?Object.create(null):{},i=0;i<source.length;++i)"undefined"!=typeof source[i]&&(obj[i]=source[i]);return obj},exports.merge=function(target,source,options){if(!source)return target;if("object"!=typeof source){if(Array.isArray(target))target.push(source);else{if("object"!=typeof target)return[target,source];target[source]=!0}return target}if("object"!=typeof target)return[target].concat(source);var mergeTarget=target;return Array.isArray(target)&&!Array.isArray(source)&&(mergeTarget=exports.arrayToObject(target,options)),Object.keys(source).reduce(function(acc,key){var value=source[key];return Object.prototype.hasOwnProperty.call(acc,key)?acc[key]=exports.merge(acc[key],value,options):acc[key]=value,acc},mergeTarget)},exports.decode=function(str){try{return decodeURIComponent(str.replace(/\+/g," "))}catch(e){return str}},exports.encode=function(str){if(0===str.length)return str;for(var string="string"==typeof str?str:String(str),out="",i=0;i<string.length;++i){var c=string.charCodeAt(i);45===c||46===c||95===c||126===c||c>=48&&57>=c||c>=65&&90>=c||c>=97&&122>=c?out+=string.charAt(i):128>c?out+=hexTable[c]:2048>c?out+=hexTable[192|c>>6]+hexTable[128|63&c]:55296>c||c>=57344?out+=hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|63&c]:(i+=1,c=65536+((1023&c)<<10|1023&string.charCodeAt(i)),out+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|63&c])}return out},exports.compact=function(obj,references){if("object"!=typeof obj||null===obj)return obj;var refs=references||[],lookup=refs.indexOf(obj);if(-1!==lookup)return refs[lookup];if(refs.push(obj),Array.isArray(obj)){for(var compacted=[],i=0;i<obj.length;++i)"undefined"!=typeof obj[i]&&compacted.push(obj[i]);
return compacted}for(var keys=Object.keys(obj),j=0;j<keys.length;++j){var key=keys[j];obj[key]=exports.compact(obj[key],refs)}return obj},exports.isRegExp=function(obj){return"[object RegExp]"===Object.prototype.toString.call(obj)},exports.isBuffer=function(obj){return null===obj||"undefined"==typeof obj?!1:!!(obj.constructor&&obj.constructor.isBuffer&&obj.constructor.isBuffer(obj))}},{}],34:[function(require,module,exports){"use strict";function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}function _typeof(obj){return obj&&"undefined"!=typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj}function getLogLevel(level,action,payload,type){switch("undefined"==typeof level?"undefined":_typeof(level)){case"object":return"function"==typeof level[type]?level[type].apply(level,_toConsumableArray(payload)):level[type];case"function":return level(action);default:return level}}function createLogger(){function printBuffer(){logBuffer.forEach(function(logEntry,key){var started=logEntry.started,startedTime=logEntry.startedTime,action=logEntry.action,prevState=logEntry.prevState,error=logEntry.error,took=logEntry.took,nextState=logEntry.nextState,nextEntry=logBuffer[key+1];nextEntry&&(nextState=nextEntry.prevState,took=nextEntry.started-started);var formattedAction=actionTransformer(action),isCollapsed="function"==typeof collapsed?collapsed(function(){return nextState},action):collapsed,formattedTime=formatTime(startedTime),titleCSS=colors.title?"color: "+colors.title(formattedAction)+";":null,title="action "+(timestamp?formattedTime:"")+" "+formattedAction.type+" "+(duration?"(in "+took.toFixed(2)+" ms)":"");try{isCollapsed?colors.title?logger.groupCollapsed("%c "+title,titleCSS):logger.groupCollapsed(title):colors.title?logger.group("%c "+title,titleCSS):logger.group(title)}catch(e){logger.log(title)}var prevStateLevel=getLogLevel(level,formattedAction,[prevState],"prevState"),actionLevel=getLogLevel(level,formattedAction,[formattedAction],"action"),errorLevel=getLogLevel(level,formattedAction,[error,prevState],"error"),nextStateLevel=getLogLevel(level,formattedAction,[nextState],"nextState");prevStateLevel&&(colors.prevState?logger[prevStateLevel]("%c prev state","color: "+colors.prevState(prevState)+"; font-weight: bold",prevState):logger[prevStateLevel]("prev state",prevState)),actionLevel&&(colors.action?logger[actionLevel]("%c action","color: "+colors.action(formattedAction)+"; font-weight: bold",formattedAction):logger[actionLevel]("action",formattedAction)),error&&errorLevel&&(colors.error?logger[errorLevel]("%c error","color: "+colors.error(error,prevState)+"; font-weight: bold",error):logger[errorLevel]("error",error)),nextStateLevel&&(colors.nextState?logger[nextStateLevel]("%c next state","color: "+colors.nextState(nextState)+"; font-weight: bold",nextState):logger[nextStateLevel]("next state",nextState));try{logger.groupEnd()}catch(e){logger.log("—— log end ——")}}),logBuffer.length=0}var options=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],_options$level=options.level,level=void 0===_options$level?"log":_options$level,_options$logger=options.logger,logger=void 0===_options$logger?console:_options$logger,_options$logErrors=options.logErrors,logErrors=void 0===_options$logErrors?!0:_options$logErrors,collapsed=options.collapsed,predicate=options.predicate,_options$duration=options.duration,duration=void 0===_options$duration?!1:_options$duration,_options$timestamp=options.timestamp,timestamp=void 0===_options$timestamp?!0:_options$timestamp,transformer=options.transformer,_options$stateTransfo=options.stateTransformer,stateTransformer=void 0===_options$stateTransfo?function(state){return state}:_options$stateTransfo,_options$actionTransf=options.actionTransformer,actionTransformer=void 0===_options$actionTransf?function(actn){return actn}:_options$actionTransf,_options$errorTransfo=options.errorTransformer,errorTransformer=void 0===_options$errorTransfo?function(error){return error}:_options$errorTransfo,_options$colors=options.colors,colors=void 0===_options$colors?{title:function(){return"#000000"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}}:_options$colors;if("undefined"==typeof logger)return function(){return function(next){return function(action){return next(action)}}};transformer&&console.error("Option 'transformer' is deprecated, use stateTransformer instead");var logBuffer=[];return function(_ref){var getState=_ref.getState;return function(next){return function(action){if("function"==typeof predicate&&!predicate(getState,action))return next(action);var logEntry={};logBuffer.push(logEntry),logEntry.started=timer.now(),logEntry.startedTime=new Date,logEntry.prevState=stateTransformer(getState()),logEntry.action=action;var returnedValue=void 0;if(logErrors)try{returnedValue=next(action)}catch(e){logEntry.error=errorTransformer(e)}else returnedValue=next(action);if(logEntry.took=timer.now()-logEntry.started,logEntry.nextState=stateTransformer(getState()),printBuffer(),logEntry.error)throw logEntry.error;return returnedValue}}}}var repeat=function(str,times){return new Array(times+1).join(str)},pad=function(num,maxLength){return repeat("0",maxLength-num.toString().length)+num},formatTime=function(time){return"@ "+pad(time.getHours(),2)+":"+pad(time.getMinutes(),2)+":"+pad(time.getSeconds(),2)+"."+pad(time.getMilliseconds(),3)},timer="undefined"!=typeof performance&&"function"==typeof performance.now?performance:Date;module.exports=createLogger},{}]},{},[1]);
!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj["default"]=obj,newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function appBoot(){_ReducerRegister2["default"].add("config",_ConfigReducer2["default"]),_ReducerRegister2["default"].add("form",_FormReducer2["default"]),_ReducerRegister2["default"].add("schemas",_SchemaReducer2["default"]),_ReducerRegister2["default"].add("records",_RecordsReducer2["default"]),_ReducerRegister2["default"].add("campaign",_CampaignReducer2["default"]);var initialState={},rootReducer=(0,_redux.combineReducers)(_ReducerRegister2["default"].getAll()),middleware=[_reduxThunk2["default"]];"dev"===window.ss.config.environment&&middleware.push((0,_reduxLogger2["default"])());var createStoreWithMiddleware=_redux.applyMiddleware.apply(void 0,middleware)(_redux.createStore);window.store=createStoreWithMiddleware(rootReducer,initialState),window.store.dispatch(configActions.setConfig(window.ss.config))}var _jQuery=require("jQuery"),_jQuery2=_interopRequireDefault(_jQuery),_redux=require("redux"),_reduxThunk=require("redux-thunk"),_reduxThunk2=_interopRequireDefault(_reduxThunk),_reduxLogger=require("redux-logger"),_reduxLogger2=_interopRequireDefault(_reduxLogger),_ReducerRegister=require("lib/ReducerRegister"),_ReducerRegister2=_interopRequireDefault(_ReducerRegister),_ConfigActions=require("state/config/ConfigActions"),configActions=_interopRequireWildcard(_ConfigActions),_ConfigReducer=require("state/config/ConfigReducer"),_ConfigReducer2=_interopRequireDefault(_ConfigReducer),_FormReducer=require("state/form/FormReducer"),_FormReducer2=_interopRequireDefault(_FormReducer),_SchemaReducer=require("state/schema/SchemaReducer"),_SchemaReducer2=_interopRequireDefault(_SchemaReducer),_RecordsReducer=require("state/records/RecordsReducer"),_RecordsReducer2=_interopRequireDefault(_RecordsReducer),_CampaignReducer=require("state/campaign/CampaignReducer"),_CampaignReducer2=_interopRequireDefault(_CampaignReducer),_index=require("containers/CampaignAdmin/index");_interopRequireDefault(_index);(0,_jQuery2["default"])("body").entwine({onadd:function(){return appBoot()}})},{"containers/CampaignAdmin/index":10,jQuery:"jQuery","lib/ReducerRegister":"lib/ReducerRegister",redux:"redux","redux-logger":34,"redux-thunk":"redux-thunk","state/campaign/CampaignReducer":14,"state/config/ConfigActions":16,"state/config/ConfigReducer":17,"state/form/FormReducer":19,"state/records/RecordsReducer":22,"state/schema/SchemaReducer":24}],2:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),Accordion=function(_SilverStripeComponen){function Accordion(){return _classCallCheck(this,Accordion),_possibleConstructorReturn(this,_SilverStripeComponen.apply(this,arguments))}return _inherits(Accordion,_SilverStripeComponen),Accordion.prototype.render=function(){return _react2["default"].createElement("div",{role:"tablist","aria-multiselectable":"true"},this.props.children)},Accordion}(_SilverStripeComponent2["default"]);exports["default"]=Accordion},{"lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],3:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent);require("bootstrap-collapse");var AccordionGroup=function(_SilverStripeComponen){function AccordionGroup(){return _classCallCheck(this,AccordionGroup),_possibleConstructorReturn(this,_SilverStripeComponen.apply(this,arguments))}return _inherits(AccordionGroup,_SilverStripeComponen),AccordionGroup.prototype.render=function(){var headerID=this.props.groupid+"_Header",listID=this.props.groupid+"_Items",href="#"+listID,groupProps={id:listID,"aria-expanded":!0,className:"list-group list-group-flush collapse in",role:"tabpanel","aria-labelledby":headerID};return _react2["default"].createElement("div",{className:"accordion-group"},_react2["default"].createElement("h6",{className:"accordion-group__title",role:"tab",id:headerID},_react2["default"].createElement("a",{"data-toggle":"collapse",href:href,"aria-expanded":"true","aria-controls":listID},this.props.title)),_react2["default"].createElement("div",groupProps,this.props.children))},AccordionGroup}(_SilverStripeComponent2["default"]);exports["default"]=AccordionGroup},{"bootstrap-collapse":"bootstrap-collapse","lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],4:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),AccordionItem=function(_SilverStripeComponen){function AccordionItem(props){_classCallCheck(this,AccordionItem);var _this=_possibleConstructorReturn(this,_SilverStripeComponen.call(this,props));return _this.handleClick=_this.handleClick.bind(_this),_this}return _inherits(AccordionItem,_SilverStripeComponen),AccordionItem.prototype.render=function(){var className="list-group-item "+this.props.className;return _react2["default"].createElement("a",{tabIndex:"0",className:className,onClick:this.handleClick},this.props.children)},AccordionItem.prototype.handleClick=function(event){this.props.handleClick&&this.props.handleClick(event,this.props.handleClickArg)},AccordionItem}(_SilverStripeComponent2["default"]);AccordionItem.propTypes={handleClickArg:_react2["default"].PropTypes.any,handleClick:_react2["default"].PropTypes.func},exports["default"]=AccordionItem},{"lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],5:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),Breadcrumb=function(_SilverStripeComponen){function Breadcrumb(){return _classCallCheck(this,Breadcrumb),_possibleConstructorReturn(this,_SilverStripeComponen.apply(this,arguments))}return _inherits(Breadcrumb,_SilverStripeComponen),Breadcrumb.prototype.render=function(){return _react2["default"].createElement("ol",{className:"breadcrumb"},this.getBreadcrumbs())},Breadcrumb.prototype.getBreadcrumbs=function(){return"undefined"==typeof this.props.crumbs?null:[].concat(this.props.crumbs.slice(0,-1).map(function(crumb,index){return[_react2["default"].createElement("li",{className:"breadcrumb__item"},_react2["default"].createElement("a",{key:index,className:"breadcrumb__item-title",href:crumb.href},crumb.text))]}),this.props.crumbs.slice(-1).map(function(crumb,index){return[_react2["default"].createElement("li",{className:"breadcrumb__item breadcrumb__item--last"},_react2["default"].createElement("h2",{className:"breadcrumb__item-title breadcrumb__item-title--last",key:index},crumb.text))]}))},Breadcrumb}(_SilverStripeComponent2["default"]);Breadcrumb.propTypes={crumbs:_react2["default"].PropTypes.array},exports["default"]=Breadcrumb},{"lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],6:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),Preview=function(_SilverStripeComponen){function Preview(){return _classCallCheck(this,Preview),_possibleConstructorReturn(this,_SilverStripeComponen.apply(this,arguments))}return _inherits(Preview,_SilverStripeComponen),Preview.prototype.render=function(){var body=null;return body=this.props.previewUrl?0===this.props.previewType.indexOf("image/")?_react2["default"].createElement("div",{className:"preview__file-container panel-scrollable"},_react2["default"].createElement("img",{alt:this.props.previewUrl,className:"preview__file--fits-space",src:this.props.previewUrl})):_react2["default"].createElement("iframe",{className:"preview__iframe",src:this.props.previewUrl}):_react2["default"].createElement("div",{className:"preview__overlay"},_react2["default"].createElement("h3",{className:"preview__overlay-text"},"There is no preview available for this item.")),_react2["default"].createElement("div",{className:"cms-content__right preview"},body,_react2["default"].createElement("a",{href:"",className:"cms-content__back-btn font-icon-left-open-big"}),_react2["default"].createElement("div",{className:"toolbar--south"},_react2["default"].createElement("div",{className:"btn-toolbar"},_react2["default"].createElement("button",{className:"btn btn-secondary btn-secondary",type:"button"},_react2["default"].createElement("i",{className:"font-icon-edit"})," Edit"),_react2["default"].createElement("button",{type:"button","data-container":"body",className:"btn btn-link btn--options","data-toggle":"popover",title:"Page actions","data-placement":"top","data-content":"<a href=''>Add to campaign</a><a href=''>Remove from campaign</a>"},_react2["default"].createElement("i",{className:"font-icon-dot-3"})))))},Preview}(_SilverStripeComponent2["default"]);Preview.propTypes={previewUrl:_react2["default"].PropTypes.string.isRequired,previewType:_react2["default"].PropTypes.string},exports["default"]=Preview},{"lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],7:[function(require,module,exports){"use strict";function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj["default"]=obj,newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}function mapStateToProps(state,ownProps){return{config:state.config,sectionConfig:state.config.sections[ownProps.sectionConfigKey],campaignId:state.campaign.campaignId,view:state.campaign.view}}function mapDispatchToProps(dispatch){return{actions:(0,_redux.bindActionCreators)(actions,dispatch)}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_react=require("react"),_react2=_interopRequireDefault(_react),_redux=require("redux"),_reactRedux=require("react-redux"),_Backend=require("lib/Backend"),_Backend2=_interopRequireDefault(_Backend),_CampaignActions=require("state/campaign/CampaignActions"),actions=_interopRequireWildcard(_CampaignActions),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),_FormAction=require("components/FormAction/FormAction"),_FormAction2=_interopRequireDefault(_FormAction),_i18n=require("i18n"),_i18n2=_interopRequireDefault(_i18n),_Toolbar=require("components/Toolbar/Toolbar"),_Toolbar2=_interopRequireDefault(_Toolbar),_FormBuilder=require("components/FormBuilder/FormBuilder"),_FormBuilder2=_interopRequireDefault(_FormBuilder),_CampaignAdminList=require("./CampaignAdminList"),_CampaignAdminList2=_interopRequireDefault(_CampaignAdminList),CampaignAdmin=function(_SilverStripeComponen){function CampaignAdmin(props){_classCallCheck(this,CampaignAdmin);var _this=_possibleConstructorReturn(this,_SilverStripeComponen.call(this,props));return _this.addCampaign=_this.addCampaign.bind(_this),_this.publishApi=_Backend2["default"].createEndpointFetcher({url:_this.props.sectionConfig.publishEndpoint.url,method:_this.props.sectionConfig.publishEndpoint.method,defaultData:{SecurityID:_this.props.config.SecurityID},payloadSchema:{id:{urlReplacement:":id",remove:!0}}}),_this.campaignListCreateFn=_this.campaignListCreateFn.bind(_this),_this.campaignAddCreateFn=_this.campaignAddCreateFn.bind(_this),_this.campaignEditCreateFn=_this.campaignEditCreateFn.bind(_this),_this}return _inherits(CampaignAdmin,_SilverStripeComponen),CampaignAdmin.prototype.componentDidMount=function(){var _this2=this;_SilverStripeComponen.prototype.componentDidMount.call(this);var captureRoute=!0,route=window.ss.router.resolveURLToBase(this.props.sectionConfig.campaignViewRoute);window.ss.router(route,function(ctx,next){captureRoute?_this2.props.actions.showCampaignView(ctx.params.id,ctx.params.view):next()}),window.ss.router.exit(route,function(ctx,next){var applies=window.ss.router.routeAppliesToCurrentLocation(route);applies||(captureRoute=!1),next()})},CampaignAdmin.prototype.render=function(){var view=null;switch(this.props.view){case"show":view=this.renderItemListView();break;case"edit":view=this.renderDetailEditView();break;case"create":view=this.renderCreateView();break;default:view=this.renderIndexView()}return view},CampaignAdmin.prototype.renderIndexView=function(){var schemaUrl=this.props.sectionConfig.form.EditForm.schemaUrl,formActionProps={label:_i18n2["default"]._t("Campaigns.ADDCAMPAIGN"),icon:"plus",handleClick:this.addCampaign},formBuilderProps={createFn:this.campaignListCreateFn,schemaUrl:schemaUrl};return _react2["default"].createElement("div",{className:"cms-content__inner no-preview"},_react2["default"].createElement("div",{className:"cms-content__left cms-campaigns collapse in","aria-expanded":"true"},_react2["default"].createElement(_Toolbar2["default"],null,_react2["default"].createElement("div",{className:"breadcrumb breadcrumb--current-only"},_react2["default"].createElement("h2",{className:"breadcrumb__item-title breadcrumb__item-title--last"},"Campaigns"))),_react2["default"].createElement("div",{className:"panel-scrollable--single-toolbar"},_react2["default"].createElement("div",{className:"toolbar--content"},_react2["default"].createElement("div",{className:"btn-toolbar"},_react2["default"].createElement(_FormAction2["default"],formActionProps))),_react2["default"].createElement(_FormBuilder2["default"],formBuilderProps))))},CampaignAdmin.prototype.renderItemListView=function(){var props={campaignId:this.props.campaignId,itemListViewEndpoint:this.props.sectionConfig.itemListViewEndpoint,publishApi:this.publishApi,breadcrumbs:this.getBreadcrumbs()};return _react2["default"].createElement(_CampaignAdminList2["default"],props)},CampaignAdmin.prototype.renderDetailEditView=function(){var baseSchemaUrl=this.props.sectionConfig.form.DetailEditForm.schemaUrl,formBuilderProps={createFn:this.campaignEditCreateFn,schemaUrl:baseSchemaUrl+"/ChangeSet/"+this.props.campaignId};return _react2["default"].createElement("div",{className:"cms-middle no-preview"},_react2["default"].createElement("div",{className:"cms-campaigns collapse in","aria-expanded":"true"},_react2["default"].createElement(_Toolbar2["default"],{showBackButton:!0},_react2["default"].createElement("div",{className:"breadcrumb breadcrumb--current-only"},_react2["default"].createElement("h2",{className:"text-truncate breadcrumb__item-title--last"},"Campaigns"))),_react2["default"].createElement(_FormBuilder2["default"],formBuilderProps)))},CampaignAdmin.prototype.renderCreateView=function(){var baseSchemaUrl=this.props.sectionConfig.form.DetailEditForm.schemaUrl,formBuilderProps={createFn:this.campaignAddCreateFn,schemaUrl:baseSchemaUrl+"/ChangeSet"};return _react2["default"].createElement("div",{className:"cms-middle no-preview"},_react2["default"].createElement("div",{className:"cms-campaigns collapse in","aria-expanded":"true"},_react2["default"].createElement(_Toolbar2["default"],{showBackButton:!0},_react2["default"].createElement("div",{className:"breadcrumb breadcrumb--current-only"},_react2["default"].createElement("h2",{className:"text-truncate breadcrumb__item-title--last"},"Campaigns"))),_react2["default"].createElement("div",{className:"cms-middle__scrollable"},_react2["default"].createElement(_FormBuilder2["default"],formBuilderProps))))},CampaignAdmin.prototype.campaignEditCreateFn=function(Component,props){var indexRoute=this.props.sectionConfig.route;if("action_cancel"===props.name){var extendedProps=_extends({},props,{handleClick:function(event){event.preventDefault(),window.ss.router.show(indexRoute)}});return _react2["default"].createElement(Component,_extends({key:props.name},extendedProps))}return _react2["default"].createElement(Component,_extends({key:props.name},props))},CampaignAdmin.prototype.campaignAddCreateFn=function(Component,props){var indexRoute=this.props.sectionConfig.route;if("action_cancel"===props.name){var extendedProps=_extends({},props,{handleClick:function(event){event.preventDefault(),window.ss.router.show(indexRoute)}});return _react2["default"].createElement(Component,_extends({key:props.name},extendedProps))}return _react2["default"].createElement(Component,_extends({key:props.name},props))},CampaignAdmin.prototype.campaignListCreateFn=function(Component,props){var campaignViewRoute=this.props.sectionConfig.campaignViewRoute,typeUrlParam="set";if("GridField"===props.component){var extendedProps=_extends({},props,{data:_extends({},props.data,{handleDrillDown:function(event,record){var path=campaignViewRoute.replace(/:type\?/,typeUrlParam).replace(/:id\?/,record.ID).replace(/:view\?/,"show");window.ss.router.show(path)},handleEditRecord:function(event,id){var path=campaignViewRoute.replace(/:type\?/,typeUrlParam).replace(/:id\?/,id).replace(/:view\?/,"edit");window.ss.router.show(path)}})});return _react2["default"].createElement(Component,_extends({key:extendedProps.name},extendedProps))}return _react2["default"].createElement(Component,_extends({key:props.name},props))},CampaignAdmin.prototype.getBreadcrumbs=function(){return[{text:"Campaigns",href:"admin/campaigns"},{text:"March release",href:"admin/campaigns/show/1"}]},CampaignAdmin.prototype.addCampaign=function(){var path=this.props.sectionConfig.campaignViewRoute.replace(/:type\?/,"set").replace(/:id\?/,0).replace(/:view\?/,"create");window.ss.router.show(path)},CampaignAdmin}(_SilverStripeComponent2["default"]);CampaignAdmin.propTypes={actions:_react2["default"].PropTypes.object.isRequired,campaignId:_react2["default"].PropTypes.string,config:_react2["default"].PropTypes.shape({form:_react2["default"].PropTypes.shape({editForm:_react2["default"].PropTypes.shape({schemaUrl:_react2["default"].PropTypes.string})}),SecurityID:_react2["default"].PropTypes.string}),sectionConfig:_react2["default"].PropTypes.object.isRequired,sectionConfigKey:_react2["default"].PropTypes.string.isRequired,view:_react2["default"].PropTypes.string},exports["default"]=(0,_reactRedux.connect)(mapStateToProps,mapDispatchToProps)(CampaignAdmin)},{"./CampaignAdminList":9,"components/FormAction/FormAction":"components/FormAction/FormAction","components/FormBuilder/FormBuilder":"components/FormBuilder/FormBuilder","components/Toolbar/Toolbar":"components/Toolbar/Toolbar",i18n:"i18n","lib/Backend":"lib/Backend","lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react","react-redux":"react-redux",redux:"redux","state/campaign/CampaignActions":13}],8:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=require("react"),_react2=_interopRequireDefault(_react),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),_i18n=require("i18n"),_i18n2=_interopRequireDefault(_i18n),CampaignAdminItem=function(_SilverStripeComponen){function CampaignAdminItem(){return _classCallCheck(this,CampaignAdminItem),_possibleConstructorReturn(this,_SilverStripeComponen.apply(this,arguments))}return _inherits(CampaignAdminItem,_SilverStripeComponen),CampaignAdminItem.prototype.render=function(){var thumbnail=null,badge={},item=this.props.item,campaign=this.props.campaign;if("open"===campaign.State)switch(item.ChangeType){case"created":badge.className="label label-warning list-group-item__status",badge.Title=_i18n2["default"]._t("CampaignItem.DRAFT","Draft");break;case"modified":badge.className="label label-warning list-group-item__status",badge.Title=_i18n2["default"]._t("CampaignItem.MODIFIED","Modified");break;case"deleted":badge.className="label label-error list-group-item__status",badge.Title=_i18n2["default"]._t("CampaignItem.REMOVED","Removed");break;case"none":default:badge.className="label label-success list-group-item__status",badge.Title=_i18n2["default"]._t("CampaignItem.NO_CHANGES","No changes")}var links=_react2["default"].createElement("span",{className:"list-group-item--has-links"},_react2["default"].createElement("i",{className:"font-icon-link"}),"3 linked items");return item.Thumbnail&&(thumbnail=_react2["default"].createElement("span",{className:"list-group-item__thumbnail"},_react2["default"].createElement("img",{alt:item.Title,src:item.Thumbnail}))),_react2["default"].createElement("div",null,thumbnail,_react2["default"].createElement("h4",{className:"list-group-item-heading"},item.Title),_react2["default"].createElement("span",{className:"list-group-item--is-linked"},_react2["default"].createElement("i",{className:"font-icon-link"})),links,badge.className&&badge.Title&&_react2["default"].createElement("span",{className:badge.className},badge.Title))},CampaignAdminItem}(_SilverStripeComponent2["default"]);CampaignAdminItem.propTypes={campaign:_react2["default"].PropTypes.object.isRequired,item:_react2["default"].PropTypes.object.isRequired},exports["default"]=CampaignAdminItem},{i18n:"i18n","lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react"}],9:[function(require,module,exports){"use strict";function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj["default"]=obj,newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defaults(obj,defaults){for(var keys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){var key=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void 0===obj[key]&&Object.defineProperty(obj,key,value)}return obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}function mapStateToProps(state,ownProps){var record=null;
return state.records&&state.records.ChangeSet&&ownProps.campaignId&&(record=state.records.ChangeSet[parseInt(ownProps.campaignId,10)]),{record:record||{},campaign:state.campaign}}function mapDispatchToProps(dispatch){return{recordActions:(0,_redux.bindActionCreators)(recordActions,dispatch),campaignActions:(0,_redux.bindActionCreators)(campaignActions,dispatch)}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_react=require("react"),_react2=_interopRequireDefault(_react),_redux=require("redux"),_reactRedux=require("react-redux"),_RecordsActions=require("state/records/RecordsActions"),recordActions=_interopRequireWildcard(_RecordsActions),_CampaignActions=require("state/campaign/CampaignActions"),campaignActions=_interopRequireWildcard(_CampaignActions),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),_Accordion=require("components/Accordion/Accordion"),_Accordion2=_interopRequireDefault(_Accordion),_AccordionGroup=require("components/Accordion/AccordionGroup"),_AccordionGroup2=_interopRequireDefault(_AccordionGroup),_AccordionItem=require("components/Accordion/AccordionItem"),_AccordionItem2=_interopRequireDefault(_AccordionItem),_Toolbar=require("components/Toolbar/Toolbar"),_Toolbar2=_interopRequireDefault(_Toolbar),_FormAction=require("components/FormAction/FormAction"),_FormAction2=_interopRequireDefault(_FormAction),_CampaignAdminItem=require("./CampaignAdminItem"),_CampaignAdminItem2=_interopRequireDefault(_CampaignAdminItem),_Breadcrumb=require("components/Breadcrumb/Breadcrumb"),_Breadcrumb2=_interopRequireDefault(_Breadcrumb),_Preview=require("components/Preview/Preview"),_Preview2=_interopRequireDefault(_Preview),_i18n=require("i18n"),_i18n2=_interopRequireDefault(_i18n),CampaignAdminList=function(_SilverStripeComponen){function CampaignAdminList(props){_classCallCheck(this,CampaignAdminList);var _this=_possibleConstructorReturn(this,_SilverStripeComponen.call(this,props));return _this.handlePublish=_this.handlePublish.bind(_this),_this.handleItemSelected=_this.handleItemSelected.bind(_this),_this}return _inherits(CampaignAdminList,_SilverStripeComponen),CampaignAdminList.prototype.componentDidMount=function(){var fetchURL=this.props.itemListViewEndpoint.replace(/:id/,this.props.campaignId);_SilverStripeComponen.prototype.componentDidMount.call(this),this.props.recordActions.fetchRecord("ChangeSet","get",fetchURL)},CampaignAdminList.prototype.render=function(){var _this2=this,itemID=this.props.campaign.changeSetItemId,previewUrl=null,previewType=null,campaignId=this.props.campaignId,campaign=this.props.record,itemGroups=this.groupItemsForSet(),accordionGroups=[];Object.keys(itemGroups).forEach(function(className){var group=itemGroups[className],groupCount=group.items.length,accordionItems=[],title=groupCount+" "+(1===groupCount?group.singular:group.plural),groupid="Set_"+campaignId+"_Group_"+className;group.items.forEach(function(item){itemID||(itemID=item.ID);var selected=itemID===item.ID;selected&&item._links.preview&&(item._links.preview.Stage?(previewUrl=item._links.preview.Stage.href,previewType=item._links.preview.Stage.type):item._links.preview.Live&&(previewUrl=item._links.preview.Live.href,previewType=item._links.preview.Live.type));var itemClassNames=[];"none"!==item.ChangeType&&"published"!==campaign.State||itemClassNames.push("list-group-item--published"),selected&&itemClassNames.push("active"),accordionItems.push(_react2["default"].createElement(_AccordionItem2["default"],{key:item.ID,className:itemClassNames.join(" "),handleClick:_this2.handleItemSelected,handleClickArg:item.ID},_react2["default"].createElement(_CampaignAdminItem2["default"],{item:item,campaign:_this2.props.record})))}),accordionGroups.push(_react2["default"].createElement(_AccordionGroup2["default"],{key:groupid,groupid:groupid,title:title},accordionItems))});var classNames=previewUrl?"cms-content__split cms-content__split--left-sm":"cms-content__split cms-content__split--none";return _react2["default"].createElement("div",{className:classNames},_react2["default"].createElement("div",{className:"cms-content__left collapse in","aria-expanded":"true"},_react2["default"].createElement(_Toolbar2["default"],null,_react2["default"].createElement(_Breadcrumb2["default"],{crumbs:this.props.breadcrumbs,multiline:!0})),_react2["default"].createElement("div",{className:"container-fluid campaign-items panel-scrollable--double-toolbar"},_react2["default"].createElement(_Accordion2["default"],null,accordionGroups)),_react2["default"].createElement("div",{className:"toolbar--south"},this.renderButtonToolbar())),previewUrl&&_react2["default"].createElement(_Preview2["default"],{previewUrl:previewUrl,previewType:previewType}))},CampaignAdminList.prototype.handleItemSelected=function(event,itemId){this.props.campaignActions.selectChangeSetItem(itemId)},CampaignAdminList.prototype.renderButtonToolbar=function(){var items=this.getItems();if(!items)return _react2["default"].createElement("div",{className:"btn-toolbar"});var actionProps={};return"open"===this.props.record.State?actionProps=_extends(actionProps,{label:_i18n2["default"]._t("Campaigns.PUBLISHCAMPAIGN"),bootstrapButtonStyle:"success",loading:this.props.campaign.isPublishing,handleClick:this.handlePublish,icon:"rocket"}):"published"===this.props.record.State&&(actionProps=_extends(actionProps,{label:_i18n2["default"]._t("Campaigns.REVERTCAMPAIGN"),bootstrapButtonStyle:"default",icon:"back-in-time",disabled:!0})),_react2["default"].createElement("div",{className:"btn-toolbar"},_react2["default"].createElement(_FormAction2["default"],actionProps))},CampaignAdminList.prototype.getItems=function(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.ChangeSetItems:null},CampaignAdminList.prototype.groupItemsForSet=function(){var groups={},items=this.getItems();return items?(items.forEach(function(item){var classname=item.BaseClass;groups[classname]||(groups[classname]={singular:item.Singular,plural:item.Plural,items:[]}),groups[classname].items.push(item)}),groups):groups},CampaignAdminList.prototype.handlePublish=function(e){e.preventDefault(),this.props.campaignActions.publishCampaign(this.props.publishApi,this.props.campaignId)},CampaignAdminList}(_SilverStripeComponent2["default"]);CampaignAdminList.propTypes={campaign:_react2["default"].PropTypes.shape({isPublishing:_react2["default"].PropTypes.bool.isRequired,changeSetItemId:_react2["default"].PropTypes.number}),campaignActions:_react2["default"].PropTypes.object.isRequired,publishApi:_react2["default"].PropTypes.func.isRequired,record:_react2["default"].PropTypes.object.isRequired,recordActions:_react2["default"].PropTypes.object.isRequired},exports["default"]=(0,_reactRedux.connect)(mapStateToProps,mapDispatchToProps)(CampaignAdminList)},{"./CampaignAdminItem":8,"components/Accordion/Accordion":2,"components/Accordion/AccordionGroup":3,"components/Accordion/AccordionItem":4,"components/Breadcrumb/Breadcrumb":5,"components/FormAction/FormAction":"components/FormAction/FormAction","components/Preview/Preview":6,"components/Toolbar/Toolbar":"components/Toolbar/Toolbar",i18n:"i18n","lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react","react-redux":"react-redux",redux:"redux","state/campaign/CampaignActions":13,"state/records/RecordsActions":21}],10:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _jQuery=require("jQuery"),_jQuery2=_interopRequireDefault(_jQuery),_react=require("react"),_react2=_interopRequireDefault(_react),_reactDom=require("react-dom"),_reactDom2=_interopRequireDefault(_reactDom),_reactRedux=require("react-redux"),_CampaignAdmin=require("./CampaignAdmin"),_CampaignAdmin2=_interopRequireDefault(_CampaignAdmin);_jQuery2["default"].entwine("ss",function($){$(".cms-content.CampaignAdmin").entwine({onadd:function(){_reactDom2["default"].render(_react2["default"].createElement(_reactRedux.Provider,{store:window.store},_react2["default"].createElement(_CampaignAdmin2["default"],{sectionConfigKey:"CampaignAdmin"})),this[0])},onremove:function(){_reactDom2["default"].unmountComponentAtNode(this[0])}})})},{"./CampaignAdmin":7,jQuery:"jQuery",react:"react","react-dom":"react-dom","react-redux":"react-redux"}],11:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function checkStatus(response){var ret=void 0,error=void 0;if(!(response.status>=200&&response.status<300))throw error=new Error(response.statusText),error.response=response,error;return ret=response}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_isomorphicFetch=require("isomorphic-fetch"),_isomorphicFetch2=_interopRequireDefault(_isomorphicFetch),_es6Promise=require("es6-promise"),_es6Promise2=_interopRequireDefault(_es6Promise),_qs=require("qs"),_qs2=_interopRequireDefault(_qs),_merge=require("merge"),_merge2=_interopRequireDefault(_merge);_es6Promise2["default"].polyfill();var Backend=function(){function Backend(){_classCallCheck(this,Backend),this.fetch=_isomorphicFetch2["default"]}return Backend.prototype.createEndpointFetcher=function(endpointSpec){function encode(contentType,data){switch(contentType){case"application/x-www-form-urlencoded":return _qs2["default"].stringify(data);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.stringify(data);default:throw new Error("Can't encode format: "+contentType)}}function decode(contentType,text){switch(contentType){case"application/x-www-form-urlencoded":return _qs2["default"].parse(text);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.parse(text);default:throw new Error("Can't decode format: "+contentType)}}function addQuerystring(url,querystring){return""===querystring?url:url.match(/\?/)?url+"&"+querystring:url+"?"+querystring}function parseResponse(response){return response.text().then(function(body){return decode(response.headers.get("Content-Type"),body)})}function applySchemaToData(payloadSchema,data){return Object.keys(data).reduce(function(prev,key){var schema=payloadSchema[key];return!schema||schema.remove!==!0&&schema.querystring!==!0?_extends(prev,_defineProperty({},key,data[key])):prev},{})}function applySchemaToUrl(payloadSchema,url,data){var opts=arguments.length<=3||void 0===arguments[3]?{setFromData:!1}:arguments[3],newUrl=url,queryData=Object.keys(data).reduce(function(prev,key){var schema=payloadSchema[key],includeThroughSetFromData=opts.setFromData===!0&&!(schema&&schema.remove===!0),includeThroughSpec=schema&&schema.querystring===!0&&schema.remove!==!0;return includeThroughSetFromData||includeThroughSpec?_extends(prev,_defineProperty({},key,data[key])):prev},{});return newUrl=addQuerystring(newUrl,encode("application/x-www-form-urlencoded",queryData)),newUrl=Object.keys(payloadSchema).reduce(function(prev,key){var replacement=payloadSchema[key].urlReplacement;return replacement?prev.replace(replacement,data[key]):prev},newUrl)}var _this=this,refinedSpec=_extends({method:"get",payloadFormat:"application/x-www-form-urlencoded",responseFormat:"application/json",payloadSchema:{},defaultData:{}},endpointSpec),formatShortcuts={json:"application/json",urlencoded:"application/x-www-form-urlencoded"};return["payloadFormat","responseFormat"].forEach(function(key){formatShortcuts[refinedSpec[key]]&&(refinedSpec[key]=formatShortcuts[refinedSpec[key]])}),function(){var data=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],headers=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],mergedHeaders=_extends({},headers,{Accept:refinedSpec.responseFormat,"Content-Type":refinedSpec.payloadFormat}),mergedData=_merge2["default"].recursive({},refinedSpec.defaultData,data),url=applySchemaToUrl(refinedSpec.payloadSchema,refinedSpec.url,mergedData,{setFromData:"get"===refinedSpec.method.toLowerCase()}),encodedData=encode(refinedSpec.payloadFormat,applySchemaToData(refinedSpec.payloadSchema,mergedData)),args="get"===refinedSpec.method.toLowerCase()?[url,mergedHeaders]:[url,encodedData,mergedHeaders];return _this[refinedSpec.method.toLowerCase()].apply(_this,args).then(parseResponse)}},Backend.prototype.get=function(url){var headers=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return this.fetch(url,{method:"get",credentials:"same-origin",headers:headers}).then(checkStatus)},Backend.prototype.post=function(url){var data=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],headers=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],defaultHeaders={"Content-Type":"application/x-www-form-urlencoded"};return this.fetch(url,{method:"post",headers:_extends({},defaultHeaders,headers),credentials:"same-origin",body:data}).then(checkStatus)},Backend.prototype.put=function(url){var data=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],headers=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(url,{method:"put",credentials:"same-origin",body:data,headers:headers}).then(checkStatus)},Backend.prototype["delete"]=function(url){var data=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],headers=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(url,{method:"delete",credentials:"same-origin",body:data,headers:headers}).then(checkStatus)},Backend}(),backend=new Backend;exports["default"]=backend},{"es6-promise":26,"isomorphic-fetch":27,merge:29,qs:30}],12:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]={SET_CAMPAIGN_ACTIVE_CHANGESET:"SET_CAMPAIGN_ACTIVE_CHANGESET",SET_CAMPAIGN_SELECTED_CHANGESETITEM:"SET_CAMPAIGN_SELECTED_CHANGESETITEM",PUBLISH_CAMPAIGN_REQUEST:"PUBLISH_CAMPAIGN_REQUEST",PUBLISH_CAMPAIGN_SUCCESS:"PUBLISH_CAMPAIGN_SUCCESS",PUBLISH_CAMPAIGN_FAILURE:"PUBLISH_CAMPAIGN_FAILURE"}},{}],13:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function selectChangeSetItem(changeSetItemId){return{type:_CampaignActionTypes2["default"].SET_CAMPAIGN_SELECTED_CHANGESETITEM,payload:{changeSetItemId:changeSetItemId}}}function showCampaignView(campaignId,view){return{type:_CampaignActionTypes2["default"].SET_CAMPAIGN_ACTIVE_CHANGESET,payload:{campaignId:campaignId,view:view}}}function publishCampaign(publishApi,campaignId){return function(dispatch){dispatch({type:_CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_REQUEST,payload:{campaignId:campaignId}}),publishApi({id:campaignId}).then(function(data){dispatch({type:_CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_SUCCESS,payload:{campaignId:campaignId}}),dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORD_SUCCESS,payload:{recordType:"ChangeSet",data:data}})})["catch"](function(error){dispatch({type:_CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_FAILURE,payload:{error:error}})})}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.selectChangeSetItem=selectChangeSetItem,exports.showCampaignView=showCampaignView,exports.publishCampaign=publishCampaign;var _CampaignActionTypes=require("./CampaignActionTypes"),_CampaignActionTypes2=_interopRequireDefault(_CampaignActionTypes),_RecordsActionTypes=require("state/records/RecordsActionTypes"),_RecordsActionTypes2=_interopRequireDefault(_RecordsActionTypes)},{"./CampaignActionTypes":12,"state/records/RecordsActionTypes":20}],14:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function reducer(){var state=arguments.length<=0||void 0===arguments[0]?initialState:arguments[0],action=arguments[1];switch(action.type){case _CampaignActionTypes2["default"].SET_CAMPAIGN_SELECTED_CHANGESETITEM:return(0,_deepFreeze2["default"])(_extends({},state,{changeSetItemId:action.payload.changeSetItemId}));case _CampaignActionTypes2["default"].SET_CAMPAIGN_ACTIVE_CHANGESET:return(0,_deepFreeze2["default"])(_extends({},state,{campaignId:action.payload.campaignId,view:action.payload.view,changeSetItemId:null}));case _CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_REQUEST:return(0,_deepFreeze2["default"])(_extends({},state,{isPublishing:!0}));case _CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_SUCCESS:case _CampaignActionTypes2["default"].PUBLISH_CAMPAIGN_FAILURE:return(0,_deepFreeze2["default"])(_extends({},state,{isPublishing:!1}));default:return state}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_deepFreeze=require("deep-freeze"),_deepFreeze2=_interopRequireDefault(_deepFreeze),_CampaignActionTypes=require("./CampaignActionTypes"),_CampaignActionTypes2=_interopRequireDefault(_CampaignActionTypes),initialState=(0,_deepFreeze2["default"])({campaignId:null,changeSetItemId:null,isPublishing:!1,view:null});exports["default"]=reducer},{"./CampaignActionTypes":12,"deep-freeze":"deep-freeze"}],15:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]={SET_CONFIG:"SET_CONFIG"}},{}],16:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function setConfig(config){return{type:_ConfigActionTypes2["default"].SET_CONFIG,payload:{config:config}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.setConfig=setConfig;var _ConfigActionTypes=require("./ConfigActionTypes"),_ConfigActionTypes2=_interopRequireDefault(_ConfigActionTypes)},{"./ConfigActionTypes":15}],17:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function configReducer(){var state=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],action=arguments[1];switch(action.type){case _ConfigActionTypes2["default"].SET_CONFIG:return(0,_deepFreeze2["default"])(_extends({},state,action.payload.config));default:return state}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_deepFreeze=require("deep-freeze"),_deepFreeze2=_interopRequireDefault(_deepFreeze),_ConfigActionTypes=require("./ConfigActionTypes"),_ConfigActionTypes2=_interopRequireDefault(_ConfigActionTypes);exports["default"]=configReducer},{"./ConfigActionTypes":15,"deep-freeze":"deep-freeze"}],18:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.ACTION_TYPES={ADD_FORM:"ADD_FORM",REMOVE_FORM:"REMOVE_FORM",SUBMIT_FORM_FAILURE:"SUBMIT_FORM_FAILURE",SUBMIT_FORM_REQUEST:"SUBMIT_FORM_REQUEST",SUBMIT_FORM_SUCCESS:"SUBMIT_FORM_SUCCESS",UPDATE_FIELD:"UPDATE_FIELD"}},{}],19:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function formReducer(){var state=arguments.length<=0||void 0===arguments[0]?initialState:arguments[0],action=arguments[1];switch(action.type){case _FormActionTypes.ACTION_TYPES.SUBMIT_FORM_REQUEST:return(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},action.payload.formId,{submitting:!0})));case _FormActionTypes.ACTION_TYPES.REMOVE_FORM:return(0,_deepFreeze2["default"])(Object.keys(state).reduce(function(previous,current){return current===action.payload.formId?previous:_extends({},previous,_defineProperty({},current,state[current]))},{}));case _FormActionTypes.ACTION_TYPES.ADD_FORM:return(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},action.payload.formState.id,{fields:action.payload.formState.fields,submitting:!1})));case _FormActionTypes.ACTION_TYPES.UPDATE_FIELD:return(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},action.payload.formId,_extends({},state[action.payload.formId],{fields:state[action.payload.formId].fields.map(function(field){return field.id===action.payload.updates.id?_extends({},field,action.payload.updates):field})}))));case _FormActionTypes.ACTION_TYPES.SUBMIT_FORM_SUCCESS:return(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},action.payload.response.id,{fields:action.payload.response.state.fields,messages:action.payload.response.state.messages,submitting:!1})));case _FormActionTypes.ACTION_TYPES.SUBMIT_FORM_FAILURE:return(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},action.payload.formId,{submitting:!1})));default:return state}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_deepFreeze=require("deep-freeze"),_deepFreeze2=_interopRequireDefault(_deepFreeze),_FormActionTypes=require("./FormActionTypes"),initialState=(0,_deepFreeze2["default"])({});exports["default"]=formReducer},{"./FormActionTypes":18,"deep-freeze":"deep-freeze"}],20:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]={CREATE_RECORD:"CREATE_RECORD",UPDATE_RECORD:"UPDATE_RECORD",DELETE_RECORD:"DELETE_RECORD",FETCH_RECORDS_REQUEST:"FETCH_RECORDS_REQUEST",FETCH_RECORDS_FAILURE:"FETCH_RECORDS_FAILURE",FETCH_RECORDS_SUCCESS:"FETCH_RECORDS_SUCCESS",FETCH_RECORD_REQUEST:"FETCH_RECORD_REQUEST",FETCH_RECORD_FAILURE:"FETCH_RECORD_FAILURE",FETCH_RECORD_SUCCESS:"FETCH_RECORD_SUCCESS",DELETE_RECORD_REQUEST:"DELETE_RECORD_REQUEST",DELETE_RECORD_FAILURE:"DELETE_RECORD_FAILURE",DELETE_RECORD_SUCCESS:"DELETE_RECORD_SUCCESS"}},{}],21:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function populate(str,params){var names=["id"];return names.reduce(function(acc,name){return acc.replace(":"+name,params[name])},str)}function fetchRecords(recordType,method,url){var payload={recordType:recordType},headers={Accept:"text/json"},methodToLowerCase=method.toLowerCase();return function(dispatch){dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORDS_REQUEST,payload:payload});var args="get"===methodToLowerCase?[populate(url,payload),headers]:[populate(url,payload),{},headers];return _Backend2["default"][methodToLowerCase].apply(_Backend2["default"],args).then(function(response){return response.json()}).then(function(json){dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORDS_SUCCESS,payload:{recordType:recordType,data:json}})})["catch"](function(err){dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORDS_FAILURE,payload:{error:err,recordType:recordType}})})}}function fetchRecord(recordType,method,url){var payload={recordType:recordType},headers={Accept:"text/json"},methodToLowerCase=method.toLowerCase();return function(dispatch){dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORD_REQUEST,payload:payload});var args="get"===methodToLowerCase?[populate(url,payload),headers]:[populate(url,payload),{},headers];return _Backend2["default"][methodToLowerCase].apply(_Backend2["default"],args).then(function(response){return response.json()}).then(function(json){dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORD_SUCCESS,payload:{recordType:recordType,data:json}})})["catch"](function(err){dispatch({type:_RecordsActionTypes2["default"].FETCH_RECORD_FAILURE,payload:{error:err,recordType:recordType}})})}}function deleteRecord(recordType,id,method,url){var payload={recordType:recordType,id:id};return function(dispatch){return dispatch({type:_RecordsActionTypes2["default"].DELETE_RECORD_REQUEST,payload:payload}),_Backend2["default"][method.toLowerCase()](populate(url,payload)).then(function(){dispatch({type:_RecordsActionTypes2["default"].DELETE_RECORD_SUCCESS,payload:{recordType:recordType,id:id}})})["catch"](function(err){dispatch({type:_RecordsActionTypes2["default"].DELETE_RECORD_FAILURE,payload:{error:err,recordType:recordType,id:id}})})}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.fetchRecords=fetchRecords,exports.fetchRecord=fetchRecord,exports.deleteRecord=deleteRecord;var _RecordsActionTypes=require("./RecordsActionTypes"),_RecordsActionTypes2=_interopRequireDefault(_RecordsActionTypes),_Backend=require("lib/Backend.js"),_Backend2=_interopRequireDefault(_Backend)},{"./RecordsActionTypes":20,"lib/Backend.js":11}],22:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function recordsReducer(){var state=arguments.length<=0||void 0===arguments[0]?initialState:arguments[0],action=arguments[1],records=void 0,recordType=void 0,record=void 0;switch(action.type){case _RecordsActionTypes2["default"].CREATE_RECORD:return(0,_deepFreeze2["default"])(_extends({},state,{}));case _RecordsActionTypes2["default"].UPDATE_RECORD:return(0,_deepFreeze2["default"])(_extends({},state,{}));case _RecordsActionTypes2["default"].DELETE_RECORD:return(0,_deepFreeze2["default"])(_extends({},state,{}));case _RecordsActionTypes2["default"].FETCH_RECORDS_REQUEST:return state;case _RecordsActionTypes2["default"].FETCH_RECORDS_FAILURE:return state;case _RecordsActionTypes2["default"].FETCH_RECORDS_SUCCESS:return recordType=action.payload.recordType,records=action.payload.data._embedded[recordType+"s"]||{},records=records.reduce(function(prev,val){return _extends({},prev,_defineProperty({},val.ID,val))},{}),(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},recordType,records)));case _RecordsActionTypes2["default"].FETCH_RECORD_REQUEST:return state;case _RecordsActionTypes2["default"].FETCH_RECORD_FAILURE:return state;case _RecordsActionTypes2["default"].FETCH_RECORD_SUCCESS:return recordType=action.payload.recordType,record=action.payload.data,(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},recordType,_extends({},state[recordType],_defineProperty({},record.ID,record)))));case _RecordsActionTypes2["default"].DELETE_RECORD_REQUEST:return state;case _RecordsActionTypes2["default"].DELETE_RECORD_FAILURE:return state;case _RecordsActionTypes2["default"].DELETE_RECORD_SUCCESS:return recordType=action.payload.recordType,records=state[recordType],records=Object.keys(records).reduce(function(result,key){return parseInt(key,10)!==parseInt(action.payload.id,10)?_extends({},result,_defineProperty({},key,records[key])):result},{}),(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},recordType,records)));default:return state}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_deepFreeze=require("deep-freeze"),_deepFreeze2=_interopRequireDefault(_deepFreeze),_RecordsActionTypes=require("./RecordsActionTypes"),_RecordsActionTypes2=_interopRequireDefault(_RecordsActionTypes),initialState={};exports["default"]=recordsReducer},{"./RecordsActionTypes":20,"deep-freeze":"deep-freeze"}],23:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ACTION_TYPES={SET_SCHEMA:"SET_SCHEMA"};exports["default"]=ACTION_TYPES},{}],24:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function schemaReducer(){var state=arguments.length<=0||void 0===arguments[0]?initialState:arguments[0],action=arguments.length<=1||void 0===arguments[1]?null:arguments[1];switch(action.type){case _SchemaActionTypes2["default"].SET_SCHEMA:var id=action.payload.schema.schema_url;return(0,_deepFreeze2["default"])(_extends({},state,_defineProperty({},id,action.payload)));default:return state}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target};exports["default"]=schemaReducer;var _deepFreeze=require("deep-freeze"),_deepFreeze2=_interopRequireDefault(_deepFreeze),_SchemaActionTypes=require("./SchemaActionTypes"),_SchemaActionTypes2=_interopRequireDefault(_SchemaActionTypes),initialState=(0,_deepFreeze2["default"])({})},{"./SchemaActionTypes":23,"deep-freeze":"deep-freeze"}],25:[function(require,module,exports){function cleanUpNextTick(){draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue()}function drainQueue(){if(!draining){var timeout=setTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,clearTimeout(timeout)}}function Item(fun,array){this.fun=fun,this.array=array}function noop(){}var currentQueue,process=module.exports={},queue=[],draining=!1,queueIndex=-1;process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args)),1!==queue.length||draining||setTimeout(drainQueue,0)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.binding=function(name){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(dir){throw new Error("process.chdir is not supported")},process.umask=function(){return 0}},{}],26:[function(require,module,exports){(function(process,global){(function(){"use strict";function lib$es6$promise$utils$$objectOrFunction(x){return"function"==typeof x||"object"==typeof x&&null!==x}function lib$es6$promise$utils$$isFunction(x){return"function"==typeof x}function lib$es6$promise$asap$$setScheduler(scheduleFn){lib$es6$promise$asap$$customSchedulerFn=scheduleFn}function lib$es6$promise$asap$$setAsap(asapFn){
lib$es6$promise$asap$$asap=asapFn}function lib$es6$promise$asap$$useNextTick(){return function(){process.nextTick(lib$es6$promise$asap$$flush)}}function lib$es6$promise$asap$$useVertxTimer(){return function(){lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush)}}function lib$es6$promise$asap$$useMutationObserver(){var iterations=0,observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush),node=document.createTextNode("");return observer.observe(node,{characterData:!0}),function(){node.data=iterations=++iterations%2}}function lib$es6$promise$asap$$useMessageChannel(){var channel=new MessageChannel;return channel.port1.onmessage=lib$es6$promise$asap$$flush,function(){channel.port2.postMessage(0)}}function lib$es6$promise$asap$$useSetTimeout(){return function(){setTimeout(lib$es6$promise$asap$$flush,1)}}function lib$es6$promise$asap$$flush(){for(var i=0;lib$es6$promise$asap$$len>i;i+=2){var callback=lib$es6$promise$asap$$queue[i],arg=lib$es6$promise$asap$$queue[i+1];callback(arg),lib$es6$promise$asap$$queue[i]=void 0,lib$es6$promise$asap$$queue[i+1]=void 0}lib$es6$promise$asap$$len=0}function lib$es6$promise$asap$$attemptVertx(){try{var r=require,vertx=r("vertx");return lib$es6$promise$asap$$vertxNext=vertx.runOnLoop||vertx.runOnContext,lib$es6$promise$asap$$useVertxTimer()}catch(e){return lib$es6$promise$asap$$useSetTimeout()}}function lib$es6$promise$then$$then(onFulfillment,onRejection){var parent=this,state=parent._state;if(state===lib$es6$promise$$internal$$FULFILLED&&!onFulfillment||state===lib$es6$promise$$internal$$REJECTED&&!onRejection)return this;var child=new this.constructor(lib$es6$promise$$internal$$noop),result=parent._result;if(state){var callback=arguments[state-1];lib$es6$promise$asap$$asap(function(){lib$es6$promise$$internal$$invokeCallback(state,child,callback,result)})}else lib$es6$promise$$internal$$subscribe(parent,child,onFulfillment,onRejection);return child}function lib$es6$promise$promise$resolve$$resolve(object){var Constructor=this;if(object&&"object"==typeof object&&object.constructor===Constructor)return object;var promise=new Constructor(lib$es6$promise$$internal$$noop);return lib$es6$promise$$internal$$resolve(promise,object),promise}function lib$es6$promise$$internal$$noop(){}function lib$es6$promise$$internal$$selfFulfillment(){return new TypeError("You cannot resolve a promise with itself")}function lib$es6$promise$$internal$$cannotReturnOwn(){return new TypeError("A promises callback cannot return that same promise.")}function lib$es6$promise$$internal$$getThen(promise){try{return promise.then}catch(error){return lib$es6$promise$$internal$$GET_THEN_ERROR.error=error,lib$es6$promise$$internal$$GET_THEN_ERROR}}function lib$es6$promise$$internal$$tryThen(then,value,fulfillmentHandler,rejectionHandler){try{then.call(value,fulfillmentHandler,rejectionHandler)}catch(e){return e}}function lib$es6$promise$$internal$$handleForeignThenable(promise,thenable,then){lib$es6$promise$asap$$asap(function(promise){var sealed=!1,error=lib$es6$promise$$internal$$tryThen(then,thenable,function(value){sealed||(sealed=!0,thenable!==value?lib$es6$promise$$internal$$resolve(promise,value):lib$es6$promise$$internal$$fulfill(promise,value))},function(reason){sealed||(sealed=!0,lib$es6$promise$$internal$$reject(promise,reason))},"Settle: "+(promise._label||" unknown promise"));!sealed&&error&&(sealed=!0,lib$es6$promise$$internal$$reject(promise,error))},promise)}function lib$es6$promise$$internal$$handleOwnThenable(promise,thenable){thenable._state===lib$es6$promise$$internal$$FULFILLED?lib$es6$promise$$internal$$fulfill(promise,thenable._result):thenable._state===lib$es6$promise$$internal$$REJECTED?lib$es6$promise$$internal$$reject(promise,thenable._result):lib$es6$promise$$internal$$subscribe(thenable,void 0,function(value){lib$es6$promise$$internal$$resolve(promise,value)},function(reason){lib$es6$promise$$internal$$reject(promise,reason)})}function lib$es6$promise$$internal$$handleMaybeThenable(promise,maybeThenable,then){maybeThenable.constructor===promise.constructor&&then===lib$es6$promise$then$$default&&constructor.resolve===lib$es6$promise$promise$resolve$$default?lib$es6$promise$$internal$$handleOwnThenable(promise,maybeThenable):then===lib$es6$promise$$internal$$GET_THEN_ERROR?lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$GET_THEN_ERROR.error):void 0===then?lib$es6$promise$$internal$$fulfill(promise,maybeThenable):lib$es6$promise$utils$$isFunction(then)?lib$es6$promise$$internal$$handleForeignThenable(promise,maybeThenable,then):lib$es6$promise$$internal$$fulfill(promise,maybeThenable)}function lib$es6$promise$$internal$$resolve(promise,value){promise===value?lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$selfFulfillment()):lib$es6$promise$utils$$objectOrFunction(value)?lib$es6$promise$$internal$$handleMaybeThenable(promise,value,lib$es6$promise$$internal$$getThen(value)):lib$es6$promise$$internal$$fulfill(promise,value)}function lib$es6$promise$$internal$$publishRejection(promise){promise._onerror&&promise._onerror(promise._result),lib$es6$promise$$internal$$publish(promise)}function lib$es6$promise$$internal$$fulfill(promise,value){promise._state===lib$es6$promise$$internal$$PENDING&&(promise._result=value,promise._state=lib$es6$promise$$internal$$FULFILLED,0!==promise._subscribers.length&&lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish,promise))}function lib$es6$promise$$internal$$reject(promise,reason){promise._state===lib$es6$promise$$internal$$PENDING&&(promise._state=lib$es6$promise$$internal$$REJECTED,promise._result=reason,lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection,promise))}function lib$es6$promise$$internal$$subscribe(parent,child,onFulfillment,onRejection){var subscribers=parent._subscribers,length=subscribers.length;parent._onerror=null,subscribers[length]=child,subscribers[length+lib$es6$promise$$internal$$FULFILLED]=onFulfillment,subscribers[length+lib$es6$promise$$internal$$REJECTED]=onRejection,0===length&&parent._state&&lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish,parent)}function lib$es6$promise$$internal$$publish(promise){var subscribers=promise._subscribers,settled=promise._state;if(0!==subscribers.length){for(var child,callback,detail=promise._result,i=0;i<subscribers.length;i+=3)child=subscribers[i],callback=subscribers[i+settled],child?lib$es6$promise$$internal$$invokeCallback(settled,child,callback,detail):callback(detail);promise._subscribers.length=0}}function lib$es6$promise$$internal$$ErrorObject(){this.error=null}function lib$es6$promise$$internal$$tryCatch(callback,detail){try{return callback(detail)}catch(e){return lib$es6$promise$$internal$$TRY_CATCH_ERROR.error=e,lib$es6$promise$$internal$$TRY_CATCH_ERROR}}function lib$es6$promise$$internal$$invokeCallback(settled,promise,callback,detail){var value,error,succeeded,failed,hasCallback=lib$es6$promise$utils$$isFunction(callback);if(hasCallback){if(value=lib$es6$promise$$internal$$tryCatch(callback,detail),value===lib$es6$promise$$internal$$TRY_CATCH_ERROR?(failed=!0,error=value.error,value=null):succeeded=!0,promise===value)return void lib$es6$promise$$internal$$reject(promise,lib$es6$promise$$internal$$cannotReturnOwn())}else value=detail,succeeded=!0;promise._state!==lib$es6$promise$$internal$$PENDING||(hasCallback&&succeeded?lib$es6$promise$$internal$$resolve(promise,value):failed?lib$es6$promise$$internal$$reject(promise,error):settled===lib$es6$promise$$internal$$FULFILLED?lib$es6$promise$$internal$$fulfill(promise,value):settled===lib$es6$promise$$internal$$REJECTED&&lib$es6$promise$$internal$$reject(promise,value))}function lib$es6$promise$$internal$$initializePromise(promise,resolver){try{resolver(function(value){lib$es6$promise$$internal$$resolve(promise,value)},function(reason){lib$es6$promise$$internal$$reject(promise,reason)})}catch(e){lib$es6$promise$$internal$$reject(promise,e)}}function lib$es6$promise$promise$all$$all(entries){return new lib$es6$promise$enumerator$$default(this,entries).promise}function lib$es6$promise$promise$race$$race(entries){function onFulfillment(value){lib$es6$promise$$internal$$resolve(promise,value)}function onRejection(reason){lib$es6$promise$$internal$$reject(promise,reason)}var Constructor=this,promise=new Constructor(lib$es6$promise$$internal$$noop);if(!lib$es6$promise$utils$$isArray(entries))return lib$es6$promise$$internal$$reject(promise,new TypeError("You must pass an array to race.")),promise;for(var length=entries.length,i=0;promise._state===lib$es6$promise$$internal$$PENDING&&length>i;i++)lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]),void 0,onFulfillment,onRejection);return promise}function lib$es6$promise$promise$reject$$reject(reason){var Constructor=this,promise=new Constructor(lib$es6$promise$$internal$$noop);return lib$es6$promise$$internal$$reject(promise,reason),promise}function lib$es6$promise$promise$$needsResolver(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function lib$es6$promise$promise$$needsNew(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function lib$es6$promise$promise$$Promise(resolver){this._id=lib$es6$promise$promise$$counter++,this._state=void 0,this._result=void 0,this._subscribers=[],lib$es6$promise$$internal$$noop!==resolver&&("function"!=typeof resolver&&lib$es6$promise$promise$$needsResolver(),this instanceof lib$es6$promise$promise$$Promise?lib$es6$promise$$internal$$initializePromise(this,resolver):lib$es6$promise$promise$$needsNew())}function lib$es6$promise$enumerator$$Enumerator(Constructor,input){this._instanceConstructor=Constructor,this.promise=new Constructor(lib$es6$promise$$internal$$noop),Array.isArray(input)?(this._input=input,this.length=input.length,this._remaining=input.length,this._result=new Array(this.length),0===this.length?lib$es6$promise$$internal$$fulfill(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&lib$es6$promise$$internal$$fulfill(this.promise,this._result))):lib$es6$promise$$internal$$reject(this.promise,this._validationError())}function lib$es6$promise$polyfill$$polyfill(){var local;if("undefined"!=typeof global)local=global;else if("undefined"!=typeof self)local=self;else try{local=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var P=local.Promise;P&&"[object Promise]"===Object.prototype.toString.call(P.resolve())&&!P.cast||(local.Promise=lib$es6$promise$promise$$default)}var lib$es6$promise$utils$$_isArray;lib$es6$promise$utils$$_isArray=Array.isArray?Array.isArray:function(x){return"[object Array]"===Object.prototype.toString.call(x)};var lib$es6$promise$asap$$vertxNext,lib$es6$promise$asap$$customSchedulerFn,lib$es6$promise$asap$$scheduleFlush,lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray,lib$es6$promise$asap$$len=0,lib$es6$promise$asap$$asap=function(callback,arg){lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback,lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg,lib$es6$promise$asap$$len+=2,2===lib$es6$promise$asap$$len&&(lib$es6$promise$asap$$customSchedulerFn?lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush):lib$es6$promise$asap$$scheduleFlush())},lib$es6$promise$asap$$browserWindow="undefined"!=typeof window?window:void 0,lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow||{},lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver||lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver,lib$es6$promise$asap$$isNode="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),lib$es6$promise$asap$$isWorker="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,lib$es6$promise$asap$$queue=new Array(1e3);lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$isNode?lib$es6$promise$asap$$useNextTick():lib$es6$promise$asap$$BrowserMutationObserver?lib$es6$promise$asap$$useMutationObserver():lib$es6$promise$asap$$isWorker?lib$es6$promise$asap$$useMessageChannel():void 0===lib$es6$promise$asap$$browserWindow&&"function"==typeof require?lib$es6$promise$asap$$attemptVertx():lib$es6$promise$asap$$useSetTimeout();var lib$es6$promise$then$$default=lib$es6$promise$then$$then,lib$es6$promise$promise$resolve$$default=lib$es6$promise$promise$resolve$$resolve,lib$es6$promise$$internal$$PENDING=void 0,lib$es6$promise$$internal$$FULFILLED=1,lib$es6$promise$$internal$$REJECTED=2,lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject,lib$es6$promise$$internal$$TRY_CATCH_ERROR=new lib$es6$promise$$internal$$ErrorObject,lib$es6$promise$promise$all$$default=lib$es6$promise$promise$all$$all,lib$es6$promise$promise$race$$default=lib$es6$promise$promise$race$$race,lib$es6$promise$promise$reject$$default=lib$es6$promise$promise$reject$$reject,lib$es6$promise$promise$$counter=0,lib$es6$promise$promise$$default=lib$es6$promise$promise$$Promise;lib$es6$promise$promise$$Promise.all=lib$es6$promise$promise$all$$default,lib$es6$promise$promise$$Promise.race=lib$es6$promise$promise$race$$default,lib$es6$promise$promise$$Promise.resolve=lib$es6$promise$promise$resolve$$default,lib$es6$promise$promise$$Promise.reject=lib$es6$promise$promise$reject$$default,lib$es6$promise$promise$$Promise._setScheduler=lib$es6$promise$asap$$setScheduler,lib$es6$promise$promise$$Promise._setAsap=lib$es6$promise$asap$$setAsap,lib$es6$promise$promise$$Promise._asap=lib$es6$promise$asap$$asap,lib$es6$promise$promise$$Promise.prototype={constructor:lib$es6$promise$promise$$Promise,then:lib$es6$promise$then$$default,"catch":function(onRejection){return this.then(null,onRejection)}};var lib$es6$promise$enumerator$$default=lib$es6$promise$enumerator$$Enumerator;lib$es6$promise$enumerator$$Enumerator.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},lib$es6$promise$enumerator$$Enumerator.prototype._enumerate=function(){for(var length=this.length,input=this._input,i=0;this._state===lib$es6$promise$$internal$$PENDING&&length>i;i++)this._eachEntry(input[i],i)},lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry=function(entry,i){var c=this._instanceConstructor,resolve=c.resolve;if(resolve===lib$es6$promise$promise$resolve$$default){var then=lib$es6$promise$$internal$$getThen(entry);if(then===lib$es6$promise$then$$default&&entry._state!==lib$es6$promise$$internal$$PENDING)this._settledAt(entry._state,i,entry._result);else if("function"!=typeof then)this._remaining--,this._result[i]=entry;else if(c===lib$es6$promise$promise$$default){var promise=new c(lib$es6$promise$$internal$$noop);lib$es6$promise$$internal$$handleMaybeThenable(promise,entry,then),this._willSettleAt(promise,i)}else this._willSettleAt(new c(function(resolve){resolve(entry)}),i)}else this._willSettleAt(resolve(entry),i)},lib$es6$promise$enumerator$$Enumerator.prototype._settledAt=function(state,i,value){var promise=this.promise;promise._state===lib$es6$promise$$internal$$PENDING&&(this._remaining--,state===lib$es6$promise$$internal$$REJECTED?lib$es6$promise$$internal$$reject(promise,value):this._result[i]=value),0===this._remaining&&lib$es6$promise$$internal$$fulfill(promise,this._result)},lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt=function(promise,i){var enumerator=this;lib$es6$promise$$internal$$subscribe(promise,void 0,function(value){enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED,i,value)},function(reason){enumerator._settledAt(lib$es6$promise$$internal$$REJECTED,i,reason)})};var lib$es6$promise$polyfill$$default=lib$es6$promise$polyfill$$polyfill,lib$es6$promise$umd$$ES6Promise={Promise:lib$es6$promise$promise$$default,polyfill:lib$es6$promise$polyfill$$default};"function"==typeof define&&define.amd?define(function(){return lib$es6$promise$umd$$ES6Promise}):"undefined"!=typeof module&&module.exports?module.exports=lib$es6$promise$umd$$ES6Promise:"undefined"!=typeof this&&(this.ES6Promise=lib$es6$promise$umd$$ES6Promise),lib$es6$promise$polyfill$$default()}).call(this)}).call(this,require("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:25}],27:[function(require,module,exports){require("whatwg-fetch"),module.exports=self.fetch.bind(self)},{"whatwg-fetch":28}],28:[function(require,module,exports){!function(self){"use strict";function normalizeName(name){if("string"!=typeof name&&(name=String(name)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name))throw new TypeError("Invalid character in header field name");return name.toLowerCase()}function normalizeValue(value){return"string"!=typeof value&&(value=String(value)),value}function Headers(headers){this.map={},headers instanceof Headers?headers.forEach(function(value,name){this.append(name,value)},this):headers&&Object.getOwnPropertyNames(headers).forEach(function(name){this.append(name,headers[name])},this)}function consumed(body){return body.bodyUsed?Promise.reject(new TypeError("Already read")):void(body.bodyUsed=!0)}function fileReaderReady(reader){return new Promise(function(resolve,reject){reader.onload=function(){resolve(reader.result)},reader.onerror=function(){reject(reader.error)}})}function readBlobAsArrayBuffer(blob){var reader=new FileReader;return reader.readAsArrayBuffer(blob),fileReaderReady(reader)}function readBlobAsText(blob){var reader=new FileReader;return reader.readAsText(blob),fileReaderReady(reader)}function Body(){return this.bodyUsed=!1,this._initBody=function(body){if(this._bodyInit=body,"string"==typeof body)this._bodyText=body;else if(support.blob&&Blob.prototype.isPrototypeOf(body))this._bodyBlob=body;else if(support.formData&&FormData.prototype.isPrototypeOf(body))this._bodyFormData=body;else if(body){if(!support.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(body))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof body?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type&&this.headers.set("content-type",this._bodyBlob.type))},support.blob?(this.blob=function(){var rejected=consumed(this);if(rejected)return rejected;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(readBlobAsArrayBuffer)},this.text=function(){var rejected=consumed(this);if(rejected)return rejected;if(this._bodyBlob)return readBlobAsText(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var rejected=consumed(this);return rejected?rejected:Promise.resolve(this._bodyText)},support.formData&&(this.formData=function(){return this.text().then(decode)}),this.json=function(){return this.text().then(JSON.parse)},this}function normalizeMethod(method){var upcased=method.toUpperCase();return methods.indexOf(upcased)>-1?upcased:method}function Request(input,options){options=options||{};var body=options.body;if(Request.prototype.isPrototypeOf(input)){if(input.bodyUsed)throw new TypeError("Already read");this.url=input.url,this.credentials=input.credentials,options.headers||(this.headers=new Headers(input.headers)),this.method=input.method,this.mode=input.mode,body||(body=input._bodyInit,input.bodyUsed=!0)}else this.url=input;if(this.credentials=options.credentials||this.credentials||"omit",!options.headers&&this.headers||(this.headers=new Headers(options.headers)),this.method=normalizeMethod(options.method||this.method||"GET"),this.mode=options.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&body)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(body)}function decode(body){var form=new FormData;return body.trim().split("&").forEach(function(bytes){if(bytes){var split=bytes.split("="),name=split.shift().replace(/\+/g," "),value=split.join("=").replace(/\+/g," ");form.append(decodeURIComponent(name),decodeURIComponent(value))}}),form}function headers(xhr){var head=new Headers,pairs=xhr.getAllResponseHeaders().trim().split("\n");return pairs.forEach(function(header){var split=header.trim().split(":"),key=split.shift().trim(),value=split.join(":").trim();head.append(key,value)}),head}function Response(bodyInit,options){options||(options={}),this.type="default",this.status=options.status,this.ok=this.status>=200&&this.status<300,this.statusText=options.statusText,this.headers=options.headers instanceof Headers?options.headers:new Headers(options.headers),this.url=options.url||"",this._initBody(bodyInit)}if(!self.fetch){Headers.prototype.append=function(name,value){name=normalizeName(name),value=normalizeValue(value);var list=this.map[name];list||(list=[],this.map[name]=list),list.push(value)},Headers.prototype["delete"]=function(name){delete this.map[normalizeName(name)]},Headers.prototype.get=function(name){var values=this.map[normalizeName(name)];return values?values[0]:null},Headers.prototype.getAll=function(name){return this.map[normalizeName(name)]||[]},Headers.prototype.has=function(name){return this.map.hasOwnProperty(normalizeName(name))},Headers.prototype.set=function(name,value){this.map[normalizeName(name)]=[normalizeValue(value)]},Headers.prototype.forEach=function(callback,thisArg){Object.getOwnPropertyNames(this.map).forEach(function(name){this.map[name].forEach(function(value){callback.call(thisArg,value,name,this)},this)},this)};var support={blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self},methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];Request.prototype.clone=function(){return new Request(this)},Body.call(Request.prototype),Body.call(Response.prototype),Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})},Response.error=function(){var response=new Response(null,{status:0,statusText:""});return response.type="error",response};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(url,status){if(-1===redirectStatuses.indexOf(status))throw new RangeError("Invalid status code");return new Response(null,{status:status,headers:{location:url}})},self.Headers=Headers,self.Request=Request,self.Response=Response,self.fetch=function(input,init){return new Promise(function(resolve,reject){function responseURL(){return"responseURL"in xhr?xhr.responseURL:/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())?xhr.getResponseHeader("X-Request-URL"):void 0}var request;request=Request.prototype.isPrototypeOf(input)&&!init?input:new Request(input,init);var xhr=new XMLHttpRequest;xhr.onload=function(){var status=1223===xhr.status?204:xhr.status;if(100>status||status>599)return void reject(new TypeError("Network request failed"));var options={status:status,statusText:xhr.statusText,headers:headers(xhr),url:responseURL()},body="response"in xhr?xhr.response:xhr.responseText;resolve(new Response(body,options))},xhr.onerror=function(){reject(new TypeError("Network request failed"))},xhr.open(request.method,request.url,!0),"include"===request.credentials&&(xhr.withCredentials=!0),"responseType"in xhr&&support.blob&&(xhr.responseType="blob"),request.headers.forEach(function(value,name){xhr.setRequestHeader(name,value)}),xhr.send("undefined"==typeof request._bodyInit?null:request._bodyInit)})},self.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},{}],29:[function(require,module,exports){!function(isNode){function merge_recursive(base,extend){if("object"!==typeOf(base))return extend;for(var key in extend)"object"===typeOf(base[key])&&"object"===typeOf(extend[key])?base[key]=merge_recursive(base[key],extend[key]):base[key]=extend[key];return base}function merge(clone,recursive,argv){var result=argv[0],size=argv.length;(clone||"object"!==typeOf(result))&&(result={});for(var index=0;size>index;++index){var item=argv[index],type=typeOf(item);if("object"===type)for(var key in item){var sitem=clone?Public.clone(item[key]):item[key];recursive?result[key]=merge_recursive(result[key],sitem):result[key]=sitem}}return result}function typeOf(input){return{}.toString.call(input).slice(8,-1).toLowerCase()}var Public=function(clone){return merge(clone===!0,!1,arguments)},publicName="merge";Public.recursive=function(clone){return merge(clone===!0,!0,arguments)},Public.clone=function(input){var index,size,output=input,type=typeOf(input);if("array"===type)for(output=[],size=input.length,index=0;size>index;++index)output[index]=Public.clone(input[index]);else if("object"===type){output={};for(index in input)output[index]=Public.clone(input[index])}return output},isNode?module.exports=Public:window[publicName]=Public}("object"==typeof module&&module&&"object"==typeof module.exports&&module.exports)},{}],30:[function(require,module,exports){"use strict";var Stringify=require("./stringify"),Parse=require("./parse");module.exports={stringify:Stringify,parse:Parse}},{"./parse":31,"./stringify":32}],31:[function(require,module,exports){"use strict";var Utils=require("./utils"),internals={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1,allowDots:!1};internals.parseValues=function(str,options){for(var obj={},parts=str.split(options.delimiter,options.parameterLimit===1/0?void 0:options.parameterLimit),i=0;i<parts.length;++i){var part=parts[i],pos=-1===part.indexOf("]=")?part.indexOf("="):part.indexOf("]=")+1;if(-1===pos)obj[Utils.decode(part)]="",options.strictNullHandling&&(obj[Utils.decode(part)]=null);else{var key=Utils.decode(part.slice(0,pos)),val=Utils.decode(part.slice(pos+1));Object.prototype.hasOwnProperty.call(obj,key)?obj[key]=[].concat(obj[key]).concat(val):obj[key]=val}}return obj},internals.parseObject=function(chain,val,options){if(!chain.length)return val;var obj,root=chain.shift();if("[]"===root)obj=[],obj=obj.concat(internals.parseObject(chain,val,options));else{obj=options.plainObjects?Object.create(null):{};var cleanRoot="["===root[0]&&"]"===root[root.length-1]?root.slice(1,root.length-1):root,index=parseInt(cleanRoot,10);!isNaN(index)&&root!==cleanRoot&&String(index)===cleanRoot&&index>=0&&options.parseArrays&&index<=options.arrayLimit?(obj=[],obj[index]=internals.parseObject(chain,val,options)):obj[cleanRoot]=internals.parseObject(chain,val,options)}return obj},internals.parseKeys=function(givenKey,val,options){if(givenKey){var key=options.allowDots?givenKey.replace(/\.([^\.\[]+)/g,"[$1]"):givenKey,parent=/^([^\[\]]*)/,child=/(\[[^\[\]]*\])/g,segment=parent.exec(key),keys=[];if(segment[1]){if(!options.plainObjects&&Object.prototype.hasOwnProperty(segment[1])&&!options.allowPrototypes)return;keys.push(segment[1])}for(var i=0;null!==(segment=child.exec(key))&&i<options.depth;)i+=1,(options.plainObjects||!Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g,""))||options.allowPrototypes)&&keys.push(segment[1]);return segment&&keys.push("["+key.slice(segment.index)+"]"),internals.parseObject(keys,val,options)}},module.exports=function(str,opts){var options=opts||{};if(options.delimiter="string"==typeof options.delimiter||Utils.isRegExp(options.delimiter)?options.delimiter:internals.delimiter,options.depth="number"==typeof options.depth?options.depth:internals.depth,options.arrayLimit="number"==typeof options.arrayLimit?options.arrayLimit:internals.arrayLimit,options.parseArrays=options.parseArrays!==!1,options.allowDots="boolean"==typeof options.allowDots?options.allowDots:internals.allowDots,options.plainObjects="boolean"==typeof options.plainObjects?options.plainObjects:internals.plainObjects,options.allowPrototypes="boolean"==typeof options.allowPrototypes?options.allowPrototypes:internals.allowPrototypes,options.parameterLimit="number"==typeof options.parameterLimit?options.parameterLimit:internals.parameterLimit,options.strictNullHandling="boolean"==typeof options.strictNullHandling?options.strictNullHandling:internals.strictNullHandling,""===str||null===str||"undefined"==typeof str)return options.plainObjects?Object.create(null):{};for(var tempObj="string"==typeof str?internals.parseValues(str,options):str,obj=options.plainObjects?Object.create(null):{},keys=Object.keys(tempObj),i=0;i<keys.length;++i){var key=keys[i],newObj=internals.parseKeys(key,tempObj[key],options);obj=Utils.merge(obj,newObj,options)}return Utils.compact(obj)}},{"./utils":33}],32:[function(require,module,exports){"use strict";var Utils=require("./utils"),internals={delimiter:"&",arrayPrefixGenerators:{brackets:function(prefix){return prefix+"[]"},indices:function(prefix,key){return prefix+"["+key+"]"},repeat:function(prefix){return prefix}},strictNullHandling:!1,skipNulls:!1,encode:!0};internals.stringify=function(object,prefix,generateArrayPrefix,strictNullHandling,skipNulls,encode,filter,sort,allowDots){var obj=object;if("function"==typeof filter)obj=filter(prefix,obj);else if(Utils.isBuffer(obj))obj=String(obj);else if(obj instanceof Date)obj=obj.toISOString();else if(null===obj){if(strictNullHandling)return encode?Utils.encode(prefix):prefix;obj=""}if("string"==typeof obj||"number"==typeof obj||"boolean"==typeof obj)return encode?[Utils.encode(prefix)+"="+Utils.encode(obj)]:[prefix+"="+obj];var values=[];if("undefined"==typeof obj)return values;var objKeys;if(Array.isArray(filter))objKeys=filter;else{var keys=Object.keys(obj);objKeys=sort?keys.sort(sort):keys}for(var i=0;i<objKeys.length;++i){var key=objKeys[i];skipNulls&&null===obj[key]||(values=Array.isArray(obj)?values.concat(internals.stringify(obj[key],generateArrayPrefix(prefix,key),generateArrayPrefix,strictNullHandling,skipNulls,encode,filter,sort,allowDots)):values.concat(internals.stringify(obj[key],prefix+(allowDots?"."+key:"["+key+"]"),generateArrayPrefix,strictNullHandling,skipNulls,encode,filter,sort,allowDots)))}return values},module.exports=function(object,opts){var objKeys,filter,obj=object,options=opts||{},delimiter="undefined"==typeof options.delimiter?internals.delimiter:options.delimiter,strictNullHandling="boolean"==typeof options.strictNullHandling?options.strictNullHandling:internals.strictNullHandling,skipNulls="boolean"==typeof options.skipNulls?options.skipNulls:internals.skipNulls,encode="boolean"==typeof options.encode?options.encode:internals.encode,sort="function"==typeof options.sort?options.sort:null,allowDots="undefined"==typeof options.allowDots?!1:options.allowDots;"function"==typeof options.filter?(filter=options.filter,obj=filter("",obj)):Array.isArray(options.filter)&&(objKeys=filter=options.filter);var keys=[];if("object"!=typeof obj||null===obj)return"";var arrayFormat;arrayFormat=options.arrayFormat in internals.arrayPrefixGenerators?options.arrayFormat:"indices"in options?options.indices?"indices":"repeat":"indices";var generateArrayPrefix=internals.arrayPrefixGenerators[arrayFormat];objKeys||(objKeys=Object.keys(obj)),sort&&objKeys.sort(sort);for(var i=0;i<objKeys.length;++i){var key=objKeys[i];skipNulls&&null===obj[key]||(keys=keys.concat(internals.stringify(obj[key],key,generateArrayPrefix,strictNullHandling,skipNulls,encode,filter,sort,allowDots)))}return keys.join(delimiter)}},{"./utils":33}],33:[function(require,module,exports){"use strict";var hexTable=function(){for(var array=new Array(256),i=0;256>i;++i)array[i]="%"+((16>i?"0":"")+i.toString(16)).toUpperCase();return array}();exports.arrayToObject=function(source,options){for(var obj=options.plainObjects?Object.create(null):{},i=0;i<source.length;++i)"undefined"!=typeof source[i]&&(obj[i]=source[i]);
return obj},exports.merge=function(target,source,options){if(!source)return target;if("object"!=typeof source){if(Array.isArray(target))target.push(source);else{if("object"!=typeof target)return[target,source];target[source]=!0}return target}if("object"!=typeof target)return[target].concat(source);var mergeTarget=target;return Array.isArray(target)&&!Array.isArray(source)&&(mergeTarget=exports.arrayToObject(target,options)),Object.keys(source).reduce(function(acc,key){var value=source[key];return Object.prototype.hasOwnProperty.call(acc,key)?acc[key]=exports.merge(acc[key],value,options):acc[key]=value,acc},mergeTarget)},exports.decode=function(str){try{return decodeURIComponent(str.replace(/\+/g," "))}catch(e){return str}},exports.encode=function(str){if(0===str.length)return str;for(var string="string"==typeof str?str:String(str),out="",i=0;i<string.length;++i){var c=string.charCodeAt(i);45===c||46===c||95===c||126===c||c>=48&&57>=c||c>=65&&90>=c||c>=97&&122>=c?out+=string.charAt(i):128>c?out+=hexTable[c]:2048>c?out+=hexTable[192|c>>6]+hexTable[128|63&c]:55296>c||c>=57344?out+=hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|63&c]:(i+=1,c=65536+((1023&c)<<10|1023&string.charCodeAt(i)),out+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|63&c])}return out},exports.compact=function(obj,references){if("object"!=typeof obj||null===obj)return obj;var refs=references||[],lookup=refs.indexOf(obj);if(-1!==lookup)return refs[lookup];if(refs.push(obj),Array.isArray(obj)){for(var compacted=[],i=0;i<obj.length;++i)"undefined"!=typeof obj[i]&&compacted.push(obj[i]);return compacted}for(var keys=Object.keys(obj),j=0;j<keys.length;++j){var key=keys[j];obj[key]=exports.compact(obj[key],refs)}return obj},exports.isRegExp=function(obj){return"[object RegExp]"===Object.prototype.toString.call(obj)},exports.isBuffer=function(obj){return null===obj||"undefined"==typeof obj?!1:!!(obj.constructor&&obj.constructor.isBuffer&&obj.constructor.isBuffer(obj))}},{}],34:[function(require,module,exports){"use strict";function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}function _typeof(obj){return obj&&"undefined"!=typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj}function getLogLevel(level,action,payload,type){switch("undefined"==typeof level?"undefined":_typeof(level)){case"object":return"function"==typeof level[type]?level[type].apply(level,_toConsumableArray(payload)):level[type];case"function":return level(action);default:return level}}function createLogger(){function printBuffer(){logBuffer.forEach(function(logEntry,key){var started=logEntry.started,startedTime=logEntry.startedTime,action=logEntry.action,prevState=logEntry.prevState,error=logEntry.error,took=logEntry.took,nextState=logEntry.nextState,nextEntry=logBuffer[key+1];nextEntry&&(nextState=nextEntry.prevState,took=nextEntry.started-started);var formattedAction=actionTransformer(action),isCollapsed="function"==typeof collapsed?collapsed(function(){return nextState},action):collapsed,formattedTime=formatTime(startedTime),titleCSS=colors.title?"color: "+colors.title(formattedAction)+";":null,title="action "+(timestamp?formattedTime:"")+" "+formattedAction.type+" "+(duration?"(in "+took.toFixed(2)+" ms)":"");try{isCollapsed?colors.title?logger.groupCollapsed("%c "+title,titleCSS):logger.groupCollapsed(title):colors.title?logger.group("%c "+title,titleCSS):logger.group(title)}catch(e){logger.log(title)}var prevStateLevel=getLogLevel(level,formattedAction,[prevState],"prevState"),actionLevel=getLogLevel(level,formattedAction,[formattedAction],"action"),errorLevel=getLogLevel(level,formattedAction,[error,prevState],"error"),nextStateLevel=getLogLevel(level,formattedAction,[nextState],"nextState");prevStateLevel&&(colors.prevState?logger[prevStateLevel]("%c prev state","color: "+colors.prevState(prevState)+"; font-weight: bold",prevState):logger[prevStateLevel]("prev state",prevState)),actionLevel&&(colors.action?logger[actionLevel]("%c action","color: "+colors.action(formattedAction)+"; font-weight: bold",formattedAction):logger[actionLevel]("action",formattedAction)),error&&errorLevel&&(colors.error?logger[errorLevel]("%c error","color: "+colors.error(error,prevState)+"; font-weight: bold",error):logger[errorLevel]("error",error)),nextStateLevel&&(colors.nextState?logger[nextStateLevel]("%c next state","color: "+colors.nextState(nextState)+"; font-weight: bold",nextState):logger[nextStateLevel]("next state",nextState));try{logger.groupEnd()}catch(e){logger.log("—— log end ——")}}),logBuffer.length=0}var options=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],_options$level=options.level,level=void 0===_options$level?"log":_options$level,_options$logger=options.logger,logger=void 0===_options$logger?console:_options$logger,_options$logErrors=options.logErrors,logErrors=void 0===_options$logErrors?!0:_options$logErrors,collapsed=options.collapsed,predicate=options.predicate,_options$duration=options.duration,duration=void 0===_options$duration?!1:_options$duration,_options$timestamp=options.timestamp,timestamp=void 0===_options$timestamp?!0:_options$timestamp,transformer=options.transformer,_options$stateTransfo=options.stateTransformer,stateTransformer=void 0===_options$stateTransfo?function(state){return state}:_options$stateTransfo,_options$actionTransf=options.actionTransformer,actionTransformer=void 0===_options$actionTransf?function(actn){return actn}:_options$actionTransf,_options$errorTransfo=options.errorTransformer,errorTransformer=void 0===_options$errorTransfo?function(error){return error}:_options$errorTransfo,_options$colors=options.colors,colors=void 0===_options$colors?{title:function(){return"#000000"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}}:_options$colors;if("undefined"==typeof logger)return function(){return function(next){return function(action){return next(action)}}};transformer&&console.error("Option 'transformer' is deprecated, use stateTransformer instead");var logBuffer=[];return function(_ref){var getState=_ref.getState;return function(next){return function(action){if("function"==typeof predicate&&!predicate(getState,action))return next(action);var logEntry={};logBuffer.push(logEntry),logEntry.started=timer.now(),logEntry.startedTime=new Date,logEntry.prevState=stateTransformer(getState()),logEntry.action=action;var returnedValue=void 0;if(logErrors)try{returnedValue=next(action)}catch(e){logEntry.error=errorTransformer(e)}else returnedValue=next(action);if(logEntry.took=timer.now()-logEntry.started,logEntry.nextState=stateTransformer(getState()),printBuffer(),logEntry.error)throw logEntry.error;return returnedValue}}}}var repeat=function(str,times){return new Array(times+1).join(str)},pad=function(num,maxLength){return repeat("0",maxLength-num.toString().length)+num},formatTime=function(time){return"@ "+pad(time.getHours(),2)+":"+pad(time.getMinutes(),2)+":"+pad(time.getSeconds(),2)+"."+pad(time.getMilliseconds(),3)},timer="undefined"!=typeof performance&&"function"==typeof performance.now?performance:Date;module.exports=createLogger},{}]},{},[1]);
//# sourceMappingURL=bundle-framework.js.map

File diff suppressed because one or more lines are too long

View File

@ -2,13 +2,31 @@ import React from 'react';
import SilverStripeComponent from 'lib/SilverStripeComponent';
class AccordionItem extends SilverStripeComponent {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
render() {
let className = `list-group-item ${this.props.className}`;
return (
<a tabIndex="0" className={className}>
<a tabIndex="0" className={className} onClick={this.handleClick}>
{this.props.children}
</a>
);
}
handleClick(event) {
if (this.props.handleClick) {
this.props.handleClick(event, this.props.handleClickArg);
}
}
}
AccordionItem.propTypes = {
handleClickArg: React.PropTypes.any,
handleClick: React.PropTypes.func,
};
export default AccordionItem;

View File

@ -7,27 +7,46 @@ import SilverStripeComponent from 'lib/SilverStripeComponent';
class Preview extends SilverStripeComponent {
render() {
return (
<div className="cms-content__right preview">
<iframe className="preview__iframe" src={this.props.previewUrl}></iframe>
// @todo - Multiple preview views with toggle slider
let body = null;
if (!this.props.previewUrl) {
body = (
<div className="preview__overlay">
<h3 className="preview__overlay-text">There is no preview available for this item.</h3>
</div>
);
} else if (this.props.previewType.indexOf('image/') === 0) {
body = (
<div className="preview__file-container panel-scrollable">
<img className="preview__file--fits-space" src="http://placehold.it/250x150" />
<img alt={this.props.previewUrl} className="preview__file--fits-space" src={this.props.previewUrl} />
</div>
<a href="" className="cms-content__back-btn font-icon-left-open-big"></a>
);
} else {
body = <iframe className="preview__iframe" src={this.props.previewUrl}></iframe>;
}
return (
<div className="cms-content__right preview">
{body}
<a href="" className="cms-content__back-btn font-icon-left-open-big" />
<div className="toolbar--south">
<div className="btn-toolbar">
<button className="btn btn-secondary btn-secondary" type="button"><i className="font-icon-edit"></i> Edit</button>
<button type="button" data-container="body" className="btn btn-link btn--options" data-toggle="popover" title="Page actions" data-placement="top" data-content="<a href=''>Add to campaign</a><a href=''>Remove from campaign</a>"><i className="font-icon-dot-3"></i></button>
<button className="btn btn-secondary btn-secondary" type="button">
<i className="font-icon-edit" /> Edit
</button>
<button type="button" data-container="body" className="btn btn-link btn--options"
data-toggle="popover" title="Page actions" data-placement="top"
data-content="<a href=''>Add to campaign</a><a href=''>Remove from campaign</a>"
><i className="font-icon-dot-3" /></button>
</div>
</div>
</div>
);
}
}
Preview.propTypes = {
previewUrl: React.PropTypes.string.isRequired,
previewType: React.PropTypes.string, // Mime type
};
export default Preview;

View File

@ -297,20 +297,6 @@ class CampaignAdmin extends SilverStripeComponent {
];
}
/**
* Gets preview URL for itemid
* @param int id
* @returns string
*/
previewURLForItem(id) {
if (!id) {
return '';
}
// hard code in baseurl for any itemid preview url
return document.getElementsByTagName('base')[0].href;
}
addCampaign() {
const path = this.props.sectionConfig.campaignViewRoute
.replace(/:type\?/, 'set')

View File

@ -4,7 +4,7 @@
margin-left: -$spacer-y;
margin-right: -$spacer-y;
border-bottom: 1px solid $border-color-light;
margin-bottom: $spacer-y*.75;
margin-bottom: 0;
}
.list-group-item {
@ -17,7 +17,8 @@
&:first-child {
border-top: none;
}
&:hover {
&:hover,
&:focus {
text-decoration: none;
.list-group-item--has-links {
@ -26,6 +27,14 @@
}
}
&:focus {
outline-width: 1px;
outline-offset: -1px;
outline-style: solid;
outline-color: $brand-primary;
z-index: 1;
}
&.active {
background-color: $brand-primary;
color: #FFF;
@ -36,10 +45,15 @@
color: #FFF;
opacity: 1;
}
// Focus color clashes with selected colour
&:focus {
outline-color: darken($brand-primary, 10%);
}
}
}
.list-group-item__heading {
.list-group-item-heading {
font-weight: 400;
font-size: 14px;
margin: 2px 0 5px;
@ -52,7 +66,8 @@
display: block;
background: #ccc;
float: left;
margin: -12px 12px 0 -$spacer-y;
// See negate padding on bootstrap .list-group-item in _list-group.scss
margin: -12px 12px 0 (0 - $spacer-y);
}
.label {

View File

@ -6,6 +6,7 @@ import i18n from 'i18n';
* Describes an individual campaign item
*/
class CampaignAdminItem extends SilverStripeComponent {
render() {
let thumbnail = null;
const badge = {};
@ -41,22 +42,25 @@ class CampaignAdminItem extends SilverStripeComponent {
// Linked items
let links = (
<span className="list-group-item--has-links">
<i className="font-icon-link"></i>
<i className="font-icon-link" />
3 linked items
</span>
);
// Thumbnail
if (item.Thumbnail) {
thumbnail = <span className="list-group-item__thumbnail"><img src={item.Thumbnail} /></span>;
thumbnail = (
<span className="list-group-item__thumbnail">
<img alt={item.Title} src={item.Thumbnail} />
</span>
);
}
return (
<div>
{thumbnail}
<h4 className="list-group-item__heading">{item.Title}</h4>
<span className="list-group-item--is-linked"><i className="font-icon-link"></i></span>
<h4 className="list-group-item-heading">{item.Title}</h4>
<span className="list-group-item--is-linked"><i className="font-icon-link" /></span>
{links}
{badge.className && badge.Title &&
<span className={badge.className}>{badge.Title}</span>

View File

@ -24,6 +24,7 @@ class CampaignAdminList extends SilverStripeComponent {
super(props);
this.handlePublish = this.handlePublish.bind(this);
this.handleItemSelected = this.handleItemSelected.bind(this);
}
componentDidMount() {
@ -38,18 +39,17 @@ class CampaignAdminList extends SilverStripeComponent {
* @return object
*/
render() {
const itemID = 1; // todo - hook up to "click" handler for changesetitems
let itemID = this.props.campaign.changeSetItemId;
let previewUrl = null;
let previewType = null;
const campaignId = this.props.campaignId;
const campaign = this.props.record;
// Trigger different layout when preview is enabled
const previewUrl = this.previewURLForItem(itemID);
const itemGroups = this.groupItemsForSet();
const classNames = previewUrl ? 'cms-content__split cms-content__split--left-sm' : 'cms-content__split cms-content__split--none';
// Get items in this set
let accordionGroups = [];
Object.keys(itemGroups).forEach(className => {
const group = itemGroups[className];
const groupCount = group.items.length;
@ -60,15 +60,34 @@ class CampaignAdminList extends SilverStripeComponent {
// Create items for this group
group.items.forEach(item => {
// Add extra css class for published items
let itemClassName = '';
// Auto-select first item
if (!itemID) {
itemID = item.ID;
}
// Find preview url
const selected = (itemID === item.ID);
if (selected && item._links.preview) {
if (item._links.preview.Stage) {
previewUrl = item._links.preview.Stage.href;
previewType = item._links.preview.Stage.type;
} else if (item._links.preview.Live) {
previewUrl = item._links.preview.Live.href;
previewType = item._links.preview.Live.type;
}
}
// Add extra css class for published items
const itemClassNames = [];
if (item.ChangeType === 'none' || campaign.State === 'published') {
itemClassName = 'list-group-item--published';
itemClassNames.push('list-group-item--published');
}
if (selected) {
itemClassNames.push('active');
}
accordionItems.push(
<AccordionItem key={item.ID} className={itemClassName}>
<AccordionItem key={item.ID} className={itemClassNames.join(' ')} handleClick={this.handleItemSelected} handleClickArg={item.ID} >
<CampaignAdminItem item={item} campaign={this.props.record} />
</AccordionItem>
);
@ -82,6 +101,11 @@ class CampaignAdminList extends SilverStripeComponent {
);
});
// Get preview details
const classNames = previewUrl
? 'cms-content__split cms-content__split--left-sm'
: 'cms-content__split cms-content__split--none';
return (
<div className={classNames}>
<div className="cms-content__left collapse in" aria-expanded="true">
@ -97,11 +121,21 @@ class CampaignAdminList extends SilverStripeComponent {
{this.renderButtonToolbar()}
</div>
</div>
{ previewUrl && <Preview previewUrl={previewUrl} /> }
{ previewUrl && <Preview previewUrl={previewUrl} previewType={previewType} /> }
</div>
);
}
/**
* Callback for items being clicked on
*
* @param {object} event
* @param {number} itemId
*/
handleItemSelected(event, itemId) {
this.props.campaignActions.selectChangeSetItem(itemId);
}
renderButtonToolbar() {
const items = this.getItems();
@ -152,20 +186,6 @@ class CampaignAdminList extends SilverStripeComponent {
);
}
/**
* Gets preview URL for itemid
* @param int id
* @returns string
*/
previewURLForItem(id) {
if (!id) {
return '';
}
// hard code in baseurl for any itemid preview url
return document.getElementsByTagName('base')[0].href;
}
/**
* @return {Array}
*/
@ -222,6 +242,7 @@ class CampaignAdminList extends SilverStripeComponent {
CampaignAdminList.propTypes = {
campaign: React.PropTypes.shape({
isPublishing: React.PropTypes.bool.isRequired,
changeSetItemId: React.PropTypes.number,
}),
campaignActions: React.PropTypes.object.isRequired,
publishApi: React.PropTypes.func.isRequired,

View File

@ -1,18 +0,0 @@
import React from 'react';
import SilverStripeComponent from 'lib/SilverStripeComponent';
/**
* Renders the right-hand collapsable change preview panel
*/
class CampaignAdminPreview extends SilverStripeComponent {
render() {
return (
<div className="pages-preview">
<iframe src={this.props.previewUrl}></iframe>
</div>
);
}
}
export default CampaignAdminPreview;

View File

@ -1,5 +1,6 @@
export default {
SET_CAMPAIGN_ACTIVE_CHANGESET: 'SET_CAMPAIGN_ACTIVE_CHANGESET',
SET_CAMPAIGN_SELECTED_CHANGESETITEM: 'SET_CAMPAIGN_SELECTED_CHANGESETITEM',
PUBLISH_CAMPAIGN_REQUEST: 'PUBLISH_CAMPAIGN_REQUEST',
PUBLISH_CAMPAIGN_SUCCESS: 'PUBLISH_CAMPAIGN_SUCCESS',
PUBLISH_CAMPAIGN_FAILURE: 'PUBLISH_CAMPAIGN_FAILURE',

View File

@ -1,11 +1,26 @@
import ACTION_TYPES from './CampaignActionTypes';
import RECORD_ACTION_TYPES from 'state/records/RecordsActionTypes';
/**
* Set selected changeset item
*
* @param {number} changeSetItemId ID of changesetitem in the currently visible changeset
* @return {object}
*/
export function selectChangeSetItem(changeSetItemId) {
return {
type: ACTION_TYPES.SET_CAMPAIGN_SELECTED_CHANGESETITEM,
payload: { changeSetItemId },
};
}
/**
* Show specified campaign set
*
* @param number campaignId - ID of the Campaign to show.
* @param string view - The view mode to display the Campaign in.
* @param {number} campaignId ID of the Campaign to show.
* @param {string} view The view mode to display the Campaign in.
* @return {function}
*/
export function showCampaignView(campaignId, view) {
return {

View File

@ -3,6 +3,7 @@ import ACTION_TYPES from './CampaignActionTypes';
const initialState = deepFreeze({
campaignId: null,
changeSetItemId: null,
isPublishing: false,
view: null,
});
@ -10,10 +11,16 @@ const initialState = deepFreeze({
function reducer(state = initialState, action) {
switch (action.type) {
case ACTION_TYPES.SET_CAMPAIGN_SELECTED_CHANGESETITEM:
return deepFreeze(Object.assign({}, state, {
changeSetItemId: action.payload.changeSetItemId,
}));
case ACTION_TYPES.SET_CAMPAIGN_ACTIVE_CHANGESET:
return deepFreeze(Object.assign({}, state, {
campaignId: action.payload.campaignId,
view: action.payload.view,
changeSetItemId: null,
}));
case ACTION_TYPES.PUBLISH_CAMPAIGN_REQUEST:

View File

@ -14,13 +14,24 @@
interface CMSPreviewable {
/**
* @return String Absolute URL to the end-user view for this record.
* Determine the preview link, if available, for this object.
* If no preview is available for this record, it may return null.
*
* @param string $action
* @return string Link to the end-user view for this record.
* Example: http://mysite.com/my-record
*/
public function Link();
public function PreviewLink($action = null);
/**
* @return String Absolute URL to the CMS-author view. Should point to a
* To determine preview mechanism (e.g. embedded / iframe)
*
* @return string
*/
public function getMimeType();
/**
* @return string Link to the CMS-author view. Should point to a
* controller subclassing {@link LeftAndMain}. Example:
* http://mysite.com/admin/edit/6
*/

View File

@ -233,6 +233,9 @@ JSON;
* @return array
*/
protected function getChangeSetResource(ChangeSet $changeSet) {
// Before presenting the changeset to the client,
// synchronise it with new changes.
$changeSet->sync();
$hal = [
'_links' => [
'self' => [
@ -291,6 +294,20 @@ JSON;
'Plural' => $baseSingleton->i18n_plural_name(),
'Thumbnail' => $changeSetItem->ThumbnailURL($thumbnailWidth, $thumbnailHeight),
];
// Get preview urls
$previews = $changeSetItem->getPreviewLinks();
if($previews) {
$hal['_links']['preview'] = $previews;
}
// Get edit link
$editLink = $changeSetItem->CMSEditLink();
if($editLink) {
$hal['_links']['edit'] = [
'href' => $editLink,
];
}
// Depending on whether the object was added implicitly or explicitly, set
// other related objects.
if($changeSetItem->Added === ChangeSetItem::IMPLICITLY) {

View File

@ -41,6 +41,7 @@
* `CMSBatchAction_DeleteFromLive` is removed.
* `CMSMain.enabled_legacy_actions` config is removed.
* `DataObject::can` has new method signature with `$context` parameter.
* `SiteTree.alternatePreviewLink` is deprecated. Use `updatePreviewLink` instead.
## New API

View File

@ -1,5 +1,6 @@
<?php
use SilverStripe\Filesystem\Storage\DBFile;
use SilverStripe\Filesystem\Thumbnail;
use SilverStripe\Filesystem\ImageManipulation;
use SilverStripe\Filesystem\Storage\AssetContainer;
@ -65,7 +66,7 @@ use SilverStripe\Filesystem\Storage\AssetContainer;
* @mixin Hierarchy
* @mixin Versioned
*/
class File extends DataObject implements ShortcodeHandler, AssetContainer, Thumbnail {
class File extends DataObject implements ShortcodeHandler, AssetContainer, Thumbnail, CMSPreviewable {
use ImageManipulation;
@ -709,7 +710,7 @@ class File extends DataObject implements ShortcodeHandler, AssetContainer, Thumb
public function getURL($grant = true) {
if($this->File->exists()) {
return $this->File->getURL($grant);
}
}
}
/**
@ -721,7 +722,7 @@ class File extends DataObject implements ShortcodeHandler, AssetContainer, Thumb
public function getSourceURL($grant = true) {
if($this->File->exists()) {
return $this->File->getSourceURL($grant);
}
}
}
/**
@ -1162,4 +1163,17 @@ class File extends DataObject implements ShortcodeHandler, AssetContainer, Thumb
public function canViewFile() {
return $this->File->canViewFile();
}
public function CMSEditLink() {
$link = null;
$this->extend('updateCMSEditLink', $link);
return $link;
}
public function PreviewLink($action = null) {
// No preview for non-images by default
$link = null;
$this->extend('updatePreviewLink', $link, $action);
return $link;
}
}

View File

@ -120,4 +120,15 @@ class Image extends File implements ShortcodeHandler {
$regenerator = ShortcodeParser::get('regenerator');
return $regenerator->parse($value);
}
public function PreviewLink($action = null) {
// Since AbsoluteLink can whitelist protected assets,
// do permission check first
if(!$this->canView()) {
return false;
}
$link = $this->AbsoluteLink();
$this->extend('updatePreviewLink', $link, $action);
return $link;
}
}

View File

@ -345,4 +345,49 @@ class ChangeSetItem extends DataObject implements Thumbnail {
'ObjectClass' => ClassInfo::baseDataClass($objectClass)
]);
}
/**
* Gets the list of modes this record can be previewed in.
*
* {@link https://tools.ietf.org/html/draft-kelly-json-hal-07#section-5}
*
* @return array Map of links in acceptable HAL format
*/
public function getPreviewLinks() {
$links = [];
// Preview draft
$stage = $this->getObjectInStage(Versioned::DRAFT);
if($stage instanceof CMSPreviewable && $stage->canView() && ($link = $stage->PreviewLink())) {
$links[Versioned::DRAFT] = [
'href' => Controller::join_links($link, '?stage=' . Versioned::DRAFT),
'type' => $stage->getMimeType(),
];
}
// Preview live
$live = $this->getObjectInStage(Versioned::LIVE);
if($live instanceof CMSPreviewable && $live->canView() && ($link = $live->PreviewLink())) {
$links[Versioned::LIVE] = [
'href' => Controller::join_links($link, '?stage=' . Versioned::LIVE),
'type' => $live->getMimeType(),
];
}
return $links;
}
/**
* Get edit link for this item
*
* @return string
*/
public function CMSEditLink()
{
$link = $this->getObjectInStage(Versioned::DRAFT);
if($link instanceof CMSPreviewable) {
return $link->CMSEditLink();
}
return null;
}
}

View File

@ -719,7 +719,7 @@ class ViewableData_Debugger extends ViewableData {
* @return string The rendered debugger
*/
public function __toString() {
return $this->forTemplate();
return (string)$this->forTemplate();
}
/**