@searchstax-inc/searchstudio-ux-react 0.0.3 → 0.0.6

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.
@@ -0,0 +1,4 @@
1
+ import SearchstaxInputWidget from "./components/SearchstaxInputWidget";
2
+ import SearchstaxWrapper from "./components/SearchstaxWrapper";
3
+ import SearchstaxResultWidget from "./components/SearchstaxResultWidget";
4
+ export { SearchstaxWrapper, SearchstaxResultWidget, SearchstaxInputWidget };
@@ -0,0 +1,4 @@
1
+ import SearchstaxInputWidget from "./components/SearchstaxInputWidget";
2
+ import SearchstaxWrapper from "./components/SearchstaxWrapper";
3
+ import SearchstaxResultWidget from "./components/SearchstaxResultWidget";
4
+ export { SearchstaxWrapper, SearchstaxResultWidget, SearchstaxInputWidget };
@@ -1,4 +1,4 @@
1
- (function(V,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],j):(V=typeof globalThis<"u"?globalThis:V||self,j(V.searchstudioUxReactTs={},V.React))})(this,function(V,j){"use strict";var d={},ze={get exports(){return d},set exports(r){d=r}},z={};/**
1
+ (function(se,D){"use strict";var d={},ze={get exports(){return d},set exports(r){d=r}},$={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var xe;function Ge(){if(xe)return z;xe=1;var r=j,e=Symbol.for("react.element"),s=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function u(l,h,p){var C,A={},L=null,U=null;p!==void 0&&(L=""+p),h.key!==void 0&&(L=""+h.key),h.ref!==void 0&&(U=h.ref);for(C in h)n.call(h,C)&&!i.hasOwnProperty(C)&&(A[C]=h[C]);if(l&&l.defaultProps)for(C in h=l.defaultProps,h)A[C]===void 0&&(A[C]=h[C]);return{$$typeof:e,type:l,key:L,ref:U,props:A,_owner:a.current}}return z.Fragment=s,z.jsx=u,z.jsxs=u,z}var G={};/**
9
+ */var xe;function Ge(){if(xe)return $;xe=1;var r=D,e=Symbol.for("react.element"),s=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function u(l,h,p){var C,A={},L=null,B=null;p!==void 0&&(L=""+p),h.key!==void 0&&(L=""+h.key),h.ref!==void 0&&(B=h.ref);for(C in h)n.call(h,C)&&!i.hasOwnProperty(C)&&(A[C]=h[C]);if(l&&l.defaultProps)for(C in h=l.defaultProps,h)A[C]===void 0&&(A[C]=h[C]);return{$$typeof:e,type:l,key:L,ref:B,props:A,_owner:a.current}}return $.Fragment=s,$.jsx=u,$.jsxs=u,$}var z={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,23 +14,23 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Ce;function Je(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var r=j,e=Symbol.for("react.element"),s=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),U=Symbol.for("react.offscreen"),Z=Symbol.iterator,E="@@iterator";function P(t){if(t===null||typeof t!="object")return null;var o=Z&&t[Z]||t[E];return typeof o=="function"?o:null}var R=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(t){{for(var o=arguments.length,c=new Array(o>1?o-1:0),f=1;f<o;f++)c[f-1]=arguments[f];H("error",t,c)}}function H(t,o,c){{var f=R.ReactDebugCurrentFrame,b=f.getStackAddendum();b!==""&&(o+="%s",c=c.concat([b]));var x=c.map(function(m){return String(m)});x.unshift("Warning: "+o),Function.prototype.apply.call(console[t],console,x)}}var K=!1,F=!1,ee=!1,he=!1,O=!1,Ee;Ee=Symbol.for("react.module.reference");function kt(t){return!!(typeof t=="string"||typeof t=="function"||t===n||t===i||O||t===a||t===p||t===C||he||t===U||K||F||ee||typeof t=="object"&&t!==null&&(t.$$typeof===L||t.$$typeof===A||t.$$typeof===u||t.$$typeof===l||t.$$typeof===h||t.$$typeof===Ee||t.getModuleId!==void 0))}function Tt(t,o,c){var f=t.displayName;if(f)return f;var b=o.displayName||o.name||"";return b!==""?c+"("+b+")":c}function ke(t){return t.displayName||"Context"}function D(t){if(t==null)return null;if(typeof t.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case n:return"Fragment";case s:return"Portal";case i:return"Profiler";case a:return"StrictMode";case p:return"Suspense";case C:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case l:var o=t;return ke(o)+".Consumer";case u:var c=t;return ke(c._context)+".Provider";case h:return Tt(t,t.render,"ForwardRef");case A:var f=t.displayName||null;return f!==null?f:D(t.type)||"Memo";case L:{var b=t,x=b._payload,m=b._init;try{return D(m(x))}catch{return null}}}return null}var W=Object.assign,te=0,Te,Ie,Ae,we,Le,je,_e;function Oe(){}Oe.__reactDisabledLog=!0;function It(){{if(te===0){Te=console.log,Ie=console.info,Ae=console.warn,we=console.error,Le=console.group,je=console.groupCollapsed,_e=console.groupEnd;var t={configurable:!0,enumerable:!0,value:Oe,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}te++}}function At(){{if(te--,te===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},t,{value:Te}),info:W({},t,{value:Ie}),warn:W({},t,{value:Ae}),error:W({},t,{value:we}),group:W({},t,{value:Le}),groupCollapsed:W({},t,{value:je}),groupEnd:W({},t,{value:_e})})}te<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=R.ReactCurrentDispatcher,de;function re(t,o,c){{if(de===void 0)try{throw Error()}catch(b){var f=b.stack.trim().match(/\n( *(at )?)/);de=f&&f[1]||""}return`
18
- `+de+t}}var fe=!1,ae;{var wt=typeof WeakMap=="function"?WeakMap:Map;ae=new wt}function Pe(t,o){if(!t||fe)return"";{var c=ae.get(t);if(c!==void 0)return c}var f;fe=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var x;x=ge.current,ge.current=null,It();try{if(o){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(B){f=B}Reflect.construct(t,[],m)}else{try{m.call()}catch(B){f=B}t.call(m.prototype)}}else{try{throw Error()}catch(B){f=B}t()}}catch(B){if(B&&f&&typeof B.stack=="string"){for(var v=B.stack.split(`
17
+ */var Ce;function Je(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var r=D,e=Symbol.for("react.element"),s=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),Q=Symbol.iterator,E="@@iterator";function O(t){if(t===null||typeof t!="object")return null;var o=Q&&t[Q]||t[E];return typeof o=="function"?o:null}var R=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(t){{for(var o=arguments.length,c=new Array(o>1?o-1:0),f=1;f<o;f++)c[f-1]=arguments[f];U("error",t,c)}}function U(t,o,c){{var f=R.ReactDebugCurrentFrame,b=f.getStackAddendum();b!==""&&(o+="%s",c=c.concat([b]));var x=c.map(function(m){return String(m)});x.unshift("Warning: "+o),Function.prototype.apply.call(console[t],console,x)}}var q=!1,V=!1,Z=!1,he=!1,_=!1,Ee;Ee=Symbol.for("react.module.reference");function kt(t){return!!(typeof t=="string"||typeof t=="function"||t===n||t===i||_||t===a||t===p||t===C||he||t===B||q||V||Z||typeof t=="object"&&t!==null&&(t.$$typeof===L||t.$$typeof===A||t.$$typeof===u||t.$$typeof===l||t.$$typeof===h||t.$$typeof===Ee||t.getModuleId!==void 0))}function Tt(t,o,c){var f=t.displayName;if(f)return f;var b=o.displayName||o.name||"";return b!==""?c+"("+b+")":c}function ke(t){return t.displayName||"Context"}function M(t){if(t==null)return null;if(typeof t.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case n:return"Fragment";case s:return"Portal";case i:return"Profiler";case a:return"StrictMode";case p:return"Suspense";case C:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case l:var o=t;return ke(o)+".Consumer";case u:var c=t;return ke(c._context)+".Provider";case h:return Tt(t,t.render,"ForwardRef");case A:var f=t.displayName||null;return f!==null?f:M(t.type)||"Memo";case L:{var b=t,x=b._payload,m=b._init;try{return M(m(x))}catch{return null}}}return null}var H=Object.assign,ee=0,Te,Ie,Ae,we,Le,je,_e;function Oe(){}Oe.__reactDisabledLog=!0;function It(){{if(ee===0){Te=console.log,Ie=console.info,Ae=console.warn,we=console.error,Le=console.group,je=console.groupCollapsed,_e=console.groupEnd;var t={configurable:!0,enumerable:!0,value:Oe,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}ee++}}function At(){{if(ee--,ee===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},t,{value:Te}),info:H({},t,{value:Ie}),warn:H({},t,{value:Ae}),error:H({},t,{value:we}),group:H({},t,{value:Le}),groupCollapsed:H({},t,{value:je}),groupEnd:H({},t,{value:_e})})}ee<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=R.ReactCurrentDispatcher,de;function re(t,o,c){{if(de===void 0)try{throw Error()}catch(b){var f=b.stack.trim().match(/\n( *(at )?)/);de=f&&f[1]||""}return`
18
+ `+de+t}}var fe=!1,ae;{var wt=typeof WeakMap=="function"?WeakMap:Map;ae=new wt}function Pe(t,o){if(!t||fe)return"";{var c=ae.get(t);if(c!==void 0)return c}var f;fe=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var x;x=ge.current,ge.current=null,It();try{if(o){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(F){f=F}Reflect.construct(t,[],m)}else{try{m.call()}catch(F){f=F}t.call(m.prototype)}}else{try{throw Error()}catch(F){f=F}t()}}catch(F){if(F&&f&&typeof F.stack=="string"){for(var v=F.stack.split(`
19
19
  `),w=f.stack.split(`
20
- `),S=v.length-1,k=w.length-1;S>=1&&k>=0&&v[S]!==w[k];)k--;for(;S>=1&&k>=0;S--,k--)if(v[S]!==w[k]){if(S!==1||k!==1)do if(S--,k--,k<0||v[S]!==w[k]){var _=`
21
- `+v[S].replace(" at new "," at ");return t.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",t.displayName)),typeof t=="function"&&ae.set(t,_),_}while(S>=1&&k>=0);break}}}finally{fe=!1,ge.current=x,At(),Error.prepareStackTrace=b}var $=t?t.displayName||t.name:"",$e=$?re($):"";return typeof t=="function"&&ae.set(t,$e),$e}function Lt(t,o,c){return Pe(t,!1)}function jt(t){var o=t.prototype;return!!(o&&o.isReactComponent)}function ne(t,o,c){if(t==null)return"";if(typeof t=="function")return Pe(t,jt(t));if(typeof t=="string")return re(t);switch(t){case p:return re("Suspense");case C:return re("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case h:return Lt(t.render);case A:return ne(t.type,o,c);case L:{var f=t,b=f._payload,x=f._init;try{return ne(x(b),o,c)}catch{}}}return""}var ie=Object.prototype.hasOwnProperty,Ve={},Me=R.ReactDebugCurrentFrame;function oe(t){if(t){var o=t._owner,c=ne(t.type,t._source,o?o.type:null);Me.setExtraStackFrame(c)}else Me.setExtraStackFrame(null)}function _t(t,o,c,f,b){{var x=Function.call.bind(ie);for(var m in t)if(x(t,m)){var v=void 0;try{if(typeof t[m]!="function"){var w=Error((f||"React class")+": "+c+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}v=t[m](o,m,f,c,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(S){v=S}v&&!(v instanceof Error)&&(oe(b),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",f||"React class",c,m,typeof v),oe(null)),v instanceof Error&&!(v.message in Ve)&&(Ve[v.message]=!0,oe(b),y("Failed %s type: %s",c,v.message),oe(null))}}}var Ot=Array.isArray;function pe(t){return Ot(t)}function Pt(t){{var o=typeof Symbol=="function"&&Symbol.toStringTag,c=o&&t[Symbol.toStringTag]||t.constructor.name||"Object";return c}}function Vt(t){try{return Fe(t),!1}catch{return!0}}function Fe(t){return""+t}function De(t){if(Vt(t))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Pt(t)),Fe(t)}var se=R.ReactCurrentOwner,Mt={key:!0,ref:!0,__self:!0,__source:!0},Be,Ue,ve;ve={};function Ft(t){if(ie.call(t,"ref")){var o=Object.getOwnPropertyDescriptor(t,"ref").get;if(o&&o.isReactWarning)return!1}return t.ref!==void 0}function Dt(t){if(ie.call(t,"key")){var o=Object.getOwnPropertyDescriptor(t,"key").get;if(o&&o.isReactWarning)return!1}return t.key!==void 0}function Bt(t,o){if(typeof t.ref=="string"&&se.current&&o&&se.current.stateNode!==o){var c=D(se.current.type);ve[c]||(y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',D(se.current.type),t.ref),ve[c]=!0)}}function Ut(t,o){{var c=function(){Be||(Be=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",o))};c.isReactWarning=!0,Object.defineProperty(t,"key",{get:c,configurable:!0})}}function Ht(t,o){{var c=function(){Ue||(Ue=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",o))};c.isReactWarning=!0,Object.defineProperty(t,"ref",{get:c,configurable:!0})}}var Wt=function(t,o,c,f,b,x,m){var v={$$typeof:e,type:t,key:o,ref:c,props:m,_owner:x};return v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(v,"_self",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.defineProperty(v,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v};function Nt(t,o,c,f,b){{var x,m={},v=null,w=null;c!==void 0&&(De(c),v=""+c),Dt(o)&&(De(o.key),v=""+o.key),Ft(o)&&(w=o.ref,Bt(o,b));for(x in o)ie.call(o,x)&&!Mt.hasOwnProperty(x)&&(m[x]=o[x]);if(t&&t.defaultProps){var S=t.defaultProps;for(x in S)m[x]===void 0&&(m[x]=S[x])}if(v||w){var k=typeof t=="function"?t.displayName||t.name||"Unknown":t;v&&Ut(m,k),w&&Ht(m,k)}return Wt(t,v,w,b,f,se.current,m)}}var me=R.ReactCurrentOwner,He=R.ReactDebugCurrentFrame;function Y(t){if(t){var o=t._owner,c=ne(t.type,t._source,o?o.type:null);He.setExtraStackFrame(c)}else He.setExtraStackFrame(null)}var be;be=!1;function ye(t){return typeof t=="object"&&t!==null&&t.$$typeof===e}function We(){{if(me.current){var t=D(me.current.type);if(t)return`
20
+ `),S=v.length-1,k=w.length-1;S>=1&&k>=0&&v[S]!==w[k];)k--;for(;S>=1&&k>=0;S--,k--)if(v[S]!==w[k]){if(S!==1||k!==1)do if(S--,k--,k<0||v[S]!==w[k]){var j=`
21
+ `+v[S].replace(" at new "," at ");return t.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",t.displayName)),typeof t=="function"&&ae.set(t,j),j}while(S>=1&&k>=0);break}}}finally{fe=!1,ge.current=x,At(),Error.prepareStackTrace=b}var Y=t?t.displayName||t.name:"",$e=Y?re(Y):"";return typeof t=="function"&&ae.set(t,$e),$e}function Lt(t,o,c){return Pe(t,!1)}function jt(t){var o=t.prototype;return!!(o&&o.isReactComponent)}function ne(t,o,c){if(t==null)return"";if(typeof t=="function")return Pe(t,jt(t));if(typeof t=="string")return re(t);switch(t){case p:return re("Suspense");case C:return re("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case h:return Lt(t.render);case A:return ne(t.type,o,c);case L:{var f=t,b=f._payload,x=f._init;try{return ne(x(b),o,c)}catch{}}}return""}var ie=Object.prototype.hasOwnProperty,Ve={},Me=R.ReactDebugCurrentFrame;function oe(t){if(t){var o=t._owner,c=ne(t.type,t._source,o?o.type:null);Me.setExtraStackFrame(c)}else Me.setExtraStackFrame(null)}function _t(t,o,c,f,b){{var x=Function.call.bind(ie);for(var m in t)if(x(t,m)){var v=void 0;try{if(typeof t[m]!="function"){var w=Error((f||"React class")+": "+c+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}v=t[m](o,m,f,c,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(S){v=S}v&&!(v instanceof Error)&&(oe(b),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",f||"React class",c,m,typeof v),oe(null)),v instanceof Error&&!(v.message in Ve)&&(Ve[v.message]=!0,oe(b),y("Failed %s type: %s",c,v.message),oe(null))}}}var Ot=Array.isArray;function pe(t){return Ot(t)}function Pt(t){{var o=typeof Symbol=="function"&&Symbol.toStringTag,c=o&&t[Symbol.toStringTag]||t.constructor.name||"Object";return c}}function Vt(t){try{return Fe(t),!1}catch{return!0}}function Fe(t){return""+t}function De(t){if(Vt(t))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Pt(t)),Fe(t)}var te=R.ReactCurrentOwner,Mt={key:!0,ref:!0,__self:!0,__source:!0},Be,Ue,ve;ve={};function Ft(t){if(ie.call(t,"ref")){var o=Object.getOwnPropertyDescriptor(t,"ref").get;if(o&&o.isReactWarning)return!1}return t.ref!==void 0}function Dt(t){if(ie.call(t,"key")){var o=Object.getOwnPropertyDescriptor(t,"key").get;if(o&&o.isReactWarning)return!1}return t.key!==void 0}function Bt(t,o){if(typeof t.ref=="string"&&te.current&&o&&te.current.stateNode!==o){var c=M(te.current.type);ve[c]||(y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',M(te.current.type),t.ref),ve[c]=!0)}}function Ut(t,o){{var c=function(){Be||(Be=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",o))};c.isReactWarning=!0,Object.defineProperty(t,"key",{get:c,configurable:!0})}}function Ht(t,o){{var c=function(){Ue||(Ue=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",o))};c.isReactWarning=!0,Object.defineProperty(t,"ref",{get:c,configurable:!0})}}var Wt=function(t,o,c,f,b,x,m){var v={$$typeof:e,type:t,key:o,ref:c,props:m,_owner:x};return v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(v,"_self",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.defineProperty(v,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v};function Nt(t,o,c,f,b){{var x,m={},v=null,w=null;c!==void 0&&(De(c),v=""+c),Dt(o)&&(De(o.key),v=""+o.key),Ft(o)&&(w=o.ref,Bt(o,b));for(x in o)ie.call(o,x)&&!Mt.hasOwnProperty(x)&&(m[x]=o[x]);if(t&&t.defaultProps){var S=t.defaultProps;for(x in S)m[x]===void 0&&(m[x]=S[x])}if(v||w){var k=typeof t=="function"?t.displayName||t.name||"Unknown":t;v&&Ut(m,k),w&&Ht(m,k)}return Wt(t,v,w,b,f,te.current,m)}}var me=R.ReactCurrentOwner,He=R.ReactDebugCurrentFrame;function K(t){if(t){var o=t._owner,c=ne(t.type,t._source,o?o.type:null);He.setExtraStackFrame(c)}else He.setExtraStackFrame(null)}var be;be=!1;function ye(t){return typeof t=="object"&&t!==null&&t.$$typeof===e}function We(){{if(me.current){var t=M(me.current.type);if(t)return`
22
22
 
23
23
  Check the render method of \``+t+"`."}return""}}function qt(t){{if(t!==void 0){var o=t.fileName.replace(/^.*[\\\/]/,""),c=t.lineNumber;return`
24
24
 
25
25
  Check your code at `+o+":"+c+"."}return""}}var Ne={};function Kt(t){{var o=We();if(!o){var c=typeof t=="string"?t:t.displayName||t.name;c&&(o=`
26
26
 
27
- Check the top-level render call using <`+c+">.")}return o}}function qe(t,o){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var c=Kt(o);if(Ne[c])return;Ne[c]=!0;var f="";t&&t._owner&&t._owner!==me.current&&(f=" It was passed a child from "+D(t._owner.type)+"."),Y(t),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',c,f),Y(null)}}function Ke(t,o){{if(typeof t!="object")return;if(pe(t))for(var c=0;c<t.length;c++){var f=t[c];ye(f)&&qe(f,o)}else if(ye(t))t._store&&(t._store.validated=!0);else if(t){var b=P(t);if(typeof b=="function"&&b!==t.entries)for(var x=b.call(t),m;!(m=x.next()).done;)ye(m.value)&&qe(m.value,o)}}}function Yt(t){{var o=t.type;if(o==null||typeof o=="string")return;var c;if(typeof o=="function")c=o.propTypes;else if(typeof o=="object"&&(o.$$typeof===h||o.$$typeof===A))c=o.propTypes;else return;if(c){var f=D(o);_t(c,t.props,"prop",f,t)}else if(o.PropTypes!==void 0&&!be){be=!0;var b=D(o);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof o.getDefaultProps=="function"&&!o.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $t(t){{for(var o=Object.keys(t.props),c=0;c<o.length;c++){var f=o[c];if(f!=="children"&&f!=="key"){Y(t),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),Y(null);break}}t.ref!==null&&(Y(t),y("Invalid attribute `ref` supplied to `React.Fragment`."),Y(null))}}function Ye(t,o,c,f,b,x){{var m=kt(t);if(!m){var v="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(v+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var w=qt(b);w?v+=w:v+=We();var S;t===null?S="null":pe(t)?S="array":t!==void 0&&t.$$typeof===e?(S="<"+(D(t.type)||"Unknown")+" />",v=" Did you accidentally export a JSX literal instead of a component?"):S=typeof t,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",S,v)}var k=Nt(t,o,c,b,x);if(k==null)return k;if(m){var _=o.children;if(_!==void 0)if(f)if(pe(_)){for(var $=0;$<_.length;$++)Ke(_[$],t);Object.freeze&&Object.freeze(_)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ke(_,t)}return t===n?$t(k):Yt(k),k}}function zt(t,o,c){return Ye(t,o,c,!0)}function Gt(t,o,c){return Ye(t,o,c,!1)}var Jt=Gt,Xt=zt;G.Fragment=n,G.jsx=Jt,G.jsxs=Xt}()),G}(function(r){process.env.NODE_ENV==="production"?r.exports=Ge():r.exports=Je()})(ze);var Xe=Object.defineProperty,Qe=(r,e,s)=>e in r?Xe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s,g=(r,e,s)=>(Qe(r,typeof e!="symbol"?e+"":e,s),s);class J{constructor(e){g(this,"value"),g(this,"observers",[]),this.value=e,this.observers=[]}subscribe(e){this.observers.push(e),e(this.value)}unsubscribe(e){const s=this.observers.indexOf(e);s!==-1&&this.observers.splice(s,1)}setValue(e){this.value=e,this.notify()}getValue(){return this.value}notify(){this.observers.forEach(e=>e(this.value))}}class Ze{constructor(){g(this,"searchTermChangeObservable",new J("")),g(this,"loadingChangeObservable",new J(!1)),g(this,"searchResultsObservable",new J(null)),g(this,"searchResultsMetadataObservable",new J(null)),g(this,"searchAutosuggestObservable",new J(null)),g(this,"currentPage",1),g(this,"renderingEngine","mustache")}setSearchTerm(e){this.searchTermChangeObservable.setValue(e)}setRenderingEngine(e){this.renderingEngine=e}setCurrentPage(e){this.currentPage=e}setLoading(e){this.loadingChangeObservable.setValue(e)}setSearchResults(e){this.searchResultsObservable.setValue(e)}setSearchResultsMetadata(e){this.searchResultsMetadataObservable.setValue(e)}setSearchAutosuggest(e){this.searchAutosuggestObservable.setValue(e)}get searchResultsValue(){return this.searchResultsObservable.getValue()}get searchTermValue(){return this.searchTermChangeObservable.getValue()}get loadingValue(){return this.loadingChangeObservable.getValue()}get searchAutosuggestValue(){return this.searchAutosuggestObservable.getValue()}get searchResultsMetadataValue(){return this.searchResultsMetadataObservable.getValue()}get currentPageValue(){return this.currentPage}get renderingEngineValue(){return this.renderingEngine}}class ue{static combineResultsWithMetadata(e){const s=[],n=parseInt(e.response.start+"");return e.response.docs.forEach((a,i)=>{const u={custom:null,uniqueId:this.getValueByKey(e.responseHeader.params.uniqueId,a,e)??"",position:n+i+1,ribbon:this.doesMapExist("ribbon",e)?this.getValueByKey("ribbon",a,e):null,paths:this.doesMapExist("paths",e)?this.getValueByKey("paths",a,e):null,url:this.doesMapExist("url",e)?this.getValueByKey("url",a,e):null,title:this.doesMapExist("title",e)?this.getValueByKey("title",a,e):null,promoted:a["[elevated]"]?a["[elevated]"]:!1,thumbnail:this.doesMapExist("thumbnail",e)?this.getValueByKey("thumbnail",a,e):null,date:this.doesMapExist("date",e)?this.getValueByKey("date",a,e):null,snippet:this.doesMapExist("snippet",e)?this.getValueByKey("snippet",a,e):null,description:this.doesMapExist("description",e)?this.getValueByKey("description",a,e):null,unmappedFields:this.getUnmappedFields(a,e),allFields:this.getAllFields(a,e)};s.push(u)}),s}static extractSearchResultsMetadata(e){var s,n,a,i;let u="";return u=((i=(a=(n=(s=e==null?void 0:e.spellcheck)==null?void 0:s.suggestions)==null?void 0:n[0])==null?void 0:a.suggestion)==null?void 0:i[0])??"",typeof u!="string"&&(u=(u==null?void 0:u.word)??""),{recordsPerPageValue:parseInt(e.responseHeader.params.rows),startDocVal:parseInt(e.response.start+""),totalResultsValue:parseInt(e.response.numFound+""),latency:parseInt(e.responseHeader.QTime+""),endDocValue:parseInt(e.responseHeader.params.rows)+parseInt(e.response.start+""),spellingSuggestion:u}}static findResultByUniqueId(e,s){return s.find(n=>n.uniqueId===e)??null}static getUnmappedFields(e,s){const n=s.metadata.results.filter(i=>i.result_card==="").map(i=>i.name),a=[];for(const i of Object.keys(e))if(n.indexOf(i)!==-1){const u=Array.isArray(e[i])?e[i].join(", "):e[i];a.push({key:i,value:u,isImage:this.checkIfImage(e[i])})}return a}static checkIfImage(e){return e===void 0||typeof e!="string"?!1:/\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e)}static getAllFields(e,s){const n=s.metadata.results.map(i=>i.name),a=[];for(const i of Object.keys(e))n.indexOf(i)!==-1&&a.push({key:i,value:e[i],isImage:this.checkIfImage(e[i])});return a}static doesMapExist(e,s){return s.metadata.results.find(n=>n.result_card===e)!==void 0}static getValueByKey(e,s,n){const a=n.metadata.results.find(u=>u.result_card===e);if(a===void 0)return null;const i=s[a.name];return i===void 0?null:typeof i=="string"?i:Array.isArray(i)?i.join(", "):null}}class et{constructor(e,s){g(this,"url",""),g(this,"relatedSearches",""),g(this,"suggester",""),g(this,"authHeader"),g(this,"authHeaderRelated"),g(this,"language","en"),g(this,"trackApiKey",""),g(this,"session",""),g(this,"searchAuthType"),g(this,"controllerSearch"),g(this,"signalSearch"),g(this,"controllerSuggest"),g(this,"signalSuggest"),g(this,"dataLayer"),this.dataLayer=s,this.url=e.searchURL,this.language=e.language,this.suggester=e.suggesterURL,this.trackApiKey=e.trackApiKey,this.session=e.sessionId,this.searchAuthType=e.authType,this.authHeader=new Headers,this.authHeader.append("Accept","application/json");const n=this.searchAuthType==="token"?`Token ${e.searchAuth}`:`Basic ${e.searchAuth}`;this.authHeader.append("Authorization",n),this.authHeaderRelated=new Headers,this.authHeaderRelated.append("Accept","application/json"),this.authHeaderRelated.append("Authorization",e.searchAuth)}search(e,s,n){this.dataLayer.setSearchTerm(e),this.dataLayer.setLoading(!0),this.controllerSearch&&this.controllerSearch.abort(),this.controllerSearch=new AbortController,this.signalSearch=this.controllerSearch.signal;const a=new Proxy(new URLSearchParams(window.location.search),{get:(l,h)=>l.get(h)??""}),i=a.languageVariant?"&fq=_language:"+a.languageVariant:"",u=this.url+"?q="+encodeURIComponent(e.trim())+this.toQueryString(n)+"&language="+this.language+i;fetch(u,{method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSearch}).then(l=>l.json()).then(l=>{this.dataLayer.setLoading(!1),s(l)}).catch(l=>{this.dataLayer.setLoading(!1),console.log(l)})}suggest(e,s,n){this.controllerSuggest&&this.controllerSuggest.abort(),this.controllerSuggest=new AbortController,this.signalSuggest=this.controllerSuggest.signal;const a=this.suggester+"?q="+e.trim()+this.toQueryString(n)+"&language="+this.language;fetch(a,{method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSuggest}).then(i=>i.json()).then(i=>{s(i)}).catch(i=>console.log(i))}fields(){return this.fields}toQueryString(e){return"&"+e.join("&")}}class tt{static getOrSetCookie(e){let s=this.getCookie(e);return s==null&&(s=this.makeid(25),this.setCookie(e,s,{secure:!0,"max-age":3600})),s}static makeid(e){let s="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=n.length;for(let i=0;i<e;i++)s+=n.charAt(Math.floor(Math.random()*a));return s}static getCookie(e){const s=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return s?decodeURIComponent(s[1]):void 0}static setCookie(e,s,n){const a={path:"/",...n};n.expires instanceof Date&&(a.expires=n.expires.toUTCString());let i=encodeURIComponent(e)+"="+encodeURIComponent(s);for(const u in a){i+="; "+u;const l=a[u];l!==!0&&(i+="="+l)}document.cookie=i}}class st{static trackClick(e){const s={key:e.trackApiKey,query:e.searchTermValue,shownHits:e.recordsPerPage,totalHits:e.totalResults,pageNo:e.currentPage,latency:e.latencyVal,session:e.session,cDocId:e.result.uniqueId,cDocTitle:e.result.title,position:e.result.position,language:e.language};_msq.push(["trackClick",s])}}/*!
27
+ Check the top-level render call using <`+c+">.")}return o}}function qe(t,o){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var c=Kt(o);if(Ne[c])return;Ne[c]=!0;var f="";t&&t._owner&&t._owner!==me.current&&(f=" It was passed a child from "+M(t._owner.type)+"."),K(t),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',c,f),K(null)}}function Ke(t,o){{if(typeof t!="object")return;if(pe(t))for(var c=0;c<t.length;c++){var f=t[c];ye(f)&&qe(f,o)}else if(ye(t))t._store&&(t._store.validated=!0);else if(t){var b=O(t);if(typeof b=="function"&&b!==t.entries)for(var x=b.call(t),m;!(m=x.next()).done;)ye(m.value)&&qe(m.value,o)}}}function Yt(t){{var o=t.type;if(o==null||typeof o=="string")return;var c;if(typeof o=="function")c=o.propTypes;else if(typeof o=="object"&&(o.$$typeof===h||o.$$typeof===A))c=o.propTypes;else return;if(c){var f=M(o);_t(c,t.props,"prop",f,t)}else if(o.PropTypes!==void 0&&!be){be=!0;var b=M(o);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof o.getDefaultProps=="function"&&!o.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $t(t){{for(var o=Object.keys(t.props),c=0;c<o.length;c++){var f=o[c];if(f!=="children"&&f!=="key"){K(t),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),K(null);break}}t.ref!==null&&(K(t),y("Invalid attribute `ref` supplied to `React.Fragment`."),K(null))}}function Ye(t,o,c,f,b,x){{var m=kt(t);if(!m){var v="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(v+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var w=qt(b);w?v+=w:v+=We();var S;t===null?S="null":pe(t)?S="array":t!==void 0&&t.$$typeof===e?(S="<"+(M(t.type)||"Unknown")+" />",v=" Did you accidentally export a JSX literal instead of a component?"):S=typeof t,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",S,v)}var k=Nt(t,o,c,b,x);if(k==null)return k;if(m){var j=o.children;if(j!==void 0)if(f)if(pe(j)){for(var Y=0;Y<j.length;Y++)Ke(j[Y],t);Object.freeze&&Object.freeze(j)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ke(j,t)}return t===n?$t(k):Yt(k),k}}function zt(t,o,c){return Ye(t,o,c,!0)}function Gt(t,o,c){return Ye(t,o,c,!1)}var Jt=Gt,Xt=zt;z.Fragment=n,z.jsx=Jt,z.jsxs=Xt}()),z}(function(r){process.env.NODE_ENV==="production"?r.exports=Ge():r.exports=Je()})(ze);var Xe=Object.defineProperty,Qe=(r,e,s)=>e in r?Xe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s,g=(r,e,s)=>(Qe(r,typeof e!="symbol"?e+"":e,s),s);class G{constructor(e){g(this,"value"),g(this,"observers",[]),this.value=e,this.observers=[]}subscribe(e){this.observers.push(e),e(this.value)}unsubscribe(e){const s=this.observers.indexOf(e);s!==-1&&this.observers.splice(s,1)}setValue(e){this.value=e,this.notify()}getValue(){return this.value}notify(){this.observers.forEach(e=>e(this.value))}}class Ze{constructor(){g(this,"searchTermChangeObservable",new G("")),g(this,"loadingChangeObservable",new G(!1)),g(this,"searchResultsObservable",new G(null)),g(this,"searchResultsMetadataObservable",new G(null)),g(this,"searchAutosuggestObservable",new G(null)),g(this,"currentPage",1),g(this,"renderingEngine","mustache")}setSearchTerm(e){this.searchTermChangeObservable.setValue(e)}setRenderingEngine(e){this.renderingEngine=e}setCurrentPage(e){this.currentPage=e}setLoading(e){this.loadingChangeObservable.setValue(e)}setSearchResults(e){this.searchResultsObservable.setValue(e)}setSearchResultsMetadata(e){this.searchResultsMetadataObservable.setValue(e)}setSearchAutosuggest(e){this.searchAutosuggestObservable.setValue(e)}get searchResultsValue(){return this.searchResultsObservable.getValue()}get searchTermValue(){return this.searchTermChangeObservable.getValue()}get loadingValue(){return this.loadingChangeObservable.getValue()}get searchAutosuggestValue(){return this.searchAutosuggestObservable.getValue()}get searchResultsMetadataValue(){return this.searchResultsMetadataObservable.getValue()}get currentPageValue(){return this.currentPage}get renderingEngineValue(){return this.renderingEngine}}class ue{static combineResultsWithMetadata(e){const s=[],n=parseInt(e.response.start+"");return e.response.docs.forEach((a,i)=>{const u={custom:null,uniqueId:this.getValueByKey(e.responseHeader.params.uniqueId,a,e)??"",position:n+i+1,ribbon:this.doesMapExist("ribbon",e)?this.getValueByKey("ribbon",a,e):null,paths:this.doesMapExist("paths",e)?this.getValueByKey("paths",a,e):null,url:this.doesMapExist("url",e)?this.getValueByKey("url",a,e):null,title:this.doesMapExist("title",e)?this.getValueByKey("title",a,e):null,promoted:a["[elevated]"]?a["[elevated]"]:!1,thumbnail:this.doesMapExist("thumbnail",e)?this.getValueByKey("thumbnail",a,e):null,date:this.doesMapExist("date",e)?this.getValueByKey("date",a,e):null,snippet:this.doesMapExist("snippet",e)?this.getValueByKey("snippet",a,e):null,description:this.doesMapExist("description",e)?this.getValueByKey("description",a,e):null,unmappedFields:this.getUnmappedFields(a,e),allFields:this.getAllFields(a,e)};s.push(u)}),s}static extractSearchResultsMetadata(e){var s,n,a,i;let u="";return u=((i=(a=(n=(s=e==null?void 0:e.spellcheck)==null?void 0:s.suggestions)==null?void 0:n[0])==null?void 0:a.suggestion)==null?void 0:i[0])??"",typeof u!="string"&&(u=(u==null?void 0:u.word)??""),{recordsPerPageValue:parseInt(e.responseHeader.params.rows),startDocVal:parseInt(e.response.start+""),totalResultsValue:parseInt(e.response.numFound+""),latency:parseInt(e.responseHeader.QTime+""),endDocValue:parseInt(e.responseHeader.params.rows)+parseInt(e.response.start+""),spellingSuggestion:u}}static findResultByUniqueId(e,s){return s.find(n=>n.uniqueId===e)??null}static getUnmappedFields(e,s){const n=s.metadata.results.filter(i=>i.result_card==="").map(i=>i.name),a=[];for(const i of Object.keys(e))if(n.indexOf(i)!==-1){const u=Array.isArray(e[i])?e[i].join(", "):e[i];a.push({key:i,value:u,isImage:this.checkIfImage(e[i])})}return a}static checkIfImage(e){return e===void 0||typeof e!="string"?!1:/\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e)}static getAllFields(e,s){const n=s.metadata.results.map(i=>i.name),a=[];for(const i of Object.keys(e))n.indexOf(i)!==-1&&a.push({key:i,value:e[i],isImage:this.checkIfImage(e[i])});return a}static doesMapExist(e,s){return s.metadata.results.find(n=>n.result_card===e)!==void 0}static getValueByKey(e,s,n){const a=n.metadata.results.find(u=>u.result_card===e);if(a===void 0)return null;const i=s[a.name];return i===void 0?null:typeof i=="string"?i:Array.isArray(i)?i.join(", "):null}}class et{constructor(e,s){g(this,"url",""),g(this,"relatedSearches",""),g(this,"suggester",""),g(this,"authHeader"),g(this,"authHeaderRelated"),g(this,"language","en"),g(this,"trackApiKey",""),g(this,"session",""),g(this,"searchAuthType"),g(this,"controllerSearch"),g(this,"signalSearch"),g(this,"controllerSuggest"),g(this,"signalSuggest"),g(this,"dataLayer"),this.dataLayer=s,this.url=e.searchURL,this.language=e.language,this.suggester=e.suggesterURL,this.trackApiKey=e.trackApiKey,this.session=e.sessionId,this.searchAuthType=e.authType,this.authHeader=new Headers,this.authHeader.append("Accept","application/json");const n=this.searchAuthType==="token"?`Token ${e.searchAuth}`:`Basic ${e.searchAuth}`;this.authHeader.append("Authorization",n),this.authHeaderRelated=new Headers,this.authHeaderRelated.append("Accept","application/json"),this.authHeaderRelated.append("Authorization",e.searchAuth)}search(e,s,n){this.dataLayer.setSearchTerm(e),this.dataLayer.setLoading(!0),this.controllerSearch&&this.controllerSearch.abort(),this.controllerSearch=new AbortController,this.signalSearch=this.controllerSearch.signal;const a=new Proxy(new URLSearchParams(window.location.search),{get:(l,h)=>l.get(h)??""}),i=a.languageVariant?"&fq=_language:"+a.languageVariant:"",u=this.url+"?q="+encodeURIComponent(e.trim())+this.toQueryString(n)+"&language="+this.language+i;fetch(u,{method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSearch}).then(l=>l.json()).then(l=>{this.dataLayer.setLoading(!1),s(l)}).catch(l=>{this.dataLayer.setLoading(!1),console.log(l)})}suggest(e,s,n){this.controllerSuggest&&this.controllerSuggest.abort(),this.controllerSuggest=new AbortController,this.signalSuggest=this.controllerSuggest.signal;const a=this.suggester+"?q="+e.trim()+this.toQueryString(n)+"&language="+this.language;fetch(a,{method:"GET",headers:this.authHeader,credentials:"same-origin",signal:this.signalSuggest}).then(i=>i.json()).then(i=>{s(i)}).catch(i=>console.log(i))}fields(){return this.fields}toQueryString(e){return"&"+e.join("&")}}class tt{static getOrSetCookie(e){let s=this.getCookie(e);return s==null&&(s=this.makeid(25),this.setCookie(e,s,{secure:!0,"max-age":3600})),s}static makeid(e){let s="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=n.length;for(let i=0;i<e;i++)s+=n.charAt(Math.floor(Math.random()*a));return s}static getCookie(e){const s=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return s?decodeURIComponent(s[1]):void 0}static setCookie(e,s,n){const a={path:"/",...n};n.expires instanceof Date&&(a.expires=n.expires.toUTCString());let i=encodeURIComponent(e)+"="+encodeURIComponent(s);for(const u in a){i+="; "+u;const l=a[u];l!==!0&&(i+="="+l)}document.cookie=i}}class st{static trackClick(e){const s={key:e.trackApiKey,query:e.searchTermValue,shownHits:e.recordsPerPage,totalHits:e.totalResults,pageNo:e.currentPage,latency:e.latencyVal,session:e.session,cDocId:e.result.uniqueId,cDocTitle:e.result.title,position:e.result.position,language:e.language};_msq.push(["trackClick",s])}}/*!
28
28
  * mustache.js - Logic-less {{mustache}} templates with JavaScript
29
29
  * http://github.com/janl/mustache.js
30
- */var rt=Object.prototype.toString,N=Array.isArray||function(r){return rt.call(r)==="[object Array]"};function ce(r){return typeof r=="function"}function at(r){return N(r)?"array":typeof r}function le(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Re(r,e){return r!=null&&typeof r=="object"&&e in r}function nt(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var it=RegExp.prototype.test;function ot(r,e){return it.call(r,e)}var ut=/\S/;function ct(r){return!ot(ut,r)}var lt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function ht(r){return String(r).replace(/[&<>"'`=\/]/g,function(e){return lt[e]})}var gt=/\s*/,dt=/\s+/,Se=/\s*=/,ft=/\s*\}/,pt=/#|\^|\/|>|\{|&|=|!/;function vt(r,e){if(!r)return[];var s=!1,n=[],a=[],i=[],u=!1,l=!1,h="",p=0;function C(){if(u&&!l)for(;i.length;)delete a[i.pop()];else i=[];u=!1,l=!1}var A,L,U;function Z(O){if(typeof O=="string"&&(O=O.split(dt,2)),!N(O)||O.length!==2)throw new Error("Invalid tags: "+O);A=new RegExp(le(O[0])+"\\s*"),L=new RegExp("\\s*"+le(O[1])),U=new RegExp("\\s*"+le("}"+O[1]))}Z(e||T.tags);for(var E=new X(r),P,R,y,H,K,F;!E.eos();){if(P=E.pos,y=E.scanUntil(A),y)for(var ee=0,he=y.length;ee<he;++ee)H=y.charAt(ee),ct(H)?(i.push(a.length),h+=H):(l=!0,s=!0,h+=" "),a.push(["text",H,P,P+1]),P+=1,H===`
31
- `&&(C(),h="",p=0,s=!1);if(!E.scan(A))break;if(u=!0,R=E.scan(pt)||"name",E.scan(gt),R==="="?(y=E.scanUntil(Se),E.scan(Se),E.scanUntil(L)):R==="{"?(y=E.scanUntil(U),E.scan(ft),E.scanUntil(L),R="&"):y=E.scanUntil(L),!E.scan(L))throw new Error("Unclosed tag at "+E.pos);if(R==">"?K=[R,y,P,E.pos,h,p,s]:K=[R,y,P,E.pos],p++,a.push(K),R==="#"||R==="^")n.push(K);else if(R==="/"){if(F=n.pop(),!F)throw new Error('Unopened section "'+y+'" at '+P);if(F[1]!==y)throw new Error('Unclosed section "'+F[1]+'" at '+P)}else R==="name"||R==="{"||R==="&"?l=!0:R==="="&&Z(y)}if(C(),F=n.pop(),F)throw new Error('Unclosed section "'+F[1]+'" at '+E.pos);return bt(mt(a))}function mt(r){for(var e=[],s,n,a=0,i=r.length;a<i;++a)s=r[a],s&&(s[0]==="text"&&n&&n[0]==="text"?(n[1]+=s[1],n[3]=s[3]):(e.push(s),n=s));return e}function bt(r){for(var e=[],s=e,n=[],a,i,u=0,l=r.length;u<l;++u)switch(a=r[u],a[0]){case"#":case"^":s.push(a),n.push(a),s=a[4]=[];break;case"/":i=n.pop(),i[5]=a[2],s=n.length>0?n[n.length-1][4]:e;break;default:s.push(a)}return e}function X(r){this.string=r,this.tail=r,this.pos=0}X.prototype.eos=function(){return this.tail===""},X.prototype.scan=function(r){var e=this.tail.match(r);if(!e||e.index!==0)return"";var s=e[0];return this.tail=this.tail.substring(s.length),this.pos+=s.length,s},X.prototype.scanUntil=function(r){var e=this.tail.search(r),s;switch(e){case-1:s=this.tail,this.tail="";break;case 0:s="";break;default:s=this.tail.substring(0,e),this.tail=this.tail.substring(e)}return this.pos+=s.length,s};function q(r,e){this.view=r,this.cache={".":this.view},this.parent=e}q.prototype.push=function(r){return new q(r,this)},q.prototype.lookup=function(r){var e=this.cache,s;if(e.hasOwnProperty(r))s=e[r];else{for(var n=this,a,i,u,l=!1;n;){if(r.indexOf(".")>0)for(a=n.view,i=r.split("."),u=0;a!=null&&u<i.length;)u===i.length-1&&(l=Re(a,i[u])||nt(a,i[u])),a=a[i[u++]];else a=n.view[r],l=Re(n.view,r);if(l){s=a;break}n=n.parent}e[r]=s}return ce(s)&&(s=s.call(this.view)),s};function I(){this.templateCache={_cache:{},set:function(r,e){this._cache[r]=e},get:function(r){return this._cache[r]},clear:function(){this._cache={}}}}I.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()},I.prototype.parse=function(r,e){var s=this.templateCache,n=r+":"+(e||T.tags).join(":"),a=typeof s<"u",i=a?s.get(n):void 0;return i==null&&(i=vt(r,e),a&&s.set(n,i)),i},I.prototype.render=function(r,e,s,n){var a=this.getConfigTags(n),i=this.parse(r,a),u=e instanceof q?e:new q(e,void 0);return this.renderTokens(i,u,s,r,n)},I.prototype.renderTokens=function(r,e,s,n,a){for(var i="",u,l,h,p=0,C=r.length;p<C;++p)h=void 0,u=r[p],l=u[0],l==="#"?h=this.renderSection(u,e,s,n,a):l==="^"?h=this.renderInverted(u,e,s,n,a):l===">"?h=this.renderPartial(u,e,s,a):l==="&"?h=this.unescapedValue(u,e):l==="name"?h=this.escapedValue(u,e,a):l==="text"&&(h=this.rawValue(u)),h!==void 0&&(i+=h);return i},I.prototype.renderSection=function(r,e,s,n,a){var i=this,u="",l=e.lookup(r[1]);function h(A){return i.render(A,e,s,a)}if(l){if(N(l))for(var p=0,C=l.length;p<C;++p)u+=this.renderTokens(r[4],e.push(l[p]),s,n,a);else if(typeof l=="object"||typeof l=="string"||typeof l=="number")u+=this.renderTokens(r[4],e.push(l),s,n,a);else if(ce(l)){if(typeof n!="string")throw new Error("Cannot use higher-order sections without the original template");l=l.call(e.view,n.slice(r[3],r[5]),h),l!=null&&(u+=l)}else u+=this.renderTokens(r[4],e,s,n,a);return u}},I.prototype.renderInverted=function(r,e,s,n,a){var i=e.lookup(r[1]);if(!i||N(i)&&i.length===0)return this.renderTokens(r[4],e,s,n,a)},I.prototype.indentPartial=function(r,e,s){for(var n=e.replace(/[^ \t]/g,""),a=r.split(`
30
+ */var rt=Object.prototype.toString,W=Array.isArray||function(r){return rt.call(r)==="[object Array]"};function ce(r){return typeof r=="function"}function at(r){return W(r)?"array":typeof r}function le(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Re(r,e){return r!=null&&typeof r=="object"&&e in r}function nt(r,e){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(e)}var it=RegExp.prototype.test;function ot(r,e){return it.call(r,e)}var ut=/\S/;function ct(r){return!ot(ut,r)}var lt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function ht(r){return String(r).replace(/[&<>"'`=\/]/g,function(e){return lt[e]})}var gt=/\s*/,dt=/\s+/,Se=/\s*=/,ft=/\s*\}/,pt=/#|\^|\/|>|\{|&|=|!/;function vt(r,e){if(!r)return[];var s=!1,n=[],a=[],i=[],u=!1,l=!1,h="",p=0;function C(){if(u&&!l)for(;i.length;)delete a[i.pop()];else i=[];u=!1,l=!1}var A,L,B;function Q(_){if(typeof _=="string"&&(_=_.split(dt,2)),!W(_)||_.length!==2)throw new Error("Invalid tags: "+_);A=new RegExp(le(_[0])+"\\s*"),L=new RegExp("\\s*"+le(_[1])),B=new RegExp("\\s*"+le("}"+_[1]))}Q(e||T.tags);for(var E=new J(r),O,R,y,U,q,V;!E.eos();){if(O=E.pos,y=E.scanUntil(A),y)for(var Z=0,he=y.length;Z<he;++Z)U=y.charAt(Z),ct(U)?(i.push(a.length),h+=U):(l=!0,s=!0,h+=" "),a.push(["text",U,O,O+1]),O+=1,U===`
31
+ `&&(C(),h="",p=0,s=!1);if(!E.scan(A))break;if(u=!0,R=E.scan(pt)||"name",E.scan(gt),R==="="?(y=E.scanUntil(Se),E.scan(Se),E.scanUntil(L)):R==="{"?(y=E.scanUntil(B),E.scan(ft),E.scanUntil(L),R="&"):y=E.scanUntil(L),!E.scan(L))throw new Error("Unclosed tag at "+E.pos);if(R==">"?q=[R,y,O,E.pos,h,p,s]:q=[R,y,O,E.pos],p++,a.push(q),R==="#"||R==="^")n.push(q);else if(R==="/"){if(V=n.pop(),!V)throw new Error('Unopened section "'+y+'" at '+O);if(V[1]!==y)throw new Error('Unclosed section "'+V[1]+'" at '+O)}else R==="name"||R==="{"||R==="&"?l=!0:R==="="&&Q(y)}if(C(),V=n.pop(),V)throw new Error('Unclosed section "'+V[1]+'" at '+E.pos);return bt(mt(a))}function mt(r){for(var e=[],s,n,a=0,i=r.length;a<i;++a)s=r[a],s&&(s[0]==="text"&&n&&n[0]==="text"?(n[1]+=s[1],n[3]=s[3]):(e.push(s),n=s));return e}function bt(r){for(var e=[],s=e,n=[],a,i,u=0,l=r.length;u<l;++u)switch(a=r[u],a[0]){case"#":case"^":s.push(a),n.push(a),s=a[4]=[];break;case"/":i=n.pop(),i[5]=a[2],s=n.length>0?n[n.length-1][4]:e;break;default:s.push(a)}return e}function J(r){this.string=r,this.tail=r,this.pos=0}J.prototype.eos=function(){return this.tail===""},J.prototype.scan=function(r){var e=this.tail.match(r);if(!e||e.index!==0)return"";var s=e[0];return this.tail=this.tail.substring(s.length),this.pos+=s.length,s},J.prototype.scanUntil=function(r){var e=this.tail.search(r),s;switch(e){case-1:s=this.tail,this.tail="";break;case 0:s="";break;default:s=this.tail.substring(0,e),this.tail=this.tail.substring(e)}return this.pos+=s.length,s};function N(r,e){this.view=r,this.cache={".":this.view},this.parent=e}N.prototype.push=function(r){return new N(r,this)},N.prototype.lookup=function(r){var e=this.cache,s;if(e.hasOwnProperty(r))s=e[r];else{for(var n=this,a,i,u,l=!1;n;){if(r.indexOf(".")>0)for(a=n.view,i=r.split("."),u=0;a!=null&&u<i.length;)u===i.length-1&&(l=Re(a,i[u])||nt(a,i[u])),a=a[i[u++]];else a=n.view[r],l=Re(n.view,r);if(l){s=a;break}n=n.parent}e[r]=s}return ce(s)&&(s=s.call(this.view)),s};function I(){this.templateCache={_cache:{},set:function(r,e){this._cache[r]=e},get:function(r){return this._cache[r]},clear:function(){this._cache={}}}}I.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()},I.prototype.parse=function(r,e){var s=this.templateCache,n=r+":"+(e||T.tags).join(":"),a=typeof s<"u",i=a?s.get(n):void 0;return i==null&&(i=vt(r,e),a&&s.set(n,i)),i},I.prototype.render=function(r,e,s,n){var a=this.getConfigTags(n),i=this.parse(r,a),u=e instanceof N?e:new N(e,void 0);return this.renderTokens(i,u,s,r,n)},I.prototype.renderTokens=function(r,e,s,n,a){for(var i="",u,l,h,p=0,C=r.length;p<C;++p)h=void 0,u=r[p],l=u[0],l==="#"?h=this.renderSection(u,e,s,n,a):l==="^"?h=this.renderInverted(u,e,s,n,a):l===">"?h=this.renderPartial(u,e,s,a):l==="&"?h=this.unescapedValue(u,e):l==="name"?h=this.escapedValue(u,e,a):l==="text"&&(h=this.rawValue(u)),h!==void 0&&(i+=h);return i},I.prototype.renderSection=function(r,e,s,n,a){var i=this,u="",l=e.lookup(r[1]);function h(A){return i.render(A,e,s,a)}if(l){if(W(l))for(var p=0,C=l.length;p<C;++p)u+=this.renderTokens(r[4],e.push(l[p]),s,n,a);else if(typeof l=="object"||typeof l=="string"||typeof l=="number")u+=this.renderTokens(r[4],e.push(l),s,n,a);else if(ce(l)){if(typeof n!="string")throw new Error("Cannot use higher-order sections without the original template");l=l.call(e.view,n.slice(r[3],r[5]),h),l!=null&&(u+=l)}else u+=this.renderTokens(r[4],e,s,n,a);return u}},I.prototype.renderInverted=function(r,e,s,n,a){var i=e.lookup(r[1]);if(!i||W(i)&&i.length===0)return this.renderTokens(r[4],e,s,n,a)},I.prototype.indentPartial=function(r,e,s){for(var n=e.replace(/[^ \t]/g,""),a=r.split(`
32
32
  `),i=0;i<a.length;i++)a[i].length&&(i>0||!s)&&(a[i]=n+a[i]);return a.join(`
33
- `)},I.prototype.renderPartial=function(r,e,s,n){if(s){var a=this.getConfigTags(n),i=ce(s)?s(r[1]):s[r[1]];if(i!=null){var u=r[6],l=r[5],h=r[4],p=i;l==0&&h&&(p=this.indentPartial(i,h,u));var C=this.parse(p,a);return this.renderTokens(C,e,s,p,n)}}},I.prototype.unescapedValue=function(r,e){var s=e.lookup(r[1]);if(s!=null)return s},I.prototype.escapedValue=function(r,e,s){var n=this.getConfigEscape(s)||T.escape,a=e.lookup(r[1]);if(a!=null)return typeof a=="number"&&n===T.escape?String(a):n(a)},I.prototype.rawValue=function(r){return r[1]},I.prototype.getConfigTags=function(r){return N(r)?r:r&&typeof r=="object"?r.tags:void 0},I.prototype.getConfigEscape=function(r){if(r&&typeof r=="object"&&!N(r))return r.escape};var T={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){Q.templateCache=r},get templateCache(){return Q.templateCache}},Q=new I;T.clearCache=function(){return Q.clearCache()},T.parse=function(r,e){return Q.parse(r,e)},T.render=function(r,e,s,n){if(typeof r!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+at(r)+'" was given as the first argument for mustache#render(template, view, partials)');return Q.render(r,e,s,n)},T.escape=ht,T.Scanner=X,T.Context=q,T.Writer=I;class yt{constructor(e){g(this,"dataLayer"),g(this,"config"),g(this,"suggestAfterMinChars"),g(this,"containerId"),g(this,"currentInputValue",""),g(this,"autosuggestResults"),g(this,"searchInput"),g(this,"actionButton"),g(this,"autosuggestContainer"),g(this,"buttonState","search"),g(this,"selectedAutosuggestItem",-1),g(this,"suggestTrigger"),g(this,"searchTrigger"),this.dataLayer=e.dataLayer,this.config=e.config,this.searchTrigger=e.searchTrigger,this.suggestTrigger=e.suggestTrigger,this.containerId=e.containerId,this.suggestAfterMinChars=e.config.suggestAfterMinChars,this.renderMainTemplate(),this.actionButtonInit(),this.updateActionButtonState("search"),this.searchInput&&(this.createAutosuggestContainer(),this.attachSubscriptions())}renderMainTemplate(){var e,s;const n=document.getElementById(this.containerId);if(!n)throw new Error("Search input container not found");const a=((e=this.config.templates)==null?void 0:e.mainTemplate)||`
33
+ `)},I.prototype.renderPartial=function(r,e,s,n){if(s){var a=this.getConfigTags(n),i=ce(s)?s(r[1]):s[r[1]];if(i!=null){var u=r[6],l=r[5],h=r[4],p=i;l==0&&h&&(p=this.indentPartial(i,h,u));var C=this.parse(p,a);return this.renderTokens(C,e,s,p,n)}}},I.prototype.unescapedValue=function(r,e){var s=e.lookup(r[1]);if(s!=null)return s},I.prototype.escapedValue=function(r,e,s){var n=this.getConfigEscape(s)||T.escape,a=e.lookup(r[1]);if(a!=null)return typeof a=="number"&&n===T.escape?String(a):n(a)},I.prototype.rawValue=function(r){return r[1]},I.prototype.getConfigTags=function(r){return W(r)?r:r&&typeof r=="object"?r.tags:void 0},I.prototype.getConfigEscape=function(r){if(r&&typeof r=="object"&&!W(r))return r.escape};var T={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){X.templateCache=r},get templateCache(){return X.templateCache}},X=new I;T.clearCache=function(){return X.clearCache()},T.parse=function(r,e){return X.parse(r,e)},T.render=function(r,e,s,n){if(typeof r!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+at(r)+'" was given as the first argument for mustache#render(template, view, partials)');return X.render(r,e,s,n)},T.escape=ht,T.Scanner=J,T.Context=N,T.Writer=I;class yt{constructor(e){g(this,"dataLayer"),g(this,"config"),g(this,"suggestAfterMinChars"),g(this,"containerId"),g(this,"currentInputValue",""),g(this,"autosuggestResults"),g(this,"searchInput"),g(this,"actionButton"),g(this,"autosuggestContainer"),g(this,"buttonState","search"),g(this,"selectedAutosuggestItem",-1),g(this,"suggestTrigger"),g(this,"searchTrigger"),this.dataLayer=e.dataLayer,this.config=e.config,this.searchTrigger=e.searchTrigger,this.suggestTrigger=e.suggestTrigger,this.containerId=e.containerId,this.suggestAfterMinChars=e.config.suggestAfterMinChars,this.renderMainTemplate(),this.actionButtonInit(),this.updateActionButtonState("search"),this.searchInput&&(this.createAutosuggestContainer(),this.attachSubscriptions())}renderMainTemplate(){var e,s;const n=document.getElementById(this.containerId);if(!n)throw new Error("Search input container not found");const a=((e=this.config.templates)==null?void 0:e.mainTemplate)||`
34
34
  <div class="searchstax-search-input-container">
35
35
  <div class="searchstax-search-input-wrapper">
36
36
  <input type="text" id="searchstax-search-input" class="searchstax-search-input" placeholder="SEARCH FOR..." />
@@ -92,4 +92,4 @@ Check the top-level render call using <`+c+">.")}return o}}function qe(t,o){{if(
92
92
  <div class="searchstax-search-results-container">
93
93
  <div class="searchstax-search-results"></div>
94
94
  </div>
95
- `;this.dataLayer.renderingEngineValue==="mustache"&&(this.searchResultsMainContainer.innerHTML=T.render(n,{})),setTimeout(()=>{var a,i;const u=(a=this.config)!=null&&a.searchResultsContainerId?(i=this.config)==null?void 0:i.searchResultsContainerId:"searchstax-search-results",l=document.getElementById(u);if(l)this.searchResultsContainer=l;else throw new Error(`Search Results Container with id ${u} not found`)},0)}}class Ct{constructor(e="mustache"){g(this,"sessionId"),g(this,"searchstaxConfig"),g(this,"searchHelper"),g(this,"searchInputConfig"),g(this,"searchResultsConfig"),g(this,"searchInputWidget"),g(this,"searchResultsWidget"),g(this,"dataLayer",new Ze),e&&this.dataLayer.setRenderingEngine(e),this.sessionId=tt.getOrSetCookie("searchstax_session_id"),this.handleHooks()}setRenderingEngine(e="mustache"){this.dataLayer.setRenderingEngine(e)}handleHooks(){var e,s;(s=(e=this.searchInputConfig)==null?void 0:e.hooks)!=null&&s.afterSearch&&this.dataLayer.searchResultsObservable.subscribe(n=>{this.searchInputConfig.hooks.afterSearch(n)})}initialize(e){this.searchstaxConfig||(this.searchstaxConfig=e,this.searchHelper=new et({...e,sessionId:this.sessionId},this.dataLayer))}search(e,s){this.searchHelper&&this.searchHelper.search(e,this.parseSearchResultsResponse.bind(this),s)}parseSearchResultsResponse(e){var s,n;let a=ue.combineResultsWithMetadata(e);(n=(s=this.searchInputConfig)==null?void 0:s.hooks)!=null&&n.afterSearch&&(a=this.searchInputConfig.hooks.afterSearch(a)),this.dataLayer.setSearchResults(a),this.dataLayer.setSearchResultsMetadata(ue.extractSearchResultsMetadata(e))}parseSuggestSuggestResponse(e){var s,n;let a=e;(n=(s=this.searchInputConfig)==null?void 0:s.hooks)!=null&&n.afterAutosuggest&&(a=this.searchInputConfig.hooks.afterAutosuggest(e)),this.dataLayer.setSearchAutosuggest(a)}suggest(e,s){this.searchHelper&&this.searchHelper.suggest(e,this.parseSuggestSuggestResponse.bind(this),s)}changeLanguage(e){this.searchHelper&&(this.searchHelper.language=e)}addSearchInputWidget(e,s){this.searchInputConfig||(this.searchInputConfig=s,this.searchInputWidget=new yt({containerId:e,config:s,searchTrigger:this.executeSearch.bind(this),suggestTrigger:this.executeSuggest.bind(this),dataLayer:this.dataLayer}))}addSearchResultsWidget(e,s){this.searchResultsConfig||(this.searchResultsConfig=s,this.searchResultsWidget=new xt({containerId:e,linkClickCallback:this.executeLinkClick.bind(this),searchTrigger:this.executeSearch.bind(this),config:s,dataLayer:this.dataLayer}))}executeSearch(e){var s,n;let a={term:e,queryParams:[]};(n=(s=this.searchInputConfig)==null?void 0:s.hooks)!=null&&n.beforeSearch&&(a=this.searchInputConfig.hooks.beforeSearch(a)),a&&a.term!==void 0&&a.queryParams!==void 0&&this.search(a.term,a.queryParams)}executeSuggest(e){var s,n;let a={term:e,queryParams:[]};(n=(s=this.searchInputConfig)==null?void 0:s.hooks)!=null&&n.beforeAutosuggest&&(a=this.searchInputConfig.hooks.beforeAutosuggest(a)),a&&a.term!==void 0&&a.queryParams!==void 0&&this.suggest(a.term,a.queryParams)}executeLinkClick(e){var s,n,a,i;let u=ue.findResultByUniqueId(e,this.dataLayer.searchResultsValue??[]);u&&((n=(s=this.searchResultsConfig)==null?void 0:s.hooks)!=null&&n.afterLinkClick&&(u=this.searchResultsConfig.hooks.afterLinkClick(u)),u&&(console.log("foundResult",u),this.dataLayer.searchResultsMetadataValue&&st.trackClick({result:u,searchTermValue:this.dataLayer.searchTermValue,trackApiKey:((a=this.searchstaxConfig)==null?void 0:a.trackApiKey)??"",session:this.sessionId,language:((i=this.searchHelper)==null?void 0:i.language)??"",recordsPerPage:this.dataLayer.searchResultsMetadataValue.recordsPerPageValue,totalResults:this.dataLayer.searchResultsMetadataValue.totalResultsValue,currentPage:this.dataLayer.currentPageValue,latencyVal:this.dataLayer.searchResultsMetadataValue.latency})))}}const M={searchstax:new Ct("react")};function Rt(r){return j.useEffect(()=>{if(M.searchstax){const e={};r.beforeSearch&&(e.beforeSearch=r.beforeSearch),r.afterSearch&&(e.afterSearch=r.afterSearch),r.afterAutosuggest&&(e.afterAutosuggest=r.afterAutosuggest),r.beforeAutosuggest&&(e.beforeAutosuggest=r.beforeAutosuggest),M.searchstax.addSearchInputWidget("searchstax-input-container",{suggestAfterMinChars:r.suggestAfterMinChars??3,hooks:e,templates:{searchInputId:r.searchInputId??"searchstax-search-input"}})}else throw Error("Searchstax instance needs to be passed via props")},[]),d.jsx(d.Fragment,{children:d.jsx("div",{id:"searchstax-input-container",children:d.jsxs("div",{className:"searchstax-search-input-container",children:[!r.inputTemplate&&d.jsxs("div",{className:"searchstax-search-input-wrapper",children:[d.jsx("input",{type:"text",id:"searchstax-search-input",className:"searchstax-search-input",placeholder:"SEARCH FOR..."}),d.jsx("button",{className:"searchstax-spinner-icon",id:"searchstax-search-input-action-button"})]}),r.inputTemplate&&d.jsx(d.Fragment,{children:r.inputTemplate()})]})})})}function St(r){return j.useEffect(()=>{M.searchstax.initialize({language:r.language??"en",searchURL:r.searchURL,suggesterURL:r.suggesterURL,trackApiKey:r.trackApiKey,searchAuth:r.searchAuth,authType:r.authType??"basic"}),r.initialized(M.searchstax)},[r.initialized]),d.jsx(d.Fragment,{children:r.children})}function Et(r){const[e,s]=j.useState(null),[n,a]=j.useState(""),[i,u]=j.useState(""),l=(h,p)=>{p.preventDefault(),p.stopPropagation(),M.searchstax.executeLinkClick(h.uniqueId)};return j.useEffect(()=>{const h={};r.afterLinkClick&&(h.afterLinkClick=r.afterLinkClick),M.searchstax.dataLayer.searchResultsObservable.subscribe(p=>{s(p)}),M.searchstax.dataLayer.searchResultsMetadataObservable.subscribe(p=>{u((p==null?void 0:p.spellingSuggestion)??"")}),M.searchstax.dataLayer.searchTermChangeObservable.subscribe(p=>{a(p)}),M.searchstax.addSearchResultsWidget("searchstax-results-container",{searchResultsContainerId:"searchstax-result-container",templates:{},hooks:h})},[]),d.jsx(d.Fragment,{children:d.jsx("div",{id:"searchstax-results-container",children:d.jsx("div",{className:"searchstax-search-results-container",children:d.jsxs("div",{id:"searchstax-result-container",children:[e&&e.length===0&&!r.noResultTemplate&&d.jsxs("div",{children:[d.jsxs("div",{className:"searchstax-no-results",children:["Showing ",d.jsx("strong",{children:"no results"})," for",d.jsxs("strong",{children:['"',n,'"']}),d.jsx("br",{}),i&&d.jsxs("span",{children:[" Did you mean",d.jsx("a",{href:"#",className:"searchstax-suggestion-term",children:i}),"?"]})]}),d.jsxs("div",{children:[d.jsx("p",{children:"Try searching for search related terms or topics. We offer a wide variety of content to help you get the information you need."}),d.jsx("p",{children:"Lost? Click on the ‘X” in the Search Box to reset your search."})]})]}),e&&e.length===0&&r.noResultTemplate&&d.jsx(d.Fragment,{children:r.noResultTemplate(n,i)}),e&&e.length&&!r.resultsTemplate&&d.jsxs("div",{className:"searchstax-search-results",children:[e!==null&&e.map(function(h){return d.jsxs("div",{className:"searchstax-search-result",children:[h.url&&d.jsx("a",{href:h.url,"data-searchstax-unique-result-id":h.uniqueId,onClick:p=>{l(h,p)},className:"searchstax-result-item-link"}),h.ribbon&&d.jsx("div",{className:"searchstax-search-result-ribbon",children:h.ribbon}),h.thumbnail&&d.jsx("img",{src:h.thumbnail,className:"searchstax-thumbnail"}),d.jsx("div",{className:"searchstax-search-result-title-container",children:d.jsx("span",{className:"searchstax-search-result-title",children:h.title})}),h.paths&&d.jsx("p",{className:"searchstax-search-result-common",children:h.paths}),h.description&&d.jsx("p",{className:"searchstax-search-result-description searchstax-search-result-common",children:h.description}),h.unmappedFields.map(function(p){return d.jsxs("div",{children:[p.isImage&&d.jsx("div",{className:"searchstax-search-result-image-container",children:d.jsx("img",{src:p.value,className:"searchstax-result-image"})}),!p.isImage&&d.jsx("div",{children:d.jsx("p",{className:"searchstax-search-result-common",children:p.value})})]},p.value)})]},h.uniqueId)}),e!==null&&e.length&&d.jsx("div",{"v-if":"searchResults && searchResults.length && hasResultSlot"})]}),e&&e.length&&r.resultsTemplate&&d.jsx(d.Fragment,{children:r.resultsTemplate(e,l)})]})})})})}V.SearchstaxInputWidget=Rt,V.SearchstaxResultWidget=Et,V.SearchstaxWrapper=St,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
95
+ `;this.dataLayer.renderingEngineValue==="mustache"&&(this.searchResultsMainContainer.innerHTML=T.render(n,{})),setTimeout(()=>{var a,i;const u=(a=this.config)!=null&&a.searchResultsContainerId?(i=this.config)==null?void 0:i.searchResultsContainerId:"searchstax-search-results",l=document.getElementById(u);if(l)this.searchResultsContainer=l;else throw new Error(`Search Results Container with id ${u} not found`)},0)}}class Ct{constructor(e="mustache"){g(this,"sessionId"),g(this,"searchstaxConfig"),g(this,"searchHelper"),g(this,"searchInputConfig"),g(this,"searchResultsConfig"),g(this,"searchInputWidget"),g(this,"searchResultsWidget"),g(this,"dataLayer",new Ze),e&&this.dataLayer.setRenderingEngine(e),this.sessionId=tt.getOrSetCookie("searchstax_session_id"),this.handleHooks()}setRenderingEngine(e="mustache"){this.dataLayer.setRenderingEngine(e)}handleHooks(){var e,s;(s=(e=this.searchInputConfig)==null?void 0:e.hooks)!=null&&s.afterSearch&&this.dataLayer.searchResultsObservable.subscribe(n=>{this.searchInputConfig.hooks.afterSearch(n)})}initialize(e){this.searchstaxConfig||(this.searchstaxConfig=e,this.searchHelper=new et({...e,sessionId:this.sessionId},this.dataLayer))}search(e,s){this.searchHelper&&this.searchHelper.search(e,this.parseSearchResultsResponse.bind(this),s)}parseSearchResultsResponse(e){var s,n;let a=ue.combineResultsWithMetadata(e);(n=(s=this.searchInputConfig)==null?void 0:s.hooks)!=null&&n.afterSearch&&(a=this.searchInputConfig.hooks.afterSearch(a)),this.dataLayer.setSearchResults(a),this.dataLayer.setSearchResultsMetadata(ue.extractSearchResultsMetadata(e))}parseSuggestSuggestResponse(e){var s,n;let a=e;(n=(s=this.searchInputConfig)==null?void 0:s.hooks)!=null&&n.afterAutosuggest&&(a=this.searchInputConfig.hooks.afterAutosuggest(e)),this.dataLayer.setSearchAutosuggest(a)}suggest(e,s){this.searchHelper&&this.searchHelper.suggest(e,this.parseSuggestSuggestResponse.bind(this),s)}changeLanguage(e){this.searchHelper&&(this.searchHelper.language=e)}addSearchInputWidget(e,s){this.searchInputConfig||(this.searchInputConfig=s,this.searchInputWidget=new yt({containerId:e,config:s,searchTrigger:this.executeSearch.bind(this),suggestTrigger:this.executeSuggest.bind(this),dataLayer:this.dataLayer}))}addSearchResultsWidget(e,s){this.searchResultsConfig||(this.searchResultsConfig=s,this.searchResultsWidget=new xt({containerId:e,linkClickCallback:this.executeLinkClick.bind(this),searchTrigger:this.executeSearch.bind(this),config:s,dataLayer:this.dataLayer}))}executeSearch(e){var s,n;let a={term:e,queryParams:[]};(n=(s=this.searchInputConfig)==null?void 0:s.hooks)!=null&&n.beforeSearch&&(a=this.searchInputConfig.hooks.beforeSearch(a)),a&&a.term!==void 0&&a.queryParams!==void 0&&this.search(a.term,a.queryParams)}executeSuggest(e){var s,n;let a={term:e,queryParams:[]};(n=(s=this.searchInputConfig)==null?void 0:s.hooks)!=null&&n.beforeAutosuggest&&(a=this.searchInputConfig.hooks.beforeAutosuggest(a)),a&&a.term!==void 0&&a.queryParams!==void 0&&this.suggest(a.term,a.queryParams)}executeLinkClick(e){var s,n,a,i;let u=ue.findResultByUniqueId(e,this.dataLayer.searchResultsValue??[]);u&&((n=(s=this.searchResultsConfig)==null?void 0:s.hooks)!=null&&n.afterLinkClick&&(u=this.searchResultsConfig.hooks.afterLinkClick(u)),u&&(console.log("foundResult",u),this.dataLayer.searchResultsMetadataValue&&st.trackClick({result:u,searchTermValue:this.dataLayer.searchTermValue,trackApiKey:((a=this.searchstaxConfig)==null?void 0:a.trackApiKey)??"",session:this.sessionId,language:((i=this.searchHelper)==null?void 0:i.language)??"",recordsPerPage:this.dataLayer.searchResultsMetadataValue.recordsPerPageValue,totalResults:this.dataLayer.searchResultsMetadataValue.totalResultsValue,currentPage:this.dataLayer.currentPageValue,latencyVal:this.dataLayer.searchResultsMetadataValue.latency})))}}const P={searchstax:new Ct("react")};function Rt(r){return D.useEffect(()=>{if(P.searchstax){const e={};r.beforeSearch&&(e.beforeSearch=r.beforeSearch),r.afterSearch&&(e.afterSearch=r.afterSearch),r.afterAutosuggest&&(e.afterAutosuggest=r.afterAutosuggest),r.beforeAutosuggest&&(e.beforeAutosuggest=r.beforeAutosuggest),P.searchstax.addSearchInputWidget("searchstax-input-container",{suggestAfterMinChars:r.suggestAfterMinChars??3,hooks:e,templates:{searchInputId:r.searchInputId??"searchstax-search-input"}})}else throw Error("Searchstax instance needs to be passed via props")},[]),d.jsx(d.Fragment,{children:d.jsx("div",{id:"searchstax-input-container",children:d.jsxs("div",{className:"searchstax-search-input-container",children:[!r.inputTemplate&&d.jsxs("div",{className:"searchstax-search-input-wrapper",children:[d.jsx("input",{type:"text",id:"searchstax-search-input",className:"searchstax-search-input",placeholder:"SEARCH FOR..."}),d.jsx("button",{className:"searchstax-spinner-icon",id:"searchstax-search-input-action-button"})]}),r.inputTemplate&&d.jsx(d.Fragment,{children:r.inputTemplate()})]})})})}function St(r){return D.useEffect(()=>{P.searchstax.initialize({language:r.language??"en",searchURL:r.searchURL,suggesterURL:r.suggesterURL,trackApiKey:r.trackApiKey,searchAuth:r.searchAuth,authType:r.authType??"basic"}),r.initialized(P.searchstax)},[r.initialized]),d.jsx(d.Fragment,{children:r.children})}function Et(r){const[e,s]=D.useState(null),[n,a]=D.useState(""),[i,u]=D.useState(""),l=(h,p)=>{p.preventDefault(),p.stopPropagation(),P.searchstax.executeLinkClick(h.uniqueId)};return D.useEffect(()=>{const h={};r.afterLinkClick&&(h.afterLinkClick=r.afterLinkClick),P.searchstax.dataLayer.searchResultsObservable.subscribe(p=>{s(p)}),P.searchstax.dataLayer.searchResultsMetadataObservable.subscribe(p=>{u((p==null?void 0:p.spellingSuggestion)??"")}),P.searchstax.dataLayer.searchTermChangeObservable.subscribe(p=>{a(p)}),P.searchstax.addSearchResultsWidget("searchstax-results-container",{searchResultsContainerId:"searchstax-result-container",templates:{},hooks:h})},[]),d.jsx(d.Fragment,{children:d.jsx("div",{id:"searchstax-results-container",children:d.jsx("div",{className:"searchstax-search-results-container",children:d.jsxs("div",{id:"searchstax-result-container",children:[e&&e.length===0&&!r.noResultTemplate&&d.jsxs("div",{children:[d.jsxs("div",{className:"searchstax-no-results",children:["Showing ",d.jsx("strong",{children:"no results"})," for",d.jsxs("strong",{children:['"',n,'"']}),d.jsx("br",{}),i&&d.jsxs("span",{children:[" Did you mean",d.jsx("a",{href:"#",className:"searchstax-suggestion-term",children:i}),"?"]})]}),d.jsxs("div",{children:[d.jsx("p",{children:"Try searching for search related terms or topics. We offer a wide variety of content to help you get the information you need."}),d.jsx("p",{children:"Lost? Click on the ‘X” in the Search Box to reset your search."})]})]}),e&&e.length===0&&r.noResultTemplate&&d.jsx(d.Fragment,{children:r.noResultTemplate(n,i)}),e&&e.length&&!r.resultsTemplate&&d.jsxs("div",{className:"searchstax-search-results",children:[e!==null&&e.map(function(h){return d.jsxs("div",{className:"searchstax-search-result",children:[h.url&&d.jsx("a",{href:h.url,"data-searchstax-unique-result-id":h.uniqueId,onClick:p=>{l(h,p)},className:"searchstax-result-item-link"}),h.ribbon&&d.jsx("div",{className:"searchstax-search-result-ribbon",children:h.ribbon}),h.thumbnail&&d.jsx("img",{src:h.thumbnail,className:"searchstax-thumbnail"}),d.jsx("div",{className:"searchstax-search-result-title-container",children:d.jsx("span",{className:"searchstax-search-result-title",children:h.title})}),h.paths&&d.jsx("p",{className:"searchstax-search-result-common",children:h.paths}),h.description&&d.jsx("p",{className:"searchstax-search-result-description searchstax-search-result-common",children:h.description}),h.unmappedFields.map(function(p){return d.jsxs("div",{children:[p.isImage&&d.jsx("div",{className:"searchstax-search-result-image-container",children:d.jsx("img",{src:p.value,className:"searchstax-result-image"})}),!p.isImage&&d.jsx("div",{children:d.jsx("p",{className:"searchstax-search-result-common",children:p.value})})]},p.value)})]},h.uniqueId)}),e!==null&&e.length&&d.jsx("div",{"v-if":"searchResults && searchResults.length && hasResultSlot"})]}),e&&e.length&&r.resultsTemplate&&d.jsx(d.Fragment,{children:r.resultsTemplate(e,l)})]})})})})}se.SearchstaxInputWidget=Rt,se.SearchstaxResultWidget=Et,se.SearchstaxWrapper=St,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})})(this["@searchstaxInc/searchstudioUxReact"]=this["@searchstaxInc/searchstudioUxReact"]||{},React);
@@ -1,6 +1,6 @@
1
1
  import type { ISearchstaxParsedResult } from '@searchstax-inc/searchstudio-ux-js';
2
2
  declare function SearchstaxResultWidget(props: {
3
- afterLinkClick: (results: ISearchstaxParsedResult[]) => ISearchstaxParsedResult[];
3
+ afterLinkClick: (results: ISearchstaxParsedResult) => ISearchstaxParsedResult;
4
4
  noResultTemplate?: (searchTerm: string, searchSuggestion: string) => React.ReactElement;
5
5
  resultsTemplate?: (results: ISearchstaxParsedResult[], resultClicked: (result: ISearchstaxParsedResult, event: any) => any) => React.ReactElement;
6
6
  }): JSX.Element;
@@ -1,4 +1,4 @@
1
- import Searchstax from '@searchstax-inc/searchstudio-ux-js';
1
+ import type { Searchstax } from '@searchstax-inc/searchstudio-ux-js';
2
2
  declare function SearchstaxWrapper(props: {
3
3
  language?: string;
4
4
  searchURL: string;
@@ -0,0 +1,4 @@
1
+ import { Searchstax } from '@searchstax-inc/searchstudio-ux-js';
2
+ export declare const store: {
3
+ searchstax: Searchstax;
4
+ };
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
1
  {
2
2
  "name": "@searchstax-inc/searchstudio-ux-react",
3
3
  "private": false,
4
- "version": "0.0.3",
4
+ "version": "0.0.6",
5
5
  "type": "module",
6
- "main": "./dist/searchstudio-ux-react-ts.umd.js",
7
- "module": "./dist/searchstudio-ux-react-ts.es.js",
8
- "types": "./dist/main.d.ts",
6
+ "main": "./dist/@searchstax-inc/searchstudio-ux-react-ts.umd.js",
7
+ "module": "./dist/@searchstax-inc/searchstudio-ux-react-ts.es.js",
8
+ "types": "./dist/@searchstax-inc/main.d.ts",
9
9
  "files": [
10
10
  "dist"
11
11
  ],
12
12
  "exports": {
13
13
  ".": {
14
- "import": "./dist/searchstudio-ux-react-ts.es.js",
15
- "require": "./dist/searchstudio-ux-react-ts.umd.js"
14
+ "import": "./dist/@searchstax-inc/searchstudio-ux-react-ts.es.js",
15
+ "require": "./dist/@searchstax-inc/searchstudio-ux-react-ts.umd.js"
16
16
  },
17
- "./dist/searchstudio-ux-react-ts.css": {
18
- "import": "./dist/searchstudio-ux-react-ts.css",
19
- "require": "./dist/searchstudio-ux-react-ts.css"
17
+ "./dist/@searchstax-inc/searchstudio-ux-react-ts.css": {
18
+ "import": "./dist/@searchstax-inc/searchstudio-ux-react-ts.css",
19
+ "require": "./dist/@searchstax-inc/searchstudio-ux-react-ts.css"
20
20
  }
21
21
  },
22
22
  "scripts": {
23
23
  "dev": "vite",
24
- "build": "tsc && vite build",
24
+ "build": "tsc && vite build && cp ./dist/main.d.ts ./dist/@searchstax-inc/searchstudio-ux-react.d.mts && cp ./dist/main.d.ts ./dist/@searchstax-inc/main.d.ts",
25
25
  "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
26
26
  "preview": "vite preview"
27
27
  },
28
28
  "dependencies": {
29
- "@searchstax-inc/searchstudio-ux-js": "^0.0.7",
29
+ "@searchstax-inc/searchstudio-ux-js": "^0.0.9",
30
30
  "react": "^18.2.0",
31
31
  "react-dom": "^18.2.0"
32
32
  },