@constructor-io/constructorio-ui-autocomplete 1.23.21 → 1.23.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constructorio-ui-autocomplete-bundled.js +2 -2
- package/lib/cjs/components/Autocomplete/SearchInput/SearchInput.js +1 -1
- package/lib/cjs/constants.js +2 -0
- package/lib/cjs/hooks/useSections/index.js +1 -1
- package/lib/cjs/hooks/useSections/useActiveSectionsWithData.js +4 -3
- package/lib/cjs/utils.js +5 -1
- package/lib/cjs/version.js +1 -1
- package/lib/mjs/components/Autocomplete/SearchInput/SearchInput.js +1 -1
- package/lib/mjs/constants.js +2 -0
- package/lib/mjs/hooks/useSections/index.js +1 -1
- package/lib/mjs/hooks/useSections/useActiveSectionsWithData.js +4 -3
- package/lib/mjs/utils.js +5 -1
- package/lib/mjs/version.js +1 -1
- package/lib/types/constants.d.ts +2 -2
- package/lib/types/hooks/useSections/useActiveSectionsWithData.d.ts +2 -2
- package/lib/types/utils.d.ts +2 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -32,11 +32,11 @@ var vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"
|
|
|
32
32
|
Error generating stack: `+o.message+`
|
|
33
33
|
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function ru(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function vs(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Tv=typeof WeakMap=="function"?WeakMap:Map;function xd(e,t,n){n=Tt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){lo||(lo=!0,xs=r),vs(e,t)},n}function Id(e,t,n){n=Tt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){vs(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){vs(e,t),typeof r!="function"&&(Gt===null?Gt=new Set([this]):Gt.add(this));var u=t.stack;this.componentDidCatch(t.value,{componentStack:u!==null?u:""})}),n}function qa(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Tv;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=bv.bind(null,e,t,n),t.then(e,e))}function Fa(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ua(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Tt(-1,1),t.tag=2,Wt(n,t,1))),n.lanes|=1),e)}var Nv=Dt.ReactCurrentOwner,qe=!1;function Pe(e,t,n,r){t.child=e===null?id(t,null,n,r):bn(t,e.child,n,r)}function Ba(e,t,n,r,i){n=n.render;var o=t.ref;return qn(t,i),r=fl(e,t,n,r,o,i),n=dl(),e!==null&&!qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Pt(e,t,i)):(fe&&n&&Zs(t),t.flags|=1,Pe(e,t,r,i),t.child)}function ja(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!kl(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Rd(e,t,o,r,i)):(e=Bi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var u=o.memoizedProps;if(n=n.compare,n=n!==null?n:Lr,n(u,r)&&e.ref===t.ref)return Pt(e,t,i)}return t.flags|=1,e=$t(o,r),e.ref=t.ref,e.return=t,t.child=e}function Rd(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Lr(o,r)&&e.ref===t.ref)if(qe=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(qe=!0);else return t.lanes=e.lanes,Pt(e,t,i)}return gs(e,t,n,r,i)}function Td(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ue(Pn,be),be|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ue(Pn,be),be|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ue(Pn,be),be|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ue(Pn,be),be|=r;return Pe(e,t,i,n),t.child}function Nd(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function gs(e,t,n,r,i){var o=Ue(n)?cn:Ae.current;return o=Bn(t,o),qn(t,i),n=fl(e,t,n,r,o,i),r=dl(),e!==null&&!qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Pt(e,t,i)):(fe&&r&&Zs(t),t.flags|=1,Pe(e,t,n,i),t.child)}function ba(e,t,n,r,i){if(Ue(n)){var o=!0;Xi(t)}else o=!1;if(qn(t,i),t.stateNode===null)qi(e,t),nd(t,n,r),hs(t,n,r,i),r=!0;else if(e===null){var u=t.stateNode,s=t.memoizedProps;u.props=s;var a=u.context,d=n.contextType;typeof d=="object"&&d!==null?d=tt(d):(d=Ue(n)?cn:Ae.current,d=Bn(t,d));var m=n.getDerivedStateFromProps,y=typeof m=="function"||typeof u.getSnapshotBeforeUpdate=="function";y||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(s!==r||a!==d)&&Da(t,u,r,d),qt=!1;var k=t.memoizedState;u.state=k,ro(t,r,u,i),a=t.memoizedState,s!==r||k!==a||Fe.current||qt?(typeof m=="function"&&(ps(t,n,m,r),a=t.memoizedState),(s=qt||Pa(t,n,s,r,k,a,d))?(y||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),u.props=r,u.state=a,u.context=d,r=s):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{u=t.stateNode,ed(e,t),s=t.memoizedProps,d=t.type===t.elementType?s:ot(t.type,s),u.props=d,y=t.pendingProps,k=u.context,a=n.contextType,typeof a=="object"&&a!==null?a=tt(a):(a=Ue(n)?cn:Ae.current,a=Bn(t,a));var _=n.getDerivedStateFromProps;(m=typeof _=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(s!==y||k!==a)&&Da(t,u,r,a),qt=!1,k=t.memoizedState,u.state=k,ro(t,r,u,i);var w=t.memoizedState;s!==y||k!==w||Fe.current||qt?(typeof _=="function"&&(ps(t,n,_,r),w=t.memoizedState),(d=qt||Pa(t,n,d,r,k,w,a)||!1)?(m||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(r,w,a),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(r,w,a)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||s===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=w),u.props=r,u.state=w,u.context=a,r=d):(typeof u.componentDidUpdate!="function"||s===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),r=!1)}return ms(e,t,n,r,o,i)}function ms(e,t,n,r,i,o){Nd(e,t);var u=(t.flags&128)!==0;if(!r&&!u)return i&&Ra(t,n,!1),Pt(e,t,o);r=t.stateNode,Nv.current=t;var s=u&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&u?(t.child=bn(t,e.child,null,o),t.child=bn(t,null,s,o)):Pe(e,t,s,o),t.memoizedState=r.state,i&&Ra(t,n,!0),t.child}function Od(e){var t=e.stateNode;t.pendingContext?Ia(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ia(e,t.context,!1),sl(e,t.containerInfo)}function Ha(e,t,n,r,i){return jn(),tl(i),t.flags|=256,Pe(e,t,n,r),t.child}var ys={dehydrated:null,treeContext:null,retryLane:0};function ws(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ad(e,t,n){var r=t.pendingProps,i=de.current,o=!1,u=(t.flags&128)!==0,s;if((s=u)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ue(de,i&1),e===null)return fs(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(u=r.children,e=r.fallback,o?(r=t.mode,o=t.child,u={mode:"hidden",children:u},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=u):o=Io(u,r,0,null),e=an(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=ws(n),t.memoizedState=ys,e):vl(t,u));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Ov(e,t,u,r,s,i,n);if(o){o=r.fallback,u=t.mode,i=e.child,s=i.sibling;var a={mode:"hidden",children:r.children};return!(u&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=$t(i,a),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=$t(s,o):(o=an(o,u,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,u=e.child.memoizedState,u=u===null?ws(n):{baseLanes:u.baseLanes|n,cachePool:null,transitions:u.transitions},o.memoizedState=u,o.childLanes=e.childLanes&~n,t.memoizedState=ys,r}return o=e.child,e=o.sibling,r=$t(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function vl(e,t){return t=Io({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function wi(e,t,n,r){return r!==null&&tl(r),bn(t,e.child,null,n),e=vl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ov(e,t,n,r,i,o,u){if(n)return t.flags&256?(t.flags&=-257,r=ru(Error(z(422))),wi(e,t,u,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Io({mode:"visible",children:r.children},i,0,null),o=an(o,i,u,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&bn(t,e.child,null,u),t.child.memoizedState=ws(u),t.memoizedState=ys,o);if(!(t.mode&1))return wi(e,t,u,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(z(419)),r=ru(o,r,void 0),wi(e,t,u,r)}if(s=(u&e.childLanes)!==0,qe||s){if(r=Ee,r!==null){switch(u&-u){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|u)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,At(e,i),at(r,e,i,-1))}return Sl(),r=ru(Error(z(421))),wi(e,t,u,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Hv.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,He=Kt(i.nextSibling),Ve=t,fe=!0,st=null,e!==null&&(Ye[Xe++]=It,Ye[Xe++]=Rt,Ye[Xe++]=fn,It=e.id,Rt=e.overflow,fn=t),t=vl(t,r.children),t.flags|=4096,t)}function Va(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ds(e.return,t,n)}function iu(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Pd(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Pe(e,t,r.children,n),r=de.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Va(e,n,t);else if(e.tag===19)Va(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ue(de,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&io(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),iu(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}iu(t,!0,n,null,o);break;case"together":iu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),pn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(z(153));if(t.child!==null){for(e=t.child,n=$t(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$t(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Av(e,t,n){switch(t.tag){case 3:Od(t),jn();break;case 5:od(t);break;case 1:Ue(t.type)&&Xi(t);break;case 4:sl(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ue(to,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ue(de,de.current&1),t.flags|=128,null):n&t.child.childLanes?Ad(e,t,n):(ue(de,de.current&1),e=Pt(e,t,n),e!==null?e.sibling:null);ue(de,de.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Pd(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ue(de,de.current),r)break;return null;case 22:case 23:return t.lanes=0,Td(e,t,n)}return Pt(e,t,n)}var Dd,_s,Ld,Md;Dd=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};_s=function(){};Ld=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,sn(_t.current);var o=null;switch(n){case"input":i=bu(e,i),r=bu(e,r),o=[];break;case"select":i=he({},i,{value:void 0}),r=he({},r,{value:void 0}),o=[];break;case"textarea":i=Ku(e,i),r=Ku(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ji)}Gu(n,r);var u;n=null;for(d in i)if(!r.hasOwnProperty(d)&&i.hasOwnProperty(d)&&i[d]!=null)if(d==="style"){var s=i[d];for(u in s)s.hasOwnProperty(u)&&(n||(n={}),n[u]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Rr.hasOwnProperty(d)?o||(o=[]):(o=o||[]).push(d,null));for(d in r){var a=r[d];if(s=i!=null?i[d]:void 0,r.hasOwnProperty(d)&&a!==s&&(a!=null||s!=null))if(d==="style")if(s){for(u in s)!s.hasOwnProperty(u)||a&&a.hasOwnProperty(u)||(n||(n={}),n[u]="");for(u in a)a.hasOwnProperty(u)&&s[u]!==a[u]&&(n||(n={}),n[u]=a[u])}else n||(o||(o=[]),o.push(d,n)),n=a;else d==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,s=s?s.__html:void 0,a!=null&&s!==a&&(o=o||[]).push(d,a)):d==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(d,""+a):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Rr.hasOwnProperty(d)?(a!=null&&d==="onScroll"&&le("scroll",e),o||s===a||(o=[])):(o=o||[]).push(d,a))}n&&(o=o||[]).push("style",n);var d=o;(t.updateQueue=d)&&(t.flags|=4)}};Md=function(e,t,n,r){n!==r&&(t.flags|=4)};function sr(e,t){if(!fe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ne(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Pv(e,t,n){var r=t.pendingProps;switch(el(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ne(t),null;case 1:return Ue(t.type)&&Yi(),Ne(t),null;case 3:return r=t.stateNode,Hn(),ae(Fe),ae(Ae),al(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(mi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,st!==null&&(Ts(st),st=null))),_s(e,t),Ne(t),null;case 5:ll(t);var i=sn(Ur.current);if(n=t.type,e!==null&&t.stateNode!=null)Ld(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(z(166));return Ne(t),null}if(e=sn(_t.current),mi(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[yt]=t,r[qr]=o,e=(t.mode&1)!==0,n){case"dialog":le("cancel",r),le("close",r);break;case"iframe":case"object":case"embed":le("load",r);break;case"video":case"audio":for(i=0;i<pr.length;i++)le(pr[i],r);break;case"source":le("error",r);break;case"img":case"image":case"link":le("error",r),le("load",r);break;case"details":le("toggle",r);break;case"input":Zl(r,o),le("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},le("invalid",r);break;case"textarea":ta(r,o),le("invalid",r)}Gu(n,o),i=null;for(var u in o)if(o.hasOwnProperty(u)){var s=o[u];u==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&gi(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&gi(r.textContent,s,e),i=["children",""+s]):Rr.hasOwnProperty(u)&&s!=null&&u==="onScroll"&&le("scroll",r)}switch(n){case"input":li(r),ea(r,o,!0);break;case"textarea":li(r),na(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=Ji)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{u=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=lf(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=u.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),n==="select"&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[yt]=t,e[qr]=r,Dd(e,t,!1,!1),t.stateNode=e;e:{switch(u=Qu(n,r),n){case"dialog":le("cancel",e),le("close",e),i=r;break;case"iframe":case"object":case"embed":le("load",e),i=r;break;case"video":case"audio":for(i=0;i<pr.length;i++)le(pr[i],e);i=r;break;case"source":le("error",e),i=r;break;case"img":case"image":case"link":le("error",e),le("load",e),i=r;break;case"details":le("toggle",e),i=r;break;case"input":Zl(e,r),i=bu(e,r),le("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=he({},r,{value:void 0}),le("invalid",e);break;case"textarea":ta(e,r),i=Ku(e,r),le("invalid",e);break;default:i=r}Gu(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="style"?ff(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&af(e,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Tr(e,a):typeof a=="number"&&Tr(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Rr.hasOwnProperty(o)?a!=null&&o==="onScroll"&&le("scroll",e):a!=null&&Us(e,o,a,u))}switch(n){case"input":li(e),ea(e,r,!1);break;case"textarea":li(e),na(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Jt(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Dn(e,!!r.multiple,o,!1):r.defaultValue!=null&&Dn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Ji)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ne(t),null;case 6:if(e&&t.stateNode!=null)Md(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(z(166));if(n=sn(Ur.current),sn(_t.current),mi(t)){if(r=t.stateNode,n=t.memoizedProps,r[yt]=t,(o=r.nodeValue!==n)&&(e=Ve,e!==null))switch(e.tag){case 3:gi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&gi(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[yt]=t,t.stateNode=r}return Ne(t),null;case 13:if(ae(de),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(fe&&He!==null&&t.mode&1&&!(t.flags&128))Xf(),jn(),t.flags|=98560,o=!1;else if(o=mi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(z(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(z(317));o[yt]=t}else jn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ne(t),o=!1}else st!==null&&(Ts(st),st=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||de.current&1?Se===0&&(Se=3):Sl())),t.updateQueue!==null&&(t.flags|=4),Ne(t),null);case 4:return Hn(),_s(e,t),e===null&&Mr(t.stateNode.containerInfo),Ne(t),null;case 10:return il(t.type._context),Ne(t),null;case 17:return Ue(t.type)&&Yi(),Ne(t),null;case 19:if(ae(de),o=t.memoizedState,o===null)return Ne(t),null;if(r=(t.flags&128)!==0,u=o.rendering,u===null)if(r)sr(o,!1);else{if(Se!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(u=io(e),u!==null){for(t.flags|=128,sr(o,!1),r=u.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,u=o.alternate,u===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=u.childLanes,o.lanes=u.lanes,o.child=u.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=u.memoizedProps,o.memoizedState=u.memoizedState,o.updateQueue=u.updateQueue,o.type=u.type,e=u.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ue(de,de.current&1|2),t.child}e=e.sibling}o.tail!==null&&me()>Kn&&(t.flags|=128,r=!0,sr(o,!1),t.lanes=4194304)}else{if(!r)if(e=io(u),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),sr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!u.alternate&&!fe)return Ne(t),null}else 2*me()-o.renderingStartTime>Kn&&n!==1073741824&&(t.flags|=128,r=!0,sr(o,!1),t.lanes=4194304);o.isBackwards?(u.sibling=t.child,t.child=u):(n=o.last,n!==null?n.sibling=u:t.child=u,o.last=u)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=me(),t.sibling=null,n=de.current,ue(de,r?n&1|2:n&1),t):(Ne(t),null);case 22:case 23:return _l(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?be&1073741824&&(Ne(t),t.subtreeFlags&6&&(t.flags|=8192)):Ne(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function Dv(e,t){switch(el(t),t.tag){case 1:return Ue(t.type)&&Yi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hn(),ae(Fe),ae(Ae),al(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ll(t),null;case 13:if(ae(de),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));jn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(de),null;case 4:return Hn(),null;case 10:return il(t.type._context),null;case 22:case 23:return _l(),null;case 24:return null;default:return null}}var _i=!1,Oe=!1,Lv=typeof WeakSet=="function"?WeakSet:Set,K=null;function An(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ge(e,t,r)}else n.current=null}function Ss(e,t,n){try{n()}catch(r){ge(e,t,r)}}var Ka=!1;function Mv(e,t){if(is=Gi,e=Uf(),Xs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var u=0,s=-1,a=-1,d=0,m=0,y=e,k=null;t:for(;;){for(var _;y!==n||i!==0&&y.nodeType!==3||(s=u+i),y!==o||r!==0&&y.nodeType!==3||(a=u+r),y.nodeType===3&&(u+=y.nodeValue.length),(_=y.firstChild)!==null;)k=y,y=_;for(;;){if(y===e)break t;if(k===n&&++d===i&&(s=u),k===o&&++m===r&&(a=u),(_=y.nextSibling)!==null)break;y=k,k=y.parentNode}y=_}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(os={focusedElem:e,selectionRange:n},Gi=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var l=w.memoizedProps,p=w.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?l:ot(t.type,l),p);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(E){ge(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return w=Ka,Ka=!1,w}function kr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Ss(t,n,o)}i=i.next}while(i!==r)}}function Co(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ks(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function zd(e){var t=e.alternate;t!==null&&(e.alternate=null,zd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yt],delete t[qr],delete t[ls],delete t[mv],delete t[yv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function qd(e){return e.tag===5||e.tag===3||e.tag===4}function Wa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Es(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ji));else if(r!==4&&(e=e.child,e!==null))for(Es(e,t,n),e=e.sibling;e!==null;)Es(e,t,n),e=e.sibling}function Cs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Cs(e,t,n),e=e.sibling;e!==null;)Cs(e,t,n),e=e.sibling}var xe=null,ut=!1;function Mt(e,t,n){for(n=n.child;n!==null;)Fd(e,t,n),n=n.sibling}function Fd(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(go,n)}catch{}switch(n.tag){case 5:Oe||An(n,t);case 6:var r=xe,i=ut;xe=null,Mt(e,t,n),xe=r,ut=i,xe!==null&&(ut?(e=xe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xe.removeChild(n.stateNode));break;case 18:xe!==null&&(ut?(e=xe,n=n.stateNode,e.nodeType===8?Yo(e.parentNode,n):e.nodeType===1&&Yo(e,n),Pr(e)):Yo(xe,n.stateNode));break;case 4:r=xe,i=ut,xe=n.stateNode.containerInfo,ut=!0,Mt(e,t,n),xe=r,ut=i;break;case 0:case 11:case 14:case 15:if(!Oe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,u=o.destroy;o=o.tag,u!==void 0&&(o&2||o&4)&&Ss(n,t,u),i=i.next}while(i!==r)}Mt(e,t,n);break;case 1:if(!Oe&&(An(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){ge(n,t,s)}Mt(e,t,n);break;case 21:Mt(e,t,n);break;case 22:n.mode&1?(Oe=(r=Oe)||n.memoizedState!==null,Mt(e,t,n),Oe=r):Mt(e,t,n);break;default:Mt(e,t,n)}}function Ga(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Lv),t.forEach(function(r){var i=Vv.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function it(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,u=t,s=u;e:for(;s!==null;){switch(s.tag){case 5:xe=s.stateNode,ut=!1;break e;case 3:xe=s.stateNode.containerInfo,ut=!0;break e;case 4:xe=s.stateNode.containerInfo,ut=!0;break e}s=s.return}if(xe===null)throw Error(z(160));Fd(o,u,i),xe=null,ut=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(d){ge(i,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ud(t,e),t=t.sibling}function Ud(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(it(t,e),gt(e),r&4){try{kr(3,e,e.return),Co(3,e)}catch(l){ge(e,e.return,l)}try{kr(5,e,e.return)}catch(l){ge(e,e.return,l)}}break;case 1:it(t,e),gt(e),r&512&&n!==null&&An(n,n.return);break;case 5:if(it(t,e),gt(e),r&512&&n!==null&&An(n,n.return),e.flags&32){var i=e.stateNode;try{Tr(i,"")}catch(l){ge(e,e.return,l)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,u=n!==null?n.memoizedProps:o,s=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&uf(i,o),Qu(s,u);var d=Qu(s,o);for(u=0;u<a.length;u+=2){var m=a[u],y=a[u+1];m==="style"?ff(i,y):m==="dangerouslySetInnerHTML"?af(i,y):m==="children"?Tr(i,y):Us(i,m,y,d)}switch(s){case"input":Hu(i,o);break;case"textarea":sf(i,o);break;case"select":var k=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var _=o.value;_!=null?Dn(i,!!o.multiple,_,!1):k!==!!o.multiple&&(o.defaultValue!=null?Dn(i,!!o.multiple,o.defaultValue,!0):Dn(i,!!o.multiple,o.multiple?[]:"",!1))}i[qr]=o}catch(l){ge(e,e.return,l)}}break;case 6:if(it(t,e),gt(e),r&4){if(e.stateNode===null)throw Error(z(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(l){ge(e,e.return,l)}}break;case 3:if(it(t,e),gt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Pr(t.containerInfo)}catch(l){ge(e,e.return,l)}break;case 4:it(t,e),gt(e);break;case 13:it(t,e),gt(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(yl=me())),r&4&&Ga(e);break;case 22:if(m=n!==null&&n.memoizedState!==null,e.mode&1?(Oe=(d=Oe)||m,it(t,e),Oe=d):it(t,e),gt(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!m&&e.mode&1)for(K=e,m=e.child;m!==null;){for(y=K=m;K!==null;){switch(k=K,_=k.child,k.tag){case 0:case 11:case 14:case 15:kr(4,k,k.return);break;case 1:An(k,k.return);var w=k.stateNode;if(typeof w.componentWillUnmount=="function"){r=k,n=k.return;try{t=r,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(l){ge(r,n,l)}}break;case 5:An(k,k.return);break;case 22:if(k.memoizedState!==null){$a(y);continue}}_!==null?(_.return=k,K=_):$a(y)}m=m.sibling}e:for(m=null,y=e;;){if(y.tag===5){if(m===null){m=y;try{i=y.stateNode,d?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=y.stateNode,a=y.memoizedProps.style,u=a!=null&&a.hasOwnProperty("display")?a.display:null,s.style.display=cf("display",u))}catch(l){ge(e,e.return,l)}}}else if(y.tag===6){if(m===null)try{y.stateNode.nodeValue=d?"":y.memoizedProps}catch(l){ge(e,e.return,l)}}else if((y.tag!==22&&y.tag!==23||y.memoizedState===null||y===e)&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===e)break e;for(;y.sibling===null;){if(y.return===null||y.return===e)break e;m===y&&(m=null),y=y.return}m===y&&(m=null),y.sibling.return=y.return,y=y.sibling}}break;case 19:it(t,e),gt(e),r&4&&Ga(e);break;case 21:break;default:it(t,e),gt(e)}}function gt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(qd(n)){var r=n;break e}n=n.return}throw Error(z(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Tr(i,""),r.flags&=-33);var o=Wa(e);Cs(e,o,i);break;case 3:case 4:var u=r.stateNode.containerInfo,s=Wa(e);Es(e,s,u);break;default:throw Error(z(161))}}catch(a){ge(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zv(e,t,n){K=e,Bd(e)}function Bd(e,t,n){for(var r=(e.mode&1)!==0;K!==null;){var i=K,o=i.child;if(i.tag===22&&r){var u=i.memoizedState!==null||_i;if(!u){var s=i.alternate,a=s!==null&&s.memoizedState!==null||Oe;s=_i;var d=Oe;if(_i=u,(Oe=a)&&!d)for(K=i;K!==null;)u=K,a=u.child,u.tag===22&&u.memoizedState!==null?Ja(i):a!==null?(a.return=u,K=a):Ja(i);for(;o!==null;)K=o,Bd(o),o=o.sibling;K=i,_i=s,Oe=d}Qa(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,K=o):Qa(e)}}function Qa(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Oe||Co(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Oe)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:ot(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Aa(t,o,r);break;case 3:var u=t.updateQueue;if(u!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Aa(t,u,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var m=d.memoizedState;if(m!==null){var y=m.dehydrated;y!==null&&Pr(y)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(z(163))}Oe||t.flags&512&&ks(t)}catch(k){ge(t,t.return,k)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function $a(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function Ja(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Co(4,t)}catch(a){ge(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(a){ge(t,i,a)}}var o=t.return;try{ks(t)}catch(a){ge(t,o,a)}break;case 5:var u=t.return;try{ks(t)}catch(a){ge(t,u,a)}}}catch(a){ge(t,t.return,a)}if(t===e){K=null;break}var s=t.sibling;if(s!==null){s.return=t.return,K=s;break}K=t.return}}var qv=Math.ceil,so=Dt.ReactCurrentDispatcher,gl=Dt.ReactCurrentOwner,et=Dt.ReactCurrentBatchConfig,te=0,Ee=null,ye=null,Ie=0,be=0,Pn=Zt(0),Se=0,Hr=null,pn=0,xo=0,ml=0,Er=null,ze=null,yl=0,Kn=1/0,Ct=null,lo=!1,xs=null,Gt=null,Si=!1,jt=null,ao=0,Cr=0,Is=null,Fi=-1,Ui=0;function De(){return te&6?me():Fi!==-1?Fi:Fi=me()}function Qt(e){return e.mode&1?te&2&&Ie!==0?Ie&-Ie:_v.transition!==null?(Ui===0&&(Ui=Ef()),Ui):(e=oe,e!==0||(e=window.event,e=e===void 0?16:Of(e.type)),e):1}function at(e,t,n,r){if(50<Cr)throw Cr=0,Is=null,Error(z(185));Wr(e,n,r),(!(te&2)||e!==Ee)&&(e===Ee&&(!(te&2)&&(xo|=n),Se===4&&Ut(e,Ie)),Be(e,r),n===1&&te===0&&!(t.mode&1)&&(Kn=me()+500,So&&en()))}function Be(e,t){var n=e.callbackNode;_h(e,t);var r=Wi(e,e===Ee?Ie:0);if(r===0)n!==null&&oa(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&oa(n),t===1)e.tag===0?wv(Ya.bind(null,e)):$f(Ya.bind(null,e)),vv(function(){!(te&6)&&en()}),n=null;else{switch(Cf(r)){case 1:n=Vs;break;case 4:n=Sf;break;case 16:n=Ki;break;case 536870912:n=kf;break;default:n=Ki}n=Qd(n,jd.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function jd(e,t){if(Fi=-1,Ui=0,te&6)throw Error(z(327));var n=e.callbackNode;if(Fn()&&e.callbackNode!==n)return null;var r=Wi(e,e===Ee?Ie:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=co(e,r);else{t=r;var i=te;te|=2;var o=Hd();(Ee!==e||Ie!==t)&&(Ct=null,Kn=me()+500,ln(e,t));do try{Bv();break}catch(s){bd(e,s)}while(1);rl(),so.current=o,te=i,ye!==null?t=0:(Ee=null,Ie=0,t=Se)}if(t!==0){if(t===2&&(i=Zu(e),i!==0&&(r=i,t=Rs(e,i))),t===1)throw n=Hr,ln(e,0),Ut(e,r),Be(e,me()),n;if(t===6)Ut(e,r);else{if(i=e.current.alternate,!(r&30)&&!Fv(i)&&(t=co(e,r),t===2&&(o=Zu(e),o!==0&&(r=o,t=Rs(e,o))),t===1))throw n=Hr,ln(e,0),Ut(e,r),Be(e,me()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(z(345));case 2:rn(e,ze,Ct);break;case 3:if(Ut(e,r),(r&130023424)===r&&(t=yl+500-me(),10<t)){if(Wi(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){De(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ss(rn.bind(null,e,ze,Ct),t);break}rn(e,ze,Ct);break;case 4:if(Ut(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var u=31-lt(r);o=1<<u,u=t[u],u>i&&(i=u),r&=~o}if(r=i,r=me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*qv(r/1960))-r,10<r){e.timeoutHandle=ss(rn.bind(null,e,ze,Ct),r);break}rn(e,ze,Ct);break;case 5:rn(e,ze,Ct);break;default:throw Error(z(329))}}}return Be(e,me()),e.callbackNode===n?jd.bind(null,e):null}function Rs(e,t){var n=Er;return e.current.memoizedState.isDehydrated&&(ln(e,t).flags|=256),e=co(e,t),e!==2&&(t=ze,ze=n,t!==null&&Ts(t)),e}function Ts(e){ze===null?ze=e:ze.push.apply(ze,e)}function Fv(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!ct(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ut(e,t){for(t&=~ml,t&=~xo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-lt(t),r=1<<n;e[n]=-1,t&=~r}}function Ya(e){if(te&6)throw Error(z(327));Fn();var t=Wi(e,0);if(!(t&1))return Be(e,me()),null;var n=co(e,t);if(e.tag!==0&&n===2){var r=Zu(e);r!==0&&(t=r,n=Rs(e,r))}if(n===1)throw n=Hr,ln(e,0),Ut(e,t),Be(e,me()),n;if(n===6)throw Error(z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,rn(e,ze,Ct),Be(e,me()),null}function wl(e,t){var n=te;te|=1;try{return e(t)}finally{te=n,te===0&&(Kn=me()+500,So&&en())}}function hn(e){jt!==null&&jt.tag===0&&!(te&6)&&Fn();var t=te;te|=1;var n=et.transition,r=oe;try{if(et.transition=null,oe=1,e)return e()}finally{oe=r,et.transition=n,te=t,!(te&6)&&en()}}function _l(){be=Pn.current,ae(Pn)}function ln(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,hv(n)),ye!==null)for(n=ye.return;n!==null;){var r=n;switch(el(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Yi();break;case 3:Hn(),ae(Fe),ae(Ae),al();break;case 5:ll(r);break;case 4:Hn();break;case 13:ae(de);break;case 19:ae(de);break;case 10:il(r.type._context);break;case 22:case 23:_l()}n=n.return}if(Ee=e,ye=e=$t(e.current,null),Ie=be=t,Se=0,Hr=null,ml=xo=pn=0,ze=Er=null,un!==null){for(t=0;t<un.length;t++)if(n=un[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var u=o.next;o.next=i,r.next=u}n.pending=r}un=null}return e}function bd(e,t){do{var n=ye;try{if(rl(),Mi.current=uo,oo){for(var r=pe.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}oo=!1}if(dn=0,ke=_e=pe=null,Sr=!1,Br=0,gl.current=null,n===null||n.return===null){Se=1,Hr=t,ye=null;break}e:{var o=e,u=n.return,s=n,a=t;if(t=Ie,s.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var d=a,m=s,y=m.tag;if(!(m.mode&1)&&(y===0||y===11||y===15)){var k=m.alternate;k?(m.updateQueue=k.updateQueue,m.memoizedState=k.memoizedState,m.lanes=k.lanes):(m.updateQueue=null,m.memoizedState=null)}var _=Fa(u);if(_!==null){_.flags&=-257,Ua(_,u,s,o,t),_.mode&1&&qa(o,d,t),t=_,a=d;var w=t.updateQueue;if(w===null){var l=new Set;l.add(a),t.updateQueue=l}else w.add(a);break e}else{if(!(t&1)){qa(o,d,t),Sl();break e}a=Error(z(426))}}else if(fe&&s.mode&1){var p=Fa(u);if(p!==null){!(p.flags&65536)&&(p.flags|=256),Ua(p,u,s,o,t),tl(Vn(a,s));break e}}o=a=Vn(a,s),Se!==4&&(Se=2),Er===null?Er=[o]:Er.push(o),o=u;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var f=xd(o,a,t);Oa(o,f);break e;case 1:s=a;var c=o.type,h=o.stateNode;if(!(o.flags&128)&&(typeof c.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Gt===null||!Gt.has(h)))){o.flags|=65536,t&=-t,o.lanes|=t;var E=Id(o,s,t);Oa(o,E);break e}}o=o.return}while(o!==null)}Kd(n)}catch(x){t=x,ye===n&&n!==null&&(ye=n=n.return);continue}break}while(1)}function Hd(){var e=so.current;return so.current=uo,e===null?uo:e}function Sl(){(Se===0||Se===3||Se===2)&&(Se=4),Ee===null||!(pn&268435455)&&!(xo&268435455)||Ut(Ee,Ie)}function co(e,t){var n=te;te|=2;var r=Hd();(Ee!==e||Ie!==t)&&(Ct=null,ln(e,t));do try{Uv();break}catch(i){bd(e,i)}while(1);if(rl(),te=n,so.current=r,ye!==null)throw Error(z(261));return Ee=null,Ie=0,Se}function Uv(){for(;ye!==null;)Vd(ye)}function Bv(){for(;ye!==null&&!fh();)Vd(ye)}function Vd(e){var t=Gd(e.alternate,e,be);e.memoizedProps=e.pendingProps,t===null?Kd(e):ye=t,gl.current=null}function Kd(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Dv(n,t),n!==null){n.flags&=32767,ye=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Se=6,ye=null;return}}else if(n=Pv(n,t,be),n!==null){ye=n;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);Se===0&&(Se=5)}function rn(e,t,n){var r=oe,i=et.transition;try{et.transition=null,oe=1,jv(e,t,n,r)}finally{et.transition=i,oe=r}return null}function jv(e,t,n,r){do Fn();while(jt!==null);if(te&6)throw Error(z(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(z(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Sh(e,o),e===Ee&&(ye=Ee=null,Ie=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Si||(Si=!0,Qd(Ki,function(){return Fn(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=et.transition,et.transition=null;var u=oe;oe=1;var s=te;te|=4,gl.current=null,Mv(e,n),Ud(n,e),sv(os),Gi=!!is,os=is=null,e.current=n,zv(n),dh(),te=s,oe=u,et.transition=o}else e.current=n;if(Si&&(Si=!1,jt=e,ao=i),o=e.pendingLanes,o===0&&(Gt=null),vh(n.stateNode),Be(e,me()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(lo)throw lo=!1,e=xs,xs=null,e;return ao&1&&e.tag!==0&&Fn(),o=e.pendingLanes,o&1?e===Is?Cr++:(Cr=0,Is=e):Cr=0,en(),null}function Fn(){if(jt!==null){var e=Cf(ao),t=et.transition,n=oe;try{if(et.transition=null,oe=16>e?16:e,jt===null)var r=!1;else{if(e=jt,jt=null,ao=0,te&6)throw Error(z(331));var i=te;for(te|=4,K=e.current;K!==null;){var o=K,u=o.child;if(K.flags&16){var s=o.deletions;if(s!==null){for(var a=0;a<s.length;a++){var d=s[a];for(K=d;K!==null;){var m=K;switch(m.tag){case 0:case 11:case 15:kr(8,m,o)}var y=m.child;if(y!==null)y.return=m,K=y;else for(;K!==null;){m=K;var k=m.sibling,_=m.return;if(zd(m),m===d){K=null;break}if(k!==null){k.return=_,K=k;break}K=_}}}var w=o.alternate;if(w!==null){var l=w.child;if(l!==null){w.child=null;do{var p=l.sibling;l.sibling=null,l=p}while(l!==null)}}K=o}}if(o.subtreeFlags&2064&&u!==null)u.return=o,K=u;else e:for(;K!==null;){if(o=K,o.flags&2048)switch(o.tag){case 0:case 11:case 15:kr(9,o,o.return)}var f=o.sibling;if(f!==null){f.return=o.return,K=f;break e}K=o.return}}var c=e.current;for(K=c;K!==null;){u=K;var h=u.child;if(u.subtreeFlags&2064&&h!==null)h.return=u,K=h;else e:for(u=c;K!==null;){if(s=K,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:Co(9,s)}}catch(x){ge(s,s.return,x)}if(s===u){K=null;break e}var E=s.sibling;if(E!==null){E.return=s.return,K=E;break e}K=s.return}}if(te=i,en(),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(go,e)}catch{}r=!0}return r}finally{oe=n,et.transition=t}}return!1}function Xa(e,t,n){t=Vn(n,t),t=xd(e,t,1),e=Wt(e,t,1),t=De(),e!==null&&(Wr(e,1,t),Be(e,t))}function ge(e,t,n){if(e.tag===3)Xa(e,e,n);else for(;t!==null;){if(t.tag===3){Xa(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Gt===null||!Gt.has(r))){e=Vn(n,e),e=Id(t,e,1),t=Wt(t,e,1),e=De(),t!==null&&(Wr(t,1,e),Be(t,e));break}}t=t.return}}function bv(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=De(),e.pingedLanes|=e.suspendedLanes&n,Ee===e&&(Ie&n)===n&&(Se===4||Se===3&&(Ie&130023424)===Ie&&500>me()-yl?ln(e,0):ml|=n),Be(e,t)}function Wd(e,t){t===0&&(e.mode&1?(t=fi,fi<<=1,!(fi&130023424)&&(fi=4194304)):t=1);var n=De();e=At(e,t),e!==null&&(Wr(e,t,n),Be(e,n))}function Hv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wd(e,n)}function Vv(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),Wd(e,n)}var Gd;Gd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Fe.current)qe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qe=!1,Av(e,t,n);qe=!!(e.flags&131072)}else qe=!1,fe&&t.flags&1048576&&Jf(t,eo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;qi(e,t),e=t.pendingProps;var i=Bn(t,Ae.current);qn(t,n),i=fl(null,t,r,e,i,n);var o=dl();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ue(r)?(o=!0,Xi(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ul(t),i.updater=ko,t.stateNode=i,i._reactInternals=t,hs(t,r,e,n),t=ms(null,t,r,!0,o,n)):(t.tag=0,fe&&o&&Zs(t),Pe(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(qi(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Wv(r),e=ot(r,e),i){case 0:t=gs(null,t,r,e,n);break e;case 1:t=ba(null,t,r,e,n);break e;case 11:t=Ba(null,t,r,e,n);break e;case 14:t=ja(null,t,r,ot(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ot(r,i),gs(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ot(r,i),ba(e,t,r,i,n);case 3:e:{if(Od(t),e===null)throw Error(z(387));r=t.pendingProps,o=t.memoizedState,i=o.element,ed(e,t),ro(t,r,null,n);var u=t.memoizedState;if(r=u.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Vn(Error(z(423)),t),t=Ha(e,t,r,n,i);break e}else if(r!==i){i=Vn(Error(z(424)),t),t=Ha(e,t,r,n,i);break e}else for(He=Kt(t.stateNode.containerInfo.firstChild),Ve=t,fe=!0,st=null,n=id(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(jn(),r===i){t=Pt(e,t,n);break e}Pe(e,t,r,n)}t=t.child}return t;case 5:return od(t),e===null&&fs(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,u=i.children,us(r,i)?u=null:o!==null&&us(r,o)&&(t.flags|=32),Nd(e,t),Pe(e,t,u,n),t.child;case 6:return e===null&&fs(t),null;case 13:return Ad(e,t,n);case 4:return sl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bn(t,null,r,n):Pe(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ot(r,i),Ba(e,t,r,i,n);case 7:return Pe(e,t,t.pendingProps,n),t.child;case 8:return Pe(e,t,t.pendingProps.children,n),t.child;case 12:return Pe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,u=i.value,ue(to,r._currentValue),r._currentValue=u,o!==null)if(ct(o.value,u)){if(o.children===i.children&&!Fe.current){t=Pt(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){u=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=Tt(-1,n&-n),a.tag=2;var d=o.updateQueue;if(d!==null){d=d.shared;var m=d.pending;m===null?a.next=a:(a.next=m.next,m.next=a),d.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ds(o.return,n,t),s.lanes|=n;break}a=a.next}}else if(o.tag===10)u=o.type===t.type?null:o.child;else if(o.tag===18){if(u=o.return,u===null)throw Error(z(341));u.lanes|=n,s=u.alternate,s!==null&&(s.lanes|=n),ds(u,n,t),u=o.sibling}else u=o.child;if(u!==null)u.return=o;else for(u=o;u!==null;){if(u===t){u=null;break}if(o=u.sibling,o!==null){o.return=u.return,u=o;break}u=u.return}o=u}Pe(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,qn(t,n),i=tt(i),r=r(i),t.flags|=1,Pe(e,t,r,n),t.child;case 14:return r=t.type,i=ot(r,t.pendingProps),i=ot(r.type,i),ja(e,t,r,i,n);case 15:return Rd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ot(r,i),qi(e,t),t.tag=1,Ue(r)?(e=!0,Xi(t)):e=!1,qn(t,n),nd(t,r,i),hs(t,r,i,n),ms(null,t,r,!0,e,n);case 19:return Pd(e,t,n);case 22:return Td(e,t,n)}throw Error(z(156,t.tag))};function Qd(e,t){return _f(e,t)}function Kv(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ze(e,t,n,r){return new Kv(e,t,n,r)}function kl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wv(e){if(typeof e=="function")return kl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===js)return 11;if(e===bs)return 14}return 2}function $t(e,t){var n=e.alternate;return n===null?(n=Ze(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Bi(e,t,n,r,i,o){var u=2;if(r=e,typeof e=="function")kl(e)&&(u=1);else if(typeof e=="string")u=5;else e:switch(e){case kn:return an(n.children,i,o,t);case Bs:u=8,i|=8;break;case Fu:return e=Ze(12,n,t,i|2),e.elementType=Fu,e.lanes=o,e;case Uu:return e=Ze(13,n,t,i),e.elementType=Uu,e.lanes=o,e;case Bu:return e=Ze(19,n,t,i),e.elementType=Bu,e.lanes=o,e;case nf:return Io(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ef:u=10;break e;case tf:u=9;break e;case js:u=11;break e;case bs:u=14;break e;case zt:u=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Ze(u,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function an(e,t,n,r){return e=Ze(7,e,r,t),e.lanes=n,e}function Io(e,t,n,r){return e=Ze(22,e,r,t),e.elementType=nf,e.lanes=n,e.stateNode={isHidden:!1},e}function ou(e,t,n){return e=Ze(6,e,null,t),e.lanes=n,e}function uu(e,t,n){return t=Ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Gv(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bo(0),this.expirationTimes=Bo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bo(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function El(e,t,n,r,i,o,u,s,a){return e=new Gv(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Ze(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ul(o),e}function Qv(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Sn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function $d(e){if(!e)return Yt;e=e._reactInternals;e:{if(gn(e)!==e||e.tag!==1)throw Error(z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ue(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(z(171))}if(e.tag===1){var n=e.type;if(Ue(n))return Qf(e,n,t)}return t}function Jd(e,t,n,r,i,o,u,s,a){return e=El(n,r,!0,e,i,o,u,s,a),e.context=$d(null),n=e.current,r=De(),i=Qt(n),o=Tt(r,i),o.callback=t??null,Wt(n,o,i),e.current.lanes=i,Wr(e,i,r),Be(e,r),e}function Ro(e,t,n,r){var i=t.current,o=De(),u=Qt(i);return n=$d(n),t.context===null?t.context=n:t.pendingContext=n,t=Tt(o,u),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Wt(i,t,u),e!==null&&(at(e,i,u,o),Li(e,i,u)),u}function fo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Za(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Cl(e,t){Za(e,t),(e=e.alternate)&&Za(e,t)}function $v(){return null}var Yd=typeof reportError=="function"?reportError:function(e){console.error(e)};function xl(e){this._internalRoot=e}To.prototype.render=xl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(z(409));Ro(e,t,null,null)};To.prototype.unmount=xl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hn(function(){Ro(null,e,null,null)}),t[Ot]=null}};function To(e){this._internalRoot=e}To.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ft.length&&t!==0&&t<Ft[n].priority;n++);Ft.splice(n,0,e),n===0&&Nf(e)}};function Il(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function No(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ec(){}function Jv(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var d=fo(u);o.call(d)}}var u=Jd(t,r,e,0,null,!1,!1,"",ec);return e._reactRootContainer=u,e[Ot]=u.current,Mr(e.nodeType===8?e.parentNode:e),hn(),u}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var d=fo(a);s.call(d)}}var a=El(e,0,!1,null,null,!1,!1,"",ec);return e._reactRootContainer=a,e[Ot]=a.current,Mr(e.nodeType===8?e.parentNode:e),hn(function(){Ro(t,a,n,r)}),a}function Oo(e,t,n,r,i){var o=n._reactRootContainer;if(o){var u=o;if(typeof i=="function"){var s=i;i=function(){var a=fo(u);s.call(a)}}Ro(t,u,e,i)}else u=Jv(n,t,e,i,r);return fo(u)}xf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dr(t.pendingLanes);n!==0&&(Ks(t,n|1),Be(t,me()),!(te&6)&&(Kn=me()+500,en()))}break;case 13:hn(function(){var r=At(e,1);if(r!==null){var i=De();at(r,e,1,i)}}),Cl(e,1)}};Ws=function(e){if(e.tag===13){var t=At(e,134217728);if(t!==null){var n=De();at(t,e,134217728,n)}Cl(e,134217728)}};If=function(e){if(e.tag===13){var t=Qt(e),n=At(e,t);if(n!==null){var r=De();at(n,e,t,r)}Cl(e,t)}};Rf=function(){return oe};Tf=function(e,t){var n=oe;try{return oe=e,t()}finally{oe=n}};Ju=function(e,t,n){switch(t){case"input":if(Hu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=_o(r);if(!i)throw Error(z(90));of(r),Hu(r,i)}}}break;case"textarea":sf(e,n);break;case"select":t=n.value,t!=null&&Dn(e,!!n.multiple,t,!1)}};hf=wl;vf=hn;var Yv={usingClientEntryPoint:!1,Events:[Qr,In,_o,df,pf,wl]},lr={findFiberByHostInstance:on,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},Xv={bundleType:lr.bundleType,version:lr.version,rendererPackageName:lr.rendererPackageName,rendererConfig:lr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Dt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=yf(e),e===null?null:e.stateNode},findFiberByHostInstance:lr.findFiberByHostInstance||$v,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ki=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ki.isDisabled&&ki.supportsFiber)try{go=ki.inject(Xv),wt=ki}catch{}}We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yv;We.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Il(t))throw Error(z(200));return Qv(e,t,null,n)};We.createRoot=function(e,t){if(!Il(e))throw Error(z(299));var n=!1,r="",i=Yd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=El(e,1,!1,null,null,n,!1,r,i),e[Ot]=t.current,Mr(e.nodeType===8?e.parentNode:e),new xl(t)};We.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(z(188)):(e=Object.keys(e).join(","),Error(z(268,e)));return e=yf(t),e=e===null?null:e.stateNode,e};We.flushSync=function(e){return hn(e)};We.hydrate=function(e,t,n){if(!No(t))throw Error(z(200));return Oo(null,e,t,!0,n)};We.hydrateRoot=function(e,t,n){if(!Il(e))throw Error(z(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",u=Yd;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(u=n.onRecoverableError)),t=Jd(t,null,e,1,n??null,i,!1,o,u),e[Ot]=t.current,Mr(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new To(t)};We.render=function(e,t,n){if(!No(t))throw Error(z(200));return Oo(null,e,t,!1,n)};We.unmountComponentAtNode=function(e){if(!No(e))throw Error(z(40));return e._reactRootContainer?(hn(function(){Oo(null,null,e,!1,function(){e._reactRootContainer=null,e[Ot]=null})}),!0):!1};We.unstable_batchedUpdates=wl;We.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!No(n))throw Error(z(200));if(e==null||e._reactInternals===void 0)throw Error(z(38));return Oo(e,t,n,!1,r)};We.version="18.2.0-next-9e3b772b8-20220608";function Xd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xd)}catch(e){console.error(e)}}Xd(),$c.exports=We;var Zv=$c.exports,tc=Zv;zu.createRoot=tc.createRoot,zu.hydrateRoot=tc.hydrateRoot;var Zd={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Zd);var Qe=Zd.exports,su={exports:{}},nc;function ft(){return nc||(nc=1,function(e){function t(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(su)),su.exports}var lu={exports:{}},au={exports:{}},cu={exports:{}},rc;function $n(){return rc||(rc=1,function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(cu)),cu.exports}var fu={exports:{}},ic;function eg(){return ic||(ic=1,function(e){var t=$n().default;function n(r,i){if(t(r)!=="object"||r===null)return r;var o=r[Symbol.toPrimitive];if(o!==void 0){var u=o.call(r,i||"default");if(t(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(fu)),fu.exports}var oc;function ep(){return oc||(oc=1,function(e){var t=$n().default,n=eg();function r(i){var o=n(i,"string");return t(o)==="symbol"?o:String(o)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(au)),au.exports}var uc;function dt(){return uc||(uc=1,function(e){var t=ep();function n(i,o){for(var u=0;u<o.length;u++){var s=o[u];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,t(s.key),s)}}function r(i,o,u){return o&&n(i.prototype,o),u&&n(i,u),Object.defineProperty(i,"prototype",{writable:!1}),i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(lu)),lu.exports}function tg(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var du={exports:{}},sc;function ng(){return sc||(sc=1,function(e){(function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(n==null)throw new TypeError("Cannot convert first argument to object");for(var r=Object(n),i=1;i<arguments.length;i++){var o=arguments[i];if(o!=null){o=Object(o);for(var u=Object.keys(Object(o)),s=0,a=u.length;a>s;s++){var d=u[s],m=Object.getOwnPropertyDescriptor(o,d);m!==void 0&&m.enumerable&&(r[d]=o[d])}}}return r}});var t=function(n){var r={user_agent:null,persist:!0,cookie_name_client_id:"ConstructorioID_client_id",cookie_name_session_id:"ConstructorioID_session_id",cookie_name_session_data:"ConstructorioID_session",cookie_domain:null,cookie_secure:null,cookie_samesite:null,cookie_days_to_live:365,local_name_client_id:"_constructorio_search_client_id",local_name_session_id:"_constructorio_search_session_id",local_name_session_data:"_constructorio_search_session",on_node:typeof window>"u",session_is_new:null,new_to_beacon:null,client_id_storage_location:"cookie",session_id_storage_location:"local"};if(Object.assign(this,r,n),!this.client_id)if(!this.on_node&&this.persist){var i;this.client_id_storage_location==="cookie"&&(i=this.get_cookie(this.cookie_name_client_id),i&&(this.delete_cookie(this.cookie_name_client_id),this.set_cookie(this.cookie_name_client_id,i))),this.client_id_storage_location==="local"&&(i=this.get_local_object(this.local_name_client_id)),this.client_id=i||this.generate_client_id()}else this.client_id=this.generate_client_id();this.session_id||(!this.on_node&&this.persist?this.session_id=this.generate_session_id():this.session_id=1),this.on_node||(this.user_agent=this.user_agent||window&&window.navigator&&window.navigator.userAgent)};t.prototype.set_cookie=function(n,r){if(!this.on_node&&this.persist){var i=new Date(Date.now()+this.cookie_days_to_live*24*60*60*1e3),o=n+"="+r+"; expires="+i.toUTCString()+"; path=/";return this.cookie_domain&&(o+="; domain="+this.cookie_domain),this.cookie_secure&&(o+="; secure"),this.cookie_samesite&&(o+="; samesite="+this.cookie_samesite),document.cookie=o,o}return null},t.prototype.get_cookie=function(n){for(var r=n+"=",i=document.cookie.split(";"),o=0;o<i.length;o++){var u=i[o];try{for(var s=decodeURIComponent(u);s.charAt(0)===" ";)s=s.substring(1);if(s.indexOf(r)===0)return s.substring(r.length,s.length)}catch{}}},t.prototype.delete_cookie=function(n){document.cookie=n+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;"},t.prototype.generate_client_id=function(){var n;if(!this.on_node){var r=this.get_cookie(this.cookie_name_client_id),i=this.get_local_object(this.local_name_client_id);this.client_id_storage_location==="cookie"&&i&&(n=i,this.set_cookie(this.cookie_name_client_id,n),this.delete_local_object(this.local_name_client_id)),this.client_id_storage_location==="local"&&r&&(n=r,this.set_local_object(this.local_name_client_id,n),this.delete_cookie(this.cookie_name_client_id))}return n||(n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(o){var u=Math.random()*16|0,s=o==="x"?u:u&3|8;return s.toString(16)}),this.client_id_storage_location==="cookie"&&this.set_cookie(this.cookie_name_client_id,n),this.client_id_storage_location==="local"&&this.set_local_object(this.local_name_client_id,n)),n},t.prototype.get_local_object=function(n){var r,i=window&&window.localStorage;if(i&&typeof n=="string")try{r=JSON.parse(i.getItem(n))}catch{r=i.getItem(n)}return r},t.prototype.set_local_object=function(n,r){var i=window&&window.localStorage;if(i&&typeof n=="string"){if(typeof r=="object")try{i.setItem(n,JSON.stringify(r))}catch{}if(typeof r=="string"||typeof r=="number")try{i.setItem(n,r)}catch{}}},t.prototype.delete_local_object=function(n){var r=window&&window.localStorage;if(r&&typeof n=="string")try{r.removeItem(n)}catch{}},t.prototype.generate_session_id=function(){var n=this.get_cookie(this.cookie_name_session_data),r=this.get_local_object(this.local_name_session_data),i=Date.now(),o=1e3*60*30,u;if(this.session_id_storage_location==="local"&&(u=this.get_local_object(this.local_name_session_data),!u&&n&&(u=n,this.delete_cookie(this.cookie_name_session_data))),this.session_id_storage_location==="cookie"){u=this.get_cookie(this.cookie_name_session_data);try{u=JSON.parse(u)}catch{}!u&&r&&(u=r,this.delete_local_object(this.local_name_session_data))}var s=1,a=1;u&&typeof u=="object"&&(a=parseInt(u.sessionId,10)||1,u.lastTime>i-o?s=a:s=a+1),this.session_id=s,this.session_is_new=!(u&&a===s),u&&u.newToBeacon&&(this.new_to_beacon=!0);const d={sessionId:s,lastTime:i};return this.session_is_new&&(d.newToBeacon=!0),this.session_id_storage_location==="local"&&(this.set_local_object(this.local_name_session_id,s),this.set_local_object(this.local_name_session_data,d)),this.session_id_storage_location==="cookie"&&(this.cookie_domain&&(this.delete_cookie(this.cookie_name_session_id),this.delete_cookie(this.cookie_name_session_data)),this.set_cookie(this.cookie_name_session_id,s),this.set_cookie(this.cookie_name_session_data,JSON.stringify(d))),s},typeof tg<"u"&&(e.exports=t)})()}(du)),du.exports}var Ei={exports:{}},lc;function rg(){return lc||(lc=1,function(e,t){(function(n){function r(i){var o=i&&i.Promise||n.Promise,u=i&&i.XMLHttpRequest||n.XMLHttpRequest;return function(){var s=Object.create(n,{fetch:{value:void 0,writable:!0}});return function(a,d){d(t)}(this,function(a){var d=typeof s<"u"&&s||typeof self<"u"&&self||typeof d<"u"&&d,m={searchParams:"URLSearchParams"in d,iterable:"Symbol"in d&&"iterator"in Symbol,blob:"FileReader"in d&&"Blob"in d&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in d,arrayBuffer:"ArrayBuffer"in d};function y(T){return T&&DataView.prototype.isPrototypeOf(T)}if(m.arrayBuffer)var k=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],_=ArrayBuffer.isView||function(T){return T&&k.indexOf(Object.prototype.toString.call(T))>-1};function w(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(T)||T==="")throw new TypeError("Invalid character in header field name");return T.toLowerCase()}function l(T){return typeof T!="string"&&(T=String(T)),T}function p(T){var R={next:function(){var A=T.shift();return{done:A===void 0,value:A}}};return m.iterable&&(R[Symbol.iterator]=function(){return R}),R}function f(T){this.map={},T instanceof f?T.forEach(function(R,A){this.append(A,R)},this):Array.isArray(T)?T.forEach(function(R){this.append(R[0],R[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function(R){this.append(R,T[R])},this)}f.prototype.append=function(T,R){T=w(T),R=l(R);var A=this.map[T];this.map[T]=A?A+", "+R:R},f.prototype.delete=function(T){delete this.map[w(T)]},f.prototype.get=function(T){return T=w(T),this.has(T)?this.map[T]:null},f.prototype.has=function(T){return this.map.hasOwnProperty(w(T))},f.prototype.set=function(T,R){this.map[w(T)]=l(R)},f.prototype.forEach=function(T,R){for(var A in this.map)this.map.hasOwnProperty(A)&&T.call(R,this.map[A],A,this)},f.prototype.keys=function(){var T=[];return this.forEach(function(R,A){T.push(A)}),p(T)},f.prototype.values=function(){var T=[];return this.forEach(function(R){T.push(R)}),p(T)},f.prototype.entries=function(){var T=[];return this.forEach(function(R,A){T.push([A,R])}),p(T)},m.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function c(T){if(T.bodyUsed)return o.reject(new TypeError("Already read"));T.bodyUsed=!0}function h(T){return new o(function(R,A){T.onload=function(){R(T.result)},T.onerror=function(){A(T.error)}})}function E(T){var R=new FileReader,A=h(R);return R.readAsArrayBuffer(T),A}function x(T){var R=new FileReader,A=h(R);return R.readAsText(T),A}function S(T){for(var R=new Uint8Array(T),A=new Array(R.length),D=0;D<R.length;D++)A[D]=String.fromCharCode(R[D]);return A.join("")}function v(T){if(T.slice)return T.slice(0);var R=new Uint8Array(T.byteLength);return R.set(new Uint8Array(T)),R.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(T){this.bodyUsed=this.bodyUsed,this._bodyInit=T,T?typeof T=="string"?this._bodyText=T:m.blob&&Blob.prototype.isPrototypeOf(T)?this._bodyBlob=T:m.formData&&FormData.prototype.isPrototypeOf(T)?this._bodyFormData=T:m.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)?this._bodyText=T.toString():m.arrayBuffer&&m.blob&&y(T)?(this._bodyArrayBuffer=v(T.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):m.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(T)||_(T))?this._bodyArrayBuffer=v(T):this._bodyText=T=Object.prototype.toString.call(T):this._bodyText="",this.headers.get("content-type")||(typeof T=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):m.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},m.blob&&(this.blob=function(){var T=c(this);if(T)return T;if(this._bodyBlob)return o.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return o.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return o.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var T=c(this);return T||(ArrayBuffer.isView(this._bodyArrayBuffer)?o.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):o.resolve(this._bodyArrayBuffer))}else return this.blob().then(E)}),this.text=function(){var T=c(this);if(T)return T;if(this._bodyBlob)return x(this._bodyBlob);if(this._bodyArrayBuffer)return o.resolve(S(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return o.resolve(this._bodyText)},m.formData&&(this.formData=function(){return this.text().then(N)}),this.json=function(){return this.text().then(JSON.parse)},this}var I=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function C(T){var R=T.toUpperCase();return I.indexOf(R)>-1?R:T}function O(T,R){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R=R||{};var A=R.body;if(T instanceof O){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,R.headers||(this.headers=new f(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!A&&T._bodyInit!=null&&(A=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new f(R.headers)),this.method=C(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&A)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(A),(this.method==="GET"||this.method==="HEAD")&&(R.cache==="no-store"||R.cache==="no-cache")){var D=/([?&])_=[^&]*/;if(D.test(this.url))this.url=this.url.replace(D,"$1_="+new Date().getTime());else{var M=/\?/;this.url+=(M.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}O.prototype.clone=function(){return new O(this,{body:this._bodyInit})};function N(T){var R=new FormData;return T.trim().split("&").forEach(function(A){if(A){var D=A.split("="),M=D.shift().replace(/\+/g," "),L=D.join("=").replace(/\+/g," ");R.append(decodeURIComponent(M),decodeURIComponent(L))}}),R}function P(T){var R=new f,A=T.replace(/\r?\n[\t ]+/g," ");return A.split("\r").map(function(D){return D.indexOf(`
|
|
34
34
|
`)===0?D.substr(1,D.length):D}).forEach(function(D){var M=D.split(":"),L=M.shift().trim();if(L){var Q=M.join(":").trim();R.append(L,Q)}}),R}g.call(O.prototype);function q(T,R){if(!(this instanceof q))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in R?R.statusText:"",this.headers=new f(R.headers),this.url=R.url||"",this._initBody(T)}g.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},q.error=function(){var T=new q(null,{status:0,statusText:""});return T.type="error",T};var F=[301,302,303,307,308];q.redirect=function(T,R){if(F.indexOf(R)===-1)throw new RangeError("Invalid status code");return new q(null,{status:R,headers:{location:T}})},a.DOMException=d.DOMException;try{new a.DOMException}catch{a.DOMException=function(R,A){this.message=R,this.name=A;var D=Error(R);this.stack=D.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function j(T,R){return new o(function(A,D){var M=new O(T,R);if(M.signal&&M.signal.aborted)return D(new a.DOMException("Aborted","AbortError"));var L=new u;function Q(){L.abort()}L.onload=function(){var V={status:L.status,statusText:L.statusText,headers:P(L.getAllResponseHeaders()||"")};V.url="responseURL"in L?L.responseURL:V.headers.get("X-Request-URL");var J="response"in L?L.response:L.responseText;setTimeout(function(){A(new q(J,V))},0)},L.onerror=function(){setTimeout(function(){D(new TypeError("Network request failed"))},0)},L.ontimeout=function(){setTimeout(function(){D(new TypeError("Network request failed"))},0)},L.onabort=function(){setTimeout(function(){D(new a.DOMException("Aborted","AbortError"))},0)};function Y(V){try{return V===""&&d.location.href?d.location.href:V}catch{return V}}L.open(M.method,Y(M.url),!0),M.credentials==="include"?L.withCredentials=!0:M.credentials==="omit"&&(L.withCredentials=!1),"responseType"in L&&(m.blob?L.responseType="blob":m.arrayBuffer&&M.headers.get("Content-Type")&&M.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(L.responseType="arraybuffer")),R&&typeof R.headers=="object"&&!(R.headers instanceof f)?Object.getOwnPropertyNames(R.headers).forEach(function(V){L.setRequestHeader(V,l(R.headers[V]))}):M.headers.forEach(function(V,J){L.setRequestHeader(J,V)}),M.signal&&(M.signal.addEventListener("abort",Q),L.onreadystatechange=function(){L.readyState===4&&M.signal.removeEventListener("abort",Q)}),L.send(typeof M._bodyInit>"u"?null:M._bodyInit)})}j.polyfill=!0,d.fetch||(d.fetch=j,d.Headers=f,d.Request=O,d.Response=q),a.Headers=f,a.Request=O,a.Response=q,a.fetch=j,Object.defineProperty(a,"__esModule",{value:!0})}),{fetch:s.fetch,Headers:s.Headers,Request:s.Request,Response:s.Response,DOMException:s.DOMException}}()}e.exports=r})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:vr)}(Ei,Ei.exports)),Ei.exports}var pu={};/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */var ac;function ig(){return ac||(ac=1,function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="1.2.2";function n(){for(var g=0,I=new Array(256),C=0;C!=256;++C)g=C,g=g&1?-306674912^g>>>1:g>>>1,g=g&1?-306674912^g>>>1:g>>>1,g=g&1?-306674912^g>>>1:g>>>1,g=g&1?-306674912^g>>>1:g>>>1,g=g&1?-306674912^g>>>1:g>>>1,g=g&1?-306674912^g>>>1:g>>>1,g=g&1?-306674912^g>>>1:g>>>1,g=g&1?-306674912^g>>>1:g>>>1,I[C]=g;return typeof Int32Array<"u"?new Int32Array(I):I}var r=n();function i(g){var I=0,C=0,O=0,N=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(O=0;O!=256;++O)N[O]=g[O];for(O=0;O!=256;++O)for(C=g[O],I=256+O;I<4096;I+=256)C=N[I]=C>>>8^g[C&255];var P=[];for(O=1;O!=16;++O)P[O-1]=typeof Int32Array<"u"?N.subarray(O*256,O*256+256):N.slice(O*256,O*256+256);return P}var o=i(r),u=o[0],s=o[1],a=o[2],d=o[3],m=o[4],y=o[5],k=o[6],_=o[7],w=o[8],l=o[9],p=o[10],f=o[11],c=o[12],h=o[13],E=o[14];function x(g,I){for(var C=I^-1,O=0,N=g.length;O<N;)C=C>>>8^r[(C^g.charCodeAt(O++))&255];return~C}function S(g,I){for(var C=I^-1,O=g.length-15,N=0;N<O;)C=E[g[N++]^C&255]^h[g[N++]^C>>8&255]^c[g[N++]^C>>16&255]^f[g[N++]^C>>>24]^p[g[N++]]^l[g[N++]]^w[g[N++]]^_[g[N++]]^k[g[N++]]^y[g[N++]]^m[g[N++]]^d[g[N++]]^a[g[N++]]^s[g[N++]]^u[g[N++]]^r[g[N++]];for(O+=15;N<O;)C=C>>>8^r[(C^g[N++])&255];return~C}function v(g,I){for(var C=I^-1,O=0,N=g.length,P=0,q=0;O<N;)P=g.charCodeAt(O++),P<128?C=C>>>8^r[(C^P)&255]:P<2048?(C=C>>>8^r[(C^(192|P>>6&31))&255],C=C>>>8^r[(C^(128|P&63))&255]):P>=55296&&P<57344?(P=(P&1023)+64,q=g.charCodeAt(O++)&1023,C=C>>>8^r[(C^(240|P>>8&7))&255],C=C>>>8^r[(C^(128|P>>2&63))&255],C=C>>>8^r[(C^(128|q>>6&15|(P&3)<<4))&255],C=C>>>8^r[(C^(128|q&63))&255]):(C=C>>>8^r[(C^(224|P>>12&15))&255],C=C>>>8^r[(C^(128|P>>6&63))&255],C=C>>>8^r[(C^(128|P&63))&255]);return~C}t.table=r,t.bstr=x,t.buf=S,t.str=v})}(pu)),pu}var hu,cc;function Rl(){if(cc)return hu;cc=1;var e={overflow:{},get:function(i){var o=this.overflow[i];if(o)return o;if(typeof sessionStorage>"u")return null;var u=sessionStorage.getItem(i);if(u)try{return JSON.parse(u)}catch{return u}return null},set:function(i,o){try{sessionStorage.setItem(i,JSON.stringify(o))}catch{this.overflow[i]=o}},remove:function(i){var o;(o=this.overflow)!==null&&o!==void 0&&o[i]&&delete this.overflow[i],typeof sessionStorage<"u"&&sessionStorage.removeItem(i)},key:function(i){var o,u;if(typeof sessionStorage>"u"){var s;return(s=Object.keys(this.overflow))===null||s===void 0?void 0:s[i]}var a=(o=sessionStorage)===null||o===void 0?void 0:o.key(i),d=((u=sessionStorage)===null||u===void 0?void 0:u.length)||0;if(i>=d){var m,y=i-d;return(m=Object.keys(this.overflow))===null||m===void 0?void 0:m[y]}return a},length:function(){var i=Object.keys(this.overflow).length;return typeof sessionStorage>"u"?i:sessionStorage.length+i},clear:function(){this.overflow={},typeof sessionStorage<"u"&&sessionStorage.clear()}},t={overflow:{},get:function(i){var o=this.overflow[i];if(o)return o;if(typeof localStorage>"u")return null;var u=localStorage.getItem(i);if(u)try{return JSON.parse(u)}catch{return u}return null},set:function(i,o){try{localStorage.setItem(i,JSON.stringify(o))}catch{this.overflow[i]=o}},remove:function(i){var o;(o=this.overflow)!==null&&o!==void 0&&o[i]&&delete this.overflow[i],typeof localStorage<"u"&&localStorage.removeItem(i)},key:function(i){var o,u;if(typeof localStorage>"u"){var s;return(s=Object.keys(this.overflow))===null||s===void 0?void 0:s[i]}var a=(o=localStorage)===null||o===void 0?void 0:o.key(i),d=((u=localStorage)===null||u===void 0?void 0:u.length)||0;if(i>=d){var m,y=i-d;return(m=Object.keys(this.overflow))===null||m===void 0?void 0:m[y]}return a},length:function(){var i=Object.keys(this.overflow).length;return typeof localStorage>"u"?i:localStorage.length+i},clear:function(){this.overflow={},typeof localStorage<"u"&&localStorage.clear()}},n={local:t,session:e};return hu=n,hu}var vu,fc;function rt(){if(fc)return vu;fc=1;var e=Qe,t=e($n()),n=ig(),r=Rl(),i="_constructorio_purchase_order_ids",o=[{pattern:/[\w\-+\\.]+@([\w-]+\.)+[\w-]{2,4}/,replaceWith:"<email_omitted>"},{pattern:/^(?:\+\d{11,12}|\+\d{1,3}\s\d{3}\s\d{3}\s\d{3,4}|\(\d{3}\)\d{7}|\(\d{3}\)\s\d{3}\s\d{4}|\(\d{3}\)\d{3}-\d{4}|\(\d{3}\)\s\d{3}-\d{4})$/,replaceWith:"<phone_omitted>"},{pattern:/^(?:4[0-9]{15}|(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|6(?:011|5[0-9]{2})[0-9]{12}|(?:2131|1800|35\d{3})\d{11})$/,replaceWith:"<credit_omitted>"}],u={trimNonBreakingSpaces:function(a){return a.replace(/\s/g," ").trim()},encodeURIComponentRFC3986:function(a){return encodeURIComponent(a).replace(/[!'()*]/g,function(d){return"%".concat(d.charCodeAt(0).toString(16).toUpperCase())})},cleanParams:function(a){var d={};return Object.keys(a).forEach(function(m){var y=a[m];typeof y=="string"?d[m]=u.trimNonBreakingSpaces(y):d[m]=y}),d},throwHttpErrorFromResponse:function(a,d){return d.json().then(function(m){throw a.message=m.message,a.status=d.status,a.statusText=d.statusText,a.url=d.url,a.headers=d.headers,a})},canUseDOM:function(){return!!(typeof window<"u"&&window.document&&window.document.createElement)},addEventListener:function(a,d,m){u.canUseDOM()&&window.addEventListener(a,d,m)},removeEventListener:function(a,d,m){u.canUseDOM()&&window.removeEventListener(a,d,m)},getNavigator:function(){return u.canUseDOM()?window.navigator:{userAgent:"",webdriver:!1}},isNil:function(a){return a==null},getWindowLocation:function(){return u.canUseDOM()?window.location:{}},dispatchEvent:function(a){u.canUseDOM()&&window.dispatchEvent(a)},createCustomEvent:function(a,d){if(u.canUseDOM())try{return new window.CustomEvent(a,{detail:d})}catch{var m=document.createEvent("CustomEvent");return m.initCustomEvent(a,!1,!1,d),m}return null},hasOrderIdRecord:function(a){var d=a.orderId,m=a.apiKey,y=d;m&&(y="".concat(m,"-").concat(d));var k=n.str(y.toString()),_=r.local.get(i);return typeof _=="string"&&(_=JSON.parse(_)),_&&_.includes(k)?!0:null},addOrderIdRecord:function(a){var d=a.orderId,m=a.apiKey,y=d;m&&(y="".concat(m,"-").concat(d));var k=n.str(y.toString()),_=r.local.get(i);if(typeof _=="string"&&(_=JSON.parse(_)),_){if(_.includes(k))return;_.length>=10&&(_=_.slice(-9)),_.push(k)}else _=[k];r.local.set(i,_)},applyNetworkTimeout:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,y=a&&a.networkParameters&&a.networkParameters.timeout,k=d&&d.timeout,_=k||y;typeof _=="number"&&m&&setTimeout(function(){return m.abort()},_)},stringify:function(a,d,m){if(!a)return"";var y=[];return Object.keys(a).forEach(function(k){var _=a[k],w=u.encodeURIComponentRFC3986(k),l;if(_!=null){var p=d?"".concat(d,"%5B").concat(w,"%5D"):w;Array.isArray(_)?l=u.stringify(_,p,"array"):(0,t.default)(_)==="object"?l=u.stringify(_,p,"object"):m==="object"?l="".concat(p,"=").concat(u.encodeURIComponentRFC3986(_)):l="".concat(d||w,"=").concat(u.encodeURIComponentRFC3986(_)),y.push(l)}}),y.join("&")},toSnakeCase:function(a){return a.replace(/[A-Z]/g,function(d){return"_".concat(d.toLowerCase())})},toSnakeCaseKeys:function(a){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m={};return Object.keys(a).forEach(function(y){var k=u.toSnakeCase(y);m[k]=d&&(0,t.default)(a[y])==="object"&&!Array.isArray(a[y])?u.toSnakeCaseKeys(a[y],d):a[y]}),m},containsPii:function(a,d){var m=a.toLowerCase();return d.test(m)},obfuscatePiiRequest:function(a){var d=a;try{var m,y,k,_=new URL(a),w=_==null||(m=_.pathname)===null||m===void 0?void 0:m.split("/"),l=_==null||(y=_.search)===null||y===void 0||(k=y.split("&"))===null||k===void 0?void 0:k.map(function(p){var f;return(f=p.split("="))===null||f===void 0?void 0:f[1]});o.forEach(function(p){var f=p.pattern,c=p.replaceWith;w.forEach(function(h){var E=decodeURIComponent(h);u.containsPii(E,f)&&(d=d.replaceAll(h,c))}),l.forEach(function(h){var E=decodeURIComponent(h);u.containsPii(E,f)&&(d=d.replaceAll(E,c))})})}catch{}return d},convertResponseToJson:function(a){return a.ok?a.json().catch(function(){return a.text().then(function(d){throw new Error("Server responded with an invalid JSON object. Response code: ".concat(a.code,", Response: ").concat(d))})}):u.throwHttpErrorFromResponse(new Error,a)},addHTTPSToString:function(a){if(typeof a!="string")return null;var d=a.startsWith("https://"),m=a.startsWith("http://");if(!d&&m)return a.replace("http","https");if(!m&&!d){var y="https://".concat(a);return y}return a}};return vu=u,vu}var gu,dc;function Jn(){if(dc)return gu;dc=1;var e=Qe,t=e(ft()),n=e(dt()),r=rt(),i=function(){function o(u){var s=this;(0,t.default)(this,o),this.events=[],this.enabled=!(u&&u.enabled===!1),this.waitForBeacon=!(u&&u.waitForBeacon===!1),this.active=this.enabled,this.waitForBeacon&&(this.active=!1,r.canUseDOM()&&(window.ConstructorioAutocomplete||window.ConstructorioBeacon||window.ConstructorioTracker)&&this.enabled&&(this.active=!0,this.dispatchEvents()),r.addEventListener("cio.beacon.loaded",function(){s.enabled&&(s.active=!0,s.dispatchEvents())}))}return(0,n.default)(o,[{key:"queue",value:function(s,a){this.events.push({name:s,data:a}),this.active&&this.dispatchEvents()}},{key:"dispatchEvents",value:function(){for(;this.events.length;){var s=this.events.shift(),a=s.name,d=s.data,m="cio.client.".concat(a);r.dispatchEvent(r.createCustomEvent(m,d))}}}]),o}();return gu=i,gu}var mu,pc;function og(){if(pc)return mu;pc=1;var e=Qe,t=e(ft()),n=e(dt()),r=Jn(),i=rt();function o(s,a,d){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,y=d.apiKey,k=d.version,_=d.serviceUrl,w=d.sessionId,l=d.clientId,p=d.userId,f=d.segments,c=d.testCells,h={c:k};if(h.key=y,h.i=l,h.s=w,!s||typeof s!="string")throw new Error("query is a required parameter of type string");if(c&&Object.keys(c).forEach(function(A){h["ef-".concat(A)]=c[A]}),f&&f.length&&(h.us=f),p&&(h.ui=String(p)),a){var E=a.offset,x=a.page,S=a.resultsPerPage,v=a.filters,g=a.sortBy,I=a.sortOrder,C=a.section,O=a.fmtOptions,N=a.hiddenFields,P=a.hiddenFacets,q=a.variationsMap,F=a.qsParam,j=a.preFilterExpression;i.isNil(E)||(h.offset=E),i.isNil(x)||(h.page=x),i.isNil(S)||(h.num_results_per_page=S),v&&(h.filters=v),g&&(h.sort_by=g),I&&(h.sort_order=I),C&&(h.section=C),O&&(h.fmt_options=O),N&&(h.fmt_options?h.fmt_options.hidden_fields=N:h.fmt_options={hidden_fields:N}),P&&(h.fmt_options?h.fmt_options.hidden_facets=P:h.fmt_options={hidden_facets:P}),q&&(h.variations_map=JSON.stringify(q)),j&&(h.pre_filter_expression=JSON.stringify(j)),F&&(h.qs=JSON.stringify(F))}h._dt=Date.now(),h=i.cleanParams(h);var T=i.stringify(h),R=m?"search/natural_language":"search";return"".concat(_,"/").concat(R,"/").concat(i.encodeURIComponentRFC3986(i.trimNonBreakingSpaces(s)),"?").concat(T)}var u=function(){function s(a){(0,t.default)(this,s),this.options=a||{},this.eventDispatcher=new r(a.eventDispatcher)}return(0,n.default)(s,[{key:"getSearchResults",value:function(d,m){var y=this,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},_,w=this.options.fetch,l;if(typeof AbortController=="function"){var p=new AbortController;l=p&&p.signal,i.applyNetworkTimeout(this.options,k,p)}try{_=o(d,m,this.options)}catch(f){return Promise.reject(f)}return w(_,{signal:l}).then(i.convertResponseToJson).then(function(f){if(f.response&&f.response.results)return f.result_id&&f.response.results.forEach(function(c){c.result_id=f.result_id}),y.eventDispatcher.queue("search.getSearchResults.completed",f),f;if(f.response&&f.response.redirect)return y.eventDispatcher.queue("search.getSearchResults.completed",f),f;throw new Error("getSearchResults response data is malformed")})}},{key:"getVoiceSearchResults",value:function(d,m){var y=this,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},_,w=this.options.fetch,l;if(typeof AbortController=="function"){var p=new AbortController;l=p&&p.signal,i.applyNetworkTimeout(this.options,k,p)}try{var f=!0;_=o(d,m,this.options,f)}catch(c){return Promise.reject(c)}return w(_,{signal:l}).then(i.convertResponseToJson).then(function(c){if(c.response&&c.response.results)return c.result_id&&c.response.results.forEach(function(h){h.result_id=c.result_id}),y.eventDispatcher.queue("search.getVoiceSearchResults.completed",c),c;if(c.response&&c.response.redirect)return y.eventDispatcher.queue("search.getVoiceSearchResults.completed",c),c;throw new Error("getVoiceSearchResults response data is malformed")})}}]),s}();return mu=u,mu}var yu={exports:{}},hc;function Tl(){return hc||(hc=1,function(e){var t=ep();function n(r,i,o){return i=t(i),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o,r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(yu)),yu.exports}var wu,vc;function ug(){if(vc)return wu;vc=1;var e=Qe,t=e(ft()),n=e(dt()),r=e(Tl());function i(w,l){var p=Object.keys(w);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(w);l&&(f=f.filter(function(c){return Object.getOwnPropertyDescriptor(w,c).enumerable})),p.push.apply(p,f)}return p}function o(w){for(var l=1;l<arguments.length;l++){var p=arguments[l]!=null?arguments[l]:{};l%2?i(Object(p),!0).forEach(function(f){(0,r.default)(w,f,p[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(p)):i(Object(p)).forEach(function(f){Object.defineProperty(w,f,Object.getOwnPropertyDescriptor(p,f))})}return w}var u=Jn(),s=rt();function a(w,l){var p=l.apiKey,f=l.version,c=l.sessionId,h=l.clientId,E=l.userId,x=l.segments,S=l.testCells,v={c:f};if(v.key=p,v.i=h,v.s=c,S&&Object.keys(S).forEach(function(M){v["ef-".concat(M)]=S[M]}),x&&x.length&&(v.us=x),E&&(v.ui=String(E)),w){var g=w.page,I=w.offset,C=w.resultsPerPage,O=w.filters,N=w.sortBy,P=w.sortOrder,q=w.section,F=w.fmtOptions,j=w.hiddenFields,T=w.hiddenFacets,R=w.variationsMap,A=w.qsParam,D=w.preFilterExpression;s.isNil(g)||(v.page=g),s.isNil(I)||(v.offset=I),s.isNil(C)||(v.num_results_per_page=C),O&&(v.filters=O),N&&(v.sort_by=N),P&&(v.sort_order=P),q&&(v.section=q),F&&(v.fmt_options=F),j&&(v.fmt_options?v.fmt_options.hidden_fields=j:v.fmt_options={hidden_fields:j}),T&&(v.fmt_options?v.fmt_options.hidden_facets=T:v.fmt_options={hidden_facets:T}),R&&(v.variations_map=JSON.stringify(R)),D&&(v.pre_filter_expression=JSON.stringify(D)),A&&(v.qs=JSON.stringify(A))}return v._dt=Date.now(),v=s.cleanParams(v),v}function d(w,l,p,f){var c=f.serviceUrl;if(!w||typeof w!="string")throw new Error("filterName is a required parameter of type string");if(!l||typeof l!="string")throw new Error("filterValue is a required parameter of type string");var h=a(p,f),E=s.stringify(h);return"".concat(c,"/browse/").concat(s.encodeURIComponentRFC3986(s.trimNonBreakingSpaces(w)),"/").concat(s.encodeURIComponentRFC3986(s.trimNonBreakingSpaces(l)),"?").concat(E)}function m(w,l,p){var f=p.serviceUrl;if(!w||!Array.isArray(w)||!w.length)throw new Error("ids is a required parameter of type array");var c=o(o({},a(l,p)),{},{ids:w}),h=s.stringify(c);return"".concat(f,"/browse/items?").concat(h)}function y(w,l){var p=l.serviceUrl,f=o({},a(w,l));delete f._dt;var c=s.stringify(f);return"".concat(p,"/browse/facets?").concat(c)}function k(w,l,p){var f=p.serviceUrl;if(!w||typeof w!="string")throw new Error("facetName is a required parameter of type string");var c=o({},a(l,p));c.facet_name=w,delete c._dt;var h=s.stringify(c);return"".concat(f,"/browse/facet_options?").concat(h)}var _=function(){function w(l){(0,t.default)(this,w),this.options=l||{},this.eventDispatcher=new u(l.eventDispatcher)}return(0,n.default)(w,[{key:"getBrowseResults",value:function(p,f,c){var h=this,E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},x,S=this.options.fetch,v;if(typeof AbortController=="function"){var g=new AbortController;v=g&&g.signal,s.applyNetworkTimeout(this.options,E,g)}try{x=d(p,f,c,this.options)}catch(I){return Promise.reject(I)}return S(x,{signal:v}).then(s.convertResponseToJson).then(function(I){if(I.response&&I.response.results)return I.result_id&&I.response.results.forEach(function(C){C.result_id=I.result_id}),h.eventDispatcher.queue("browse.getBrowseResults.completed",I),I;throw new Error("getBrowseResults response data is malformed")})}},{key:"getBrowseResultsForItemIds",value:function(p,f){var c=this,h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E,x=this.options.fetch,S;if(typeof AbortController=="function"){var v=new AbortController;S=v&&v.signal,s.applyNetworkTimeout(this.options,h,v)}try{E=m(p,f,this.options)}catch(g){return Promise.reject(g)}return x(E,{signal:S}).then(s.convertResponseToJson).then(function(g){if(g.response&&g.response.results)return g.result_id&&g.response.results.forEach(function(I){I.result_id=g.result_id}),c.eventDispatcher.queue("browse.getBrowseResultsForItemIds.completed",g),g;throw new Error("getBrowseResultsForItemIds response data is malformed")})}},{key:"getBrowseGroups",value:function(p){var f=this,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=this.options.fetch,E=this.options.serviceUrl,x=a(p,this.options),S;if(typeof AbortController=="function"){var v=new AbortController;S=v&&v.signal,s.applyNetworkTimeout(this.options,c,v)}delete x._dt;var g=s.stringify(x),I="".concat(E,"/browse/groups?").concat(g);return h(I,{signal:S}).then(s.convertResponseToJson).then(function(C){if(C.response&&C.response.groups)return f.eventDispatcher.queue("browse.getBrowseGroups.completed",C),C;throw new Error("getBrowseGroups response data is malformed")})}},{key:"getBrowseFacets",value:function(p,f){var c=this,h,E=this.options.fetch,x;if(typeof AbortController=="function"){var S=new AbortController;x=S&&S.signal,s.applyNetworkTimeout(this.options,f,S)}try{h=y(p,this.options)}catch(v){return Promise.reject(v)}return E(h,{signal:x}).then(s.convertResponseToJson).then(function(v){if(v.response&&v.response.facets)return c.eventDispatcher.queue("browse.getBrowseFacets.completed",v),v;throw new Error("getBrowseFacets response data is malformed")})}},{key:"getBrowseFacetOptions",value:function(p){var f=this,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E,x=this.options.fetch,S;if(typeof AbortController=="function"){var v=new AbortController;S=v&&v.signal,s.applyNetworkTimeout(this.options,h,v)}try{E=k(p,c,this.options)}catch(g){return Promise.reject(g)}return x(E,{signal:S}).then(s.convertResponseToJson).then(function(g){if(g.response&&g.response.facets)return f.eventDispatcher.queue("browse.getBrowseFacetOptions.completed",g),g;throw new Error("getBrowseFacetOptions response data is malformed")})}}]),w}();return wu=_,wu}var _u,gc;function sg(){if(gc)return _u;gc=1;var e=Qe,t=e(ft()),n=e(dt()),r=Jn(),i=rt(),o=i.convertResponseToJson,u=i.cleanParams,s=i.applyNetworkTimeout,a=i.trimNonBreakingSpaces,d=i.encodeURIComponentRFC3986,m=i.stringify;function y(_,w,l){var p=l.apiKey,f=l.version,c=l.serviceUrl,h=l.sessionId,E=l.clientId,x=l.userId,S=l.segments,v=l.testCells,g={c:f};if(g.key=p,g.i=E,g.s=h,!_||typeof _!="string")throw new Error("query is a required parameter of type string");if(v&&Object.keys(v).forEach(function(R){g["ef-".concat(R)]=v[R]}),S&&S.length&&(g.us=S),x&&(g.ui=String(x)),w){var I=w.numResults,C=w.resultsPerSection,O=w.filters,N=w.filtersPerSection,P=w.hiddenFields,q=w.variationsMap,F=w.preFilterExpression;I&&(g.num_results=I),C&&Object.keys(C).forEach(function(R){g["num_results_".concat(R)]=C[R]}),O&&(g.filters=O),N&&Object.keys(N).forEach(function(R){g["filters[".concat(R,"]")]=N[R]}),F&&(g.pre_filter_expression=JSON.stringify(F)),P&&(g.fmt_options?g.fmt_options.hidden_fields=P:g.fmt_options={hidden_fields:P}),q&&(g.variations_map=JSON.stringify(q))}g._dt=Date.now(),g=u(g);var j=m(g),T=_.replace(/^\//,"|");return"".concat(c,"/autocomplete/").concat(d(a(T)),"?").concat(j)}var k=function(){function _(w){(0,t.default)(this,_),this.options=w||{},this.eventDispatcher=new r(w.eventDispatcher)}return(0,n.default)(_,[{key:"getAutocompleteResults",value:function(l,p){var f=this,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},h,E=this.options.fetch,x;if(typeof AbortController=="function"){var S=new AbortController;x=S&&S.signal,s(this.options,c,S)}try{h=y(l,p,this.options)}catch(v){return Promise.reject(v)}return E(h,{signal:x}).then(o).then(function(v){if(v.sections){if(v.result_id){var g=Object.keys(v.sections);g.forEach(function(I){var C=v.sections[I];C.length&&C.forEach(function(O){O.result_id=v.result_id})})}return f.eventDispatcher.queue("autocomplete.getAutocompleteResults.completed",v),v}throw new Error("getAutocompleteResults response data is malformed")})}}]),_}();return _u=k,_u}var Su,mc;function lg(){if(mc)return Su;mc=1;var e=Qe,t=e(ft()),n=e(dt()),r=Jn(),i=rt();function o(s,a,d){var m=d.apiKey,y=d.version,k=d.serviceUrl,_=d.sessionId,w=d.userId,l=d.clientId,p=d.segments,f={c:y};if(f.key=m,f.i=l,f.s=_,!s||typeof s!="string")throw new Error("podId is a required parameter of type string");if(p&&p.length&&(f.us=p),w&&(f.ui=String(w)),a){var c=a.numResults,h=a.itemIds,E=a.section,x=a.term,S=a.filters,v=a.variationsMap,g=a.hiddenFields,I=a.preFilterExpression;i.isNil(c)||(f.num_results=c),h&&(f.item_id=h),E&&(f.section=E),x&&(f.term=x),S&&(f.filters=S),g&&(f.fmt_options?f.fmt_options.hidden_fields=g:f.fmt_options={hidden_fields:g}),v&&(f.variations_map=JSON.stringify(v)),I&&(f.pre_filter_expression=JSON.stringify(I))}f=i.cleanParams(f);var C=i.stringify(f);return"".concat(k,"/recommendations/v1/pods/").concat(i.encodeURIComponentRFC3986(i.trimNonBreakingSpaces(s)),"?").concat(C)}var u=function(){function s(a){(0,t.default)(this,s),this.options=a||{},this.eventDispatcher=new r(a.eventDispatcher)}return(0,n.default)(s,[{key:"getRecommendations",value:function(d,m){var y=this,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},_,w=this.options.fetch,l;if(typeof AbortController=="function"){var p=new AbortController;l=p&&p.signal,i.applyNetworkTimeout(this.options,k,p)}try{_=o(d,m,this.options)}catch(f){return Promise.reject(f)}return w(_,{signal:l}).then(i.convertResponseToJson).then(function(f){if(f.response&&f.response.results)return f.result_id&&f.response.results.forEach(function(c){c.result_id=f.result_id}),y.eventDispatcher.queue("recommendations.getRecommendations.completed",f),f;throw new Error("getRecommendations response data is malformed")})}}]),s}();return Su=u,Su}var Ci={exports:{}},yc;function ag(){if(yc)return Ci.exports;yc=1;var e=Qe,t=e($n()),n=(typeof Reflect>"u"?"undefined":(0,t.default)(Reflect))==="object"?Reflect:null,r=n&&typeof n.apply=="function"?n.apply:function(v,g,I){return Function.prototype.apply.call(v,g,I)},i;n&&typeof n.ownKeys=="function"?i=n.ownKeys:Object.getOwnPropertySymbols?i=function(v){return Object.getOwnPropertyNames(v).concat(Object.getOwnPropertySymbols(v))}:i=function(v){return Object.getOwnPropertyNames(v)};function o(S){console&&console.warn&&console.warn(S)}var u=Number.isNaN||function(v){return v!==v};function s(){s.init.call(this)}Ci.exports=s,Ci.exports.once=h,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function d(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+(0,t.default)(S))}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(v){if(typeof v!="number"||v<0||u(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");a=v}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(v){if(typeof v!="number"||v<0||u(v))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+v+".");return this._maxListeners=v,this};function m(S){return S._maxListeners===void 0?s.defaultMaxListeners:S._maxListeners}s.prototype.getMaxListeners=function(){return m(this)},s.prototype.emit=function(v){for(var g=[],I=1;I<arguments.length;I++)g.push(arguments[I]);var C=v==="error",O=this._events;if(O!==void 0)C=C&&O.error===void 0;else if(!C)return!1;if(C){var N;if(g.length>0&&(N=g[0]),N instanceof Error)throw N;var P=new Error("Unhandled error."+(N?" ("+N.message+")":""));throw P.context=N,P}var q=O[v];if(q===void 0)return!1;if(typeof q=="function")r(q,this,g);else for(var F=q.length,j=p(q,F),I=0;I<F;++I)r(j[I],this,g);return!0};function y(S,v,g,I){var C,O,N;if(d(g),O=S._events,O===void 0?(O=S._events=Object.create(null),S._eventsCount=0):(O.newListener!==void 0&&(S.emit("newListener",v,g.listener?g.listener:g),O=S._events),N=O[v]),N===void 0)N=O[v]=g,++S._eventsCount;else if(typeof N=="function"?N=O[v]=I?[g,N]:[N,g]:I?N.unshift(g):N.push(g),C=m(S),C>0&&N.length>C&&!N.warned){N.warned=!0;var P=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(v)+" listeners added. Use emitter.setMaxListeners() to increase limit");P.name="MaxListenersExceededWarning",P.emitter=S,P.type=v,P.count=N.length,o(P)}return S}s.prototype.addListener=function(v,g){return y(this,v,g,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(v,g){return y(this,v,g,!0)};function k(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(S,v,g){var I={fired:!1,wrapFn:void 0,target:S,type:v,listener:g},C=k.bind(I);return C.listener=g,I.wrapFn=C,C}s.prototype.once=function(v,g){return d(g),this.on(v,_(this,v,g)),this},s.prototype.prependOnceListener=function(v,g){return d(g),this.prependListener(v,_(this,v,g)),this},s.prototype.removeListener=function(v,g){var I,C,O,N,P;if(d(g),C=this._events,C===void 0)return this;if(I=C[v],I===void 0)return this;if(I===g||I.listener===g)--this._eventsCount===0?this._events=Object.create(null):(delete C[v],C.removeListener&&this.emit("removeListener",v,I.listener||g));else if(typeof I!="function"){for(O=-1,N=I.length-1;N>=0;N--)if(I[N]===g||I[N].listener===g){P=I[N].listener,O=N;break}if(O<0)return this;O===0?I.shift():f(I,O),I.length===1&&(C[v]=I[0]),C.removeListener!==void 0&&this.emit("removeListener",v,P||g)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(v){var g,I,C;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[v]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[v]),this;if(arguments.length===0){var O=Object.keys(I),N;for(C=0;C<O.length;++C)N=O[C],N!=="removeListener"&&this.removeAllListeners(N);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(g=I[v],typeof g=="function")this.removeListener(v,g);else if(g!==void 0)for(C=g.length-1;C>=0;C--)this.removeListener(v,g[C]);return this};function w(S,v,g){var I=S._events;if(I===void 0)return[];var C=I[v];return C===void 0?[]:typeof C=="function"?g?[C.listener||C]:[C]:g?c(C):p(C,C.length)}s.prototype.listeners=function(v){return w(this,v,!0)},s.prototype.rawListeners=function(v){return w(this,v,!1)},s.listenerCount=function(S,v){return typeof S.listenerCount=="function"?S.listenerCount(v):l.call(S,v)},s.prototype.listenerCount=l;function l(S){var v=this._events;if(v!==void 0){var g=v[S];if(typeof g=="function")return 1;if(g!==void 0)return g.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function p(S,v){for(var g=new Array(v),I=0;I<v;++I)g[I]=S[I];return g}function f(S,v){for(;v+1<S.length;v++)S[v]=S[v+1];S.pop()}function c(S){for(var v=new Array(S.length),g=0;g<v.length;++g)v[g]=S[g].listener||S[g];return v}function h(S,v){return new Promise(function(g,I){function C(N){S.removeListener(v,O),I(N)}function O(){typeof S.removeListener=="function"&&S.removeListener("error",C),g([].slice.call(arguments))}x(S,v,O,{once:!0}),v!=="error"&&E(S,C,{once:!0})})}function E(S,v,g){typeof S.on=="function"&&x(S,"error",v,g)}function x(S,v,g,I){if(typeof S.on=="function")I.once?S.once(v,g):S.on(v,g);else if(typeof S.addEventListener=="function")S.addEventListener(v,function C(O){I.once&&S.removeEventListener(v,C),g(O)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+(0,t.default)(S))}return Ci.exports}var ku,wc;function cg(){return wc||(wc=1,ku=["Googlebot/","Googlebot-Mobile","Googlebot-Image","Googlebot-News","Googlebot-Video","AdsBot-Google([^-]|$)","AdsBot-Google-Mobile","Feedfetcher-Google","Mediapartners-Google","Mediapartners \\(Googlebot\\)","APIs-Google","bingbot","Slurp","[wW]get","curl","LinkedInBot","Python-urllib","python-requests","libwww","httpunit","nutch","Go-http-client","phpcrawl","msnbot","jyxobot","FAST-WebCrawler","FAST Enterprise Crawler","BIGLOTRON","Teoma","convera","seekbot","Gigabot","Gigablast","exabot","ia_archiver","GingerCrawler","webmon ","HTTrack","grub\\.org","UsineNouvelleCrawler","antibot","netresearchserver","speedy","fluffy","bibnum\\.bnf","findlink","msrbot","panscient","yacybot","AISearchBot","ips-agent","tagoobot","MJ12bot","woriobot","yanga","buzzbot","mlbot","YandexBot","yandex\\.com/bots","purebot","Linguee Bot","CyberPatrol","voilabot","Baiduspider","citeseerxbot","spbot","twengabot","postrank","turnitinbot","scribdbot","page2rss","sitebot","linkdex","Adidxbot","blekkobot","ezooms","dotbot","Mail\\.RU_Bot","discobot","heritrix","findthatfile","europarchive\\.org","NerdByNature\\.Bot","sistrix crawler","Ahrefs(Bot|SiteAudit)","fuelbot","CrunchBot","centurybot9","IndeedBot","mappydata","woobot","ZoominfoBot","PrivacyAwareBot","Multiviewbot","SWIMGBot","Grobbot","eright","Apercite","semanticbot","Aboundex","domaincrawler","wbsearchbot","summify","CCBot","edisterbot","seznambot","ec2linkfinder","gslfbot","aiHitBot","intelium_bot","facebookexternalhit","Yeti","RetrevoPageAnalyzer","lb-spider","Sogou","lssbot","careerbot","wotbox","wocbot","ichiro","DuckDuckBot","lssrocketcrawler","drupact","webcompanycrawler","acoonbot","openindexspider","gnam gnam spider","web-archive-net\\.com\\.bot","backlinkcrawler","coccoc","integromedb","content crawler spider","toplistbot","it2media-domain-crawler","ip-web-crawler\\.com","siteexplorer\\.info","elisabot","proximic","changedetection","arabot","WeSEE:Search","niki-bot","CrystalSemanticsBot","rogerbot","360Spider","psbot","InterfaxScanBot","CC Metadata Scaper","g00g1e\\.net","GrapeshotCrawler","urlappendbot","brainobot","fr-crawler","binlar","SimpleCrawler","Twitterbot","cXensebot","smtbot","bnf\\.fr_bot","A6-Indexer","ADmantX","Facebot","OrangeBot/","memorybot","AdvBot","MegaIndex","SemanticScholarBot","ltx71","nerdybot","xovibot","BUbiNG","Qwantify","archive\\.org_bot","Applebot","TweetmemeBot","crawler4j","findxbot","S[eE][mM]rushBot","yoozBot","lipperhey","Y!J","Domain Re-Animator Bot","AddThis","Screaming Frog SEO Spider","MetaURI","Scrapy","Livelap[bB]ot","OpenHoseBot","CapsuleChecker","collection@infegy\\.com","IstellaBot","DeuSu/","betaBot","Cliqzbot/","MojeekBot/","netEstate NE Crawler","SafeSearch microdata crawler","Gluten Free Crawler/","Sonic","Sysomos","Trove","deadlinkchecker","Slack-ImgProxy","Embedly","RankActiveLinkBot","iskanie","SafeDNSBot","SkypeUriPreview","Veoozbot","Slackbot","redditbot","datagnionbot","Google-Adwords-Instant","adbeat_bot","WhatsApp","contxbot","pinterest","electricmonk","GarlikCrawler","BingPreview/","vebidoobot","FemtosearchBot","Yahoo Link Preview","MetaJobBot","DomainStatsBot","mindUpBot","Daum/","Jugendschutzprogramm-Crawler","Xenu Link Sleuth","Pcore-HTTP","moatbot","KosmioBot","pingdom","PhantomJS","Gowikibot","PiplBot","Discordbot","TelegramBot","Jetslide","newsharecounts","James BOT","Barkrowler","TinEye","SocialRankIOBot","trendictionbot","Ocarinabot","epicbot","Primalbot","DuckDuckGo-Favicons-Bot","GnowitNewsbot","Leikibot","LinkArchiver","YaK/","PaperLiBot","Digg Deeper","dcrawl","Snacktory","AndersPinkBot","Fyrebot","EveryoneSocialBot","Mediatoolkitbot","Luminator-robots","ExtLinksBot","SurveyBot","NING/","okhttp","Nuzzel","omgili","PocketParser","YisouSpider","um-LN","ToutiaoSpider","MuckRack","Jamie's Spider","AHC/","NetcraftSurveyAgent","Laserlikebot","Apache-HttpClient","AppEngine-Google","Jetty","Upflow","Thinklab","Traackr\\.com","Twurly","Mastodon","http_get","DnyzBot","botify","007ac9 Crawler","BehloolBot","BrandVerity","check_http","BDCbot","ZumBot","EZID","ICC-Crawler","ArchiveBot","^LCC ","filterdb\\.iss\\.net/crawler","BLP_bbot","BomboraBot","Buck/","Companybook-Crawler","Genieo","magpie-crawler","MeltwaterNews","Moreover","newspaper/","ScoutJet","(^| )sentry/","StorygizeBot","UptimeRobot","OutclicksBot","seoscanners","Hatena","Google Web Preview","MauiBot","AlphaBot","SBL-BOT","IAS crawler","adscanner","Netvibes","acapbot","Baidu-YunGuanCe","bitlybot","blogmuraBot","Bot\\.AraTurka\\.com","bot-pge\\.chlooe\\.com","BoxcarBot","BTWebClient","ContextAd Bot","Digincore bot","Disqus","Feedly","Fetch/","Fever","Flamingo_SearchEngine","FlipboardProxy","g2reader-bot","imrbot","K7MLWCBot","Kemvibot","Landau-Media-Spider","linkapediabot","vkShare","Siteimprove\\.com","BLEXBot/","DareBoost","ZuperlistBot/","Miniflux/","Feedspotbot/","Diffbot/","SEOkicks","tracemyfile","Nimbostratus-Bot","Bytespider"]),ku}var Eu,_c;function fg(){if(_c)return Eu;_c=1;var e=Qe,t=e(ft()),n=e(dt()),r=Rl(),i=cg(),o=rt(),u="_constructorio_is_human",s=["scroll","resize","touchmove","mouseover","mousemove","keydown","keypress","keyup","focus"],a=function(){function d(){var m=this;(0,t.default)(this,d),this.isHumanBoolean=this.getIsHumanFromSessionStorage();var y=function k(){m.isHumanBoolean=!0,r.session.set(u,!0),s.forEach(function(_){o.removeEventListener(_,k,!0)})};this.isHumanBoolean||s.forEach(function(k){o.addEventListener(k,y,!0)})}return(0,n.default)(d,[{key:"getIsHumanFromSessionStorage",value:function(){return!!r.session.get(u)||!1}},{key:"isHuman",value:function(){return this.isHumanBoolean||!!r.session.get(u)}},{key:"isBot",value:function(){if(this.getIsHumanFromSessionStorage())return!1;var y=o.getNavigator(),k=y.userAgent,_=y.webdriver,w=new RegExp("(".concat(i.join("|"),")"));return!!k.match(w)||!!_}}]),d}();return Eu=a,Eu}var Cu,Sc;function dg(){if(Sc)return Cu;Sc=1;var e=Qe,t=e(ft()),n=e(dt()),r=Rl(),i=fg(),o=rt(),u=rt(),s=u.obfuscatePiiRequest,a="_constructorio_requests",d=18e4,m=function(){function y(k,_){var w=this;(0,t.default)(this,y),this.options=k,this.eventemitter=_,this.humanity=new i,this.requestPending=!1,this.pageUnloading=!1,this.sendTrackingEvents=!!(k&&k.sendTrackingEvents===!0),o.addEventListener("beforeunload",function(){w.pageUnloading=!0}),this.sendTrackingEvents&&this.send()}return(0,n.default)(y,[{key:"queue",value:function(_){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GET",l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(this.sendTrackingEvents&&!this.humanity.isBot()){var f=y.get(),c=s(_);f.push({url:c,method:w,body:l,networkParameters:p}),y.set(f)}}},{key:"sendEvents",value:function(){var _=this,w=this.options.fetch,l=y.get();if((!o.canUseDOM()||this.humanity.isHuman())&&!this.requestPending&&!this.pageUnloading&&l.length){var p,f=l.shift(),c=f,h=c.networkParameters,E,x=this;if(y.set(l),h&&typeof AbortController=="function"){var S=new AbortController;E=S.signal,o.applyNetworkTimeout(this.options,h,S)}if(typeof f=="string"&&(f={url:f,method:"GET"}),f.url){var v=f.url.match(/\?.*_dt=([^&]+)/),g=parseInt(v&&v[1],10),I=+new Date;if(g&&Number.isInteger(g)&&I-g>d){this.sendTrackingEvents=!1,y.remove();return}}f.method==="GET"&&(p=w(f.url,{signal:E})),f.method==="POST"&&(p=w(f.url,{method:f.method,body:JSON.stringify(f.body),mode:"cors",headers:{"Content-Type":"text/plain"},signal:E})),p&&(this.requestPending=!0,p.then(function(C){C.ok?(x.eventemitter&&x.eventemitter.emit("success",{url:f.url,method:f.method,message:"ok"}),_.requestPending=!1,_.send()):C.json().then(function(O){x.eventemitter&&x.eventemitter.emit("error",{url:f.url,method:f.method,message:O&&O.message}),_.requestPending=!1,_.send()}).catch(function(O){x.eventemitter&&x.eventemitter.emit("error",{url:f.url,method:f.method,message:O.type}),_.requestPending=!1,_.send()})}).catch(function(C){x.eventemitter&&x.eventemitter.emit("error",{url:f.url,method:f.method,message:C&&C.toString&&C.toString()}),_.requestPending=!1,_.send()}))}}},{key:"send",value:function(){this.sendTrackingEvents&&(this.options&&this.options.trackingSendDelay===0?this.sendEvents():setTimeout(this.sendEvents.bind(this),this.options&&this.options.trackingSendDelay||250))}}],[{key:"get",value:function(){return r.local.get(a)||[]}},{key:"set",value:function(_){!_||Array.isArray(_)&&_.length===0?y.remove():r.local.set(a,_);var w=y.get();Array.isArray(w)&&w.length!==_.length&&(this.sendTrackingEvents=!1,y.remove())}},{key:"remove",value:function(){r.local.remove(a)}}]),y}();return Cu=m,Cu}var xu,kc;function pg(){if(kc)return xu;kc=1;var e=Qe,t=e($n()),n=e(Tl()),r=e(ft()),i=e(dt());function o(_,w){var l=Object.keys(_);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(_);w&&(p=p.filter(function(f){return Object.getOwnPropertyDescriptor(_,f).enumerable})),l.push.apply(l,p)}return l}function u(_){for(var w=1;w<arguments.length;w++){var l=arguments[w]!=null?arguments[w]:{};w%2?o(Object(l),!0).forEach(function(p){(0,n.default)(_,p,l[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(l)):o(Object(l)).forEach(function(p){Object.defineProperty(_,p,Object.getOwnPropertyDescriptor(l,p))})}return _}var s=ag(),a=rt(),d=dg();function m(_,w){var l=w.apiKey,p=w.version,f=w.sessionId,c=w.clientId,h=w.userId,E=w.segments,x=w.testCells,S=w.requestMethod,v=w.beaconMode,g=a.getWindowLocation(),I=g.host,C=g.pathname,O=w.sendReferrerWithTrackingEvents!==!1,N=Object.assign(_);return p&&(N.c=p),c&&(N.i=c),f&&(N.s=f),h&&(N.ui=String(h)),E&&E.length&&(N.us=E),l&&(N.key=l),x&&Object.keys(x).forEach(function(P){N["ef-".concat(P)]=x[P]}),v&&S&&S.match(/POST/i)&&(N.beacon=!0),O&&I&&(N.origin_referrer=I,C&&(N.origin_referrer+=C)),N._dt=Date.now(),N=a.cleanParams(N),N}function y(_,w){return a.stringify(m(_,w))}var k=function(){function _(w){(0,r.default)(this,_),this.options=w||{},this.eventemitter=new s,this.requests=new d(w,this.eventemitter)}return(0,i.default)(_,[{key:"trackSessionStartV2",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p="".concat(this.options.serviceUrl,"/v2/behavioral_action/session_start?");return this.requests.queue("".concat(p).concat(y({},this.options)),"POST",void 0,l),this.requests.send(),!0}},{key:"trackSessionStart",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p="".concat(this.options.serviceUrl,"/behavior?"),f={action:"session_start"};return this.requests.queue("".concat(p).concat(y(f,this.options)),void 0,void 0,l),this.requests.send(),!0}},{key:"trackInputFocusV2",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c="".concat(this.options.serviceUrl,"/v2/behavioral_action/focus?"),h={},E=p.analyticsTags,x=E===void 0?null:E;x&&(h.analytics_tags=x),h.user_input=l;var S="POST",v=m(h,u(u({},this.options),{},{requestMethod:S}));return this.requests.queue("".concat(c).concat(y({},this.options)),S,v,f),this.requests.send(),!0}},{key:"trackInputFocus",value:function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p="".concat(this.options.serviceUrl,"/behavior?"),f={action:"focus"};return this.requests.queue("".concat(p).concat(y(f,this.options)),void 0,void 0,l),this.requests.send(),!0}},{key:"trackItemDetailLoad",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/item_detail_load?"),c={},h={},E=l.item_name,x=l.name,S=l.item_id,v=l.customer_id,g=l.customerId,I=g===void 0?v:g,C=l.variation_id,O=l.itemName,N=O===void 0?E||x:O,P=l.itemId,q=P===void 0?S||I:P,F=l.variationId,j=F===void 0?C:F,T=l.url,R=l.analyticsTags;N&&(h.item_name=N),q&&(h.item_id=q),j&&(h.variation_id=j),R&&(h.analytics_tags=R),T&&(h.url=T);var A="".concat(f).concat(y(c,this.options)),D="POST",M=m(h,u(u({},this.options),{},{requestMethod:D}));return this.requests.queue(A,D,M,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackAutocompleteSelectV2",value:function(l,p){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(l&&typeof l=="string"){if(p&&(0,t.default)(p)==="object"&&!Array.isArray(p)){var c="".concat(this.options.serviceUrl,"/v2/behavioral_action/autocomplete_select?"),h=p.original_query,E=p.originalQuery,x=E===void 0?h:E,S=p.user_input,v=p.userInput,g=v===void 0?x||S:v,I=p.original_section,C=p.section,O=C===void 0?I:C,N=p.tr,P=p.group_id,q=p.groupId,F=q===void 0?P:q,j=p.item_id,T=p.itemId,R=T===void 0?j:T,A=p.variation_id,D=p.variationId,M=D===void 0?A:D,L={},Q={user_input:g,tr:N,group_id:F,item_id:R,variation_id:M,item_name:l,section:O};O&&(L.section=O);var Y="".concat(c).concat(y(L,this.options)),V="POST",J=m(Q,u(u({},this.options),{},{requestMethod:V}));return this.requests.queue(Y,V,J,f),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackAutocompleteSelect",value:function(l,p){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(l&&typeof l=="string"){if(p&&(0,t.default)(p)==="object"&&!Array.isArray(p)){var c="".concat(this.options.serviceUrl,"/autocomplete/").concat(a.encodeURIComponentRFC3986(a.trimNonBreakingSpaces(l)),"/select?"),h={},E=p.original_query,x=p.originalQuery,S=x===void 0?E:x,v=p.section,g=p.original_section,I=p.originalSection,C=I===void 0?g:I,O=p.tr,N=p.group_id,P=p.groupId,q=P===void 0?N:P,F=p.display_name,j=p.displayName,T=j===void 0?F:j;return S&&(h.original_query=S),O&&(h.tr=O),(C||v)&&(h.section=C||v),q&&(h.group={group_id:q,display_name:T}),this.requests.queue("".concat(c).concat(y(h,this.options)),void 0,void 0,f),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackSearchSubmitV2",value:function(l,p){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(l&&typeof l=="string"){if(p&&(0,t.default)(p)==="object"&&!Array.isArray(p)){var c="".concat(this.options.serviceUrl,"/v2/behavioral_action/search_submit?"),h=p.original_query,E=p.originalQuery,x=E===void 0?h:E,S=p.user_input,v=p.userInput,g=v===void 0?x||S:v,I=p.group_id,C=p.groupId,O=C===void 0?I:C,N=p.section,P={},q={user_input:g,search_term:l,section:N};O&&(q.filters={group_id:O}),N&&(P.section=N);var F="".concat(c).concat(y(P,this.options)),j="POST",T=m(q,u(u({},this.options),{},{requestMethod:j}));return this.requests.queue(F,j,T,f),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackSearchSubmit",value:function(l,p){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(l&&typeof l=="string"){if(p&&(0,t.default)(p)==="object"&&!Array.isArray(p)){var c="".concat(this.options.serviceUrl,"/autocomplete/").concat(a.encodeURIComponentRFC3986(a.trimNonBreakingSpaces(l)),"/search?"),h={},E=p.original_query,x=p.originalQuery,S=x===void 0?E:x,v=p.group_id,g=p.groupId,I=g===void 0?v:g,C=p.display_name,O=p.displayName,N=O===void 0?C:O;return S&&(h.original_query=S),I&&(h.group={group_id:I,display_name:N}),this.requests.queue("".concat(c).concat(y(h,this.options)),void 0,void 0,f),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackSearchResultsLoadedV2",value:function(l,p){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(l&&typeof l=="string"){if(p&&(0,t.default)(p)==="object"&&!Array.isArray(p)){var c="".concat(this.options.serviceUrl,"/v2/behavioral_action/search_result_load?"),h=p.num_results,E=p.numResults,x=E===void 0?h:E,S=p.result_count,v=p.resultCount,g=v===void 0?x||S:v,I=p.customer_ids,C=p.item_ids,O=p.items,N=O===void 0?I||C:O,P=p.result_page,q=p.resultPage,F=q===void 0?P:q,j=p.result_id,T=p.resultId,R=T===void 0?j:T,A=p.sort_order,D=p.sortOrder,M=D===void 0?A:D,L=p.sort_by,Q=p.sortBy,Y=Q===void 0?L:Q,V=p.selected_filters,J=p.selectedFilters,H=J===void 0?V:J,b=p.url,W=p.section,$={},X;N&&Array.isArray(N)&&N.length!==0&&(X=N,typeof N[0]=="string"||typeof N[0]=="number"?X=N.map(function(ne){return{item_id:String(ne)}}):X=N.map(function(ne){return a.toSnakeCaseKeys(ne,!1)})),W&&($.section=W);var re={search_term:l,result_count:g,items:X,result_page:F,result_id:R,sort_order:M,sort_by:Y,selected_filters:H,url:b,section:W},ee="".concat(c).concat(y($,this.options)),ie="POST",ve=m(re,u(u({},this.options),{},{requestMethod:ie}));return this.requests.queue(ee,ie,ve,f),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackSearchResultsLoaded",value:function(l,p){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(l&&typeof l=="string"){if(p&&(0,t.default)(p)==="object"&&!Array.isArray(p)){var c="".concat(this.options.serviceUrl,"/behavior?"),h={action:"search-results",term:l},E=p.num_results,x=p.numResults,S=x===void 0?E:x,v=p.customer_ids,g=p.customerIds,I=g===void 0?v:g,C=p.item_ids,O=p.itemIds,N=O===void 0?C:O,P;return a.isNil(S)||(h.num_results=S),N&&Array.isArray(N)?P=N:I&&Array.isArray(I)&&(P=I),P&&Array.isArray(P)&&P.length&&(h.customer_ids=P.slice(0,100).join(",")),this.requests.queue("".concat(c).concat(y(h,this.options)),void 0,void 0,f),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackSearchResultClickV2",value:function(l,p){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(l&&typeof l=="string"){if(p&&(0,t.default)(p)==="object"&&!Array.isArray(p)){var c="".concat(this.options.serviceUrl,"/v2/behavioral_action/search_result_click?"),h=p.num_results,E=p.customer_id,x=p.item_id,S=p.itemId,v=S===void 0?E||x:S,g=p.name,I=p.item_name,C=p.itemName,O=C===void 0?g||I:C,N=p.variation_id,P=p.variationId,q=P===void 0?N:P,F=p.result_id,j=p.resultId,T=j===void 0?F:j,R=p.result_count,A=p.resultCount,D=A===void 0?h||R:A,M=p.result_page,L=p.resultPage,Q=L===void 0?M:L,Y=p.result_position_on_page,V=p.resultPositionOnPage,J=V===void 0?Y:V,H=p.num_results_per_page,b=p.numResultsPerPage,W=b===void 0?H:b,$=p.selected_filters,X=p.selectedFilters,re=X===void 0?$:X,ee=p.section,ie={item_name:O,item_id:v,variation_id:q,result_id:T,result_count:D,result_page:Q,result_position_on_page:J,num_results_per_page:W,selected_filters:re,section:ee,search_term:l},ve={};ee&&(ve.section=ee);var ne="".concat(c).concat(y(ve,this.options)),we="POST",$e=m(ie,u(u({},this.options),{},{requestMethod:we}));return this.requests.queue(ne,we,$e,f),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackSearchResultClick",value:function(l,p){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(l&&typeof l=="string"){if(p&&(0,t.default)(p)==="object"&&!Array.isArray(p)){var c="".concat(this.options.serviceUrl,"/autocomplete/").concat(a.encodeURIComponentRFC3986(a.trimNonBreakingSpaces(l)),"/click_through?"),h={},E=p.item_name,x=p.name,S=p.itemName,v=S===void 0?E||x:S,g=p.item_id,I=p.itemId,C=I===void 0?g:I,O=p.customer_id,N=p.customerId,P=N===void 0?O||C:N,q=p.variation_id,F=p.variationId,j=F===void 0?q:F,T=p.result_id,R=p.resultId,A=R===void 0?T:R,D=p.item_is_convertible,M=p.itemIsConvertible,L=M===void 0?D:M,Q=p.section;return v&&(h.name=v),P&&(h.customer_id=P),j&&(h.variation_id=j),A&&(h.result_id=A),typeof L=="boolean"&&(h.item_is_convertible=L),Q&&(h.section=Q),this.requests.queue("".concat(c).concat(y(h,this.options)),void 0,void 0,f),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}return this.requests.send(),new Error("term is a required parameter of type string")}},{key:"trackConversion",value:function(l,p){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(p&&(0,t.default)(p)==="object"&&!Array.isArray(p)){var c=l||"TERM_UNKNOWN",h="".concat(this.options.serviceUrl,"/v2/behavioral_action/conversion?"),E={},x={},S=p.name,v=p.item_name,g=p.itemName,I=g===void 0?v||S:g,C=p.customer_id,O=p.customerId,N=O===void 0?C:O,P=p.item_id,q=p.itemId,F=q===void 0?P||N:q,j=p.variation_id,T=p.variationId,R=T===void 0?j:T,A=p.revenue,D=p.section,M=D===void 0?"Products":D,L=p.display_name,Q=p.displayName,Y=Q===void 0?L:Q,V=p.type,J=p.is_custom_type,H=p.isCustomType,b=H===void 0?J:H;F&&(x.item_id=F),I&&(x.item_name=I),R&&(x.variation_id=R),(A||A===0)&&(x.revenue=A.toString()),M&&(E.section=M,x.section=M),c&&(x.search_term=c),V&&(x.type=V),b&&(x.is_custom_type=b),Y&&(x.display_name=Y);var W="".concat(h).concat(y(E,this.options)),$="POST",X=m(x,u(u({},this.options),{},{requestMethod:$}));return this.requests.queue(W,$,X,f),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackPurchase",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/purchase?"),c={},h={},E=l.items,x=l.revenue,S=l.order_id,v=l.orderId,g=v===void 0?S:v,I=l.section,C=l.analyticsTags,O=this.options.apiKey;if(g){if(a.hasOrderIdRecord({orderId:g,apiKey:O}))return!1;a.addOrderIdRecord({orderId:g,apiKey:O}),h.order_id=g}E&&Array.isArray(E)&&(h.items=E.slice(0,100).map(function(F){return a.toSnakeCaseKeys(F,!1)})),(x||x===0)&&(h.revenue=x),I?c.section=I:c.section="Products",C&&(h.analytics_tags=C);var N="".concat(f).concat(y(c,this.options)),P="POST",q=m(h,u(u({},this.options),{},{requestMethod:P}));return this.requests.queue(N,P,q,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackRecommendationView",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/recommendation_result_view?"),c={},h=l.result_count,E=l.resultCount,x=E===void 0?h:E,S=l.result_page,v=l.resultPage,g=v===void 0?S:v,I=l.result_id,C=l.resultId,O=C===void 0?I:C,N=l.section,P=l.url,q=l.pod_id,F=l.podId,j=F===void 0?q:F,T=l.num_results_viewed,R=l.numResultsViewed,A=R===void 0?T:R,D=l.items,M=l.analyticsTags;a.isNil(x)||(c.result_count=x),a.isNil(g)||(c.result_page=g),O&&(c.result_id=O),N?c.section=N:c.section="Products",P&&(c.url=P),j&&(c.pod_id=j),a.isNil(A)||(c.num_results_viewed=A),D&&Array.isArray(D)&&(c.items=D.slice(0,100).map(function(V){return a.toSnakeCaseKeys(V,!1)})),M&&(c.analytics_tags=M);var L="".concat(f).concat(y({},this.options)),Q="POST",Y=m(c,u(u({},this.options),{},{requestMethod:Q}));return this.requests.queue(L,Q,Y,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackRecommendationClick",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/recommendation_result_click?"),c={},h=l.variation_id,E=l.variationId,x=E===void 0?h:E,S=l.section,v=S===void 0?"Products":S,g=l.result_id,I=l.resultId,C=I===void 0?g:I,O=l.result_count,N=l.resultCount,P=N===void 0?O:N,q=l.result_page,F=l.resultPage,j=F===void 0?q:F,T=l.result_position_on_page,R=l.resultPositionOnPage,A=R===void 0?T:R,D=l.num_results_per_page,M=l.numResultsPerPage,L=M===void 0?D:M,Q=l.pod_id,Y=l.podId,V=Y===void 0?Q:Y,J=l.strategy_id,H=l.strategyId,b=H===void 0?J:H,W=l.item_id,$=l.itemId,X=$===void 0?W:$,re=l.item_name,ee=l.itemName,ie=ee===void 0?re:ee,ve=l.analyticsTags;x&&(c.variation_id=x),v&&(c.section=v),C&&(c.result_id=C),a.isNil(P)||(c.result_count=P),a.isNil(j)||(c.result_page=j),a.isNil(A)||(c.result_position_on_page=A),a.isNil(L)||(c.num_results_per_page=L),V&&(c.pod_id=V),b&&(c.strategy_id=b),X&&(c.item_id=X),ie&&(c.item_name=ie),ve&&(c.analytics_tags=ve);var ne="".concat(f).concat(y({},this.options)),we="POST",$e=m(c,u(u({},this.options),{},{requestMethod:we}));return this.requests.queue(ne,we,$e,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackBrowseResultsLoaded",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/browse_result_load?"),c={},h=l.section,E=h===void 0?"Products":h,x=l.result_count,S=l.resultCount,v=S===void 0?x:S,g=l.result_page,I=l.resultPage,C=I===void 0?g:I,O=l.result_id,N=l.resultId,P=N===void 0?O:N,q=l.selected_filters,F=l.selectedFilters,j=F===void 0?q:F,T=l.url,R=l.sort_order,A=l.sortOrder,D=A===void 0?R:A,M=l.sort_by,L=l.sortBy,Q=L===void 0?M:L,Y=l.filter_name,V=l.filterName,J=V===void 0?Y:V,H=l.filter_value,b=l.filterValue,W=b===void 0?H:b,$=l.items,X=l.analyticsTags;E&&(c.section=E),a.isNil(v)||(c.result_count=v),a.isNil(C)||(c.result_page=C),P&&(c.result_id=P),j&&(c.selected_filters=j),T&&(c.url=T),D&&(c.sort_order=D),Q&&(c.sort_by=Q),J&&(c.filter_name=J),W&&(c.filter_value=W),$&&Array.isArray($)&&(c.items=$.slice(0,100).map(function(ve){return a.toSnakeCaseKeys(ve,!1)})),X&&(c.analytics_tags=X);var re="".concat(f).concat(y({},this.options)),ee="POST",ie=m(c,u(u({},this.options),{},{requestMethod:ee}));return this.requests.queue(re,ee,ie,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackBrowseResultClick",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/browse_result_click?"),c={},h=l.section,E=h===void 0?"Products":h,x=l.variation_id,S=l.variationId,v=S===void 0?x:S,g=l.result_id,I=l.resultId,C=I===void 0?g:I,O=l.result_count,N=l.resultCount,P=N===void 0?O:N,q=l.result_page,F=l.resultPage,j=F===void 0?q:F,T=l.result_position_on_page,R=l.resultPositionOnPage,A=R===void 0?T:R,D=l.num_results_per_page,M=l.numResultsPerPage,L=M===void 0?D:M,Q=l.selected_filters,Y=l.selectedFilters,V=Y===void 0?Q:Y,J=l.filter_name,H=l.filterName,b=H===void 0?J:H,W=l.filter_value,$=l.filterValue,X=$===void 0?W:$,re=l.customer_id,ee=l.customerId,ie=ee===void 0?re:ee,ve=l.item_id,ne=l.itemId,we=ne===void 0?ie||ve:ne,$e=l.item_name,ht=l.name,mn=l.itemName,je=mn===void 0?$e||ht:mn,yn=l.analyticsTags;E&&(c.section=E),v&&(c.variation_id=v),C&&(c.result_id=C),a.isNil(P)||(c.result_count=P),a.isNil(j)||(c.result_page=j),a.isNil(A)||(c.result_position_on_page=A),a.isNil(L)||(c.num_results_per_page=L),V&&(c.selected_filters=V),b&&(c.filter_name=b),X&&(c.filter_value=X),we&&(c.item_id=we),je&&(c.item_name=je),yn&&(c.analytics_tags=yn);var wn="".concat(f).concat(y({},this.options)),kt="POST",Zn=m(c,u(u({},this.options),{},{requestMethod:kt}));return this.requests.queue(wn,kt,Zn,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackGenericResultClick",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if((0,t.default)(l)==="object"){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/result_click?"),c={},h=l.item_id,E=l.itemId,x=E===void 0?h:E,S=l.item_name,v=l.itemName,g=v===void 0?S:v,I=l.variation_id,C=l.variationId,O=C===void 0?I:C,N=l.section,P=N===void 0?"Products":N,q=l.analyticsTags;if(x){c.section=P,c.item_id=x,g&&(c.item_name=g),O&&(c.variation_id=O),q&&(c.analytics_tags=q);var F="".concat(f).concat(y({},this.options)),j="POST",T=m(c,u(u({},this.options),{},{requestMethod:j}));return this.requests.queue(F,j,T,p),this.requests.send(),!0}}return this.requests.send(),new Error('A parameters object with an "itemId" property is required.')}},{key:"trackQuizResultsLoaded",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/quiz_result_load?"),c=l.quiz_id,h=l.quizId,E=h===void 0?c:h,x=l.quiz_version_id,S=l.quizVersionId,v=S===void 0?x:S,g=l.quiz_session_id,I=l.quizSessionId,C=I===void 0?g:I,O=l.url,N=l.section,P=N===void 0?"Products":N,q=l.result_count,F=l.resultCount,j=F===void 0?q:F,T=l.result_id,R=l.resultId,A=R===void 0?T:R,D=l.result_page,M=l.resultPage,L=M===void 0?D:M,Q=l.items,Y={},V={};if(Q&&Array.isArray(Q)&&(V.items=Q.slice(0,100).map(function(W){return a.toSnakeCaseKeys(W,!1)})),typeof E!="string")return new Error('"quizId" is a required parameter of type string');if(typeof v!="string")return new Error('"quizVersionId" is a required parameter of type string');if(typeof C!="string")return new Error('"quizSessionId" is a required parameter of type string');if(typeof O!="string")return new Error('"url" is a required parameter of type string');if(V.quiz_id=E,V.quiz_version_id=v,V.quiz_session_id=C,V.url=O,!a.isNil(P)){if(typeof P!="string")return new Error('"section" must be a string');Y.section=P,V.section=P}if(!a.isNil(j)){if(typeof j!="number")return new Error('"resultCount" must be a number');V.result_count=j}if(!a.isNil(A)){if(typeof A!="string")return new Error('"resultId" must be a string');V.result_id=A}if(!a.isNil(L)){if(typeof L!="number")return new Error('"resultPage" must be a number');V.result_page=L}var J="".concat(f).concat(y(Y,this.options)),H="POST",b=m(V,u(u({},this.options),{},{requestMethod:H}));return this.requests.queue(J,H,b,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackQuizResultClick",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/quiz_result_click?"),c=l.quiz_id,h=l.quizId,E=h===void 0?c:h,x=l.quiz_version_id,S=l.quizVersionId,v=S===void 0?x:S,g=l.quiz_session_id,I=l.quizSessionId,C=I===void 0?g:I,O=l.item_id,N=l.itemId,P=N===void 0?O:N,q=l.item_name,F=l.itemName,j=F===void 0?q:F,T=l.result_count,R=l.resultCount,A=R===void 0?T:R,D=l.result_id,M=l.resultId,L=M===void 0?D:M,Q=l.result_page,Y=l.resultPage,V=Y===void 0?Q:Y,J=l.num_results_per_page,H=l.numResultsPerPage,b=H===void 0?J:H,W=l.result_position_on_page,$=l.resultPositionOnPage,X=$===void 0?W:$,re=l.section,ee=re===void 0?"Products":re,ie=l.variationId,ve={},ne={};if(typeof E!="string")return new Error('"quizId" is a required parameter of type string');if(typeof v!="string")return new Error('"quizVersionId" is a required parameter of type string');if(typeof C!="string")return new Error('"quizSessionId" is a required parameter of type string');if(typeof P!="string"&&typeof j!="string")return new Error('"itemId" or "itemName" is a required parameter of type string');if(ne.quiz_id=E,ne.quiz_version_id=v,ne.quiz_session_id=C,!a.isNil(P)){if(typeof P!="string")return new Error('"itemId" must be a string');ne.item_id=P}if(!a.isNil(j)){if(typeof j!="string")return new Error('"itemName" must be a string');ne.item_name=j}if(!a.isNil(ie)){if(typeof ie!="string")return new Error('"variationId" must be a string');ne.variation_id=ie}if(!a.isNil(ee)){if(typeof ee!="string")return new Error('"section" must be a string');ve.section=ee}if(!a.isNil(A)){if(typeof A!="number")return new Error('"resultCount" must be a number');ne.result_count=A}if(!a.isNil(L)){if(typeof L!="string")return new Error('"resultId" must be a string');ne.result_id=L}if(!a.isNil(V)){if(typeof V!="number")return new Error('"resultPage" must be a number');ne.result_page=V}if(!a.isNil(b)){if(typeof b!="number")return new Error('"numResultsPerPage" must be a number');ne.num_results_per_page=b}if(!a.isNil(X)){if(typeof X!="number")return new Error('"resultPositionOnPage" must be a number');ne.result_position_on_page=X}var we="".concat(f).concat(y(ve,this.options)),$e="POST",ht=m(ne,u(u({},this.options),{},{requestMethod:$e}));return this.requests.queue(we,$e,ht,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackQuizConversion",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/quiz_conversion?"),c=l.quiz_id,h=l.quizId,E=h===void 0?c:h,x=l.quiz_version_id,S=l.quizVersionId,v=S===void 0?x:S,g=l.quiz_session_id,I=l.quizSessionId,C=I===void 0?g:I,O=l.item_id,N=l.itemId,P=N===void 0?O:N,q=l.item_name,F=l.itemName,j=F===void 0?q:F,T=l.variation_id,R=l.variationId,A=R===void 0?T:R,D=l.revenue,M=l.section,L=M===void 0?"Products":M,Q=l.type,Y=l.is_custom_type,V=l.isCustomType,J=V===void 0?Y:V,H=l.display_name,b=l.displayName,W=b===void 0?H:b,$={},X={};if(typeof E!="string")return new Error('"quizId" is a required parameter of type string');if(typeof v!="string")return new Error('"quizVersionId" is a required parameter of type string');if(typeof C!="string")return new Error('"quizSessionId" is a required parameter of type string');if(typeof P!="string"&&typeof j!="string")return new Error('"itemId" or "itemName" is a required parameter of type string');if(X.quiz_id=E,X.quiz_version_id=v,X.quiz_session_id=C,!a.isNil(P)){if(typeof P!="string")return new Error('"itemId" must be a string');X.item_id=P}if(!a.isNil(j)){if(typeof j!="string")return new Error('"itemName" must be a string');X.item_name=j}if(!a.isNil(A)){if(typeof A!="string")return new Error('"variationId" must be a string');X.variation_id=A}if(!a.isNil(D)){if(typeof D!="string")return new Error('"revenue" must be a string');X.revenue=D}if(!a.isNil(L)){if(typeof L!="string")return new Error('"section" must be a string');X.section=L}if(!a.isNil(Q)){if(typeof Q!="string")return new Error('"type" must be a string');X.type=Q}if(!a.isNil(J)){if(typeof J!="boolean")return new Error('"isCustomType" must be a boolean');X.is_custom_type=J}if(!a.isNil(W)){if(typeof W!="string")return new Error('"displayName" must be a string');X.display_name=W}var re="".concat(f).concat(y($,this.options)),ee="POST",ie=m(X,u(u({},this.options),{},{requestMethod:ee}));return this.requests.queue(re,ee,ie,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackAssistantSubmit",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/assistant_submit?"),c=l.section,h=l.intent,E={intent:h,section:c},x="".concat(f).concat(y({},this.options)),S="POST",v=m(E,u(u({},this.options),{},{requestMethod:S}));return this.requests.queue(x,S,v,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackAssistantResultLoadStarted",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/assistant_result_load_start?"),c=l.section,h=l.intentResultId,E=l.intent,x={intent_result_id:h,intent:E,section:c},S="".concat(f).concat(y({},this.options)),v="POST",g=m(x,u(u({},this.options),{},{requestMethod:v}));return this.requests.queue(S,v,g,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackAssistantResultLoadFinished",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/assistant_result_load_finish?"),c=l.section,h=l.searchResultCount,E=l.intentResultId,x=l.intent,S={intent_result_id:E,section:c,intent:x,search_result_count:h},v="".concat(f).concat(y({},this.options)),g="POST",I=m(S,u(u({},this.options),{},{requestMethod:g}));return this.requests.queue(v,g,I,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackAssistantResultClick",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/assistant_search_result_click?"),c=l.section,h=c===void 0?"Products":c,E=l.variationId,x=l.intentResultId,S=l.searchResultId,v=l.itemId,g=l.itemName,I=l.intent,C={section:h,variation_id:E,intent_result_id:x,search_result_id:S,item_id:v,item_name:g,intent:I},O="".concat(f).concat(y({},this.options)),N="POST",P=m(C,u(u({},this.options),{},{requestMethod:N}));return this.requests.queue(O,N,P,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackAssistantResultView",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/assistant_search_result_view?"),c=l.section,h=c===void 0?"Products":c,E=l.items,x=l.numResultsViewed,S=l.intentResultId,v=l.searchResultId,g=l.intent,I={section:h,intent_result_id:S,search_result_id:v,num_results_viewed:x,items:E&&Array.isArray(E)&&E.slice(0,100).map(function(P){return a.toSnakeCaseKeys(P,!1)}),intent:g},C="".concat(f).concat(y({},this.options)),O="POST",N=m(I,u(u({},this.options),{},{requestMethod:O}));return this.requests.queue(C,O,N,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters are required of type object")}},{key:"trackAssistantSearchSubmit",value:function(l){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(l&&(0,t.default)(l)==="object"&&!Array.isArray(l)){var f="".concat(this.options.serviceUrl,"/v2/behavioral_action/assistant_search_submit?"),c=l.section,h=l.intent,E=l.searchTerm,x=l.searchResultId,S=l.intentResultId,v={intent:h,section:c,search_term:E,search_result_id:x,intent_result_id:S},g="".concat(f).concat(y({},this.options)),I="POST",C=m(v,u(u({},this.options),{},{requestMethod:I}));return this.requests.queue(g,I,C,p),this.requests.send(),!0}return this.requests.send(),new Error("parameters is a required parameter of type object")}},{key:"on",value:function(l,p){return l!=="success"&&l!=="error"?new Error('messageType must be a string of value "success" or "error"'):!p||typeof p!="function"?new Error("callback is required and must be a function"):(this.eventemitter.on(l,p),!0)}}]),_}();return k.RequestQueue=d,xu=k,xu}var Iu={},Ec;function hg(){return Ec||(Ec=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t="2.51.0";e.default=t}(Iu)),Iu}var Ru={exports:{}},Tu={exports:{}},Nu={exports:{}},Cc;function tp(){return Cc||(Cc=1,function(e){function t(n,r){(r==null||r>n.length)&&(r=n.length);for(var i=0,o=new Array(r);i<r;i++)o[i]=n[i];return o}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Nu)),Nu.exports}var xc;function vg(){return xc||(xc=1,function(e){var t=tp();function n(r){if(Array.isArray(r))return t(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Tu)),Tu.exports}var Ou={exports:{}},Ic;function gg(){return Ic||(Ic=1,function(e){function t(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Ou)),Ou.exports}var Au={exports:{}},Rc;function mg(){return Rc||(Rc=1,function(e){var t=tp();function n(r,i){if(r){if(typeof r=="string")return t(r,i);var o=Object.prototype.toString.call(r).slice(8,-1);if(o==="Object"&&r.constructor&&(o=r.constructor.name),o==="Map"||o==="Set")return Array.from(r);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return t(r,i)}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Au)),Au.exports}var Pu={exports:{}},Tc;function yg(){return Tc||(Tc=1,function(e){function t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
35
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Pu)),Pu.exports}var Nc;function wg(){return Nc||(Nc=1,function(e){var t=vg(),n=gg(),r=mg(),i=yg();function o(u){return t(u)||n(u)||r(u)||i()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}(Ru)),Ru.exports}var Du,Oc;function _g(){if(Oc)return Du;Oc=1;var e=Qe,t=e(ft()),n=e(dt()),r=e(wg()),i=e($n()),o=Jn(),u=rt();function s(d,m,y,k){var _=y.apiKey,w=y.clientId,l=y.sessionId,p=y.segments,f=y.userId,c=y.version,h=y.quizzesServiceUrl,E={c},x="";if(E.key=_,E.i=w,E.s=l,p&&p.length&&(E.us=p),f&&(E.ui=String(f)),!d||typeof d!="string")throw new Error("quizId is a required parameter of type string");if(k==="results"&&((0,i.default)(m.answers)!=="object"||!Array.isArray(m.answers)||m.answers.length===0))throw new Error("answers is a required parameter of type array");if(m){var S=m.section,v=m.answers,g=m.quizSessionId,I=m.quizVersionId,C=m.page,O=m.resultsPerPage,N=m.filters,P=m.fmtOptions,q=m.hiddenFields;S&&(E.section=S),I&&(E.quiz_version_id=I),g&&(E.quiz_session_id=g),v&&v.length&&(x="&".concat(u.stringify({a:v.map(function(j){return(0,r.default)(j).join(",")})}))),u.isNil(C)||(E.page=C),u.isNil(O)||(E.num_results_per_page=O),N&&(E.filters=N),P&&(E.fmt_options=P),q&&(E.fmt_options?E.fmt_options.hidden_fields=q:E.fmt_options={hidden_fields:q})}E._dt=Date.now(),E=u.cleanParams(E);var F=u.stringify(E);return"".concat(h,"/v1/quizzes/").concat(encodeURIComponent(d),"/").concat(encodeURIComponent(k),"/?").concat(F).concat(x)}var a=function(){function d(m){(0,t.default)(this,d),this.options=m||{},this.eventDispatcher=new o(m.eventDispatcher)}return(0,n.default)(d,[{key:"getQuizNextQuestion",value:function(y,k){var _=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l,p=this.options.fetch,f=new AbortController,c=f.signal;try{l=s(y,k,this.options,"next")}catch(h){return Promise.reject(h)}return u.applyNetworkTimeout(this.options,w,f),p(l,{signal:c}).then(u.convertResponseToJson).then(function(h){if(h.quiz_version_id)return _.eventDispatcher.queue("quizzes.getQuizNextQuestion.completed",h),h;throw new Error("getQuizNextQuestion response data is malformed")})}},{key:"getQuizResults",value:function(y,k){var _=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l,p=this.options.fetch,f=new AbortController,c=f.signal;try{l=s(y,k,this.options,"results")}catch(h){return Promise.reject(h)}return u.applyNetworkTimeout(this.options,w,f),p(l,{signal:c}).then(u.convertResponseToJson).then(function(h){if(h.quiz_version_id)return _.eventDispatcher.queue("quizzes.getQuizResults.completed",h),h;throw new Error("getQuizResults response data is malformed")})}},{key:"getQuizResultsConfig",value:function(y,k){var _=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l,p=this.options.fetch,f=new AbortController,c=f.signal;try{l=s(y,k,this.options,"results_config")}catch(h){return Promise.reject(h)}return u.applyNetworkTimeout(this.options,w,f),p(l,{signal:c}).then(u.convertResponseToJson).then(function(h){if(h.quiz_version_id)return _.eventDispatcher.queue("quizzes.getQuizResultsConfig.completed",h),h;throw new Error("getQuizResultsConfig response data is malformed")})}}]),d}();return Du=a,Du}var ar={exports:{}},Ac;function Sg(){if(Ac)return ar.exports;Ac=1;var e=Qe,t=e(ft()),n=e(dt()),r=e(Tl()),i=rt(),o=i.cleanParams,u=i.trimNonBreakingSpaces,s=i.encodeURIComponentRFC3986,a=i.stringify;function d(k,_,w){var l=w.apiKey,p=w.version,f=w.sessionId,c=w.clientId,h=w.userId,E=w.segments,x=w.testCells,S=w.assistantServiceUrl,v={c:p};if(v.key=l,v.i=c,v.s=f,!k||typeof k!="string")throw new Error("intent is a required parameter of type string");if(!_.domain||typeof _.domain!="string")throw new Error("parameters.domain is a required parameter of type string");if(x&&Object.keys(x).forEach(function(N){v["ef-".concat(N)]=x[N]}),E&&E.length&&(v.us=E),h&&(v.ui=String(h)),_){var g=_.domain,I=_.numResultsPerPage;g&&(v.domain=g),I&&(v.num_results_per_page=I)}v._dt=Date.now(),v=o(v);var C=a(v),O=k.replace(/^\//,"|");return"".concat(S,"/v1/intent/").concat(s(u(O)),"?").concat(C)}function m(k,_,w){var l=function(f){k.addEventListener(f,function(c){var h=JSON.parse(c.data);_.enqueue({type:f,data:h})})};Object.values(w).forEach(function(p){p!==w.END&&l(p)}),k.addEventListener(w.END,function(){_.close(),k.close()}),k.onerror=function(p){_.error(p),k.close()}}var y=function(){function k(_){(0,t.default)(this,k),this.options=_||{}}return(0,n.default)(k,[{key:"getAssistantResultsStream",value:function(w,l){var p,f;try{var c=d(w,l,this.options);p=new EventSource(c),f=new ReadableStream({start:function(S){m(p,S,k.EventTypes)},cancel:function(){p.close()}})}catch(x){if(f){var h;(h=f)===null||h===void 0||h.cancel()}else{var E;(E=p)===null||E===void 0||E.close()}throw new Error(x.message)}return f}}]),k}();return(0,r.default)(y,"EventTypes",{START:"start",GROUP:"group",SEARCH_RESULT:"search_result",ARTICLE_REFERENCE:"article_reference",RECIPE_INFO:"recipe_info",RECIPE_INSTRUCTIONS:"recipe_instructions",SERVER_ERROR:"server_error",IMAGE_META:"image_meta",END:"end"}),ar.exports=y,ar.exports.createAssistantUrl=d,ar.exports.setupEventListeners=m,ar.exports}var np=Qe,kg=np(ft()),Eg=np(dt()),Cg=ng(),xg=rg(),Ig=og(),Rg=ug(),Tg=sg(),Ng=lg(),rp=pg(),Og=Jn(),po=rt(),Ag=hg(),Pg=Ag.default,Dg=_g(),Lg=Sg(),Mg=function(){var t="ciojs-client-",n=[];return po.canUseDOM()||n.push("domless"),typeof process<"u"&&typeof process.env<"u"&&{}.BUNDLED&&n.push("bundled"),"".concat(t).concat(n.join("-")).concat(n.length?"-":"").concat(Pg)},Nl=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,kg.default)(this,e);var n=t.apiKey,r=t.version,i=t.serviceUrl,o=t.quizzesServiceUrl,u=t.assistantServiceUrl,s=t.segments,a=t.testCells,d=t.clientId,m=t.sessionId,y=t.userId,k=t.fetch,_=t.trackingSendDelay,w=t.sendReferrerWithTrackingEvents,l=t.sendTrackingEvents,p=t.eventDispatcher,f=t.idOptions,c=t.beaconMode,h=t.networkParameters;if(!n||typeof n!="string")throw new Error("API key is a required parameter of type string");var E,x,S=typeof vr<"u"&&vr.CLIENT_VERSION;if(po.canUseDOM()){var v=new Cg(f||{});E=v.session_id,x=v.client_id}else{if(!m||typeof m!="number")throw new Error("sessionId is a required user parameter of type number");if(!d||typeof d!="string")throw new Error("clientId is a required user parameter of type string")}var g=i&&i.replace(/\/$/,"");this.options={apiKey:n,version:r||S||Mg(),serviceUrl:po.addHTTPSToString(g)||"https://ac.cnstrc.com",quizzesServiceUrl:o&&o.replace(/\/$/,"")||"https://quizzes.cnstrc.com",assistantServiceUrl:u&&u.replace(/\/$/,"")||"https://assistant.cnstrc.com",sessionId:m||E,clientId:d||x,userId:y,segments:s,testCells:a,fetch:k||xg({Promise}).fetch,trackingSendDelay:_,sendTrackingEvents:l,sendReferrerWithTrackingEvents:w,eventDispatcher:p,beaconMode:c!==!1,networkParameters:h||{}},this.search=new Ig(this.options),this.browse=new Rg(this.options),this.autocomplete=new Tg(this.options),this.recommendations=new Ng(this.options),this.tracker=new rp(this.options),this.quizzes=new Dg(this.options),this.assistant=new Lg(this.options),new Og(t.eventDispatcher).queue("instantiated",this.options)}return(0,Eg.default)(e,[{key:"setClientOptions",value:function(n){if(Object.keys(n).length){var r=n.apiKey,i=n.segments,o=n.testCells,u=n.userId;r&&(this.options.apiKey=r),i&&(this.options.segments=i),o&&(this.options.testCells=o),u&&(this.options.userId=u)}}}]),e}();Nl.Tracker=rp;po.canUseDOM()&&(window.ConstructorioClient=Nl);var zg=Nl;const qg=Ps(zg),St={SEARCH_SUBMIT:"SEARCH_SUBMIT",RECENT_ACTIONS_STORAGE_KEY:{scope:"session",key:"_constructorio_recent_actions"},RECENT_SEARCHES_STORAGE_KEY:{scope:"local",key:"_constructorio_recent_searches"},SEARCH_TERM_STORAGE_KEY:{scope:"session",key:"_constructorio_search_term"},RECENT_SEARCHES_STORAGE_COUNT:100,RECENT_ACTION_STORAGE_COUNT:5},Ol=e=>e==="local"?localStorage:sessionStorage,Al=(e,t)=>{try{return Ol(e.scope).setItem(e.key,t)}catch(n){return Ao(`storageSetItem error: ${n}`),null}},Fg=e=>{try{return Ol(e.scope).removeItem(e.key)}catch(t){return Ao(`storageRemoveItem error: ${t}`),null}},Ug=e=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,[...t.body.querySelectorAll("script, img")].forEach(o=>{t.body.removeChild(o)}),[...t.body.childNodes].map(o=>o.innerText||o.textContent).join("")},Bg=e=>{try{return Ol(e.scope).getItem(e.key)}catch(t){return Ao(`storageGetItem error: ${t}`),null}},ip=e=>{const t=Bg(e);if(t)try{return JSON.parse(t)}catch(n){Ao(`storageGetArray error: ${n}`)}return null},jg=()=>{const e=ip(St.RECENT_SEARCHES_STORAGE_KEY)||[];return e.forEach((t,n)=>{typeof t=="string"&&(e[n]={term:t,ts:Date.now()})}),e},bg=(e,t)=>{const n=Ug(e.trim());let r=jg();if(n.length>0){for(r=r.filter(i=>{var o;return((o=i.term)==null?void 0:o.toUpperCase())!==n.toUpperCase()}),t!=null&&t.original_section&&(t.section=t.original_section,delete t.original_section,delete t.is_meta_section),r.push({term:n,ts:Date.now(),data:t});r.length>St.RECENT_SEARCHES_STORAGE_COUNT;)r.shift();Al(St.RECENT_SEARCHES_STORAGE_KEY,JSON.stringify(r))}},op=()=>ip(St.RECENT_ACTIONS_STORAGE_KEY)||[],Hg=()=>{var t;const e=op();return e&&e.length?(t=e[e.length-1])==null?void 0:t.action:null},Vg=e=>{let t=op();e&&(Hg()!==e&&t.push({action:e,ts:Date.now()}),t.length>St.RECENT_ACTION_STORAGE_COUNT&&(t=t.slice(-1*St.RECENT_ACTION_STORAGE_COUNT)),Al(St.RECENT_ACTIONS_STORAGE_KEY,JSON.stringify(t)))};function Kg(e){return e.section==="Products"}function Wg(e){return e.section==="Search Suggestions"}function up(e){return e.groupName!==void 0}function Pc(e){return e.type==="custom"}function sp(e){return e.type==="autocomplete"||!e.type}function Yn(e){return e.type==="recommendations"}const Gg="1.23.21";function lp(e){var i,o;let t=!1,n=!1,r=!0;if(((i=e==null?void 0:e.features)==null?void 0:i.custom_autosuggest_ui)===!0)switch((o=e==null?void 0:e.feature_variants)==null?void 0:o.custom_autosuggest_ui){case"custom_autosuggest_ui_result_count":n=!0;break;case"custom_autosuggest_ui_image":t=!0;break;case"custom_autosuggest_ui_image_result_count":t=!0,n=!0;break;case"custom_autosuggest_ui_disable_recommendations_in_zero_state":r=!1;break}return{featureDisplaySearchSuggestionImages:t,featureDisplaySearchSuggestionResultCounts:n,featureDisplayZeroStateRecommendations:r}}const Qg=({item:e,items:t})=>{var i;const n=t.findIndex(o=>(o==null?void 0:o.id)===(e==null?void 0:e.id));return{sectionId:(i=t[n])==null?void 0:i.section,index:n}},$g=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b([A-Z]+)([A-Z])([a-z])/,"$1 $2$3").replace(/([a-zA-Z])/,t=>t.toUpperCase()),Ns=e=>e.replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Jg=(e,t)=>{if(e&&typeof window<"u"){const n=new qg({apiKey:e,sendTrackingEvents:!0,version:`cio-ui-autocomplete-${Gg}`,...t});return n.tracker.on("error",r=>console.error(r)),n}return null},Yg=(e,t,n)=>{const r=[],i=o=>{const{type:u}=o;let s;switch(u){case"recommendations":s=t[o.podId];break;case"custom":s=o.data.map(a=>{var d;return{...a,id:(a==null?void 0:a.id)||((d=a==null?void 0:a.data)==null?void 0:d.id)}});break;default:s=t[o.indexSectionName]}return s};return e==null||e.forEach((o,u)=>{const s=i(o);if(Array.isArray(s)){const a={...o,data:s},d=o.ref,m=n.current[u];a.ref=d||m,r.push(a)}}),r},Xg=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Zg=(e,t,n)=>{if(e.dataset.cnstrcRecommendationsPodId){const r=t.find(o=>Yn(o)&&o.podId===e.dataset.cnstrcRecommendationsPodId),i=r==null?void 0:r.data.map(o=>{var u,s;return{itemId:(u=o.data)==null?void 0:u.id,itemName:o.value,variationId:(s=o.data)==null?void 0:s.variation_id}});n==null||n.tracker.trackRecommendationView({podId:e.dataset.cnstrcRecommendationsPodId,numResultsViewed:(i==null?void 0:i.length)||0,url:window.location.href,section:e.dataset.cnstrcSection,items:i})}},em=e=>{const t=[];return e==null||e.forEach(n=>{n!=null&&n.data&&t.push(...n.data)}),t},ap=(e,t)=>{const n={in:"in","show all results":"show all results"};return t?t[e]:n[e]||e},Os=(e,t,n={})=>{e==null||e.tracker.trackSearchSubmit(t,n),Al(St.SEARCH_TERM_STORAGE_KEY,t),bg(t,{}),Vg(St.SEARCH_SUBMIT)},tm=(e,t,n={})=>{e==null||e.tracker.trackAutocompleteSelect(t,n),(n==null?void 0:n.section)==="Products"&&Fg(St.SEARCH_TERM_STORAGE_KEY)},Ao=e=>{var t;try{typeof process<"u"&&((t=process==null?void 0:process.env)!=null&&t.LOGGER)&&console.log(e)}catch{}},nm=({apiKey:e,cioJsClient:t,cioJsClientOptions:n})=>(!e&&!t&&console.error("Either apiKey or cioJsClient is required"),B.useMemo(()=>t||Jg(e,n),[e,t,n]));function hr(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function ce(){return ce=Object.assign?Object.assign.bind():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},ce.apply(this,arguments)}var cp={exports:{}},rm="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",im=rm,om=im;function fp(){}function dp(){}dp.resetWarningCache=fp;var um=function(){function e(r,i,o,u,s,a){if(a!==om){var d=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 d.name="Invariant Violation",d}}e.isRequired=e;function t(){return 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:dp,resetWarningCache:fp};return n.PropTypes=n,n};cp.exports=um();var sm=cp.exports;const U=Ps(sm);var se={};/** @license React v17.0.2
|
|
35
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Pu)),Pu.exports}var Nc;function wg(){return Nc||(Nc=1,function(e){var t=vg(),n=gg(),r=mg(),i=yg();function o(u){return t(u)||n(u)||r(u)||i()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}(Ru)),Ru.exports}var Du,Oc;function _g(){if(Oc)return Du;Oc=1;var e=Qe,t=e(ft()),n=e(dt()),r=e(wg()),i=e($n()),o=Jn(),u=rt();function s(d,m,y,k){var _=y.apiKey,w=y.clientId,l=y.sessionId,p=y.segments,f=y.userId,c=y.version,h=y.quizzesServiceUrl,E={c},x="";if(E.key=_,E.i=w,E.s=l,p&&p.length&&(E.us=p),f&&(E.ui=String(f)),!d||typeof d!="string")throw new Error("quizId is a required parameter of type string");if(k==="results"&&((0,i.default)(m.answers)!=="object"||!Array.isArray(m.answers)||m.answers.length===0))throw new Error("answers is a required parameter of type array");if(m){var S=m.section,v=m.answers,g=m.quizSessionId,I=m.quizVersionId,C=m.page,O=m.resultsPerPage,N=m.filters,P=m.fmtOptions,q=m.hiddenFields;S&&(E.section=S),I&&(E.quiz_version_id=I),g&&(E.quiz_session_id=g),v&&v.length&&(x="&".concat(u.stringify({a:v.map(function(j){return(0,r.default)(j).join(",")})}))),u.isNil(C)||(E.page=C),u.isNil(O)||(E.num_results_per_page=O),N&&(E.filters=N),P&&(E.fmt_options=P),q&&(E.fmt_options?E.fmt_options.hidden_fields=q:E.fmt_options={hidden_fields:q})}E._dt=Date.now(),E=u.cleanParams(E);var F=u.stringify(E);return"".concat(h,"/v1/quizzes/").concat(encodeURIComponent(d),"/").concat(encodeURIComponent(k),"/?").concat(F).concat(x)}var a=function(){function d(m){(0,t.default)(this,d),this.options=m||{},this.eventDispatcher=new o(m.eventDispatcher)}return(0,n.default)(d,[{key:"getQuizNextQuestion",value:function(y,k){var _=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l,p=this.options.fetch,f=new AbortController,c=f.signal;try{l=s(y,k,this.options,"next")}catch(h){return Promise.reject(h)}return u.applyNetworkTimeout(this.options,w,f),p(l,{signal:c}).then(u.convertResponseToJson).then(function(h){if(h.quiz_version_id)return _.eventDispatcher.queue("quizzes.getQuizNextQuestion.completed",h),h;throw new Error("getQuizNextQuestion response data is malformed")})}},{key:"getQuizResults",value:function(y,k){var _=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l,p=this.options.fetch,f=new AbortController,c=f.signal;try{l=s(y,k,this.options,"results")}catch(h){return Promise.reject(h)}return u.applyNetworkTimeout(this.options,w,f),p(l,{signal:c}).then(u.convertResponseToJson).then(function(h){if(h.quiz_version_id)return _.eventDispatcher.queue("quizzes.getQuizResults.completed",h),h;throw new Error("getQuizResults response data is malformed")})}},{key:"getQuizResultsConfig",value:function(y,k){var _=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l,p=this.options.fetch,f=new AbortController,c=f.signal;try{l=s(y,k,this.options,"results_config")}catch(h){return Promise.reject(h)}return u.applyNetworkTimeout(this.options,w,f),p(l,{signal:c}).then(u.convertResponseToJson).then(function(h){if(h.quiz_version_id)return _.eventDispatcher.queue("quizzes.getQuizResultsConfig.completed",h),h;throw new Error("getQuizResultsConfig response data is malformed")})}}]),d}();return Du=a,Du}var ar={exports:{}},Ac;function Sg(){if(Ac)return ar.exports;Ac=1;var e=Qe,t=e(ft()),n=e(dt()),r=e(Tl()),i=rt(),o=i.cleanParams,u=i.trimNonBreakingSpaces,s=i.encodeURIComponentRFC3986,a=i.stringify;function d(k,_,w){var l=w.apiKey,p=w.version,f=w.sessionId,c=w.clientId,h=w.userId,E=w.segments,x=w.testCells,S=w.assistantServiceUrl,v={c:p};if(v.key=l,v.i=c,v.s=f,!k||typeof k!="string")throw new Error("intent is a required parameter of type string");if(!_.domain||typeof _.domain!="string")throw new Error("parameters.domain is a required parameter of type string");if(x&&Object.keys(x).forEach(function(N){v["ef-".concat(N)]=x[N]}),E&&E.length&&(v.us=E),h&&(v.ui=String(h)),_){var g=_.domain,I=_.numResultsPerPage;g&&(v.domain=g),I&&(v.num_results_per_page=I)}v._dt=Date.now(),v=o(v);var C=a(v),O=k.replace(/^\//,"|");return"".concat(S,"/v1/intent/").concat(s(u(O)),"?").concat(C)}function m(k,_,w){var l=function(f){k.addEventListener(f,function(c){var h=JSON.parse(c.data);_.enqueue({type:f,data:h})})};Object.values(w).forEach(function(p){p!==w.END&&l(p)}),k.addEventListener(w.END,function(){_.close(),k.close()}),k.onerror=function(p){_.error(p),k.close()}}var y=function(){function k(_){(0,t.default)(this,k),this.options=_||{}}return(0,n.default)(k,[{key:"getAssistantResultsStream",value:function(w,l){var p,f;try{var c=d(w,l,this.options);p=new EventSource(c),f=new ReadableStream({start:function(S){m(p,S,k.EventTypes)},cancel:function(){p.close()}})}catch(x){if(f){var h;(h=f)===null||h===void 0||h.cancel()}else{var E;(E=p)===null||E===void 0||E.close()}throw new Error(x.message)}return f}}]),k}();return(0,r.default)(y,"EventTypes",{START:"start",GROUP:"group",SEARCH_RESULT:"search_result",ARTICLE_REFERENCE:"article_reference",RECIPE_INFO:"recipe_info",RECIPE_INSTRUCTIONS:"recipe_instructions",SERVER_ERROR:"server_error",IMAGE_META:"image_meta",END:"end"}),ar.exports=y,ar.exports.createAssistantUrl=d,ar.exports.setupEventListeners=m,ar.exports}var np=Qe,kg=np(ft()),Eg=np(dt()),Cg=ng(),xg=rg(),Ig=og(),Rg=ug(),Tg=sg(),Ng=lg(),rp=pg(),Og=Jn(),po=rt(),Ag=hg(),Pg=Ag.default,Dg=_g(),Lg=Sg(),Mg=function(){var t="ciojs-client-",n=[];return po.canUseDOM()||n.push("domless"),typeof process<"u"&&typeof process.env<"u"&&{}.BUNDLED&&n.push("bundled"),"".concat(t).concat(n.join("-")).concat(n.length?"-":"").concat(Pg)},Nl=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,kg.default)(this,e);var n=t.apiKey,r=t.version,i=t.serviceUrl,o=t.quizzesServiceUrl,u=t.assistantServiceUrl,s=t.segments,a=t.testCells,d=t.clientId,m=t.sessionId,y=t.userId,k=t.fetch,_=t.trackingSendDelay,w=t.sendReferrerWithTrackingEvents,l=t.sendTrackingEvents,p=t.eventDispatcher,f=t.idOptions,c=t.beaconMode,h=t.networkParameters;if(!n||typeof n!="string")throw new Error("API key is a required parameter of type string");var E,x,S=typeof vr<"u"&&vr.CLIENT_VERSION;if(po.canUseDOM()){var v=new Cg(f||{});E=v.session_id,x=v.client_id}else{if(!m||typeof m!="number")throw new Error("sessionId is a required user parameter of type number");if(!d||typeof d!="string")throw new Error("clientId is a required user parameter of type string")}var g=i&&i.replace(/\/$/,"");this.options={apiKey:n,version:r||S||Mg(),serviceUrl:po.addHTTPSToString(g)||"https://ac.cnstrc.com",quizzesServiceUrl:o&&o.replace(/\/$/,"")||"https://quizzes.cnstrc.com",assistantServiceUrl:u&&u.replace(/\/$/,"")||"https://assistant.cnstrc.com",sessionId:m||E,clientId:d||x,userId:y,segments:s,testCells:a,fetch:k||xg({Promise}).fetch,trackingSendDelay:_,sendTrackingEvents:l,sendReferrerWithTrackingEvents:w,eventDispatcher:p,beaconMode:c!==!1,networkParameters:h||{}},this.search=new Ig(this.options),this.browse=new Rg(this.options),this.autocomplete=new Tg(this.options),this.recommendations=new Ng(this.options),this.tracker=new rp(this.options),this.quizzes=new Dg(this.options),this.assistant=new Lg(this.options),new Og(t.eventDispatcher).queue("instantiated",this.options)}return(0,Eg.default)(e,[{key:"setClientOptions",value:function(n){if(Object.keys(n).length){var r=n.apiKey,i=n.segments,o=n.testCells,u=n.userId;r&&(this.options.apiKey=r),i&&(this.options.segments=i),o&&(this.options.testCells=o),u&&(this.options.userId=u)}}}]),e}();Nl.Tracker=rp;po.canUseDOM()&&(window.ConstructorioClient=Nl);var zg=Nl;const qg=Ps(zg),St={SEARCH_SUBMIT:"SEARCH_SUBMIT",RECENT_ACTIONS_STORAGE_KEY:{scope:"session",key:"_constructorio_recent_actions"},RECENT_SEARCHES_STORAGE_KEY:{scope:"local",key:"_constructorio_recent_searches"},SEARCH_TERM_STORAGE_KEY:{scope:"session",key:"_constructorio_search_term"},RECENT_SEARCHES_STORAGE_COUNT:100,RECENT_ACTION_STORAGE_COUNT:5},Ol=e=>e==="local"?localStorage:sessionStorage,Al=(e,t)=>{try{return Ol(e.scope).setItem(e.key,t)}catch(n){return Ao(`storageSetItem error: ${n}`),null}},Fg=e=>{try{return Ol(e.scope).removeItem(e.key)}catch(t){return Ao(`storageRemoveItem error: ${t}`),null}},Ug=e=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,[...t.body.querySelectorAll("script, img")].forEach(o=>{t.body.removeChild(o)}),[...t.body.childNodes].map(o=>o.innerText||o.textContent).join("")},Bg=e=>{try{return Ol(e.scope).getItem(e.key)}catch(t){return Ao(`storageGetItem error: ${t}`),null}},ip=e=>{const t=Bg(e);if(t)try{return JSON.parse(t)}catch(n){Ao(`storageGetArray error: ${n}`)}return null},jg=()=>{const e=ip(St.RECENT_SEARCHES_STORAGE_KEY)||[];return e.forEach((t,n)=>{typeof t=="string"&&(e[n]={term:t,ts:Date.now()})}),e},bg=(e,t)=>{const n=Ug(e.trim());let r=jg();if(n.length>0){for(r=r.filter(i=>{var o;return((o=i.term)==null?void 0:o.toUpperCase())!==n.toUpperCase()}),t!=null&&t.original_section&&(t.section=t.original_section,delete t.original_section,delete t.is_meta_section),r.push({term:n,ts:Date.now(),data:t});r.length>St.RECENT_SEARCHES_STORAGE_COUNT;)r.shift();Al(St.RECENT_SEARCHES_STORAGE_KEY,JSON.stringify(r))}},op=()=>ip(St.RECENT_ACTIONS_STORAGE_KEY)||[],Hg=()=>{var t;const e=op();return e&&e.length?(t=e[e.length-1])==null?void 0:t.action:null},Vg=e=>{let t=op();e&&(Hg()!==e&&t.push({action:e,ts:Date.now()}),t.length>St.RECENT_ACTION_STORAGE_COUNT&&(t=t.slice(-1*St.RECENT_ACTION_STORAGE_COUNT)),Al(St.RECENT_ACTIONS_STORAGE_KEY,JSON.stringify(t)))};function Kg(e){return e.section==="Products"}function Wg(e){return e.section==="Search Suggestions"}function up(e){return e.groupName!==void 0}function Pc(e){return e.type==="custom"}function sp(e){return e.type==="autocomplete"||!e.type}function Yn(e){return e.type==="recommendations"}const Gg="1.23.23";function lp(e){var i,o;let t=!1,n=!1,r=!0;if(((i=e==null?void 0:e.features)==null?void 0:i.custom_autosuggest_ui)===!0)switch((o=e==null?void 0:e.feature_variants)==null?void 0:o.custom_autosuggest_ui){case"custom_autosuggest_ui_result_count":n=!0;break;case"custom_autosuggest_ui_image":t=!0;break;case"custom_autosuggest_ui_image_result_count":t=!0,n=!0;break;case"custom_autosuggest_ui_disable_recommendations_in_zero_state":r=!1;break}return{featureDisplaySearchSuggestionImages:t,featureDisplaySearchSuggestionResultCounts:n,featureDisplayZeroStateRecommendations:r}}const Qg=({item:e,items:t})=>{var i;const n=t.findIndex(o=>(o==null?void 0:o.id)===(e==null?void 0:e.id));return{sectionId:(i=t[n])==null?void 0:i.section,index:n}},$g=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b([A-Z]+)([A-Z])([a-z])/,"$1 $2$3").replace(/([a-zA-Z])/,t=>t.toUpperCase()),Ns=e=>e.replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Jg=(e,t)=>{if(e&&typeof window<"u"){const n=new qg({apiKey:e,sendTrackingEvents:!0,version:`cio-ui-autocomplete-${Gg}`,...t});return n.tracker.on("error",r=>console.error(r)),n}return null},Yg=(e,t,n,r)=>{const i=[],o=u=>{const{type:s}=u;let a;switch(s){case"recommendations":a=t[u.podId];break;case"custom":a=u.data.map(d=>{var m;return{...d,id:(d==null?void 0:d.id)||((m=d==null?void 0:d.data)==null?void 0:m.id)}});break;default:a=t[u.indexSectionName]}return a};return e==null||e.forEach((u,s)=>{const a=o(u);if(Array.isArray(a)){const d={...u,data:a};u.type==="recommendations"&&(d.displayName=u.displayName||r[u.podId].displayName);const m=u.ref,y=n.current[s];d.ref=m||y,i.push(d)}}),i},Xg=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Zg=(e,t,n)=>{if(e.dataset.cnstrcRecommendationsPodId){const r=t.find(o=>Yn(o)&&o.podId===e.dataset.cnstrcRecommendationsPodId),i=r==null?void 0:r.data.map(o=>{var u,s;return{itemId:(u=o.data)==null?void 0:u.id,itemName:o.value,variationId:(s=o.data)==null?void 0:s.variation_id}});n==null||n.tracker.trackRecommendationView({podId:e.dataset.cnstrcRecommendationsPodId,numResultsViewed:(i==null?void 0:i.length)||0,url:window.location.href,section:e.dataset.cnstrcSection,items:i})}},em=e=>{const t=[];return e==null||e.forEach(n=>{n!=null&&n.data&&t.push(...n.data)}),t},ap=(e,t)=>{const n={in:"in","show all results":"show all results"};return t?t[e]:n[e]||e},Os=(e,t,n={})=>{e==null||e.tracker.trackSearchSubmit(t,n),Al(St.SEARCH_TERM_STORAGE_KEY,t),bg(t,{}),Vg(St.SEARCH_SUBMIT)},tm=(e,t,n={})=>{e==null||e.tracker.trackAutocompleteSelect(t,n),(n==null?void 0:n.section)==="Products"&&Fg(St.SEARCH_TERM_STORAGE_KEY)},Ao=e=>{var t;try{typeof process<"u"&&((t=process==null?void 0:process.env)!=null&&t.LOGGER)&&console.log(e)}catch{}},nm=({apiKey:e,cioJsClient:t,cioJsClientOptions:n})=>(!e&&!t&&console.error("Either apiKey or cioJsClient is required"),B.useMemo(()=>t||Jg(e,n),[e,t,n]));function hr(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function ce(){return ce=Object.assign?Object.assign.bind():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},ce.apply(this,arguments)}var cp={exports:{}},rm="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",im=rm,om=im;function fp(){}function dp(){}dp.resetWarningCache=fp;var um=function(){function e(r,i,o,u,s,a){if(a!==om){var d=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 d.name="Invariant Violation",d}}e.isRequired=e;function t(){return 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:dp,resetWarningCache:fp};return n.PropTypes=n,n};cp.exports=um();var sm=cp.exports;const U=Ps(sm);var se={};/** @license React v17.0.2
|
|
36
36
|
* react-is.production.min.js
|
|
37
37
|
*
|
|
38
38
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the MIT license found in the
|
|
41
41
|
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var Po=60103,Do=60106,Jr=60107,Yr=60108,Xr=60114,Zr=60109,ei=60110,ti=60112,ni=60113,Pl=60120,ri=60115,ii=60116,pp=60121,hp=60122,vp=60117,gp=60129,mp=60131;if(typeof Symbol=="function"&&Symbol.for){var Ce=Symbol.for;Po=Ce("react.element"),Do=Ce("react.portal"),Jr=Ce("react.fragment"),Yr=Ce("react.strict_mode"),Xr=Ce("react.profiler"),Zr=Ce("react.provider"),ei=Ce("react.context"),ti=Ce("react.forward_ref"),ni=Ce("react.suspense"),Pl=Ce("react.suspense_list"),ri=Ce("react.memo"),ii=Ce("react.lazy"),pp=Ce("react.block"),hp=Ce("react.server.block"),vp=Ce("react.fundamental"),gp=Ce("react.debug_trace_mode"),mp=Ce("react.legacy_hidden")}function pt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Po:switch(e=e.type,e){case Jr:case Xr:case Yr:case ni:case Pl:return e;default:switch(e=e&&e.$$typeof,e){case ei:case ti:case ii:case ri:case Zr:return e;default:return t}}case Do:return t}}}var lm=Zr,am=Po,cm=ti,fm=Jr,dm=ii,pm=ri,hm=Do,vm=Xr,gm=Yr,mm=ni;se.ContextConsumer=ei;se.ContextProvider=lm;se.Element=am;se.ForwardRef=cm;se.Fragment=fm;se.Lazy=dm;se.Memo=pm;se.Portal=hm;se.Profiler=vm;se.StrictMode=gm;se.Suspense=mm;se.isAsyncMode=function(){return!1};se.isConcurrentMode=function(){return!1};se.isContextConsumer=function(e){return pt(e)===ei};se.isContextProvider=function(e){return pt(e)===Zr};se.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Po};se.isForwardRef=function(e){return pt(e)===ti};se.isFragment=function(e){return pt(e)===Jr};se.isLazy=function(e){return pt(e)===ii};se.isMemo=function(e){return pt(e)===ri};se.isPortal=function(e){return pt(e)===Do};se.isProfiler=function(e){return pt(e)===Xr};se.isStrictMode=function(e){return pt(e)===Yr};se.isSuspense=function(e){return pt(e)===ni};se.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Jr||e===Xr||e===gp||e===Yr||e===ni||e===Pl||e===mp||typeof e=="object"&&e!==null&&(e.$$typeof===ii||e.$$typeof===ri||e.$$typeof===Zr||e.$$typeof===ei||e.$$typeof===ti||e.$$typeof===vp||e.$$typeof===pp||e[0]===hp)};se.typeOf=pt;let Dc=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Lc=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Lu=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return Lc(n.overflowY,t)||Lc(n.overflowX,t)||(r=>{let i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(e)}return!1},xi=(e,t,n,r,i,o,u,s)=>o<e&&u>t||o>e&&u<t?0:o<=e&&s<=n||u>=t&&s>=n?o-e-r:u>t&&s<n||o<e&&s>n?u-t+i:0,ym=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)};var wm=(e,t)=>{var n,r,i,o,u,s;if(typeof document>"u")return[];let{scrollMode:a,block:d,inline:m,boundary:y,skipOverflowHiddenElements:k}=t,_=typeof y=="function"?y:q=>q!==y;if(!Dc(e))throw new TypeError("Invalid target");let w=document.scrollingElement||document.documentElement,l=[],p=e;for(;Dc(p)&&_(p);){if(p=ym(p),p===w){l.push(p);break}p!=null&&p===document.body&&Lu(p)&&!Lu(document.documentElement)||p!=null&&Lu(p,k)&&l.push(p)}let f=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,c=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,h=(u=window.scrollX)!=null?u:pageXOffset,E=(s=window.scrollY)!=null?s:pageYOffset,{height:x,width:S,top:v,right:g,bottom:I,left:C}=e.getBoundingClientRect(),O=d==="start"||d==="nearest"?v:d==="end"?I:v+x/2,N=m==="center"?C+S/2:m==="end"?g:C,P=[];for(let q=0;q<l.length;q++){let F=l[q],{height:j,width:T,top:R,right:A,bottom:D,left:M}=F.getBoundingClientRect();if(a==="if-needed"&&v>=0&&C>=0&&I<=c&&g<=f&&v>=R&&I<=D&&C>=M&&g<=A)return P;let L=getComputedStyle(F),Q=parseInt(L.borderLeftWidth,10),Y=parseInt(L.borderTopWidth,10),V=parseInt(L.borderRightWidth,10),J=parseInt(L.borderBottomWidth,10),H=0,b=0,W="offsetWidth"in F?F.offsetWidth-F.clientWidth-Q-V:0,$="offsetHeight"in F?F.offsetHeight-F.clientHeight-Y-J:0,X="offsetWidth"in F?F.offsetWidth===0?0:T/F.offsetWidth:0,re="offsetHeight"in F?F.offsetHeight===0?0:j/F.offsetHeight:0;if(w===F)H=d==="start"?O:d==="end"?O-c:d==="nearest"?xi(E,E+c,c,Y,J,E+O,E+O+x,x):O-c/2,b=m==="start"?N:m==="center"?N-f/2:m==="end"?N-f:xi(h,h+f,f,Q,V,h+N,h+N+S,S),H=Math.max(0,H+E),b=Math.max(0,b+h);else{H=d==="start"?O-R-Y:d==="end"?O-D+J+$:d==="nearest"?xi(R,D,j,Y,J+$,O,O+x,x):O-(R+j/2)+$/2,b=m==="start"?N-M-Q:m==="center"?N-(M+T/2)+W/2:m==="end"?N-A+V+W:xi(M,A,T,Q,V+W,N,N+S,S);let{scrollLeft:ee,scrollTop:ie}=F;H=Math.max(0,Math.min(ie+H/re,F.scrollHeight-j/re+$)),b=Math.max(0,Math.min(ee+b/X,F.scrollWidth-T/X+W)),O+=ie-H,N+=ee-b}P.push({el:F,top:H,left:b})}return P},ho=function(){return ho=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ho.apply(this,arguments)};var _m=0;function yp(){}function Sm(e,t){if(e){var n=wm(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach(function(r){var i=r.el,o=r.top,u=r.left;i.scrollTop=o,i.scrollLeft=u})}}function Mc(e,t,n){var r=e===t||t instanceof n.Node&&e.contains&&e.contains(t);return r}function wp(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var o=arguments.length,u=new Array(o),s=0;s<o;s++)u[s]=arguments[s];r(),n=setTimeout(function(){n=null,e.apply(void 0,u)},t)}return i.cancel=r,i}function Et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),u=1;u<i;u++)o[u-1]=arguments[u];return t.some(function(s){return s&&s.apply(void 0,[r].concat(o)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function Ii(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){t.forEach(function(i){typeof i=="function"?i(r):i&&(i.current=r)})}}function km(){return String(_m++)}function Em(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(n===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function As(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=_p(t,r)?t[r]:e[r],n},{})}function _p(e,t){return e[t]!==void 0}function Cm(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function Ri(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var o=n-1;(typeof t!="number"||t<0||t>=n)&&(t=e>0?-1:o+1);var u=t+e;u<0?u=i?o:0:u>o&&(u=i?0:o);var s=Vr(e,u,n,r,i);return s===-1?t>=n?-1:t:s}function Vr(e,t,n,r,i){var o=r(t);if(!o||!o.hasAttribute("disabled"))return t;if(e>0){for(var u=t+1;u<n;u++)if(!r(u).hasAttribute("disabled"))return u}else for(var s=t-1;s>=0;s--)if(!r(s).hasAttribute("disabled"))return s;return i?e>0?Vr(1,0,n,r,!1):Vr(-1,n-1,n,r,!1):-1}function zc(e,t,n,r){return r===void 0&&(r=!0),t.some(function(i){return i&&(Mc(i,e,n)||r&&Mc(i,n.document.activeElement,n))})}var xm=wp(function(e){Sp(e).textContent=""},500);function Im(e,t){var n=Sp(t);e&&(n.textContent=e,xm(t))}function Sp(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var Rm=["isInitialMount","highlightedIndex","items","environment"],kp={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function Tm(e,t,n){var r=e.props,i=e.type,o={};Object.keys(t).forEach(function(u){Nm(u,e,t,n),n[u]!==t[u]&&(o[u]=n[u])}),r.onStateChange&&Object.keys(o).length&&r.onStateChange(ce({type:i},o))}function Nm(e,t,n,r){var i=t.props,o=t.type,u="on"+Dl(e)+"Change";i[u]&&r[e]!==void 0&&r[e]!==n[e]&&i[u](ce({type:o},r))}function Om(e,t){return t.changes}function Am(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""}var Pm=wp(function(e,t){Im(e(),t)},200),Dm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?B.useLayoutEffect:B.useEffect;function Lm(e){var t=e.id,n=t===void 0?"downshift-"+km():t,r=e.labelId,i=e.menuId,o=e.getItemId,u=e.toggleButtonId,s=e.inputId,a=B.useRef({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:o||function(d){return n+"-item-"+d},toggleButtonId:u||n+"-toggle-button",inputId:s||n+"-input"});return a.current}function Mm(e,t,n){return e!==void 0?e:n.length===0?-1:n.indexOf(t)}function zm(e){return e?String(e):""}function Dl(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Ep(e){var t=B.useRef(e);return t.current=e,t}function qm(e,t,n){var r=B.useRef(),i=B.useRef(),o=B.useCallback(function(k,_){i.current=_,k=As(k,_.props);var w=e(k,_),l=_.props.stateReducer(k,ce({},_,{changes:w}));return l},[e]),u=B.useReducer(o,t),s=u[0],a=u[1],d=Ep(n),m=B.useCallback(function(k){return a(ce({props:d.current},k))},[d]),y=i.current;return B.useEffect(function(){y&&r.current&&r.current!==s&&Tm(y,As(r.current,y.props),s),r.current=s},[s,n,y]),[s,m]}var xr={itemToString:zm,stateReducer:Om,getA11ySelectionMessage:Am,scrollIntoView:Sm,environment:typeof window>"u"?{}:window};function Je(e,t,n){n===void 0&&(n=kp);var r=e["default"+Dl(t)];return r!==void 0?r:n[t]}function Ti(e,t,n){n===void 0&&(n=kp);var r=e[t];if(r!==void 0)return r;var i=e["initial"+Dl(t)];return i!==void 0?i:Je(e,t,n)}function Fm(e){var t=Ti(e,"selectedItem"),n=Ti(e,"isOpen"),r=Ti(e,"highlightedIndex"),i=Ti(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function Ir(e,t,n){var r=e.items,i=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,u=t.selectedItem,s=t.highlightedIndex;return r.length===0?-1:i!==void 0&&s===i?i:o!==void 0?o:u?r.indexOf(u):n===0?-1:n<0?r.length-1:0}function Um(e,t,n,r){var i=B.useRef({isMouseDown:!1,isTouchMove:!1});return B.useEffect(function(){var o=function(){i.current.isMouseDown=!0},u=function(y){i.current.isMouseDown=!1,e&&!zc(y.target,t.map(function(k){return k.current}),n)&&r()},s=function(){i.current.isTouchMove=!1},a=function(){i.current.isTouchMove=!0},d=function(y){e&&!i.current.isTouchMove&&!zc(y.target,t.map(function(k){return k.current}),n,!1)&&r()};return n.addEventListener("mousedown",o),n.addEventListener("mouseup",u),n.addEventListener("touchstart",s),n.addEventListener("touchmove",a),n.addEventListener("touchend",d),function(){n.removeEventListener("mousedown",o),n.removeEventListener("mouseup",u),n.removeEventListener("touchstart",s),n.removeEventListener("touchmove",a),n.removeEventListener("touchend",d)}},[e,n]),i}var Bm=function(){return yp};function qc(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,o=n.items,u=n.environment,s=hr(n,Rm);B.useEffect(function(){r||Pm(function(){return e(ce({highlightedIndex:i,highlightedItem:o[i],resultCount:o.length},s))},u.document)},t)}function jm(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,o=e.menuElement,u=e.scrollIntoView,s=B.useRef(!0);return Dm(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:u(i(t),o))},[t]),s}var bm=yp;function Hm(e,t,n){var r=t.type,i=t.props,o;switch(r){case n.ItemMouseMove:o={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:o={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ir(i,e,0)};break;case n.FunctionOpenMenu:o={isOpen:!0,highlightedIndex:Ir(i,e,0)};break;case n.FunctionCloseMenu:o={isOpen:!1};break;case n.FunctionSetHighlightedIndex:o={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:o={inputValue:t.inputValue};break;case n.FunctionReset:o={highlightedIndex:Je(i,"highlightedIndex"),isOpen:Je(i,"isOpen"),selectedItem:Je(i,"selectedItem"),inputValue:Je(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return ce({},e,o)}U.array.isRequired,U.func,U.func,U.func,U.number,U.number,U.number,U.bool,U.bool,U.bool,U.any,U.any,U.any,U.string,U.string,U.string,U.func,U.string,U.func,U.func,U.func,U.func,U.func,U.shape({addEventListener:U.func,removeEventListener:U.func,document:U.shape({getElementById:U.func,activeElement:U.any,body:U.any})});function Vm(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(n===1?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}ho(ho({},xr),{getA11yStatusMessage:Vm});var Ll=0,Ml=1,zl=2,ql=3,Fl=4,Ul=5,Bl=6,jl=7,bl=8,vo=9,Hl=10,Cp=11,xp=12,Vl=13,Ip=14,Rp=15,Tp=16,Np=17,Op=18,Kl=19,Ap=20,Pp=21,Wl=22,Dp=Object.freeze({__proto__:null,InputKeyDownArrowDown:Ll,InputKeyDownArrowUp:Ml,InputKeyDownEscape:zl,InputKeyDownHome:ql,InputKeyDownEnd:Fl,InputKeyDownPageUp:Ul,InputKeyDownPageDown:Bl,InputKeyDownEnter:jl,InputChange:bl,InputBlur:vo,InputFocus:Hl,MenuMouseLeave:Cp,ItemMouseMove:xp,ItemClick:Vl,ToggleButtonClick:Ip,FunctionToggleMenu:Rp,FunctionOpenMenu:Tp,FunctionCloseMenu:Np,FunctionSetHighlightedIndex:Op,FunctionSelectItem:Kl,FunctionSetInputValue:Ap,FunctionReset:Pp,ControlledPropUpdatedSelectedItem:Wl});function Km(e){var t=Fm(e),n=t.selectedItem,r=t.inputValue;return r===""&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),ce({},t,{inputValue:r})}U.array.isRequired,U.func,U.func,U.func,U.number,U.number,U.number,U.bool,U.bool,U.bool,U.any,U.any,U.any,U.string,U.string,U.string,U.string,U.string,U.string,U.func,U.string,U.string,U.func,U.func,U.func,U.func,U.func,U.func,U.shape({addEventListener:U.func,removeEventListener:U.func,document:U.shape({getElementById:U.func,activeElement:U.any,body:U.any})});function Wm(e,t,n){var r=B.useRef(),i=qm(e,t,n),o=i[0],u=i[1];return B.useEffect(function(){_p(n,"selectedItem")&&(r.current!==n.selectedItem&&u({type:Wl,inputValue:n.itemToString(n.selectedItem)}),r.current=o.selectedItem===r.current?n.selectedItem:o.selectedItem)}),[As(o,n),u]}var Gm=ce({},xr,{getA11yStatusMessage:Em});function Qm(e,t){var n=t.type,r=t.props,i=t.altKey,o;switch(n){case Vl:o={isOpen:Je(r,"isOpen"),highlightedIndex:Je(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case Ll:e.isOpen?o={highlightedIndex:Ri(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:o={highlightedIndex:i&&e.selectedItem==null?-1:Ir(r,e,1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case Ml:e.isOpen?i?o=ce({isOpen:Je(r,"isOpen"),highlightedIndex:Je(r,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])}):o={highlightedIndex:Ri(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:o={highlightedIndex:Ir(r,e,-1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case jl:o=ce({isOpen:Je(r,"isOpen"),highlightedIndex:Je(r,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case zl:o=ce({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Ul:o={highlightedIndex:Ri(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case Bl:o={highlightedIndex:Ri(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case ql:o={highlightedIndex:Vr(1,0,r.items.length,t.getItemNodeFromIndex,!1)};break;case Fl:o={highlightedIndex:Vr(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1)};break;case vo:o=ce({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case bl:o={isOpen:!0,highlightedIndex:Je(r,"highlightedIndex"),inputValue:t.inputValue};break;case Hl:o={isOpen:!0,highlightedIndex:Ir(r,e,0)};break;case Kl:o={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case Wl:o={inputValue:t.inputValue};break;default:return Hm(e,t,Dp)}return ce({},e,o)}var $m=["onMouseLeave","refKey","ref"],Jm=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],Ym=["onClick","onPress","refKey","ref"],Xm=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];Lp.stateChangeTypes=Dp;function Lp(e){e===void 0&&(e={});var t=ce({},Gm,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,o=t.scrollIntoView,u=t.environment,s=t.getA11yStatusMessage,a=t.getA11ySelectionMessage,d=t.itemToString,m=Km(t),y=Wm(Qm,m,t),k=y[0],_=y[1],w=k.isOpen,l=k.highlightedIndex,p=k.selectedItem,f=k.inputValue,c=B.useRef(null),h=B.useRef({}),E=B.useRef(null),x=B.useRef(null),S=B.useRef(!0),v=Lm(t),g=B.useRef(),I=Ep({state:k,props:t}),C=B.useCallback(function(H){return h.current[v.getItemId(H)]},[v]);qc(s,[w,l,f,i],ce({isInitialMount:S.current,previousResultCount:g.current,items:i,environment:u,itemToString:d},k)),qc(a,[p],ce({isInitialMount:S.current,previousResultCount:g.current,items:i,environment:u,itemToString:d},k));var O=jm({menuElement:c.current,highlightedIndex:l,isOpen:w,itemRefs:h,scrollIntoView:o,getItemNodeFromIndex:C});bm({isInitialMount:S.current,props:t,state:k}),B.useEffect(function(){var H=n||r||w;H&&E.current&&E.current.focus()},[]),B.useEffect(function(){S.current||(g.current=i.length)});var N=Um(w,[E,c,x],u,function(){_({type:vo,selectItem:!1})}),P=Bm();B.useEffect(function(){return S.current=!1,function(){S.current=!0}},[]),B.useEffect(function(){if(!w)h.current={};else if(document.activeElement!==E.current){var H;E==null||(H=E.current)==null||H.focus()}},[w]);var q=B.useMemo(function(){return{ArrowDown:function(b){b.preventDefault(),_({type:Ll,altKey:b.altKey,getItemNodeFromIndex:C})},ArrowUp:function(b){b.preventDefault(),_({type:Ml,altKey:b.altKey,getItemNodeFromIndex:C})},Home:function(b){I.current.state.isOpen&&(b.preventDefault(),_({type:ql,getItemNodeFromIndex:C}))},End:function(b){I.current.state.isOpen&&(b.preventDefault(),_({type:Fl,getItemNodeFromIndex:C}))},Escape:function(b){var W=I.current.state;(W.isOpen||W.inputValue||W.selectedItem||W.highlightedIndex>-1)&&(b.preventDefault(),_({type:zl}))},Enter:function(b){var W=I.current.state;!W.isOpen||b.which===229||(b.preventDefault(),_({type:jl,getItemNodeFromIndex:C}))},PageUp:function(b){I.current.state.isOpen&&(b.preventDefault(),_({type:Ul,getItemNodeFromIndex:C}))},PageDown:function(b){I.current.state.isOpen&&(b.preventDefault(),_({type:Bl,getItemNodeFromIndex:C}))}}},[_,I,C]),F=B.useCallback(function(H){return ce({id:v.labelId,htmlFor:v.inputId},H)},[v]),j=B.useCallback(function(H,b){var W,$=H===void 0?{}:H,X=$.onMouseLeave,re=$.refKey,ee=re===void 0?"ref":re,ie=$.ref,ve=hr($,$m),ne=b===void 0?{}:b;return ne.suppressRefError,ce((W={},W[ee]=Ii(ie,function(we){c.current=we}),W.id=v.menuId,W.role="listbox",W["aria-labelledby"]=v.labelId,W.onMouseLeave=Et(X,function(){_({type:Cp})}),W),ve)},[_,P,v]),T=B.useCallback(function(H){var b,W,$=H===void 0?{}:H,X=$.item,re=$.index,ee=$.refKey,ie=ee===void 0?"ref":ee,ve=$.ref,ne=$.onMouseMove,we=$.onMouseDown,$e=$.onClick;$.onPress;var ht=$.disabled,mn=hr($,Jm),je=I.current,yn=je.props,wn=je.state,kt=Mm(re,X,yn.items);if(kt<0)throw new Error("Pass either item or item index in getItemProps!");var Zn="onClick",Lo=$e,oi=function(){re!==wn.highlightedIndex&&(O.current=!1,_({type:xp,index:re,disabled:ht}))},Lt=function(){_({type:Vl,index:re})},tn=function(er){return er.preventDefault()};return ce((b={},b[ie]=Ii(ve,function(vt){vt&&(h.current[v.getItemId(kt)]=vt)}),b.disabled=ht,b.role="option",b["aria-selected"]=""+(kt===wn.highlightedIndex),b.id=v.getItemId(kt),b),!ht&&(W={},W[Zn]=Et(Lo,Lt),W),{onMouseMove:Et(ne,oi),onMouseDown:Et(we,tn)},mn)},[_,I,O,v]),R=B.useCallback(function(H){var b,W=H===void 0?{}:H,$=W.onClick;W.onPress;var X=W.refKey,re=X===void 0?"ref":X,ee=W.ref,ie=hr(W,Ym),ve=I.current.state,ne=function(){_({type:Ip})};return ce((b={},b[re]=Ii(ee,function(we){x.current=we}),b["aria-controls"]=v.menuId,b["aria-expanded"]=ve.isOpen,b.id=v.toggleButtonId,b.tabIndex=-1,b),!ie.disabled&&ce({},{onClick:Et($,ne)}),ie)},[_,I,v]),A=B.useCallback(function(H,b){var W,$=H===void 0?{}:H,X=$.onKeyDown,re=$.onChange,ee=$.onInput,ie=$.onFocus,ve=$.onBlur;$.onChangeText;var ne=$.refKey,we=ne===void 0?"ref":ne,$e=$.ref,ht=hr($,Xm),mn=b===void 0?{}:b;mn.suppressRefError;var je=I.current.state,yn=function(vt){var er=Cm(vt);er&&q[er]&&q[er](vt)},wn=function(vt){_({type:bl,inputValue:vt.target.value})},kt=function(){je.isOpen&&!N.current.isMouseDown&&_({type:vo,selectItem:!0})},Zn=function(){je.isOpen||_({type:Hl})},Lo="onChange",oi={};if(!ht.disabled){var Lt;oi=(Lt={},Lt[Lo]=Et(re,ee,wn),Lt.onKeyDown=Et(X,yn),Lt.onBlur=Et(ve,kt),Lt.onFocus=Et(ie,Zn),Lt)}return ce((W={},W[we]=Ii($e,function(tn){E.current=tn}),W["aria-activedescendant"]=je.isOpen&&je.highlightedIndex>-1?v.getItemId(je.highlightedIndex):"",W["aria-autocomplete"]="list",W["aria-controls"]=v.menuId,W["aria-expanded"]=je.isOpen,W["aria-labelledby"]=v.labelId,W.autoComplete="off",W.id=v.inputId,W.role="combobox",W.value=je.inputValue,W),oi,ht)},[_,q,I,N,P,v]),D=B.useCallback(function(){_({type:Rp})},[_]),M=B.useCallback(function(){_({type:Np})},[_]),L=B.useCallback(function(){_({type:Tp})},[_]),Q=B.useCallback(function(H){_({type:Op,highlightedIndex:H})},[_]),Y=B.useCallback(function(H){_({type:Kl,selectedItem:H})},[_]),V=B.useCallback(function(H){_({type:Ap,inputValue:H})},[_]),J=B.useCallback(function(){_({type:Pp})},[_]);return{getItemProps:T,getLabelProps:F,getMenuProps:j,getInputProps:A,getToggleButtonProps:R,toggleMenu:D,openMenu:L,closeMenu:M,setHighlightedIndex:Q,setInputValue:V,selectItem:Y,reset:J,highlightedIndex:l,isOpen:w,selectedItem:p,inputValue:f}}function Zm(e){var t=e.removedSelectedItem,n=e.itemToString;return n(t)+" has been removed."}U.array,U.array,U.array,U.func,U.func,U.func,U.number,U.number,U.number,U.func,U.func,U.string,U.string,U.shape({addEventListener:U.func,removeEventListener:U.func,document:U.shape({getElementById:U.func,activeElement:U.any,body:U.any})});xr.itemToString,xr.stateReducer,xr.environment;let ey=0;const ty=({setQuery:e,items:t,onSubmit:n,cioClient:r,previousQuery:i="",...o})=>Lp({id:`cio-autocomplete-${ey++}`,items:t,itemToString:u=>(u==null?void 0:u.value)||"",onSelectedItemChange({selectedItem:u}){var s;if(u&&u!=null&&u.value){n&&n({item:u,originalQuery:i});try{(u==null?void 0:u.section)==="Search Suggestions"&&(e(u.value||""),Os(r,u.value,{originalQuery:i})),u.podId&&((s=u.data)!=null&&s.id)&&u.strategy?r==null||r.tracker.trackRecommendationClick({itemName:u.value,itemId:u.data.id,variationId:u.data.variation_id,podId:u.podId,strategyId:u.strategy.id,section:u.section,resultId:u.result_id}):u.result_id&&tm(r,u.value,{originalQuery:i,section:u.section})}catch(a){console.log(a)}}},...o}),ny=e=>{const t=B.useRef();return B.useEffect(()=>{t.current=e},[e]),t.current},ry=(e,t)=>{B.useEffect(()=>{e&&!Array.isArray(e)&&console.error("useCioAutocomplete expects sections to reference an array of section configuration objects"),t&&!Array.isArray(t)&&console.error("useCioAutocomplete expects zeroStateSections to reference an array of section configuration objects")},[e,t])};function iy(e,t,n,r){const i=!e.length&&!!(r!=null&&r.length),[o,u]=B.useState(i?r:t);return{activeSections:B.useMemo(()=>o.map(a=>{const d=a;if(Yn(a)){const m=n==null?void 0:n[a.podId],y=a.displayName,k=m==null?void 0:m.displayName;d.displayName=y||k}return d}),[o,n]),showZeroStateSections:i,setActiveSections:u}}const oy=(e,t=250)=>{const[n,r]=B.useState(e);return B.useEffect(()=>{const i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},uy=(e,t)=>{const{numTermsWithGroupSuggestions:n,numGroupsSuggestedPerTerm:r}=t,i={};return Object.keys((e==null?void 0:e.sections)||{}).forEach(o=>{i[o]=[],e.sections[o].map(s=>{var a;return{...s,id:(a=s==null?void 0:s.data)==null?void 0:a.id,section:o}}).forEach((s,a)=>{var d,m,y;(d=i[o])==null||d.push(s),o==="Search Suggestions"&&((y=(m=s==null?void 0:s.data)==null?void 0:m.groups)!=null&&y.length)&&a<n&&s.data.groups.forEach((k,_)=>{var w,l;if(_<r){const p={...s,id:`${(w=s.data)==null?void 0:w.id}_${k.group_id}`,groupName:k.display_name,groupId:k.group_id};(l=i[o])==null||l.push(p)}})})}),{sectionsData:i,request:e==null?void 0:e.request,totalNumResultsPerSection:e==null?void 0:e.total_num_results_per_section}},sy=(e,t,n,r)=>{const[i,o]=B.useState({sectionsData:{},request:{},totalNumResultsPerSection:{}}),u=oy(e,r==null?void 0:r.debounce),{numTermsWithGroupSuggestions:s=0,numGroupsSuggestedPerTerm:a=0}=r||{},d=B.useMemo(()=>{const m={...r};return m==null||delete m.debounce,n&&(m.resultsPerSection=n.reduce((y,k)=>({...y,[k.indexSectionName]:(k==null?void 0:k.numResults)||8}),{})),m},[n,r]);return B.useEffect(()=>{(async()=>{const m=u.trim();if(m&&encodeURIComponent(m).length<200)try{const y=await(t==null?void 0:t.autocomplete.getAutocompleteResults(u,d));if(y){const k=uy(y,{numTermsWithGroupSuggestions:s,numGroupsSuggestedPerTerm:a});o(k)}}catch(y){console.log(y)}else u||o({sectionsData:{},request:{},totalNumResultsPerSection:{}})})()},[u,t,s,a,d]),i},ly=(e,t,n=!1)=>{const[r,i]=B.useState({}),[o,u]=B.useState({}),s=async()=>{if(!e||!Array.isArray(t)||t.length===0)return;const a=await Promise.all(t.map(({podId:y,indexSectionName:k,..._})=>e.recommendations.getRecommendations(y,{..._,section:k}))),d={},m={};a.forEach(({response:y,request:k},_)=>{const{pod:w,results:l}=y;w!=null&&w.id&&(d[w.id]=l==null?void 0:l.map(p=>{var f,c;return{...p,id:(f=p==null?void 0:p.data)==null?void 0:f.id,section:(c=t[_])==null?void 0:c.indexSectionName,podId:w.id}}),m[w.id]={displayName:w.display_name,podId:w.id,request:k})});try{i(d),u(m)}catch(y){console.log(y)}};return B.useEffect(()=>{n||s()},[e,t]),{fetchRecommendationResults:s,recommendationsResults:r,podsData:o}};function ay(e,t,n,r){const i=B.useMemo(()=>n==null?void 0:n.filter(k=>sp(k)),[n]),{sectionsData:o,request:u,totalNumResultsPerSection:s}=sy(e,t,i,r),a=B.useMemo(()=>n==null?void 0:n.filter(k=>Yn(k)),[n]),{fetchRecommendationResults:d,recommendationsResults:m,podsData:y}=ly(t,a,r==null?void 0:r.fetchZeroStateOnFocus);return{recommendations:{results:m,fetchRecommendationResults:d,podsData:y},autocomplete:{results:o,request:u,totalNumResultsPerSection:s}}}function cy(e,t,n,r){const[i,o]=B.useState([]);return B.useEffect(()=>{const u=Yg(t,e,n);(u.length||!r)&&o(u)},[t,e,n,r]),i}function fy(e,t,n,r,i){B.useEffect(()=>{var u,s;const o=lp((s=(u=Object.values(t||{}))==null?void 0:u[0])==null?void 0:s.request);r?o.featureDisplayZeroStateRecommendations?n(i):n([]):n(e)},[i,r,e,t,n])}function dy(e,t,n,r,i){const[o,u]=B.useState({}),{activeSections:s,showZeroStateSections:a,setActiveSections:d}=iy(e,n,o,r),m=B.useRef(s.map(()=>B.createRef())),{recommendations:y,autocomplete:k}=ay(e,t,s,i);B.useEffect(()=>{y.podsData||u(y.podsData)},[y.podsData]),fy(n,o,d,a,r);const _=B.useMemo(()=>({...k.results,...y.results}),[k.results,y.results]),w=cy(_,s,m,e);return{fetchRecommendationResults:y.fetchRecommendationResults,activeSections:s,activeSectionsWithData:w,zeroStateActiveSections:a,request:k.request,totalNumResultsPerSection:k.totalNumResultsPerSection}}const Mu=new Set;function py(e,t,n,r){const i=t.filter(o=>Yn(o)).map(o=>o.ref);B.useEffect(()=>{const o={root:null,threshold:.1},u=new IntersectionObserver(s=>{s.forEach(a=>{a.isIntersecting&&!Mu.has(a.target)&&(r(a.target,t,n),Mu.add(a.target))})},o);return i.forEach(s=>{s!=null&&s.current&&u.observe(s.current)}),()=>{i.forEach(s=>{s!=null&&s.current&&u.unobserve(s.current)})}},[e,t]),B.useEffect(()=>{e||Mu.clear()},[e])}const hy=[{indexSectionName:"Search Suggestions",type:"autocomplete"},{indexSectionName:"Products",type:"autocomplete"}],vy=e=>e.map(t=>{if(Yn(t)){if(t.identifier&&!t.podId)return{...t,podId:t.identifier};if(!t.indexSectionName)return{...t,indexSectionName:"Products"}}return sp(t)&&t.identifier&&!t.indexSectionName?{...t,indexSectionName:t.identifier}:t}),Fc=e=>e&&vy(e),gy=e=>{const{sections:t=hy,zeroStateSections:n,cioJsClientOptions:r,advancedParameters:i}=e,o=B.useMemo(()=>Fc(t),[JSON.stringify(t)]),u=B.useMemo(()=>Fc(n),[JSON.stringify(n)]),s=B.useMemo(()=>r,[JSON.stringify(r)]),a=B.useMemo(()=>i,[JSON.stringify(i)]);return{sections:o,zeroStateSections:u,cioJsClientOptions:s,advancedParameters:a}},my=e=>{const{sections:t,zeroStateSections:n,cioJsClientOptions:r,advancedParameters:i}=gy(e),{onSubmit:o,onChange:u,openOnFocus:s,apiKey:a,cioJsClient:d,placeholder:m="What can we help you find today?",autocompleteClassName:y="cio-autocomplete",defaultInput:k,getSearchResultsUrl:_,...w}=e,[l,p]=B.useState(k||""),f=ny(l),c=nm({apiKey:a,cioJsClient:d,cioJsClientOptions:r}),{fetchRecommendationResults:h,activeSections:E,activeSectionsWithData:x,zeroStateActiveSections:S,request:v,totalNumResultsPerSection:g}=dy(l,c,t,n,i),I=B.useMemo(()=>lp(v),[v]),C=B.useMemo(()=>em(x),[x]),{isOpen:O,getMenuProps:N,getLabelProps:P,openMenu:q,closeMenu:F,highlightedIndex:j,getInputProps:T,getItemProps:R}=ty({setQuery:p,items:C,onSubmit:o,cioClient:c,previousQuery:f,...w});return ry(t,E),py(O,x,c,Zg),{query:l,sections:x,totalNumResultsPerSection:g,request:v,featureToggles:I,isOpen:O&&(C==null?void 0:C.length)>0,getMenuProps:()=>({...N(),className:"cio-results","data-testid":"cio-results","data-cnstrc-autosuggest":""}),getLabelProps:P,openMenu:q,closeMenu:F,getItemProps:A=>{var Q;const{index:D,sectionId:M}=Qg({item:A,items:C}),L=`cio-item-${M==null?void 0:M.replace(" ","")}`;return{...R({item:A,index:D}),className:`cio-item ${L}`,"data-testid":L,"data-cnstrc-item-section":A.section,"data-cnstrc-item-group":A.groupId,"data-cnstrc-item-name":A.value,"data-cnstrc-item-id":(Q=A.data)==null?void 0:Q.id}},getInputProps:()=>({...T({onChange:A=>{p(A.target.value),u&&u(A.target.value)}}),value:l,onFocus:()=>{var A;e.onFocus&&e.onFocus(),S&&s!==!1&&I.featureDisplayZeroStateRecommendations&&q(),l!=null&&l.length&&q();try{i!=null&&i.fetchZeroStateOnFocus&&h(),(A=c==null?void 0:c.tracker)==null||A.trackInputFocus()}catch(D){console.log(D)}},className:"cio-input","data-testid":"cio-input","data-cnstrc-search-input":"",placeholder:m,onKeyDownCapture:({code:A,key:D,nativeEvent:M})=>{const L=A==="Enter"||D==="Enter",Q=A==="Home"||D==="Home",Y=A==="End"||D==="End",V=j<0;if(O&&L&&V&&(l!=null&&l.length)){o&&o({query:l});try{Os(c,l,{originalQuery:l})}catch(J){console.log(J)}}(Q||Y)&&(M.preventDownshiftDefault=!0)}}),getFormProps:()=>({onSubmit:A=>{A.preventDefault(),o&&o({query:l});try{Os(c,l,{originalQuery:l})}catch(D){console.log(D)}return{query:l}},className:"cio-form","data-testid":"cio-form","data-cnstrc-search-form":""}),getSectionProps:A=>{var Q,Y;const D=()=>{const{type:V}=A;let J;const H=V!=="custom"&&A.indexSectionName?Ns(A.indexSectionName):"";switch(V){case"recommendations":J=A.podId;break;case"autocomplete":J=A.displayName||A.indexSectionName;break;case"custom":J=A.displayName;break;default:J=A.displayName||A.indexSectionName;break}return`${J} ${H}`},L={className:`cio-section cio-section-${Pc(A)?"custom":Ns(A.indexSectionName||((Q=A.data[0])==null?void 0:Q.section)||"Products")} ${D()}`,ref:A.ref,role:"none","data-cnstrc-section":(Y=A.data[0])==null?void 0:Y.section};return Pc(A)&&(L["data-cnstrc-custom-section"]=!0,L["data-cnstrc-custom-section-name"]=A.displayName),Yn(A)&&(L["data-cnstrc-recommendations"]=!0,L["data-cnstrc-recommendations-pod-id"]=A.podId),L},setQuery:p,cioClient:c,autocompleteClassName:y,selectedItem:C[j],advancedParameters:i,getSearchResultsUrl:_}},Xn=B.createContext({});function Uc(e){const{children:t,...n}=e,r=my(n);return G.createElement(Xn.Provider,{value:r},G.createElement("div",{className:r.autocompleteClassName},t))}function ji({item:e,query:t,highlightSearchTerm:n}){const r=up(e)?e.groupName:e.value;if(n){const i=new RegExp(`(${Xg(t)})`,"gi"),o=i.test(r);if(t&&o){const u=r.split(i);return G.createElement(G.Fragment,null,u.map((s,a)=>i.test(s)?G.createElement("b",{key:`matched-word-${a}`},s):s))}}return G.createElement(G.Fragment,null,r)}function Bc(e){var m,y,k,_;const{item:t,displaySearchTermHighlights:n}=e,{advancedParameters:r,query:i,featureToggles:o}=B.useContext(Xn),{featureDisplaySearchSuggestionImages:u,featureDisplaySearchSuggestionResultCounts:s}=o,{displaySearchSuggestionImages:a=u,displaySearchSuggestionResultCounts:d=s}=r||{};return G.createElement(G.Fragment,null,a&&((m=t.data)==null?void 0:m.image_url)&&G.createElement("img",{src:(y=t.data)==null?void 0:y.image_url,alt:t.value,className:"cio-suggestion-image"}),G.createElement("p",{className:"cio-suggestion-text"},G.createElement(ji,{item:t,query:i,highlightSearchTerm:n})),d&&((k=t.data)==null?void 0:k.total_num_results)&&G.createElement("p",{className:"cio-suggestion-count"},"(",(_=t.data)==null?void 0:_.total_num_results,")"))}function yy(e){var m,y;const{item:t,children:n,displaySearchTermHighlights:r}=e,{getItemProps:i,advancedParameters:o,query:u,getSearchResultsUrl:s}=B.useContext(Xn),{translations:a}=o||{};let d;return Kg(t)?d=G.createElement("a",{href:(m=t.data)==null?void 0:m.url},G.createElement("img",{"data-testid":"cio-img",src:(y=t.data)==null?void 0:y.image_url,alt:t.value,className:"cio-product-image"}),G.createElement("p",{"data-testid":"cio-text",className:"cio-product-text"},G.createElement(ji,{item:t,query:u,highlightSearchTerm:r}))):up(t)?d=G.createElement("p",{className:"cio-term-in-group"},ap("in",a)," ",G.createElement(ji,{item:t,query:u,highlightSearchTerm:r})):Wg(t)?s?d=G.createElement("a",{className:"suggestion-link",href:s(t)},G.createElement(Bc,{item:t,displaySearchTermHighlights:r})):d=G.createElement(Bc,{item:t,displaySearchTermHighlights:r}):d=G.createElement("p",{className:"cio-custom-text"},G.createElement(ji,{item:t,query:u,highlightSearchTerm:r})),G.createElement("li",{...i(t)},n||d)}const wy=function({section:e}){var k,_;const{getSectionProps:t,query:n,getFormProps:r,advancedParameters:i,getItemProps:o}=B.useContext(Xn),{displayShowAllResultsButton:u,translations:s}=i||{},{onSubmit:a}=r(),{type:d,displayName:m}=e;let y=m;if(!y)switch(d){case"recommendations":y=e.podId;break;case"autocomplete":y=e.indexSectionName;break;case"custom":y=e.displayName;break;default:y=e.indexSectionName;break}return(k=e==null?void 0:e.data)!=null&&k.length?G.createElement("li",{...t(e)},G.createElement("h5",{className:"cio-section-name cio-sectionName","aria-hidden":!0},$g(y)),G.createElement("ul",{className:"cio-section-items",role:"none"},(_=e==null?void 0:e.data)==null?void 0:_.map(w=>typeof(e==null?void 0:e.renderItem)=="function"?e.renderItem({item:w,query:n,getItemProps:o}):G.createElement(yy,{item:w,key:w==null?void 0:w.id,displaySearchTermHighlights:e.displaySearchTermHighlights}))),u&&d==="autocomplete"&&e.indexSectionName==="Products"&&G.createElement("div",{className:"cio-section-footer"},G.createElement("button",{"data-cnstrc-search-submit-btn":!0,className:"cio-show-all-results-button",type:"button",onClick:a},ap("show all results",s)))):null};function _y(e){const{section:t,children:n=wy}=e;return n({section:t})}function Sy(e){return G.createElement("svg",{...e,className:"cio-close",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"122.878px",height:"122.88px",viewBox:"0 0 122.878 122.88",enableBackground:"new 0 0 122.878 122.88",xmlSpace:"preserve"},G.createElement("g",null,G.createElement("path",{d:"M1.426,8.313c-1.901-1.901-1.901-4.984,0-6.886c1.901-1.902,4.984-1.902,6.886,0l53.127,53.127l53.127-53.127 c1.901-1.902,4.984-1.902,6.887,0c1.901,1.901,1.901,4.985,0,6.886L68.324,61.439l53.128,53.128c1.901,1.901,1.901,4.984,0,6.886 c-1.902,1.902-4.985,1.902-6.887,0L61.438,68.326L8.312,121.453c-1.901,1.902-4.984,1.902-6.886,0 c-1.901-1.901-1.901-4.984,0-6.886l53.127-53.128L1.426,8.313L1.426,8.313z"})))}const ky=({sections:e})=>e==null?void 0:e.map(t=>{const{type:n}=t;let r=t.displayName;switch(n){case"recommendations":r=t.podId;break;case"custom":r=Ns(t.displayName);break;case"autocomplete":r=t.indexSectionName;break;default:r=t.indexSectionName;break}return G.createElement(_y,{section:t,key:r})});function Ey(e){const{children:t=ky}=e,{sections:n,isOpen:r,getMenuProps:i,getItemProps:o,closeMenu:u}=B.useContext(Xn),s=n&&n.some(m=>{var y;return(y=m==null?void 0:m.data)==null?void 0:y.length}),a={...i()};let d;return r&&s?d=G.createElement(G.Fragment,null,G.createElement(Sy,{onClick:()=>u()}),typeof t=="function"?t({sections:n,getItemProps:o}):t):(d=null,a.style={display:"none"}),G.createElement("ul",{...a},d)}function Cy({getFormProps:e,getInputProps:t,getLabelProps:n,setQuery:r}){const i=t();return G.createElement("form",{...e()},G.createElement("label",{...n(),htmlFor:"cio-input"},G.createElement("input",{id:"cio-input",...i})),G.createElement("button",{className:"cio-clear-btn","data-testid":"cio-clear-btn",hidden:!i.value,onClick:()=>{r(""),i.id&&setTimeout(()=>{var o;return(o=document.getElementById(i.id))==null?void 0:o.focus()},100)},type:"button","aria-label":"Clear search field text"},G.createElement("div",{className:"cio-icon"},G.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 512 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},G.createElement("path",{d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})))),G.createElement("button",{className:"cio-submit-btn","data-testid":"cio-submit-btn",disabled:!i.value,"data-cnstrc-search-submit-btn":!0,type:"submit","aria-label":"Submit Search"},G.createElement("div",{className:"cio-icon"},G.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 512 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},G.createElement("path",{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"})))))}function xy(e){const{children:t=Cy}=e,{getFormProps:n,getInputProps:r,getLabelProps:i,setQuery:o}=B.useContext(Xn);return t({getFormProps:n,getInputProps:r,getLabelProps:i,setQuery:o})}function Iy(e){const{children:t}=e;return t?G.createElement(Uc,{...e},t):G.createElement("div",null,G.createElement(Uc,{...e},G.createElement(xy,null),G.createElement(Ey,null)))}const Ry=({selector:e,includeCSS:t=!0,...n})=>{if(document){const r=document.getElementById("cio-autocomplete-styles"),i=document.querySelector(e);if(!i){console.error("CioAutocomplete: There were no elements found for the provided selector");return}r&&(t?r.disabled=!1:r.disabled=!0),zu.createRoot(i).render(G.createElement(G.StrictMode,null,G.createElement(Iy,{...n})))}};window&&(window.CioAutocomplete=Ry);export{Ry as default};
|
|
42
|
+
*/var Po=60103,Do=60106,Jr=60107,Yr=60108,Xr=60114,Zr=60109,ei=60110,ti=60112,ni=60113,Pl=60120,ri=60115,ii=60116,pp=60121,hp=60122,vp=60117,gp=60129,mp=60131;if(typeof Symbol=="function"&&Symbol.for){var Ce=Symbol.for;Po=Ce("react.element"),Do=Ce("react.portal"),Jr=Ce("react.fragment"),Yr=Ce("react.strict_mode"),Xr=Ce("react.profiler"),Zr=Ce("react.provider"),ei=Ce("react.context"),ti=Ce("react.forward_ref"),ni=Ce("react.suspense"),Pl=Ce("react.suspense_list"),ri=Ce("react.memo"),ii=Ce("react.lazy"),pp=Ce("react.block"),hp=Ce("react.server.block"),vp=Ce("react.fundamental"),gp=Ce("react.debug_trace_mode"),mp=Ce("react.legacy_hidden")}function pt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Po:switch(e=e.type,e){case Jr:case Xr:case Yr:case ni:case Pl:return e;default:switch(e=e&&e.$$typeof,e){case ei:case ti:case ii:case ri:case Zr:return e;default:return t}}case Do:return t}}}var lm=Zr,am=Po,cm=ti,fm=Jr,dm=ii,pm=ri,hm=Do,vm=Xr,gm=Yr,mm=ni;se.ContextConsumer=ei;se.ContextProvider=lm;se.Element=am;se.ForwardRef=cm;se.Fragment=fm;se.Lazy=dm;se.Memo=pm;se.Portal=hm;se.Profiler=vm;se.StrictMode=gm;se.Suspense=mm;se.isAsyncMode=function(){return!1};se.isConcurrentMode=function(){return!1};se.isContextConsumer=function(e){return pt(e)===ei};se.isContextProvider=function(e){return pt(e)===Zr};se.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Po};se.isForwardRef=function(e){return pt(e)===ti};se.isFragment=function(e){return pt(e)===Jr};se.isLazy=function(e){return pt(e)===ii};se.isMemo=function(e){return pt(e)===ri};se.isPortal=function(e){return pt(e)===Do};se.isProfiler=function(e){return pt(e)===Xr};se.isStrictMode=function(e){return pt(e)===Yr};se.isSuspense=function(e){return pt(e)===ni};se.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Jr||e===Xr||e===gp||e===Yr||e===ni||e===Pl||e===mp||typeof e=="object"&&e!==null&&(e.$$typeof===ii||e.$$typeof===ri||e.$$typeof===Zr||e.$$typeof===ei||e.$$typeof===ti||e.$$typeof===vp||e.$$typeof===pp||e[0]===hp)};se.typeOf=pt;let Dc=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Lc=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Lu=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return Lc(n.overflowY,t)||Lc(n.overflowX,t)||(r=>{let i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(e)}return!1},xi=(e,t,n,r,i,o,u,s)=>o<e&&u>t||o>e&&u<t?0:o<=e&&s<=n||u>=t&&s>=n?o-e-r:u>t&&s<n||o<e&&s>n?u-t+i:0,ym=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)};var wm=(e,t)=>{var n,r,i,o,u,s;if(typeof document>"u")return[];let{scrollMode:a,block:d,inline:m,boundary:y,skipOverflowHiddenElements:k}=t,_=typeof y=="function"?y:q=>q!==y;if(!Dc(e))throw new TypeError("Invalid target");let w=document.scrollingElement||document.documentElement,l=[],p=e;for(;Dc(p)&&_(p);){if(p=ym(p),p===w){l.push(p);break}p!=null&&p===document.body&&Lu(p)&&!Lu(document.documentElement)||p!=null&&Lu(p,k)&&l.push(p)}let f=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,c=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,h=(u=window.scrollX)!=null?u:pageXOffset,E=(s=window.scrollY)!=null?s:pageYOffset,{height:x,width:S,top:v,right:g,bottom:I,left:C}=e.getBoundingClientRect(),O=d==="start"||d==="nearest"?v:d==="end"?I:v+x/2,N=m==="center"?C+S/2:m==="end"?g:C,P=[];for(let q=0;q<l.length;q++){let F=l[q],{height:j,width:T,top:R,right:A,bottom:D,left:M}=F.getBoundingClientRect();if(a==="if-needed"&&v>=0&&C>=0&&I<=c&&g<=f&&v>=R&&I<=D&&C>=M&&g<=A)return P;let L=getComputedStyle(F),Q=parseInt(L.borderLeftWidth,10),Y=parseInt(L.borderTopWidth,10),V=parseInt(L.borderRightWidth,10),J=parseInt(L.borderBottomWidth,10),H=0,b=0,W="offsetWidth"in F?F.offsetWidth-F.clientWidth-Q-V:0,$="offsetHeight"in F?F.offsetHeight-F.clientHeight-Y-J:0,X="offsetWidth"in F?F.offsetWidth===0?0:T/F.offsetWidth:0,re="offsetHeight"in F?F.offsetHeight===0?0:j/F.offsetHeight:0;if(w===F)H=d==="start"?O:d==="end"?O-c:d==="nearest"?xi(E,E+c,c,Y,J,E+O,E+O+x,x):O-c/2,b=m==="start"?N:m==="center"?N-f/2:m==="end"?N-f:xi(h,h+f,f,Q,V,h+N,h+N+S,S),H=Math.max(0,H+E),b=Math.max(0,b+h);else{H=d==="start"?O-R-Y:d==="end"?O-D+J+$:d==="nearest"?xi(R,D,j,Y,J+$,O,O+x,x):O-(R+j/2)+$/2,b=m==="start"?N-M-Q:m==="center"?N-(M+T/2)+W/2:m==="end"?N-A+V+W:xi(M,A,T,Q,V+W,N,N+S,S);let{scrollLeft:ee,scrollTop:ie}=F;H=Math.max(0,Math.min(ie+H/re,F.scrollHeight-j/re+$)),b=Math.max(0,Math.min(ee+b/X,F.scrollWidth-T/X+W)),O+=ie-H,N+=ee-b}P.push({el:F,top:H,left:b})}return P},ho=function(){return ho=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ho.apply(this,arguments)};var _m=0;function yp(){}function Sm(e,t){if(e){var n=wm(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach(function(r){var i=r.el,o=r.top,u=r.left;i.scrollTop=o,i.scrollLeft=u})}}function Mc(e,t,n){var r=e===t||t instanceof n.Node&&e.contains&&e.contains(t);return r}function wp(e,t){var n;function r(){n&&clearTimeout(n)}function i(){for(var o=arguments.length,u=new Array(o),s=0;s<o;s++)u[s]=arguments[s];r(),n=setTimeout(function(){n=null,e.apply(void 0,u)},t)}return i.cancel=r,i}function Et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),u=1;u<i;u++)o[u-1]=arguments[u];return t.some(function(s){return s&&s.apply(void 0,[r].concat(o)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function Ii(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){t.forEach(function(i){typeof i=="function"?i(r):i&&(i.current=r)})}}function km(){return String(_m++)}function Em(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(n===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function As(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=_p(t,r)?t[r]:e[r],n},{})}function _p(e,t){return e[t]!==void 0}function Cm(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function Ri(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var o=n-1;(typeof t!="number"||t<0||t>=n)&&(t=e>0?-1:o+1);var u=t+e;u<0?u=i?o:0:u>o&&(u=i?0:o);var s=Vr(e,u,n,r,i);return s===-1?t>=n?-1:t:s}function Vr(e,t,n,r,i){var o=r(t);if(!o||!o.hasAttribute("disabled"))return t;if(e>0){for(var u=t+1;u<n;u++)if(!r(u).hasAttribute("disabled"))return u}else for(var s=t-1;s>=0;s--)if(!r(s).hasAttribute("disabled"))return s;return i?e>0?Vr(1,0,n,r,!1):Vr(-1,n-1,n,r,!1):-1}function zc(e,t,n,r){return r===void 0&&(r=!0),t.some(function(i){return i&&(Mc(i,e,n)||r&&Mc(i,n.document.activeElement,n))})}var xm=wp(function(e){Sp(e).textContent=""},500);function Im(e,t){var n=Sp(t);e&&(n.textContent=e,xm(t))}function Sp(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var Rm=["isInitialMount","highlightedIndex","items","environment"],kp={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function Tm(e,t,n){var r=e.props,i=e.type,o={};Object.keys(t).forEach(function(u){Nm(u,e,t,n),n[u]!==t[u]&&(o[u]=n[u])}),r.onStateChange&&Object.keys(o).length&&r.onStateChange(ce({type:i},o))}function Nm(e,t,n,r){var i=t.props,o=t.type,u="on"+Dl(e)+"Change";i[u]&&r[e]!==void 0&&r[e]!==n[e]&&i[u](ce({type:o},r))}function Om(e,t){return t.changes}function Am(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""}var Pm=wp(function(e,t){Im(e(),t)},200),Dm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?B.useLayoutEffect:B.useEffect;function Lm(e){var t=e.id,n=t===void 0?"downshift-"+km():t,r=e.labelId,i=e.menuId,o=e.getItemId,u=e.toggleButtonId,s=e.inputId,a=B.useRef({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:o||function(d){return n+"-item-"+d},toggleButtonId:u||n+"-toggle-button",inputId:s||n+"-input"});return a.current}function Mm(e,t,n){return e!==void 0?e:n.length===0?-1:n.indexOf(t)}function zm(e){return e?String(e):""}function Dl(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Ep(e){var t=B.useRef(e);return t.current=e,t}function qm(e,t,n){var r=B.useRef(),i=B.useRef(),o=B.useCallback(function(k,_){i.current=_,k=As(k,_.props);var w=e(k,_),l=_.props.stateReducer(k,ce({},_,{changes:w}));return l},[e]),u=B.useReducer(o,t),s=u[0],a=u[1],d=Ep(n),m=B.useCallback(function(k){return a(ce({props:d.current},k))},[d]),y=i.current;return B.useEffect(function(){y&&r.current&&r.current!==s&&Tm(y,As(r.current,y.props),s),r.current=s},[s,n,y]),[s,m]}var xr={itemToString:zm,stateReducer:Om,getA11ySelectionMessage:Am,scrollIntoView:Sm,environment:typeof window>"u"?{}:window};function Je(e,t,n){n===void 0&&(n=kp);var r=e["default"+Dl(t)];return r!==void 0?r:n[t]}function Ti(e,t,n){n===void 0&&(n=kp);var r=e[t];if(r!==void 0)return r;var i=e["initial"+Dl(t)];return i!==void 0?i:Je(e,t,n)}function Fm(e){var t=Ti(e,"selectedItem"),n=Ti(e,"isOpen"),r=Ti(e,"highlightedIndex"),i=Ti(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function Ir(e,t,n){var r=e.items,i=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,u=t.selectedItem,s=t.highlightedIndex;return r.length===0?-1:i!==void 0&&s===i?i:o!==void 0?o:u?r.indexOf(u):n===0?-1:n<0?r.length-1:0}function Um(e,t,n,r){var i=B.useRef({isMouseDown:!1,isTouchMove:!1});return B.useEffect(function(){var o=function(){i.current.isMouseDown=!0},u=function(y){i.current.isMouseDown=!1,e&&!zc(y.target,t.map(function(k){return k.current}),n)&&r()},s=function(){i.current.isTouchMove=!1},a=function(){i.current.isTouchMove=!0},d=function(y){e&&!i.current.isTouchMove&&!zc(y.target,t.map(function(k){return k.current}),n,!1)&&r()};return n.addEventListener("mousedown",o),n.addEventListener("mouseup",u),n.addEventListener("touchstart",s),n.addEventListener("touchmove",a),n.addEventListener("touchend",d),function(){n.removeEventListener("mousedown",o),n.removeEventListener("mouseup",u),n.removeEventListener("touchstart",s),n.removeEventListener("touchmove",a),n.removeEventListener("touchend",d)}},[e,n]),i}var Bm=function(){return yp};function qc(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,o=n.items,u=n.environment,s=hr(n,Rm);B.useEffect(function(){r||Pm(function(){return e(ce({highlightedIndex:i,highlightedItem:o[i],resultCount:o.length},s))},u.document)},t)}function jm(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,o=e.menuElement,u=e.scrollIntoView,s=B.useRef(!0);return Dm(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:u(i(t),o))},[t]),s}var bm=yp;function Hm(e,t,n){var r=t.type,i=t.props,o;switch(r){case n.ItemMouseMove:o={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:o={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ir(i,e,0)};break;case n.FunctionOpenMenu:o={isOpen:!0,highlightedIndex:Ir(i,e,0)};break;case n.FunctionCloseMenu:o={isOpen:!1};break;case n.FunctionSetHighlightedIndex:o={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:o={inputValue:t.inputValue};break;case n.FunctionReset:o={highlightedIndex:Je(i,"highlightedIndex"),isOpen:Je(i,"isOpen"),selectedItem:Je(i,"selectedItem"),inputValue:Je(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return ce({},e,o)}U.array.isRequired,U.func,U.func,U.func,U.number,U.number,U.number,U.bool,U.bool,U.bool,U.any,U.any,U.any,U.string,U.string,U.string,U.func,U.string,U.func,U.func,U.func,U.func,U.func,U.shape({addEventListener:U.func,removeEventListener:U.func,document:U.shape({getElementById:U.func,activeElement:U.any,body:U.any})});function Vm(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(n===1?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}ho(ho({},xr),{getA11yStatusMessage:Vm});var Ll=0,Ml=1,zl=2,ql=3,Fl=4,Ul=5,Bl=6,jl=7,bl=8,vo=9,Hl=10,Cp=11,xp=12,Vl=13,Ip=14,Rp=15,Tp=16,Np=17,Op=18,Kl=19,Ap=20,Pp=21,Wl=22,Dp=Object.freeze({__proto__:null,InputKeyDownArrowDown:Ll,InputKeyDownArrowUp:Ml,InputKeyDownEscape:zl,InputKeyDownHome:ql,InputKeyDownEnd:Fl,InputKeyDownPageUp:Ul,InputKeyDownPageDown:Bl,InputKeyDownEnter:jl,InputChange:bl,InputBlur:vo,InputFocus:Hl,MenuMouseLeave:Cp,ItemMouseMove:xp,ItemClick:Vl,ToggleButtonClick:Ip,FunctionToggleMenu:Rp,FunctionOpenMenu:Tp,FunctionCloseMenu:Np,FunctionSetHighlightedIndex:Op,FunctionSelectItem:Kl,FunctionSetInputValue:Ap,FunctionReset:Pp,ControlledPropUpdatedSelectedItem:Wl});function Km(e){var t=Fm(e),n=t.selectedItem,r=t.inputValue;return r===""&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),ce({},t,{inputValue:r})}U.array.isRequired,U.func,U.func,U.func,U.number,U.number,U.number,U.bool,U.bool,U.bool,U.any,U.any,U.any,U.string,U.string,U.string,U.string,U.string,U.string,U.func,U.string,U.string,U.func,U.func,U.func,U.func,U.func,U.func,U.shape({addEventListener:U.func,removeEventListener:U.func,document:U.shape({getElementById:U.func,activeElement:U.any,body:U.any})});function Wm(e,t,n){var r=B.useRef(),i=qm(e,t,n),o=i[0],u=i[1];return B.useEffect(function(){_p(n,"selectedItem")&&(r.current!==n.selectedItem&&u({type:Wl,inputValue:n.itemToString(n.selectedItem)}),r.current=o.selectedItem===r.current?n.selectedItem:o.selectedItem)}),[As(o,n),u]}var Gm=ce({},xr,{getA11yStatusMessage:Em});function Qm(e,t){var n=t.type,r=t.props,i=t.altKey,o;switch(n){case Vl:o={isOpen:Je(r,"isOpen"),highlightedIndex:Je(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case Ll:e.isOpen?o={highlightedIndex:Ri(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:o={highlightedIndex:i&&e.selectedItem==null?-1:Ir(r,e,1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case Ml:e.isOpen?i?o=ce({isOpen:Je(r,"isOpen"),highlightedIndex:Je(r,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])}):o={highlightedIndex:Ri(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:o={highlightedIndex:Ir(r,e,-1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case jl:o=ce({isOpen:Je(r,"isOpen"),highlightedIndex:Je(r,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case zl:o=ce({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Ul:o={highlightedIndex:Ri(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case Bl:o={highlightedIndex:Ri(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case ql:o={highlightedIndex:Vr(1,0,r.items.length,t.getItemNodeFromIndex,!1)};break;case Fl:o={highlightedIndex:Vr(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1)};break;case vo:o=ce({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case bl:o={isOpen:!0,highlightedIndex:Je(r,"highlightedIndex"),inputValue:t.inputValue};break;case Hl:o={isOpen:!0,highlightedIndex:Ir(r,e,0)};break;case Kl:o={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case Wl:o={inputValue:t.inputValue};break;default:return Hm(e,t,Dp)}return ce({},e,o)}var $m=["onMouseLeave","refKey","ref"],Jm=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],Ym=["onClick","onPress","refKey","ref"],Xm=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];Lp.stateChangeTypes=Dp;function Lp(e){e===void 0&&(e={});var t=ce({},Gm,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,o=t.scrollIntoView,u=t.environment,s=t.getA11yStatusMessage,a=t.getA11ySelectionMessage,d=t.itemToString,m=Km(t),y=Wm(Qm,m,t),k=y[0],_=y[1],w=k.isOpen,l=k.highlightedIndex,p=k.selectedItem,f=k.inputValue,c=B.useRef(null),h=B.useRef({}),E=B.useRef(null),x=B.useRef(null),S=B.useRef(!0),v=Lm(t),g=B.useRef(),I=Ep({state:k,props:t}),C=B.useCallback(function(H){return h.current[v.getItemId(H)]},[v]);qc(s,[w,l,f,i],ce({isInitialMount:S.current,previousResultCount:g.current,items:i,environment:u,itemToString:d},k)),qc(a,[p],ce({isInitialMount:S.current,previousResultCount:g.current,items:i,environment:u,itemToString:d},k));var O=jm({menuElement:c.current,highlightedIndex:l,isOpen:w,itemRefs:h,scrollIntoView:o,getItemNodeFromIndex:C});bm({isInitialMount:S.current,props:t,state:k}),B.useEffect(function(){var H=n||r||w;H&&E.current&&E.current.focus()},[]),B.useEffect(function(){S.current||(g.current=i.length)});var N=Um(w,[E,c,x],u,function(){_({type:vo,selectItem:!1})}),P=Bm();B.useEffect(function(){return S.current=!1,function(){S.current=!0}},[]),B.useEffect(function(){if(!w)h.current={};else if(document.activeElement!==E.current){var H;E==null||(H=E.current)==null||H.focus()}},[w]);var q=B.useMemo(function(){return{ArrowDown:function(b){b.preventDefault(),_({type:Ll,altKey:b.altKey,getItemNodeFromIndex:C})},ArrowUp:function(b){b.preventDefault(),_({type:Ml,altKey:b.altKey,getItemNodeFromIndex:C})},Home:function(b){I.current.state.isOpen&&(b.preventDefault(),_({type:ql,getItemNodeFromIndex:C}))},End:function(b){I.current.state.isOpen&&(b.preventDefault(),_({type:Fl,getItemNodeFromIndex:C}))},Escape:function(b){var W=I.current.state;(W.isOpen||W.inputValue||W.selectedItem||W.highlightedIndex>-1)&&(b.preventDefault(),_({type:zl}))},Enter:function(b){var W=I.current.state;!W.isOpen||b.which===229||(b.preventDefault(),_({type:jl,getItemNodeFromIndex:C}))},PageUp:function(b){I.current.state.isOpen&&(b.preventDefault(),_({type:Ul,getItemNodeFromIndex:C}))},PageDown:function(b){I.current.state.isOpen&&(b.preventDefault(),_({type:Bl,getItemNodeFromIndex:C}))}}},[_,I,C]),F=B.useCallback(function(H){return ce({id:v.labelId,htmlFor:v.inputId},H)},[v]),j=B.useCallback(function(H,b){var W,$=H===void 0?{}:H,X=$.onMouseLeave,re=$.refKey,ee=re===void 0?"ref":re,ie=$.ref,ve=hr($,$m),ne=b===void 0?{}:b;return ne.suppressRefError,ce((W={},W[ee]=Ii(ie,function(we){c.current=we}),W.id=v.menuId,W.role="listbox",W["aria-labelledby"]=v.labelId,W.onMouseLeave=Et(X,function(){_({type:Cp})}),W),ve)},[_,P,v]),T=B.useCallback(function(H){var b,W,$=H===void 0?{}:H,X=$.item,re=$.index,ee=$.refKey,ie=ee===void 0?"ref":ee,ve=$.ref,ne=$.onMouseMove,we=$.onMouseDown,$e=$.onClick;$.onPress;var ht=$.disabled,mn=hr($,Jm),je=I.current,yn=je.props,wn=je.state,kt=Mm(re,X,yn.items);if(kt<0)throw new Error("Pass either item or item index in getItemProps!");var Zn="onClick",Lo=$e,oi=function(){re!==wn.highlightedIndex&&(O.current=!1,_({type:xp,index:re,disabled:ht}))},Lt=function(){_({type:Vl,index:re})},tn=function(er){return er.preventDefault()};return ce((b={},b[ie]=Ii(ve,function(vt){vt&&(h.current[v.getItemId(kt)]=vt)}),b.disabled=ht,b.role="option",b["aria-selected"]=""+(kt===wn.highlightedIndex),b.id=v.getItemId(kt),b),!ht&&(W={},W[Zn]=Et(Lo,Lt),W),{onMouseMove:Et(ne,oi),onMouseDown:Et(we,tn)},mn)},[_,I,O,v]),R=B.useCallback(function(H){var b,W=H===void 0?{}:H,$=W.onClick;W.onPress;var X=W.refKey,re=X===void 0?"ref":X,ee=W.ref,ie=hr(W,Ym),ve=I.current.state,ne=function(){_({type:Ip})};return ce((b={},b[re]=Ii(ee,function(we){x.current=we}),b["aria-controls"]=v.menuId,b["aria-expanded"]=ve.isOpen,b.id=v.toggleButtonId,b.tabIndex=-1,b),!ie.disabled&&ce({},{onClick:Et($,ne)}),ie)},[_,I,v]),A=B.useCallback(function(H,b){var W,$=H===void 0?{}:H,X=$.onKeyDown,re=$.onChange,ee=$.onInput,ie=$.onFocus,ve=$.onBlur;$.onChangeText;var ne=$.refKey,we=ne===void 0?"ref":ne,$e=$.ref,ht=hr($,Xm),mn=b===void 0?{}:b;mn.suppressRefError;var je=I.current.state,yn=function(vt){var er=Cm(vt);er&&q[er]&&q[er](vt)},wn=function(vt){_({type:bl,inputValue:vt.target.value})},kt=function(){je.isOpen&&!N.current.isMouseDown&&_({type:vo,selectItem:!0})},Zn=function(){je.isOpen||_({type:Hl})},Lo="onChange",oi={};if(!ht.disabled){var Lt;oi=(Lt={},Lt[Lo]=Et(re,ee,wn),Lt.onKeyDown=Et(X,yn),Lt.onBlur=Et(ve,kt),Lt.onFocus=Et(ie,Zn),Lt)}return ce((W={},W[we]=Ii($e,function(tn){E.current=tn}),W["aria-activedescendant"]=je.isOpen&&je.highlightedIndex>-1?v.getItemId(je.highlightedIndex):"",W["aria-autocomplete"]="list",W["aria-controls"]=v.menuId,W["aria-expanded"]=je.isOpen,W["aria-labelledby"]=v.labelId,W.autoComplete="off",W.id=v.inputId,W.role="combobox",W.value=je.inputValue,W),oi,ht)},[_,q,I,N,P,v]),D=B.useCallback(function(){_({type:Rp})},[_]),M=B.useCallback(function(){_({type:Np})},[_]),L=B.useCallback(function(){_({type:Tp})},[_]),Q=B.useCallback(function(H){_({type:Op,highlightedIndex:H})},[_]),Y=B.useCallback(function(H){_({type:Kl,selectedItem:H})},[_]),V=B.useCallback(function(H){_({type:Ap,inputValue:H})},[_]),J=B.useCallback(function(){_({type:Pp})},[_]);return{getItemProps:T,getLabelProps:F,getMenuProps:j,getInputProps:A,getToggleButtonProps:R,toggleMenu:D,openMenu:L,closeMenu:M,setHighlightedIndex:Q,setInputValue:V,selectItem:Y,reset:J,highlightedIndex:l,isOpen:w,selectedItem:p,inputValue:f}}function Zm(e){var t=e.removedSelectedItem,n=e.itemToString;return n(t)+" has been removed."}U.array,U.array,U.array,U.func,U.func,U.func,U.number,U.number,U.number,U.func,U.func,U.string,U.string,U.shape({addEventListener:U.func,removeEventListener:U.func,document:U.shape({getElementById:U.func,activeElement:U.any,body:U.any})});xr.itemToString,xr.stateReducer,xr.environment;let ey=0;const ty=({setQuery:e,items:t,onSubmit:n,cioClient:r,previousQuery:i="",...o})=>Lp({id:`cio-autocomplete-${ey++}`,items:t,itemToString:u=>(u==null?void 0:u.value)||"",onSelectedItemChange({selectedItem:u}){var s;if(u&&u!=null&&u.value){n&&n({item:u,originalQuery:i});try{(u==null?void 0:u.section)==="Search Suggestions"&&(e(u.value||""),Os(r,u.value,{originalQuery:i})),u.podId&&((s=u.data)!=null&&s.id)&&u.strategy?r==null||r.tracker.trackRecommendationClick({itemName:u.value,itemId:u.data.id,variationId:u.data.variation_id,podId:u.podId,strategyId:u.strategy.id,section:u.section,resultId:u.result_id}):u.result_id&&tm(r,u.value,{originalQuery:i,section:u.section})}catch(a){console.log(a)}}},...o}),ny=e=>{const t=B.useRef();return B.useEffect(()=>{t.current=e},[e]),t.current},ry=(e,t)=>{B.useEffect(()=>{e&&!Array.isArray(e)&&console.error("useCioAutocomplete expects sections to reference an array of section configuration objects"),t&&!Array.isArray(t)&&console.error("useCioAutocomplete expects zeroStateSections to reference an array of section configuration objects")},[e,t])};function iy(e,t,n,r){const i=!e.length&&!!(r!=null&&r.length),[o,u]=B.useState(i?r:t);return{activeSections:B.useMemo(()=>o.map(a=>{const d=a;if(Yn(a)){const m=n==null?void 0:n[a.podId],y=a.displayName,k=m==null?void 0:m.displayName;d.displayName=y||k}return d}),[o,n]),showZeroStateSections:i,setActiveSections:u}}const oy=(e,t=250)=>{const[n,r]=B.useState(e);return B.useEffect(()=>{const i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},uy=(e,t)=>{const{numTermsWithGroupSuggestions:n,numGroupsSuggestedPerTerm:r}=t,i={};return Object.keys((e==null?void 0:e.sections)||{}).forEach(o=>{i[o]=[],e.sections[o].map(s=>{var a;return{...s,id:(a=s==null?void 0:s.data)==null?void 0:a.id,section:o}}).forEach((s,a)=>{var d,m,y;(d=i[o])==null||d.push(s),o==="Search Suggestions"&&((y=(m=s==null?void 0:s.data)==null?void 0:m.groups)!=null&&y.length)&&a<n&&s.data.groups.forEach((k,_)=>{var w,l;if(_<r){const p={...s,id:`${(w=s.data)==null?void 0:w.id}_${k.group_id}`,groupName:k.display_name,groupId:k.group_id};(l=i[o])==null||l.push(p)}})})}),{sectionsData:i,request:e==null?void 0:e.request,totalNumResultsPerSection:e==null?void 0:e.total_num_results_per_section}},sy=(e,t,n,r)=>{const[i,o]=B.useState({sectionsData:{},request:{},totalNumResultsPerSection:{}}),u=oy(e,r==null?void 0:r.debounce),{numTermsWithGroupSuggestions:s=0,numGroupsSuggestedPerTerm:a=0}=r||{},d=B.useMemo(()=>{const m={...r};return m==null||delete m.debounce,n&&(m.resultsPerSection=n.reduce((y,k)=>({...y,[k.indexSectionName]:(k==null?void 0:k.numResults)||8}),{})),m},[n,r]);return B.useEffect(()=>{(async()=>{const m=u.trim();if(m&&encodeURIComponent(m).length<200)try{const y=await(t==null?void 0:t.autocomplete.getAutocompleteResults(u,d));if(y){const k=uy(y,{numTermsWithGroupSuggestions:s,numGroupsSuggestedPerTerm:a});o(k)}}catch(y){console.log(y)}else u||o({sectionsData:{},request:{},totalNumResultsPerSection:{}})})()},[u,t,s,a,d]),i},ly=(e,t,n=!1)=>{const[r,i]=B.useState({}),[o,u]=B.useState({}),s=async()=>{if(!e||!Array.isArray(t)||t.length===0)return;const a=await Promise.all(t.map(({podId:y,indexSectionName:k,..._})=>e.recommendations.getRecommendations(y,{..._,section:k}))),d={},m={};a.forEach(({response:y,request:k},_)=>{const{pod:w,results:l}=y;w!=null&&w.id&&(d[w.id]=l==null?void 0:l.map(p=>{var f,c;return{...p,id:(f=p==null?void 0:p.data)==null?void 0:f.id,section:(c=t[_])==null?void 0:c.indexSectionName,podId:w.id}}),m[w.id]={displayName:w.display_name,podId:w.id,request:k})});try{i(d),u(m)}catch(y){console.log(y)}};return B.useEffect(()=>{n||s()},[e,t]),{fetchRecommendationResults:s,recommendationsResults:r,podsData:o}};function ay(e,t,n,r){const i=B.useMemo(()=>n==null?void 0:n.filter(k=>sp(k)),[n]),{sectionsData:o,request:u,totalNumResultsPerSection:s}=sy(e,t,i,r),a=B.useMemo(()=>n==null?void 0:n.filter(k=>Yn(k)),[n]),{fetchRecommendationResults:d,recommendationsResults:m,podsData:y}=ly(t,a,r==null?void 0:r.fetchZeroStateOnFocus);return{recommendations:{results:m,fetchRecommendationResults:d,podsData:y},autocomplete:{results:o,request:u,totalNumResultsPerSection:s}}}function cy(e,t,n,r,i){const[o,u]=B.useState([]);return B.useEffect(()=>{const s=Yg(t,e,n,i);(s.length||!r)&&u(s)},[t,e,n,r,i]),o}function fy(e,t,n,r,i){B.useEffect(()=>{var u,s;const o=lp((s=(u=Object.values(t||{}))==null?void 0:u[0])==null?void 0:s.request);r?o.featureDisplayZeroStateRecommendations?n(i):n([]):n(e)},[i,r,e,t,n])}function dy(e,t,n,r,i){const[o,u]=B.useState({}),{activeSections:s,showZeroStateSections:a,setActiveSections:d}=iy(e,n,o,r),m=B.useRef(s.map(()=>B.createRef())),{recommendations:y,autocomplete:k}=ay(e,t,s,i);B.useEffect(()=>{y.podsData||u(y.podsData)},[y.podsData]),fy(n,o,d,a,r);const _=B.useMemo(()=>({...k.results,...y.results}),[k.results,y.results]),w=cy(_,s,m,e,y.podsData);return{fetchRecommendationResults:y.fetchRecommendationResults,activeSections:s,activeSectionsWithData:w,zeroStateActiveSections:a,request:k.request,totalNumResultsPerSection:k.totalNumResultsPerSection}}const Mu=new Set;function py(e,t,n,r){const i=t.filter(o=>Yn(o)).map(o=>o.ref);B.useEffect(()=>{const o={root:null,threshold:.1},u=new IntersectionObserver(s=>{s.forEach(a=>{a.isIntersecting&&!Mu.has(a.target)&&(r(a.target,t,n),Mu.add(a.target))})},o);return i.forEach(s=>{s!=null&&s.current&&u.observe(s.current)}),()=>{i.forEach(s=>{s!=null&&s.current&&u.unobserve(s.current)})}},[e,t]),B.useEffect(()=>{e||Mu.clear()},[e])}const hy=[{indexSectionName:"Search Suggestions",type:"autocomplete"},{indexSectionName:"Products",type:"autocomplete"}],vy=e=>e.map(t=>{if(Yn(t)){if(t.identifier&&!t.podId)return{...t,podId:t.identifier};if(!t.indexSectionName)return{...t,indexSectionName:"Products"}}return sp(t)&&t.identifier&&!t.indexSectionName?{...t,indexSectionName:t.identifier}:t}),Fc=e=>e&&vy(e),gy=e=>{const{sections:t=hy,zeroStateSections:n,cioJsClientOptions:r,advancedParameters:i}=e,o=B.useMemo(()=>Fc(t),[JSON.stringify(t)]),u=B.useMemo(()=>Fc(n),[JSON.stringify(n)]),s=B.useMemo(()=>r,[JSON.stringify(r)]),a=B.useMemo(()=>i,[JSON.stringify(i)]);return{sections:o,zeroStateSections:u,cioJsClientOptions:s,advancedParameters:a}},my=e=>{const{sections:t,zeroStateSections:n,cioJsClientOptions:r,advancedParameters:i}=gy(e),{onSubmit:o,onChange:u,openOnFocus:s,apiKey:a,cioJsClient:d,placeholder:m="What can we help you find today?",autocompleteClassName:y="cio-autocomplete",defaultInput:k,getSearchResultsUrl:_,...w}=e,[l,p]=B.useState(k||""),f=ny(l),c=nm({apiKey:a,cioJsClient:d,cioJsClientOptions:r}),{fetchRecommendationResults:h,activeSections:E,activeSectionsWithData:x,zeroStateActiveSections:S,request:v,totalNumResultsPerSection:g}=dy(l,c,t,n,i),I=B.useMemo(()=>lp(v),[v]),C=B.useMemo(()=>em(x),[x]),{isOpen:O,getMenuProps:N,getLabelProps:P,openMenu:q,closeMenu:F,highlightedIndex:j,getInputProps:T,getItemProps:R}=ty({setQuery:p,items:C,onSubmit:o,cioClient:c,previousQuery:f,...w});return ry(t,E),py(O,x,c,Zg),{query:l,sections:x,totalNumResultsPerSection:g,request:v,featureToggles:I,isOpen:O&&(C==null?void 0:C.length)>0,getMenuProps:()=>({...N(),className:"cio-results","data-testid":"cio-results","data-cnstrc-autosuggest":""}),getLabelProps:P,openMenu:q,closeMenu:F,getItemProps:A=>{var Q;const{index:D,sectionId:M}=Qg({item:A,items:C}),L=`cio-item-${M==null?void 0:M.replace(" ","")}`;return{...R({item:A,index:D}),className:`cio-item ${L}`,"data-testid":L,"data-cnstrc-item-section":A.section,"data-cnstrc-item-group":A.groupId,"data-cnstrc-item-name":A.value,"data-cnstrc-item-id":(Q=A.data)==null?void 0:Q.id}},getInputProps:()=>({...T({onChange:A=>{p(A.target.value),u&&u(A.target.value)}}),value:l,onFocus:()=>{var A;e.onFocus&&e.onFocus(),S&&s!==!1&&I.featureDisplayZeroStateRecommendations&&q(),l!=null&&l.length&&q();try{i!=null&&i.fetchZeroStateOnFocus&&h(),(A=c==null?void 0:c.tracker)==null||A.trackInputFocus()}catch(D){console.log(D)}},className:"cio-input","data-testid":"cio-input","data-cnstrc-search-input":"",placeholder:m,onKeyDownCapture:({code:A,key:D,nativeEvent:M})=>{const L=A==="Enter"||D==="Enter",Q=A==="Home"||D==="Home",Y=A==="End"||D==="End",V=j<0;if(O&&L&&V&&(l!=null&&l.length)){o&&o({query:l});try{Os(c,l,{originalQuery:l})}catch(J){console.log(J)}}(Q||Y)&&(M.preventDownshiftDefault=!0)}}),getFormProps:()=>({onSubmit:A=>{A.preventDefault(),o&&o({query:l});try{Os(c,l,{originalQuery:l})}catch(D){console.log(D)}return{query:l}},className:"cio-form","data-testid":"cio-form","data-cnstrc-search-form":""}),getSectionProps:A=>{var Q,Y;const D=()=>{const{type:V}=A;let J;const H=V!=="custom"&&A.indexSectionName?Ns(A.indexSectionName):"";switch(V){case"recommendations":J=A.podId;break;case"autocomplete":J=A.displayName||A.indexSectionName;break;case"custom":J=A.displayName;break;default:J=A.displayName||A.indexSectionName;break}return`${J} ${H}`},L={className:`cio-section cio-section-${Pc(A)?"custom":Ns(A.indexSectionName||((Q=A.data[0])==null?void 0:Q.section)||"Products")} ${D()}`,ref:A.ref,role:"none","data-cnstrc-section":(Y=A.data[0])==null?void 0:Y.section};return Pc(A)&&(L["data-cnstrc-custom-section"]=!0,L["data-cnstrc-custom-section-name"]=A.displayName),Yn(A)&&(L["data-cnstrc-recommendations"]=!0,L["data-cnstrc-recommendations-pod-id"]=A.podId),L},setQuery:p,cioClient:c,autocompleteClassName:y,selectedItem:C[j],advancedParameters:i,getSearchResultsUrl:_}},Xn=B.createContext({});function Uc(e){const{children:t,...n}=e,r=my(n);return G.createElement(Xn.Provider,{value:r},G.createElement("div",{className:r.autocompleteClassName},t))}function ji({item:e,query:t,highlightSearchTerm:n}){const r=up(e)?e.groupName:e.value;if(n){const i=new RegExp(`(${Xg(t)})`,"gi"),o=i.test(r);if(t&&o){const u=r.split(i);return G.createElement(G.Fragment,null,u.map((s,a)=>i.test(s)?G.createElement("b",{key:`matched-word-${a}`},s):s))}}return G.createElement(G.Fragment,null,r)}function Bc(e){var m,y,k,_;const{item:t,displaySearchTermHighlights:n}=e,{advancedParameters:r,query:i,featureToggles:o}=B.useContext(Xn),{featureDisplaySearchSuggestionImages:u,featureDisplaySearchSuggestionResultCounts:s}=o,{displaySearchSuggestionImages:a=u,displaySearchSuggestionResultCounts:d=s}=r||{};return G.createElement(G.Fragment,null,a&&((m=t.data)==null?void 0:m.image_url)&&G.createElement("img",{src:(y=t.data)==null?void 0:y.image_url,alt:t.value,className:"cio-suggestion-image"}),G.createElement("p",{className:"cio-suggestion-text"},G.createElement(ji,{item:t,query:i,highlightSearchTerm:n})),d&&((k=t.data)==null?void 0:k.total_num_results)&&G.createElement("p",{className:"cio-suggestion-count"},"(",(_=t.data)==null?void 0:_.total_num_results,")"))}function yy(e){var m,y;const{item:t,children:n,displaySearchTermHighlights:r}=e,{getItemProps:i,advancedParameters:o,query:u,getSearchResultsUrl:s}=B.useContext(Xn),{translations:a}=o||{};let d;return Kg(t)?d=G.createElement("a",{href:(m=t.data)==null?void 0:m.url},G.createElement("img",{"data-testid":"cio-img",src:(y=t.data)==null?void 0:y.image_url,alt:t.value,className:"cio-product-image"}),G.createElement("p",{"data-testid":"cio-text",className:"cio-product-text"},G.createElement(ji,{item:t,query:u,highlightSearchTerm:r}))):up(t)?d=G.createElement("p",{className:"cio-term-in-group"},ap("in",a)," ",G.createElement(ji,{item:t,query:u,highlightSearchTerm:r})):Wg(t)?s?d=G.createElement("a",{className:"suggestion-link",href:s(t)},G.createElement(Bc,{item:t,displaySearchTermHighlights:r})):d=G.createElement(Bc,{item:t,displaySearchTermHighlights:r}):d=G.createElement("p",{className:"cio-custom-text"},G.createElement(ji,{item:t,query:u,highlightSearchTerm:r})),G.createElement("li",{...i(t)},n||d)}const wy=function({section:e}){var k,_;const{getSectionProps:t,query:n,getFormProps:r,advancedParameters:i,getItemProps:o}=B.useContext(Xn),{displayShowAllResultsButton:u,translations:s}=i||{},{onSubmit:a}=r(),{type:d,displayName:m}=e;let y=m;if(!y)switch(d){case"recommendations":y=e.podId;break;case"autocomplete":y=e.indexSectionName;break;case"custom":y=e.displayName;break;default:y=e.indexSectionName;break}return(k=e==null?void 0:e.data)!=null&&k.length?G.createElement("li",{...t(e)},G.createElement("h5",{className:"cio-section-name cio-sectionName","aria-hidden":!0},$g(y)),G.createElement("ul",{className:"cio-section-items",role:"none"},(_=e==null?void 0:e.data)==null?void 0:_.map(w=>typeof(e==null?void 0:e.renderItem)=="function"?e.renderItem({item:w,query:n,getItemProps:o}):G.createElement(yy,{item:w,key:w==null?void 0:w.id,displaySearchTermHighlights:e.displaySearchTermHighlights}))),u&&d==="autocomplete"&&e.indexSectionName==="Products"&&G.createElement("div",{className:"cio-section-footer"},G.createElement("button",{"data-cnstrc-search-submit-btn":!0,className:"cio-show-all-results-button",type:"button",onClick:a},ap("show all results",s)))):null};function _y(e){const{section:t,children:n=wy}=e;return n({section:t})}function Sy(e){return G.createElement("svg",{...e,className:"cio-close",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"122.878px",height:"122.88px",viewBox:"0 0 122.878 122.88",enableBackground:"new 0 0 122.878 122.88",xmlSpace:"preserve"},G.createElement("g",null,G.createElement("path",{d:"M1.426,8.313c-1.901-1.901-1.901-4.984,0-6.886c1.901-1.902,4.984-1.902,6.886,0l53.127,53.127l53.127-53.127 c1.901-1.902,4.984-1.902,6.887,0c1.901,1.901,1.901,4.985,0,6.886L68.324,61.439l53.128,53.128c1.901,1.901,1.901,4.984,0,6.886 c-1.902,1.902-4.985,1.902-6.887,0L61.438,68.326L8.312,121.453c-1.901,1.902-4.984,1.902-6.886,0 c-1.901-1.901-1.901-4.984,0-6.886l53.127-53.128L1.426,8.313L1.426,8.313z"})))}const ky=({sections:e})=>e==null?void 0:e.map(t=>{const{type:n}=t;let r=t.displayName;switch(n){case"recommendations":r=t.podId;break;case"custom":r=Ns(t.displayName);break;case"autocomplete":r=t.indexSectionName;break;default:r=t.indexSectionName;break}return G.createElement(_y,{section:t,key:r})});function Ey(e){const{children:t=ky}=e,{sections:n,isOpen:r,getMenuProps:i,getItemProps:o,closeMenu:u}=B.useContext(Xn),s=n&&n.some(m=>{var y;return(y=m==null?void 0:m.data)==null?void 0:y.length}),a={...i()};let d;return r&&s?d=G.createElement(G.Fragment,null,G.createElement(Sy,{onClick:()=>u()}),typeof t=="function"?t({sections:n,getItemProps:o}):t):(d=null,a.style={display:"none"}),G.createElement("ul",{...a},d)}function Cy({getFormProps:e,getInputProps:t,getLabelProps:n,setQuery:r}){const i=t();return G.createElement("form",{...e()},G.createElement("label",{...n(),htmlFor:"cio-input"},G.createElement("input",{id:"cio-input",...i,enterKeyHint:"search"})),G.createElement("button",{className:"cio-clear-btn","data-testid":"cio-clear-btn",hidden:!i.value,onClick:()=>{r(""),i.id&&setTimeout(()=>{var o;return(o=document.getElementById(i.id))==null?void 0:o.focus()},100)},type:"button","aria-label":"Clear search field text"},G.createElement("div",{className:"cio-icon"},G.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 512 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},G.createElement("path",{d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})))),G.createElement("button",{className:"cio-submit-btn","data-testid":"cio-submit-btn",disabled:!i.value,"data-cnstrc-search-submit-btn":!0,type:"submit","aria-label":"Submit Search"},G.createElement("div",{className:"cio-icon"},G.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 512 512",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},G.createElement("path",{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"})))))}function xy(e){const{children:t=Cy}=e,{getFormProps:n,getInputProps:r,getLabelProps:i,setQuery:o}=B.useContext(Xn);return t({getFormProps:n,getInputProps:r,getLabelProps:i,setQuery:o})}function Iy(e){const{children:t}=e;return t?G.createElement(Uc,{...e},t):G.createElement("div",null,G.createElement(Uc,{...e},G.createElement(xy,null),G.createElement(Ey,null)))}const Ry=({selector:e,includeCSS:t=!0,...n})=>{if(document){const r=document.getElementById("cio-autocomplete-styles"),i=document.querySelector(e);if(!i){console.error("CioAutocomplete: There were no elements found for the provided selector");return}r&&(t?r.disabled=!1:r.disabled=!0),zu.createRoot(i).render(G.createElement(G.StrictMode,null,G.createElement(Iy,{...n})))}};window&&(window.CioAutocomplete=Ry);export{Ry as default};
|
|
@@ -7,7 +7,7 @@ function DefaultRenderInput({ getFormProps, getInputProps, getLabelProps, setQue
|
|
|
7
7
|
const inputProps = getInputProps();
|
|
8
8
|
return (react_1.default.createElement("form", Object.assign({}, getFormProps()),
|
|
9
9
|
react_1.default.createElement("label", Object.assign({}, getLabelProps(), { htmlFor: 'cio-input' }),
|
|
10
|
-
react_1.default.createElement("input", Object.assign({ id: 'cio-input' }, inputProps))),
|
|
10
|
+
react_1.default.createElement("input", Object.assign({ id: 'cio-input' }, inputProps, { enterKeyHint: 'search' }))),
|
|
11
11
|
react_1.default.createElement("button", { className: 'cio-clear-btn', "data-testid": 'cio-clear-btn', hidden: !inputProps.value, onClick: () => {
|
|
12
12
|
setQuery('');
|
|
13
13
|
if (inputProps.id) {
|
package/lib/cjs/constants.js
CHANGED
|
@@ -68,6 +68,7 @@ exports.sectionsDescription = `- by default, typing a query will fetch data for
|
|
|
68
68
|
- the order of the objects in the \`sections\` array determines the order of the results
|
|
69
69
|
- each autocomplete section object must have a \`indexSectionName\`
|
|
70
70
|
- each recommendation section object must have a \`podId\`
|
|
71
|
+
- passing displayName in the sectionConfiguration will override the displayName set by Merchandisers on the Customer Dashboard for the recommendation section
|
|
71
72
|
- each custom section object must have a \`displayName\`
|
|
72
73
|
- each section object can specify a \`type\`
|
|
73
74
|
- each section object can override the default \`numResults\` of 8
|
|
@@ -106,6 +107,7 @@ exports.zeroStateDescription = `- when the text input field has no text, we call
|
|
|
106
107
|
- the order of the objects in the \`zeroStateSections\` array determines the order of the results
|
|
107
108
|
- each autocomplete section object must have a \`indexSectionName\`
|
|
108
109
|
- each recommendation section object must have a \`podId\`
|
|
110
|
+
- passing displayName in the sectionConfiguration will override the displayName set by Merchandisers on the Customer Dashboard for the recommendation section
|
|
109
111
|
- each custom section object must have a \`displayName\`
|
|
110
112
|
- each section object can specify a \`type\`
|
|
111
113
|
- each section object can override the default \`numResults\` of 8`;
|
|
@@ -25,7 +25,7 @@ function useSections(query, cioClient, sections, zeroStateSections, advancedPara
|
|
|
25
25
|
// Combine recommendations and autocomplete results in sectionsResults
|
|
26
26
|
const sectionsResults = (0, react_1.useMemo)(() => (Object.assign(Object.assign({}, autocomplete.results), recommendations.results)), [autocomplete.results, recommendations.results]);
|
|
27
27
|
// Return current active sections populated with data from the API response sectionsResults
|
|
28
|
-
const activeSectionsWithData = (0, useActiveSectionsWithData_1.default)(sectionsResults, activeSections, sectionsRefs, query);
|
|
28
|
+
const activeSectionsWithData = (0, useActiveSectionsWithData_1.default)(sectionsResults, activeSections, sectionsRefs, query, recommendations.podsData);
|
|
29
29
|
return {
|
|
30
30
|
fetchRecommendationResults: recommendations.fetchRecommendationResults,
|
|
31
31
|
activeSections,
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable max-params */
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const utils_1 = require("../../utils");
|
|
5
|
-
function useActiveSectionsWithData(sectionsResults, activeSections, sectionsRefs, query) {
|
|
6
|
+
function useActiveSectionsWithData(sectionsResults, activeSections, sectionsRefs, query, podsData) {
|
|
6
7
|
const [activeSectionsWithData, setActiveSectionsWithData] = (0, react_1.useState)([]);
|
|
7
8
|
// Add to active sections the results data and refs when autocomplete results or recommendation results fetched
|
|
8
9
|
(0, react_1.useEffect)(() => {
|
|
9
|
-
const activeSectionsWithDataValue = (0, utils_1.getActiveSectionsWithData)(activeSections, sectionsResults, sectionsRefs);
|
|
10
|
+
const activeSectionsWithDataValue = (0, utils_1.getActiveSectionsWithData)(activeSections, sectionsResults, sectionsRefs, podsData);
|
|
10
11
|
if (activeSectionsWithDataValue.length || !query) {
|
|
11
12
|
setActiveSectionsWithData(activeSectionsWithDataValue);
|
|
12
13
|
}
|
|
13
|
-
}, [activeSections, sectionsResults, sectionsRefs, query]);
|
|
14
|
+
}, [activeSections, sectionsResults, sectionsRefs, query, podsData]);
|
|
14
15
|
return activeSectionsWithData;
|
|
15
16
|
}
|
|
16
17
|
exports.default = useActiveSectionsWithData;
|
package/lib/cjs/utils.js
CHANGED
|
@@ -144,7 +144,7 @@ const getCioClient = (apiKey, cioJsClientOptions) => {
|
|
|
144
144
|
return null;
|
|
145
145
|
};
|
|
146
146
|
exports.getCioClient = getCioClient;
|
|
147
|
-
const getActiveSectionsWithData = (activeSections, sectionsResults, sectionsRefs) => {
|
|
147
|
+
const getActiveSectionsWithData = (activeSections, sectionsResults, sectionsRefs, podsData) => {
|
|
148
148
|
const activeSectionsWithData = [];
|
|
149
149
|
const getSectionData = (sectionConfig) => {
|
|
150
150
|
const { type } = sectionConfig;
|
|
@@ -170,6 +170,10 @@ const getActiveSectionsWithData = (activeSections, sectionsResults, sectionsRefs
|
|
|
170
170
|
const sectionData = getSectionData(sectionConfig);
|
|
171
171
|
if (Array.isArray(sectionData)) {
|
|
172
172
|
const section = Object.assign(Object.assign({}, sectionConfig), { data: sectionData });
|
|
173
|
+
if (sectionConfig.type === 'recommendations') {
|
|
174
|
+
section.displayName =
|
|
175
|
+
sectionConfig.displayName || podsData[sectionConfig.podId].displayName;
|
|
176
|
+
}
|
|
173
177
|
// If ref passed as part of `SectionConfiguration`, use it.
|
|
174
178
|
// Otherwise, use the ref from our library generated refs array
|
|
175
179
|
const userDefinedSectionRef = sectionConfig.ref;
|
package/lib/cjs/version.js
CHANGED
|
@@ -4,7 +4,7 @@ function DefaultRenderInput({ getFormProps, getInputProps, getLabelProps, setQue
|
|
|
4
4
|
const inputProps = getInputProps();
|
|
5
5
|
return (React.createElement("form", { ...getFormProps() },
|
|
6
6
|
React.createElement("label", { ...getLabelProps(), htmlFor: 'cio-input' },
|
|
7
|
-
React.createElement("input", { id: 'cio-input', ...inputProps })),
|
|
7
|
+
React.createElement("input", { id: 'cio-input', ...inputProps, enterKeyHint: 'search' })),
|
|
8
8
|
React.createElement("button", { className: 'cio-clear-btn', "data-testid": 'cio-clear-btn', hidden: !inputProps.value, onClick: () => {
|
|
9
9
|
setQuery('');
|
|
10
10
|
if (inputProps.id) {
|
package/lib/mjs/constants.js
CHANGED
|
@@ -65,6 +65,7 @@ export const sectionsDescription = `- by default, typing a query will fetch data
|
|
|
65
65
|
- the order of the objects in the \`sections\` array determines the order of the results
|
|
66
66
|
- each autocomplete section object must have a \`indexSectionName\`
|
|
67
67
|
- each recommendation section object must have a \`podId\`
|
|
68
|
+
- passing displayName in the sectionConfiguration will override the displayName set by Merchandisers on the Customer Dashboard for the recommendation section
|
|
68
69
|
- each custom section object must have a \`displayName\`
|
|
69
70
|
- each section object can specify a \`type\`
|
|
70
71
|
- each section object can override the default \`numResults\` of 8
|
|
@@ -103,6 +104,7 @@ export const zeroStateDescription = `- when the text input field has no text, we
|
|
|
103
104
|
- the order of the objects in the \`zeroStateSections\` array determines the order of the results
|
|
104
105
|
- each autocomplete section object must have a \`indexSectionName\`
|
|
105
106
|
- each recommendation section object must have a \`podId\`
|
|
107
|
+
- passing displayName in the sectionConfiguration will override the displayName set by Merchandisers on the Customer Dashboard for the recommendation section
|
|
106
108
|
- each custom section object must have a \`displayName\`
|
|
107
109
|
- each section object can specify a \`type\`
|
|
108
110
|
- each section object can override the default \`numResults\` of 8`;
|
|
@@ -22,7 +22,7 @@ export default function useSections(query, cioClient, sections, zeroStateSection
|
|
|
22
22
|
// Combine recommendations and autocomplete results in sectionsResults
|
|
23
23
|
const sectionsResults = useMemo(() => ({ ...autocomplete.results, ...recommendations.results }), [autocomplete.results, recommendations.results]);
|
|
24
24
|
// Return current active sections populated with data from the API response sectionsResults
|
|
25
|
-
const activeSectionsWithData = useActiveSectionsWithData(sectionsResults, activeSections, sectionsRefs, query);
|
|
25
|
+
const activeSectionsWithData = useActiveSectionsWithData(sectionsResults, activeSections, sectionsRefs, query, recommendations.podsData);
|
|
26
26
|
return {
|
|
27
27
|
fetchRecommendationResults: recommendations.fetchRecommendationResults,
|
|
28
28
|
activeSections,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
/* eslint-disable max-params */
|
|
1
2
|
import { useEffect, useState } from 'react';
|
|
2
3
|
import { getActiveSectionsWithData } from '../../utils';
|
|
3
|
-
export default function useActiveSectionsWithData(sectionsResults, activeSections, sectionsRefs, query) {
|
|
4
|
+
export default function useActiveSectionsWithData(sectionsResults, activeSections, sectionsRefs, query, podsData) {
|
|
4
5
|
const [activeSectionsWithData, setActiveSectionsWithData] = useState([]);
|
|
5
6
|
// Add to active sections the results data and refs when autocomplete results or recommendation results fetched
|
|
6
7
|
useEffect(() => {
|
|
7
|
-
const activeSectionsWithDataValue = getActiveSectionsWithData(activeSections, sectionsResults, sectionsRefs);
|
|
8
|
+
const activeSectionsWithDataValue = getActiveSectionsWithData(activeSections, sectionsResults, sectionsRefs, podsData);
|
|
8
9
|
if (activeSectionsWithDataValue.length || !query) {
|
|
9
10
|
setActiveSectionsWithData(activeSectionsWithDataValue);
|
|
10
11
|
}
|
|
11
|
-
}, [activeSections, sectionsResults, sectionsRefs, query]);
|
|
12
|
+
}, [activeSections, sectionsResults, sectionsRefs, query, podsData]);
|
|
12
13
|
return activeSectionsWithData;
|
|
13
14
|
}
|
package/lib/mjs/utils.js
CHANGED
|
@@ -130,7 +130,7 @@ export const getCioClient = (apiKey, cioJsClientOptions) => {
|
|
|
130
130
|
}
|
|
131
131
|
return null;
|
|
132
132
|
};
|
|
133
|
-
export const getActiveSectionsWithData = (activeSections, sectionsResults, sectionsRefs) => {
|
|
133
|
+
export const getActiveSectionsWithData = (activeSections, sectionsResults, sectionsRefs, podsData) => {
|
|
134
134
|
const activeSectionsWithData = [];
|
|
135
135
|
const getSectionData = (sectionConfig) => {
|
|
136
136
|
const { type } = sectionConfig;
|
|
@@ -159,6 +159,10 @@ export const getActiveSectionsWithData = (activeSections, sectionsResults, secti
|
|
|
159
159
|
...sectionConfig,
|
|
160
160
|
data: sectionData,
|
|
161
161
|
};
|
|
162
|
+
if (sectionConfig.type === 'recommendations') {
|
|
163
|
+
section.displayName =
|
|
164
|
+
sectionConfig.displayName || podsData[sectionConfig.podId].displayName;
|
|
165
|
+
}
|
|
162
166
|
// If ref passed as part of `SectionConfiguration`, use it.
|
|
163
167
|
// Otherwise, use the ref from our library generated refs array
|
|
164
168
|
const userDefinedSectionRef = sectionConfig.ref;
|
package/lib/mjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.23.
|
|
1
|
+
export default '1.23.23';
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { AutocompleteSubmitEvent } from './types';
|
|
|
2
2
|
export declare const apiKey = "key_M57QS8SMPdLdLx4x";
|
|
3
3
|
export declare const componentDescription = "- import `CioAutocomplete` to render in your JSX.\n- This component handles state management, data fetching, and rendering logic.\n- To use this component, an `apiKey` or `cioJsClient` are required, and an `onSubmit` callback must be passed. All other values are optional.\n- Use different props to configure the behavior of this component.\n- The following stories shows how different props affect the component's behavior\n\n> Note: when we say `cioJsClient`, we are referring to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)\n";
|
|
4
4
|
export declare const hookDescription = "- import `useCioAutocomplete` and call this custom hook in a functional component.\n- This hook leaves rendering logic up to you, while handling:\n - state management\n - data fetching\n - keyboard navigation\n - mouse interactions\n - focus and submit event handling\n - accessibility\n- To use this hook, an `apiKey` or `cioJsClient` are required, and an `onSubmit` callback must be passed to the `useCioAutocomplete` hook to configure behavior. All other values are optional.\n- use the <a href=\"https://kentcdodds.com/blog/how-to-give-rendering-control-to-users-with-prop-getters\" target=\"__blank\">prop getters</a> and other variables returned by this hook (below) to leverage the functionality described above with jsx elements in your react component definitions\n\n> **Important: Please note that all of the select or submit events should go through the `onSubmit` callback. The `getItemProps` hook returns click and keyboard handlers which should be applied to the elements using the spread operator (see code examples below). Adding an `onClick` event manually to the elements would override the default behavior of the library preventing it from sending tracking events and would cause different behavior between click and keyboard events. Selecting an item or submitting the search would both cause `onSubmit` to be called. **\n\nCalling the `useCioAutocomplete` hook returns an object with the following keys:\n\n```jsx\nconst {\n // must be used for a hooks integrations\n query: string, // current input field value\n sections: [{...}], // array of sections data to render in menu list\n totalNumResultsPerSection: {\n \"Products\": number,\n \"Search Suggestions\": number,\n ...\n }, // total number of product and search suggestion results (and other sections)\n getFormProps: () => ({...})), // prop getter for jsx form element\n getInputProps: () => ({...})), // prop getter for jsx input element\n getMenuProps: () => ({...})), // prop getter for jsx element rendering the results container\n getItemProps: (item) => ({...})), // prop getter for jsx element rendering each result\n getSectionProps: (section: Section) => ({...})), // prop getter for jsx element rendering each section.\n\n // available for use, but not required for all use cases\n selectedItem: item, // undefined or current selected item (via hover or arrow keys)\n isOpen: boolean, // current state of the menu list\n openMenu: () => void, // open menu\n closeMenu: () => void, // close menu\n setQuery: () => void, // update the current input field value\n getLabelProps: () => ({...})), // prop getter for a jsx label element\n cioJsClient, // instance of constructorio-client-javascript\n } = useCioAutocomplete(args);\n```\n\n> Note: when we say `cioJsClient`, we are referring to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)\n\nThe following stories show how different options affect the hook's behavior!\n";
|
|
5
|
-
export declare const sectionsDescription = "- by default, typing a query will fetch data for Search Suggestions and Products\n- to override this, pass an array of sections objects\n- the order of the objects in the `sections` array determines the order of the results\n- each autocomplete section object must have a `indexSectionName`\n- each recommendation section object must have a `podId`\n- each custom section object must have a `displayName`\n- each section object can specify a `type`\n- each section object can override the default `numResults` of 8\n\n`indexSectionName` refers to a section under an index. The default sections are \"Products\" and \"Search Suggestions\". You can find all the sections that exist in your index under the \"Indexes\" tab of Constructor dashboard.\n\nWhen no values are passed for the `sections` argument, the following defaults are used:\n\n```jsx\n[\n {\n indexSectionName: 'Search Suggestions',\n type: 'autocomplete',\n numResults: 8\n },\n {\n indexSectionName: 'Products',\n type: 'autocomplete',\n numResults: 8\n }\n]\n```\n";
|
|
5
|
+
export declare const sectionsDescription = "- by default, typing a query will fetch data for Search Suggestions and Products\n- to override this, pass an array of sections objects\n- the order of the objects in the `sections` array determines the order of the results\n- each autocomplete section object must have a `indexSectionName`\n- each recommendation section object must have a `podId`\n- passing displayName in the sectionConfiguration will override the displayName set by Merchandisers on the Customer Dashboard for the recommendation section\n- each custom section object must have a `displayName`\n- each section object can specify a `type`\n- each section object can override the default `numResults` of 8\n\n`indexSectionName` refers to a section under an index. The default sections are \"Products\" and \"Search Suggestions\". You can find all the sections that exist in your index under the \"Indexes\" tab of Constructor dashboard.\n\nWhen no values are passed for the `sections` argument, the following defaults are used:\n\n```jsx\n[\n {\n indexSectionName: 'Search Suggestions',\n type: 'autocomplete',\n numResults: 8\n },\n {\n indexSectionName: 'Products',\n type: 'autocomplete',\n numResults: 8\n }\n]\n```\n";
|
|
6
6
|
export declare const userEventsDescription = "- pass callback functions to respond to user events\n- if provided, the onFocus callback function will be called each time the user focuses on the text input field\n- if provided, the onChange callback function will be called each time the user changes the value in the text input field\n- the onSubmit callback function will be called each time the user submits the form\n- the user can submit the form by pressing the enter key in the text input field, clicking a submit button within the form, clicking on a result, or pressing enter while a result is selected\n\n> \u26A0\uFE0F NOTE \u26A0\uFE0F Use the Storybook Canvas Actions tab to explore the behavior of all of these `OnEvent` callback functions as you interact with our Default User Events example rendered in the Canvas. In the stories below, Storybook Canvas Actions have been disabled to focus on each of these callback functions in isolation. Each of the example callback functions in the stories below log output to the console tab of the browser's developer tools.";
|
|
7
|
-
export declare const zeroStateDescription = "- when the text input field has no text, we call this zero state\n- by default, the autocomplete shows nothing in the menu it's for zero state\n- to show zero state results, pass an array of section objects for `zeroStateSections`\n- when `zeroStateSections` has sections, the menu will open on user focus by default\n- set `openOnFocus` to false, to only show `zeroStateSections` after user has typed and then cleared the text input, instead of as soon as the user focuses on the text input\n- the order of the objects in the `zeroStateSections` array determines the order of the results\n- each autocomplete section object must have a `indexSectionName`\n- each recommendation section object must have a `podId`\n- each custom section object must have a `displayName`\n- each section object can specify a `type`\n- each section object can override the default `numResults` of 8";
|
|
7
|
+
export declare const zeroStateDescription = "- when the text input field has no text, we call this zero state\n- by default, the autocomplete shows nothing in the menu it's for zero state\n- to show zero state results, pass an array of section objects for `zeroStateSections`\n- when `zeroStateSections` has sections, the menu will open on user focus by default\n- set `openOnFocus` to false, to only show `zeroStateSections` after user has typed and then cleared the text input, instead of as soon as the user focuses on the text input\n- the order of the objects in the `zeroStateSections` array determines the order of the results\n- each autocomplete section object must have a `indexSectionName`\n- each recommendation section object must have a `podId`\n- passing displayName in the sectionConfiguration will override the displayName set by Merchandisers on the Customer Dashboard for the recommendation section\n- each custom section object must have a `displayName`\n- each section object can specify a `type`\n- each section object can override the default `numResults` of 8";
|
|
8
8
|
export declare const fullFeaturedAndStyledExampleDescription = "Using the default options, the library displays clean and minimal visual elements, with the intent of making it easy for consumers to easily extend and customize the styles to suit unique needs. The example below shows a full featured and styled example to demonstrate what is possible using Constructor.io's advanced Autocomplete UI library.";
|
|
9
9
|
export declare const apiKeyDescription = "Pass an `apiKey` to request results from constructor's servers";
|
|
10
10
|
export declare const cioJsClientDescription = "If you are already using an instance of the `ConstructorIOClient`, you can pass a `cioJsClient` instead of an `apiKey` to request results from constructor's servers\n\n> Note: when we say `cioJsClient`, we are referring to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
import { UserDefinedSection, Section, SectionsData } from '../../types';
|
|
3
|
-
export default function useActiveSectionsWithData(sectionsResults: SectionsData, activeSections: UserDefinedSection[], sectionsRefs: React.MutableRefObject<RefObject<HTMLLIElement>[]>, query: string): Section[];
|
|
2
|
+
import { UserDefinedSection, Section, SectionsData, PodData } from '../../types';
|
|
3
|
+
export default function useActiveSectionsWithData(sectionsResults: SectionsData, activeSections: UserDefinedSection[], sectionsRefs: React.MutableRefObject<RefObject<HTMLLIElement>[]>, query: string, podsData: Record<string, PodData>): Section[];
|
package/lib/types/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ConstructorIOClient from '@constructor-io/constructorio-client-javascript';
|
|
2
2
|
import { AutocompleteRequestType, Nullable, ConstructorClientOptions } from '@constructor-io/constructorio-client-javascript/lib/types';
|
|
3
|
-
import { Item, Section, UserDefinedSection, SectionsData, Translations } from './types';
|
|
3
|
+
import { Item, Section, UserDefinedSection, SectionsData, Translations, PodData } from './types';
|
|
4
4
|
export type GetItemPosition = (args: {
|
|
5
5
|
item: Item;
|
|
6
6
|
items: Item[];
|
|
@@ -37,7 +37,7 @@ export declare const functionStrings: {
|
|
|
37
37
|
export declare const stringifyWithDefaults: (obj: any) => string;
|
|
38
38
|
export declare const disableStoryActions: (story: any) => void;
|
|
39
39
|
export declare const getCioClient: (apiKey?: string, cioJsClientOptions?: ConstructorClientOptions) => ConstructorIOClient | null;
|
|
40
|
-
export declare const getActiveSectionsWithData: (activeSections: UserDefinedSection[], sectionsResults: SectionsData, sectionsRefs: React.MutableRefObject<React.RefObject<HTMLLIElement>[]>) => Section[];
|
|
40
|
+
export declare const getActiveSectionsWithData: (activeSections: UserDefinedSection[], sectionsResults: SectionsData, sectionsRefs: React.MutableRefObject<React.RefObject<HTMLLIElement>[]>, podsData: Record<string, PodData>) => Section[];
|
|
41
41
|
export declare const escapeRegExp: (string: string) => string;
|
|
42
42
|
export declare const trackRecommendationView: (target: HTMLElement, activeSectionsWithData: Section[], cioClient: Nullable<ConstructorIOClient>) => void;
|
|
43
43
|
export declare const getItemsForActiveSections: (activeSectionsWithData: Section[]) => Item[];
|
package/lib/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.23.
|
|
1
|
+
declare const _default: "1.23.23";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED