@aarhus-university/au-lib-react-components 10.4.0 → 10.7.0
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/.eslintrc.js +7 -17
- package/.storybook/main.js +21 -0
- package/.storybook/preview-head.html +0 -0
- package/.storybook/preview.js +11 -0
- package/__tests__/jest/AUButtonComponent.test.tsx +165 -0
- package/__tests__/jest/AUModalComponent.test.tsx +116 -0
- package/__tests__/jest/AUSpinnerComponent.test.tsx +57 -0
- package/__tests__/jest/AUToolbarComponent.test.tsx +46 -0
- package/__tests__/jest/helpers.test.ts +15 -0
- package/__tests__/jest/setupTests.ts +2 -0
- package/babel.config.js +1 -0
- package/build/umd/alphabox.js +1 -1
- package/build/umd/alphabox.js.map +1 -1
- package/build/umd/databox.js +1 -1
- package/build/umd/databox.js.map +1 -1
- package/build/umd/diagramme.js +1 -1
- package/build/umd/diagramme.js.map +1 -1
- package/build/umd/flowbox.js +1 -1
- package/build/umd/flowbox.js.map +1 -1
- package/build/umd/universe.js +1 -1
- package/build/umd/universe.js.map +1 -1
- package/package.json +45 -5
- package/src/components/AUButtonComponent.tsx +83 -0
- package/src/components/AUModalComponent.tsx +16 -32
- package/src/components/AUSpinnerComponent.tsx +25 -83
- package/src/components/AUToolbarComponent.tsx +8 -1
- package/src/lib/hooks.ts +20 -16
- package/src/lib/tracking.ts +3 -3
- package/stories/AUButtonComponent.stories.tsx +86 -0
- package/stories/AUModalComponent.stories.tsx +92 -0
- package/stories/AUSpinnerComponent.stories.tsx +41 -0
- package/stories/AUToolbarComponent.stories.tsx +96 -0
- package/stories/assets/code-brackets.svg +1 -0
- package/stories/assets/colors.svg +1 -0
- package/stories/assets/comments.svg +1 -0
- package/stories/assets/direction.svg +1 -0
- package/stories/assets/flow.svg +1 -0
- package/stories/assets/plugin.svg +1 -0
- package/stories/assets/repo.svg +1 -0
- package/stories/assets/stackalt.svg +1 -0
package/build/umd/databox.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-dom"));else if("function"==typeof define&&define.amd)define(["react","react-dom"],t);else{var n="object"==typeof exports?t(require("react"),require("react-dom")):t(e.React,e.ReactDOM);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t)=>(()=>{var n={20:e=>{"use strict";var t="%[a-f0-9]{2}",n=new RegExp(t,"gi"),r=new RegExp("("+t+")+","gi");function o(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],o(n),o(r))}function i(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=o(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=r.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var o=i(n[0]);o!==n[0]&&(t[n[0]]=o)}n=r.exec(e)}t["%C2"]="�";for(var s=Object.keys(t),u=0;u<s.length;u++){var a=s[u];e=e.replace(new RegExp(a,"g"),t[a])}return e}(e)}}},806:e=>{"use strict";e.exports=function(e,t){for(var n={},r=Object.keys(e),o=Array.isArray(t),i=0;i<r.length;i++){var s=r[i],u=e[s];(o?-1!==t.indexOf(s):t(s,u,e))&&(n[s]=u)}return n}},296:(e,t,n)=>{var r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt,a="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,l="object"==typeof self&&self&&self.Object===Object&&self,c=a||l||Function("return this")(),g=Object.prototype.toString,d=Math.max,p=Math.min,f=function(){return c.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==g.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=i.test(e);return n||s.test(e)?u(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,s,u,a,l=0,c=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,i=o;return r=o=void 0,l=t,s=e.apply(i,n)}function v(e){return l=e,u=setTimeout(O,t),c?b(e):s}function S(e){var n=e-a;return void 0===a||n>=t||n<0||g&&e-l>=i}function O(){var e=f();if(S(e))return w(e);u=setTimeout(O,function(e){var n=t-(e-a);return g?p(n,i-(e-l)):n}(e))}function w(e){return u=void 0,y&&r?b(e):(r=o=void 0,s)}function x(){var e=f(),n=S(e);if(r=arguments,o=this,a=e,n){if(void 0===u)return v(a);if(g)return u=setTimeout(O,t),b(a)}return void 0===u&&(u=setTimeout(O,t)),s}return t=m(t)||0,h(n)&&(c=!!n.leading,i=(g="maxWait"in n)?d(m(n.maxWait)||0,t):i,y="trailing"in n?!!n.trailing:y),x.cancel=function(){void 0!==u&&clearTimeout(u),l=0,r=a=o=u=void 0},x.flush=function(){return void 0===u?s:w(f())},x}},703:(e,t,n)=>{"use strict";var r=n(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,s){if(s!==r){var u=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 u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bigint: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:i,resetWarningCache:o};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},563:(e,t,n)=>{"use strict";const r=n(610),o=n(20),i=n(500),s=n(806),u=Symbol("encodeFragmentIdentifier");function a(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function c(e,t){return t.decode?o(e):e}function g(e){return Array.isArray(e)?e.sort():"object"==typeof e?g(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function d(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function p(e){const t=(e=d(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function f(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function h(e,t){a((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const o="string"==typeof n&&n.includes(e.arrayFormatSeparator),i="string"==typeof n&&!o&&c(n,e).includes(e.arrayFormatSeparator);n=i?c(n,e):n;const s=o||i?n.split(e.arrayFormatSeparator).map((t=>c(t,e))):null===n?n:c(n,e);r[t]=s};case"bracket-separator":return(t,n,r)=>{const o=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!o)return void(r[t]=n?c(n,e):n);const i=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>c(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],i):r[t]=i};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const o of e.split("&")){if(""===o)continue;let[e,s]=i(t.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:c(s,t),n(c(e,t),s,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=f(n[e],t);else r[e]=f(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=g(n):e[t]=n,e}),Object.create(null))}t.extract=p,t.parse=h,t.stringify=(e,t)=>{if(!e)return"";a((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[",o,"]"].join("")]:[...n,[l(t,e),"[",l(o,e),"]=",l(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[]"].join("")]:[...n,[l(t,e),"[]=",l(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),":list="].join("")]:[...n,[l(t,e),":list=",l(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[l(n,e),t,l(o,e)].join("")]:[[r,l(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,l(t,e)]:[...n,[l(t,e),"=",l(r,e)].join("")]}}(t),o={};for(const t of Object.keys(e))n(t)||(o[t]=e[t]);const i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map((n=>{const o=e[n];return void 0===o?"":null===o?l(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?l(n,t)+"[]":o.reduce(r(n),[]).join("&"):l(n,t)+"="+l(o,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=i(e,"#");return Object.assign({url:n.split("?")[0]||"",query:h(p(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:c(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[u]:!0},n);const r=d(e.url).split("?")[0]||"",o=t.extract(e.url),i=t.parse(o,{sort:!1}),s=Object.assign(i,e.query);let a=t.stringify(s,n);a&&(a=`?${a}`);let c=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(c=`#${n[u]?l(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${a}${c}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[u]:!1},r);const{url:o,query:i,fragmentIdentifier:a}=t.parseUrl(e,r);return t.stringifyUrl({url:o,query:s(i,n),fragmentIdentifier:a},r)},t.exclude=(e,n,r)=>{const o=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return t.pick(e,o,r)}},394:(e,t,n)=>{"use strict";t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(244)),o=a(n(697)),i=a(n(444)),s=a(n(402)),u=n(581);function a(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function c(e){return c="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},c(e)}function g(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 d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(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"!==c(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S=function(){return!0},O=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&&b(e,t)}(l,e);var t,n,o,a=(t=l,function(){var e,n=y(t);if(m()){var r=y(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function l(e){var t,n=e.alwaysRenderSuggestions;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),v(h(t=a.call(this)),"onDocumentMouseDown",(function(e){t.justClickedOnSuggestionsContainer=!1;for(var n=e.detail&&e.detail.target||e.target;null!==n&&n!==document;){if(n.getAttribute&&null!==n.getAttribute("data-suggestion-index"))return;if(n===t.suggestionsContainer)return void(t.justClickedOnSuggestionsContainer=!0);n=n.parentNode}})),v(h(t),"storeAutowhateverRef",(function(e){null!==e&&(t.autowhatever=e)})),v(h(t),"onSuggestionMouseEnter",(function(e,n){var r=n.sectionIndex,o=n.itemIndex;t.updateHighlightedSuggestion(r,o),e.target===t.pressedSuggestion&&(t.justSelectedSuggestion=!0),t.justMouseEntered=!0,setTimeout((function(){t.justMouseEntered=!1}))})),v(h(t),"highlightFirstSuggestion",(function(){t.updateHighlightedSuggestion(t.props.multiSection?0:null,0)})),v(h(t),"onDocumentMouseUp",(function(){t.pressedSuggestion&&!t.justSelectedSuggestion&&t.input.focus(),t.pressedSuggestion=null})),v(h(t),"onSuggestionMouseDown",(function(e){t.justSelectedSuggestion||(t.justSelectedSuggestion=!0,t.pressedSuggestion=e.target)})),v(h(t),"onSuggestionsClearRequested",(function(){var e=t.props.onSuggestionsClearRequested;e&&e()})),v(h(t),"onSuggestionSelected",(function(e,n){var r=t.props,o=r.alwaysRenderSuggestions,i=r.onSuggestionSelected,s=r.onSuggestionsFetchRequested;i&&i(e,n),o?s({value:n.suggestionValue,reason:"suggestion-selected"}):t.onSuggestionsClearRequested(),t.resetHighlightedSuggestion()})),v(h(t),"onSuggestionClick",(function(e){var n=t.props,r=n.alwaysRenderSuggestions,o=n.focusInputOnSuggestionClick,i=t.getSuggestionIndices(t.findSuggestionElement(e.target)),s=i.sectionIndex,u=i.suggestionIndex,a=t.getSuggestion(s,u),l=t.props.getSuggestionValue(a);t.maybeCallOnChange(e,l,"click"),t.onSuggestionSelected(e,{suggestion:a,suggestionValue:l,suggestionIndex:u,sectionIndex:s,method:"click"}),r||t.closeSuggestions(),!0===o?t.input.focus():t.onBlur(),setTimeout((function(){t.justSelectedSuggestion=!1}))})),v(h(t),"onBlur",(function(){var e=t.props,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value,i=n.onBlur,s=t.getHighlightedSuggestion(),u=r(o);t.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!u}),i&&i(t.blurEvent,{highlightedSuggestion:s})})),v(h(t),"onSuggestionMouseLeave",(function(e){t.resetHighlightedSuggestion(!1),t.justSelectedSuggestion&&e.target===t.pressedSuggestion&&(t.justSelectedSuggestion=!1)})),v(h(t),"onSuggestionTouchStart",(function(){t.justSelectedSuggestion=!0})),v(h(t),"onSuggestionTouchMove",(function(){t.justSelectedSuggestion=!1,t.pressedSuggestion=null,t.input.focus()})),v(h(t),"itemProps",(function(e){return{"data-section-index":e.sectionIndex,"data-suggestion-index":e.itemIndex,onMouseEnter:t.onSuggestionMouseEnter,onMouseLeave:t.onSuggestionMouseLeave,onMouseDown:t.onSuggestionMouseDown,onTouchStart:t.onSuggestionTouchStart,onTouchMove:t.onSuggestionTouchMove,onClick:t.onSuggestionClick}})),v(h(t),"renderSuggestionsContainer",(function(e){var n=e.containerProps,r=e.children;return(0,t.props.renderSuggestionsContainer)({containerProps:n,children:r,query:t.getQuery()})})),t.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null},t.justPressedUpDown=!1,t.justMouseEntered=!1,t.pressedSuggestion=null,t}return n=l,o=[{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:"UNSAFE_componentWillReceiveProps",value:function(e){(0,i.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,o=n.onSuggestionHighlighted,s=n.highlightFirstSuggestion;if(!(0,i.default)(r,e.suggestions)&&r.length>0&&s)this.highlightFirstSuggestion();else if(o){var u=this.getHighlightedSuggestion();u!=t.highlightedSuggestion&&o({suggestion:u})}}},{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(o){var i=o.valueBeforeUpDown;return null===t?i=null:null===i&&void 0!==n&&(i=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:i}}))}},{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,o=n.multiSection,i=n.getSectionSuggestions;return o?i(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(t.getAttribute&&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,o=r.value,i=r.onChange;t!==o&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value;return t.length>0&&r(o)}},{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,o=t.renderInputComponent,i=t.onSuggestionsFetchRequested,a=t.renderSuggestion,l=t.inputProps,c=t.multiSection,g=t.renderSectionTitle,p=t.id,f=t.getSectionSuggestions,h=t.theme,m=t.getSuggestionValue,y=t.alwaysRenderSuggestions,b=t.highlightFirstSuggestion,v=this.state,O=v.isFocused,w=v.isCollapsed,x=v.highlightedSectionIndex,I=v.highlightedSuggestionIndex,j=v.valueBeforeUpDown,k=y?S:this.props.shouldRenderSuggestions,C=l.value,R=l.onFocus,P=l.onKeyDown,E=this.willRenderSuggestions(this.props),_=y||O&&!w&&E,q=_?n:[],D=d({},l,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=k(C);e.setState({isFocused:!0,isCollapsed:!n}),R&&R(t),n&&i({value:C,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,r=k(n);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(d({},b?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!r})),r?i({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var o=t.keyCode;switch(o){case 40:case 38:if(w)k(C)&&(i({value:C,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var s,u=r.newHighlightedSectionIndex,a=r.newHighlightedItemIndex;s=null===a?null===j?C:j:e.getSuggestionValueByIndex(u,a),e.updateHighlightedSuggestion(u,a,C),e.maybeCallOnChange(t,s,40===o?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout((function(){e.justPressedUpDown=!1}));break;case 13:if(229===t.keyCode)break;var l=e.getHighlightedSuggestion();if(_&&!y&&e.closeSuggestions(),null!=l){var c=m(l);e.maybeCallOnChange(t,c,"enter"),e.onSuggestionSelected(t,{suggestion:l,suggestionValue:c,suggestionIndex:I,sectionIndex:x,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout((function(){e.justSelectedSuggestion=!1}))}break;case 27:_&&t.preventDefault();var g=_&&!y;null===j?g||(e.maybeCallOnChange(t,"","escape"),k("")?i({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()):e.maybeCallOnChange(t,j,"escape"),g?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}P&&P(t)}}),T={query:this.getQuery()};return r.default.createElement(s.default,{multiSection:c,items:q,renderInputComponent:o,renderItemsContainer:this.renderSuggestionsContainer,renderItem:a,renderItemData:T,renderSectionTitle:g,getSectionItems:f,highlightedSectionIndex:x,highlightedItemIndex:I,inputProps:D,itemProps:this.itemProps,theme:(0,u.mapToAutowhateverTheme)(h),id:p,ref:this.storeAutowhateverRef})}}],o&&p(n.prototype,o),l}(r.Component);t.default=O,v(O,"propTypes",{suggestions:o.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){if("function"!=typeof e[t])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:o.default.func,onSuggestionHighlighted:o.default.func,renderInputComponent:o.default.func,renderSuggestionsContainer:o.default.func,getSuggestionValue:o.default.func.isRequired,renderSuggestion:o.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!Object.prototype.hasOwnProperty.call(n,"value"))throw new Error("'inputProps' must have 'value'.");if(!Object.prototype.hasOwnProperty.call(n,"onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:o.default.func,alwaysRenderSuggestions:o.default.bool,multiSection:o.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:o.default.bool,highlightFirstSuggestion:o.default.bool,theme:o.default.object,id:o.default.string}),v(O,"defaultProps",{renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return r.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:u.defaultTheme,id:"1"})},402:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==f(e)&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(244)),o=l(n(697)),i=l(n(383)),s=l(n(379)),u=l(n(752)),a=l(n(210));function l(e){return e&&e.__esModule?e:{default:e}}function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function g(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 d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(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 f(e){return f="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},f(e)}function h(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 m(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?y(e):t}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function S(e,t){return S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},S(e,t)}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w={},x=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&&S(e,t)}(c,e);var t,n,o,l=(t=c,function(){var e,n=v(t);if(b()){var r=v(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return m(this,e)});function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),O(y(t=l.call(this,e)),"storeInputReference",(function(e){null!==e&&(t.input=e);var n=t.props.inputProps.ref;n&&("function"==typeof n?n(e):"object"===f(n)&&Object.prototype.hasOwnProperty.call(n,"current")&&(n.current=e))})),O(y(t),"storeItemsContainerReference",(function(e){null!==e&&(t.itemsContainer=e)})),O(y(t),"onHighlightedItemChange",(function(e){t.highlightedItem=e})),O(y(t),"getItemId",(function(e,n){if(null===n)return null;var r=t.props.id,o=null===e?"":"section-".concat(e);return"react-autowhatever-".concat(r,"-").concat(o,"-item-").concat(n)})),O(y(t),"onFocus",(function(e){var n=t.props.inputProps;t.setState({isInputFocused:!0}),n.onFocus&&n.onFocus(e)})),O(y(t),"onBlur",(function(e){var n=t.props.inputProps;t.setState({isInputFocused:!1}),n.onBlur&&n.onBlur(e)})),O(y(t),"onKeyDown",(function(e){var n,r,o=t.props,i=o.inputProps,s=o.highlightedSectionIndex,u=o.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var a="ArrowDown"===e.key?"next":"prev",l=(n=t.sectionIterator[a]([s,u]),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var s,u=e[Symbol.iterator]();!(r=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}}(n,r)||function(e,t){if(e){if("string"==typeof e)return p(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(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=l[0],g=l[1];i.onKeyDown(e,{newHighlightedSectionIndex:c,newHighlightedItemIndex:g});break;default:i.onKeyDown(e,{highlightedSectionIndex:s,highlightedItemIndex:u})}})),t.highlightedItem=null,t.state={isInputFocused:!1},t.setSectionsItems(e),t.setSectionIterator(e),t.setTheme(e),t}return n=c,(o=[{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,i.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,s.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,o=n.id,i=n.items,s=n.renderItem,l=n.renderItemData,c=n.renderSectionTitle,g=n.highlightedSectionIndex,d=n.highlightedItemIndex,p=n.itemProps;return i.map((function(n,i){var f="react-autowhatever-".concat(o,"-"),h="".concat(f,"section-").concat(i,"-"),m=0===i;return r.default.createElement("div",t("".concat(h,"container"),"sectionContainer",m&&"sectionContainerFirst"),r.default.createElement(u.default,{section:n,renderSectionTitle:c,theme:t,sectionKeyPrefix:h}),r.default.createElement(a.default,{items:e.sectionsItems[i],itemProps:p,renderItem:s,renderItemData:l,sectionIndex:i,highlightedItemIndex:g===i?d:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:f,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,o=n.id,i=n.renderItem,s=n.renderItemData,u=n.highlightedSectionIndex,l=n.highlightedItemIndex,c=n.itemProps;return r.default.createElement(a.default,{items:e,itemProps:c,renderItem:i,renderItemData:s,highlightedItemIndex:null===u?l:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-".concat(o,"-")})}},{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,o=t.multiSection,i=t.renderInputComponent,s=t.renderItemsContainer,u=t.highlightedSectionIndex,a=t.highlightedItemIndex,l=this.state.isInputFocused,c=o?this.renderSections():this.renderItems(),g=null!==c,p=this.getItemId(u,a),f="react-autowhatever-".concat(n),h=d({role:"combobox","aria-haspopup":"listbox","aria-owns":f,"aria-expanded":g},e("react-autowhatever-".concat(n,"-container"),"container",g&&"containerOpen"),{},this.props.containerProps),m=i(d({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":f,"aria-activedescendant":p},e("react-autowhatever-".concat(n,"-input"),"input",g&&"inputOpen",l&&"inputFocused"),{},this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),y=s({containerProps:d({id:f,role:"listbox"},e("react-autowhatever-".concat(n,"-items-container"),"itemsContainer",g&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:c});return r.default.createElement("div",h,m,y)}}])&&h(n.prototype,o),c}(r.Component);t.default=x,O(x,"propTypes",{id:o.default.string,multiSection:o.default.bool,renderInputComponent:o.default.func,renderItemsContainer:o.default.func,items:o.default.array.isRequired,renderItem:o.default.func,renderItemData:o.default.object,renderSectionTitle:o.default.func,getSectionItems:o.default.func,containerProps:o.default.object,inputProps:o.default.object,itemProps:o.default.oneOfType([o.default.object,o.default.func]),highlightedSectionIndex:o.default.number,highlightedItemIndex:o.default.number,theme:o.default.oneOfType([o.default.object,o.default.array])}),O(x,"defaultProps",{id:"1",multiSection:!1,renderInputComponent:function(e){return r.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return r.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:w,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:w,inputProps:w,itemProps:w,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"}})},314:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(244)),o=s(n(697)),i=s(n(770));function s(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},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},a(e)}function l(){return l=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},l.apply(this,arguments)}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 g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(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 p(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?f(e):t}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=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&&y(e,t)}(u,e);var t,n,o,s=(t=u,function(){var e,n=m(t);if(h()){var r=m(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return p(this,e)});function u(){var e;g(this,u);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return b(f(e=s.call.apply(s,[this].concat(n))),"storeItemReference",(function(t){null!==t&&(e.item=t)})),b(f(e),"onMouseEnter",(function(t){var n=e.props,r=n.sectionIndex,o=n.itemIndex;e.props.onMouseEnter(t,{sectionIndex:r,itemIndex:o})})),b(f(e),"onMouseLeave",(function(t){var n=e.props,r=n.sectionIndex,o=n.itemIndex;e.props.onMouseLeave(t,{sectionIndex:r,itemIndex:o})})),b(f(e),"onMouseDown",(function(t){var n=e.props,r=n.sectionIndex,o=n.itemIndex;e.props.onMouseDown(t,{sectionIndex:r,itemIndex:o})})),b(f(e),"onClick",(function(t){var n=e.props,r=n.sectionIndex,o=n.itemIndex;e.props.onClick(t,{sectionIndex:r,itemIndex:o})})),e}return n=u,o=[{key:"shouldComponentUpdate",value:function(e){return(0,i.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,o=e.renderItem,i=e.renderItemData,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete s.sectionIndex,delete s.itemIndex,"function"==typeof s.onMouseEnter&&(s.onMouseEnter=this.onMouseEnter),"function"==typeof s.onMouseLeave&&(s.onMouseLeave=this.onMouseLeave),"function"==typeof s.onMouseDown&&(s.onMouseDown=this.onMouseDown),"function"==typeof s.onClick&&(s.onClick=this.onClick),r.default.createElement("li",l({role:"option"},s,{ref:this.storeItemReference}),o(n,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({isHighlighted:t},i)))}}],o&&d(n.prototype,o),u}(r.Component);t.default=v,b(v,"propTypes",{sectionIndex:o.default.number,isHighlighted:o.default.bool.isRequired,itemIndex:o.default.number.isRequired,item:o.default.any.isRequired,renderItem:o.default.func.isRequired,renderItemData:o.default.object.isRequired,onMouseEnter:o.default.func,onMouseLeave:o.default.func,onMouseDown:o.default.func,onClick:o.default.func})},210:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==l(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(244)),o=u(n(697)),i=u(n(314)),s=u(n(770));function u(e){return e&&e.__esModule?e:{default:e}}function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function l(e){return l="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},l(e)}function c(){return c=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},c.apply(this,arguments)}function g(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 d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(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"!==l(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S=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&&b(e,t)}(a,e);var t,n,o,u=(t=a,function(){var e,n=y(t);if(m()){var r=y(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function a(){var e;d(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v(h(e=u.call.apply(u,[this].concat(n))),"storeHighlightedItemReference",(function(t){e.props.onHighlightedItemChange(null===t?null:t.item)})),e}return n=a,o=[{key:"shouldComponentUpdate",value:function(e){return(0,s.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,o=t.itemProps,s=t.renderItem,u=t.renderItemData,a=t.sectionIndex,l=t.highlightedItemIndex,d=t.getItemId,p=t.theme,f=t.keyPrefix,h=null===a?f:"".concat(f,"section-").concat(a,"-"),m="function"==typeof o;return r.default.createElement("ul",c({role:"listbox"},p("".concat(h,"items-list"),"itemsList")),n.map((function(t,n){var f=0===n,y=n===l,b="".concat(h,"item-").concat(n),S=m?o({sectionIndex:a,itemIndex:n}):o,O=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({id:d(a,n),"aria-selected":y},p(b,"item",f&&"itemFirst",y&&"itemHighlighted"),{},S);return y&&(O.ref=e.storeHighlightedItemReference),r.default.createElement(i.default,c({},O,{sectionIndex:a,isHighlighted:y,itemIndex:n,item:t,renderItem:s,renderItemData:u}))})))}}],o&&p(n.prototype,o),a}(r.Component);t.default=S,v(S,"propTypes",{items:o.default.array.isRequired,itemProps:o.default.oneOfType([o.default.object,o.default.func]),renderItem:o.default.func.isRequired,renderItemData:o.default.object.isRequired,sectionIndex:o.default.number,highlightedItemIndex:o.default.number,onHighlightedItemChange:o.default.func.isRequired,getItemId:o.default.func.isRequired,theme:o.default.func.isRequired,keyPrefix:o.default.string.isRequired}),v(S,"defaultProps",{sectionIndex:null})},752:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(244)),o=s(n(697)),i=s(n(770));function s(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},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},a(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(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 g(e,t){return!t||"object"!==a(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 d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}var h,m,y,b=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)}(u,e);var t,n,o,s=(t=u,function(){var e,n=p(t);if(d()){var r=p(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return g(this,e)});function u(){return l(this,u),s.apply(this,arguments)}return n=u,(o=[{key:"shouldComponentUpdate",value:function(e){return(0,i.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,o=e.theme,i=e.sectionKeyPrefix,s=n(t);return s?r.default.createElement("div",o("".concat(i,"title"),"sectionTitle"),s):null}}])&&c(n.prototype,o),u}(r.Component);t.default=b,h=b,m="propTypes",y={section:o.default.any.isRequired,renderSectionTitle:o.default.func.isRequired,theme:o.default.func.isRequired,sectionKeyPrefix:o.default.string.isRequired},m in h?Object.defineProperty(h,m,{value:y,enumerable:!0,configurable:!0,writable:!0}):h[m]=y},770:(e,t)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!0;var s,u,a={};for(s=0,u=r.length;s<u;s++)a[r[s]]=!0;for(s=0,u=o.length;s<u;s++){var l=o[s],c=e[l],g=t[l];if(c!==g){if(!a[l]||null===c||null===g||"object"!==n(c)||"object"!==n(g))return!0;var d=Object.keys(c),p=Object.keys(g);if(d.length!==p.length)return!0;for(var f=0,h=d.length;f<h;f++){var m=d[f];if(c[m]!==g[m])return!0}}}return!1}},808:(e,t,n)=>{"use strict";e.exports=n(394).default},581:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapToAutowhateverTheme=t.defaultTheme=void 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}},379:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function r(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,i=(o=n(894))&&o.__esModule?o:{default:o},s=function(e){return e};t.default=function(e){var t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var s,u=e[Symbol.iterator]();!(r=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(Array.isArray(e)&&2===e.length?e:[e,null],2),n=t[0],o=t[1];return function(e){for(var t=arguments.length,u=Array(t>1?t-1:0),a=1;a<t;a++)u[a-1]=arguments[a];var l=u.map((function(e){return n[e]})).filter(s);return"string"==typeof l[0]||"function"==typeof o?{key:e,className:o?o.apply(void 0,r(l)):l.join(" ")}:{key:e,style:i.default.apply(void 0,[{}].concat(r(l)))}}},e.exports=t.default},894:e=>{"use strict";var t=Object.prototype.propertyIsEnumerable;function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(e){var n=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e))),n.filter((function(n){return t.call(e,n)}))}e.exports=Object.assign||function(e,t){for(var o,i,s=n(e),u=1;u<arguments.length;u++){o=arguments[u],i=r(Object(o));for(var a=0;a<i.length;a++)s[i[a]]=o[i[a]]}return s}},383:e=>{"use strict";var t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var s,u=e[Symbol.iterator]();!(r=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var n=e.data,r=e.multiSection;function o(e){var o=t(e,2),i=o[0],s=o[1];return r?null===s||s===n[i]-1?null===(i=function(e){for(null===e?e=0:e++;e<n.length&&0===n[e];)e++;return e===n.length?null:e}(i))?[null,null]:[i,0]:[i,s+1]:0===n||s===n-1?[null,null]:null===s?[null,0]:[null,s+1]}return{next:o,prev:function(e){var o=t(e,2),i=o[0],s=o[1];return r?null===s||0===s?null===(i=function(e){for(null===e?e=n.length-1:e--;e>=0&&0===n[e];)e--;return-1===e?null:e}(i))?[null,null]:[i,n[i]-1]:[i,s-1]:0===n||0===s?[null,null]:null===s?[null,n-1]:[null,s-1]},isLast:function(e){return null===o(e)[1]}}}},444:e=>{"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}},500:e=>{"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},610:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},244:t=>{"use strict";t.exports=e},741:e=>{"use strict";e.exports=t}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";o.r(i);var e=o(244),t=o.n(e),n=o(741),r=o.n(n),s=o(697),u=o.n(s),a=o(563),l=o(808),c=o.n(l),g=o(296),d=o.n(g);class p extends t().Component{constructor(e){super(e),this.state={value:"",suggestions:[],noSuggestions:!1},this.onChange=this.onChange.bind(this),this.onEnter=this.onEnter.bind(this),this.onSuggestionsFetchRequested=d()(this.onSuggestionsFetchRequested.bind(this),400),this.onSuggestionsClearRequested=this.onSuggestionsClearRequested.bind(this),this.onSuggestionSelected=this.onSuggestionSelected.bind(this)}onChange(e,{newValue:t}){const{setQuery:n}=this.props;this.setState({value:t},(()=>{n(t)}))}onEnter(e){const{suggestions:t}=this.state,{setResults:n}=this.props;"Enter"===e.key&&n(t)}onSuggestionsFetchRequested({value:e}){const{getSuggestions:t,collection:n}=this.props;t(e,n,(t=>{this.setState({suggestions:t,noSuggestions:0===t.length&&""!==e.trim()&&e.trim().length>1})}))}onSuggestionsClearRequested(){this.setState({suggestions:[]})}onSuggestionSelected(e,{suggestion:t}){const{setResults:n,clearInput:r}=this.props;n([t]),r&&this.setState({value:""})}render(){const{value:e,suggestions:n,noSuggestions:r}=this.state,{placeholder:o,getSuggestionValue:i,renderSuggestion:s,id:u,theme:a,type:l,initialValue:g,disabled:d,noResultsText:p}=this.props,f={placeholder:o,value:g||e,id:u,type:l,disabled:d,"aria-label":o,onChange:this.onChange,onKeyDown:this.onEnter};return t().createElement(t().Fragment,null,t().createElement(c(),{suggestions:n,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,onSuggestionSelected:this.onSuggestionSelected,getSuggestionValue:i,renderSuggestion:s,inputProps:f,theme:a}),r&&p&&t().createElement("p",{className:"no-results"},t().createElement("em",null,p)))}}p.displayName="AUAutoSuggestComponent",p.defaultProps={id:"autosuggest1",theme:{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"},clearInput:!1,type:"text",initialValue:"",disabled:!1,setQuery:()=>{},noResultsText:""},p.propTypes={setQuery:u().func,getSuggestions:u().func.isRequired,getSuggestionValue:u().func.isRequired,renderSuggestion:u().func.isRequired,setResults:u().func.isRequired,collection:u().arrayOf(u().shape({})).isRequired,placeholder:u().string.isRequired,id:u().string,theme:u().shape({}),clearInput:u().bool,type:u().string,initialValue:u().string,disabled:u().bool,noResultsText:u().string};const f=p;class h extends t().Component{constructor(e){super(e),this.state={item:e.item}}static getDerivedStateFromProps(e,t){return e.item.id!==t.item.id?{item:e.item}:null}render(){const{item:e}=this.state;return t().createElement("span",null,e.name)}}h.propTypes={item:u().shape({id:u().number.isRequired}).isRequired},h.displayName="DataBoxSuggestionComponent";const m=h;class y extends t().Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this),this.handleChange=this.handleChange.bind(this)}handleClick(){const{setActive:e,active:t,index:n}=this.props;e(t?0:n+1)}handleChange(e){const{value:t}=e.target,{setSearchValue:n}=this.props,r=`${[window.location.protocol,"//",window.location.host,window.location.pathname].join("")}?initval=${t}`;window.history.replaceState({initVal:t},document.title,r),n(t)}render(){const{button:e,index:n,box:r,active:o,getSuggestions:i,searchValue:s}=this.props,u=n+1,a=r.background;let l=`db-button button-${u}`;const c=r.search.index===u;return a.overlay&&(l+=" overlay"),c&&(l+=" db-search"),o&&!c&&(l+=" active"),c?r.search.autocomplete?t().createElement("div",{className:l,key:u},t().createElement("span",{dangerouslySetInnerHTML:{__html:e.text}}),t().createElement(f,{placeholder:r.search.placeHolder,setQuery:()=>{},setResults:e=>{1===e.length&&e[0].url&&(window.location.href=e[0].url)},collection:[],getSuggestions:i,getSuggestionValue:e=>e.name,renderSuggestion:e=>t().createElement(m,{item:e})})):t().createElement("div",{className:l,key:u},t().createElement("span",null,e.text),t().createElement("input",{type:"text",value:s,placeholder:r.search.placeHolder,onChange:this.handleChange})):""!==e.link?t().createElement("div",{key:u,role:"button",tabIndex:"0",onClick:this.handleClick,onKeyUp:()=>{},className:l},t().createElement("span",null,t().createElement("a",{href:e.link},e.text))):t().createElement("div",{key:u,role:"button",tabIndex:"0",onClick:this.handleClick,onKeyUp:()=>{},className:l},t().createElement("span",null,e.text))}}y.defaultProps={searchValue:""},y.propTypes={active:u().bool.isRequired,index:u().number.isRequired,searchValue:u().string,setActive:u().func.isRequired,setSearchValue:u().func.isRequired,button:u().shape({text:u().string.isRequired,link:u().string.isRequired}).isRequired,box:u().shape({background:u().shape({color:u().string.isRequired,linkColor:u().string.isRequired,src:u().string.isRequired,height:u().number.isRequired,text:u().string.isRequired,overlay:u().bool.isRequired}).isRequired,search:u().shape({index:u().number.isRequired,autocomplete:u().bool.isRequired,placeHolder:u().string.isRequired}).isRequired}).isRequired,getSuggestions:u().func.isRequired},y.displayName="DataBoxButtonComponent";const b=y,v=(e,t)=>void 0!==e.name&&void 0!==t.name?e.name.toLowerCase().localeCompare(t.name.toLowerCase(),"da",{ignorePunctuation:!0}):0,S=e=>{const{assoc:n}=e,r=n.items.sort(v).map((e=>{if(e.children.length>0){const n=e.children.sort(v).map((e=>t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))));return t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name),t().createElement("ul",null,n))}return t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))}));return t().createElement("div",null,t().createElement("ul",null,r))};S.propTypes={assoc:u().shape({items:u().arrayOf(u().shape({})).isRequired}).isRequired},S.displayName="DataBoxStackedAssociationComponent";const O=S;class w extends t().Component{constructor(e){super(e),this.state={collapsed:e.collapsed}}componentDidMount(){const{attributes:e}=this.props;e.forEach((e=>{if(e.selector){const t=this.node.querySelector(e.selector);t&&t.setAttribute(e.attr,e.value)}else this.node.setAttribute(e.attr,e.value)}))}render(){const{header:e,level:n,content:r,classNames:o,onClick:i,children:s,dataID:u,headerElement:a}=this.props,{collapsed:l}=this.state;let c="csc-frame au_collapsible";return l&&(c+=" au_collapsed"),o&&(c+=` ${o}`),t().createElement("div",{"data-id":u,ref:e=>{this.node=e},className:c},(()=>n>-1?t().createElement("div",{className:"csc-header",onClick:()=>{this.setState((e=>({collapsed:!e.collapsed})),(()=>{const{collapsed:e}=this.state;i(e,this.node)}))},onKeyUp:()=>{},role:"button",tabIndex:0},(()=>{switch(n){case 0:return a;case 1:return t().createElement("h1",null,e);case 2:return t().createElement("h2",null,e);case 3:return t().createElement("h3",null,e);case 4:return t().createElement("h4",null,e);case 5:return t().createElement("h5",null,e);default:return t().createElement("h6",null,e)}})()):null)(),s||r)}}w.defaultProps={dataID:null,children:null,content:null,header:"",headerElement:null,level:1,classNames:"",onClick:()=>{},attributes:[]},w.propTypes={dataID:u().string,children:u().element,collapsed:u().bool.isRequired,header:u().string,headerElement:u().element,level:u().number,content:u().element,classNames:u().string,onClick:u().func,attributes:u().arrayOf(u().shape({attr:u().string,value:u().string,selector:u().string}))},w.displayName="AUCollapsibleComponent";const x=w;class I extends t().Component{constructor(e){super(e),this.state={open:e.open},this.handleClick=this.handleClick.bind(this)}handleClick(){const{rememberState:e,boxID:t,grouping:n,index:r}=this.props,{open:o}=this.state;e&&(o?sessionStorage.removeItem(`box-${t}-group-${n}-index-${r}`):sessionStorage.setItem(`box-${t}-group-${n}-index-${r}`,!0)),this.setState((e=>({open:!e.open})))}render(){const{open:e}=this.state,{assoc:n}=this.props,{items:r}=n,o=r.sort(v).map((e=>{if(e.children.length>0){const n=e.children.sort(v).map((e=>t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))));return t().createElement("li",{key:e.id},e.url?t().createElement("a",{href:e.url},e.name):t().createElement("span",null,e.name),t().createElement("ul",null,n))}return t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))})),i=t().createElement("ul",null,o);return t().createElement(x,{key:e,collapsed:!e,level:3,header:n.name,content:i,onClick:this.handleClick})}}I.defaultProps={},I.propTypes={boxID:u().number.isRequired,grouping:u().number.isRequired,assoc:u().shape({name:u().string.isRequired,items:u().arrayOf(u().shape({})).isRequired}).isRequired,index:u().number.isRequired,open:u().bool.isRequired,rememberState:u().bool.isRequired},I.displayName="DataBoxAssociationComponent";const j=I,k=e=>{const{stacked:n,grouping:r,expand:o,rememberState:i,boxID:s}=e;let u;return u=n&&1===r.associations.length?e.grouping.associations.map((e=>t().createElement(O,{key:e.id,assoc:e}))):e.grouping.associations.map(((e,n)=>{const u=o||1===r.associations.length||i&&sessionStorage.getItem(`box-${s}-group-${r.id}-index-${n}`);return t().createElement(j,{key:e.id,open:u,boxID:s,rememberState:i,grouping:r.id,index:n,assoc:e})})),t().createElement("div",{id:`box-${s}-grouping-${r.id}`},u)};k.defaultProps={},k.propTypes={boxID:u().number.isRequired,stacked:u().bool.isRequired,expand:u().bool.isRequired,rememberState:u().bool.isRequired,grouping:u().shape({id:u().number.isRequired,associations:u().arrayOf(u().shape({})).isRequired}).isRequired},k.displayName="DataBoxGroupingComponent";const C=k,R=e=>{const{items:n,searchValue:r}=e,o=n.sort(v).filter((e=>e.name.toLowerCase().indexOf(r.toLowerCase())>-1)).map((e=>t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))));return t().createElement("div",null,t().createElement("ul",null,o))};R.propTypes={items:u().arrayOf(u().shape({id:u().number.isRequired,url:u().string.isRequired,name:u().string.isRequired})).isRequired,searchValue:u().string.isRequired},R.displayName="DataBoxSearchResultComponent";const P=R;class E extends t().Component{constructor(e){super(e),this.letters=["...","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","æ","ø","å"],this.state={letterIndex:this.letters.indexOf(e.initLetter.toLowerCase())}}render(){const{letterIndex:e}=this.state,{linkColor:n,rememberState:r,boxID:o}=this.props,i=this.letters.map(((i,s)=>{const{items:u}=this.props,a=0===s||u.filter((e=>0===e.name.toLowerCase().indexOf(i))).length>0;let l="";a&&(l+="available"),s===e&&(l+=" active");let c={};return a&&(c=e===s?{backgroundColor:"#fff",color:n}:{backgroundColor:n}),t().createElement("li",{key:i,className:l},t().createElement("button",{type:"button",style:c,onClick:()=>{a&&(this.setState({letterIndex:s}),r&&sessionStorage.setItem(`box-alphabet-${o}`,this.letters[s]))}},i))}));let{items:s}=this.props;0!==e&&(s=s.filter((t=>0===t.name.toLowerCase().indexOf(this.letters[e]))));const u=s.sort(v).map((e=>{const n=e.children.map((e=>t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))));return e.children.length>0?t().createElement("li",{key:e.id},e.url?t().createElement("a",{href:e.url},e.name):t().createElement("span",null,e.name),t().createElement("ul",null,n)):e.parent?null:t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))}));return t().createElement("div",null,t().createElement("ul",{className:"letters"},i),t().createElement("ul",null,u))}}E.defaultProps={},E.propTypes={initLetter:u().string.isRequired,items:u().arrayOf(u().shape({})).isRequired,linkColor:u().string.isRequired,rememberState:u().bool.isRequired,boxID:u().number.isRequired},E.displayName="DataBoxAlphabetComponent";const _=E;class q extends t().Component{constructor(e){super(e),this.state={loading:!0,visible:e.visible},this.lazyLoad=this.lazyLoad.bind(this)}componentDidMount(){this.lazyLoad(),window.addEventListener("scroll",(()=>{this.lazyLoad()}))}componentDidUpdate(){this.lazyLoad()}static getDerivedStateFromProps(e,t){return e.visible!==t.visible?{visible:e.visible}:null}lazyLoad(){const{loadingCondition:e,loaded:t,domID:n,onLoad:r}=this.props,{loading:o,visible:i}=this.state,s=document.getElementById(n);!t&&o&&e&&(i||(e=>{if(null===e)return!1;const t=e.getBoundingClientRect();return t.bottom>0&&t.right>0&&t.left<(window.innerWidth||document.documentElement.clientWidth)&&t.top<(window.innerHeight||document.documentElement.clientHeight)})(s))&&this.setState({loading:!1},(()=>{r()}))}render(){const{columns:e,content:n,loaded:r,domID:o,children:i}=this.props;return r?i||n:t().createElement("div",{id:o,className:`cell column ${e}`},t().createElement("p",{className:"spinner"}))}}q.defaultProps={domID:"au-spinner-component",visible:!1,columns:"large-12 medium-12 small-12",content:null,children:null,onLoad:()=>{}},q.propTypes={domID:u().string,visible:u().bool,columns:u().string,content:u().element,children:u().element,loaded:u().bool.isRequired,loadingCondition:u().bool.isRequired,onLoad:u().func},q.displayName="AUSpinnerComponent";const D=q;class T extends t().Component{constructor(e){super(e);const t=(0,a.parse)(window.location.search),n=e.box.config,{stacked:r}=n,o=n.rememberState&&sessionStorage.getItem(`box-header-${e.box.id}`)?parseInt(sessionStorage.getItem(`box-header-${e.box.id}`),10):e.box.config.trigger;this.state={active:o,rawData:null,items:[],groupings:[],stacked:r,searchValue:void 0===t.initval?"":decodeURIComponent(t.initval)},this.setActive=this.setActive.bind(this),this.setSearchValue=this.setSearchValue.bind(this),this.getSuggestions=this.getSuggestions.bind(this)}componentDidMount(){const{parse:e,box:t}=this.props,{searchValue:n}=this.state;e(t.data.source,(e=>{const{items:t,groupings:n,rawData:r}=e;this.setState({items:t,groupings:n||[],rawData:r})})),""!==n&&this.setSearchValue(n)}componentDidUpdate(){const{box:e}=this.props,{rawData:t,items:n,groupings:r}=this.state,o=e.data;"function"==typeof o.callback&&o.callback(t||{items:n,groupings:r})}setActive(e){const{box:t}=this.props;this.setState({active:e}),t.config.rememberState&&sessionStorage.setItem(`box-header-${t.id}`,e)}setSearchValue(e){const{box:t}=this.props;t.search.autocomplete||this.setState({searchValue:e,active:""===e?0:t.search.index})}getSuggestions(e,t,n){const{items:r}=this.state,o=e.trim().toLowerCase();n(o.length<2?[]:r.filter((e=>e.name.toLowerCase().indexOf(o)>-1)).sort(v))}render(){const{box:e}=this.props,{active:n,items:r,searchValue:o,groupings:i,stacked:s}=this.state,u=e.config,a=e.background,l=t().createElement("div",{className:"content"},(()=>{const u=e.search.index,a=e.config.alphabet,l=e.config.rememberState&&sessionStorage.getItem(`box-alphabet-${e.id}`)?sessionStorage.getItem(`box-alphabet-${e.id}`):e.config.initLetter;if(n===a)return t().createElement(_,{boxID:e.id,rememberState:e.config.rememberState,initLetter:l,color:e.background.color,linkColor:e.background.linkColor,items:r});if(""!==o&&!e.search.autocomplete)return t().createElement(P,{items:r,searchValue:o});let c=0;u>0&&(c=u>n?0:1);let g=0;a>0&&(g=a>n?0:1);const d=i[n-c-g-1];return d?t().createElement(C,{boxID:e.id,rememberState:e.config.rememberState,stacked:s,grouping:d,expand:e.config.expand}):t().createElement("div",{className:`box-${e.id}-empty`})})()),c=u.buttons.map(((r,i)=>{const u=i;return s?t().createElement("div",{key:u},t().createElement(b,{box:e,button:r,index:i,active:i+1===n,setActive:this.setActive,setSearchValue:this.setSearchValue,getSuggestions:this.getSuggestions}),n>0&&i+1===n?l:null):t().createElement(b,{key:u,box:e,button:r,index:i,active:i+1===n,searchValue:o,setActive:this.setActive,setSearchValue:this.setSearchValue,getSuggestions:this.getSuggestions})}));let g=`au_databox collapse buttons-${u.buttons.length}`;u.firstline&&(g+=" first-line-full"),s&&(g+=" stacked");const d={backgroundColor:a.color};""!==a.src&&(d.backgroundImage=`url('${a.src}')`),a.height>0&&(d.height=a.height);const p=t().createElement("div",{className:g},t().createElement("div",{className:"button-wrapper",style:d},""!==a.text?t().createElement("div",{className:"au_focus",dangerouslySetInnerHTML:{__html:a.text}}):null,t().createElement("div",null,c)),n>0&&!s?l:null);return t().createElement(D,{domID:`spinner-${e.config.container}`,loadingCondition:0===r.length,loaded:r.length>0,onLoad:()=>{e.loaded=!0}},p)}}T.defaultProps={},T.propTypes={box:u().shape({id:u().number.isRequired,data:u().shape({source:u().string.isRequired,mode:u().string.isRequired,callback:u().func.isRequired}),config:u().shape({expand:u().bool.isRequired,initLetter:u().string.isRequired,alphabet:u().number.isRequired,rememberState:u().bool.isRequired,trigger:u().number.isRequired,stacked:u().bool.isRequired,buttons:u().arrayOf(u().shape({})).isRequired,firstline:u().bool.isRequired,container:u().string.isRequired}).isRequired,background:u().shape({color:u().string.isRequired,linkColor:u().string.isRequired,src:u().string.isRequired,height:u().string.isRequired,text:u().string.isRequired}).isRequired,search:u().shape({autocomplete:u().bool.isRequired,index:u().number.isRequired}).isRequired,loaded:u().bool.isRequired}).isRequired,parse:u().func.isRequired},T.displayName="DataBoxComponent";const M=T,F={config:{container:".au_databox",firstline:!0,alphabet:2,initLetter:"a",trigger:0,tracking:"/virtual/databox/",buttons:[{text:"Dummy knap 1",link:""},{text:"Dummy knap 2",link:""}],stacked:!1,rememberState:!1,expand:!1},background:{color:"#003d73",linkColor:"#003d73",src:"",height:0,text:"",overlay:!0},search:{autocomplete:!0,index:1,minLength:1,placeHolder:""},data:{mode:"json",source:"",callback:null}};class A{static json(e,t){if(e){let n=[];Array.isArray(e)?n=e:n.push(e);const r=[];n.forEach((e=>{r.push(new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{t(e)}))})))})),Promise.all(r).then((e=>{t({items:e.map((e=>e.items))[0],groupings:e.map((e=>e.groupings))[0]||[]})}))}}static xml(e,t){const n=e=>{const n=[],r=[],o=[];let i=[],s=1;do{i=$(e).find(`associations${s} > item`);const t=[];for(let e=0;e<i.length;e+=1)t.push({id:$(i[e]).attr("id"),name:$(i[e]).attr("name"),items:[]});t.length>0&&o.push(t),s+=1}while(i.length>0);const u=$(e).find("items > item");$.each(u,(function(){const e=$(this).find("extra"),t=[];$.each(e.find("param"),(()=>{t.push({param:$(this).text()})}));const i={id:$(this).attr("id"),name:$(this).attr("name"),url:$(this).attr("url"),parent:$(this).attr("parent"),extra:t,children:[],associations:[]};for(let e=0;e<o.length;e+=1){const t=$(this).find(`association${parseInt(e+1,10)}`);i.associations.push([]);for(let n=0;n<t.length;n+=1){const r=parseInt($(t[n]).attr("id"),10)-1;i.associations[e].push({id:o[e][r].id,name:o[e][r].name}),o[e][r].items.push(i)}}n.push(i),void 0!==i.parent&&""!==i.parent&&r.push(i)}));for(let e=0;e<r.length;e+=1){const t=r[e].parent;for(let o=0;o<n.length;o+=1)if(n[o].id===t){n[o].children.push(r[e]);break}}const a=[];for(let e=0;e<o.length;e+=1)a.push({id:e,associations:o[e]});t({rawData:e,items:n,groupings:a})};AU.helpers.getXML(e,(e=>{n(e)}))}static table(e,t){const n=$(`${e} > table`),r=$(`${e} > ul`),o=[],i=[],s=[];$("li",r).each((function(){const e=[];$("> ul > li",this).each((function(t){e.push({id:t,name:$(this).text(),items:[]})})),e.length>0&&s.push(e)})),$("tr",n).each((function(e){if(e>0){const e=$("td",this),t=parseInt(e.eq(0).text(),10),n=parseInt(e.eq(1).text(),10);let r=e.eq(2).text();r=r.trim();const u=3,a={id:t,name:r,url:$("a",e.eq(2)).attr("href"),parent:n,extra:[],children:[],associations:[]};for(let t=0;t<s.length;t+=1){const n=e.eq(t+u).text().split(",");a.associations.push([]);for(let e=0;e<n.length;e+=1){const r=parseInt(n[e],10)-1;void 0!==s[t][r]&&(a.associations[t].push({id:s[t][r].id,name:s[t][r].name}),s[t][r].items.push(a))}}0===a.parent||""===a.parent?o.push(a):i.push(a)}}));for(let e=0;e<i.length;e+=1){const t=i[e].parent;for(let n=0;n<o.length;n+=1)if(o[n].id===t){o[n].children.push(i[e]);break}}const u=[];for(let e=0;e<s.length;e+=1)u.push({id:e,associations:s[e]});t({items:o,groupings:u})}static list(e,t){const n=$(e),r=[];$("li",n).each((function(e){r.push({id:e,label:$(this).text(),value:$(this).text(),name:$(this).text(),url:$("a",this).attr("href"),children:[],associations:[]})})),t({items:r,groupings:[]})}}class L{constructor(e){this.boxes=e}static mergeOptions(e){const t=e;t.hasOwnProperty("config")||(t.config={});for(const e in F.config)t.config.hasOwnProperty(e)||(t.config[e]=F.config[e]);t.hasOwnProperty("background")||(t.background={});for(const e in F.background)t.background.hasOwnProperty(e)||(t.background[e]=F.background[e]);t.hasOwnProperty("search")||(t.search={});for(const e in F.search)t.search.hasOwnProperty(e)||(t.search[e]=F.search[e]);t.hasOwnProperty("data")||(t.data={});for(const e in F.data)t.data.hasOwnProperty(e)||(t.data[e]=F.data[e]);return t}static legacyCleanUp(e){const t=e,n=$(t.config.container);if(null!==n){const e=$("> *:not(.no-header)",n);e.length>0&&(t.config.buttons=[],e.each((function(){t.config.buttons.push({text:$(this).text(),link:""})})))}}init(){const e={json:A.json,xml:A.xml,table:A.table,list:A.list};for(let n=0;n<this.boxes.length;n+=1){let o=this.boxes[n];if(!o.loaded){o=L.mergeOptions(o),o.id=n,L.legacyCleanUp(o);const i=document.querySelector(o.config.container),s=i&&"hidden"!==getComputedStyle(i).visibility;if(!o.config.stacked&&AU.responsive.state&&"PHONE"===AU.responsive.state.NAME&&(o.config.stacked=!0),s&&(r().render(t().createElement(M,{box:o,parse:e[o.data.mode]}),i),o.loaded=!0),"table"===o.data.mode||"list"===o.data.mode){const e=document.querySelector(o.data.source);e&&e.parentNode.removeChild(e)}}}}}window.AUDatabox=L})(),i})()));
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-dom"));else if("function"==typeof define&&define.amd)define(["react","react-dom"],t);else{var n="object"==typeof exports?t(require("react"),require("react-dom")):t(e.React,e.ReactDOM);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t)=>(()=>{var n={20:e=>{"use strict";var t="%[a-f0-9]{2}",n=new RegExp(t,"gi"),r=new RegExp("("+t+")+","gi");function o(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],o(n),o(r))}function i(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=o(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=r.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var o=i(n[0]);o!==n[0]&&(t[n[0]]=o)}n=r.exec(e)}t["%C2"]="�";for(var u=Object.keys(t),s=0;s<u.length;s++){var a=u[s];e=e.replace(new RegExp(a,"g"),t[a])}return e}(e)}}},806:e=>{"use strict";e.exports=function(e,t){for(var n={},r=Object.keys(e),o=Array.isArray(t),i=0;i<r.length;i++){var u=r[i],s=e[u];(o?-1!==t.indexOf(u):t(u,s,e))&&(n[u]=s)}return n}},296:(e,t,n)=>{var r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,u=/^0o[0-7]+$/i,s=parseInt,a="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,l=a||c||Function("return this")(),f=Object.prototype.toString,p=Math.max,d=Math.min,g=function(){return l.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==f.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=i.test(e);return n||u.test(e)?s(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,u,s,a,c=0,l=!1,f=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,i=o;return r=o=void 0,c=t,u=e.apply(i,n)}function v(e){return c=e,s=setTimeout(O,t),l?b(e):u}function S(e){var n=e-a;return void 0===a||n>=t||n<0||f&&e-c>=i}function O(){var e=g();if(S(e))return w(e);s=setTimeout(O,function(e){var n=t-(e-a);return f?d(n,i-(e-c)):n}(e))}function w(e){return s=void 0,m&&r?b(e):(r=o=void 0,u)}function j(){var e=g(),n=S(e);if(r=arguments,o=this,a=e,n){if(void 0===s)return v(a);if(f)return s=setTimeout(O,t),b(a)}return void 0===s&&(s=setTimeout(O,t)),u}return t=y(t)||0,h(n)&&(l=!!n.leading,i=(f="maxWait"in n)?p(y(n.maxWait)||0,t):i,m="trailing"in n?!!n.trailing:m),j.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=a=o=s=void 0},j.flush=function(){return void 0===s?u:w(g())},j}},703:(e,t,n)=>{"use strict";var r=n(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,u){if(u!==r){var s=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 s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint: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:i,resetWarningCache:o};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},563:(e,t,n)=>{"use strict";const r=n(610),o=n(20),i=n(500),u=n(806),s=Symbol("encodeFragmentIdentifier");function a(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function c(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function l(e,t){return t.decode?o(e):e}function f(e){return Array.isArray(e)?e.sort():"object"==typeof e?f(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function p(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function d(e){const t=(e=p(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function g(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function h(e,t){a((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const o="string"==typeof n&&n.includes(e.arrayFormatSeparator),i="string"==typeof n&&!o&&l(n,e).includes(e.arrayFormatSeparator);n=i?l(n,e):n;const u=o||i?n.split(e.arrayFormatSeparator).map((t=>l(t,e))):null===n?n:l(n,e);r[t]=u};case"bracket-separator":return(t,n,r)=>{const o=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!o)return void(r[t]=n?l(n,e):n);const i=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>l(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],i):r[t]=i};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const o of e.split("&")){if(""===o)continue;let[e,u]=i(t.decode?o.replace(/\+/g," "):o,"=");u=void 0===u?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?u:l(u,t),n(l(e,t),u,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=g(n[e],t);else r[e]=g(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=f(n):e[t]=n,e}),Object.create(null))}t.extract=d,t.parse=h,t.stringify=(e,t)=>{if(!e)return"";a((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[c(t,e),"[",o,"]"].join("")]:[...n,[c(t,e),"[",c(o,e),"]=",c(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[c(t,e),"[]"].join("")]:[...n,[c(t,e),"[]=",c(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[c(t,e),":list="].join("")]:[...n,[c(t,e),":list=",c(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[c(n,e),t,c(o,e)].join("")]:[[r,c(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,c(t,e)]:[...n,[c(t,e),"=",c(r,e)].join("")]}}(t),o={};for(const t of Object.keys(e))n(t)||(o[t]=e[t]);const i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map((n=>{const o=e[n];return void 0===o?"":null===o?c(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?c(n,t)+"[]":o.reduce(r(n),[]).join("&"):c(n,t)+"="+c(o,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=i(e,"#");return Object.assign({url:n.split("?")[0]||"",query:h(d(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:l(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);const r=p(e.url).split("?")[0]||"",o=t.extract(e.url),i=t.parse(o,{sort:!1}),u=Object.assign(i,e.query);let a=t.stringify(u,n);a&&(a=`?${a}`);let l=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(l=`#${n[s]?c(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${a}${l}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[s]:!1},r);const{url:o,query:i,fragmentIdentifier:a}=t.parseUrl(e,r);return t.stringifyUrl({url:o,query:u(i,n),fragmentIdentifier:a},r)},t.exclude=(e,n,r)=>{const o=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return t.pick(e,o,r)}},394:(e,t,n)=>{"use strict";t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==l(e)&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(244)),o=a(n(697)),i=a(n(444)),u=a(n(402)),s=n(581);function a(e){return e&&e.__esModule?e:{default:e}}function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function l(e){return l="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},l(e)}function f(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 p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(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 g(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S=function(){return!0},O="suggestions-revealed",w="input-focused",j="input-changed",x="escape-pressed",I=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&&b(e,t)}(c,e);var t,n,o,a=(t=c,function(){var e,n=m(t);if(y()){var r=m(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return g(this,e)});function c(e){var t,n=e.alwaysRenderSuggestions;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),v(h(t=a.call(this)),"onDocumentMouseDown",(function(e){t.justClickedOnSuggestionsContainer=!1;for(var n=e.detail&&e.detail.target||e.target;null!==n&&n!==document;){if(n.getAttribute&&null!==n.getAttribute("data-suggestion-index"))return;if(n===t.suggestionsContainer)return void(t.justClickedOnSuggestionsContainer=!0);n=n.parentNode}})),v(h(t),"storeAutowhateverRef",(function(e){null!==e&&(t.autowhatever=e)})),v(h(t),"onSuggestionMouseEnter",(function(e,n){var r=n.sectionIndex,o=n.itemIndex;t.updateHighlightedSuggestion(r,o),e.target===t.pressedSuggestion&&(t.justSelectedSuggestion=!0),t.justMouseEntered=!0,setTimeout((function(){t.justMouseEntered=!1}))})),v(h(t),"highlightFirstSuggestion",(function(){t.updateHighlightedSuggestion(t.props.multiSection?0:null,0)})),v(h(t),"onDocumentMouseUp",(function(){t.pressedSuggestion&&!t.justSelectedSuggestion&&t.input.focus(),t.pressedSuggestion=null})),v(h(t),"onSuggestionMouseDown",(function(e){t.justSelectedSuggestion||(t.justSelectedSuggestion=!0,t.pressedSuggestion=e.target)})),v(h(t),"onSuggestionsClearRequested",(function(){var e=t.props.onSuggestionsClearRequested;e&&e()})),v(h(t),"onSuggestionSelected",(function(e,n){var r=t.props,o=r.alwaysRenderSuggestions,i=r.onSuggestionSelected,u=r.onSuggestionsFetchRequested;i&&i(e,n);var s=t.props.shouldKeepSuggestionsOnSelect(n.suggestion);o||s?u({value:n.suggestionValue,reason:"suggestion-selected"}):t.onSuggestionsClearRequested(),t.resetHighlightedSuggestion()})),v(h(t),"onSuggestionClick",(function(e){var n=t.props,r=n.alwaysRenderSuggestions,o=n.focusInputOnSuggestionClick,i=t.getSuggestionIndices(t.findSuggestionElement(e.target)),u=i.sectionIndex,s=i.suggestionIndex,a=t.getSuggestion(u,s),c=t.props.getSuggestionValue(a);t.maybeCallOnChange(e,c,"click"),t.onSuggestionSelected(e,{suggestion:a,suggestionValue:c,suggestionIndex:s,sectionIndex:u,method:"click"});var l=t.props.shouldKeepSuggestionsOnSelect(a);r||l||t.closeSuggestions(),!0===o?t.input.focus():t.onBlur(),setTimeout((function(){t.justSelectedSuggestion=!1}))})),v(h(t),"onBlur",(function(){var e=t.props,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value,i=n.onBlur,u=t.getHighlightedSuggestion(),s=r(o,"input-blurred");t.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!s}),i&&i(t.blurEvent,{highlightedSuggestion:u})})),v(h(t),"onSuggestionMouseLeave",(function(e){t.resetHighlightedSuggestion(!1),t.justSelectedSuggestion&&e.target===t.pressedSuggestion&&(t.justSelectedSuggestion=!1)})),v(h(t),"onSuggestionTouchStart",(function(){t.justSelectedSuggestion=!0})),v(h(t),"onSuggestionTouchMove",(function(){t.justSelectedSuggestion=!1,t.pressedSuggestion=null,t.input.focus()})),v(h(t),"itemProps",(function(e){return{"data-section-index":e.sectionIndex,"data-suggestion-index":e.itemIndex,onMouseEnter:t.onSuggestionMouseEnter,onMouseLeave:t.onSuggestionMouseLeave,onMouseDown:t.onSuggestionMouseDown,onTouchStart:t.onSuggestionTouchStart,onTouchMove:t.onSuggestionTouchMove,onClick:t.onSuggestionClick}})),v(h(t),"renderSuggestionsContainer",(function(e){var n=e.containerProps,r=e.children;return(0,t.props.renderSuggestionsContainer)({containerProps:n,children:r,query:t.getQuery()})})),t.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null},t.justPressedUpDown=!1,t.justMouseEntered=!1,t.pressedSuggestion=null,t}return n=c,o=[{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:"UNSAFE_componentWillReceiveProps",value:function(e){var t=0===this.state.highlightedSuggestionIndex&&this.props.highlightFirstSuggestion&&!e.highlightFirstSuggestion;(0,i.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered?this.highlightFirstSuggestion():t&&this.resetHighlightedSuggestion():this.willRenderSuggestions(e,"suggestions-updated")?(this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions(),t&&this.resetHighlightedSuggestion()):this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,o=n.onSuggestionHighlighted,u=n.highlightFirstSuggestion;if(!(0,i.default)(r,e.suggestions)&&r.length>0&&u)this.highlightFirstSuggestion();else if(o){var s=this.getHighlightedSuggestion();s!=t.highlightedSuggestion&&o({suggestion:s})}}},{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(o){var i=o.valueBeforeUpDown;return null===t?i=null:null===i&&void 0!==n&&(i=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:i}}))}},{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,o=n.multiSection,i=n.getSectionSuggestions;return o?i(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(t.getAttribute&&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,o=r.value,i=r.onChange;t!==o&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e,t){var n=e.suggestions,r=e.inputProps,o=e.shouldRenderSuggestions,i=r.value;return n.length>0&&o(i,t)}},{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,o=t.renderInputComponent,i=t.onSuggestionsFetchRequested,a=t.renderSuggestion,c=t.inputProps,l=t.multiSection,f=t.renderSectionTitle,d=t.id,g=t.getSectionSuggestions,h=t.theme,y=t.getSuggestionValue,m=t.alwaysRenderSuggestions,b=t.highlightFirstSuggestion,v=t.containerProps,I=this.state,P=I.isFocused,k=I.isCollapsed,R=I.highlightedSectionIndex,_=I.highlightedSuggestionIndex,C=I.valueBeforeUpDown,E=m?S:this.props.shouldRenderSuggestions,D=c.value,q=c.onFocus,T=c.onKeyDown,M=this.willRenderSuggestions(this.props,"render"),F=m||P&&!k&&M,A=F?n:[],L=p({},c,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=E(D,w);e.setState({isFocused:!0,isCollapsed:!n}),q&&q(t),n&&i({value:D,reason:w})}},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,r=E(n,j);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(p({},b?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!r})),r?i({value:n,reason:j}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var o=t.keyCode;switch(o){case 40:case 38:if(k)E(D,O)&&(i({value:D,reason:O}),e.revealSuggestions(),t.preventDefault());else if(n.length>0){var u,s=r.newHighlightedSectionIndex,a=r.newHighlightedItemIndex;u=null===a?null===C?D:C:e.getSuggestionValueByIndex(s,a),e.updateHighlightedSuggestion(s,a,D),e.maybeCallOnChange(t,u,40===o?"down":"up"),t.preventDefault()}e.justPressedUpDown=!0,setTimeout((function(){e.justPressedUpDown=!1}));break;case 13:if(229===t.keyCode)break;var c=e.getHighlightedSuggestion();if(F&&!m&&e.closeSuggestions(),null!=c){t.preventDefault();var l=y(c);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:c,suggestionValue:l,suggestionIndex:_,sectionIndex:R,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout((function(){e.justSelectedSuggestion=!1}))}break;case 27:F&&t.preventDefault();var f=F&&!m;null===C?f||(e.maybeCallOnChange(t,"","escape"),E("",x)?i({value:"",reason:x}):e.onSuggestionsClearRequested()):e.maybeCallOnChange(t,C,"escape"),f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}T&&T(t)}}),N={query:this.getQuery()};return r.default.createElement(u.default,{multiSection:l,items:A,renderInputComponent:o,renderItemsContainer:this.renderSuggestionsContainer,renderItem:a,renderItemData:N,renderSectionTitle:f,getSectionItems:g,highlightedSectionIndex:R,highlightedItemIndex:_,containerProps:v,inputProps:L,itemProps:this.itemProps,theme:(0,s.mapToAutowhateverTheme)(h),id:d,ref:this.storeAutowhateverRef})}}],o&&d(n.prototype,o),c}(r.Component);t.default=I,v(I,"propTypes",{suggestions:o.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){if("function"!=typeof e[t])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")},shouldKeepSuggestionsOnSelect:o.default.func,onSuggestionSelected:o.default.func,onSuggestionHighlighted:o.default.func,renderInputComponent:o.default.func,renderSuggestionsContainer:o.default.func,getSuggestionValue:o.default.func.isRequired,renderSuggestion:o.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n)throw new Error("'inputProps' must be passed.");if(!Object.prototype.hasOwnProperty.call(n,"value"))throw new Error("'inputProps' must have 'value'.");if(!Object.prototype.hasOwnProperty.call(n,"onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:o.default.func,alwaysRenderSuggestions:o.default.bool,multiSection:o.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:o.default.bool,highlightFirstSuggestion:o.default.bool,theme:o.default.object,id:o.default.string,containerProps:o.default.object}),v(I,"defaultProps",{renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return r.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,shouldKeepSuggestionsOnSelect:function(){return!1},focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:s.defaultTheme,id:"1",containerProps:{}})},402:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==g(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(244)),o=c(n(697)),i=c(n(383)),u=c(n(379)),s=c(n(752)),a=c(n(210));function c(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function f(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 p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(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 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},g(e)}function h(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 y(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?m(e):t}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function S(e,t){return S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},S(e,t)}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w={},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&&S(e,t)}(l,e);var t,n,o,c=(t=l,function(){var e,n=v(t);if(b()){var r=v(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return y(this,e)});function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),O(m(t=c.call(this,e)),"storeInputReference",(function(e){null!==e&&(t.input=e);var n=t.props.inputProps.ref;n&&("function"==typeof n?n(e):"object"===g(n)&&Object.prototype.hasOwnProperty.call(n,"current")&&(n.current=e))})),O(m(t),"storeItemsContainerReference",(function(e){null!==e&&(t.itemsContainer=e)})),O(m(t),"onHighlightedItemChange",(function(e){t.highlightedItem=e})),O(m(t),"getItemId",(function(e,n){if(null===n)return null;var r=t.props.id,o=null===e?"":"section-".concat(e);return"react-autowhatever-".concat(r,"-").concat(o,"-item-").concat(n)})),O(m(t),"onFocus",(function(e){var n=t.props.inputProps;t.setState({isInputFocused:!0}),n.onFocus&&n.onFocus(e)})),O(m(t),"onBlur",(function(e){var n=t.props.inputProps;t.setState({isInputFocused:!1}),n.onBlur&&n.onBlur(e)})),O(m(t),"onKeyDown",(function(e){var n,r,o=t.props,i=o.inputProps,u=o.highlightedSectionIndex,s=o.highlightedItemIndex,a=e.keyCode;switch(a){case 40:case 38:var c=40===a?"next":"prev",l=(n=t.sectionIterator[c]([u,s]),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(n,r)||function(e,t){if(e){if("string"==typeof e)return d(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(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=l[0],p=l[1];i.onKeyDown(e,{newHighlightedSectionIndex:f,newHighlightedItemIndex:p});break;default:i.onKeyDown(e,{highlightedSectionIndex:u,highlightedItemIndex:s})}})),t.highlightedItem=null,t.state={isInputFocused:!1},t.setSectionsItems(e),t.setSectionIterator(e),t.setTheme(e),t}return n=l,(o=[{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,i.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,u.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,o=n.id,i=n.items,u=n.renderItem,c=n.renderItemData,l=n.renderSectionTitle,f=n.highlightedSectionIndex,p=n.highlightedItemIndex,d=n.itemProps;return i.map((function(n,i){var g="react-autowhatever-".concat(o,"-"),h="".concat(g,"section-").concat(i,"-"),y=0===i;return r.default.createElement("div",t("".concat(h,"container"),"sectionContainer",y&&"sectionContainerFirst"),r.default.createElement(s.default,{section:n,renderSectionTitle:l,theme:t,sectionKeyPrefix:h}),r.default.createElement(a.default,{items:e.sectionsItems[i],itemProps:d,renderItem:u,renderItemData:c,sectionIndex:i,highlightedItemIndex:f===i?p:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:g,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,o=n.id,i=n.renderItem,u=n.renderItemData,s=n.highlightedSectionIndex,c=n.highlightedItemIndex,l=n.itemProps;return r.default.createElement(a.default,{items:e,itemProps:l,renderItem:i,renderItemData:u,highlightedItemIndex:null===s?c:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-".concat(o,"-")})}},{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,o=t.multiSection,i=t.renderInputComponent,u=t.renderItemsContainer,s=t.highlightedSectionIndex,a=t.highlightedItemIndex,c=this.state.isInputFocused,l=o?this.renderSections():this.renderItems(),f=null!==l,d=this.getItemId(s,a),g="react-autowhatever-".concat(n),h=p({role:"combobox","aria-haspopup":"listbox","aria-owns":g,"aria-expanded":f},e("react-autowhatever-".concat(n,"-container"),"container",f&&"containerOpen"),{},this.props.containerProps),y=i(p({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":g,"aria-activedescendant":d},e("react-autowhatever-".concat(n,"-input"),"input",f&&"inputOpen",c&&"inputFocused"),{},this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),m=u({containerProps:p({id:g,role:"listbox"},e("react-autowhatever-".concat(n,"-items-container"),"itemsContainer",f&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:l});return r.default.createElement("div",h,y,m)}}])&&h(n.prototype,o),l}(r.Component);t.default=j,O(j,"propTypes",{id:o.default.string,multiSection:o.default.bool,renderInputComponent:o.default.func,renderItemsContainer:o.default.func,items:o.default.array.isRequired,renderItem:o.default.func,renderItemData:o.default.object,renderSectionTitle:o.default.func,getSectionItems:o.default.func,containerProps:o.default.object,inputProps:o.default.object,itemProps:o.default.oneOfType([o.default.object,o.default.func]),highlightedSectionIndex:o.default.number,highlightedItemIndex:o.default.number,theme:o.default.oneOfType([o.default.object,o.default.array])}),O(j,"defaultProps",{id:"1",multiSection:!1,renderInputComponent:function(e){return r.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return r.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:w,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:w,inputProps:w,itemProps:w,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"}})},314:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(244)),o=u(n(697)),i=u(n(770));function u(e){return e&&e.__esModule?e:{default:e}}function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},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},a(e)}function c(){return c=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},c.apply(this,arguments)}function l(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 f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(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 d(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?g(e):t}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=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&&m(e,t)}(s,e);var t,n,o,u=(t=s,function(){var e,n=y(t);if(h()){var r=y(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return d(this,e)});function s(){var e;f(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return b(g(e=u.call.apply(u,[this].concat(n))),"storeItemReference",(function(t){null!==t&&(e.item=t)})),b(g(e),"onMouseEnter",(function(t){var n=e.props,r=n.sectionIndex,o=n.itemIndex;e.props.onMouseEnter(t,{sectionIndex:r,itemIndex:o})})),b(g(e),"onMouseLeave",(function(t){var n=e.props,r=n.sectionIndex,o=n.itemIndex;e.props.onMouseLeave(t,{sectionIndex:r,itemIndex:o})})),b(g(e),"onMouseDown",(function(t){var n=e.props,r=n.sectionIndex,o=n.itemIndex;e.props.onMouseDown(t,{sectionIndex:r,itemIndex:o})})),b(g(e),"onClick",(function(t){var n=e.props,r=n.sectionIndex,o=n.itemIndex;e.props.onClick(t,{sectionIndex:r,itemIndex:o})})),e}return n=s,o=[{key:"shouldComponentUpdate",value:function(e){return(0,i.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,o=e.renderItem,i=e.renderItemData,u=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete u.sectionIndex,delete u.itemIndex,"function"==typeof u.onMouseEnter&&(u.onMouseEnter=this.onMouseEnter),"function"==typeof u.onMouseLeave&&(u.onMouseLeave=this.onMouseLeave),"function"==typeof u.onMouseDown&&(u.onMouseDown=this.onMouseDown),"function"==typeof u.onClick&&(u.onClick=this.onClick),r.default.createElement("li",c({role:"option"},u,{ref:this.storeItemReference}),o(n,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({isHighlighted:t},i)))}}],o&&p(n.prototype,o),s}(r.Component);t.default=v,b(v,"propTypes",{sectionIndex:o.default.number,isHighlighted:o.default.bool.isRequired,itemIndex:o.default.number.isRequired,item:o.default.any.isRequired,renderItem:o.default.func.isRequired,renderItemData:o.default.object.isRequired,onMouseEnter:o.default.func,onMouseLeave:o.default.func,onMouseDown:o.default.func,onClick:o.default.func})},210:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(244)),o=s(n(697)),i=s(n(314)),u=s(n(770));function s(e){return e&&e.__esModule?e:{default:e}}function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function c(e){return c="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},c(e)}function l(){return l=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},l.apply(this,arguments)}function f(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 p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(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 g(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var S=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&&b(e,t)}(a,e);var t,n,o,s=(t=a,function(){var e,n=m(t);if(y()){var r=m(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return g(this,e)});function a(){var e;p(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v(h(e=s.call.apply(s,[this].concat(n))),"storeHighlightedItemReference",(function(t){e.props.onHighlightedItemChange(null===t?null:t.item)})),e}return n=a,o=[{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,o=t.itemProps,u=t.renderItem,s=t.renderItemData,a=t.sectionIndex,c=t.highlightedItemIndex,p=t.getItemId,d=t.theme,g=t.keyPrefix,h=null===a?g:"".concat(g,"section-").concat(a,"-"),y="function"==typeof o;return r.default.createElement("ul",l({role:"listbox"},d("".concat(h,"items-list"),"itemsList")),n.map((function(t,n){var g=0===n,m=n===c,b="".concat(h,"item-").concat(n),S=y?o({sectionIndex:a,itemIndex:n}):o,O=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({id:p(a,n),"aria-selected":m},d(b,"item",g&&"itemFirst",m&&"itemHighlighted"),{},S);return m&&(O.ref=e.storeHighlightedItemReference),r.default.createElement(i.default,l({},O,{sectionIndex:a,isHighlighted:m,itemIndex:n,item:t,renderItem:u,renderItemData:s}))})))}}],o&&d(n.prototype,o),a}(r.Component);t.default=S,v(S,"propTypes",{items:o.default.array.isRequired,itemProps:o.default.oneOfType([o.default.object,o.default.func]),renderItem:o.default.func.isRequired,renderItemData:o.default.object.isRequired,sectionIndex:o.default.number,highlightedItemIndex:o.default.number,onHighlightedItemChange:o.default.func.isRequired,getItemId:o.default.func.isRequired,theme:o.default.func.isRequired,keyPrefix:o.default.string.isRequired}),v(S,"defaultProps",{sectionIndex:null})},752:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(244)),o=u(n(697)),i=u(n(770));function u(e){return e&&e.__esModule?e:{default:e}}function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},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},a(e)}function c(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?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(e,t)}var h,y,m,b=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&&g(e,t)}(s,e);var t,n,o,u=(t=s,function(){var e,n=d(t);if(p()){var r=d(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function s(){return c(this,s),u.apply(this,arguments)}return n=s,(o=[{key:"shouldComponentUpdate",value:function(e){return(0,i.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,o=e.theme,i=e.sectionKeyPrefix,u=n(t);return u?r.default.createElement("div",o("".concat(i,"title"),"sectionTitle"),u):null}}])&&l(n.prototype,o),s}(r.Component);t.default=b,h=b,y="propTypes",m={section:o.default.any.isRequired,renderSectionTitle:o.default.func.isRequired,theme:o.default.func.isRequired,sectionKeyPrefix:o.default.string.isRequired},y in h?Object.defineProperty(h,y,{value:m,enumerable:!0,configurable:!0,writable:!0}):h[y]=m},770:(e,t)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!0;var u,s,a={};for(u=0,s=r.length;u<s;u++)a[r[u]]=!0;for(u=0,s=o.length;u<s;u++){var c=o[u],l=e[c],f=t[c];if(l!==f){if(!a[c]||null===l||null===f||"object"!==n(l)||"object"!==n(f))return!0;var p=Object.keys(l),d=Object.keys(f);if(p.length!==d.length)return!0;for(var g=0,h=p.length;g<h;g++){var y=p[g];if(l[y]!==f[y])return!0}}}return!1}},808:(e,t,n)=>{"use strict";e.exports=n(394).default},581:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapToAutowhateverTheme=t.defaultTheme=void 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}},379:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function r(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,i=(o=n(894))&&o.__esModule?o:{default:o},u=function(e){return e};t.default=function(e){var t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(Array.isArray(e)&&2===e.length?e:[e,null],2),n=t[0],o=t[1];return function(e){for(var t=arguments.length,s=Array(t>1?t-1:0),a=1;a<t;a++)s[a-1]=arguments[a];var c=s.map((function(e){return n[e]})).filter(u);return"string"==typeof c[0]||"function"==typeof o?{key:e,className:o?o.apply(void 0,r(c)):c.join(" ")}:{key:e,style:i.default.apply(void 0,[{}].concat(r(c)))}}},e.exports=t.default},894:e=>{"use strict";var t=Object.prototype.propertyIsEnumerable;function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(e){var n=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(e))),n.filter((function(n){return t.call(e,n)}))}e.exports=Object.assign||function(e,t){for(var o,i,u=n(e),s=1;s<arguments.length;s++){o=arguments[s],i=r(Object(o));for(var a=0;a<i.length;a++)u[i[a]]=o[i[a]]}return u}},383:e=>{"use strict";var t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var n=e.data,r=e.multiSection;function o(e){var o=t(e,2),i=o[0],u=o[1];return r?null===u||u===n[i]-1?null===(i=function(e){for(null===e?e=0:e++;e<n.length&&0===n[e];)e++;return e===n.length?null:e}(i))?[null,null]:[i,0]:[i,u+1]:0===n||u===n-1?[null,null]:null===u?[null,0]:[null,u+1]}return{next:o,prev:function(e){var o=t(e,2),i=o[0],u=o[1];return r?null===u||0===u?null===(i=function(e){for(null===e?e=n.length-1:e--;e>=0&&0===n[e];)e--;return-1===e?null:e}(i))?[null,null]:[i,n[i]-1]:[i,u-1]:0===n||0===u?[null,null]:null===u?[null,n-1]:[null,u-1]},isLast:function(e){return null===o(e)[1]}}}},444:e=>{"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}},500:e=>{"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},610:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},244:t=>{"use strict";t.exports=e},741:e=>{"use strict";e.exports=t}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";o.r(i);var e=o(244),t=o.n(e),n=o(741),r=o.n(n),u=o(697),s=o.n(u),a=o(563),c=o(808),l=o.n(c),f=o(296),p=o.n(f);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},d(e)}function g(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 h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function y(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}var v=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(s,e);var n,r,o,i,u=(o=s,i=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}}(),function(){var e,t=b(o);if(i){var n=b(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return y(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=u.call(this,e)).state={value:"",suggestions:[],noSuggestions:!1},t.onChange=t.onChange.bind(m(t)),t.onEnter=t.onEnter.bind(m(t)),t.onSuggestionsFetchRequested=p()(t.onSuggestionsFetchRequested.bind(m(t)),400),t.onSuggestionsClearRequested=t.onSuggestionsClearRequested.bind(m(t)),t.onSuggestionSelected=t.onSuggestionSelected.bind(m(t)),t}return n=s,(r=[{key:"onChange",value:function(e,t){var n=t.newValue,r=this.props.setQuery;this.setState({value:n},(function(){r(n)}))}},{key:"onEnter",value:function(e){var t=this.state.suggestions,n=this.props.setResults;"Enter"===e.key&&n(t)}},{key:"onSuggestionsFetchRequested",value:function(e){var t=this,n=e.value,r=this.props,o=r.getSuggestions,i=r.collection;o(n,i,(function(e){t.setState({suggestions:e,noSuggestions:0===e.length&&""!==n.trim()&&n.trim().length>1})}))}},{key:"onSuggestionsClearRequested",value:function(){this.setState({suggestions:[]})}},{key:"onSuggestionSelected",value:function(e,t){var n=t.suggestion,r=this.props,o=r.setResults,i=r.clearInput;o([n]),i&&this.setState({value:""})}},{key:"render",value:function(){var e=this.state,n=e.value,r=e.suggestions,o=e.noSuggestions,i=this.props,u=i.placeholder,s=i.getSuggestionValue,a=i.renderSuggestion,c=i.id,f=i.theme,p=i.type,d=i.initialValue,g=i.disabled,h=i.noResultsText,y={placeholder:u,value:d||n,id:c,type:p,disabled:g,"aria-label":u,onChange:this.onChange,onKeyDown:this.onEnter};return t().createElement(t().Fragment,null,t().createElement(l(),{suggestions:r,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,onSuggestionSelected:this.onSuggestionSelected,getSuggestionValue:s,renderSuggestion:a,inputProps:y,theme:f}),o&&h&&t().createElement("p",{className:"no-results"},t().createElement("em",null,h)))}}])&&g(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);v.displayName="AUAutoSuggestComponent",v.defaultProps={id:"autosuggest1",theme:{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"},clearInput:!1,type:"text",initialValue:"",disabled:!1,setQuery:function(){},noResultsText:""},v.propTypes={setQuery:s().func,getSuggestions:s().func.isRequired,getSuggestionValue:s().func.isRequired,renderSuggestion:s().func.isRequired,setResults:s().func.isRequired,collection:s().arrayOf(s().shape({})).isRequired,placeholder:s().string.isRequired,id:s().string,theme:s().shape({}),clearInput:s().bool,type:s().string,initialValue:s().string,disabled:s().bool,noResultsText:s().string};const S=v;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},O(e)}function w(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},j(e,t)}function x(e,t){if(t&&("object"===O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},I(e)}var P=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&j(e,t)}(a,e);var n,r,o,i,u,s=(i=a,u=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}}(),function(){var e,t=I(i);if(u){var n=I(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return x(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=s.call(this,e)).state={item:e.item},t}return n=a,o=[{key:"getDerivedStateFromProps",value:function(e,t){return e.item.id!==t.item.id?{item:e.item}:null}}],(r=[{key:"render",value:function(){var e=this.state.item;return t().createElement("span",null,e.name)}}])&&w(n.prototype,r),o&&w(n,o),Object.defineProperty(n,"prototype",{writable:!1}),a}(t().Component);P.propTypes={item:s().shape({id:s().number.isRequired}).isRequired},P.displayName="DataBoxSuggestionComponent";const k=P;function R(e){return 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},R(e)}function _(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 C(e,t){return C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},C(e,t)}function E(e,t){if(t&&("object"===R(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return D(e)}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e){return q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},q(e)}var T=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(s,e);var n,r,o,i,u=(o=s,i=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}}(),function(){var e,t=q(o);if(i){var n=q(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return E(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=u.call(this,e)).handleClick=t.handleClick.bind(D(t)),t.handleChange=t.handleChange.bind(D(t)),t}return n=s,(r=[{key:"handleClick",value:function(){var e=this.props,t=e.setActive,n=e.active,r=e.index;t(n?0:r+1)}},{key:"handleChange",value:function(e){var t=e.target.value,n=this.props.setSearchValue,r="".concat([window.location.protocol,"//",window.location.host,window.location.pathname].join(""),"?initval=").concat(t);window.history.replaceState({initVal:t},document.title,r),n(t)}},{key:"render",value:function(){var e=this.props,n=e.button,r=e.index,o=e.box,i=e.active,u=e.getSuggestions,s=e.searchValue,a=r+1,c=o.background,l="db-button button-".concat(a),f=o.search.index===a;return c.overlay&&(l+=" overlay"),f&&(l+=" db-search"),i&&!f&&(l+=" active"),f?o.search.autocomplete?t().createElement("div",{className:l,key:a},t().createElement("span",{dangerouslySetInnerHTML:{__html:n.text}}),t().createElement(S,{placeholder:o.search.placeHolder,setQuery:function(){},setResults:function(e){1===e.length&&e[0].url&&(window.location.href=e[0].url)},collection:[],getSuggestions:u,getSuggestionValue:function(e){return e.name},renderSuggestion:function(e){return t().createElement(k,{item:e})}})):t().createElement("div",{className:l,key:a},t().createElement("span",null,n.text),t().createElement("input",{type:"text",value:s,placeholder:o.search.placeHolder,onChange:this.handleChange})):""!==n.link?t().createElement("div",{key:a,role:"button",tabIndex:"0",onClick:this.handleClick,onKeyUp:function(){},className:l},t().createElement("span",null,t().createElement("a",{href:n.link},n.text))):t().createElement("div",{key:a,role:"button",tabIndex:"0",onClick:this.handleClick,onKeyUp:function(){},className:l},t().createElement("span",null,n.text))}}])&&_(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);T.defaultProps={searchValue:""},T.propTypes={active:s().bool.isRequired,index:s().number.isRequired,searchValue:s().string,setActive:s().func.isRequired,setSearchValue:s().func.isRequired,button:s().shape({text:s().string.isRequired,link:s().string.isRequired}).isRequired,box:s().shape({background:s().shape({color:s().string.isRequired,linkColor:s().string.isRequired,src:s().string.isRequired,height:s().number.isRequired,text:s().string.isRequired,overlay:s().bool.isRequired}).isRequired,search:s().shape({index:s().number.isRequired,autocomplete:s().bool.isRequired,placeHolder:s().string.isRequired}).isRequired}).isRequired,getSuggestions:s().func.isRequired},T.displayName="DataBoxButtonComponent";const M=T;var F=function(e,t){return void 0!==e.name&&void 0!==t.name?e.name.toLowerCase().localeCompare(t.name.toLowerCase(),"da",{ignorePunctuation:!0}):0},A=function(e){var n=e.assoc.items.sort(F).map((function(e){if(e.children.length>0){var n=e.children.sort(F).map((function(e){return t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))}));return t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name),t().createElement("ul",null,n))}return t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))}));return t().createElement("div",null,t().createElement("ul",null,n))};A.propTypes={assoc:s().shape({items:s().arrayOf(s().shape({})).isRequired}).isRequired},A.displayName="DataBoxStackedAssociationComponent";const L=A;function N(e){return N="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},N(e)}function H(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){return U=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},U(e,t)}function B(e,t){if(t&&("object"===N(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},V(e)}var W=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&U(e,t)}(s,e);var n,r,o,i,u=(o=s,i=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}}(),function(){var e,t=V(o);if(i){var n=V(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return B(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=u.call(this,e)).state={collapsed:e.collapsed},t}return n=s,(r=[{key:"componentDidMount",value:function(){var e=this;this.props.attributes.forEach((function(t){if(t.selector){var n=e.node.querySelector(t.selector);n&&n.setAttribute(t.attr,t.value)}else e.node.setAttribute(t.attr,t.value)}))}},{key:"render",value:function(){var e=this,n=this.props,r=n.header,o=n.level,i=n.content,u=n.classNames,s=n.onClick,a=n.children,c=n.dataID,l=n.headerElement,f="csc-frame au_collapsible";return this.state.collapsed&&(f+=" au_collapsed"),u&&(f+=" ".concat(u)),t().createElement("div",{"data-id":c,ref:function(t){e.node=t},className:f},o>-1?t().createElement("div",{className:"csc-header",onClick:function(){e.setState((function(e){return{collapsed:!e.collapsed}}),(function(){var t=e.state.collapsed;s(t,e.node)}))},onKeyUp:function(){},role:"button",tabIndex:0},function(){switch(o){case 0:return l;case 1:return t().createElement("h1",null,r);case 2:return t().createElement("h2",null,r);case 3:return t().createElement("h3",null,r);case 4:return t().createElement("h4",null,r);case 5:return t().createElement("h5",null,r);default:return t().createElement("h6",null,r)}}()):null,a||i)}}])&&H(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);W.defaultProps={dataID:null,children:null,content:null,header:"",headerElement:null,level:1,classNames:"",onClick:function(){},attributes:[]},W.propTypes={dataID:s().string,children:s().element,collapsed:s().bool.isRequired,header:s().string,headerElement:s().element,level:s().number,content:s().element,classNames:s().string,onClick:s().func,attributes:s().arrayOf(s().shape({attr:s().string,value:s().string,selector:s().string}))},W.displayName="AUCollapsibleComponent";const K=W;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},z(e)}function Q(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 G(e,t){return G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},G(e,t)}function X(e,t){if(t&&("object"===z(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Y(e)}function Y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function J(e){return J=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},J(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G(e,t)}(s,e);var n,r,o,i,u=(o=s,i=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}}(),function(){var e,t=J(o);if(i){var n=J(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return X(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=u.call(this,e)).state={open:e.open},t.handleClick=t.handleClick.bind(Y(t)),t}return n=s,(r=[{key:"handleClick",value:function(){var e=this.props,t=e.rememberState,n=e.boxID,r=e.grouping,o=e.index,i=this.state.open;t&&(i?sessionStorage.removeItem("box-".concat(n,"-group-").concat(r,"-index-").concat(o)):sessionStorage.setItem("box-".concat(n,"-group-").concat(r,"-index-").concat(o),!0)),this.setState((function(e){return{open:!e.open}}))}},{key:"render",value:function(){var e=this.state.open,n=this.props.assoc,r=n.items.sort(F).map((function(e){if(e.children.length>0){var n=e.children.sort(F).map((function(e){return t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))}));return t().createElement("li",{key:e.id},e.url?t().createElement("a",{href:e.url},e.name):t().createElement("span",null,e.name),t().createElement("ul",null,n))}return t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))})),o=t().createElement("ul",null,r);return t().createElement(K,{key:e,collapsed:!e,level:3,header:n.name,content:o,onClick:this.handleClick})}}])&&Q(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);Z.defaultProps={},Z.propTypes={boxID:s().number.isRequired,grouping:s().number.isRequired,assoc:s().shape({name:s().string.isRequired,items:s().arrayOf(s().shape({})).isRequired}).isRequired,index:s().number.isRequired,open:s().bool.isRequired,rememberState:s().bool.isRequired},Z.displayName="DataBoxAssociationComponent";const ee=Z;var te=function(e){var n,r=e.stacked,o=e.grouping,i=e.expand,u=e.rememberState,s=e.boxID;return n=r&&1===o.associations.length?e.grouping.associations.map((function(e){return t().createElement(L,{key:e.id,assoc:e})})):e.grouping.associations.map((function(e,n){var r=i||1===o.associations.length||u&&sessionStorage.getItem("box-".concat(s,"-group-").concat(o.id,"-index-").concat(n));return t().createElement(ee,{key:e.id,open:r,boxID:s,rememberState:u,grouping:o.id,index:n,assoc:e})})),t().createElement("div",{id:"box-".concat(s,"-grouping-").concat(o.id)},n)};te.defaultProps={},te.propTypes={boxID:s().number.isRequired,stacked:s().bool.isRequired,expand:s().bool.isRequired,rememberState:s().bool.isRequired,grouping:s().shape({id:s().number.isRequired,associations:s().arrayOf(s().shape({})).isRequired}).isRequired},te.displayName="DataBoxGroupingComponent";const ne=te;var re=function(e){var n=e.items,r=e.searchValue,o=n.sort(F).filter((function(e){return e.name.toLowerCase().indexOf(r.toLowerCase())>-1})).map((function(e){return t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))}));return t().createElement("div",null,t().createElement("ul",null,o))};re.propTypes={items:s().arrayOf(s().shape({id:s().number.isRequired,url:s().string.isRequired,name:s().string.isRequired})).isRequired,searchValue:s().string.isRequired},re.displayName="DataBoxSearchResultComponent";const oe=re;function ie(e){return ie="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},ie(e)}function ue(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 se(e,t){return se=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},se(e,t)}function ae(e,t){if(t&&("object"===ie(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ce(e){return ce=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ce(e)}var le=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&se(e,t)}(s,e);var n,r,o,i,u=(o=s,i=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}}(),function(){var e,t=ce(o);if(i){var n=ce(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ae(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=u.call(this,e)).letters=["...","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","æ","ø","å"],t.state={letterIndex:t.letters.indexOf(e.initLetter.toLowerCase())},t}return n=s,(r=[{key:"render",value:function(){var e=this,n=this.state.letterIndex,r=this.props,o=r.linkColor,i=r.rememberState,u=r.boxID,s=this.letters.map((function(r,s){var a=e.props.items,c=0===s||a.filter((function(e){return 0===e.name.toLowerCase().indexOf(r)})).length>0,l="";c&&(l+="available"),s===n&&(l+=" active");var f={};return c&&(f=n===s?{backgroundColor:"#fff",color:o}:{backgroundColor:o}),t().createElement("li",{key:r,className:l},t().createElement("button",{type:"button",style:f,onClick:function(){c&&(e.setState({letterIndex:s}),i&&sessionStorage.setItem("box-alphabet-".concat(u),e.letters[s]))}},r))})),a=this.props.items;0!==n&&(a=a.filter((function(t){return 0===t.name.toLowerCase().indexOf(e.letters[n])})));var c=a.sort(F).map((function(e){var n=e.children.map((function(e){return t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))}));return e.children.length>0?t().createElement("li",{key:e.id},e.url?t().createElement("a",{href:e.url},e.name):t().createElement("span",null,e.name),t().createElement("ul",null,n)):e.parent?null:t().createElement("li",{key:e.id},t().createElement("a",{href:e.url},e.name))}));return t().createElement("div",null,t().createElement("ul",{className:"letters"},s),t().createElement("ul",null,c))}}])&&ue(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);le.defaultProps={},le.propTypes={initLetter:s().string.isRequired,items:s().arrayOf(s().shape({})).isRequired,linkColor:s().string.isRequired,rememberState:s().bool.isRequired,boxID:s().number.isRequired},le.displayName="DataBoxAlphabetComponent";const fe=le;function pe(e){return pe="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},pe(e)}function de(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 ge(e,t){return ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ge(e,t)}function he(e,t){if(t&&("object"===pe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ye(e)}function ye(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function me(e){return me=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},me(e)}var be=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ge(e,t)}(a,e);var n,r,o,i,u,s=(i=a,u=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}}(),function(){var e,t=me(i);if(u){var n=me(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return he(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=s.call(this,e)).state={loading:!0,visible:e.visible},t.lazyLoad=t.lazyLoad.bind(ye(t)),t}return n=a,o=[{key:"getDerivedStateFromProps",value:function(e,t){return e.visible!==t.visible?{visible:e.visible}:null}}],(r=[{key:"componentDidMount",value:function(){var e=this;this.lazyLoad(),window.addEventListener("scroll",(function(){e.lazyLoad()}))}},{key:"componentDidUpdate",value:function(){this.lazyLoad()}},{key:"lazyLoad",value:function(){var e=this.props,t=e.loadingCondition,n=e.loaded,r=e.domID,o=e.onLoad,i=this.state,u=i.loading,s=i.visible,a=document.getElementById(r);!n&&u&&t&&(s||function(e){if(null===e)return!1;var t=e.getBoundingClientRect();return t.bottom>0&&t.right>0&&t.left<(window.innerWidth||document.documentElement.clientWidth)&&t.top<(window.innerHeight||document.documentElement.clientHeight)}(a))&&this.setState({loading:!1},(function(){o()}))}},{key:"render",value:function(){var e=this.props,n=e.columns,r=e.content,o=e.loaded,i=e.domID,u=e.children;return o?u||r:t().createElement("div",{id:i,className:"cell column ".concat(n)},t().createElement("p",{className:"spinner"}))}}])&&de(n.prototype,r),o&&de(n,o),Object.defineProperty(n,"prototype",{writable:!1}),a}(t().Component);be.defaultProps={domID:"au-spinner-component",visible:!1,columns:"large-12 medium-12 small-12",content:null,children:null,onLoad:function(){}},be.propTypes={domID:s().string,visible:s().bool,columns:s().string,content:s().element,children:s().element,loaded:s().bool.isRequired,loadingCondition:s().bool.isRequired,onLoad:s().func},be.displayName="AUSpinnerComponent";const ve=be;function Se(e){return Se="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},Se(e)}function Oe(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 we(e,t){return we=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},we(e,t)}function je(e,t){if(t&&("object"===Se(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xe(e)}function xe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ie(e){return Ie=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ie(e)}var Pe=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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&we(e,t)}(s,e);var n,r,o,i,u=(o=s,i=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}}(),function(){var e,t=Ie(o);if(i){var n=Ie(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return je(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),t=u.call(this,e);var n=(0,a.parse)(window.location.search),r=e.box.config,o=r.stacked,i=r.rememberState&&sessionStorage.getItem("box-header-".concat(e.box.id))?parseInt(sessionStorage.getItem("box-header-".concat(e.box.id)),10):e.box.config.trigger;return t.state={active:i,rawData:null,items:[],groupings:[],stacked:o,searchValue:void 0===n.initval?"":decodeURIComponent(n.initval)},t.setActive=t.setActive.bind(xe(t)),t.setSearchValue=t.setSearchValue.bind(xe(t)),t.getSuggestions=t.getSuggestions.bind(xe(t)),t}return n=s,(r=[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.parse,r=t.box,o=this.state.searchValue;n(r.data.source,(function(t){var n=t.items,r=t.groupings,o=t.rawData;e.setState({items:n,groupings:r||[],rawData:o})})),""!==o&&this.setSearchValue(o)}},{key:"componentDidUpdate",value:function(){var e=this.props.box,t=this.state,n=t.rawData,r=t.items,o=t.groupings,i=e.data;"function"==typeof i.callback&&i.callback(n||{items:r,groupings:o})}},{key:"setActive",value:function(e){var t=this.props.box;this.setState({active:e}),t.config.rememberState&&sessionStorage.setItem("box-header-".concat(t.id),e)}},{key:"setSearchValue",value:function(e){var t=this.props.box;t.search.autocomplete||this.setState({searchValue:e,active:""===e?0:t.search.index})}},{key:"getSuggestions",value:function(e,t,n){var r=this.state.items,o=e.trim().toLowerCase();n(o.length<2?[]:r.filter((function(e){return e.name.toLowerCase().indexOf(o)>-1})).sort(F))}},{key:"render",value:function(){var e=this,n=this.props.box,r=this.state,o=r.active,i=r.items,u=r.searchValue,s=r.groupings,a=r.stacked,c=n.config,l=n.background,f=t().createElement("div",{className:"content"},function(){var e=n.search.index,r=n.config.alphabet,c=n.config.rememberState&&sessionStorage.getItem("box-alphabet-".concat(n.id))?sessionStorage.getItem("box-alphabet-".concat(n.id)):n.config.initLetter;if(o===r)return t().createElement(fe,{boxID:n.id,rememberState:n.config.rememberState,initLetter:c,color:n.background.color,linkColor:n.background.linkColor,items:i});if(""!==u&&!n.search.autocomplete)return t().createElement(oe,{items:i,searchValue:u});var l=0;e>0&&(l=e>o?0:1);var f=0;r>0&&(f=r>o?0:1);var p=s[o-l-f-1];return p?t().createElement(ne,{boxID:n.id,rememberState:n.config.rememberState,stacked:a,grouping:p,expand:n.config.expand}):t().createElement("div",{className:"box-".concat(n.id,"-empty")})}()),p=c.buttons.map((function(r,i){var s=i;return a?t().createElement("div",{key:s},t().createElement(M,{box:n,button:r,index:i,active:i+1===o,setActive:e.setActive,setSearchValue:e.setSearchValue,getSuggestions:e.getSuggestions}),o>0&&i+1===o?f:null):t().createElement(M,{key:s,box:n,button:r,index:i,active:i+1===o,searchValue:u,setActive:e.setActive,setSearchValue:e.setSearchValue,getSuggestions:e.getSuggestions})})),d="au_databox collapse buttons-".concat(c.buttons.length);c.firstline&&(d+=" first-line-full"),a&&(d+=" stacked");var g={backgroundColor:l.color};""!==l.src&&(g.backgroundImage="url('".concat(l.src,"')")),l.height>0&&(g.height=l.height);var h=t().createElement("div",{className:d},t().createElement("div",{className:"button-wrapper",style:g},""!==l.text?t().createElement("div",{className:"au_focus",dangerouslySetInnerHTML:{__html:l.text}}):null,t().createElement("div",null,p)),o>0&&!a?f:null);return t().createElement(ve,{domID:"spinner-".concat(n.config.container),loadingCondition:0===i.length,loaded:i.length>0,onLoad:function(){n.loaded=!0}},h)}}])&&Oe(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);Pe.defaultProps={},Pe.propTypes={box:s().shape({id:s().number.isRequired,data:s().shape({source:s().string.isRequired,mode:s().string.isRequired,callback:s().func.isRequired}),config:s().shape({expand:s().bool.isRequired,initLetter:s().string.isRequired,alphabet:s().number.isRequired,rememberState:s().bool.isRequired,trigger:s().number.isRequired,stacked:s().bool.isRequired,buttons:s().arrayOf(s().shape({})).isRequired,firstline:s().bool.isRequired,container:s().string.isRequired}).isRequired,background:s().shape({color:s().string.isRequired,linkColor:s().string.isRequired,src:s().string.isRequired,height:s().string.isRequired,text:s().string.isRequired}).isRequired,search:s().shape({autocomplete:s().bool.isRequired,index:s().number.isRequired}).isRequired,loaded:s().bool.isRequired}).isRequired,parse:s().func.isRequired},Pe.displayName="DataBoxComponent";const ke=Pe;function Re(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 Ce(e,t,n){return t&&_e(e.prototype,t),n&&_e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ee={config:{container:".au_databox",firstline:!0,alphabet:2,initLetter:"a",trigger:0,tracking:"/virtual/databox/",buttons:[{text:"Dummy knap 1",link:""},{text:"Dummy knap 2",link:""}],stacked:!1,rememberState:!1,expand:!1},background:{color:"#003d73",linkColor:"#003d73",src:"",height:0,text:"",overlay:!0},search:{autocomplete:!0,index:1,minLength:1,placeHolder:""},data:{mode:"json",source:"",callback:null}},De=function(){function e(){Re(this,e)}return Ce(e,null,[{key:"json",value:function(e,t){if(e){var n=[];Array.isArray(e)?n=e:n.push(e);var r=[];n.forEach((function(e){r.push(new Promise((function(t){fetch(e).then((function(e){return e.json()})).then((function(e){t(e)}))})))})),Promise.all(r).then((function(e){t({items:e.map((function(e){return e.items}))[0],groupings:e.map((function(e){return e.groupings}))[0]||[]})}))}}},{key:"xml",value:function(e,t){AU.helpers.getXML(e,(function(e){!function(e){var n=[],r=[],o=[],i=[],u=1;do{i=$(e).find("associations".concat(u," > item"));for(var s=[],a=0;a<i.length;a+=1)s.push({id:$(i[a]).attr("id"),name:$(i[a]).attr("name"),items:[]});s.length>0&&o.push(s),u+=1}while(i.length>0);var c=$(e).find("items > item");$.each(c,(function(){var e=this,t=$(this).find("extra"),i=[];$.each(t.find("param"),(function(){i.push({param:$(e).text()})}));for(var u={id:$(this).attr("id"),name:$(this).attr("name"),url:$(this).attr("url"),parent:$(this).attr("parent"),extra:i,children:[],associations:[]},s=0;s<o.length;s+=1){var a=$(this).find("association".concat(parseInt(s+1,10)));u.associations.push([]);for(var c=0;c<a.length;c+=1){var l=parseInt($(a[c]).attr("id"),10)-1;u.associations[s].push({id:o[s][l].id,name:o[s][l].name}),o[s][l].items.push(u)}}n.push(u),void 0!==u.parent&&""!==u.parent&&r.push(u)}));for(var l=0;l<r.length;l+=1)for(var f=r[l].parent,p=0;p<n.length;p+=1)if(n[p].id===f){n[p].children.push(r[l]);break}for(var d=[],g=0;g<o.length;g+=1)d.push({id:g,associations:o[g]});t({rawData:e,items:n,groupings:d})}(e)}))}},{key:"table",value:function(e,t){var n=$("".concat(e," > table")),r=$("".concat(e," > ul")),o=[],i=[],u=[];$("li",r).each((function(){var e=[];$("> ul > li",this).each((function(t){e.push({id:t,name:$(this).text(),items:[]})})),e.length>0&&u.push(e)})),$("tr",n).each((function(e){if(e>0){for(var t=$("td",this),n=parseInt(t.eq(0).text(),10),r=parseInt(t.eq(1).text(),10),s=t.eq(2).text(),a={id:n,name:s=s.trim(),url:$("a",t.eq(2)).attr("href"),parent:r,extra:[],children:[],associations:[]},c=0;c<u.length;c+=1){var l=t.eq(c+3).text().split(",");a.associations.push([]);for(var f=0;f<l.length;f+=1){var p=parseInt(l[f],10)-1;void 0!==u[c][p]&&(a.associations[c].push({id:u[c][p].id,name:u[c][p].name}),u[c][p].items.push(a))}}0===a.parent||""===a.parent?o.push(a):i.push(a)}}));for(var s=0;s<i.length;s+=1)for(var a=i[s].parent,c=0;c<o.length;c+=1)if(o[c].id===a){o[c].children.push(i[s]);break}for(var l=[],f=0;f<u.length;f+=1)l.push({id:f,associations:u[f]});t({items:o,groupings:l})}},{key:"list",value:function(e,t){var n=$(e),r=[];$("li",n).each((function(e){r.push({id:e,label:$(this).text(),value:$(this).text(),name:$(this).text(),url:$("a",this).attr("href"),children:[],associations:[]})})),t({items:r,groupings:[]})}}]),e}(),qe=function(){function e(t){Re(this,e),this.boxes=t}return Ce(e,[{key:"init",value:function(){for(var n={json:De.json,xml:De.xml,table:De.table,list:De.list},o=0;o<this.boxes.length;o+=1){var i=this.boxes[o];if(!i.loaded){(i=e.mergeOptions(i)).id=o,e.legacyCleanUp(i);var u=document.querySelector(i.config.container),s=u&&"hidden"!==getComputedStyle(u).visibility;if(!i.config.stacked&&AU.responsive.state&&"PHONE"===AU.responsive.state.NAME&&(i.config.stacked=!0),s&&(r().render(t().createElement(ke,{box:i,parse:n[i.data.mode]}),u),i.loaded=!0),"table"===i.data.mode||"list"===i.data.mode){var a=document.querySelector(i.data.source);a&&a.parentNode.removeChild(a)}}}}}],[{key:"mergeOptions",value:function(e){var t=e;for(var n in t.hasOwnProperty("config")||(t.config={}),Ee.config)t.config.hasOwnProperty(n)||(t.config[n]=Ee.config[n]);for(var r in t.hasOwnProperty("background")||(t.background={}),Ee.background)t.background.hasOwnProperty(r)||(t.background[r]=Ee.background[r]);for(var o in t.hasOwnProperty("search")||(t.search={}),Ee.search)t.search.hasOwnProperty(o)||(t.search[o]=Ee.search[o]);for(var i in t.hasOwnProperty("data")||(t.data={}),Ee.data)t.data.hasOwnProperty(i)||(t.data[i]=Ee.data[i]);return t}},{key:"legacyCleanUp",value:function(e){var t=e,n=$(t.config.container);if(null!==n){var r=$("> *:not(.no-header)",n);r.length>0&&(t.config.buttons=[],r.each((function(){t.config.buttons.push({text:$(this).text(),link:""})})))}}}]),e}();window.AUDatabox=qe})(),i})()));
|
|
2
2
|
//# sourceMappingURL=databox.js.map
|