@clickview/curator 1.0.38-rc.2 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/curator-app.js +1 -1
- package/package.json +3 -3
package/dist/curator-app.js
CHANGED
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,b=r?Symbol.for("react.block"):60121,g=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function O(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case f:case p:case a:case s:case c:case m:return e;default:switch(e=e&&e.$$typeof){case l:case d:case v:case y:case u:return e;default:return t}}case o:return t}}}function C(e){return O(e)===p}t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=u,t.Element=i,t.ForwardRef=d,t.Fragment=a,t.Lazy=v,t.Memo=y,t.Portal=o,t.Profiler=s,t.StrictMode=c,t.Suspense=m,t.isAsyncMode=function(e){return C(e)||O(e)===f},t.isConcurrentMode=C,t.isContextConsumer=function(e){return O(e)===l},t.isContextProvider=function(e){return O(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return O(e)===d},t.isFragment=function(e){return O(e)===a},t.isLazy=function(e){return O(e)===v},t.isMemo=function(e){return O(e)===y},t.isPortal=function(e){return O(e)===o},t.isProfiler=function(e){return O(e)===s},t.isStrictMode=function(e){return O(e)===c},t.isSuspense=function(e){return O(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===s||e===c||e===m||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===y||e.$$typeof===u||e.$$typeof===l||e.$$typeof===d||e.$$typeof===g||e.$$typeof===S||e.$$typeof===E||e.$$typeof===b)},t.typeOf=O},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),a=f(o),c=f(n(33)),s=f(n(228)),u=f(n(229)),l=n(237);function f(e){return e&&e.__esModule?e:{default:e}}var p=function(){return!0},d=function(e){function t(e){var n=e.alwaysRenderSuggestions;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return m.call(r),r.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null},r.justPressedUpDown=!1,r.justMouseEntered=!1,r.pressedSuggestion=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("mouseup",this.onDocumentMouseUp),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"componentWillReceiveProps",value:function(e){(0,s.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions():this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,i=n.onSuggestionHighlighted,o=n.highlightFirstSuggestion;if(!(0,s.default)(r,e.suggestions)&&r.length>0&&o)this.highlightFirstSuggestion();else if(i){var a=this.getHighlightedSuggestion();a!=t.highlightedSuggestion&&i({suggestion:a})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("mouseup",this.onDocumentMouseUp)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var r=this;this.setState((function(i){var o=i.valueBeforeUpDown;return null===t?o=null:null===o&&void 0!==n&&(o=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:o}}))}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState((function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:e?null:n}}))}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,i=n.multiSection,o=n.getSectionSuggestions;return i?o(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,i=r.value,o=r.onChange;t!==i&&o(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,i=n.value;return t.length>0&&r(i)}},{key:"getQuery",value:function(){var e=this.props.inputProps.value,t=this.state.valueBeforeUpDown;return(null===t?e:t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,i=t.renderInputComponent,o=t.onSuggestionsFetchRequested,c=t.renderSuggestion,s=t.inputProps,f=t.multiSection,d=t.renderSectionTitle,m=t.id,h=t.getSectionSuggestions,y=t.theme,v=t.getSuggestionValue,b=t.alwaysRenderSuggestions,g=t.highlightFirstSuggestion,S=this.state,E=S.isFocused,O=S.isCollapsed,C=S.highlightedSectionIndex,w=S.highlightedSuggestionIndex,A=S.valueBeforeUpDown,j=b?p:this.props.shouldRenderSuggestions,T=s.value,k=s.onFocus,I=s.onKeyDown,L=this.willRenderSuggestions(this.props),_=b||E&&!O&&L,P=_?n:[],x=r({},s,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=j(T);e.setState({isFocused:!0,isCollapsed:!n}),k&&k(t),n&&o({value:T,reason:"input-focused"})}},onBlur:function(t){e.justClickedOnSuggestionsContainer?e.input.focus():(e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested()))},onChange:function(t){var n=t.target.value,i=j(n);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(r({},g?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!i})),i?o({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var i=t.keyCode;switch(i){case 40:case 38:if(O)j(T)&&(o({value:T,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var a=r.newHighlightedSectionIndex,c=r.newHighlightedItemIndex,s=void 0;s=null===c?null===A?T:A:e.getSuggestionValueByIndex(a,c),e.updateHighlightedSuggestion(a,c,T),e.maybeCallOnChange(t,s,40===i?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout((function(){e.justPressedUpDown=!1}));break;case 13:if(229===t.keyCode)break;var u=e.getHighlightedSuggestion();if(_&&!b&&e.closeSuggestions(),null!=u){var l=v(u);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:u,suggestionValue:l,suggestionIndex:w,sectionIndex:C,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout((function(){e.justSelectedSuggestion=!1}))}break;case 27:_&&t.preventDefault();var f=_&&!b;if(null===A){if(!f){e.maybeCallOnChange(t,"","escape"),j("")?o({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,A,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}I&&I(t)}}),N={query:this.getQuery()};return a.default.createElement(u.default,{multiSection:f,items:P,renderInputComponent:i,renderItemsContainer:this.renderSuggestionsContainer,renderItem:c,renderItemData:N,renderSectionTitle:d,getSectionItems:h,highlightedSectionIndex:C,highlightedItemIndex:w,inputProps:x,itemProps:this.itemProps,theme:(0,l.mapToAutowhateverTheme)(y),id:m,ref:this.storeAutowhateverRef})}}]),t}(o.Component);d.propTypes={suggestions:c.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){var n=e[t];if("function"!=typeof n)throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:c.default.func,onSuggestionHighlighted:c.default.func,renderInputComponent:c.default.func,renderSuggestionsContainer:c.default.func,getSuggestionValue:c.default.func.isRequired,renderSuggestion:c.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:c.default.func,alwaysRenderSuggestions:c.default.bool,multiSection:c.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:c.default.bool,highlightFirstSuggestion:c.default.bool,theme:c.default.object,id:c.default.string},d.defaultProps={renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return a.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:l.defaultTheme,id:"1"};var m=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,i=n.itemIndex;e.updateHighlightedSuggestion(r,i),t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!0),e.justMouseEntered=!0,setTimeout((function(){e.justMouseEntered=!1}))},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onDocumentMouseUp=function(){e.pressedSuggestion&&!e.justSelectedSuggestion&&e.input.focus(),e.pressedSuggestion=null},this.onSuggestionMouseDown=function(t){e.justSelectedSuggestion||(e.justSelectedSuggestion=!0,e.pressedSuggestion=t.target)},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,i=r.alwaysRenderSuggestions,o=r.onSuggestionSelected,a=r.onSuggestionsFetchRequested;o&&o(t,n),i?a({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,i=n.focusInputOnSuggestionClick,o=e.getSuggestionIndices(e.findSuggestionElement(t.target)),a=o.sectionIndex,c=o.suggestionIndex,s=e.getSuggestion(a,c),u=e.props.getSuggestionValue(s);e.maybeCallOnChange(t,u,"click"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:u,suggestionIndex:c,sectionIndex:a,method:"click"}),r||e.closeSuggestions(),!0===i?e.input.focus():e.onBlur(),setTimeout((function(){e.justSelectedSuggestion=!1}))},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,i=n.value,o=n.onBlur,a=e.getHighlightedSuggestion(),c=r(i);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!c}),o&&o(e.blurEvent,{highlightedSuggestion:a})},this.onSuggestionMouseLeave=function(t){e.resetHighlightedSuggestion(!1),e.justSelectedSuggestion&&t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!1)},this.onSuggestionTouchStart=function(){e.justSelectedSuggestion=!0},this.onSuggestionTouchMove=function(){e.justSelectedSuggestion=!1,e.pressedSuggestion=null,e.input.focus()},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.onSuggestionMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionTouchStart,onTouchMove:e.onSuggestionTouchMove,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=d},function(e,t,n){"use strict";var r=n(227);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}},function(e,t,n){"use strict";e.exports=n(230).default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=d(a),s=d(n(33)),u=d(n(231)),l=d(n(232)),f=d(n(234)),p=d(n(235));function d(e){return e&&e.__esModule?e:{default:e}}var m={},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.storeInputReference=function(e){null!==e&&(n.input=e)},n.storeItemsContainerReference=function(e){null!==e&&(n.itemsContainer=e)},n.onHighlightedItemChange=function(e){n.highlightedItem=e},n.getItemId=function(e,t){return null===t?null:"react-autowhatever-"+n.props.id+"-"+(null===e?"":"section-"+e)+"-item-"+t},n.onFocus=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!0}),t.onFocus&&t.onFocus(e)},n.onBlur=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!1}),t.onBlur&&t.onBlur(e)},n.onKeyDown=function(e){var t=n.props,r=t.inputProps,o=t.highlightedSectionIndex,a=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var c="ArrowDown"===e.key?"next":"prev",s=n.sectionIterator[c]([o,a]),u=i(s,2),l=u[0],f=u[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:f});break;default:r.onKeyDown(e,{highlightedSectionIndex:o,highlightedItemIndex:a})}},n.highlightedItem=null,n.state={isInputFocused:!1},n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map((function(t){return e.getSectionItems(t)})),this.sectionsLengths=this.sectionsItems.map((function(e){return e.length})),this.allSectionsAreEmpty=this.sectionsLengths.every((function(e){return 0===e})))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,u.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,l.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,r=n.id,i=n.items,o=n.renderItem,a=n.renderItemData,s=n.renderSectionTitle,u=n.highlightedSectionIndex,l=n.highlightedItemIndex,d=n.itemProps;return i.map((function(n,i){var m="react-autowhatever-"+r+"-",h=m+"section-"+i+"-",y=0===i;return c.default.createElement("div",t(h+"container","sectionContainer",y&&"sectionContainerFirst"),c.default.createElement(f.default,{section:n,renderSectionTitle:s,theme:t,sectionKeyPrefix:h}),c.default.createElement(p.default,{items:e.sectionsItems[i],itemProps:d,renderItem:o,renderItemData:a,sectionIndex:i,highlightedItemIndex:u===i?l:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:m,ref:e.storeItemsListReference}))}))}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,r=n.id,i=n.renderItem,o=n.renderItemData,a=n.highlightedSectionIndex,s=n.highlightedItemIndex,u=n.itemProps;return c.default.createElement(p.default,{items:e,itemProps:u,renderItem:i,renderItemData:o,highlightedItemIndex:null===a?s:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+r+"-"})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,i=t.multiSection,o=t.renderInputComponent,a=t.renderItemsContainer,s=t.highlightedSectionIndex,u=t.highlightedItemIndex,l=this.state.isInputFocused,f=i?this.renderSections():this.renderItems(),p=null!==f,d=this.getItemId(s,u),m="react-autowhatever-"+n,h=r({role:"combobox","aria-haspopup":"listbox","aria-owns":m,"aria-expanded":p},e("react-autowhatever-"+n+"-container","container",p&&"containerOpen"),this.props.containerProps),y=o(r({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":m,"aria-activedescendant":d},e("react-autowhatever-"+n+"-input","input",p&&"inputOpen",l&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),v=a({containerProps:r({id:m,role:"listbox"},e("react-autowhatever-"+n+"-items-container","itemsContainer",p&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:f});return c.default.createElement("div",h,y,v)}}]),t}(a.Component);h.propTypes={id:s.default.string,multiSection:s.default.bool,renderInputComponent:s.default.func,renderItemsContainer:s.default.func,items:s.default.array.isRequired,renderItem:s.default.func,renderItemData:s.default.object,renderSectionTitle:s.default.func,getSectionItems:s.default.func,containerProps:s.default.object,inputProps:s.default.object,itemProps:s.default.oneOfType([s.default.object,s.default.func]),highlightedSectionIndex:s.default.number,highlightedItemIndex:s.default.number,theme:s.default.oneOfType([s.default.object,s.default.array])},h.defaultProps={id:"1",multiSection:!1,renderInputComponent:function(e){return c.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return c.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:m,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:m,inputProps:m,itemProps:m,highlightedSectionIndex:null,highlightedItemIndex:null,theme:{container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"}},t.default=h},function(e,t,n){"use strict";var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var t=e.data,n=e.multiSection;function i(e){var i=r(e,2),o=i[0],a=i[1];return n?null===a||a===t[o]-1?null===(o=function(e){for(null===e?e=0:e++;e<t.length&&0===t[e];)e++;return e===t.length?null:e}(o))?[null,null]:[o,0]:[o,a+1]:0===t||a===t-1?[null,null]:null===a?[null,0]:[null,a+1]}return{next:i,prev:function(e){var i=r(e,2),o=i[0],a=i[1];return n?null===a||0===a?null===(o=function(e){for(null===e?e=t.length-1:e--;e>=0&&0===t[e];)e--;return-1===e?null:e}(o))?[null,null]:[o,t[o]-1]:[o,a-1]:0===t||0===a?[null,null]:null===a?[null,t-1]:[null,a-1]},isLast:function(e){return null===i(e)[1]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var o,a=n(233),c=(o=a)&&o.__esModule?o:{default:o},s=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=r(t,2),o=n[0],a=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var u=n.map((function(e){return o[e]})).filter(s);return"string"==typeof u[0]||"function"==typeof a?{key:e,className:a?a.apply(void 0,i(u)):u.join(" ")}:{key:e,style:c.default.apply(void 0,[{}].concat(i(u)))}}},e.exports=t.default},function(e,t,n){"use strict";var r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function o(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter((function(t){return r.call(e,t)}))}e.exports=Object.assign||function(e,t){for(var n,r,a=i(e),c=1;c<arguments.length;c++){n=arguments[c],r=o(Object(n));for(var s=0;s<r.length;s++)a[r[s]]=n[r[s]]}return a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),o=s(i),a=s(n(33)),c=s(n(58));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=function(e){function t(){return u(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"shouldComponentUpdate",value:function(e){return(0,c.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,r=e.theme,i=e.sectionKeyPrefix,a=n(t);return a?o.default.createElement("div",r(i+"title","sectionTitle"),a):null}}]),t}(i.Component);f.propTypes={section:a.default.any.isRequired,renderSectionTitle:a.default.func.isRequired,theme:a.default.func.isRequired,sectionKeyPrefix:a.default.string.isRequired},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),a=l(o),c=l(n(33)),s=l(n(236)),u=l(n(58));function l(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(){var e,n,r;f(this,t);for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.storeHighlightedItemReference=function(e){r.props.onHighlightedItemChange(null===e?null:e.item)},p(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"shouldComponentUpdate",value:function(e){return(0,u.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,i=t.itemProps,o=t.renderItem,c=t.renderItemData,u=t.sectionIndex,l=t.highlightedItemIndex,f=t.getItemId,p=t.theme,d=t.keyPrefix,m=null===u?d:d+"section-"+u+"-",h="function"==typeof i;return a.default.createElement("ul",r({role:"listbox"},p(m+"items-list","itemsList")),n.map((function(t,n){var d=0===n,y=n===l,v=m+"item-"+n,b=h?i({sectionIndex:u,itemIndex:n}):i,g=r({id:f(u,n),"aria-selected":y},p(v,"item",d&&"itemFirst",y&&"itemHighlighted"),b);return y&&(g.ref=e.storeHighlightedItemReference),a.default.createElement(s.default,r({},g,{sectionIndex:u,isHighlighted:y,itemIndex:n,item:t,renderItem:o,renderItemData:c}))})))}}]),t}(o.Component);d.propTypes={items:c.default.array.isRequired,itemProps:c.default.oneOfType([c.default.object,c.default.func]),renderItem:c.default.func.isRequired,renderItemData:c.default.object.isRequired,sectionIndex:c.default.number,highlightedItemIndex:c.default.number,onHighlightedItemChange:c.default.func.isRequired,getItemId:c.default.func.isRequired,theme:c.default.func.isRequired,keyPrefix:c.default.string.isRequired},d.defaultProps={sectionIndex:null},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),a=u(o),c=u(n(33)),s=u(n(58));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p=function(e){function t(){var e,n,r;l(this,t);for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.storeItemReference=function(e){null!==e&&(r.item=e)},r.onMouseEnter=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onMouseEnter(e,{sectionIndex:n,itemIndex:i})},r.onMouseLeave=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onMouseLeave(e,{sectionIndex:n,itemIndex:i})},r.onMouseDown=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onMouseDown(e,{sectionIndex:n,itemIndex:i})},r.onClick=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onClick(e,{sectionIndex:n,itemIndex:i})},f(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"shouldComponentUpdate",value:function(e){return(0,s.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,i=e.renderItem,o=e.renderItemData,c=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete c.sectionIndex,delete c.itemIndex,"function"==typeof c.onMouseEnter&&(c.onMouseEnter=this.onMouseEnter),"function"==typeof c.onMouseLeave&&(c.onMouseLeave=this.onMouseLeave),"function"==typeof c.onMouseDown&&(c.onMouseDown=this.onMouseDown),"function"==typeof c.onClick&&(c.onClick=this.onClick),a.default.createElement("li",r({role:"option"},c,{ref:this.storeItemReference}),i(n,r({isHighlighted:t},o)))}}]),t}(o.Component);p.propTypes={sectionIndex:c.default.number,isHighlighted:c.default.bool.isRequired,itemIndex:c.default.number.isRequired,item:c.default.any.isRequired,renderItem:c.default.func.isRequired,renderItemData:c.default.object.isRequired,onMouseEnter:c.default.func,onMouseLeave:c.default.func,onMouseDown:c.default.func,onClick:c.default.func},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(239),a=v(o),c=v(n(179)),s=n(0),u=v(n(33)),l=v(n(247)),f=v(n(248)),p=v(n(249)),d=v(n(250)),m=v(n(251)),h=n(252),y=n(253);function v(e){return e&&e.__esModule?e:{default:e}}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var S=function(e){function t(e){var n;b(this,t);for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var a=g(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this,e].concat(i)));return a.getScrollLeft=a.getScrollLeft.bind(a),a.getScrollTop=a.getScrollTop.bind(a),a.getScrollWidth=a.getScrollWidth.bind(a),a.getScrollHeight=a.getScrollHeight.bind(a),a.getClientWidth=a.getClientWidth.bind(a),a.getClientHeight=a.getClientHeight.bind(a),a.getValues=a.getValues.bind(a),a.getThumbHorizontalWidth=a.getThumbHorizontalWidth.bind(a),a.getThumbVerticalHeight=a.getThumbVerticalHeight.bind(a),a.getScrollLeftForOffset=a.getScrollLeftForOffset.bind(a),a.getScrollTopForOffset=a.getScrollTopForOffset.bind(a),a.scrollLeft=a.scrollLeft.bind(a),a.scrollTop=a.scrollTop.bind(a),a.scrollToLeft=a.scrollToLeft.bind(a),a.scrollToTop=a.scrollToTop.bind(a),a.scrollToRight=a.scrollToRight.bind(a),a.scrollToBottom=a.scrollToBottom.bind(a),a.handleTrackMouseEnter=a.handleTrackMouseEnter.bind(a),a.handleTrackMouseLeave=a.handleTrackMouseLeave.bind(a),a.handleHorizontalTrackMouseDown=a.handleHorizontalTrackMouseDown.bind(a),a.handleVerticalTrackMouseDown=a.handleVerticalTrackMouseDown.bind(a),a.handleHorizontalThumbMouseDown=a.handleHorizontalThumbMouseDown.bind(a),a.handleVerticalThumbMouseDown=a.handleVerticalThumbMouseDown.bind(a),a.handleWindowResize=a.handleWindowResize.bind(a),a.handleScroll=a.handleScroll.bind(a),a.handleDrag=a.handleDrag.bind(a),a.handleDragEnd=a.handleDragEnd.bind(a),a.state={didMountUniversal:!1},a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.addListeners(),this.update(),this.componentDidMountUniversal()}},{key:"componentDidMountUniversal",value:function(){this.props.universal&&this.setState({didMountUniversal:!0})}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"componentWillUnmount",value:function(){this.removeListeners(),(0,o.cancel)(this.requestFrame),clearTimeout(this.hideTracksTimeout),clearInterval(this.detectScrollingInterval)}},{key:"getScrollLeft",value:function(){return this.view?this.view.scrollLeft:0}},{key:"getScrollTop",value:function(){return this.view?this.view.scrollTop:0}},{key:"getScrollWidth",value:function(){return this.view?this.view.scrollWidth:0}},{key:"getScrollHeight",value:function(){return this.view?this.view.scrollHeight:0}},{key:"getClientWidth",value:function(){return this.view?this.view.clientWidth:0}},{key:"getClientHeight",value:function(){return this.view?this.view.clientHeight:0}},{key:"getValues",value:function(){var e=this.view||{},t=e.scrollLeft,n=void 0===t?0:t,r=e.scrollTop,i=void 0===r?0:r,o=e.scrollWidth,a=void 0===o?0:o,c=e.scrollHeight,s=void 0===c?0:c,u=e.clientWidth,l=void 0===u?0:u,f=e.clientHeight,p=void 0===f?0:f;return{left:n/(a-l)||0,top:i/(s-p)||0,scrollLeft:n,scrollTop:i,scrollWidth:a,scrollHeight:s,clientWidth:l,clientHeight:p}}},{key:"getThumbHorizontalWidth",value:function(){var e=this.props,t=e.thumbSize,n=e.thumbMinSize,r=this.view,i=r.scrollWidth,o=r.clientWidth,a=(0,d.default)(this.trackHorizontal),c=Math.ceil(o/i*a);return a===c?0:t||Math.max(c,n)}},{key:"getThumbVerticalHeight",value:function(){var e=this.props,t=e.thumbSize,n=e.thumbMinSize,r=this.view,i=r.scrollHeight,o=r.clientHeight,a=(0,m.default)(this.trackVertical),c=Math.ceil(o/i*a);return a===c?0:t||Math.max(c,n)}},{key:"getScrollLeftForOffset",value:function(e){var t=this.view,n=t.scrollWidth,r=t.clientWidth;return e/((0,d.default)(this.trackHorizontal)-this.getThumbHorizontalWidth())*(n-r)}},{key:"getScrollTopForOffset",value:function(e){var t=this.view,n=t.scrollHeight,r=t.clientHeight;return e/((0,m.default)(this.trackVertical)-this.getThumbVerticalHeight())*(n-r)}},{key:"scrollLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.view&&(this.view.scrollLeft=e)}},{key:"scrollTop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.view&&(this.view.scrollTop=e)}},{key:"scrollToLeft",value:function(){this.view&&(this.view.scrollLeft=0)}},{key:"scrollToTop",value:function(){this.view&&(this.view.scrollTop=0)}},{key:"scrollToRight",value:function(){this.view&&(this.view.scrollLeft=this.view.scrollWidth)}},{key:"scrollToBottom",value:function(){this.view&&(this.view.scrollTop=this.view.scrollHeight)}},{key:"addListeners",value:function(){if("undefined"!=typeof document&&this.view){var e=this.view,t=this.trackHorizontal,n=this.trackVertical,r=this.thumbHorizontal,i=this.thumbVertical;e.addEventListener("scroll",this.handleScroll),(0,f.default)()&&(t.addEventListener("mouseenter",this.handleTrackMouseEnter),t.addEventListener("mouseleave",this.handleTrackMouseLeave),t.addEventListener("mousedown",this.handleHorizontalTrackMouseDown),n.addEventListener("mouseenter",this.handleTrackMouseEnter),n.addEventListener("mouseleave",this.handleTrackMouseLeave),n.addEventListener("mousedown",this.handleVerticalTrackMouseDown),r.addEventListener("mousedown",this.handleHorizontalThumbMouseDown),i.addEventListener("mousedown",this.handleVerticalThumbMouseDown),window.addEventListener("resize",this.handleWindowResize))}}},{key:"removeListeners",value:function(){if("undefined"!=typeof document&&this.view){var e=this.view,t=this.trackHorizontal,n=this.trackVertical,r=this.thumbHorizontal,i=this.thumbVertical;e.removeEventListener("scroll",this.handleScroll),(0,f.default)()&&(t.removeEventListener("mouseenter",this.handleTrackMouseEnter),t.removeEventListener("mouseleave",this.handleTrackMouseLeave),t.removeEventListener("mousedown",this.handleHorizontalTrackMouseDown),n.removeEventListener("mouseenter",this.handleTrackMouseEnter),n.removeEventListener("mouseleave",this.handleTrackMouseLeave),n.removeEventListener("mousedown",this.handleVerticalTrackMouseDown),r.removeEventListener("mousedown",this.handleHorizontalThumbMouseDown),i.removeEventListener("mousedown",this.handleVerticalThumbMouseDown),window.removeEventListener("resize",this.handleWindowResize),this.teardownDragging())}}},{key:"handleScroll",value:function(e){var t=this,n=this.props,r=n.onScroll,i=n.onScrollFrame;r&&r(e),this.update((function(e){var n=e.scrollLeft,r=e.scrollTop;t.viewScrollLeft=n,t.viewScrollTop=r,i&&i(e)})),this.detectScrolling()}},{key:"handleScrollStart",value:function(){var e=this.props.onScrollStart;e&&e(),this.handleScrollStartAutoHide()}},{key:"handleScrollStartAutoHide",value:function(){this.props.autoHide&&this.showTracks()}},{key:"handleScrollStop",value:function(){var e=this.props.onScrollStop;e&&e(),this.handleScrollStopAutoHide()}},{key:"handleScrollStopAutoHide",value:function(){this.props.autoHide&&this.hideTracks()}},{key:"handleWindowResize",value:function(){this.update()}},{key:"handleHorizontalTrackMouseDown",value:function(e){e.preventDefault();var t=e.target,n=e.clientX,r=t.getBoundingClientRect().left,i=this.getThumbHorizontalWidth(),o=Math.abs(r-n)-i/2;this.view.scrollLeft=this.getScrollLeftForOffset(o)}},{key:"handleVerticalTrackMouseDown",value:function(e){e.preventDefault();var t=e.target,n=e.clientY,r=t.getBoundingClientRect().top,i=this.getThumbVerticalHeight(),o=Math.abs(r-n)-i/2;this.view.scrollTop=this.getScrollTopForOffset(o)}},{key:"handleHorizontalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);var t=e.target,n=e.clientX,r=t.offsetWidth,i=t.getBoundingClientRect().left;this.prevPageX=r-(n-i)}},{key:"handleVerticalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);var t=e.target,n=e.clientY,r=t.offsetHeight,i=t.getBoundingClientRect().top;this.prevPageY=r-(n-i)}},{key:"setupDragging",value:function(){(0,c.default)(document.body,h.disableSelectStyle),document.addEventListener("mousemove",this.handleDrag),document.addEventListener("mouseup",this.handleDragEnd),document.onselectstart=p.default}},{key:"teardownDragging",value:function(){(0,c.default)(document.body,h.disableSelectStyleReset),document.removeEventListener("mousemove",this.handleDrag),document.removeEventListener("mouseup",this.handleDragEnd),document.onselectstart=void 0}},{key:"handleDragStart",value:function(e){this.dragging=!0,e.stopImmediatePropagation(),this.setupDragging()}},{key:"handleDrag",value:function(e){if(this.prevPageX){var t=e.clientX,n=-this.trackHorizontal.getBoundingClientRect().left+t-(this.getThumbHorizontalWidth()-this.prevPageX);this.view.scrollLeft=this.getScrollLeftForOffset(n)}if(this.prevPageY){var r=e.clientY,i=-this.trackVertical.getBoundingClientRect().top+r-(this.getThumbVerticalHeight()-this.prevPageY);this.view.scrollTop=this.getScrollTopForOffset(i)}return!1}},{key:"handleDragEnd",value:function(){this.dragging=!1,this.prevPageX=this.prevPageY=0,this.teardownDragging(),this.handleDragEndAutoHide()}},{key:"handleDragEndAutoHide",value:function(){this.props.autoHide&&this.hideTracks()}},{key:"handleTrackMouseEnter",value:function(){this.trackMouseOver=!0,this.handleTrackMouseEnterAutoHide()}},{key:"handleTrackMouseEnterAutoHide",value:function(){this.props.autoHide&&this.showTracks()}},{key:"handleTrackMouseLeave",value:function(){this.trackMouseOver=!1,this.handleTrackMouseLeaveAutoHide()}},{key:"handleTrackMouseLeaveAutoHide",value:function(){this.props.autoHide&&this.hideTracks()}},{key:"showTracks",value:function(){clearTimeout(this.hideTracksTimeout),(0,c.default)(this.trackHorizontal,{opacity:1}),(0,c.default)(this.trackVertical,{opacity:1})}},{key:"hideTracks",value:function(){var e=this;if(!this.dragging&&!this.scrolling&&!this.trackMouseOver){var t=this.props.autoHideTimeout;clearTimeout(this.hideTracksTimeout),this.hideTracksTimeout=setTimeout((function(){(0,c.default)(e.trackHorizontal,{opacity:0}),(0,c.default)(e.trackVertical,{opacity:0})}),t)}}},{key:"detectScrolling",value:function(){var e=this;this.scrolling||(this.scrolling=!0,this.handleScrollStart(),this.detectScrollingInterval=setInterval((function(){e.lastViewScrollLeft===e.viewScrollLeft&&e.lastViewScrollTop===e.viewScrollTop&&(clearInterval(e.detectScrollingInterval),e.scrolling=!1,e.handleScrollStop()),e.lastViewScrollLeft=e.viewScrollLeft,e.lastViewScrollTop=e.viewScrollTop}),100))}},{key:"raf",value:function(e){var t=this;this.requestFrame&&a.default.cancel(this.requestFrame),this.requestFrame=(0,a.default)((function(){t.requestFrame=void 0,e()}))}},{key:"update",value:function(e){var t=this;this.raf((function(){return t._update(e)}))}},{key:"_update",value:function(e){var t=this.props,n=t.onUpdate,r=t.hideTracksWhenNotNeeded,i=this.getValues();if((0,f.default)()){var o=i.scrollLeft,a=i.clientWidth,s=i.scrollWidth,u=(0,d.default)(this.trackHorizontal),l=this.getThumbHorizontalWidth(),p={width:l,transform:"translateX("+o/(s-a)*(u-l)+"px)"},h=i.scrollTop,y=i.clientHeight,v=i.scrollHeight,b=(0,m.default)(this.trackVertical),g=this.getThumbVerticalHeight(),S={height:g,transform:"translateY("+h/(v-y)*(b-g)+"px)"};if(r){var E={visibility:s>a?"visible":"hidden"},O={visibility:v>y?"visible":"hidden"};(0,c.default)(this.trackHorizontal,E),(0,c.default)(this.trackVertical,O)}(0,c.default)(this.thumbHorizontal,p),(0,c.default)(this.thumbVertical,S)}n&&n(i),"function"==typeof e&&e(i)}},{key:"render",value:function(){var e=this,t=(0,f.default)(),n=this.props,i=(n.onScroll,n.onScrollFrame,n.onScrollStart,n.onScrollStop,n.onUpdate,n.renderView),o=n.renderTrackHorizontal,a=n.renderTrackVertical,c=n.renderThumbHorizontal,u=n.renderThumbVertical,p=n.tagName,d=(n.hideTracksWhenNotNeeded,n.autoHide),m=(n.autoHideTimeout,n.autoHideDuration),y=(n.thumbSize,n.thumbMinSize,n.universal),v=n.autoHeight,b=n.autoHeightMin,g=n.autoHeightMax,S=n.style,E=n.children,O=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(n,["onScroll","onScrollFrame","onScrollStart","onScrollStop","onUpdate","renderView","renderTrackHorizontal","renderTrackVertical","renderThumbHorizontal","renderThumbVertical","tagName","hideTracksWhenNotNeeded","autoHide","autoHideTimeout","autoHideDuration","thumbSize","thumbMinSize","universal","autoHeight","autoHeightMin","autoHeightMax","style","children"]),C=this.state.didMountUniversal,w=r({},h.containerStyleDefault,v&&r({},h.containerStyleAutoHeight,{minHeight:b,maxHeight:g}),S),A=r({},h.viewStyleDefault,{marginRight:t?-t:0,marginBottom:t?-t:0},v&&r({},h.viewStyleAutoHeight,{minHeight:(0,l.default)(b)?"calc("+b+" + "+t+"px)":b+t,maxHeight:(0,l.default)(g)?"calc("+g+" + "+t+"px)":g+t}),v&&y&&!C&&{minHeight:b,maxHeight:g},y&&!C&&h.viewStyleUniversalInitial),j={transition:"opacity "+m+"ms",opacity:0},T=r({},h.trackHorizontalStyleDefault,d&&j,(!t||y&&!C)&&{display:"none"}),k=r({},h.trackVerticalStyleDefault,d&&j,(!t||y&&!C)&&{display:"none"});return(0,s.createElement)(p,r({},O,{style:w,ref:function(t){e.container=t}}),[(0,s.cloneElement)(i({style:A}),{key:"view",ref:function(t){e.view=t}},E),(0,s.cloneElement)(o({style:T}),{key:"trackHorizontal",ref:function(t){e.trackHorizontal=t}},(0,s.cloneElement)(c({style:h.thumbHorizontalStyleDefault}),{ref:function(t){e.thumbHorizontal=t}})),(0,s.cloneElement)(a({style:k}),{key:"trackVertical",ref:function(t){e.trackVertical=t}},(0,s.cloneElement)(u({style:h.thumbVerticalStyleDefault}),{ref:function(t){e.thumbVertical=t}}))])}}]),t}(s.Component);t.default=S,S.propTypes={onScroll:u.default.func,onScrollFrame:u.default.func,onScrollStart:u.default.func,onScrollStop:u.default.func,onUpdate:u.default.func,renderView:u.default.func,renderTrackHorizontal:u.default.func,renderTrackVertical:u.default.func,renderThumbHorizontal:u.default.func,renderThumbVertical:u.default.func,tagName:u.default.string,thumbSize:u.default.number,thumbMinSize:u.default.number,hideTracksWhenNotNeeded:u.default.bool,autoHide:u.default.bool,autoHideTimeout:u.default.number,autoHideDuration:u.default.number,autoHeight:u.default.bool,autoHeightMin:u.default.oneOfType([u.default.number,u.default.string]),autoHeightMax:u.default.oneOfType([u.default.number,u.default.string]),universal:u.default.bool,style:u.default.object,children:u.default.node},S.defaultProps={renderView:y.renderViewDefault,renderTrackHorizontal:y.renderTrackHorizontalDefault,renderTrackVertical:y.renderTrackVerticalDefault,renderThumbHorizontal:y.renderThumbHorizontalDefault,renderThumbVertical:y.renderThumbVerticalDefault,tagName:"div",thumbMinSize:30,hideTracksWhenNotNeeded:!1,autoHide:!1,autoHideTimeout:1e3,autoHideDuration:200,autoHeight:!1,autoHeightMin:0,autoHeightMax:200,universal:!1}},function(e,t,n){(function(t){for(var r=n(240),i="undefined"==typeof window?t:window,o=["moz","webkit"],a="AnimationFrame",c=i["request"+a],s=i["cancel"+a]||i["cancelRequest"+a],u=0;!c&&u<o.length;u++)c=i[o[u]+"Request"+a],s=i[o[u]+"Cancel"+a]||i[o[u]+"CancelRequest"+a];if(!c||!s){var l=0,f=0,p=[];c=function(e){if(0===p.length){var t=r(),n=Math.max(0,1e3/60-(t-l));l=n+t,setTimeout((function(){var e=p.slice(0);p.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(l)}catch(e){setTimeout((function(){throw e}),0)}}),Math.round(n))}return p.push({handle:++f,callback:e,cancelled:!1}),f},s=function(e){for(var t=0;t<p.length;t++)p[t].handle===e&&(p[t].cancelled=!0)}}e.exports=function(e){return c.call(i,e)},e.exports.cancel=function(){s.apply(i,arguments)},e.exports.polyfill=function(e){e||(e=i),e.requestAnimationFrame=c,e.cancelAnimationFrame=s}}).call(this,n(84))},function(e,t,n){(function(t){(function(){var n,r,i,o,a,c;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:null!=t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,o=(n=function(){var e;return 1e9*(e=r())[0]+e[1]})(),c=1e9*t.uptime(),a=o-c):Date.now?(e.exports=function(){return Date.now()-i},i=Date.now()):(e.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(this,n(241))},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],l=!1,f=-1;function p(){l&&s&&(l=!1,s.length?u=s.concat(u):f=-1,u.length&&d())}function d(){if(!l){var e=c(p);l=!0;for(var t=u.length;t;){for(s=u,u=[];++f<t;)s&&s[f].run();f=-1,t=u.length}s=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new m(e,t)),1!==u.length||l||c(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){var n=null,r=["Webkit","Moz","O","ms"];e.exports=function(e){n||(n=document.createElement("div"));var t=n.style;if(e in t)return e;for(var i=e.charAt(0).toUpperCase()+e.slice(1),o=r.length;o>=0;o--){var a=r[o]+i;if(a in t)return a}return!1}},function(e,t,n){var r=n(244);e.exports=function(e){return r(e).replace(/\s(\w)/g,(function(e,t){return t.toUpperCase()}))}},function(e,t,n){var r=n(245);e.exports=function(e){return r(e).replace(/[\W_]+(.|$)/g,(function(e,t){return t?" "+t:""})).trim()}},function(e,t){e.exports=function(e){return n.test(e)?e.toLowerCase():r.test(e)?(function(e){return e.replace(o,(function(e,t){return t?" "+t:""}))}(e)||e).toLowerCase():i.test(e)?function(e){return e.replace(a,(function(e,t,n){return t+" "+n.toLowerCase().split("").join(" ")}))}(e).toLowerCase():e.toLowerCase()};var n=/\s/,r=/(_|-|\.|:)/,i=/([a-z][A-Z]|[A-Z][a-z])/;var o=/[\W_]+(.|$)/g;var a=/(.)([A-Z]+)/g},function(e,t){var n={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};e.exports=function(e,t){return"number"!=typeof t||n[e]?t:t+"px"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"string"==typeof e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!1!==a)return a;if("undefined"!=typeof document){var e=document.createElement("div");(0,o.default)(e,{width:100,height:100,position:"absolute",top:-9999,overflow:"scroll",MsOverflowStyle:"scrollbar"}),document.body.appendChild(e),a=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}else a=0;return a||0};var r,i=n(179),o=(r=i)&&r.__esModule?r:{default:r};var a=!1},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.clientWidth,n=getComputedStyle(e),r=n.paddingLeft,i=n.paddingRight;return t-parseFloat(r)-parseFloat(i)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.clientHeight,n=getComputedStyle(e),r=n.paddingTop,i=n.paddingBottom;return t-parseFloat(r)-parseFloat(i)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.containerStyleDefault={position:"relative",overflow:"hidden",width:"100%",height:"100%"},t.containerStyleAutoHeight={height:"auto"},t.viewStyleDefault={position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"scroll",WebkitOverflowScrolling:"touch"},t.viewStyleAutoHeight={position:"relative",top:void 0,left:void 0,right:void 0,bottom:void 0},t.viewStyleUniversalInitial={overflow:"hidden",marginRight:0,marginBottom:0},t.trackHorizontalStyleDefault={position:"absolute",height:6},t.trackVerticalStyleDefault={position:"absolute",width:6},t.thumbHorizontalStyleDefault={position:"relative",display:"block",height:"100%"},t.thumbVerticalStyleDefault={position:"relative",display:"block",width:"100%"},t.disableSelectStyle={userSelect:"none"},t.disableSelectStyleReset={userSelect:""}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.renderViewDefault=function(e){return a.default.createElement("div",e)},t.renderTrackHorizontalDefault=function(e){var t=e.style,n=c(e,["style"]),i=r({},t,{right:2,bottom:2,left:2,borderRadius:3});return a.default.createElement("div",r({style:i},n))},t.renderTrackVerticalDefault=function(e){var t=e.style,n=c(e,["style"]),i=r({},t,{right:2,bottom:2,top:2,borderRadius:3});return a.default.createElement("div",r({style:i},n))},t.renderThumbHorizontalDefault=function(e){var t=e.style,n=c(e,["style"]),i=r({},t,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return a.default.createElement("div",r({style:i},n))},t.renderThumbVerticalDefault=function(e){var t=e.style,n=c(e,["style"]),i=r({},t,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return a.default.createElement("div",r({style:i},n))};var i,o=n(0),a=(i=o)&&i.__esModule?i:{default:i};function c(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},function(e,t,n){"use strict";t.__esModule=!0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(255));var i=r.tokenize,o=r.options.Options;function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function c(e){return e.replace(/"/g,""")}function s(e){if(!e)return"";var t=[];for(var n in e){var r=e[n]+"";t.push(n+'="'+c(r)+'"')}return t.join(" ")}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=new o(t);for(var n=i(e),r=[],u=0;u<n.length;u++){var l=n[u];if("nl"===l.type&&t.nl2br)r.push("<br>\n");else if(l.isLink&&t.check(l)){var f=t.resolve(l),p=f.formatted,d=f.formattedHref,m=f.tagName,h=f.className,y=f.target,v=f.attributes,b="<"+m+' href="'+c(d)+'"';h&&(b+=' class="'+c(h)+'"'),y&&(b+=' target="'+c(y)+'"'),v&&(b+=" "+s(v)),b+=">"+a(p)+"</"+m+">",r.push(b)}else r.push(a(l.toString()))}return r.join("")}if(!String.prototype.linkify)try{Object.defineProperty(String.prototype,"linkify",{set:function(){},get:function(){return function(e){return u(this,e)}}})}catch(e){String.prototype.linkify||(String.prototype.linkify=function(e){return u(this,e)})}t.default=u},function(e,t,n){"use strict";t.__esModule=!0,t.tokenize=t.test=t.scanner=t.parser=t.options=t.inherits=t.find=void 0;var r=n(43),i=c(n(256)),o=c(n(257)),a=c(n(258));function c(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var s=function(e){return a.run(o.run(e))};t.find=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(e),r=[],i=0;i<n.length;i++){var o=n[i];!o.isLink||t&&o.type!==t||r.push(o.toObject())}return r},t.inherits=r.inherits,t.options=i,t.parser=a,t.scanner=o,t.test=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(e);return 1===n.length&&n[0].isLink&&(!t||n[0].type===t)},t.tokenize=s},function(e,t,n){"use strict";t.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i={defaultProtocol:"http",events:null,format:a,formatHref:a,nl2br:!1,tagName:"a",target:function(e,t){return"url"===t?"_blank":null},validate:!0,ignoreTags:[],attributes:null,className:"linkified"};function o(e){e=e||{},this.defaultProtocol=e.hasOwnProperty("defaultProtocol")?e.defaultProtocol:i.defaultProtocol,this.events=e.hasOwnProperty("events")?e.events:i.events,this.format=e.hasOwnProperty("format")?e.format:i.format,this.formatHref=e.hasOwnProperty("formatHref")?e.formatHref:i.formatHref,this.nl2br=e.hasOwnProperty("nl2br")?e.nl2br:i.nl2br,this.tagName=e.hasOwnProperty("tagName")?e.tagName:i.tagName,this.target=e.hasOwnProperty("target")?e.target:i.target,this.validate=e.hasOwnProperty("validate")?e.validate:i.validate,this.ignoreTags=[],this.attributes=e.attributes||e.linkAttributes||i.attributes,this.className=e.hasOwnProperty("className")?e.className:e.linkClass||i.className;for(var t=e.hasOwnProperty("ignoreTags")?e.ignoreTags:i.ignoreTags,n=0;n<t.length;n++)this.ignoreTags.push(t[n].toUpperCase())}function a(e){return e}t.defaults=i,t.Options=o,t.contains=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},o.prototype={resolve:function(e){var t=e.toHref(this.defaultProtocol);return{formatted:this.get("format",e.toString(),e),formattedHref:this.get("formatHref",t,e),tagName:this.get("tagName",t,e),className:this.get("className",t,e),target:this.get("target",t,e),events:this.getObject("events",t,e),attributes:this.getObject("attributes",t,e)}},check:function(e){return this.get("validate",e.toString(),e)},get:function(e,t,n){var o=void 0,a=this[e];if(!a)return a;switch(void 0===a?"undefined":r(a)){case"function":return a(t,n.type);case"object":return"function"==typeof(o=a.hasOwnProperty(n.type)?a[n.type]:i[e])?o(t,n.type):o}return a},getObject:function(e,t,n){var r=this[e];return"function"==typeof r?r(t,n.type):r}}},function(e,t,n){"use strict";t.__esModule=!0,t.start=t.run=t.TOKENS=t.State=void 0;var r=n(195),i=n(59),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(i);var a="aaa|aarp|abarth|abb|abbott|abbvie|abc|able|abogado|abudhabi|ac|academy|accenture|accountant|accountants|aco|active|actor|ad|adac|ads|adult|ae|aeg|aero|aetna|af|afamilycompany|afl|africa|ag|agakhan|agency|ai|aig|aigo|airbus|airforce|airtel|akdn|al|alfaromeo|alibaba|alipay|allfinanz|allstate|ally|alsace|alstom|am|americanexpress|americanfamily|amex|amfam|amica|amsterdam|analytics|android|anquan|anz|ao|aol|apartments|app|apple|aq|aquarelle|ar|arab|aramco|archi|army|arpa|art|arte|as|asda|asia|associates|at|athleta|attorney|au|auction|audi|audible|audio|auspost|author|auto|autos|avianca|aw|aws|ax|axa|az|azure|ba|baby|baidu|banamex|bananarepublic|band|bank|bar|barcelona|barclaycard|barclays|barefoot|bargains|baseball|basketball|bauhaus|bayern|bb|bbc|bbt|bbva|bcg|bcn|bd|be|beats|beauty|beer|bentley|berlin|best|bestbuy|bet|bf|bg|bh|bharti|bi|bible|bid|bike|bing|bingo|bio|biz|bj|black|blackfriday|blanco|blockbuster|blog|bloomberg|blue|bm|bms|bmw|bn|bnl|bnpparibas|bo|boats|boehringer|bofa|bom|bond|boo|book|booking|boots|bosch|bostik|boston|bot|boutique|box|br|bradesco|bridgestone|broadway|broker|brother|brussels|bs|bt|budapest|bugatti|build|builders|business|buy|buzz|bv|bw|by|bz|bzh|ca|cab|cafe|cal|call|calvinklein|cam|camera|camp|cancerresearch|canon|capetown|capital|capitalone|car|caravan|cards|care|career|careers|cars|cartier|casa|case|caseih|cash|casino|cat|catering|catholic|cba|cbn|cbre|cbs|cc|cd|ceb|center|ceo|cern|cf|cfa|cfd|cg|ch|chanel|channel|chase|chat|cheap|chintai|chloe|christmas|chrome|chrysler|church|ci|cipriani|circle|cisco|citadel|citi|citic|city|cityeats|ck|cl|claims|cleaning|click|clinic|clinique|clothing|cloud|club|clubmed|cm|cn|co|coach|codes|coffee|college|cologne|com|comcast|commbank|community|company|compare|computer|comsec|condos|construction|consulting|contact|contractors|cooking|cookingchannel|cool|coop|corsica|country|coupon|coupons|courses|cr|credit|creditcard|creditunion|cricket|crown|crs|cruise|cruises|csc|cu|cuisinella|cv|cw|cx|cy|cymru|cyou|cz|dabur|dad|dance|data|date|dating|datsun|day|dclk|dds|de|deal|dealer|deals|degree|delivery|dell|deloitte|delta|democrat|dental|dentist|desi|design|dev|dhl|diamonds|diet|digital|direct|directory|discount|discover|dish|diy|dj|dk|dm|dnp|do|docs|doctor|dodge|dog|doha|domains|dot|download|drive|dtv|dubai|duck|dunlop|duns|dupont|durban|dvag|dvr|dz|earth|eat|ec|eco|edeka|edu|education|ee|eg|email|emerck|energy|engineer|engineering|enterprises|epost|epson|equipment|er|ericsson|erni|es|esq|estate|esurance|et|etisalat|eu|eurovision|eus|events|everbank|exchange|expert|exposed|express|extraspace|fage|fail|fairwinds|faith|family|fan|fans|farm|farmers|fashion|fast|fedex|feedback|ferrari|ferrero|fi|fiat|fidelity|fido|film|final|finance|financial|fire|firestone|firmdale|fish|fishing|fit|fitness|fj|fk|flickr|flights|flir|florist|flowers|fly|fm|fo|foo|food|foodnetwork|football|ford|forex|forsale|forum|foundation|fox|fr|free|fresenius|frl|frogans|frontdoor|frontier|ftr|fujitsu|fujixerox|fun|fund|furniture|futbol|fyi|ga|gal|gallery|gallo|gallup|game|games|gap|garden|gb|gbiz|gd|gdn|ge|gea|gent|genting|george|gf|gg|ggee|gh|gi|gift|gifts|gives|giving|gl|glade|glass|gle|global|globo|gm|gmail|gmbh|gmo|gmx|gn|godaddy|gold|goldpoint|golf|goo|goodhands|goodyear|goog|google|gop|got|gov|gp|gq|gr|grainger|graphics|gratis|green|gripe|grocery|group|gs|gt|gu|guardian|gucci|guge|guide|guitars|guru|gw|gy|hair|hamburg|hangout|haus|hbo|hdfc|hdfcbank|health|healthcare|help|helsinki|here|hermes|hgtv|hiphop|hisamitsu|hitachi|hiv|hk|hkt|hm|hn|hockey|holdings|holiday|homedepot|homegoods|homes|homesense|honda|honeywell|horse|hospital|host|hosting|hot|hoteles|hotels|hotmail|house|how|hr|hsbc|ht|htc|hu|hughes|hyatt|hyundai|ibm|icbc|ice|icu|id|ie|ieee|ifm|ikano|il|im|imamat|imdb|immo|immobilien|in|industries|infiniti|info|ing|ink|institute|insurance|insure|int|intel|international|intuit|investments|io|ipiranga|iq|ir|irish|is|iselect|ismaili|ist|istanbul|it|itau|itv|iveco|iwc|jaguar|java|jcb|jcp|je|jeep|jetzt|jewelry|jio|jlc|jll|jm|jmp|jnj|jo|jobs|joburg|jot|joy|jp|jpmorgan|jprs|juegos|juniper|kaufen|kddi|ke|kerryhotels|kerrylogistics|kerryproperties|kfh|kg|kh|ki|kia|kim|kinder|kindle|kitchen|kiwi|km|kn|koeln|komatsu|kosher|kp|kpmg|kpn|kr|krd|kred|kuokgroup|kw|ky|kyoto|kz|la|lacaixa|ladbrokes|lamborghini|lamer|lancaster|lancia|lancome|land|landrover|lanxess|lasalle|lat|latino|latrobe|law|lawyer|lb|lc|lds|lease|leclerc|lefrak|legal|lego|lexus|lgbt|li|liaison|lidl|life|lifeinsurance|lifestyle|lighting|like|lilly|limited|limo|lincoln|linde|link|lipsy|live|living|lixil|lk|loan|loans|locker|locus|loft|lol|london|lotte|lotto|love|lpl|lplfinancial|lr|ls|lt|ltd|ltda|lu|lundbeck|lupin|luxe|luxury|lv|ly|ma|macys|madrid|maif|maison|makeup|man|management|mango|map|market|marketing|markets|marriott|marshalls|maserati|mattel|mba|mc|mckinsey|md|me|med|media|meet|melbourne|meme|memorial|men|menu|meo|merckmsd|metlife|mg|mh|miami|microsoft|mil|mini|mint|mit|mitsubishi|mk|ml|mlb|mls|mm|mma|mn|mo|mobi|mobile|mobily|moda|moe|moi|mom|monash|money|monster|mopar|mormon|mortgage|moscow|moto|motorcycles|mov|movie|movistar|mp|mq|mr|ms|msd|mt|mtn|mtr|mu|museum|mutual|mv|mw|mx|my|mz|na|nab|nadex|nagoya|name|nationwide|natura|navy|nba|nc|ne|nec|net|netbank|netflix|network|neustar|new|newholland|news|next|nextdirect|nexus|nf|nfl|ng|ngo|nhk|ni|nico|nike|nikon|ninja|nissan|nissay|nl|no|nokia|northwesternmutual|norton|now|nowruz|nowtv|np|nr|nra|nrw|ntt|nu|nyc|nz|obi|observer|off|office|okinawa|olayan|olayangroup|oldnavy|ollo|om|omega|one|ong|onl|online|onyourside|ooo|open|oracle|orange|org|organic|origins|osaka|otsuka|ott|ovh|pa|page|panasonic|panerai|paris|pars|partners|parts|party|passagens|pay|pccw|pe|pet|pf|pfizer|pg|ph|pharmacy|phd|philips|phone|photo|photography|photos|physio|piaget|pics|pictet|pictures|pid|pin|ping|pink|pioneer|pizza|pk|pl|place|play|playstation|plumbing|plus|pm|pn|pnc|pohl|poker|politie|porn|post|pr|pramerica|praxi|press|prime|pro|prod|productions|prof|progressive|promo|properties|property|protection|pru|prudential|ps|pt|pub|pw|pwc|py|qa|qpon|quebec|quest|qvc|racing|radio|raid|re|read|realestate|realtor|realty|recipes|red|redstone|redumbrella|rehab|reise|reisen|reit|reliance|ren|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rexroth|rich|richardli|ricoh|rightathome|ril|rio|rip|rmit|ro|rocher|rocks|rodeo|rogers|room|rs|rsvp|ru|rugby|ruhr|run|rw|rwe|ryukyu|sa|saarland|safe|safety|sakura|sale|salon|samsclub|samsung|sandvik|sandvikcoromant|sanofi|sap|sapo|sarl|sas|save|saxo|sb|sbi|sbs|sc|sca|scb|schaeffler|schmidt|scholarships|school|schule|schwarz|science|scjohnson|scor|scot|sd|se|search|seat|secure|security|seek|select|sener|services|ses|seven|sew|sex|sexy|sfr|sg|sh|shangrila|sharp|shaw|shell|shia|shiksha|shoes|shop|shopping|shouji|show|showtime|shriram|si|silk|sina|singles|site|sj|sk|ski|skin|sky|skype|sl|sling|sm|smart|smile|sn|sncf|so|soccer|social|softbank|software|sohu|solar|solutions|song|sony|soy|space|spiegel|spot|spreadbetting|sr|srl|srt|st|stada|staples|star|starhub|statebank|statefarm|statoil|stc|stcgroup|stockholm|storage|store|stream|studio|study|style|su|sucks|supplies|supply|support|surf|surgery|suzuki|sv|swatch|swiftcover|swiss|sx|sy|sydney|symantec|systems|sz|tab|taipei|talk|taobao|target|tatamotors|tatar|tattoo|tax|taxi|tc|tci|td|tdk|team|tech|technology|tel|telecity|telefonica|temasek|tennis|teva|tf|tg|th|thd|theater|theatre|tiaa|tickets|tienda|tiffany|tips|tires|tirol|tj|tjmaxx|tjx|tk|tkmaxx|tl|tm|tmall|tn|to|today|tokyo|tools|top|toray|toshiba|total|tours|town|toyota|toys|tr|trade|trading|training|travel|travelchannel|travelers|travelersinsurance|trust|trv|tt|tube|tui|tunes|tushu|tv|tvs|tw|tz|ua|ubank|ubs|uconnect|ug|uk|unicom|university|uno|uol|ups|us|uy|uz|va|vacations|vana|vanguard|vc|ve|vegas|ventures|verisign|versicherung|vet|vg|vi|viajes|video|vig|viking|villas|vin|vip|virgin|visa|vision|vista|vistaprint|viva|vivo|vlaanderen|vn|vodka|volkswagen|volvo|vote|voting|voto|voyage|vu|vuelos|wales|walmart|walter|wang|wanggou|warman|watch|watches|weather|weatherchannel|webcam|weber|website|wed|wedding|weibo|weir|wf|whoswho|wien|wiki|williamhill|win|windows|wine|winners|wme|wolterskluwer|woodside|work|works|world|wow|ws|wtc|wtf|xbox|xerox|xfinity|xihuan|xin|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--30rr7y|xn--3bst00m|xn--3ds443g|xn--3e0b707e|xn--3hcrj9c|xn--3oq18vl8pn36a|xn--3pxu8k|xn--42c2d9a|xn--45br5cyl|xn--45brj9c|xn--45q11c|xn--4gbrim|xn--54b7fta0cc|xn--55qw42g|xn--55qx5d|xn--5su34j936bgsg|xn--5tzm5g|xn--6frz82g|xn--6qq986b3xl|xn--80adxhks|xn--80ao21a|xn--80aqecdr1a|xn--80asehdb|xn--80aswg|xn--8y0a063a|xn--90a3ac|xn--90ae|xn--90ais|xn--9dbq2a|xn--9et52u|xn--9krt00a|xn--b4w605ferd|xn--bck1b9a5dre4c|xn--c1avg|xn--c2br7g|xn--cck2b3b|xn--cg4bki|xn--clchc0ea0b2g2a9gcd|xn--czr694b|xn--czrs0t|xn--czru2d|xn--d1acj3b|xn--d1alf|xn--e1a4c|xn--eckvdtc9d|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fhbei|xn--fiq228c5hs|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--fjq720a|xn--flw351e|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--fzys8d69uvgm|xn--g2xx48c|xn--gckr3f0f|xn--gecrj9c|xn--gk3at1e|xn--h2breg3eve|xn--h2brj9c|xn--h2brj9c8c|xn--hxt814e|xn--i1b6b1a6a2e|xn--imr513n|xn--io0a7i|xn--j1aef|xn--j1amh|xn--j6w193g|xn--jlq61u9w7b|xn--jvr189m|xn--kcrx77d1x4a|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--kput3i|xn--l1acc|xn--lgbbat1ad8j|xn--mgb9awbf|xn--mgba3a3ejt|xn--mgba3a4f16a|xn--mgba7c0bbn0a|xn--mgbaakc7dvf|xn--mgbaam7a8h|xn--mgbab2bd|xn--mgbai9azgqp6j|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a|xn--mgbbh1a71e|xn--mgbc0a9azcg|xn--mgbca7dzdo|xn--mgberp4a5d4ar|xn--mgbgu82a|xn--mgbi4ecexp|xn--mgbpl2fh|xn--mgbt3dhd|xn--mgbtx2b|xn--mgbx4cd0ab|xn--mix891f|xn--mk1bu44c|xn--mxtq1m|xn--ngbc5azd|xn--ngbe9e0a|xn--ngbrx|xn--node|xn--nqv7f|xn--nqv7fs00ema|xn--nyqy26a|xn--o3cw4h|xn--ogbpf8fl|xn--p1acf|xn--p1ai|xn--pbt977c|xn--pgbs0dh|xn--pssy2u|xn--q9jyb4c|xn--qcka1pmc|xn--qxam|xn--rhqv96g|xn--rovu88b|xn--rvc1e0am3e|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--tckwe|xn--tiq49xqyj|xn--unup4y|xn--vermgensberater-ctb|xn--vermgensberatung-pwb|xn--vhquv|xn--vuq861b|xn--w4r85el8fhu5dnra|xn--w4rs40l|xn--wgbh1c|xn--wgbl6a|xn--xhq521b|xn--xkc2al3hye2a|xn--xkc2dl3a5ee0h|xn--y9a3aq|xn--yfro4i67o|xn--ygbi2ammx|xn--zfr164b|xperia|xxx|xyz|yachts|yahoo|yamaxun|yandex|ye|yodobashi|yoga|yokohama|you|youtube|yt|yun|za|zappos|zara|zero|zip|zippo|zm|zone|zuerich|zw".split("|"),c="0123456789".split(""),s="0123456789abcdefghijklmnopqrstuvwxyz".split(""),u=[" ","\f","\r","\t","\v"," "," ",""],l=[],f=function(e){return new r.CharacterState(e)},p=f(),d=f(i.NUM),m=f(i.DOMAIN),h=f(),y=f(i.WS);p.on("@",f(i.AT)).on(".",f(i.DOT)).on("+",f(i.PLUS)).on("#",f(i.POUND)).on("?",f(i.QUERY)).on("/",f(i.SLASH)).on("_",f(i.UNDERSCORE)).on(":",f(i.COLON)).on("{",f(i.OPENBRACE)).on("[",f(i.OPENBRACKET)).on("<",f(i.OPENANGLEBRACKET)).on("(",f(i.OPENPAREN)).on("}",f(i.CLOSEBRACE)).on("]",f(i.CLOSEBRACKET)).on(">",f(i.CLOSEANGLEBRACKET)).on(")",f(i.CLOSEPAREN)).on("&",f(i.AMPERSAND)).on([",",";","!",'"',"'"],f(i.PUNCTUATION)),p.on("\n",f(i.NL)).on(u,y),y.on(u,y);for(var v=0;v<a.length;v++){var b=(0,r.stateify)(a[v],p,i.TLD,i.DOMAIN);l.push.apply(l,b)}var g=(0,r.stateify)("file",p,i.DOMAIN,i.DOMAIN),S=(0,r.stateify)("ftp",p,i.DOMAIN,i.DOMAIN),E=(0,r.stateify)("http",p,i.DOMAIN,i.DOMAIN),O=(0,r.stateify)("mailto",p,i.DOMAIN,i.DOMAIN);l.push.apply(l,g),l.push.apply(l,S),l.push.apply(l,E),l.push.apply(l,O);var C=g.pop(),w=S.pop(),A=E.pop(),j=O.pop(),T=f(i.DOMAIN),k=f(i.PROTOCOL),I=f(i.MAILTO);w.on("s",T).on(":",k),A.on("s",T).on(":",k),l.push(T),C.on(":",k),T.on(":",k),j.on(":",I);var L=(0,r.stateify)("localhost",p,i.LOCALHOST,i.DOMAIN);l.push.apply(l,L),p.on(c,d),d.on("-",h).on(c,d).on(s,m),m.on("-",h).on(s,m);for(var _=0;_<l.length;_++)l[_].on("-",h).on(s,m);h.on("-",h).on(c,m).on(s,m),p.defaultTransition=f(i.SYM);var P=p;t.State=r.CharacterState,t.TOKENS=o,t.run=function(e){for(var t=e.replace(/[A-Z]/g,(function(e){return e.toLowerCase()})),n=e.length,r=[],i=0;i<n;){for(var o=p,a=null,c=0,s=null,u=-1;i<n&&(a=o.next(t[i]));)(o=a).accepts()?(u=0,s=o):u>=0&&u++,c++,i++;if(!(u<0)){i-=u,c-=u;var l=s.emit();r.push(new l(e.substr(i-c,c)))}}return r},t.start=P},function(e,t,n){"use strict";t.__esModule=!0,t.start=t.run=t.TOKENS=t.State=void 0;var r=n(195),i=n(259),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(i),a=n(59);var c=function(e){return new r.TokenState(e)},s=c(),u=c(),l=c(),f=c(),p=c(),d=c(),m=c(),h=c(i.URL),y=c(),v=c(i.URL),b=c(i.URL),g=c(),S=c(),E=c(),O=c(),C=c(),w=c(i.URL),A=c(i.URL),j=c(i.URL),T=c(i.URL),k=c(),I=c(),L=c(),_=c(),P=c(),x=c(),N=c(i.EMAIL),R=c(),D=c(i.EMAIL),M=c(i.MAILTOEMAIL),U=c(),F=c(),V=c(),B=c(),H=c(i.NL);s.on(a.NL,H).on(a.PROTOCOL,u).on(a.MAILTO,l).on(a.SLASH,f),u.on(a.SLASH,f),f.on(a.SLASH,p),s.on(a.TLD,d).on(a.DOMAIN,d).on(a.LOCALHOST,h).on(a.NUM,d),p.on(a.TLD,b).on(a.DOMAIN,b).on(a.NUM,b).on(a.LOCALHOST,b),d.on(a.DOT,m),P.on(a.DOT,x),m.on(a.TLD,h).on(a.DOMAIN,d).on(a.NUM,d).on(a.LOCALHOST,d),x.on(a.TLD,N).on(a.DOMAIN,P).on(a.NUM,P).on(a.LOCALHOST,P),h.on(a.DOT,m),N.on(a.DOT,x),h.on(a.COLON,y).on(a.SLASH,b),y.on(a.NUM,v),v.on(a.SLASH,b),N.on(a.COLON,R),R.on(a.NUM,D);var z=[a.DOMAIN,a.AT,a.LOCALHOST,a.NUM,a.PLUS,a.POUND,a.PROTOCOL,a.SLASH,a.TLD,a.UNDERSCORE,a.SYM,a.AMPERSAND],q=[a.COLON,a.DOT,a.QUERY,a.PUNCTUATION,a.CLOSEBRACE,a.CLOSEBRACKET,a.CLOSEANGLEBRACKET,a.CLOSEPAREN,a.OPENBRACE,a.OPENBRACKET,a.OPENANGLEBRACKET,a.OPENPAREN];b.on(a.OPENBRACE,S).on(a.OPENBRACKET,E).on(a.OPENANGLEBRACKET,O).on(a.OPENPAREN,C),g.on(a.OPENBRACE,S).on(a.OPENBRACKET,E).on(a.OPENANGLEBRACKET,O).on(a.OPENPAREN,C),S.on(a.CLOSEBRACE,b),E.on(a.CLOSEBRACKET,b),O.on(a.CLOSEANGLEBRACKET,b),C.on(a.CLOSEPAREN,b),w.on(a.CLOSEBRACE,b),A.on(a.CLOSEBRACKET,b),j.on(a.CLOSEANGLEBRACKET,b),T.on(a.CLOSEPAREN,b),k.on(a.CLOSEBRACE,b),I.on(a.CLOSEBRACKET,b),L.on(a.CLOSEANGLEBRACKET,b),_.on(a.CLOSEPAREN,b),S.on(z,w),E.on(z,A),O.on(z,j),C.on(z,T),S.on(q,k),E.on(q,I),O.on(q,L),C.on(q,_),w.on(z,w),A.on(z,A),j.on(z,j),T.on(z,T),w.on(q,w),A.on(q,A),j.on(q,j),T.on(q,T),k.on(z,w),I.on(z,A),L.on(z,j),_.on(z,T),k.on(q,k),I.on(q,I),L.on(q,L),_.on(q,_),b.on(z,b),g.on(z,b),b.on(q,g),g.on(q,g),l.on(a.TLD,M).on(a.DOMAIN,M).on(a.NUM,M).on(a.LOCALHOST,M),M.on(z,M).on(q,U),U.on(z,M).on(q,U);var J=[a.DOMAIN,a.NUM,a.PLUS,a.POUND,a.QUERY,a.UNDERSCORE,a.SYM,a.AMPERSAND,a.TLD];d.on(J,F).on(a.AT,V),h.on(J,F).on(a.AT,V),m.on(J,F),F.on(J,F).on(a.AT,V).on(a.DOT,B),B.on(J,F),V.on(a.TLD,P).on(a.DOMAIN,P).on(a.LOCALHOST,N);t.State=r.TokenState,t.TOKENS=o,t.run=function(e){for(var t=e.length,n=0,r=[],o=[];n<t;){for(var a=s,c=null,u=null,l=0,f=null,p=-1;n<t&&!(c=a.next(e[n]));)o.push(e[n++]);for(;n<t&&(u=c||a.next(e[n]));)c=null,(a=u).accepts()?(p=0,f=a):p>=0&&p++,n++,l++;if(p<0)for(var d=n-l;d<n;d++)o.push(e[d]);else{o.length>0&&(r.push(new i.TEXT(o)),o=[]),n-=p,l-=p;var m=f.emit();r.push(new m(e.slice(n-l,n)))}}return o.length>0&&r.push(new i.TEXT(o)),r},t.start=s},function(e,t,n){"use strict";t.__esModule=!0,t.URL=t.TEXT=t.NL=t.EMAIL=t.MAILTOEMAIL=t.Base=void 0;var r=n(196),i=n(43),o=n(59);function a(e){return e instanceof o.DOMAIN||e instanceof o.TLD}var c=(0,r.createTokenClass)();c.prototype={type:"token",isLink:!1,toString:function(){for(var e=[],t=0;t<this.v.length;t++)e.push(this.v[t].toString());return e.join("")},toHref:function(){return this.toString()},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http";return{type:this.type,value:this.toString(),href:this.toHref(e)}}};var s=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"email",isLink:!0}),u=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"email",isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),l=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"text"}),f=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"nl"}),p=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"url",isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http",t=!1,n=!1,r=this.v,i=[],c=0;r[c]instanceof o.PROTOCOL;)t=!0,i.push(r[c].toString().toLowerCase()),c++;for(;r[c]instanceof o.SLASH;)n=!0,i.push(r[c].toString()),c++;for(;a(r[c]);)i.push(r[c].toString().toLowerCase()),c++;for(;c<r.length;c++)i.push(r[c].toString());return i=i.join(""),t||n||(i=e+"://"+i),i},hasProtocol:function(){return this.v[0]instanceof o.PROTOCOL}});t.Base=c,t.MAILTOEMAIL=s,t.EMAIL=u,t.NL=f,t.TEXT=l,t.URL=p},function(e,t,n){const{defaults:r}=n(39),{block:i}=n(199),{rtrim:o,splitCells:a,escape:c}=n(34);e.exports=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.rules=i.normal,this.options.pedantic?this.rules=i.pedantic:this.options.gfm&&(this.rules=i.gfm)}static get rules(){return i}static lex(t,n){return new e(n).lex(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.token(e,!0)}token(e,t){let n,r,s,u,l,f,p,d,m,h,y,v,b,g,S,E;for(e=e.replace(/^ +$/gm,"");e;)if((s=this.rules.newline.exec(e))&&(e=e.substring(s[0].length),s[0].length>1&&this.tokens.push({type:"space"})),s=this.rules.code.exec(e)){const t=this.tokens[this.tokens.length-1];e=e.substring(s[0].length),t&&"paragraph"===t.type?t.text+="\n"+s[0].trimRight():(s=s[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?s:o(s,"\n")}))}else if(s=this.rules.fences.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"code",lang:s[2]?s[2].trim():s[2],text:s[3]||""});else if(s=this.rules.heading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:s[1].length,text:s[2]});else if((s=this.rules.nptable.exec(e))&&(f={type:"table",header:a(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]},f.header.length===f.align.length)){for(e=e.substring(s[0].length),y=0;y<f.align.length;y++)/^ *-+: *$/.test(f.align[y])?f.align[y]="right":/^ *:-+: *$/.test(f.align[y])?f.align[y]="center":/^ *:-+ *$/.test(f.align[y])?f.align[y]="left":f.align[y]=null;for(y=0;y<f.cells.length;y++)f.cells[y]=a(f.cells[y],f.header.length);this.tokens.push(f)}else if(s=this.rules.hr.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"hr"});else if(s=this.rules.blockquote.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"blockquote_start"}),s=s[0].replace(/^ *> ?/gm,""),this.token(s,t),this.tokens.push({type:"blockquote_end"});else if(s=this.rules.list.exec(e)){for(e=e.substring(s[0].length),u=s[2],g=u.length>1,p={type:"list_start",ordered:g,start:g?+u:"",loose:!1},this.tokens.push(p),s=s[0].match(this.rules.item),d=[],n=!1,b=s.length,y=0;y<b;y++)f=s[y],h=f.length,f=f.replace(/^ *([*+-]|\d+\.) */,""),~f.indexOf("\n ")&&(h-=f.length,f=this.options.pedantic?f.replace(/^ {1,4}/gm,""):f.replace(new RegExp("^ {1,"+h+"}","gm"),"")),y!==b-1&&(l=i.bullet.exec(s[y+1])[0],(u.length>1?1===l.length:l.length>1||this.options.smartLists&&l!==u)&&(e=s.slice(y+1).join("\n")+e,y=b-1)),r=n||/\n\n(?!\s*$)/.test(f),y!==b-1&&(n="\n"===f.charAt(f.length-1),r||(r=n)),r&&(p.loose=!0),S=/^\[[ xX]\] /.test(f),E=void 0,S&&(E=" "!==f[1],f=f.replace(/^\[[ xX]\] +/,"")),m={type:"list_item_start",task:S,checked:E,loose:r},d.push(m),this.tokens.push(m),this.token(f,!1),this.tokens.push({type:"list_item_end"});if(p.loose)for(b=d.length,y=0;y<b;y++)d[y].loose=!0;this.tokens.push({type:"list_end"})}else if(s=this.rules.html.exec(e))e=e.substring(s[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===s[1]||"script"===s[1]||"style"===s[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):c(s[0]):s[0]});else if(t&&(s=this.rules.def.exec(e)))e=e.substring(s[0].length),s[3]&&(s[3]=s[3].substring(1,s[3].length-1)),v=s[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[v]||(this.tokens.links[v]={href:s[2],title:s[3]});else if((s=this.rules.table.exec(e))&&(f={type:"table",header:a(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]},f.header.length===f.align.length)){for(e=e.substring(s[0].length),y=0;y<f.align.length;y++)/^ *-+: *$/.test(f.align[y])?f.align[y]="right":/^ *:-+: *$/.test(f.align[y])?f.align[y]="center":/^ *:-+ *$/.test(f.align[y])?f.align[y]="left":f.align[y]=null;for(y=0;y<f.cells.length;y++)f.cells[y]=a(f.cells[y].replace(/^ *\| *| *\| *$/g,""),f.header.length);this.tokens.push(f)}else if(s=this.rules.lheading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:"="===s[2].charAt(0)?1:2,text:s[1]});else if(t&&(s=this.rules.paragraph.exec(e)))e=e.substring(s[0].length),this.tokens.push({type:"paragraph",text:"\n"===s[1].charAt(s[1].length-1)?s[1].slice(0,-1):s[1]});else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"text",text:s[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens}}},function(e,t,n){const r=n(60),i=n(200),o=n(201),a=n(202),{defaults:c}=n(39),{merge:s,unescape:u}=n(34);e.exports=class e{constructor(e){this.tokens=[],this.token=null,this.options=e||c,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new i}static parse(t,n){return new e(n).parse(t)}parse(e){this.inline=new o(e.links,this.options),this.inlineText=new o(e.links,s({},this.options,{renderer:new a})),this.tokens=e.reverse();let t="";for(;this.next();)t+=this.tok();return t}next(){return this.token=this.tokens.pop(),this.token}peek(){return this.tokens[this.tokens.length-1]||0}parseText(){let e=this.token.text;for(;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}tok(){let e="";switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,u(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":{let t,n,r,i,o="";for(r="",t=0;t<this.token.header.length;t++)r+=this.renderer.tablecell(this.inline.output(this.token.header[t]),{header:!0,align:this.token.align[t]});for(o+=this.renderer.tablerow(r),t=0;t<this.token.cells.length;t++){for(n=this.token.cells[t],r="",i=0;i<n.length;i++)r+=this.renderer.tablecell(this.inline.output(n[i]),{header:!1,align:this.token.align[i]});e+=this.renderer.tablerow(r)}return this.renderer.table(o,e)}case"blockquote_start":for(e="";"blockquote_end"!==this.next().type;)e+=this.tok();return this.renderer.blockquote(e);case"list_start":{e="";const t=this.token.ordered,n=this.token.start;for(;"list_end"!==this.next().type;)e+=this.tok();return this.renderer.list(e,t,n)}case"list_item_start":{e="";const t=this.token.loose,n=this.token.checked,r=this.token.task;if(this.token.task)if(t)if("text"===this.peek().type){const e=this.peek();e.text=this.renderer.checkbox(n)+" "+e.text}else this.tokens.push({type:"text",text:this.renderer.checkbox(n)});else e+=this.renderer.checkbox(n);for(;"list_item_end"!==this.next().type;)e+=t||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(e,r,n)}case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:{const e='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(e);console.log(e)}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var r=o(n(0)),i=o(n(263));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?d(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=function(e){function t(){var e,n;u(this,t);for(var o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];return h(d(n=f(this,(e=p(t)).call.apply(e,[this].concat(a)))),"onClick",(function(e){var t=n.props,o=t.text,a=t.onCopy,c=t.children,s=t.options,u=r.default.Children.only(c),l=(0,i.default)(o,s);a&&a(o,l),u&&u.props&&"function"==typeof u.props.onClick&&u.props.onClick(e)})),n}var n,o,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(t,e),n=t,(o=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=s(e,["text","onCopy","options","children"]),i=r.default.Children.only(t);return r.default.cloneElement(i,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(n,!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{onClick:this.onClick}))}}])&&l(n.prototype,o),a&&l(n,a),t}(r.default.PureComponent);t.CopyToClipboard=y,h(y,"defaultProps",{onCopy:void 0,options:void 0})},function(e,t,n){"use strict";var r=n(264),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,o,a,c,s,u,l=!1;t||(t={}),n=t.debug||!1;try{if(a=r(),c=document.createRange(),s=document.getSelection(),(u=document.createElement("span")).textContent=e,u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=i[t.format]||i.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(u),c.selectNodeContents(u),s.addRange(c),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),o=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(c):s.removeAllRanges()),u&&document.body.removeChild(u),a()}return l}},function(e,t){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}},function(e,t,n){"use strict";n.r(t);var r={UPLOAD_IMAGE:"upload:image"},i={Subjects:Object.assign({SUBJECTS:"subjects",NEW_SUBJECT:"new:subject",EDIT_SUBJECT:"edit:subject",EDIT_SUBJECT_PLAYLISTS:"edit:subject:playlists",EDIT_SUBJECT_SERIES:"edit:subject:series",EDIT_SUBJECT_VIDEOS:"edit:subject:videos",SUBJECT_CLASSIFICATIONS:"subject:classifications",DELETE_SUBJECT:"delete:subject",ADD_SUBJECT_MEMBERS:"add:subject:members",REMOVE_SUBJECT_MEMBER:"remove:subject:member",CLASSIFICATIONS:"classifications",PRESENTATION_CLASSIFICATIONS:"presentation:classifications",NEW_CLASSIFICATION:"new:classification",EDIT_CLASSIFICATION:"edit:classification",EDIT_CLASSIFICATION_PLAYLISTS:"edit:classification:playlists",EDIT_CLASSIFICATION_SERIES:"edit:classification:series",EDIT_CLASSIFICATION_VIDEOS:"edit:classification:videos",DELETE_CLASSIFICATION:"delete:classification",REMOVE_CLASSIFICATION_MEMBER:"remove:classification:member",LEVELS:"levels",NEW_LEVEL:"new:level",EDIT_LEVEL:"edit:level",LEVEL_AUDIENCES:"level:audiences",EDIT_LEVEL_PLAYLISTS:"edit:level:playlists",EDIT_LEVEL_SERIES:"edit:level:series",EDIT_LEVEL_VIDEOS:"edit:level:videos",REMOVE_LEVEL_MEMBER:"remove:level:member",AUDIENCES:"audiences",PRESENTATION_AUDIENCES:"presentation:audiences",NEW_AUDIENCE:"new:audience",EDIT_AUDIENCE:"edit:audience",EDIT_AUDIENCE_PLAYLISTS:"edit:audience:playlists",EDIT_AUDIENCE_SERIES:"edit:audience:series",EDIT_AUDIENCE_VIDEOS:"edit:audience:videos",DELETE_AUDIENCE:"delete:audience",REMOVE_AUDIENCE_MEMBER:"remove:audience:member",PRESENTATIONS:"presentations",NEW_PRESENTATION:"new:presentation",EDIT_PRESENTATION:"edit:presentation"},r),Playlists:Object.assign({PLAYLISTS:"index",SEARCH_PLAYLISTS:"search:playlists",NEW_PLAYLIST:"new:playlist",EDIT_PLAYLIST:"edit:playlist",EDIT_PLAYLIST_VIDEOS:"edit:playlist:videos",EDIT_PLAYLIST_DASHBOARDS:"edit:playlist:dashboards",EDIT_PLAYLIST_SUBJECTS:"edit:playlist:subjects",EDIT_PLAYLIST_AUDIENCES:"edit:playlist:audiences",DELETE_PLAYLIST:"delete:playlist",REMOVE_VIDEO:"remove:video",REMOVE_FROM_SUBJECT:"remove:from:subject",DASHBOARD:"dashboard",DELETE_DASHBOARD_WIDGET:"delete:dashboard:widget"},r),Series:Object.assign({EDIT_SERIES:"edit:series",EDIT_SERIES_VIDEOS:"edit:series:videos",EDIT_SERIES_SUBJECTS:"edit:series:subjects",EDIT_SERIES_AUDIENCES:"edit:series:audiences",LEGACY_EDIT_SERIES:"legacy:edit:series"},r),Videos:Object.assign({EDIT_VIDEO:"edit:video",EDIT_VIDEO_AUDIENCES:"edit:video:audiences",EDIT_VIDEO_SUBJECTS:"edit:video:subjects",EDIT_VIDEO_ALIASES:"edit:video:aliases",LEGACY_EDIT_VIDEO:"legacy:edit:video"},r),DomainOptions:{DOMAIN_OPTIONS:"domain:options",NEW_DOMAIN_OPTION:"new:domain:option",EDIT_DOMAIN_OPTION:"edit:domain:option",DELETE_DOMAIN_OPTION:"delete:domain:option"},People:{PEOPLE:"people",NEW_PERSON:"new:person",EDIT_PERSON:"edit:person"},Companies:{COMPANIES:"companies",NEW_COMPANY:"new:company",EDIT_COMPANY:"edit:company"},Themes:Object.assign({THEMES:"themes",NEW_THEME:"new:theme",EDIT_THEME:"edit:theme",DELETE_THEME:"delete:theme"},r),ReleaseNotes:{FORM:"form",GENERATOR:"generator"},Customers:{MANAGE_CUSTOMER:"manage:customer",MANAGE_CUSTOMER_TOPICS:"manage:customer:topics"},Users:{HOME:"index",USER:"user"}},o={SUBJECT:"subject",SUBJECTS:"subjects",UPDATE_SUBJECT:"update:subject",DELETE_SUBJECT:"delete:subject",UPDATE_OBJECT_SUBJECTS:"update:object:subjects",ADD_TO_SUBJECT:"add:to:subject",REMOVE_FROM_SUBJECT:"remove:from:subject",CLASSIFICATION:"classification",CLASSIFICATIONS:"classifications",UPDATE_CLASSIFICATION:"update:classification",DELETE_CLASSIFICATION:"delete:classification",UPDATE_OBJECT_CLASSIFICATIONS:"update:object:classifications",ADD_TO_CLASSIFICATION:"add:to:classification",REMOVE_FROM_CLASSIFICATION:"remove:from:classification",PRESENTATION:"presentation",PRESENTATIONS:"presentations",UPDATE_PRESENTATION:"update:presentation",LEVEL:"level",LEVELS:"levels",UPDATE_LEVEL:"update:level",ADD_TO_LEVEL:"add:to:level",REMOVE_FROM_LEVEL:"remove:from:level",UPDATE_OBJECT_LEVELS:"update:object:levels",AUDIENCE:"audience",AUDIENCES:"audiences",UPDATE_AUDIENCE:"update:audience",DELETE_AUDIENCE:"delete:audience",UPDATE_OBJECT_AUDIENCES:"update:object:audiences",ADD_TO_AUDIENCE:"add:to:audience",REMOVE_FROM_AUDIENCE:"remove:from:audience",PLAYLIST:"playlist",PLAYLISTS:"playlists",UPDATE_PLAYLIST:"update:playlist",DELETE_PLAYLIST:"delete:playlist",PLAYLIST_VIDEOS:"playlist:videos",REORDER_PLAYLIST_VIDEOS:"reorder:playlist:videos",REMOVE_PLAYLIST_VIDEO:"remove:playlist:video",VIDEO:"video",SERIES:"series",SERIES_BY_ID:"series:by:id",UPDATE_SERIES:"update:series",CURRENT_USER:"current:user",UPLOAD_IMAGE:"upload:image",LOCALE:"locale",PHRASES:"PHRASES"},a={CURATOR_LAYOUT:"CuratorLayout"},c={COMPANIES:"companies:application",CUSTOMERS:"customers:application",DOMAIN_OPTIONS:"domain:options:application",PEOPLE:"people:application",PLAYLISTS:"playlists:application",SERIES:"series:application",SUBJECTS:"subjects:application",THEMES:"themes:application",VIDEOS:"videos:application",RELEASE_NOTES:"release:notes:application",USERS:"users:application"},s={IMAGE_UPLOAD:"image:upload:data:service",SUBJECT:"subject:data:service",LANGUAGE:"language:data:service"},u={SUBJECT:"SubjectDataService",LANGUAGE:"LanguageDataService"},l=n(0),f=n.n(l),p=n(25),d=n(1),m=function(e,t,n){return d.debounce(e,t,n)},h=function(e){return d.isFunction(e)},y=function(){return d.identity},v=n(54),b=n(6);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=A(e);if(t){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return w(this,n)}}function w(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(o,e);var t,n,r,i=C(o);function o(){return S(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"isReactComponent",value:function(e){return l&&l.isValidElement(e)}},{key:"showChildView",value:function(e,t){this.isReactComponent(t)&&this.showChildReactComponent(e,t)}},{key:"showChildReactComponent",value:function(e,t){var n=this;this.isAttached()?this.renderChildReactComponent(e,t):this.listenToOnce(this,"attach",(function(){return n.renderChildReactComponent(e,t)}))}},{key:"renderChildReactComponent",value:function(e,t){var n=this.getRegion(e),r=this.$el.find(n.el);r&&r.length&&(n.trigger("before:show"),v.render(t,r[0],(function(){return n.trigger("show")})),this.listenToOnce(this,"unmount:".concat(e),(function(){return v.unmountComponentAtNode(r[0])})),this.listenToOnce(this,"before:destroy",(function(){return v.unmountComponentAtNode(r[0])})))}},{key:"wrapWithStore",value:function(e){return l.createElement(b.Provider,{store:this.options.store},e)}}])&&E(t.prototype,n),r&&E(t,r),o}(n(46).a),T="top:nav",k="left:nav",I="content",L="popup",_="alert",P=n(206),x=n.n(P),N=n(55),R=n.n(N);function D(e){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function U(e,t,n){return(U="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=H(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function F(e,t){return(F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=H(e);if(t){var i=H(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return B(this,n)}}function B(e,t){return!t||"object"!==D(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function H(e){return(H=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&F(e,t)}(o,e);var t,n,r,i=V(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).childComponents={},t}return t=o,r=[{key:"getCacheKey",value:function(e){var t="".concat(this.name),n=[];return Object.keys(e).forEach((function(t){n.push("".concat(t,":").concat(e[t]))})),n.length&&(n.sort(),t+=":".concat(n.join(":"))),t}}],(n=[{key:"title",get:function(){return!1}},{key:"name",get:function(){return"CuratorLayoutView"}},{key:"template",get:function(){return x.a}},{key:"className",get:function(){return"container-fluid ".concat(R.a.curatorLayout)}},{key:"regions",value:function(){return{layout:".layout-region"}}},{key:"getChildComponents",value:function(){return{topNav:{component:this.childComponents[T],className:R.a.topNavRegion},leftNav:{component:this.childComponents[k],className:"py-3 ".concat(R.a.leftNavRegion)},content:{component:this.childComponents[I],className:"position-relative container py-3"},popup:{component:this.childComponents[L]},alert:{component:this.childComponents[_]}}}},{key:"unsetRegion",value:function(e){delete this.childComponents[e],this.renderLayout()}},{key:"renderTopNav",value:function(){h(this.options.getTopNavView)&&(this.childComponents[T]=this.options.getTopNavView(p.AppLinkHelper.getCurrentAppLink()))}},{key:"hideLeftNav",value:function(){this.unsetRegion(k)}},{key:"closePopup",value:function(){this.unsetRegion(L)}},{key:"showChildView",value:function(e,t){this.childComponents[e]=t,this.renderTopNav(),this.renderLayout()}},{key:"renderLayout",value:function(){var e=Object.assign({provider:this.options.provider},this.getChildComponents());U(H(o.prototype),"showChildView",this).call(this,"layout",this.wrapWithStore(l.createElement(Y,Object.assign({},e))))}}])&&M(t.prototype,n),r&&M(t,r),o}(j),q=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},J=function(e){var t=e.className,n=e.children;return l.createElement("div",{className:t},n)},K=function(e,t){return"".concat(e).concat(t?" ".concat(t):"")},W=function(e){var t=e.topNav,n=e.leftNav,r=e.content,i=e.popup,o=e.alert;return l.createElement(l.Fragment,null,l.createElement("div",{className:"position-relative"},!!t.component&&l.createElement(J,{className:K("top-nav-region",t.className)},t.component),!!n.component&&l.createElement(J,{className:K("left-nav-region",n.className)},n.component),!!r.component&&l.createElement("div",{className:"content-container"},l.createElement(J,{className:K("content-region",r.className)},r.component))),!!i.component&&l.createElement(J,{className:K("popup-region",i.className)},i.component),!!o.component&&l.createElement(J,{className:K("alert-region",o.className)},o.component))},Y=function(e){var t=e.provider,n=q(e,["provider"]);return t?l.createElement(t,null,l.createElement(W,Object.assign({},n))):l.createElement(W,Object.assign({},n))},G=n(9);function Z(e){return(Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Q(e){return function(e){if(Array.isArray(e))return X(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return X(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ne(e,t){return(ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function re(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe(e);if(t){var i=oe(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie(this,n)}}function ie(e,t){return!t||"object"!==Z(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function oe(e){return(oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ne(e,t)}(o,e);var t,n,r,i=re(o);function o(){return ee(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"initialize",value:function(){this.listenTo(G.a.SHELL,p.EventNames.ROUTING_END,this.updateNav)}},{key:"name",get:function(){return"CuratorAppNavService"}},{key:"updateNav",value:function(){var e=this,t=p.AppLinkHelper.getCurrentAppLink().application;if(t!==this.currentApplication){this.currentApplication=t;var n=this.options.navItemMappings[t];if(n){var r=document.querySelector(this.options.navSelector);r&&r.children&&Q(r.children).forEach((function(t){var r=t.querySelector("a");r&&(r.classList.remove(e.options.currentItemClassName),r.text===n&&r.classList.add(e.options.currentItemClassName))}))}}}}])&&te(t.prototype,n),r&&te(t,r),o}(p.Service),ce=n(70),se=n(8),ue=function(e){var t="/api/master/v2/companies";return e?"".concat(t,"?cursor=").concat(e):t},le=function(e){return"/api/master/v2/objects/".concat(e)},fe=function(){return"/api/master/v2/companies"},pe=function(e){return"/api/master/v2/objects/".concat(e)},de="companies",me="company",he="update:company",ye=function(e){return{key:"".concat(de).concat(e?":".concat(e):""),url:ue(e)}},ve=function(e){return{key:"".concat(me,":").concat(e),url:le(e)}},be=function(e,t,n){return{key:me,url:fe(),data:e,type:se.a.POST,success:t,error:n,invalidationKeys:[de]}},ge=function(e,t,n){return{key:"".concat(he,":").concat(e),url:pe(e),data:t,type:se.a.PUT,always:n}},Se=n(32),Ee=n.n(Se),Oe=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Ce}(e)}(e)};var Ce="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function we(e,t){return!1!==t.clone&&t.isMergeableObject(e)?je((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Ae(e,t,n){return e.concat(t).map((function(e){return we(e,n)}))}function je(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Ae,n.isMergeableObject=n.isMergeableObject||Oe;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=we(e[t],n)})),Object.keys(t).forEach((function(i){n.isMergeableObject(t[i])&&e[i]?r[i]=je(e[i],t[i],n):r[i]=we(t[i],n)})),r}(e,t,n):we(t,n)}je.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return je(e,n,t)}),{})};var Te=je,ke=n(15),Ie=ke.a.Symbol,Le=Object.prototype,_e=Le.hasOwnProperty,Pe=Le.toString,xe=Ie?Ie.toStringTag:void 0;var Ne=function(e){var t=_e.call(e,xe),n=e[xe];try{e[xe]=void 0;var r=!0}catch(e){}var i=Pe.call(e);return r&&(t?e[xe]=n:delete e[xe]),i},Re=Object.prototype.toString;var De=function(e){return Re.call(e)},Me=Ie?Ie.toStringTag:void 0;var Ue=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Me&&Me in Object(e)?Ne(e):De(e)};var Fe=function(e,t){return function(n){return e(t(n))}},Ve=Fe(Object.getPrototypeOf,Object);var Be=function(e){return null!=e&&"object"==typeof e},He=Function.prototype,ze=Object.prototype,qe=He.toString,Je=ze.hasOwnProperty,$e=qe.call(Object);var Ke=function(e){if(!Be(e)||"[object Object]"!=Ue(e))return!1;var t=Ve(e);if(null===t)return!0;var n=Je.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&qe.call(n)==$e};var We=function(){this.__data__=[],this.size=0};var Ye=function(e,t){return e===t||e!=e&&t!=t};var Ge=function(e,t){for(var n=e.length;n--;)if(Ye(e[n][0],t))return n;return-1},Ze=Array.prototype.splice;var Qe=function(e){var t=this.__data__,n=Ge(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ze.call(t,n,1),--this.size,!0)};var Xe=function(e){var t=this.__data__,n=Ge(t,e);return n<0?void 0:t[n][1]};var et=function(e){return Ge(this.__data__,e)>-1};var tt=function(e,t){var n=this.__data__,r=Ge(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function nt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nt.prototype.clear=We,nt.prototype.delete=Qe,nt.prototype.get=Xe,nt.prototype.has=et,nt.prototype.set=tt;var rt=nt;var it=function(){this.__data__=new rt,this.size=0};var ot=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var at=function(e){return this.__data__.get(e)};var ct=function(e){return this.__data__.has(e)};var st=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var ut,lt=function(e){if(!st(e))return!1;var t=Ue(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ft=ke.a["__core-js_shared__"],pt=(ut=/[^.]+$/.exec(ft&&ft.keys&&ft.keys.IE_PROTO||""))?"Symbol(src)_1."+ut:"";var dt=function(e){return!!pt&&pt in e},mt=Function.prototype.toString;var ht=function(e){if(null!=e){try{return mt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},yt=/^\[object .+?Constructor\]$/,vt=Function.prototype,bt=Object.prototype,gt=vt.toString,St=bt.hasOwnProperty,Et=RegExp("^"+gt.call(St).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ot=function(e){return!(!st(e)||dt(e))&&(lt(e)?Et:yt).test(ht(e))};var Ct=function(e,t){return null==e?void 0:e[t]};var wt=function(e,t){var n=Ct(e,t);return Ot(n)?n:void 0},At=wt(ke.a,"Map"),jt=wt(Object,"create");var Tt=function(){this.__data__=jt?jt(null):{},this.size=0};var kt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},It=Object.prototype.hasOwnProperty;var Lt=function(e){var t=this.__data__;if(jt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return It.call(t,e)?t[e]:void 0},_t=Object.prototype.hasOwnProperty;var Pt=function(e){var t=this.__data__;return jt?void 0!==t[e]:_t.call(t,e)};var xt=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=jt&&void 0===t?"__lodash_hash_undefined__":t,this};function Nt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Nt.prototype.clear=Tt,Nt.prototype.delete=kt,Nt.prototype.get=Lt,Nt.prototype.has=Pt,Nt.prototype.set=xt;var Rt=Nt;var Dt=function(){this.size=0,this.__data__={hash:new Rt,map:new(At||rt),string:new Rt}};var Mt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Ut=function(e,t){var n=e.__data__;return Mt(t)?n["string"==typeof t?"string":"hash"]:n.map};var Ft=function(e){var t=Ut(this,e).delete(e);return this.size-=t?1:0,t};var Vt=function(e){return Ut(this,e).get(e)};var Bt=function(e){return Ut(this,e).has(e)};var Ht=function(e,t){var n=Ut(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function zt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zt.prototype.clear=Dt,zt.prototype.delete=Ft,zt.prototype.get=Vt,zt.prototype.has=Bt,zt.prototype.set=Ht;var qt=zt;var Jt=function(e,t){var n=this.__data__;if(n instanceof rt){var r=n.__data__;if(!At||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qt(r)}return n.set(e,t),this.size=n.size,this};function $t(e){var t=this.__data__=new rt(e);this.size=t.size}$t.prototype.clear=it,$t.prototype.delete=ot,$t.prototype.get=at,$t.prototype.has=ct,$t.prototype.set=Jt;var Kt=$t;var Wt=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},Yt=function(){try{var e=wt(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Gt=function(e,t,n){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Zt=Object.prototype.hasOwnProperty;var Qt=function(e,t,n){var r=e[t];Zt.call(e,t)&&Ye(r,n)&&(void 0!==n||t in e)||Gt(e,t,n)};var Xt=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var c=t[o],s=r?r(n[c],e[c],c,n,e):void 0;void 0===s&&(s=e[c]),i?Gt(n,c,s):Qt(n,c,s)}return n};var en=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var tn=function(e){return Be(e)&&"[object Arguments]"==Ue(e)},nn=Object.prototype,rn=nn.hasOwnProperty,on=nn.propertyIsEnumerable,an=tn(function(){return arguments}())?tn:function(e){return Be(e)&&rn.call(e,"callee")&&!on.call(e,"callee")},cn=Array.isArray,sn=n(49),un=/^(?:0|[1-9]\d*)$/;var ln=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&un.test(e))&&e>-1&&e%1==0&&e<t};var fn=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},pn={};pn["[object Float32Array]"]=pn["[object Float64Array]"]=pn["[object Int8Array]"]=pn["[object Int16Array]"]=pn["[object Int32Array]"]=pn["[object Uint8Array]"]=pn["[object Uint8ClampedArray]"]=pn["[object Uint16Array]"]=pn["[object Uint32Array]"]=!0,pn["[object Arguments]"]=pn["[object Array]"]=pn["[object ArrayBuffer]"]=pn["[object Boolean]"]=pn["[object DataView]"]=pn["[object Date]"]=pn["[object Error]"]=pn["[object Function]"]=pn["[object Map]"]=pn["[object Number]"]=pn["[object Object]"]=pn["[object RegExp]"]=pn["[object Set]"]=pn["[object String]"]=pn["[object WeakMap]"]=!1;var dn=function(e){return Be(e)&&fn(e.length)&&!!pn[Ue(e)]};var mn=function(e){return function(t){return e(t)}},hn=n(29),yn=hn.a&&hn.a.isTypedArray,vn=yn?mn(yn):dn,bn=Object.prototype.hasOwnProperty;var gn=function(e,t){var n=cn(e),r=!n&&an(e),i=!n&&!r&&Object(sn.a)(e),o=!n&&!r&&!i&&vn(e),a=n||r||i||o,c=a?en(e.length,String):[],s=c.length;for(var u in e)!t&&!bn.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ln(u,s))||c.push(u);return c},Sn=Object.prototype;var En=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Sn)},On=Fe(Object.keys,Object),Cn=Object.prototype.hasOwnProperty;var wn=function(e){if(!En(e))return On(e);var t=[];for(var n in Object(e))Cn.call(e,n)&&"constructor"!=n&&t.push(n);return t};var An=function(e){return null!=e&&fn(e.length)&&!lt(e)};var jn=function(e){return An(e)?gn(e):wn(e)};var Tn=function(e,t){return e&&Xt(t,jn(t),e)};var kn=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},In=Object.prototype.hasOwnProperty;var Ln=function(e){if(!st(e))return kn(e);var t=En(e),n=[];for(var r in e)("constructor"!=r||!t&&In.call(e,r))&&n.push(r);return n};var _n=function(e){return An(e)?gn(e,!0):Ln(e)};var Pn=function(e,t){return e&&Xt(t,_n(t),e)},xn=n(208);var Nn=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var Rn=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o};var Dn=function(){return[]},Mn=Object.prototype.propertyIsEnumerable,Un=Object.getOwnPropertySymbols,Fn=Un?function(e){return null==e?[]:(e=Object(e),Rn(Un(e),(function(t){return Mn.call(e,t)})))}:Dn;var Vn=function(e,t){return Xt(e,Fn(e),t)};var Bn=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},Hn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Bn(t,Fn(e)),e=Ve(e);return t}:Dn;var zn=function(e,t){return Xt(e,Hn(e),t)};var qn=function(e,t,n){var r=t(e);return cn(e)?r:Bn(r,n(e))};var Jn=function(e){return qn(e,jn,Fn)};var $n=function(e){return qn(e,_n,Hn)},Kn=wt(ke.a,"DataView"),Wn=wt(ke.a,"Promise"),Yn=wt(ke.a,"Set"),Gn=wt(ke.a,"WeakMap"),Zn=ht(Kn),Qn=ht(At),Xn=ht(Wn),er=ht(Yn),tr=ht(Gn),nr=Ue;(Kn&&"[object DataView]"!=nr(new Kn(new ArrayBuffer(1)))||At&&"[object Map]"!=nr(new At)||Wn&&"[object Promise]"!=nr(Wn.resolve())||Yn&&"[object Set]"!=nr(new Yn)||Gn&&"[object WeakMap]"!=nr(new Gn))&&(nr=function(e){var t=Ue(e),n="[object Object]"==t?e.constructor:void 0,r=n?ht(n):"";if(r)switch(r){case Zn:return"[object DataView]";case Qn:return"[object Map]";case Xn:return"[object Promise]";case er:return"[object Set]";case tr:return"[object WeakMap]"}return t});var rr=nr,ir=Object.prototype.hasOwnProperty;var or=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ir.call(e,"index")&&(n.index=e.index,n.input=e.input),n},ar=ke.a.Uint8Array;var cr=function(e){var t=new e.constructor(e.byteLength);return new ar(t).set(new ar(e)),t};var sr=function(e,t){var n=t?cr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},ur=/\w*$/;var lr=function(e){var t=new e.constructor(e.source,ur.exec(e));return t.lastIndex=e.lastIndex,t},fr=Ie?Ie.prototype:void 0,pr=fr?fr.valueOf:void 0;var dr=function(e){return pr?Object(pr.call(e)):{}};var mr=function(e,t){var n=t?cr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var hr=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return cr(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return sr(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return mr(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return lr(e);case"[object Set]":return new r;case"[object Symbol]":return dr(e)}},yr=Object.create,vr=function(){function e(){}return function(t){if(!st(t))return{};if(yr)return yr(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var br=function(e){return"function"!=typeof e.constructor||En(e)?{}:vr(Ve(e))};var gr=function(e){return Be(e)&&"[object Map]"==rr(e)},Sr=hn.a&&hn.a.isMap,Er=Sr?mn(Sr):gr;var Or=function(e){return Be(e)&&"[object Set]"==rr(e)},Cr=hn.a&&hn.a.isSet,wr=Cr?mn(Cr):Or,Ar={};Ar["[object Arguments]"]=Ar["[object Array]"]=Ar["[object ArrayBuffer]"]=Ar["[object DataView]"]=Ar["[object Boolean]"]=Ar["[object Date]"]=Ar["[object Float32Array]"]=Ar["[object Float64Array]"]=Ar["[object Int8Array]"]=Ar["[object Int16Array]"]=Ar["[object Int32Array]"]=Ar["[object Map]"]=Ar["[object Number]"]=Ar["[object Object]"]=Ar["[object RegExp]"]=Ar["[object Set]"]=Ar["[object String]"]=Ar["[object Symbol]"]=Ar["[object Uint8Array]"]=Ar["[object Uint8ClampedArray]"]=Ar["[object Uint16Array]"]=Ar["[object Uint32Array]"]=!0,Ar["[object Error]"]=Ar["[object Function]"]=Ar["[object WeakMap]"]=!1;var jr=function e(t,n,r,i,o,a){var c,s=1&n,u=2&n,l=4&n;if(r&&(c=o?r(t,i,o,a):r(t)),void 0!==c)return c;if(!st(t))return t;var f=cn(t);if(f){if(c=or(t),!s)return Nn(t,c)}else{var p=rr(t),d="[object Function]"==p||"[object GeneratorFunction]"==p;if(Object(sn.a)(t))return Object(xn.a)(t,s);if("[object Object]"==p||"[object Arguments]"==p||d&&!o){if(c=u||d?{}:br(t),!s)return u?zn(t,Pn(c,t)):Vn(t,Tn(c,t))}else{if(!Ar[p])return o?t:{};c=hr(t,p,s)}}a||(a=new Kt);var m=a.get(t);if(m)return m;a.set(t,c),wr(t)?t.forEach((function(i){c.add(e(i,n,r,i,t,a))})):Er(t)&&t.forEach((function(i,o){c.set(o,e(i,n,r,o,t,a))}));var h=f?void 0:(l?u?$n:Jn:u?_n:jn)(t);return Wt(h||t,(function(i,o){h&&(i=t[o=i]),Qt(c,o,e(i,n,r,o,t,a))})),c};var Tr=function(e){return jr(e,4)};var kr=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i};var Ir=function(e){return"symbol"==typeof e||Be(e)&&"[object Symbol]"==Ue(e)};function Lr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Lr.Cache||qt),n}Lr.Cache=qt;var _r=Lr;var Pr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xr=/\\(\\)?/g,Nr=function(e){var t=_r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Pr,(function(e,n,r,i){t.push(r?i.replace(xr,"$1"):n||e)})),t}));var Rr=function(e){if("string"==typeof e||Ir(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Dr=Ie?Ie.prototype:void 0,Mr=Dr?Dr.toString:void 0;var Ur=function e(t){if("string"==typeof t)return t;if(cn(t))return kr(t,e)+"";if(Ir(t))return Mr?Mr.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var Fr=function(e){return null==e?"":Ur(e)};var Vr=function(e){return cn(e)?kr(e,Rr):Ir(e)?[e]:Nn(Nr(Fr(e)))};var Br=function(e,t){},Hr=n(61),zr=n(62),qr=n.n(zr);var Jr=function(e){return jr(e,5)};function $r(){return($r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Kr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Wr(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function Yr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Gr=function(e){return"function"==typeof e},Zr=function(e){return null!==e&&"object"==typeof e},Qr=function(e){return String(Math.floor(Number(e)))===e},Xr=function(e){return"[object String]"===Object.prototype.toString.call(e)},ei=function(e){return 0===l.Children.count(e)},ti=function(e){return Zr(e)&&Gr(e.then)};function ni(e,t,n,r){void 0===r&&(r=0);for(var i=Vr(t);e&&r<i.length;)e=e[i[r++]];return void 0===e?n:e}function ri(e,t,n){for(var r=Tr(e),i=r,o=0,a=Vr(t);o<a.length-1;o++){var c=a[o],s=ni(e,a.slice(0,o+1));if(s&&(Zr(s)||Array.isArray(s)))i=i[c]=Tr(s);else{var u=a[o+1];i=i[c]=Qr(u)&&Number(u)>=0?[]:{}}}return(0===o?e:i)[a[o]]===n?e:(void 0===n?delete i[a[o]]:i[a[o]]=n,0===o&&void 0===n&&delete r[a[o]],r)}function ii(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,o=Object.keys(e);i<o.length;i++){var a=o[i],c=e[a];Zr(c)?n.get(c)||(n.set(c,!0),r[a]=Array.isArray(c)?[]:{},ii(c,t,n,r[a])):r[a]=t}return r}var oi=Object(l.createContext)(void 0),ai=oi.Provider,ci=oi.Consumer;function si(){var e=Object(l.useContext)(oi);return e||Br(!1),e}function ui(e,t){switch(t.type){case"SET_VALUES":return $r({},e,{values:t.payload});case"SET_TOUCHED":return $r({},e,{touched:t.payload});case"SET_ERRORS":return $r({},e,{errors:t.payload});case"SET_STATUS":return $r({},e,{status:t.payload});case"SET_ISSUBMITTING":return $r({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return $r({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return $r({},e,{values:ri(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return $r({},e,{touched:ri(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return $r({},e,{errors:ri(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return $r({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return $r({},e,{touched:ii(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return $r({},e,{isSubmitting:!1});default:return e}}var li={},fi={};function pi(e){var t=e.validateOnChange,n=void 0===t||t,r=e.validateOnBlur,i=void 0===r||r,o=e.validateOnMount,a=void 0!==o&&o,c=e.isInitialValid,s=e.enableReinitialize,u=void 0!==s&&s,f=e.onSubmit,p=Wr(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),d=$r({validateOnChange:n,validateOnBlur:i,validateOnMount:a,onSubmit:f},p),m=Object(l.useRef)(d.initialValues),h=Object(l.useRef)(d.initialErrors||li),y=Object(l.useRef)(d.initialTouched||fi),v=Object(l.useRef)(d.initialStatus),b=Object(l.useRef)(!1),g=Object(l.useRef)({});Object(l.useEffect)((function(){0}),[]),Object(l.useEffect)((function(){return b.current=!0,function(){b.current=!1}}),[]);var S=Object(l.useReducer)(ui,{values:d.initialValues,errors:d.initialErrors||li,touched:d.initialTouched||fi,status:d.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),E=S[0],O=S[1],C=Object(l.useCallback)((function(e,t){return new Promise((function(n,r){var i=d.validate(e,t);null==i?n(li):ti(i)?i.then((function(e){n(e||li)}),(function(e){r(e)})):n(i)}))}),[d.validate]),w=Object(l.useCallback)((function(e,t){var n=d.validationSchema,r=Gr(n)?n(t):n,i=t&&r.validateAt?r.validateAt(t,e):function(e,t,n,r){void 0===n&&(n=!1);void 0===r&&(r={});var i=function e(t){var n={};for(var r in t)if(t.hasOwnProperty(r)){var i=String(r);!0===Array.isArray(t[i])?n[i]=t[i].map((function(t){return!0===Array.isArray(t)||Ke(t)?e(t):""!==t?t:void 0})):Ke(t[i])?n[i]=e(t[i]):n[i]=""!==t[i]?t[i]:void 0}return n}(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}(e,r);return new Promise((function(e,t){i.then((function(){e(li)}),(function(n){"ValidationError"===n.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return ri(t,e.path,e.message);var n=e.inner,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var a=o;ni(t,a.path)||(t=ri(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[d.validationSchema]),A=Object(l.useCallback)((function(e,t){return new Promise((function(n){return n(g.current[e].validate(t))}))}),[]),j=Object(l.useCallback)((function(e){var t=Object.keys(g.current).filter((function(e){return Gr(g.current[e].validate)})),n=t.length>0?t.map((function(t){return A(t,ni(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=ri(e,t[r],n)),e}),{})}))}),[A]),T=Object(l.useCallback)((function(e){return Promise.all([j(e),d.validationSchema?w(e):{},d.validate?C(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return Te.all([t,n,r],{arrayMerge:mi})}))}),[d.validate,d.validationSchema,j,C,w]),k=yi((function(e){return void 0===e&&(e=E.values),Object(Hr.unstable_runWithPriority)(Hr.LowPriority,(function(){return T(e).then((function(e){return b.current&&O({type:"SET_ERRORS",payload:e}),e}))}))})),I=yi((function(e){return void 0===e&&(e=E.values),O({type:"SET_ISVALIDATING",payload:!0}),T(e).then((function(e){return b.current&&(O({type:"SET_ISVALIDATING",payload:!1}),Ee()(E.errors,e)||O({type:"SET_ERRORS",payload:e})),e}))}));Object(l.useEffect)((function(){a&&!0===b.current&&k(d.initialValues)}),[d.initialValues,a,k]);var L=Object(l.useCallback)((function(e){var t=e&&e.values?e.values:m.current,n=e&&e.errors?e.errors:h.current?h.current:d.initialErrors||{},r=e&&e.touched?e.touched:y.current?y.current:d.initialTouched||{},i=e&&e.status?e.status:v.current?v.current:d.initialStatus;m.current=t,h.current=n,y.current=r,v.current=i,O({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})}),[d.initialErrors,d.initialStatus,d.initialTouched]);Object(l.useEffect)((function(){u&&!0===b.current&&!Ee()(m.current,d.initialValues)&&(m.current=d.initialValues,L())}),[u,d.initialValues,L]),Object(l.useEffect)((function(){u&&!0===b.current&&!Ee()(h.current,d.initialErrors)&&(h.current=d.initialErrors||li,O({type:"SET_ERRORS",payload:d.initialErrors||li}))}),[u,d.initialErrors]),Object(l.useEffect)((function(){u&&!0===b.current&&!Ee()(y.current,d.initialTouched)&&(y.current=d.initialTouched||fi,O({type:"SET_TOUCHED",payload:d.initialTouched||fi}))}),[u,d.initialTouched]),Object(l.useEffect)((function(){u&&!0===b.current&&!Ee()(v.current,d.initialStatus)&&(v.current=d.initialStatus,O({type:"SET_STATUS",payload:d.initialStatus}))}),[u,d.initialStatus,d.initialTouched]);var _=yi((function(e){if(Gr(g.current[e].validate)){var t=ni(E.values,e),n=g.current[e].validate(t);return ti(n)?(O({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),O({type:"SET_ISVALIDATING",payload:!1})}))):(O({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return Promise.resolve()})),P=Object(l.useCallback)((function(e,t){var n=t.validate;g.current[e]={validate:n}}),[]),x=Object(l.useCallback)((function(e){delete g.current[e]}),[]),N=yi((function(e){return O({type:"SET_TOUCHED",payload:e}),i?k(E.values):Promise.resolve()})),R=Object(l.useCallback)((function(e){O({type:"SET_ERRORS",payload:e})}),[]),D=yi((function(e){return O({type:"SET_VALUES",payload:e}),n?k(e):Promise.resolve()})),M=Object(l.useCallback)((function(e,t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),U=yi((function(e,t,r){return void 0===r&&(r=!0),O({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),n&&r?k(ri(E.values,e,t)):Promise.resolve()})),F=Object(l.useCallback)((function(e,t){var n,r=t,i=e;if(!Xr(e)){e.persist&&e.persist();var o=e.target,a=o.type,c=o.name,s=o.id,u=o.value,l=o.checked,f=(o.outerHTML,o.options),p=o.multiple;r=t||(c||s),i=/number|range/.test(a)?(n=parseFloat(u),isNaN(n)?"":n):/checkbox/.test(a)?function(e,t,n){if("true"==n||"false"==n)return!!t;if(t&&n)return Array.isArray(e)?e.concat(n):[n];if(!Array.isArray(e))return!e;var r=e.indexOf(n);if(r<0)return e;return e.slice(0,r).concat(e.slice(r+1))}(ni(E.values,r),l,u):p?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(f):u}r&&U(r,i)}),[U,E.values]),V=Object(l.useCallback)((function(e){if(Xr(e))return function(t){return F(t,e)};F(e)}),[F]),B=yi((function(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=!0),O({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),i&&n?k(E.values):Promise.resolve()})),H=Object(l.useCallback)((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,i=n.id,o=(n.outerHTML,t||(r||i));B(o,!0)}),[B]),z=Object(l.useCallback)((function(e){if(Xr(e))return function(t){return H(t,e)};H(e)}),[H]),q=Object(l.useCallback)((function(e){Gr(e)?O({type:"SET_FORMIK_STATE",payload:e}):O({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),J=Object(l.useCallback)((function(e){O({type:"SET_STATUS",payload:e})}),[]),$=Object(l.useCallback)((function(e){O({type:"SET_ISSUBMITTING",payload:e})}),[]),K={resetForm:L,validateForm:I,validateField:_,setErrors:R,setFieldError:M,setFieldTouched:B,setFieldValue:U,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,setFormikState:q},W=yi((function(){return f(E.values,K)})),Y=yi((function(){return O({type:"SUBMIT_ATTEMPT"}),I().then((function(e){if(0===Object.keys(e).length){var t=W();if(void 0===t)return;return Promise.resolve(t).then((function(){b.current&&O({type:"SUBMIT_SUCCESS"})})).catch((function(e){if(b.current)throw O({type:"SUBMIT_FAILURE"}),e}))}b.current&&O({type:"SUBMIT_FAILURE"})}))})),G=yi((function(e){e&&e.preventDefault&&Gr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Gr(e.stopPropagation)&&e.stopPropagation(),Y()})),Z=yi((function(e){if(e&&e.preventDefault&&Gr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Gr(e.stopPropagation)&&e.stopPropagation(),d.onReset){var t=d.onReset(E.values,K);ti(t)?t.then(L):L()}else L()})),Q=Object(l.useCallback)((function(e){return{value:ni(E.values,e),error:ni(E.errors,e),touched:!!ni(E.touched,e),initialValue:ni(m.current,e),initialTouched:!!ni(y.current,e),initialError:ni(h.current,e)}}),[E.errors,E.touched,E.values]),X=Object(l.useCallback)((function(e){var t=Zr(e),n=t?e.name:e,r=ni(E.values,n),i={name:n,value:r,onChange:V,onBlur:z};if(t){var o=e.type,a=e.value,c=e.as,s=e.multiple;"checkbox"===o?void 0===a?i.checked=!!r:(i.checked=!(!Array.isArray(r)||!~r.indexOf(a)),i.value=a):"radio"===o?(i.checked=r===a,i.value=a):"select"===c&&s&&(i.value=i.value||[],i.multiple=!0)}return i}),[z,V,E.values]),ee=Object(l.useMemo)((function(){return!Ee()(m.current,E.values)}),[E.values]),te=Object(l.useMemo)((function(){return void 0!==c?ee?E.errors&&0===Object.keys(E.errors).length:!1!==c&&Gr(c)?c(d):c:E.errors&&0===Object.keys(E.errors).length}),[c,ee,E.errors,d]);return $r({},E,{initialValues:m.current,initialErrors:h.current,initialTouched:y.current,initialStatus:v.current,handleBlur:z,handleChange:V,handleReset:Z,handleSubmit:G,resetForm:L,setErrors:R,setFormikState:q,setFieldTouched:B,setFieldValue:U,setFieldError:M,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,submitForm:Y,validateForm:I,validateField:_,isValid:te,dirty:ee,unregisterField:x,registerField:P,getFieldProps:X,getFieldMeta:Q,validateOnBlur:i,validateOnChange:n,validateOnMount:a})}function di(e){var t=pi(e),n=e.component,r=e.children,i=e.render;return Object(l.useEffect)((function(){0}),[]),Object(l.createElement)(ai,{value:t},n?Object(l.createElement)(n,t):i?i(t):r?Gr(r)?r(t):ei(r)?null:l.Children.only(r):null)}function mi(e,t,n){var r=e.slice();return t.forEach((function(t,i){if(void 0===r[i]){var o=!1!==n.clone&&n.isMergeableObject(t);r[i]=o?Te(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[i]=Te(e[i],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var hi="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;function yi(e){var t=Object(l.useRef)(e);return hi((function(){t.current=e})),Object(l.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current.apply(void 0,n)}),[])}function vi(e){var t=e.validate,n=e.name,r=e.render,i=e.children,o=e.as,a=e.component,c=Wr(e,["validate","name","render","children","as","component"]),s=si(),u=(s.validate,s.validationSchema,Wr(s,["validate","validationSchema"]));Object(l.useEffect)((function(){0}),[]);var f=u.registerField,p=u.unregisterField;Object(l.useEffect)((function(){return f(n,{validate:t}),function(){p(n)}}),[f,p,n,t]);var d=u.getFieldProps($r({name:n},c)),m=u.getFieldMeta(n),h={field:d,form:u};if(r)return r($r({},h,{meta:m}));if(Gr(i))return i($r({},h,{meta:m}));if(a){if("string"==typeof a){var y=c.innerRef,v=Wr(c,["innerRef"]);return Object(l.createElement)(a,$r({ref:y},d,v),i)}return Object(l.createElement)(a,$r({field:d,form:u},c),i)}var b=o||"input";if("string"==typeof b){var g=c.innerRef,S=Wr(c,["innerRef"]);return Object(l.createElement)(b,$r({ref:g},d,S),i)}return Object(l.createElement)(b,$r({},d,c),i)}var bi=Object(l.forwardRef)((function(e,t){var n=e.action,r=Wr(e,["action"]),i=n||"#",o=si(),a=o.handleReset,c=o.handleSubmit;return Object(l.createElement)("form",Object.assign({onSubmit:c,ref:t,onReset:a,action:i},r))}));function gi(e){var t=function(t){return Object(l.createElement)(ci,null,(function(n){return n||Br(!1),Object(l.createElement)(e,Object.assign({},t,{formik:n}))}))},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t.WrappedComponent=e,t.displayName="FormikConnect("+n+")",qr()(t,e)}bi.displayName="Form";var Si=function(e,t,n){var r=Ei(e);return r.splice(t,0,n),r},Ei=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,t){return t>e?t:e}),0);return Array.from($r({},e,{length:t+1}))}return[]},Oi=function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var i=n.props,o=i.name,a=i.validateOnChange,c=i.formik,s=c.setFormikState,u=c.validateForm;s((function(n){var i="function"==typeof r?r:e,a="function"==typeof t?t:e;return $r({},n,{values:ri(n.values,o,e(ni(n.values,o))),errors:r?ri(n.errors,o,i(ni(n.errors,o))):n.errors,touched:t?ri(n.touched,o,a(ni(n.touched,o))):n.touched})}),(function(){a&&u()}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(Ei(t),[Jr(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Ei(e),i=r[t];return r[t]=r[n],r[n]=i,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Ei(e),i=r[t];return r.splice(t,1),r.splice(n,0,i),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return Si(n,e,t)}),(function(t){return Si(t,e,null)}),(function(t){return Si(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Ei(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(Yr(n)),n.pop=n.pop.bind(Yr(n)),n}Kr(t,e);var n=t.prototype;return n.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?Ei(n):[];return t||(t=r[e]),Gr(r.splice)&&r.splice(e,1),r}),!0,!0),t},n.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},n.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,i=t.children,o=t.name,a=t.formik,c=(a.validate,a.validationSchema,$r({},e,{form:Wr(a,["validate","validationSchema"]),name:o}));return n?Object(l.createElement)(n,c):r?r(c):i?"function"==typeof i?i(c):ei(i)?null:l.Children.only(i):null},t}(l.Component);Oi.defaultProps={validateOnChange:!0};var Ci=gi(function(e){function t(){return e.apply(this,arguments)||this}Kr(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return ni(this.props.formik.errors,this.props.name)!==ni(e.formik.errors,this.props.name)||ni(this.props.formik.touched,this.props.name)!==ni(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,t=e.component,n=e.formik,r=e.render,i=e.children,o=e.name,a=Wr(e,["component","formik","render","children","name"]),c=ni(n.touched,o),s=ni(n.errors,o);return c&&s?r?Gr(r)?r(s):null:i?Gr(i)?i(s):null:t?Object(l.createElement)(t,a,s):s:null},t}(l.Component));(function(e){function t(t){var n;n=e.call(this,t)||this;var r=t.render,i=t.children,o=t.component,a=t.as;t.name;return r&&Br(!1),o&&r&&Br(!1),a&&i&&Gr(i)&&Br(!1),o&&i&&Gr(i)&&Br(!1),r&&i&&!ei(i)&&Br(!1),n}Kr(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e,t,n){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):ni(this.context.values,this.props.name)!==ni(n.values,this.props.name)||ni(this.context.errors,this.props.name)!==ni(n.errors,this.props.name)||ni(this.context.touched,this.props.name)!==ni(n.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||this.context.isSubmitting!==n.isSubmitting},n.componentDidMount=function(){this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentDidUpdate=function(e){this.props.name!==e.name&&(this.context.unregisterField(e.name),this.context.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==e.validate&&this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentWillUnmount=function(){this.context.unregisterField(this.props.name)},n.render=function(){var e=this.props,t=(e.validate,e.name),n=e.render,r=e.as,i=e.children,o=e.component,a=(e.shouldUpdate,Wr(e,["validate","name","render","as","children","component","shouldUpdate"])),c=this.context,s=(c.validate,c.validationSchema,Wr(c,["validate","validationSchema"])),u={value:"radio"===a.type||"checkbox"===a.type?a.value:ni(c.values,t),name:t,onChange:c.handleChange,onBlur:c.handleBlur},f={field:u,meta:{value:ni(c.values,t),error:ni(c.errors,t),touched:!!ni(c.touched,t),initialValue:ni(c.initialValues,t),initialTouched:!!ni(c.initialTouched,t),initialError:ni(c.initialErrors,t)},form:s};if(n)return n(f);if(Gr(i))return i(f);if(o){if("string"==typeof o){var p=a.innerRef,d=Wr(a,["innerRef"]);return Object(l.createElement)(o,$r({ref:p},u,d),i)}return Object(l.createElement)(o,$r({field:u,form:c},a),i)}var m=r||"input";if("string"==typeof m){var h=a.innerRef,y=Wr(a,["innerRef"]);return Object(l.createElement)(m,$r({ref:h},u,y),i)}return Object(l.createElement)(m,$r({},u,a),i)},t}(l.Component)).contextType=oi;var wi=n(7),Ai=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function ji(e){var t=e.castInitialValues,n=e.castValuesOnSubmit,r=e.initialValues,i=e.onSubmit,o=Ai(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit"]),a=t&&e.validationSchema?e.validationSchema.cast(function e(t){var n=wi.a.deepClone(t);return Object.keys(n).forEach((function(t){n.hasOwnProperty(t)&&(wi.a.isObject(n[t])?n[t]=e(n[t]):null===n[t]&&delete n[t])})),n}(r)):r,c={allowInitialSubmit:e.allowInitialSubmit};return l.createElement(di,Object.assign({enableReinitialize:!0},o,{initialValues:a,onSubmit:function(t,r){var o=r.setSubmitting,a=r.resetForm,c=n&&e.validationSchema?e.validationSchema.cast(t):t;i(c,(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.reset&&a(),o(!1)}))},initialStatus:c}),h(e.children)?function(t){return e.children(t)}:l.Children.count(e.children)?e.children:null)}ji.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0};var Ti=n(2),ki=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),Ii=n(3),Li=function(e,t,n,r,i){var o="form-control";return"sm"===r&&(o+=" form-control-sm"),"lg"===r&&(o+=" form-control-lg"),ni(t,n)&&ni(e,n)&&(o+=" is-invalid"),i&&(o+=" ".concat(i)),o},_i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Pi(e){var t=e.label,n=e.checkboxLabelClassName,r=_i(e,["label","checkboxLabelClassName"]);return l.createElement(Ii.Form.Group,null,l.createElement("div",{className:"custom-control custom-checkbox"},l.createElement(os,Object.assign({className:"custom-control-input"},r)),l.createElement(Ii.Form.Label,{className:"custom-control-label cursor-pointer ".concat(n),htmlFor:r.id},t)))}var xi,Ni,Ri=n(37),Di=n(85),Mi=n.n(Di),Ui=n(86),Fi=n.n(Ui),Vi=n(87),Bi=n.n(Vi),Hi=n(88),zi=n.n(Hi),qi=(n(89),n(90)),Ji=n.n(qi),$i=n(91),Ki=n.n($i),Wi=n(92),Yi=n.n(Wi),Gi=n(93),Zi=n.n(Gi),Qi=n(94),Xi=n.n(Qi),eo=n(95),to=n.n(eo),no=n(96),ro=n.n(no),io=n(97),oo=n.n(io),ao=n(98),co=n.n(ao),so=n(99),uo=n.n(so),lo=n(100),fo=n.n(lo),po=n(101),mo=n.n(po),ho=n(102),yo=n.n(ho),vo=n(103),bo=n.n(vo),go=n(104),So=n.n(go),Eo=n(105),Oo=n.n(Eo),Co=n(106),wo=n.n(Co),Ao=n(107),jo=n.n(Ao),To=n(108),ko=n.n(To),Io=n(109),Lo=n.n(Io),_o=n(110),Po=n.n(_o),xo=n(111),No=n.n(xo),Ro=n(112),Do=n.n(Ro),Mo=n(113),Uo=n.n(Mo),Fo=n(114),Vo=n.n(Fo),Bo=n(115),Ho=n.n(Bo),zo=n(116),qo=n.n(zo),Jo=n(117),$o=n.n(Jo),Ko=n(118),Wo=n.n(Ko),Yo=n(119),Go=n.n(Yo),Zo=n(120),Qo=n.n(Zo),Xo=n(121),ea=n.n(Xo),ta=(n(122),n(123),n(124)),na=n.n(ta),ra=n(125),ia=n.n(ra),oa=n(126),aa=n.n(oa),ca=n(127),sa=n.n(ca),ua=n(128),la=n.n(ua),fa=n(129),pa=n.n(fa),da=n(130),ma=n.n(da),ha=n(131),ya=n.n(ha),va=n(132),ba=n.n(va),ga=(n(133),n(134)),Sa=n.n(ga),Ea=n(135),Oa=n.n(Ea),Ca=n(136),wa=n.n(Ca),Aa=n(137),ja=n.n(Aa),Ta=n(138),ka=n.n(Ta),Ia=n(139),La=n.n(Ia),_a=n(140),Pa=n.n(_a),xa=(n(141),n(142)),Na=n.n(xa),Ra=n(143),Da=n.n(Ra),Ma=n(144),Ua=n.n(Ma),Fa=n(145),Va=n.n(Fa),Ba=n(146),Ha=n.n(Ba),za=n(147),qa=n.n(za),Ja=n(148),$a=n.n(Ja),Ka=n(149),Wa=n.n(Ka),Ya=n(150),Ga=n.n(Ya),Za=n(151),Qa=n.n(Za),Xa=n(152),ec=n.n(Xa),tc=n(153),nc=n.n(tc),rc=n(154),ic=n.n(rc),oc=n(155),ac=n.n(oc),cc=n(156),sc=n.n(cc),uc=n(157),lc=n.n(uc),fc=n(158),pc=n.n(fc),dc=n(159),mc=n.n(dc),hc=n(160),yc=n.n(hc),vc=n(161),bc=n.n(vc),gc=n(162),Sc=n.n(gc),Ec=n(163),Oc=n.n(Ec),Cc=n(164),wc=n.n(Cc),Ac=n(165),jc=n.n(Ac),Tc=n(166),kc=n.n(Tc),Ic=n(167),Lc=n.n(Ic),_c=n(168),Pc=n.n(_c),xc=n(169),Nc=n.n(xc),Rc=n(170),Dc=n.n(Rc),Mc=n(171),Uc=n.n(Mc),Fc=n(172),Vc=n.n(Fc),Bc=n(173),Hc=n.n(Bc),zc=(n(174),n(175),n(176),n(177)),qc=n.n(zc),Jc=n(178),$c=n.n(Jc),Kc=[Mi.a,Bi.a,zi.a,Ki.a,Xi.a,to.a,ro.a,oo.a,Zi.a,Ji.a,Fi.a,co.a,uo.a,fo.a,mo.a,yo.a,Yi.a,bo.a,So.a,Oo.a,wo.a,jo.a,ko.a,Lo.a,Po.a,Do.a,$o.a,Wo.a,Uo.a,Vo.a,Ho.a,qo.a,Go.a,No.a,la.a,lc.a,mc.a,pc.a,Oc.a,yc.a,bc.a,Sc.a,ja.a,La.a,ka.a,Qo.a,ea.a,Oa.a,wa.a,Sa.a,na.a,pa.a,Da.a,Ua.a,ma.a,ya.a,ba.a,Va.a,ia.a,Na.a,Ha.a,qa.a,ic.a,Pa.a,$a.a,Ga.a,Wa.a,wc.a,jc.a,Qa.a,ec.a,aa.a,sa.a,nc.a,ac.a,sc.a,Pc.a,Lc.a,kc.a,Nc.a,Uc.a,Dc.a,Vc.a,Hc.a,$c.a,qc.a];function Wc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e.AddToPlaylists="add-to-playlist",e.Caret="caret",e.Delete="delete",e.Edit="edit",e.NoEdit="no-edit",e.Close="close",e.Folder="folder",e.Resources="resources",e.More="more",e.Bell="bell",e.Plus="plus",e.Minus="minus",e.Search="search",e.Share="share",e.Share2="share2",e.Upload="upload",e.Preview="preview",e.CircleCheck="circle-check",e.Down="down",e.Right="right",e.UpDown="up-down",e.ChevronUp="chevron-up",e.ChevronDown="chevron-down",e.ChevronLeft="chevron-left",e.ChevronRight="chevron-right",e.VisibleOff="visible-off",e.VisibleOn="visible-on",e.PublisherArchive="publisher-archive",e.ArrowLeft="arrow-left",e.ArrowRight="arrow-right",e.CheckCircleOutline="check-circle-o",e.CheckCircle="check-circle",e.Check="check",e.Lock="lock",e.Link="link",e.Info="info",e.Question="question",e.Star="star",e.StarOutline="star-o",e.Archive="archive",e.Warning="warning",e.WarningOutline="warning-o",e.NewWindow="new-window",e.File="file",e.FilePDF="file-pdf",e.FileExcel="file-excel",e.FilePowerpoint="file-ppt",e.FileWord="file-word",e.FileImg="file-img",e.FileZip="file-zip",e.Enter="enter",e.Calendar="calendar",e.CloseCaptionBadge="close-caption-badge",e.Playlist="playlist",e.Image="image",e.Handle="handle",e.Subject="subject",e.Series="series",e.EditClickView="edit-clickview",e.Heart="heart",e.HeartOutline="heart-outline",e.WhiteWave="white-wave",e.Cog="cog",e.Video="video",e.Compass="compass",e.History="history",e.Tag="tag",e.Email="email",e.YearLevel="year-level",e.Subjects="subjects",e.Download="download",e.Print="print",e.CreateInteractive="create-interactive",e.Play="play",e.PlayCircle="play-circle",e.Twitter="twitter",e.Facebook="facebook",e.Classrooms="classrooms",e.Group="group",e.Timer="timer",e.CrossCircle="cross-circle",e.CrossCircleFilled="cross-circle-filled",e.Hamburger="hamburger",e.Library="library",e.InteractiveResults="interactive-results",e.House="house",e.MonitorPlay="monitor-play"}(xi||(xi={}));var Yc;function Gc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}d.extend(Ri.config,{autoReplaceSvg:!1,autoAddCss:!1,familyPrefix:"cv",autoA11y:!0,observeMutations:!1,replacementClass:"cv-svg",keepOriginalSource:!1}),(Ni=Ri.library).add.apply(Ni,function(e){if(Array.isArray(e))return Wc(e)}(Yc=Kc)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(Yc)||function(e,t){if(e){if("string"==typeof e)return Wc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wc(e,t):void 0}}(Yc)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var Zc=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"getSvg",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.faIconLookup(e,t),r=this.getIcon(n,t);if(r&&(!r||r.html.length))return r.html.pop()}},{key:"getIcon",value:function(e,t){return Ri.icon(e,t.iconOptions||{})}},{key:"faIconLookup",value:function(e,t){var n=t.prefix,r=void 0===n?"cv":n;return Ri.findIconDefinition({prefix:r,iconName:e})}}])&&Gc(t.prototype,n),r&&Gc(t,r),e}().Instance,Qc=xi,Xc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return Math.floor(Math.random()*Math.floor(e))};function es(e){var t,n=e.title,r=e.placement,i=e.trigger,o=e.spanHack,a=e.children;return o?l.createElement(Ii.OverlayTrigger,{placement:r,overlay:l.createElement(Ii.Tooltip,{id:"".concat(n,"-").concat(Xc())},n),trigger:i},l.createElement("span",{className:"d-flex justify-content-center align-items-center ".concat(null!==(t=e.spanHackClassName)&&void 0!==t?t:"")},a)):l.createElement(Ii.OverlayTrigger,{placement:r,overlay:l.createElement(Ii.Tooltip,{id:"".concat(n,"-").concat(Xc())},n),trigger:i},l.createElement(l.Fragment,null,a))}es.defaultProps={trigger:["hover","click","focus"],placement:"top"};var ts;function ns(e){var t=e.svgName,n=e.className,r=void 0===n?"d-inline-block svg-container":n,i=e.tagName,o=void 0===i?"span":i,a=e.size,c=void 0===a?ts.Standard:a,s=e.onClick,u=e.title,f=e.tooltipPlacement,p=void 0===f?"right":f,d=e.tooltipSpanHack,m=void 0!==d&&d,y=o,v={dangerouslySetInnerHTML:{__html:Zc.getSvg(t)},className:"".concat(r," ").concat(c),onClick:h(s)?s:null};return u?l.createElement(es,{title:u,placement:p,spanHack:m},l.createElement(y,Object.assign({},v))):l.createElement(y,Object.assign({},v))}function rs(e){var t=si().values[e.fieldName];return"string"!=typeof t?l.createElement(l.Fragment,null):l.createElement("div",{className:"float-right text-muted"},t.length,"/",e.limit)}!function(e){e.Standard="std",e.Small="sm",e.Medium="md",e.Large="lg",e.ExtraLarge="xlg",e.XXL="xxlg"}(ts||(ts={}));var is=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function os(e){var t=e.children,n=is(e,["children"]);return l.createElement(vi,Object.assign({},wi.a.omit(n,["formSize"])),h(t)?function(e){return t(e)}:l.Children.count(t)?t:null)}function as(e){var t=e.label,n=e.className,r=e.showCharacterCounter,i=e.showRequiredStar,o=e.infoTooltip,a=e.formSize,c=is(e,["label","className","showCharacterCounter","showRequiredStar","infoTooltip","formSize"]),s=si(),u=s.errors,f=s.touched,p=function(){};if("checkbox"===c.type){var d=wi.a.omit(e,["formSize"]);return e.disabled&&(d.onChange=p),l.createElement(Pi,Object.assign({},d))}var m=Object.assign(Object.assign({},c),{className:Li(u,f,c.name,a,n)});return e.disabled&&(m.onChange=p),l.createElement(Ii.Form.Group,null,!!t&&l.createElement(Ii.Form.Label,{htmlFor:c.id,className:"d-flex align-items-center"},t,i&&l.createElement("span",{className:"text-danger"},"*"),o&&l.createElement(ns,{svgName:Qc.Info,title:o,tooltipPlacement:"top",tooltipSpanHack:!0})),l.createElement(os,Object.assign({},m)),!!r&&!!c.maxLength&&l.createElement(rs,{fieldName:c.name,limit:c.maxLength}),l.createElement(Ci,{name:c.name},(function(e){return l.createElement(Ii.Form.Control.Feedback,{type:"invalid"},e)})))}function cs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ss(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ss(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function us(e){var t,n=cs(l.useState(!1),2),r=n[0],i=n[1];return l.useEffect((function(){var t;e.isValid&&(e.dirty||(null===(t=e.initialStatus)||void 0===t?void 0:t.allowInitialSubmit))?i(!0):i(!1)}),[e.isValid,null===(t=e.initialStatus)||void 0===t?void 0:t.allowInitialSubmit,e.dirty,e.values]),l.useEffect((function(){e.isSubmitting&&i(!1)}),[e.isSubmitting]),r}var ls=n(209),fs=n(50),ps=n(23),ds=n(4),ms="AlertService",hs="LanguageService",ys=n(11),vs=n(36);function bs(e){return(bs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ss(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Es(e,t){return(Es=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Os(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ws(e);if(t){var i=ws(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Cs(this,n)}}function Cs(e,t){return!t||"object"!==bs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ws(e){return(ws=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function As(e){return fs.sanitize(e).replace("&","&")}var js=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Es(e,t)}(o,e);var t,n,r,i=Os(o);function o(){return gs(this,o),i.apply(this,arguments)}return t=o,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"name",get:function(){return hs}},{key:"setConfig",value:function(e){this.polyglot=new ls({locale:e.locale,phrases:e.phrases.rootElement||e.phrases}),this.cache={}}},{key:"getPhrase",value:function(e,t,n){var r="".concat(e,".").concat(t);if(this.polyglot||ds.c.throw(new ys.a("LanguageService config must be set.")),!this.polyglot.has(r)){if(!vs.a.isDevelopment){var i=window.trackJs;return i&&i.console.error("No phrase set for ".concat(r," in language config")),""}ds.c.throw(new ys.a("No phrase set for ".concat(r," in language config.")))}if(!n||d.isEmpty(n)){var o=this.cache[r];if(o)return o;var a=this.polyglot.t(r);return this.cache[r]=a,a}var c=d.omit(n,"smartCount"),s={};for(var u in c){var l=c[u];"number"==typeof l&&(l=l.toString()),s[u]=As(l)}d.isNumber(n.smartCount)&&(s.smart_count=n.smartCount);var f="".concat(r,":").concat(d.values(Object.assign({},s)).join(":")),p=this.cache[f];if(p)return p;var m=this.polyglot.t(r,s);return this.cache[f]=m,m}},{key:"encloseNamespace",value:function(e){var t=this;return function(n,r){return t.getPhrase(e,n,r)}}}])&&Ss(t.prototype,n),r&&Ss(t,r),o}(ps.a).Instance,Ts=l.createContext(""),ks=l.memo((function(e){var t=e.phrase,n=e.namespace,r=e.options,i=l.useContext(Ts),o=n||i,a=js.getPhrase(o,t,r);return l.createElement("span",{dangerouslySetInnerHTML:{__html:a}})}),(function(e,t){return e.namespace===t.namespace&&e.phrase===t.phrase&&wi.a.isEqual(e.options,t.options)}));function Is(e){var t=si(),n=us(t);return l.createElement(Ii.Button,{variant:e.variant||"primary",type:"submit",disabled:!n,size:e.size,className:e.className?e.className:""},t.isSubmitting?l.createElement(Ii.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.submitText?l.createElement(l.Fragment,null,e.submitText):l.createElement(ks,{namespace:"shared.formButtons",phrase:e.isNew?"create":"save"}))}function Ls(e){var t=si();return l.createElement(bi,null,l.createElement(as,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this company",autoFocus:!0}),l.createElement(Is,{isNew:e.isNew}))}function _s(e){return l.createElement(ji,{initialValues:e.company,validationSchema:ki,onSubmit:e.saveCompany},l.createElement(Ls,{isNew:!(e.company&&e.company.id)}))}function Ps(e){var t=Object(b.useDispatch)(),n=ce.useBasicFetch(ve(e.id));return l.createElement(l.Fragment,null,!!n.data&&l.createElement(_s,{company:n.data,saveCompany:function(n,r){return ce.fetch(t,ge(e.id,n,r))}}))}function xs(){var e=Object(b.useDispatch)();return l.createElement(_s,{saveCompany:function(t,n){ce.fetch(e,be(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.PEOPLE,action:i.Companies.EDIT_COMPANY,args:[e.id]})}),n))}})}var Ns,Rs=n(210),Ds=n(211),Ms=n.n(Ds);function Us(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vs(e){return(Vs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){e.XS="(max-width: 575px)",e.SM="(min-width: 576px) and (max-width: 767px)",e.MD="(min-width: 768px) and (max-width: 991px)",e.LG="(min-width: 992px)",e.XL="(min-width: 1200px)",e.XXL="(min-width: 1440px)",e.SMDown="(max-width: 576px)",e.MDDown="(max-width: 768px)",e.LGDown="(max-width: 992px)",e.XLDown="(max-width: 1200px)"}(Ns||(Ns={}));var Bs={isNumber:function(e){return Bs.isType(e,"number")},isString:function(e){return Bs.isType(e,"string")},isType:function(e,t){return Vs(e)===t}},Hs=n(21),zs=n.n(Hs);function qs(e){return function(e){if(Array.isArray(e))return Js(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Js(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Js(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Js(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ks,Ws=[{empty:!0}];function Ys(e,t){return wi.a.isObject(e)&&e.hasOwnProperty(t)&&Bs.isString(e[t])}function Gs(e,t,n){return function(r){var i=r.value;if(i.length||n(),!(i.length<e.activationLength)){if(e.local){var o=h(e.getLocalSuggestions)?e.getLocalSuggestions(i,e.local):(c=i,s=e.local,u=e.valueKey,(l=c.trim().toLowerCase()).length?s.filter((function(e){return!(!Ys(e,u)||!Bs.isString(e[u]))&&e[u].trim().toLowerCase().includes(l)})):[]),a=!o.length&&e.getEmptyStateComponent;t((function(e){var t;return Object.assign(Object.assign({},e),($s(t={},Ks.Local,o),$s(t,Ks.Empty,a?Ws:[]),t))}))}var c,s,u,l;e.getRemoteUrl&&function(e,t,n,r){var i=h(e)&&e(t);i&&ce.ajaxRequest({resource:i,type:se.a.GET,success:n,error:function(){},headers:r})}(e.getRemoteUrl,i,(function(n){var r=h(e.formatRemoteSuggestions)?e.formatRemoteSuggestions(n):n,i=!r.length&&e.getEmptyStateComponent;t((function(e){var t;return Object.assign(Object.assign({},e),($s(t={},Ks.Remote,r),$s(t,Ks.Empty,i?Ws:[]),t))}))}),e.requestHeaders)}}}function Zs(e,t,n,r,i,o,a){var c=function(t){return e[t]||[]},s=t?c(Ks.Recent):[],u=c(Ks.Local),l=c(Ks.Remote),f=c(Ks.Empty);if(f.length&&n)return[{data:f}];var p=[];s.length&&p.push({title:r,data:s});var d=[].concat(qs(u),qs(l));return d.length?(Number.isInteger(a)&&d.length>a&&(d=d.slice(0,a)),h(o)?p.push.apply(p,qs(o(d))):p.push({title:i,data:d}),p):p}function Qs(e){return e.data}function Xs(e){return{container:"position-relative",suggestionsContainerOpen:"bg-white py-1 border rounded ".concat(zs.a.suggestionsContainerOpen),suggestionsList:"list-unstyled m-0",suggestion:"".concat(e?"":"cursor-pointer"," py-1 px-2"),suggestionHighlighted:e?"":zs.a.suggestionHighlighted,sectionContainer:"border-bottom py-1 ".concat(zs.a.sectionContainer)}}function eu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=Xs(t),r=Object.assign(n,e);return r}!function(e){e.Local="local",e.Recent="recent",e.Remote="remote",e.Empty="empty"}(Ks||(Ks={}));var tu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function nu(e,t,n,r,i){var o="form-control";return n||(o+=" ".concat(zs.a.inputWithoutHighlight)),"left"===e&&(o+=" ".concat(zs.a.inputWithLeftIcon)),("right"===e&&!t||"left"===e&&t)&&(o+=" ".concat(zs.a.inputWithRightIcon)),"right"===e&&t&&(o+=" ".concat(zs.a.inputWithTwoRightIcons)),"lg"===i&&(o+=" form-control-lg"),"sm"===i&&(o+=" form-control-sm"),r&&(o+="".concat(r)),o}function ru(e){var t="d-inline-block svg-container";return h(e)?t+" cursor-pointer":t}function iu(e){var t=e.onClickSearchIcon,n=e.searchIconPlacement,r=e.showClearInputIcon,i=e.onClickClearInput,o=e.highlightOnFocus,a=e.className,c=e.formSize,s=tu(e,["onClickSearchIcon","searchIconPlacement","showClearInputIcon","onClickClearInput","highlightOnFocus","className","formSize"]),u=function(){return l.createElement("div",{className:"d-inline-block"},l.createElement(ns,{svgName:Qc.Search,size:ts.Standard,onClick:t,className:ru(t)}))};return l.createElement("div",{className:"position-relative ".concat(zs.a.inputContainer)},"left"===n&&l.createElement("div",{className:"".concat(zs.a.iconContainer," ").concat(zs.a.leftIconContainer)},l.createElement(u,null)),l.createElement("input",Object.assign({className:nu(n,r,o,a,c)},s)),("right"===n||!!r)&&l.createElement("div",{className:"".concat(zs.a.iconContainer," ").concat(zs.a.rightIconContainer)},!!r&&l.createElement((function(){return l.createElement("div",{className:"d-inline-block text-muted ".concat(zs.a.clearButton)},l.createElement(ns,{svgName:Qc.Close,size:ts.Standard,onClick:i,className:ru(i)}))}),null),"right"===n&&l.createElement(u,null)))}function ou(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return au(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return au(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function au(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},su=h;function uu(e){return e.renderAsForm?l.createElement("form",{onSubmit:e.onSubmit},e.children):l.createElement(l.Fragment,null,e.children)}function lu(e){var t,n,r,i=(t=e.initialSuggestions,n=e.recentSearches,$s(r={},Ks.Recent,n),$s(r,Ks.Local,t),$s(r,Ks.Remote,[]),$s(r,Ks.Empty,[]),r),o=ou(l.useState(e.initialQuery||""),2),a=o[0],c=o[1],s=ou(l.useState(i),2),u=s[0],f=s[1],p=function(e){var t=Us(Object(l.useState)(window.matchMedia(e).matches),2),n=t[0],r=t[1];return Object(l.useEffect)((function(){var t=window.matchMedia(e);t.matches!==n&&r(t.matches);var i=function(){return r(t.matches)};return t.addListener(i),function(){return t.removeListener(i)}}),[e]),n}(Ns.XS);l.useEffect((function(){var t=e.initialQuery||"";a!==t&&c(t)}),[e.initialQuery]);var d=function(){f(i)},y=function(t){t.preventDefault(),su(e.onSubmit)&&e.onSubmit(a)},v=l.useMemo((function(){return e.debounceTime?m(Gs(e,f,d),e.debounceTime):Gs(e,f,d)}),[e.debounceTime]);return l.createElement(uu,{onSubmit:y,renderAsForm:!!e.renderAsForm},l.createElement(Rs,Object.assign({suggestions:Zs(u,!a,!!e.getEmptyStateComponent,e.recentSearchHeading||js.getPhrase("shared.searchBar","recentSearchHeading"),e.suggestionsHeading,e.getSections,e.suggestionLimit),onSuggestionsFetchRequested:v,onSuggestionsClearRequested:function(){e.alwaysRenderSuggestions||d()},onSuggestionSelected:function(t,n){var r=n.suggestion;r.empty||(e.clearQueryOnSelect&&c(""),e.onSuggestionSelected(r))},getSuggestionValue:function(t){return e.updateQueryOnSelection?function(e,t){return Ys(t,e)?t[e]:""}(e.valueKey,t):a},renderSuggestion:function(t){return t&&t.empty?a.length>=e.activationLength&&h(e.getEmptyStateComponent)?e.getEmptyStateComponent(a):l.createElement(l.Fragment,null):su(e.getSuggestionComponent)?e.getSuggestionComponent(t):function(e,t){return Ys(t,e)?l.createElement(l.Fragment,null,t[e]):l.createElement(l.Fragment,null)}(e.valueKey,t)},renderSuggestionsContainer:function(t){var n=t.containerProps,r=n.ref,i=cu(n,["ref"]);return e.customScrollbarProps?l.createElement(Ms.a,Object.assign({ref:r},e.customScrollbarProps,i),t.children):l.createElement("div",Object.assign({ref:r},i),t.children)},alwaysRenderSuggestions:e.alwaysRenderSuggestions,focusInputOnSuggestionClick:!p,inputProps:{placeholder:e.placeholder||js.getPhrase("shared.searchBar","placeholder"),value:a,onChange:function(t,n){var r=n.newValue;c(r),su(e.onQueryChange)&&e.onQueryChange(r)},onKeyDown:function(t){8===t.keyCode&&e.onBackspace&&!a&&e.onBackspace()},autoFocus:!!e.autoFocusInput,highlightOnFocus:e.highlightInputOnFocus,onClickSearchIcon:!!e.submitOnClickSearchIcon&&y,searchIconPlacement:e.searchIconPlacement,showClearInputIcon:!!e.showClearInputIcon&&!!a.length,onClickClearInput:function(){c(""),su(e.onClickClearInput)&&e.onClickClearInput()},formSize:e.size},renderInputComponent:iu,theme:eu(e.theme,!!u.empty.find((function(e){return e.empty}))),multiSection:!0,renderSectionTitle:function(t){return function(e,t){if(e.title)return l.createElement("div",{className:"pb-1 ".concat(null!=t?t:"")},l.createElement("strong",null,e.title))}(t,e.sectionTitleClassName)},getSectionSuggestions:Qs},e.alwaysRenderSuggestionsOnInputFocus?{shouldRenderSuggestions:function(){return!0}}:{})))}lu.defaultProps={updateQueryOnSelection:!0,valueKey:"name",activationLength:3,suggestionLimit:5,recentSearches:[],initialSuggestions:[],searchIconPlacement:"right",renderAsForm:!0};var fu,pu=n(13);function du(e){return(du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yu(e,t){return(yu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=gu(e);if(t){var i=gu(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return bu(this,n)}}function bu(e,t){return!t||"object"!==du(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function gu(e){return(gu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Analytics="AnalyticsService",e.Context="ContextService"}(fu||(fu={}));var Su,Eu=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yu(e,t)}(o,e);var t,n,r,i=vu(o);function o(){var e;return mu(this,o),(e=i.apply(this,arguments)).contextHistory=[],e}return t=o,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"name",get:function(){return fu.Context}},{key:"initialize",value:function(){this.listenTo(G.a.SHELL,p.EventNames.ROUTE,this.setContext)}},{key:"setContext",value:function(e){this.contextHistory.length>=5&&this.contextHistory.unshift(),this.contextHistory.push({pageLoad:!this.contextHistory.length,appLink:e})}},{key:"getCurrentContext",value:function(){if(this.contextHistory.length)return this.contextHistory[this.contextHistory.length-1]}},{key:"fromPageLoad",value:function(){return 1===this.contextHistory.length}}])&&hu(t.prototype,n),r&&hu(t,r),o}(p.Service)),Ou=n(5);!function(e){e.Inlet="event:inlet",e.Outlet="event:outlet"}(Su||(Su={}));var Cu="global:analytics";function wu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Au=pu.EventVersion.V1,ju=function(){function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=t,this.data=n,this.actionContext=r,this.eventVersion=i||Au}var t,n,r;return t=e,(n=[{key:"isType",value:function(e){return e===this.type}},{key:"enrich",value:function(e,t){this.validateKey(e),this[e]=t}},{key:"get",value:function(e){if(e&&this[e])return this[e]}},{key:"validateKey",value:function(e){"type"!==e&&"data"!==e||p.ErrorHelper.throw(new ys.a("".concat(e," is not a valid key"))),this[e]&&p.ErrorHelper.throw(new ys.a("Event already contains an enrichment named ".concat(e)))}}])&&wu(t.prototype,n),r&&wu(t,r),e}(),Tu=function(e,t,n,r){Ou.Radio.channel(Cu).trigger(Su.Inlet,new ju(e,t,n,r))};function ku(){var e=Eu.getCurrentContext().appLink;return d.isObject(e)||p.ErrorHelper.throw(new ys.a("Applink does not exist. Check current context.")),e.application.replace(":","-")}function Iu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.location,n=e.entity,r=e.workflowPhase,i=void 0===r?null:r,o=e.descriptor,a=void 0===o?null:o;return t||p.ErrorHelper.throw(new ys.a("location must be set.")),n||p.ErrorHelper.throw(new ys.a("entity must be set.")),{productArea:ku(),location:t,entity:n,descriptor:a,workflowPhase:i}}function Lu(){return p.LocationUtils.GetCurrentPath()+p.LocationUtils.GetCurrentQueryString()}var _u={logUserAction:function(e,t){if(function(e){return!(!d.isArray(e)||!d.every(e,(function(e){return d.isObject(e)})))||!!d.isObject(e)}(e)&&d.isObject(t)){var n=_u.buildUserActionEvent(t),r=n.userAction,i=n.action,o=n.eventVersion;Tu(r,e,i,o)}},logNavigate:function(e,t){var n=Object.assign({currentLocation:Lu(),appLink:e},t);Tu(pu.UserAction.Navigate,n)},mergeOptions:function(e,t){return d.extend({},e,t)},buildActionContext:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Iu(e)},buildUserActionEvent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.actionType,n=e.eventVersion,r=t,i=Iu(e);return{userAction:r,action:i,eventVersion:n}},buildCurrentLocation:function(){return Lu()},buildSearchEvent:function(e,t){return{data:{query:e},action:Iu({entity:pu.EntityType.Video,location:pu.LocationContext.SearchBar,descriptor:t})}},buildInstantSearchEvent:function(e,t,n){var r;n===pu.SearchQueryType.Series&&(r=pu.EntityType.Series),n===pu.SearchQueryType.Folder&&(r=pu.EntityType.Folder),n===pu.SearchQueryType.Tags&&(r=pu.EntityType.Tag),n===pu.SearchQueryType.Video&&(r=pu.EntityType.Video),n===pu.SearchQueryType.Subjects&&(r=pu.EntityType.Classification);var i={instant:{},query:e};return t.id&&(i.instant.selectedId=t.id),t.name&&(i.instant.selectedName=t.name),{data:i,action:Iu({entity:r,location:pu.LocationContext.SearchBar})}},mapInteractionType:function(e){switch(e){case pu.InteractionType.DragDrop:return pu.InteractionTypeDescriptor.DragDrop;case pu.InteractionType.FileSelect:return pu.InteractionTypeDescriptor.FileSelect;default:return}}};function Pu(e){var t=e.appLink,n=e.appLinkOptions,r=e.className,i=e.style,o=e.children,a=e.tag,c=void 0===a?"a":a;if(!t)return l.createElement("span",{className:r||""},o);var s=p.AppLinkHelper.getHref(t),u={onClick:function(r){var i;r.preventDefault(),null===(i=e.onClick)||void 0===i||i.call(e,r),e.analyticsData&&e.analyticsOptions&&_u.logUserAction(Object.assign({href:s},e.analyticsData),e.analyticsOptions),e.openInNewTab?p.LocationUtils.PageLoad(s,!0):p.AppLinkHelper.trigger(t,n)},href:s,className:r,style:i};return e.title&&(u.title=e.title),l.createElement(c,Object.assign({},u),o)}function xu(e){var t=e.backToName,n=e.appLink;return l.createElement(Pu,{appLink:n,className:"d-inline-flex align-items-center"},l.createElement(ns,{svgName:Qc.ArrowLeft,size:ts.Small}),l.createElement("span",{className:"ml-1"},"Back to ".concat(t)))}function Nu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ru(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ru(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ru(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Pu.defaultProps={appLinkOptions:{}};var Du,Mu,Uu,Fu,Vu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Bu(e){var t=e.selected,n=e.onToggle,r=Vu(e,["selected","onToggle"]),i=Nu(l.useState(t),2),o=i[0],a=i[1];l.useEffect((function(){return a(t)}),[t]);return l.createElement(Ii.Form.Check,Object.assign({type:"checkbox",id:"checkbox-".concat(Xc()),checked:o,onChange:function(){a(!o),n(!o)}},r))}!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(Du||(Du={})),function(e){e[e.Thumbnails=0]="Thumbnails",e[e.Banners=1]="Banners",e[e.Avatars=2]="Avatars",e[e.Logos=3]="Logos",e[e.Covers=4]="Covers",e[e.Posters=5]="Posters",e[e.TallPosters=6]="TallPosters",e[e.HeroBanners=7]="HeroBanners",e[e.None=99999]="None"}(Mu||(Mu={})),function(e){e[e.Crop=0]="Crop",e[e.Stretched=1]="Stretched",e[e.Cover=2]="Cover"}(Uu||(Uu={})),function(e){e[e.None=0]="None",e[e.ImageAPIv1=1]="ImageAPIv1",e[e.FileAPIv1=2]="FileAPIv1",e[e.ImageAPIv2=3]="ImageAPIv2"}(Fu||(Fu={}));var Hu,zu,qu=function(e,t){var n=d.map(t,(function(e,t){return t&&Array.isArray(e)?e.map((function(e){return"".concat(t,"=").concat(encodeURIComponent(e))})).join("&"):t&&void 0!==e?"".concat(t,"=").concat(encodeURIComponent(e)):""})),r=d.reduce(n,(function(e,t){return t?e?"".concat(e,"&").concat(t):t:e}));return r?"".concat(e,"?").concat(r):e},Ju=function(e,t){if(e){var n=e;return e.endsWith("/")||(n+="/"),t?n+=t.startsWith("/")?t.slice(1):t:n}};function $u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.Banner="banner",e.Thumbnail="thumbnail"}(zu||(zu={}));var Ku,Wu=($u(Hu={},Mu.Banners,zu.Banner),$u(Hu,Mu.Thumbnails,zu.Thumbnail),Hu),Yu=function(e){return"/v1/category-map/".concat(e)},Gu={createUrl:function(e,t){return Gu._createUrl(e,t)},createBannerUrl:function(e,t,n){return e&&e.url?Gu._createUrl(e.url,n):Gu._createCategoryMappedUrl(t,n)},createResourceImage:function(e,t,n){return Gu._createUrl(e,Object.assign({url:t},n))},Rfc3986EncodeURIComponent:function(e){return encodeURIComponent(e).replace(/[!'()*]/g,escape)},_createCategoryMappedUrl:function(e,t){var n=e.fallbackBaseUrl,r=e.fallbackCategoryName,i=e.type,o=Ju(n,"".concat(Yu(Wu[i]))),a=Object.assign({name:Gu.Rfc3986EncodeURIComponent(r)},t);return Gu._createUrl(o,a)},_createUrl:function(e,t){if(e){if(wi.a.isEmpty(t))return e;var n=$.param(t),r=-1===e.indexOf("?")?"?":"&",i=e;return i.endsWith("/")&&(i=i.slice(0,-1)),i+"".concat(r).concat(n)}},legacyCreateThumbnailUrl:function(e,t){if(!e)return"";var n;if(e&&(n=e instanceof p.Model?e.get("url"):"string"==typeof e?e:e.url)){var r=Object.assign({size:Du.Small,bgColor:"000"},t);return Gu._createUrl(n,r)}},getDisplayImageFromObject:function(e){var t,n,r,i,o;return"tallPoster"in e&&(null===(t=e.tallPoster)||void 0===t?void 0:t.url)?e.tallPoster:"cover"in e&&(null===(n=e.cover)||void 0===n?void 0:n.url)?e.cover:"thumbnail"in e&&(null===(r=e.thumbnail)||void 0===r?void 0:r.url)?e.thumbnail:"video"in e&&(null===(o=null===(i=e.video)||void 0===i?void 0:i.thumbnail)||void 0===o?void 0:o.url)?e.video.thumbnail:null}};function Zu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qu=(Zu(Ku={},Mu.Thumbnails,{width:1280,height:720}),Zu(Ku,Mu.Banners,{width:1200,height:222}),Zu(Ku,Mu.Covers,{width:512,height:512}),Zu(Ku,Mu.Posters,{width:1e3,height:1500}),Zu(Ku,Mu.TallPosters,{width:1080,height:1920}),Zu(Ku,Mu.HeroBanners,{width:1920,height:640}),Zu(Ku,Mu.None,{width:1,height:1}),Zu(Ku,Mu.Avatars,{width:256,height:256}),Ku);function Xu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return el(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return el(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function el(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var tl,nl=l.createContext(void 0),rl=function(e){var t=e.children,n=Xu(l.useState(),2),r=n[0],i=n[1],o=Xu(l.useState(!1),2),a=o[0],c=o[1],s=Xu(l.useState(),2),u=s[0],f=s[1],p={getDataUrl:function(){var e=r;return i(null),e},setDataUrl:i,imageUploaded:a,getImage:function(){var e=u;return f(null),c(!1),e},setImage:function(e){f(e),c(!0)}};return l.createElement(nl.Provider,{value:p},t)},il={onFileSelect:function(e,t,n){if(t&&t.length){var r=new FileReader;r.addEventListener("load",(function(){return il.onReaderLoad(r,e,n)})),r.readAsDataURL(t[0])}},onReaderLoad:function(e,t,n){var r=new Image;r.src=e.result;var i=Qu[t].width,o=Qu[t].height;r.addEventListener("load",(function(){il.isImageValid(t,r)&&h(n)?n(r):alert("Image too small: minimum dimensions are ".concat(i," x ").concat(o))}))},isImageValid:function(e,t){var n=Qu[e].width,r=Qu[e].height;return!(n&&t.width<n)&&!(r&&t.height<r)},mapImageTypeToString:function(e){switch(e){case Mu.Avatars:return"avatars";case Mu.Thumbnails:return"thumbnails";case Mu.Logos:return"logos";case Mu.Covers:return"covers";case Mu.Posters:return"posters";case Mu.TallPosters:return"tallposters";case Mu.HeroBanners:return"herobanners";case Mu.None:default:return""}}},ol=["pdf"],al=["doc","docx","dotx","dot","rtf","docm","odt"],cl=["csv","txt"],sl=["xls","xlt","xlsx"],ul=["jpg","tif","png","bmp","gif","jpeg"],ll=["zip","rar"],fl=["ppt","pot","pps","pptx"],pl=["srt"],dl={IMAGES:".".concat(ul.join(",.")),RESOURCES:".".concat([].concat(al,sl,fl,ol,cl,ul,ll).join(",.")),SUBTITLES:".".concat(pl.join(",."))},ml=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function hl(e){var t=e.onFileSelect,n=e.acceptMultiple,r=e.mimeType,i=e.label,o=e.error,a=e.touched,c=ml(e,["onFileSelect","acceptMultiple","mimeType","label","error","touched"]),s="custom-file-input cursor-pointer";o&&a&&(s+=" is-invalid");var u=Object.assign({type:"file",className:s,onChange:function(e){var n=e.currentTarget.files;n&&n.length&&h(t)&&t(n)},autoComplete:"off",value:"",multiple:!!n},r?{accept:r}:{});return l.createElement("div",{className:"form-group"},l.createElement("div",{className:"custom-file"},l.createElement(vi,Object.assign({},u,c),e.children),l.createElement(Ii.Form.Label,{className:"custom-file-label",htmlFor:c.id},i)))}function yl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vl(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gl=(bl(tl={},Mu.Thumbnails,"Thumbnail"),bl(tl,Mu.Banners,"Banner"),bl(tl,Mu.Avatars,"Avatar"),bl(tl,Mu.Logos,"Logo"),bl(tl,Mu.Covers,"Cover"),bl(tl,Mu.Posters,"Poster"),bl(tl,Mu.TallPosters,"Tall Poster"),bl(tl,Mu.HeroBanners,"Hero Banner"),bl(tl,Mu.None,"Image"),tl);function Sl(e){var t=si(),n=ni(null==t?void 0:t.values,e.fieldName),r=l.useContext(nl),i=r.setDataUrl,o=r.getImage,a=r.imageUploaded,c=yl(l.useState(!1),2),s=c[0],u=c[1],f=yl(l.useState(n),2),d=f[0],m=f[1],y=yl(l.useState(!1),2),v=y[0],b=y[1];function g(t){u(!0),i(t.src),p.AppLinkHelper.trigger({application:e.application,action:e.uploadAction,args:[e.imageType]})}l.useEffect((function(){if(s){var n,r=o();if(r)u(!1),m(r),n=r,h(e.setSelectedImage)?e.setSelectedImage(n):t&&t.setFieldValue(e.fieldName,{fileId:n.id,fileIdType:Fu.ImageAPIv2})}}),[a]);var S=e.label||gl[e.imageType]||"Image";return l.createElement("div",{className:"form-group"},l.createElement("div",{className:"form-control h-auto py-2"},l.createElement("label",null,S),l.createElement("em",{className:"ml-1 text-muted"},"(Minimum dimensions are ".concat(Qu[e.imageType].width,"px")+" x ".concat(Qu[e.imageType].height,"px)")),l.createElement(hl,{label:"Choose a ".concat(S.toLowerCase()),name:"image",mimeType:dl.IMAGES,onFileSelect:function(t){return il.onFileSelect(e.imageType,t,g)}}),!!d&&!!d.url&&l.createElement(l.Fragment,null,!v&&l.createElement("div",{className:"pb-2 ".concat(e.imageType===Mu.Banners?"w-100":"w-50")},l.createElement("img",{src:Gu.createUrl(d.url),className:"img img-fluid"})),l.createElement("div",{className:"d-flex justify-content-center"},l.createElement(ns,{svgName:v?Qc.ChevronDown:Qc.ChevronUp,size:ts.Large,className:"svg-container cursor-pointer",onClick:function(){return b(!v)},title:v?"Show image":"Hide image",tooltipPlacement:"top"})))))}var El=function(){Ou.Radio.channel(G.a.SHELL).trigger("prevent:scroll:top")};function Ol(e,t){return t?{application:e.application,action:e.action,args:e.args,params:Object.assign({},e.params,{cursor:t})}:null}function Cl(e){var t=e.appLink,n=e.cursors,r=e.className,i=e.buttonVariant;function o(e){El(),_u.logUserAction({page:e},{location:pu.LocationContext.Pagination,entity:pu.EntityType.Pagination,actionType:pu.UserAction.Navigate})}return l.createElement(Ts.Provider,{value:"shared.pagination"},l.createElement("div",{className:r},l.createElement(Pu,{appLink:Ol(t,n.previous),className:"btn btn-".concat(i," mr-1 ").concat(n.previous?"":"disabled"),onClick:function(){return o("previous")}},l.createElement(ks,{phrase:"previous"})),l.createElement(Pu,{appLink:Ol(t,n.next),className:"btn btn-".concat(i," ").concat(n.next?"":"disabled"),onClick:function(){return o("next")}},l.createElement(ks,{phrase:"next"}))))}function wl(e){return l.createElement("tr",null,e.columns.map((function(t,n){var r=function(){return l.createElement(l.Fragment,null,h(t.accessor)?t.accessor(e.object):e.object[t.accessor])},i=h(t.appLink)?t.appLink(e.object):t.appLink;return l.createElement("td",{key:n},i?l.createElement(Pu,{appLink:i},l.createElement(r,null)):l.createElement(r,null))})),!!e.addNewObjectColumn&&l.createElement("td",null))}function Al(e){return l.createElement(Ii.Table,{responsive:!0},l.createElement("thead",null,l.createElement("tr",null,e.columns.map((function(e,t){return l.createElement("th",{key:t},e.header)})),!!e.newObjectAppLink&&l.createElement("th",null,l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(Pu,{appLink:e.newObjectAppLink},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New ".concat(e.objectName))))))),l.createElement("tbody",null,e.objects.map((function(t){return l.createElement(wl,{key:t.id,object:t,columns:e.columns,addNewObjectColumn:!!e.newObjectAppLink})}))))}function jl(e){if(!e.collection)return l.createElement(l.Fragment,null);var t=e.collection,n=t.data,r=t.pagination;return l.createElement(l.Fragment,null,!!n&&l.createElement(Al,{objects:n,columns:e.columns,newObjectAppLink:e.newObjectAppLink,objectName:e.objectName}),!!r&&!!r.cursors&&l.createElement(Cl,{cursors:r.cursors,appLink:e.collectionAppLink}))}Cl.defaultProps={className:"py-2",buttonVariant:"secondary"};var Tl=n(42),kl=n.n(Tl);function Il(e){var t="".concat(e.className," ").concat(kl.a.iconButton);e.children?t+=" ".concat(kl.a.iconWithText):t+=" ".concat(kl.a.iconOnly);var n=l.createElement(ns,{svgName:e.svgName,className:"svg-container ".concat(kl.a.svg),size:e.svgSize});return e.appLink?l.createElement(Pu,{appLink:e.appLink,className:t,onClick:e.onClick,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab},n,e.children):l.createElement("button",{className:t,onClick:function(t){e.analyticsData&&e.analyticsOptions&&_u.logUserAction(e.analyticsData,e.analyticsOptions),h(e.onClick)&&e.onClick(t)}},n,e.children)}var Ll=n(212),_l=n.n(Ll);function Pl(e){var t="dropdown-item";return e&&(t+=" ".concat(e)),t}function xl(e){var t=h(e.action.label)?e.action.label:function(){return e.action.label};if(e.action.appLink)return l.createElement(Pu,{appLink:e.action.appLink,onClick:e.action.onClick,className:Pl(e.action.className),analyticsData:e.action.analyticsData,analyticsOptions:e.action.analyticsOptions,openInNewTab:e.action.openInNewTab},t());function n(){e.action.analyticsData&&e.action.analyticsOptions&&_u.logUserAction(e.action.analyticsData,e.action.analyticsOptions),h(e.action.onClick)&&e.action.onClick()}return l.createElement("span",{className:"cursor-pointer ".concat(Pl(e.action.className)),onClick:n,role:"button",tabIndex:0,onKeyDown:function(e){return"Enter"===e.key&&n()}},t())}function Nl(e){if(!e.actions||!e.actions.length)return l.createElement(l.Fragment,null);var t="dropdown";e.className&&(t+=" ".concat(e.className));var n="actions-dropdown-".concat(Xc()),r="dropdown-toggle px-0 ".concat(_l.a.dropdownToggle);return e.dropdownToggleClassName&&(r+=" ".concat(e.dropdownToggleClassName)),l.createElement("div",{className:t},l.createElement("button",{className:r,type:"button",id:n,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},l.createElement(ns,{svgName:Qc.More,size:ts.Small})),l.createElement("div",{className:"dropdown-menu dropdown-menu-right","aria-labelledby":n},e.actions.map((function(e,t){return e.tooltip?l.createElement(es,{key:t,title:e.tooltip,spanHack:!0},l.createElement(xl,{action:e})):l.createElement(xl,{key:t,action:e})}))))}function Rl(e){var t=e.showSpinner?l.createElement(Ii.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.children;if(e.tooltip)return l.createElement(es,{title:e.tooltip},l.createElement("span",null,l.createElement(Il,{appLink:e.appLink,svgName:e.svgName,svgSize:e.svgSize,onClick:e.onClick,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab},t)));if(e.svgName)return l.createElement(Il,{onClick:e.onClick,appLink:e.appLink,svgName:e.svgName,svgSize:e.svgSize,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab},t);if(e.appLink)return l.createElement(Pu,{onClick:e.onClick,appLink:e.appLink,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab},t);return l.createElement("button",{onClick:function(t){e.analyticsData&&e.analyticsOptions&&_u.logUserAction(e.analyticsData,e.analyticsOptions),h(e.onClick)&&e.onClick(t)},className:e.className},t)}function Dl(e){var t=l.useMemo((function(){return e.actions.sort((function(e,t){return e.order-t.order}))}),[e.actions]),n=[],r=[];t.forEach((function(e){e.button?n.push(e):r.push(e)}));var i="d-flex";return e.className&&(i+=" ".concat(e.className)),n.length||r.length?l.createElement("div",{className:i},l.createElement(l.Fragment,null,l.createElement("span",{className:"d-flex align-items-center"},n.length?n.map((function(e,t){return l.createElement(l.Fragment,{key:t},function(){if(e.label){var t=h(e.label)?e.label:function(){return e.label};return l.createElement(Rl,{appLink:e.appLink,onClick:e.onClick,svgName:e.svgName,className:e.className,tooltip:e.tooltip,showSpinner:e.showSpinner,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab},t())}var n=l.createElement(Il,{appLink:e.appLink,onClick:e.onClick,svgName:e.svgName,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab});return e.tooltip?l.createElement(es,{title:e.tooltip,spanHack:!0},n):n}())})):l.createElement(l.Fragment,null),e.sortComponent&&e.sortComponent,r.length?l.createElement(Nl,{actions:r,dropdownToggleClassName:e.actionsDropdownClassName}):l.createElement(l.Fragment,null)))):l.createElement(l.Fragment,null)}function Ml(e){var t=e.object,n=e.actions;return l.createElement("div",{className:"d-flex justify-content-between py-2"},!!t&&l.createElement("h5",null,t.name),!!n&&l.createElement("span",null,l.createElement(Dl,{actions:n})))}function Ul(e){var t=e.objects,n=e.getAppLink,r=e.emptyMessage;return t?t.length?l.createElement("ul",{className:"list-unstyled"},t.map((function(e,t){return l.createElement("li",{key:t,className:"border rounded mb-3"},l.createElement(Pu,{appLink:n(e),className:"d-block p-3"},e.name))}))):l.createElement("div",{className:"py-3"},l.createElement("p",null,r)):l.createElement(l.Fragment,null)}Nl.defaultProps={dropdownToggleClassName:"btn btn-light"},Ul.defaultProps={emptyMessage:"There is nothing here."};function Fl(e){var t=si();return l.createElement(as,{as:"select",label:"Rating",name:"rating",id:"rating",value:t.values.rating&&t.values.rating.id,onChange:function(e){return t.setFieldValue("rating",e.target.value?{id:e.target.value}:{})},disabled:e.disabled},l.createElement(l.Fragment,null,l.createElement("option",{value:""},"Please select a rating"),e.ratings.map((function(e,t){return l.createElement("option",{key:t,value:e.id},function(e){return"".concat(e.name).concat(e.code?" (".concat(e.code,")"):"")}(e))}))))}var Vl={isItemActive:function(e,t){return t||(t=p.AppLinkHelper.getCurrentAppLink()),t.application===e.appLink.application&&(Array.isArray(e.activeActions)?e.activeActions.includes(t.action):t.action===e.appLink.action)}},Bl=function(e){return Object.values(e).every((function(e){return!!e}))},Hl=(n(213),function(e,t){return!!e&&!!t&&e.toString()===t.toString()}),zl=function(e){return e.split(" ").map((function(e){return(e[0]?e[0].toUpperCase():"")+(e.substr(1)?e.substr(1).toLowerCase():"")})).join(" ")};function ql(e){return function(e){if(Array.isArray(e))return Jl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Jl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $l={find:function(e,t){if(e&&e.children&&e.children.length)for(var n=function e(n){if(Hl(n.id,t))return n;var r=n.children;if(r&&r.length)for(var i=0;i<r.length;i++){var o=e(r[i]);if(o)return o}},r=0;r<e.children.length;r++){var i=n(e.children[r]);if(i)return i}},getPath:function(e,t){for(var n=[t],r=function(e){return e.hasOwnProperty("parentIds")&&Array.isArray(e.parentIds)&&e.parentIds.length?e.parentIds[0]:e.hasOwnProperty("parentId")?e.parentId:null},i=r(t);i;){var o=$l.find(e,i);o&&(n=[o].concat(ql(n))),i=o?r(o):null}return n}},Kl=function(e){return e&&e.groups?e.groups.map((function(e){return e.name})):[]};function Wl(e){var t=e.tabs,n=e.isItemActive;return l.createElement(Ii.Nav,{fill:!0,variant:"tabs"},t.map((function(e,t){return l.createElement(Ii.Nav.Item,{key:t},l.createElement(Pu,{appLink:e.appLink,className:(r=n(e),r?"nav-link active":"nav-link")},e.label));var r})))}Wl.defaultProps={isItemActive:Vl.isItemActive};var Yl=n(24),Gl=n.n(Yl);function Zl(e){var t=e.name,n=e.appLink,r=e.onSelect,i=e.isDisabled,o=e.className,a=e.actions,c=Gl.a.text;return o&&(c+=" ".concat(o)),i?l.createElement("a",{className:"".concat(c," text-muted ").concat(Gl.a.disabled)},t):l.createElement(l.Fragment,null,n?l.createElement(Pu,{appLink:n,className:c},t):l.createElement("a",{onClick:r,className:c},t),!!a&&l.createElement(Dl,{className:Gl.a.actions,actions:a}))}function Ql(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xl(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ef(e){var t=e.tree,n=e.selectedIds,r=e.getAppLink,i=e.onSelect,o=e.isDisabled,a=e.actions,c=Array.isArray(n)&&n.some((function(e){return Hl(t.id,e)})),s=l.useMemo((function(){return Array.isArray(n)&&n.some((function(e){return $l.find(t,e)}))}),[t,n]),u=Ql(l.useState(s),2),f=u[0],p=u[1],d=!!t.children&&!!t.children.length,m={name:t.name,appLink:h(r)?r(t):null,onSelect:h(i)?function(){return i(t)}:null,isDisabled:!!h(o)&&o(t),className:c&&Gl.a.selected||s&&Gl.a.parentOfSelected,actions:!!a&&a.map((function(e){return Object.assign(Object.assign({},e),{appLink:e.getAppLink(t)})}))};return l.createElement("li",{className:"position-relative".concat(f?"":" ".concat(Gl.a.collapsed))},l.createElement("div",{className:"position-relative"},l.createElement("span",{className:Gl.a.node},d&&l.createElement(ns,{svgName:Qc.ChevronDown,size:ts.Small,className:"svg-container ".concat(Gl.a.chevron),onClick:function(){return p(!f)}}),l.createElement(Zl,Object.assign({},m))),f&&l.createElement(nf,Object.assign({},e))))}var tf=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function nf(e){var t=e.tree,n=tf(e,["tree"]);return t&&t.children?l.createElement("ul",{className:"m-0 p-0 ".concat(Gl.a.tree)},t.children.map((function(e){return l.createElement(ef,Object.assign({key:e.id,tree:e},n))}))):l.createElement(l.Fragment,null)}var rf={getChord:function(e,t){return $l.getPath(e,t).map((function(e){return e.name})).join(" -> ")},getState:function(e,t){var n={};return Array.isArray(e)&&e.forEach((function(e){var r,i,o,a=$l.find(t,e);a&&(n=Object.assign((r={},i=e,o=rf.getChord(t,a),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o,r),n))})),n}};function of(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return af(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return af(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function af(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cf=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function sf(e){var t=e.onSelect,n=e.label,r=e.hideCollapseBtn,i=e.collapse,o=e.noSelectionMessage,a=e.isNodeDisabled,c=e.getSelectedItemAppLink,s=cf(e,["onSelect","label","hideCollapseBtn","collapse","noSelectionMessage","isNodeDisabled","getSelectedItemAppLink"]),u=s.tree,f=s.selectedIds,p=of(l.useState(rf.getState(f,u)),2),d=p[0],m=p[1];l.useEffect((function(){return m(rf.getState(f,u))}),[f,u]);var y=of(l.useState(!!i),2),v=y[0],b=y[1];l.useEffect((function(){return b(!!i)}),[i]);var g=!r||!!n;return l.createElement(l.Fragment,null,g&&l.createElement("div",{className:"pb-2"},!!n&&l.createElement("label",{className:"m-0"},n),!r&&l.createElement("a",{className:"float-right cursor-pointer",onClick:function(){return b(!v)}},v?"Expand":"Collapse")),!v&&l.createElement("div",{className:"py-2 border-top"},l.createElement(nf,Object.assign({onSelect:function(e){return h(t)&&t(e)},isDisabled:a},s))),(!wi.a.isEmpty(d)||!!o)&&l.createElement("div",{className:"py-2 border-top"},l.createElement("label",null,"Selected:"),l.createElement("ul",{className:"m-0"},wi.a.isEmpty(d)?l.createElement("li",null,o):Object.keys(d).map((function(e,t){return l.createElement("li",{key:t},h(c)?l.createElement(Pu,{appLink:c(e)},d[e]):d[e])})))))}var uf=n(51);function lf(e){return function(e){if(Array.isArray(e))return ff(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ff(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ff(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ff(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pf(e){var t=e.page,n=e.totalPages,r=Bs.isNumber(t)&&t>0&&t<n&&t+1,i=Bs.isNumber(t)&&t>1&&t-1,o={};if(r&&r<=n&&(o.next=r.toString()),i&&(o.previous=i.toString()),!wi.a.isEmpty(o))return o}var df={isEmpty:function(e){return e&&!(e.data&&e.data.length)},length:function(e){return e&&e.data&&e.data.length},at:function(e,t){if(e&&e.data&&e.data.length&&!(t>e.data.length))return e.data[t]},get:function(e,t){if(e&&e.data&&e.data.length)return e.data.find((function(e){return e.id&&e.id.toString()===t}))},flattenCollections:function(e){if(e&&e.length){var t=[];return e.forEach((function(e){t=[].concat(lf(t),lf(e.data))})),t}},getNextCursor:function(e){return e.pagination&&e.pagination.cursors&&e.pagination.cursors.next},convertLegacyPaginatedCollection:function(e){if(e)return{data:e.data,pagination:{cursors:pf(e.pagination),limit:e.pagination.pageSize}}}},mf=function(e){var t="bg-white";return e&&(t+=" ".concat(e)),t};function hf(e){var t=e.video,n=e.getVideoAppLink,r=e.getVideoActions,i=e.className,o=void 0===i?"":i,a=e.itemNumber,c=h(n)&&n(t);return l.createElement("tr",{className:mf(o)},!!a&&l.createElement("td",null,l.createElement("span",null,a)),l.createElement("td",null,c?l.createElement(Pu,{appLink:c},t.name):t.name),h(r)&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(Dl,{actions:r(t)}))))}var yf=Object(uf.SortableElement)((function(e){return l.createElement(hf,Object.assign({sortable:!0},e))})),vf=n(31),bf=n.n(vf),gf=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},Sf=function(e){var t=e.sortable,n=e.getVideoActions;return l.createElement("thead",null,l.createElement("tr",null,!!t&&l.createElement("th",null,"#"),l.createElement("th",null,"Name"),!!n&&l.createElement("th",null)))},Ef=l.forwardRef((function(e,t){var n=e.videos,r=e.sortable,i=gf(e,["videos","sortable"]);return l.createElement("tbody",{ref:t},!df.isEmpty(n)&&n.data.map((function(e,t){return r?l.createElement(yf,Object.assign({key:e.id,index:t,itemNumber:t+1,video:e,className:bf.a.draggableVideoItem},i)):l.createElement(hf,Object.assign({video:e},i))})))}));var Of=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},Cf=Object(uf.SortableContainer)((function(e){var t=e.forwardedRef,n=Of(e,["forwardedRef"]);return l.createElement(Ef,Object.assign({sortable:!0,ref:t},n))})),wf=function(e){return function(t){var n=t.node,r=e.current;if(r){r.classList.add(bf.a.sortingContainer);var i=r.querySelector(".".concat(bf.a.draggedVideoItem));n.childNodes.forEach((function(e,t){return i.childNodes[t].style.width="".concat(e.offsetWidth,"px")}))}}},Af=function(e,t){return function(n){var r=e.current;r&&r.classList.remove(bf.a.sortingContainer),t(n.oldIndex,n.newIndex)}};function jf(e){var t=e.onSortEnd,n=e.emptyMessage,r=Of(e,["onSortEnd","emptyMessage"]),i=l.useRef();return df.isEmpty(e.videos)?l.createElement("div",null,n):l.createElement(Ii.Table,{responsive:!0},l.createElement(Sf,Object.assign({sortable:!0},e)),l.createElement(Cf,Object.assign({forwardedRef:i,onSortStart:wf(i),onSortEnd:Af(i,t),lockAxis:"y",lockToContainerEdges:!0,distance:1,helperClass:bf.a.draggedVideoItem,helperContainer:function(){return i.current}},r)))}function Tf(e){var t=e.alias,n=e.onDelete;return l.createElement("li",{className:"list-group-item d-flex justify-content-between"},t.name,l.createElement(ns,{svgName:Qc.Delete,onClick:function(){return n(t.id)}}))}function kf(e){var t=e.aliases,n=e.onDelete;return l.createElement("ul",{className:"list-group mb-3"},t?t.map((function(e){return l.createElement(Tf,{key:e.id,alias:e,onDelete:n})})):l.createElement("span",null,"Currently there are no aliases for this object."))}function If(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Lf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}jf.defaultProps={emptyMessage:"There are no videos in this list."};var _f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Pf(e){var t=e.showSpinner,n=e.children,r=_f(e,["showSpinner","children"]),i=l.useRef(),o=If(l.useState({}),2),a=o[0],c=o[1];return l.useEffect((function(){var e=a.width,t=a.height;if(!e||!t){var n=i.current,r=n.offsetHeight,o=n.offsetWidth;r&&o&&c({width:o,height:r})}})),l.useEffect((function(){var e=a.width,t=a.height;if(e&&t){var n=i.current;n.style.width="".concat(e+1,"px"),n.style.height="".concat(t+1,"px")}}),[a]),l.createElement(Ii.Button,Object.assign({ref:i,disabled:t},r),t?l.createElement(Ii.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):n)}var xf=Object(Ti.object)().shape({name:Object(Ti.string)().trim().max(255,"Name is too long").required("Name is required").default("")});function Nf(){var e=si(),t=us(e);return l.createElement(bi,null,l.createElement(as,{label:"Create an alias",name:"name",id:"name",value:e.values.name,placeholder:"Add an alias"}),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(Pf,{showSpinner:e.isSubmitting,type:"submit",disabled:!t},"Add")))}function Rf(e){var t=e.onSave;return l.createElement(ji,{initialValues:{name:""},validationSchema:xf,onSubmit:function(e,n){t(e,(function(){return n({reset:!0})}))}},l.createElement(Nf,null))}function Df(e){var t=e.onSave,n=e.aliases,r=e.onDelete;return l.createElement("div",{className:"w-50"},l.createElement("h1",null,"Aliases"),l.createElement(kf,{aliases:n,onDelete:r}),l.createElement(Rf,{onSave:t}))}var Mf=c.COMPANIES,Uf=function(e){return{application:Mf,action:i.Companies.EDIT_COMPANY,args:[e.id]}},Ff=function(e){return p.AppLinkHelper.trigger(Uf(e))};function Vf(e){var t=ce.useBasicFetch(ye(e.cursor));return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-3 w-50"},l.createElement(lu,{placeholder:"Search for a company",onSuggestionSelected:Ff,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/companies/instant/raw","?q=").concat(e)},activationLength:2})),l.createElement(jl,{collection:t&&t.data,columns:[{accessor:"name",header:"Name",appLink:Uf}],collectionAppLink:{application:Mf,action:i.Companies.COMPANIES},newObjectAppLink:{application:Mf,action:i.Companies.NEW_COMPANY},objectName:"Company"}))}function Bf(e){return(Bf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qf(e,t,n){return t&&zf(e.prototype,t),n&&zf(e,n),e}function Jf(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$f(e,t)}function $f(e,t){return($f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Yf(e);if(t){var i=Yf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Wf(this,n)}}function Wf(e,t){return!t||"object"!==Bf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Yf(e){return(Yf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Gf=function(e){Jf(n,e);var t=Kf(n);function n(){return Hf(this,n),t.apply(this,arguments)}return qf(n,[{key:"channelName",get:function(){return c.COMPANIES}},{key:"appRoutes",get:function(){return{"manage/companies(/)":"companies","manage/companies/new(/)":"newCompany","manage/companies/:id(/)":"editCompany"}}}]),n}(p.AppRouter),Zf=function(e){Jf(n,e);var t=Kf(n);function n(){return Hf(this,n),t.apply(this,arguments)}return qf(n,[{key:"name",get:function(){return"Companies Application"}},{key:"channelName",get:function(){return c.COMPANIES}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT}}},{key:"companies",value:function(e){var t=e.cursor;this.layout.showChildView(I,l.createElement(Vf,{cursor:t}))}},{key:"newCompany",value:function(){this.layout.showChildView(I,l.createElement(xs,null))}},{key:"editCompany",value:function(e){this.layout.showChildView(I,l.createElement(Ps,{id:e}))}}],[{key:"router",get:function(){return Gf}}]),n}(p.Application);function Qf(e){return(Qf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ep(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tp(e,t){return(tp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function np(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ip(e);if(t){var i=ip(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return rp(this,n)}}function rp(e,t){return!t||"object"!==Qf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ip(e){return(ip=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var op=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tp(e,t)}(o,e);var t,n,r,i=np(o);function o(){return Xf(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"onShowAlert",value:function(e){if(this.layoutOptions.options.alertRegion){var t=e.ctor,n=e.collection,r=n?n.toJSON():[];this.layout.showChildView(this.layoutOptions.options.alertRegion,l.createElement(t,{alerts:r,removeAlert:function(e){return Ou.Radio.channel(G.a.ALERT).trigger("remove:alert",e)}}))}}}])&&ep(t.prototype,n),r&&ep(t,r),o}(n(44).a),ap=function(e,t){return e.toLowerCase()===t};function cp(e){return(cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function up(e,t){return(up=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function lp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=pp(e);if(t){var i=pp(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return fp(this,n)}}function fp(e,t){return!t||"object"!==cp(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function pp(e){return(pp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var dp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&up(e,t)}(o,e);var t,n,r,i=lp(o);function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this)).constructors={},e.destructors={},e.instances={},e.singletonInstances={},e.referenceCounts={},e}return t=o,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"name",get:function(){return"InstanceManager"}},{key:"registerDataService",value:function(e,t){var n=this;this.validateConstructor(e);var r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=function(){return new e({dataProvider:n.getInstance(t.dataProvider),cache:n.getInstance(t.cache),bootstrapData:t.bootstrapData,defaultErrorHandler:t.defaultErrorHandler,alertService:t.alertService})},this.destructors[r]=function(){n.instances[r]?n.instances[r].destroy():ds.c.throw(new ys.a("Trying to destroy a ".concat(r," instance that has already been destroyed"))),n.releaseInstance(t.dataProvider),n.releaseInstance(t.cache)},this}},{key:"registerInstance",value:function(e,t){var n=this;this.validateConstructor(e);var r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=function(){return new e(t)},this.destructors[r]=function(){return d.isFunction(n.instances[r].destroy)&&n.instances[r].destroy()},this}},{key:"registerSingleton",value:function(e){var t=e.name;return this.singletonInstances[t]=e,this}},{key:"getInstance",value:function(e,t){var n=this;return this.singletonInstances[e]?this.singletonInstances[e]:(this.constructors[e]||ds.c.throw(new ys.a("".concat(e," was not registered with ").concat(this.name))),this.referenceCounts[e]++,t&&this.listenTo(t,"destroy",(function(){return n.releaseInstance(e)})),this.instances[e]||(this.instances[e]=this.constructors[e]()),this.instances[e])}},{key:"releaseInstance",value:function(e){var t=this;if(this.instances[e])return window.setTimeout((function(){t.referenceCounts[e]--,t.referenceCounts[e]<1&&(t.destructors[e](),delete t.instances[e])}),0),this}},{key:"validateConstructor",value:function(e){var t=e.prototype.name;t||ds.c.throw(new ys.a("Classes registered with ".concat(this.name," must have a unique name property."))),this.constructors[t]&&ds.c.throw(new ys.a("A class with the name: ".concat(t," has already been registered with ").concat(this.name)))}}])&&sp(t.prototype,n),r&&sp(t,r),o}(ps.a).Instance;function mp(e){var t,n;return t=e,n=dp.getInstance(t),l.useEffect((function(){return function(){dp.releaseInstance(t)}})),n}var hp,yp,vp=n(35),bp=n(30);function gp(e){return(gp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ep(e,t){return(Ep=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Op(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wp(e);if(t){var i=wp(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Cp(this,n)}}function Cp(e,t){return!t||"object"!==gp(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function wp(e){return(wp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Success="success",e.Warning="warning",e.Fail="danger",e.Info="info"}(hp||(hp={})),function(e){e.Success="Success! 🙌",e.Warning="Whoops...",e.Fail="Oops...",e.Info="FYI"}(yp||(yp={}));var Ap=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ep(e,t)}(o,e);var t,n,r,i=Op(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,e)}return t=o,(n=[{key:"initialize",value:function(){this.alertCollection=new vp.a,this.listenTo(G.a.ALERT,"remove:alert",this.removeAlert),this.showAlerts()}},{key:"name",get:function(){return ms}},{key:"defaults",get:function(){return{maxAlerts:3}}},{key:"showAlerts",value:function(){var e=Ou.Radio.channel(G.a.ALERT),t={collection:this.alertCollection};this.options.alertViewCtor&&(t=d.extend({},t,{ctor:this.options.alertViewCtor})),e.trigger("show:alert",t)}},{key:"removeAlert",value:function(e){this.alertCollection.remove(e),this.showAlerts()}},{key:"createAlert",value:function(e){this.alertCollection.length===this.options.maxAlerts&&this.alertCollection.shift(),e.id||(e=d.extend({},e,{id:this.generateUniqueAlertId()})),this.alertCollection.push(new bp.a(e)),this.showAlerts()}},{key:"clearAllAlerts",value:function(){this.alertCollection.reset(null)}},{key:"success",value:function(e){var t=this;return"string"==typeof e?d.bind((function(){return t.createAlert(d.extend({},t.options.defaultSuccessAlert,{message:e}))}),this):e.useXHR?d.bind((function(e,n){return t.createAlert(d.extend({},t.options.defaultSuccessAlert,{message:n}))}),this):d.bind((function(){return t.createAlert(d.extend({},t.options.defaultSuccessAlert,e))}),this)}},{key:"error",value:function(e){var t=this;return"string"==typeof e?d.bind((function(){return t.createAlert(d.extend({},t.options.defaultErrorAlert,{message:e}))}),this):e.useXHR?d.bind((function(e){return t.createAlert(d.extend({},t.options.defaultErrorAlert,{message:e.message}))}),this):d.bind((function(){return t.createAlert(d.extend({},t.options.defaultErrorAlertIL_DEFAULT,e))}),this)}},{key:"generateUniqueAlertId",value:function(){return d.uniqueId("alert_")}}])&&Sp(t.prototype,n),r&&Sp(t,r),o}(ps.a);function jp(){var e=mp(ms);return{success:function(t){e.success(t)()},error:function(t){e.error(t)()},warning:function(t){e.createAlert({type:hp.Warning,heading:yp.Warning,message:t})}}}function Tp(){return l.createElement("div",{className:"text-center p-5"},l.createElement(Ii.Spinner,{as:"div",animation:"border",role:"status"}))}function kp(e){var t,n=(null===(t=e.headerButtons)||void 0===t?void 0:t.length)?e.headerButtons.map((function(e,t){return l.createElement(Rl,Object.assign({key:t},e))})):l.createElement(l.Fragment,null);return l.createElement(Ii.Modal,{show:!0,onHide:e.closePopup,onEntered:e.onEntered,size:e.size,dialogClassName:e.dialogClassName,centered:e.centered},!!e.title&&l.createElement(Ii.Modal.Header,{className:"d-flex align-items-center",closeButton:e.closeButton},l.createElement(Ii.Modal.Title,{className:"flex-grow-1 text-truncate"},e.title),n),e.showLoadingSpinner?l.createElement(Tp,null):l.createElement(Ii.Modal.Body,{className:e.bodyClassName},e.children))}kp.defaultProps={closeButton:!0,bodyClassName:"",dialogClassName:""};var Ip=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Lp(e){var t=e.buttons;return l.createElement("div",{className:"d-flex justify-content-end border-top pt-3 px-3 mx-n3 undo-changes-btn"},t.map((function(e,t){return function(e,t){var n=e.buttonText,r=e.type,i=void 0===r?"button":r,o=e.isSpinnerButton,a=e.showSpinner,c=void 0!==a&&a,s=e.className,u=Ip(e,["buttonText","type","isSpinnerButton","showSpinner","className"]),f=Object.assign({key:t,type:i,className:"ml-2".concat(s?" ".concat(s):"")},u);return o?l.createElement(Pf,Object.assign({showSpinner:c},f),n):l.createElement(Ii.Button,Object.assign({},f),n)}(e,t)})))}function _p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xp=js.encloseNamespace("shared.confirmationPopup");function Np(e){var t=_p(l.useState(!1),2),n=t[0],r=t[1],i=[{variant:e.cancelButtonVariant,onClick:e.closePopup,buttonText:e.cancelButtonText||xp("cancel")},{variant:e.confirmButtonVariant,onClick:function(){r(!0),e.onClickConfirm()},buttonText:e.confirmButtonText||xp("confirm"),isSpinnerButton:!0,showSpinner:n}];return l.createElement(kp,{title:e.title,closePopup:e.closePopup},l.createElement(l.Fragment,null,e.children,l.createElement(Lp,{buttons:i})))}Np.defaultProps={confirmButtonVariant:"primary",cancelButtonVariant:"link"};var Rp,Dp,Mp,Up="locale",Fp="phrases",Vp="currentuser",Bp=function(e,t){return{url:"/api/currentuser",key:"currentuser",normalizeOptions:{namespace:"currentuser"},bootstrapName:Vp,formatData:function(e){return e.id?e:null},success:e,error:t,expiryTime:1/0}},Hp=n(10),zp=function(e,t,n,r){return{key:"settings:".concat(e,":").concat(t),url:"/api/domain/v3/settings/".concat(e,"?type=").concat(t),normalize:!1,formatData:function(e){return Hp.a.first(e)},success:n,error:r}},qp=function(e,t,n,r){return{key:"update:settings:".concat(e,":bulk"),url:"/api/domain/v3/settings/".concat(e,"/bulk"),data:t,type:se.a.PUT,invalidationKeys:t.map((function(t){return"settings:".concat(e,":").concat(t.name)})),success:n,error:r}};function Jp(e){var t=l.useRef(null);return l.useEffect((function(){t.current&&(e.checked?t.current.indeterminate&&(t.current.indeterminate=!1):!e.indeterminate||t.current.indeterminate?!e.indeterminate&&t.current.indeterminate&&(t.current.indeterminate=!1):t.current.indeterminate=!0)}),[t.current,e.indeterminate,e.checked]),l.createElement("div",{className:"custom-control custom-checkbox ".concat(e.className)},l.createElement("input",{ref:t,type:"checkbox",className:"custom-control-input",id:e.id,name:e.name,checked:e.checked,onChange:e.onChange,disabled:e.disabled}),l.createElement("label",{className:"custom-control-label cursor-pointer",htmlFor:e.id},e.label))}function $p(e,t){return t?"".concat(e,":").concat(t):e}Jp.defaultProps={checked:!1,label:"",className:""},function(e){e.MustCompleteOnboarding="must_complete_onboarding",e.StudentWorkspaceSharing="student_ws_sharing",e.StudentToStudentMessaging="student_to_student_messaging",e.HideResourcesForStudents="hide_resources_for_students",e.LibraryReview="library_review",e.SchoolMessaging="school_messaging",e.LegacyTvNaming="legacy_tv_naming",e.LegacyAlbertCustomer="legacy_albert_customer",e.HideHostedLibraries="hide_hosted_libraries",e.StaffRequest="staff_request",e.MaxCustomLibraries="max_custom_libraries",e.CustomLibrariesBetaAccess="custom_libraries_beta_access",e.AutoCaptioning="auto_captioning",e.Topics="subjects",e.NewDashboards="new_dashboards",e.LiteAccess="lite_access",e.HasCompletedOnboarding="has_completed_onboarding",e.BulkOnboardingPreferencesState="bulk_onboarding_preferences_state"}(Rp||(Rp={})),function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(Dp||(Dp={})),function(e){e.AU="content-ap-southeast-1",e.NZ="content-ap-southeast-2",e.UK="content-eu-west-1",e.SCOT="content-eu-west-2",e.US="content-na-central-1",e.GLOBAL="content-global"}(Mp||(Mp={}));var Kp,Wp=function(e){return{key:$p("presentations",e),url:qu("/api/subjects/v1/presentations",{type:e})}},Yp=function(e,t){return{key:$p("customers:".concat(e,":presentations"),t),url:qu("/api/subjects/v1/customers/".concat(e,"/presentations"),{type:t})}},Gp=function(e,t,n,r,i){return{key:"customers:".concat(e,":presentations:").concat(t,":add"),url:"/api/subjects/v1/customers/".concat(e,"/presentations/").concat(t),type:se.a.POST,invalidationKeys:"customers:".concat(e,":presentation"),success:n,error:r,always:i}},Zp=function(e,t,n,r,i){return{key:"customers:".concat(e,":presentations:").concat(t,":remove"),url:"/api/subjects/v1/customers/".concat(e,"/presentations/").concat(t),type:se.a.DELETE,invalidationKeys:"customers:".concat(e,":presentations"),success:n,error:r,always:i}};!function(e){e.Developer="Curator Devs",e.Content="Content",e.Curator="Curators",e.Support="Support",e.SalesSupport="Sales Support"}(Kp||(Kp={}));var Qp,Xp,ed=function(){return[{value:"protected",access:"r"}]},td=function(e){return Kl(e).includes(Kp.Developer)},nd=function(e){return[Kp.Developer,Kp.Content].some((function(t){return Kl(e).includes(t)}))},rd=function(e,t,n,r,i){var o="settings:entity:".concat(e),a="/api/cache?keys=".concat(o);return{url:"/ajax/online/".concat(t,"?endpoint=").concat(encodeURIComponent(a)),key:"settings:cache:".concat(e),type:se.a.DELETE,success:n,error:r,always:i}},id=function(e){return{key:"customers:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=country,contentregion")}};function od(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ad(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ad(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ad(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cd(e){var t,n=od(l.useState(),2),r=n[0],i=n[1],o=e.availablePresentations.filter((function(t){return!e.currentPresentations.find((function(e){return e.id===t.id}))}));return l.createElement("div",null,!!e.canAdd&&!!o.length&&l.createElement(l.Fragment,null,l.createElement(Ii.Form.Label,null,"Select a presentation to add"),l.createElement(Ii.Form.Control,{as:"select",value:null!==(t=null==r?void 0:r.id)&&void 0!==t?t:"",onChange:function(t){var n=function(e,t){return Hp.a.first(t.filter((function(t){return t.id.toString()===e.toString()})))}(t.target.value,o);n&&(i(n),e.onSelectPresentation(n))},className:"cursor-pointer"},l.createElement("option",{value:""},"Select a presentation"),o.map((function(e){return l.createElement("option",{value:e.id,key:e.id},e.name)})))),!!e.currentPresentations.length&&l.createElement(l.Fragment,null,l.createElement("ul",{className:"list-unstyled mt-2"},e.currentPresentations.map((function(t){return l.createElement("li",null,t.name,!!e.canRemove&&l.createElement("span",{className:"text-danger cursor-pointer ml-2",onClick:function(){return e.removePresentation(t)}},l.createElement("em",null,"remove")))})))))}!function(e){e.Draft="Draft",e.Published="Published"}(Qp||(Qp={})),function(e){e.Subject="subject",e.Curriculum="curriculum"}(Xp||(Xp={}));var sd="9",ud="13",ld="14",fd="15";function pd(e,t){return td(t)?e:function(e){return e.filter((function(e){return e.status===Qp.Published}))}(e)}function dd(e,t,n){return td(t)?e:pd(e,t).filter((function(e){return n.contentRegion.systemName===Mp.US?e.id.toString()===ud||e.id.toString()===fd||e.id.toString()===ld:n.contentRegion.systemName===Mp.AU?e.id.toString()===sd:void 0}))}function md(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yd(e){var t,n,r,o=jp(),a=Object(b.useDispatch)(),s=md(l.useState(!!e.newCustomer),2),u=s[0],f=s[1],d=md(l.useState(),2),m=d[0],h=d[1],y=md(l.useState(),2),v=y[0],g=y[1],S=md(l.useState(),2),E=S[0],O=S[1],C=md(l.useState(!1),2),w=C[0],A=C[1],j=ce.useBasicFetch(id(e.customerId)),T=ce.useBasicFetch(Bp()),k=ce.useBasicFetch(zp(e.customerId,Rp.Topics)),I=(r=e.customerId,{availableTopicPresentations:ce.useBasicFetch(Wp(Xp.Subject)),availableCurriculumPresentations:ce.useBasicFetch(Wp(Xp.Curriculum)),customerTopicPresentations:ce.useBasicFetch(Yp(r,Xp.Subject)),customerCurriculumPresentations:ce.useBasicFetch(Yp(r,Xp.Curriculum))}),L=I.availableTopicPresentations,_=I.availableCurriculumPresentations,P=I.customerTopicPresentations,x=I.customerCurriculumPresentations;function N(){if(e.newCustomer)return alert("Successfully set up Topics for this customer."),void p.LocationUtils.PageLoad(p.AppLinkHelper.getHref({application:c.CUSTOMERS,action:i.Customers.MANAGE_CUSTOMER_TOPICS,args:[e.customerId]}));A(!1),o.success("Successfully saved customer presentations.")}if(l.useEffect((function(){var e;(null===(e=k.data)||void 0===e?void 0:e.value)&&f(!0)}),[null===(t=k.data)||void 0===t?void 0:t.value]),l.useEffect((function(){u||(h(null),g(null))}),[u]),l.useEffect((function(){if(!td(T.data)&&m){var e=_.data.find((function(e){return"Default Curriculum"===e.name}));g(e)}}),[m]),!!!(T.data&&k.data&&j.data&&L.data&&_.data&&P.data&&x.data))return l.createElement(l.Fragment,null);var R=ap(null===(n=j.data.contentRegion)||void 0===n?void 0:n.systemName,Mp.US),D=td(T.data),M=D?m||v:u&&m&&v;return l.createElement(l.Fragment,null,l.createElement("h1",{className:"h6 mb-3"},j.data.name," - ",j.data.crmId),l.createElement("div",{className:"alert alert-danger",role:"alert"},"After enabling Topics, please ensure that ",l.createElement("strong",null,"Dashboard")," is enabled for this customer and that they have the correct library for the ",l.createElement("strong",null,"Topics Presentation")," you choose."),l.createElement(Jp,{id:"enableTopics",checked:u,onChange:function(){return f(!u)},label:"Enable Topics",disabled:k.data.value}),u&&l.createElement(l.Fragment,null,l.createElement("p",{className:"mt-3"},l.createElement("strong",null,"Topic Presentations")),l.createElement(cd,{availablePresentations:dd(L.data,T.data,j.data),currentPresentations:P.data,onSelectPresentation:function(e){return h(e)},removePresentation:function(e){return O(e)},canRemove:D,canAdd:!0}),D&&l.createElement(l.Fragment,null,l.createElement("p",{className:"mt-3"},l.createElement("strong",null,"Curriculum Presentations")),l.createElement(cd,{availablePresentations:pd(_.data,T.data),currentPresentations:x.data,onSelectPresentation:function(e){return g(e)},removePresentation:function(e){return O(e)},canRemove:D,canAdd:!0}))),l.createElement("div",{className:"d-flex justify-content-end align-items-center pt-3"},!k.data.value&&!R&&l.createElement(Pu,{className:"info-link mr-3",appLink:{application:c.CUSTOMERS,action:i.Customers.MANAGE_CUSTOMER,args:[e.customerId]}},"Skip for now"),l.createElement("button",{className:"btn btn-primary",onClick:function(){return A(!0)},disabled:!M},"Save")),w&&l.createElement(Np,{title:"Confirmation needed",onClickConfirm:function(){var t=function(){var e=[];return m&&e.push(m),v&&e.push(v),e}();if(t.length){var n=function(){var t=k.data.value?[]:[Rp.Topics,Rp.NewDashboards];return e.newCustomer&&t.push(Rp.MustCompleteOnboarding),t}(),r=0,i=0,o=t.length+(n.length?1:0),c=t.map((function(t){return Gp(e.customerId,t.id,s,u)}));n.length&&c.push(qp(e.customerId,n.map((function(e){return{name:e,value:!0,kind:Dp.Temporary}})),s,u)),c.forEach((function(e){return ce.fetch(a,e)}))}function s(){i++,u()}function u(){var t;if(++r===o){if(i<r||!(null===(t=j.data.country)||void 0===t?void 0:t.code))return A(!1),void alert("Something went wrong while setting up Topics for this customer. Please contact to the Product Team so that they look into the issue.");if(!n.length)return N(),h(null),void g(null);var c=rd(e.customerId,j.data.country.code,N,(function(){A(!1),alert("Successfully set up Topics but failed to clear Online cache. Please contact to the Product Team so that they look into the issue.")}));ce.fetch(a,c)}}},closePopup:function(){return A(!1)}},k.data.value?l.createElement("p",null,"Are you sure you want to add this customer to:"):l.createElement("p",null,"Are you sure you want enable Topics for this customer and add it to the following presentations:"),l.createElement("ul",null,!!m&&l.createElement("li",null,l.createElement("strong",null,"Topic Presentation:")," ",m.name),!!D&&!!v&&l.createElement("li",null,l.createElement("strong",null,"Curriculum Presentation:")," ",v.name)),!D&&l.createElement("p",{className:"text-danger"},l.createElement("strong",null,"You will be able to come back and add more presentations."))),!!E&&l.createElement(Np,{title:"Confirmation needed",onClickConfirm:function(){if(E){var t=Zp(e.customerId,E.id,(function(){return o.success("Successfully removed customer from presentation.")}),(function(e){var t;return o.error((null===(t=e.responseJSON)||void 0===t?void 0:t.message)||"Failed to remove presentation.")}),(function(){return O(null)}));ce.fetch(a,t)}},closePopup:function(){return O(null)}},l.createElement("p",null,"Are you sure you want to remove this customer from ",l.createElement("strong",null,E.name),"?")))}function vd(e){return(vd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Sd(e,t,n){return t&&gd(e.prototype,t),n&&gd(e,n),e}function Ed(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Od(e,t)}function Od(e,t){return(Od=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Cd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ad(e);if(t){var i=Ad(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return wd(this,n)}}function wd(e,t){return!t||"object"!==vd(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ad(e){return(Ad=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jd=function(e){Ed(n,e);var t=Cd(n);function n(){return bd(this,n),t.apply(this,arguments)}return Sd(n,[{key:"channelName",get:function(){return c.CUSTOMERS}},{key:"appRoutes",get:function(){return{"customers/:id/topics(/)":"manageCustomerTopics"}}},{key:"externalRoutes",get:function(){return{"customers/:id(/)":"manageCustomer"}}}]),n}(p.AppRouter),Td=function(e){Ed(n,e);var t=Cd(n);function n(){return bd(this,n),t.apply(this,arguments)}return Sd(n,[{key:"name",get:function(){return"Customers Application"}},{key:"channelName",get:function(){return c.CUSTOMERS}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{alertRegion:_}}}},{key:"manageCustomerTopics",value:function(e,t){this.layout.showChildView(I,l.createElement(yd,{customerId:e,newCustomer:t.newCustomer}))}}],[{key:"router",get:function(){return jd}}]),n}(op),kd=n(63),Id=n(27),Ld=n.n(Id);function _d(e){var t=e.alert,n=e.svgName,r=e.svgClassName,i=e.closeAlert,o=t.message,a=t.heading,c=t.appLink,s=t.appLinkText,u=t.appLinkClassName,f=void 0===u?"":u,p=Object(fs.sanitize)(o);return l.createElement(l.Fragment,null,l.createElement("div",{className:"d-inline-block ".concat(Ld.a.icon)},l.createElement(ns,{svgName:n,className:"svg-container ".concat(r)})),l.createElement("div",{className:"pl-2 d-inline-block ".concat(Ld.a.alertContent)},l.createElement("p",{className:"p-0 m-0 pb-1 ".concat(Ld.a.heading)},a),l.createElement("p",{className:"p-0 text-break clamp-4 ".concat(Ld.a.message),dangerouslySetInnerHTML:{__html:p}}),!!c&&l.createElement(Pu,{className:f,appLink:c},s)),l.createElement("div",{className:"close d-inline-block cursor-pointer",role:"button",onClick:i},"×"))}function Pd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Nd=function(e){switch(e.type){case hp.Success:return Qc.CheckCircleOutline;case hp.Fail:case hp.Warning:return Qc.Warning;case hp.Info:default:return Qc.Info}};function Rd(e){var t=e.alert,n=e.closeAlert,r=Pd(l.useState(!0),2),i=r[0],o=r[1],a=l.useRef();l.useEffect((function(){i?a.current=window.setTimeout(n,3e3):clearTimeout(a.current)}),[i]);var c="text-".concat(t.type.toLowerCase());return l.createElement("li",{className:"bg-white mt-2 p-2 show clearfix ".concat(Ld.a.alertItem),onMouseEnter:function(){return o(!1)},onMouseLeave:function(){return o(!0)}},l.createElement(_d,{alert:t,svgName:Nd(t),svgClassName:c,closeAlert:n}))}function Dd(e){var t=e.alerts,n=e.removeAlert;return l.createElement("div",{className:Ld.a.alertBox},l.createElement(kd.TransitionGroup,{component:"ul",className:"".concat(Ld.a.alertList," list-unstyled")},t&&t.map((function(e,t){return l.createElement(kd.CSSTransition,{key:t,timeout:200,classNames:"alert"},l.createElement(Rd,{alert:e,closeAlert:function(){return n(e.id)}}))}))))}var Md=n(20),Ud={namespace:"domain_options"},Fd=function(){return"/api/domain/v3/settings/types"},Vd=function(e){return"/api/domain/v3/settings/types/".concat(e)},Bd=function(){return"/api/domain/v3/settings/types"},Hd=function(e){return"/api/domain/v3/settings/types/".concat(e)},zd=function(e){return"/api/domain/v3/settings/types/".concat(e)},qd="domain:options",Jd="domain:option",$d="update:domain:option",Kd="delete:domain:option",Wd=function(){return{key:qd,url:Fd(),normalizeOptions:Ud}},Yd=function(e){return{key:"".concat(Jd,":").concat(e),url:Vd(e),normalizeOptions:Ud}},Gd=function(e,t,n){return e.type===Md.DomainOptionType.String&&(e=Xd(e)),{key:Jd,url:Bd(),data:e,type:se.a.POST,success:t,error:n,invalidationKeys:[qd],normalizeOptions:Ud}},Zd=function(e,t){return e.type===Md.DomainOptionType.String&&(e=Xd(e)),{key:"".concat($d,":").concat(e.id),url:Hd(e.id),data:e,type:se.a.PUT,always:t,formatData:function(){return e},normalizeOptions:Ud}},Qd=function(e,t){return{key:"".concat(Kd,":").concat(e),url:zd(e),type:se.a.DELETE,invalidationKeys:[qd],normalizeOptions:Ud,success:t}};function Xd(e){var t=e.defaultValue;if('"'===t)return Object.assign(Object.assign({},e),{defaultValue:'"'.concat(t,'"')});var n=t.charAt(0),r=t.charAt(t.length-1);return'"'!==n&&(t='"'.concat(t)),'"'!==r&&(t="".concat(t,'"')),Object.assign(Object.assign({},e),{defaultValue:t})}function em(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nm(e){var t=em(l.useState(!1),2),n=t[0],r=t[1],o=ce.useBasicFetch(Yd(e.optionId)),a=Object(b.useDispatch)(),s=function(){e.closePopup(),p.AppLinkHelper.trigger({application:c.DOMAIN_OPTIONS,action:i.DomainOptions.DOMAIN_OPTIONS})};return l.createElement(kp,{title:"Delete Domain Option",closePopup:e.closePopup,showLoadingSpinner:!o.data},o.data&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,o.data.name),"?")),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){r(!0),ce.fetch(a,Qd(e.optionId,s))},buttonText:"Yes, delete this domain option",isSpinnerButton:!0,showSpinner:n}]})))}var rm,im=function(e){return{application:c.DOMAIN_OPTIONS,action:i.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]}},om={application:c.DOMAIN_OPTIONS,action:i.DomainOptions.NEW_DOMAIN_OPTION};function am(){var e=ce.useBasicFetch(Wd());if(!e.data)return l.createElement(l.Fragment,null);var t=e.data.map((function(e){return e.displayName&&(e.name=e.displayName),e}));return l.createElement(l.Fragment,null,l.createElement("div",{className:"d-flex justify-content-between mb-2"},l.createElement("h5",{className:"d-inline-block m-0"},"Select a domain option type to edit:"),l.createElement(Pu,{appLink:om,className:"d-block"},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New Domain Option"))),l.createElement(Ul,{objects:t,getAppLink:im}))}!function(e){e[e.Audience=1]="Audience",e[e.Category=2]="Category",e[e.Channel=3]="Channel",e[e.Chapter=4]="Chapter",e[e.Comment=5]="Comment",e[e.OwnerComment=6]="OwnerComment",e[e.Image=7]="Image",e[e.Thumbnail=8]="Thumbnail",e[e.Avatar=9]="Avatar",e[e.Banner=10]="Banner",e[e.Video=11]="Video",e[e.Trailer=12]="Trailer",e[e.Rating=13]="Rating",e[e.Topic=14]="Topic",e[e.Series=15]="Series",e[e.Season=16]="Season",e[e.HostedMediaObjectCollection=17]="HostedMediaObjectCollection",e[e.ExchangeCollection=18]="ExchangeCollection",e[e.CustomMediaObjectCollection=19]="CustomMediaObjectCollection",e[e.Playlist=20]="Playlist",e[e.ClickViewTvCollection=21]="ClickViewTvCollection",e[e.ClickViewProductionsCollection=22]="ClickViewProductionsCollection",e[e.User=23]="User",e[e.SystemUser=24]="SystemUser",e[e.Customer=25]="Customer",e[e.Country=26]="Country",e[e.Organisation=28]="Organisation",e[e.SystemOrganisation=29]="SystemOrganisation",e[e.Group=30]="Group",e[e.SystemGroup=31]="SystemGroup",e[e.FlagReason=32]="FlagReason",e[e.Library=33]="Library",e[e.Interactive=34]="Interactive",e[e.WorkspaceCollection=35]="WorkspaceCollection",e[e.Conversation=36]="Conversation",e[e.Message=37]="Message",e[e.Notification=38]="Notification",e[e.Clip=39]="Clip",e[e.Link=40]="Link",e[e.UserChannel=41]="UserChannel",e[e.Resource=42]="Resource",e[e.VideoStream=43]="VideoStream",e[e.AudioStream=44]="AudioStream",e[e.Tag=45]="Tag",e[e.Subtitle=46]="Subtitle",e[e.LicencedContentCollection=47]="LicencedContentCollection",e[e.PublicCollection=48]="PublicCollection",e[e.CategoryTree=49]="CategoryTree",e[e.Logo=50]="Logo",e[e.Permission=51]="Permission",e[e.Subject=52]="Subject",e[e.Field=53]="Field",e[e.Company=54]="Company",e[e.Person=55]="Person",e[e.Cover=56]="Cover",e[e.Poster=57]="Poster",e[e.SubjectAudience=58]="SubjectAudience",e[e.TallPoster=60]="TallPoster",e[e.Classroom=67]="Classroom",e[e.ClassroomGroup=68]="ClassroomGroup"}(rm||(rm={}));var cm=Ti.object().shape({id:Ti.string(),name:Ti.string().trim().max(64,"Name is too long").required("Name is required").default(""),displayName:Ti.string().trim().max(255,"Display name is too long").required("Display name is required").default(""),type:Ti.mixed().required("Type is required").default(Md.DomainOptionType.Boolean),entityType:Ti.mixed().required("Entity type is required").default(rm.Customer),kind:Ti.mixed().required("Kind is required").default(Md.DomainOptionKind.Temporary),defaultValue:Ti.mixed().required("Default value is required").default("false")}).noUnknown();function sm(e){var t=e.type,n=e.defaultValue;if(!t)return l.createElement(l.Fragment,null);var r={label:"Default Value",name:"defaultValue",id:"defaultValue",value:n};return t===Md.DomainOptionType.Boolean?l.createElement(as,Object.assign({as:"select"},r),l.createElement("option",{value:"true"},"True"),l.createElement("option",{value:"false"},"False")):t===Md.DomainOptionType.Long||t===Md.DomainOptionType.StaffRequest?l.createElement(as,Object.assign({as:"input",type:"number"},r)):t===Md.DomainOptionType.String?l.createElement(as,Object.assign({as:"input"},r)):void 0}var um=[rm.Customer,rm.User];function lm(e){var t=null===e.id||void 0===e.id,n=si(),r=us(n);return l.createElement(bi,null,l.createElement(as,{label:"Name (snake_case)",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this domain option",autoFocus:!0}),l.createElement(as,{label:"Display Name",type:"text",name:"displayName",id:"displayName",value:n.values.displayName,placeholder:"Enter a display name for this domain option"}),l.createElement(as,{as:"select",label:"Kind",name:"kind",id:"kind",value:n.values.kind},wi.a.getEnumKeys(Md.DomainOptionKind).map((function(e){return l.createElement("option",{key:e,value:Md.DomainOptionKind[e]},e)}))),l.createElement(as,{as:"select",label:"Entity",name:"entityType",id:"entityType",value:n.values.entityType},wi.a.getEnumKeys(rm).filter((function(e){return um.includes(rm[e])})).map((function(e){return l.createElement("option",{key:e,value:rm[e]},e)}))),l.createElement(as,{as:"select",label:"Type",name:"type",id:"type",value:n.values.type},wi.a.getEnumKeys(Md.DomainOptionType).map((function(e){return l.createElement("option",{key:e,value:Md.DomainOptionType[e]},e)}))),l.createElement(sm,{type:n.values.type,defaultValue:n.values.defaultValue}),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(Pf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&l.createElement(Ii.Button,{as:Pu,variant:"danger",appLink:{application:c.DOMAIN_OPTIONS,action:i.DomainOptions.DELETE_DOMAIN_OPTION,args:[e.id]}},"Delete")))}function fm(e){return l.createElement(ji,{initialValues:e.domainOption,validationSchema:cm,onSubmit:e.saveDomainOption},l.createElement(lm,{id:e.domainOption&&e.domainOption.id}))}function pm(){var e=Object(b.useDispatch)();return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Create New Domain Option"),l.createElement(fm,{saveDomainOption:function(t,n){ce.fetch(e,Gd(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.DOMAIN_OPTIONS,action:i.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]})}),n))}}))}function dm(e){var t=e.optionId,n=ce.useBasicFetch(Yd(t)),r=Object(b.useDispatch)();return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Edit Domain Option"),n.data&&l.createElement(fm,{domainOption:n.data,saveDomainOption:function(e,t){return ce.fetch(r,Zd(e,t))}}))}function mm(e){return(mm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ym(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vm(e,t,n){return t&&ym(e.prototype,t),n&&ym(e,n),e}function bm(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gm(e,t)}function gm(e,t){return(gm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Om(e);if(t){var i=Om(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Em(this,n)}}function Em(e,t){return!t||"object"!==mm(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Om(e){return(Om=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Cm=function(e){bm(n,e);var t=Sm(n);function n(){return hm(this,n),t.apply(this,arguments)}return vm(n,[{key:"channelName",get:function(){return c.DOMAIN_OPTIONS}},{key:"appRoutes",get:function(){return{"developer/options(/)":"domainOptions","developer/options/new(/)":"newDomainOption","developer/options/:id(/)":"editDomainOption"}}},{key:"appLinks",get:function(){return["deleteDomainOption"]}}]),n}(p.AppRouter),wm=function(e){bm(n,e);var t=Sm(n);function n(){return hm(this,n),t.apply(this,arguments)}return vm(n,[{key:"name",get:function(){return"Domain Options Application"}},{key:"channelName",get:function(){return c.DOMAIN_OPTIONS}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT}}},{key:"domainOptions",value:function(){this.layout.showChildView(I,l.createElement(am,null))}},{key:"newDomainOption",value:function(){this.layout.showChildView(I,l.createElement(pm,null))}},{key:"editDomainOption",value:function(e){this.layout.showChildView(I,l.createElement(dm,{optionId:e}))}},{key:"deleteDomainOption",value:function(e){this.layout.showChildView(L,l.createElement(nm,Object.assign({optionId:e},this.getPopupProps())))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return Ou.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_,l.createElement(Dd,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return Cm}}]),n}(p.Application),Am=function(e){return e?"".concat("/api/master/v2/people","?cursor=").concat(e):"/api/master/v2/people"},jm=function(e){return"/api/master/v2/objects/".concat(e)},Tm=function(){return"/api/master/v2/people"},km=function(e){return"/api/master/v2/objects/".concat(e)},Im="people",Lm="person",_m="update:person",Pm=function(e){return{key:"".concat(Im).concat(e?":".concat(e):""),url:Am(e)}},xm=function(e){return{key:"".concat(Lm,":").concat(e),url:jm(e)}},Nm=function(e,t,n){return{key:Lm,url:Tm(),data:e,type:se.a.POST,success:t,error:n,invalidationKeys:[Im]}},Rm=function(e,t,n){return{key:"".concat(_m,":").concat(e),url:km(e),data:t,type:se.a.PUT,always:n}},Dm=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown();function Mm(e){var t=si();return l.createElement(bi,null,l.createElement(as,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this person",autoFocus:!0}),l.createElement(Is,{isNew:e.isNew}))}function Um(e){return l.createElement(ji,{initialValues:e.person,validationSchema:Dm,onSubmit:e.savePerson},l.createElement(Mm,{isNew:!(e.person&&e.person.id)}))}function Fm(e){var t=Object(b.useDispatch)(),n=ce.useBasicFetch(xm(e.id));return l.createElement(l.Fragment,null,!!n.data&&l.createElement(Um,{person:n.data,savePerson:function(n,r){return ce.fetch(t,Rm(e.id,n,r))}}))}function Vm(){var e=Object(b.useDispatch)();return l.createElement(Um,{savePerson:function(t,n){ce.fetch(e,Nm(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.PEOPLE,action:i.People.EDIT_PERSON,args:[e.id]})}),n))}})}var Bm=c.PEOPLE,Hm=function(e){return{application:Bm,action:i.People.EDIT_PERSON,args:[e.id]}},zm=function(e){return p.AppLinkHelper.trigger(Hm(e))};function qm(e){var t=ce.useBasicFetch(Pm(e.cursor));return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-3 w-50"},l.createElement(lu,{placeholder:"Search for a person",onSuggestionSelected:zm,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/people/instant/raw","?q=").concat(e)},activationLength:2})),l.createElement(jl,{collection:t&&t.data,columns:[{accessor:"name",header:"Name",appLink:Hm}],collectionAppLink:{application:Bm,action:i.People.PEOPLE},newObjectAppLink:{application:Bm,action:i.People.NEW_PERSON},objectName:"Person"}))}function Jm(e){return(Jm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Km(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wm(e,t,n){return t&&Km(e.prototype,t),n&&Km(e,n),e}function Ym(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gm(e,t)}function Gm(e,t){return(Gm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xm(e);if(t){var i=Xm(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Qm(this,n)}}function Qm(e,t){return!t||"object"!==Jm(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Xm(e){return(Xm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var eh,th=function(e){Ym(n,e);var t=Zm(n);function n(){return $m(this,n),t.apply(this,arguments)}return Wm(n,[{key:"channelName",get:function(){return c.PEOPLE}},{key:"appRoutes",get:function(){return{"manage/people(/)":"people","manage/people/new(/)":"newPerson","manage/people/:id(/)":"editPerson"}}}]),n}(p.AppRouter),nh=function(e){Ym(n,e);var t=Zm(n);function n(){return $m(this,n),t.apply(this,arguments)}return Wm(n,[{key:"name",get:function(){return"People Application"}},{key:"channelName",get:function(){return c.PEOPLE}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT}}},{key:"people",value:function(e){var t=e.cursor;this.layout.showChildView(I,l.createElement(qm,{cursor:t}))}},{key:"newPerson",value:function(){this.layout.showChildView(I,l.createElement(Vm,null))}},{key:"editPerson",value:function(e){this.layout.showChildView(I,l.createElement(Fm,{id:e}))}}],[{key:"router",get:function(){return th}}]),n}(p.Application),rh=function(e,t,n,r,i){return{url:"/api/image/upload?type=".concat(t),key:"upload:image",data:e,type:se.a.POST,success:n,error:r,always:i}},ih=n(214),oh=n.n(ih);function ah(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ch(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ch(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ch(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e[e.NoRestrictions=0]="NoRestrictions",e[e.RestrictToCanvas=1]="RestrictToCanvas"}(eh||(eh={}));var sh=/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/;function uh(e){var t=e.dataUrl,n=e.minHeight,r=e.minWidth,i=e.onCrop,o=e.onCancel,a=l.useRef(),c=l.useRef(),s=ah(l.useState(!1),2),u=s[0],f=s[1],p=ah(l.useState(!1),2),d=p[0],m=p[1];return l.useEffect((function(){var e=new Image;e.src=t;var i=a.current.offsetWidth/e.width;return c.current=new oh.a(a.current,{viewMode:eh.RestrictToCanvas,autoCropArea:1,aspectRatio:r/n,minCropBoxWidth:r*i,minCropBoxHeight:n*i,ready:function(){return f(!0)}}),function(){c.current.destroy()}}),[]),l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-3 cropper-img-padding"},l.createElement("img",{ref:a,src:t,className:"img img-fluid"})),l.createElement("div",{className:"d-flex justify-content-end border-top pt-3 btn-padding"},l.createElement(Ii.Button,{variant:"link",onClick:o},"Cancel"),l.createElement(Pf,{onClick:function(){if(u){m(!0);var e=c.current.getCroppedCanvas().toDataURL(function(e){var t=e.match(sh);if(t)return t[1]}(t));h(i)&&i(e)}},disabled:!u,showSpinner:d},"Crop")))}function lh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ph(e){var t=Object(b.useDispatch)(),n=l.useContext(nl),r=n.getDataUrl,i=n.setImage,o=lh(l.useState(r()),1)[0],a=lh(l.useState(!1),2),c=a[0],s=a[1];return l.createElement(kp,{title:"Crop Image",size:e.popupSize,closePopup:e.closePopup,onEntered:function(){return s(!0)}},c&&l.createElement(uh,{dataUrl:o,minWidth:Qu[e.imageType].width,minHeight:Qu[e.imageType].height,onCrop:function(n){ce.fetch(t,rh(n,e.imageType,(function(e){return i(e)}),null,e.closePopup))},onCancel:e.closePopup}))}var dh=function(e){var t=e.children;return l.createElement(rl,null,t)};function mh(e){var t=e.page,n=e.totalPages,r=Bs.isNumber(t)&&t>0&&t<n&&t+1,i=Bs.isNumber(t)&&t>1&&t-1,o={};if(r&&r<=n&&(o.next=r.toString()),i&&(o.previous=i.toString()),!wi.a.isEmpty(o))return o}var hh={convertLegacyPaginatedCollection:function(e){if(e)return{data:e.data,pagination:{cursors:mh(e.pagination),limit:e.pagination.pageSize}}}},yh=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1";return{key:"playlists:".concat(e),url:"/ajax/playlists/curators?page=".concat(e),formatData:hh.convertLegacyPaginatedCollection}},vh=function(e,t){var n="/api/domain/v1/search/playlists?query=".concat(e);return t&&(n+="&filter={page:".concat(t,"}")),{key:"playlists:search:".concat(e).concat(t?":".concat(t):""),url:n,formatData:hh.convertLegacyPaginatedCollection}},bh=function(e){return{key:"playlist:".concat(e),url:"/ajax/playlists/".concat(e,"?query=cover,banner")}},gh=function(e){var t=e.slice().sort();return{key:"playlists:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},Sh=function(e,t,n,r){return{url:"/ajax/playlists",key:"playlist",data:e,type:se.a.POST,invalidationKeys:"playlists",success:t,error:n,always:r}},Eh=function(e,t,n,r,i){return{url:"/ajax/v2/playlists//".concat(e),key:"update:playlist:".concat(e),data:t,type:se.a.PUT,success:n,error:r,always:i}},Oh=function(e,t,n,r){return{url:"/ajax/playlists/".concat(e),key:"delete:playlist:".concat(e),type:se.a.DELETE,invalidationKeys:"playlists",success:t,error:n,always:r}},Ch=function(e){return{key:"playlist:".concat(e,":videos"),url:"/api/master/v2/objects/".concat(e,"/videos?query={orderBy:orderindex,limit:100}")}},wh=function(e,t,n,r){return{key:"reorder:playlist",url:"/api/master/v1/objects/".concat(e,"/videos/reorder"),data:t,type:se.a.PUT,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r}},Ah=function(e,t,n,r,i){return{key:"remove:playlist:video",url:"/api/master/v1/playlists/".concat(e,"/dissociate/").concat(t),type:se.a.DELETE,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r,always:i}},jh=function(e,t,n,r){return{key:"playlist:metadata:".concat(e.join(",")),url:qu("/ajax/playlists/metadata",{ids:e}),success:t,error:n,always:r}},Th=function(e,t,n,r){return{key:"dashboards:".concat(e),url:"/ajax/dashboards/".concat(e),success:t,error:n,always:r}},kh=function(e,t,n,r,i){return{key:"dashboard:".concat(e,":widget:").concat(t),url:"/ajax/dashboards/".concat(e,"/widgets/").concat(t),success:n,error:r,always:i}},Ih=function(e,t,n,r){return{key:"playlist:".concat(e,":widgets"),url:"/ajax/playlists/".concat(e,"/widgets"),success:t,error:n,always:r}},Lh=function(e,t,n,r,i,o){return{key:"dashboard:".concat(e,":widget:").concat(t),url:"/ajax/dashboards/".concat(e,"/widgets/").concat(t),type:se.a.DELETE,invalidationKeys:"playlist:".concat(n,":widgets"),formatData:function(){return null},success:r,error:i,always:o}};function _h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ph(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ph(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ph(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xh(e){var t=Object(b.useDispatch)(),n=jp(),r=_h(l.useState(!1),2),o=r[0],a=r[1],s=ce.useBasicFetch(bh(e.playlistId));var u=[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){a(!0),ce.fetch(t,Oh(e.playlistId,(function(){n.success("Successfully deleted playlist."),p.AppLinkHelper.trigger({application:c.PLAYLISTS,action:i.Playlists.PLAYLISTS})}),(function(){a(!1),n.error("Failed to delete playlist.")}),e.closePopup))},buttonText:"Yes, delete playlist",isSpinnerButton:!0,showSpinner:o}],f=!!s.data;return l.createElement(kp,{title:"Delete Playlist",closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,s.data.name),"?"),l.createElement("p",null,"Please ensure it is not being used in any widgets.")),l.createElement(Lp,{buttons:u})))}var Nh=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Ti.string().trim().max(65535,"Description is too long").default(""),cover:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),banner:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),metadata:Ti.object().shape({playlistId:Ti.string(),internalDescription:Ti.string().trim().max(255,"Description is too long").default("")}).default({}).noUnknown()}).noUnknown(),Rh=function(e,t){var n=c.PLAYLISTS,r=i.Playlists,o=[{label:"Edit Playlist Details",appLink:{application:n,action:r.EDIT_PLAYLIST,args:[t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_PLAYLIST_VIDEOS,args:[t]}},{label:"Dashboards",appLink:{application:n,action:r.EDIT_PLAYLIST_DASHBOARDS,args:[t]}}];return nd(e)&&o.push.apply(o,[{label:"Backbone Classifications",appLink:{application:n,action:r.EDIT_PLAYLIST_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_PLAYLIST_AUDIENCES,args:[t]}}]),o};function Dh(e){var t,n=si(),r=us(n);return l.createElement(bi,null,l.createElement(as,{label:"Name",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this playlist",autoFocus:!0}),l.createElement(as,{label:"Description",as:"textarea",name:"description",id:"description",value:n.values.description,placeholder:"Describe this playlist here"}),l.createElement(as,{label:"Internal Description",as:"textarea",name:"metadata.internalDescription",id:"metadata.internalDescription",value:null===(t=n.values.metadata)||void 0===t?void 0:t.internalDescription,placeholder:"This description will only be displayed in Curator"}),l.createElement(Sl,{imageType:Mu.Covers,fieldName:"cover",application:c.PLAYLISTS,uploadAction:i.Playlists.UPLOAD_IMAGE}),l.createElement(Sl,{imageType:Mu.Banners,fieldName:"banner",application:c.PLAYLISTS,uploadAction:i.Playlists.UPLOAD_IMAGE}),l.createElement("div",{className:"d-flex justify-content-between align-items-center"},l.createElement(Pf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},e.id?"Save":"Create"),!!e.actions&&l.createElement(Dl,{actions:e.actions})))}function Mh(e){var t,n=e.playlist&&e.playlist.id;return l.createElement(ji,{initialValues:e.playlist,validationSchema:Nh,onSubmit:e.savePlaylist},l.createElement(Dh,{id:n,actions:!!n&&(t=n,[{label:"Delete playlist",appLink:{application:c.PLAYLISTS,action:i.Playlists.DELETE_PLAYLIST,args:[t]},className:"text-danger"}])}))}function Uh(e){return l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:Rh(e.currentUser,e.playlistId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function Fh(e){var t=Object(b.useDispatch)(),n=jp(),r=ce.useBasicFetch(bh(e.playlistId)),o=ce.useBasicFetch(Bp());return l.createElement(l.Fragment,null,!!o.data&&l.createElement(Uh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST,currentUser:o.data}),!!r.data&&l.createElement(Mh,{playlist:r.data,savePlaylist:function(r,i){ce.fetch(t,Eh(e.playlistId,r,(function(){n.success("Successfully updated playlist.")}),(function(){n.error("Failed to update playlist.")}),i))}}))}var Vh=function(e,t){var n=e.dataServiceName,r=e.eventPrefix,i=e.fetchData,o=e.setData,a=e.onError,c=e.deleteEventPrefix;if(h(i)){if(h(o)){var s=a&&h(a),u=dp.getInstance(n),l=Ou.Radio.channel(u.channelName),f="".concat(r,":request"),d="".concat(r,":sync"),m="".concat(r,":error"),y="".concat(r,":invalidate"),v=c&&"".concat(c,":sync"),b=function(){return t(!1)},g=function(){return t(!0)},S=function(){return t(!1)},E=function(){return l.off(y,S)};l.once(f,b),l.once(d,g),l.once(y,S),s&&l.once(m,a),v&&l.once(v,E);var O=i(u);return O&&(t(!0),e.setData(O)),function(){dp.releaseInstance(n),l.off(f,b),l.off(d,g),l.off(y,S),s&&l.off(m,a),v&&l.off(v,E)}}p.ErrorHelper.throw(new ys.a("A setData function must be passed to fetch"))}else p.ErrorHelper.throw(new ys.a("A fetchData function must be passed to fetch"))};function Bh(e){return function(e){if(Array.isArray(e))return qh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||zh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||zh(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zh(e,t){if(e){if("string"==typeof e)return qh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qh(e,t):void 0}}function qh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Jh=function(e){return Array(Array.isArray(e)?e.length:0).fill(!1)};function $h(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=l.useState(Jh(e)),i=Hh(r,2),o=i[0],a=i[1];l.useEffect((function(){a(Jh(e))}),Bh(t)),l.useEffect((function(){if(n){var t=[];return e&&e.forEach((function(e,n){t.push(Vh(e,(function(e){e!==o[n]&&a(Hp.a.cloneAndReplaceAtIdx(o,n,e))})))})),function(){return t.forEach((function(e){return e()}))}}}),[o,n])}function Kh(e){return function(e){if(Array.isArray(e))return Gh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Yh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||Yh(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yh(e,t){if(e){if("string"==typeof e)return Gh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gh(e,t):void 0}}function Gh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zh(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=l.useState(!1),i=Wh(r,2),o=i[0],a=i[1];l.useEffect((function(){a(!1)}),Kh(t)),l.useEffect((function(){if(n)return Vh(e,a)}),[o,n])}var Qh=function(e,t,n){return function(r){return e((function(e){var i=h(n)?n:y();return Object.assign(Object.assign({},e),function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,i(r,e)))}))}};function Xh(e){return(Xh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ey(e){return function(e){if(Array.isArray(e))return ty(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ty(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ty(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ty(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ny(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ry(e,t){return(ry=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function iy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cy(e);if(t){var i=cy(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return oy(this,n)}}function oy(e,t){return!t||"object"!==Xh(t)&&"function"!=typeof t?ay(e):t}function ay(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cy(e){return(cy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var sy,uy,ly,fy,py,dy=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ry(e,t)}(o,e);var t,n,r,i=iy(o);function o(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=i.call(this,e),d.result(ay(t),"name")||ds.c.throw(new ys.a("Must provide a name when extending BaseDataService")),d.result(ay(t),"channelName")||ds.c.throw(new ys.a("Must provide a channelName for ".concat(d.result(ay(t),"name"))));var n=[].concat(ey(t.defaultProps),ey(t.props||[]));return t.dataRequestSignatures={},t.mergeOptions(e,n),t}return t=o,(n=[{key:"defaultProps",get:function(){return["dataProvider","cache","bootstrapData","defaultErrorHandler","alertService"]}},{key:"getCursors",value:function(e){var t=this.cache.get(e);return t?t.cursors:{}}},{key:"clearCacheAndGet",value:function(e){var t=this,n=e.callback,r=e.errorCallback,i=e.eventPrefix,o=this.getEventNames(i),a=o.syncEvent,c=o.errorEvent,s=this.cache.get(i);if(s&&s.openRequest)return this.listenToOnce(this.getChannel(),a,(function(e){d.isFunction(r)&&t.stopListening(t.getChannel(),c,r),d.isFunction(n)&&n(e)})),void this.listenToOnce(this.getChannel(),c,(function(){d.isFunction(n)&&t.stopListening(t.getChannel(),a,n),d.isFunction(r)&&r()}));this.cache.remove(e.eventPrefix),this.get(e)}},{key:"get",value:function(e){var t=this,n=e.callback,r=e.errorCallback,i=e.eventPrefix,o=e.resource,a=e.formatData,c=e.expiryTime,s=e.successHandler,u=e.errorHandler,l=e.bootstrapName,f=this.getEventNames(i),p=f.syncEvent,m=f.requestEvent,h=f.successEvent,y=f.errorEvent,v=this.getChannel(),b=this.currentTimestamp();this.bootstrapData&&this.bootstrapData[l]&&(this.cacheData(i,this.bootstrapData[l],a,{openRequest:!1,timestamp:b}),delete this.bootstrapData[l]);var g,S=this.cache.get(i);S&&(g=S.data);var E=S&&S.openRequest,O=this.isExpired(i,c);if(E&&(this.listenToOnce(v,p,(function(e){d.isFunction(r)&&t.stopListening(t.getChannel(),y,r),d.isFunction(n)&&n(e)})),this.listenToOnce(v,y,(function(){d.isFunction(n)&&t.stopListening(t.getChannel(),p,n),d.isFunction(r)&&r()}))),this.cache.has(i)&&!O||(v.trigger(m),this.listenToResponse({eventPrefix:i,formatData:a,cacheOptions:{timestamp:b},callback:n,errorCallback:r,successHandler:s,errorHandler:u}),this.cacheData(i,null,null,{openRequest:!0,timestamp:b}),this.dataProvider.read(o,{channel:this.getTransportChannel(),successEvent:h,errorEvent:y})),g&&d.isFunction(n)&&!O&&n(g),g)return g}},{key:"create",value:function(e){var t=e.eventPrefix,n=e.resource,r=e.data,i=e.formatData,o=e.callback,a=e.errorCallback,c=e.invalidationKeys,s=e.successHandler,u=e.errorHandler,l=this.getEventNames(e.eventPrefix),f=l.requestEvent,p=l.successEvent,d=l.errorEvent,m=this.getChannel(),h=this.getTransportChannel();m.trigger(f),this.listenToResponse({eventPrefix:t,formatData:i,invalidationKeys:c,callback:o,errorCallback:a,successHandler:s,errorHandler:u}),this.dataProvider.create(n,r,{channel:h,successEvent:p,errorEvent:d})}},{key:"update",value:function(e){var t=e.data,n=e.callback,r=e.errorCallback,i=e.resource,o=e.formatData,a=e.eventPrefix,c=e.invalidationKeys,s=e.errorHandler,u=e.successHandler,l=this.getEventNames(e.eventPrefix),f=l.requestEvent,p=l.successEvent,d=l.errorEvent,m=this.getChannel(),h=this.getTransportChannel();m.trigger(f),this.listenToResponse({eventPrefix:a,formatData:o,invalidationKeys:c,callback:n,errorCallback:r,successHandler:u,errorHandler:s}),this.dataProvider.update(i,t,{channel:h,successEvent:p,errorEvent:d})}},{key:"delete",value:function(e){var t=e.eventPrefix,n=e.resource,r=e.callback,i=e.errorCallback,o=e.invalidationKeys,a=e.successHandler,c=e.errorHandler,s=this.getEventNames(t),u=s.successEvent,l=s.errorEvent,f=this.getTransportChannel();this.listenToResponse({eventPrefix:t,invalidationKeys:o,callback:r,errorCallback:i,cacheOptions:{noCache:!0,clearCacheKey:!0},successHandler:a,errorHandler:c}),this.dataProvider.delete(n,{channel:f,successEvent:u,errorEvent:l})}},{key:"listenToResponse",value:function(e){var t=this,n=e.eventPrefix,r=e.formatData,i=e.callback,o=e.errorCallback,a=e.successHandler,c=e.errorHandler,s=e.invalidationKeys,u=e.cacheOptions,l=void 0===u?{}:u,f=this.getEventNames(n),p=f.syncEvent,m=f.successEvent,h=f.errorEvent,y=f.successAlertEvent,v=f.errorAlertEvent,b=this.getChannel(),g=this.getTransportChannel(),S=this.getAlertChannel();d.isFunction(i)&&this.listenToOnce(b,p,i),d.isFunction(o)&&this.listenToOnce(b,h,o),this.stopListening(S,y),this.stopListening(S,v),d.isFunction(a)&&this.listenToOnce(S,y,a),d.isFunction(c)&&this.listenToOnce(S,v,c),!d.isFunction(c)&&!1!==c&&d.isFunction(this.defaultErrorHandler)&&this.listenToOnce(S,v,this.defaultErrorHandler),this.hasRequestSignature(n)||(this.setRequestSignature(n),this.listenTo(g,m,(function(e){t.stopListening(b,h,o);for(var i=arguments.length,a=new Array(i>1?i-1:0),c=1;c<i;c++)a[c-1]=arguments[c];S.trigger.apply(S,[y,e].concat(a));var u=l.noCache?t.formatData(e,r):t.cacheData(n,e,r);l.clearCacheKey&&t.cache.remove(n),b.trigger(p,u),s&&s.length&&t.cache.invalidate(s,(function(e){return b.trigger("".concat(e,":invalidate"))}))})),this.listenTo(g,h,(function(){var e;t.stopListening(b,p,i);var r=(e=t.dataProvider).parseError.apply(e,arguments);S.trigger(v,r),b.trigger(h,r),l.noCache||t.cacheData(n,null,null)})))}},{key:"cacheData",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.openRequest,o=void 0!==i&&i,a=r.timestamp;a||(a=this.currentTimestamp());var c=this.processPagination(t),s=this.formatData(t,n);return this.cache.set(e,{data:s,timestamp:a,cursors:c,openRequest:o}),s}},{key:"processPagination",value:function(e){if(e){var t=e.pagination;if(t)return t.cursors?t.cursors:d.isUndefined(t.offset)||d.isUndefined(t.pageSize)?t.page?this.convertLegacyPaginationToCursors(t):void 0:this.convertOffsetPaginationToCursors(t)}}},{key:"formatData",value:function(e,t){return d.isFunction(t)?t(e):e}},{key:"chain",value:function(){var e=this,t=[],n=function(e,t){d.isFunction(e)&&e(t)},r=function(r,o){return t.push((function(){var i=r.callback;r.callback=function(e){n(i,e),n(t.shift())},e[o](r)})),i},i={func:function(e){return t.push((function(){e(t.shift()||function(){})})),i},get:function(e){return r(e,"get")},create:function(e){return r(e,"create")},update:function(e){return r(e,"update")},delete:function(e){return r(e,"delete")},run:function(){n(t.shift())}};return i}},{key:"invalidateCache",value:function(e){e&&e.length&&this.cache.invalidate(e)}},{key:"currentTimestamp",value:function(){return(new Date).valueOf()}},{key:"isExpired",value:function(e,t){if(!t)return!1;var n=this.cache.get(e);if(!n||!n.timestamp)return!0;var r=1e3*t;return n.timestamp<this.currentTimestamp()-r}},{key:"getEventNames",value:function(e){return{syncEvent:"".concat(e,":sync"),requestEvent:"".concat(e,":request"),successEvent:"".concat(e,":success"),errorEvent:"".concat(e,":error"),successAlertEvent:"".concat(e,":success:alert"),errorAlertEvent:"".concat(e,":error:alert")}}},{key:"getTransportChannel",value:function(){return Ou.Radio.channel("".concat(this.channelName,":transport"))}},{key:"getAlertChannel",value:function(){return Ou.Radio.channel("".concat(this.channelName,":alert"))}},{key:"setRequestSignature",value:function(e){this.dataRequestSignatures[e]=e}},{key:"hasRequestSignature",value:function(e){return!!this.dataRequestSignatures[e]}},{key:"convertOffsetPaginationToCursors",value:function(e){var t=e.offset,n=e.pageSize,r=e.totalItems,i=r>0&&t<r&&t+n,o=r>0&&t>0&&Math.max(t-n,0),a={};if(i&&i<r&&(a.next=i.toString()),d.isNumber(o)&&(a.previous=o.toString()),!d.isEmpty(a))return a}},{key:"convertLegacyPaginationToCursors",value:function(e){var t=e.page,n=e.totalPages,r=d.isNumber(t)&&t>0&&t<n&&t+1,i=d.isNumber(t)&&t>1&&t-1,o={};if(r&&r<=n&&(o.next=r.toString()),i&&(o.previous=i.toString()),!d.isEmpty(o))return o}}])&&ny(t.prototype,n),r&&ny(t,r),o}(ps.a),my=n(47),hy={SHORT:120,STANDARD:600};!function(e){e[e.Subject=0]="Subject",e[e.Classification=1]="Classification",e[e.Level=2]="Level",e[e.Audience=3]="Audience"}(sy||(sy={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(uy||(uy={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(ly||(ly={})),function(e){e.Root="0"}(fy||(fy={})),function(e){e.Root="root"}(py||(py={}));var yy,vy,by=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),backboneAudienceIds:Ti.array().of(Ti.string()).required("A level is required").default([])}).noUnknown();!function(e){e.Subject="Subject",e.Topic="Topic"}(yy||(yy={})),function(e){e.Draft="Draft",e.ComingSoon="ComingSoon",e.Published="Published"}(vy||(vy={}));var gy=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentIds:Ti.array().of(Ti.string()).default([py.Root]),backboneClassificationIds:Ti.array().of(Ti.string()).min(1,"A classification must be mapped to at least one subject").required("A classification must be mapped to at least one subject").default([]),type:Ti.mixed().required("Type is required").default(yy.Subject),status:Ti.mixed().required("Status is required").default(vy.Draft),emphasize:Ti.boolean().default(!1),canBePreferred:Ti.boolean().default(!1),cover:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),banner:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),tallPoster:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown()}).noUnknown(),Sy=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),Ey=Ti.object().shape({name:Ti.string().max(255,"Name is too long").required("Name is required"),description:Ti.string().max(65535,"Description is too long").required("Description is required"),status:Ti.mixed().required("Status is required").default(Qp.Draft)}),Oy=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentId:Ti.string().default(fy.Root)}).noUnknown(),Cy={singularizeMemberType:function(e){switch(e){case uy.Playlists:return"playlist";case uy.Series:return"series";case uy.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case uy.Playlists:return{application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:n};case uy.Series:return{application:c.SERIES,action:i.Series.EDIT_SERIES,args:n};case uy.Videos:return{application:c.VIDEOS,action:i.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(Cy.singularizeMemberType(n)),appLink:{application:c.SUBJECTS,action:t===sy.Subject?i.Subjects.REMOVE_SUBJECT_MEMBER:i.Subjects.REMOVE_CLASSIFICATION_MEMBER,args:[e,r,n]},className:"text-danger"}]}},wy=function(){var e=c.SUBJECTS,t=i.Subjects;return[{label:"Classifications",appLink:{application:e,action:t.CLASSIFICATIONS},activeActions:[t.CLASSIFICATIONS,t.PRESENTATION_CLASSIFICATIONS,t.NEW_CLASSIFICATION,t.EDIT_CLASSIFICATION,t.EDIT_CLASSIFICATION_PLAYLISTS,t.EDIT_CLASSIFICATION_SERIES,t.EDIT_CLASSIFICATION_VIDEOS,t.DELETE_CLASSIFICATION,t.REMOVE_CLASSIFICATION_MEMBER]},{label:"Backbone Classifications",appLink:{application:e,action:t.SUBJECTS},activeActions:[t.SUBJECTS,t.NEW_SUBJECT,t.EDIT_SUBJECT,t.EDIT_SUBJECT_PLAYLISTS,t.EDIT_SUBJECT_SERIES,t.EDIT_SUBJECT_VIDEOS,t.SUBJECT_CLASSIFICATIONS,t.DELETE_SUBJECT,t.ADD_SUBJECT_MEMBERS,t.REMOVE_SUBJECT_MEMBER]},{label:"Audiences",appLink:{application:e,action:t.AUDIENCES},activeActions:[t.AUDIENCES,t.PRESENTATION_AUDIENCES,t.NEW_AUDIENCE,t.EDIT_AUDIENCE,t.EDIT_AUDIENCE_PLAYLISTS,t.EDIT_AUDIENCE_SERIES,t.EDIT_AUDIENCE_VIDEOS,t.REMOVE_AUDIENCE_MEMBER]},{label:"Backbone Audiences",appLink:{application:e,action:t.LEVELS},activeActions:[t.LEVELS,t.NEW_LEVEL,t.EDIT_LEVEL,t.LEVEL_AUDIENCES,t.EDIT_LEVEL_PLAYLISTS,t.EDIT_LEVEL_SERIES,t.EDIT_LEVEL_VIDEOS]},{label:"Presentations",appLink:{application:e,action:t.PRESENTATIONS},activeActions:[t.PRESENTATIONS,t.NEW_PRESENTATION,t.EDIT_PRESENTATION]}]},Ay=function(e,t){var n=c.SUBJECTS,r=i.Subjects,o=[e];return[{label:"Edit Backbone Classification Details",appLink:{action:r.EDIT_SUBJECT}},{label:"Classifications",appLink:{action:r.SUBJECT_CLASSIFICATIONS}},{label:"Playlists",appLink:{action:r.EDIT_SUBJECT_PLAYLISTS}},{label:"Series",appLink:{action:r.EDIT_SUBJECT_SERIES}},{label:"Videos",appLink:{action:r.EDIT_SUBJECT_VIDEOS}}].map((function(e){var r=Object.assign(Object.assign({},e.appLink),{application:n,args:o});return t&&(r.params={presentationId:t}),{label:e.label,appLink:r}}))},jy=function(e,t){var n=c.SUBJECTS,r=i.Subjects;return[{label:"Edit Classification Details",appLink:{application:n,action:r.EDIT_CLASSIFICATION,args:[e,t]}},{label:"Playlists",appLink:{application:n,action:r.EDIT_CLASSIFICATION_PLAYLISTS,args:[e,t]}},{label:"Series",appLink:{application:n,action:r.EDIT_CLASSIFICATION_SERIES,args:[e,t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_CLASSIFICATION_VIDEOS,args:[e,t]}}]},Ty=function(e,t){var n=c.SUBJECTS,r=i.Subjects,o=[e];return[{label:"Edit Level Details",appLink:{action:r.EDIT_LEVEL}},{label:"Audiences",appLink:{action:r.LEVEL_AUDIENCES}},{label:"Playlists",appLink:{action:r.EDIT_LEVEL_PLAYLISTS}},{label:"Series",appLink:{action:r.EDIT_LEVEL_SERIES}},{label:"Videos",appLink:{action:r.EDIT_LEVEL_VIDEOS}}].map((function(e){var r=Object.assign(Object.assign({},e.appLink),{application:n,args:o});return t&&(r.params={presentationId:t}),{label:e.label,appLink:r}}))},ky=function(e,t){var n=c.SUBJECTS,r=i.Subjects;return[{label:"Edit Audience Details",appLink:{application:n,action:r.EDIT_AUDIENCE,args:[e,t]}},{label:"Playlists",appLink:{application:n,action:r.EDIT_AUDIENCE_PLAYLISTS,args:[e,t]}},{label:"Series",appLink:{application:n,action:r.EDIT_AUDIENCE_SERIES,args:[e,t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_AUDIENCE_VIDEOS,args:[e,t]}}]},Iy={singularizeMemberType:function(e){switch(e){case ly.Playlists:return"playlist";case ly.Series:return"series";case ly.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case ly.Playlists:return{application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:n};case ly.Series:return{application:c.SERIES,action:i.Series.EDIT_SERIES,args:n};case ly.Videos:return{application:c.VIDEOS,action:i.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(Iy.singularizeMemberType(n)),appLink:{application:c.SUBJECTS,action:t===sy.Level?i.Subjects.REMOVE_LEVEL_MEMBER:i.Subjects.REMOVE_AUDIENCE_MEMBER,args:[e,r,n]},className:"text-danger"}]}};function Ly(e){return(Ly="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _y(e){return function(e){if(Array.isArray(e))return Py(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Py(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Py(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Py(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ny(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ry(e,t){return(Ry=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Uy(e);if(t){var i=Uy(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return My(this,n)}}function My(e,t){return!t||"object"!==Ly(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Uy(e){return(Uy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Fy=function(){return"/api/subjects/v1/backbone-classifications/tree"},Vy=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},By=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/").concat(t,"?query={limit:100}")},Hy=function(e,t,n){var r="/api/subjects/v1/backbone-classifications/".concat(e,"/classifications"),i=[];return t&&i.push("presentationId=".concat(t)),n&&i.push("query=".concat(n,"{limit:100}")),i.length?"".concat(r,"?").concat(i.join("&")):r},zy=function(){return"/api/subjects/v1/backbone-classifications"},qy=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},Jy=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},$y=function(e){return"/api/subjects/v1/objects/".concat(e,"/backbone-classifications")},Ky=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/backbone-classifications?addToClassifications=").concat(!!t)},Wy=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/objects?addToClassifications=").concat(!!t)},Yy=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Gy=function(){return"/api/subjects/v1/presentations"},Zy=function(e){return"/api/subjects/v1/presentations/".concat(e)},Qy=function(){return"/api/subjects/v1/presentations"},Xy=function(e){return"/api/subjects/v1/presentations/".concat(e)},ev=function(e){return"/api/subjects/v1/presentations/".concat(e,"/classifications/tree")},tv=function(e){return"/api/subjects/v1/classifications/".concat(e,"?query=cover,banner,tallPoster,followers[count()]{limit:0}")},nv=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/").concat(t,"?query={limit:100}")},rv=function(){return"/api/subjects/v1/classifications"},iv=function(e){return"/api/subjects/v1/classifications/".concat(e)},ov=function(e){return"/api/subjects/v1/classifications/".concat(e)},av=function(e){return"/api/subjects/v1/objects/".concat(e,"/classifications")},cv=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/classifications?presentationId=").concat(t)},sv=function(e){return"/api/subjects/v1/classifications/".concat(e,"/objects")},uv=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},lv=function(){return"/api/subjects/v1/backbone-audiences"},fv=function(e){return"/api/subjects/v1/backbone-audiences/".concat(e)},pv=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/").concat(t,"?query={limit:100}")},dv=function(e,t,n){var r="/api/subjects/v1/backbone-audiences/".concat(e,"/audiences"),i=[];return t&&i.push("presentationId=".concat(t)),n&&i.push("query=".concat(n,"{limit:100}")),i.length?"".concat(r,"?").concat(i.join("&")):r},mv=function(){return"/api/subjects/v1/backbone-audiences"},hv=function(e){return"/api/subjects/v1/backbone-audiences/".concat(e)},yv=function(e){return"/api/subjects/v1/objects/".concat(e,"/backbone-audiences")},vv=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/backbone-audiences?addToAudiences=").concat(!!t)},bv=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/objects?addToAudiences=").concat(!!t)},gv=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Sv=function(e){return"/api/subjects/v1/presentations/".concat(e,"/audiences")},Ev=function(e){return"/api/subjects/v1/audiences/".concat(e)},Ov=function(e,t){return"/api/master/v2/objects/".concat(e,"/").concat(t,"?query={limit:100}")},Cv=function(){return"/api/subjects/v1/audiences"},wv=function(e){return"/api/subjects/v1/audiences/".concat(e)},Av=function(e){return"/api/subjects/v1/audiences/".concat(e)},jv=function(e){return"/api/subjects/v1/objects/".concat(e,"/audiences")},Tv=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/audiences?presentationId=").concat(t)},kv=function(e){return"/api/subjects/v1/audiences/".concat(e,"/objects")},Iv=function(e,t){return"/api/subjects/v1/audiences/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Lv=function(e,t,n){var r="".concat(o.SUBJECT,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(o.CLASSIFICATIONS),n&&(r+=":".concat(n)),r},_v=function(e,t,n){var r="".concat(o.LEVEL,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(o.AUDIENCES),n&&(r+=":".concat(n)),r},Pv=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ry(e,t)}(a,e);var t,n,r,i=Dy(a);function a(){return xy(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"name",get:function(){return u.SUBJECT}},{key:"channelName",get:function(){return s.SUBJECT}},{key:"getPresentations",value:function(e,t){return this.get({resource:Gy(),eventPrefix:o.PRESENTATIONS,expiryTime:hy.STANDARD,callback:e,errorCallback:t})}},{key:"getPresentation",value:function(e,t,n){return this.get({resource:Zy(e),eventPrefix:"".concat(o.PRESENTATION,":").concat(e),expiryTime:hy.STANDARD,callback:t,errorCallback:n})}},{key:"createPresentation",value:function(e,t,n){return this.create({resource:Qy(),data:e,callback:t,errorCallback:n,eventPrefix:o.PRESENTATION,invalidationKeys:[o.PRESENTATIONS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully created presentation."),errorHandler:this.alertService.error("Failed to create presentation.")})}},{key:"updatePresentation",value:function(e,t,n,r){return this.update({resource:Xy(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(o.UPDATE_PRESENTATION,":").concat(e),invalidationKeys:["".concat(o.PRESENTATION,":").concat(e),o.PRESENTATIONS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully updated presentation."),errorHandler:this.alertService.error("Failed to update presentation.")})}},{key:"getSubjectTree",value:function(e,t){return this.get({resource:Fy(),formatData:function(e){return{children:e,name:fy.Root,id:null}},eventPrefix:o.SUBJECTS,expiryTime:hy.STANDARD,callback:e,errorCallback:t})}},{key:"getSubject",value:function(e,t,n){return this.get({resource:Vy(e),eventPrefix:"".concat(o.SUBJECT,":").concat(e),expiryTime:hy.STANDARD,callback:t,errorCallback:n})}},{key:"getSubjectMemberIds",value:function(e,t,n,r){return this.get({resource:By(e,t),eventPrefix:"".concat(o.SUBJECT,":").concat(e,":").concat(t),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"getSubjectClassifications",value:function(e,t,n,r,i){return this.get({resource:Hy(e,t,n),eventPrefix:Lv(e,t,n),expiryTime:hy.STANDARD,callback:r,errorCallback:i})}},{key:"createSubject",value:function(e,t,n){return this.create({resource:zy(),data:e,callback:t,errorCallback:n,eventPrefix:o.SUBJECT,invalidationKeys:[o.SUBJECTS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully created subject."),errorHandler:this.alertService.error("Failed to create subject.")})}},{key:"updateSubject",value:function(e,t,n,r){return this.update({resource:qy(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(o.UPDATE_SUBJECT,":").concat(e),invalidationKeys:["".concat(o.SUBJECT,":").concat(e),o.SUBJECTS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully updated subject."),errorHandler:this.alertService.error("Failed to save subject.")})}},{key:"deleteSubject",value:function(e,t,n){var r=this;return this.delete({resource:Jy(e),callback:t,errorCallback:n,eventPrefix:o.DELETE_SUBJECT,invalidationKeys:["".concat(o.SUBJECT,":").concat(e),o.SUBJECTS],successHandler:this.alertService.success("Successfully deleted subject."),errorHandler:function(e){var t=(null==e?void 0:e.code)===my.a.Conflict?"Cannot delete a subject with child subjects and/or classifications.":"Failed to delete subject.";r.alertService.error(t)()}})}},{key:"getObjectSubjects",value:function(e,t,n,r){return this.get({resource:$y(e),eventPrefix:"".concat(t,":").concat(e,":").concat(o.SUBJECTS),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectSubjects",value:function(e,t,n,r,i,a){var c=Cy.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(o.SUBJECTS)];return r&&s.push("".concat(n,":").concat(e,":").concat(o.CLASSIFICATIONS)),s.push.apply(s,_y(t.map((function(e){return"".concat(o.SUBJECTS,":").concat(e,":").concat(n)})))),this.update({resource:Ky(e,r),data:t,callback:i,errorCallback:a,eventPrefix:"".concat(o.UPDATE_OBJECT_SUBJECTS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(c," subjects.")),errorHandler:this.alertService.error("Failed to update ".concat(c," subjects."))})}},{key:"addObjectsToSubject",value:function(e,t,n,r,i,a){var c=1===t.length?Cy.singularizeMemberType(n):n,s=["".concat(o.SUBJECT,":").concat(e,":").concat(n)].concat(_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.SUBJECTS)}))),_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.CLASSIFICATIONS)}))));return this.create({resource:Wy(e,r),data:t,callback:i,errorCallback:a,eventPrefix:"".concat(o.ADD_TO_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(c," to subject.")),errorHandler:this.alertService.error("Failed to add ".concat(c," to subject."))})}},{key:"removeObjectsFromSubject",value:function(e,t,n,r,i){var a=1===t.length?Cy.singularizeMemberType(n):n,c=["".concat(o.SUBJECT,":").concat(e,":").concat(n)].concat(_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.SUBJECTS)}))));return this.delete({resource:Yy(e,t),callback:r,errorCallback:i,eventPrefix:"".concat(o.REMOVE_FROM_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:c,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(a," from subject.")),errorHandler:this.alertService.error("Failed to remove ".concat(a," from subject."))})}},{key:"getClassificationTree",value:function(e,t,n){return this.get({resource:ev(e),formatData:function(e){return{children:e,name:py.Root,id:null}},eventPrefix:"".concat(o.CLASSIFICATIONS,":").concat(e),expiryTime:hy.STANDARD,callback:t,errorCallback:n})}},{key:"getClassification",value:function(e,t,n){return this.get({resource:tv(e),eventPrefix:"".concat(o.CLASSIFICATION,":").concat(e),expiryTime:hy.STANDARD,callback:t,errorCallback:n})}},{key:"getClassificationMembers",value:function(e,t,n,r){return this.get({resource:nv(e,t),eventPrefix:"".concat(o.CLASSIFICATION,":").concat(e,":").concat(t),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"createClassification",value:function(e,t,n){return this.create({resource:rv(),data:e,callback:t,errorCallback:n,eventPrefix:o.CLASSIFICATION,invalidationKeys:[o.CLASSIFICATIONS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully created classification."),errorHandler:this.alertService.error("Failed to create classification.")})}},{key:"updateClassification",value:function(e,t,n,r){return this.update({resource:iv(e),data:wi.a.omit(t,["followers"]),callback:n,errorCallback:r,eventPrefix:"".concat(o.UPDATE_CLASSIFICATION,":").concat(e),invalidationKeys:["".concat(o.CLASSIFICATION,":").concat(e),o.CLASSIFICATIONS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully updated classification."),errorHandler:this.alertService.error("Failed to save classification.")})}},{key:"deleteClassification",value:function(e,t,n){return this.delete({resource:ov(e),callback:t,errorCallback:n,eventPrefix:o.DELETE_CLASSIFICATION,invalidationKeys:["".concat(o.CLASSIFICATION,":").concat(e),o.CLASSIFICATIONS],successHandler:this.alertService.success("Successfully deleted classification"),errorHandler:this.alertService.error("Failed to delete classification")})}},{key:"getObjectClassifications",value:function(e,t,n,r){return this.get({resource:av(e),eventPrefix:"".concat(t,":").concat(e,":").concat(o.CLASSIFICATIONS),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectClassifications",value:function(e,t,n,r,i,a){var c=Cy.singularizeMemberType(r),s=["".concat(r,":").concat(e,":").concat(o.CLASSIFICATIONS)];return s.push.apply(s,_y(n.map((function(e){return"".concat(o.CLASSIFICATION,":").concat(e,":").concat(r)})))),this.update({resource:cv(e,t),data:n,callback:i,errorCallback:a,eventPrefix:"".concat(o.UPDATE_OBJECT_CLASSIFICATIONS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(c," classifications.")),errorHandler:this.alertService.error("Failed to update ".concat(c," classifications."))})}},{key:"addObjectsToClassification",value:function(e,t,n,r,i,a,c){var s=1===t.length?Cy.singularizeMemberType(n):n,u=["".concat(o.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(Lv(r,i,n)),u.push.apply(u,_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.CLASSIFICATIONS)})))),this.create({resource:sv(e),data:t,callback:a,errorCallback:c,eventPrefix:"".concat(o.ADD_TO_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(s," to classification.")),errorHandler:this.alertService.error("Failed to add ".concat(s," to classification."))})}},{key:"removeObjectsFromClassification",value:function(e,t,n,r,i,a,c){var s=1===t.length?Cy.singularizeMemberType(n):n,u=["".concat(o.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(Lv(r,i,n)),u.push.apply(u,_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.CLASSIFICATIONS)})))),this.delete({resource:uv(e,t),callback:a,errorCallback:c,eventPrefix:"".concat(o.REMOVE_FROM_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(s," from classification.")),errorHandler:this.alertService.error("Failed to remove ".concat(s," from classification."))})}},{key:"getLevels",value:function(e,t){return this.get({resource:lv(),eventPrefix:o.LEVELS,expiryTime:hy.STANDARD,callback:e,errorCallback:t})}},{key:"getLevel",value:function(e,t,n){return this.get({resource:fv(e),eventPrefix:"".concat(o.LEVEL,":").concat(e),expiryTime:hy.STANDARD,callback:t,errorCallback:n})}},{key:"getLevelMemberIds",value:function(e,t,n,r){return this.get({resource:pv(e,t),eventPrefix:"".concat(o.LEVEL,":").concat(e,":").concat(t),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"getLevelAudiences",value:function(e,t,n,r,i){return this.get({resource:dv(e,t,n),eventPrefix:_v(e,t,n),expiryTime:hy.STANDARD,callback:r,errorCallback:i})}},{key:"createLevel",value:function(e,t,n){return this.create({resource:mv(),data:e,callback:t,errorCallback:n,eventPrefix:o.LEVEL,invalidationKeys:[o.LEVELS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully created level."),errorHandler:this.alertService.error("Failed to create level.")})}},{key:"updateLevel",value:function(e,t,n,r){return this.update({resource:hv(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(o.UPDATE_LEVEL,":").concat(e),invalidationKeys:["".concat(o.LEVEL,":").concat(e),o.LEVELS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully updated level."),errorHandler:this.alertService.error("Failed to save level.")})}},{key:"getObjectLevels",value:function(e,t,n,r){return this.get({resource:yv(e),eventPrefix:"".concat(t,":").concat(e,":").concat(o.LEVELS),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectLevels",value:function(e,t,n,r,i,a){var c=Cy.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(o.LEVELS)];return r&&s.push("".concat(n,":").concat(e,":").concat(o.AUDIENCES)),this.update({resource:vv(e,r),data:t,callback:i,errorCallback:a,eventPrefix:"".concat(o.UPDATE_OBJECT_LEVELS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(c," levels.")),errorHandler:this.alertService.error("Failed to update ".concat(c," levels."))})}},{key:"addObjectsToLevel",value:function(e,t,n,r,i,a){var c=1===t.length?Iy.singularizeMemberType(n):n,s=["".concat(o.LEVEL,":").concat(e,":").concat(n)].concat(_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.LEVELS)}))),_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.AUDIENCES)}))));return this.create({resource:bv(e,r),data:t,callback:i,errorCallback:a,eventPrefix:"".concat(o.ADD_TO_LEVEL,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(c," to level.")),errorHandler:this.alertService.error("Failed to add ".concat(c," to level."))})}},{key:"removeObjectsFromLevel",value:function(e,t,n,r,i){var a=1===t.length?Iy.singularizeMemberType(n):n,c=["".concat(o.LEVEL,":").concat(e,":").concat(n)].concat(_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.LEVELS)}))));return this.delete({resource:gv(e,t),callback:r,errorCallback:i,eventPrefix:"".concat(o.REMOVE_FROM_LEVEL,":").concat(e,":").concat(n),invalidationKeys:c,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(a," from level.")),errorHandler:this.alertService.error("Failed to remove ".concat(a," from level."))})}},{key:"getAudiences",value:function(e,t,n){return this.get({resource:Sv(e),callback:t,errorCallback:n,eventPrefix:"".concat(o.AUDIENCES,":").concat(e),expiryTime:hy.STANDARD})}},{key:"getAudience",value:function(e,t,n){return this.get({resource:Ev(e),callback:t,errorCallback:n,eventPrefix:"".concat(o.AUDIENCE,":").concat(e),expiryTime:hy.STANDARD})}},{key:"getAudienceMembers",value:function(e,t,n,r){return this.get({resource:Ov(e,t),eventPrefix:"".concat(o.AUDIENCE,":").concat(e,":").concat(t),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"createAudience",value:function(e,t,n){return this.create({resource:Cv(),data:e,callback:t,errorCallback:n,eventPrefix:o.AUDIENCE,invalidationKeys:[o.AUDIENCES],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully created audience."),errorHandler:this.alertService.error("Failed to create audience.")})}},{key:"updateAudience",value:function(e,t,n,r){return this.update({resource:wv(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(o.UPDATE_AUDIENCE,":").concat(e),invalidationKeys:["".concat(o.AUDIENCE,":").concat(e),o.AUDIENCES],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully updated audience."),errorHandler:this.alertService.error("Failed to update audience.")})}},{key:"deleteAudience",value:function(e,t,n){return this.delete({resource:Av(e),callback:t,errorCallback:n,eventPrefix:o.DELETE_AUDIENCE,invalidationKeys:["".concat(o.AUDIENCE,":").concat(e),o.AUDIENCES],successHandler:this.alertService.success("Successfully deleted audience"),errorHandler:this.alertService.error("Failed to delete audience")})}},{key:"getObjectAudiences",value:function(e,t,n,r){return this.get({resource:jv(e),eventPrefix:"".concat(t,":").concat(e,":").concat(o.AUDIENCES),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectAudiences",value:function(e,t,n,r,i,a){var c=Cy.singularizeMemberType(r);return this.update({resource:Tv(e,t),data:n,callback:i,errorCallback:a,eventPrefix:"".concat(o.UPDATE_OBJECT_AUDIENCES,":").concat(e),invalidationKeys:["".concat(r,":").concat(e,":").concat(o.AUDIENCES)],successHandler:this.alertService.success("Successfully updated ".concat(c," audiences.")),errorHandler:this.alertService.error("Failed to update ".concat(c," audiences."))})}},{key:"addObjectsToAudience",value:function(e,t,n,r,i,a,c){var s=1===t.length?Iy.singularizeMemberType(n):n,u=["".concat(o.AUDIENCE,":").concat(e,":").concat(n)];return r&&u.push(_v(r,i,n)),u.push.apply(u,_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.AUDIENCES)})))),this.create({resource:kv(e),data:t,callback:a,errorCallback:c,eventPrefix:"".concat(o.ADD_TO_AUDIENCE,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(s," to audience.")),errorHandler:this.alertService.error("Failed to add ".concat(s," to audience."))})}},{key:"removeObjectsFromAudience",value:function(e,t,n,r,i,a,c){var s=1===t.length?Iy.singularizeMemberType(n):n,u=["".concat(o.AUDIENCE,":").concat(e,":").concat(n)];return r&&u.push(_v(r,i,n)),u.push.apply(u,_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.AUDIENCES)})))),this.delete({resource:Iv(e,t),callback:a,errorCallback:c,eventPrefix:"".concat(o.REMOVE_FROM_AUDIENCE,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(s," from audience.")),errorHandler:this.alertService.error("Failed to remove ".concat(s," from audience."))})}}])&&Ny(t.prototype,n),r&&Ny(t,r),a}(dy),xv={dataServiceName:u.SUBJECT,dataChannelName:s.SUBJECT},Nv={getSubjectTreeFetchOptions:function(e,t){return Object.assign(Object.assign({},xv),{eventPrefix:o.SUBJECTS,fetchData:function(e){return e.getSubjectTree()},setData:e,onError:t})},getSubjectFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.SUBJECT,":").concat(e),fetchData:function(t){return t.getSubject(e)},setData:t,onError:n,deleteEventPrefix:o.DELETE_SUBJECT})},getSubjectMemberIdsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.SUBJECT,":").concat(e,":").concat(t),fetchData:function(n){return n.getSubjectMemberIds(e,t)},setData:n,onError:r})},getSubjectClassificationFetchOptions:function(e,t,n,r,i){return Object.assign(Object.assign({},xv),{eventPrefix:Lv(e,n,r),fetchData:function(t){return t.getSubjectClassifications(e,n,r)},setData:t,onError:i})},getObjectSubjectsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(t,":").concat(e,":").concat(o.SUBJECTS),fetchData:function(n){return n.getObjectSubjects(e,t)},setData:n,onError:r})},getPresentationsFetchOptions:function(e,t){return Object.assign(Object.assign({},xv),{eventPrefix:o.PRESENTATIONS,fetchData:function(e){return e.getPresentations()},setData:e,onError:t})},getPresentationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.PRESENTATION,":").concat(e),fetchData:function(t){return t.getPresentation(e)},setData:t,onError:n})},getClassificationTreeFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.CLASSIFICATIONS,":").concat(e),fetchData:function(t){return t.getClassificationTree(e)},setData:t,onError:n})},getClassificationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.CLASSIFICATION,":").concat(e),fetchData:function(t){return t.getClassification(e)},setData:t,onError:n,deleteEventPrefix:o.DELETE_CLASSIFICATION})},getClassificationMembersFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.CLASSIFICATION,":").concat(e,":").concat(t),fetchData:function(n){return n.getClassificationMembers(e,t)},setData:n,onError:r})},getObjectClassificationsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(t,":").concat(e,":").concat(o.CLASSIFICATIONS),fetchData:function(n){return n.getObjectClassifications(e,t)},setData:n,onError:r})},getLevelsFetchOptions:function(e,t){return Object.assign(Object.assign({},xv),{eventPrefix:o.LEVELS,fetchData:function(e){return e.getLevels()},setData:e,onError:t})},getLevelFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.LEVEL,":").concat(e),fetchData:function(t){return t.getLevel(e)},setData:t,onError:n})},getLevelMemberIdsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.LEVEL,":").concat(e,":").concat(t),fetchData:function(n){return n.getLevelMemberIds(e,t)},setData:n,onError:r})},getLevelAudiencesFetchOptions:function(e,t,n,r,i){return Object.assign(Object.assign({},xv),{eventPrefix:_v(e,n,r),fetchData:function(t){return t.getLevelAudiences(e,n,r)},setData:t,onError:i})},getObjectLevelsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(t,":").concat(e,":").concat(o.LEVELS),fetchData:function(n){return n.getObjectLevels(e,t)},setData:n,onError:r})},getAudiencesFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.AUDIENCES,":").concat(e),fetchData:function(t){return t.getAudiences(e)},setData:t,onError:n})},getAudienceFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.AUDIENCE,":").concat(e),fetchData:function(t){return t.getAudience(e)},setData:t,onError:n})},getAudienceMembersFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.AUDIENCE,":").concat(e,":").concat(t),fetchData:function(n){return n.getAudienceMembers(e,t)},setData:n,onError:r})},getObjectAudiencesFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(t,":").concat(e,":").concat(o.AUDIENCES),fetchData:function(n){return n.getObjectAudiences(e,t)},setData:n,onError:r})}},Rv=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[e.id]}},Dv=function(e,t){var n=e.backboneAudienceIds;return t.filter((function(e){return n.includes(e.id)}))};function Mv(e){var t=e.showLevels;return l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,"Audiences"),!!t&&l.createElement("th",null,"Mapped Backbone Audience(s)")))}function Uv(e){var t,n=e.audience,r=e.levels;return l.createElement("tr",null,l.createElement("td",null,l.createElement(Pu,{appLink:(t=n,{application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[t.presentationId,t.masterId]})},n.name)),l.createElement("td",null,r.map((function(e){return l.createElement(Pu,{key:e.id,appLink:Rv(e),className:"mr-2"},e.name)}))))}function Fv(e){var t=e.audiences,n=e.levels;return l.createElement(Ii.Table,{responsive:!0,bordered:!0},l.createElement(Mv,{showLevels:!!t.length}),l.createElement("tbody",null,t.length?t.map((function(e){return l.createElement(Uv,{key:e.masterId,audience:e,levels:Dv(e,n)})})):l.createElement("tr",null,l.createElement("td",null,"This presentation has no audiences."))))}function Vv(e){var t=null===e.masterId||void 0===e.masterId,n=si(),r=us(n);return l.createElement(bi,null,l.createElement(as,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this audience",autoFocus:!0}),l.createElement(as,{label:"Mapped Level(s)",as:"select",name:"backboneAudienceIds",id:"level-ids",multiple:!0,size:e.levels.length,value:n.values.backboneAudienceIds},e.levels.map((function(e){return l.createElement("option",{key:e.id,value:e.id},e.name)}))),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(Pf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&l.createElement(Ii.Button,{as:Pu,variant:"danger",appLink:{application:c.SUBJECTS,action:i.Subjects.DELETE_AUDIENCE,args:[e.presentationId,e.masterId]}},"Delete")))}function Bv(e){return l.createElement(ji,{initialValues:e.audience,validationSchema:by,onSubmit:e.saveAudience},l.createElement(Vv,{masterId:e.audience&&e.audience.masterId,presentationId:e.presentationId,levels:e.levels}))}function Hv(e){var t=e.objectAudiences,n=e.presentationAudiences;return t.filter((function(e){return n.some((function(t){return t.masterId===e.masterId}))}))}function zv(e){var t,n,r,i,o,a=Cy.singularizeMemberType(e.memberType),c=(n=(t=e).presentationAudiences,r=t.objectLevels,i=t.objectAudiences,o=r.map((function(e){return e.id})),n.filter((function(e){return Hp.a.intersection(e.backboneAudienceIds,o).length||i.some((function(t){return t.masterId===e.masterId}))})));return l.createElement(l.Fragment,null,l.createElement("div",{className:"border-bottom pb-3 mb-3"},l.createElement("h6",null,"Backbone Audiences"),l.createElement("p",null,"Select which backbone audiences this ".concat(a," is mapped to.")),l.createElement("p",null,"To see how backbone audiences correspond to audiences, scroll down to the audience-backbone audience mappings table."),l.createElement(mb,{initialValues:{backboneAudienceIds:e.objectLevels.map((function(e){return e.id}))},saveLevels:e.saveLevels,levels:e.levels,memberType:e.memberType})),l.createElement("h6",null,"Audiences"),l.createElement("p",null,"Select a presentation to view its audiences and map them to this ".concat(a,".")),l.createElement("div",{className:"w-50 pb-3"},l.createElement(jb,{presentations:e.presentations,currentPresentationId:e.currentPresentation.id,setCurrentPresentation:e.setCurrentPresentation})),l.createElement("p",null,"Audience to backbone audience mappings for this presentation are displayed below."),l.createElement(Fv,{levels:e.levels,audiences:e.presentationAudiences}),l.createElement("p",null,"Only the audiences which are mapped to a backbone audience that this"+" ".concat(a," is mapped to are displayed below.")),!!c.length&&l.createElement(Jv,{initialValues:{audienceIds:Hv(e).map((function(e){return e.masterId}))},saveAudiences:e.saveAudiences,audiences:c}))}function qv(e){var t=si(),n=us(t);return l.createElement(bi,null,l.createElement(as,{label:"Audience(s)",as:"select",name:"audienceIds",id:"audience-ids",multiple:!0,size:e.audiences.length,value:t.values.audienceIds},e.audiences.map((function(e){return l.createElement("option",{key:e.masterId,value:e.masterId},e.name)}))),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(Pf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Audiences")))}function Jv(e){return l.createElement(ji,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.audienceIds;return e.saveAudiences(r,n)},enableReinitialize:!0},l.createElement(qv,{audiences:e.audiences}))}var $v=function(e){return function(t){if(!e)return t.appLink.action===i.Subjects.EDIT_AUDIENCE;switch(e){case ly.Playlists:return t.appLink.action===i.Subjects.EDIT_AUDIENCE_PLAYLISTS;case ly.Series:return t.appLink.action===i.Subjects.EDIT_AUDIENCE_SERIES;case ly.Videos:return t.appLink.action===i.Subjects.EDIT_AUDIENCE_VIDEOS}}};function Kv(e){var t=e.presentation,n=e.audienceId,r=e.memberType;return t?l.createElement(l.Fragment,null,l.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:ky(t.id,n),isItemActive:$v(r)}))):l.createElement(l.Fragment,null)}function Wv(e){var t=e.item,n=e.getItemAppLink,r=e.actions;return l.createElement("tr",null,l.createElement("td",null,l.createElement(Pu,{appLink:n(t)},t.name)),r&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(Dl,{actions:r}))))}function Yv(e){var t=e.items,n=e.memberType,r=e.getItemAppLink,i=e.getActions;if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this audience."));var o="".concat(zl(Iy.singularizeMemberType(n))," Name");return l.createElement(Ii.Table,{responsive:!0},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,o),h(i)&&l.createElement("th",null))),l.createElement("tbody",null,t.map((function(e){return l.createElement(Wv,{item:e,key:e.id,getItemAppLink:r,actions:h(i)&&i(e)})}))))}function Gv(e){var t=e.item,n=e.getItemAppLink,r=e.actions,i=e.pinState;return l.createElement("tr",null,l.createElement("td",null,l.createElement(Pu,{appLink:n(t)},t.name)),i.isPinnable&&l.createElement("td",null,l.createElement(Bu,{selected:parseInt(t.id)===parseInt(i.currentPinnedVideo),onToggle:function(e){return i.onChange(e,t.id)},id:t.id})),r&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(Dl,{actions:r}))))}function Zv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tb(e){var t=e.items,n=e.memberType,r=e.classification,i=e.getItemAppLink,o=e.getActions,a=e.updatePinnedVideo,c=Xv(l.useState(!1),2),s=c[0],u=c[1],f=function(e,t){var n=e.pinnedVideoMasterId||null,r=Zv(l.useState(n),2),i=r[0],o=r[1];return{currentPinnedVideo:i,onChange:function(e,t){o(e?t:null)},canSubmit:n!==i,isPinnable:t===uy.Videos}}(r,n);if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this classification."));var p="".concat(zl(Cy.singularizeMemberType(n))," Name");return l.createElement(l.Fragment,null,l.createElement(Ii.Table,{responsive:!0},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,p),f.isPinnable&&l.createElement("th",null,"Pinned"),h(o)&&l.createElement("th",null))),l.createElement("tbody",null,t.map((function(e){return l.createElement(Gv,{item:e,key:e.id,getItemAppLink:i,actions:h(o)&&o(e),pinState:f})})))),f.isPinnable&&l.createElement(Pf,{showSpinner:s,onClick:function(){u(!0),a(f.currentPinnedVideo,(function(){return u(!1)}))},disabled:!f.canSubmit||s},"Save"))}function nb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ib=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[e]}};function ob(e){var t,n,r,o,a,s=si(),u=us(s),f=null===(null===(t=e.classification)||void 0===t?void 0:t.id)||void 0===(null===(n=e.classification)||void 0===n?void 0:n.id),p=!f||!(!s.values.parentIds||!s.values.parentIds.length),d=nb(l.useState(p),2),m=d[0],h=d[1];l.useEffect((function(){return h(p)}),[null===(r=e.classification)||void 0===r?void 0:r.id,s.values.parentIds]),l.useEffect((function(){s.values.backboneClassificationIds.length&&!s.touched.backboneClassificationIds&&s.setFieldTouched("backboneClassificationIds",!0)}),[s.values.backboneClassificationIds]);var y=function(e){return s.setFieldValue("parentIds",Hp.a.addOrRemove(s.values.parentIds.map((function(e){return e.toString()})),e.id.toString()))},v=function(e){return s.setFieldValue("backboneClassificationIds",Hp.a.addOrRemove(s.values.backboneClassificationIds.map((function(e){return e.toString()})),e.id.toString()))},b=function(e){return"".concat(Li(s.errors,s.touched,e)," h-auto py-2")},g=td(e.currentUser);return l.createElement(bi,null,l.createElement(as,{label:"Name",name:"name",id:"name",value:s.values.name,placeholder:"Enter a name for this classification",autoFocus:!0}),l.createElement(as,{as:"select",label:"Type",name:"type",id:"type",value:s.values.type},wi.a.getEnumKeys(yy).map((function(e){return l.createElement("option",{key:e,value:yy[e]},e)}))),l.createElement(as,{as:"select",label:"Status",name:"status",id:"status",value:s.values.status,disabled:f},wi.a.getEnumKeys(vy).map((function(e){return l.createElement("option",{key:e,value:vy[e]},e)}))),l.createElement(as,{label:"Emphasize",name:"emphasize",id:"emphasize",type:"checkbox",checked:s.values.emphasize}),l.createElement(as,{label:"Can Be Preferred",name:"canBePreferred",id:"canBePreferred",type:"checkbox",checked:s.values.canBePreferred}),!f&&l.createElement(l.Fragment,null,l.createElement("label",null,"Total Followers:")," ",null===(o=e.classification.followers)||void 0===o?void 0:o.count),l.createElement(as,{name:"parentIds"},(function(){var t,n,r;return l.createElement("div",{className:b("parentIds")},l.createElement(sf,{label:"Parent Classification(s)",tree:e.classificationTree,selectedIds:s.values.parentIds,onSelect:y,collapse:m,noSelectionMessage:"No parent selected, this will be a root classification.",isNodeDisabled:(n=e.classificationTree,r=null===(t=e.classification)||void 0===t?void 0:t.id,function(e){if(e.id===r)return!0;var t=$l.find(n,r);return!!$l.find(t,e.id)})}))})),l.createElement(as,{name:"backboneClassificationIds"},(function(){return l.createElement("div",{className:b("backboneClassificationIds")},l.createElement(sf,{label:"Mapped Subject(s)",tree:e.subjectTree,selectedIds:s.values.backboneClassificationIds,onSelect:v,collapse:!f,getSelectedItemAppLink:ib}))})),l.createElement(Sl,{imageType:Mu.Covers,fieldName:"cover",application:c.SUBJECTS,uploadAction:i.Subjects.UPLOAD_IMAGE}),l.createElement(Sl,{imageType:Mu.Banners,fieldName:"banner",application:c.SUBJECTS,uploadAction:i.Subjects.UPLOAD_IMAGE}),l.createElement(Sl,{imageType:Mu.TallPosters,fieldName:"tallPoster",application:c.SUBJECTS,uploadAction:i.Subjects.UPLOAD_IMAGE}),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(Pf,{showSpinner:s.isSubmitting,type:"submit",disabled:!u},f?"Create":"Save"),!f&&g&&l.createElement(Ii.Button,{as:Pu,variant:"danger",appLink:{application:c.SUBJECTS,action:i.Subjects.DELETE_CLASSIFICATION,args:[e.presentationId,null===(a=e.classification)||void 0===a?void 0:a.id]}},"Delete")))}function ab(e){return l.createElement(ji,{initialValues:e.classification,validationSchema:gy,onSubmit:e.saveClassification},l.createElement(ob,{presentationId:e.presentationId,classificationTree:e.classificationTree,subjectTree:e.subjectTree,classification:e.classification,currentUser:e.currentUser}))}var cb=function(e){return function(t){if(!e)return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION;switch(e){case uy.Playlists:return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;case uy.Series:return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION_SERIES;case uy.Videos:return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION_VIDEOS}}};function sb(e){var t=e.presentation,n=e.classificationId,r=e.memberType;return t?l.createElement(l.Fragment,null,l.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:jy(t.id,n),isItemActive:cb(r)}))):l.createElement(l.Fragment,null)}function ub(e){var t=si(),n=us(t),r=function(e){return t.setFieldValue("classificationIds",Hp.a.addOrRemove(t.values.classificationIds.map((function(e){return e.toString()})),e.id.toString()))},o="".concat(Li(t.errors,t.touched,"classificationIds")," h-auto py-2");return l.createElement(bi,null,l.createElement(as,{name:"classificationIds"},(function(){return l.createElement("div",{className:o},l.createElement(sf,{label:"Mapped Classification(s)",tree:e.classificationTree,selectedIds:t.values.classificationIds,onSelect:r,getSelectedItemAppLink:(n=e.presentationId,function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[n,e]}}),isNodeDisabled:e.isClassificationDisabled}));var n})),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(Pf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Classifications")))}function lb(e){return l.createElement(ji,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.classificationIds;return e.saveClassifications(r,n)},enableReinitialize:!0},l.createElement(ub,{presentationId:e.presentationId,classificationTree:e.classificationTree,isClassificationDisabled:e.isClassificationDisabled}))}function fb(e){var t=null===e.id||void 0===e.id,n=si(),r=us(n);return l.createElement(bi,null,l.createElement(as,{label:"Name",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this level",autoFocus:!0}),l.createElement(Pf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"))}function pb(e){return l.createElement(ji,{initialValues:e.level,validationSchema:Sy,onSubmit:e.saveLevel},l.createElement(fb,{id:e.level&&e.level.id}))}function db(e){var t=Cy.singularizeMemberType(e.memberType),n=si(),r=us(n);return l.createElement(bi,null,l.createElement(as,{label:"Backbone Audience(s)",as:"select",name:"backboneAudienceIds",id:"level-ids",multiple:!0,size:e.levels.length,value:n.values.backboneAudienceIds},e.levels.map((function(e){return l.createElement("option",{key:e.id,value:e.id},e.name)}))),l.createElement("p",null,l.createElement("strong",null,"Note:")," When removing a ".concat(t," from a backbone audience, that backbone audience's mapped audiences "),l.createElement("strong",null,"will not")," be automatically removed from."),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(Pf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},"Save Backbone Audience")))}function mb(e){return l.createElement(ji,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.backboneAudienceIds;return e.saveLevels(r,!1,n)}},l.createElement(db,{levels:e.levels,memberType:e.memberType}))}var hb=function(e){return function(t){return t.appLink.action===e}};function yb(e){var t=e.levelId,n=e.activeAction,r=e.presentationId;return l.createElement(l.Fragment,null,l.createElement(Ii.Alert,{variant:"danger"},"Warning: You are editing the backbone audiences."),l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:Ty(t,r),isItemActive:hb(n)})))}var vb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function bb(e){return l.createElement(l.Fragment,null,e.audiences.map((function(t){return l.createElement("th",{key:t.masterId},l.createElement("span",{className:"d-inline-block"},l.createElement(Bu,{selected:e.getIsAudienceSelected(t),onToggle:function(n){return e.onToggleAudience(t.masterId,n)}})),l.createElement(Pu,{appLink:e.getAudienceAppLink(t.masterId)},function(e,t){return t?e.name:"Audience: ".concat(e.name)}(t,e.showAudienceSubHeader)))})))}function gb(e){var t=e.memberType,n=e.hasActions,r=e.audiences,i=vb(e,["memberType","hasActions","audiences"]),o="".concat(zl(Iy.singularizeMemberType(t))," Name"),a=!!r&&!!r.length,c=a&&r.length>1,s=a?2:1,u=Object.assign({audiences:r,showAudienceSubHeader:c},i);return l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{rowSpan:s},o),a&&(c?l.createElement("th",{colSpan:r.length,className:"text-center"},"Audiences"):l.createElement(bb,Object.assign({},u))),n&&l.createElement("th",{rowSpan:s})),a&&c&&l.createElement("tr",null,l.createElement(bb,Object.assign({},u))))}function Sb(e){var t=e.member,n=t.id,r=t.name,i=t.audiences,o=void 0===i?[]:i,a=e.getMemberAppLink,c=e.onToggleAudience,s=e.actions,u=h(a)&&a(n);return o.length&&!h(c)&&p.ErrorHelper.throw(new ys.a("onToggleAudience must be passed to LevelMemberItem")),l.createElement("tr",null,l.createElement("td",null,u?l.createElement(Pu,{appLink:a(n)},r):r),!!o.length&&o.map((function(e){return l.createElement("td",{key:e.id},l.createElement(Bu,{selected:e.selected,onToggle:function(t){return c(e.id,t,n)}}))})),s&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(Dl,{actions:s}))))}var Eb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Ob(e,t){return function(n){var r=n[e],i=df.length(r);return!!i&&i===t.length}}function Cb(e){var t=e.members,n=e.memberType,r=e.getActions,i=e.audiences,o=e.getAudienceAppLink,a=e.onToggleAudience,c=Eb(e,["members","memberType","getActions","audiences","getAudienceAppLink","onToggleAudience"]);if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this level."));var s=h(r),u={memberType:n,audiences:i,getAudienceAppLink:o,getIsAudienceSelected:Ob(n,t),onToggleAudience:a,hasActions:s};return l.createElement(Ii.Table,{responsive:!0,bordered:!0},l.createElement(gb,Object.assign({},u)),l.createElement("tbody",null,t.map((function(e,t){return l.createElement(Sb,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleAudience:a},c))}))))}function wb(e){var t=si();return l.createElement(bi,null,l.createElement(as,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this presentation",autoFocus:!0}),l.createElement(as,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this presentation here"}),l.createElement(as,{as:"select",label:"Status",name:"status",id:"status",value:t.values.status,disabled:e.isNew},wi.a.getEnumKeys(Qp).map((function(e){return l.createElement("option",{key:e,value:Qp[e]},e)}))),l.createElement("div",{className:"btn-container d-flex justify-content-end"},l.createElement(Is,{isNew:e.isNew})))}function Ab(e){var t;return l.createElement(ji,{initialValues:e.presentation,validationSchema:Ey,onSubmit:e.savePresentation},l.createElement(wb,{isNew:!(null===(t=e.presentation)||void 0===t?void 0:t.id)}))}function jb(e){var t=e.presentations,n=e.currentPresentationId,r=e.setCurrentPresentation,i=e.label,o=function(e){var n=function(e,t){return Hp.a.first(t.filter((function(t){return t.id.toString()===e.toString()})))}(e,t);r(n)};return l.useEffect((function(){t&&!n&&r(Hp.a.first(t))}),[t]),l.createElement(l.Fragment,null,!!n&&l.createElement(l.Fragment,null,l.createElement(Ii.Form.Label,null,i),l.createElement(Ii.Form.Control,{as:"select",value:n,onChange:function(e){return o(e.target.value)},className:"cursor-pointer"},t.map((function(e){return l.createElement("option",{value:e.id,key:e.id},e.name)})))))}function Tb(e){return l.createElement(l.Fragment,null,l.createElement("h4",null,"".concat(zl(e.memberType))),l.createElement(Ii.Table,{responsive:!0},l.createElement("tbody",null,e.objects&&e.objects.map((function(t){return l.createElement("tr",{key:t.id},l.createElement("td",null,l.createElement(Pu,{appLink:Cy.getMemberAppLink(e.memberType,t.id)},t.name)))})))),l.createElement(Fb,{initialValues:{backboneClassificationIds:[]},subjectTree:e.subjectTree,saveSubjects:e.onClickAddToSubject,memberType:e.memberType,saveBtnText:"Add to backbone classification",subjectRequired:!0}))}function kb(e){return function(e){if(Array.isArray(e))return Ib(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ib(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ib(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ib(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lb(e){var t=Cy.singularizeMemberType(e.memberType),n=[].concat(kb(e.objectClassifications),kb(e.objectSubjectClassifications)).map((function(e){return e.id}));return l.createElement(l.Fragment,null,l.createElement("div",{className:"border-bottom pb-3 mb-3"},l.createElement("h6",null,"Backbone Classifications"),l.createElement("p",null,"Select which backbone classifications this ".concat(t," is mapped to.")),l.createElement(Fb,{initialValues:{backboneClassificationIds:e.objectSubjects.map((function(e){return e.id}))},subjectTree:e.subjectTree,saveSubjects:e.saveSubjects,memberType:e.memberType,saveBtnText:"Save Backbone Classifications",allowMultiple:!0})),l.createElement("h6",null,"Classifications"),l.createElement("p",null,"Select a presentation to view its classifications and map them to this ".concat(t,".")),l.createElement("div",{className:"w-50 pb-3"},l.createElement(jb,{presentations:e.presentations,currentPresentationId:e.currentPresentation.id,setCurrentPresentation:e.setCurrentPresentation})),e.currentPresentation&&e.classificationTree&&e.classificationTree.children.length?l.createElement(l.Fragment,null,l.createElement("p",null,"Only classifications which are mapped to one of the backbone classifications selected above can be selected."),l.createElement(lb,{initialValues:{classificationIds:e.objectClassifications.map((function(e){return e.id}))},presentationId:e.currentPresentation.id,classificationTree:e.classificationTree,saveClassifications:e.saveClassifications,isClassificationDisabled:function(e){return!n.includes(e.id)}})):l.createElement("p",null,"This presentation has no classifications."))}function _b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}jb.defaultProps={label:"Presentation"};function xb(e){var t=!e.id,n=si(),r=us(n),o=!t||!!n.values.parentId,a=_b(l.useState(o),2),s=a[0],u=a[1];l.useEffect((function(){return u(o)}),[e.id,n.values.parentId]);var f=function(e){var t=e.id===n.values.parentId?null:e.id;n.setFieldValue("parentId",t)},p="".concat(Li(n.errors,n.touched,"parentId")," h-auto py-2");return l.createElement(bi,null,l.createElement(as,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this backbone classification",autoFocus:!0}),l.createElement(as,{name:"parentId"},(function(){return l.createElement("div",{className:p},l.createElement(sf,{label:"Parent Backbone Classification",tree:e.subjectTree,selectedIds:[n.values.parentId],onSelect:f,collapse:s,noSelectionMessage:"No parent selected, this will be a root backbone classification.",isNodeDisabled:(t=e.subjectTree,r=e.id,function(e){if(e.id===r)return!0;var n=$l.find(t,r);return!!$l.find(n,e.id)})}));var t,r})),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(Pf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&l.createElement(Ii.Button,{as:Pu,variant:"danger",appLink:{application:c.SUBJECTS,action:i.Subjects.DELETE_SUBJECT,args:[e.id]}},"Delete")))}function Nb(e){return l.createElement(ji,{initialValues:e.subject,validationSchema:Oy,onSubmit:e.saveSubject},l.createElement(xb,{id:e.subject&&e.subject.id,subjectTree:e.subjectTree}))}var Rb=function(e){return function(t){return t.appLink.action===e}};function Db(e){var t=e.subjectId,n=e.activeAction,r=e.presentationId;return l.createElement(l.Fragment,null,l.createElement(Ii.Alert,{variant:"danger"},"Warning: You are editing the backbone classifications."),l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:Ay(t,r),isItemActive:Rb(n)})))}var Mb=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[e]}};function Ub(e){var t=si(),n=us(t),r=function(n){var r=e.allowMultiple?Hp.a.addOrRemove(t.values.backboneClassificationIds.map((function(e){return e.toString()})),n.id.toString()):[n.id];t.setFieldValue("backboneClassificationIds",r)},i="".concat(Li(t.errors,t.touched,"backboneClassificationIds")," h-auto py-2");return l.createElement(bi,null,l.createElement(as,{name:"backboneClassificationIds"},(function(){return l.createElement("div",{className:i},l.createElement(sf,{label:"Mapped Backbone Classification".concat(e.allowMultiple?"(s)":""),tree:e.subjectTree,selectedIds:t.values.backboneClassificationIds,onSelect:r,collapse:!!t.initialValues.backboneClassificationIds.length,getSelectedItemAppLink:Mb}))})),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(Pf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.saveBtnText)))}function Fb(e){var t;return l.createElement(ji,{initialValues:e.initialValues,validationSchema:(t=e.subjectRequired,Ti.object().shape({backboneClassificationIds:t?Ti.array().of(Ti.string()).min(1,"A subject is required").required("A subject is required"):Ti.array().of(Ti.string())}).noUnknown()),onSubmit:function(t,n){var r=t.backboneClassificationIds;return e.saveSubjects(r,!1,n)}},l.createElement(Ub,{subjectTree:e.subjectTree,memberType:e.memberType,allowMultiple:e.allowMultiple,saveBtnText:e.saveBtnText}))}Ub.defaultProps={saveBtnText:"Save"};var Vb=function(e){return l.createElement("div",{className:"border rounded p-2 mb-3"},l.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.classifications&&e.classifications.length?l.createElement("ul",{className:"list-unstyled mb-0"},e.classifications.map((function(t){return l.createElement("li",{key:t.id,className:"py-1"},l.createElement(Pu,{appLink:(n=e.presentation.id,r=t.id,{application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[n,r]})},t.name));var n,r}))):l.createElement("p",null,l.createElement("em",null,"There are no classifications mapped to this backbone classification in this presentation.")))},Bb=function(e){return l.createElement(l.Fragment,null,!!e.presentations&&!!e.classificationDictionary&&e.presentations.map((function(t){return l.createElement(Vb,{key:t.id,presentation:t,classifications:e.classificationDictionary[t.id]})})))},Hb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function zb(e){return l.createElement(l.Fragment,null,e.classifications.map((function(t){return l.createElement("th",{key:t.id},l.createElement("span",{className:"d-inline-block"},l.createElement(Bu,{selected:e.getIsClassificationSelected(t),onToggle:function(n){return e.onToggleClassification(t.id,n)}})),l.createElement(Pu,{appLink:e.getClassificationAppLink(t.id)},function(e,t){return t?e.name:"Classification: ".concat(e.name)}(t,e.showClassificationSubHeader)))})))}function qb(e){var t=e.memberType,n=e.hasActions,r=e.classifications,i=Hb(e,["memberType","hasActions","classifications"]),o="".concat(zl(Cy.singularizeMemberType(t))," Name"),a=!!r&&!!r.length,c=a&&r.length>1,s=a?2:1,u=Object.assign({classifications:r,showClassificationSubHeader:c},i);return l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{rowSpan:s},o),a&&(c?l.createElement("th",{colSpan:r.length,className:"text-center"},"Classifications"):l.createElement(zb,Object.assign({},u))),n&&l.createElement("th",{rowSpan:s})),a&&c&&l.createElement("tr",null,l.createElement(zb,Object.assign({},u))))}function Jb(e){var t=e.member,n=t.id,r=t.name,i=t.classifications,o=void 0===i?[]:i,a=e.getMemberAppLink,c=e.onToggleClassification,s=e.actions,u=h(a)&&a(n);return o.length&&!h(c)&&p.ErrorHelper.throw(new ys.a("onToggleClassification must be passed to SubjectMemberItem")),l.createElement("tr",null,l.createElement("td",null,u?l.createElement(Pu,{appLink:a(n)},r):r),!!o.length&&o.map((function(e){return l.createElement("td",{key:e.id},l.createElement(Bu,{selected:e.selected,onToggle:function(t){return c(e.id,t,n)}}))})),s&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(Dl,{actions:s}))))}var $b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Kb(e,t){return function(n){var r=n[e],i=df.length(r);return!!i&&i===t.length}}function Wb(e){var t=e.members,n=e.memberType,r=e.getActions,i=e.classifications,o=e.getClassificationAppLink,a=e.onToggleClassification,c=$b(e,["members","memberType","getActions","classifications","getClassificationAppLink","onToggleClassification"]);if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this backbone classification."));var s=h(r),u={memberType:n,classifications:i,getClassificationAppLink:o,getIsClassificationSelected:Kb(n,t),onToggleClassification:a,hasActions:s};return l.createElement(Ii.Table,{responsive:!0,bordered:!0},l.createElement(qb,Object.assign({},u)),l.createElement("tbody",null,t.map((function(e,t){return l.createElement(Jb,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleClassification:a},c))}))))}function Yb(e){var t=e.navItems,n=e.currentAppLink;return l.createElement(Ii.Container,null,l.createElement(Ii.Navbar,{className:"justify-content-between align-items-center"},l.createElement(Ii.Nav,null,!!t&&t.map((function(e,t){return l.createElement(Ii.Nav.Item,{key:t},l.createElement(Pu,{appLink:e.appLink,className:"nav-link".concat(Vl.isItemActive(e,n)?" text-primary":"")},e.label))})))))}function Gb(e,t){l.useEffect((function(){e.presentations&&!e.currentPresentation&&Qh(t,"currentPresentation")(Hp.a.first(e.presentations))}),[e.presentations])}function Zb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xb(e){var t=ce.useBasicFetch(bh(e.playlistId)),n=ce.useBasicFetch(Bp()),r=Zb(l.useState({}),2),o=r[0],a=r[1],c=mp(u.SUBJECT);!function(e,t,n){var r=function(e){return Qh(n,e)};$h([Nv.getObjectLevelsFetchOptions(e,uy.Playlists,r("playlistLevels"))],[e]),Zh(Nv.getObjectAudiencesFetchOptions(e,uy.Playlists,r("playlistAudiences")),[e,t.playlistLevels]),$h([Nv.getPresentationsFetchOptions(r("presentations")),Nv.getLevelsFetchOptions(r("levels"))],[]),Zh(!!t.currentPresentation&&Nv.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.playlistId,o,a),Gb(o,a);var s=!!(o.presentations&&o.levels&&o.presentationAudiences&&o.playlistLevels&&o.playlistAudiences);return l.createElement(l.Fragment,null,!!n.data&&l.createElement(Uh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_AUDIENCES,currentUser:n.data}),l.createElement(Ml,{object:t.data}),!!s&&l.createElement(zv,{objectLevels:o.playlistLevels,objectAudiences:o.playlistAudiences,presentations:o.presentations,currentPresentation:o.currentPresentation,setCurrentPresentation:Qh(a,"currentPresentation"),levels:o.levels,presentationAudiences:o.presentationAudiences,memberType:uy.Playlists,saveLevels:function(t,n,r){return c.updateObjectLevels(e.playlistId,t,uy.Playlists,n,r,r)},saveAudiences:function(t,n){return c.updateObjectAudiences(e.playlistId,o.currentPresentation.id,t,uy.Playlists,n,n)}}))}function eg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||ng(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tg(e){return function(e){if(Array.isArray(e))return rg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||ng(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ng(e,t){if(e){if("string"==typeof e)return rg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rg(e,t):void 0}}function rg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ig(e){var t=ce.useBasicFetch(bh(e.playlistId)),n=ce.useBasicFetch(Bp()),r=eg(l.useState({}),2),o=r[0],a=r[1],c=mp(u.SUBJECT);!function(e,t,n){var r=function(e){return Qh(n,e)};$h([Nv.getSubjectTreeFetchOptions(r("subjectTree")),Nv.getPresentationsFetchOptions(r("presentations"))],[]),$h([Nv.getObjectSubjectsFetchOptions(e,uy.Playlists,r("playlistSubjects"))],[e]),Zh(!!t.currentPresentation&&Nv.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),l.useEffect((function(){return r("subjectClassifications")([])}),[t.playlistSubjects]);var i=function(e,t){return[].concat(tg(t.subjectClassifications||[]),tg(e))},o=t.playlistSubjects&&t.playlistSubjects.map((function(e){return Nv.getSubjectClassificationFetchOptions(e.id,Qh(n,"subjectClassifications",i))}));$h(o,[t.playlistSubjects],!!o),Zh(Nv.getObjectClassificationsFetchOptions(e,uy.Playlists,r("playlistClassifications")),[e,t.playlistSubjects])}(e.playlistId,o,a),Gb(o,a);var s=!!(o.playlistSubjects&&o.subjectTree&&o.presentations&&o.classificationTree&&o.playlistClassifications&&o.subjectClassifications);return l.createElement(l.Fragment,null,!!n.data&&l.createElement(Uh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_SUBJECTS,currentUser:n.data}),l.createElement(Ml,{object:t.data}),s&&l.createElement(Lb,{objectSubjects:o.playlistSubjects,subjectTree:o.subjectTree,memberType:uy.Playlists,presentations:o.presentations,currentPresentation:o.currentPresentation,setCurrentPresentation:Qh(a,"currentPresentation"),objectClassifications:o.playlistClassifications,objectSubjectClassifications:o.subjectClassifications,classificationTree:o.classificationTree,saveSubjects:function(t,n,r){return c.updateObjectSubjects(e.playlistId,t,uy.Playlists,n,r,r)},saveClassifications:function(t,n){return c.updateObjectClassifications(e.playlistId,o.currentPresentation.id,t,uy.Playlists,n,n)}}))}var og=function(e,t,n){if(t===n)return{reorderedItems:e,reorderRequest:null};var r=Hp.a.moveItem(e,t,n),i=n<e.length-1?r[n+1].id:null;return{reorderedItems:r,reorderRequest:{sourceMemberId:r[n].id,destinationMemberId:i}}};function ag(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return cg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ug(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ug(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ug(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var lg=function(e){return{application:c.VIDEOS,action:i.Videos.EDIT_VIDEO,args:[e.id]}};function fg(e){var t,n,r,o,a,s,u=Object(b.useDispatch)(),f=jp(),p=ce.useBasicFetch(bh(e.playlistId)),d=ce.useBasicFetch(Ch(e.playlistId)),m=ce.useBasicFetch(Bp()),h=sg((n=null===(t=d.data)||void 0===t?void 0:t.data,r=ag(Object(l.useState)(),2),o=r[0],a=r[1],Object(l.useEffect)((function(){o&&(n.length!==o.length||function(e,t){var n=!0;if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r].id!==t[r].id){n=!1;break}return n}(n,o))&&a(null)}),[n]),[o,a]),2),y=h[0],v=h[1],g=y?{data:y,pagination:null}:d.data;return l.createElement(l.Fragment,null,!!m.data&&l.createElement(Uh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_VIDEOS,currentUser:m.data}),l.createElement(Ml,{object:p.data}),!!g&&l.createElement(jf,{onSortEnd:function(t,n){if(t!==n){var r=og(d.data.data,t,n),i=r.reorderRequest,o=r.reorderedItems;v(o);ce.fetch(u,wh(e.playlistId,i,null,(function(){f.error("Failed to update playlist order."),v(null)})))}},videos:g,getVideoAppLink:lg,getVideoActions:(s=e.playlistId,function(e){return[{label:"Remove video",appLink:{application:c.PLAYLISTS,action:i.Playlists.REMOVE_VIDEO,args:[s.toString(),e.id.toString()]},className:"text-danger"}]}),emptyMessage:"There are no videos in this playlist."}))}function pg(){var e=Object(b.useDispatch)(),t=jp();return l.createElement(Mh,{savePlaylist:function(n,r){ce.fetch(e,Sh(n,(function(e){t.success("Successfully created playlist."),function(e){e&&e.id&&p.AppLinkHelper.trigger({application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]})}(e)}),(function(){t.error("Failed to create playlist.")}),r))}})}var dg="rating,thumbnail,glance,herobanner,tags",mg=function(e){return{url:"/api/master/v2/objects/".concat(e,"?query=").concat(dg),key:"videos:".concat(e)}},hg=function(e){var t=e.slice().sort();return{key:"videos:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},yg=function(e){return{url:"/ajax/hostedlibraries/rightsline/programs/".concat(e),key:"rightsline:videos:".concat(e),normalizeOptions:{namespace:"rightsline"}}},vg=function(e,t,n,r,i){return{key:"videos:".concat(e),url:"/api/master/v2/objects/".concat(e),data:t,type:se.a.PUT,success:n,error:r,always:i}};function bg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sg(e){var t=Object(b.useDispatch)(),n=jp(),r=ce.useBasicFetch(bh(e.playlistId)),i=ce.useBasicFetch(mg(e.videoId)),o=bg(l.useState(!1),2),a=o[0],c=o[1];var s=!!r.data&&!!i.data;return l.createElement(kp,{title:"Remove Video",closePopup:e.closePopup,showLoadingSpinner:!s},!!s&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,i.data.name)," from ",l.createElement("strong",null,r.data.name),"?")),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),ce.fetch(t,Ah(e.playlistId,e.videoId,(function(){n.success("Successfully removed video from playlist")}),(function(){n.error("Failed to remove video from playlist")}),e.closePopup))},buttonText:"Yes, remove video",isSpinnerButton:!0,showSpinner:a}]})))}function Eg(e){return p.AppLinkHelper.trigger(function(e){return{application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]}}(e))}function Og(e){var t=e?{application:c.PLAYLISTS,action:i.Playlists.SEARCH_PLAYLISTS,params:{query:e}}:{application:c.PLAYLISTS,action:i.Playlists.PLAYLISTS};p.AppLinkHelper.trigger(t)}function Cg(e){return l.createElement("div",{className:"pb-3 w-50"},l.createElement(lu,{initialQuery:e.query,placeholder:"Search for a playlist",onSuggestionSelected:Eg,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/playlists/instant/raw","?query=").concat(e)},activationLength:2,onSubmit:Og}))}var wg=c.PLAYLISTS,Ag=function(e){return{application:wg,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]}};function jg(e){var t=ce.useBasicFetch(yh(e.cursor));return l.createElement(l.Fragment,null,l.createElement(Cg,null),l.createElement(jl,{collection:t.data,columns:[{header:"Name",accessor:"name",appLink:Ag},{header:"Internal Description",accessor:function(e){var t;return null===(t=e.metadata)||void 0===t?void 0:t.internalDescription}}],collectionAppLink:{application:wg,action:i.Playlists.PLAYLISTS},newObjectAppLink:{application:wg,action:i.Playlists.NEW_PLAYLIST},objectName:"Playlist"}))}var Tg=c.PLAYLISTS,kg=function(e){return{application:Tg,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]}};function Ig(e){var t,n,r=ce.useBasicFetch(vh(e.query,e.cursor)),o=ce.useBasicFetch(!!(null===(n=null===(t=r.data)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)&&jh(r.data.data.map((function(e){return e.id})))),a=o.isComplete&&function(e,t){var n,r;return(null==t?void 0:t.length)?Object.assign(Object.assign({},e),{data:null!==(r=null===(n=e.data)||void 0===n?void 0:n.map((function(e){return Object.assign(Object.assign({},e),{metadata:t.find((function(t){return t.playlistId.toString()===e.id.toString()}))})})))&&void 0!==r?r:[]}):e}(r.data,o.data);return l.createElement(l.Fragment,null,l.createElement(Cg,{query:e.query}),!!r.data&&(r.data.data.length?l.createElement(jl,{collection:a,columns:[{header:"Name",accessor:"name",appLink:kg},{header:"Internal Description",accessor:function(e){var t;return null===(t=e.metadata)||void 0===t?void 0:t.internalDescription}}],collectionAppLink:{application:Tg,action:i.Playlists.SEARCH_PLAYLISTS,params:{query:e.query}},newObjectAppLink:{application:Tg,action:i.Playlists.NEW_PLAYLIST},objectName:"Playlist"}):l.createElement("p",null,"No playlists found, please try a different search query.")))}function Lg(e){return{application:c.PLAYLISTS,action:i.Playlists.DASHBOARD,args:[e.dashboardId]}}function _g(e){return[{label:"Remove playlist from dashboard",appLink:{application:c.PLAYLISTS,action:i.Playlists.DELETE_DASHBOARD_WIDGET,args:[e.dashboardId,e.id]},className:"text-danger"}]}function Pg(e){var t=ce.useBasicFetch(bh(e.playlistId)),n=ce.useBasicFetch(Ih(e.playlistId)),r=ce.useBasicFetch(Bp());return f.a.createElement(f.a.Fragment,null,!!r.data&&f.a.createElement(Uh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_DASHBOARDS,currentUser:r.data}),f.a.createElement(Ml,{object:t.data}),!!n.data&&(n.data.length?f.a.createElement(Al,{objects:n.data,columns:[{header:"Dashboard",accessor:function(e){var t;return null===(t=e.dashboard)||void 0===t?void 0:t.name},appLink:Lg},{accessor:function(e){return f.a.createElement("span",{className:"d-flex justify-content-end"},f.a.createElement(Dl,{actions:_g(e)}))}}]}):f.a.createElement("p",null,"This playlist isn't in any dashboards.")))}function xg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ng(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ng(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ng(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rg(e){var t=xg(f.a.useState(!1),2),n=t[0],r=t[1],i=Object(b.useDispatch)(),o=jp(),a=ce.useBasicFetch(kh(e.dashboardId,e.widgetId)),c=ce.useBasicFetch(Th(e.dashboardId)),s=ce.useBasicFetch(!!a.data&&bh(a.data.collectionId)),u=!!a.data&&!!c.data&&!!s.data;return f.a.createElement(kp,{title:"Remove playlist from dashboard",closePopup:e.closePopup,showLoadingSpinner:!u},!!u&&f.a.createElement(f.a.Fragment,null,f.a.createElement("div",null,f.a.createElement("p",null,"Are you sure you want to remove ",f.a.createElement("strong",null,s.data.name)," from ",f.a.createElement("strong",null,c.data.name),"?"),f.a.createElement("p",null,f.a.createElement("em",null,"Note: This is the same as deleting the widget from the dashboard."))),f.a.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){r(!0),ce.fetch(i,Lh(c.data.id,a.data.id,s.data.id,(function(){o.success("Successfully removed playlist from dashboard")}),(function(){o.error("Failed to remove playlist from dashboard")}),e.closePopup))},buttonText:"Yes, remove playlist",isSpinnerButton:!0,showSpinner:n}]})))}function Dg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Mg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ug=function(e,t,n){return[{variant:"link",onClick:t,buttonText:"Cancel"},{variant:"danger",onClick:e,buttonText:"Yes, delete this audience",isSpinnerButton:!0,showSpinner:n}]};function Fg(e){var t=e.id,n=e.routeToOnDelete,r=e.closePopup,i=Dg(l.useState(),2),o=i[0],a=i[1],c=Dg(l.useState(!1),2),s=c[0],f=c[1],d=mp(u.SUBJECT);Zh(Nv.getAudienceFetchOptions(t,a),[t]);return l.createElement(kp,{title:"Delete Audience",closePopup:r,showLoadingSpinner:!o},!!o&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,o.name),"?")),l.createElement(Lp,{buttons:Ug((function(){f(!0);d.deleteAudience(t,(function(){r(),n&&p.AppLinkHelper.trigger(n)}),r)}),r,s)})))}function Vg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Bg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hg(e){var t=e.presentationId,n=e.audienceId,r=Vg(l.useState(),2),i=r[0],o=r[1],a=Vg(l.useState(),2),c=a[0],s=a[1],f=Vg(l.useState(),2),p=f[0],d=f[1],m=mp(u.SUBJECT);Zh(Nv.getAudienceFetchOptions(n,o),[n]),Zh(Nv.getLevelsFetchOptions(s),[]),Zh(Nv.getPresentationFetchOptions(t,d),[t]);return l.createElement(l.Fragment,null,l.createElement(Kv,{presentation:p,audienceId:n}),!!p&&l.createElement("h6",null,"Presentation: ".concat(p.name)),!!i&&!!c&&l.createElement(Bv,{audience:i,levels:c,saveAudience:function(e,r){return m.updateAudience(n,Object.assign(Object.assign({},e),{presentationId:t}),r,r)},presentationId:t}))}function zg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Jg=function(e){return{application:c.SUBJECTS,action:i.Subjects.PRESENTATION_AUDIENCES,args:[e]}};function $g(e){var t=e.presentationId,n=zg(l.useState(),2),r=n[0],o=n[1],a=zg(l.useState(),2),s=a[0],f=a[1],d=mp(u.SUBJECT);Zh(Nv.getLevelsFetchOptions(o),[]),Zh(Nv.getPresentationFetchOptions(t,f),[t]);return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-2"},l.createElement(xu,{appLink:Jg(t),backToName:"audiences"})),!!s&&l.createElement("h6",null,"Presentation: ".concat(s.name)),!!r&&l.createElement(Bv,{levels:r,presentationId:t,saveAudience:function(e,n){return d.createAudience(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]})}}(t,n),n)}}))}var Kg=n(215),Wg=n.n(Kg);function Yg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zg(e){var t=e.presentationId,n=e.selectedAudienceId,r=Yg(l.useState(),2),o=r[0],a=r[1];Zh(Nv.getAudiencesFetchOptions(t,a),[]);var s=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[t,e.masterId]}},u={application:c.SUBJECTS,action:i.Subjects.NEW_AUDIENCE,args:[t]};return l.createElement("div",{className:"".concat(Wg.a.navContainer," h-auto pr-2 border-right")},l.createElement("h5",{className:"border-bottom pb-2"},"Audiences"),l.createElement(Pu,{appLink:u,className:"d-inline-block pb-2"},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New Audience")),l.createElement("div",{className:"border-top pt-1"},l.createElement("ul",{className:"list-unstyled"},o&&o.map((function(e){return l.createElement("li",{className:"position-relative py-1"},l.createElement(Pu,{className:(null==n?void 0:n.toString())===e.masterId.toString()?"text-primary font-weight-500":"",appLink:s(e)},e.name))})))))}function Qg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eS(e){var t=e.presentationId,n=e.audienceId,r=e.memberType,i=Qg(l.useState(),2),o=i[0],a=i[1],c=Qg(l.useState(),2)[1],s=Qg(l.useState(),2),u=s[0],f=s[1];Zh(Nv.getPresentationFetchOptions(t,a),[]),Zh(Nv.getAudienceFetchOptions(n,c),[n]),Zh(Nv.getAudienceMembersFetchOptions(n,r,f),[n,r]);var p={items:u&&u.data,memberType:r,getItemAppLink:function(e){return Iy.getMemberAppLink(r,e.id)},getActions:function(e){return Iy.getMemberActions(n,sy.Audience,r,e.id)}},d={presentation:o,audienceId:n},m=Bl(p);return l.createElement(l.Fragment,null,l.createElement(Kv,Object.assign({},d,{memberType:r})),m&&l.createElement(Yv,Object.assign({},p)))}function tS(e){return{application:c.SUBJECTS,action:i.Subjects.NEW_CLASSIFICATION,args:[e]}}function nS(e,t){var n={label:"Add child",getAppLink:function(t){return Object.assign(Object.assign({},tS(e)),{args:[e],params:{parentId:t.id}})}},r={label:"Delete classification",getAppLink:function(t){return{application:c.SUBJECTS,action:i.Subjects.DELETE_CLASSIFICATION,args:[e,t.id]}},className:"text-danger"};return td(t)?[n,r]:[n]}var rS=n(216),iS=n.n(rS);function oS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return aS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function aS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cS(e){var t=e.presentationId,n=e.selectedClassificationId,r=oS(l.useState(),2),o=r[0],a=r[1],s=oS(l.useState(),2),u=s[0],f=s[1];!function(e,t,n){$h([Nv.getClassificationTreeFetchOptions(e,t),Nv.getPresentationFetchOptions(e,n)],[e])}(t,a,f);var p=ce.useBasicFetch(Bp());return l.createElement("div",{className:"".concat(iS.a.navContainer," h-auto pr-2 border-right")},!!u&&l.createElement("h6",{className:"border-bottom pb-2"},"Classifications (".concat(u.name,")")),l.createElement(Pu,{appLink:tS(t),className:"d-inline-block pb-2"},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New Classification")),!!o&&l.createElement("div",{className:"border-top pt-1"},l.createElement(nf,{tree:o,getAppLink:function(e){return function(e,t){return{application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[e,t.id]}}(t,e)},selectedIds:[n],actions:nS(t,p.data)})))}function sS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lS(e){var t=e.classificationId,n=e.routeToOnDelete,r=e.closePopup,i=sS(l.useState(),2),o=i[0],a=i[1],c=sS(l.useState(!1),2),s=c[0],f=c[1];Zh(Nv.getClassificationFetchOptions(t,a),[]);var d=mp(u.SUBJECT),m=[{variant:"link",onClick:r,buttonText:"Cancel"},{variant:"danger",onClick:function(){f(!0);d.deleteClassification(t,(function(){r(),n&&p.AppLinkHelper.trigger(n)}),r)},buttonText:"Yes, delete this classification",isSpinnerButton:!0,showSpinner:s}];return l.createElement(kp,{title:"Delete Classification",closePopup:r,showLoadingSpinner:!o},!!o&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,o.name),"?")),l.createElement(Lp,{buttons:m})))}function fS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dS(e){var t=e.presentationId,n=e.classificationId,r=fS(l.useState(),2),i=r[0],o=r[1],a=fS(l.useState(),2),c=a[0],s=a[1],f=fS(l.useState(),2),p=f[0],d=f[1],m=fS(l.useState(),2),h=m[0],y=m[1],v=mp(u.SUBJECT),b=Nv.getClassificationFetchOptions(n,o),g=Nv.getPresentationFetchOptions(t,s),S=Nv.getClassificationTreeFetchOptions(t,d),E=Nv.getSubjectTreeFetchOptions(y),O=ce.useBasicFetch(Bp());Zh(E,[]),Zh(b,[n]),$h([g,S],[t]);return l.createElement("div",null,l.createElement(sb,{presentation:c,classificationId:n}),!!i&&!!p&&!!h&&l.createElement(ab,{classification:i,presentationId:t,subjectTree:h,classificationTree:p,saveClassification:function(e,t){var r=Object.assign({pinnedVideoMasterId:(null==i?void 0:i.pinnedVideoMasterId)||null},e);return v.updateClassification(n,r,t,t)},currentUser:O.data}))}function mS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yS(e){var t=e.presentationId,n=e.classificationId,r=e.memberType,i=mS(l.useState(),2),o=i[0],a=i[1],c=mS(l.useState(),2),s=c[0],f=c[1],p=mS(l.useState(),2),d=p[0],m=p[1];Zh(Nv.getPresentationFetchOptions(t,a),[]),Zh(Nv.getClassificationFetchOptions(n,f),[n]),Zh(Nv.getClassificationMembersFetchOptions(n,r,m),[n,r]);var h=mp(u.SUBJECT),y={items:d&&d.data,memberType:r,classification:s,updatePinnedVideo:function(e,t){var r=Object.assign(Object.assign({},s),{pinnedVideoMasterId:e});h.updateClassification(n,r,t)},getItemAppLink:function(e){return Cy.getMemberAppLink(r,e.id)},getActions:function(e){return Cy.getMemberActions(n,sy.Classification,r,e.id)}},v={presentation:o,classificationId:n},b=Bl(y);return l.createElement(l.Fragment,null,l.createElement(sb,Object.assign({},v,{memberType:r})),b&&l.createElement(tb,Object.assign({},y)))}function vS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gS(e){var t=e.presentationId,n=e.parentId,r=vS(l.useState(),2),o=r[0],a=r[1],s=vS(l.useState(),2),f=s[0],d=s[1],m=mp(u.SUBJECT),h=Nv.getClassificationTreeFetchOptions(t,a);Zh(Nv.getSubjectTreeFetchOptions(d),[]),Zh(h,[t]);return l.createElement("div",null,l.createElement("h4",{className:"py-2"},"Create New Classification"),!!f&&!!o&&l.createElement(ab,{classification:n?{parentIds:[n]}:{},presentationId:t,subjectTree:f,classificationTree:o,saveClassification:function(e,n){return m.createClassification(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),n&&n.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]})}}(t,n),n)}}))}var SS=function(e){return{key:"series:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=thumbnail,tallPoster,banner,rating")}},ES=function(e){var t=e.slice().sort();return{key:"series:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},OS=function(e,t,n,r){return{url:"/api/master/v2/series",key:"series",data:e,type:se.a.POST,success:t,error:n,always:r}},CS=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(e),key:"update:series:".concat(e),data:t,type:se.a.PUT,success:n,error:r,always:i}};function wS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return AS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function AS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jS(e){var t=wS(l.useState(),2),n=t[0],r=t[1],i=wS(l.useState(!1),2),o=i[0],a=i[1],c=ce.useBasicFetch(function(e,t){switch(e){case uy.Playlists:return bh(t);case uy.Series:return SS(t);case uy.Videos:return mg(t)}}(e.memberType,e.memberId)),s=mp(u.SUBJECT);Zh(Nv.getClassificationFetchOptions(e.classificationId,r),[e.classificationId]);var f=!!n&&!!c.data,p="Remove ".concat(zl(Cy.singularizeMemberType(e.memberType)));return l.createElement(kp,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"This will not remove it from the backbone subject.")),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){a(!0),s.removeObjectsFromClassification(e.classificationId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup),n.pinnedVideoMasterId===e.memberId&&s.updateClassification(e.classificationId,Object.assign(Object.assign({},n),{pinnedVideoMasterId:null}))},buttonText:"Yes, remove this ".concat(Cy.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:o}]})))}function TS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function IS(e){var t=e.id,n=TS(l.useState(),2),r=n[0],o=n[1],a=mp(u.SUBJECT);Zh(Nv.getLevelFetchOptions(t,o),[t]);return l.createElement(l.Fragment,null,l.createElement(yb,{levelId:t,activeAction:i.Subjects.EDIT_LEVEL}),l.createElement("h4",{className:"py-2"},"Edit Level"),!!r&&l.createElement(pb,{level:r,saveLevel:function(e,n){return a.updateLevel(t,e,n,n)}}))}function LS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _S(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PS(){var e=LS(l.useState(),2),t=e[0],n=e[1];return Zh(Nv.getLevelsFetchOptions(n),[]),l.useEffect((function(){t&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[Hp.a.first(t).id]},{replace:!0})}),[t]),l.createElement(l.Fragment,null)}function xS(){var e=mp(u.SUBJECT);return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Create New Level"),l.createElement(pb,{saveLevel:function(t,n){return e.createLevel(t,function(e){return function(t){e(),t&&t.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[t.id]})}}(n),n)}}))}var NS=n(217),RS=n.n(NS);function DS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return MS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function MS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function US(e){var t=e.selectedLevelId,n=DS(l.useState(),2),r=n[0],o=n[1];Zh(Nv.getLevelsFetchOptions(o),[]);var a=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[e.id]}},s={application:c.SUBJECTS,action:i.Subjects.NEW_LEVEL};return l.createElement("div",{className:"".concat(RS.a.navContainer," h-auto pr-2 border-right")},l.createElement("h5",{className:"border-bottom pb-2"},"Backbone Audiences"),l.createElement(Pu,{appLink:s,className:"d-inline-block pb-2"},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New Backbone Audience")),l.createElement("div",{className:"border-top pt-1"},l.createElement("ul",{className:"list-unstyled"},r&&r.map((function(e){return l.createElement("li",{className:"position-relative py-1"},l.createElement(Pu,{className:(null==t?void 0:t.toString())===e.id.toString()?"text-primary font-weight-500":"",appLink:a(e)},e.name))})))))}var FS=function(e){return l.createElement("div",{className:"border rounded p-2 mb-3"},l.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.audiences&&e.audiences.length?l.createElement("ul",{className:"list-unstyled mb-0"},e.audiences.map((function(t){return l.createElement("li",{key:t.masterId,className:"py-1"},l.createElement(Pu,{appLink:(n=e.presentation.id,r=t.masterId,{application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[n,r]})},t.name));var n,r}))):l.createElement("p",null,l.createElement("em",null,"There are no audiences mapped to this level in this presentation.")))},VS=function(e){return l.createElement(l.Fragment,null,!!e.presentations&&!!e.audienceDictionary&&e.presentations.map((function(t){return l.createElement(FS,{key:t.id,presentation:t,audiences:e.audienceDictionary[t.id]})})))};function BS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return HS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function HS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zS(e){var t=e.levelId,n=BS(l.useState({}),2),r=n[0];return function(e,t){var n=function(e){return Qh(t,e)};Zh(Nv.getLevelAudiencesFetchOptions(e,n("audiences")),[e]),Zh(Nv.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),l.createElement(l.Fragment,null,l.createElement(yb,{levelId:t,activeAction:i.Subjects.LEVEL_AUDIENCES}),l.createElement(VS,{presentations:r.presentations,audienceDictionary:Hp.a.groupBy(r.audiences,"presentationId")}))}function qS(e,t){return Qh(e,t)}function JS(e){switch(e){case ly.Playlists:return i.Subjects.EDIT_LEVEL_PLAYLISTS;case ly.Series:return i.Subjects.EDIT_LEVEL_SERIES;case ly.Videos:return i.Subjects.EDIT_LEVEL_VIDEOS}}function $S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return KS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function KS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function WS(e){var t=$S(l.useState({}),2),n=t[0],r=t[1],o=n.presentations,a=n.audiences,s=n.memberIds,f=n.membersWithAudiences,d=ce.useBasicFetch(Array.isArray(s)&&s.length?function(e,t){switch(e){case ly.Playlists:return gh(t);case ly.Series:return ES(t);case ly.Videos:return hg(t)}}(e.memberType,s):null),m=mp(u.SUBJECT);function h(t){p.AppLinkHelper.trigger({application:c.SUBJECTS,action:e.action,args:[e.levelId],params:{presentationId:t}})}!function(e,t,n){var r=e.presentationId,i=e.levelId,o=e.memberType;Zh(Nv.getPresentationsFetchOptions(qS(n,"presentations")),[]),Zh(Nv.getLevelMemberIdsFetchOptions(i,o,qS(n,"memberIds")),[i,o]),Zh(!!r&&Nv.getLevelAudiencesFetchOptions(i,qS(n,"audiences"),r,o),[i,o,r],!!r)}(e,0,r),function(e,t,n,r){var i=n.audiences;l.useEffect((function(){qS(r,"membersWithAudiences")(function(e,t,n){if(!t||!n)return;return t.map((function(t){return{id:t.id,name:t.name,audiences:n.map((function(n){return{id:n.masterId,selected:(r=t,i=n,!!i[e]&&!!i[e].data.filter((function(e){return e.id===r.id})).length)};var r,i}))}}))}(t.memberType,e,i))}),[e,i])}(d.data,e,n,r),l.useEffect((function(){!e.presentationId&&(null==o?void 0:o.length)&&h(Hp.a.first(o).id)}),[e.presentationId]);var y,v,b=!!e.presentationId&&!!a;return l.createElement(l.Fragment,null,l.createElement(yb,{levelId:e.levelId,presentationId:e.presentationId,activeAction:JS(e.memberType)}),l.createElement(Ii.Alert,{variant:"info",className:"m-0"},"Select which ".concat(e.memberType," are shown for each audience in this level.")+" Change the selected presentation to view different audiences."),l.createElement("div",{className:"w-50 py-2"},!!o&&l.createElement(jb,{presentations:o,currentPresentationId:e.presentationId,setCurrentPresentation:function(e){return h(e.id)}})),b&&l.createElement(Cb,{members:f||[],memberType:e.memberType,getMemberAppLink:function(t){return Iy.getMemberAppLink(e.memberType,t)},getActions:function(t){return Iy.getMemberActions(e.levelId,sy.Level,e.memberType,t)},audiences:a,getAudienceAppLink:e.presentationId&&(y=e.memberType,v=e.presentationId,function(e){var t,n=c.SUBJECTS,r=[v,e];switch(y){case ly.Playlists:t=i.Subjects.EDIT_AUDIENCE_PLAYLISTS;break;case ly.Series:t=i.Subjects.EDIT_AUDIENCE_SERIES;break;case ly.Videos:t=i.Subjects.EDIT_AUDIENCE_VIDEOS}return{application:n,action:t,args:r}}),onToggleAudience:function(t,n,r){return function(e,t,n,r,i,o,a){(a?e.addObjectsToAudience.bind(e):e.removeObjectsFromAudience.bind(e))(o,n,t,r,i)}(m,e.memberType,r?[r]:s,e.levelId,e.presentationId,t,n)}}))}function YS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return GS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function GS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ZS(e){var t=YS(l.useState(),2),n=t[0],r=t[1],i=YS(l.useState(!1),2),o=i[0],a=i[1],c=ce.useBasicFetch(function(e,t){switch(e){case ly.Playlists:return bh(t);case ly.Series:return SS(t);case ly.Videos:return mg(t)}}(e.memberType,e.memberId)),s=mp(u.SUBJECT);Zh(Nv.getLevelFetchOptions(e.levelId,r),[e.levelId]);var f=!!n&&!!c.data,p="Remove ".concat(zl(Iy.singularizeMemberType(e.memberType)));return l.createElement(kp,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"Please ensure that it is not in any audiences before removing.")),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){a(!0),s.removeObjectsFromLevel(e.levelId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Iy.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:o}]})))}function QS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return XS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function XS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eE(e){var t=e.id,n=QS(l.useState(),2),r=n[0],i=n[1],o=mp(u.SUBJECT);Zh(Nv.getPresentationFetchOptions(t,i),[t]);var a={presentation:r,savePresentation:function(e,n){o.updatePresentation(t,e,n,n)}},c=Bl(a);return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Edit Presentation"),!!c&&l.createElement(Ab,Object.assign({},a)))}function tE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rE=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_PRESENTATION,args:[e.id]}},iE={application:c.SUBJECTS,action:i.Subjects.NEW_PRESENTATION};function oE(){var e=tE(l.useState(),2),t=e[0],n=e[1];return Zh(Nv.getPresentationsFetchOptions(n),[]),l.createElement("div",null,l.createElement("div",{className:"d-flex justify-content-between mb-2"},l.createElement("h5",{className:"d-inline-block m-0"},"Select a presentation to edit:"),l.createElement(Pu,{appLink:iE,className:"d-block"},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New Presentation"))),l.createElement(Ul,{objects:t,getAppLink:rE}))}function aE(){var e=mp(u.SUBJECT);return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Create New Presentation"),l.createElement(Ab,{savePresentation:function(t,n){e.createPresentation(t,(function(e){n(),e&&e.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_PRESENTATION,args:[e.id]})}),n)}}))}function cE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uE(e){var t=e.objectType,n=e.getAppLink,r=cE(l.useState(),2),i=r[0],o=r[1];return Zh(Nv.getPresentationsFetchOptions(o),[]),l.createElement("div",null,l.createElement("h5",null,l.createElement(ks,{namespace:"subjects.selectPresentation",phrase:"heading",options:{objectType:t}})),l.createElement(Ul,{objects:i,getAppLink:n}))}function lE(e,t){return Qh(e,t)}function fE(e,t,n,r,o){var a=r.selectedSubject,s=function(){return lE(o,"showConfirmationPopup")(!1)};t.addObjectsToSubject(a.id,e.map((function(e){return e.id})),n.memberType,r.addToClassifications,(function(){s(),p.AppLinkHelper.trigger(function(e,t){var n={application:c.SUBJECTS,args:[e]};switch(t){case uy.Playlists:return Object.assign(Object.assign({},n),{action:i.Subjects.EDIT_SUBJECT_PLAYLISTS});case uy.Series:return Object.assign(Object.assign({},n),{action:i.Subjects.EDIT_SUBJECT_SERIES});case uy.Videos:return Object.assign(Object.assign({},n),{action:i.Subjects.EDIT_SUBJECT_VIDEOS})}}(a.id,n.memberType))}),s)}function pE(e,t,n){if(t&&n){var r=1===t.length?"this ".concat(Cy.singularizeMemberType(e)):"these ".concat(e);return"Add ".concat(r," to ").concat(n.name)}}function dE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return mE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hE(e,t){return function(n,r,i){i(),lE(t,"selectedSubject")($l.find(e.subjectTree,Hp.a.first(n))),lE(t,"addToClassifications")(r),lE(t,"showConfirmationPopup")(!0)}}function yE(e){var t=dE(l.useState({}),2),n=t[0],r=t[1],i=ce.useBasicFetch(function(e,t){switch(e){case uy.Playlists:return gh(t);case uy.Series:return ES(t);case uy.Videos:return hg(t)}}(e.memberType,e.objectIds)),o=mp(u.SUBJECT);!function(e,t){Zh(Nv.getSubjectTreeFetchOptions(lE(t,"subjectTree")),[])}(0,r);var a;return l.createElement(l.Fragment,null,!!i.data&&!!n.subjectTree&&l.createElement(Tb,{memberType:e.memberType,objects:i.data,subjectTree:n.subjectTree,onClickAddToSubject:hE(n,r)}),n.showConfirmationPopup&&l.createElement(Np,{title:pE(e.memberType,i.data,n.selectedSubject),onClickConfirm:function(){return fE(i.data,o,e,n,r)},closePopup:function(){return e=!1,lE(r,"showConfirmationPopup")(e);var e}},l.createElement("p",null,"The following ".concat(e.memberType," will be added to "),l.createElement("strong",null,n.selectedSubject.name),n.addToClassifications?" and its mapped classifications:":":"),l.createElement("ul",null,i.data.map((function(e){return l.createElement("li",{key:e.id},e.name)}))),!n.addToClassifications&&l.createElement("p",null,"".concat(1===i.data.length?"It":"They"," will not be added to its mapped classifications.")),l.createElement("p",null,"".concat((a=e.memberType,zl(Cy.singularizeMemberType(a)))," to classification mappings can be managed from the "),l.createElement("strong",null,"Edit Subject ".concat(zl(e.memberType)," ")),"page.")))}function vE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gE(e){var t=e.subjectId,n=e.routeToOnDelete,r=e.closePopup,i=vE(l.useState(),2),o=i[0],a=i[1],c=vE(l.useState(!1),2),s=c[0],f=c[1];Zh(Nv.getSubjectFetchOptions(t,a),[]);var d=mp(u.SUBJECT),m=[{variant:"link",onClick:r,buttonText:"Cancel"},{variant:"danger",onClick:function(){f(!0);d.deleteSubject(t,(function(){r(),n&&p.AppLinkHelper.trigger(n)}),r)},buttonText:"Yes, delete this backbone classification",isSpinnerButton:!0,showSpinner:s}];return l.createElement(kp,{title:"Delete Subject",closePopup:r,showLoadingSpinner:!o},!!o&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,o.name),"?"),l.createElement("p",null,"Subjects that have mapped classifications cannot be deleted.")),l.createElement(Lp,{buttons:m})))}function SE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return EE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function EE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function OE(e){var t=e.subjectId,n=SE(l.useState(),2),r=n[0],o=n[1],a=SE(l.useState(),2),c=a[0],s=a[1],f=mp(u.SUBJECT),p=Nv.getSubjectFetchOptions(t,o);Zh(Nv.getSubjectTreeFetchOptions(s),[]),Zh(p,[t]);return l.createElement(l.Fragment,null,l.createElement(Db,{subjectId:t,activeAction:i.Subjects.EDIT_SUBJECT}),!!r&&!!c&&l.createElement(Nb,{subject:r,subjectTree:c,saveSubject:function(e,n){return f.updateSubject(t,e,n,n)}}))}function CE(e,t){return Qh(e,t)}function wE(e){switch(e){case uy.Playlists:return i.Subjects.EDIT_SUBJECT_PLAYLISTS;case uy.Series:return i.Subjects.EDIT_SUBJECT_SERIES;case uy.Videos:return i.Subjects.EDIT_SUBJECT_VIDEOS}}function AE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function TE(e){var t=AE(l.useState({}),2),n=t[0],r=t[1],o=n.presentations,a=n.classifications,s=n.memberIds,f=n.membersWithClassifications,d=ce.useBasicFetch(Array.isArray(s)&&function(e,t){switch(e){case uy.Playlists:return gh(t);case uy.Series:return ES(t);case uy.Videos:return hg(t)}}(e.memberType,s)),m=mp(u.SUBJECT);function h(t){p.AppLinkHelper.trigger({application:c.SUBJECTS,action:e.action,args:[e.subjectId],params:{presentationId:t}})}!function(e,t,n){var r=e.subjectId,i=e.memberType,o=e.presentationId;Zh(Nv.getPresentationsFetchOptions(CE(n,"presentations")),[]),Zh(Nv.getSubjectMemberIdsFetchOptions(r,i,CE(n,"memberIds")),[r,i]),Zh(!!o&&Nv.getSubjectClassificationFetchOptions(r,CE(n,"classifications"),o,i),[r,i,o],!!o)}(e,0,r),function(e,t,n,r){var i=n.classifications;l.useEffect((function(){CE(r,"membersWithClassifications")(function(e,t,n){if(!t||!n)return;return t.map((function(t){return{id:t.id,name:t.name,classifications:n.map((function(n){return{id:n.id,selected:(r=t,i=n,!!i[e]&&!!i[e].data.filter((function(e){return e.id===r.id})).length)};var r,i}))}}))}(t.memberType,e,i))}),[e,i])}(d.data,e,n,r),l.useEffect((function(){!e.presentationId&&(null==o?void 0:o.length)&&h(Hp.a.first(o).id)}),[e.presentationId]);var y,v,b=!!e.presentationId&&!!a;return l.createElement(l.Fragment,null,l.createElement(Db,{subjectId:e.subjectId,presentationId:e.presentationId,activeAction:wE(e.memberType)}),l.createElement(Ii.Alert,{variant:"info",className:"m-0"},"Select which ".concat(e.memberType," are shown for each classification in this backbone classification.")+" Change the selected presentation to view different classifications."),l.createElement("div",{className:"w-50 py-2"},!!o&&l.createElement(jb,{presentations:o,currentPresentationId:e.presentationId,setCurrentPresentation:function(e){return h(e.id)}})),b&&l.createElement(Wb,{members:f||[],memberType:e.memberType,getMemberAppLink:function(t){return Cy.getMemberAppLink(e.memberType,t)},getActions:function(t){return Cy.getMemberActions(e.subjectId,sy.Subject,e.memberType,t)},classifications:a,getClassificationAppLink:e.presentationId&&(y=e.memberType,v=e.presentationId,function(e){var t,n=c.SUBJECTS,r=[v,e];switch(y){case uy.Playlists:t=i.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;break;case uy.Series:t=i.Subjects.EDIT_CLASSIFICATION_SERIES;break;case uy.Videos:t=i.Subjects.EDIT_CLASSIFICATION_VIDEOS}return{application:n,action:t,args:r}}),onToggleClassification:function(t,n,r){return function(e,t,n,r,i,o,a){(a?e.addObjectsToClassification.bind(e):e.removeObjectsFromClassification.bind(e))(o,n,t,r,i)}(m,e.memberType,r?[r]:s,e.subjectId,e.presentationId,t,n)}}))}function kE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return IE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LE(e){var t=e.parentId,n=kE(l.useState(),2),r=n[0],o=n[1],a=mp(u.SUBJECT);Zh(Nv.getSubjectTreeFetchOptions(o),[]);var s={application:c.SUBJECTS,action:i.Subjects.PRESENTATIONS};return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-2 border-bottom"},l.createElement(xu,{backToName:"Presentations",appLink:s})),l.createElement("h4",{className:"py-2"},"Create New Subject"),!!r&&l.createElement(Nb,{subject:{parentId:t},subjectTree:r,saveSubject:function(e,t){return a.createSubject(e,function(e){return function(t){e(),t&&t.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[t.id]})}}(t),t)}}))}function _E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return PE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xE(e){var t=_E(l.useState(),2),n=t[0],r=t[1],i=_E(l.useState(!1),2),o=i[0],a=i[1],c=ce.useBasicFetch(function(e,t){switch(e){case uy.Playlists:return bh(t);case uy.Series:return SS(t);case uy.Videos:return mg(t)}}(e.memberType,e.memberId)),s=mp(u.SUBJECT);Zh(Nv.getSubjectFetchOptions(e.subjectId,r),[e.subjectId]);var f=!!n&&!!c.data,p="Remove ".concat(zl(Cy.singularizeMemberType(e.memberType)));return l.createElement(kp,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"Please ensure that it is not in any classifications before removing.")),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){a(!0),s.removeObjectsFromSubject(e.subjectId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Cy.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:o}]})))}function NE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return RE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return RE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function RE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function DE(e){var t=e.subjectId,n=NE(l.useState({}),2),r=n[0];return function(e,t){var n=function(e){return Qh(t,e)};Zh(Nv.getSubjectClassificationFetchOptions(e,n("classifications")),[e]),Zh(Nv.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),l.createElement(l.Fragment,null,l.createElement(Db,{subjectId:t,activeAction:i.Subjects.SUBJECT_CLASSIFICATIONS}),l.createElement(Bb,{presentations:r.presentations,classificationDictionary:Hp.a.groupBy(r.classifications,"presentationId")}))}var ME=n(218),UE=n.n(ME);function FE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return VE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function VE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BE(e){var t=e.selectedSubjectId,n=FE(l.useState(),2),r=n[0],o=n[1];Zh(Nv.getSubjectTreeFetchOptions(o),[]);var a=l.useCallback((function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[e.id]}}),[]),s={application:c.SUBJECTS,action:i.Subjects.NEW_SUBJECT},u=[{label:"Add child",getAppLink:function(e){return Object.assign(Object.assign({},s),{params:{parentId:e.id}})}},{label:"Delete backbone classification",getAppLink:function(e){return{application:c.SUBJECTS,action:i.Subjects.DELETE_SUBJECT,args:[e.id]}},className:"text-danger"}];return l.createElement("div",{className:"".concat(UE.a.navContainer," h-auto pr-2 border-right")},l.createElement("h5",{className:"border-bottom pb-2"},"Backbone Classifications"),l.createElement(Pu,{appLink:s,className:"d-inline-block pb-2"},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New Backbone Classification")),!!r&&l.createElement("div",{className:"border-top pt-1"},l.createElement(nf,{tree:r,getAppLink:a,selectedIds:[t],actions:u})))}function HE(e){var t=e.currentAppLink;return l.createElement(Yb,{navItems:wy(),currentAppLink:t})}function zE(e){return(zE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $E(e,t,n){return t&&JE(e.prototype,t),n&&JE(e,n),e}function KE(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&WE(e,t)}function WE(e,t){return(WE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function YE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ZE(e);if(t){var i=ZE(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GE(this,n)}}function GE(e,t){return!t||"object"!==zE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ZE(e){return(ZE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var QE=function(e){KE(n,e);var t=YE(n);function n(){return qE(this,n),t.apply(this,arguments)}return $E(n,[{key:"channelName",get:function(){return c.PLAYLISTS}},{key:"appRoutes",get:function(){return{"manage/playlists(/)":"index","manage/playlists/new(/)":"newPlaylist","manage/playlists/search(/)":"searchPlaylists","manage/playlists/:id(/)":"editPlaylist","manage/playlists/:id/videos(/)":"editPlaylistVideos","manage/playlists/:id/dashboards(/)":"editPlaylistDashboards","manage/playlists/:id/classifications(/)":"editPlaylistSubjects","manage/playlists/:id/audiences(/)":"editPlaylistAudiences"}}},{key:"appLinks",get:function(){return["deletePlaylist","removeVideo","uploadImage","removeFromSubject","deleteDashboardWidget"]}},{key:"externalRoutes",get:function(){return{"dashboards/:id(/)":"dashboard"}}}]),n}(p.AppRouter),XE=function(e){KE(n,e);var t=YE(n);function n(){return qE(this,n),t.apply(this,arguments)}return $E(n,[{key:"initialize",value:function(){var e=this;wi.a.values(u).forEach((function(t){return dp.getInstance(t,e)}))}},{key:"name",get:function(){return"Playlists Application"}},{key:"channelName",get:function(){return c.PLAYLISTS}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{provider:dh}}}},{key:"index",value:function(e){this.layout.showChildView(I,l.createElement(jg,{cursor:null==e?void 0:e.cursor}))}},{key:"searchPlaylists",value:function(e){this.layout.showChildView(I,l.createElement(Ig,{query:null==e?void 0:e.query,cursor:null==e?void 0:e.cursor}))}},{key:"newPlaylist",value:function(){this.layout.showChildView(I,l.createElement(pg,null))}},{key:"editPlaylist",value:function(e){this.layout.showChildView(I,l.createElement(Fh,{key:e,playlistId:e}))}},{key:"editPlaylistVideos",value:function(e){this.layout.showChildView(I,l.createElement(fg,{key:e,playlistId:e}))}},{key:"editPlaylistDashboards",value:function(e){this.layout.showChildView(I,l.createElement(Pg,{key:e,playlistId:e}))}},{key:"editPlaylistSubjects",value:function(e){this.layout.showChildView(I,l.createElement(ig,{key:e,playlistId:e}))}},{key:"editPlaylistAudiences",value:function(e){this.layout.showChildView(I,l.createElement(Xb,{key:e,playlistId:e}))}},{key:"deletePlaylist",value:function(e){var t=Object.assign({playlistId:e},this.getPopupProps());this.layout.showChildView(L,l.createElement(xh,Object.assign({},t)))}},{key:"removeVideo",value:function(e,t){var n=Object.assign({playlistId:e,videoId:t},this.getPopupProps());this.layout.showChildView(L,l.createElement(Sg,Object.assign({},n)))}},{key:"removeFromSubject",value:function(e,t){var n=Object.assign({subjectId:t,memberId:e,memberType:uy.Playlists},this.getPopupProps());this.layout.showChildView(L,l.createElement(xE,Object.assign({},n)))}},{key:"deleteDashboardWidget",value:function(e,t){var n=this;this.layout.showChildView(L,l.createElement(Rg,{dashboardId:e,widgetId:t,closePopup:function(){return n.layout.closePopup()}}))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(L,l.createElement(ph,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return Ou.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_,l.createElement(Dd,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return QE}}]),n}(p.Application),eO=function(e){var t=e.children;return l.createElement(rl,null,t)},tO=function(){return{url:"/api/domain/v2/me/ratings",key:"ratings"}},nO=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Ti.string().trim().max(350,"Description is too long").default(""),rating:Ti.object().shape({id:Ti.string()}).default({}).noUnknown(),tallPoster:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),banner:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown()}).noUnknown(),rO=function(e,t){var n=c.SERIES,r=i.Series,o=[{label:"Edit Series Details",appLink:{application:n,action:r.EDIT_SERIES,args:[t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_SERIES_VIDEOS,args:[t]}}];return nd(e)&&o.push.apply(o,[{label:"Backbone Classifications",appLink:{application:n,action:r.EDIT_SERIES_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_SERIES_AUDIENCES,args:[t]}}]),o};function iO(e){var t=si(),n=us(t);return l.createElement(bi,null,l.createElement(as,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this series",autoFocus:!0}),l.createElement(as,{label:"Description",as:"textarea",name:"description",id:"description",maxLength:350,value:t.values.description,placeholder:"Describe this series here",showCharacterCounter:!0}),l.createElement(Fl,{ratings:e.ratings}),l.createElement(Sl,{imageType:Mu.TallPosters,fieldName:"tallPoster",application:c.SERIES,uploadAction:i.Series.UPLOAD_IMAGE}),l.createElement(Sl,{imageType:Mu.Banners,fieldName:"banner",application:c.SERIES,uploadAction:i.Playlists.UPLOAD_IMAGE}),l.createElement("div",{className:"d-flex justify-content-between align-items-center"},l.createElement(Pf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&l.createElement(Dl,{actions:e.actions})))}function oO(e){return l.createElement(ji,{initialValues:e.series,validationSchema:nO,onSubmit:e.saveSeries},l.createElement(iO,{id:e.series&&e.series.id,ratings:e.ratings}))}function aO(e){return l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:rO(e.currentUser,e.seriesId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function cO(e){var t,n=Object(b.useDispatch)(),r=jp(),o=ce.useBasicFetch(SS(e.seriesId)),a=ce.useBasicFetch(tO()),s=ce.useBasicFetch(Bp());return l.createElement(l.Fragment,null,!!s.data&&l.createElement(aO,{seriesId:e.seriesId,activeAction:i.Series.EDIT_SERIES,currentUser:s.data}),!!o.data&&!!a.data&&l.createElement(oO,{series:o.data,saveSeries:function(t,i){ce.fetch(n,CS(e.seriesId,t,(function(){r.success("Successfully updated series.")}),(function(){r.error("Failed to update series.")}),i))},ratings:a.data}),l.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit series page ",l.createElement(Pu,{className:"info-link",appLink:(t=e.seriesId,{application:c.SERIES,action:i.Series.LEGACY_EDIT_SERIES,args:[t]})},"here"),"."))}function sO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lO(e){var t=sO(l.useState({}),2),n=t[0],r=t[1],o=ce.useBasicFetch(SS(e.seriesId)),a=ce.useBasicFetch(Bp()),c=mp(u.SUBJECT);!function(e,t,n){var r=function(e){return Qh(n,e)};Zh(Nv.getObjectLevelsFetchOptions(e,uy.Series,r("seriesLevels")),[e]),Zh(Nv.getObjectAudiencesFetchOptions(e,uy.Series,r("seriesAudiences")),[e,t.seriesLevels]),$h([Nv.getPresentationsFetchOptions(r("presentations")),Nv.getLevelsFetchOptions(r("levels"))],[]),Zh(!!t.currentPresentation&&Nv.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.seriesId,n,r),Gb(n,r);var s=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.seriesLevels&&n.seriesAudiences);return l.createElement(l.Fragment,null,!!a.data&&l.createElement(aO,{seriesId:e.seriesId,activeAction:i.Series.EDIT_SERIES_AUDIENCES,currentUser:a.data}),l.createElement(Ml,{object:o.data}),!!s&&l.createElement(zv,{objectLevels:n.seriesLevels,objectAudiences:n.seriesAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Qh(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:uy.Series,saveLevels:function(t,n,r){return c.updateObjectLevels(e.seriesId,t,uy.Series,n,r,r)},saveAudiences:function(t,r){return c.updateObjectAudiences(e.seriesId,n.currentPresentation.id,t,uy.Series,r,r)}}))}function fO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||dO(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pO(e){return function(e){if(Array.isArray(e))return mO(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||dO(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dO(e,t){if(e){if("string"==typeof e)return mO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mO(e,t):void 0}}function mO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hO(e){var t=fO(l.useState({}),2),n=t[0],r=t[1],o=ce.useBasicFetch(SS(e.seriesId)),a=ce.useBasicFetch(Bp()),c=mp(u.SUBJECT);!function(e,t,n){var r=function(e){return Qh(n,e)};$h([Nv.getSubjectTreeFetchOptions(r("subjectTree")),Nv.getPresentationsFetchOptions(r("presentations"))],[]),Zh(Nv.getObjectSubjectsFetchOptions(e,uy.Series,r("seriesSubjects")),[e]),Zh(!!t.currentPresentation&&Nv.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),l.useEffect((function(){return r("subjectClassifications")([])}),[t.seriesSubjects]);var i=function(e,t){return[].concat(pO(t.subjectClassifications||[]),pO(e))},o=t.seriesSubjects&&t.seriesSubjects.map((function(e){return Nv.getSubjectClassificationFetchOptions(e.id,Qh(n,"subjectClassifications",i))}));$h(o,[t.seriesSubjects],!!o),Zh(Nv.getObjectClassificationsFetchOptions(e,uy.Series,r("seriesClassifications")),[e,t.seriesSubjects])}(e.seriesId,n,r),Gb(n,r);var s=!!(n.seriesSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.seriesClassifications&&n.subjectClassifications);return l.createElement(l.Fragment,null,!!a.data&&l.createElement(aO,{seriesId:e.seriesId,activeAction:i.Series.EDIT_SERIES_SUBJECTS,currentUser:a.data}),l.createElement(Ml,{object:o.data}),s&&l.createElement(Lb,{objectSubjects:n.seriesSubjects,subjectTree:n.subjectTree,memberType:uy.Series,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Qh(r,"currentPresentation"),objectClassifications:n.seriesClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return c.updateObjectSubjects(e.seriesId,t,uy.Series,n,r,r)},saveClassifications:function(t,r){return c.updateObjectClassifications(e.seriesId,n.currentPresentation.id,t,uy.Series,r,r)}}))}function yO(){var e=Object(b.useDispatch)(),t=jp(),n=ce.useBasicFetch(tO());return l.createElement(l.Fragment,null,!!n.data&&l.createElement(oO,{saveSeries:function(n,r){var o=function(){t.error("Failed to create series.")},a=function(e){t.success("Successfully created series."),function(e){p.AppLinkHelper.trigger({application:c.SERIES,action:i.Series.EDIT_SERIES,args:[e.id]})}(e)};ce.fetch(e,OS(n,(function(t){var n={permissions:ed()};ce.fetch(e,CS(t.id,n,a,o,r))}),o))},ratings:n.data}))}function vO(e){return(vO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function SO(e,t,n){return t&&gO(e.prototype,t),n&&gO(e,n),e}function EO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&OO(e,t)}function OO(e,t){return(OO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function CO(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=AO(e);if(t){var i=AO(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return wO(this,n)}}function wO(e,t){return!t||"object"!==vO(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function AO(e){return(AO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jO=function(e){EO(n,e);var t=CO(n);function n(){return bO(this,n),t.apply(this,arguments)}return SO(n,[{key:"channelName",get:function(){return c.SERIES}},{key:"appRoutes",get:function(){return{"manage/series/new(/)":"newSeries","manage/series/:id(/)":"editSeries","manage/series/:id/videos(/)":"editSeriesVideos","manage/series/:id/classifications(/)":"editSeriesSubjects","manage/series/:id/audiences(/)":"editSeriesAudiences","manage/legacy/series/:id(/)":"legacyEditSeries"}}},{key:"appLinks",get:function(){return["uploadImage"]}}]),n}(p.AppRouter),TO=function(e){EO(n,e);var t=CO(n);function n(){return bO(this,n),t.apply(this,arguments)}return SO(n,[{key:"initialize",value:function(){var e=this;wi.a.values(u).forEach((function(t){return dp.getInstance(t,e)}))}},{key:"name",get:function(){return"Series Application"}},{key:"channelName",get:function(){return c.SERIES}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{provider:eO}}}},{key:"newSeries",value:function(){this.layout.showChildView(I,l.createElement(yO,null))}},{key:"editSeries",value:function(e){this.layout.showChildView(I,l.createElement(cO,{seriesId:e}))}},{key:"editSeriesVideos",value:function(e){this.legacyEditSeries(e)}},{key:"editSeriesSubjects",value:function(e){this.layout.showChildView(I,l.createElement(hO,{seriesId:e}))}},{key:"editSeriesAudiences",value:function(e){this.layout.showChildView(I,l.createElement(lO,{seriesId:e}))}},{key:"legacyEditSeries",value:function(e){p.LocationUtils.Redirect("/manage/legacy/series/".concat(e),!0)}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(L,l.createElement(ph,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return Ou.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_,l.createElement(Dd,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return jO}}]),n}(p.Application);function kO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return IO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LO(e){var t=kO(l.useState(),2),n=t[0],r=t[1],i=kO(l.useState(!1),2),o=i[0],a=i[1],c=ce.useBasicFetch(function(e,t){switch(e){case ly.Playlists:return bh(t);case ly.Series:return SS(t);case ly.Videos:return mg(t)}}(e.memberType,e.memberId)),s=mp(u.SUBJECT);Zh(Nv.getAudienceFetchOptions(e.audienceId,r),[e.audienceId]);var f=!!n&&!!c.data,p="Remove ".concat(zl(Iy.singularizeMemberType(e.memberType)));return l.createElement(kp,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"This will not remove it from the backbone level.")),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){a(!0),s.removeObjectsFromAudience(e.audienceId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Iy.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:o}]})))}function _O(e){return(_O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function PO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function NO(e,t,n){return t&&xO(e.prototype,t),n&&xO(e,n),e}function RO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&DO(e,t)}function DO(e,t){return(DO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function MO(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=FO(e);if(t){var i=FO(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return UO(this,n)}}function UO(e,t){return!t||"object"!==_O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function FO(e){return(FO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var VO,BO=function(e){RO(n,e);var t=MO(n);function n(){return PO(this,n),t.apply(this,arguments)}return NO(n,[{key:"channelName",get:function(){return c.SUBJECTS}},{key:"appRoutes",get:function(){return{"manage/subjects(/)":"subjects","manage/subjects/add-objects(/)":"addSubjectMembers","manage/subjects/new(/)":"newSubject","manage/subjects/:id/edit(/)":"editSubject","manage/subjects/:id/edit/playlists(/)":"editSubjectPlaylists","manage/subjects/:id/edit/series(/)":"editSubjectSeries","manage/subjects/:id/edit/videos(/)":"editSubjectVideos","manage/subjects/:id/classifications(/)":"subjectClassifications","manage/subjects/classifications(/)":"classifications","manage/subjects/presentations/:id/classifications(/)":"presentationClassifications","manage/subjects/presentations/:id/classifications/new(/)":"newClassification","manage/subjects/presentations/:id/classifications/:id/edit(/)":"editClassification","manage/subjects/presentations/:id/classifications/:id/edit/playlists(/)":"editClassificationPlaylists","manage/subjects/presentations/:id/classifications/:id/edit/series(/)":"editClassificationSeries","manage/subjects/presentations/:id/classifications/:id/edit/videos(/)":"editClassificationVideos","manage/subjects/levels(/)":"levels","manage/subjects/levels/new(/)":"newLevel","manage/subjects/levels/:id(/)":"level","manage/subjects/levels/:id/edit(/)":"editLevel","manage/subjects/levels/:id/edit/playlists(/)":"editLevelPlaylists","manage/subjects/levels/:id/edit/series(/)":"editLevelSeries","manage/subjects/levels/:id/edit/videos(/)":"editLevelVideos","manage/subjects/levels/:id/audiences(/)":"levelAudiences","manage/subjects/audiences(/)":"audiences","manage/subjects/presentations/:id/audiences(/)":"presentationAudiences","manage/subjects/presentations/:id/audiences/new(/)":"newAudience","manage/subjects/presentations/:id/audiences/:id/edit(/)":"editAudience","manage/subjects/presentations/:id/audiences/:id/edit/playlists(/)":"editAudiencePlaylists","manage/subjects/presentations/:id/audiences/:id/edit/series(/)":"editAudienceSeries","manage/subjects/presentations/:id/audiences/:id/edit/videos(/)":"editAudienceVideos","manage/subjects/presentations(/)":"presentations","manage/subjects/presentations/new":"newPresentation","manage/subjects/presentations/:id(/)":"editPresentation"}}},{key:"appLinks",get:function(){return["deleteClassification","removeClassificationMember","deleteSubject","removeSubjectMember","deleteAudience","removeLevelMember","removeAudienceMember","uploadImage"]}}]),n}(p.AppRouter),HO=function(e){RO(n,e);var t=MO(n);function n(){return PO(this,n),t.apply(this,arguments)}return NO(n,[{key:"initialize",value:function(){var e=this;this.subjectDataService=dp.getInstance(u.SUBJECT,this),wi.a.values(u).forEach((function(t){return dp.getInstance(t,e)}))}},{key:"name",get:function(){return"Subjects Application"}},{key:"channelName",get:function(){return c.SUBJECTS}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{provider:rl,getTopNavView:this.getTopNav}}}},{key:"subjects",value:function(){this.subjectDataService.getSubjectTree((function(e){var t=!!e.children&&e.children[0];t?p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[t.id]},{replace:!0}):p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.NEW_SUBJECT},{replace:!0})}))}},{key:"newSubject",value:function(e){var t={parentId:e.parentId};this.layout.showChildView(I,l.createElement(LE,Object.assign({key:e.parentId},t))),this.renderSubjectsLeftNav()}},{key:"editSubject",value:function(e){this.layout.showChildView(I,l.createElement(OE,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"editSubjectPlaylists",value:function(e,t){var n={subjectId:e,memberType:uy.Playlists,action:i.Subjects.EDIT_SUBJECT_PLAYLISTS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(I,l.createElement(TE,Object.assign({key:"".concat(e,":playlists")},n))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectSeries",value:function(e,t){var n={subjectId:e,memberType:uy.Series,action:i.Subjects.EDIT_SUBJECT_SERIES,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(I,l.createElement(TE,Object.assign({key:"".concat(e,":series")},n))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectVideos",value:function(e,t){var n={subjectId:e,memberType:uy.Videos,action:i.Subjects.EDIT_SUBJECT_VIDEOS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(I,l.createElement(TE,Object.assign({key:"".concat(e,":videos")},n))),this.renderSubjectsLeftNav(e)}},{key:"subjectClassifications",value:function(e){this.layout.showChildView(I,l.createElement(DE,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"addSubjectMembers",value:function(e){var t=e.memberType,n=e.objectIds;if(t&&n){var r={memberType:t,objectIds:Array.isArray(n)?n:[n]};this.layout.showChildView(I,l.createElement(yE,Object.assign({},r))),this.hideLeftNav()}}},{key:"removeSubjectMember",value:function(e,t,n){var r=Object.assign({subjectId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(L,l.createElement(xE,Object.assign({},r)))}},{key:"deleteSubject",value:function(e){var t=e.toString()===this.currentLeftNavId.toString()?{application:c.SUBJECTS,action:i.Subjects.NEW_SUBJECT}:null,n=Object.assign({subjectId:e,routeToOnDelete:t||null},this.getPopupProps());this.layout.showChildView(L,l.createElement(gE,Object.assign({},n)))}},{key:"classifications",value:function(){var e={objectType:"classifications",getAppLink:function(e){return{application:c.SUBJECTS,action:i.Subjects.PRESENTATION_CLASSIFICATIONS,args:[e.id]}}};this.layout.showChildView(I,l.createElement(uE,Object.assign({},e))),this.hideLeftNav()}},{key:"presentationClassifications",value:function(e){this.subjectDataService.getClassificationTree(e,(function(t){var n=!!t.children&&t.children[0];n?p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]},{replace:!0}):p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.NEW_CLASSIFICATION,args:[e]},{replace:!0})}))}},{key:"newClassification",value:function(e,t){var n={presentationId:e,parentId:t.parentId};this.layout.showChildView(I,l.createElement(gS,Object.assign({key:t.parentId},n))),this.renderClassificationLeftNav(e)}},{key:"editClassification",value:function(e,t){var n={presentationId:e,classificationId:t};this.layout.showChildView(I,l.createElement(dS,Object.assign({key:t},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationPlaylists",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:uy.Playlists};this.layout.showChildView(I,l.createElement(yS,Object.assign({key:"".concat(t,":playlists")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationSeries",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:uy.Series};this.layout.showChildView(I,l.createElement(yS,Object.assign({key:"".concat(t,":series")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationVideos",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:uy.Videos};this.layout.showChildView(I,l.createElement(yS,Object.assign({key:"".concat(t,":videos")},n))),this.renderClassificationLeftNav(e,t)}},{key:"removeClassificationMember",value:function(e,t,n){var r=Object.assign({classificationId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(L,l.createElement(jS,Object.assign({},r)))}},{key:"deleteClassification",value:function(e,t){var n=t===this.currentLeftNavId?{application:c.SUBJECTS,action:i.Subjects.NEW_CLASSIFICATION,args:[e]}:null,r=Object.assign({classificationId:t,routeToOnDelete:n||null},this.getPopupProps());this.layout.showChildView(L,l.createElement(lS,Object.assign({},r)))}},{key:"levels",value:function(){this.layout.showChildView(I,l.createElement(PS,null)),this.renderLevelsLeftNav()}},{key:"newLevel",value:function(){this.layout.showChildView(I,l.createElement(xS,null)),this.renderLevelsLeftNav()}},{key:"level",value:function(e){p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[e]},{replace:!0})}},{key:"editLevel",value:function(e){this.layout.showChildView(I,l.createElement(IS,{key:e,id:e})),this.renderLevelsLeftNav(e)}},{key:"levelAudiences",value:function(e){this.layout.showChildView(I,l.createElement(zS,{key:e,levelId:e})),this.renderLevelsLeftNav(e)}},{key:"editLevelPlaylists",value:function(e,t){var n={levelId:e,memberType:ly.Playlists,action:i.Subjects.EDIT_LEVEL_PLAYLISTS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(I,l.createElement(WS,Object.assign({key:"".concat(e,":playlists")},n))),this.renderLevelsLeftNav(e)}},{key:"editLevelSeries",value:function(e,t){var n={levelId:e,memberType:ly.Series,action:i.Subjects.EDIT_LEVEL_SERIES,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(I,l.createElement(WS,Object.assign({key:"".concat(e,":series")},n))),this.renderLevelsLeftNav(e)}},{key:"editLevelVideos",value:function(e,t){var n={levelId:e,memberType:ly.Videos,action:i.Subjects.EDIT_LEVEL_VIDEOS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(I,l.createElement(WS,Object.assign({key:"".concat(e,":videos")},n))),this.renderLevelsLeftNav(e)}},{key:"removeLevelMember",value:function(e,t,n){var r=Object.assign({levelId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(L,l.createElement(ZS,Object.assign({},r)))}},{key:"audiences",value:function(){var e={objectType:"audiences",getAppLink:function(e){return{application:c.SUBJECTS,action:i.Subjects.PRESENTATION_AUDIENCES,args:[e.id]}}};this.layout.showChildView(I,l.createElement(uE,Object.assign({},e))),this.hideLeftNav()}},{key:"removeAudienceMember",value:function(e,t,n){var r=Object.assign({audienceId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(L,l.createElement(LO,Object.assign({},r)))}},{key:"presentationAudiences",value:function(e){this.subjectDataService.getAudiences(e,(function(t){var n=!!t&&t[0];n?p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]},{replace:!0}):p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.NEW_AUDIENCE,args:[e]},{replace:!0})}))}},{key:"newAudience",value:function(e){this.layout.showChildView(I,l.createElement($g,{presentationId:e})),this.hideLeftNav()}},{key:"editAudience",value:function(e,t){var n={presentationId:e,audienceId:t};this.layout.showChildView(I,l.createElement(Hg,Object.assign({key:t},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudiencePlaylists",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:ly.Playlists};this.layout.showChildView(I,l.createElement(eS,Object.assign({key:"".concat(t,":playlists")},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudienceSeries",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:ly.Series};this.layout.showChildView(I,l.createElement(eS,Object.assign({key:"".concat(t,":series")},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudienceVideos",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:ly.Videos};this.layout.showChildView(I,l.createElement(eS,Object.assign({key:"".concat(t,":videos")},n))),this.renderAudienceLeftNav(e,t)}},{key:"deleteAudience",value:function(e,t){var n={application:c.SUBJECTS,action:i.Subjects.PRESENTATION_AUDIENCES,args:[e]},r=Object.assign({id:t,routeToOnDelete:n},this.getPopupProps());this.layout.showChildView(L,l.createElement(Fg,Object.assign({},r)))}},{key:"presentations",value:function(){this.layout.showChildView(I,l.createElement(oE,null)),this.hideLeftNav()}},{key:"newPresentation",value:function(){this.layout.showChildView(I,l.createElement(aE,null))}},{key:"editPresentation",value:function(e){this.layout.showChildView(I,l.createElement(eE,{key:e,id:e})),this.hideLeftNav()}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(L,l.createElement(ph,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return Ou.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_,l.createElement(Dd,{alerts:n,removeAlert:r}))}},{key:"renderClassificationLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedClassificationId:t};this.layout.showChildView(k,l.createElement(cS,Object.assign({},n)))}},{key:"renderSubjectsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(k,l.createElement(BE,{selectedSubjectId:e}))}},{key:"renderAudienceLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedAudienceId:t};this.layout.showChildView(k,l.createElement(Zg,Object.assign({},n)))}},{key:"renderLevelsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(k,l.createElement(US,{selectedLevelId:e}))}},{key:"setCurrentLeftNavItem",value:function(e){this.currentLeftNavId=e||null}},{key:"hideLeftNav",value:function(){this.setCurrentLeftNavItem(),this.layout.hideLeftNav()}},{key:"getTopNav",value:function(e){return l.createElement(HE,{currentAppLink:e})}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return BO}}]),n}(p.Application),zO=function(e){return{url:"/api/domain/v1/themes/".concat(e),key:"themes:".concat(e)}},qO=function(e){var t="/api/domain/v1/themes",n="themes";return e&&(t+="?type=".concat(e),n+=":type:".concat(e)),{url:t,key:n}},JO=function(e,t,n,r){return{url:"/api/domain/v1/themes",key:"theme",data:e,type:se.a.POST,invalidationKeys:"themes",success:t,error:n,always:r}},$O=function(e,t,n,r,i){return{url:"/api/domain/v1/themes/".concat(e),key:"update:theme:".concat(e),data:t,type:se.a.PUT,success:n,error:r,always:i}},KO=function(e,t,n,r){return{url:"/api/domain/v1/themes/".concat(e),key:"delete:theme:".concat(e),type:se.a.DELETE,invalidationKeys:"themes",success:t,error:n,always:r}},WO=function(e){return{application:c.THEMES,action:i.Themes.EDIT_THEME,args:[e.id]}};function YO(){var e=ce.useBasicFetch(qO());return e.data?l.createElement(Al,{objects:e.data,columns:[{accessor:"name",header:"Name",appLink:WO}],newObjectAppLink:{application:c.THEMES,action:i.Themes.NEW_THEME},objectName:"Theme"}):l.createElement(l.Fragment,null)}!function(e){e.Glance="glance"}(VO||(VO={}));var GO=[{key:"topLeft",label:"Top Left"},{key:"topRight",label:"Top Right"},{key:"bottomLeft",label:"Bottom Left"},{key:"bottomRight",label:"Bottom Right"}];function ZO(){var e=si();return l.createElement("div",{className:"form-group"},GO.map((function(t){var n="data.".concat(t.key);return l.createElement(Sl,{label:t.label,imageType:Mu.HeroBanners,fieldName:n,application:c.THEMES,uploadAction:i.Videos.UPLOAD_IMAGE,setSelectedImage:function(t){e.setFieldValue(n,{fileId:t.id,url:t.url,fileIdType:Fu.ImageAPIv2})}})})))}var QO=Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),XO=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),type:Ti.mixed().required("Type is required"),data:Ti.mixed().when("type",{is:VO.Glance,then:Ti.object().shape({topLeft:QO,topRight:QO,bottomLeft:QO,bottomRight:QO}).noUnknown(),otherwise:Ti.mixed().strip(!0)}).default({})}).noUnknown();function eC(e){var t=si(),n=function(e){switch(e){case VO.Glance:return ZO;default:return}}(t.values.type);return l.createElement(bi,null,l.createElement(as,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this theme",autoFocus:!0}),l.createElement(as,{as:"select",label:"Type",name:"type",id:"type",value:t.values.type},l.createElement("option",{value:null},"Select a type..."),wi.a.getEnumKeys(VO).map((function(e){return l.createElement("option",{key:e,value:VO[e]},e)}))),!!n&&l.createElement(n,null),l.createElement("div",{className:"d-flex justify-content-between align-items-center"},l.createElement(Is,{isNew:e.isNew}),!!e.actions&&l.createElement(Dl,{actions:e.actions})))}function tC(e){var t;return l.createElement(ji,{initialValues:e.theme,validationSchema:XO,onSubmit:e.saveTheme},l.createElement(eC,{isNew:!(null===(t=e.theme)||void 0===t?void 0:t.id),actions:e.actions}))}function nC(){var e=Object(b.useDispatch)();return l.createElement(tC,{saveTheme:function(t,n){ce.fetch(e,JO(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.THEMES,action:i.Themes.EDIT_THEME,args:[e.id]})}),null,n))}})}function rC(e){var t=Object(b.useDispatch)(),n=jp(),r=ce.useBasicFetch(zO(e.id));return r.data?l.createElement(tC,{theme:r.data,saveTheme:function(r,i){ce.fetch(t,$O(e.id,r,(function(){n.success("Successfully updated theme")}),(function(){n.error("Failed to update theme")}),i))},actions:[{label:"Delete theme",className:"btn btn-danger",button:!0,appLink:{application:c.THEMES,action:i.Themes.DELETE_THEME,args:[e.id]}}]}):l.createElement(l.Fragment,null)}function iC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return oC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function aC(e){var t=Object(b.useDispatch)(),n=jp(),r=iC(l.useState(!1),2),o=r[0],a=r[1],s=ce.useBasicFetch(zO(e.id));return l.createElement(kp,{title:"Delete Theme",closePopup:e.closePopup,showLoadingSpinner:!s.data},l.createElement(l.Fragment,null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,s.data.name),"?"),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){a(!0),ce.fetch(t,KO(e.id,(function(){n.success("Successfully deleted theme"),p.AppLinkHelper.trigger({application:c.THEMES,action:i.Themes.THEMES})}),(function(){n.error("Failed to delete theme")})))},buttonText:"Yes, delete this theme",isSpinnerButton:!0,showSpinner:o}]})))}var cC=function(e){var t=e.children;return l.createElement(rl,null,t)};function sC(e){return(sC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fC(e,t,n){return t&&lC(e.prototype,t),n&&lC(e,n),e}function pC(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&dC(e,t)}function dC(e,t){return(dC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=yC(e);if(t){var i=yC(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return hC(this,n)}}function hC(e,t){return!t||"object"!==sC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yC(e){return(yC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vC=function(e){pC(n,e);var t=mC(n);function n(){return uC(this,n),t.apply(this,arguments)}return fC(n,[{key:"channelName",get:function(){return c.THEMES}},{key:"appRoutes",get:function(){return{"manage/themes(/)":"themes","manage/themes/new(/)":"newTheme","manage/themes/:id(/)":"editTheme"}}},{key:"appLinks",get:function(){return["deleteTheme","uploadImage"]}}]),n}(p.AppRouter),bC=function(e){pC(n,e);var t=mC(n);function n(){return uC(this,n),t.apply(this,arguments)}return fC(n,[{key:"name",get:function(){return"Themes Application"}},{key:"channelName",get:function(){return c.THEMES}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{provider:cC}}}},{key:"themes",value:function(){this.layout.showChildView(I,l.createElement(YO,null))}},{key:"newTheme",value:function(){this.layout.showChildView(I,l.createElement(nC,null))}},{key:"editTheme",value:function(e){this.layout.showChildView(I,l.createElement(rC,{id:e}))}},{key:"deleteTheme",value:function(e){var t=this;this.layout.showChildView(L,l.createElement(aC,{id:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(L,l.createElement(ph,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}}],[{key:"router",get:function(){return vC}}]),n}(op),gC=function(e){var t=e.children;return l.createElement(rl,null,t)},SC=function(e,t){var n=c.VIDEOS,r=i.Videos,o=[{label:"Edit Video Details",appLink:{application:n,action:r.EDIT_VIDEO,args:[t]}}];return nd(e)?[].concat(o,[{label:"Backbone Classifications",appLink:{application:n,action:r.EDIT_VIDEO_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_VIDEO_AUDIENCES,args:[t]}},{label:"Aliases",appLink:{application:n,action:r.EDIT_VIDEO_ALIASES,args:[t]}}]):o};function EC(e){var t,n=SC(e.currentUser,e.videoId);return n.length<2?l.createElement(l.Fragment,null):l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:n,isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}))}var OC,CC,wC,AC=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Ti.string().trim().default(""),status:Ti.mixed().required("Status is required"),productionYear:Ti.number().min(1900),rating:Ti.object().shape({id:Ti.string()}).default({}).noUnknown(),thumbnail:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),heroBanner:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),glance:Ti.object().shape({theme:Ti.string(),format:Ti.mixed(),content:Ti.string(),type:Ti.mixed()}).default({}).noUnknown()}).noUnknown();function jC(e){return f.a.createElement("div",Object.assign({},e,{role:"button",tabIndex:0,className:"".concat(e.className?e.className:""," cursor-pointer"),onKeyDown:e.onKeyDown?e.onKeyDown:function(t){return"Enter"===t.key&&e.onClick(t)},onClick:e.onClick,style:e.style?e.style:{}}),e.children)}!function(e){e[e.Draft=0]="Draft",e[e.Published=1]="Published",e[e.Archived=2]="Archived",e[e.Pending=3]="Pending",e[e.Rejected=4]="Rejected",e[e.Processing=5]="Processing"}(OC||(OC={})),function(e){e.Markdown="text/markdown"}(CC||(CC={})),function(e){e.Pedagogy="pedagogy"}(wC||(wC={}));var TC=n(52),kC=n.n(TC);function IC(e){var t,n=e.tag,r=e.appLink,i=e.onClick,o=e.disabled,a=e.tagClass,c=void 0===a?"tag":a,s=n.name.toLowerCase(),u="badge-pill py-1 px-2 my-1 mr-1 ".concat(c);return(null===(t=n.metadata)||void 0===t?void 0:t.type)===wC.Pedagogy&&(u+=" pedagogy-tag text-white"),!r&&!i||o||(u+=" cursor-pointer"),o&&(u+=" "+kC.a.disabled),r?f.a.createElement(Pu,{onClick:i,appLink:r,className:u,title:s},f.a.createElement("span",{className:"text-truncate text-nowrap"},s)):f.a.createElement("span",{onClick:i,className:u,title:s},f.a.createElement("span",{className:"text-truncate text-nowrap"},s))}function LC(e){return function(e){if(Array.isArray(e))return _C(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return _C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _C(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PC(e){var t;switch(null===(t=e.metadata)||void 0===t?void 0:t.type){case wC.Pedagogy:return 0;default:return 1}}function xC(e){var t=e.tags,n=e.getAppLink;if(!t||!t.data)return f.a.createElement(f.a.Fragment,null);var r=LC(t.data).sort((function(e,t){return PC(e)-PC(t)}));return f.a.createElement("div",{className:kC.a.tagList},r.map((function(e){var t=h(n)?n(e):null;return f.a.createElement(IC,{key:e.id,tag:e,appLink:t})})))}var NC=n(53),RC=n.n(NC);function DC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var MC=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.listeners={}}var t,n,r;return t=e,(n=[{key:"subscribe",value:function(e,t){this.registerListener(e,t)}},{key:"subscribeOnce",value:function(e,t){this.registerListener(e,t,1)}},{key:"unsubscribe",value:function(e,t){this.deregisterListener(e,t)}},{key:"trigger",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.triggerCallbacks(e,n)}},{key:"registerListener",value:function(e,t,n){var r;if("string"!=typeof e)throw new Error("Event name must be a string");if("function"!=typeof t)throw new Error("Event callback must be a function");if(n&&"number"!=typeof n)throw new Error("Execution limit must be a number or undefined");this.listeners[e]=null!==(r=this.listeners[e])&&void 0!==r?r:[],this.listeners[e].push({callback:t,executionLimit:n})}},{key:"deregisterListener",value:function(e,t){var n;if("string"!=typeof e)throw new Error("Event name must be a string");if(t&&"function"!=typeof t)throw new Error("Event callback must be a function");if(t){var r=null===(n=this.listeners[e])||void 0===n?void 0:n.findIndex((function(e){return e.callback===t}));"number"==typeof r&&-1!==r&&(this.listeners[e].splice(r,1),0===this.listeners[e].length&&delete this.listeners[e])}else this.listeners[e]=[]}},{key:"triggerCallbacks",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];if(this.listeners[e]){var o=[];this.listeners[e].forEach((function(e){var t,n;"number"==typeof e.executionLimit&&(e.executionCount=null!==(n=e.executionCount)&&void 0!==n?n:0,e.executionCount++,e.executionCount===e.executionLimit&&o.push(e.callback)),(t=e.callback).apply.apply(t,[null].concat(r))})),o.length&&o.forEach((function(n){return t.deregisterListener(e,n)}))}}}])&&DC(t.prototype,n),r&&DC(t,r),e}());function UC(e,t,n){var r=function(){MC.unsubscribe(e,t)};return Object(l.useEffect)((function(){return n?MC.subscribeOnce(e,t):MC.subscribe(e,t),function(){r()}}),[]),r}var FC=function(e,t,n){var r=t-(e=e.toString()).length;return r<=0?e:new Array(r+1).join(n)+e},VC=function(e){if(!d.isNumber(e))return"";var t=new Date(e),n=t.getUTCHours(),r=FC(t.getUTCMinutes(),2,"0"),i=FC(t.getUTCSeconds(),2,"0");return n>0?"".concat(n,":").concat(r,":").concat(i):"".concat(r,":").concat(i)},BC=n(22),HC=n.n(BC);function zC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var JC,$C=/(\[.*\]\(cv:\/\/poi\?id=[0-9]+\))/g,KC=/[0-9]+/,WC=/\[.*\]/,YC=/[\[\]]/g;function GC(e,t){var n=function(e,t){return(null==t?void 0:t.length)?e.content.replace($C,(function(e){var n=e.match(KC);if(!(null==n?void 0:n.length))return e;var r=t.find((function(e){return e.id.toString()===n[0]})),i=e.match(WC);if(!r||!(null==i?void 0:i.length))return e;var o='<span class="'.concat(HC.a.timestamp,' mr-2">').concat(VC(1e3*r.startTime),"</span>"),a=i[0];return a=(a=a.replace(YC,""))||r.description,a="[".concat(o," ").concat(a,"]"),e.replace(WC,a)})):e.content}(e,t);return NC(n).split('a href="cv://poi').join('a class="d-flex" href="cv://poi')}function ZC(e){var t=Object(l.useRef)();function n(){var t=this.getAttribute("href");if((null==t?void 0:t.includes("cv://poi"))&&(null==e?void 0:e.length)){var n=t.split("cv://poi?id=")[1];if(n){var r=e.find((function(e){return e.id.toString()===n}));r&&MC.trigger("glance:poi:mouseover",r)}}}function r(){MC.trigger("glance:poi:mouseleave")}function i(){var e;return null===(e=t.current)||void 0===e?void 0:e.querySelectorAll('[href*="cv://poi"]')}return UC("player:poi:mouseover",(function(e){var n,r=null==e?void 0:e.id;if(!r)return;null===(n=function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.querySelector('[href="cv://poi?id='.concat(e,'"]'))}(r))||void 0===n||n.classList.add(HC.a.highlightPoi)})),UC("player:poi:mouseleave",(function(){var e;null===(e=i())||void 0===e||e.forEach((function(e){return e.classList.remove(HC.a.highlightPoi)}))})),Object(l.useEffect)((function(){if(t.current){var e=i();return e.forEach((function(e){return e.addEventListener("mouseover",n)})),e.forEach((function(e){return e.addEventListener("mouseleave",r)})),function(){e.forEach((function(e){return e.removeEventListener("mouseover",n)})),e.forEach((function(e){return e.removeEventListener("mouseleave",r)}))}}}),[t.current]),t}!function(e){e.Maths="maths",e.English="english",e.History="history"}(JC||(JC={}));function QC(e){var t,n,r=function(e,t,n){var r,i=zC(Object(l.useState)(""),2),o=i[0],a=i[1];return Object(l.useEffect)((function(){n&&a(GC(e.glance,t))}),[null===(r=e.glance)||void 0===r?void 0:r.content,!!t]),o}(e.video,e.pointsOfInterest,e.hasGlanceData),i=ZC(e.pointsOfInterest);return!e.hasGlanceData&&e.hasDetails?(e.onClickShowDescription&&e.onClickShowDescription(),l.createElement(l.Fragment,null)):l.createElement("div",{className:"rounded border px-5 py-3 mb-3\n position-relative d-flex justify-content-center\n ".concat(HC.a.container," ").concat((n=null===(t=e.theme)||void 0===t?void 0:t.name.toLowerCase(),n===JC.Maths?HC.a.bgBlue:n===JC.English?HC.a.bgPink:n===JC.History?HC.a.bgYellow:HC.a.bgGreen))},l.createElement("div",{className:"".concat(HC.a.content," d-flex align-items-center")},l.createElement("div",null,l.createElement("h2",{className:"h4"},l.createElement(ks,{namespace:"shared.videoAtAGlance",phrase:"videoAtAGlance"})),e.hasDetails&&e.onClickShowDescription&&l.createElement(jC,{onClick:e.onClickShowDescription,className:"".concat(HC.a.detailsBtn," position-absolute cursor-pointer mr-4 font-weight-500 text-info")},l.createElement(ks,{namespace:"shared.videoAtAGlance",phrase:"readFullDescription"})),l.createElement("div",{ref:i,onClick:function(t){return function(e,t,n){e.preventDefault();var r=e.target.getAttribute("href");if((null==r?void 0:r.includes("cv://poi"))&&(null==t?void 0:t.length)){var i=r.split("cv://poi?id=")[1],o=t.find((function(e){return e.id.toString()===i}));n&&o&&n(o.startTime)}}(t,e.pointsOfInterest,e.setStartTime)},dangerouslySetInnerHTML:{__html:r}}),function(){var t,n,r;return(null===(n=null===(t=e.video.tags)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)?l.createElement("div",{className:"py-1"},l.createElement(xC,{tags:null===(r=e.video)||void 0===r?void 0:r.tags,getAppLink:function(t){return e.getTagAppLink?e.getTagAppLink(t.name):null}})):l.createElement(l.Fragment,null)}(),l.createElement("div",{className:"mt-2"},e.hasCurriculumLinks&&e.onClickShowCurriculumLinks&&l.createElement(jC,{onClick:e.onClickShowCurriculumLinks,className:"cursor-pointer d-inline-block font-weight-500 text-info"},l.createElement(ks,{namespace:"shared.videoAtAGlance",phrase:"seeCurriculumLinks"}))))),function(){var t;return wi.a.keys(null===(t=e.theme)||void 0===t?void 0:t.data).filter((function(t){var n;return!wi.a.isEmpty(null===(n=e.theme)||void 0===n?void 0:n.data[t])})).map((function(t){var n,r,i,o;return l.createElement("div",{key:null===(r=null===(n=e.theme)||void 0===n?void 0:n.data[t])||void 0===r?void 0:r.fileId,className:"".concat(HC.a[t]," ").concat(HC.a.background),style:{backgroundImage:"url('".concat(Gu.createUrl(null===(o=null===(i=e.theme)||void 0===i?void 0:i.data[t])||void 0===o?void 0:o.url,{format:"png"}),"')")}})}))}())}function XC(e){var t,n,r,i,o,a=si(),c=e.themes.find((function(e){var t;return e.name===(null===(t=a.values.glance)||void 0===t?void 0:t.theme)})),s=(null===(t=a.values.glance)||void 0===t?void 0:t.format)===CC.Markdown&&(null===(n=a.values.glance)||void 0===n?void 0:n.content)&&c;return l.createElement("div",{className:"form-group p-2 border"},l.createElement("div",{className:"border-bottom mb-2"},l.createElement("label",null,"Video at a Glance")),l.createElement(as,{as:"select",label:"Theme",name:"glance.theme",id:"glance.theme",value:null===(r=a.values.glance)||void 0===r?void 0:r.theme},l.createElement("option",{value:null},"Select a theme..."),e.themes.map((function(e){return l.createElement("option",{key:e.id,value:e.name},e.name)}))),l.createElement(as,{as:"select",label:"Format",name:"glance.format",id:"glance.format",value:null===(i=a.values.glance)||void 0===i?void 0:i.format},l.createElement("option",{value:null},"Select a format..."),wi.a.getEnumKeys(CC).map((function(e){return l.createElement("option",{key:e,value:CC[e]},e)}))),l.createElement(as,{label:"Content",as:"textarea",name:"glance.content",id:"glance.content",value:null===(o=a.values.glance)||void 0===o?void 0:o.content}),s&&l.createElement("div",{className:"form-group"},l.createElement("label",null,"Preview"),l.createElement(QC,{theme:c,video:{glance:a.values.glance,tags:e.tags},hasGlanceData:!0})))}function ew(e){switch(e){case OC.Published:return"badge-success";case OC.Archived:return"badge-danger";case OC.Draft:return"badge-warning";case OC.Pending:return"badge-info";case OC.Rejected:return"badge-dark";default:return"badge-secondary"}}function tw(e){var t=si(),n=!!e.rightslineId,r=nd(e.currentUser);return l.createElement(bi,null,n&&l.createElement(as,{label:"Rightsline ID",name:"rightslineId",id:"rightslineId",value:e.rightslineId,disabled:!0}),l.createElement(as,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this video",disabled:n,autoFocus:!0}),l.createElement("div",{className:"form-group"},l.createElement("label",null,"Status"),l.createElement("div",null,l.createElement("span",{className:"badge ".concat(ew(t.values.status))},OC[t.values.status]))),l.createElement(as,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this video here",disabled:n,showCharacterCounter:!0}),l.createElement(as,{label:"Production Year",type:"number",name:"productionYear",id:"productionYear",value:t.values.productionYear,disabled:n}),l.createElement(Fl,{ratings:e.ratings,disabled:n}),l.createElement(Sl,{imageType:Mu.Thumbnails,fieldName:"thumbnail",application:c.VIDEOS,uploadAction:i.Videos.UPLOAD_IMAGE}),l.createElement(Sl,{imageType:Mu.HeroBanners,fieldName:"heroBanner",application:c.VIDEOS,uploadAction:i.Videos.UPLOAD_IMAGE}),r&&l.createElement(XC,{themes:e.themes,tags:e.tags}),l.createElement(Is,{isNew:!e.id}))}function nw(e,t){if(e)return t?Object.assign(Object.assign({},e),t):e}function rw(e){var t;return l.createElement(ji,{initialValues:nw(e.video,e.rightslineVideo),validationSchema:AC,onSubmit:e.saveVideo,allowInitialSubmit:!!e.rightslineVideo},l.createElement(tw,{id:e.video&&e.video.id,ratings:e.ratings,themes:e.themes,tags:null===(t=e.video)||void 0===t?void 0:t.tags,currentUser:e.currentUser,rightslineId:e.rightslineId}))}function iw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ow(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ow(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ow(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function aw(e){var t,n=Object(b.useDispatch)(),r=iw(l.useState(!1),2),o=r[0],a=r[1],s=ce.useBasicFetch(mg(e.videoId)),u=ce.useBasicFetch(yg(e.videoId)),f=ce.useBasicFetch(tO()),p=ce.useBasicFetch(qO(VO.Glance)),d=ce.useBasicFetch(Bp());var m,h=!!s.data&&!!f.data&&!!p.data&&!!d.data&&u.isComplete;return l.createElement(l.Fragment,null,!!d.data&&l.createElement(EC,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO,currentUser:d.data}),!!u.data&&l.createElement("div",{className:"pt-3 text-right"},l.createElement(Ii.Button,{variant:"outline-dark",size:"sm",onClick:function(){u.isFetching||(a(!0),ce.fetch(n,yg(e.videoId)))}},"Sync from Rightsline")),h&&l.createElement(rw,{video:s.data,saveVideo:function(t,r){ce.fetch(n,vg(e.videoId,t,null,null,r))},ratings:f.data,themes:p.data,currentUser:d.data,rightslineId:null===(t=u.data)||void 0===t?void 0:t.rightslineId,rightslineVideo:o&&u.data}),l.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit video page ",l.createElement(Pu,{className:"info-link",appLink:(m=e.videoId,{application:c.VIDEOS,action:i.Videos.LEGACY_EDIT_VIDEO,args:[m]})},"here"),"."))}function cw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sw(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uw(e){var t=cw(l.useState({}),2),n=t[0],r=t[1],o=ce.useBasicFetch(mg(e.videoId)),a=ce.useBasicFetch(Bp()),c=mp(u.SUBJECT);!function(e,t,n){var r=function(e){return Qh(n,e)};Zh(Nv.getObjectLevelsFetchOptions(e,uy.Videos,r("videoLevels")),[e]),Zh(Nv.getObjectAudiencesFetchOptions(e,uy.Videos,r("videoAudiences")),[e,t.videoLevels]),$h([Nv.getPresentationsFetchOptions(r("presentations")),Nv.getLevelsFetchOptions(r("levels"))],[]),Zh(!!t.currentPresentation&&Nv.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.videoId,n,r),Gb(n,r);var s=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.videoLevels&&n.videoAudiences);return l.createElement(l.Fragment,null,!!a.data&&l.createElement(EC,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO_AUDIENCES,currentUser:a.data}),l.createElement(Ml,{object:o.data}),!!s&&l.createElement(zv,{objectLevels:n.videoLevels,objectAudiences:n.videoAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Qh(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:uy.Videos,saveLevels:function(t,n,r){return c.updateObjectLevels(e.videoId,t,uy.Videos,n,r,r)},saveAudiences:function(t,r){return c.updateObjectAudiences(e.videoId,n.currentPresentation.id,t,uy.Videos,r,r)}}))}function lw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||pw(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fw(e){return function(e){if(Array.isArray(e))return dw(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||pw(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pw(e,t){if(e){if("string"==typeof e)return dw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dw(e,t):void 0}}function dw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mw(e){var t=lw(l.useState({}),2),n=t[0],r=t[1],o=ce.useBasicFetch(mg(e.videoId)),a=ce.useBasicFetch(Bp()),c=mp(u.SUBJECT);!function(e,t,n){var r=function(e){return Qh(n,e)};$h([Nv.getSubjectTreeFetchOptions(r("subjectTree")),Nv.getPresentationsFetchOptions(r("presentations"))],[]),Zh(Nv.getObjectSubjectsFetchOptions(e,uy.Videos,r("videoSubjects")),[e]),Zh(!!t.currentPresentation&&Nv.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),l.useEffect((function(){return r("subjectClassifications")([])}),[t.videoSubjects]);var i=function(e,t){return[].concat(fw(t.subjectClassifications||[]),fw(e))},o=t.videoSubjects&&t.videoSubjects.map((function(e){return Nv.getSubjectClassificationFetchOptions(e.id,Qh(n,"subjectClassifications",i))}));$h(o,[t.videoSubjects],!!o),Zh(Nv.getObjectClassificationsFetchOptions(e,uy.Videos,r("videoClassifications")),[e,t.videoSubjects])}(e.videoId,n,r),Gb(n,r);var s=!!(n.videoSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.videoClassifications&&n.subjectClassifications);return l.createElement(l.Fragment,null,!!a.data&&l.createElement(EC,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO_SUBJECTS,currentUser:a.data}),l.createElement(Ml,{object:o.data}),s&&l.createElement(Lb,{objectSubjects:n.videoSubjects,subjectTree:n.subjectTree,memberType:uy.Videos,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Qh(r,"currentPresentation"),objectClassifications:n.videoClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return c.updateObjectSubjects(e.videoId,t,uy.Videos,n,r,r)},saveClassifications:function(t,r){return c.updateObjectClassifications(e.videoId,n.currentPresentation.id,t,uy.Videos,r,r)}}))}var hw=function(e){return{key:"aliases:".concat(e),url:"/api/master/v2/objects/".concat(e,"/aliases")}},yw=function(e,t,n,r){return{key:"create:alias",url:"/api/master/v2/objects/".concat(e,"/aliases"),type:se.a.POST,invalidationKeys:"aliases:".concat(e),data:t,success:n,error:r}},vw=function(e,t,n,r){return{key:"delete:alias",url:"/api/domain/v2/objects/".concat(e,"/aliases/").concat(t),type:se.a.DELETE,invalidationKeys:"aliases:".concat(e),success:n,error:r}};function bw(e){var t=Object(b.useDispatch)(),n=jp(),r=ce.useBasicFetch(hw(e.videoId)),o=ce.useBasicFetch(Bp());return r.data?l.createElement(l.Fragment,null,!!o.data&&l.createElement(EC,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO_ALIASES,currentUser:o.data}),l.createElement(Df,{aliases:r.data.data,onSave:function(r,i){ce.fetch(t,yw(e.videoId,r,(function(){n.success("Successfully created alias"),i()}),(function(){n.error("Something went wrong creating your alias")})))},onDelete:function(r){ce.fetch(t,vw(e.videoId,r,(function(){n.success("Successfully deleted alias")}),(function(){n.error("Something went wrong deleting your alias")})))}})):l.createElement(l.Fragment,null,"Loading...")}function gw(e){return(gw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ew(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ow(e,t,n){return t&&Ew(e.prototype,t),n&&Ew(e,n),e}function Cw(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ww(e,t)}function ww(e,t){return(ww=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Aw(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Tw(e);if(t){var i=Tw(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return jw(this,n)}}function jw(e,t){return!t||"object"!==gw(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Tw(e){return(Tw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var kw,Iw,Lw=function(e){Cw(n,e);var t=Aw(n);function n(){return Sw(this,n),t.apply(this,arguments)}return Ow(n,[{key:"channelName",get:function(){return c.VIDEOS}},{key:"appRoutes",get:function(){return{"manage/videos/:id(/)":"editVideo","manage/videos/:id/audiences(/)":"editVideoAudiences","manage/videos/:id/classifications(/)":"editVideoSubjects","manage/videos/:id/aliases(/)":"editVideoAliases","tools/programlookup/:id":"legacyEditVideo"}}},{key:"appLinks",get:function(){return["uploadImage"]}}]),n}(p.AppRouter),_w=function(e){Cw(n,e);var t=Aw(n);function n(){return Sw(this,n),t.apply(this,arguments)}return Ow(n,[{key:"initialize",value:function(){var e=this;wi.a.values(u).forEach((function(t){return dp.getInstance(t,e)}))}},{key:"name",get:function(){return"Videos Application"}},{key:"channelName",get:function(){return c.VIDEOS}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{provider:gC,alertRegion:_}}}},{key:"editVideo",value:function(e){this.layout.showChildView(I,l.createElement(aw,{videoId:e}))}},{key:"editVideoAudiences",value:function(e){this.layout.showChildView(I,l.createElement(uw,{videoId:e}))}},{key:"editVideoSubjects",value:function(e){this.layout.showChildView(I,l.createElement(mw,{videoId:e}))}},{key:"editVideoAliases",value:function(e){this.layout.showChildView(I,l.createElement(bw,{videoId:e}))}},{key:"legacyEditVideo",value:function(e){p.LocationUtils.Redirect("/tools/programlookup/".concat(e))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(L,l.createElement(ph,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}}],[{key:"router",get:function(){return Lw}}]),n}(op);function Pw(e){return(Pw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xw(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Nw(e,t)}function Nw(e,t){return(Nw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Rw(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Mw(e);if(t){var i=Mw(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Dw(this,n)}}function Dw(e,t){return!t||"object"!==Pw(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Mw(e){return(Mw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Uw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vw(e,t,n){return t&&Fw(e.prototype,t),n&&Fw(e,n),e}!function(e){e.UPDATE="UPDATE_VIEW_MODEL"}(kw||(kw={})),function(e){e.LocalStorage="localStorage",e.SessionStorage="sessionStorage"}(Iw||(Iw={}));var Bw=function(){function e(t){if(Uw(this,e),this.cachePrefix="_cv:",this.expireTime=3600,this.hasSupport=this.hasBrowserSupport(),this.type=t.type,this.hasSupport)try{this.storage=window[this.type]}catch(e){}}return Vw(e,[{key:"get",value:function(e){if(this.hasSupport){var t=this.storage.getItem(e);try{return JSON.parse(t)}catch(e){return t}}}},{key:"set",value:function(e,t){if(this.hasSupport)try{return this.storage.removeItem(e),"string"!=typeof t?(this.storage.setItem(e,JSON.stringify(t)),!0):(this.storage.setItem(e,t),!0)}catch(e){return!1}}},{key:"remove",value:function(e){if(this.hasSupport)return this.storage.removeItem(e)}},{key:"length",value:function(){if(this.hasSupport)return this.storage.length}},{key:"clear",value:function(){if(this.hasSupport)return this.storage.clear()}},{key:"cacheSet",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.expireTime;this.cacheClean();var r={time:this.getCurrentTime()+1e3*n,data:null!=t&&t};return this.set("".concat(this.cachePrefix).concat(e),r)}},{key:"cacheGet",value:function(e){var t="".concat(this.cachePrefix).concat(e),n=this.get(t);return n?this.isExpired(n)?(this.remove(t),null):n.data:null}},{key:"cacheExists",value:function(e){var t="".concat(this.cachePrefix).concat(e),n=this.get(t);return!!n&&(!this.isExpired(n)||(this.remove(t),!1))}},{key:"cacheRemove",value:function(e){return this.remove("".concat(this.cachePrefix).concat(e))}},{key:"cacheFlush",value:function(){this.cacheClean()}},{key:"cacheClean",value:function(){if(this.hasSupport)for(var e=0;e<this.storage.length;e++){var t=this.storage.key(e);if(0===t.indexOf(this.cachePrefix)){var n=this.get(t);n&&n.time&&this.isExpired(n)&&this.remove(t)}}}},{key:"isExpired",value:function(e){return e.time<this.getCurrentTime()}},{key:"getCurrentTime",value:function(){return(new Date).getTime()}},{key:"hasBrowserSupport",value:function(){try{return this.type in window&&null!==window[this.type]}catch(e){return!1}}}]),e}(),Hw=function(e){xw(n,e);var t=Rw(n);function n(){return Uw(this,n),t.apply(this,arguments)}return Vw(n,null,[{key:"Instance",get:function(){return this.instance||(this.instance=new this({type:Iw.LocalStorage}))}}]),n}(Bw),zw=function(e){xw(n,e);var t=Rw(n);function n(){return Uw(this,n),t.apply(this,arguments)}return Vw(n,null,[{key:"Instance",get:function(){return this.instance||(this.instance=new this({type:Iw.SessionStorage}))}}]),n}(Bw),qw=Hw.Instance,Jw=zw.Instance;var $w=function(e,t,n){var r,i=(r=null==n?void 0:n.storage)?r===Iw.SessionStorage?Jw:qw:null,o=Object(b.useDispatch)(),a=Object(b.useSelector)((function(t){return t.viewModelData[e]})),c=void 0!==t&&void 0===a;if(c)u(t);else if(i&&void 0===a){var s=i.get(e);u("undefined"===s?null:s)}function u(t,n){i&&function(t,n){if(!i)return;var r=i.get(e);if("string"==typeof t&&void 0!==n)return void i.set(e,Object.assign(Object.assign({},r),{dataOrKey:n}));i.set(e,t)}(t,n),o({type:kw.UPDATE,payload:{viewModelKey:e,dataOrKey:t,keyData:n}})}return c?[t,u]:[null!=a?a:void 0,u]},Kw="release:notes:config",Ww=[{id:"798",name:"Monorepo"},{id:"109",name:"Online"},{id:"822",name:"Lite"},{id:"534",name:"Library Editor"},{id:"62",name:"Curator"}];function Yw(e){var t=si(),n=us(t),r="798"===t.values.project;return f.a.useEffect((function(){e.getMilestones(t.values.project),r&&e.getBranchNames(t.values.project)}),[t.values.project]),f.a.useEffect((function(){t.setFieldValue("milestone",Hp.a.first(e.milestones))}),[e.milestones]),f.a.useEffect((function(){t.setFieldValue("branchName",Hp.a.first(e.branchNames))}),[e.branchNames]),f.a.createElement(bi,null,f.a.createElement(as,{as:"select",label:"Project",name:"project",id:"project",value:t.values.project},Ww.map((function(e){return f.a.createElement("option",{key:e.id,value:e.id},e.name)}))),f.a.createElement(as,{as:"select",label:"Milestone",name:"milestone",id:"milestone",value:t.values.milestone,disabled:!e.milestones.length},e.milestones.map((function(e){return f.a.createElement("option",{key:e,value:e},e)}))),r&&f.a.createElement(as,{as:"select",label:"Branch Name",name:"branchName",id:"branchName",value:t.values.branchName,disabled:!e.branchNames.length},e.branchNames.map((function(e){return f.a.createElement("option",{key:e,value:e},e)}))),f.a.createElement("div",{className:"d-flex justify-content-between"},f.a.createElement(Pf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Generate")))}var Gw="U_Jxes3Htv-xiaDX5wfn",Zw="https://gitlab.cvinternal.net/api/v4",Qw=function(e,t){return{key:"milestones:".concat(e),url:qu("".concat(Zw,"/projects/").concat(e,"/milestones"),{private_token:Gw}),normalize:!1,formatData:function(e){return e.map((function(e){return e.title}))},success:t}},Xw=function(e,t){return{key:"branch:names:".concat(e),url:qu("".concat(Zw,"/projects/").concat(e,"/repository/branches"),{private_token:Gw,per_page:50}),normalize:!1,formatData:function(e){return e.map((function(e){return e.name}))},success:t}},eA=function(e,t,n,r){return{key:"merge:requests:".concat(e,":").concat(t,":").concat(n),url:qu("".concat(Zw,"/projects/").concat(e,"/merge_requests"),{private_token:Gw,milestone:t,state:"merged",per_page:50,page:n}),success:r}},tA=function(e,t,n){return{key:"file:paths:".concat(t,":").concat(e),url:qu("".concat(Zw,"/projects/").concat(e,"/search"),{scope:"blobs",search:t,private_token:Gw}),normalize:!1,formatData:function(e){return e.filter((function(e){return e.filename.includes(t)}))},success:n}},nA=function(e,t,n,r){return{key:"file:".concat(e,":").concat(t,":").concat(n),url:qu("".concat(Zw,"/projects/").concat(e,"/repository/files/").concat(encodeURIComponent(t),"/raw"),{ref:n,private_token:Gw}),normalize:!1,formatData:function(e){return JSON.parse(e)},success:r}},rA=Ti.object().shape({project:Ti.string().required("Project is required").default(""),milestone:Ti.string().required("Milestone is required").default(""),branchName:Ti.string().when("project",(function(e,t){return"798"===e?t.required("Branch name is required"):t})).default("")}).noUnknown();function iA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return oA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oA(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var aA={project:Hp.a.first(Ww).id};function cA(){var e=iA(f.a.useState([]),2),t=e[0],n=e[1],r=iA(f.a.useState([]),2),o=r[0],a=r[1],s=iA($w(Kw),2)[1],u=Object(b.useDispatch)();return f.a.createElement(f.a.Fragment,null,f.a.createElement("h4",{className:"py-2"},"Generate Release Notes"),f.a.createElement(ji,{initialValues:aA,onSubmit:function(e){s(e),p.AppLinkHelper.trigger({application:c.RELEASE_NOTES,action:i.ReleaseNotes.GENERATOR})},validationSchema:rA},f.a.createElement(Yw,{getMilestones:function(e){n([]),ce.fetch(u,Qw(e,n))},milestones:t,getBranchNames:function(e){a([]),ce.fetch(u,Xw(e,a))},branchNames:o})))}var sA=n(219),uA=/#*/;function lA(e){return e=e.replace("-"," "),e="## "+(e=(e=zl(e)).replace(uA,"").trim())}function fA(e){var t=e.toLowerCase();return"## notes"===t||"## dependencies"===t}function pA(e){return e=e.replace("-"," "),e=zl(e)}function dA(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return mA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function mA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hA=["# online","# curator","# library editor","# lite","# styles","# tooling","# analytics","# common","# shared","# player"];function yA(e){for(var t={name:"",changes:""},n=0;t.name||n<e.length;n++){var r=e[n];if(!r)break;if("#"===r){var i=e.indexOf("\n",n),o=e.slice(n,i);hA.includes(o.toLowerCase().trim())&&(t.name=zl(o.replace("#","").trim()),e=e.slice(i),n=-1)}}for(var a=0;!t.changes&&a<e.length;a++){if(a+1===e.length){t.changes=e,e="";break}if("#"===e[a]&&"#"!==e[a+1]){var c=e.indexOf("\n",a),s=e.slice(a,c);hA.includes(s.toLowerCase().trim())&&(t.changes=e.slice(0,a),e=e.slice(a),a=-1)}}return{section:t,remainingDescription:e}}function vA(e){var t,n={},r=dA(e);try{for(r.s();!(t=r.n()).done;)for(var i=t.value;i;){var o=yA(i),a=o.section;if(i=o.remainingDescription,!a.name)break;n[a.name]||(n[a.name]=[]),n[a.name].push(a.changes)}}catch(e){r.e(e)}finally{r.f()}var c={};return Object.keys(n).forEach((function(e){var t,r;c[e]=(t=n[e],r={},t.forEach((function(e){for(var t=e.split("");t&&t.length;){for(var n=0;n<t.length&&t.length!==n+1;n++)if("#"===t[n]&&"#"===t[n+1]){var i=t.indexOf("\n",n),o=pA(t.slice(n,i).join(""));r[o]||(r[o]="");for(var a=i;a<t.length;a++){if(t.length===a+1){var c=t.slice(i+1).join("");r[o]+=c,t=[];break}if("#"===t[a]&&"#"===t[a+1]){var s=t.slice(i+1,a).join("");if(!s.length){t=t.slice(a),n=-1;break}r[o]+=s,t=t.slice(a),n=-1;break}}r[o]+="\n"}break}})),Object.keys(r).reduce((function(e,t){return e+=t+"\n",e+=r[t]+"\n"}),""))})),Object.keys(c).reduce((function(e,t){return e+="\n",e+="\n# ".concat(t),e+="\n".concat(c[t])}),"")}var bA=n(220),gA=n.n(bA);function SA(e){return function(e){if(Array.isArray(e))return CA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||OA(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function EA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||OA(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function OA(e,t){if(e){if("string"==typeof e)return CA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?CA(e,t):void 0}}function CA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wA(){var e=EA(f.a.useState(!0),2),t=e[0],n=e[1],r=EA(f.a.useState(1),2),o=r[0],a=r[1],s=EA(f.a.useState([]),2),u=s[0],l=s[1],d=EA(f.a.useState([]),2),m=d[0],h=d[1],y=EA(f.a.useState(!0),2),v=y[0],g=y[1],S=EA(f.a.useState(""),2),E=S[0],O=S[1],C=EA(f.a.useState("Copy"),2),w=C[0],A=C[1],j=EA($w(Kw),1)[0],T=j&&"798"===j.project,k=Object(b.useDispatch)();return f.a.useEffect((function(){if(j){var e=j.project,t=j.milestone;ce.fetch(k,eA(e,t,o,(function(e){l([].concat(SA(u),SA(e))),50===e.length?a(o+1):n(!1)})))}}),[o]),f.a.useEffect((function(){if(!(t||T&&v)){var e=u.map((function(e){return e.description.replace("\r\n","\n").replace("\r","")})),n=T?function(e,t){var n=function(e){var t="# Final Package Versions\n\n| Package | Version |\n| ------------------------- | ------------------------ |\n| @clickview/analytics | <analytics-version> |\n| @clickview/styles | <styles-version> |\n| @clickview/tooling | <tooling-version> |\n| @clickview/curator | <curator-version> |\n| @clickview/library-editor | <library-editor-version> |\n| @clickview/lite | <lite-version> |\n| @clickview/online | <online-version> |\n| @clickview/player | <player-version> |\n";return e.forEach((function(e){var n=e.name,r=e.version;r&&(t=t.replace("<".concat(n.replace("@clickview/",""),"-version>"),r))})),t}(t),r=vA(e);return"".concat(n,"\n").concat(r)}(e,m):function(e){var t={};return e.forEach((function(e){for(var n=e.split("");;){var r=!1;if(!n||!n.length)break;for(var i=0;i<n.length&&n.length!==i+1;i++)if("#"===n[i]){var o=n.indexOf("\n",i),a=lA(n.slice(i,o).join(""));t[a]||(fA(a)?r=!0:t[a]="");for(var c=o;c<n.length;c++){if(n.length===c+1){if(r){r=!1,n=[];break}var s=n.slice(o+1).join("");t[a]+=s,n=[];break}if("#"===n[c]){if(r){r=!1,n=n.slice(c),i=-1;break}var u=n.slice(o+1,c).join("");if(!u.length){n=n.slice(c),i=-1;break}t[a]+=u,n=n.slice(c),i=-1;break}}t[a]?t[a]+="\n":delete t[a]}break}})),Object.keys(t).reduce((function(e,n){return t[n]?(e+=n+"\n",e+=t[n]+"\n"):e}),"")}(e);O(n)}}),[t,v]),f.a.useEffect((function(){if(j&&T){var e=[];ce.fetch(k,tA(j.project,"package.json",(function(t){var n,r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=OA(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;ce.fetch(k,nA(j.project,i.path,j.branchName,(function(n){e.push(n),e.length===t.length&&(h(e),g(!1))})))}}catch(e){r.e(e)}finally{r.f()}})))}}),[]),j?f.a.createElement(f.a.Fragment,null,E?f.a.createElement("div",{className:"position-relative border rounded p-3"},f.a.createElement(sA,{onCopy:function(){return A("Copied")},text:E},f.a.createElement("button",{className:"btn btn-outline-dark ".concat(gA.a.copyBtn)},w)),f.a.createElement("div",{dangerouslySetInnerHTML:{__html:RC()(E)}})):t?"Fetching merge requests..":"Merging descriptions.."):(p.AppLinkHelper.trigger({application:c.RELEASE_NOTES,action:i.ReleaseNotes.FORM}),f.a.createElement(f.a.Fragment,null))}function AA(e){return(AA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function kA(e,t,n){return t&&TA(e.prototype,t),n&&TA(e,n),e}function IA(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&LA(e,t)}function LA(e,t){return(LA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xA(e);if(t){var i=xA(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return PA(this,n)}}function PA(e,t){return!t||"object"!==AA(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xA(e){return(xA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var NA=function(e){IA(n,e);var t=_A(n);function n(){return jA(this,n),t.apply(this,arguments)}return kA(n,[{key:"channelName",get:function(){return c.RELEASE_NOTES}},{key:"appRoutes",get:function(){return{"developer/release-notes(/)":"index","developer/release-notes/generate(/)":"form","developer/release-notes/generator(/)":"generator"}}}]),n}(p.AppRouter),RA=function(e){IA(n,e);var t=_A(n);function n(){return jA(this,n),t.apply(this,arguments)}return kA(n,[{key:"name",get:function(){return"Release Notes Application"}},{key:"channelName",get:function(){return c.RELEASE_NOTES}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT}}},{key:"index",value:function(){p.AppLinkHelper.trigger({application:c.RELEASE_NOTES,action:i.ReleaseNotes.GENERATOR},{replace:!0})}},{key:"form",value:function(){this.layout.showChildView(I,l.createElement(cA,null))}},{key:"generator",value:function(){this.layout.showChildView(I,l.createElement(wA,null))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return Ou.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_,l.createElement(Dd,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return NA}}]),n}(p.Application),DA=function(e,t){var n="/api/domain/v1/search/users?q=".concat(e);return t&&(n+="&filter={page:".concat(t,"}")),{key:"users:search:".concat(e).concat(t?":".concat(t):""),url:n,formatData:df.convertLegacyPaginatedCollection}},MA=function(e){e.sort();var t="customers&".concat(e.map((function(e){return"id=".concat(e)})).join("&"));return{url:"/api/master/v2/objects?query.user=".concat(t),key:"users:".concat(e.join(","))}};function UA(e){return{application:c.USERS,action:i.Users.USER,args:[e.id]}}function FA(e){p.AppLinkHelper.trigger({application:c.USERS,action:i.Users.HOME,params:{query:e}})}function VA(e){var t,n,r=ce.useBasicFetch(!!e.query&&DA(e.query,e.cursor)),o=function(e){var t,n;return ce.useBasicFetch(!!(null===(n=null===(t=e.data)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)&&MA(e.data.data.map((function(e){return e.id}))))}(r),a=(null===(n=null===(t=r.data)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)?o.isComplete:r.isComplete;return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{className:"pb-3 w-50"},f.a.createElement(lu,{initialQuery:e.query,placeholder:"Search for a user by name, username or email...",onSuggestionSelected:function(e){return p.AppLinkHelper.trigger(UA(e))},onSubmit:FA})),a&&(r.data.data.length?f.a.createElement(jl,{collection:r.data,columns:[{header:"Name",accessor:function(e){return"".concat(e.name," ").concat(e.surname)},appLink:UA},{header:"Username",accessor:"username",appLink:UA},{header:"Email",accessor:"email",appLink:UA},{header:"Customer",accessor:function(e){var t,n,r=null!==(n=null===(t=e.customers)||void 0===t?void 0:t.data)&&void 0!==n?n:[];return f.a.createElement("ul",{className:"list-unstyled"},r.map((function(e,t){return f.a.createElement("li",{key:t},f.a.createElement(Pu,{appLink:(n=e,{application:c.CUSTOMERS,action:i.Customers.MANAGE_CUSTOMER,args:[n.id]})},"".concat(e.name," - ").concat(e.crmId)));var n})))}}],collectionAppLink:{application:c.USERS,action:i.Users.HOME,params:{query:e.query}}}):f.a.createElement("p",null,"No users found, please try a different search query.")))}function BA(e){return(BA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function HA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qA(e,t,n){return t&&zA(e.prototype,t),n&&zA(e,n),e}function JA(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$A(e,t)}function $A(e,t){return($A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function KA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=YA(e);if(t){var i=YA(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return WA(this,n)}}function WA(e,t){return!t||"object"!==BA(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function YA(e){return(YA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var GA,ZA=function(e){JA(n,e);var t=KA(n);function n(){return HA(this,n),t.apply(this,arguments)}return qA(n,[{key:"channelName",get:function(){return c.USERS}},{key:"appRoutes",get:function(){return{"users(/)":"index"}}},{key:"externalRoutes",get:function(){return{"users/:id(/)":"user"}}}]),n}(p.AppRouter),QA=function(e){JA(n,e);var t=KA(n);function n(){return HA(this,n),t.apply(this,arguments)}return qA(n,[{key:"name",get:function(){return"Users Application"}},{key:"channelName",get:function(){return c.USERS}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{alertRegion:_}}}},{key:"index",value:function(e){this.layout.showChildView(I,l.createElement(VA,{query:e.query,cursor:e.cursor}))}}],[{key:"router",get:function(){return ZA}}]),n}(op);function XA(e){return(XA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ej(e){return function(e){if(Array.isArray(e))return tj(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return tj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tj(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rj(e,t){return(rj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ij(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=aj(e);if(t){var i=aj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return oj(this,n)}}function oj(e,t){return!t||"object"!==XA(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function aj(e){return(aj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Fifo="FifoMemoryCache"}(GA||(GA={}));var cj,sj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&rj(e,t)}(o,e);var t,n,r,i=ij(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this)).size=e.size,t.cache={},t.cachedkeys=[],t}return t=o,(n=[{key:"name",get:function(){return GA.Fifo}},{key:"removeCacheKey",value:function(e){this.cachedkeys=d.without(this.cachedkeys,e)}},{key:"has",value:function(e){return!!this.cache[e]}},{key:"get",value:function(e){return this.cache[e]}},{key:"set",value:function(e,t){e&&t||ds.c.throw(new ys.a("Must provide a cache key and a value to cache in FifoMemoryCache.")),this.has(e)&&this.removeCacheKey(e),this.cachedkeys.push(e),this.cache[e]=t,this.cachedkeys.length>this.size&&delete this.cache[this.cachedkeys.shift()]}},{key:"getOrSet",value:function(e,t){if(this.has(e))return this.get(e);var n=t();return this.set(e,n),n}},{key:"remove",value:function(e){return!!this.has(e)&&(delete this.cache[e],this.removeCacheKey(e),!0)}},{key:"invalidate",value:function(e,t){var n=this,r=d.object(this.cachedkeys,this.cachedkeys),i=[];d.each(e,(function(e){var t;r[e]&&i.push(e);var n=new RegExp(e,"i"),o=d.filter(r,(function(e){return n.test(e)}));(t=i).push.apply(t,ej(o))})),i.length&&(i=d.uniq(i),d.each(i,(function(e){delete n.cache[e],d.isFunction(t)&&t(e)})),this.cachedkeys=d.without.apply(d,[this.cachedkeys].concat(ej(i))))}}])&&nj(t.prototype,n),r&&nj(t,r),o}(ps.a),uj=n(17);!function(e){e[e.Unknown=0]="Unknown",e[e.BadRequest=1]="BadRequest",e[e.Unauthorized=2]="Unauthorized",e[e.Forbidden=3]="Forbidden",e[e.NotFound=4]="NotFound",e[e.InternalServer=5]="InternalServer"}(cj||(cj={}));var lj,fj={type:cj.Unknown,message:"",code:0};!function(e){e.Ajax="AjaxDataProvider",e.Notifications="NotificationsSignalRDataProvider"}(lj||(lj={}));var pj=function(e,t,n){if(!n||!n.errorCode)return e[t];var r="".concat(n.errorCode);return n.errorSubCode&&(r+=".".concat(n.errorSubCode)),e[r]||e[t]};function dj(e){return(dj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hj(e,t){return(hj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=bj(e);if(t){var i=bj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return vj(this,n)}}function vj(e,t){return!t||"object"!==dj(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function bj(e){return(bj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var gj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&hj(e,t)}(o,e);var t,n,r,i=yj(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=i.call(this,e),$.ajaxSetup({cache:!1,contentType:"application/json; charset=utf-8"}),t.successMiddleware={},t.errorMiddleware={},t.dataServiceErrorMessageMappings=e.dataServiceErrorMessageMappings,t.defaultErrorMessageKey=e.defaultErrorMessageKey,t}return t=o,(n=[{key:"name",get:function(){return lj.Ajax}},{key:"parseUrl",value:function(e){var t=document.createElement("a");return t.href=e,""===t.host&&(t.href=t.href),t}},{key:"makeHttps",value:function(e){var t=this.parseUrl(e);return"http:"===t.protocol&&(t.protocol="https:"),t.href}},{key:"base",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n||(n=se.a.GET);var i=d.defaults(r,{forceHttps:!1}),o={url:e,method:n,type:n};t&&(o.data=n===se.a.POST||n===se.a.PUT?JSON.stringify(t):t),i.forceHttps&&(o.url=this.makeHttps(o.url)),i.traditional&&(o.traditional=i.traditional);var a=$.ajax(o);return d.keys(this.successMiddleware).length&&a.done(d.values(this.successMiddleware)),d.keys(this.errorMiddleware).length&&a.fail(d.values(this.errorMiddleware)),a}},{key:"create",value:function(e,t,n){var r=n.channel,i=n.successEvent,o=n.errorEvent;this.base(e,t,se.a.POST).done((function(e,t,n){return r.trigger(i,e,t,n)})).fail((function(e,t,n){return r.trigger(o,e,t,n)}))}},{key:"read",value:function(e,t){var n=t.channel,r=t.successEvent,i=t.errorEvent;this.base(e,null,se.a.GET).done((function(e,t,i){n.trigger(r,e,t,i)})).fail((function(e,t,r){n.trigger(i,e,t,r)}))}},{key:"update",value:function(e,t,n){var r=n.channel,i=n.successEvent,o=n.errorEvent;this.base(e,t,se.a.PUT).done((function(e,t,n){return r.trigger(i,e,t,n)})).fail((function(e,t,n){return r.trigger(o,e,t,n)}))}},{key:"delete",value:function(e,t){var n=t.channel,r=t.successEvent,i=t.errorEvent;this.base(e,null,se.a.DELETE).done((function(e,t,i){return n.trigger(r,e,t,i)})).fail((function(e,t,r){return n.trigger(i,e,t,r)}))}},{key:"useMiddleware",value:function(e,t){this.successMiddleware[e]||(this.successMiddleware[e]=t)}},{key:"useErrorMiddleware",value:function(e,t){this.errorMiddleware[e]||(this.errorMiddleware[e]=t)}},{key:"parseError",value:function(e){var t=e.responseJSON,n=fj;switch(n.code=e.status,n.message=pj(this.dataServiceErrorMessageMappings,this.defaultErrorMessageKey,t),e.status){case 400:n.type=cj.BadRequest;break;case 401:n.type=cj.Unauthorized;break;case 403:n.type=cj.Forbidden;break;case 404:n.type=cj.NotFound;break;case 500:n.type=cj.InternalServer}return n}}])&&mj(t.prototype,n),r&&mj(t,r),o}(uj.Object);function Sj(e){return(Sj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ej(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oj(e,t){return"string"==typeof t.payload.dataOrKey&&void 0!==t.payload.keyData?Object.assign(Object.assign({},e),Ej({},t.payload.viewModelKey,Object.assign(Object.assign({},e[t.payload.viewModelKey]),Ej({},t.payload.dataOrKey,t.payload.keyData)))):("object"===Sj(t.payload.dataOrKey)&&Array.isArray(t.payload.dataOrKey),Object.assign(Object.assign({},e),Ej({},t.payload.viewModelKey,t.payload.dataOrKey)))}function Cj(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case kw.UPDATE:return Oj(e,t)}return e}var wj="LanguageDataService",Aj="locale",jj="phrases",Tj="language:data:service";function kj(e){return(kj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ij(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _j(e,t){return(_j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Nj(e);if(t){var i=Nj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return xj(this,n)}}function xj(e,t){return!t||"object"!==kj(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Nj(e){return(Nj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Rj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_j(e,t)}(o,e);var t,n,r,i=Pj(o);function o(){return Ij(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"name",get:function(){return wj}},{key:"channelName",get:function(){return Tj}},{key:"getLanguageConfig",value:function(e){var t={locale:"",phrases:null};this.get({resource:"/api/locale",eventPrefix:Aj,expiryTime:hy.STANDARD,bootstrapName:Up,callback:function(n){t.locale=n,t.phrases&&d.isFunction(e)&&e(t)}}),this.get({resource:"/api/phrases",eventPrefix:jj,expiryTime:hy.STANDARD,bootstrapName:Fp,callback:function(n){t.phrases=n,t.locale&&d.isFunction(e)&&e(t)}})}}])&&Lj(t.prototype,n),r&&Lj(t,r),o}(dy);n.d(t,"Layouts",(function(){return a})),n.d(t,"AppChannels",(function(){return c})),n.d(t,"DataChannels",(function(){return s})),n.d(t,"Actions",(function(){return i})),n.d(t,"DataPrefixes",(function(){return o})),n.d(t,"DataServices",(function(){return u})),n.d(t,"CuratorLayoutView",(function(){return z})),n.d(t,"LayoutComponent",(function(){return Y})),n.d(t,"CuratorAppNavService",(function(){return ae})),n.d(t,"CompaniesApplication",(function(){return Zf})),n.d(t,"CustomersApplication",(function(){return Td})),n.d(t,"DomainOptionsApplication",(function(){return wm})),n.d(t,"PeopleApplication",(function(){return nh})),n.d(t,"PlaylistsApplication",(function(){return XE})),n.d(t,"SeriesApplication",(function(){return TO})),n.d(t,"SubjectDataService",(function(){return Pv})),n.d(t,"SubjectDataServiceHelper",(function(){return Nv})),n.d(t,"SubjectsApplication",(function(){return HO})),n.d(t,"ThemesApplication",(function(){return bC})),n.d(t,"VideosApplication",(function(){return _w})),n.d(t,"DomainOptionsApplication",(function(){return wm})),n.d(t,"ReleaseNotesApplication",(function(){return RA})),n.d(t,"UsersApplication",(function(){return QA})),n.d(t,"Core",(function(){return p})),n.d(t,"InstanceManager",(function(){return dp})),n.d(t,"FifoMemoryCache",(function(){return sj})),n.d(t,"AjaxDataProvider",(function(){return gj})),n.d(t,"AlertList",(function(){return Dd})),n.d(t,"AlertType",(function(){return hp})),n.d(t,"BaseAlertService",(function(){return Ap})),n.d(t,"LanguageService",(function(){return js})),n.d(t,"Flight",(function(){return ce})),n.d(t,"CacheDurations",(function(){return hy})),n.d(t,"ViewModelReducer",(function(){return Cj})),n.d(t,"LanguageDataService",(function(){return Rj}))}])}));
|
|
17
|
+
*/var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,b=r?Symbol.for("react.block"):60121,g=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function O(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case f:case p:case a:case s:case c:case m:return e;default:switch(e=e&&e.$$typeof){case l:case d:case v:case y:case u:return e;default:return t}}case o:return t}}}function C(e){return O(e)===p}t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=u,t.Element=i,t.ForwardRef=d,t.Fragment=a,t.Lazy=v,t.Memo=y,t.Portal=o,t.Profiler=s,t.StrictMode=c,t.Suspense=m,t.isAsyncMode=function(e){return C(e)||O(e)===f},t.isConcurrentMode=C,t.isContextConsumer=function(e){return O(e)===l},t.isContextProvider=function(e){return O(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return O(e)===d},t.isFragment=function(e){return O(e)===a},t.isLazy=function(e){return O(e)===v},t.isMemo=function(e){return O(e)===y},t.isPortal=function(e){return O(e)===o},t.isProfiler=function(e){return O(e)===s},t.isStrictMode=function(e){return O(e)===c},t.isSuspense=function(e){return O(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===s||e===c||e===m||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===y||e.$$typeof===u||e.$$typeof===l||e.$$typeof===d||e.$$typeof===g||e.$$typeof===S||e.$$typeof===E||e.$$typeof===b)},t.typeOf=O},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),a=f(o),c=f(n(33)),s=f(n(228)),u=f(n(229)),l=n(237);function f(e){return e&&e.__esModule?e:{default:e}}var p=function(){return!0},d=function(e){function t(e){var n=e.alwaysRenderSuggestions;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return m.call(r),r.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null},r.justPressedUpDown=!1,r.justMouseEntered=!1,r.pressedSuggestion=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("mouseup",this.onDocumentMouseUp),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"componentWillReceiveProps",value:function(e){(0,s.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions():this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,i=n.onSuggestionHighlighted,o=n.highlightFirstSuggestion;if(!(0,s.default)(r,e.suggestions)&&r.length>0&&o)this.highlightFirstSuggestion();else if(i){var a=this.getHighlightedSuggestion();a!=t.highlightedSuggestion&&i({suggestion:a})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("mouseup",this.onDocumentMouseUp)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var r=this;this.setState((function(i){var o=i.valueBeforeUpDown;return null===t?o=null:null===o&&void 0!==n&&(o=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:o}}))}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState((function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:e?null:n}}))}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,i=n.multiSection,o=n.getSectionSuggestions;return i?o(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,i=r.value,o=r.onChange;t!==i&&o(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,i=n.value;return t.length>0&&r(i)}},{key:"getQuery",value:function(){var e=this.props.inputProps.value,t=this.state.valueBeforeUpDown;return(null===t?e:t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,i=t.renderInputComponent,o=t.onSuggestionsFetchRequested,c=t.renderSuggestion,s=t.inputProps,f=t.multiSection,d=t.renderSectionTitle,m=t.id,h=t.getSectionSuggestions,y=t.theme,v=t.getSuggestionValue,b=t.alwaysRenderSuggestions,g=t.highlightFirstSuggestion,S=this.state,E=S.isFocused,O=S.isCollapsed,C=S.highlightedSectionIndex,w=S.highlightedSuggestionIndex,A=S.valueBeforeUpDown,j=b?p:this.props.shouldRenderSuggestions,T=s.value,k=s.onFocus,I=s.onKeyDown,L=this.willRenderSuggestions(this.props),_=b||E&&!O&&L,P=_?n:[],x=r({},s,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=j(T);e.setState({isFocused:!0,isCollapsed:!n}),k&&k(t),n&&o({value:T,reason:"input-focused"})}},onBlur:function(t){e.justClickedOnSuggestionsContainer?e.input.focus():(e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested()))},onChange:function(t){var n=t.target.value,i=j(n);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(r({},g?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!i})),i?o({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var i=t.keyCode;switch(i){case 40:case 38:if(O)j(T)&&(o({value:T,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var a=r.newHighlightedSectionIndex,c=r.newHighlightedItemIndex,s=void 0;s=null===c?null===A?T:A:e.getSuggestionValueByIndex(a,c),e.updateHighlightedSuggestion(a,c,T),e.maybeCallOnChange(t,s,40===i?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout((function(){e.justPressedUpDown=!1}));break;case 13:if(229===t.keyCode)break;var u=e.getHighlightedSuggestion();if(_&&!b&&e.closeSuggestions(),null!=u){var l=v(u);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:u,suggestionValue:l,suggestionIndex:w,sectionIndex:C,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout((function(){e.justSelectedSuggestion=!1}))}break;case 27:_&&t.preventDefault();var f=_&&!b;if(null===A){if(!f){e.maybeCallOnChange(t,"","escape"),j("")?o({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,A,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}I&&I(t)}}),N={query:this.getQuery()};return a.default.createElement(u.default,{multiSection:f,items:P,renderInputComponent:i,renderItemsContainer:this.renderSuggestionsContainer,renderItem:c,renderItemData:N,renderSectionTitle:d,getSectionItems:h,highlightedSectionIndex:C,highlightedItemIndex:w,inputProps:x,itemProps:this.itemProps,theme:(0,l.mapToAutowhateverTheme)(y),id:m,ref:this.storeAutowhateverRef})}}]),t}(o.Component);d.propTypes={suggestions:c.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){var n=e[t];if("function"!=typeof n)throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:c.default.func,onSuggestionHighlighted:c.default.func,renderInputComponent:c.default.func,renderSuggestionsContainer:c.default.func,getSuggestionValue:c.default.func.isRequired,renderSuggestion:c.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:c.default.func,alwaysRenderSuggestions:c.default.bool,multiSection:c.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:c.default.bool,highlightFirstSuggestion:c.default.bool,theme:c.default.object,id:c.default.string},d.defaultProps={renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return a.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:l.defaultTheme,id:"1"};var m=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,i=n.itemIndex;e.updateHighlightedSuggestion(r,i),t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!0),e.justMouseEntered=!0,setTimeout((function(){e.justMouseEntered=!1}))},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onDocumentMouseUp=function(){e.pressedSuggestion&&!e.justSelectedSuggestion&&e.input.focus(),e.pressedSuggestion=null},this.onSuggestionMouseDown=function(t){e.justSelectedSuggestion||(e.justSelectedSuggestion=!0,e.pressedSuggestion=t.target)},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,i=r.alwaysRenderSuggestions,o=r.onSuggestionSelected,a=r.onSuggestionsFetchRequested;o&&o(t,n),i?a({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,i=n.focusInputOnSuggestionClick,o=e.getSuggestionIndices(e.findSuggestionElement(t.target)),a=o.sectionIndex,c=o.suggestionIndex,s=e.getSuggestion(a,c),u=e.props.getSuggestionValue(s);e.maybeCallOnChange(t,u,"click"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:u,suggestionIndex:c,sectionIndex:a,method:"click"}),r||e.closeSuggestions(),!0===i?e.input.focus():e.onBlur(),setTimeout((function(){e.justSelectedSuggestion=!1}))},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,i=n.value,o=n.onBlur,a=e.getHighlightedSuggestion(),c=r(i);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!c}),o&&o(e.blurEvent,{highlightedSuggestion:a})},this.onSuggestionMouseLeave=function(t){e.resetHighlightedSuggestion(!1),e.justSelectedSuggestion&&t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!1)},this.onSuggestionTouchStart=function(){e.justSelectedSuggestion=!0},this.onSuggestionTouchMove=function(){e.justSelectedSuggestion=!1,e.pressedSuggestion=null,e.input.focus()},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.onSuggestionMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionTouchStart,onTouchMove:e.onSuggestionTouchMove,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=d},function(e,t,n){"use strict";var r=n(227);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}},function(e,t,n){"use strict";e.exports=n(230).default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=d(a),s=d(n(33)),u=d(n(231)),l=d(n(232)),f=d(n(234)),p=d(n(235));function d(e){return e&&e.__esModule?e:{default:e}}var m={},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.storeInputReference=function(e){null!==e&&(n.input=e)},n.storeItemsContainerReference=function(e){null!==e&&(n.itemsContainer=e)},n.onHighlightedItemChange=function(e){n.highlightedItem=e},n.getItemId=function(e,t){return null===t?null:"react-autowhatever-"+n.props.id+"-"+(null===e?"":"section-"+e)+"-item-"+t},n.onFocus=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!0}),t.onFocus&&t.onFocus(e)},n.onBlur=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!1}),t.onBlur&&t.onBlur(e)},n.onKeyDown=function(e){var t=n.props,r=t.inputProps,o=t.highlightedSectionIndex,a=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var c="ArrowDown"===e.key?"next":"prev",s=n.sectionIterator[c]([o,a]),u=i(s,2),l=u[0],f=u[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:f});break;default:r.onKeyDown(e,{highlightedSectionIndex:o,highlightedItemIndex:a})}},n.highlightedItem=null,n.state={isInputFocused:!1},n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map((function(t){return e.getSectionItems(t)})),this.sectionsLengths=this.sectionsItems.map((function(e){return e.length})),this.allSectionsAreEmpty=this.sectionsLengths.every((function(e){return 0===e})))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,u.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,l.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,r=n.id,i=n.items,o=n.renderItem,a=n.renderItemData,s=n.renderSectionTitle,u=n.highlightedSectionIndex,l=n.highlightedItemIndex,d=n.itemProps;return i.map((function(n,i){var m="react-autowhatever-"+r+"-",h=m+"section-"+i+"-",y=0===i;return c.default.createElement("div",t(h+"container","sectionContainer",y&&"sectionContainerFirst"),c.default.createElement(f.default,{section:n,renderSectionTitle:s,theme:t,sectionKeyPrefix:h}),c.default.createElement(p.default,{items:e.sectionsItems[i],itemProps:d,renderItem:o,renderItemData:a,sectionIndex:i,highlightedItemIndex:u===i?l:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:m,ref:e.storeItemsListReference}))}))}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,r=n.id,i=n.renderItem,o=n.renderItemData,a=n.highlightedSectionIndex,s=n.highlightedItemIndex,u=n.itemProps;return c.default.createElement(p.default,{items:e,itemProps:u,renderItem:i,renderItemData:o,highlightedItemIndex:null===a?s:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+r+"-"})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,i=t.multiSection,o=t.renderInputComponent,a=t.renderItemsContainer,s=t.highlightedSectionIndex,u=t.highlightedItemIndex,l=this.state.isInputFocused,f=i?this.renderSections():this.renderItems(),p=null!==f,d=this.getItemId(s,u),m="react-autowhatever-"+n,h=r({role:"combobox","aria-haspopup":"listbox","aria-owns":m,"aria-expanded":p},e("react-autowhatever-"+n+"-container","container",p&&"containerOpen"),this.props.containerProps),y=o(r({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":m,"aria-activedescendant":d},e("react-autowhatever-"+n+"-input","input",p&&"inputOpen",l&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),v=a({containerProps:r({id:m,role:"listbox"},e("react-autowhatever-"+n+"-items-container","itemsContainer",p&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:f});return c.default.createElement("div",h,y,v)}}]),t}(a.Component);h.propTypes={id:s.default.string,multiSection:s.default.bool,renderInputComponent:s.default.func,renderItemsContainer:s.default.func,items:s.default.array.isRequired,renderItem:s.default.func,renderItemData:s.default.object,renderSectionTitle:s.default.func,getSectionItems:s.default.func,containerProps:s.default.object,inputProps:s.default.object,itemProps:s.default.oneOfType([s.default.object,s.default.func]),highlightedSectionIndex:s.default.number,highlightedItemIndex:s.default.number,theme:s.default.oneOfType([s.default.object,s.default.array])},h.defaultProps={id:"1",multiSection:!1,renderInputComponent:function(e){return c.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return c.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:m,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:m,inputProps:m,itemProps:m,highlightedSectionIndex:null,highlightedItemIndex:null,theme:{container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"}},t.default=h},function(e,t,n){"use strict";var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var t=e.data,n=e.multiSection;function i(e){var i=r(e,2),o=i[0],a=i[1];return n?null===a||a===t[o]-1?null===(o=function(e){for(null===e?e=0:e++;e<t.length&&0===t[e];)e++;return e===t.length?null:e}(o))?[null,null]:[o,0]:[o,a+1]:0===t||a===t-1?[null,null]:null===a?[null,0]:[null,a+1]}return{next:i,prev:function(e){var i=r(e,2),o=i[0],a=i[1];return n?null===a||0===a?null===(o=function(e){for(null===e?e=t.length-1:e--;e>=0&&0===t[e];)e--;return-1===e?null:e}(o))?[null,null]:[o,t[o]-1]:[o,a-1]:0===t||0===a?[null,null]:null===a?[null,t-1]:[null,a-1]},isLast:function(e){return null===i(e)[1]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var o,a=n(233),c=(o=a)&&o.__esModule?o:{default:o},s=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=r(t,2),o=n[0],a=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var u=n.map((function(e){return o[e]})).filter(s);return"string"==typeof u[0]||"function"==typeof a?{key:e,className:a?a.apply(void 0,i(u)):u.join(" ")}:{key:e,style:c.default.apply(void 0,[{}].concat(i(u)))}}},e.exports=t.default},function(e,t,n){"use strict";var r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function o(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter((function(t){return r.call(e,t)}))}e.exports=Object.assign||function(e,t){for(var n,r,a=i(e),c=1;c<arguments.length;c++){n=arguments[c],r=o(Object(n));for(var s=0;s<r.length;s++)a[r[s]]=n[r[s]]}return a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),o=s(i),a=s(n(33)),c=s(n(58));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=function(e){function t(){return u(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"shouldComponentUpdate",value:function(e){return(0,c.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,r=e.theme,i=e.sectionKeyPrefix,a=n(t);return a?o.default.createElement("div",r(i+"title","sectionTitle"),a):null}}]),t}(i.Component);f.propTypes={section:a.default.any.isRequired,renderSectionTitle:a.default.func.isRequired,theme:a.default.func.isRequired,sectionKeyPrefix:a.default.string.isRequired},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),a=l(o),c=l(n(33)),s=l(n(236)),u=l(n(58));function l(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(){var e,n,r;f(this,t);for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.storeHighlightedItemReference=function(e){r.props.onHighlightedItemChange(null===e?null:e.item)},p(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"shouldComponentUpdate",value:function(e){return(0,u.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,i=t.itemProps,o=t.renderItem,c=t.renderItemData,u=t.sectionIndex,l=t.highlightedItemIndex,f=t.getItemId,p=t.theme,d=t.keyPrefix,m=null===u?d:d+"section-"+u+"-",h="function"==typeof i;return a.default.createElement("ul",r({role:"listbox"},p(m+"items-list","itemsList")),n.map((function(t,n){var d=0===n,y=n===l,v=m+"item-"+n,b=h?i({sectionIndex:u,itemIndex:n}):i,g=r({id:f(u,n),"aria-selected":y},p(v,"item",d&&"itemFirst",y&&"itemHighlighted"),b);return y&&(g.ref=e.storeHighlightedItemReference),a.default.createElement(s.default,r({},g,{sectionIndex:u,isHighlighted:y,itemIndex:n,item:t,renderItem:o,renderItemData:c}))})))}}]),t}(o.Component);d.propTypes={items:c.default.array.isRequired,itemProps:c.default.oneOfType([c.default.object,c.default.func]),renderItem:c.default.func.isRequired,renderItemData:c.default.object.isRequired,sectionIndex:c.default.number,highlightedItemIndex:c.default.number,onHighlightedItemChange:c.default.func.isRequired,getItemId:c.default.func.isRequired,theme:c.default.func.isRequired,keyPrefix:c.default.string.isRequired},d.defaultProps={sectionIndex:null},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),a=u(o),c=u(n(33)),s=u(n(58));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p=function(e){function t(){var e,n,r;l(this,t);for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.storeItemReference=function(e){null!==e&&(r.item=e)},r.onMouseEnter=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onMouseEnter(e,{sectionIndex:n,itemIndex:i})},r.onMouseLeave=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onMouseLeave(e,{sectionIndex:n,itemIndex:i})},r.onMouseDown=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onMouseDown(e,{sectionIndex:n,itemIndex:i})},r.onClick=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onClick(e,{sectionIndex:n,itemIndex:i})},f(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"shouldComponentUpdate",value:function(e){return(0,s.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,i=e.renderItem,o=e.renderItemData,c=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete c.sectionIndex,delete c.itemIndex,"function"==typeof c.onMouseEnter&&(c.onMouseEnter=this.onMouseEnter),"function"==typeof c.onMouseLeave&&(c.onMouseLeave=this.onMouseLeave),"function"==typeof c.onMouseDown&&(c.onMouseDown=this.onMouseDown),"function"==typeof c.onClick&&(c.onClick=this.onClick),a.default.createElement("li",r({role:"option"},c,{ref:this.storeItemReference}),i(n,r({isHighlighted:t},o)))}}]),t}(o.Component);p.propTypes={sectionIndex:c.default.number,isHighlighted:c.default.bool.isRequired,itemIndex:c.default.number.isRequired,item:c.default.any.isRequired,renderItem:c.default.func.isRequired,renderItemData:c.default.object.isRequired,onMouseEnter:c.default.func,onMouseLeave:c.default.func,onMouseDown:c.default.func,onClick:c.default.func},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(239),a=v(o),c=v(n(179)),s=n(0),u=v(n(33)),l=v(n(247)),f=v(n(248)),p=v(n(249)),d=v(n(250)),m=v(n(251)),h=n(252),y=n(253);function v(e){return e&&e.__esModule?e:{default:e}}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var S=function(e){function t(e){var n;b(this,t);for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var a=g(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this,e].concat(i)));return a.getScrollLeft=a.getScrollLeft.bind(a),a.getScrollTop=a.getScrollTop.bind(a),a.getScrollWidth=a.getScrollWidth.bind(a),a.getScrollHeight=a.getScrollHeight.bind(a),a.getClientWidth=a.getClientWidth.bind(a),a.getClientHeight=a.getClientHeight.bind(a),a.getValues=a.getValues.bind(a),a.getThumbHorizontalWidth=a.getThumbHorizontalWidth.bind(a),a.getThumbVerticalHeight=a.getThumbVerticalHeight.bind(a),a.getScrollLeftForOffset=a.getScrollLeftForOffset.bind(a),a.getScrollTopForOffset=a.getScrollTopForOffset.bind(a),a.scrollLeft=a.scrollLeft.bind(a),a.scrollTop=a.scrollTop.bind(a),a.scrollToLeft=a.scrollToLeft.bind(a),a.scrollToTop=a.scrollToTop.bind(a),a.scrollToRight=a.scrollToRight.bind(a),a.scrollToBottom=a.scrollToBottom.bind(a),a.handleTrackMouseEnter=a.handleTrackMouseEnter.bind(a),a.handleTrackMouseLeave=a.handleTrackMouseLeave.bind(a),a.handleHorizontalTrackMouseDown=a.handleHorizontalTrackMouseDown.bind(a),a.handleVerticalTrackMouseDown=a.handleVerticalTrackMouseDown.bind(a),a.handleHorizontalThumbMouseDown=a.handleHorizontalThumbMouseDown.bind(a),a.handleVerticalThumbMouseDown=a.handleVerticalThumbMouseDown.bind(a),a.handleWindowResize=a.handleWindowResize.bind(a),a.handleScroll=a.handleScroll.bind(a),a.handleDrag=a.handleDrag.bind(a),a.handleDragEnd=a.handleDragEnd.bind(a),a.state={didMountUniversal:!1},a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.addListeners(),this.update(),this.componentDidMountUniversal()}},{key:"componentDidMountUniversal",value:function(){this.props.universal&&this.setState({didMountUniversal:!0})}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"componentWillUnmount",value:function(){this.removeListeners(),(0,o.cancel)(this.requestFrame),clearTimeout(this.hideTracksTimeout),clearInterval(this.detectScrollingInterval)}},{key:"getScrollLeft",value:function(){return this.view?this.view.scrollLeft:0}},{key:"getScrollTop",value:function(){return this.view?this.view.scrollTop:0}},{key:"getScrollWidth",value:function(){return this.view?this.view.scrollWidth:0}},{key:"getScrollHeight",value:function(){return this.view?this.view.scrollHeight:0}},{key:"getClientWidth",value:function(){return this.view?this.view.clientWidth:0}},{key:"getClientHeight",value:function(){return this.view?this.view.clientHeight:0}},{key:"getValues",value:function(){var e=this.view||{},t=e.scrollLeft,n=void 0===t?0:t,r=e.scrollTop,i=void 0===r?0:r,o=e.scrollWidth,a=void 0===o?0:o,c=e.scrollHeight,s=void 0===c?0:c,u=e.clientWidth,l=void 0===u?0:u,f=e.clientHeight,p=void 0===f?0:f;return{left:n/(a-l)||0,top:i/(s-p)||0,scrollLeft:n,scrollTop:i,scrollWidth:a,scrollHeight:s,clientWidth:l,clientHeight:p}}},{key:"getThumbHorizontalWidth",value:function(){var e=this.props,t=e.thumbSize,n=e.thumbMinSize,r=this.view,i=r.scrollWidth,o=r.clientWidth,a=(0,d.default)(this.trackHorizontal),c=Math.ceil(o/i*a);return a===c?0:t||Math.max(c,n)}},{key:"getThumbVerticalHeight",value:function(){var e=this.props,t=e.thumbSize,n=e.thumbMinSize,r=this.view,i=r.scrollHeight,o=r.clientHeight,a=(0,m.default)(this.trackVertical),c=Math.ceil(o/i*a);return a===c?0:t||Math.max(c,n)}},{key:"getScrollLeftForOffset",value:function(e){var t=this.view,n=t.scrollWidth,r=t.clientWidth;return e/((0,d.default)(this.trackHorizontal)-this.getThumbHorizontalWidth())*(n-r)}},{key:"getScrollTopForOffset",value:function(e){var t=this.view,n=t.scrollHeight,r=t.clientHeight;return e/((0,m.default)(this.trackVertical)-this.getThumbVerticalHeight())*(n-r)}},{key:"scrollLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.view&&(this.view.scrollLeft=e)}},{key:"scrollTop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.view&&(this.view.scrollTop=e)}},{key:"scrollToLeft",value:function(){this.view&&(this.view.scrollLeft=0)}},{key:"scrollToTop",value:function(){this.view&&(this.view.scrollTop=0)}},{key:"scrollToRight",value:function(){this.view&&(this.view.scrollLeft=this.view.scrollWidth)}},{key:"scrollToBottom",value:function(){this.view&&(this.view.scrollTop=this.view.scrollHeight)}},{key:"addListeners",value:function(){if("undefined"!=typeof document&&this.view){var e=this.view,t=this.trackHorizontal,n=this.trackVertical,r=this.thumbHorizontal,i=this.thumbVertical;e.addEventListener("scroll",this.handleScroll),(0,f.default)()&&(t.addEventListener("mouseenter",this.handleTrackMouseEnter),t.addEventListener("mouseleave",this.handleTrackMouseLeave),t.addEventListener("mousedown",this.handleHorizontalTrackMouseDown),n.addEventListener("mouseenter",this.handleTrackMouseEnter),n.addEventListener("mouseleave",this.handleTrackMouseLeave),n.addEventListener("mousedown",this.handleVerticalTrackMouseDown),r.addEventListener("mousedown",this.handleHorizontalThumbMouseDown),i.addEventListener("mousedown",this.handleVerticalThumbMouseDown),window.addEventListener("resize",this.handleWindowResize))}}},{key:"removeListeners",value:function(){if("undefined"!=typeof document&&this.view){var e=this.view,t=this.trackHorizontal,n=this.trackVertical,r=this.thumbHorizontal,i=this.thumbVertical;e.removeEventListener("scroll",this.handleScroll),(0,f.default)()&&(t.removeEventListener("mouseenter",this.handleTrackMouseEnter),t.removeEventListener("mouseleave",this.handleTrackMouseLeave),t.removeEventListener("mousedown",this.handleHorizontalTrackMouseDown),n.removeEventListener("mouseenter",this.handleTrackMouseEnter),n.removeEventListener("mouseleave",this.handleTrackMouseLeave),n.removeEventListener("mousedown",this.handleVerticalTrackMouseDown),r.removeEventListener("mousedown",this.handleHorizontalThumbMouseDown),i.removeEventListener("mousedown",this.handleVerticalThumbMouseDown),window.removeEventListener("resize",this.handleWindowResize),this.teardownDragging())}}},{key:"handleScroll",value:function(e){var t=this,n=this.props,r=n.onScroll,i=n.onScrollFrame;r&&r(e),this.update((function(e){var n=e.scrollLeft,r=e.scrollTop;t.viewScrollLeft=n,t.viewScrollTop=r,i&&i(e)})),this.detectScrolling()}},{key:"handleScrollStart",value:function(){var e=this.props.onScrollStart;e&&e(),this.handleScrollStartAutoHide()}},{key:"handleScrollStartAutoHide",value:function(){this.props.autoHide&&this.showTracks()}},{key:"handleScrollStop",value:function(){var e=this.props.onScrollStop;e&&e(),this.handleScrollStopAutoHide()}},{key:"handleScrollStopAutoHide",value:function(){this.props.autoHide&&this.hideTracks()}},{key:"handleWindowResize",value:function(){this.update()}},{key:"handleHorizontalTrackMouseDown",value:function(e){e.preventDefault();var t=e.target,n=e.clientX,r=t.getBoundingClientRect().left,i=this.getThumbHorizontalWidth(),o=Math.abs(r-n)-i/2;this.view.scrollLeft=this.getScrollLeftForOffset(o)}},{key:"handleVerticalTrackMouseDown",value:function(e){e.preventDefault();var t=e.target,n=e.clientY,r=t.getBoundingClientRect().top,i=this.getThumbVerticalHeight(),o=Math.abs(r-n)-i/2;this.view.scrollTop=this.getScrollTopForOffset(o)}},{key:"handleHorizontalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);var t=e.target,n=e.clientX,r=t.offsetWidth,i=t.getBoundingClientRect().left;this.prevPageX=r-(n-i)}},{key:"handleVerticalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);var t=e.target,n=e.clientY,r=t.offsetHeight,i=t.getBoundingClientRect().top;this.prevPageY=r-(n-i)}},{key:"setupDragging",value:function(){(0,c.default)(document.body,h.disableSelectStyle),document.addEventListener("mousemove",this.handleDrag),document.addEventListener("mouseup",this.handleDragEnd),document.onselectstart=p.default}},{key:"teardownDragging",value:function(){(0,c.default)(document.body,h.disableSelectStyleReset),document.removeEventListener("mousemove",this.handleDrag),document.removeEventListener("mouseup",this.handleDragEnd),document.onselectstart=void 0}},{key:"handleDragStart",value:function(e){this.dragging=!0,e.stopImmediatePropagation(),this.setupDragging()}},{key:"handleDrag",value:function(e){if(this.prevPageX){var t=e.clientX,n=-this.trackHorizontal.getBoundingClientRect().left+t-(this.getThumbHorizontalWidth()-this.prevPageX);this.view.scrollLeft=this.getScrollLeftForOffset(n)}if(this.prevPageY){var r=e.clientY,i=-this.trackVertical.getBoundingClientRect().top+r-(this.getThumbVerticalHeight()-this.prevPageY);this.view.scrollTop=this.getScrollTopForOffset(i)}return!1}},{key:"handleDragEnd",value:function(){this.dragging=!1,this.prevPageX=this.prevPageY=0,this.teardownDragging(),this.handleDragEndAutoHide()}},{key:"handleDragEndAutoHide",value:function(){this.props.autoHide&&this.hideTracks()}},{key:"handleTrackMouseEnter",value:function(){this.trackMouseOver=!0,this.handleTrackMouseEnterAutoHide()}},{key:"handleTrackMouseEnterAutoHide",value:function(){this.props.autoHide&&this.showTracks()}},{key:"handleTrackMouseLeave",value:function(){this.trackMouseOver=!1,this.handleTrackMouseLeaveAutoHide()}},{key:"handleTrackMouseLeaveAutoHide",value:function(){this.props.autoHide&&this.hideTracks()}},{key:"showTracks",value:function(){clearTimeout(this.hideTracksTimeout),(0,c.default)(this.trackHorizontal,{opacity:1}),(0,c.default)(this.trackVertical,{opacity:1})}},{key:"hideTracks",value:function(){var e=this;if(!this.dragging&&!this.scrolling&&!this.trackMouseOver){var t=this.props.autoHideTimeout;clearTimeout(this.hideTracksTimeout),this.hideTracksTimeout=setTimeout((function(){(0,c.default)(e.trackHorizontal,{opacity:0}),(0,c.default)(e.trackVertical,{opacity:0})}),t)}}},{key:"detectScrolling",value:function(){var e=this;this.scrolling||(this.scrolling=!0,this.handleScrollStart(),this.detectScrollingInterval=setInterval((function(){e.lastViewScrollLeft===e.viewScrollLeft&&e.lastViewScrollTop===e.viewScrollTop&&(clearInterval(e.detectScrollingInterval),e.scrolling=!1,e.handleScrollStop()),e.lastViewScrollLeft=e.viewScrollLeft,e.lastViewScrollTop=e.viewScrollTop}),100))}},{key:"raf",value:function(e){var t=this;this.requestFrame&&a.default.cancel(this.requestFrame),this.requestFrame=(0,a.default)((function(){t.requestFrame=void 0,e()}))}},{key:"update",value:function(e){var t=this;this.raf((function(){return t._update(e)}))}},{key:"_update",value:function(e){var t=this.props,n=t.onUpdate,r=t.hideTracksWhenNotNeeded,i=this.getValues();if((0,f.default)()){var o=i.scrollLeft,a=i.clientWidth,s=i.scrollWidth,u=(0,d.default)(this.trackHorizontal),l=this.getThumbHorizontalWidth(),p={width:l,transform:"translateX("+o/(s-a)*(u-l)+"px)"},h=i.scrollTop,y=i.clientHeight,v=i.scrollHeight,b=(0,m.default)(this.trackVertical),g=this.getThumbVerticalHeight(),S={height:g,transform:"translateY("+h/(v-y)*(b-g)+"px)"};if(r){var E={visibility:s>a?"visible":"hidden"},O={visibility:v>y?"visible":"hidden"};(0,c.default)(this.trackHorizontal,E),(0,c.default)(this.trackVertical,O)}(0,c.default)(this.thumbHorizontal,p),(0,c.default)(this.thumbVertical,S)}n&&n(i),"function"==typeof e&&e(i)}},{key:"render",value:function(){var e=this,t=(0,f.default)(),n=this.props,i=(n.onScroll,n.onScrollFrame,n.onScrollStart,n.onScrollStop,n.onUpdate,n.renderView),o=n.renderTrackHorizontal,a=n.renderTrackVertical,c=n.renderThumbHorizontal,u=n.renderThumbVertical,p=n.tagName,d=(n.hideTracksWhenNotNeeded,n.autoHide),m=(n.autoHideTimeout,n.autoHideDuration),y=(n.thumbSize,n.thumbMinSize,n.universal),v=n.autoHeight,b=n.autoHeightMin,g=n.autoHeightMax,S=n.style,E=n.children,O=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(n,["onScroll","onScrollFrame","onScrollStart","onScrollStop","onUpdate","renderView","renderTrackHorizontal","renderTrackVertical","renderThumbHorizontal","renderThumbVertical","tagName","hideTracksWhenNotNeeded","autoHide","autoHideTimeout","autoHideDuration","thumbSize","thumbMinSize","universal","autoHeight","autoHeightMin","autoHeightMax","style","children"]),C=this.state.didMountUniversal,w=r({},h.containerStyleDefault,v&&r({},h.containerStyleAutoHeight,{minHeight:b,maxHeight:g}),S),A=r({},h.viewStyleDefault,{marginRight:t?-t:0,marginBottom:t?-t:0},v&&r({},h.viewStyleAutoHeight,{minHeight:(0,l.default)(b)?"calc("+b+" + "+t+"px)":b+t,maxHeight:(0,l.default)(g)?"calc("+g+" + "+t+"px)":g+t}),v&&y&&!C&&{minHeight:b,maxHeight:g},y&&!C&&h.viewStyleUniversalInitial),j={transition:"opacity "+m+"ms",opacity:0},T=r({},h.trackHorizontalStyleDefault,d&&j,(!t||y&&!C)&&{display:"none"}),k=r({},h.trackVerticalStyleDefault,d&&j,(!t||y&&!C)&&{display:"none"});return(0,s.createElement)(p,r({},O,{style:w,ref:function(t){e.container=t}}),[(0,s.cloneElement)(i({style:A}),{key:"view",ref:function(t){e.view=t}},E),(0,s.cloneElement)(o({style:T}),{key:"trackHorizontal",ref:function(t){e.trackHorizontal=t}},(0,s.cloneElement)(c({style:h.thumbHorizontalStyleDefault}),{ref:function(t){e.thumbHorizontal=t}})),(0,s.cloneElement)(a({style:k}),{key:"trackVertical",ref:function(t){e.trackVertical=t}},(0,s.cloneElement)(u({style:h.thumbVerticalStyleDefault}),{ref:function(t){e.thumbVertical=t}}))])}}]),t}(s.Component);t.default=S,S.propTypes={onScroll:u.default.func,onScrollFrame:u.default.func,onScrollStart:u.default.func,onScrollStop:u.default.func,onUpdate:u.default.func,renderView:u.default.func,renderTrackHorizontal:u.default.func,renderTrackVertical:u.default.func,renderThumbHorizontal:u.default.func,renderThumbVertical:u.default.func,tagName:u.default.string,thumbSize:u.default.number,thumbMinSize:u.default.number,hideTracksWhenNotNeeded:u.default.bool,autoHide:u.default.bool,autoHideTimeout:u.default.number,autoHideDuration:u.default.number,autoHeight:u.default.bool,autoHeightMin:u.default.oneOfType([u.default.number,u.default.string]),autoHeightMax:u.default.oneOfType([u.default.number,u.default.string]),universal:u.default.bool,style:u.default.object,children:u.default.node},S.defaultProps={renderView:y.renderViewDefault,renderTrackHorizontal:y.renderTrackHorizontalDefault,renderTrackVertical:y.renderTrackVerticalDefault,renderThumbHorizontal:y.renderThumbHorizontalDefault,renderThumbVertical:y.renderThumbVerticalDefault,tagName:"div",thumbMinSize:30,hideTracksWhenNotNeeded:!1,autoHide:!1,autoHideTimeout:1e3,autoHideDuration:200,autoHeight:!1,autoHeightMin:0,autoHeightMax:200,universal:!1}},function(e,t,n){(function(t){for(var r=n(240),i="undefined"==typeof window?t:window,o=["moz","webkit"],a="AnimationFrame",c=i["request"+a],s=i["cancel"+a]||i["cancelRequest"+a],u=0;!c&&u<o.length;u++)c=i[o[u]+"Request"+a],s=i[o[u]+"Cancel"+a]||i[o[u]+"CancelRequest"+a];if(!c||!s){var l=0,f=0,p=[];c=function(e){if(0===p.length){var t=r(),n=Math.max(0,1e3/60-(t-l));l=n+t,setTimeout((function(){var e=p.slice(0);p.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(l)}catch(e){setTimeout((function(){throw e}),0)}}),Math.round(n))}return p.push({handle:++f,callback:e,cancelled:!1}),f},s=function(e){for(var t=0;t<p.length;t++)p[t].handle===e&&(p[t].cancelled=!0)}}e.exports=function(e){return c.call(i,e)},e.exports.cancel=function(){s.apply(i,arguments)},e.exports.polyfill=function(e){e||(e=i),e.requestAnimationFrame=c,e.cancelAnimationFrame=s}}).call(this,n(84))},function(e,t,n){(function(t){(function(){var n,r,i,o,a,c;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:null!=t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,o=(n=function(){var e;return 1e9*(e=r())[0]+e[1]})(),c=1e9*t.uptime(),a=o-c):Date.now?(e.exports=function(){return Date.now()-i},i=Date.now()):(e.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(this,n(241))},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],l=!1,f=-1;function p(){l&&s&&(l=!1,s.length?u=s.concat(u):f=-1,u.length&&d())}function d(){if(!l){var e=c(p);l=!0;for(var t=u.length;t;){for(s=u,u=[];++f<t;)s&&s[f].run();f=-1,t=u.length}s=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new m(e,t)),1!==u.length||l||c(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){var n=null,r=["Webkit","Moz","O","ms"];e.exports=function(e){n||(n=document.createElement("div"));var t=n.style;if(e in t)return e;for(var i=e.charAt(0).toUpperCase()+e.slice(1),o=r.length;o>=0;o--){var a=r[o]+i;if(a in t)return a}return!1}},function(e,t,n){var r=n(244);e.exports=function(e){return r(e).replace(/\s(\w)/g,(function(e,t){return t.toUpperCase()}))}},function(e,t,n){var r=n(245);e.exports=function(e){return r(e).replace(/[\W_]+(.|$)/g,(function(e,t){return t?" "+t:""})).trim()}},function(e,t){e.exports=function(e){return n.test(e)?e.toLowerCase():r.test(e)?(function(e){return e.replace(o,(function(e,t){return t?" "+t:""}))}(e)||e).toLowerCase():i.test(e)?function(e){return e.replace(a,(function(e,t,n){return t+" "+n.toLowerCase().split("").join(" ")}))}(e).toLowerCase():e.toLowerCase()};var n=/\s/,r=/(_|-|\.|:)/,i=/([a-z][A-Z]|[A-Z][a-z])/;var o=/[\W_]+(.|$)/g;var a=/(.)([A-Z]+)/g},function(e,t){var n={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};e.exports=function(e,t){return"number"!=typeof t||n[e]?t:t+"px"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"string"==typeof e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!1!==a)return a;if("undefined"!=typeof document){var e=document.createElement("div");(0,o.default)(e,{width:100,height:100,position:"absolute",top:-9999,overflow:"scroll",MsOverflowStyle:"scrollbar"}),document.body.appendChild(e),a=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}else a=0;return a||0};var r,i=n(179),o=(r=i)&&r.__esModule?r:{default:r};var a=!1},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.clientWidth,n=getComputedStyle(e),r=n.paddingLeft,i=n.paddingRight;return t-parseFloat(r)-parseFloat(i)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.clientHeight,n=getComputedStyle(e),r=n.paddingTop,i=n.paddingBottom;return t-parseFloat(r)-parseFloat(i)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.containerStyleDefault={position:"relative",overflow:"hidden",width:"100%",height:"100%"},t.containerStyleAutoHeight={height:"auto"},t.viewStyleDefault={position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"scroll",WebkitOverflowScrolling:"touch"},t.viewStyleAutoHeight={position:"relative",top:void 0,left:void 0,right:void 0,bottom:void 0},t.viewStyleUniversalInitial={overflow:"hidden",marginRight:0,marginBottom:0},t.trackHorizontalStyleDefault={position:"absolute",height:6},t.trackVerticalStyleDefault={position:"absolute",width:6},t.thumbHorizontalStyleDefault={position:"relative",display:"block",height:"100%"},t.thumbVerticalStyleDefault={position:"relative",display:"block",width:"100%"},t.disableSelectStyle={userSelect:"none"},t.disableSelectStyleReset={userSelect:""}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.renderViewDefault=function(e){return a.default.createElement("div",e)},t.renderTrackHorizontalDefault=function(e){var t=e.style,n=c(e,["style"]),i=r({},t,{right:2,bottom:2,left:2,borderRadius:3});return a.default.createElement("div",r({style:i},n))},t.renderTrackVerticalDefault=function(e){var t=e.style,n=c(e,["style"]),i=r({},t,{right:2,bottom:2,top:2,borderRadius:3});return a.default.createElement("div",r({style:i},n))},t.renderThumbHorizontalDefault=function(e){var t=e.style,n=c(e,["style"]),i=r({},t,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return a.default.createElement("div",r({style:i},n))},t.renderThumbVerticalDefault=function(e){var t=e.style,n=c(e,["style"]),i=r({},t,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return a.default.createElement("div",r({style:i},n))};var i,o=n(0),a=(i=o)&&i.__esModule?i:{default:i};function c(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},function(e,t,n){"use strict";t.__esModule=!0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(255));var i=r.tokenize,o=r.options.Options;function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function c(e){return e.replace(/"/g,""")}function s(e){if(!e)return"";var t=[];for(var n in e){var r=e[n]+"";t.push(n+'="'+c(r)+'"')}return t.join(" ")}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=new o(t);for(var n=i(e),r=[],u=0;u<n.length;u++){var l=n[u];if("nl"===l.type&&t.nl2br)r.push("<br>\n");else if(l.isLink&&t.check(l)){var f=t.resolve(l),p=f.formatted,d=f.formattedHref,m=f.tagName,h=f.className,y=f.target,v=f.attributes,b="<"+m+' href="'+c(d)+'"';h&&(b+=' class="'+c(h)+'"'),y&&(b+=' target="'+c(y)+'"'),v&&(b+=" "+s(v)),b+=">"+a(p)+"</"+m+">",r.push(b)}else r.push(a(l.toString()))}return r.join("")}if(!String.prototype.linkify)try{Object.defineProperty(String.prototype,"linkify",{set:function(){},get:function(){return function(e){return u(this,e)}}})}catch(e){String.prototype.linkify||(String.prototype.linkify=function(e){return u(this,e)})}t.default=u},function(e,t,n){"use strict";t.__esModule=!0,t.tokenize=t.test=t.scanner=t.parser=t.options=t.inherits=t.find=void 0;var r=n(43),i=c(n(256)),o=c(n(257)),a=c(n(258));function c(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var s=function(e){return a.run(o.run(e))};t.find=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(e),r=[],i=0;i<n.length;i++){var o=n[i];!o.isLink||t&&o.type!==t||r.push(o.toObject())}return r},t.inherits=r.inherits,t.options=i,t.parser=a,t.scanner=o,t.test=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(e);return 1===n.length&&n[0].isLink&&(!t||n[0].type===t)},t.tokenize=s},function(e,t,n){"use strict";t.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i={defaultProtocol:"http",events:null,format:a,formatHref:a,nl2br:!1,tagName:"a",target:function(e,t){return"url"===t?"_blank":null},validate:!0,ignoreTags:[],attributes:null,className:"linkified"};function o(e){e=e||{},this.defaultProtocol=e.hasOwnProperty("defaultProtocol")?e.defaultProtocol:i.defaultProtocol,this.events=e.hasOwnProperty("events")?e.events:i.events,this.format=e.hasOwnProperty("format")?e.format:i.format,this.formatHref=e.hasOwnProperty("formatHref")?e.formatHref:i.formatHref,this.nl2br=e.hasOwnProperty("nl2br")?e.nl2br:i.nl2br,this.tagName=e.hasOwnProperty("tagName")?e.tagName:i.tagName,this.target=e.hasOwnProperty("target")?e.target:i.target,this.validate=e.hasOwnProperty("validate")?e.validate:i.validate,this.ignoreTags=[],this.attributes=e.attributes||e.linkAttributes||i.attributes,this.className=e.hasOwnProperty("className")?e.className:e.linkClass||i.className;for(var t=e.hasOwnProperty("ignoreTags")?e.ignoreTags:i.ignoreTags,n=0;n<t.length;n++)this.ignoreTags.push(t[n].toUpperCase())}function a(e){return e}t.defaults=i,t.Options=o,t.contains=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},o.prototype={resolve:function(e){var t=e.toHref(this.defaultProtocol);return{formatted:this.get("format",e.toString(),e),formattedHref:this.get("formatHref",t,e),tagName:this.get("tagName",t,e),className:this.get("className",t,e),target:this.get("target",t,e),events:this.getObject("events",t,e),attributes:this.getObject("attributes",t,e)}},check:function(e){return this.get("validate",e.toString(),e)},get:function(e,t,n){var o=void 0,a=this[e];if(!a)return a;switch(void 0===a?"undefined":r(a)){case"function":return a(t,n.type);case"object":return"function"==typeof(o=a.hasOwnProperty(n.type)?a[n.type]:i[e])?o(t,n.type):o}return a},getObject:function(e,t,n){var r=this[e];return"function"==typeof r?r(t,n.type):r}}},function(e,t,n){"use strict";t.__esModule=!0,t.start=t.run=t.TOKENS=t.State=void 0;var r=n(195),i=n(59),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(i);var a="aaa|aarp|abarth|abb|abbott|abbvie|abc|able|abogado|abudhabi|ac|academy|accenture|accountant|accountants|aco|active|actor|ad|adac|ads|adult|ae|aeg|aero|aetna|af|afamilycompany|afl|africa|ag|agakhan|agency|ai|aig|aigo|airbus|airforce|airtel|akdn|al|alfaromeo|alibaba|alipay|allfinanz|allstate|ally|alsace|alstom|am|americanexpress|americanfamily|amex|amfam|amica|amsterdam|analytics|android|anquan|anz|ao|aol|apartments|app|apple|aq|aquarelle|ar|arab|aramco|archi|army|arpa|art|arte|as|asda|asia|associates|at|athleta|attorney|au|auction|audi|audible|audio|auspost|author|auto|autos|avianca|aw|aws|ax|axa|az|azure|ba|baby|baidu|banamex|bananarepublic|band|bank|bar|barcelona|barclaycard|barclays|barefoot|bargains|baseball|basketball|bauhaus|bayern|bb|bbc|bbt|bbva|bcg|bcn|bd|be|beats|beauty|beer|bentley|berlin|best|bestbuy|bet|bf|bg|bh|bharti|bi|bible|bid|bike|bing|bingo|bio|biz|bj|black|blackfriday|blanco|blockbuster|blog|bloomberg|blue|bm|bms|bmw|bn|bnl|bnpparibas|bo|boats|boehringer|bofa|bom|bond|boo|book|booking|boots|bosch|bostik|boston|bot|boutique|box|br|bradesco|bridgestone|broadway|broker|brother|brussels|bs|bt|budapest|bugatti|build|builders|business|buy|buzz|bv|bw|by|bz|bzh|ca|cab|cafe|cal|call|calvinklein|cam|camera|camp|cancerresearch|canon|capetown|capital|capitalone|car|caravan|cards|care|career|careers|cars|cartier|casa|case|caseih|cash|casino|cat|catering|catholic|cba|cbn|cbre|cbs|cc|cd|ceb|center|ceo|cern|cf|cfa|cfd|cg|ch|chanel|channel|chase|chat|cheap|chintai|chloe|christmas|chrome|chrysler|church|ci|cipriani|circle|cisco|citadel|citi|citic|city|cityeats|ck|cl|claims|cleaning|click|clinic|clinique|clothing|cloud|club|clubmed|cm|cn|co|coach|codes|coffee|college|cologne|com|comcast|commbank|community|company|compare|computer|comsec|condos|construction|consulting|contact|contractors|cooking|cookingchannel|cool|coop|corsica|country|coupon|coupons|courses|cr|credit|creditcard|creditunion|cricket|crown|crs|cruise|cruises|csc|cu|cuisinella|cv|cw|cx|cy|cymru|cyou|cz|dabur|dad|dance|data|date|dating|datsun|day|dclk|dds|de|deal|dealer|deals|degree|delivery|dell|deloitte|delta|democrat|dental|dentist|desi|design|dev|dhl|diamonds|diet|digital|direct|directory|discount|discover|dish|diy|dj|dk|dm|dnp|do|docs|doctor|dodge|dog|doha|domains|dot|download|drive|dtv|dubai|duck|dunlop|duns|dupont|durban|dvag|dvr|dz|earth|eat|ec|eco|edeka|edu|education|ee|eg|email|emerck|energy|engineer|engineering|enterprises|epost|epson|equipment|er|ericsson|erni|es|esq|estate|esurance|et|etisalat|eu|eurovision|eus|events|everbank|exchange|expert|exposed|express|extraspace|fage|fail|fairwinds|faith|family|fan|fans|farm|farmers|fashion|fast|fedex|feedback|ferrari|ferrero|fi|fiat|fidelity|fido|film|final|finance|financial|fire|firestone|firmdale|fish|fishing|fit|fitness|fj|fk|flickr|flights|flir|florist|flowers|fly|fm|fo|foo|food|foodnetwork|football|ford|forex|forsale|forum|foundation|fox|fr|free|fresenius|frl|frogans|frontdoor|frontier|ftr|fujitsu|fujixerox|fun|fund|furniture|futbol|fyi|ga|gal|gallery|gallo|gallup|game|games|gap|garden|gb|gbiz|gd|gdn|ge|gea|gent|genting|george|gf|gg|ggee|gh|gi|gift|gifts|gives|giving|gl|glade|glass|gle|global|globo|gm|gmail|gmbh|gmo|gmx|gn|godaddy|gold|goldpoint|golf|goo|goodhands|goodyear|goog|google|gop|got|gov|gp|gq|gr|grainger|graphics|gratis|green|gripe|grocery|group|gs|gt|gu|guardian|gucci|guge|guide|guitars|guru|gw|gy|hair|hamburg|hangout|haus|hbo|hdfc|hdfcbank|health|healthcare|help|helsinki|here|hermes|hgtv|hiphop|hisamitsu|hitachi|hiv|hk|hkt|hm|hn|hockey|holdings|holiday|homedepot|homegoods|homes|homesense|honda|honeywell|horse|hospital|host|hosting|hot|hoteles|hotels|hotmail|house|how|hr|hsbc|ht|htc|hu|hughes|hyatt|hyundai|ibm|icbc|ice|icu|id|ie|ieee|ifm|ikano|il|im|imamat|imdb|immo|immobilien|in|industries|infiniti|info|ing|ink|institute|insurance|insure|int|intel|international|intuit|investments|io|ipiranga|iq|ir|irish|is|iselect|ismaili|ist|istanbul|it|itau|itv|iveco|iwc|jaguar|java|jcb|jcp|je|jeep|jetzt|jewelry|jio|jlc|jll|jm|jmp|jnj|jo|jobs|joburg|jot|joy|jp|jpmorgan|jprs|juegos|juniper|kaufen|kddi|ke|kerryhotels|kerrylogistics|kerryproperties|kfh|kg|kh|ki|kia|kim|kinder|kindle|kitchen|kiwi|km|kn|koeln|komatsu|kosher|kp|kpmg|kpn|kr|krd|kred|kuokgroup|kw|ky|kyoto|kz|la|lacaixa|ladbrokes|lamborghini|lamer|lancaster|lancia|lancome|land|landrover|lanxess|lasalle|lat|latino|latrobe|law|lawyer|lb|lc|lds|lease|leclerc|lefrak|legal|lego|lexus|lgbt|li|liaison|lidl|life|lifeinsurance|lifestyle|lighting|like|lilly|limited|limo|lincoln|linde|link|lipsy|live|living|lixil|lk|loan|loans|locker|locus|loft|lol|london|lotte|lotto|love|lpl|lplfinancial|lr|ls|lt|ltd|ltda|lu|lundbeck|lupin|luxe|luxury|lv|ly|ma|macys|madrid|maif|maison|makeup|man|management|mango|map|market|marketing|markets|marriott|marshalls|maserati|mattel|mba|mc|mckinsey|md|me|med|media|meet|melbourne|meme|memorial|men|menu|meo|merckmsd|metlife|mg|mh|miami|microsoft|mil|mini|mint|mit|mitsubishi|mk|ml|mlb|mls|mm|mma|mn|mo|mobi|mobile|mobily|moda|moe|moi|mom|monash|money|monster|mopar|mormon|mortgage|moscow|moto|motorcycles|mov|movie|movistar|mp|mq|mr|ms|msd|mt|mtn|mtr|mu|museum|mutual|mv|mw|mx|my|mz|na|nab|nadex|nagoya|name|nationwide|natura|navy|nba|nc|ne|nec|net|netbank|netflix|network|neustar|new|newholland|news|next|nextdirect|nexus|nf|nfl|ng|ngo|nhk|ni|nico|nike|nikon|ninja|nissan|nissay|nl|no|nokia|northwesternmutual|norton|now|nowruz|nowtv|np|nr|nra|nrw|ntt|nu|nyc|nz|obi|observer|off|office|okinawa|olayan|olayangroup|oldnavy|ollo|om|omega|one|ong|onl|online|onyourside|ooo|open|oracle|orange|org|organic|origins|osaka|otsuka|ott|ovh|pa|page|panasonic|panerai|paris|pars|partners|parts|party|passagens|pay|pccw|pe|pet|pf|pfizer|pg|ph|pharmacy|phd|philips|phone|photo|photography|photos|physio|piaget|pics|pictet|pictures|pid|pin|ping|pink|pioneer|pizza|pk|pl|place|play|playstation|plumbing|plus|pm|pn|pnc|pohl|poker|politie|porn|post|pr|pramerica|praxi|press|prime|pro|prod|productions|prof|progressive|promo|properties|property|protection|pru|prudential|ps|pt|pub|pw|pwc|py|qa|qpon|quebec|quest|qvc|racing|radio|raid|re|read|realestate|realtor|realty|recipes|red|redstone|redumbrella|rehab|reise|reisen|reit|reliance|ren|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rexroth|rich|richardli|ricoh|rightathome|ril|rio|rip|rmit|ro|rocher|rocks|rodeo|rogers|room|rs|rsvp|ru|rugby|ruhr|run|rw|rwe|ryukyu|sa|saarland|safe|safety|sakura|sale|salon|samsclub|samsung|sandvik|sandvikcoromant|sanofi|sap|sapo|sarl|sas|save|saxo|sb|sbi|sbs|sc|sca|scb|schaeffler|schmidt|scholarships|school|schule|schwarz|science|scjohnson|scor|scot|sd|se|search|seat|secure|security|seek|select|sener|services|ses|seven|sew|sex|sexy|sfr|sg|sh|shangrila|sharp|shaw|shell|shia|shiksha|shoes|shop|shopping|shouji|show|showtime|shriram|si|silk|sina|singles|site|sj|sk|ski|skin|sky|skype|sl|sling|sm|smart|smile|sn|sncf|so|soccer|social|softbank|software|sohu|solar|solutions|song|sony|soy|space|spiegel|spot|spreadbetting|sr|srl|srt|st|stada|staples|star|starhub|statebank|statefarm|statoil|stc|stcgroup|stockholm|storage|store|stream|studio|study|style|su|sucks|supplies|supply|support|surf|surgery|suzuki|sv|swatch|swiftcover|swiss|sx|sy|sydney|symantec|systems|sz|tab|taipei|talk|taobao|target|tatamotors|tatar|tattoo|tax|taxi|tc|tci|td|tdk|team|tech|technology|tel|telecity|telefonica|temasek|tennis|teva|tf|tg|th|thd|theater|theatre|tiaa|tickets|tienda|tiffany|tips|tires|tirol|tj|tjmaxx|tjx|tk|tkmaxx|tl|tm|tmall|tn|to|today|tokyo|tools|top|toray|toshiba|total|tours|town|toyota|toys|tr|trade|trading|training|travel|travelchannel|travelers|travelersinsurance|trust|trv|tt|tube|tui|tunes|tushu|tv|tvs|tw|tz|ua|ubank|ubs|uconnect|ug|uk|unicom|university|uno|uol|ups|us|uy|uz|va|vacations|vana|vanguard|vc|ve|vegas|ventures|verisign|versicherung|vet|vg|vi|viajes|video|vig|viking|villas|vin|vip|virgin|visa|vision|vista|vistaprint|viva|vivo|vlaanderen|vn|vodka|volkswagen|volvo|vote|voting|voto|voyage|vu|vuelos|wales|walmart|walter|wang|wanggou|warman|watch|watches|weather|weatherchannel|webcam|weber|website|wed|wedding|weibo|weir|wf|whoswho|wien|wiki|williamhill|win|windows|wine|winners|wme|wolterskluwer|woodside|work|works|world|wow|ws|wtc|wtf|xbox|xerox|xfinity|xihuan|xin|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--30rr7y|xn--3bst00m|xn--3ds443g|xn--3e0b707e|xn--3hcrj9c|xn--3oq18vl8pn36a|xn--3pxu8k|xn--42c2d9a|xn--45br5cyl|xn--45brj9c|xn--45q11c|xn--4gbrim|xn--54b7fta0cc|xn--55qw42g|xn--55qx5d|xn--5su34j936bgsg|xn--5tzm5g|xn--6frz82g|xn--6qq986b3xl|xn--80adxhks|xn--80ao21a|xn--80aqecdr1a|xn--80asehdb|xn--80aswg|xn--8y0a063a|xn--90a3ac|xn--90ae|xn--90ais|xn--9dbq2a|xn--9et52u|xn--9krt00a|xn--b4w605ferd|xn--bck1b9a5dre4c|xn--c1avg|xn--c2br7g|xn--cck2b3b|xn--cg4bki|xn--clchc0ea0b2g2a9gcd|xn--czr694b|xn--czrs0t|xn--czru2d|xn--d1acj3b|xn--d1alf|xn--e1a4c|xn--eckvdtc9d|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fhbei|xn--fiq228c5hs|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--fjq720a|xn--flw351e|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--fzys8d69uvgm|xn--g2xx48c|xn--gckr3f0f|xn--gecrj9c|xn--gk3at1e|xn--h2breg3eve|xn--h2brj9c|xn--h2brj9c8c|xn--hxt814e|xn--i1b6b1a6a2e|xn--imr513n|xn--io0a7i|xn--j1aef|xn--j1amh|xn--j6w193g|xn--jlq61u9w7b|xn--jvr189m|xn--kcrx77d1x4a|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--kput3i|xn--l1acc|xn--lgbbat1ad8j|xn--mgb9awbf|xn--mgba3a3ejt|xn--mgba3a4f16a|xn--mgba7c0bbn0a|xn--mgbaakc7dvf|xn--mgbaam7a8h|xn--mgbab2bd|xn--mgbai9azgqp6j|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a|xn--mgbbh1a71e|xn--mgbc0a9azcg|xn--mgbca7dzdo|xn--mgberp4a5d4ar|xn--mgbgu82a|xn--mgbi4ecexp|xn--mgbpl2fh|xn--mgbt3dhd|xn--mgbtx2b|xn--mgbx4cd0ab|xn--mix891f|xn--mk1bu44c|xn--mxtq1m|xn--ngbc5azd|xn--ngbe9e0a|xn--ngbrx|xn--node|xn--nqv7f|xn--nqv7fs00ema|xn--nyqy26a|xn--o3cw4h|xn--ogbpf8fl|xn--p1acf|xn--p1ai|xn--pbt977c|xn--pgbs0dh|xn--pssy2u|xn--q9jyb4c|xn--qcka1pmc|xn--qxam|xn--rhqv96g|xn--rovu88b|xn--rvc1e0am3e|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--tckwe|xn--tiq49xqyj|xn--unup4y|xn--vermgensberater-ctb|xn--vermgensberatung-pwb|xn--vhquv|xn--vuq861b|xn--w4r85el8fhu5dnra|xn--w4rs40l|xn--wgbh1c|xn--wgbl6a|xn--xhq521b|xn--xkc2al3hye2a|xn--xkc2dl3a5ee0h|xn--y9a3aq|xn--yfro4i67o|xn--ygbi2ammx|xn--zfr164b|xperia|xxx|xyz|yachts|yahoo|yamaxun|yandex|ye|yodobashi|yoga|yokohama|you|youtube|yt|yun|za|zappos|zara|zero|zip|zippo|zm|zone|zuerich|zw".split("|"),c="0123456789".split(""),s="0123456789abcdefghijklmnopqrstuvwxyz".split(""),u=[" ","\f","\r","\t","\v"," "," ",""],l=[],f=function(e){return new r.CharacterState(e)},p=f(),d=f(i.NUM),m=f(i.DOMAIN),h=f(),y=f(i.WS);p.on("@",f(i.AT)).on(".",f(i.DOT)).on("+",f(i.PLUS)).on("#",f(i.POUND)).on("?",f(i.QUERY)).on("/",f(i.SLASH)).on("_",f(i.UNDERSCORE)).on(":",f(i.COLON)).on("{",f(i.OPENBRACE)).on("[",f(i.OPENBRACKET)).on("<",f(i.OPENANGLEBRACKET)).on("(",f(i.OPENPAREN)).on("}",f(i.CLOSEBRACE)).on("]",f(i.CLOSEBRACKET)).on(">",f(i.CLOSEANGLEBRACKET)).on(")",f(i.CLOSEPAREN)).on("&",f(i.AMPERSAND)).on([",",";","!",'"',"'"],f(i.PUNCTUATION)),p.on("\n",f(i.NL)).on(u,y),y.on(u,y);for(var v=0;v<a.length;v++){var b=(0,r.stateify)(a[v],p,i.TLD,i.DOMAIN);l.push.apply(l,b)}var g=(0,r.stateify)("file",p,i.DOMAIN,i.DOMAIN),S=(0,r.stateify)("ftp",p,i.DOMAIN,i.DOMAIN),E=(0,r.stateify)("http",p,i.DOMAIN,i.DOMAIN),O=(0,r.stateify)("mailto",p,i.DOMAIN,i.DOMAIN);l.push.apply(l,g),l.push.apply(l,S),l.push.apply(l,E),l.push.apply(l,O);var C=g.pop(),w=S.pop(),A=E.pop(),j=O.pop(),T=f(i.DOMAIN),k=f(i.PROTOCOL),I=f(i.MAILTO);w.on("s",T).on(":",k),A.on("s",T).on(":",k),l.push(T),C.on(":",k),T.on(":",k),j.on(":",I);var L=(0,r.stateify)("localhost",p,i.LOCALHOST,i.DOMAIN);l.push.apply(l,L),p.on(c,d),d.on("-",h).on(c,d).on(s,m),m.on("-",h).on(s,m);for(var _=0;_<l.length;_++)l[_].on("-",h).on(s,m);h.on("-",h).on(c,m).on(s,m),p.defaultTransition=f(i.SYM);var P=p;t.State=r.CharacterState,t.TOKENS=o,t.run=function(e){for(var t=e.replace(/[A-Z]/g,(function(e){return e.toLowerCase()})),n=e.length,r=[],i=0;i<n;){for(var o=p,a=null,c=0,s=null,u=-1;i<n&&(a=o.next(t[i]));)(o=a).accepts()?(u=0,s=o):u>=0&&u++,c++,i++;if(!(u<0)){i-=u,c-=u;var l=s.emit();r.push(new l(e.substr(i-c,c)))}}return r},t.start=P},function(e,t,n){"use strict";t.__esModule=!0,t.start=t.run=t.TOKENS=t.State=void 0;var r=n(195),i=n(259),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(i),a=n(59);var c=function(e){return new r.TokenState(e)},s=c(),u=c(),l=c(),f=c(),p=c(),d=c(),m=c(),h=c(i.URL),y=c(),v=c(i.URL),b=c(i.URL),g=c(),S=c(),E=c(),O=c(),C=c(),w=c(i.URL),A=c(i.URL),j=c(i.URL),T=c(i.URL),k=c(),I=c(),L=c(),_=c(),P=c(),x=c(),N=c(i.EMAIL),R=c(),D=c(i.EMAIL),M=c(i.MAILTOEMAIL),U=c(),F=c(),V=c(),B=c(),H=c(i.NL);s.on(a.NL,H).on(a.PROTOCOL,u).on(a.MAILTO,l).on(a.SLASH,f),u.on(a.SLASH,f),f.on(a.SLASH,p),s.on(a.TLD,d).on(a.DOMAIN,d).on(a.LOCALHOST,h).on(a.NUM,d),p.on(a.TLD,b).on(a.DOMAIN,b).on(a.NUM,b).on(a.LOCALHOST,b),d.on(a.DOT,m),P.on(a.DOT,x),m.on(a.TLD,h).on(a.DOMAIN,d).on(a.NUM,d).on(a.LOCALHOST,d),x.on(a.TLD,N).on(a.DOMAIN,P).on(a.NUM,P).on(a.LOCALHOST,P),h.on(a.DOT,m),N.on(a.DOT,x),h.on(a.COLON,y).on(a.SLASH,b),y.on(a.NUM,v),v.on(a.SLASH,b),N.on(a.COLON,R),R.on(a.NUM,D);var z=[a.DOMAIN,a.AT,a.LOCALHOST,a.NUM,a.PLUS,a.POUND,a.PROTOCOL,a.SLASH,a.TLD,a.UNDERSCORE,a.SYM,a.AMPERSAND],q=[a.COLON,a.DOT,a.QUERY,a.PUNCTUATION,a.CLOSEBRACE,a.CLOSEBRACKET,a.CLOSEANGLEBRACKET,a.CLOSEPAREN,a.OPENBRACE,a.OPENBRACKET,a.OPENANGLEBRACKET,a.OPENPAREN];b.on(a.OPENBRACE,S).on(a.OPENBRACKET,E).on(a.OPENANGLEBRACKET,O).on(a.OPENPAREN,C),g.on(a.OPENBRACE,S).on(a.OPENBRACKET,E).on(a.OPENANGLEBRACKET,O).on(a.OPENPAREN,C),S.on(a.CLOSEBRACE,b),E.on(a.CLOSEBRACKET,b),O.on(a.CLOSEANGLEBRACKET,b),C.on(a.CLOSEPAREN,b),w.on(a.CLOSEBRACE,b),A.on(a.CLOSEBRACKET,b),j.on(a.CLOSEANGLEBRACKET,b),T.on(a.CLOSEPAREN,b),k.on(a.CLOSEBRACE,b),I.on(a.CLOSEBRACKET,b),L.on(a.CLOSEANGLEBRACKET,b),_.on(a.CLOSEPAREN,b),S.on(z,w),E.on(z,A),O.on(z,j),C.on(z,T),S.on(q,k),E.on(q,I),O.on(q,L),C.on(q,_),w.on(z,w),A.on(z,A),j.on(z,j),T.on(z,T),w.on(q,w),A.on(q,A),j.on(q,j),T.on(q,T),k.on(z,w),I.on(z,A),L.on(z,j),_.on(z,T),k.on(q,k),I.on(q,I),L.on(q,L),_.on(q,_),b.on(z,b),g.on(z,b),b.on(q,g),g.on(q,g),l.on(a.TLD,M).on(a.DOMAIN,M).on(a.NUM,M).on(a.LOCALHOST,M),M.on(z,M).on(q,U),U.on(z,M).on(q,U);var J=[a.DOMAIN,a.NUM,a.PLUS,a.POUND,a.QUERY,a.UNDERSCORE,a.SYM,a.AMPERSAND,a.TLD];d.on(J,F).on(a.AT,V),h.on(J,F).on(a.AT,V),m.on(J,F),F.on(J,F).on(a.AT,V).on(a.DOT,B),B.on(J,F),V.on(a.TLD,P).on(a.DOMAIN,P).on(a.LOCALHOST,N);t.State=r.TokenState,t.TOKENS=o,t.run=function(e){for(var t=e.length,n=0,r=[],o=[];n<t;){for(var a=s,c=null,u=null,l=0,f=null,p=-1;n<t&&!(c=a.next(e[n]));)o.push(e[n++]);for(;n<t&&(u=c||a.next(e[n]));)c=null,(a=u).accepts()?(p=0,f=a):p>=0&&p++,n++,l++;if(p<0)for(var d=n-l;d<n;d++)o.push(e[d]);else{o.length>0&&(r.push(new i.TEXT(o)),o=[]),n-=p,l-=p;var m=f.emit();r.push(new m(e.slice(n-l,n)))}}return o.length>0&&r.push(new i.TEXT(o)),r},t.start=s},function(e,t,n){"use strict";t.__esModule=!0,t.URL=t.TEXT=t.NL=t.EMAIL=t.MAILTOEMAIL=t.Base=void 0;var r=n(196),i=n(43),o=n(59);function a(e){return e instanceof o.DOMAIN||e instanceof o.TLD}var c=(0,r.createTokenClass)();c.prototype={type:"token",isLink:!1,toString:function(){for(var e=[],t=0;t<this.v.length;t++)e.push(this.v[t].toString());return e.join("")},toHref:function(){return this.toString()},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http";return{type:this.type,value:this.toString(),href:this.toHref(e)}}};var s=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"email",isLink:!0}),u=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"email",isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),l=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"text"}),f=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"nl"}),p=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"url",isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http",t=!1,n=!1,r=this.v,i=[],c=0;r[c]instanceof o.PROTOCOL;)t=!0,i.push(r[c].toString().toLowerCase()),c++;for(;r[c]instanceof o.SLASH;)n=!0,i.push(r[c].toString()),c++;for(;a(r[c]);)i.push(r[c].toString().toLowerCase()),c++;for(;c<r.length;c++)i.push(r[c].toString());return i=i.join(""),t||n||(i=e+"://"+i),i},hasProtocol:function(){return this.v[0]instanceof o.PROTOCOL}});t.Base=c,t.MAILTOEMAIL=s,t.EMAIL=u,t.NL=f,t.TEXT=l,t.URL=p},function(e,t,n){const{defaults:r}=n(39),{block:i}=n(199),{rtrim:o,splitCells:a,escape:c}=n(34);e.exports=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.rules=i.normal,this.options.pedantic?this.rules=i.pedantic:this.options.gfm&&(this.rules=i.gfm)}static get rules(){return i}static lex(t,n){return new e(n).lex(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.token(e,!0)}token(e,t){let n,r,s,u,l,f,p,d,m,h,y,v,b,g,S,E;for(e=e.replace(/^ +$/gm,"");e;)if((s=this.rules.newline.exec(e))&&(e=e.substring(s[0].length),s[0].length>1&&this.tokens.push({type:"space"})),s=this.rules.code.exec(e)){const t=this.tokens[this.tokens.length-1];e=e.substring(s[0].length),t&&"paragraph"===t.type?t.text+="\n"+s[0].trimRight():(s=s[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?s:o(s,"\n")}))}else if(s=this.rules.fences.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"code",lang:s[2]?s[2].trim():s[2],text:s[3]||""});else if(s=this.rules.heading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:s[1].length,text:s[2]});else if((s=this.rules.nptable.exec(e))&&(f={type:"table",header:a(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]},f.header.length===f.align.length)){for(e=e.substring(s[0].length),y=0;y<f.align.length;y++)/^ *-+: *$/.test(f.align[y])?f.align[y]="right":/^ *:-+: *$/.test(f.align[y])?f.align[y]="center":/^ *:-+ *$/.test(f.align[y])?f.align[y]="left":f.align[y]=null;for(y=0;y<f.cells.length;y++)f.cells[y]=a(f.cells[y],f.header.length);this.tokens.push(f)}else if(s=this.rules.hr.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"hr"});else if(s=this.rules.blockquote.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"blockquote_start"}),s=s[0].replace(/^ *> ?/gm,""),this.token(s,t),this.tokens.push({type:"blockquote_end"});else if(s=this.rules.list.exec(e)){for(e=e.substring(s[0].length),u=s[2],g=u.length>1,p={type:"list_start",ordered:g,start:g?+u:"",loose:!1},this.tokens.push(p),s=s[0].match(this.rules.item),d=[],n=!1,b=s.length,y=0;y<b;y++)f=s[y],h=f.length,f=f.replace(/^ *([*+-]|\d+\.) */,""),~f.indexOf("\n ")&&(h-=f.length,f=this.options.pedantic?f.replace(/^ {1,4}/gm,""):f.replace(new RegExp("^ {1,"+h+"}","gm"),"")),y!==b-1&&(l=i.bullet.exec(s[y+1])[0],(u.length>1?1===l.length:l.length>1||this.options.smartLists&&l!==u)&&(e=s.slice(y+1).join("\n")+e,y=b-1)),r=n||/\n\n(?!\s*$)/.test(f),y!==b-1&&(n="\n"===f.charAt(f.length-1),r||(r=n)),r&&(p.loose=!0),S=/^\[[ xX]\] /.test(f),E=void 0,S&&(E=" "!==f[1],f=f.replace(/^\[[ xX]\] +/,"")),m={type:"list_item_start",task:S,checked:E,loose:r},d.push(m),this.tokens.push(m),this.token(f,!1),this.tokens.push({type:"list_item_end"});if(p.loose)for(b=d.length,y=0;y<b;y++)d[y].loose=!0;this.tokens.push({type:"list_end"})}else if(s=this.rules.html.exec(e))e=e.substring(s[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===s[1]||"script"===s[1]||"style"===s[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):c(s[0]):s[0]});else if(t&&(s=this.rules.def.exec(e)))e=e.substring(s[0].length),s[3]&&(s[3]=s[3].substring(1,s[3].length-1)),v=s[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[v]||(this.tokens.links[v]={href:s[2],title:s[3]});else if((s=this.rules.table.exec(e))&&(f={type:"table",header:a(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]},f.header.length===f.align.length)){for(e=e.substring(s[0].length),y=0;y<f.align.length;y++)/^ *-+: *$/.test(f.align[y])?f.align[y]="right":/^ *:-+: *$/.test(f.align[y])?f.align[y]="center":/^ *:-+ *$/.test(f.align[y])?f.align[y]="left":f.align[y]=null;for(y=0;y<f.cells.length;y++)f.cells[y]=a(f.cells[y].replace(/^ *\| *| *\| *$/g,""),f.header.length);this.tokens.push(f)}else if(s=this.rules.lheading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:"="===s[2].charAt(0)?1:2,text:s[1]});else if(t&&(s=this.rules.paragraph.exec(e)))e=e.substring(s[0].length),this.tokens.push({type:"paragraph",text:"\n"===s[1].charAt(s[1].length-1)?s[1].slice(0,-1):s[1]});else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"text",text:s[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens}}},function(e,t,n){const r=n(60),i=n(200),o=n(201),a=n(202),{defaults:c}=n(39),{merge:s,unescape:u}=n(34);e.exports=class e{constructor(e){this.tokens=[],this.token=null,this.options=e||c,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new i}static parse(t,n){return new e(n).parse(t)}parse(e){this.inline=new o(e.links,this.options),this.inlineText=new o(e.links,s({},this.options,{renderer:new a})),this.tokens=e.reverse();let t="";for(;this.next();)t+=this.tok();return t}next(){return this.token=this.tokens.pop(),this.token}peek(){return this.tokens[this.tokens.length-1]||0}parseText(){let e=this.token.text;for(;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}tok(){let e="";switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,u(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":{let t,n,r,i,o="";for(r="",t=0;t<this.token.header.length;t++)r+=this.renderer.tablecell(this.inline.output(this.token.header[t]),{header:!0,align:this.token.align[t]});for(o+=this.renderer.tablerow(r),t=0;t<this.token.cells.length;t++){for(n=this.token.cells[t],r="",i=0;i<n.length;i++)r+=this.renderer.tablecell(this.inline.output(n[i]),{header:!1,align:this.token.align[i]});e+=this.renderer.tablerow(r)}return this.renderer.table(o,e)}case"blockquote_start":for(e="";"blockquote_end"!==this.next().type;)e+=this.tok();return this.renderer.blockquote(e);case"list_start":{e="";const t=this.token.ordered,n=this.token.start;for(;"list_end"!==this.next().type;)e+=this.tok();return this.renderer.list(e,t,n)}case"list_item_start":{e="";const t=this.token.loose,n=this.token.checked,r=this.token.task;if(this.token.task)if(t)if("text"===this.peek().type){const e=this.peek();e.text=this.renderer.checkbox(n)+" "+e.text}else this.tokens.push({type:"text",text:this.renderer.checkbox(n)});else e+=this.renderer.checkbox(n);for(;"list_item_end"!==this.next().type;)e+=t||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(e,r,n)}case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:{const e='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(e);console.log(e)}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var r=o(n(0)),i=o(n(263));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?d(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=function(e){function t(){var e,n;u(this,t);for(var o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];return h(d(n=f(this,(e=p(t)).call.apply(e,[this].concat(a)))),"onClick",(function(e){var t=n.props,o=t.text,a=t.onCopy,c=t.children,s=t.options,u=r.default.Children.only(c),l=(0,i.default)(o,s);a&&a(o,l),u&&u.props&&"function"==typeof u.props.onClick&&u.props.onClick(e)})),n}var n,o,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(t,e),n=t,(o=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=s(e,["text","onCopy","options","children"]),i=r.default.Children.only(t);return r.default.cloneElement(i,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(n,!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{onClick:this.onClick}))}}])&&l(n.prototype,o),a&&l(n,a),t}(r.default.PureComponent);t.CopyToClipboard=y,h(y,"defaultProps",{onCopy:void 0,options:void 0})},function(e,t,n){"use strict";var r=n(264),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,o,a,c,s,u,l=!1;t||(t={}),n=t.debug||!1;try{if(a=r(),c=document.createRange(),s=document.getSelection(),(u=document.createElement("span")).textContent=e,u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=i[t.format]||i.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(u),c.selectNodeContents(u),s.addRange(c),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),o=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(c):s.removeAllRanges()),u&&document.body.removeChild(u),a()}return l}},function(e,t){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}},function(e,t,n){"use strict";n.r(t);var r={UPLOAD_IMAGE:"upload:image"},i={Subjects:Object.assign({SUBJECTS:"subjects",NEW_SUBJECT:"new:subject",EDIT_SUBJECT:"edit:subject",EDIT_SUBJECT_PLAYLISTS:"edit:subject:playlists",EDIT_SUBJECT_SERIES:"edit:subject:series",EDIT_SUBJECT_VIDEOS:"edit:subject:videos",SUBJECT_CLASSIFICATIONS:"subject:classifications",DELETE_SUBJECT:"delete:subject",ADD_SUBJECT_MEMBERS:"add:subject:members",REMOVE_SUBJECT_MEMBER:"remove:subject:member",CLASSIFICATIONS:"classifications",PRESENTATION_CLASSIFICATIONS:"presentation:classifications",NEW_CLASSIFICATION:"new:classification",EDIT_CLASSIFICATION:"edit:classification",EDIT_CLASSIFICATION_PLAYLISTS:"edit:classification:playlists",EDIT_CLASSIFICATION_SERIES:"edit:classification:series",EDIT_CLASSIFICATION_VIDEOS:"edit:classification:videos",DELETE_CLASSIFICATION:"delete:classification",REMOVE_CLASSIFICATION_MEMBER:"remove:classification:member",LEVELS:"levels",NEW_LEVEL:"new:level",EDIT_LEVEL:"edit:level",LEVEL_AUDIENCES:"level:audiences",EDIT_LEVEL_PLAYLISTS:"edit:level:playlists",EDIT_LEVEL_SERIES:"edit:level:series",EDIT_LEVEL_VIDEOS:"edit:level:videos",REMOVE_LEVEL_MEMBER:"remove:level:member",AUDIENCES:"audiences",PRESENTATION_AUDIENCES:"presentation:audiences",NEW_AUDIENCE:"new:audience",EDIT_AUDIENCE:"edit:audience",EDIT_AUDIENCE_PLAYLISTS:"edit:audience:playlists",EDIT_AUDIENCE_SERIES:"edit:audience:series",EDIT_AUDIENCE_VIDEOS:"edit:audience:videos",DELETE_AUDIENCE:"delete:audience",REMOVE_AUDIENCE_MEMBER:"remove:audience:member",PRESENTATIONS:"presentations",NEW_PRESENTATION:"new:presentation",EDIT_PRESENTATION:"edit:presentation"},r),Playlists:Object.assign({PLAYLISTS:"index",SEARCH_PLAYLISTS:"search:playlists",NEW_PLAYLIST:"new:playlist",EDIT_PLAYLIST:"edit:playlist",EDIT_PLAYLIST_VIDEOS:"edit:playlist:videos",EDIT_PLAYLIST_DASHBOARDS:"edit:playlist:dashboards",EDIT_PLAYLIST_SUBJECTS:"edit:playlist:subjects",EDIT_PLAYLIST_AUDIENCES:"edit:playlist:audiences",DELETE_PLAYLIST:"delete:playlist",REMOVE_VIDEO:"remove:video",REMOVE_FROM_SUBJECT:"remove:from:subject",DASHBOARD:"dashboard",DELETE_DASHBOARD_WIDGET:"delete:dashboard:widget"},r),Series:Object.assign({EDIT_SERIES:"edit:series",EDIT_SERIES_VIDEOS:"edit:series:videos",EDIT_SERIES_SUBJECTS:"edit:series:subjects",EDIT_SERIES_AUDIENCES:"edit:series:audiences",LEGACY_EDIT_SERIES:"legacy:edit:series"},r),Videos:Object.assign({EDIT_VIDEO:"edit:video",EDIT_VIDEO_AUDIENCES:"edit:video:audiences",EDIT_VIDEO_SUBJECTS:"edit:video:subjects",EDIT_VIDEO_ALIASES:"edit:video:aliases",LEGACY_EDIT_VIDEO:"legacy:edit:video"},r),DomainOptions:{DOMAIN_OPTIONS:"domain:options",NEW_DOMAIN_OPTION:"new:domain:option",EDIT_DOMAIN_OPTION:"edit:domain:option",DELETE_DOMAIN_OPTION:"delete:domain:option"},People:{PEOPLE:"people",NEW_PERSON:"new:person",EDIT_PERSON:"edit:person"},Companies:{COMPANIES:"companies",NEW_COMPANY:"new:company",EDIT_COMPANY:"edit:company"},Themes:Object.assign({THEMES:"themes",NEW_THEME:"new:theme",EDIT_THEME:"edit:theme",DELETE_THEME:"delete:theme"},r),ReleaseNotes:{FORM:"form",GENERATOR:"generator"},Customers:{MANAGE_CUSTOMER:"manage:customer",MANAGE_CUSTOMER_TOPICS:"manage:customer:topics"},Users:{HOME:"index",USER:"user"}},o={SUBJECT:"subject",SUBJECTS:"subjects",UPDATE_SUBJECT:"update:subject",DELETE_SUBJECT:"delete:subject",UPDATE_OBJECT_SUBJECTS:"update:object:subjects",ADD_TO_SUBJECT:"add:to:subject",REMOVE_FROM_SUBJECT:"remove:from:subject",CLASSIFICATION:"classification",CLASSIFICATIONS:"classifications",UPDATE_CLASSIFICATION:"update:classification",DELETE_CLASSIFICATION:"delete:classification",UPDATE_OBJECT_CLASSIFICATIONS:"update:object:classifications",ADD_TO_CLASSIFICATION:"add:to:classification",REMOVE_FROM_CLASSIFICATION:"remove:from:classification",PRESENTATION:"presentation",PRESENTATIONS:"presentations",UPDATE_PRESENTATION:"update:presentation",LEVEL:"level",LEVELS:"levels",UPDATE_LEVEL:"update:level",ADD_TO_LEVEL:"add:to:level",REMOVE_FROM_LEVEL:"remove:from:level",UPDATE_OBJECT_LEVELS:"update:object:levels",AUDIENCE:"audience",AUDIENCES:"audiences",UPDATE_AUDIENCE:"update:audience",DELETE_AUDIENCE:"delete:audience",UPDATE_OBJECT_AUDIENCES:"update:object:audiences",ADD_TO_AUDIENCE:"add:to:audience",REMOVE_FROM_AUDIENCE:"remove:from:audience",PLAYLIST:"playlist",PLAYLISTS:"playlists",UPDATE_PLAYLIST:"update:playlist",DELETE_PLAYLIST:"delete:playlist",PLAYLIST_VIDEOS:"playlist:videos",REORDER_PLAYLIST_VIDEOS:"reorder:playlist:videos",REMOVE_PLAYLIST_VIDEO:"remove:playlist:video",VIDEO:"video",SERIES:"series",SERIES_BY_ID:"series:by:id",UPDATE_SERIES:"update:series",CURRENT_USER:"current:user",UPLOAD_IMAGE:"upload:image",LOCALE:"locale",PHRASES:"PHRASES"},a={CURATOR_LAYOUT:"CuratorLayout"},c={COMPANIES:"companies:application",CUSTOMERS:"customers:application",DOMAIN_OPTIONS:"domain:options:application",PEOPLE:"people:application",PLAYLISTS:"playlists:application",SERIES:"series:application",SUBJECTS:"subjects:application",THEMES:"themes:application",VIDEOS:"videos:application",RELEASE_NOTES:"release:notes:application",USERS:"users:application"},s={IMAGE_UPLOAD:"image:upload:data:service",SUBJECT:"subject:data:service",LANGUAGE:"language:data:service"},u={SUBJECT:"SubjectDataService",LANGUAGE:"LanguageDataService"},l=n(0),f=n.n(l),p=n(25),d=n(1),m=function(e,t,n){return d.debounce(e,t,n)},h=function(e){return d.isFunction(e)},y=function(){return d.identity},v=n(54),b=n(6);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=A(e);if(t){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return w(this,n)}}function w(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(o,e);var t,n,r,i=C(o);function o(){return S(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"isReactComponent",value:function(e){return l&&l.isValidElement(e)}},{key:"showChildView",value:function(e,t){this.isReactComponent(t)&&this.showChildReactComponent(e,t)}},{key:"showChildReactComponent",value:function(e,t){var n=this;this.isAttached()?this.renderChildReactComponent(e,t):this.listenToOnce(this,"attach",(function(){return n.renderChildReactComponent(e,t)}))}},{key:"renderChildReactComponent",value:function(e,t){var n=this.getRegion(e),r=this.$el.find(n.el);r&&r.length&&(n.trigger("before:show"),v.render(t,r[0],(function(){return n.trigger("show")})),this.listenToOnce(this,"unmount:".concat(e),(function(){return v.unmountComponentAtNode(r[0])})),this.listenToOnce(this,"before:destroy",(function(){return v.unmountComponentAtNode(r[0])})))}},{key:"wrapWithStore",value:function(e){return l.createElement(b.Provider,{store:this.options.store},e)}}])&&E(t.prototype,n),r&&E(t,r),o}(n(46).a),T="top:nav",k="left:nav",I="content",L="popup",_="alert",P=n(206),x=n.n(P),N=n(55),R=n.n(N);function D(e){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function U(e,t,n){return(U="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=H(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function F(e,t){return(F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=H(e);if(t){var i=H(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return B(this,n)}}function B(e,t){return!t||"object"!==D(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function H(e){return(H=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&F(e,t)}(o,e);var t,n,r,i=V(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).childComponents={},t}return t=o,r=[{key:"getCacheKey",value:function(e){var t="".concat(this.name),n=[];return Object.keys(e).forEach((function(t){n.push("".concat(t,":").concat(e[t]))})),n.length&&(n.sort(),t+=":".concat(n.join(":"))),t}}],(n=[{key:"title",get:function(){return!1}},{key:"name",get:function(){return"CuratorLayoutView"}},{key:"template",get:function(){return x.a}},{key:"className",get:function(){return"container-fluid ".concat(R.a.curatorLayout)}},{key:"regions",value:function(){return{layout:".layout-region"}}},{key:"getChildComponents",value:function(){return{topNav:{component:this.childComponents[T],className:R.a.topNavRegion},leftNav:{component:this.childComponents[k],className:"py-3 ".concat(R.a.leftNavRegion)},content:{component:this.childComponents[I],className:"position-relative container py-3"},popup:{component:this.childComponents[L]},alert:{component:this.childComponents[_]}}}},{key:"unsetRegion",value:function(e){delete this.childComponents[e],this.renderLayout()}},{key:"renderTopNav",value:function(){h(this.options.getTopNavView)&&(this.childComponents[T]=this.options.getTopNavView(p.AppLinkHelper.getCurrentAppLink()))}},{key:"hideLeftNav",value:function(){this.unsetRegion(k)}},{key:"closePopup",value:function(){this.unsetRegion(L)}},{key:"showChildView",value:function(e,t){this.childComponents[e]=t,this.renderTopNav(),this.renderLayout()}},{key:"renderLayout",value:function(){var e=Object.assign({provider:this.options.provider},this.getChildComponents());U(H(o.prototype),"showChildView",this).call(this,"layout",this.wrapWithStore(l.createElement(Y,Object.assign({},e))))}}])&&M(t.prototype,n),r&&M(t,r),o}(j),q=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},J=function(e){var t=e.className,n=e.children;return l.createElement("div",{className:t},n)},K=function(e,t){return"".concat(e).concat(t?" ".concat(t):"")},W=function(e){var t=e.topNav,n=e.leftNav,r=e.content,i=e.popup,o=e.alert;return l.createElement(l.Fragment,null,l.createElement("div",{className:"position-relative"},!!t.component&&l.createElement(J,{className:K("top-nav-region",t.className)},t.component),!!n.component&&l.createElement(J,{className:K("left-nav-region",n.className)},n.component),!!r.component&&l.createElement("div",{className:"content-container"},l.createElement(J,{className:K("content-region",r.className)},r.component))),!!i.component&&l.createElement(J,{className:K("popup-region",i.className)},i.component),!!o.component&&l.createElement(J,{className:K("alert-region",o.className)},o.component))},Y=function(e){var t=e.provider,n=q(e,["provider"]);return t?l.createElement(t,null,l.createElement(W,Object.assign({},n))):l.createElement(W,Object.assign({},n))},G=n(9);function Z(e){return(Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Q(e){return function(e){if(Array.isArray(e))return X(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return X(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ne(e,t){return(ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function re(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=oe(e);if(t){var i=oe(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ie(this,n)}}function ie(e,t){return!t||"object"!==Z(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function oe(e){return(oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ne(e,t)}(o,e);var t,n,r,i=re(o);function o(){return ee(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"initialize",value:function(){this.listenTo(G.a.SHELL,p.EventNames.ROUTING_END,this.updateNav)}},{key:"name",get:function(){return"CuratorAppNavService"}},{key:"updateNav",value:function(){var e=this,t=p.AppLinkHelper.getCurrentAppLink().application;if(t!==this.currentApplication){this.currentApplication=t;var n=this.options.navItemMappings[t];if(n){var r=document.querySelector(this.options.navSelector);r&&r.children&&Q(r.children).forEach((function(t){var r=t.querySelector("a");r&&(r.classList.remove(e.options.currentItemClassName),r.text===n&&r.classList.add(e.options.currentItemClassName))}))}}}}])&&te(t.prototype,n),r&&te(t,r),o}(p.Service),ce=n(70),se=n(8),ue=function(e){var t="/api/master/v2/companies";return e?"".concat(t,"?cursor=").concat(e):t},le=function(e){return"/api/master/v2/objects/".concat(e)},fe=function(){return"/api/master/v2/companies"},pe=function(e){return"/api/master/v2/objects/".concat(e)},de="companies",me="company",he="update:company",ye=function(e){return{key:"".concat(de).concat(e?":".concat(e):""),url:ue(e)}},ve=function(e){return{key:"".concat(me,":").concat(e),url:le(e)}},be=function(e,t,n){return{key:me,url:fe(),data:e,type:se.a.POST,success:t,error:n,invalidationKeys:[de]}},ge=function(e,t,n){return{key:"".concat(he,":").concat(e),url:pe(e),data:t,type:se.a.PUT,always:n}},Se=n(32),Ee=n.n(Se),Oe=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Ce}(e)}(e)};var Ce="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function we(e,t){return!1!==t.clone&&t.isMergeableObject(e)?je((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Ae(e,t,n){return e.concat(t).map((function(e){return we(e,n)}))}function je(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Ae,n.isMergeableObject=n.isMergeableObject||Oe;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=we(e[t],n)})),Object.keys(t).forEach((function(i){n.isMergeableObject(t[i])&&e[i]?r[i]=je(e[i],t[i],n):r[i]=we(t[i],n)})),r}(e,t,n):we(t,n)}je.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return je(e,n,t)}),{})};var Te=je,ke=n(15),Ie=ke.a.Symbol,Le=Object.prototype,_e=Le.hasOwnProperty,Pe=Le.toString,xe=Ie?Ie.toStringTag:void 0;var Ne=function(e){var t=_e.call(e,xe),n=e[xe];try{e[xe]=void 0;var r=!0}catch(e){}var i=Pe.call(e);return r&&(t?e[xe]=n:delete e[xe]),i},Re=Object.prototype.toString;var De=function(e){return Re.call(e)},Me=Ie?Ie.toStringTag:void 0;var Ue=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Me&&Me in Object(e)?Ne(e):De(e)};var Fe=function(e,t){return function(n){return e(t(n))}},Ve=Fe(Object.getPrototypeOf,Object);var Be=function(e){return null!=e&&"object"==typeof e},He=Function.prototype,ze=Object.prototype,qe=He.toString,Je=ze.hasOwnProperty,$e=qe.call(Object);var Ke=function(e){if(!Be(e)||"[object Object]"!=Ue(e))return!1;var t=Ve(e);if(null===t)return!0;var n=Je.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&qe.call(n)==$e};var We=function(){this.__data__=[],this.size=0};var Ye=function(e,t){return e===t||e!=e&&t!=t};var Ge=function(e,t){for(var n=e.length;n--;)if(Ye(e[n][0],t))return n;return-1},Ze=Array.prototype.splice;var Qe=function(e){var t=this.__data__,n=Ge(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ze.call(t,n,1),--this.size,!0)};var Xe=function(e){var t=this.__data__,n=Ge(t,e);return n<0?void 0:t[n][1]};var et=function(e){return Ge(this.__data__,e)>-1};var tt=function(e,t){var n=this.__data__,r=Ge(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function nt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nt.prototype.clear=We,nt.prototype.delete=Qe,nt.prototype.get=Xe,nt.prototype.has=et,nt.prototype.set=tt;var rt=nt;var it=function(){this.__data__=new rt,this.size=0};var ot=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var at=function(e){return this.__data__.get(e)};var ct=function(e){return this.__data__.has(e)};var st=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var ut,lt=function(e){if(!st(e))return!1;var t=Ue(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ft=ke.a["__core-js_shared__"],pt=(ut=/[^.]+$/.exec(ft&&ft.keys&&ft.keys.IE_PROTO||""))?"Symbol(src)_1."+ut:"";var dt=function(e){return!!pt&&pt in e},mt=Function.prototype.toString;var ht=function(e){if(null!=e){try{return mt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},yt=/^\[object .+?Constructor\]$/,vt=Function.prototype,bt=Object.prototype,gt=vt.toString,St=bt.hasOwnProperty,Et=RegExp("^"+gt.call(St).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ot=function(e){return!(!st(e)||dt(e))&&(lt(e)?Et:yt).test(ht(e))};var Ct=function(e,t){return null==e?void 0:e[t]};var wt=function(e,t){var n=Ct(e,t);return Ot(n)?n:void 0},At=wt(ke.a,"Map"),jt=wt(Object,"create");var Tt=function(){this.__data__=jt?jt(null):{},this.size=0};var kt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},It=Object.prototype.hasOwnProperty;var Lt=function(e){var t=this.__data__;if(jt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return It.call(t,e)?t[e]:void 0},_t=Object.prototype.hasOwnProperty;var Pt=function(e){var t=this.__data__;return jt?void 0!==t[e]:_t.call(t,e)};var xt=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=jt&&void 0===t?"__lodash_hash_undefined__":t,this};function Nt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Nt.prototype.clear=Tt,Nt.prototype.delete=kt,Nt.prototype.get=Lt,Nt.prototype.has=Pt,Nt.prototype.set=xt;var Rt=Nt;var Dt=function(){this.size=0,this.__data__={hash:new Rt,map:new(At||rt),string:new Rt}};var Mt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Ut=function(e,t){var n=e.__data__;return Mt(t)?n["string"==typeof t?"string":"hash"]:n.map};var Ft=function(e){var t=Ut(this,e).delete(e);return this.size-=t?1:0,t};var Vt=function(e){return Ut(this,e).get(e)};var Bt=function(e){return Ut(this,e).has(e)};var Ht=function(e,t){var n=Ut(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function zt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zt.prototype.clear=Dt,zt.prototype.delete=Ft,zt.prototype.get=Vt,zt.prototype.has=Bt,zt.prototype.set=Ht;var qt=zt;var Jt=function(e,t){var n=this.__data__;if(n instanceof rt){var r=n.__data__;if(!At||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qt(r)}return n.set(e,t),this.size=n.size,this};function $t(e){var t=this.__data__=new rt(e);this.size=t.size}$t.prototype.clear=it,$t.prototype.delete=ot,$t.prototype.get=at,$t.prototype.has=ct,$t.prototype.set=Jt;var Kt=$t;var Wt=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},Yt=function(){try{var e=wt(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Gt=function(e,t,n){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Zt=Object.prototype.hasOwnProperty;var Qt=function(e,t,n){var r=e[t];Zt.call(e,t)&&Ye(r,n)&&(void 0!==n||t in e)||Gt(e,t,n)};var Xt=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var c=t[o],s=r?r(n[c],e[c],c,n,e):void 0;void 0===s&&(s=e[c]),i?Gt(n,c,s):Qt(n,c,s)}return n};var en=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var tn=function(e){return Be(e)&&"[object Arguments]"==Ue(e)},nn=Object.prototype,rn=nn.hasOwnProperty,on=nn.propertyIsEnumerable,an=tn(function(){return arguments}())?tn:function(e){return Be(e)&&rn.call(e,"callee")&&!on.call(e,"callee")},cn=Array.isArray,sn=n(49),un=/^(?:0|[1-9]\d*)$/;var ln=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&un.test(e))&&e>-1&&e%1==0&&e<t};var fn=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},pn={};pn["[object Float32Array]"]=pn["[object Float64Array]"]=pn["[object Int8Array]"]=pn["[object Int16Array]"]=pn["[object Int32Array]"]=pn["[object Uint8Array]"]=pn["[object Uint8ClampedArray]"]=pn["[object Uint16Array]"]=pn["[object Uint32Array]"]=!0,pn["[object Arguments]"]=pn["[object Array]"]=pn["[object ArrayBuffer]"]=pn["[object Boolean]"]=pn["[object DataView]"]=pn["[object Date]"]=pn["[object Error]"]=pn["[object Function]"]=pn["[object Map]"]=pn["[object Number]"]=pn["[object Object]"]=pn["[object RegExp]"]=pn["[object Set]"]=pn["[object String]"]=pn["[object WeakMap]"]=!1;var dn=function(e){return Be(e)&&fn(e.length)&&!!pn[Ue(e)]};var mn=function(e){return function(t){return e(t)}},hn=n(29),yn=hn.a&&hn.a.isTypedArray,vn=yn?mn(yn):dn,bn=Object.prototype.hasOwnProperty;var gn=function(e,t){var n=cn(e),r=!n&&an(e),i=!n&&!r&&Object(sn.a)(e),o=!n&&!r&&!i&&vn(e),a=n||r||i||o,c=a?en(e.length,String):[],s=c.length;for(var u in e)!t&&!bn.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ln(u,s))||c.push(u);return c},Sn=Object.prototype;var En=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Sn)},On=Fe(Object.keys,Object),Cn=Object.prototype.hasOwnProperty;var wn=function(e){if(!En(e))return On(e);var t=[];for(var n in Object(e))Cn.call(e,n)&&"constructor"!=n&&t.push(n);return t};var An=function(e){return null!=e&&fn(e.length)&&!lt(e)};var jn=function(e){return An(e)?gn(e):wn(e)};var Tn=function(e,t){return e&&Xt(t,jn(t),e)};var kn=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},In=Object.prototype.hasOwnProperty;var Ln=function(e){if(!st(e))return kn(e);var t=En(e),n=[];for(var r in e)("constructor"!=r||!t&&In.call(e,r))&&n.push(r);return n};var _n=function(e){return An(e)?gn(e,!0):Ln(e)};var Pn=function(e,t){return e&&Xt(t,_n(t),e)},xn=n(208);var Nn=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var Rn=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o};var Dn=function(){return[]},Mn=Object.prototype.propertyIsEnumerable,Un=Object.getOwnPropertySymbols,Fn=Un?function(e){return null==e?[]:(e=Object(e),Rn(Un(e),(function(t){return Mn.call(e,t)})))}:Dn;var Vn=function(e,t){return Xt(e,Fn(e),t)};var Bn=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},Hn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Bn(t,Fn(e)),e=Ve(e);return t}:Dn;var zn=function(e,t){return Xt(e,Hn(e),t)};var qn=function(e,t,n){var r=t(e);return cn(e)?r:Bn(r,n(e))};var Jn=function(e){return qn(e,jn,Fn)};var $n=function(e){return qn(e,_n,Hn)},Kn=wt(ke.a,"DataView"),Wn=wt(ke.a,"Promise"),Yn=wt(ke.a,"Set"),Gn=wt(ke.a,"WeakMap"),Zn=ht(Kn),Qn=ht(At),Xn=ht(Wn),er=ht(Yn),tr=ht(Gn),nr=Ue;(Kn&&"[object DataView]"!=nr(new Kn(new ArrayBuffer(1)))||At&&"[object Map]"!=nr(new At)||Wn&&"[object Promise]"!=nr(Wn.resolve())||Yn&&"[object Set]"!=nr(new Yn)||Gn&&"[object WeakMap]"!=nr(new Gn))&&(nr=function(e){var t=Ue(e),n="[object Object]"==t?e.constructor:void 0,r=n?ht(n):"";if(r)switch(r){case Zn:return"[object DataView]";case Qn:return"[object Map]";case Xn:return"[object Promise]";case er:return"[object Set]";case tr:return"[object WeakMap]"}return t});var rr=nr,ir=Object.prototype.hasOwnProperty;var or=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ir.call(e,"index")&&(n.index=e.index,n.input=e.input),n},ar=ke.a.Uint8Array;var cr=function(e){var t=new e.constructor(e.byteLength);return new ar(t).set(new ar(e)),t};var sr=function(e,t){var n=t?cr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},ur=/\w*$/;var lr=function(e){var t=new e.constructor(e.source,ur.exec(e));return t.lastIndex=e.lastIndex,t},fr=Ie?Ie.prototype:void 0,pr=fr?fr.valueOf:void 0;var dr=function(e){return pr?Object(pr.call(e)):{}};var mr=function(e,t){var n=t?cr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var hr=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return cr(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return sr(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return mr(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return lr(e);case"[object Set]":return new r;case"[object Symbol]":return dr(e)}},yr=Object.create,vr=function(){function e(){}return function(t){if(!st(t))return{};if(yr)return yr(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var br=function(e){return"function"!=typeof e.constructor||En(e)?{}:vr(Ve(e))};var gr=function(e){return Be(e)&&"[object Map]"==rr(e)},Sr=hn.a&&hn.a.isMap,Er=Sr?mn(Sr):gr;var Or=function(e){return Be(e)&&"[object Set]"==rr(e)},Cr=hn.a&&hn.a.isSet,wr=Cr?mn(Cr):Or,Ar={};Ar["[object Arguments]"]=Ar["[object Array]"]=Ar["[object ArrayBuffer]"]=Ar["[object DataView]"]=Ar["[object Boolean]"]=Ar["[object Date]"]=Ar["[object Float32Array]"]=Ar["[object Float64Array]"]=Ar["[object Int8Array]"]=Ar["[object Int16Array]"]=Ar["[object Int32Array]"]=Ar["[object Map]"]=Ar["[object Number]"]=Ar["[object Object]"]=Ar["[object RegExp]"]=Ar["[object Set]"]=Ar["[object String]"]=Ar["[object Symbol]"]=Ar["[object Uint8Array]"]=Ar["[object Uint8ClampedArray]"]=Ar["[object Uint16Array]"]=Ar["[object Uint32Array]"]=!0,Ar["[object Error]"]=Ar["[object Function]"]=Ar["[object WeakMap]"]=!1;var jr=function e(t,n,r,i,o,a){var c,s=1&n,u=2&n,l=4&n;if(r&&(c=o?r(t,i,o,a):r(t)),void 0!==c)return c;if(!st(t))return t;var f=cn(t);if(f){if(c=or(t),!s)return Nn(t,c)}else{var p=rr(t),d="[object Function]"==p||"[object GeneratorFunction]"==p;if(Object(sn.a)(t))return Object(xn.a)(t,s);if("[object Object]"==p||"[object Arguments]"==p||d&&!o){if(c=u||d?{}:br(t),!s)return u?zn(t,Pn(c,t)):Vn(t,Tn(c,t))}else{if(!Ar[p])return o?t:{};c=hr(t,p,s)}}a||(a=new Kt);var m=a.get(t);if(m)return m;a.set(t,c),wr(t)?t.forEach((function(i){c.add(e(i,n,r,i,t,a))})):Er(t)&&t.forEach((function(i,o){c.set(o,e(i,n,r,o,t,a))}));var h=f?void 0:(l?u?$n:Jn:u?_n:jn)(t);return Wt(h||t,(function(i,o){h&&(i=t[o=i]),Qt(c,o,e(i,n,r,o,t,a))})),c};var Tr=function(e){return jr(e,4)};var kr=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i};var Ir=function(e){return"symbol"==typeof e||Be(e)&&"[object Symbol]"==Ue(e)};function Lr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Lr.Cache||qt),n}Lr.Cache=qt;var _r=Lr;var Pr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xr=/\\(\\)?/g,Nr=function(e){var t=_r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Pr,(function(e,n,r,i){t.push(r?i.replace(xr,"$1"):n||e)})),t}));var Rr=function(e){if("string"==typeof e||Ir(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Dr=Ie?Ie.prototype:void 0,Mr=Dr?Dr.toString:void 0;var Ur=function e(t){if("string"==typeof t)return t;if(cn(t))return kr(t,e)+"";if(Ir(t))return Mr?Mr.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var Fr=function(e){return null==e?"":Ur(e)};var Vr=function(e){return cn(e)?kr(e,Rr):Ir(e)?[e]:Nn(Nr(Fr(e)))};var Br=function(e,t){},Hr=n(61),zr=n(62),qr=n.n(zr);var Jr=function(e){return jr(e,5)};function $r(){return($r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Kr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Wr(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function Yr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Gr=function(e){return"function"==typeof e},Zr=function(e){return null!==e&&"object"==typeof e},Qr=function(e){return String(Math.floor(Number(e)))===e},Xr=function(e){return"[object String]"===Object.prototype.toString.call(e)},ei=function(e){return 0===l.Children.count(e)},ti=function(e){return Zr(e)&&Gr(e.then)};function ni(e,t,n,r){void 0===r&&(r=0);for(var i=Vr(t);e&&r<i.length;)e=e[i[r++]];return void 0===e?n:e}function ri(e,t,n){for(var r=Tr(e),i=r,o=0,a=Vr(t);o<a.length-1;o++){var c=a[o],s=ni(e,a.slice(0,o+1));if(s&&(Zr(s)||Array.isArray(s)))i=i[c]=Tr(s);else{var u=a[o+1];i=i[c]=Qr(u)&&Number(u)>=0?[]:{}}}return(0===o?e:i)[a[o]]===n?e:(void 0===n?delete i[a[o]]:i[a[o]]=n,0===o&&void 0===n&&delete r[a[o]],r)}function ii(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,o=Object.keys(e);i<o.length;i++){var a=o[i],c=e[a];Zr(c)?n.get(c)||(n.set(c,!0),r[a]=Array.isArray(c)?[]:{},ii(c,t,n,r[a])):r[a]=t}return r}var oi=Object(l.createContext)(void 0),ai=oi.Provider,ci=oi.Consumer;function si(){var e=Object(l.useContext)(oi);return e||Br(!1),e}function ui(e,t){switch(t.type){case"SET_VALUES":return $r({},e,{values:t.payload});case"SET_TOUCHED":return $r({},e,{touched:t.payload});case"SET_ERRORS":return $r({},e,{errors:t.payload});case"SET_STATUS":return $r({},e,{status:t.payload});case"SET_ISSUBMITTING":return $r({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return $r({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return $r({},e,{values:ri(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return $r({},e,{touched:ri(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return $r({},e,{errors:ri(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return $r({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return $r({},e,{touched:ii(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return $r({},e,{isSubmitting:!1});default:return e}}var li={},fi={};function pi(e){var t=e.validateOnChange,n=void 0===t||t,r=e.validateOnBlur,i=void 0===r||r,o=e.validateOnMount,a=void 0!==o&&o,c=e.isInitialValid,s=e.enableReinitialize,u=void 0!==s&&s,f=e.onSubmit,p=Wr(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),d=$r({validateOnChange:n,validateOnBlur:i,validateOnMount:a,onSubmit:f},p),m=Object(l.useRef)(d.initialValues),h=Object(l.useRef)(d.initialErrors||li),y=Object(l.useRef)(d.initialTouched||fi),v=Object(l.useRef)(d.initialStatus),b=Object(l.useRef)(!1),g=Object(l.useRef)({});Object(l.useEffect)((function(){0}),[]),Object(l.useEffect)((function(){return b.current=!0,function(){b.current=!1}}),[]);var S=Object(l.useReducer)(ui,{values:d.initialValues,errors:d.initialErrors||li,touched:d.initialTouched||fi,status:d.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),E=S[0],O=S[1],C=Object(l.useCallback)((function(e,t){return new Promise((function(n,r){var i=d.validate(e,t);null==i?n(li):ti(i)?i.then((function(e){n(e||li)}),(function(e){r(e)})):n(i)}))}),[d.validate]),w=Object(l.useCallback)((function(e,t){var n=d.validationSchema,r=Gr(n)?n(t):n,i=t&&r.validateAt?r.validateAt(t,e):function(e,t,n,r){void 0===n&&(n=!1);void 0===r&&(r={});var i=function e(t){var n={};for(var r in t)if(t.hasOwnProperty(r)){var i=String(r);!0===Array.isArray(t[i])?n[i]=t[i].map((function(t){return!0===Array.isArray(t)||Ke(t)?e(t):""!==t?t:void 0})):Ke(t[i])?n[i]=e(t[i]):n[i]=""!==t[i]?t[i]:void 0}return n}(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}(e,r);return new Promise((function(e,t){i.then((function(){e(li)}),(function(n){"ValidationError"===n.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return ri(t,e.path,e.message);var n=e.inner,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var a=o;ni(t,a.path)||(t=ri(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[d.validationSchema]),A=Object(l.useCallback)((function(e,t){return new Promise((function(n){return n(g.current[e].validate(t))}))}),[]),j=Object(l.useCallback)((function(e){var t=Object.keys(g.current).filter((function(e){return Gr(g.current[e].validate)})),n=t.length>0?t.map((function(t){return A(t,ni(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=ri(e,t[r],n)),e}),{})}))}),[A]),T=Object(l.useCallback)((function(e){return Promise.all([j(e),d.validationSchema?w(e):{},d.validate?C(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return Te.all([t,n,r],{arrayMerge:mi})}))}),[d.validate,d.validationSchema,j,C,w]),k=yi((function(e){return void 0===e&&(e=E.values),Object(Hr.unstable_runWithPriority)(Hr.LowPriority,(function(){return T(e).then((function(e){return b.current&&O({type:"SET_ERRORS",payload:e}),e}))}))})),I=yi((function(e){return void 0===e&&(e=E.values),O({type:"SET_ISVALIDATING",payload:!0}),T(e).then((function(e){return b.current&&(O({type:"SET_ISVALIDATING",payload:!1}),Ee()(E.errors,e)||O({type:"SET_ERRORS",payload:e})),e}))}));Object(l.useEffect)((function(){a&&!0===b.current&&k(d.initialValues)}),[d.initialValues,a,k]);var L=Object(l.useCallback)((function(e){var t=e&&e.values?e.values:m.current,n=e&&e.errors?e.errors:h.current?h.current:d.initialErrors||{},r=e&&e.touched?e.touched:y.current?y.current:d.initialTouched||{},i=e&&e.status?e.status:v.current?v.current:d.initialStatus;m.current=t,h.current=n,y.current=r,v.current=i,O({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})}),[d.initialErrors,d.initialStatus,d.initialTouched]);Object(l.useEffect)((function(){u&&!0===b.current&&!Ee()(m.current,d.initialValues)&&(m.current=d.initialValues,L())}),[u,d.initialValues,L]),Object(l.useEffect)((function(){u&&!0===b.current&&!Ee()(h.current,d.initialErrors)&&(h.current=d.initialErrors||li,O({type:"SET_ERRORS",payload:d.initialErrors||li}))}),[u,d.initialErrors]),Object(l.useEffect)((function(){u&&!0===b.current&&!Ee()(y.current,d.initialTouched)&&(y.current=d.initialTouched||fi,O({type:"SET_TOUCHED",payload:d.initialTouched||fi}))}),[u,d.initialTouched]),Object(l.useEffect)((function(){u&&!0===b.current&&!Ee()(v.current,d.initialStatus)&&(v.current=d.initialStatus,O({type:"SET_STATUS",payload:d.initialStatus}))}),[u,d.initialStatus,d.initialTouched]);var _=yi((function(e){if(Gr(g.current[e].validate)){var t=ni(E.values,e),n=g.current[e].validate(t);return ti(n)?(O({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),O({type:"SET_ISVALIDATING",payload:!1})}))):(O({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return Promise.resolve()})),P=Object(l.useCallback)((function(e,t){var n=t.validate;g.current[e]={validate:n}}),[]),x=Object(l.useCallback)((function(e){delete g.current[e]}),[]),N=yi((function(e){return O({type:"SET_TOUCHED",payload:e}),i?k(E.values):Promise.resolve()})),R=Object(l.useCallback)((function(e){O({type:"SET_ERRORS",payload:e})}),[]),D=yi((function(e){return O({type:"SET_VALUES",payload:e}),n?k(e):Promise.resolve()})),M=Object(l.useCallback)((function(e,t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),U=yi((function(e,t,r){return void 0===r&&(r=!0),O({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),n&&r?k(ri(E.values,e,t)):Promise.resolve()})),F=Object(l.useCallback)((function(e,t){var n,r=t,i=e;if(!Xr(e)){e.persist&&e.persist();var o=e.target,a=o.type,c=o.name,s=o.id,u=o.value,l=o.checked,f=(o.outerHTML,o.options),p=o.multiple;r=t||(c||s),i=/number|range/.test(a)?(n=parseFloat(u),isNaN(n)?"":n):/checkbox/.test(a)?function(e,t,n){if("true"==n||"false"==n)return!!t;if(t&&n)return Array.isArray(e)?e.concat(n):[n];if(!Array.isArray(e))return!e;var r=e.indexOf(n);if(r<0)return e;return e.slice(0,r).concat(e.slice(r+1))}(ni(E.values,r),l,u):p?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(f):u}r&&U(r,i)}),[U,E.values]),V=Object(l.useCallback)((function(e){if(Xr(e))return function(t){return F(t,e)};F(e)}),[F]),B=yi((function(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=!0),O({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),i&&n?k(E.values):Promise.resolve()})),H=Object(l.useCallback)((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,i=n.id,o=(n.outerHTML,t||(r||i));B(o,!0)}),[B]),z=Object(l.useCallback)((function(e){if(Xr(e))return function(t){return H(t,e)};H(e)}),[H]),q=Object(l.useCallback)((function(e){Gr(e)?O({type:"SET_FORMIK_STATE",payload:e}):O({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),J=Object(l.useCallback)((function(e){O({type:"SET_STATUS",payload:e})}),[]),$=Object(l.useCallback)((function(e){O({type:"SET_ISSUBMITTING",payload:e})}),[]),K={resetForm:L,validateForm:I,validateField:_,setErrors:R,setFieldError:M,setFieldTouched:B,setFieldValue:U,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,setFormikState:q},W=yi((function(){return f(E.values,K)})),Y=yi((function(){return O({type:"SUBMIT_ATTEMPT"}),I().then((function(e){if(0===Object.keys(e).length){var t=W();if(void 0===t)return;return Promise.resolve(t).then((function(){b.current&&O({type:"SUBMIT_SUCCESS"})})).catch((function(e){if(b.current)throw O({type:"SUBMIT_FAILURE"}),e}))}b.current&&O({type:"SUBMIT_FAILURE"})}))})),G=yi((function(e){e&&e.preventDefault&&Gr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Gr(e.stopPropagation)&&e.stopPropagation(),Y()})),Z=yi((function(e){if(e&&e.preventDefault&&Gr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Gr(e.stopPropagation)&&e.stopPropagation(),d.onReset){var t=d.onReset(E.values,K);ti(t)?t.then(L):L()}else L()})),Q=Object(l.useCallback)((function(e){return{value:ni(E.values,e),error:ni(E.errors,e),touched:!!ni(E.touched,e),initialValue:ni(m.current,e),initialTouched:!!ni(y.current,e),initialError:ni(h.current,e)}}),[E.errors,E.touched,E.values]),X=Object(l.useCallback)((function(e){var t=Zr(e),n=t?e.name:e,r=ni(E.values,n),i={name:n,value:r,onChange:V,onBlur:z};if(t){var o=e.type,a=e.value,c=e.as,s=e.multiple;"checkbox"===o?void 0===a?i.checked=!!r:(i.checked=!(!Array.isArray(r)||!~r.indexOf(a)),i.value=a):"radio"===o?(i.checked=r===a,i.value=a):"select"===c&&s&&(i.value=i.value||[],i.multiple=!0)}return i}),[z,V,E.values]),ee=Object(l.useMemo)((function(){return!Ee()(m.current,E.values)}),[E.values]),te=Object(l.useMemo)((function(){return void 0!==c?ee?E.errors&&0===Object.keys(E.errors).length:!1!==c&&Gr(c)?c(d):c:E.errors&&0===Object.keys(E.errors).length}),[c,ee,E.errors,d]);return $r({},E,{initialValues:m.current,initialErrors:h.current,initialTouched:y.current,initialStatus:v.current,handleBlur:z,handleChange:V,handleReset:Z,handleSubmit:G,resetForm:L,setErrors:R,setFormikState:q,setFieldTouched:B,setFieldValue:U,setFieldError:M,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,submitForm:Y,validateForm:I,validateField:_,isValid:te,dirty:ee,unregisterField:x,registerField:P,getFieldProps:X,getFieldMeta:Q,validateOnBlur:i,validateOnChange:n,validateOnMount:a})}function di(e){var t=pi(e),n=e.component,r=e.children,i=e.render;return Object(l.useEffect)((function(){0}),[]),Object(l.createElement)(ai,{value:t},n?Object(l.createElement)(n,t):i?i(t):r?Gr(r)?r(t):ei(r)?null:l.Children.only(r):null)}function mi(e,t,n){var r=e.slice();return t.forEach((function(t,i){if(void 0===r[i]){var o=!1!==n.clone&&n.isMergeableObject(t);r[i]=o?Te(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[i]=Te(e[i],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var hi="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;function yi(e){var t=Object(l.useRef)(e);return hi((function(){t.current=e})),Object(l.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current.apply(void 0,n)}),[])}function vi(e){var t=e.validate,n=e.name,r=e.render,i=e.children,o=e.as,a=e.component,c=Wr(e,["validate","name","render","children","as","component"]),s=si(),u=(s.validate,s.validationSchema,Wr(s,["validate","validationSchema"]));Object(l.useEffect)((function(){0}),[]);var f=u.registerField,p=u.unregisterField;Object(l.useEffect)((function(){return f(n,{validate:t}),function(){p(n)}}),[f,p,n,t]);var d=u.getFieldProps($r({name:n},c)),m=u.getFieldMeta(n),h={field:d,form:u};if(r)return r($r({},h,{meta:m}));if(Gr(i))return i($r({},h,{meta:m}));if(a){if("string"==typeof a){var y=c.innerRef,v=Wr(c,["innerRef"]);return Object(l.createElement)(a,$r({ref:y},d,v),i)}return Object(l.createElement)(a,$r({field:d,form:u},c),i)}var b=o||"input";if("string"==typeof b){var g=c.innerRef,S=Wr(c,["innerRef"]);return Object(l.createElement)(b,$r({ref:g},d,S),i)}return Object(l.createElement)(b,$r({},d,c),i)}var bi=Object(l.forwardRef)((function(e,t){var n=e.action,r=Wr(e,["action"]),i=n||"#",o=si(),a=o.handleReset,c=o.handleSubmit;return Object(l.createElement)("form",Object.assign({onSubmit:c,ref:t,onReset:a,action:i},r))}));function gi(e){var t=function(t){return Object(l.createElement)(ci,null,(function(n){return n||Br(!1),Object(l.createElement)(e,Object.assign({},t,{formik:n}))}))},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t.WrappedComponent=e,t.displayName="FormikConnect("+n+")",qr()(t,e)}bi.displayName="Form";var Si=function(e,t,n){var r=Ei(e);return r.splice(t,0,n),r},Ei=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,t){return t>e?t:e}),0);return Array.from($r({},e,{length:t+1}))}return[]},Oi=function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var i=n.props,o=i.name,a=i.validateOnChange,c=i.formik,s=c.setFormikState,u=c.validateForm;s((function(n){var i="function"==typeof r?r:e,a="function"==typeof t?t:e;return $r({},n,{values:ri(n.values,o,e(ni(n.values,o))),errors:r?ri(n.errors,o,i(ni(n.errors,o))):n.errors,touched:t?ri(n.touched,o,a(ni(n.touched,o))):n.touched})}),(function(){a&&u()}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(Ei(t),[Jr(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Ei(e),i=r[t];return r[t]=r[n],r[n]=i,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Ei(e),i=r[t];return r.splice(t,1),r.splice(n,0,i),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return Si(n,e,t)}),(function(t){return Si(t,e,null)}),(function(t){return Si(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Ei(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(Yr(n)),n.pop=n.pop.bind(Yr(n)),n}Kr(t,e);var n=t.prototype;return n.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?Ei(n):[];return t||(t=r[e]),Gr(r.splice)&&r.splice(e,1),r}),!0,!0),t},n.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},n.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,i=t.children,o=t.name,a=t.formik,c=(a.validate,a.validationSchema,$r({},e,{form:Wr(a,["validate","validationSchema"]),name:o}));return n?Object(l.createElement)(n,c):r?r(c):i?"function"==typeof i?i(c):ei(i)?null:l.Children.only(i):null},t}(l.Component);Oi.defaultProps={validateOnChange:!0};var Ci=gi(function(e){function t(){return e.apply(this,arguments)||this}Kr(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return ni(this.props.formik.errors,this.props.name)!==ni(e.formik.errors,this.props.name)||ni(this.props.formik.touched,this.props.name)!==ni(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,t=e.component,n=e.formik,r=e.render,i=e.children,o=e.name,a=Wr(e,["component","formik","render","children","name"]),c=ni(n.touched,o),s=ni(n.errors,o);return c&&s?r?Gr(r)?r(s):null:i?Gr(i)?i(s):null:t?Object(l.createElement)(t,a,s):s:null},t}(l.Component));(function(e){function t(t){var n;n=e.call(this,t)||this;var r=t.render,i=t.children,o=t.component,a=t.as;t.name;return r&&Br(!1),o&&r&&Br(!1),a&&i&&Gr(i)&&Br(!1),o&&i&&Gr(i)&&Br(!1),r&&i&&!ei(i)&&Br(!1),n}Kr(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e,t,n){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):ni(this.context.values,this.props.name)!==ni(n.values,this.props.name)||ni(this.context.errors,this.props.name)!==ni(n.errors,this.props.name)||ni(this.context.touched,this.props.name)!==ni(n.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||this.context.isSubmitting!==n.isSubmitting},n.componentDidMount=function(){this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentDidUpdate=function(e){this.props.name!==e.name&&(this.context.unregisterField(e.name),this.context.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==e.validate&&this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentWillUnmount=function(){this.context.unregisterField(this.props.name)},n.render=function(){var e=this.props,t=(e.validate,e.name),n=e.render,r=e.as,i=e.children,o=e.component,a=(e.shouldUpdate,Wr(e,["validate","name","render","as","children","component","shouldUpdate"])),c=this.context,s=(c.validate,c.validationSchema,Wr(c,["validate","validationSchema"])),u={value:"radio"===a.type||"checkbox"===a.type?a.value:ni(c.values,t),name:t,onChange:c.handleChange,onBlur:c.handleBlur},f={field:u,meta:{value:ni(c.values,t),error:ni(c.errors,t),touched:!!ni(c.touched,t),initialValue:ni(c.initialValues,t),initialTouched:!!ni(c.initialTouched,t),initialError:ni(c.initialErrors,t)},form:s};if(n)return n(f);if(Gr(i))return i(f);if(o){if("string"==typeof o){var p=a.innerRef,d=Wr(a,["innerRef"]);return Object(l.createElement)(o,$r({ref:p},u,d),i)}return Object(l.createElement)(o,$r({field:u,form:c},a),i)}var m=r||"input";if("string"==typeof m){var h=a.innerRef,y=Wr(a,["innerRef"]);return Object(l.createElement)(m,$r({ref:h},u,y),i)}return Object(l.createElement)(m,$r({},u,a),i)},t}(l.Component)).contextType=oi;var wi=n(7),Ai=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function ji(e){var t=e.castInitialValues,n=e.castValuesOnSubmit,r=e.initialValues,i=e.onSubmit,o=Ai(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit"]),a=t&&e.validationSchema?e.validationSchema.cast(function e(t){var n=wi.a.deepClone(t);return Object.keys(n).forEach((function(t){n.hasOwnProperty(t)&&(wi.a.isObject(n[t])?n[t]=e(n[t]):null===n[t]&&delete n[t])})),n}(r)):r,c={allowInitialSubmit:e.allowInitialSubmit};return l.createElement(di,Object.assign({enableReinitialize:!0},o,{initialValues:a,onSubmit:function(t,r){var o=r.setSubmitting,a=r.resetForm,c=n&&e.validationSchema?e.validationSchema.cast(t):t;i(c,(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.reset&&a(),o(!1)}))},initialStatus:c}),h(e.children)?function(t){return e.children(t)}:l.Children.count(e.children)?e.children:null)}ji.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0};var Ti=n(2),ki=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),Ii=n(3),Li=function(e,t,n,r,i){var o="form-control";return"sm"===r&&(o+=" form-control-sm"),"lg"===r&&(o+=" form-control-lg"),ni(t,n)&&ni(e,n)&&(o+=" is-invalid"),i&&(o+=" ".concat(i)),o},_i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Pi(e){var t=e.label,n=e.checkboxLabelClassName,r=_i(e,["label","checkboxLabelClassName"]);return l.createElement(Ii.Form.Group,null,l.createElement("div",{className:"custom-control custom-checkbox"},l.createElement(os,Object.assign({className:"custom-control-input"},r)),l.createElement(Ii.Form.Label,{className:"custom-control-label cursor-pointer ".concat(n),htmlFor:r.id},t)))}var xi,Ni,Ri=n(37),Di=n(85),Mi=n.n(Di),Ui=n(86),Fi=n.n(Ui),Vi=n(87),Bi=n.n(Vi),Hi=n(88),zi=n.n(Hi),qi=(n(89),n(90)),Ji=n.n(qi),$i=n(91),Ki=n.n($i),Wi=n(92),Yi=n.n(Wi),Gi=n(93),Zi=n.n(Gi),Qi=n(94),Xi=n.n(Qi),eo=n(95),to=n.n(eo),no=n(96),ro=n.n(no),io=n(97),oo=n.n(io),ao=n(98),co=n.n(ao),so=n(99),uo=n.n(so),lo=n(100),fo=n.n(lo),po=n(101),mo=n.n(po),ho=n(102),yo=n.n(ho),vo=n(103),bo=n.n(vo),go=n(104),So=n.n(go),Eo=n(105),Oo=n.n(Eo),Co=n(106),wo=n.n(Co),Ao=n(107),jo=n.n(Ao),To=n(108),ko=n.n(To),Io=n(109),Lo=n.n(Io),_o=n(110),Po=n.n(_o),xo=n(111),No=n.n(xo),Ro=n(112),Do=n.n(Ro),Mo=n(113),Uo=n.n(Mo),Fo=n(114),Vo=n.n(Fo),Bo=n(115),Ho=n.n(Bo),zo=n(116),qo=n.n(zo),Jo=n(117),$o=n.n(Jo),Ko=n(118),Wo=n.n(Ko),Yo=n(119),Go=n.n(Yo),Zo=n(120),Qo=n.n(Zo),Xo=n(121),ea=n.n(Xo),ta=(n(122),n(123),n(124)),na=n.n(ta),ra=n(125),ia=n.n(ra),oa=n(126),aa=n.n(oa),ca=n(127),sa=n.n(ca),ua=n(128),la=n.n(ua),fa=n(129),pa=n.n(fa),da=n(130),ma=n.n(da),ha=n(131),ya=n.n(ha),va=n(132),ba=n.n(va),ga=(n(133),n(134)),Sa=n.n(ga),Ea=n(135),Oa=n.n(Ea),Ca=n(136),wa=n.n(Ca),Aa=n(137),ja=n.n(Aa),Ta=n(138),ka=n.n(Ta),Ia=n(139),La=n.n(Ia),_a=n(140),Pa=n.n(_a),xa=(n(141),n(142)),Na=n.n(xa),Ra=n(143),Da=n.n(Ra),Ma=n(144),Ua=n.n(Ma),Fa=n(145),Va=n.n(Fa),Ba=n(146),Ha=n.n(Ba),za=n(147),qa=n.n(za),Ja=n(148),$a=n.n(Ja),Ka=n(149),Wa=n.n(Ka),Ya=n(150),Ga=n.n(Ya),Za=n(151),Qa=n.n(Za),Xa=n(152),ec=n.n(Xa),tc=n(153),nc=n.n(tc),rc=n(154),ic=n.n(rc),oc=n(155),ac=n.n(oc),cc=n(156),sc=n.n(cc),uc=n(157),lc=n.n(uc),fc=n(158),pc=n.n(fc),dc=n(159),mc=n.n(dc),hc=n(160),yc=n.n(hc),vc=n(161),bc=n.n(vc),gc=n(162),Sc=n.n(gc),Ec=n(163),Oc=n.n(Ec),Cc=n(164),wc=n.n(Cc),Ac=n(165),jc=n.n(Ac),Tc=n(166),kc=n.n(Tc),Ic=n(167),Lc=n.n(Ic),_c=n(168),Pc=n.n(_c),xc=n(169),Nc=n.n(xc),Rc=n(170),Dc=n.n(Rc),Mc=n(171),Uc=n.n(Mc),Fc=n(172),Vc=n.n(Fc),Bc=n(173),Hc=n.n(Bc),zc=(n(174),n(175),n(176),n(177)),qc=n.n(zc),Jc=n(178),$c=n.n(Jc),Kc=[Mi.a,Bi.a,zi.a,Ki.a,Xi.a,to.a,ro.a,oo.a,Zi.a,Ji.a,Fi.a,co.a,uo.a,fo.a,mo.a,yo.a,Yi.a,bo.a,So.a,Oo.a,wo.a,jo.a,ko.a,Lo.a,Po.a,Do.a,$o.a,Wo.a,Uo.a,Vo.a,Ho.a,qo.a,Go.a,No.a,la.a,lc.a,mc.a,pc.a,Oc.a,yc.a,bc.a,Sc.a,ja.a,La.a,ka.a,Qo.a,ea.a,Oa.a,wa.a,Sa.a,na.a,pa.a,Da.a,Ua.a,ma.a,ya.a,ba.a,Va.a,ia.a,Na.a,Ha.a,qa.a,ic.a,Pa.a,$a.a,Ga.a,Wa.a,wc.a,jc.a,Qa.a,ec.a,aa.a,sa.a,nc.a,ac.a,sc.a,Pc.a,Lc.a,kc.a,Nc.a,Uc.a,Dc.a,Vc.a,Hc.a,$c.a,qc.a];function Wc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e.AddToPlaylists="add-to-playlist",e.Caret="caret",e.Delete="delete",e.Edit="edit",e.NoEdit="no-edit",e.Close="close",e.Folder="folder",e.Resources="resources",e.More="more",e.Bell="bell",e.Plus="plus",e.Minus="minus",e.Search="search",e.Share="share",e.Share2="share2",e.Upload="upload",e.Preview="preview",e.CircleCheck="circle-check",e.Down="down",e.Right="right",e.UpDown="up-down",e.ChevronUp="chevron-up",e.ChevronDown="chevron-down",e.ChevronLeft="chevron-left",e.ChevronRight="chevron-right",e.VisibleOff="visible-off",e.VisibleOn="visible-on",e.PublisherArchive="publisher-archive",e.ArrowLeft="arrow-left",e.ArrowRight="arrow-right",e.CheckCircleOutline="check-circle-o",e.CheckCircle="check-circle",e.Check="check",e.Lock="lock",e.Link="link",e.Info="info",e.Question="question",e.Star="star",e.StarOutline="star-o",e.Archive="archive",e.Warning="warning",e.WarningOutline="warning-o",e.NewWindow="new-window",e.File="file",e.FilePDF="file-pdf",e.FileExcel="file-excel",e.FilePowerpoint="file-ppt",e.FileWord="file-word",e.FileImg="file-img",e.FileZip="file-zip",e.Enter="enter",e.Calendar="calendar",e.CloseCaptionBadge="close-caption-badge",e.Playlist="playlist",e.Image="image",e.Handle="handle",e.Subject="subject",e.Series="series",e.EditClickView="edit-clickview",e.Heart="heart",e.HeartOutline="heart-outline",e.WhiteWave="white-wave",e.Cog="cog",e.Video="video",e.Compass="compass",e.History="history",e.Tag="tag",e.Email="email",e.YearLevel="year-level",e.Subjects="subjects",e.Download="download",e.Print="print",e.CreateInteractive="create-interactive",e.Play="play",e.PlayCircle="play-circle",e.Twitter="twitter",e.Facebook="facebook",e.Classrooms="classrooms",e.Group="group",e.Timer="timer",e.CrossCircle="cross-circle",e.CrossCircleFilled="cross-circle-filled",e.Hamburger="hamburger",e.Library="library",e.InteractiveResults="interactive-results",e.House="house",e.MonitorPlay="monitor-play"}(xi||(xi={}));var Yc;function Gc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}d.extend(Ri.config,{autoReplaceSvg:!1,autoAddCss:!1,familyPrefix:"cv",autoA11y:!0,observeMutations:!1,replacementClass:"cv-svg",keepOriginalSource:!1}),(Ni=Ri.library).add.apply(Ni,function(e){if(Array.isArray(e))return Wc(e)}(Yc=Kc)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(Yc)||function(e,t){if(e){if("string"==typeof e)return Wc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wc(e,t):void 0}}(Yc)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var Zc=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"getSvg",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.faIconLookup(e,t),r=this.getIcon(n,t);if(r&&(!r||r.html.length))return r.html.pop()}},{key:"getIcon",value:function(e,t){return Ri.icon(e,t.iconOptions||{})}},{key:"faIconLookup",value:function(e,t){var n=t.prefix,r=void 0===n?"cv":n;return Ri.findIconDefinition({prefix:r,iconName:e})}}])&&Gc(t.prototype,n),r&&Gc(t,r),e}().Instance,Qc=xi,Xc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return Math.floor(Math.random()*Math.floor(e))};function es(e){var t,n=e.title,r=e.placement,i=e.trigger,o=e.spanHack,a=e.children;return o?l.createElement(Ii.OverlayTrigger,{placement:r,overlay:l.createElement(Ii.Tooltip,{id:"".concat(n,"-").concat(Xc())},n),trigger:i},l.createElement("span",{className:"d-flex justify-content-center align-items-center ".concat(null!==(t=e.spanHackClassName)&&void 0!==t?t:"")},a)):l.createElement(Ii.OverlayTrigger,{placement:r,overlay:l.createElement(Ii.Tooltip,{id:"".concat(n,"-").concat(Xc())},n),trigger:i},l.createElement(l.Fragment,null,a))}es.defaultProps={trigger:["hover","click","focus"],placement:"top"};var ts;function ns(e){var t=e.svgName,n=e.className,r=void 0===n?"d-inline-block svg-container":n,i=e.tagName,o=void 0===i?"span":i,a=e.size,c=void 0===a?ts.Standard:a,s=e.onClick,u=e.title,f=e.tooltipPlacement,p=void 0===f?"right":f,d=e.tooltipSpanHack,m=void 0!==d&&d,y=o,v={dangerouslySetInnerHTML:{__html:Zc.getSvg(t)},className:"".concat(r," ").concat(c),onClick:h(s)?s:null};return u?l.createElement(es,{title:u,placement:p,spanHack:m},l.createElement(y,Object.assign({},v))):l.createElement(y,Object.assign({},v))}function rs(e){var t=si().values[e.fieldName];return"string"!=typeof t?l.createElement(l.Fragment,null):l.createElement("div",{className:"float-right text-muted"},t.length,"/",e.limit)}!function(e){e.Standard="std",e.Small="sm",e.Medium="md",e.Large="lg",e.ExtraLarge="xlg",e.XXL="xxlg"}(ts||(ts={}));var is=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function os(e){var t=e.children,n=is(e,["children"]);return l.createElement(vi,Object.assign({},wi.a.omit(n,["formSize"])),h(t)?function(e){return t(e)}:l.Children.count(t)?t:null)}function as(e){var t=e.label,n=e.className,r=e.showCharacterCounter,i=e.showRequiredStar,o=e.infoTooltip,a=e.formSize,c=is(e,["label","className","showCharacterCounter","showRequiredStar","infoTooltip","formSize"]),s=si(),u=s.errors,f=s.touched,p=function(){};if("checkbox"===c.type){var d=wi.a.omit(e,["formSize"]);return e.disabled&&(d.onChange=p),l.createElement(Pi,Object.assign({},d))}var m=Object.assign(Object.assign({},c),{className:Li(u,f,c.name,a,n)});return e.disabled&&(m.onChange=p),l.createElement(Ii.Form.Group,null,!!t&&l.createElement(Ii.Form.Label,{htmlFor:c.id,className:"d-flex align-items-center"},t,i&&l.createElement("span",{className:"text-danger"},"*"),o&&l.createElement(ns,{svgName:Qc.Info,title:o,tooltipPlacement:"top",tooltipSpanHack:!0})),l.createElement(os,Object.assign({},m)),!!r&&!!c.maxLength&&l.createElement(rs,{fieldName:c.name,limit:c.maxLength}),l.createElement(Ci,{name:c.name},(function(e){return l.createElement(Ii.Form.Control.Feedback,{type:"invalid"},e)})))}function cs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ss(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ss(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function us(e){var t,n=cs(l.useState(!1),2),r=n[0],i=n[1];return l.useEffect((function(){var t;e.isValid&&(e.dirty||(null===(t=e.initialStatus)||void 0===t?void 0:t.allowInitialSubmit))?i(!0):i(!1)}),[e.isValid,null===(t=e.initialStatus)||void 0===t?void 0:t.allowInitialSubmit,e.dirty,e.values]),l.useEffect((function(){e.isSubmitting&&i(!1)}),[e.isSubmitting]),r}as.defaultProps={autoComplete:"off"};var ls=n(209),fs=n(50),ps=n(23),ds=n(4),ms="AlertService",hs="LanguageService",ys=n(11),vs=n(36);function bs(e){return(bs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ss(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Es(e,t){return(Es=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Os(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ws(e);if(t){var i=ws(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Cs(this,n)}}function Cs(e,t){return!t||"object"!==bs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ws(e){return(ws=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function As(e){return fs.sanitize(e).replace("&","&")}var js=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Es(e,t)}(o,e);var t,n,r,i=Os(o);function o(){return gs(this,o),i.apply(this,arguments)}return t=o,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"name",get:function(){return hs}},{key:"setConfig",value:function(e){this.polyglot=new ls({locale:e.locale,phrases:e.phrases.rootElement||e.phrases}),this.cache={}}},{key:"getPhrase",value:function(e,t,n){var r="".concat(e,".").concat(t);if(this.polyglot||ds.c.throw(new ys.a("LanguageService config must be set.")),!this.polyglot.has(r)){if(!vs.a.isDevelopment){var i=window.trackJs;return i&&i.console.error("No phrase set for ".concat(r," in language config")),""}ds.c.throw(new ys.a("No phrase set for ".concat(r," in language config.")))}if(!n||d.isEmpty(n)){var o=this.cache[r];if(o)return o;var a=this.polyglot.t(r);return this.cache[r]=a,a}var c=d.omit(n,"smartCount"),s={};for(var u in c){var l=c[u];"number"==typeof l&&(l=l.toString()),s[u]=As(l)}d.isNumber(n.smartCount)&&(s.smart_count=n.smartCount);var f="".concat(r,":").concat(d.values(Object.assign({},s)).join(":")),p=this.cache[f];if(p)return p;var m=this.polyglot.t(r,s);return this.cache[f]=m,m}},{key:"encloseNamespace",value:function(e){var t=this;return function(n,r){return t.getPhrase(e,n,r)}}}])&&Ss(t.prototype,n),r&&Ss(t,r),o}(ps.a).Instance,Ts=l.createContext(""),ks=l.memo((function(e){var t=e.phrase,n=e.namespace,r=e.options,i=l.useContext(Ts),o=n||i,a=js.getPhrase(o,t,r);return l.createElement("span",{dangerouslySetInnerHTML:{__html:a}})}),(function(e,t){return e.namespace===t.namespace&&e.phrase===t.phrase&&wi.a.isEqual(e.options,t.options)}));function Is(e){var t=si(),n=us(t);return l.createElement(Ii.Button,{variant:e.variant||"primary",type:"submit",disabled:!n,size:e.size,className:e.className?e.className:""},t.isSubmitting?l.createElement(Ii.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.submitText?l.createElement(l.Fragment,null,e.submitText):l.createElement(ks,{namespace:"shared.formButtons",phrase:e.isNew?"create":"save"}))}function Ls(e){var t=si();return l.createElement(bi,null,l.createElement(as,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this company",autoFocus:!0}),l.createElement(Is,{isNew:e.isNew}))}function _s(e){return l.createElement(ji,{initialValues:e.company,validationSchema:ki,onSubmit:e.saveCompany},l.createElement(Ls,{isNew:!(e.company&&e.company.id)}))}function Ps(e){var t=Object(b.useDispatch)(),n=ce.useBasicFetch(ve(e.id));return l.createElement(l.Fragment,null,!!n.data&&l.createElement(_s,{company:n.data,saveCompany:function(n,r){return ce.fetch(t,ge(e.id,n,r))}}))}function xs(){var e=Object(b.useDispatch)();return l.createElement(_s,{saveCompany:function(t,n){ce.fetch(e,be(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.PEOPLE,action:i.Companies.EDIT_COMPANY,args:[e.id]})}),n))}})}var Ns,Rs=n(210),Ds=n(211),Ms=n.n(Ds);function Us(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vs(e){return(Vs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){e.XS="(max-width: 575px)",e.SM="(min-width: 576px) and (max-width: 767px)",e.MD="(min-width: 768px) and (max-width: 991px)",e.LG="(min-width: 992px)",e.XL="(min-width: 1200px)",e.XXL="(min-width: 1440px)",e.SMDown="(max-width: 576px)",e.MDDown="(max-width: 768px)",e.LGDown="(max-width: 992px)",e.XLDown="(max-width: 1200px)"}(Ns||(Ns={}));var Bs={isNumber:function(e){return Bs.isType(e,"number")},isString:function(e){return Bs.isType(e,"string")},isType:function(e,t){return Vs(e)===t}},Hs=n(21),zs=n.n(Hs);function qs(e){return function(e){if(Array.isArray(e))return Js(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Js(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Js(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Js(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ks,Ws=[{empty:!0}];function Ys(e,t){return wi.a.isObject(e)&&e.hasOwnProperty(t)&&Bs.isString(e[t])}function Gs(e,t,n){return function(r){var i=r.value;if(i.length||n(),!(i.length<e.activationLength)){if(e.local){var o=h(e.getLocalSuggestions)?e.getLocalSuggestions(i,e.local):(c=i,s=e.local,u=e.valueKey,(l=c.trim().toLowerCase()).length?s.filter((function(e){return!(!Ys(e,u)||!Bs.isString(e[u]))&&e[u].trim().toLowerCase().includes(l)})):[]),a=!o.length&&e.getEmptyStateComponent;t((function(e){var t;return Object.assign(Object.assign({},e),($s(t={},Ks.Local,o),$s(t,Ks.Empty,a?Ws:[]),t))}))}var c,s,u,l;e.getRemoteUrl&&function(e,t,n,r){var i=h(e)&&e(t);i&&ce.ajaxRequest({resource:i,type:se.a.GET,success:n,error:function(){},headers:r})}(e.getRemoteUrl,i,(function(n){var r=h(e.formatRemoteSuggestions)?e.formatRemoteSuggestions(n):n,i=!r.length&&e.getEmptyStateComponent;t((function(e){var t;return Object.assign(Object.assign({},e),($s(t={},Ks.Remote,r),$s(t,Ks.Empty,i?Ws:[]),t))}))}),e.requestHeaders)}}}function Zs(e,t,n,r,i,o,a){var c=function(t){return e[t]||[]},s=t?c(Ks.Recent):[],u=c(Ks.Local),l=c(Ks.Remote),f=c(Ks.Empty);if(f.length&&n)return[{data:f}];var p=[];s.length&&p.push({title:r,data:s});var d=[].concat(qs(u),qs(l));return d.length?(Number.isInteger(a)&&d.length>a&&(d=d.slice(0,a)),h(o)?p.push.apply(p,qs(o(d))):p.push({title:i,data:d}),p):p}function Qs(e){return e.data}function Xs(e){return{container:"position-relative",suggestionsContainerOpen:"bg-white py-1 border rounded ".concat(zs.a.suggestionsContainerOpen),suggestionsList:"list-unstyled m-0",suggestion:"".concat(e?"":"cursor-pointer"," py-1 px-2"),suggestionHighlighted:e?"":zs.a.suggestionHighlighted,sectionContainer:"border-bottom py-1 ".concat(zs.a.sectionContainer)}}function eu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=Xs(t),r=Object.assign(n,e);return r}!function(e){e.Local="local",e.Recent="recent",e.Remote="remote",e.Empty="empty"}(Ks||(Ks={}));var tu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function nu(e,t,n,r,i){var o="form-control";return n||(o+=" ".concat(zs.a.inputWithoutHighlight)),"left"===e&&(o+=" ".concat(zs.a.inputWithLeftIcon)),("right"===e&&!t||"left"===e&&t)&&(o+=" ".concat(zs.a.inputWithRightIcon)),"right"===e&&t&&(o+=" ".concat(zs.a.inputWithTwoRightIcons)),"lg"===i&&(o+=" form-control-lg"),"sm"===i&&(o+=" form-control-sm"),r&&(o+="".concat(r)),o}function ru(e){var t="d-inline-block svg-container";return h(e)?t+" cursor-pointer":t}function iu(e){var t=e.onClickSearchIcon,n=e.searchIconPlacement,r=e.showClearInputIcon,i=e.onClickClearInput,o=e.highlightOnFocus,a=e.className,c=e.formSize,s=tu(e,["onClickSearchIcon","searchIconPlacement","showClearInputIcon","onClickClearInput","highlightOnFocus","className","formSize"]),u=function(){return l.createElement("div",{className:"d-inline-block"},l.createElement(ns,{svgName:Qc.Search,size:ts.Standard,onClick:t,className:ru(t)}))};return l.createElement("div",{className:"position-relative ".concat(zs.a.inputContainer)},"left"===n&&l.createElement("div",{className:"".concat(zs.a.iconContainer," ").concat(zs.a.leftIconContainer)},l.createElement(u,null)),l.createElement("input",Object.assign({className:nu(n,r,o,a,c)},s)),("right"===n||!!r)&&l.createElement("div",{className:"".concat(zs.a.iconContainer," ").concat(zs.a.rightIconContainer)},!!r&&l.createElement((function(){return l.createElement("div",{className:"d-inline-block text-muted ".concat(zs.a.clearButton)},l.createElement(ns,{svgName:Qc.Close,size:ts.Standard,onClick:i,className:ru(i)}))}),null),"right"===n&&l.createElement(u,null)))}function ou(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return au(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return au(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function au(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},su=h;function uu(e){return e.renderAsForm?l.createElement("form",{onSubmit:e.onSubmit},e.children):l.createElement(l.Fragment,null,e.children)}function lu(e){var t,n,r,i=(t=e.initialSuggestions,n=e.recentSearches,$s(r={},Ks.Recent,n),$s(r,Ks.Local,t),$s(r,Ks.Remote,[]),$s(r,Ks.Empty,[]),r),o=ou(l.useState(e.initialQuery||""),2),a=o[0],c=o[1],s=ou(l.useState(i),2),u=s[0],f=s[1],p=function(e){var t=Us(Object(l.useState)(window.matchMedia(e).matches),2),n=t[0],r=t[1];return Object(l.useEffect)((function(){var t=window.matchMedia(e);t.matches!==n&&r(t.matches);var i=function(){return r(t.matches)};return t.addListener(i),function(){return t.removeListener(i)}}),[e]),n}(Ns.XS);l.useEffect((function(){var t=e.initialQuery||"";a!==t&&c(t)}),[e.initialQuery]);var d=function(){f(i)},y=function(t){t.preventDefault(),su(e.onSubmit)&&e.onSubmit(a)},v=l.useMemo((function(){return e.debounceTime?m(Gs(e,f,d),e.debounceTime):Gs(e,f,d)}),[e.debounceTime]);return l.createElement(uu,{onSubmit:y,renderAsForm:!!e.renderAsForm},l.createElement(Rs,Object.assign({suggestions:Zs(u,!a,!!e.getEmptyStateComponent,e.recentSearchHeading||js.getPhrase("shared.searchBar","recentSearchHeading"),e.suggestionsHeading,e.getSections,e.suggestionLimit),onSuggestionsFetchRequested:v,onSuggestionsClearRequested:function(){e.alwaysRenderSuggestions||d()},onSuggestionSelected:function(t,n){var r=n.suggestion;r.empty||(e.clearQueryOnSelect&&c(""),e.onSuggestionSelected(r))},getSuggestionValue:function(t){return e.updateQueryOnSelection?function(e,t){return Ys(t,e)?t[e]:""}(e.valueKey,t):a},renderSuggestion:function(t){return t&&t.empty?a.length>=e.activationLength&&h(e.getEmptyStateComponent)?e.getEmptyStateComponent(a):l.createElement(l.Fragment,null):su(e.getSuggestionComponent)?e.getSuggestionComponent(t):function(e,t){return Ys(t,e)?l.createElement(l.Fragment,null,t[e]):l.createElement(l.Fragment,null)}(e.valueKey,t)},renderSuggestionsContainer:function(t){var n=t.containerProps,r=n.ref,i=cu(n,["ref"]);return e.customScrollbarProps?l.createElement(Ms.a,Object.assign({ref:r},e.customScrollbarProps,i),t.children):l.createElement("div",Object.assign({ref:r},i),t.children)},alwaysRenderSuggestions:e.alwaysRenderSuggestions,focusInputOnSuggestionClick:!p,inputProps:{placeholder:e.placeholder||js.getPhrase("shared.searchBar","placeholder"),value:a,onChange:function(t,n){var r=n.newValue;c(r),su(e.onQueryChange)&&e.onQueryChange(r)},onKeyDown:function(t){8===t.keyCode&&e.onBackspace&&!a&&e.onBackspace()},autoFocus:!!e.autoFocusInput,highlightOnFocus:e.highlightInputOnFocus,onClickSearchIcon:!!e.submitOnClickSearchIcon&&y,searchIconPlacement:e.searchIconPlacement,showClearInputIcon:!!e.showClearInputIcon&&!!a.length,onClickClearInput:function(){c(""),su(e.onClickClearInput)&&e.onClickClearInput()},formSize:e.size},renderInputComponent:iu,theme:eu(e.theme,!!u.empty.find((function(e){return e.empty}))),multiSection:!0,renderSectionTitle:function(t){return function(e,t){if(e.title)return l.createElement("div",{className:"pb-1 ".concat(null!=t?t:"")},l.createElement("strong",null,e.title))}(t,e.sectionTitleClassName)},getSectionSuggestions:Qs},e.alwaysRenderSuggestionsOnInputFocus?{shouldRenderSuggestions:function(){return!0}}:{})))}lu.defaultProps={updateQueryOnSelection:!0,valueKey:"name",activationLength:3,suggestionLimit:5,recentSearches:[],initialSuggestions:[],searchIconPlacement:"right",renderAsForm:!0};var fu,pu=n(13);function du(e){return(du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yu(e,t){return(yu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=gu(e);if(t){var i=gu(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return bu(this,n)}}function bu(e,t){return!t||"object"!==du(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function gu(e){return(gu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Analytics="AnalyticsService",e.Context="ContextService"}(fu||(fu={}));var Su,Eu=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yu(e,t)}(o,e);var t,n,r,i=vu(o);function o(){var e;return mu(this,o),(e=i.apply(this,arguments)).contextHistory=[],e}return t=o,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"name",get:function(){return fu.Context}},{key:"initialize",value:function(){this.listenTo(G.a.SHELL,p.EventNames.ROUTE,this.setContext)}},{key:"setContext",value:function(e){this.contextHistory.length>=5&&this.contextHistory.unshift(),this.contextHistory.push({pageLoad:!this.contextHistory.length,appLink:e})}},{key:"getCurrentContext",value:function(){if(this.contextHistory.length)return this.contextHistory[this.contextHistory.length-1]}},{key:"fromPageLoad",value:function(){return 1===this.contextHistory.length}}])&&hu(t.prototype,n),r&&hu(t,r),o}(p.Service)),Ou=n(5);!function(e){e.Inlet="event:inlet",e.Outlet="event:outlet"}(Su||(Su={}));var Cu="global:analytics";function wu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Au=pu.EventVersion.V1,ju=function(){function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=t,this.data=n,this.actionContext=r,this.eventVersion=i||Au}var t,n,r;return t=e,(n=[{key:"isType",value:function(e){return e===this.type}},{key:"enrich",value:function(e,t){this.validateKey(e),this[e]=t}},{key:"get",value:function(e){if(e&&this[e])return this[e]}},{key:"validateKey",value:function(e){"type"!==e&&"data"!==e||p.ErrorHelper.throw(new ys.a("".concat(e," is not a valid key"))),this[e]&&p.ErrorHelper.throw(new ys.a("Event already contains an enrichment named ".concat(e)))}}])&&wu(t.prototype,n),r&&wu(t,r),e}(),Tu=function(e,t,n,r){Ou.Radio.channel(Cu).trigger(Su.Inlet,new ju(e,t,n,r))};function ku(){var e=Eu.getCurrentContext().appLink;return d.isObject(e)||p.ErrorHelper.throw(new ys.a("Applink does not exist. Check current context.")),e.application.replace(":","-")}function Iu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.location,n=e.entity,r=e.workflowPhase,i=void 0===r?null:r,o=e.descriptor,a=void 0===o?null:o;return t||p.ErrorHelper.throw(new ys.a("location must be set.")),n||p.ErrorHelper.throw(new ys.a("entity must be set.")),{productArea:ku(),location:t,entity:n,descriptor:a,workflowPhase:i}}function Lu(){return p.LocationUtils.GetCurrentPath()+p.LocationUtils.GetCurrentQueryString()}var _u={logUserAction:function(e,t){if(function(e){return!(!d.isArray(e)||!d.every(e,(function(e){return d.isObject(e)})))||!!d.isObject(e)}(e)&&d.isObject(t)){var n=_u.buildUserActionEvent(t),r=n.userAction,i=n.action,o=n.eventVersion;Tu(r,e,i,o)}},logNavigate:function(e,t){var n=Object.assign({currentLocation:Lu(),appLink:e},t);Tu(pu.UserAction.Navigate,n)},mergeOptions:function(e,t){return d.extend({},e,t)},buildActionContext:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Iu(e)},buildUserActionEvent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.actionType,n=e.eventVersion,r=t,i=Iu(e);return{userAction:r,action:i,eventVersion:n}},buildCurrentLocation:function(){return Lu()},buildSearchEvent:function(e,t){return{data:{query:e},action:Iu({entity:pu.EntityType.Video,location:pu.LocationContext.SearchBar,descriptor:t})}},buildInstantSearchEvent:function(e,t,n){var r;n===pu.SearchQueryType.Series&&(r=pu.EntityType.Series),n===pu.SearchQueryType.Folder&&(r=pu.EntityType.Folder),n===pu.SearchQueryType.Tags&&(r=pu.EntityType.Tag),n===pu.SearchQueryType.Video&&(r=pu.EntityType.Video),n===pu.SearchQueryType.Subjects&&(r=pu.EntityType.Classification);var i={instant:{},query:e};return t.id&&(i.instant.selectedId=t.id),t.name&&(i.instant.selectedName=t.name),{data:i,action:Iu({entity:r,location:pu.LocationContext.SearchBar})}},mapInteractionType:function(e){switch(e){case pu.InteractionType.DragDrop:return pu.InteractionTypeDescriptor.DragDrop;case pu.InteractionType.FileSelect:return pu.InteractionTypeDescriptor.FileSelect;default:return}}};function Pu(e){var t=e.appLink,n=e.appLinkOptions,r=e.className,i=e.style,o=e.children,a=e.tag,c=void 0===a?"a":a;if(!t)return l.createElement("span",{className:r||""},o);var s=p.AppLinkHelper.getHref(t),u={onClick:function(r){var i;r.preventDefault(),null===(i=e.onClick)||void 0===i||i.call(e,r),e.analyticsData&&e.analyticsOptions&&_u.logUserAction(Object.assign({href:s},e.analyticsData),e.analyticsOptions),e.openInNewTab?p.LocationUtils.PageLoad(s,!0):p.AppLinkHelper.trigger(t,n)},href:s,className:r,style:i};return e.title&&(u.title=e.title),l.createElement(c,Object.assign({},u),o)}function xu(e){var t=e.backToName,n=e.appLink;return l.createElement(Pu,{appLink:n,className:"d-inline-flex align-items-center"},l.createElement(ns,{svgName:Qc.ArrowLeft,size:ts.Small}),l.createElement("span",{className:"ml-1"},"Back to ".concat(t)))}function Nu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ru(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ru(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ru(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Pu.defaultProps={appLinkOptions:{}};var Du,Mu,Uu,Fu,Vu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Bu(e){var t=e.selected,n=e.onToggle,r=Vu(e,["selected","onToggle"]),i=Nu(l.useState(t),2),o=i[0],a=i[1];l.useEffect((function(){return a(t)}),[t]);return l.createElement(Ii.Form.Check,Object.assign({type:"checkbox",id:"checkbox-".concat(Xc()),checked:o,onChange:function(){a(!o),n(!o)}},r))}!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(Du||(Du={})),function(e){e[e.Thumbnails=0]="Thumbnails",e[e.Banners=1]="Banners",e[e.Avatars=2]="Avatars",e[e.Logos=3]="Logos",e[e.Covers=4]="Covers",e[e.Posters=5]="Posters",e[e.TallPosters=6]="TallPosters",e[e.HeroBanners=7]="HeroBanners",e[e.None=99999]="None"}(Mu||(Mu={})),function(e){e[e.Crop=0]="Crop",e[e.Stretched=1]="Stretched",e[e.Cover=2]="Cover"}(Uu||(Uu={})),function(e){e[e.None=0]="None",e[e.ImageAPIv1=1]="ImageAPIv1",e[e.FileAPIv1=2]="FileAPIv1",e[e.ImageAPIv2=3]="ImageAPIv2"}(Fu||(Fu={}));var Hu,zu,qu=function(e,t){var n=d.map(t,(function(e,t){return t&&Array.isArray(e)?e.map((function(e){return"".concat(t,"=").concat(encodeURIComponent(e))})).join("&"):t&&void 0!==e?"".concat(t,"=").concat(encodeURIComponent(e)):""})),r=d.reduce(n,(function(e,t){return t?e?"".concat(e,"&").concat(t):t:e}));return r?"".concat(e,"?").concat(r):e},Ju=function(e,t){if(e){var n=e;return e.endsWith("/")||(n+="/"),t?n+=t.startsWith("/")?t.slice(1):t:n}};function $u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.Banner="banner",e.Thumbnail="thumbnail"}(zu||(zu={}));var Ku,Wu=($u(Hu={},Mu.Banners,zu.Banner),$u(Hu,Mu.Thumbnails,zu.Thumbnail),Hu),Yu=function(e){return"/v1/category-map/".concat(e)},Gu={createUrl:function(e,t){return Gu._createUrl(e,t)},createBannerUrl:function(e,t,n){return e&&e.url?Gu._createUrl(e.url,n):Gu._createCategoryMappedUrl(t,n)},createResourceImage:function(e,t,n){return Gu._createUrl(e,Object.assign({url:t},n))},Rfc3986EncodeURIComponent:function(e){return encodeURIComponent(e).replace(/[!'()*]/g,escape)},_createCategoryMappedUrl:function(e,t){var n=e.fallbackBaseUrl,r=e.fallbackCategoryName,i=e.type,o=Ju(n,"".concat(Yu(Wu[i]))),a=Object.assign({name:Gu.Rfc3986EncodeURIComponent(r)},t);return Gu._createUrl(o,a)},_createUrl:function(e,t){if(e){if(wi.a.isEmpty(t))return e;var n=$.param(t),r=-1===e.indexOf("?")?"?":"&",i=e;return i.endsWith("/")&&(i=i.slice(0,-1)),i+"".concat(r).concat(n)}},legacyCreateThumbnailUrl:function(e,t){if(!e)return"";var n;if(e&&(n=e instanceof p.Model?e.get("url"):"string"==typeof e?e:e.url)){var r=Object.assign({size:Du.Small,bgColor:"000"},t);return Gu._createUrl(n,r)}},getDisplayImageFromObject:function(e){var t,n,r,i,o;return"tallPoster"in e&&(null===(t=e.tallPoster)||void 0===t?void 0:t.url)?e.tallPoster:"cover"in e&&(null===(n=e.cover)||void 0===n?void 0:n.url)?e.cover:"thumbnail"in e&&(null===(r=e.thumbnail)||void 0===r?void 0:r.url)?e.thumbnail:"video"in e&&(null===(o=null===(i=e.video)||void 0===i?void 0:i.thumbnail)||void 0===o?void 0:o.url)?e.video.thumbnail:null}};function Zu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qu=(Zu(Ku={},Mu.Thumbnails,{width:1280,height:720}),Zu(Ku,Mu.Banners,{width:1200,height:222}),Zu(Ku,Mu.Covers,{width:512,height:512}),Zu(Ku,Mu.Posters,{width:1e3,height:1500}),Zu(Ku,Mu.TallPosters,{width:1080,height:1920}),Zu(Ku,Mu.HeroBanners,{width:1920,height:640}),Zu(Ku,Mu.None,{width:1,height:1}),Zu(Ku,Mu.Avatars,{width:256,height:256}),Ku);function Xu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return el(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return el(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function el(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var tl,nl=l.createContext(void 0),rl=function(e){var t=e.children,n=Xu(l.useState(),2),r=n[0],i=n[1],o=Xu(l.useState(!1),2),a=o[0],c=o[1],s=Xu(l.useState(),2),u=s[0],f=s[1],p={getDataUrl:function(){var e=r;return i(null),e},setDataUrl:i,imageUploaded:a,getImage:function(){var e=u;return f(null),c(!1),e},setImage:function(e){f(e),c(!0)}};return l.createElement(nl.Provider,{value:p},t)},il={onFileSelect:function(e,t,n){if(t&&t.length){var r=new FileReader;r.addEventListener("load",(function(){return il.onReaderLoad(r,e,n)})),r.readAsDataURL(t[0])}},onReaderLoad:function(e,t,n){var r=new Image;r.src=e.result;var i=Qu[t].width,o=Qu[t].height;r.addEventListener("load",(function(){il.isImageValid(t,r)&&h(n)?n(r):alert("Image too small: minimum dimensions are ".concat(i," x ").concat(o))}))},isImageValid:function(e,t){var n=Qu[e].width,r=Qu[e].height;return!(n&&t.width<n)&&!(r&&t.height<r)},mapImageTypeToString:function(e){switch(e){case Mu.Avatars:return"avatars";case Mu.Thumbnails:return"thumbnails";case Mu.Logos:return"logos";case Mu.Covers:return"covers";case Mu.Posters:return"posters";case Mu.TallPosters:return"tallposters";case Mu.HeroBanners:return"herobanners";case Mu.None:default:return""}}},ol=["pdf"],al=["doc","docx","dotx","dot","rtf","docm","odt"],cl=["csv","txt"],sl=["xls","xlt","xlsx"],ul=["jpg","tif","png","bmp","gif","jpeg"],ll=["zip","rar"],fl=["ppt","pot","pps","pptx"],pl=["srt"],dl={IMAGES:".".concat(ul.join(",.")),RESOURCES:".".concat([].concat(al,sl,fl,ol,cl,ul,ll).join(",.")),SUBTITLES:".".concat(pl.join(",."))},ml=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function hl(e){var t=e.onFileSelect,n=e.acceptMultiple,r=e.mimeType,i=e.label,o=e.error,a=e.touched,c=ml(e,["onFileSelect","acceptMultiple","mimeType","label","error","touched"]),s="custom-file-input cursor-pointer";o&&a&&(s+=" is-invalid");var u=Object.assign({type:"file",className:s,onChange:function(e){var n=e.currentTarget.files;n&&n.length&&h(t)&&t(n)},autoComplete:"off",value:"",multiple:!!n},r?{accept:r}:{});return l.createElement("div",{className:"form-group"},l.createElement("div",{className:"custom-file"},l.createElement(vi,Object.assign({},u,c),e.children),l.createElement(Ii.Form.Label,{className:"custom-file-label",htmlFor:c.id},i)))}function yl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vl(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gl=(bl(tl={},Mu.Thumbnails,"Thumbnail"),bl(tl,Mu.Banners,"Banner"),bl(tl,Mu.Avatars,"Avatar"),bl(tl,Mu.Logos,"Logo"),bl(tl,Mu.Covers,"Cover"),bl(tl,Mu.Posters,"Poster"),bl(tl,Mu.TallPosters,"Tall Poster"),bl(tl,Mu.HeroBanners,"Hero Banner"),bl(tl,Mu.None,"Image"),tl);function Sl(e){var t=si(),n=ni(null==t?void 0:t.values,e.fieldName),r=l.useContext(nl),i=r.setDataUrl,o=r.getImage,a=r.imageUploaded,c=yl(l.useState(!1),2),s=c[0],u=c[1],f=yl(l.useState(n),2),d=f[0],m=f[1],y=yl(l.useState(!1),2),v=y[0],b=y[1];function g(t){u(!0),i(t.src),p.AppLinkHelper.trigger({application:e.application,action:e.uploadAction,args:[e.imageType]})}l.useEffect((function(){if(s){var n,r=o();if(r)u(!1),m(r),n=r,h(e.setSelectedImage)?e.setSelectedImage(n):t&&t.setFieldValue(e.fieldName,{fileId:n.id,fileIdType:Fu.ImageAPIv2})}}),[a]);var S=e.label||gl[e.imageType]||"Image";return l.createElement("div",{className:"form-group"},l.createElement("div",{className:"form-control h-auto py-2"},l.createElement("label",null,S),l.createElement("em",{className:"ml-1 text-muted"},"(Minimum dimensions are ".concat(Qu[e.imageType].width,"px")+" x ".concat(Qu[e.imageType].height,"px)")),l.createElement(hl,{label:"Choose a ".concat(S.toLowerCase()),name:"image",mimeType:dl.IMAGES,onFileSelect:function(t){return il.onFileSelect(e.imageType,t,g)}}),!!d&&!!d.url&&l.createElement(l.Fragment,null,!v&&l.createElement("div",{className:"pb-2 ".concat(e.imageType===Mu.Banners?"w-100":"w-50")},l.createElement("img",{src:Gu.createUrl(d.url),className:"img img-fluid"})),l.createElement("div",{className:"d-flex justify-content-center"},l.createElement(ns,{svgName:v?Qc.ChevronDown:Qc.ChevronUp,size:ts.Large,className:"svg-container cursor-pointer",onClick:function(){return b(!v)},title:v?"Show image":"Hide image",tooltipPlacement:"top"})))))}var El=function(){Ou.Radio.channel(G.a.SHELL).trigger("prevent:scroll:top")};function Ol(e,t){return t?{application:e.application,action:e.action,args:e.args,params:Object.assign({},e.params,{cursor:t})}:null}function Cl(e){var t=e.appLink,n=e.cursors,r=e.className,i=e.buttonVariant;function o(e){El(),_u.logUserAction({page:e},{location:pu.LocationContext.Pagination,entity:pu.EntityType.Pagination,actionType:pu.UserAction.Navigate})}return l.createElement(Ts.Provider,{value:"shared.pagination"},l.createElement("div",{className:r},l.createElement(Pu,{appLink:Ol(t,n.previous),className:"btn btn-".concat(i," mr-1 ").concat(n.previous?"":"disabled"),onClick:function(){return o("previous")}},l.createElement(ks,{phrase:"previous"})),l.createElement(Pu,{appLink:Ol(t,n.next),className:"btn btn-".concat(i," ").concat(n.next?"":"disabled"),onClick:function(){return o("next")}},l.createElement(ks,{phrase:"next"}))))}function wl(e){return l.createElement("tr",null,e.columns.map((function(t,n){var r=function(){return l.createElement(l.Fragment,null,h(t.accessor)?t.accessor(e.object):e.object[t.accessor])},i=h(t.appLink)?t.appLink(e.object):t.appLink;return l.createElement("td",{key:n},i?l.createElement(Pu,{appLink:i},l.createElement(r,null)):l.createElement(r,null))})),!!e.addNewObjectColumn&&l.createElement("td",null))}function Al(e){return l.createElement(Ii.Table,{responsive:!0},l.createElement("thead",null,l.createElement("tr",null,e.columns.map((function(e,t){return l.createElement("th",{key:t},e.header)})),!!e.newObjectAppLink&&l.createElement("th",null,l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(Pu,{appLink:e.newObjectAppLink},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New ".concat(e.objectName))))))),l.createElement("tbody",null,e.objects.map((function(t){return l.createElement(wl,{key:t.id,object:t,columns:e.columns,addNewObjectColumn:!!e.newObjectAppLink})}))))}function jl(e){if(!e.collection)return l.createElement(l.Fragment,null);var t=e.collection,n=t.data,r=t.pagination;return l.createElement(l.Fragment,null,!!n&&l.createElement(Al,{objects:n,columns:e.columns,newObjectAppLink:e.newObjectAppLink,objectName:e.objectName}),!!r&&!!r.cursors&&l.createElement(Cl,{cursors:r.cursors,appLink:e.collectionAppLink}))}Cl.defaultProps={className:"py-2",buttonVariant:"secondary"};var Tl=n(42),kl=n.n(Tl);function Il(e){var t="".concat(e.className," ").concat(kl.a.iconButton);e.children?t+=" ".concat(kl.a.iconWithText):t+=" ".concat(kl.a.iconOnly);var n=l.createElement(ns,{svgName:e.svgName,className:"svg-container ".concat(kl.a.svg),size:e.svgSize});return e.appLink?l.createElement(Pu,{appLink:e.appLink,className:t,onClick:e.onClick,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab},n,e.children):l.createElement("button",{className:t,onClick:function(t){e.analyticsData&&e.analyticsOptions&&_u.logUserAction(e.analyticsData,e.analyticsOptions),h(e.onClick)&&e.onClick(t)}},n,e.children)}var Ll=n(212),_l=n.n(Ll);function Pl(e){var t="dropdown-item";return e&&(t+=" ".concat(e)),t}function xl(e){var t=h(e.action.label)?e.action.label:function(){return e.action.label};if(e.action.appLink)return l.createElement(Pu,{appLink:e.action.appLink,onClick:e.action.onClick,className:Pl(e.action.className),analyticsData:e.action.analyticsData,analyticsOptions:e.action.analyticsOptions,openInNewTab:e.action.openInNewTab},t());function n(){e.action.analyticsData&&e.action.analyticsOptions&&_u.logUserAction(e.action.analyticsData,e.action.analyticsOptions),h(e.action.onClick)&&e.action.onClick()}return l.createElement("span",{className:"cursor-pointer ".concat(Pl(e.action.className)),onClick:n,role:"button",tabIndex:0,onKeyDown:function(e){return"Enter"===e.key&&n()}},t())}function Nl(e){if(!e.actions||!e.actions.length)return l.createElement(l.Fragment,null);var t="dropdown";e.className&&(t+=" ".concat(e.className));var n="actions-dropdown-".concat(Xc()),r="dropdown-toggle px-0 ".concat(_l.a.dropdownToggle);return e.dropdownToggleClassName&&(r+=" ".concat(e.dropdownToggleClassName)),l.createElement("div",{className:t},l.createElement("button",{className:r,type:"button",id:n,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},l.createElement(ns,{svgName:Qc.More,size:ts.Small})),l.createElement("div",{className:"dropdown-menu dropdown-menu-right","aria-labelledby":n},e.actions.map((function(e,t){return e.tooltip?l.createElement(es,{key:t,title:e.tooltip,spanHack:!0},l.createElement(xl,{action:e})):l.createElement(xl,{key:t,action:e})}))))}function Rl(e){var t=e.showSpinner?l.createElement(Ii.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.children;if(e.tooltip)return l.createElement(es,{title:e.tooltip},l.createElement("span",null,l.createElement(Il,{appLink:e.appLink,svgName:e.svgName,svgSize:e.svgSize,onClick:e.onClick,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab},t)));if(e.svgName)return l.createElement(Il,{onClick:e.onClick,appLink:e.appLink,svgName:e.svgName,svgSize:e.svgSize,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab},t);if(e.appLink)return l.createElement(Pu,{onClick:e.onClick,appLink:e.appLink,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab},t);return l.createElement("button",{onClick:function(t){e.analyticsData&&e.analyticsOptions&&_u.logUserAction(e.analyticsData,e.analyticsOptions),h(e.onClick)&&e.onClick(t)},className:e.className},t)}function Dl(e){var t=l.useMemo((function(){return e.actions.sort((function(e,t){return e.order-t.order}))}),[e.actions]),n=[],r=[];t.forEach((function(e){e.button?n.push(e):r.push(e)}));var i="d-flex";return e.className&&(i+=" ".concat(e.className)),n.length||r.length?l.createElement("div",{className:i},l.createElement(l.Fragment,null,l.createElement("span",{className:"d-flex align-items-center"},n.length?n.map((function(e,t){return l.createElement(l.Fragment,{key:t},function(){if(e.label){var t=h(e.label)?e.label:function(){return e.label};return l.createElement(Rl,{appLink:e.appLink,onClick:e.onClick,svgName:e.svgName,className:e.className,tooltip:e.tooltip,showSpinner:e.showSpinner,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab},t())}var n=l.createElement(Il,{appLink:e.appLink,onClick:e.onClick,svgName:e.svgName,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions,openInNewTab:e.openInNewTab});return e.tooltip?l.createElement(es,{title:e.tooltip,spanHack:!0},n):n}())})):l.createElement(l.Fragment,null),e.sortComponent&&e.sortComponent,r.length?l.createElement(Nl,{actions:r,dropdownToggleClassName:e.actionsDropdownClassName}):l.createElement(l.Fragment,null)))):l.createElement(l.Fragment,null)}function Ml(e){var t=e.object,n=e.actions;return l.createElement("div",{className:"d-flex justify-content-between py-2"},!!t&&l.createElement("h5",null,t.name),!!n&&l.createElement("span",null,l.createElement(Dl,{actions:n})))}function Ul(e){var t=e.objects,n=e.getAppLink,r=e.emptyMessage;return t?t.length?l.createElement("ul",{className:"list-unstyled"},t.map((function(e,t){return l.createElement("li",{key:t,className:"border rounded mb-3"},l.createElement(Pu,{appLink:n(e),className:"d-block p-3"},e.name))}))):l.createElement("div",{className:"py-3"},l.createElement("p",null,r)):l.createElement(l.Fragment,null)}Nl.defaultProps={dropdownToggleClassName:"btn btn-light"},Ul.defaultProps={emptyMessage:"There is nothing here."};function Fl(e){var t=si();return l.createElement(as,{as:"select",label:"Rating",name:"rating",id:"rating",value:t.values.rating&&t.values.rating.id,onChange:function(e){return t.setFieldValue("rating",e.target.value?{id:e.target.value}:{})},disabled:e.disabled},l.createElement(l.Fragment,null,l.createElement("option",{value:""},"Please select a rating"),e.ratings.map((function(e,t){return l.createElement("option",{key:t,value:e.id},function(e){return"".concat(e.name).concat(e.code?" (".concat(e.code,")"):"")}(e))}))))}var Vl={isItemActive:function(e,t){return t||(t=p.AppLinkHelper.getCurrentAppLink()),t.application===e.appLink.application&&(Array.isArray(e.activeActions)?e.activeActions.includes(t.action):t.action===e.appLink.action)}},Bl=function(e){return Object.values(e).every((function(e){return!!e}))},Hl=(n(213),function(e,t){return!!e&&!!t&&e.toString()===t.toString()}),zl=function(e){return e.split(" ").map((function(e){return(e[0]?e[0].toUpperCase():"")+(e.substr(1)?e.substr(1).toLowerCase():"")})).join(" ")};function ql(e){return function(e){if(Array.isArray(e))return Jl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Jl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $l={find:function(e,t){if(e&&e.children&&e.children.length)for(var n=function e(n){if(Hl(n.id,t))return n;var r=n.children;if(r&&r.length)for(var i=0;i<r.length;i++){var o=e(r[i]);if(o)return o}},r=0;r<e.children.length;r++){var i=n(e.children[r]);if(i)return i}},getPath:function(e,t){for(var n=[t],r=function(e){return e.hasOwnProperty("parentIds")&&Array.isArray(e.parentIds)&&e.parentIds.length?e.parentIds[0]:e.hasOwnProperty("parentId")?e.parentId:null},i=r(t);i;){var o=$l.find(e,i);o&&(n=[o].concat(ql(n))),i=o?r(o):null}return n}},Kl=function(e){return e&&e.groups?e.groups.map((function(e){return e.name})):[]};function Wl(e){var t=e.tabs,n=e.isItemActive;return l.createElement(Ii.Nav,{fill:!0,variant:"tabs"},t.map((function(e,t){return l.createElement(Ii.Nav.Item,{key:t},l.createElement(Pu,{appLink:e.appLink,className:(r=n(e),r?"nav-link active":"nav-link")},e.label));var r})))}Wl.defaultProps={isItemActive:Vl.isItemActive};var Yl=n(24),Gl=n.n(Yl);function Zl(e){var t=e.name,n=e.appLink,r=e.onSelect,i=e.isDisabled,o=e.className,a=e.actions,c=Gl.a.text;return o&&(c+=" ".concat(o)),i?l.createElement("a",{className:"".concat(c," text-muted ").concat(Gl.a.disabled)},t):l.createElement(l.Fragment,null,n?l.createElement(Pu,{appLink:n,className:c},t):l.createElement("a",{onClick:r,className:c},t),!!a&&l.createElement(Dl,{className:Gl.a.actions,actions:a}))}function Ql(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xl(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ef(e){var t=e.tree,n=e.selectedIds,r=e.getAppLink,i=e.onSelect,o=e.isDisabled,a=e.actions,c=Array.isArray(n)&&n.some((function(e){return Hl(t.id,e)})),s=l.useMemo((function(){return Array.isArray(n)&&n.some((function(e){return $l.find(t,e)}))}),[t,n]),u=Ql(l.useState(s),2),f=u[0],p=u[1],d=!!t.children&&!!t.children.length,m={name:t.name,appLink:h(r)?r(t):null,onSelect:h(i)?function(){return i(t)}:null,isDisabled:!!h(o)&&o(t),className:c&&Gl.a.selected||s&&Gl.a.parentOfSelected,actions:!!a&&a.map((function(e){return Object.assign(Object.assign({},e),{appLink:e.getAppLink(t)})}))};return l.createElement("li",{className:"position-relative".concat(f?"":" ".concat(Gl.a.collapsed))},l.createElement("div",{className:"position-relative"},l.createElement("span",{className:Gl.a.node},d&&l.createElement(ns,{svgName:Qc.ChevronDown,size:ts.Small,className:"svg-container ".concat(Gl.a.chevron),onClick:function(){return p(!f)}}),l.createElement(Zl,Object.assign({},m))),f&&l.createElement(nf,Object.assign({},e))))}var tf=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function nf(e){var t=e.tree,n=tf(e,["tree"]);return t&&t.children?l.createElement("ul",{className:"m-0 p-0 ".concat(Gl.a.tree)},t.children.map((function(e){return l.createElement(ef,Object.assign({key:e.id,tree:e},n))}))):l.createElement(l.Fragment,null)}var rf={getChord:function(e,t){return $l.getPath(e,t).map((function(e){return e.name})).join(" -> ")},getState:function(e,t){var n={};return Array.isArray(e)&&e.forEach((function(e){var r,i,o,a=$l.find(t,e);a&&(n=Object.assign((r={},i=e,o=rf.getChord(t,a),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o,r),n))})),n}};function of(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return af(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return af(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function af(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cf=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function sf(e){var t=e.onSelect,n=e.label,r=e.hideCollapseBtn,i=e.collapse,o=e.noSelectionMessage,a=e.isNodeDisabled,c=e.getSelectedItemAppLink,s=cf(e,["onSelect","label","hideCollapseBtn","collapse","noSelectionMessage","isNodeDisabled","getSelectedItemAppLink"]),u=s.tree,f=s.selectedIds,p=of(l.useState(rf.getState(f,u)),2),d=p[0],m=p[1];l.useEffect((function(){return m(rf.getState(f,u))}),[f,u]);var y=of(l.useState(!!i),2),v=y[0],b=y[1];l.useEffect((function(){return b(!!i)}),[i]);var g=!r||!!n;return l.createElement(l.Fragment,null,g&&l.createElement("div",{className:"pb-2"},!!n&&l.createElement("label",{className:"m-0"},n),!r&&l.createElement("a",{className:"float-right cursor-pointer",onClick:function(){return b(!v)}},v?"Expand":"Collapse")),!v&&l.createElement("div",{className:"py-2 border-top"},l.createElement(nf,Object.assign({onSelect:function(e){return h(t)&&t(e)},isDisabled:a},s))),(!wi.a.isEmpty(d)||!!o)&&l.createElement("div",{className:"py-2 border-top"},l.createElement("label",null,"Selected:"),l.createElement("ul",{className:"m-0"},wi.a.isEmpty(d)?l.createElement("li",null,o):Object.keys(d).map((function(e,t){return l.createElement("li",{key:t},h(c)?l.createElement(Pu,{appLink:c(e)},d[e]):d[e])})))))}var uf=n(51);function lf(e){return function(e){if(Array.isArray(e))return ff(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ff(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ff(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ff(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pf(e){var t=e.page,n=e.totalPages,r=Bs.isNumber(t)&&t>0&&t<n&&t+1,i=Bs.isNumber(t)&&t>1&&t-1,o={};if(r&&r<=n&&(o.next=r.toString()),i&&(o.previous=i.toString()),!wi.a.isEmpty(o))return o}var df={isEmpty:function(e){return e&&!(e.data&&e.data.length)},length:function(e){return e&&e.data&&e.data.length},at:function(e,t){if(e&&e.data&&e.data.length&&!(t>e.data.length))return e.data[t]},get:function(e,t){if(e&&e.data&&e.data.length)return e.data.find((function(e){return e.id&&e.id.toString()===t}))},flattenCollections:function(e){if(e&&e.length){var t=[];return e.forEach((function(e){t=[].concat(lf(t),lf(e.data))})),t}},getNextCursor:function(e){return e.pagination&&e.pagination.cursors&&e.pagination.cursors.next},convertLegacyPaginatedCollection:function(e){if(e)return{data:e.data,pagination:{cursors:pf(e.pagination),limit:e.pagination.pageSize}}}},mf=function(e){var t="bg-white";return e&&(t+=" ".concat(e)),t};function hf(e){var t=e.video,n=e.getVideoAppLink,r=e.getVideoActions,i=e.className,o=void 0===i?"":i,a=e.itemNumber,c=h(n)&&n(t);return l.createElement("tr",{className:mf(o)},!!a&&l.createElement("td",null,l.createElement("span",null,a)),l.createElement("td",null,c?l.createElement(Pu,{appLink:c},t.name):t.name),h(r)&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(Dl,{actions:r(t)}))))}var yf=Object(uf.SortableElement)((function(e){return l.createElement(hf,Object.assign({sortable:!0},e))})),vf=n(31),bf=n.n(vf),gf=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},Sf=function(e){var t=e.sortable,n=e.getVideoActions;return l.createElement("thead",null,l.createElement("tr",null,!!t&&l.createElement("th",null,"#"),l.createElement("th",null,"Name"),!!n&&l.createElement("th",null)))},Ef=l.forwardRef((function(e,t){var n=e.videos,r=e.sortable,i=gf(e,["videos","sortable"]);return l.createElement("tbody",{ref:t},!df.isEmpty(n)&&n.data.map((function(e,t){return r?l.createElement(yf,Object.assign({key:e.id,index:t,itemNumber:t+1,video:e,className:bf.a.draggableVideoItem},i)):l.createElement(hf,Object.assign({video:e},i))})))}));var Of=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},Cf=Object(uf.SortableContainer)((function(e){var t=e.forwardedRef,n=Of(e,["forwardedRef"]);return l.createElement(Ef,Object.assign({sortable:!0,ref:t},n))})),wf=function(e){return function(t){var n=t.node,r=e.current;if(r){r.classList.add(bf.a.sortingContainer);var i=r.querySelector(".".concat(bf.a.draggedVideoItem));n.childNodes.forEach((function(e,t){return i.childNodes[t].style.width="".concat(e.offsetWidth,"px")}))}}},Af=function(e,t){return function(n){var r=e.current;r&&r.classList.remove(bf.a.sortingContainer),t(n.oldIndex,n.newIndex)}};function jf(e){var t=e.onSortEnd,n=e.emptyMessage,r=Of(e,["onSortEnd","emptyMessage"]),i=l.useRef();return df.isEmpty(e.videos)?l.createElement("div",null,n):l.createElement(Ii.Table,{responsive:!0},l.createElement(Sf,Object.assign({sortable:!0},e)),l.createElement(Cf,Object.assign({forwardedRef:i,onSortStart:wf(i),onSortEnd:Af(i,t),lockAxis:"y",lockToContainerEdges:!0,distance:1,helperClass:bf.a.draggedVideoItem,helperContainer:function(){return i.current}},r)))}function Tf(e){var t=e.alias,n=e.onDelete;return l.createElement("li",{className:"list-group-item d-flex justify-content-between"},t.name,l.createElement(ns,{svgName:Qc.Delete,onClick:function(){return n(t.id)}}))}function kf(e){var t=e.aliases,n=e.onDelete;return l.createElement("ul",{className:"list-group mb-3"},t?t.map((function(e){return l.createElement(Tf,{key:e.id,alias:e,onDelete:n})})):l.createElement("span",null,"Currently there are no aliases for this object."))}function If(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Lf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}jf.defaultProps={emptyMessage:"There are no videos in this list."};var _f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Pf(e){var t=e.showSpinner,n=e.children,r=_f(e,["showSpinner","children"]),i=l.useRef(),o=If(l.useState({}),2),a=o[0],c=o[1];return l.useEffect((function(){var e=a.width,t=a.height;if(!e||!t){var n=i.current,r=n.offsetHeight,o=n.offsetWidth;r&&o&&c({width:o,height:r})}})),l.useEffect((function(){var e=a.width,t=a.height;if(e&&t){var n=i.current;n.style.width="".concat(e+1,"px"),n.style.height="".concat(t+1,"px")}}),[a]),l.createElement(Ii.Button,Object.assign({ref:i,disabled:t},r),t?l.createElement(Ii.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):n)}var xf=Object(Ti.object)().shape({name:Object(Ti.string)().trim().max(255,"Name is too long").required("Name is required").default("")});function Nf(){var e=si(),t=us(e);return l.createElement(bi,null,l.createElement(as,{label:"Create an alias",name:"name",id:"name",value:e.values.name,placeholder:"Add an alias"}),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(Pf,{showSpinner:e.isSubmitting,type:"submit",disabled:!t},"Add")))}function Rf(e){var t=e.onSave;return l.createElement(ji,{initialValues:{name:""},validationSchema:xf,onSubmit:function(e,n){t(e,(function(){return n({reset:!0})}))}},l.createElement(Nf,null))}function Df(e){var t=e.onSave,n=e.aliases,r=e.onDelete;return l.createElement("div",{className:"w-50"},l.createElement("h1",null,"Aliases"),l.createElement(kf,{aliases:n,onDelete:r}),l.createElement(Rf,{onSave:t}))}var Mf=c.COMPANIES,Uf=function(e){return{application:Mf,action:i.Companies.EDIT_COMPANY,args:[e.id]}},Ff=function(e){return p.AppLinkHelper.trigger(Uf(e))};function Vf(e){var t=ce.useBasicFetch(ye(e.cursor));return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-3 w-50"},l.createElement(lu,{placeholder:"Search for a company",onSuggestionSelected:Ff,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/companies/instant/raw","?q=").concat(e)},activationLength:2})),l.createElement(jl,{collection:t&&t.data,columns:[{accessor:"name",header:"Name",appLink:Uf}],collectionAppLink:{application:Mf,action:i.Companies.COMPANIES},newObjectAppLink:{application:Mf,action:i.Companies.NEW_COMPANY},objectName:"Company"}))}function Bf(e){return(Bf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qf(e,t,n){return t&&zf(e.prototype,t),n&&zf(e,n),e}function Jf(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$f(e,t)}function $f(e,t){return($f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Yf(e);if(t){var i=Yf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Wf(this,n)}}function Wf(e,t){return!t||"object"!==Bf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Yf(e){return(Yf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Gf=function(e){Jf(n,e);var t=Kf(n);function n(){return Hf(this,n),t.apply(this,arguments)}return qf(n,[{key:"channelName",get:function(){return c.COMPANIES}},{key:"appRoutes",get:function(){return{"manage/companies(/)":"companies","manage/companies/new(/)":"newCompany","manage/companies/:id(/)":"editCompany"}}}]),n}(p.AppRouter),Zf=function(e){Jf(n,e);var t=Kf(n);function n(){return Hf(this,n),t.apply(this,arguments)}return qf(n,[{key:"name",get:function(){return"Companies Application"}},{key:"channelName",get:function(){return c.COMPANIES}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT}}},{key:"companies",value:function(e){var t=e.cursor;this.layout.showChildView(I,l.createElement(Vf,{cursor:t}))}},{key:"newCompany",value:function(){this.layout.showChildView(I,l.createElement(xs,null))}},{key:"editCompany",value:function(e){this.layout.showChildView(I,l.createElement(Ps,{id:e}))}}],[{key:"router",get:function(){return Gf}}]),n}(p.Application);function Qf(e){return(Qf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ep(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tp(e,t){return(tp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function np(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ip(e);if(t){var i=ip(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return rp(this,n)}}function rp(e,t){return!t||"object"!==Qf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ip(e){return(ip=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var op=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tp(e,t)}(o,e);var t,n,r,i=np(o);function o(){return Xf(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"onShowAlert",value:function(e){if(this.layoutOptions.options.alertRegion){var t=e.ctor,n=e.collection,r=n?n.toJSON():[];this.layout.showChildView(this.layoutOptions.options.alertRegion,l.createElement(t,{alerts:r,removeAlert:function(e){return Ou.Radio.channel(G.a.ALERT).trigger("remove:alert",e)}}))}}}])&&ep(t.prototype,n),r&&ep(t,r),o}(n(44).a),ap=function(e,t){return e.toLowerCase()===t};function cp(e){return(cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function up(e,t){return(up=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function lp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=pp(e);if(t){var i=pp(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return fp(this,n)}}function fp(e,t){return!t||"object"!==cp(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function pp(e){return(pp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var dp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&up(e,t)}(o,e);var t,n,r,i=lp(o);function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this)).constructors={},e.destructors={},e.instances={},e.singletonInstances={},e.referenceCounts={},e}return t=o,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"name",get:function(){return"InstanceManager"}},{key:"registerDataService",value:function(e,t){var n=this;this.validateConstructor(e);var r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=function(){return new e({dataProvider:n.getInstance(t.dataProvider),cache:n.getInstance(t.cache),bootstrapData:t.bootstrapData,defaultErrorHandler:t.defaultErrorHandler,alertService:t.alertService})},this.destructors[r]=function(){n.instances[r]?n.instances[r].destroy():ds.c.throw(new ys.a("Trying to destroy a ".concat(r," instance that has already been destroyed"))),n.releaseInstance(t.dataProvider),n.releaseInstance(t.cache)},this}},{key:"registerInstance",value:function(e,t){var n=this;this.validateConstructor(e);var r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=function(){return new e(t)},this.destructors[r]=function(){return d.isFunction(n.instances[r].destroy)&&n.instances[r].destroy()},this}},{key:"registerSingleton",value:function(e){var t=e.name;return this.singletonInstances[t]=e,this}},{key:"getInstance",value:function(e,t){var n=this;return this.singletonInstances[e]?this.singletonInstances[e]:(this.constructors[e]||ds.c.throw(new ys.a("".concat(e," was not registered with ").concat(this.name))),this.referenceCounts[e]++,t&&this.listenTo(t,"destroy",(function(){return n.releaseInstance(e)})),this.instances[e]||(this.instances[e]=this.constructors[e]()),this.instances[e])}},{key:"releaseInstance",value:function(e){var t=this;if(this.instances[e])return window.setTimeout((function(){t.referenceCounts[e]--,t.referenceCounts[e]<1&&(t.destructors[e](),delete t.instances[e])}),0),this}},{key:"validateConstructor",value:function(e){var t=e.prototype.name;t||ds.c.throw(new ys.a("Classes registered with ".concat(this.name," must have a unique name property."))),this.constructors[t]&&ds.c.throw(new ys.a("A class with the name: ".concat(t," has already been registered with ").concat(this.name)))}}])&&sp(t.prototype,n),r&&sp(t,r),o}(ps.a).Instance;function mp(e){var t,n;return t=e,n=dp.getInstance(t),l.useEffect((function(){return function(){dp.releaseInstance(t)}})),n}var hp,yp,vp=n(35),bp=n(30);function gp(e){return(gp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ep(e,t){return(Ep=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Op(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wp(e);if(t){var i=wp(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Cp(this,n)}}function Cp(e,t){return!t||"object"!==gp(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function wp(e){return(wp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Success="success",e.Warning="warning",e.Fail="danger",e.Info="info"}(hp||(hp={})),function(e){e.Success="Success! 🙌",e.Warning="Whoops...",e.Fail="Oops...",e.Info="FYI"}(yp||(yp={}));var Ap=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ep(e,t)}(o,e);var t,n,r,i=Op(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,e)}return t=o,(n=[{key:"initialize",value:function(){this.alertCollection=new vp.a,this.listenTo(G.a.ALERT,"remove:alert",this.removeAlert),this.showAlerts()}},{key:"name",get:function(){return ms}},{key:"defaults",get:function(){return{maxAlerts:3}}},{key:"showAlerts",value:function(){var e=Ou.Radio.channel(G.a.ALERT),t={collection:this.alertCollection};this.options.alertViewCtor&&(t=d.extend({},t,{ctor:this.options.alertViewCtor})),e.trigger("show:alert",t)}},{key:"removeAlert",value:function(e){this.alertCollection.remove(e),this.showAlerts()}},{key:"createAlert",value:function(e){this.alertCollection.length===this.options.maxAlerts&&this.alertCollection.shift(),e.id||(e=d.extend({},e,{id:this.generateUniqueAlertId()})),this.alertCollection.push(new bp.a(e)),this.showAlerts()}},{key:"clearAllAlerts",value:function(){this.alertCollection.reset(null)}},{key:"success",value:function(e){var t=this;return"string"==typeof e?d.bind((function(){return t.createAlert(d.extend({},t.options.defaultSuccessAlert,{message:e}))}),this):e.useXHR?d.bind((function(e,n){return t.createAlert(d.extend({},t.options.defaultSuccessAlert,{message:n}))}),this):d.bind((function(){return t.createAlert(d.extend({},t.options.defaultSuccessAlert,e))}),this)}},{key:"error",value:function(e){var t=this;return"string"==typeof e?d.bind((function(){return t.createAlert(d.extend({},t.options.defaultErrorAlert,{message:e}))}),this):e.useXHR?d.bind((function(e){return t.createAlert(d.extend({},t.options.defaultErrorAlert,{message:e.message}))}),this):d.bind((function(){return t.createAlert(d.extend({},t.options.defaultErrorAlertIL_DEFAULT,e))}),this)}},{key:"generateUniqueAlertId",value:function(){return d.uniqueId("alert_")}}])&&Sp(t.prototype,n),r&&Sp(t,r),o}(ps.a);function jp(){var e=mp(ms);return{success:function(t){e.success(t)()},error:function(t){e.error(t)()},warning:function(t){e.createAlert({type:hp.Warning,heading:yp.Warning,message:t})}}}function Tp(){return l.createElement("div",{className:"text-center p-5"},l.createElement(Ii.Spinner,{as:"div",animation:"border",role:"status"}))}function kp(e){var t,n=(null===(t=e.headerButtons)||void 0===t?void 0:t.length)?e.headerButtons.map((function(e,t){return l.createElement(Rl,Object.assign({key:t},e))})):l.createElement(l.Fragment,null);return l.createElement(Ii.Modal,{show:!0,onHide:e.closePopup,onEntered:e.onEntered,size:e.size,dialogClassName:e.dialogClassName,centered:e.centered},!!e.title&&l.createElement(Ii.Modal.Header,{className:"d-flex align-items-center",closeButton:e.closeButton},l.createElement(Ii.Modal.Title,{className:"flex-grow-1 text-truncate"},e.title),n),e.showLoadingSpinner?l.createElement(Tp,null):l.createElement(Ii.Modal.Body,{className:e.bodyClassName},e.children))}kp.defaultProps={closeButton:!0,bodyClassName:"",dialogClassName:""};var Ip=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Lp(e){var t=e.buttons;return l.createElement("div",{className:"d-flex justify-content-end border-top pt-3 px-3 mx-n3 undo-changes-btn"},t.map((function(e,t){return function(e,t){var n=e.buttonText,r=e.type,i=void 0===r?"button":r,o=e.isSpinnerButton,a=e.showSpinner,c=void 0!==a&&a,s=e.className,u=Ip(e,["buttonText","type","isSpinnerButton","showSpinner","className"]),f=Object.assign({key:t,type:i,className:"ml-2".concat(s?" ".concat(s):"")},u);return o?l.createElement(Pf,Object.assign({showSpinner:c},f),n):l.createElement(Ii.Button,Object.assign({},f),n)}(e,t)})))}function _p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xp=js.encloseNamespace("shared.confirmationPopup");function Np(e){var t=_p(l.useState(!1),2),n=t[0],r=t[1],i=[{variant:e.cancelButtonVariant,onClick:e.closePopup,buttonText:e.cancelButtonText||xp("cancel")},{variant:e.confirmButtonVariant,onClick:function(){r(!0),e.onClickConfirm()},buttonText:e.confirmButtonText||xp("confirm"),isSpinnerButton:!0,showSpinner:n}];return l.createElement(kp,{title:e.title,closePopup:e.closePopup},l.createElement(l.Fragment,null,e.children,l.createElement(Lp,{buttons:i})))}Np.defaultProps={confirmButtonVariant:"primary",cancelButtonVariant:"link"};var Rp,Dp,Mp,Up="locale",Fp="phrases",Vp="currentuser",Bp=function(e,t){return{url:"/api/currentuser",key:"currentuser",normalizeOptions:{namespace:"currentuser"},bootstrapName:Vp,formatData:function(e){return e.id?e:null},success:e,error:t,expiryTime:1/0}},Hp=n(10),zp=function(e,t,n,r){return{key:"settings:".concat(e,":").concat(t),url:"/api/domain/v3/settings/".concat(e,"?type=").concat(t),normalize:!1,formatData:function(e){return Hp.a.first(e)},success:n,error:r}},qp=function(e,t,n,r){return{key:"update:settings:".concat(e,":bulk"),url:"/api/domain/v3/settings/".concat(e,"/bulk"),data:t,type:se.a.PUT,invalidationKeys:t.map((function(t){return"settings:".concat(e,":").concat(t.name)})),success:n,error:r}};function Jp(e){var t=l.useRef(null);return l.useEffect((function(){t.current&&(e.checked?t.current.indeterminate&&(t.current.indeterminate=!1):!e.indeterminate||t.current.indeterminate?!e.indeterminate&&t.current.indeterminate&&(t.current.indeterminate=!1):t.current.indeterminate=!0)}),[t.current,e.indeterminate,e.checked]),l.createElement("div",{className:"custom-control custom-checkbox ".concat(e.className)},l.createElement("input",{ref:t,type:"checkbox",className:"custom-control-input",id:e.id,name:e.name,checked:e.checked,onChange:e.onChange,disabled:e.disabled}),l.createElement("label",{className:"custom-control-label cursor-pointer",htmlFor:e.id},e.label))}function $p(e,t){return t?"".concat(e,":").concat(t):e}Jp.defaultProps={checked:!1,label:"",className:""},function(e){e.MustCompleteOnboarding="must_complete_onboarding",e.StudentWorkspaceSharing="student_ws_sharing",e.StudentToStudentMessaging="student_to_student_messaging",e.HideResourcesForStudents="hide_resources_for_students",e.LibraryReview="library_review",e.SchoolMessaging="school_messaging",e.LegacyTvNaming="legacy_tv_naming",e.LegacyAlbertCustomer="legacy_albert_customer",e.HideHostedLibraries="hide_hosted_libraries",e.StaffRequest="staff_request",e.MaxCustomLibraries="max_custom_libraries",e.CustomLibrariesBetaAccess="custom_libraries_beta_access",e.AutoCaptioning="auto_captioning",e.Topics="subjects",e.NewDashboards="new_dashboards",e.LiteAccess="lite_access",e.HasCompletedOnboarding="has_completed_onboarding",e.BulkOnboardingPreferencesState="bulk_onboarding_preferences_state"}(Rp||(Rp={})),function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(Dp||(Dp={})),function(e){e.AU="content-ap-southeast-1",e.NZ="content-ap-southeast-2",e.UK="content-eu-west-1",e.SCOT="content-eu-west-2",e.US="content-na-central-1",e.GLOBAL="content-global"}(Mp||(Mp={}));var Kp,Wp=function(e){return{key:$p("presentations",e),url:qu("/api/subjects/v1/presentations",{type:e})}},Yp=function(e,t){return{key:$p("customers:".concat(e,":presentations"),t),url:qu("/api/subjects/v1/customers/".concat(e,"/presentations"),{type:t})}},Gp=function(e,t,n,r,i){return{key:"customers:".concat(e,":presentations:").concat(t,":add"),url:"/api/subjects/v1/customers/".concat(e,"/presentations/").concat(t),type:se.a.POST,invalidationKeys:"customers:".concat(e,":presentation"),success:n,error:r,always:i}},Zp=function(e,t,n,r,i){return{key:"customers:".concat(e,":presentations:").concat(t,":remove"),url:"/api/subjects/v1/customers/".concat(e,"/presentations/").concat(t),type:se.a.DELETE,invalidationKeys:"customers:".concat(e,":presentations"),success:n,error:r,always:i}};!function(e){e.Developer="Curator Devs",e.Content="Content",e.Curator="Curators",e.Support="Support",e.SalesSupport="Sales Support"}(Kp||(Kp={}));var Qp,Xp,ed=function(){return[{value:"protected",access:"r"}]},td=function(e){return Kl(e).includes(Kp.Developer)},nd=function(e){return[Kp.Developer,Kp.Content].some((function(t){return Kl(e).includes(t)}))},rd=function(e,t,n,r,i){var o="settings:entity:".concat(e),a="/api/cache?keys=".concat(o);return{url:"/ajax/online/".concat(t,"?endpoint=").concat(encodeURIComponent(a)),key:"settings:cache:".concat(e),type:se.a.DELETE,success:n,error:r,always:i}},id=function(e){return{key:"customers:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=country,contentregion")}};function od(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ad(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ad(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ad(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cd(e){var t,n=od(l.useState(),2),r=n[0],i=n[1],o=e.availablePresentations.filter((function(t){return!e.currentPresentations.find((function(e){return e.id===t.id}))}));return l.createElement("div",null,!!e.canAdd&&!!o.length&&l.createElement(l.Fragment,null,l.createElement(Ii.Form.Label,null,"Select a presentation to add"),l.createElement(Ii.Form.Control,{as:"select",value:null!==(t=null==r?void 0:r.id)&&void 0!==t?t:"",onChange:function(t){var n=function(e,t){return Hp.a.first(t.filter((function(t){return t.id.toString()===e.toString()})))}(t.target.value,o);n&&(i(n),e.onSelectPresentation(n))},className:"cursor-pointer"},l.createElement("option",{value:""},"Select a presentation"),o.map((function(e){return l.createElement("option",{value:e.id,key:e.id},e.name)})))),!!e.currentPresentations.length&&l.createElement(l.Fragment,null,l.createElement("ul",{className:"list-unstyled mt-2"},e.currentPresentations.map((function(t){return l.createElement("li",null,t.name,!!e.canRemove&&l.createElement("span",{className:"text-danger cursor-pointer ml-2",onClick:function(){return e.removePresentation(t)}},l.createElement("em",null,"remove")))})))))}!function(e){e.Draft="Draft",e.Published="Published"}(Qp||(Qp={})),function(e){e.Subject="subject",e.Curriculum="curriculum"}(Xp||(Xp={}));var sd="9",ud="13",ld="14",fd="15";function pd(e,t){return td(t)?e:function(e){return e.filter((function(e){return e.status===Qp.Published}))}(e)}function dd(e,t,n){return td(t)?e:pd(e,t).filter((function(e){return n.contentRegion.systemName===Mp.US?e.id.toString()===ud||e.id.toString()===fd||e.id.toString()===ld:n.contentRegion.systemName===Mp.AU?e.id.toString()===sd:void 0}))}function md(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yd(e){var t,n,r,o=jp(),a=Object(b.useDispatch)(),s=md(l.useState(!!e.newCustomer),2),u=s[0],f=s[1],d=md(l.useState(),2),m=d[0],h=d[1],y=md(l.useState(),2),v=y[0],g=y[1],S=md(l.useState(),2),E=S[0],O=S[1],C=md(l.useState(!1),2),w=C[0],A=C[1],j=ce.useBasicFetch(id(e.customerId)),T=ce.useBasicFetch(Bp()),k=ce.useBasicFetch(zp(e.customerId,Rp.Topics)),I=(r=e.customerId,{availableTopicPresentations:ce.useBasicFetch(Wp(Xp.Subject)),availableCurriculumPresentations:ce.useBasicFetch(Wp(Xp.Curriculum)),customerTopicPresentations:ce.useBasicFetch(Yp(r,Xp.Subject)),customerCurriculumPresentations:ce.useBasicFetch(Yp(r,Xp.Curriculum))}),L=I.availableTopicPresentations,_=I.availableCurriculumPresentations,P=I.customerTopicPresentations,x=I.customerCurriculumPresentations;function N(){if(e.newCustomer)return alert("Successfully set up Topics for this customer."),void p.LocationUtils.PageLoad(p.AppLinkHelper.getHref({application:c.CUSTOMERS,action:i.Customers.MANAGE_CUSTOMER_TOPICS,args:[e.customerId]}));A(!1),o.success("Successfully saved customer presentations.")}if(l.useEffect((function(){var e;(null===(e=k.data)||void 0===e?void 0:e.value)&&f(!0)}),[null===(t=k.data)||void 0===t?void 0:t.value]),l.useEffect((function(){u||(h(null),g(null))}),[u]),l.useEffect((function(){if(!td(T.data)&&m){var e=_.data.find((function(e){return"Default Curriculum"===e.name}));g(e)}}),[m]),!!!(T.data&&k.data&&j.data&&L.data&&_.data&&P.data&&x.data))return l.createElement(l.Fragment,null);var R=ap(null===(n=j.data.contentRegion)||void 0===n?void 0:n.systemName,Mp.US),D=td(T.data),M=D?m||v:u&&m&&v;return l.createElement(l.Fragment,null,l.createElement("h1",{className:"h6 mb-3"},j.data.name," - ",j.data.crmId),l.createElement("div",{className:"alert alert-danger",role:"alert"},"After enabling Topics, please ensure that ",l.createElement("strong",null,"Dashboard")," is enabled for this customer and that they have the correct library for the ",l.createElement("strong",null,"Topics Presentation")," you choose."),l.createElement(Jp,{id:"enableTopics",checked:u,onChange:function(){return f(!u)},label:"Enable Topics",disabled:k.data.value}),u&&l.createElement(l.Fragment,null,l.createElement("p",{className:"mt-3"},l.createElement("strong",null,"Topic Presentations")),l.createElement(cd,{availablePresentations:dd(L.data,T.data,j.data),currentPresentations:P.data,onSelectPresentation:function(e){return h(e)},removePresentation:function(e){return O(e)},canRemove:D,canAdd:!0}),D&&l.createElement(l.Fragment,null,l.createElement("p",{className:"mt-3"},l.createElement("strong",null,"Curriculum Presentations")),l.createElement(cd,{availablePresentations:pd(_.data,T.data),currentPresentations:x.data,onSelectPresentation:function(e){return g(e)},removePresentation:function(e){return O(e)},canRemove:D,canAdd:!0}))),l.createElement("div",{className:"d-flex justify-content-end align-items-center pt-3"},!k.data.value&&!R&&l.createElement(Pu,{className:"info-link mr-3",appLink:{application:c.CUSTOMERS,action:i.Customers.MANAGE_CUSTOMER,args:[e.customerId]}},"Skip for now"),l.createElement("button",{className:"btn btn-primary",onClick:function(){return A(!0)},disabled:!M},"Save")),w&&l.createElement(Np,{title:"Confirmation needed",onClickConfirm:function(){var t=function(){var e=[];return m&&e.push(m),v&&e.push(v),e}();if(t.length){var n=function(){var t=k.data.value?[]:[Rp.Topics,Rp.NewDashboards];return e.newCustomer&&t.push(Rp.MustCompleteOnboarding),t}(),r=0,i=0,o=t.length+(n.length?1:0),c=t.map((function(t){return Gp(e.customerId,t.id,s,u)}));n.length&&c.push(qp(e.customerId,n.map((function(e){return{name:e,value:!0,kind:Dp.Temporary}})),s,u)),c.forEach((function(e){return ce.fetch(a,e)}))}function s(){i++,u()}function u(){var t;if(++r===o){if(i<r||!(null===(t=j.data.country)||void 0===t?void 0:t.code))return A(!1),void alert("Something went wrong while setting up Topics for this customer. Please contact to the Product Team so that they look into the issue.");if(!n.length)return N(),h(null),void g(null);var c=rd(e.customerId,j.data.country.code,N,(function(){A(!1),alert("Successfully set up Topics but failed to clear Online cache. Please contact to the Product Team so that they look into the issue.")}));ce.fetch(a,c)}}},closePopup:function(){return A(!1)}},k.data.value?l.createElement("p",null,"Are you sure you want to add this customer to:"):l.createElement("p",null,"Are you sure you want enable Topics for this customer and add it to the following presentations:"),l.createElement("ul",null,!!m&&l.createElement("li",null,l.createElement("strong",null,"Topic Presentation:")," ",m.name),!!D&&!!v&&l.createElement("li",null,l.createElement("strong",null,"Curriculum Presentation:")," ",v.name)),!D&&l.createElement("p",{className:"text-danger"},l.createElement("strong",null,"You will be able to come back and add more presentations."))),!!E&&l.createElement(Np,{title:"Confirmation needed",onClickConfirm:function(){if(E){var t=Zp(e.customerId,E.id,(function(){return o.success("Successfully removed customer from presentation.")}),(function(e){var t;return o.error((null===(t=e.responseJSON)||void 0===t?void 0:t.message)||"Failed to remove presentation.")}),(function(){return O(null)}));ce.fetch(a,t)}},closePopup:function(){return O(null)}},l.createElement("p",null,"Are you sure you want to remove this customer from ",l.createElement("strong",null,E.name),"?")))}function vd(e){return(vd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Sd(e,t,n){return t&&gd(e.prototype,t),n&&gd(e,n),e}function Ed(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Od(e,t)}function Od(e,t){return(Od=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Cd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ad(e);if(t){var i=Ad(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return wd(this,n)}}function wd(e,t){return!t||"object"!==vd(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ad(e){return(Ad=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jd=function(e){Ed(n,e);var t=Cd(n);function n(){return bd(this,n),t.apply(this,arguments)}return Sd(n,[{key:"channelName",get:function(){return c.CUSTOMERS}},{key:"appRoutes",get:function(){return{"customers/:id/topics(/)":"manageCustomerTopics"}}},{key:"externalRoutes",get:function(){return{"customers/:id(/)":"manageCustomer"}}}]),n}(p.AppRouter),Td=function(e){Ed(n,e);var t=Cd(n);function n(){return bd(this,n),t.apply(this,arguments)}return Sd(n,[{key:"name",get:function(){return"Customers Application"}},{key:"channelName",get:function(){return c.CUSTOMERS}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{alertRegion:_}}}},{key:"manageCustomerTopics",value:function(e,t){this.layout.showChildView(I,l.createElement(yd,{customerId:e,newCustomer:t.newCustomer}))}}],[{key:"router",get:function(){return jd}}]),n}(op),kd=n(63),Id=n(27),Ld=n.n(Id);function _d(e){var t=e.alert,n=e.svgName,r=e.svgClassName,i=e.closeAlert,o=t.message,a=t.heading,c=t.appLink,s=t.appLinkText,u=t.appLinkClassName,f=void 0===u?"":u,p=Object(fs.sanitize)(o);return l.createElement(l.Fragment,null,l.createElement("div",{className:"d-inline-block ".concat(Ld.a.icon)},l.createElement(ns,{svgName:n,className:"svg-container ".concat(r)})),l.createElement("div",{className:"pl-2 d-inline-block ".concat(Ld.a.alertContent)},l.createElement("p",{className:"p-0 m-0 pb-1 ".concat(Ld.a.heading)},a),l.createElement("p",{className:"p-0 text-break clamp-4 ".concat(Ld.a.message),dangerouslySetInnerHTML:{__html:p}}),!!c&&l.createElement(Pu,{className:f,appLink:c},s)),l.createElement("div",{className:"close d-inline-block cursor-pointer",role:"button",onClick:i},"×"))}function Pd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Nd=function(e){switch(e.type){case hp.Success:return Qc.CheckCircleOutline;case hp.Fail:case hp.Warning:return Qc.Warning;case hp.Info:default:return Qc.Info}};function Rd(e){var t=e.alert,n=e.closeAlert,r=Pd(l.useState(!0),2),i=r[0],o=r[1],a=l.useRef();l.useEffect((function(){i?a.current=window.setTimeout(n,3e3):clearTimeout(a.current)}),[i]);var c="text-".concat(t.type.toLowerCase());return l.createElement("li",{className:"bg-white mt-2 p-2 show clearfix ".concat(Ld.a.alertItem),onMouseEnter:function(){return o(!1)},onMouseLeave:function(){return o(!0)}},l.createElement(_d,{alert:t,svgName:Nd(t),svgClassName:c,closeAlert:n}))}function Dd(e){var t=e.alerts,n=e.removeAlert;return l.createElement("div",{className:Ld.a.alertBox},l.createElement(kd.TransitionGroup,{component:"ul",className:"".concat(Ld.a.alertList," list-unstyled")},t&&t.map((function(e,t){return l.createElement(kd.CSSTransition,{key:t,timeout:200,classNames:"alert"},l.createElement(Rd,{alert:e,closeAlert:function(){return n(e.id)}}))}))))}var Md=n(20),Ud={namespace:"domain_options"},Fd=function(){return"/api/domain/v3/settings/types"},Vd=function(e){return"/api/domain/v3/settings/types/".concat(e)},Bd=function(){return"/api/domain/v3/settings/types"},Hd=function(e){return"/api/domain/v3/settings/types/".concat(e)},zd=function(e){return"/api/domain/v3/settings/types/".concat(e)},qd="domain:options",Jd="domain:option",$d="update:domain:option",Kd="delete:domain:option",Wd=function(){return{key:qd,url:Fd(),normalizeOptions:Ud}},Yd=function(e){return{key:"".concat(Jd,":").concat(e),url:Vd(e),normalizeOptions:Ud}},Gd=function(e,t,n){return e.type===Md.DomainOptionType.String&&(e=Xd(e)),{key:Jd,url:Bd(),data:e,type:se.a.POST,success:t,error:n,invalidationKeys:[qd],normalizeOptions:Ud}},Zd=function(e,t){return e.type===Md.DomainOptionType.String&&(e=Xd(e)),{key:"".concat($d,":").concat(e.id),url:Hd(e.id),data:e,type:se.a.PUT,always:t,formatData:function(){return e},normalizeOptions:Ud}},Qd=function(e,t){return{key:"".concat(Kd,":").concat(e),url:zd(e),type:se.a.DELETE,invalidationKeys:[qd],normalizeOptions:Ud,success:t}};function Xd(e){var t=e.defaultValue;if('"'===t)return Object.assign(Object.assign({},e),{defaultValue:'"'.concat(t,'"')});var n=t.charAt(0),r=t.charAt(t.length-1);return'"'!==n&&(t='"'.concat(t)),'"'!==r&&(t="".concat(t,'"')),Object.assign(Object.assign({},e),{defaultValue:t})}function em(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nm(e){var t=em(l.useState(!1),2),n=t[0],r=t[1],o=ce.useBasicFetch(Yd(e.optionId)),a=Object(b.useDispatch)(),s=function(){e.closePopup(),p.AppLinkHelper.trigger({application:c.DOMAIN_OPTIONS,action:i.DomainOptions.DOMAIN_OPTIONS})};return l.createElement(kp,{title:"Delete Domain Option",closePopup:e.closePopup,showLoadingSpinner:!o.data},o.data&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,o.data.name),"?")),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){r(!0),ce.fetch(a,Qd(e.optionId,s))},buttonText:"Yes, delete this domain option",isSpinnerButton:!0,showSpinner:n}]})))}var rm,im=function(e){return{application:c.DOMAIN_OPTIONS,action:i.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]}},om={application:c.DOMAIN_OPTIONS,action:i.DomainOptions.NEW_DOMAIN_OPTION};function am(){var e=ce.useBasicFetch(Wd());if(!e.data)return l.createElement(l.Fragment,null);var t=e.data.map((function(e){return e.displayName&&(e.name=e.displayName),e}));return l.createElement(l.Fragment,null,l.createElement("div",{className:"d-flex justify-content-between mb-2"},l.createElement("h5",{className:"d-inline-block m-0"},"Select a domain option type to edit:"),l.createElement(Pu,{appLink:om,className:"d-block"},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New Domain Option"))),l.createElement(Ul,{objects:t,getAppLink:im}))}!function(e){e[e.Audience=1]="Audience",e[e.Category=2]="Category",e[e.Channel=3]="Channel",e[e.Chapter=4]="Chapter",e[e.Comment=5]="Comment",e[e.OwnerComment=6]="OwnerComment",e[e.Image=7]="Image",e[e.Thumbnail=8]="Thumbnail",e[e.Avatar=9]="Avatar",e[e.Banner=10]="Banner",e[e.Video=11]="Video",e[e.Trailer=12]="Trailer",e[e.Rating=13]="Rating",e[e.Topic=14]="Topic",e[e.Series=15]="Series",e[e.Season=16]="Season",e[e.HostedMediaObjectCollection=17]="HostedMediaObjectCollection",e[e.ExchangeCollection=18]="ExchangeCollection",e[e.CustomMediaObjectCollection=19]="CustomMediaObjectCollection",e[e.Playlist=20]="Playlist",e[e.ClickViewTvCollection=21]="ClickViewTvCollection",e[e.ClickViewProductionsCollection=22]="ClickViewProductionsCollection",e[e.User=23]="User",e[e.SystemUser=24]="SystemUser",e[e.Customer=25]="Customer",e[e.Country=26]="Country",e[e.Organisation=28]="Organisation",e[e.SystemOrganisation=29]="SystemOrganisation",e[e.Group=30]="Group",e[e.SystemGroup=31]="SystemGroup",e[e.FlagReason=32]="FlagReason",e[e.Library=33]="Library",e[e.Interactive=34]="Interactive",e[e.WorkspaceCollection=35]="WorkspaceCollection",e[e.Conversation=36]="Conversation",e[e.Message=37]="Message",e[e.Notification=38]="Notification",e[e.Clip=39]="Clip",e[e.Link=40]="Link",e[e.UserChannel=41]="UserChannel",e[e.Resource=42]="Resource",e[e.VideoStream=43]="VideoStream",e[e.AudioStream=44]="AudioStream",e[e.Tag=45]="Tag",e[e.Subtitle=46]="Subtitle",e[e.LicencedContentCollection=47]="LicencedContentCollection",e[e.PublicCollection=48]="PublicCollection",e[e.CategoryTree=49]="CategoryTree",e[e.Logo=50]="Logo",e[e.Permission=51]="Permission",e[e.Subject=52]="Subject",e[e.Field=53]="Field",e[e.Company=54]="Company",e[e.Person=55]="Person",e[e.Cover=56]="Cover",e[e.Poster=57]="Poster",e[e.SubjectAudience=58]="SubjectAudience",e[e.TallPoster=60]="TallPoster",e[e.Classroom=67]="Classroom",e[e.ClassroomGroup=68]="ClassroomGroup"}(rm||(rm={}));var cm=Ti.object().shape({id:Ti.string(),name:Ti.string().trim().max(64,"Name is too long").required("Name is required").default(""),displayName:Ti.string().trim().max(255,"Display name is too long").required("Display name is required").default(""),type:Ti.mixed().required("Type is required").default(Md.DomainOptionType.Boolean),entityType:Ti.mixed().required("Entity type is required").default(rm.Customer),kind:Ti.mixed().required("Kind is required").default(Md.DomainOptionKind.Temporary),defaultValue:Ti.mixed().required("Default value is required").default("false")}).noUnknown();function sm(e){var t=e.type,n=e.defaultValue;if(!t)return l.createElement(l.Fragment,null);var r={label:"Default Value",name:"defaultValue",id:"defaultValue",value:n};return t===Md.DomainOptionType.Boolean?l.createElement(as,Object.assign({as:"select"},r),l.createElement("option",{value:"true"},"True"),l.createElement("option",{value:"false"},"False")):t===Md.DomainOptionType.Long||t===Md.DomainOptionType.StaffRequest?l.createElement(as,Object.assign({as:"input",type:"number"},r)):t===Md.DomainOptionType.String?l.createElement(as,Object.assign({as:"input"},r)):void 0}var um=[rm.Customer,rm.User];function lm(e){var t=null===e.id||void 0===e.id,n=si(),r=us(n);return l.createElement(bi,null,l.createElement(as,{label:"Name (snake_case)",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this domain option",autoFocus:!0}),l.createElement(as,{label:"Display Name",type:"text",name:"displayName",id:"displayName",value:n.values.displayName,placeholder:"Enter a display name for this domain option"}),l.createElement(as,{as:"select",label:"Kind",name:"kind",id:"kind",value:n.values.kind},wi.a.getEnumKeys(Md.DomainOptionKind).map((function(e){return l.createElement("option",{key:e,value:Md.DomainOptionKind[e]},e)}))),l.createElement(as,{as:"select",label:"Entity",name:"entityType",id:"entityType",value:n.values.entityType},wi.a.getEnumKeys(rm).filter((function(e){return um.includes(rm[e])})).map((function(e){return l.createElement("option",{key:e,value:rm[e]},e)}))),l.createElement(as,{as:"select",label:"Type",name:"type",id:"type",value:n.values.type},wi.a.getEnumKeys(Md.DomainOptionType).map((function(e){return l.createElement("option",{key:e,value:Md.DomainOptionType[e]},e)}))),l.createElement(sm,{type:n.values.type,defaultValue:n.values.defaultValue}),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(Pf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&l.createElement(Ii.Button,{as:Pu,variant:"danger",appLink:{application:c.DOMAIN_OPTIONS,action:i.DomainOptions.DELETE_DOMAIN_OPTION,args:[e.id]}},"Delete")))}function fm(e){return l.createElement(ji,{initialValues:e.domainOption,validationSchema:cm,onSubmit:e.saveDomainOption},l.createElement(lm,{id:e.domainOption&&e.domainOption.id}))}function pm(){var e=Object(b.useDispatch)();return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Create New Domain Option"),l.createElement(fm,{saveDomainOption:function(t,n){ce.fetch(e,Gd(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.DOMAIN_OPTIONS,action:i.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]})}),n))}}))}function dm(e){var t=e.optionId,n=ce.useBasicFetch(Yd(t)),r=Object(b.useDispatch)();return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Edit Domain Option"),n.data&&l.createElement(fm,{domainOption:n.data,saveDomainOption:function(e,t){return ce.fetch(r,Zd(e,t))}}))}function mm(e){return(mm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ym(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vm(e,t,n){return t&&ym(e.prototype,t),n&&ym(e,n),e}function bm(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gm(e,t)}function gm(e,t){return(gm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Om(e);if(t){var i=Om(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Em(this,n)}}function Em(e,t){return!t||"object"!==mm(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Om(e){return(Om=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Cm=function(e){bm(n,e);var t=Sm(n);function n(){return hm(this,n),t.apply(this,arguments)}return vm(n,[{key:"channelName",get:function(){return c.DOMAIN_OPTIONS}},{key:"appRoutes",get:function(){return{"developer/options(/)":"domainOptions","developer/options/new(/)":"newDomainOption","developer/options/:id(/)":"editDomainOption"}}},{key:"appLinks",get:function(){return["deleteDomainOption"]}}]),n}(p.AppRouter),wm=function(e){bm(n,e);var t=Sm(n);function n(){return hm(this,n),t.apply(this,arguments)}return vm(n,[{key:"name",get:function(){return"Domain Options Application"}},{key:"channelName",get:function(){return c.DOMAIN_OPTIONS}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT}}},{key:"domainOptions",value:function(){this.layout.showChildView(I,l.createElement(am,null))}},{key:"newDomainOption",value:function(){this.layout.showChildView(I,l.createElement(pm,null))}},{key:"editDomainOption",value:function(e){this.layout.showChildView(I,l.createElement(dm,{optionId:e}))}},{key:"deleteDomainOption",value:function(e){this.layout.showChildView(L,l.createElement(nm,Object.assign({optionId:e},this.getPopupProps())))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return Ou.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_,l.createElement(Dd,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return Cm}}]),n}(p.Application),Am=function(e){return e?"".concat("/api/master/v2/people","?cursor=").concat(e):"/api/master/v2/people"},jm=function(e){return"/api/master/v2/objects/".concat(e)},Tm=function(){return"/api/master/v2/people"},km=function(e){return"/api/master/v2/objects/".concat(e)},Im="people",Lm="person",_m="update:person",Pm=function(e){return{key:"".concat(Im).concat(e?":".concat(e):""),url:Am(e)}},xm=function(e){return{key:"".concat(Lm,":").concat(e),url:jm(e)}},Nm=function(e,t,n){return{key:Lm,url:Tm(),data:e,type:se.a.POST,success:t,error:n,invalidationKeys:[Im]}},Rm=function(e,t,n){return{key:"".concat(_m,":").concat(e),url:km(e),data:t,type:se.a.PUT,always:n}},Dm=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown();function Mm(e){var t=si();return l.createElement(bi,null,l.createElement(as,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this person",autoFocus:!0}),l.createElement(Is,{isNew:e.isNew}))}function Um(e){return l.createElement(ji,{initialValues:e.person,validationSchema:Dm,onSubmit:e.savePerson},l.createElement(Mm,{isNew:!(e.person&&e.person.id)}))}function Fm(e){var t=Object(b.useDispatch)(),n=ce.useBasicFetch(xm(e.id));return l.createElement(l.Fragment,null,!!n.data&&l.createElement(Um,{person:n.data,savePerson:function(n,r){return ce.fetch(t,Rm(e.id,n,r))}}))}function Vm(){var e=Object(b.useDispatch)();return l.createElement(Um,{savePerson:function(t,n){ce.fetch(e,Nm(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.PEOPLE,action:i.People.EDIT_PERSON,args:[e.id]})}),n))}})}var Bm=c.PEOPLE,Hm=function(e){return{application:Bm,action:i.People.EDIT_PERSON,args:[e.id]}},zm=function(e){return p.AppLinkHelper.trigger(Hm(e))};function qm(e){var t=ce.useBasicFetch(Pm(e.cursor));return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-3 w-50"},l.createElement(lu,{placeholder:"Search for a person",onSuggestionSelected:zm,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/people/instant/raw","?q=").concat(e)},activationLength:2})),l.createElement(jl,{collection:t&&t.data,columns:[{accessor:"name",header:"Name",appLink:Hm}],collectionAppLink:{application:Bm,action:i.People.PEOPLE},newObjectAppLink:{application:Bm,action:i.People.NEW_PERSON},objectName:"Person"}))}function Jm(e){return(Jm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Km(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wm(e,t,n){return t&&Km(e.prototype,t),n&&Km(e,n),e}function Ym(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gm(e,t)}function Gm(e,t){return(Gm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xm(e);if(t){var i=Xm(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Qm(this,n)}}function Qm(e,t){return!t||"object"!==Jm(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Xm(e){return(Xm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var eh,th=function(e){Ym(n,e);var t=Zm(n);function n(){return $m(this,n),t.apply(this,arguments)}return Wm(n,[{key:"channelName",get:function(){return c.PEOPLE}},{key:"appRoutes",get:function(){return{"manage/people(/)":"people","manage/people/new(/)":"newPerson","manage/people/:id(/)":"editPerson"}}}]),n}(p.AppRouter),nh=function(e){Ym(n,e);var t=Zm(n);function n(){return $m(this,n),t.apply(this,arguments)}return Wm(n,[{key:"name",get:function(){return"People Application"}},{key:"channelName",get:function(){return c.PEOPLE}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT}}},{key:"people",value:function(e){var t=e.cursor;this.layout.showChildView(I,l.createElement(qm,{cursor:t}))}},{key:"newPerson",value:function(){this.layout.showChildView(I,l.createElement(Vm,null))}},{key:"editPerson",value:function(e){this.layout.showChildView(I,l.createElement(Fm,{id:e}))}}],[{key:"router",get:function(){return th}}]),n}(p.Application),rh=function(e,t,n,r,i){return{url:"/api/image/upload?type=".concat(t),key:"upload:image",data:e,type:se.a.POST,success:n,error:r,always:i}},ih=n(214),oh=n.n(ih);function ah(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ch(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ch(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ch(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e[e.NoRestrictions=0]="NoRestrictions",e[e.RestrictToCanvas=1]="RestrictToCanvas"}(eh||(eh={}));var sh=/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/;function uh(e){var t=e.dataUrl,n=e.minHeight,r=e.minWidth,i=e.onCrop,o=e.onCancel,a=l.useRef(),c=l.useRef(),s=ah(l.useState(!1),2),u=s[0],f=s[1],p=ah(l.useState(!1),2),d=p[0],m=p[1];return l.useEffect((function(){var e=new Image;e.src=t;var i=a.current.offsetWidth/e.width;return c.current=new oh.a(a.current,{viewMode:eh.RestrictToCanvas,autoCropArea:1,aspectRatio:r/n,minCropBoxWidth:r*i,minCropBoxHeight:n*i,ready:function(){return f(!0)}}),function(){c.current.destroy()}}),[]),l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-3 cropper-img-padding"},l.createElement("img",{ref:a,src:t,className:"img img-fluid"})),l.createElement("div",{className:"d-flex justify-content-end border-top pt-3 btn-padding"},l.createElement(Ii.Button,{variant:"link",onClick:o},"Cancel"),l.createElement(Pf,{onClick:function(){if(u){m(!0);var e=c.current.getCroppedCanvas().toDataURL(function(e){var t=e.match(sh);if(t)return t[1]}(t));h(i)&&i(e)}},disabled:!u,showSpinner:d},"Crop")))}function lh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ph(e){var t=Object(b.useDispatch)(),n=l.useContext(nl),r=n.getDataUrl,i=n.setImage,o=lh(l.useState(r()),1)[0],a=lh(l.useState(!1),2),c=a[0],s=a[1];return l.createElement(kp,{title:"Crop Image",size:e.popupSize,closePopup:e.closePopup,onEntered:function(){return s(!0)}},c&&l.createElement(uh,{dataUrl:o,minWidth:Qu[e.imageType].width,minHeight:Qu[e.imageType].height,onCrop:function(n){ce.fetch(t,rh(n,e.imageType,(function(e){return i(e)}),null,e.closePopup))},onCancel:e.closePopup}))}var dh=function(e){var t=e.children;return l.createElement(rl,null,t)};function mh(e){var t=e.page,n=e.totalPages,r=Bs.isNumber(t)&&t>0&&t<n&&t+1,i=Bs.isNumber(t)&&t>1&&t-1,o={};if(r&&r<=n&&(o.next=r.toString()),i&&(o.previous=i.toString()),!wi.a.isEmpty(o))return o}var hh={convertLegacyPaginatedCollection:function(e){if(e)return{data:e.data,pagination:{cursors:mh(e.pagination),limit:e.pagination.pageSize}}}},yh=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1";return{key:"playlists:".concat(e),url:"/ajax/playlists/curators?page=".concat(e),formatData:hh.convertLegacyPaginatedCollection}},vh=function(e,t){var n="/api/domain/v1/search/playlists?query=".concat(e);return t&&(n+="&filter={page:".concat(t,"}")),{key:"playlists:search:".concat(e).concat(t?":".concat(t):""),url:n,formatData:hh.convertLegacyPaginatedCollection}},bh=function(e){return{key:"playlist:".concat(e),url:"/ajax/playlists/".concat(e,"?query=cover,banner")}},gh=function(e){var t=e.slice().sort();return{key:"playlists:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},Sh=function(e,t,n,r){return{url:"/ajax/playlists",key:"playlist",data:e,type:se.a.POST,invalidationKeys:"playlists",success:t,error:n,always:r}},Eh=function(e,t,n,r,i){return{url:"/ajax/v2/playlists//".concat(e),key:"update:playlist:".concat(e),data:t,type:se.a.PUT,success:n,error:r,always:i}},Oh=function(e,t,n,r){return{url:"/ajax/playlists/".concat(e),key:"delete:playlist:".concat(e),type:se.a.DELETE,invalidationKeys:"playlists",success:t,error:n,always:r}},Ch=function(e){return{key:"playlist:".concat(e,":videos"),url:"/api/master/v2/objects/".concat(e,"/videos?query={orderBy:orderindex,limit:100}")}},wh=function(e,t,n,r){return{key:"reorder:playlist",url:"/api/master/v1/objects/".concat(e,"/videos/reorder"),data:t,type:se.a.PUT,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r}},Ah=function(e,t,n,r,i){return{key:"remove:playlist:video",url:"/api/master/v1/playlists/".concat(e,"/dissociate/").concat(t),type:se.a.DELETE,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r,always:i}},jh=function(e,t,n,r){return{key:"playlist:metadata:".concat(e.join(",")),url:qu("/ajax/playlists/metadata",{ids:e}),success:t,error:n,always:r}},Th=function(e,t,n,r){return{key:"dashboards:".concat(e),url:"/ajax/dashboards/".concat(e),success:t,error:n,always:r}},kh=function(e,t,n,r,i){return{key:"dashboard:".concat(e,":widget:").concat(t),url:"/ajax/dashboards/".concat(e,"/widgets/").concat(t),success:n,error:r,always:i}},Ih=function(e,t,n,r){return{key:"playlist:".concat(e,":widgets"),url:"/ajax/playlists/".concat(e,"/widgets"),success:t,error:n,always:r}},Lh=function(e,t,n,r,i,o){return{key:"dashboard:".concat(e,":widget:").concat(t),url:"/ajax/dashboards/".concat(e,"/widgets/").concat(t),type:se.a.DELETE,invalidationKeys:"playlist:".concat(n,":widgets"),formatData:function(){return null},success:r,error:i,always:o}};function _h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ph(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ph(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ph(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xh(e){var t=Object(b.useDispatch)(),n=jp(),r=_h(l.useState(!1),2),o=r[0],a=r[1],s=ce.useBasicFetch(bh(e.playlistId));var u=[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){a(!0),ce.fetch(t,Oh(e.playlistId,(function(){n.success("Successfully deleted playlist."),p.AppLinkHelper.trigger({application:c.PLAYLISTS,action:i.Playlists.PLAYLISTS})}),(function(){a(!1),n.error("Failed to delete playlist.")}),e.closePopup))},buttonText:"Yes, delete playlist",isSpinnerButton:!0,showSpinner:o}],f=!!s.data;return l.createElement(kp,{title:"Delete Playlist",closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,s.data.name),"?"),l.createElement("p",null,"Please ensure it is not being used in any widgets.")),l.createElement(Lp,{buttons:u})))}var Nh=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Ti.string().trim().max(65535,"Description is too long").default(""),cover:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),banner:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),metadata:Ti.object().shape({playlistId:Ti.string(),internalDescription:Ti.string().trim().max(255,"Description is too long").default("")}).default({}).noUnknown()}).noUnknown(),Rh=function(e,t){var n=c.PLAYLISTS,r=i.Playlists,o=[{label:"Edit Playlist Details",appLink:{application:n,action:r.EDIT_PLAYLIST,args:[t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_PLAYLIST_VIDEOS,args:[t]}},{label:"Dashboards",appLink:{application:n,action:r.EDIT_PLAYLIST_DASHBOARDS,args:[t]}}];return nd(e)&&o.push.apply(o,[{label:"Backbone Classifications",appLink:{application:n,action:r.EDIT_PLAYLIST_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_PLAYLIST_AUDIENCES,args:[t]}}]),o};function Dh(e){var t,n=si(),r=us(n);return l.createElement(bi,null,l.createElement(as,{label:"Name",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this playlist",autoFocus:!0}),l.createElement(as,{label:"Description",as:"textarea",name:"description",id:"description",value:n.values.description,placeholder:"Describe this playlist here"}),l.createElement(as,{label:"Internal Description",as:"textarea",name:"metadata.internalDescription",id:"metadata.internalDescription",value:null===(t=n.values.metadata)||void 0===t?void 0:t.internalDescription,placeholder:"This description will only be displayed in Curator"}),l.createElement(Sl,{imageType:Mu.Covers,fieldName:"cover",application:c.PLAYLISTS,uploadAction:i.Playlists.UPLOAD_IMAGE}),l.createElement(Sl,{imageType:Mu.Banners,fieldName:"banner",application:c.PLAYLISTS,uploadAction:i.Playlists.UPLOAD_IMAGE}),l.createElement("div",{className:"d-flex justify-content-between align-items-center"},l.createElement(Pf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},e.id?"Save":"Create"),!!e.actions&&l.createElement(Dl,{actions:e.actions})))}function Mh(e){var t,n=e.playlist&&e.playlist.id;return l.createElement(ji,{initialValues:e.playlist,validationSchema:Nh,onSubmit:e.savePlaylist},l.createElement(Dh,{id:n,actions:!!n&&(t=n,[{label:"Delete playlist",appLink:{application:c.PLAYLISTS,action:i.Playlists.DELETE_PLAYLIST,args:[t]},className:"text-danger"}])}))}function Uh(e){return l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:Rh(e.currentUser,e.playlistId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function Fh(e){var t=Object(b.useDispatch)(),n=jp(),r=ce.useBasicFetch(bh(e.playlistId)),o=ce.useBasicFetch(Bp());return l.createElement(l.Fragment,null,!!o.data&&l.createElement(Uh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST,currentUser:o.data}),!!r.data&&l.createElement(Mh,{playlist:r.data,savePlaylist:function(r,i){ce.fetch(t,Eh(e.playlistId,r,(function(){n.success("Successfully updated playlist.")}),(function(){n.error("Failed to update playlist.")}),i))}}))}var Vh=function(e,t){var n=e.dataServiceName,r=e.eventPrefix,i=e.fetchData,o=e.setData,a=e.onError,c=e.deleteEventPrefix;if(h(i)){if(h(o)){var s=a&&h(a),u=dp.getInstance(n),l=Ou.Radio.channel(u.channelName),f="".concat(r,":request"),d="".concat(r,":sync"),m="".concat(r,":error"),y="".concat(r,":invalidate"),v=c&&"".concat(c,":sync"),b=function(){return t(!1)},g=function(){return t(!0)},S=function(){return t(!1)},E=function(){return l.off(y,S)};l.once(f,b),l.once(d,g),l.once(y,S),s&&l.once(m,a),v&&l.once(v,E);var O=i(u);return O&&(t(!0),e.setData(O)),function(){dp.releaseInstance(n),l.off(f,b),l.off(d,g),l.off(y,S),s&&l.off(m,a),v&&l.off(v,E)}}p.ErrorHelper.throw(new ys.a("A setData function must be passed to fetch"))}else p.ErrorHelper.throw(new ys.a("A fetchData function must be passed to fetch"))};function Bh(e){return function(e){if(Array.isArray(e))return qh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||zh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||zh(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zh(e,t){if(e){if("string"==typeof e)return qh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qh(e,t):void 0}}function qh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Jh=function(e){return Array(Array.isArray(e)?e.length:0).fill(!1)};function $h(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=l.useState(Jh(e)),i=Hh(r,2),o=i[0],a=i[1];l.useEffect((function(){a(Jh(e))}),Bh(t)),l.useEffect((function(){if(n){var t=[];return e&&e.forEach((function(e,n){t.push(Vh(e,(function(e){e!==o[n]&&a(Hp.a.cloneAndReplaceAtIdx(o,n,e))})))})),function(){return t.forEach((function(e){return e()}))}}}),[o,n])}function Kh(e){return function(e){if(Array.isArray(e))return Gh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Yh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||Yh(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yh(e,t){if(e){if("string"==typeof e)return Gh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gh(e,t):void 0}}function Gh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zh(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=l.useState(!1),i=Wh(r,2),o=i[0],a=i[1];l.useEffect((function(){a(!1)}),Kh(t)),l.useEffect((function(){if(n)return Vh(e,a)}),[o,n])}var Qh=function(e,t,n){return function(r){return e((function(e){var i=h(n)?n:y();return Object.assign(Object.assign({},e),function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,i(r,e)))}))}};function Xh(e){return(Xh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ey(e){return function(e){if(Array.isArray(e))return ty(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ty(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ty(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ty(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ny(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ry(e,t){return(ry=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function iy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cy(e);if(t){var i=cy(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return oy(this,n)}}function oy(e,t){return!t||"object"!==Xh(t)&&"function"!=typeof t?ay(e):t}function ay(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cy(e){return(cy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var sy,uy,ly,fy,py,dy=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ry(e,t)}(o,e);var t,n,r,i=iy(o);function o(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=i.call(this,e),d.result(ay(t),"name")||ds.c.throw(new ys.a("Must provide a name when extending BaseDataService")),d.result(ay(t),"channelName")||ds.c.throw(new ys.a("Must provide a channelName for ".concat(d.result(ay(t),"name"))));var n=[].concat(ey(t.defaultProps),ey(t.props||[]));return t.dataRequestSignatures={},t.mergeOptions(e,n),t}return t=o,(n=[{key:"defaultProps",get:function(){return["dataProvider","cache","bootstrapData","defaultErrorHandler","alertService"]}},{key:"getCursors",value:function(e){var t=this.cache.get(e);return t?t.cursors:{}}},{key:"clearCacheAndGet",value:function(e){var t=this,n=e.callback,r=e.errorCallback,i=e.eventPrefix,o=this.getEventNames(i),a=o.syncEvent,c=o.errorEvent,s=this.cache.get(i);if(s&&s.openRequest)return this.listenToOnce(this.getChannel(),a,(function(e){d.isFunction(r)&&t.stopListening(t.getChannel(),c,r),d.isFunction(n)&&n(e)})),void this.listenToOnce(this.getChannel(),c,(function(){d.isFunction(n)&&t.stopListening(t.getChannel(),a,n),d.isFunction(r)&&r()}));this.cache.remove(e.eventPrefix),this.get(e)}},{key:"get",value:function(e){var t=this,n=e.callback,r=e.errorCallback,i=e.eventPrefix,o=e.resource,a=e.formatData,c=e.expiryTime,s=e.successHandler,u=e.errorHandler,l=e.bootstrapName,f=this.getEventNames(i),p=f.syncEvent,m=f.requestEvent,h=f.successEvent,y=f.errorEvent,v=this.getChannel(),b=this.currentTimestamp();this.bootstrapData&&this.bootstrapData[l]&&(this.cacheData(i,this.bootstrapData[l],a,{openRequest:!1,timestamp:b}),delete this.bootstrapData[l]);var g,S=this.cache.get(i);S&&(g=S.data);var E=S&&S.openRequest,O=this.isExpired(i,c);if(E&&(this.listenToOnce(v,p,(function(e){d.isFunction(r)&&t.stopListening(t.getChannel(),y,r),d.isFunction(n)&&n(e)})),this.listenToOnce(v,y,(function(){d.isFunction(n)&&t.stopListening(t.getChannel(),p,n),d.isFunction(r)&&r()}))),this.cache.has(i)&&!O||(v.trigger(m),this.listenToResponse({eventPrefix:i,formatData:a,cacheOptions:{timestamp:b},callback:n,errorCallback:r,successHandler:s,errorHandler:u}),this.cacheData(i,null,null,{openRequest:!0,timestamp:b}),this.dataProvider.read(o,{channel:this.getTransportChannel(),successEvent:h,errorEvent:y})),g&&d.isFunction(n)&&!O&&n(g),g)return g}},{key:"create",value:function(e){var t=e.eventPrefix,n=e.resource,r=e.data,i=e.formatData,o=e.callback,a=e.errorCallback,c=e.invalidationKeys,s=e.successHandler,u=e.errorHandler,l=this.getEventNames(e.eventPrefix),f=l.requestEvent,p=l.successEvent,d=l.errorEvent,m=this.getChannel(),h=this.getTransportChannel();m.trigger(f),this.listenToResponse({eventPrefix:t,formatData:i,invalidationKeys:c,callback:o,errorCallback:a,successHandler:s,errorHandler:u}),this.dataProvider.create(n,r,{channel:h,successEvent:p,errorEvent:d})}},{key:"update",value:function(e){var t=e.data,n=e.callback,r=e.errorCallback,i=e.resource,o=e.formatData,a=e.eventPrefix,c=e.invalidationKeys,s=e.errorHandler,u=e.successHandler,l=this.getEventNames(e.eventPrefix),f=l.requestEvent,p=l.successEvent,d=l.errorEvent,m=this.getChannel(),h=this.getTransportChannel();m.trigger(f),this.listenToResponse({eventPrefix:a,formatData:o,invalidationKeys:c,callback:n,errorCallback:r,successHandler:u,errorHandler:s}),this.dataProvider.update(i,t,{channel:h,successEvent:p,errorEvent:d})}},{key:"delete",value:function(e){var t=e.eventPrefix,n=e.resource,r=e.callback,i=e.errorCallback,o=e.invalidationKeys,a=e.successHandler,c=e.errorHandler,s=this.getEventNames(t),u=s.successEvent,l=s.errorEvent,f=this.getTransportChannel();this.listenToResponse({eventPrefix:t,invalidationKeys:o,callback:r,errorCallback:i,cacheOptions:{noCache:!0,clearCacheKey:!0},successHandler:a,errorHandler:c}),this.dataProvider.delete(n,{channel:f,successEvent:u,errorEvent:l})}},{key:"listenToResponse",value:function(e){var t=this,n=e.eventPrefix,r=e.formatData,i=e.callback,o=e.errorCallback,a=e.successHandler,c=e.errorHandler,s=e.invalidationKeys,u=e.cacheOptions,l=void 0===u?{}:u,f=this.getEventNames(n),p=f.syncEvent,m=f.successEvent,h=f.errorEvent,y=f.successAlertEvent,v=f.errorAlertEvent,b=this.getChannel(),g=this.getTransportChannel(),S=this.getAlertChannel();d.isFunction(i)&&this.listenToOnce(b,p,i),d.isFunction(o)&&this.listenToOnce(b,h,o),this.stopListening(S,y),this.stopListening(S,v),d.isFunction(a)&&this.listenToOnce(S,y,a),d.isFunction(c)&&this.listenToOnce(S,v,c),!d.isFunction(c)&&!1!==c&&d.isFunction(this.defaultErrorHandler)&&this.listenToOnce(S,v,this.defaultErrorHandler),this.hasRequestSignature(n)||(this.setRequestSignature(n),this.listenTo(g,m,(function(e){t.stopListening(b,h,o);for(var i=arguments.length,a=new Array(i>1?i-1:0),c=1;c<i;c++)a[c-1]=arguments[c];S.trigger.apply(S,[y,e].concat(a));var u=l.noCache?t.formatData(e,r):t.cacheData(n,e,r);l.clearCacheKey&&t.cache.remove(n),b.trigger(p,u),s&&s.length&&t.cache.invalidate(s,(function(e){return b.trigger("".concat(e,":invalidate"))}))})),this.listenTo(g,h,(function(){var e;t.stopListening(b,p,i);var r=(e=t.dataProvider).parseError.apply(e,arguments);S.trigger(v,r),b.trigger(h,r),l.noCache||t.cacheData(n,null,null)})))}},{key:"cacheData",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.openRequest,o=void 0!==i&&i,a=r.timestamp;a||(a=this.currentTimestamp());var c=this.processPagination(t),s=this.formatData(t,n);return this.cache.set(e,{data:s,timestamp:a,cursors:c,openRequest:o}),s}},{key:"processPagination",value:function(e){if(e){var t=e.pagination;if(t)return t.cursors?t.cursors:d.isUndefined(t.offset)||d.isUndefined(t.pageSize)?t.page?this.convertLegacyPaginationToCursors(t):void 0:this.convertOffsetPaginationToCursors(t)}}},{key:"formatData",value:function(e,t){return d.isFunction(t)?t(e):e}},{key:"chain",value:function(){var e=this,t=[],n=function(e,t){d.isFunction(e)&&e(t)},r=function(r,o){return t.push((function(){var i=r.callback;r.callback=function(e){n(i,e),n(t.shift())},e[o](r)})),i},i={func:function(e){return t.push((function(){e(t.shift()||function(){})})),i},get:function(e){return r(e,"get")},create:function(e){return r(e,"create")},update:function(e){return r(e,"update")},delete:function(e){return r(e,"delete")},run:function(){n(t.shift())}};return i}},{key:"invalidateCache",value:function(e){e&&e.length&&this.cache.invalidate(e)}},{key:"currentTimestamp",value:function(){return(new Date).valueOf()}},{key:"isExpired",value:function(e,t){if(!t)return!1;var n=this.cache.get(e);if(!n||!n.timestamp)return!0;var r=1e3*t;return n.timestamp<this.currentTimestamp()-r}},{key:"getEventNames",value:function(e){return{syncEvent:"".concat(e,":sync"),requestEvent:"".concat(e,":request"),successEvent:"".concat(e,":success"),errorEvent:"".concat(e,":error"),successAlertEvent:"".concat(e,":success:alert"),errorAlertEvent:"".concat(e,":error:alert")}}},{key:"getTransportChannel",value:function(){return Ou.Radio.channel("".concat(this.channelName,":transport"))}},{key:"getAlertChannel",value:function(){return Ou.Radio.channel("".concat(this.channelName,":alert"))}},{key:"setRequestSignature",value:function(e){this.dataRequestSignatures[e]=e}},{key:"hasRequestSignature",value:function(e){return!!this.dataRequestSignatures[e]}},{key:"convertOffsetPaginationToCursors",value:function(e){var t=e.offset,n=e.pageSize,r=e.totalItems,i=r>0&&t<r&&t+n,o=r>0&&t>0&&Math.max(t-n,0),a={};if(i&&i<r&&(a.next=i.toString()),d.isNumber(o)&&(a.previous=o.toString()),!d.isEmpty(a))return a}},{key:"convertLegacyPaginationToCursors",value:function(e){var t=e.page,n=e.totalPages,r=d.isNumber(t)&&t>0&&t<n&&t+1,i=d.isNumber(t)&&t>1&&t-1,o={};if(r&&r<=n&&(o.next=r.toString()),i&&(o.previous=i.toString()),!d.isEmpty(o))return o}}])&&ny(t.prototype,n),r&&ny(t,r),o}(ps.a),my=n(47),hy={SHORT:120,STANDARD:600};!function(e){e[e.Subject=0]="Subject",e[e.Classification=1]="Classification",e[e.Level=2]="Level",e[e.Audience=3]="Audience"}(sy||(sy={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(uy||(uy={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(ly||(ly={})),function(e){e.Root="0"}(fy||(fy={})),function(e){e.Root="root"}(py||(py={}));var yy,vy,by=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),backboneAudienceIds:Ti.array().of(Ti.string()).required("A level is required").default([])}).noUnknown();!function(e){e.Subject="Subject",e.Topic="Topic"}(yy||(yy={})),function(e){e.Draft="Draft",e.ComingSoon="ComingSoon",e.Published="Published"}(vy||(vy={}));var gy=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentIds:Ti.array().of(Ti.string()).default([py.Root]),backboneClassificationIds:Ti.array().of(Ti.string()).min(1,"A classification must be mapped to at least one subject").required("A classification must be mapped to at least one subject").default([]),type:Ti.mixed().required("Type is required").default(yy.Subject),status:Ti.mixed().required("Status is required").default(vy.Draft),emphasize:Ti.boolean().default(!1),canBePreferred:Ti.boolean().default(!1),cover:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),banner:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),tallPoster:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown()}).noUnknown(),Sy=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),Ey=Ti.object().shape({name:Ti.string().max(255,"Name is too long").required("Name is required"),description:Ti.string().max(65535,"Description is too long").required("Description is required"),status:Ti.mixed().required("Status is required").default(Qp.Draft)}),Oy=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentId:Ti.string().default(fy.Root)}).noUnknown(),Cy={singularizeMemberType:function(e){switch(e){case uy.Playlists:return"playlist";case uy.Series:return"series";case uy.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case uy.Playlists:return{application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:n};case uy.Series:return{application:c.SERIES,action:i.Series.EDIT_SERIES,args:n};case uy.Videos:return{application:c.VIDEOS,action:i.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(Cy.singularizeMemberType(n)),appLink:{application:c.SUBJECTS,action:t===sy.Subject?i.Subjects.REMOVE_SUBJECT_MEMBER:i.Subjects.REMOVE_CLASSIFICATION_MEMBER,args:[e,r,n]},className:"text-danger"}]}},wy=function(){var e=c.SUBJECTS,t=i.Subjects;return[{label:"Classifications",appLink:{application:e,action:t.CLASSIFICATIONS},activeActions:[t.CLASSIFICATIONS,t.PRESENTATION_CLASSIFICATIONS,t.NEW_CLASSIFICATION,t.EDIT_CLASSIFICATION,t.EDIT_CLASSIFICATION_PLAYLISTS,t.EDIT_CLASSIFICATION_SERIES,t.EDIT_CLASSIFICATION_VIDEOS,t.DELETE_CLASSIFICATION,t.REMOVE_CLASSIFICATION_MEMBER]},{label:"Backbone Classifications",appLink:{application:e,action:t.SUBJECTS},activeActions:[t.SUBJECTS,t.NEW_SUBJECT,t.EDIT_SUBJECT,t.EDIT_SUBJECT_PLAYLISTS,t.EDIT_SUBJECT_SERIES,t.EDIT_SUBJECT_VIDEOS,t.SUBJECT_CLASSIFICATIONS,t.DELETE_SUBJECT,t.ADD_SUBJECT_MEMBERS,t.REMOVE_SUBJECT_MEMBER]},{label:"Audiences",appLink:{application:e,action:t.AUDIENCES},activeActions:[t.AUDIENCES,t.PRESENTATION_AUDIENCES,t.NEW_AUDIENCE,t.EDIT_AUDIENCE,t.EDIT_AUDIENCE_PLAYLISTS,t.EDIT_AUDIENCE_SERIES,t.EDIT_AUDIENCE_VIDEOS,t.REMOVE_AUDIENCE_MEMBER]},{label:"Backbone Audiences",appLink:{application:e,action:t.LEVELS},activeActions:[t.LEVELS,t.NEW_LEVEL,t.EDIT_LEVEL,t.LEVEL_AUDIENCES,t.EDIT_LEVEL_PLAYLISTS,t.EDIT_LEVEL_SERIES,t.EDIT_LEVEL_VIDEOS]},{label:"Presentations",appLink:{application:e,action:t.PRESENTATIONS},activeActions:[t.PRESENTATIONS,t.NEW_PRESENTATION,t.EDIT_PRESENTATION]}]},Ay=function(e,t){var n=c.SUBJECTS,r=i.Subjects,o=[e];return[{label:"Edit Backbone Classification Details",appLink:{action:r.EDIT_SUBJECT}},{label:"Classifications",appLink:{action:r.SUBJECT_CLASSIFICATIONS}},{label:"Playlists",appLink:{action:r.EDIT_SUBJECT_PLAYLISTS}},{label:"Series",appLink:{action:r.EDIT_SUBJECT_SERIES}},{label:"Videos",appLink:{action:r.EDIT_SUBJECT_VIDEOS}}].map((function(e){var r=Object.assign(Object.assign({},e.appLink),{application:n,args:o});return t&&(r.params={presentationId:t}),{label:e.label,appLink:r}}))},jy=function(e,t){var n=c.SUBJECTS,r=i.Subjects;return[{label:"Edit Classification Details",appLink:{application:n,action:r.EDIT_CLASSIFICATION,args:[e,t]}},{label:"Playlists",appLink:{application:n,action:r.EDIT_CLASSIFICATION_PLAYLISTS,args:[e,t]}},{label:"Series",appLink:{application:n,action:r.EDIT_CLASSIFICATION_SERIES,args:[e,t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_CLASSIFICATION_VIDEOS,args:[e,t]}}]},Ty=function(e,t){var n=c.SUBJECTS,r=i.Subjects,o=[e];return[{label:"Edit Level Details",appLink:{action:r.EDIT_LEVEL}},{label:"Audiences",appLink:{action:r.LEVEL_AUDIENCES}},{label:"Playlists",appLink:{action:r.EDIT_LEVEL_PLAYLISTS}},{label:"Series",appLink:{action:r.EDIT_LEVEL_SERIES}},{label:"Videos",appLink:{action:r.EDIT_LEVEL_VIDEOS}}].map((function(e){var r=Object.assign(Object.assign({},e.appLink),{application:n,args:o});return t&&(r.params={presentationId:t}),{label:e.label,appLink:r}}))},ky=function(e,t){var n=c.SUBJECTS,r=i.Subjects;return[{label:"Edit Audience Details",appLink:{application:n,action:r.EDIT_AUDIENCE,args:[e,t]}},{label:"Playlists",appLink:{application:n,action:r.EDIT_AUDIENCE_PLAYLISTS,args:[e,t]}},{label:"Series",appLink:{application:n,action:r.EDIT_AUDIENCE_SERIES,args:[e,t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_AUDIENCE_VIDEOS,args:[e,t]}}]},Iy={singularizeMemberType:function(e){switch(e){case ly.Playlists:return"playlist";case ly.Series:return"series";case ly.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case ly.Playlists:return{application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:n};case ly.Series:return{application:c.SERIES,action:i.Series.EDIT_SERIES,args:n};case ly.Videos:return{application:c.VIDEOS,action:i.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(Iy.singularizeMemberType(n)),appLink:{application:c.SUBJECTS,action:t===sy.Level?i.Subjects.REMOVE_LEVEL_MEMBER:i.Subjects.REMOVE_AUDIENCE_MEMBER,args:[e,r,n]},className:"text-danger"}]}};function Ly(e){return(Ly="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _y(e){return function(e){if(Array.isArray(e))return Py(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Py(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Py(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Py(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ny(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ry(e,t){return(Ry=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Uy(e);if(t){var i=Uy(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return My(this,n)}}function My(e,t){return!t||"object"!==Ly(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Uy(e){return(Uy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Fy=function(){return"/api/subjects/v1/backbone-classifications/tree"},Vy=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},By=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/").concat(t,"?query={limit:100}")},Hy=function(e,t,n){var r="/api/subjects/v1/backbone-classifications/".concat(e,"/classifications"),i=[];return t&&i.push("presentationId=".concat(t)),n&&i.push("query=".concat(n,"{limit:100}")),i.length?"".concat(r,"?").concat(i.join("&")):r},zy=function(){return"/api/subjects/v1/backbone-classifications"},qy=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},Jy=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},$y=function(e){return"/api/subjects/v1/objects/".concat(e,"/backbone-classifications")},Ky=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/backbone-classifications?addToClassifications=").concat(!!t)},Wy=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/objects?addToClassifications=").concat(!!t)},Yy=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Gy=function(){return"/api/subjects/v1/presentations"},Zy=function(e){return"/api/subjects/v1/presentations/".concat(e)},Qy=function(){return"/api/subjects/v1/presentations"},Xy=function(e){return"/api/subjects/v1/presentations/".concat(e)},ev=function(e){return"/api/subjects/v1/presentations/".concat(e,"/classifications/tree")},tv=function(e){return"/api/subjects/v1/classifications/".concat(e,"?query=cover,banner,tallPoster,followers[count()]{limit:0}")},nv=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/").concat(t,"?query={limit:100}")},rv=function(){return"/api/subjects/v1/classifications"},iv=function(e){return"/api/subjects/v1/classifications/".concat(e)},ov=function(e){return"/api/subjects/v1/classifications/".concat(e)},av=function(e){return"/api/subjects/v1/objects/".concat(e,"/classifications")},cv=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/classifications?presentationId=").concat(t)},sv=function(e){return"/api/subjects/v1/classifications/".concat(e,"/objects")},uv=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},lv=function(){return"/api/subjects/v1/backbone-audiences"},fv=function(e){return"/api/subjects/v1/backbone-audiences/".concat(e)},pv=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/").concat(t,"?query={limit:100}")},dv=function(e,t,n){var r="/api/subjects/v1/backbone-audiences/".concat(e,"/audiences"),i=[];return t&&i.push("presentationId=".concat(t)),n&&i.push("query=".concat(n,"{limit:100}")),i.length?"".concat(r,"?").concat(i.join("&")):r},mv=function(){return"/api/subjects/v1/backbone-audiences"},hv=function(e){return"/api/subjects/v1/backbone-audiences/".concat(e)},yv=function(e){return"/api/subjects/v1/objects/".concat(e,"/backbone-audiences")},vv=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/backbone-audiences?addToAudiences=").concat(!!t)},bv=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/objects?addToAudiences=").concat(!!t)},gv=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Sv=function(e){return"/api/subjects/v1/presentations/".concat(e,"/audiences")},Ev=function(e){return"/api/subjects/v1/audiences/".concat(e)},Ov=function(e,t){return"/api/master/v2/objects/".concat(e,"/").concat(t,"?query={limit:100}")},Cv=function(){return"/api/subjects/v1/audiences"},wv=function(e){return"/api/subjects/v1/audiences/".concat(e)},Av=function(e){return"/api/subjects/v1/audiences/".concat(e)},jv=function(e){return"/api/subjects/v1/objects/".concat(e,"/audiences")},Tv=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/audiences?presentationId=").concat(t)},kv=function(e){return"/api/subjects/v1/audiences/".concat(e,"/objects")},Iv=function(e,t){return"/api/subjects/v1/audiences/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Lv=function(e,t,n){var r="".concat(o.SUBJECT,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(o.CLASSIFICATIONS),n&&(r+=":".concat(n)),r},_v=function(e,t,n){var r="".concat(o.LEVEL,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(o.AUDIENCES),n&&(r+=":".concat(n)),r},Pv=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ry(e,t)}(a,e);var t,n,r,i=Dy(a);function a(){return xy(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"name",get:function(){return u.SUBJECT}},{key:"channelName",get:function(){return s.SUBJECT}},{key:"getPresentations",value:function(e,t){return this.get({resource:Gy(),eventPrefix:o.PRESENTATIONS,expiryTime:hy.STANDARD,callback:e,errorCallback:t})}},{key:"getPresentation",value:function(e,t,n){return this.get({resource:Zy(e),eventPrefix:"".concat(o.PRESENTATION,":").concat(e),expiryTime:hy.STANDARD,callback:t,errorCallback:n})}},{key:"createPresentation",value:function(e,t,n){return this.create({resource:Qy(),data:e,callback:t,errorCallback:n,eventPrefix:o.PRESENTATION,invalidationKeys:[o.PRESENTATIONS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully created presentation."),errorHandler:this.alertService.error("Failed to create presentation.")})}},{key:"updatePresentation",value:function(e,t,n,r){return this.update({resource:Xy(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(o.UPDATE_PRESENTATION,":").concat(e),invalidationKeys:["".concat(o.PRESENTATION,":").concat(e),o.PRESENTATIONS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully updated presentation."),errorHandler:this.alertService.error("Failed to update presentation.")})}},{key:"getSubjectTree",value:function(e,t){return this.get({resource:Fy(),formatData:function(e){return{children:e,name:fy.Root,id:null}},eventPrefix:o.SUBJECTS,expiryTime:hy.STANDARD,callback:e,errorCallback:t})}},{key:"getSubject",value:function(e,t,n){return this.get({resource:Vy(e),eventPrefix:"".concat(o.SUBJECT,":").concat(e),expiryTime:hy.STANDARD,callback:t,errorCallback:n})}},{key:"getSubjectMemberIds",value:function(e,t,n,r){return this.get({resource:By(e,t),eventPrefix:"".concat(o.SUBJECT,":").concat(e,":").concat(t),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"getSubjectClassifications",value:function(e,t,n,r,i){return this.get({resource:Hy(e,t,n),eventPrefix:Lv(e,t,n),expiryTime:hy.STANDARD,callback:r,errorCallback:i})}},{key:"createSubject",value:function(e,t,n){return this.create({resource:zy(),data:e,callback:t,errorCallback:n,eventPrefix:o.SUBJECT,invalidationKeys:[o.SUBJECTS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully created subject."),errorHandler:this.alertService.error("Failed to create subject.")})}},{key:"updateSubject",value:function(e,t,n,r){return this.update({resource:qy(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(o.UPDATE_SUBJECT,":").concat(e),invalidationKeys:["".concat(o.SUBJECT,":").concat(e),o.SUBJECTS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully updated subject."),errorHandler:this.alertService.error("Failed to save subject.")})}},{key:"deleteSubject",value:function(e,t,n){var r=this;return this.delete({resource:Jy(e),callback:t,errorCallback:n,eventPrefix:o.DELETE_SUBJECT,invalidationKeys:["".concat(o.SUBJECT,":").concat(e),o.SUBJECTS],successHandler:this.alertService.success("Successfully deleted subject."),errorHandler:function(e){var t=(null==e?void 0:e.code)===my.a.Conflict?"Cannot delete a subject with child subjects and/or classifications.":"Failed to delete subject.";r.alertService.error(t)()}})}},{key:"getObjectSubjects",value:function(e,t,n,r){return this.get({resource:$y(e),eventPrefix:"".concat(t,":").concat(e,":").concat(o.SUBJECTS),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectSubjects",value:function(e,t,n,r,i,a){var c=Cy.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(o.SUBJECTS)];return r&&s.push("".concat(n,":").concat(e,":").concat(o.CLASSIFICATIONS)),s.push.apply(s,_y(t.map((function(e){return"".concat(o.SUBJECTS,":").concat(e,":").concat(n)})))),this.update({resource:Ky(e,r),data:t,callback:i,errorCallback:a,eventPrefix:"".concat(o.UPDATE_OBJECT_SUBJECTS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(c," subjects.")),errorHandler:this.alertService.error("Failed to update ".concat(c," subjects."))})}},{key:"addObjectsToSubject",value:function(e,t,n,r,i,a){var c=1===t.length?Cy.singularizeMemberType(n):n,s=["".concat(o.SUBJECT,":").concat(e,":").concat(n)].concat(_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.SUBJECTS)}))),_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.CLASSIFICATIONS)}))));return this.create({resource:Wy(e,r),data:t,callback:i,errorCallback:a,eventPrefix:"".concat(o.ADD_TO_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(c," to subject.")),errorHandler:this.alertService.error("Failed to add ".concat(c," to subject."))})}},{key:"removeObjectsFromSubject",value:function(e,t,n,r,i){var a=1===t.length?Cy.singularizeMemberType(n):n,c=["".concat(o.SUBJECT,":").concat(e,":").concat(n)].concat(_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.SUBJECTS)}))));return this.delete({resource:Yy(e,t),callback:r,errorCallback:i,eventPrefix:"".concat(o.REMOVE_FROM_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:c,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(a," from subject.")),errorHandler:this.alertService.error("Failed to remove ".concat(a," from subject."))})}},{key:"getClassificationTree",value:function(e,t,n){return this.get({resource:ev(e),formatData:function(e){return{children:e,name:py.Root,id:null}},eventPrefix:"".concat(o.CLASSIFICATIONS,":").concat(e),expiryTime:hy.STANDARD,callback:t,errorCallback:n})}},{key:"getClassification",value:function(e,t,n){return this.get({resource:tv(e),eventPrefix:"".concat(o.CLASSIFICATION,":").concat(e),expiryTime:hy.STANDARD,callback:t,errorCallback:n})}},{key:"getClassificationMembers",value:function(e,t,n,r){return this.get({resource:nv(e,t),eventPrefix:"".concat(o.CLASSIFICATION,":").concat(e,":").concat(t),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"createClassification",value:function(e,t,n){return this.create({resource:rv(),data:e,callback:t,errorCallback:n,eventPrefix:o.CLASSIFICATION,invalidationKeys:[o.CLASSIFICATIONS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully created classification."),errorHandler:this.alertService.error("Failed to create classification.")})}},{key:"updateClassification",value:function(e,t,n,r){return this.update({resource:iv(e),data:wi.a.omit(t,["followers"]),callback:n,errorCallback:r,eventPrefix:"".concat(o.UPDATE_CLASSIFICATION,":").concat(e),invalidationKeys:["".concat(o.CLASSIFICATION,":").concat(e),o.CLASSIFICATIONS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully updated classification."),errorHandler:this.alertService.error("Failed to save classification.")})}},{key:"deleteClassification",value:function(e,t,n){return this.delete({resource:ov(e),callback:t,errorCallback:n,eventPrefix:o.DELETE_CLASSIFICATION,invalidationKeys:["".concat(o.CLASSIFICATION,":").concat(e),o.CLASSIFICATIONS],successHandler:this.alertService.success("Successfully deleted classification"),errorHandler:this.alertService.error("Failed to delete classification")})}},{key:"getObjectClassifications",value:function(e,t,n,r){return this.get({resource:av(e),eventPrefix:"".concat(t,":").concat(e,":").concat(o.CLASSIFICATIONS),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectClassifications",value:function(e,t,n,r,i,a){var c=Cy.singularizeMemberType(r),s=["".concat(r,":").concat(e,":").concat(o.CLASSIFICATIONS)];return s.push.apply(s,_y(n.map((function(e){return"".concat(o.CLASSIFICATION,":").concat(e,":").concat(r)})))),this.update({resource:cv(e,t),data:n,callback:i,errorCallback:a,eventPrefix:"".concat(o.UPDATE_OBJECT_CLASSIFICATIONS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(c," classifications.")),errorHandler:this.alertService.error("Failed to update ".concat(c," classifications."))})}},{key:"addObjectsToClassification",value:function(e,t,n,r,i,a,c){var s=1===t.length?Cy.singularizeMemberType(n):n,u=["".concat(o.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(Lv(r,i,n)),u.push.apply(u,_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.CLASSIFICATIONS)})))),this.create({resource:sv(e),data:t,callback:a,errorCallback:c,eventPrefix:"".concat(o.ADD_TO_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(s," to classification.")),errorHandler:this.alertService.error("Failed to add ".concat(s," to classification."))})}},{key:"removeObjectsFromClassification",value:function(e,t,n,r,i,a,c){var s=1===t.length?Cy.singularizeMemberType(n):n,u=["".concat(o.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(Lv(r,i,n)),u.push.apply(u,_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.CLASSIFICATIONS)})))),this.delete({resource:uv(e,t),callback:a,errorCallback:c,eventPrefix:"".concat(o.REMOVE_FROM_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(s," from classification.")),errorHandler:this.alertService.error("Failed to remove ".concat(s," from classification."))})}},{key:"getLevels",value:function(e,t){return this.get({resource:lv(),eventPrefix:o.LEVELS,expiryTime:hy.STANDARD,callback:e,errorCallback:t})}},{key:"getLevel",value:function(e,t,n){return this.get({resource:fv(e),eventPrefix:"".concat(o.LEVEL,":").concat(e),expiryTime:hy.STANDARD,callback:t,errorCallback:n})}},{key:"getLevelMemberIds",value:function(e,t,n,r){return this.get({resource:pv(e,t),eventPrefix:"".concat(o.LEVEL,":").concat(e,":").concat(t),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"getLevelAudiences",value:function(e,t,n,r,i){return this.get({resource:dv(e,t,n),eventPrefix:_v(e,t,n),expiryTime:hy.STANDARD,callback:r,errorCallback:i})}},{key:"createLevel",value:function(e,t,n){return this.create({resource:mv(),data:e,callback:t,errorCallback:n,eventPrefix:o.LEVEL,invalidationKeys:[o.LEVELS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully created level."),errorHandler:this.alertService.error("Failed to create level.")})}},{key:"updateLevel",value:function(e,t,n,r){return this.update({resource:hv(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(o.UPDATE_LEVEL,":").concat(e),invalidationKeys:["".concat(o.LEVEL,":").concat(e),o.LEVELS],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully updated level."),errorHandler:this.alertService.error("Failed to save level.")})}},{key:"getObjectLevels",value:function(e,t,n,r){return this.get({resource:yv(e),eventPrefix:"".concat(t,":").concat(e,":").concat(o.LEVELS),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectLevels",value:function(e,t,n,r,i,a){var c=Cy.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(o.LEVELS)];return r&&s.push("".concat(n,":").concat(e,":").concat(o.AUDIENCES)),this.update({resource:vv(e,r),data:t,callback:i,errorCallback:a,eventPrefix:"".concat(o.UPDATE_OBJECT_LEVELS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(c," levels.")),errorHandler:this.alertService.error("Failed to update ".concat(c," levels."))})}},{key:"addObjectsToLevel",value:function(e,t,n,r,i,a){var c=1===t.length?Iy.singularizeMemberType(n):n,s=["".concat(o.LEVEL,":").concat(e,":").concat(n)].concat(_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.LEVELS)}))),_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.AUDIENCES)}))));return this.create({resource:bv(e,r),data:t,callback:i,errorCallback:a,eventPrefix:"".concat(o.ADD_TO_LEVEL,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(c," to level.")),errorHandler:this.alertService.error("Failed to add ".concat(c," to level."))})}},{key:"removeObjectsFromLevel",value:function(e,t,n,r,i){var a=1===t.length?Iy.singularizeMemberType(n):n,c=["".concat(o.LEVEL,":").concat(e,":").concat(n)].concat(_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.LEVELS)}))));return this.delete({resource:gv(e,t),callback:r,errorCallback:i,eventPrefix:"".concat(o.REMOVE_FROM_LEVEL,":").concat(e,":").concat(n),invalidationKeys:c,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(a," from level.")),errorHandler:this.alertService.error("Failed to remove ".concat(a," from level."))})}},{key:"getAudiences",value:function(e,t,n){return this.get({resource:Sv(e),callback:t,errorCallback:n,eventPrefix:"".concat(o.AUDIENCES,":").concat(e),expiryTime:hy.STANDARD})}},{key:"getAudience",value:function(e,t,n){return this.get({resource:Ev(e),callback:t,errorCallback:n,eventPrefix:"".concat(o.AUDIENCE,":").concat(e),expiryTime:hy.STANDARD})}},{key:"getAudienceMembers",value:function(e,t,n,r){return this.get({resource:Ov(e,t),eventPrefix:"".concat(o.AUDIENCE,":").concat(e,":").concat(t),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"createAudience",value:function(e,t,n){return this.create({resource:Cv(),data:e,callback:t,errorCallback:n,eventPrefix:o.AUDIENCE,invalidationKeys:[o.AUDIENCES],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully created audience."),errorHandler:this.alertService.error("Failed to create audience.")})}},{key:"updateAudience",value:function(e,t,n,r){return this.update({resource:wv(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(o.UPDATE_AUDIENCE,":").concat(e),invalidationKeys:["".concat(o.AUDIENCE,":").concat(e),o.AUDIENCES],expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully updated audience."),errorHandler:this.alertService.error("Failed to update audience.")})}},{key:"deleteAudience",value:function(e,t,n){return this.delete({resource:Av(e),callback:t,errorCallback:n,eventPrefix:o.DELETE_AUDIENCE,invalidationKeys:["".concat(o.AUDIENCE,":").concat(e),o.AUDIENCES],successHandler:this.alertService.success("Successfully deleted audience"),errorHandler:this.alertService.error("Failed to delete audience")})}},{key:"getObjectAudiences",value:function(e,t,n,r){return this.get({resource:jv(e),eventPrefix:"".concat(t,":").concat(e,":").concat(o.AUDIENCES),expiryTime:hy.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectAudiences",value:function(e,t,n,r,i,a){var c=Cy.singularizeMemberType(r);return this.update({resource:Tv(e,t),data:n,callback:i,errorCallback:a,eventPrefix:"".concat(o.UPDATE_OBJECT_AUDIENCES,":").concat(e),invalidationKeys:["".concat(r,":").concat(e,":").concat(o.AUDIENCES)],successHandler:this.alertService.success("Successfully updated ".concat(c," audiences.")),errorHandler:this.alertService.error("Failed to update ".concat(c," audiences."))})}},{key:"addObjectsToAudience",value:function(e,t,n,r,i,a,c){var s=1===t.length?Iy.singularizeMemberType(n):n,u=["".concat(o.AUDIENCE,":").concat(e,":").concat(n)];return r&&u.push(_v(r,i,n)),u.push.apply(u,_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.AUDIENCES)})))),this.create({resource:kv(e),data:t,callback:a,errorCallback:c,eventPrefix:"".concat(o.ADD_TO_AUDIENCE,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(s," to audience.")),errorHandler:this.alertService.error("Failed to add ".concat(s," to audience."))})}},{key:"removeObjectsFromAudience",value:function(e,t,n,r,i,a,c){var s=1===t.length?Iy.singularizeMemberType(n):n,u=["".concat(o.AUDIENCE,":").concat(e,":").concat(n)];return r&&u.push(_v(r,i,n)),u.push.apply(u,_y(t.map((function(e){return"".concat(n,":").concat(e,":").concat(o.AUDIENCES)})))),this.delete({resource:Iv(e,t),callback:a,errorCallback:c,eventPrefix:"".concat(o.REMOVE_FROM_AUDIENCE,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:hy.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(s," from audience.")),errorHandler:this.alertService.error("Failed to remove ".concat(s," from audience."))})}}])&&Ny(t.prototype,n),r&&Ny(t,r),a}(dy),xv={dataServiceName:u.SUBJECT,dataChannelName:s.SUBJECT},Nv={getSubjectTreeFetchOptions:function(e,t){return Object.assign(Object.assign({},xv),{eventPrefix:o.SUBJECTS,fetchData:function(e){return e.getSubjectTree()},setData:e,onError:t})},getSubjectFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.SUBJECT,":").concat(e),fetchData:function(t){return t.getSubject(e)},setData:t,onError:n,deleteEventPrefix:o.DELETE_SUBJECT})},getSubjectMemberIdsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.SUBJECT,":").concat(e,":").concat(t),fetchData:function(n){return n.getSubjectMemberIds(e,t)},setData:n,onError:r})},getSubjectClassificationFetchOptions:function(e,t,n,r,i){return Object.assign(Object.assign({},xv),{eventPrefix:Lv(e,n,r),fetchData:function(t){return t.getSubjectClassifications(e,n,r)},setData:t,onError:i})},getObjectSubjectsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(t,":").concat(e,":").concat(o.SUBJECTS),fetchData:function(n){return n.getObjectSubjects(e,t)},setData:n,onError:r})},getPresentationsFetchOptions:function(e,t){return Object.assign(Object.assign({},xv),{eventPrefix:o.PRESENTATIONS,fetchData:function(e){return e.getPresentations()},setData:e,onError:t})},getPresentationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.PRESENTATION,":").concat(e),fetchData:function(t){return t.getPresentation(e)},setData:t,onError:n})},getClassificationTreeFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.CLASSIFICATIONS,":").concat(e),fetchData:function(t){return t.getClassificationTree(e)},setData:t,onError:n})},getClassificationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.CLASSIFICATION,":").concat(e),fetchData:function(t){return t.getClassification(e)},setData:t,onError:n,deleteEventPrefix:o.DELETE_CLASSIFICATION})},getClassificationMembersFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.CLASSIFICATION,":").concat(e,":").concat(t),fetchData:function(n){return n.getClassificationMembers(e,t)},setData:n,onError:r})},getObjectClassificationsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(t,":").concat(e,":").concat(o.CLASSIFICATIONS),fetchData:function(n){return n.getObjectClassifications(e,t)},setData:n,onError:r})},getLevelsFetchOptions:function(e,t){return Object.assign(Object.assign({},xv),{eventPrefix:o.LEVELS,fetchData:function(e){return e.getLevels()},setData:e,onError:t})},getLevelFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.LEVEL,":").concat(e),fetchData:function(t){return t.getLevel(e)},setData:t,onError:n})},getLevelMemberIdsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.LEVEL,":").concat(e,":").concat(t),fetchData:function(n){return n.getLevelMemberIds(e,t)},setData:n,onError:r})},getLevelAudiencesFetchOptions:function(e,t,n,r,i){return Object.assign(Object.assign({},xv),{eventPrefix:_v(e,n,r),fetchData:function(t){return t.getLevelAudiences(e,n,r)},setData:t,onError:i})},getObjectLevelsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(t,":").concat(e,":").concat(o.LEVELS),fetchData:function(n){return n.getObjectLevels(e,t)},setData:n,onError:r})},getAudiencesFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.AUDIENCES,":").concat(e),fetchData:function(t){return t.getAudiences(e)},setData:t,onError:n})},getAudienceFetchOptions:function(e,t,n){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.AUDIENCE,":").concat(e),fetchData:function(t){return t.getAudience(e)},setData:t,onError:n})},getAudienceMembersFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(o.AUDIENCE,":").concat(e,":").concat(t),fetchData:function(n){return n.getAudienceMembers(e,t)},setData:n,onError:r})},getObjectAudiencesFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},xv),{eventPrefix:"".concat(t,":").concat(e,":").concat(o.AUDIENCES),fetchData:function(n){return n.getObjectAudiences(e,t)},setData:n,onError:r})}},Rv=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[e.id]}},Dv=function(e,t){var n=e.backboneAudienceIds;return t.filter((function(e){return n.includes(e.id)}))};function Mv(e){var t=e.showLevels;return l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,"Audiences"),!!t&&l.createElement("th",null,"Mapped Backbone Audience(s)")))}function Uv(e){var t,n=e.audience,r=e.levels;return l.createElement("tr",null,l.createElement("td",null,l.createElement(Pu,{appLink:(t=n,{application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[t.presentationId,t.masterId]})},n.name)),l.createElement("td",null,r.map((function(e){return l.createElement(Pu,{key:e.id,appLink:Rv(e),className:"mr-2"},e.name)}))))}function Fv(e){var t=e.audiences,n=e.levels;return l.createElement(Ii.Table,{responsive:!0,bordered:!0},l.createElement(Mv,{showLevels:!!t.length}),l.createElement("tbody",null,t.length?t.map((function(e){return l.createElement(Uv,{key:e.masterId,audience:e,levels:Dv(e,n)})})):l.createElement("tr",null,l.createElement("td",null,"This presentation has no audiences."))))}function Vv(e){var t=null===e.masterId||void 0===e.masterId,n=si(),r=us(n);return l.createElement(bi,null,l.createElement(as,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this audience",autoFocus:!0}),l.createElement(as,{label:"Mapped Level(s)",as:"select",name:"backboneAudienceIds",id:"level-ids",multiple:!0,size:e.levels.length,value:n.values.backboneAudienceIds},e.levels.map((function(e){return l.createElement("option",{key:e.id,value:e.id},e.name)}))),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(Pf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&l.createElement(Ii.Button,{as:Pu,variant:"danger",appLink:{application:c.SUBJECTS,action:i.Subjects.DELETE_AUDIENCE,args:[e.presentationId,e.masterId]}},"Delete")))}function Bv(e){return l.createElement(ji,{initialValues:e.audience,validationSchema:by,onSubmit:e.saveAudience},l.createElement(Vv,{masterId:e.audience&&e.audience.masterId,presentationId:e.presentationId,levels:e.levels}))}function Hv(e){var t=e.objectAudiences,n=e.presentationAudiences;return t.filter((function(e){return n.some((function(t){return t.masterId===e.masterId}))}))}function zv(e){var t,n,r,i,o,a=Cy.singularizeMemberType(e.memberType),c=(n=(t=e).presentationAudiences,r=t.objectLevels,i=t.objectAudiences,o=r.map((function(e){return e.id})),n.filter((function(e){return Hp.a.intersection(e.backboneAudienceIds,o).length||i.some((function(t){return t.masterId===e.masterId}))})));return l.createElement(l.Fragment,null,l.createElement("div",{className:"border-bottom pb-3 mb-3"},l.createElement("h6",null,"Backbone Audiences"),l.createElement("p",null,"Select which backbone audiences this ".concat(a," is mapped to.")),l.createElement("p",null,"To see how backbone audiences correspond to audiences, scroll down to the audience-backbone audience mappings table."),l.createElement(mb,{initialValues:{backboneAudienceIds:e.objectLevels.map((function(e){return e.id}))},saveLevels:e.saveLevels,levels:e.levels,memberType:e.memberType})),l.createElement("h6",null,"Audiences"),l.createElement("p",null,"Select a presentation to view its audiences and map them to this ".concat(a,".")),l.createElement("div",{className:"w-50 pb-3"},l.createElement(jb,{presentations:e.presentations,currentPresentationId:e.currentPresentation.id,setCurrentPresentation:e.setCurrentPresentation})),l.createElement("p",null,"Audience to backbone audience mappings for this presentation are displayed below."),l.createElement(Fv,{levels:e.levels,audiences:e.presentationAudiences}),l.createElement("p",null,"Only the audiences which are mapped to a backbone audience that this"+" ".concat(a," is mapped to are displayed below.")),!!c.length&&l.createElement(Jv,{initialValues:{audienceIds:Hv(e).map((function(e){return e.masterId}))},saveAudiences:e.saveAudiences,audiences:c}))}function qv(e){var t=si(),n=us(t);return l.createElement(bi,null,l.createElement(as,{label:"Audience(s)",as:"select",name:"audienceIds",id:"audience-ids",multiple:!0,size:e.audiences.length,value:t.values.audienceIds},e.audiences.map((function(e){return l.createElement("option",{key:e.masterId,value:e.masterId},e.name)}))),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(Pf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Audiences")))}function Jv(e){return l.createElement(ji,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.audienceIds;return e.saveAudiences(r,n)},enableReinitialize:!0},l.createElement(qv,{audiences:e.audiences}))}var $v=function(e){return function(t){if(!e)return t.appLink.action===i.Subjects.EDIT_AUDIENCE;switch(e){case ly.Playlists:return t.appLink.action===i.Subjects.EDIT_AUDIENCE_PLAYLISTS;case ly.Series:return t.appLink.action===i.Subjects.EDIT_AUDIENCE_SERIES;case ly.Videos:return t.appLink.action===i.Subjects.EDIT_AUDIENCE_VIDEOS}}};function Kv(e){var t=e.presentation,n=e.audienceId,r=e.memberType;return t?l.createElement(l.Fragment,null,l.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:ky(t.id,n),isItemActive:$v(r)}))):l.createElement(l.Fragment,null)}function Wv(e){var t=e.item,n=e.getItemAppLink,r=e.actions;return l.createElement("tr",null,l.createElement("td",null,l.createElement(Pu,{appLink:n(t)},t.name)),r&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(Dl,{actions:r}))))}function Yv(e){var t=e.items,n=e.memberType,r=e.getItemAppLink,i=e.getActions;if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this audience."));var o="".concat(zl(Iy.singularizeMemberType(n))," Name");return l.createElement(Ii.Table,{responsive:!0},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,o),h(i)&&l.createElement("th",null))),l.createElement("tbody",null,t.map((function(e){return l.createElement(Wv,{item:e,key:e.id,getItemAppLink:r,actions:h(i)&&i(e)})}))))}function Gv(e){var t=e.item,n=e.getItemAppLink,r=e.actions,i=e.pinState;return l.createElement("tr",null,l.createElement("td",null,l.createElement(Pu,{appLink:n(t)},t.name)),i.isPinnable&&l.createElement("td",null,l.createElement(Bu,{selected:parseInt(t.id)===parseInt(i.currentPinnedVideo),onToggle:function(e){return i.onChange(e,t.id)},id:t.id})),r&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(Dl,{actions:r}))))}function Zv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tb(e){var t=e.items,n=e.memberType,r=e.classification,i=e.getItemAppLink,o=e.getActions,a=e.updatePinnedVideo,c=Xv(l.useState(!1),2),s=c[0],u=c[1],f=function(e,t){var n=e.pinnedVideoMasterId||null,r=Zv(l.useState(n),2),i=r[0],o=r[1];return{currentPinnedVideo:i,onChange:function(e,t){o(e?t:null)},canSubmit:n!==i,isPinnable:t===uy.Videos}}(r,n);if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this classification."));var p="".concat(zl(Cy.singularizeMemberType(n))," Name");return l.createElement(l.Fragment,null,l.createElement(Ii.Table,{responsive:!0},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,p),f.isPinnable&&l.createElement("th",null,"Pinned"),h(o)&&l.createElement("th",null))),l.createElement("tbody",null,t.map((function(e){return l.createElement(Gv,{item:e,key:e.id,getItemAppLink:i,actions:h(o)&&o(e),pinState:f})})))),f.isPinnable&&l.createElement(Pf,{showSpinner:s,onClick:function(){u(!0),a(f.currentPinnedVideo,(function(){return u(!1)}))},disabled:!f.canSubmit||s},"Save"))}function nb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ib=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[e]}};function ob(e){var t,n,r,o,a,s=si(),u=us(s),f=null===(null===(t=e.classification)||void 0===t?void 0:t.id)||void 0===(null===(n=e.classification)||void 0===n?void 0:n.id),p=!f||!(!s.values.parentIds||!s.values.parentIds.length),d=nb(l.useState(p),2),m=d[0],h=d[1];l.useEffect((function(){return h(p)}),[null===(r=e.classification)||void 0===r?void 0:r.id,s.values.parentIds]),l.useEffect((function(){s.values.backboneClassificationIds.length&&!s.touched.backboneClassificationIds&&s.setFieldTouched("backboneClassificationIds",!0)}),[s.values.backboneClassificationIds]);var y=function(e){return s.setFieldValue("parentIds",Hp.a.addOrRemove(s.values.parentIds.map((function(e){return e.toString()})),e.id.toString()))},v=function(e){return s.setFieldValue("backboneClassificationIds",Hp.a.addOrRemove(s.values.backboneClassificationIds.map((function(e){return e.toString()})),e.id.toString()))},b=function(e){return"".concat(Li(s.errors,s.touched,e)," h-auto py-2")},g=td(e.currentUser);return l.createElement(bi,null,l.createElement(as,{label:"Name",name:"name",id:"name",value:s.values.name,placeholder:"Enter a name for this classification",autoFocus:!0}),l.createElement(as,{as:"select",label:"Type",name:"type",id:"type",value:s.values.type},wi.a.getEnumKeys(yy).map((function(e){return l.createElement("option",{key:e,value:yy[e]},e)}))),l.createElement(as,{as:"select",label:"Status",name:"status",id:"status",value:s.values.status,disabled:f},wi.a.getEnumKeys(vy).map((function(e){return l.createElement("option",{key:e,value:vy[e]},e)}))),l.createElement(as,{label:"Emphasize",name:"emphasize",id:"emphasize",type:"checkbox",checked:s.values.emphasize}),l.createElement(as,{label:"Can Be Preferred",name:"canBePreferred",id:"canBePreferred",type:"checkbox",checked:s.values.canBePreferred}),!f&&l.createElement(l.Fragment,null,l.createElement("label",null,"Total Followers:")," ",null===(o=e.classification.followers)||void 0===o?void 0:o.count),l.createElement(as,{name:"parentIds"},(function(){var t,n,r;return l.createElement("div",{className:b("parentIds")},l.createElement(sf,{label:"Parent Classification(s)",tree:e.classificationTree,selectedIds:s.values.parentIds,onSelect:y,collapse:m,noSelectionMessage:"No parent selected, this will be a root classification.",isNodeDisabled:(n=e.classificationTree,r=null===(t=e.classification)||void 0===t?void 0:t.id,function(e){if(e.id===r)return!0;var t=$l.find(n,r);return!!$l.find(t,e.id)})}))})),l.createElement(as,{name:"backboneClassificationIds"},(function(){return l.createElement("div",{className:b("backboneClassificationIds")},l.createElement(sf,{label:"Mapped Subject(s)",tree:e.subjectTree,selectedIds:s.values.backboneClassificationIds,onSelect:v,collapse:!f,getSelectedItemAppLink:ib}))})),l.createElement(Sl,{imageType:Mu.Covers,fieldName:"cover",application:c.SUBJECTS,uploadAction:i.Subjects.UPLOAD_IMAGE}),l.createElement(Sl,{imageType:Mu.Banners,fieldName:"banner",application:c.SUBJECTS,uploadAction:i.Subjects.UPLOAD_IMAGE}),l.createElement(Sl,{imageType:Mu.TallPosters,fieldName:"tallPoster",application:c.SUBJECTS,uploadAction:i.Subjects.UPLOAD_IMAGE}),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(Pf,{showSpinner:s.isSubmitting,type:"submit",disabled:!u},f?"Create":"Save"),!f&&g&&l.createElement(Ii.Button,{as:Pu,variant:"danger",appLink:{application:c.SUBJECTS,action:i.Subjects.DELETE_CLASSIFICATION,args:[e.presentationId,null===(a=e.classification)||void 0===a?void 0:a.id]}},"Delete")))}function ab(e){return l.createElement(ji,{initialValues:e.classification,validationSchema:gy,onSubmit:e.saveClassification},l.createElement(ob,{presentationId:e.presentationId,classificationTree:e.classificationTree,subjectTree:e.subjectTree,classification:e.classification,currentUser:e.currentUser}))}var cb=function(e){return function(t){if(!e)return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION;switch(e){case uy.Playlists:return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;case uy.Series:return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION_SERIES;case uy.Videos:return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION_VIDEOS}}};function sb(e){var t=e.presentation,n=e.classificationId,r=e.memberType;return t?l.createElement(l.Fragment,null,l.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:jy(t.id,n),isItemActive:cb(r)}))):l.createElement(l.Fragment,null)}function ub(e){var t=si(),n=us(t),r=function(e){return t.setFieldValue("classificationIds",Hp.a.addOrRemove(t.values.classificationIds.map((function(e){return e.toString()})),e.id.toString()))},o="".concat(Li(t.errors,t.touched,"classificationIds")," h-auto py-2");return l.createElement(bi,null,l.createElement(as,{name:"classificationIds"},(function(){return l.createElement("div",{className:o},l.createElement(sf,{label:"Mapped Classification(s)",tree:e.classificationTree,selectedIds:t.values.classificationIds,onSelect:r,getSelectedItemAppLink:(n=e.presentationId,function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[n,e]}}),isNodeDisabled:e.isClassificationDisabled}));var n})),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(Pf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Classifications")))}function lb(e){return l.createElement(ji,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.classificationIds;return e.saveClassifications(r,n)},enableReinitialize:!0},l.createElement(ub,{presentationId:e.presentationId,classificationTree:e.classificationTree,isClassificationDisabled:e.isClassificationDisabled}))}function fb(e){var t=null===e.id||void 0===e.id,n=si(),r=us(n);return l.createElement(bi,null,l.createElement(as,{label:"Name",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this level",autoFocus:!0}),l.createElement(Pf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"))}function pb(e){return l.createElement(ji,{initialValues:e.level,validationSchema:Sy,onSubmit:e.saveLevel},l.createElement(fb,{id:e.level&&e.level.id}))}function db(e){var t=Cy.singularizeMemberType(e.memberType),n=si(),r=us(n);return l.createElement(bi,null,l.createElement(as,{label:"Backbone Audience(s)",as:"select",name:"backboneAudienceIds",id:"level-ids",multiple:!0,size:e.levels.length,value:n.values.backboneAudienceIds},e.levels.map((function(e){return l.createElement("option",{key:e.id,value:e.id},e.name)}))),l.createElement("p",null,l.createElement("strong",null,"Note:")," When removing a ".concat(t," from a backbone audience, that backbone audience's mapped audiences "),l.createElement("strong",null,"will not")," be automatically removed from."),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(Pf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},"Save Backbone Audience")))}function mb(e){return l.createElement(ji,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.backboneAudienceIds;return e.saveLevels(r,!1,n)}},l.createElement(db,{levels:e.levels,memberType:e.memberType}))}var hb=function(e){return function(t){return t.appLink.action===e}};function yb(e){var t=e.levelId,n=e.activeAction,r=e.presentationId;return l.createElement(l.Fragment,null,l.createElement(Ii.Alert,{variant:"danger"},"Warning: You are editing the backbone audiences."),l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:Ty(t,r),isItemActive:hb(n)})))}var vb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function bb(e){return l.createElement(l.Fragment,null,e.audiences.map((function(t){return l.createElement("th",{key:t.masterId},l.createElement("span",{className:"d-inline-block"},l.createElement(Bu,{selected:e.getIsAudienceSelected(t),onToggle:function(n){return e.onToggleAudience(t.masterId,n)}})),l.createElement(Pu,{appLink:e.getAudienceAppLink(t.masterId)},function(e,t){return t?e.name:"Audience: ".concat(e.name)}(t,e.showAudienceSubHeader)))})))}function gb(e){var t=e.memberType,n=e.hasActions,r=e.audiences,i=vb(e,["memberType","hasActions","audiences"]),o="".concat(zl(Iy.singularizeMemberType(t))," Name"),a=!!r&&!!r.length,c=a&&r.length>1,s=a?2:1,u=Object.assign({audiences:r,showAudienceSubHeader:c},i);return l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{rowSpan:s},o),a&&(c?l.createElement("th",{colSpan:r.length,className:"text-center"},"Audiences"):l.createElement(bb,Object.assign({},u))),n&&l.createElement("th",{rowSpan:s})),a&&c&&l.createElement("tr",null,l.createElement(bb,Object.assign({},u))))}function Sb(e){var t=e.member,n=t.id,r=t.name,i=t.audiences,o=void 0===i?[]:i,a=e.getMemberAppLink,c=e.onToggleAudience,s=e.actions,u=h(a)&&a(n);return o.length&&!h(c)&&p.ErrorHelper.throw(new ys.a("onToggleAudience must be passed to LevelMemberItem")),l.createElement("tr",null,l.createElement("td",null,u?l.createElement(Pu,{appLink:a(n)},r):r),!!o.length&&o.map((function(e){return l.createElement("td",{key:e.id},l.createElement(Bu,{selected:e.selected,onToggle:function(t){return c(e.id,t,n)}}))})),s&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(Dl,{actions:s}))))}var Eb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Ob(e,t){return function(n){var r=n[e],i=df.length(r);return!!i&&i===t.length}}function Cb(e){var t=e.members,n=e.memberType,r=e.getActions,i=e.audiences,o=e.getAudienceAppLink,a=e.onToggleAudience,c=Eb(e,["members","memberType","getActions","audiences","getAudienceAppLink","onToggleAudience"]);if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this level."));var s=h(r),u={memberType:n,audiences:i,getAudienceAppLink:o,getIsAudienceSelected:Ob(n,t),onToggleAudience:a,hasActions:s};return l.createElement(Ii.Table,{responsive:!0,bordered:!0},l.createElement(gb,Object.assign({},u)),l.createElement("tbody",null,t.map((function(e,t){return l.createElement(Sb,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleAudience:a},c))}))))}function wb(e){var t=si();return l.createElement(bi,null,l.createElement(as,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this presentation",autoFocus:!0}),l.createElement(as,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this presentation here"}),l.createElement(as,{as:"select",label:"Status",name:"status",id:"status",value:t.values.status,disabled:e.isNew},wi.a.getEnumKeys(Qp).map((function(e){return l.createElement("option",{key:e,value:Qp[e]},e)}))),l.createElement("div",{className:"btn-container d-flex justify-content-end"},l.createElement(Is,{isNew:e.isNew})))}function Ab(e){var t;return l.createElement(ji,{initialValues:e.presentation,validationSchema:Ey,onSubmit:e.savePresentation},l.createElement(wb,{isNew:!(null===(t=e.presentation)||void 0===t?void 0:t.id)}))}function jb(e){var t=e.presentations,n=e.currentPresentationId,r=e.setCurrentPresentation,i=e.label,o=function(e){var n=function(e,t){return Hp.a.first(t.filter((function(t){return t.id.toString()===e.toString()})))}(e,t);r(n)};return l.useEffect((function(){t&&!n&&r(Hp.a.first(t))}),[t]),l.createElement(l.Fragment,null,!!n&&l.createElement(l.Fragment,null,l.createElement(Ii.Form.Label,null,i),l.createElement(Ii.Form.Control,{as:"select",value:n,onChange:function(e){return o(e.target.value)},className:"cursor-pointer"},t.map((function(e){return l.createElement("option",{value:e.id,key:e.id},e.name)})))))}function Tb(e){return l.createElement(l.Fragment,null,l.createElement("h4",null,"".concat(zl(e.memberType))),l.createElement(Ii.Table,{responsive:!0},l.createElement("tbody",null,e.objects&&e.objects.map((function(t){return l.createElement("tr",{key:t.id},l.createElement("td",null,l.createElement(Pu,{appLink:Cy.getMemberAppLink(e.memberType,t.id)},t.name)))})))),l.createElement(Fb,{initialValues:{backboneClassificationIds:[]},subjectTree:e.subjectTree,saveSubjects:e.onClickAddToSubject,memberType:e.memberType,saveBtnText:"Add to backbone classification",subjectRequired:!0}))}function kb(e){return function(e){if(Array.isArray(e))return Ib(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ib(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ib(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ib(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lb(e){var t=Cy.singularizeMemberType(e.memberType),n=[].concat(kb(e.objectClassifications),kb(e.objectSubjectClassifications)).map((function(e){return e.id}));return l.createElement(l.Fragment,null,l.createElement("div",{className:"border-bottom pb-3 mb-3"},l.createElement("h6",null,"Backbone Classifications"),l.createElement("p",null,"Select which backbone classifications this ".concat(t," is mapped to.")),l.createElement(Fb,{initialValues:{backboneClassificationIds:e.objectSubjects.map((function(e){return e.id}))},subjectTree:e.subjectTree,saveSubjects:e.saveSubjects,memberType:e.memberType,saveBtnText:"Save Backbone Classifications",allowMultiple:!0})),l.createElement("h6",null,"Classifications"),l.createElement("p",null,"Select a presentation to view its classifications and map them to this ".concat(t,".")),l.createElement("div",{className:"w-50 pb-3"},l.createElement(jb,{presentations:e.presentations,currentPresentationId:e.currentPresentation.id,setCurrentPresentation:e.setCurrentPresentation})),e.currentPresentation&&e.classificationTree&&e.classificationTree.children.length?l.createElement(l.Fragment,null,l.createElement("p",null,"Only classifications which are mapped to one of the backbone classifications selected above can be selected."),l.createElement(lb,{initialValues:{classificationIds:e.objectClassifications.map((function(e){return e.id}))},presentationId:e.currentPresentation.id,classificationTree:e.classificationTree,saveClassifications:e.saveClassifications,isClassificationDisabled:function(e){return!n.includes(e.id)}})):l.createElement("p",null,"This presentation has no classifications."))}function _b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}jb.defaultProps={label:"Presentation"};function xb(e){var t=!e.id,n=si(),r=us(n),o=!t||!!n.values.parentId,a=_b(l.useState(o),2),s=a[0],u=a[1];l.useEffect((function(){return u(o)}),[e.id,n.values.parentId]);var f=function(e){var t=e.id===n.values.parentId?null:e.id;n.setFieldValue("parentId",t)},p="".concat(Li(n.errors,n.touched,"parentId")," h-auto py-2");return l.createElement(bi,null,l.createElement(as,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this backbone classification",autoFocus:!0}),l.createElement(as,{name:"parentId"},(function(){return l.createElement("div",{className:p},l.createElement(sf,{label:"Parent Backbone Classification",tree:e.subjectTree,selectedIds:[n.values.parentId],onSelect:f,collapse:s,noSelectionMessage:"No parent selected, this will be a root backbone classification.",isNodeDisabled:(t=e.subjectTree,r=e.id,function(e){if(e.id===r)return!0;var n=$l.find(t,r);return!!$l.find(n,e.id)})}));var t,r})),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(Pf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&l.createElement(Ii.Button,{as:Pu,variant:"danger",appLink:{application:c.SUBJECTS,action:i.Subjects.DELETE_SUBJECT,args:[e.id]}},"Delete")))}function Nb(e){return l.createElement(ji,{initialValues:e.subject,validationSchema:Oy,onSubmit:e.saveSubject},l.createElement(xb,{id:e.subject&&e.subject.id,subjectTree:e.subjectTree}))}var Rb=function(e){return function(t){return t.appLink.action===e}};function Db(e){var t=e.subjectId,n=e.activeAction,r=e.presentationId;return l.createElement(l.Fragment,null,l.createElement(Ii.Alert,{variant:"danger"},"Warning: You are editing the backbone classifications."),l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:Ay(t,r),isItemActive:Rb(n)})))}var Mb=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[e]}};function Ub(e){var t=si(),n=us(t),r=function(n){var r=e.allowMultiple?Hp.a.addOrRemove(t.values.backboneClassificationIds.map((function(e){return e.toString()})),n.id.toString()):[n.id];t.setFieldValue("backboneClassificationIds",r)},i="".concat(Li(t.errors,t.touched,"backboneClassificationIds")," h-auto py-2");return l.createElement(bi,null,l.createElement(as,{name:"backboneClassificationIds"},(function(){return l.createElement("div",{className:i},l.createElement(sf,{label:"Mapped Backbone Classification".concat(e.allowMultiple?"(s)":""),tree:e.subjectTree,selectedIds:t.values.backboneClassificationIds,onSelect:r,collapse:!!t.initialValues.backboneClassificationIds.length,getSelectedItemAppLink:Mb}))})),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(Pf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.saveBtnText)))}function Fb(e){var t;return l.createElement(ji,{initialValues:e.initialValues,validationSchema:(t=e.subjectRequired,Ti.object().shape({backboneClassificationIds:t?Ti.array().of(Ti.string()).min(1,"A subject is required").required("A subject is required"):Ti.array().of(Ti.string())}).noUnknown()),onSubmit:function(t,n){var r=t.backboneClassificationIds;return e.saveSubjects(r,!1,n)}},l.createElement(Ub,{subjectTree:e.subjectTree,memberType:e.memberType,allowMultiple:e.allowMultiple,saveBtnText:e.saveBtnText}))}Ub.defaultProps={saveBtnText:"Save"};var Vb=function(e){return l.createElement("div",{className:"border rounded p-2 mb-3"},l.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.classifications&&e.classifications.length?l.createElement("ul",{className:"list-unstyled mb-0"},e.classifications.map((function(t){return l.createElement("li",{key:t.id,className:"py-1"},l.createElement(Pu,{appLink:(n=e.presentation.id,r=t.id,{application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[n,r]})},t.name));var n,r}))):l.createElement("p",null,l.createElement("em",null,"There are no classifications mapped to this backbone classification in this presentation.")))},Bb=function(e){return l.createElement(l.Fragment,null,!!e.presentations&&!!e.classificationDictionary&&e.presentations.map((function(t){return l.createElement(Vb,{key:t.id,presentation:t,classifications:e.classificationDictionary[t.id]})})))},Hb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function zb(e){return l.createElement(l.Fragment,null,e.classifications.map((function(t){return l.createElement("th",{key:t.id},l.createElement("span",{className:"d-inline-block"},l.createElement(Bu,{selected:e.getIsClassificationSelected(t),onToggle:function(n){return e.onToggleClassification(t.id,n)}})),l.createElement(Pu,{appLink:e.getClassificationAppLink(t.id)},function(e,t){return t?e.name:"Classification: ".concat(e.name)}(t,e.showClassificationSubHeader)))})))}function qb(e){var t=e.memberType,n=e.hasActions,r=e.classifications,i=Hb(e,["memberType","hasActions","classifications"]),o="".concat(zl(Cy.singularizeMemberType(t))," Name"),a=!!r&&!!r.length,c=a&&r.length>1,s=a?2:1,u=Object.assign({classifications:r,showClassificationSubHeader:c},i);return l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{rowSpan:s},o),a&&(c?l.createElement("th",{colSpan:r.length,className:"text-center"},"Classifications"):l.createElement(zb,Object.assign({},u))),n&&l.createElement("th",{rowSpan:s})),a&&c&&l.createElement("tr",null,l.createElement(zb,Object.assign({},u))))}function Jb(e){var t=e.member,n=t.id,r=t.name,i=t.classifications,o=void 0===i?[]:i,a=e.getMemberAppLink,c=e.onToggleClassification,s=e.actions,u=h(a)&&a(n);return o.length&&!h(c)&&p.ErrorHelper.throw(new ys.a("onToggleClassification must be passed to SubjectMemberItem")),l.createElement("tr",null,l.createElement("td",null,u?l.createElement(Pu,{appLink:a(n)},r):r),!!o.length&&o.map((function(e){return l.createElement("td",{key:e.id},l.createElement(Bu,{selected:e.selected,onToggle:function(t){return c(e.id,t,n)}}))})),s&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(Dl,{actions:s}))))}var $b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Kb(e,t){return function(n){var r=n[e],i=df.length(r);return!!i&&i===t.length}}function Wb(e){var t=e.members,n=e.memberType,r=e.getActions,i=e.classifications,o=e.getClassificationAppLink,a=e.onToggleClassification,c=$b(e,["members","memberType","getActions","classifications","getClassificationAppLink","onToggleClassification"]);if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this backbone classification."));var s=h(r),u={memberType:n,classifications:i,getClassificationAppLink:o,getIsClassificationSelected:Kb(n,t),onToggleClassification:a,hasActions:s};return l.createElement(Ii.Table,{responsive:!0,bordered:!0},l.createElement(qb,Object.assign({},u)),l.createElement("tbody",null,t.map((function(e,t){return l.createElement(Jb,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleClassification:a},c))}))))}function Yb(e){var t=e.navItems,n=e.currentAppLink;return l.createElement(Ii.Container,null,l.createElement(Ii.Navbar,{className:"justify-content-between align-items-center"},l.createElement(Ii.Nav,null,!!t&&t.map((function(e,t){return l.createElement(Ii.Nav.Item,{key:t},l.createElement(Pu,{appLink:e.appLink,className:"nav-link".concat(Vl.isItemActive(e,n)?" text-primary":"")},e.label))})))))}function Gb(e,t){l.useEffect((function(){e.presentations&&!e.currentPresentation&&Qh(t,"currentPresentation")(Hp.a.first(e.presentations))}),[e.presentations])}function Zb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xb(e){var t=ce.useBasicFetch(bh(e.playlistId)),n=ce.useBasicFetch(Bp()),r=Zb(l.useState({}),2),o=r[0],a=r[1],c=mp(u.SUBJECT);!function(e,t,n){var r=function(e){return Qh(n,e)};$h([Nv.getObjectLevelsFetchOptions(e,uy.Playlists,r("playlistLevels"))],[e]),Zh(Nv.getObjectAudiencesFetchOptions(e,uy.Playlists,r("playlistAudiences")),[e,t.playlistLevels]),$h([Nv.getPresentationsFetchOptions(r("presentations")),Nv.getLevelsFetchOptions(r("levels"))],[]),Zh(!!t.currentPresentation&&Nv.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.playlistId,o,a),Gb(o,a);var s=!!(o.presentations&&o.levels&&o.presentationAudiences&&o.playlistLevels&&o.playlistAudiences);return l.createElement(l.Fragment,null,!!n.data&&l.createElement(Uh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_AUDIENCES,currentUser:n.data}),l.createElement(Ml,{object:t.data}),!!s&&l.createElement(zv,{objectLevels:o.playlistLevels,objectAudiences:o.playlistAudiences,presentations:o.presentations,currentPresentation:o.currentPresentation,setCurrentPresentation:Qh(a,"currentPresentation"),levels:o.levels,presentationAudiences:o.presentationAudiences,memberType:uy.Playlists,saveLevels:function(t,n,r){return c.updateObjectLevels(e.playlistId,t,uy.Playlists,n,r,r)},saveAudiences:function(t,n){return c.updateObjectAudiences(e.playlistId,o.currentPresentation.id,t,uy.Playlists,n,n)}}))}function eg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||ng(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tg(e){return function(e){if(Array.isArray(e))return rg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||ng(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ng(e,t){if(e){if("string"==typeof e)return rg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rg(e,t):void 0}}function rg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ig(e){var t=ce.useBasicFetch(bh(e.playlistId)),n=ce.useBasicFetch(Bp()),r=eg(l.useState({}),2),o=r[0],a=r[1],c=mp(u.SUBJECT);!function(e,t,n){var r=function(e){return Qh(n,e)};$h([Nv.getSubjectTreeFetchOptions(r("subjectTree")),Nv.getPresentationsFetchOptions(r("presentations"))],[]),$h([Nv.getObjectSubjectsFetchOptions(e,uy.Playlists,r("playlistSubjects"))],[e]),Zh(!!t.currentPresentation&&Nv.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),l.useEffect((function(){return r("subjectClassifications")([])}),[t.playlistSubjects]);var i=function(e,t){return[].concat(tg(t.subjectClassifications||[]),tg(e))},o=t.playlistSubjects&&t.playlistSubjects.map((function(e){return Nv.getSubjectClassificationFetchOptions(e.id,Qh(n,"subjectClassifications",i))}));$h(o,[t.playlistSubjects],!!o),Zh(Nv.getObjectClassificationsFetchOptions(e,uy.Playlists,r("playlistClassifications")),[e,t.playlistSubjects])}(e.playlistId,o,a),Gb(o,a);var s=!!(o.playlistSubjects&&o.subjectTree&&o.presentations&&o.classificationTree&&o.playlistClassifications&&o.subjectClassifications);return l.createElement(l.Fragment,null,!!n.data&&l.createElement(Uh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_SUBJECTS,currentUser:n.data}),l.createElement(Ml,{object:t.data}),s&&l.createElement(Lb,{objectSubjects:o.playlistSubjects,subjectTree:o.subjectTree,memberType:uy.Playlists,presentations:o.presentations,currentPresentation:o.currentPresentation,setCurrentPresentation:Qh(a,"currentPresentation"),objectClassifications:o.playlistClassifications,objectSubjectClassifications:o.subjectClassifications,classificationTree:o.classificationTree,saveSubjects:function(t,n,r){return c.updateObjectSubjects(e.playlistId,t,uy.Playlists,n,r,r)},saveClassifications:function(t,n){return c.updateObjectClassifications(e.playlistId,o.currentPresentation.id,t,uy.Playlists,n,n)}}))}var og=function(e,t,n){if(t===n)return{reorderedItems:e,reorderRequest:null};var r=Hp.a.moveItem(e,t,n),i=n<e.length-1?r[n+1].id:null;return{reorderedItems:r,reorderRequest:{sourceMemberId:r[n].id,destinationMemberId:i}}};function ag(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return cg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ug(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ug(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ug(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var lg=function(e){return{application:c.VIDEOS,action:i.Videos.EDIT_VIDEO,args:[e.id]}};function fg(e){var t,n,r,o,a,s,u=Object(b.useDispatch)(),f=jp(),p=ce.useBasicFetch(bh(e.playlistId)),d=ce.useBasicFetch(Ch(e.playlistId)),m=ce.useBasicFetch(Bp()),h=sg((n=null===(t=d.data)||void 0===t?void 0:t.data,r=ag(Object(l.useState)(),2),o=r[0],a=r[1],Object(l.useEffect)((function(){o&&(n.length!==o.length||function(e,t){var n=!0;if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r].id!==t[r].id){n=!1;break}return n}(n,o))&&a(null)}),[n]),[o,a]),2),y=h[0],v=h[1],g=y?{data:y,pagination:null}:d.data;return l.createElement(l.Fragment,null,!!m.data&&l.createElement(Uh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_VIDEOS,currentUser:m.data}),l.createElement(Ml,{object:p.data}),!!g&&l.createElement(jf,{onSortEnd:function(t,n){if(t!==n){var r=og(d.data.data,t,n),i=r.reorderRequest,o=r.reorderedItems;v(o);ce.fetch(u,wh(e.playlistId,i,null,(function(){f.error("Failed to update playlist order."),v(null)})))}},videos:g,getVideoAppLink:lg,getVideoActions:(s=e.playlistId,function(e){return[{label:"Remove video",appLink:{application:c.PLAYLISTS,action:i.Playlists.REMOVE_VIDEO,args:[s.toString(),e.id.toString()]},className:"text-danger"}]}),emptyMessage:"There are no videos in this playlist."}))}function pg(){var e=Object(b.useDispatch)(),t=jp();return l.createElement(Mh,{savePlaylist:function(n,r){ce.fetch(e,Sh(n,(function(e){t.success("Successfully created playlist."),function(e){e&&e.id&&p.AppLinkHelper.trigger({application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]})}(e)}),(function(){t.error("Failed to create playlist.")}),r))}})}var dg="rating,thumbnail,glance,herobanner,tags",mg=function(e){return{url:"/api/master/v2/objects/".concat(e,"?query=").concat(dg),key:"videos:".concat(e)}},hg=function(e){var t=e.slice().sort();return{key:"videos:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},yg=function(e){return{url:"/ajax/hostedlibraries/rightsline/programs/".concat(e),key:"rightsline:videos:".concat(e),normalizeOptions:{namespace:"rightsline"}}},vg=function(e,t,n,r,i){return{key:"videos:".concat(e),url:"/api/master/v2/objects/".concat(e),data:t,type:se.a.PUT,success:n,error:r,always:i}};function bg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sg(e){var t=Object(b.useDispatch)(),n=jp(),r=ce.useBasicFetch(bh(e.playlistId)),i=ce.useBasicFetch(mg(e.videoId)),o=bg(l.useState(!1),2),a=o[0],c=o[1];var s=!!r.data&&!!i.data;return l.createElement(kp,{title:"Remove Video",closePopup:e.closePopup,showLoadingSpinner:!s},!!s&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,i.data.name)," from ",l.createElement("strong",null,r.data.name),"?")),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),ce.fetch(t,Ah(e.playlistId,e.videoId,(function(){n.success("Successfully removed video from playlist")}),(function(){n.error("Failed to remove video from playlist")}),e.closePopup))},buttonText:"Yes, remove video",isSpinnerButton:!0,showSpinner:a}]})))}function Eg(e){return p.AppLinkHelper.trigger(function(e){return{application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]}}(e))}function Og(e){var t=e?{application:c.PLAYLISTS,action:i.Playlists.SEARCH_PLAYLISTS,params:{query:e}}:{application:c.PLAYLISTS,action:i.Playlists.PLAYLISTS};p.AppLinkHelper.trigger(t)}function Cg(e){return l.createElement("div",{className:"pb-3 w-50"},l.createElement(lu,{initialQuery:e.query,placeholder:"Search for a playlist",onSuggestionSelected:Eg,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/playlists/instant/raw","?query=").concat(e)},activationLength:2,onSubmit:Og}))}var wg=c.PLAYLISTS,Ag=function(e){return{application:wg,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]}};function jg(e){var t=ce.useBasicFetch(yh(e.cursor));return l.createElement(l.Fragment,null,l.createElement(Cg,null),l.createElement(jl,{collection:t.data,columns:[{header:"Name",accessor:"name",appLink:Ag},{header:"Internal Description",accessor:function(e){var t;return null===(t=e.metadata)||void 0===t?void 0:t.internalDescription}}],collectionAppLink:{application:wg,action:i.Playlists.PLAYLISTS},newObjectAppLink:{application:wg,action:i.Playlists.NEW_PLAYLIST},objectName:"Playlist"}))}var Tg=c.PLAYLISTS,kg=function(e){return{application:Tg,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]}};function Ig(e){var t,n,r=ce.useBasicFetch(vh(e.query,e.cursor)),o=ce.useBasicFetch(!!(null===(n=null===(t=r.data)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)&&jh(r.data.data.map((function(e){return e.id})))),a=o.isComplete&&function(e,t){var n,r;return(null==t?void 0:t.length)?Object.assign(Object.assign({},e),{data:null!==(r=null===(n=e.data)||void 0===n?void 0:n.map((function(e){return Object.assign(Object.assign({},e),{metadata:t.find((function(t){return t.playlistId.toString()===e.id.toString()}))})})))&&void 0!==r?r:[]}):e}(r.data,o.data);return l.createElement(l.Fragment,null,l.createElement(Cg,{query:e.query}),!!r.data&&(r.data.data.length?l.createElement(jl,{collection:a,columns:[{header:"Name",accessor:"name",appLink:kg},{header:"Internal Description",accessor:function(e){var t;return null===(t=e.metadata)||void 0===t?void 0:t.internalDescription}}],collectionAppLink:{application:Tg,action:i.Playlists.SEARCH_PLAYLISTS,params:{query:e.query}},newObjectAppLink:{application:Tg,action:i.Playlists.NEW_PLAYLIST},objectName:"Playlist"}):l.createElement("p",null,"No playlists found, please try a different search query.")))}function Lg(e){return{application:c.PLAYLISTS,action:i.Playlists.DASHBOARD,args:[e.dashboardId]}}function _g(e){return[{label:"Remove playlist from dashboard",appLink:{application:c.PLAYLISTS,action:i.Playlists.DELETE_DASHBOARD_WIDGET,args:[e.dashboardId,e.id]},className:"text-danger"}]}function Pg(e){var t=ce.useBasicFetch(bh(e.playlistId)),n=ce.useBasicFetch(Ih(e.playlistId)),r=ce.useBasicFetch(Bp());return f.a.createElement(f.a.Fragment,null,!!r.data&&f.a.createElement(Uh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_DASHBOARDS,currentUser:r.data}),f.a.createElement(Ml,{object:t.data}),!!n.data&&(n.data.length?f.a.createElement(Al,{objects:n.data,columns:[{header:"Dashboard",accessor:function(e){var t;return null===(t=e.dashboard)||void 0===t?void 0:t.name},appLink:Lg},{accessor:function(e){return f.a.createElement("span",{className:"d-flex justify-content-end"},f.a.createElement(Dl,{actions:_g(e)}))}}]}):f.a.createElement("p",null,"This playlist isn't in any dashboards.")))}function xg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ng(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ng(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ng(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rg(e){var t=xg(f.a.useState(!1),2),n=t[0],r=t[1],i=Object(b.useDispatch)(),o=jp(),a=ce.useBasicFetch(kh(e.dashboardId,e.widgetId)),c=ce.useBasicFetch(Th(e.dashboardId)),s=ce.useBasicFetch(!!a.data&&bh(a.data.collectionId)),u=!!a.data&&!!c.data&&!!s.data;return f.a.createElement(kp,{title:"Remove playlist from dashboard",closePopup:e.closePopup,showLoadingSpinner:!u},!!u&&f.a.createElement(f.a.Fragment,null,f.a.createElement("div",null,f.a.createElement("p",null,"Are you sure you want to remove ",f.a.createElement("strong",null,s.data.name)," from ",f.a.createElement("strong",null,c.data.name),"?"),f.a.createElement("p",null,f.a.createElement("em",null,"Note: This is the same as deleting the widget from the dashboard."))),f.a.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){r(!0),ce.fetch(i,Lh(c.data.id,a.data.id,s.data.id,(function(){o.success("Successfully removed playlist from dashboard")}),(function(){o.error("Failed to remove playlist from dashboard")}),e.closePopup))},buttonText:"Yes, remove playlist",isSpinnerButton:!0,showSpinner:n}]})))}function Dg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Mg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ug=function(e,t,n){return[{variant:"link",onClick:t,buttonText:"Cancel"},{variant:"danger",onClick:e,buttonText:"Yes, delete this audience",isSpinnerButton:!0,showSpinner:n}]};function Fg(e){var t=e.id,n=e.routeToOnDelete,r=e.closePopup,i=Dg(l.useState(),2),o=i[0],a=i[1],c=Dg(l.useState(!1),2),s=c[0],f=c[1],d=mp(u.SUBJECT);Zh(Nv.getAudienceFetchOptions(t,a),[t]);return l.createElement(kp,{title:"Delete Audience",closePopup:r,showLoadingSpinner:!o},!!o&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,o.name),"?")),l.createElement(Lp,{buttons:Ug((function(){f(!0);d.deleteAudience(t,(function(){r(),n&&p.AppLinkHelper.trigger(n)}),r)}),r,s)})))}function Vg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Bg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hg(e){var t=e.presentationId,n=e.audienceId,r=Vg(l.useState(),2),i=r[0],o=r[1],a=Vg(l.useState(),2),c=a[0],s=a[1],f=Vg(l.useState(),2),p=f[0],d=f[1],m=mp(u.SUBJECT);Zh(Nv.getAudienceFetchOptions(n,o),[n]),Zh(Nv.getLevelsFetchOptions(s),[]),Zh(Nv.getPresentationFetchOptions(t,d),[t]);return l.createElement(l.Fragment,null,l.createElement(Kv,{presentation:p,audienceId:n}),!!p&&l.createElement("h6",null,"Presentation: ".concat(p.name)),!!i&&!!c&&l.createElement(Bv,{audience:i,levels:c,saveAudience:function(e,r){return m.updateAudience(n,Object.assign(Object.assign({},e),{presentationId:t}),r,r)},presentationId:t}))}function zg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Jg=function(e){return{application:c.SUBJECTS,action:i.Subjects.PRESENTATION_AUDIENCES,args:[e]}};function $g(e){var t=e.presentationId,n=zg(l.useState(),2),r=n[0],o=n[1],a=zg(l.useState(),2),s=a[0],f=a[1],d=mp(u.SUBJECT);Zh(Nv.getLevelsFetchOptions(o),[]),Zh(Nv.getPresentationFetchOptions(t,f),[t]);return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-2"},l.createElement(xu,{appLink:Jg(t),backToName:"audiences"})),!!s&&l.createElement("h6",null,"Presentation: ".concat(s.name)),!!r&&l.createElement(Bv,{levels:r,presentationId:t,saveAudience:function(e,n){return d.createAudience(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]})}}(t,n),n)}}))}var Kg=n(215),Wg=n.n(Kg);function Yg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zg(e){var t=e.presentationId,n=e.selectedAudienceId,r=Yg(l.useState(),2),o=r[0],a=r[1];Zh(Nv.getAudiencesFetchOptions(t,a),[]);var s=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[t,e.masterId]}},u={application:c.SUBJECTS,action:i.Subjects.NEW_AUDIENCE,args:[t]};return l.createElement("div",{className:"".concat(Wg.a.navContainer," h-auto pr-2 border-right")},l.createElement("h5",{className:"border-bottom pb-2"},"Audiences"),l.createElement(Pu,{appLink:u,className:"d-inline-block pb-2"},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New Audience")),l.createElement("div",{className:"border-top pt-1"},l.createElement("ul",{className:"list-unstyled"},o&&o.map((function(e){return l.createElement("li",{className:"position-relative py-1"},l.createElement(Pu,{className:(null==n?void 0:n.toString())===e.masterId.toString()?"text-primary font-weight-500":"",appLink:s(e)},e.name))})))))}function Qg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eS(e){var t=e.presentationId,n=e.audienceId,r=e.memberType,i=Qg(l.useState(),2),o=i[0],a=i[1],c=Qg(l.useState(),2)[1],s=Qg(l.useState(),2),u=s[0],f=s[1];Zh(Nv.getPresentationFetchOptions(t,a),[]),Zh(Nv.getAudienceFetchOptions(n,c),[n]),Zh(Nv.getAudienceMembersFetchOptions(n,r,f),[n,r]);var p={items:u&&u.data,memberType:r,getItemAppLink:function(e){return Iy.getMemberAppLink(r,e.id)},getActions:function(e){return Iy.getMemberActions(n,sy.Audience,r,e.id)}},d={presentation:o,audienceId:n},m=Bl(p);return l.createElement(l.Fragment,null,l.createElement(Kv,Object.assign({},d,{memberType:r})),m&&l.createElement(Yv,Object.assign({},p)))}function tS(e){return{application:c.SUBJECTS,action:i.Subjects.NEW_CLASSIFICATION,args:[e]}}function nS(e,t){var n={label:"Add child",getAppLink:function(t){return Object.assign(Object.assign({},tS(e)),{args:[e],params:{parentId:t.id}})}},r={label:"Delete classification",getAppLink:function(t){return{application:c.SUBJECTS,action:i.Subjects.DELETE_CLASSIFICATION,args:[e,t.id]}},className:"text-danger"};return td(t)?[n,r]:[n]}var rS=n(216),iS=n.n(rS);function oS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return aS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function aS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cS(e){var t=e.presentationId,n=e.selectedClassificationId,r=oS(l.useState(),2),o=r[0],a=r[1],s=oS(l.useState(),2),u=s[0],f=s[1];!function(e,t,n){$h([Nv.getClassificationTreeFetchOptions(e,t),Nv.getPresentationFetchOptions(e,n)],[e])}(t,a,f);var p=ce.useBasicFetch(Bp());return l.createElement("div",{className:"".concat(iS.a.navContainer," h-auto pr-2 border-right")},!!u&&l.createElement("h6",{className:"border-bottom pb-2"},"Classifications (".concat(u.name,")")),l.createElement(Pu,{appLink:tS(t),className:"d-inline-block pb-2"},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New Classification")),!!o&&l.createElement("div",{className:"border-top pt-1"},l.createElement(nf,{tree:o,getAppLink:function(e){return function(e,t){return{application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[e,t.id]}}(t,e)},selectedIds:[n],actions:nS(t,p.data)})))}function sS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lS(e){var t=e.classificationId,n=e.routeToOnDelete,r=e.closePopup,i=sS(l.useState(),2),o=i[0],a=i[1],c=sS(l.useState(!1),2),s=c[0],f=c[1];Zh(Nv.getClassificationFetchOptions(t,a),[]);var d=mp(u.SUBJECT),m=[{variant:"link",onClick:r,buttonText:"Cancel"},{variant:"danger",onClick:function(){f(!0);d.deleteClassification(t,(function(){r(),n&&p.AppLinkHelper.trigger(n)}),r)},buttonText:"Yes, delete this classification",isSpinnerButton:!0,showSpinner:s}];return l.createElement(kp,{title:"Delete Classification",closePopup:r,showLoadingSpinner:!o},!!o&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,o.name),"?")),l.createElement(Lp,{buttons:m})))}function fS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dS(e){var t=e.presentationId,n=e.classificationId,r=fS(l.useState(),2),i=r[0],o=r[1],a=fS(l.useState(),2),c=a[0],s=a[1],f=fS(l.useState(),2),p=f[0],d=f[1],m=fS(l.useState(),2),h=m[0],y=m[1],v=mp(u.SUBJECT),b=Nv.getClassificationFetchOptions(n,o),g=Nv.getPresentationFetchOptions(t,s),S=Nv.getClassificationTreeFetchOptions(t,d),E=Nv.getSubjectTreeFetchOptions(y),O=ce.useBasicFetch(Bp());Zh(E,[]),Zh(b,[n]),$h([g,S],[t]);return l.createElement("div",null,l.createElement(sb,{presentation:c,classificationId:n}),!!i&&!!p&&!!h&&l.createElement(ab,{classification:i,presentationId:t,subjectTree:h,classificationTree:p,saveClassification:function(e,t){var r=Object.assign({pinnedVideoMasterId:(null==i?void 0:i.pinnedVideoMasterId)||null},e);return v.updateClassification(n,r,t,t)},currentUser:O.data}))}function mS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yS(e){var t=e.presentationId,n=e.classificationId,r=e.memberType,i=mS(l.useState(),2),o=i[0],a=i[1],c=mS(l.useState(),2),s=c[0],f=c[1],p=mS(l.useState(),2),d=p[0],m=p[1];Zh(Nv.getPresentationFetchOptions(t,a),[]),Zh(Nv.getClassificationFetchOptions(n,f),[n]),Zh(Nv.getClassificationMembersFetchOptions(n,r,m),[n,r]);var h=mp(u.SUBJECT),y={items:d&&d.data,memberType:r,classification:s,updatePinnedVideo:function(e,t){var r=Object.assign(Object.assign({},s),{pinnedVideoMasterId:e});h.updateClassification(n,r,t)},getItemAppLink:function(e){return Cy.getMemberAppLink(r,e.id)},getActions:function(e){return Cy.getMemberActions(n,sy.Classification,r,e.id)}},v={presentation:o,classificationId:n},b=Bl(y);return l.createElement(l.Fragment,null,l.createElement(sb,Object.assign({},v,{memberType:r})),b&&l.createElement(tb,Object.assign({},y)))}function vS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gS(e){var t=e.presentationId,n=e.parentId,r=vS(l.useState(),2),o=r[0],a=r[1],s=vS(l.useState(),2),f=s[0],d=s[1],m=mp(u.SUBJECT),h=Nv.getClassificationTreeFetchOptions(t,a);Zh(Nv.getSubjectTreeFetchOptions(d),[]),Zh(h,[t]);return l.createElement("div",null,l.createElement("h4",{className:"py-2"},"Create New Classification"),!!f&&!!o&&l.createElement(ab,{classification:n?{parentIds:[n]}:{},presentationId:t,subjectTree:f,classificationTree:o,saveClassification:function(e,n){return m.createClassification(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),n&&n.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]})}}(t,n),n)}}))}var SS=function(e){return{key:"series:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=thumbnail,tallPoster,banner,rating")}},ES=function(e){var t=e.slice().sort();return{key:"series:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},OS=function(e,t,n,r){return{url:"/api/master/v2/series",key:"series",data:e,type:se.a.POST,success:t,error:n,always:r}},CS=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(e),key:"update:series:".concat(e),data:t,type:se.a.PUT,success:n,error:r,always:i}};function wS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return AS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function AS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jS(e){var t=wS(l.useState(),2),n=t[0],r=t[1],i=wS(l.useState(!1),2),o=i[0],a=i[1],c=ce.useBasicFetch(function(e,t){switch(e){case uy.Playlists:return bh(t);case uy.Series:return SS(t);case uy.Videos:return mg(t)}}(e.memberType,e.memberId)),s=mp(u.SUBJECT);Zh(Nv.getClassificationFetchOptions(e.classificationId,r),[e.classificationId]);var f=!!n&&!!c.data,p="Remove ".concat(zl(Cy.singularizeMemberType(e.memberType)));return l.createElement(kp,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"This will not remove it from the backbone subject.")),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){a(!0),s.removeObjectsFromClassification(e.classificationId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup),n.pinnedVideoMasterId===e.memberId&&s.updateClassification(e.classificationId,Object.assign(Object.assign({},n),{pinnedVideoMasterId:null}))},buttonText:"Yes, remove this ".concat(Cy.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:o}]})))}function TS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function IS(e){var t=e.id,n=TS(l.useState(),2),r=n[0],o=n[1],a=mp(u.SUBJECT);Zh(Nv.getLevelFetchOptions(t,o),[t]);return l.createElement(l.Fragment,null,l.createElement(yb,{levelId:t,activeAction:i.Subjects.EDIT_LEVEL}),l.createElement("h4",{className:"py-2"},"Edit Level"),!!r&&l.createElement(pb,{level:r,saveLevel:function(e,n){return a.updateLevel(t,e,n,n)}}))}function LS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _S(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PS(){var e=LS(l.useState(),2),t=e[0],n=e[1];return Zh(Nv.getLevelsFetchOptions(n),[]),l.useEffect((function(){t&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[Hp.a.first(t).id]},{replace:!0})}),[t]),l.createElement(l.Fragment,null)}function xS(){var e=mp(u.SUBJECT);return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Create New Level"),l.createElement(pb,{saveLevel:function(t,n){return e.createLevel(t,function(e){return function(t){e(),t&&t.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[t.id]})}}(n),n)}}))}var NS=n(217),RS=n.n(NS);function DS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return MS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function MS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function US(e){var t=e.selectedLevelId,n=DS(l.useState(),2),r=n[0],o=n[1];Zh(Nv.getLevelsFetchOptions(o),[]);var a=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[e.id]}},s={application:c.SUBJECTS,action:i.Subjects.NEW_LEVEL};return l.createElement("div",{className:"".concat(RS.a.navContainer," h-auto pr-2 border-right")},l.createElement("h5",{className:"border-bottom pb-2"},"Backbone Audiences"),l.createElement(Pu,{appLink:s,className:"d-inline-block pb-2"},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New Backbone Audience")),l.createElement("div",{className:"border-top pt-1"},l.createElement("ul",{className:"list-unstyled"},r&&r.map((function(e){return l.createElement("li",{className:"position-relative py-1"},l.createElement(Pu,{className:(null==t?void 0:t.toString())===e.id.toString()?"text-primary font-weight-500":"",appLink:a(e)},e.name))})))))}var FS=function(e){return l.createElement("div",{className:"border rounded p-2 mb-3"},l.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.audiences&&e.audiences.length?l.createElement("ul",{className:"list-unstyled mb-0"},e.audiences.map((function(t){return l.createElement("li",{key:t.masterId,className:"py-1"},l.createElement(Pu,{appLink:(n=e.presentation.id,r=t.masterId,{application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[n,r]})},t.name));var n,r}))):l.createElement("p",null,l.createElement("em",null,"There are no audiences mapped to this level in this presentation.")))},VS=function(e){return l.createElement(l.Fragment,null,!!e.presentations&&!!e.audienceDictionary&&e.presentations.map((function(t){return l.createElement(FS,{key:t.id,presentation:t,audiences:e.audienceDictionary[t.id]})})))};function BS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return HS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function HS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zS(e){var t=e.levelId,n=BS(l.useState({}),2),r=n[0];return function(e,t){var n=function(e){return Qh(t,e)};Zh(Nv.getLevelAudiencesFetchOptions(e,n("audiences")),[e]),Zh(Nv.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),l.createElement(l.Fragment,null,l.createElement(yb,{levelId:t,activeAction:i.Subjects.LEVEL_AUDIENCES}),l.createElement(VS,{presentations:r.presentations,audienceDictionary:Hp.a.groupBy(r.audiences,"presentationId")}))}function qS(e,t){return Qh(e,t)}function JS(e){switch(e){case ly.Playlists:return i.Subjects.EDIT_LEVEL_PLAYLISTS;case ly.Series:return i.Subjects.EDIT_LEVEL_SERIES;case ly.Videos:return i.Subjects.EDIT_LEVEL_VIDEOS}}function $S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return KS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function KS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function WS(e){var t=$S(l.useState({}),2),n=t[0],r=t[1],o=n.presentations,a=n.audiences,s=n.memberIds,f=n.membersWithAudiences,d=ce.useBasicFetch(Array.isArray(s)&&s.length?function(e,t){switch(e){case ly.Playlists:return gh(t);case ly.Series:return ES(t);case ly.Videos:return hg(t)}}(e.memberType,s):null),m=mp(u.SUBJECT);function h(t){p.AppLinkHelper.trigger({application:c.SUBJECTS,action:e.action,args:[e.levelId],params:{presentationId:t}})}!function(e,t,n){var r=e.presentationId,i=e.levelId,o=e.memberType;Zh(Nv.getPresentationsFetchOptions(qS(n,"presentations")),[]),Zh(Nv.getLevelMemberIdsFetchOptions(i,o,qS(n,"memberIds")),[i,o]),Zh(!!r&&Nv.getLevelAudiencesFetchOptions(i,qS(n,"audiences"),r,o),[i,o,r],!!r)}(e,0,r),function(e,t,n,r){var i=n.audiences;l.useEffect((function(){qS(r,"membersWithAudiences")(function(e,t,n){if(!t||!n)return;return t.map((function(t){return{id:t.id,name:t.name,audiences:n.map((function(n){return{id:n.masterId,selected:(r=t,i=n,!!i[e]&&!!i[e].data.filter((function(e){return e.id===r.id})).length)};var r,i}))}}))}(t.memberType,e,i))}),[e,i])}(d.data,e,n,r),l.useEffect((function(){!e.presentationId&&(null==o?void 0:o.length)&&h(Hp.a.first(o).id)}),[e.presentationId]);var y,v,b=!!e.presentationId&&!!a;return l.createElement(l.Fragment,null,l.createElement(yb,{levelId:e.levelId,presentationId:e.presentationId,activeAction:JS(e.memberType)}),l.createElement(Ii.Alert,{variant:"info",className:"m-0"},"Select which ".concat(e.memberType," are shown for each audience in this level.")+" Change the selected presentation to view different audiences."),l.createElement("div",{className:"w-50 py-2"},!!o&&l.createElement(jb,{presentations:o,currentPresentationId:e.presentationId,setCurrentPresentation:function(e){return h(e.id)}})),b&&l.createElement(Cb,{members:f||[],memberType:e.memberType,getMemberAppLink:function(t){return Iy.getMemberAppLink(e.memberType,t)},getActions:function(t){return Iy.getMemberActions(e.levelId,sy.Level,e.memberType,t)},audiences:a,getAudienceAppLink:e.presentationId&&(y=e.memberType,v=e.presentationId,function(e){var t,n=c.SUBJECTS,r=[v,e];switch(y){case ly.Playlists:t=i.Subjects.EDIT_AUDIENCE_PLAYLISTS;break;case ly.Series:t=i.Subjects.EDIT_AUDIENCE_SERIES;break;case ly.Videos:t=i.Subjects.EDIT_AUDIENCE_VIDEOS}return{application:n,action:t,args:r}}),onToggleAudience:function(t,n,r){return function(e,t,n,r,i,o,a){(a?e.addObjectsToAudience.bind(e):e.removeObjectsFromAudience.bind(e))(o,n,t,r,i)}(m,e.memberType,r?[r]:s,e.levelId,e.presentationId,t,n)}}))}function YS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return GS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function GS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ZS(e){var t=YS(l.useState(),2),n=t[0],r=t[1],i=YS(l.useState(!1),2),o=i[0],a=i[1],c=ce.useBasicFetch(function(e,t){switch(e){case ly.Playlists:return bh(t);case ly.Series:return SS(t);case ly.Videos:return mg(t)}}(e.memberType,e.memberId)),s=mp(u.SUBJECT);Zh(Nv.getLevelFetchOptions(e.levelId,r),[e.levelId]);var f=!!n&&!!c.data,p="Remove ".concat(zl(Iy.singularizeMemberType(e.memberType)));return l.createElement(kp,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"Please ensure that it is not in any audiences before removing.")),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){a(!0),s.removeObjectsFromLevel(e.levelId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Iy.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:o}]})))}function QS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return XS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function XS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eE(e){var t=e.id,n=QS(l.useState(),2),r=n[0],i=n[1],o=mp(u.SUBJECT);Zh(Nv.getPresentationFetchOptions(t,i),[t]);var a={presentation:r,savePresentation:function(e,n){o.updatePresentation(t,e,n,n)}},c=Bl(a);return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Edit Presentation"),!!c&&l.createElement(Ab,Object.assign({},a)))}function tE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rE=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_PRESENTATION,args:[e.id]}},iE={application:c.SUBJECTS,action:i.Subjects.NEW_PRESENTATION};function oE(){var e=tE(l.useState(),2),t=e[0],n=e[1];return Zh(Nv.getPresentationsFetchOptions(n),[]),l.createElement("div",null,l.createElement("div",{className:"d-flex justify-content-between mb-2"},l.createElement("h5",{className:"d-inline-block m-0"},"Select a presentation to edit:"),l.createElement(Pu,{appLink:iE,className:"d-block"},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New Presentation"))),l.createElement(Ul,{objects:t,getAppLink:rE}))}function aE(){var e=mp(u.SUBJECT);return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Create New Presentation"),l.createElement(Ab,{savePresentation:function(t,n){e.createPresentation(t,(function(e){n(),e&&e.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_PRESENTATION,args:[e.id]})}),n)}}))}function cE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uE(e){var t=e.objectType,n=e.getAppLink,r=cE(l.useState(),2),i=r[0],o=r[1];return Zh(Nv.getPresentationsFetchOptions(o),[]),l.createElement("div",null,l.createElement("h5",null,l.createElement(ks,{namespace:"subjects.selectPresentation",phrase:"heading",options:{objectType:t}})),l.createElement(Ul,{objects:i,getAppLink:n}))}function lE(e,t){return Qh(e,t)}function fE(e,t,n,r,o){var a=r.selectedSubject,s=function(){return lE(o,"showConfirmationPopup")(!1)};t.addObjectsToSubject(a.id,e.map((function(e){return e.id})),n.memberType,r.addToClassifications,(function(){s(),p.AppLinkHelper.trigger(function(e,t){var n={application:c.SUBJECTS,args:[e]};switch(t){case uy.Playlists:return Object.assign(Object.assign({},n),{action:i.Subjects.EDIT_SUBJECT_PLAYLISTS});case uy.Series:return Object.assign(Object.assign({},n),{action:i.Subjects.EDIT_SUBJECT_SERIES});case uy.Videos:return Object.assign(Object.assign({},n),{action:i.Subjects.EDIT_SUBJECT_VIDEOS})}}(a.id,n.memberType))}),s)}function pE(e,t,n){if(t&&n){var r=1===t.length?"this ".concat(Cy.singularizeMemberType(e)):"these ".concat(e);return"Add ".concat(r," to ").concat(n.name)}}function dE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return mE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hE(e,t){return function(n,r,i){i(),lE(t,"selectedSubject")($l.find(e.subjectTree,Hp.a.first(n))),lE(t,"addToClassifications")(r),lE(t,"showConfirmationPopup")(!0)}}function yE(e){var t=dE(l.useState({}),2),n=t[0],r=t[1],i=ce.useBasicFetch(function(e,t){switch(e){case uy.Playlists:return gh(t);case uy.Series:return ES(t);case uy.Videos:return hg(t)}}(e.memberType,e.objectIds)),o=mp(u.SUBJECT);!function(e,t){Zh(Nv.getSubjectTreeFetchOptions(lE(t,"subjectTree")),[])}(0,r);var a;return l.createElement(l.Fragment,null,!!i.data&&!!n.subjectTree&&l.createElement(Tb,{memberType:e.memberType,objects:i.data,subjectTree:n.subjectTree,onClickAddToSubject:hE(n,r)}),n.showConfirmationPopup&&l.createElement(Np,{title:pE(e.memberType,i.data,n.selectedSubject),onClickConfirm:function(){return fE(i.data,o,e,n,r)},closePopup:function(){return e=!1,lE(r,"showConfirmationPopup")(e);var e}},l.createElement("p",null,"The following ".concat(e.memberType," will be added to "),l.createElement("strong",null,n.selectedSubject.name),n.addToClassifications?" and its mapped classifications:":":"),l.createElement("ul",null,i.data.map((function(e){return l.createElement("li",{key:e.id},e.name)}))),!n.addToClassifications&&l.createElement("p",null,"".concat(1===i.data.length?"It":"They"," will not be added to its mapped classifications.")),l.createElement("p",null,"".concat((a=e.memberType,zl(Cy.singularizeMemberType(a)))," to classification mappings can be managed from the "),l.createElement("strong",null,"Edit Subject ".concat(zl(e.memberType)," ")),"page.")))}function vE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gE(e){var t=e.subjectId,n=e.routeToOnDelete,r=e.closePopup,i=vE(l.useState(),2),o=i[0],a=i[1],c=vE(l.useState(!1),2),s=c[0],f=c[1];Zh(Nv.getSubjectFetchOptions(t,a),[]);var d=mp(u.SUBJECT),m=[{variant:"link",onClick:r,buttonText:"Cancel"},{variant:"danger",onClick:function(){f(!0);d.deleteSubject(t,(function(){r(),n&&p.AppLinkHelper.trigger(n)}),r)},buttonText:"Yes, delete this backbone classification",isSpinnerButton:!0,showSpinner:s}];return l.createElement(kp,{title:"Delete Subject",closePopup:r,showLoadingSpinner:!o},!!o&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,o.name),"?"),l.createElement("p",null,"Subjects that have mapped classifications cannot be deleted.")),l.createElement(Lp,{buttons:m})))}function SE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return EE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function EE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function OE(e){var t=e.subjectId,n=SE(l.useState(),2),r=n[0],o=n[1],a=SE(l.useState(),2),c=a[0],s=a[1],f=mp(u.SUBJECT),p=Nv.getSubjectFetchOptions(t,o);Zh(Nv.getSubjectTreeFetchOptions(s),[]),Zh(p,[t]);return l.createElement(l.Fragment,null,l.createElement(Db,{subjectId:t,activeAction:i.Subjects.EDIT_SUBJECT}),!!r&&!!c&&l.createElement(Nb,{subject:r,subjectTree:c,saveSubject:function(e,n){return f.updateSubject(t,e,n,n)}}))}function CE(e,t){return Qh(e,t)}function wE(e){switch(e){case uy.Playlists:return i.Subjects.EDIT_SUBJECT_PLAYLISTS;case uy.Series:return i.Subjects.EDIT_SUBJECT_SERIES;case uy.Videos:return i.Subjects.EDIT_SUBJECT_VIDEOS}}function AE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function TE(e){var t=AE(l.useState({}),2),n=t[0],r=t[1],o=n.presentations,a=n.classifications,s=n.memberIds,f=n.membersWithClassifications,d=ce.useBasicFetch(Array.isArray(s)&&function(e,t){switch(e){case uy.Playlists:return gh(t);case uy.Series:return ES(t);case uy.Videos:return hg(t)}}(e.memberType,s)),m=mp(u.SUBJECT);function h(t){p.AppLinkHelper.trigger({application:c.SUBJECTS,action:e.action,args:[e.subjectId],params:{presentationId:t}})}!function(e,t,n){var r=e.subjectId,i=e.memberType,o=e.presentationId;Zh(Nv.getPresentationsFetchOptions(CE(n,"presentations")),[]),Zh(Nv.getSubjectMemberIdsFetchOptions(r,i,CE(n,"memberIds")),[r,i]),Zh(!!o&&Nv.getSubjectClassificationFetchOptions(r,CE(n,"classifications"),o,i),[r,i,o],!!o)}(e,0,r),function(e,t,n,r){var i=n.classifications;l.useEffect((function(){CE(r,"membersWithClassifications")(function(e,t,n){if(!t||!n)return;return t.map((function(t){return{id:t.id,name:t.name,classifications:n.map((function(n){return{id:n.id,selected:(r=t,i=n,!!i[e]&&!!i[e].data.filter((function(e){return e.id===r.id})).length)};var r,i}))}}))}(t.memberType,e,i))}),[e,i])}(d.data,e,n,r),l.useEffect((function(){!e.presentationId&&(null==o?void 0:o.length)&&h(Hp.a.first(o).id)}),[e.presentationId]);var y,v,b=!!e.presentationId&&!!a;return l.createElement(l.Fragment,null,l.createElement(Db,{subjectId:e.subjectId,presentationId:e.presentationId,activeAction:wE(e.memberType)}),l.createElement(Ii.Alert,{variant:"info",className:"m-0"},"Select which ".concat(e.memberType," are shown for each classification in this backbone classification.")+" Change the selected presentation to view different classifications."),l.createElement("div",{className:"w-50 py-2"},!!o&&l.createElement(jb,{presentations:o,currentPresentationId:e.presentationId,setCurrentPresentation:function(e){return h(e.id)}})),b&&l.createElement(Wb,{members:f||[],memberType:e.memberType,getMemberAppLink:function(t){return Cy.getMemberAppLink(e.memberType,t)},getActions:function(t){return Cy.getMemberActions(e.subjectId,sy.Subject,e.memberType,t)},classifications:a,getClassificationAppLink:e.presentationId&&(y=e.memberType,v=e.presentationId,function(e){var t,n=c.SUBJECTS,r=[v,e];switch(y){case uy.Playlists:t=i.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;break;case uy.Series:t=i.Subjects.EDIT_CLASSIFICATION_SERIES;break;case uy.Videos:t=i.Subjects.EDIT_CLASSIFICATION_VIDEOS}return{application:n,action:t,args:r}}),onToggleClassification:function(t,n,r){return function(e,t,n,r,i,o,a){(a?e.addObjectsToClassification.bind(e):e.removeObjectsFromClassification.bind(e))(o,n,t,r,i)}(m,e.memberType,r?[r]:s,e.subjectId,e.presentationId,t,n)}}))}function kE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return IE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LE(e){var t=e.parentId,n=kE(l.useState(),2),r=n[0],o=n[1],a=mp(u.SUBJECT);Zh(Nv.getSubjectTreeFetchOptions(o),[]);var s={application:c.SUBJECTS,action:i.Subjects.PRESENTATIONS};return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-2 border-bottom"},l.createElement(xu,{backToName:"Presentations",appLink:s})),l.createElement("h4",{className:"py-2"},"Create New Subject"),!!r&&l.createElement(Nb,{subject:{parentId:t},subjectTree:r,saveSubject:function(e,t){return a.createSubject(e,function(e){return function(t){e(),t&&t.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[t.id]})}}(t),t)}}))}function _E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return PE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xE(e){var t=_E(l.useState(),2),n=t[0],r=t[1],i=_E(l.useState(!1),2),o=i[0],a=i[1],c=ce.useBasicFetch(function(e,t){switch(e){case uy.Playlists:return bh(t);case uy.Series:return SS(t);case uy.Videos:return mg(t)}}(e.memberType,e.memberId)),s=mp(u.SUBJECT);Zh(Nv.getSubjectFetchOptions(e.subjectId,r),[e.subjectId]);var f=!!n&&!!c.data,p="Remove ".concat(zl(Cy.singularizeMemberType(e.memberType)));return l.createElement(kp,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"Please ensure that it is not in any classifications before removing.")),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){a(!0),s.removeObjectsFromSubject(e.subjectId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Cy.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:o}]})))}function NE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return RE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return RE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function RE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function DE(e){var t=e.subjectId,n=NE(l.useState({}),2),r=n[0];return function(e,t){var n=function(e){return Qh(t,e)};Zh(Nv.getSubjectClassificationFetchOptions(e,n("classifications")),[e]),Zh(Nv.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),l.createElement(l.Fragment,null,l.createElement(Db,{subjectId:t,activeAction:i.Subjects.SUBJECT_CLASSIFICATIONS}),l.createElement(Bb,{presentations:r.presentations,classificationDictionary:Hp.a.groupBy(r.classifications,"presentationId")}))}var ME=n(218),UE=n.n(ME);function FE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return VE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function VE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BE(e){var t=e.selectedSubjectId,n=FE(l.useState(),2),r=n[0],o=n[1];Zh(Nv.getSubjectTreeFetchOptions(o),[]);var a=l.useCallback((function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[e.id]}}),[]),s={application:c.SUBJECTS,action:i.Subjects.NEW_SUBJECT},u=[{label:"Add child",getAppLink:function(e){return Object.assign(Object.assign({},s),{params:{parentId:e.id}})}},{label:"Delete backbone classification",getAppLink:function(e){return{application:c.SUBJECTS,action:i.Subjects.DELETE_SUBJECT,args:[e.id]}},className:"text-danger"}];return l.createElement("div",{className:"".concat(UE.a.navContainer," h-auto pr-2 border-right")},l.createElement("h5",{className:"border-bottom pb-2"},"Backbone Classifications"),l.createElement(Pu,{appLink:s,className:"d-inline-block pb-2"},l.createElement(ns,{svgName:Qc.Plus,size:ts.Small}),l.createElement("span",null,"New Backbone Classification")),!!r&&l.createElement("div",{className:"border-top pt-1"},l.createElement(nf,{tree:r,getAppLink:a,selectedIds:[t],actions:u})))}function HE(e){var t=e.currentAppLink;return l.createElement(Yb,{navItems:wy(),currentAppLink:t})}function zE(e){return(zE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $E(e,t,n){return t&&JE(e.prototype,t),n&&JE(e,n),e}function KE(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&WE(e,t)}function WE(e,t){return(WE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function YE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ZE(e);if(t){var i=ZE(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GE(this,n)}}function GE(e,t){return!t||"object"!==zE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ZE(e){return(ZE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var QE=function(e){KE(n,e);var t=YE(n);function n(){return qE(this,n),t.apply(this,arguments)}return $E(n,[{key:"channelName",get:function(){return c.PLAYLISTS}},{key:"appRoutes",get:function(){return{"manage/playlists(/)":"index","manage/playlists/new(/)":"newPlaylist","manage/playlists/search(/)":"searchPlaylists","manage/playlists/:id(/)":"editPlaylist","manage/playlists/:id/videos(/)":"editPlaylistVideos","manage/playlists/:id/dashboards(/)":"editPlaylistDashboards","manage/playlists/:id/classifications(/)":"editPlaylistSubjects","manage/playlists/:id/audiences(/)":"editPlaylistAudiences"}}},{key:"appLinks",get:function(){return["deletePlaylist","removeVideo","uploadImage","removeFromSubject","deleteDashboardWidget"]}},{key:"externalRoutes",get:function(){return{"dashboards/:id(/)":"dashboard"}}}]),n}(p.AppRouter),XE=function(e){KE(n,e);var t=YE(n);function n(){return qE(this,n),t.apply(this,arguments)}return $E(n,[{key:"initialize",value:function(){var e=this;wi.a.values(u).forEach((function(t){return dp.getInstance(t,e)}))}},{key:"name",get:function(){return"Playlists Application"}},{key:"channelName",get:function(){return c.PLAYLISTS}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{provider:dh}}}},{key:"index",value:function(e){this.layout.showChildView(I,l.createElement(jg,{cursor:null==e?void 0:e.cursor}))}},{key:"searchPlaylists",value:function(e){this.layout.showChildView(I,l.createElement(Ig,{query:null==e?void 0:e.query,cursor:null==e?void 0:e.cursor}))}},{key:"newPlaylist",value:function(){this.layout.showChildView(I,l.createElement(pg,null))}},{key:"editPlaylist",value:function(e){this.layout.showChildView(I,l.createElement(Fh,{key:e,playlistId:e}))}},{key:"editPlaylistVideos",value:function(e){this.layout.showChildView(I,l.createElement(fg,{key:e,playlistId:e}))}},{key:"editPlaylistDashboards",value:function(e){this.layout.showChildView(I,l.createElement(Pg,{key:e,playlistId:e}))}},{key:"editPlaylistSubjects",value:function(e){this.layout.showChildView(I,l.createElement(ig,{key:e,playlistId:e}))}},{key:"editPlaylistAudiences",value:function(e){this.layout.showChildView(I,l.createElement(Xb,{key:e,playlistId:e}))}},{key:"deletePlaylist",value:function(e){var t=Object.assign({playlistId:e},this.getPopupProps());this.layout.showChildView(L,l.createElement(xh,Object.assign({},t)))}},{key:"removeVideo",value:function(e,t){var n=Object.assign({playlistId:e,videoId:t},this.getPopupProps());this.layout.showChildView(L,l.createElement(Sg,Object.assign({},n)))}},{key:"removeFromSubject",value:function(e,t){var n=Object.assign({subjectId:t,memberId:e,memberType:uy.Playlists},this.getPopupProps());this.layout.showChildView(L,l.createElement(xE,Object.assign({},n)))}},{key:"deleteDashboardWidget",value:function(e,t){var n=this;this.layout.showChildView(L,l.createElement(Rg,{dashboardId:e,widgetId:t,closePopup:function(){return n.layout.closePopup()}}))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(L,l.createElement(ph,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return Ou.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_,l.createElement(Dd,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return QE}}]),n}(p.Application),eO=function(e){var t=e.children;return l.createElement(rl,null,t)},tO=function(){return{url:"/api/domain/v2/me/ratings",key:"ratings"}},nO=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Ti.string().trim().max(350,"Description is too long").default(""),rating:Ti.object().shape({id:Ti.string()}).default({}).noUnknown(),tallPoster:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),banner:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown()}).noUnknown(),rO=function(e,t){var n=c.SERIES,r=i.Series,o=[{label:"Edit Series Details",appLink:{application:n,action:r.EDIT_SERIES,args:[t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_SERIES_VIDEOS,args:[t]}}];return nd(e)&&o.push.apply(o,[{label:"Backbone Classifications",appLink:{application:n,action:r.EDIT_SERIES_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_SERIES_AUDIENCES,args:[t]}}]),o};function iO(e){var t=si(),n=us(t);return l.createElement(bi,null,l.createElement(as,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this series",autoFocus:!0}),l.createElement(as,{label:"Description",as:"textarea",name:"description",id:"description",maxLength:350,value:t.values.description,placeholder:"Describe this series here",showCharacterCounter:!0}),l.createElement(Fl,{ratings:e.ratings}),l.createElement(Sl,{imageType:Mu.TallPosters,fieldName:"tallPoster",application:c.SERIES,uploadAction:i.Series.UPLOAD_IMAGE}),l.createElement(Sl,{imageType:Mu.Banners,fieldName:"banner",application:c.SERIES,uploadAction:i.Playlists.UPLOAD_IMAGE}),l.createElement("div",{className:"d-flex justify-content-between align-items-center"},l.createElement(Pf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&l.createElement(Dl,{actions:e.actions})))}function oO(e){return l.createElement(ji,{initialValues:e.series,validationSchema:nO,onSubmit:e.saveSeries},l.createElement(iO,{id:e.series&&e.series.id,ratings:e.ratings}))}function aO(e){return l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:rO(e.currentUser,e.seriesId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function cO(e){var t,n=Object(b.useDispatch)(),r=jp(),o=ce.useBasicFetch(SS(e.seriesId)),a=ce.useBasicFetch(tO()),s=ce.useBasicFetch(Bp());return l.createElement(l.Fragment,null,!!s.data&&l.createElement(aO,{seriesId:e.seriesId,activeAction:i.Series.EDIT_SERIES,currentUser:s.data}),!!o.data&&!!a.data&&l.createElement(oO,{series:o.data,saveSeries:function(t,i){ce.fetch(n,CS(e.seriesId,t,(function(){r.success("Successfully updated series.")}),(function(){r.error("Failed to update series.")}),i))},ratings:a.data}),l.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit series page ",l.createElement(Pu,{className:"info-link",appLink:(t=e.seriesId,{application:c.SERIES,action:i.Series.LEGACY_EDIT_SERIES,args:[t]})},"here"),"."))}function sO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lO(e){var t=sO(l.useState({}),2),n=t[0],r=t[1],o=ce.useBasicFetch(SS(e.seriesId)),a=ce.useBasicFetch(Bp()),c=mp(u.SUBJECT);!function(e,t,n){var r=function(e){return Qh(n,e)};Zh(Nv.getObjectLevelsFetchOptions(e,uy.Series,r("seriesLevels")),[e]),Zh(Nv.getObjectAudiencesFetchOptions(e,uy.Series,r("seriesAudiences")),[e,t.seriesLevels]),$h([Nv.getPresentationsFetchOptions(r("presentations")),Nv.getLevelsFetchOptions(r("levels"))],[]),Zh(!!t.currentPresentation&&Nv.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.seriesId,n,r),Gb(n,r);var s=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.seriesLevels&&n.seriesAudiences);return l.createElement(l.Fragment,null,!!a.data&&l.createElement(aO,{seriesId:e.seriesId,activeAction:i.Series.EDIT_SERIES_AUDIENCES,currentUser:a.data}),l.createElement(Ml,{object:o.data}),!!s&&l.createElement(zv,{objectLevels:n.seriesLevels,objectAudiences:n.seriesAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Qh(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:uy.Series,saveLevels:function(t,n,r){return c.updateObjectLevels(e.seriesId,t,uy.Series,n,r,r)},saveAudiences:function(t,r){return c.updateObjectAudiences(e.seriesId,n.currentPresentation.id,t,uy.Series,r,r)}}))}function fO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||dO(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pO(e){return function(e){if(Array.isArray(e))return mO(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||dO(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dO(e,t){if(e){if("string"==typeof e)return mO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mO(e,t):void 0}}function mO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hO(e){var t=fO(l.useState({}),2),n=t[0],r=t[1],o=ce.useBasicFetch(SS(e.seriesId)),a=ce.useBasicFetch(Bp()),c=mp(u.SUBJECT);!function(e,t,n){var r=function(e){return Qh(n,e)};$h([Nv.getSubjectTreeFetchOptions(r("subjectTree")),Nv.getPresentationsFetchOptions(r("presentations"))],[]),Zh(Nv.getObjectSubjectsFetchOptions(e,uy.Series,r("seriesSubjects")),[e]),Zh(!!t.currentPresentation&&Nv.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),l.useEffect((function(){return r("subjectClassifications")([])}),[t.seriesSubjects]);var i=function(e,t){return[].concat(pO(t.subjectClassifications||[]),pO(e))},o=t.seriesSubjects&&t.seriesSubjects.map((function(e){return Nv.getSubjectClassificationFetchOptions(e.id,Qh(n,"subjectClassifications",i))}));$h(o,[t.seriesSubjects],!!o),Zh(Nv.getObjectClassificationsFetchOptions(e,uy.Series,r("seriesClassifications")),[e,t.seriesSubjects])}(e.seriesId,n,r),Gb(n,r);var s=!!(n.seriesSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.seriesClassifications&&n.subjectClassifications);return l.createElement(l.Fragment,null,!!a.data&&l.createElement(aO,{seriesId:e.seriesId,activeAction:i.Series.EDIT_SERIES_SUBJECTS,currentUser:a.data}),l.createElement(Ml,{object:o.data}),s&&l.createElement(Lb,{objectSubjects:n.seriesSubjects,subjectTree:n.subjectTree,memberType:uy.Series,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Qh(r,"currentPresentation"),objectClassifications:n.seriesClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return c.updateObjectSubjects(e.seriesId,t,uy.Series,n,r,r)},saveClassifications:function(t,r){return c.updateObjectClassifications(e.seriesId,n.currentPresentation.id,t,uy.Series,r,r)}}))}function yO(){var e=Object(b.useDispatch)(),t=jp(),n=ce.useBasicFetch(tO());return l.createElement(l.Fragment,null,!!n.data&&l.createElement(oO,{saveSeries:function(n,r){var o=function(){t.error("Failed to create series.")},a=function(e){t.success("Successfully created series."),function(e){p.AppLinkHelper.trigger({application:c.SERIES,action:i.Series.EDIT_SERIES,args:[e.id]})}(e)};ce.fetch(e,OS(n,(function(t){var n={permissions:ed()};ce.fetch(e,CS(t.id,n,a,o,r))}),o))},ratings:n.data}))}function vO(e){return(vO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function SO(e,t,n){return t&&gO(e.prototype,t),n&&gO(e,n),e}function EO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&OO(e,t)}function OO(e,t){return(OO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function CO(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=AO(e);if(t){var i=AO(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return wO(this,n)}}function wO(e,t){return!t||"object"!==vO(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function AO(e){return(AO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jO=function(e){EO(n,e);var t=CO(n);function n(){return bO(this,n),t.apply(this,arguments)}return SO(n,[{key:"channelName",get:function(){return c.SERIES}},{key:"appRoutes",get:function(){return{"manage/series/new(/)":"newSeries","manage/series/:id(/)":"editSeries","manage/series/:id/videos(/)":"editSeriesVideos","manage/series/:id/classifications(/)":"editSeriesSubjects","manage/series/:id/audiences(/)":"editSeriesAudiences","manage/legacy/series/:id(/)":"legacyEditSeries"}}},{key:"appLinks",get:function(){return["uploadImage"]}}]),n}(p.AppRouter),TO=function(e){EO(n,e);var t=CO(n);function n(){return bO(this,n),t.apply(this,arguments)}return SO(n,[{key:"initialize",value:function(){var e=this;wi.a.values(u).forEach((function(t){return dp.getInstance(t,e)}))}},{key:"name",get:function(){return"Series Application"}},{key:"channelName",get:function(){return c.SERIES}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{provider:eO}}}},{key:"newSeries",value:function(){this.layout.showChildView(I,l.createElement(yO,null))}},{key:"editSeries",value:function(e){this.layout.showChildView(I,l.createElement(cO,{seriesId:e}))}},{key:"editSeriesVideos",value:function(e){this.legacyEditSeries(e)}},{key:"editSeriesSubjects",value:function(e){this.layout.showChildView(I,l.createElement(hO,{seriesId:e}))}},{key:"editSeriesAudiences",value:function(e){this.layout.showChildView(I,l.createElement(lO,{seriesId:e}))}},{key:"legacyEditSeries",value:function(e){p.LocationUtils.Redirect("/manage/legacy/series/".concat(e),!0)}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(L,l.createElement(ph,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return Ou.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_,l.createElement(Dd,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return jO}}]),n}(p.Application);function kO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return IO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LO(e){var t=kO(l.useState(),2),n=t[0],r=t[1],i=kO(l.useState(!1),2),o=i[0],a=i[1],c=ce.useBasicFetch(function(e,t){switch(e){case ly.Playlists:return bh(t);case ly.Series:return SS(t);case ly.Videos:return mg(t)}}(e.memberType,e.memberId)),s=mp(u.SUBJECT);Zh(Nv.getAudienceFetchOptions(e.audienceId,r),[e.audienceId]);var f=!!n&&!!c.data,p="Remove ".concat(zl(Iy.singularizeMemberType(e.memberType)));return l.createElement(kp,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"This will not remove it from the backbone level.")),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){a(!0),s.removeObjectsFromAudience(e.audienceId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Iy.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:o}]})))}function _O(e){return(_O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function PO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function NO(e,t,n){return t&&xO(e.prototype,t),n&&xO(e,n),e}function RO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&DO(e,t)}function DO(e,t){return(DO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function MO(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=FO(e);if(t){var i=FO(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return UO(this,n)}}function UO(e,t){return!t||"object"!==_O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function FO(e){return(FO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var VO,BO=function(e){RO(n,e);var t=MO(n);function n(){return PO(this,n),t.apply(this,arguments)}return NO(n,[{key:"channelName",get:function(){return c.SUBJECTS}},{key:"appRoutes",get:function(){return{"manage/subjects(/)":"subjects","manage/subjects/add-objects(/)":"addSubjectMembers","manage/subjects/new(/)":"newSubject","manage/subjects/:id/edit(/)":"editSubject","manage/subjects/:id/edit/playlists(/)":"editSubjectPlaylists","manage/subjects/:id/edit/series(/)":"editSubjectSeries","manage/subjects/:id/edit/videos(/)":"editSubjectVideos","manage/subjects/:id/classifications(/)":"subjectClassifications","manage/subjects/classifications(/)":"classifications","manage/subjects/presentations/:id/classifications(/)":"presentationClassifications","manage/subjects/presentations/:id/classifications/new(/)":"newClassification","manage/subjects/presentations/:id/classifications/:id/edit(/)":"editClassification","manage/subjects/presentations/:id/classifications/:id/edit/playlists(/)":"editClassificationPlaylists","manage/subjects/presentations/:id/classifications/:id/edit/series(/)":"editClassificationSeries","manage/subjects/presentations/:id/classifications/:id/edit/videos(/)":"editClassificationVideos","manage/subjects/levels(/)":"levels","manage/subjects/levels/new(/)":"newLevel","manage/subjects/levels/:id(/)":"level","manage/subjects/levels/:id/edit(/)":"editLevel","manage/subjects/levels/:id/edit/playlists(/)":"editLevelPlaylists","manage/subjects/levels/:id/edit/series(/)":"editLevelSeries","manage/subjects/levels/:id/edit/videos(/)":"editLevelVideos","manage/subjects/levels/:id/audiences(/)":"levelAudiences","manage/subjects/audiences(/)":"audiences","manage/subjects/presentations/:id/audiences(/)":"presentationAudiences","manage/subjects/presentations/:id/audiences/new(/)":"newAudience","manage/subjects/presentations/:id/audiences/:id/edit(/)":"editAudience","manage/subjects/presentations/:id/audiences/:id/edit/playlists(/)":"editAudiencePlaylists","manage/subjects/presentations/:id/audiences/:id/edit/series(/)":"editAudienceSeries","manage/subjects/presentations/:id/audiences/:id/edit/videos(/)":"editAudienceVideos","manage/subjects/presentations(/)":"presentations","manage/subjects/presentations/new":"newPresentation","manage/subjects/presentations/:id(/)":"editPresentation"}}},{key:"appLinks",get:function(){return["deleteClassification","removeClassificationMember","deleteSubject","removeSubjectMember","deleteAudience","removeLevelMember","removeAudienceMember","uploadImage"]}}]),n}(p.AppRouter),HO=function(e){RO(n,e);var t=MO(n);function n(){return PO(this,n),t.apply(this,arguments)}return NO(n,[{key:"initialize",value:function(){var e=this;this.subjectDataService=dp.getInstance(u.SUBJECT,this),wi.a.values(u).forEach((function(t){return dp.getInstance(t,e)}))}},{key:"name",get:function(){return"Subjects Application"}},{key:"channelName",get:function(){return c.SUBJECTS}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{provider:rl,getTopNavView:this.getTopNav}}}},{key:"subjects",value:function(){this.subjectDataService.getSubjectTree((function(e){var t=!!e.children&&e.children[0];t?p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[t.id]},{replace:!0}):p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.NEW_SUBJECT},{replace:!0})}))}},{key:"newSubject",value:function(e){var t={parentId:e.parentId};this.layout.showChildView(I,l.createElement(LE,Object.assign({key:e.parentId},t))),this.renderSubjectsLeftNav()}},{key:"editSubject",value:function(e){this.layout.showChildView(I,l.createElement(OE,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"editSubjectPlaylists",value:function(e,t){var n={subjectId:e,memberType:uy.Playlists,action:i.Subjects.EDIT_SUBJECT_PLAYLISTS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(I,l.createElement(TE,Object.assign({key:"".concat(e,":playlists")},n))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectSeries",value:function(e,t){var n={subjectId:e,memberType:uy.Series,action:i.Subjects.EDIT_SUBJECT_SERIES,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(I,l.createElement(TE,Object.assign({key:"".concat(e,":series")},n))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectVideos",value:function(e,t){var n={subjectId:e,memberType:uy.Videos,action:i.Subjects.EDIT_SUBJECT_VIDEOS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(I,l.createElement(TE,Object.assign({key:"".concat(e,":videos")},n))),this.renderSubjectsLeftNav(e)}},{key:"subjectClassifications",value:function(e){this.layout.showChildView(I,l.createElement(DE,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"addSubjectMembers",value:function(e){var t=e.memberType,n=e.objectIds;if(t&&n){var r={memberType:t,objectIds:Array.isArray(n)?n:[n]};this.layout.showChildView(I,l.createElement(yE,Object.assign({},r))),this.hideLeftNav()}}},{key:"removeSubjectMember",value:function(e,t,n){var r=Object.assign({subjectId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(L,l.createElement(xE,Object.assign({},r)))}},{key:"deleteSubject",value:function(e){var t=e.toString()===this.currentLeftNavId.toString()?{application:c.SUBJECTS,action:i.Subjects.NEW_SUBJECT}:null,n=Object.assign({subjectId:e,routeToOnDelete:t||null},this.getPopupProps());this.layout.showChildView(L,l.createElement(gE,Object.assign({},n)))}},{key:"classifications",value:function(){var e={objectType:"classifications",getAppLink:function(e){return{application:c.SUBJECTS,action:i.Subjects.PRESENTATION_CLASSIFICATIONS,args:[e.id]}}};this.layout.showChildView(I,l.createElement(uE,Object.assign({},e))),this.hideLeftNav()}},{key:"presentationClassifications",value:function(e){this.subjectDataService.getClassificationTree(e,(function(t){var n=!!t.children&&t.children[0];n?p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]},{replace:!0}):p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.NEW_CLASSIFICATION,args:[e]},{replace:!0})}))}},{key:"newClassification",value:function(e,t){var n={presentationId:e,parentId:t.parentId};this.layout.showChildView(I,l.createElement(gS,Object.assign({key:t.parentId},n))),this.renderClassificationLeftNav(e)}},{key:"editClassification",value:function(e,t){var n={presentationId:e,classificationId:t};this.layout.showChildView(I,l.createElement(dS,Object.assign({key:t},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationPlaylists",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:uy.Playlists};this.layout.showChildView(I,l.createElement(yS,Object.assign({key:"".concat(t,":playlists")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationSeries",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:uy.Series};this.layout.showChildView(I,l.createElement(yS,Object.assign({key:"".concat(t,":series")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationVideos",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:uy.Videos};this.layout.showChildView(I,l.createElement(yS,Object.assign({key:"".concat(t,":videos")},n))),this.renderClassificationLeftNav(e,t)}},{key:"removeClassificationMember",value:function(e,t,n){var r=Object.assign({classificationId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(L,l.createElement(jS,Object.assign({},r)))}},{key:"deleteClassification",value:function(e,t){var n=t===this.currentLeftNavId?{application:c.SUBJECTS,action:i.Subjects.NEW_CLASSIFICATION,args:[e]}:null,r=Object.assign({classificationId:t,routeToOnDelete:n||null},this.getPopupProps());this.layout.showChildView(L,l.createElement(lS,Object.assign({},r)))}},{key:"levels",value:function(){this.layout.showChildView(I,l.createElement(PS,null)),this.renderLevelsLeftNav()}},{key:"newLevel",value:function(){this.layout.showChildView(I,l.createElement(xS,null)),this.renderLevelsLeftNav()}},{key:"level",value:function(e){p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[e]},{replace:!0})}},{key:"editLevel",value:function(e){this.layout.showChildView(I,l.createElement(IS,{key:e,id:e})),this.renderLevelsLeftNav(e)}},{key:"levelAudiences",value:function(e){this.layout.showChildView(I,l.createElement(zS,{key:e,levelId:e})),this.renderLevelsLeftNav(e)}},{key:"editLevelPlaylists",value:function(e,t){var n={levelId:e,memberType:ly.Playlists,action:i.Subjects.EDIT_LEVEL_PLAYLISTS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(I,l.createElement(WS,Object.assign({key:"".concat(e,":playlists")},n))),this.renderLevelsLeftNav(e)}},{key:"editLevelSeries",value:function(e,t){var n={levelId:e,memberType:ly.Series,action:i.Subjects.EDIT_LEVEL_SERIES,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(I,l.createElement(WS,Object.assign({key:"".concat(e,":series")},n))),this.renderLevelsLeftNav(e)}},{key:"editLevelVideos",value:function(e,t){var n={levelId:e,memberType:ly.Videos,action:i.Subjects.EDIT_LEVEL_VIDEOS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(I,l.createElement(WS,Object.assign({key:"".concat(e,":videos")},n))),this.renderLevelsLeftNav(e)}},{key:"removeLevelMember",value:function(e,t,n){var r=Object.assign({levelId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(L,l.createElement(ZS,Object.assign({},r)))}},{key:"audiences",value:function(){var e={objectType:"audiences",getAppLink:function(e){return{application:c.SUBJECTS,action:i.Subjects.PRESENTATION_AUDIENCES,args:[e.id]}}};this.layout.showChildView(I,l.createElement(uE,Object.assign({},e))),this.hideLeftNav()}},{key:"removeAudienceMember",value:function(e,t,n){var r=Object.assign({audienceId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(L,l.createElement(LO,Object.assign({},r)))}},{key:"presentationAudiences",value:function(e){this.subjectDataService.getAudiences(e,(function(t){var n=!!t&&t[0];n?p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]},{replace:!0}):p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.NEW_AUDIENCE,args:[e]},{replace:!0})}))}},{key:"newAudience",value:function(e){this.layout.showChildView(I,l.createElement($g,{presentationId:e})),this.hideLeftNav()}},{key:"editAudience",value:function(e,t){var n={presentationId:e,audienceId:t};this.layout.showChildView(I,l.createElement(Hg,Object.assign({key:t},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudiencePlaylists",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:ly.Playlists};this.layout.showChildView(I,l.createElement(eS,Object.assign({key:"".concat(t,":playlists")},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudienceSeries",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:ly.Series};this.layout.showChildView(I,l.createElement(eS,Object.assign({key:"".concat(t,":series")},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudienceVideos",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:ly.Videos};this.layout.showChildView(I,l.createElement(eS,Object.assign({key:"".concat(t,":videos")},n))),this.renderAudienceLeftNav(e,t)}},{key:"deleteAudience",value:function(e,t){var n={application:c.SUBJECTS,action:i.Subjects.PRESENTATION_AUDIENCES,args:[e]},r=Object.assign({id:t,routeToOnDelete:n},this.getPopupProps());this.layout.showChildView(L,l.createElement(Fg,Object.assign({},r)))}},{key:"presentations",value:function(){this.layout.showChildView(I,l.createElement(oE,null)),this.hideLeftNav()}},{key:"newPresentation",value:function(){this.layout.showChildView(I,l.createElement(aE,null))}},{key:"editPresentation",value:function(e){this.layout.showChildView(I,l.createElement(eE,{key:e,id:e})),this.hideLeftNav()}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(L,l.createElement(ph,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return Ou.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_,l.createElement(Dd,{alerts:n,removeAlert:r}))}},{key:"renderClassificationLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedClassificationId:t};this.layout.showChildView(k,l.createElement(cS,Object.assign({},n)))}},{key:"renderSubjectsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(k,l.createElement(BE,{selectedSubjectId:e}))}},{key:"renderAudienceLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedAudienceId:t};this.layout.showChildView(k,l.createElement(Zg,Object.assign({},n)))}},{key:"renderLevelsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(k,l.createElement(US,{selectedLevelId:e}))}},{key:"setCurrentLeftNavItem",value:function(e){this.currentLeftNavId=e||null}},{key:"hideLeftNav",value:function(){this.setCurrentLeftNavItem(),this.layout.hideLeftNav()}},{key:"getTopNav",value:function(e){return l.createElement(HE,{currentAppLink:e})}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return BO}}]),n}(p.Application),zO=function(e){return{url:"/api/domain/v1/themes/".concat(e),key:"themes:".concat(e)}},qO=function(e){var t="/api/domain/v1/themes",n="themes";return e&&(t+="?type=".concat(e),n+=":type:".concat(e)),{url:t,key:n}},JO=function(e,t,n,r){return{url:"/api/domain/v1/themes",key:"theme",data:e,type:se.a.POST,invalidationKeys:"themes",success:t,error:n,always:r}},$O=function(e,t,n,r,i){return{url:"/api/domain/v1/themes/".concat(e),key:"update:theme:".concat(e),data:t,type:se.a.PUT,success:n,error:r,always:i}},KO=function(e,t,n,r){return{url:"/api/domain/v1/themes/".concat(e),key:"delete:theme:".concat(e),type:se.a.DELETE,invalidationKeys:"themes",success:t,error:n,always:r}},WO=function(e){return{application:c.THEMES,action:i.Themes.EDIT_THEME,args:[e.id]}};function YO(){var e=ce.useBasicFetch(qO());return e.data?l.createElement(Al,{objects:e.data,columns:[{accessor:"name",header:"Name",appLink:WO}],newObjectAppLink:{application:c.THEMES,action:i.Themes.NEW_THEME},objectName:"Theme"}):l.createElement(l.Fragment,null)}!function(e){e.Glance="glance"}(VO||(VO={}));var GO=[{key:"topLeft",label:"Top Left"},{key:"topRight",label:"Top Right"},{key:"bottomLeft",label:"Bottom Left"},{key:"bottomRight",label:"Bottom Right"}];function ZO(){var e=si();return l.createElement("div",{className:"form-group"},GO.map((function(t){var n="data.".concat(t.key);return l.createElement(Sl,{label:t.label,imageType:Mu.HeroBanners,fieldName:n,application:c.THEMES,uploadAction:i.Videos.UPLOAD_IMAGE,setSelectedImage:function(t){e.setFieldValue(n,{fileId:t.id,url:t.url,fileIdType:Fu.ImageAPIv2})}})})))}var QO=Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),XO=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),type:Ti.mixed().required("Type is required"),data:Ti.mixed().when("type",{is:VO.Glance,then:Ti.object().shape({topLeft:QO,topRight:QO,bottomLeft:QO,bottomRight:QO}).noUnknown(),otherwise:Ti.mixed().strip(!0)}).default({})}).noUnknown();function eC(e){var t=si(),n=function(e){switch(e){case VO.Glance:return ZO;default:return}}(t.values.type);return l.createElement(bi,null,l.createElement(as,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this theme",autoFocus:!0}),l.createElement(as,{as:"select",label:"Type",name:"type",id:"type",value:t.values.type},l.createElement("option",{value:null},"Select a type..."),wi.a.getEnumKeys(VO).map((function(e){return l.createElement("option",{key:e,value:VO[e]},e)}))),!!n&&l.createElement(n,null),l.createElement("div",{className:"d-flex justify-content-between align-items-center"},l.createElement(Is,{isNew:e.isNew}),!!e.actions&&l.createElement(Dl,{actions:e.actions})))}function tC(e){var t;return l.createElement(ji,{initialValues:e.theme,validationSchema:XO,onSubmit:e.saveTheme},l.createElement(eC,{isNew:!(null===(t=e.theme)||void 0===t?void 0:t.id),actions:e.actions}))}function nC(){var e=Object(b.useDispatch)();return l.createElement(tC,{saveTheme:function(t,n){ce.fetch(e,JO(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.THEMES,action:i.Themes.EDIT_THEME,args:[e.id]})}),null,n))}})}function rC(e){var t=Object(b.useDispatch)(),n=jp(),r=ce.useBasicFetch(zO(e.id));return r.data?l.createElement(tC,{theme:r.data,saveTheme:function(r,i){ce.fetch(t,$O(e.id,r,(function(){n.success("Successfully updated theme")}),(function(){n.error("Failed to update theme")}),i))},actions:[{label:"Delete theme",className:"btn btn-danger",button:!0,appLink:{application:c.THEMES,action:i.Themes.DELETE_THEME,args:[e.id]}}]}):l.createElement(l.Fragment,null)}function iC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return oC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function aC(e){var t=Object(b.useDispatch)(),n=jp(),r=iC(l.useState(!1),2),o=r[0],a=r[1],s=ce.useBasicFetch(zO(e.id));return l.createElement(kp,{title:"Delete Theme",closePopup:e.closePopup,showLoadingSpinner:!s.data},l.createElement(l.Fragment,null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,s.data.name),"?"),l.createElement(Lp,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){a(!0),ce.fetch(t,KO(e.id,(function(){n.success("Successfully deleted theme"),p.AppLinkHelper.trigger({application:c.THEMES,action:i.Themes.THEMES})}),(function(){n.error("Failed to delete theme")})))},buttonText:"Yes, delete this theme",isSpinnerButton:!0,showSpinner:o}]})))}var cC=function(e){var t=e.children;return l.createElement(rl,null,t)};function sC(e){return(sC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fC(e,t,n){return t&&lC(e.prototype,t),n&&lC(e,n),e}function pC(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&dC(e,t)}function dC(e,t){return(dC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=yC(e);if(t){var i=yC(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return hC(this,n)}}function hC(e,t){return!t||"object"!==sC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yC(e){return(yC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vC=function(e){pC(n,e);var t=mC(n);function n(){return uC(this,n),t.apply(this,arguments)}return fC(n,[{key:"channelName",get:function(){return c.THEMES}},{key:"appRoutes",get:function(){return{"manage/themes(/)":"themes","manage/themes/new(/)":"newTheme","manage/themes/:id(/)":"editTheme"}}},{key:"appLinks",get:function(){return["deleteTheme","uploadImage"]}}]),n}(p.AppRouter),bC=function(e){pC(n,e);var t=mC(n);function n(){return uC(this,n),t.apply(this,arguments)}return fC(n,[{key:"name",get:function(){return"Themes Application"}},{key:"channelName",get:function(){return c.THEMES}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{provider:cC}}}},{key:"themes",value:function(){this.layout.showChildView(I,l.createElement(YO,null))}},{key:"newTheme",value:function(){this.layout.showChildView(I,l.createElement(nC,null))}},{key:"editTheme",value:function(e){this.layout.showChildView(I,l.createElement(rC,{id:e}))}},{key:"deleteTheme",value:function(e){var t=this;this.layout.showChildView(L,l.createElement(aC,{id:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(L,l.createElement(ph,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}}],[{key:"router",get:function(){return vC}}]),n}(op),gC=function(e){var t=e.children;return l.createElement(rl,null,t)},SC=function(e,t){var n=c.VIDEOS,r=i.Videos,o=[{label:"Edit Video Details",appLink:{application:n,action:r.EDIT_VIDEO,args:[t]}}];return nd(e)?[].concat(o,[{label:"Backbone Classifications",appLink:{application:n,action:r.EDIT_VIDEO_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_VIDEO_AUDIENCES,args:[t]}},{label:"Aliases",appLink:{application:n,action:r.EDIT_VIDEO_ALIASES,args:[t]}}]):o};function EC(e){var t,n=SC(e.currentUser,e.videoId);return n.length<2?l.createElement(l.Fragment,null):l.createElement("div",{className:"py-2"},l.createElement(Wl,{tabs:n,isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}))}var OC,CC,wC,AC=Ti.object().shape({name:Ti.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Ti.string().trim().default(""),status:Ti.mixed().required("Status is required"),productionYear:Ti.number().min(1900),rating:Ti.object().shape({id:Ti.string()}).default({}).noUnknown(),thumbnail:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),heroBanner:Ti.object().shape({fileId:Ti.string(),fileIdType:Ti.mixed(),url:Ti.string()}).default({}).noUnknown(),glance:Ti.object().shape({theme:Ti.string(),format:Ti.mixed(),content:Ti.string(),type:Ti.mixed()}).default({}).noUnknown()}).noUnknown();function jC(e){return f.a.createElement("div",Object.assign({},e,{role:"button",tabIndex:0,className:"".concat(e.className?e.className:""," cursor-pointer"),onKeyDown:e.onKeyDown?e.onKeyDown:function(t){return"Enter"===t.key&&e.onClick(t)},onClick:e.onClick,style:e.style?e.style:{}}),e.children)}!function(e){e[e.Draft=0]="Draft",e[e.Published=1]="Published",e[e.Archived=2]="Archived",e[e.Pending=3]="Pending",e[e.Rejected=4]="Rejected",e[e.Processing=5]="Processing"}(OC||(OC={})),function(e){e.Markdown="text/markdown"}(CC||(CC={})),function(e){e.Pedagogy="pedagogy"}(wC||(wC={}));var TC=n(52),kC=n.n(TC);function IC(e){var t,n=e.tag,r=e.appLink,i=e.onClick,o=e.disabled,a=e.tagClass,c=void 0===a?"tag":a,s=n.name.toLowerCase(),u="badge-pill py-1 px-2 my-1 mr-1 ".concat(c);return(null===(t=n.metadata)||void 0===t?void 0:t.type)===wC.Pedagogy&&(u+=" pedagogy-tag text-white"),!r&&!i||o||(u+=" cursor-pointer"),o&&(u+=" "+kC.a.disabled),r?f.a.createElement(Pu,{onClick:i,appLink:r,className:u,title:s},f.a.createElement("span",{className:"text-truncate text-nowrap"},s)):f.a.createElement("span",{onClick:i,className:u,title:s},f.a.createElement("span",{className:"text-truncate text-nowrap"},s))}function LC(e){return function(e){if(Array.isArray(e))return _C(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return _C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _C(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PC(e){var t;switch(null===(t=e.metadata)||void 0===t?void 0:t.type){case wC.Pedagogy:return 0;default:return 1}}function xC(e){var t=e.tags,n=e.getAppLink;if(!t||!t.data)return f.a.createElement(f.a.Fragment,null);var r=LC(t.data).sort((function(e,t){return PC(e)-PC(t)}));return f.a.createElement("div",{className:kC.a.tagList},r.map((function(e){var t=h(n)?n(e):null;return f.a.createElement(IC,{key:e.id,tag:e,appLink:t})})))}var NC=n(53),RC=n.n(NC);function DC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var MC=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.listeners={}}var t,n,r;return t=e,(n=[{key:"subscribe",value:function(e,t){this.registerListener(e,t)}},{key:"subscribeOnce",value:function(e,t){this.registerListener(e,t,1)}},{key:"unsubscribe",value:function(e,t){this.deregisterListener(e,t)}},{key:"trigger",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.triggerCallbacks(e,n)}},{key:"registerListener",value:function(e,t,n){var r;if("string"!=typeof e)throw new Error("Event name must be a string");if("function"!=typeof t)throw new Error("Event callback must be a function");if(n&&"number"!=typeof n)throw new Error("Execution limit must be a number or undefined");this.listeners[e]=null!==(r=this.listeners[e])&&void 0!==r?r:[],this.listeners[e].push({callback:t,executionLimit:n})}},{key:"deregisterListener",value:function(e,t){var n;if("string"!=typeof e)throw new Error("Event name must be a string");if(t&&"function"!=typeof t)throw new Error("Event callback must be a function");if(t){var r=null===(n=this.listeners[e])||void 0===n?void 0:n.findIndex((function(e){return e.callback===t}));"number"==typeof r&&-1!==r&&(this.listeners[e].splice(r,1),0===this.listeners[e].length&&delete this.listeners[e])}else this.listeners[e]=[]}},{key:"triggerCallbacks",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];if(this.listeners[e]){var o=[];this.listeners[e].forEach((function(e){var t,n;"number"==typeof e.executionLimit&&(e.executionCount=null!==(n=e.executionCount)&&void 0!==n?n:0,e.executionCount++,e.executionCount===e.executionLimit&&o.push(e.callback)),(t=e.callback).apply.apply(t,[null].concat(r))})),o.length&&o.forEach((function(n){return t.deregisterListener(e,n)}))}}}])&&DC(t.prototype,n),r&&DC(t,r),e}());function UC(e,t,n){var r=function(){MC.unsubscribe(e,t)};return Object(l.useEffect)((function(){return n?MC.subscribeOnce(e,t):MC.subscribe(e,t),function(){r()}}),[]),r}var FC=function(e,t,n){var r=t-(e=e.toString()).length;return r<=0?e:new Array(r+1).join(n)+e},VC=function(e){if(!d.isNumber(e))return"";var t=new Date(e),n=t.getUTCHours(),r=FC(t.getUTCMinutes(),2,"0"),i=FC(t.getUTCSeconds(),2,"0");return n>0?"".concat(n,":").concat(r,":").concat(i):"".concat(r,":").concat(i)},BC=n(22),HC=n.n(BC);function zC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var JC,$C=/(\[.*\]\(cv:\/\/poi\?id=[0-9]+\))/g,KC=/[0-9]+/,WC=/\[.*\]/,YC=/[\[\]]/g;function GC(e,t){var n=function(e,t){return(null==t?void 0:t.length)?e.content.replace($C,(function(e){var n=e.match(KC);if(!(null==n?void 0:n.length))return e;var r=t.find((function(e){return e.id.toString()===n[0]})),i=e.match(WC);if(!r||!(null==i?void 0:i.length))return e;var o='<span class="'.concat(HC.a.timestamp,' mr-2">').concat(VC(1e3*r.startTime),"</span>"),a=i[0];return a=(a=a.replace(YC,""))||r.description,a="[".concat(o," ").concat(a,"]"),e.replace(WC,a)})):e.content}(e,t);return NC(n).split('a href="cv://poi').join('a class="d-flex" href="cv://poi')}function ZC(e){var t=Object(l.useRef)();function n(){var t=this.getAttribute("href");if((null==t?void 0:t.includes("cv://poi"))&&(null==e?void 0:e.length)){var n=t.split("cv://poi?id=")[1];if(n){var r=e.find((function(e){return e.id.toString()===n}));r&&MC.trigger("glance:poi:mouseover",r)}}}function r(){MC.trigger("glance:poi:mouseleave")}function i(){var e;return null===(e=t.current)||void 0===e?void 0:e.querySelectorAll('[href*="cv://poi"]')}return UC("player:poi:mouseover",(function(e){var n,r=null==e?void 0:e.id;if(!r)return;null===(n=function(e){var n;return null===(n=t.current)||void 0===n?void 0:n.querySelector('[href="cv://poi?id='.concat(e,'"]'))}(r))||void 0===n||n.classList.add(HC.a.highlightPoi)})),UC("player:poi:mouseleave",(function(){var e;null===(e=i())||void 0===e||e.forEach((function(e){return e.classList.remove(HC.a.highlightPoi)}))})),Object(l.useEffect)((function(){if(t.current){var e=i();return e.forEach((function(e){return e.addEventListener("mouseover",n)})),e.forEach((function(e){return e.addEventListener("mouseleave",r)})),function(){e.forEach((function(e){return e.removeEventListener("mouseover",n)})),e.forEach((function(e){return e.removeEventListener("mouseleave",r)}))}}}),[t.current]),t}!function(e){e.Maths="maths",e.English="english",e.History="history"}(JC||(JC={}));function QC(e){var t,n,r=function(e,t,n){var r,i=zC(Object(l.useState)(""),2),o=i[0],a=i[1];return Object(l.useEffect)((function(){n&&a(GC(e.glance,t))}),[null===(r=e.glance)||void 0===r?void 0:r.content,!!t]),o}(e.video,e.pointsOfInterest,e.hasGlanceData),i=ZC(e.pointsOfInterest);return!e.hasGlanceData&&e.hasDetails?(e.onClickShowDescription&&e.onClickShowDescription(),l.createElement(l.Fragment,null)):l.createElement("div",{className:"rounded border px-5 py-3 mb-3\n position-relative d-flex justify-content-center\n ".concat(HC.a.container," ").concat((n=null===(t=e.theme)||void 0===t?void 0:t.name.toLowerCase(),n===JC.Maths?HC.a.bgBlue:n===JC.English?HC.a.bgPink:n===JC.History?HC.a.bgYellow:HC.a.bgGreen))},l.createElement("div",{className:"".concat(HC.a.content," d-flex align-items-center")},l.createElement("div",null,l.createElement("h2",{className:"h4"},l.createElement(ks,{namespace:"shared.videoAtAGlance",phrase:"videoAtAGlance"})),e.hasDetails&&e.onClickShowDescription&&l.createElement(jC,{onClick:e.onClickShowDescription,className:"".concat(HC.a.detailsBtn," position-absolute cursor-pointer mr-4 font-weight-500 text-info")},l.createElement(ks,{namespace:"shared.videoAtAGlance",phrase:"readFullDescription"})),l.createElement("div",{ref:i,onClick:function(t){return function(e,t,n){e.preventDefault();var r=e.target.getAttribute("href");if((null==r?void 0:r.includes("cv://poi"))&&(null==t?void 0:t.length)){var i=r.split("cv://poi?id=")[1],o=t.find((function(e){return e.id.toString()===i}));n&&o&&n(o.startTime)}}(t,e.pointsOfInterest,e.setStartTime)},dangerouslySetInnerHTML:{__html:r}}),function(){var t,n,r;return(null===(n=null===(t=e.video.tags)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)?l.createElement("div",{className:"py-1"},l.createElement(xC,{tags:null===(r=e.video)||void 0===r?void 0:r.tags,getAppLink:function(t){return e.getTagAppLink?e.getTagAppLink(t.name):null}})):l.createElement(l.Fragment,null)}(),l.createElement("div",{className:"mt-2"},e.hasCurriculumLinks&&e.onClickShowCurriculumLinks&&l.createElement(jC,{onClick:e.onClickShowCurriculumLinks,className:"cursor-pointer d-inline-block font-weight-500 text-info"},l.createElement(ks,{namespace:"shared.videoAtAGlance",phrase:"seeCurriculumLinks"}))))),function(){var t;return wi.a.keys(null===(t=e.theme)||void 0===t?void 0:t.data).filter((function(t){var n;return!wi.a.isEmpty(null===(n=e.theme)||void 0===n?void 0:n.data[t])})).map((function(t){var n,r,i,o;return l.createElement("div",{key:null===(r=null===(n=e.theme)||void 0===n?void 0:n.data[t])||void 0===r?void 0:r.fileId,className:"".concat(HC.a[t]," ").concat(HC.a.background),style:{backgroundImage:"url('".concat(Gu.createUrl(null===(o=null===(i=e.theme)||void 0===i?void 0:i.data[t])||void 0===o?void 0:o.url,{format:"png"}),"')")}})}))}())}function XC(e){var t,n,r,i,o,a=si(),c=e.themes.find((function(e){var t;return e.name===(null===(t=a.values.glance)||void 0===t?void 0:t.theme)})),s=(null===(t=a.values.glance)||void 0===t?void 0:t.format)===CC.Markdown&&(null===(n=a.values.glance)||void 0===n?void 0:n.content)&&c;return l.createElement("div",{className:"form-group p-2 border"},l.createElement("div",{className:"border-bottom mb-2"},l.createElement("label",null,"Video at a Glance")),l.createElement(as,{as:"select",label:"Theme",name:"glance.theme",id:"glance.theme",value:null===(r=a.values.glance)||void 0===r?void 0:r.theme},l.createElement("option",{value:null},"Select a theme..."),e.themes.map((function(e){return l.createElement("option",{key:e.id,value:e.name},e.name)}))),l.createElement(as,{as:"select",label:"Format",name:"glance.format",id:"glance.format",value:null===(i=a.values.glance)||void 0===i?void 0:i.format},l.createElement("option",{value:null},"Select a format..."),wi.a.getEnumKeys(CC).map((function(e){return l.createElement("option",{key:e,value:CC[e]},e)}))),l.createElement(as,{label:"Content",as:"textarea",name:"glance.content",id:"glance.content",value:null===(o=a.values.glance)||void 0===o?void 0:o.content}),s&&l.createElement("div",{className:"form-group"},l.createElement("label",null,"Preview"),l.createElement(QC,{theme:c,video:{glance:a.values.glance,tags:e.tags},hasGlanceData:!0})))}function ew(e){switch(e){case OC.Published:return"badge-success";case OC.Archived:return"badge-danger";case OC.Draft:return"badge-warning";case OC.Pending:return"badge-info";case OC.Rejected:return"badge-dark";default:return"badge-secondary"}}function tw(e){var t=si(),n=!!e.rightslineId,r=nd(e.currentUser);return l.createElement(bi,null,n&&l.createElement(as,{label:"Rightsline ID",name:"rightslineId",id:"rightslineId",value:e.rightslineId,disabled:!0}),l.createElement(as,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this video",disabled:n,autoFocus:!0}),l.createElement("div",{className:"form-group"},l.createElement("label",null,"Status"),l.createElement("div",null,l.createElement("span",{className:"badge ".concat(ew(t.values.status))},OC[t.values.status]))),l.createElement(as,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this video here",disabled:n,showCharacterCounter:!0}),l.createElement(as,{label:"Production Year",type:"number",name:"productionYear",id:"productionYear",value:t.values.productionYear,disabled:n}),l.createElement(Fl,{ratings:e.ratings,disabled:n}),l.createElement(Sl,{imageType:Mu.Thumbnails,fieldName:"thumbnail",application:c.VIDEOS,uploadAction:i.Videos.UPLOAD_IMAGE}),l.createElement(Sl,{imageType:Mu.HeroBanners,fieldName:"heroBanner",application:c.VIDEOS,uploadAction:i.Videos.UPLOAD_IMAGE}),r&&l.createElement(XC,{themes:e.themes,tags:e.tags}),l.createElement(Is,{isNew:!e.id}))}function nw(e,t){if(e)return t?Object.assign(Object.assign({},e),t):e}function rw(e){var t;return l.createElement(ji,{initialValues:nw(e.video,e.rightslineVideo),validationSchema:AC,onSubmit:e.saveVideo,allowInitialSubmit:!!e.rightslineVideo},l.createElement(tw,{id:e.video&&e.video.id,ratings:e.ratings,themes:e.themes,tags:null===(t=e.video)||void 0===t?void 0:t.tags,currentUser:e.currentUser,rightslineId:e.rightslineId}))}function iw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ow(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ow(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ow(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function aw(e){var t,n=Object(b.useDispatch)(),r=iw(l.useState(!1),2),o=r[0],a=r[1],s=ce.useBasicFetch(mg(e.videoId)),u=ce.useBasicFetch(yg(e.videoId)),f=ce.useBasicFetch(tO()),p=ce.useBasicFetch(qO(VO.Glance)),d=ce.useBasicFetch(Bp());var m,h=!!s.data&&!!f.data&&!!p.data&&!!d.data&&u.isComplete;return l.createElement(l.Fragment,null,!!d.data&&l.createElement(EC,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO,currentUser:d.data}),!!u.data&&l.createElement("div",{className:"pt-3 text-right"},l.createElement(Ii.Button,{variant:"outline-dark",size:"sm",onClick:function(){u.isFetching||(a(!0),ce.fetch(n,yg(e.videoId)))}},"Sync from Rightsline")),h&&l.createElement(rw,{video:s.data,saveVideo:function(t,r){ce.fetch(n,vg(e.videoId,t,null,null,r))},ratings:f.data,themes:p.data,currentUser:d.data,rightslineId:null===(t=u.data)||void 0===t?void 0:t.rightslineId,rightslineVideo:o&&u.data}),l.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit video page ",l.createElement(Pu,{className:"info-link",appLink:(m=e.videoId,{application:c.VIDEOS,action:i.Videos.LEGACY_EDIT_VIDEO,args:[m]})},"here"),"."))}function cw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sw(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uw(e){var t=cw(l.useState({}),2),n=t[0],r=t[1],o=ce.useBasicFetch(mg(e.videoId)),a=ce.useBasicFetch(Bp()),c=mp(u.SUBJECT);!function(e,t,n){var r=function(e){return Qh(n,e)};Zh(Nv.getObjectLevelsFetchOptions(e,uy.Videos,r("videoLevels")),[e]),Zh(Nv.getObjectAudiencesFetchOptions(e,uy.Videos,r("videoAudiences")),[e,t.videoLevels]),$h([Nv.getPresentationsFetchOptions(r("presentations")),Nv.getLevelsFetchOptions(r("levels"))],[]),Zh(!!t.currentPresentation&&Nv.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.videoId,n,r),Gb(n,r);var s=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.videoLevels&&n.videoAudiences);return l.createElement(l.Fragment,null,!!a.data&&l.createElement(EC,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO_AUDIENCES,currentUser:a.data}),l.createElement(Ml,{object:o.data}),!!s&&l.createElement(zv,{objectLevels:n.videoLevels,objectAudiences:n.videoAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Qh(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:uy.Videos,saveLevels:function(t,n,r){return c.updateObjectLevels(e.videoId,t,uy.Videos,n,r,r)},saveAudiences:function(t,r){return c.updateObjectAudiences(e.videoId,n.currentPresentation.id,t,uy.Videos,r,r)}}))}function lw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||pw(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fw(e){return function(e){if(Array.isArray(e))return dw(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||pw(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pw(e,t){if(e){if("string"==typeof e)return dw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dw(e,t):void 0}}function dw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mw(e){var t=lw(l.useState({}),2),n=t[0],r=t[1],o=ce.useBasicFetch(mg(e.videoId)),a=ce.useBasicFetch(Bp()),c=mp(u.SUBJECT);!function(e,t,n){var r=function(e){return Qh(n,e)};$h([Nv.getSubjectTreeFetchOptions(r("subjectTree")),Nv.getPresentationsFetchOptions(r("presentations"))],[]),Zh(Nv.getObjectSubjectsFetchOptions(e,uy.Videos,r("videoSubjects")),[e]),Zh(!!t.currentPresentation&&Nv.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),l.useEffect((function(){return r("subjectClassifications")([])}),[t.videoSubjects]);var i=function(e,t){return[].concat(fw(t.subjectClassifications||[]),fw(e))},o=t.videoSubjects&&t.videoSubjects.map((function(e){return Nv.getSubjectClassificationFetchOptions(e.id,Qh(n,"subjectClassifications",i))}));$h(o,[t.videoSubjects],!!o),Zh(Nv.getObjectClassificationsFetchOptions(e,uy.Videos,r("videoClassifications")),[e,t.videoSubjects])}(e.videoId,n,r),Gb(n,r);var s=!!(n.videoSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.videoClassifications&&n.subjectClassifications);return l.createElement(l.Fragment,null,!!a.data&&l.createElement(EC,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO_SUBJECTS,currentUser:a.data}),l.createElement(Ml,{object:o.data}),s&&l.createElement(Lb,{objectSubjects:n.videoSubjects,subjectTree:n.subjectTree,memberType:uy.Videos,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:Qh(r,"currentPresentation"),objectClassifications:n.videoClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return c.updateObjectSubjects(e.videoId,t,uy.Videos,n,r,r)},saveClassifications:function(t,r){return c.updateObjectClassifications(e.videoId,n.currentPresentation.id,t,uy.Videos,r,r)}}))}var hw=function(e){return{key:"aliases:".concat(e),url:"/api/master/v2/objects/".concat(e,"/aliases")}},yw=function(e,t,n,r){return{key:"create:alias",url:"/api/master/v2/objects/".concat(e,"/aliases"),type:se.a.POST,invalidationKeys:"aliases:".concat(e),data:t,success:n,error:r}},vw=function(e,t,n,r){return{key:"delete:alias",url:"/api/domain/v2/objects/".concat(e,"/aliases/").concat(t),type:se.a.DELETE,invalidationKeys:"aliases:".concat(e),success:n,error:r}};function bw(e){var t=Object(b.useDispatch)(),n=jp(),r=ce.useBasicFetch(hw(e.videoId)),o=ce.useBasicFetch(Bp());return r.data?l.createElement(l.Fragment,null,!!o.data&&l.createElement(EC,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO_ALIASES,currentUser:o.data}),l.createElement(Df,{aliases:r.data.data,onSave:function(r,i){ce.fetch(t,yw(e.videoId,r,(function(){n.success("Successfully created alias"),i()}),(function(){n.error("Something went wrong creating your alias")})))},onDelete:function(r){ce.fetch(t,vw(e.videoId,r,(function(){n.success("Successfully deleted alias")}),(function(){n.error("Something went wrong deleting your alias")})))}})):l.createElement(l.Fragment,null,"Loading...")}function gw(e){return(gw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ew(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ow(e,t,n){return t&&Ew(e.prototype,t),n&&Ew(e,n),e}function Cw(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ww(e,t)}function ww(e,t){return(ww=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Aw(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Tw(e);if(t){var i=Tw(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return jw(this,n)}}function jw(e,t){return!t||"object"!==gw(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Tw(e){return(Tw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var kw,Iw,Lw=function(e){Cw(n,e);var t=Aw(n);function n(){return Sw(this,n),t.apply(this,arguments)}return Ow(n,[{key:"channelName",get:function(){return c.VIDEOS}},{key:"appRoutes",get:function(){return{"manage/videos/:id(/)":"editVideo","manage/videos/:id/audiences(/)":"editVideoAudiences","manage/videos/:id/classifications(/)":"editVideoSubjects","manage/videos/:id/aliases(/)":"editVideoAliases","tools/programlookup/:id":"legacyEditVideo"}}},{key:"appLinks",get:function(){return["uploadImage"]}}]),n}(p.AppRouter),_w=function(e){Cw(n,e);var t=Aw(n);function n(){return Sw(this,n),t.apply(this,arguments)}return Ow(n,[{key:"initialize",value:function(){var e=this;wi.a.values(u).forEach((function(t){return dp.getInstance(t,e)}))}},{key:"name",get:function(){return"Videos Application"}},{key:"channelName",get:function(){return c.VIDEOS}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{provider:gC,alertRegion:_}}}},{key:"editVideo",value:function(e){this.layout.showChildView(I,l.createElement(aw,{videoId:e}))}},{key:"editVideoAudiences",value:function(e){this.layout.showChildView(I,l.createElement(uw,{videoId:e}))}},{key:"editVideoSubjects",value:function(e){this.layout.showChildView(I,l.createElement(mw,{videoId:e}))}},{key:"editVideoAliases",value:function(e){this.layout.showChildView(I,l.createElement(bw,{videoId:e}))}},{key:"legacyEditVideo",value:function(e){p.LocationUtils.Redirect("/tools/programlookup/".concat(e))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(L,l.createElement(ph,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}}],[{key:"router",get:function(){return Lw}}]),n}(op);function Pw(e){return(Pw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xw(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Nw(e,t)}function Nw(e,t){return(Nw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Rw(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Mw(e);if(t){var i=Mw(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Dw(this,n)}}function Dw(e,t){return!t||"object"!==Pw(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Mw(e){return(Mw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Uw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vw(e,t,n){return t&&Fw(e.prototype,t),n&&Fw(e,n),e}!function(e){e.UPDATE="UPDATE_VIEW_MODEL"}(kw||(kw={})),function(e){e.LocalStorage="localStorage",e.SessionStorage="sessionStorage"}(Iw||(Iw={}));var Bw=function(){function e(t){if(Uw(this,e),this.cachePrefix="_cv:",this.expireTime=3600,this.hasSupport=this.hasBrowserSupport(),this.type=t.type,this.hasSupport)try{this.storage=window[this.type]}catch(e){}}return Vw(e,[{key:"get",value:function(e){if(this.hasSupport){var t=this.storage.getItem(e);try{return JSON.parse(t)}catch(e){return t}}}},{key:"set",value:function(e,t){if(this.hasSupport)try{return this.storage.removeItem(e),"string"!=typeof t?(this.storage.setItem(e,JSON.stringify(t)),!0):(this.storage.setItem(e,t),!0)}catch(e){return!1}}},{key:"remove",value:function(e){if(this.hasSupport)return this.storage.removeItem(e)}},{key:"length",value:function(){if(this.hasSupport)return this.storage.length}},{key:"clear",value:function(){if(this.hasSupport)return this.storage.clear()}},{key:"cacheSet",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.expireTime;this.cacheClean();var r={time:this.getCurrentTime()+1e3*n,data:null!=t&&t};return this.set("".concat(this.cachePrefix).concat(e),r)}},{key:"cacheGet",value:function(e){var t="".concat(this.cachePrefix).concat(e),n=this.get(t);return n?this.isExpired(n)?(this.remove(t),null):n.data:null}},{key:"cacheExists",value:function(e){var t="".concat(this.cachePrefix).concat(e),n=this.get(t);return!!n&&(!this.isExpired(n)||(this.remove(t),!1))}},{key:"cacheRemove",value:function(e){return this.remove("".concat(this.cachePrefix).concat(e))}},{key:"cacheFlush",value:function(){this.cacheClean()}},{key:"cacheClean",value:function(){if(this.hasSupport)for(var e=0;e<this.storage.length;e++){var t=this.storage.key(e);if(0===t.indexOf(this.cachePrefix)){var n=this.get(t);n&&n.time&&this.isExpired(n)&&this.remove(t)}}}},{key:"isExpired",value:function(e){return e.time<this.getCurrentTime()}},{key:"getCurrentTime",value:function(){return(new Date).getTime()}},{key:"hasBrowserSupport",value:function(){try{return this.type in window&&null!==window[this.type]}catch(e){return!1}}}]),e}(),Hw=function(e){xw(n,e);var t=Rw(n);function n(){return Uw(this,n),t.apply(this,arguments)}return Vw(n,null,[{key:"Instance",get:function(){return this.instance||(this.instance=new this({type:Iw.LocalStorage}))}}]),n}(Bw),zw=function(e){xw(n,e);var t=Rw(n);function n(){return Uw(this,n),t.apply(this,arguments)}return Vw(n,null,[{key:"Instance",get:function(){return this.instance||(this.instance=new this({type:Iw.SessionStorage}))}}]),n}(Bw),qw=Hw.Instance,Jw=zw.Instance;var $w=function(e,t,n){var r,i=(r=null==n?void 0:n.storage)?r===Iw.SessionStorage?Jw:qw:null,o=Object(b.useDispatch)(),a=Object(b.useSelector)((function(t){return t.viewModelData[e]})),c=void 0!==t&&void 0===a;if(c)u(t);else if(i&&void 0===a){var s=i.get(e);u("undefined"===s?null:s)}function u(t,n){i&&function(t,n){if(!i)return;var r=i.get(e);if("string"==typeof t&&void 0!==n)return void i.set(e,Object.assign(Object.assign({},r),{dataOrKey:n}));i.set(e,t)}(t,n),o({type:kw.UPDATE,payload:{viewModelKey:e,dataOrKey:t,keyData:n}})}return c?[t,u]:[null!=a?a:void 0,u]},Kw="release:notes:config",Ww=[{id:"798",name:"Monorepo"},{id:"109",name:"Online"},{id:"822",name:"Lite"},{id:"534",name:"Library Editor"},{id:"62",name:"Curator"}];function Yw(e){var t=si(),n=us(t),r="798"===t.values.project;return f.a.useEffect((function(){e.getMilestones(t.values.project),r&&e.getBranchNames(t.values.project)}),[t.values.project]),f.a.useEffect((function(){t.setFieldValue("milestone",Hp.a.first(e.milestones))}),[e.milestones]),f.a.useEffect((function(){t.setFieldValue("branchName",Hp.a.first(e.branchNames))}),[e.branchNames]),f.a.createElement(bi,null,f.a.createElement(as,{as:"select",label:"Project",name:"project",id:"project",value:t.values.project},Ww.map((function(e){return f.a.createElement("option",{key:e.id,value:e.id},e.name)}))),f.a.createElement(as,{as:"select",label:"Milestone",name:"milestone",id:"milestone",value:t.values.milestone,disabled:!e.milestones.length},e.milestones.map((function(e){return f.a.createElement("option",{key:e,value:e},e)}))),r&&f.a.createElement(as,{as:"select",label:"Branch Name",name:"branchName",id:"branchName",value:t.values.branchName,disabled:!e.branchNames.length},e.branchNames.map((function(e){return f.a.createElement("option",{key:e,value:e},e)}))),f.a.createElement("div",{className:"d-flex justify-content-between"},f.a.createElement(Pf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Generate")))}var Gw="U_Jxes3Htv-xiaDX5wfn",Zw="https://gitlab.cvinternal.net/api/v4",Qw=function(e,t){return{key:"milestones:".concat(e),url:qu("".concat(Zw,"/projects/").concat(e,"/milestones"),{private_token:Gw}),normalize:!1,formatData:function(e){return e.map((function(e){return e.title}))},success:t}},Xw=function(e,t){return{key:"branch:names:".concat(e),url:qu("".concat(Zw,"/projects/").concat(e,"/repository/branches"),{private_token:Gw,per_page:50}),normalize:!1,formatData:function(e){return e.map((function(e){return e.name}))},success:t}},eA=function(e,t,n,r){return{key:"merge:requests:".concat(e,":").concat(t,":").concat(n),url:qu("".concat(Zw,"/projects/").concat(e,"/merge_requests"),{private_token:Gw,milestone:t,state:"merged",per_page:50,page:n}),success:r}},tA=function(e,t,n){return{key:"file:paths:".concat(t,":").concat(e),url:qu("".concat(Zw,"/projects/").concat(e,"/search"),{scope:"blobs",search:t,private_token:Gw}),normalize:!1,formatData:function(e){return e.filter((function(e){return e.filename.includes(t)}))},success:n}},nA=function(e,t,n,r){return{key:"file:".concat(e,":").concat(t,":").concat(n),url:qu("".concat(Zw,"/projects/").concat(e,"/repository/files/").concat(encodeURIComponent(t),"/raw"),{ref:n,private_token:Gw}),normalize:!1,formatData:function(e){return JSON.parse(e)},success:r}},rA=Ti.object().shape({project:Ti.string().required("Project is required").default(""),milestone:Ti.string().required("Milestone is required").default(""),branchName:Ti.string().when("project",(function(e,t){return"798"===e?t.required("Branch name is required"):t})).default("")}).noUnknown();function iA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return oA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oA(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var aA={project:Hp.a.first(Ww).id};function cA(){var e=iA(f.a.useState([]),2),t=e[0],n=e[1],r=iA(f.a.useState([]),2),o=r[0],a=r[1],s=iA($w(Kw),2)[1],u=Object(b.useDispatch)();return f.a.createElement(f.a.Fragment,null,f.a.createElement("h4",{className:"py-2"},"Generate Release Notes"),f.a.createElement(ji,{initialValues:aA,onSubmit:function(e){s(e),p.AppLinkHelper.trigger({application:c.RELEASE_NOTES,action:i.ReleaseNotes.GENERATOR})},validationSchema:rA},f.a.createElement(Yw,{getMilestones:function(e){n([]),ce.fetch(u,Qw(e,n))},milestones:t,getBranchNames:function(e){a([]),ce.fetch(u,Xw(e,a))},branchNames:o})))}var sA=n(219),uA=/#*/;function lA(e){return e=e.replace("-"," "),e="## "+(e=(e=zl(e)).replace(uA,"").trim())}function fA(e){var t=e.toLowerCase();return"## notes"===t||"## dependencies"===t}function pA(e){return e=e.replace("-"," "),e=zl(e)}function dA(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return mA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function mA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hA=["# online","# curator","# library editor","# lite","# styles","# tooling","# analytics","# common","# shared","# player"];function yA(e){for(var t={name:"",changes:""},n=0;t.name||n<e.length;n++){var r=e[n];if(!r)break;if("#"===r){var i=e.indexOf("\n",n),o=e.slice(n,i);hA.includes(o.toLowerCase().trim())&&(t.name=zl(o.replace("#","").trim()),e=e.slice(i),n=-1)}}for(var a=0;!t.changes&&a<e.length;a++){if(a+1===e.length){t.changes=e,e="";break}if("#"===e[a]&&"#"!==e[a+1]){var c=e.indexOf("\n",a),s=e.slice(a,c);hA.includes(s.toLowerCase().trim())&&(t.changes=e.slice(0,a),e=e.slice(a),a=-1)}}return{section:t,remainingDescription:e}}function vA(e){var t,n={},r=dA(e);try{for(r.s();!(t=r.n()).done;)for(var i=t.value;i;){var o=yA(i),a=o.section;if(i=o.remainingDescription,!a.name)break;n[a.name]||(n[a.name]=[]),n[a.name].push(a.changes)}}catch(e){r.e(e)}finally{r.f()}var c={};return Object.keys(n).forEach((function(e){var t,r;c[e]=(t=n[e],r={},t.forEach((function(e){for(var t=e.split("");t&&t.length;){for(var n=0;n<t.length&&t.length!==n+1;n++)if("#"===t[n]&&"#"===t[n+1]){var i=t.indexOf("\n",n),o=pA(t.slice(n,i).join(""));r[o]||(r[o]="");for(var a=i;a<t.length;a++){if(t.length===a+1){var c=t.slice(i+1).join("");r[o]+=c,t=[];break}if("#"===t[a]&&"#"===t[a+1]){var s=t.slice(i+1,a).join("");if(!s.length){t=t.slice(a),n=-1;break}r[o]+=s,t=t.slice(a),n=-1;break}}r[o]+="\n"}break}})),Object.keys(r).reduce((function(e,t){return e+=t+"\n",e+=r[t]+"\n"}),""))})),Object.keys(c).reduce((function(e,t){return e+="\n",e+="\n# ".concat(t),e+="\n".concat(c[t])}),"")}var bA=n(220),gA=n.n(bA);function SA(e){return function(e){if(Array.isArray(e))return CA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||OA(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function EA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||OA(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function OA(e,t){if(e){if("string"==typeof e)return CA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?CA(e,t):void 0}}function CA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wA(){var e=EA(f.a.useState(!0),2),t=e[0],n=e[1],r=EA(f.a.useState(1),2),o=r[0],a=r[1],s=EA(f.a.useState([]),2),u=s[0],l=s[1],d=EA(f.a.useState([]),2),m=d[0],h=d[1],y=EA(f.a.useState(!0),2),v=y[0],g=y[1],S=EA(f.a.useState(""),2),E=S[0],O=S[1],C=EA(f.a.useState("Copy"),2),w=C[0],A=C[1],j=EA($w(Kw),1)[0],T=j&&"798"===j.project,k=Object(b.useDispatch)();return f.a.useEffect((function(){if(j){var e=j.project,t=j.milestone;ce.fetch(k,eA(e,t,o,(function(e){l([].concat(SA(u),SA(e))),50===e.length?a(o+1):n(!1)})))}}),[o]),f.a.useEffect((function(){if(!(t||T&&v)){var e=u.map((function(e){return e.description.replace("\r\n","\n").replace("\r","")})),n=T?function(e,t){var n=function(e){var t="# Final Package Versions\n\n| Package | Version |\n| ------------------------- | ------------------------ |\n| @clickview/analytics | <analytics-version> |\n| @clickview/styles | <styles-version> |\n| @clickview/tooling | <tooling-version> |\n| @clickview/curator | <curator-version> |\n| @clickview/library-editor | <library-editor-version> |\n| @clickview/lite | <lite-version> |\n| @clickview/online | <online-version> |\n| @clickview/player | <player-version> |\n";return e.forEach((function(e){var n=e.name,r=e.version;r&&(t=t.replace("<".concat(n.replace("@clickview/",""),"-version>"),r))})),t}(t),r=vA(e);return"".concat(n,"\n").concat(r)}(e,m):function(e){var t={};return e.forEach((function(e){for(var n=e.split("");;){var r=!1;if(!n||!n.length)break;for(var i=0;i<n.length&&n.length!==i+1;i++)if("#"===n[i]){var o=n.indexOf("\n",i),a=lA(n.slice(i,o).join(""));t[a]||(fA(a)?r=!0:t[a]="");for(var c=o;c<n.length;c++){if(n.length===c+1){if(r){r=!1,n=[];break}var s=n.slice(o+1).join("");t[a]+=s,n=[];break}if("#"===n[c]){if(r){r=!1,n=n.slice(c),i=-1;break}var u=n.slice(o+1,c).join("");if(!u.length){n=n.slice(c),i=-1;break}t[a]+=u,n=n.slice(c),i=-1;break}}t[a]?t[a]+="\n":delete t[a]}break}})),Object.keys(t).reduce((function(e,n){return t[n]?(e+=n+"\n",e+=t[n]+"\n"):e}),"")}(e);O(n)}}),[t,v]),f.a.useEffect((function(){if(j&&T){var e=[];ce.fetch(k,tA(j.project,"package.json",(function(t){var n,r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=OA(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;ce.fetch(k,nA(j.project,i.path,j.branchName,(function(n){e.push(n),e.length===t.length&&(h(e),g(!1))})))}}catch(e){r.e(e)}finally{r.f()}})))}}),[]),j?f.a.createElement(f.a.Fragment,null,E?f.a.createElement("div",{className:"position-relative border rounded p-3"},f.a.createElement(sA,{onCopy:function(){return A("Copied")},text:E},f.a.createElement("button",{className:"btn btn-outline-dark ".concat(gA.a.copyBtn)},w)),f.a.createElement("div",{dangerouslySetInnerHTML:{__html:RC()(E)}})):t?"Fetching merge requests..":"Merging descriptions.."):(p.AppLinkHelper.trigger({application:c.RELEASE_NOTES,action:i.ReleaseNotes.FORM}),f.a.createElement(f.a.Fragment,null))}function AA(e){return(AA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function kA(e,t,n){return t&&TA(e.prototype,t),n&&TA(e,n),e}function IA(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&LA(e,t)}function LA(e,t){return(LA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xA(e);if(t){var i=xA(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return PA(this,n)}}function PA(e,t){return!t||"object"!==AA(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xA(e){return(xA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var NA=function(e){IA(n,e);var t=_A(n);function n(){return jA(this,n),t.apply(this,arguments)}return kA(n,[{key:"channelName",get:function(){return c.RELEASE_NOTES}},{key:"appRoutes",get:function(){return{"developer/release-notes(/)":"index","developer/release-notes/generate(/)":"form","developer/release-notes/generator(/)":"generator"}}}]),n}(p.AppRouter),RA=function(e){IA(n,e);var t=_A(n);function n(){return jA(this,n),t.apply(this,arguments)}return kA(n,[{key:"name",get:function(){return"Release Notes Application"}},{key:"channelName",get:function(){return c.RELEASE_NOTES}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT}}},{key:"index",value:function(){p.AppLinkHelper.trigger({application:c.RELEASE_NOTES,action:i.ReleaseNotes.GENERATOR},{replace:!0})}},{key:"form",value:function(){this.layout.showChildView(I,l.createElement(cA,null))}},{key:"generator",value:function(){this.layout.showChildView(I,l.createElement(wA,null))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return Ou.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_,l.createElement(Dd,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return NA}}]),n}(p.Application),DA=function(e,t){var n="/api/domain/v1/search/users?q=".concat(e);return t&&(n+="&filter={page:".concat(t,"}")),{key:"users:search:".concat(e).concat(t?":".concat(t):""),url:n,formatData:df.convertLegacyPaginatedCollection}},MA=function(e){e.sort();var t="customers&".concat(e.map((function(e){return"id=".concat(e)})).join("&"));return{url:"/api/master/v2/objects?query.user=".concat(t),key:"users:".concat(e.join(","))}};function UA(e){return{application:c.USERS,action:i.Users.USER,args:[e.id]}}function FA(e){p.AppLinkHelper.trigger({application:c.USERS,action:i.Users.HOME,params:{query:e}})}function VA(e){var t,n,r=ce.useBasicFetch(!!e.query&&DA(e.query,e.cursor)),o=function(e){var t,n;return ce.useBasicFetch(!!(null===(n=null===(t=e.data)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)&&MA(e.data.data.map((function(e){return e.id}))))}(r),a=(null===(n=null===(t=r.data)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)?o.isComplete:r.isComplete;return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{className:"pb-3 w-50"},f.a.createElement(lu,{initialQuery:e.query,placeholder:"Search for a user by name, username or email...",onSuggestionSelected:function(e){return p.AppLinkHelper.trigger(UA(e))},onSubmit:FA})),a&&(r.data.data.length?f.a.createElement(jl,{collection:r.data,columns:[{header:"Name",accessor:function(e){return"".concat(e.name," ").concat(e.surname)},appLink:UA},{header:"Username",accessor:"username",appLink:UA},{header:"Email",accessor:"email",appLink:UA},{header:"Customer",accessor:function(e){var t,n,r=null!==(n=null===(t=e.customers)||void 0===t?void 0:t.data)&&void 0!==n?n:[];return f.a.createElement("ul",{className:"list-unstyled"},r.map((function(e,t){return f.a.createElement("li",{key:t},f.a.createElement(Pu,{appLink:(n=e,{application:c.CUSTOMERS,action:i.Customers.MANAGE_CUSTOMER,args:[n.id]})},"".concat(e.name," - ").concat(e.crmId)));var n})))}}],collectionAppLink:{application:c.USERS,action:i.Users.HOME,params:{query:e.query}}}):f.a.createElement("p",null,"No users found, please try a different search query.")))}function BA(e){return(BA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function HA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qA(e,t,n){return t&&zA(e.prototype,t),n&&zA(e,n),e}function JA(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$A(e,t)}function $A(e,t){return($A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function KA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=YA(e);if(t){var i=YA(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return WA(this,n)}}function WA(e,t){return!t||"object"!==BA(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function YA(e){return(YA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var GA,ZA=function(e){JA(n,e);var t=KA(n);function n(){return HA(this,n),t.apply(this,arguments)}return qA(n,[{key:"channelName",get:function(){return c.USERS}},{key:"appRoutes",get:function(){return{"users(/)":"index"}}},{key:"externalRoutes",get:function(){return{"users/:id(/)":"user"}}}]),n}(p.AppRouter),QA=function(e){JA(n,e);var t=KA(n);function n(){return HA(this,n),t.apply(this,arguments)}return qA(n,[{key:"name",get:function(){return"Users Application"}},{key:"channelName",get:function(){return c.USERS}},{key:"layoutOptions",get:function(){return{name:a.CURATOR_LAYOUT,options:{alertRegion:_}}}},{key:"index",value:function(e){this.layout.showChildView(I,l.createElement(VA,{query:e.query,cursor:e.cursor}))}}],[{key:"router",get:function(){return ZA}}]),n}(op);function XA(e){return(XA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ej(e){return function(e){if(Array.isArray(e))return tj(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return tj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tj(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rj(e,t){return(rj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ij(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=aj(e);if(t){var i=aj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return oj(this,n)}}function oj(e,t){return!t||"object"!==XA(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function aj(e){return(aj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Fifo="FifoMemoryCache"}(GA||(GA={}));var cj,sj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&rj(e,t)}(o,e);var t,n,r,i=ij(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this)).size=e.size,t.cache={},t.cachedkeys=[],t}return t=o,(n=[{key:"name",get:function(){return GA.Fifo}},{key:"removeCacheKey",value:function(e){this.cachedkeys=d.without(this.cachedkeys,e)}},{key:"has",value:function(e){return!!this.cache[e]}},{key:"get",value:function(e){return this.cache[e]}},{key:"set",value:function(e,t){e&&t||ds.c.throw(new ys.a("Must provide a cache key and a value to cache in FifoMemoryCache.")),this.has(e)&&this.removeCacheKey(e),this.cachedkeys.push(e),this.cache[e]=t,this.cachedkeys.length>this.size&&delete this.cache[this.cachedkeys.shift()]}},{key:"getOrSet",value:function(e,t){if(this.has(e))return this.get(e);var n=t();return this.set(e,n),n}},{key:"remove",value:function(e){return!!this.has(e)&&(delete this.cache[e],this.removeCacheKey(e),!0)}},{key:"invalidate",value:function(e,t){var n=this,r=d.object(this.cachedkeys,this.cachedkeys),i=[];d.each(e,(function(e){var t;r[e]&&i.push(e);var n=new RegExp(e,"i"),o=d.filter(r,(function(e){return n.test(e)}));(t=i).push.apply(t,ej(o))})),i.length&&(i=d.uniq(i),d.each(i,(function(e){delete n.cache[e],d.isFunction(t)&&t(e)})),this.cachedkeys=d.without.apply(d,[this.cachedkeys].concat(ej(i))))}}])&&nj(t.prototype,n),r&&nj(t,r),o}(ps.a),uj=n(17);!function(e){e[e.Unknown=0]="Unknown",e[e.BadRequest=1]="BadRequest",e[e.Unauthorized=2]="Unauthorized",e[e.Forbidden=3]="Forbidden",e[e.NotFound=4]="NotFound",e[e.InternalServer=5]="InternalServer"}(cj||(cj={}));var lj,fj={type:cj.Unknown,message:"",code:0};!function(e){e.Ajax="AjaxDataProvider",e.Notifications="NotificationsSignalRDataProvider"}(lj||(lj={}));var pj=function(e,t,n){if(!n||!n.errorCode)return e[t];var r="".concat(n.errorCode);return n.errorSubCode&&(r+=".".concat(n.errorSubCode)),e[r]||e[t]};function dj(e){return(dj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hj(e,t){return(hj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=bj(e);if(t){var i=bj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return vj(this,n)}}function vj(e,t){return!t||"object"!==dj(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function bj(e){return(bj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var gj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&hj(e,t)}(o,e);var t,n,r,i=yj(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=i.call(this,e),$.ajaxSetup({cache:!1,contentType:"application/json; charset=utf-8"}),t.successMiddleware={},t.errorMiddleware={},t.dataServiceErrorMessageMappings=e.dataServiceErrorMessageMappings,t.defaultErrorMessageKey=e.defaultErrorMessageKey,t}return t=o,(n=[{key:"name",get:function(){return lj.Ajax}},{key:"parseUrl",value:function(e){var t=document.createElement("a");return t.href=e,""===t.host&&(t.href=t.href),t}},{key:"makeHttps",value:function(e){var t=this.parseUrl(e);return"http:"===t.protocol&&(t.protocol="https:"),t.href}},{key:"base",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n||(n=se.a.GET);var i=d.defaults(r,{forceHttps:!1}),o={url:e,method:n,type:n};t&&(o.data=n===se.a.POST||n===se.a.PUT?JSON.stringify(t):t),i.forceHttps&&(o.url=this.makeHttps(o.url)),i.traditional&&(o.traditional=i.traditional);var a=$.ajax(o);return d.keys(this.successMiddleware).length&&a.done(d.values(this.successMiddleware)),d.keys(this.errorMiddleware).length&&a.fail(d.values(this.errorMiddleware)),a}},{key:"create",value:function(e,t,n){var r=n.channel,i=n.successEvent,o=n.errorEvent;this.base(e,t,se.a.POST).done((function(e,t,n){return r.trigger(i,e,t,n)})).fail((function(e,t,n){return r.trigger(o,e,t,n)}))}},{key:"read",value:function(e,t){var n=t.channel,r=t.successEvent,i=t.errorEvent;this.base(e,null,se.a.GET).done((function(e,t,i){n.trigger(r,e,t,i)})).fail((function(e,t,r){n.trigger(i,e,t,r)}))}},{key:"update",value:function(e,t,n){var r=n.channel,i=n.successEvent,o=n.errorEvent;this.base(e,t,se.a.PUT).done((function(e,t,n){return r.trigger(i,e,t,n)})).fail((function(e,t,n){return r.trigger(o,e,t,n)}))}},{key:"delete",value:function(e,t){var n=t.channel,r=t.successEvent,i=t.errorEvent;this.base(e,null,se.a.DELETE).done((function(e,t,i){return n.trigger(r,e,t,i)})).fail((function(e,t,r){return n.trigger(i,e,t,r)}))}},{key:"useMiddleware",value:function(e,t){this.successMiddleware[e]||(this.successMiddleware[e]=t)}},{key:"useErrorMiddleware",value:function(e,t){this.errorMiddleware[e]||(this.errorMiddleware[e]=t)}},{key:"parseError",value:function(e){var t=e.responseJSON,n=fj;switch(n.code=e.status,n.message=pj(this.dataServiceErrorMessageMappings,this.defaultErrorMessageKey,t),e.status){case 400:n.type=cj.BadRequest;break;case 401:n.type=cj.Unauthorized;break;case 403:n.type=cj.Forbidden;break;case 404:n.type=cj.NotFound;break;case 500:n.type=cj.InternalServer}return n}}])&&mj(t.prototype,n),r&&mj(t,r),o}(uj.Object);function Sj(e){return(Sj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ej(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oj(e,t){return"string"==typeof t.payload.dataOrKey&&void 0!==t.payload.keyData?Object.assign(Object.assign({},e),Ej({},t.payload.viewModelKey,Object.assign(Object.assign({},e[t.payload.viewModelKey]),Ej({},t.payload.dataOrKey,t.payload.keyData)))):("object"===Sj(t.payload.dataOrKey)&&Array.isArray(t.payload.dataOrKey),Object.assign(Object.assign({},e),Ej({},t.payload.viewModelKey,t.payload.dataOrKey)))}function Cj(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case kw.UPDATE:return Oj(e,t)}return e}var wj="LanguageDataService",Aj="locale",jj="phrases",Tj="language:data:service";function kj(e){return(kj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ij(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _j(e,t){return(_j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Nj(e);if(t){var i=Nj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return xj(this,n)}}function xj(e,t){return!t||"object"!==kj(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Nj(e){return(Nj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Rj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_j(e,t)}(o,e);var t,n,r,i=Pj(o);function o(){return Ij(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"name",get:function(){return wj}},{key:"channelName",get:function(){return Tj}},{key:"getLanguageConfig",value:function(e){var t={locale:"",phrases:null};this.get({resource:"/api/locale",eventPrefix:Aj,expiryTime:hy.STANDARD,bootstrapName:Up,callback:function(n){t.locale=n,t.phrases&&d.isFunction(e)&&e(t)}}),this.get({resource:"/api/phrases",eventPrefix:jj,expiryTime:hy.STANDARD,bootstrapName:Fp,callback:function(n){t.phrases=n,t.locale&&d.isFunction(e)&&e(t)}})}}])&&Lj(t.prototype,n),r&&Lj(t,r),o}(dy);n.d(t,"Layouts",(function(){return a})),n.d(t,"AppChannels",(function(){return c})),n.d(t,"DataChannels",(function(){return s})),n.d(t,"Actions",(function(){return i})),n.d(t,"DataPrefixes",(function(){return o})),n.d(t,"DataServices",(function(){return u})),n.d(t,"CuratorLayoutView",(function(){return z})),n.d(t,"LayoutComponent",(function(){return Y})),n.d(t,"CuratorAppNavService",(function(){return ae})),n.d(t,"CompaniesApplication",(function(){return Zf})),n.d(t,"CustomersApplication",(function(){return Td})),n.d(t,"DomainOptionsApplication",(function(){return wm})),n.d(t,"PeopleApplication",(function(){return nh})),n.d(t,"PlaylistsApplication",(function(){return XE})),n.d(t,"SeriesApplication",(function(){return TO})),n.d(t,"SubjectDataService",(function(){return Pv})),n.d(t,"SubjectDataServiceHelper",(function(){return Nv})),n.d(t,"SubjectsApplication",(function(){return HO})),n.d(t,"ThemesApplication",(function(){return bC})),n.d(t,"VideosApplication",(function(){return _w})),n.d(t,"DomainOptionsApplication",(function(){return wm})),n.d(t,"ReleaseNotesApplication",(function(){return RA})),n.d(t,"UsersApplication",(function(){return QA})),n.d(t,"Core",(function(){return p})),n.d(t,"InstanceManager",(function(){return dp})),n.d(t,"FifoMemoryCache",(function(){return sj})),n.d(t,"AjaxDataProvider",(function(){return gj})),n.d(t,"AlertList",(function(){return Dd})),n.d(t,"AlertType",(function(){return hp})),n.d(t,"BaseAlertService",(function(){return Ap})),n.d(t,"LanguageService",(function(){return js})),n.d(t,"Flight",(function(){return ce})),n.d(t,"CacheDurations",(function(){return hy})),n.d(t,"ViewModelReducer",(function(){return Cj})),n.d(t,"LanguageDataService",(function(){return Rj}))}])}));
|