titaned-frontend-library 1.0.2 → 1.0.3

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,2 @@
1
+ import { ThemeResponse } from '../../../interfaces/components';
2
+ export declare const dynamicTheme: (response: ThemeResponse) => void;
package/dist/index.cjs CHANGED
@@ -1,27 +1,27 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),v=require("@openedx/paragon");function _r(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(s,i,n.get?n:{enumerable:!0,get:()=>t[i]})}}return s.default=t,Object.freeze(s)}const V=_r(w);var we={exports:{}},pe={};/*
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),v=require("@openedx/paragon");function _r(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(s,i,n.get?n:{enumerable:!0,get:()=>t[i]})}}return s.default=t,Object.freeze(s)}const q=_r(y);var we={exports:{}},pe={};/*
2
2
  object-assign
3
3
  (c) Sindre Sorhus
4
4
  @license MIT
5
- */var Oe,Ve;function rr(){if(Ve)return Oe;Ve=1;var t=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function n(m){if(m==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(m)}function y(){try{if(!Object.assign)return!1;var m=new String("abc");if(m[5]="de",Object.getOwnPropertyNames(m)[0]==="5")return!1;for(var j={},p=0;p<10;p++)j["_"+String.fromCharCode(p)]=p;var g=Object.getOwnPropertyNames(j).map(function(o){return j[o]});if(g.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(o){c[o]=o}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Oe=y()?Object.assign:function(m,j){for(var p,g=n(m),c,o=1;o<arguments.length;o++){p=Object(arguments[o]);for(var d in p)s.call(p,d)&&(g[d]=p[d]);if(t){c=t(p);for(var f=0;f<c.length;f++)i.call(p,c[f])&&(g[c[f]]=p[c[f]])}}return g},Oe}/** @license React v17.0.2
5
+ */var Oe,qe;function rr(){if(qe)return Oe;qe=1;var t=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function n(p){if(p==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(p)}function x(){try{if(!Object.assign)return!1;var p=new String("abc");if(p[5]="de",Object.getOwnPropertyNames(p)[0]==="5")return!1;for(var j={},m=0;m<10;m++)j["_"+String.fromCharCode(m)]=m;var g=Object.getOwnPropertyNames(j).map(function(o){return j[o]});if(g.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(o){c[o]=o}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Oe=x()?Object.assign:function(p,j){for(var m,g=n(p),c,o=1;o<arguments.length;o++){m=Object(arguments[o]);for(var d in m)s.call(m,d)&&(g[d]=m[d]);if(t){c=t(m);for(var f=0;f<c.length;f++)i.call(m,c[f])&&(g[c[f]]=m[c[f]])}}return g},Oe}/** @license React v17.0.2
6
6
  * react-jsx-runtime.production.min.js
7
7
  *
8
8
  * Copyright (c) Facebook, Inc. and its affiliates.
9
9
  *
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
- */var We;function Sr(){if(We)return pe;We=1,rr();var t=w,s=60103;if(pe.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var i=Symbol.for;s=i("react.element"),pe.Fragment=i("react.fragment")}var n=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y=Object.prototype.hasOwnProperty,m={key:!0,ref:!0,__self:!0,__source:!0};function j(p,g,c){var o,d={},f=null,b=null;c!==void 0&&(f=""+c),g.key!==void 0&&(f=""+g.key),g.ref!==void 0&&(b=g.ref);for(o in g)y.call(g,o)&&!m.hasOwnProperty(o)&&(d[o]=g[o]);if(p&&p.defaultProps)for(o in g=p.defaultProps,g)d[o]===void 0&&(d[o]=g[o]);return{$$typeof:s,type:p,key:f,ref:b,props:d,_owner:n.current}}return pe.jsx=j,pe.jsxs=j,pe}var Re={};/** @license React v17.0.2
12
+ */var Ve;function Er(){if(Ve)return pe;Ve=1,rr();var t=y,s=60103;if(pe.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var i=Symbol.for;s=i("react.element"),pe.Fragment=i("react.fragment")}var n=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};function j(m,g,c){var o,d={},f=null,w=null;c!==void 0&&(f=""+c),g.key!==void 0&&(f=""+g.key),g.ref!==void 0&&(w=g.ref);for(o in g)x.call(g,o)&&!p.hasOwnProperty(o)&&(d[o]=g[o]);if(m&&m.defaultProps)for(o in g=m.defaultProps,g)d[o]===void 0&&(d[o]=g[o]);return{$$typeof:s,type:m,key:f,ref:w,props:d,_owner:n.current}}return pe.jsx=j,pe.jsxs=j,pe}var Re={};/** @license React v17.0.2
13
13
  * react-jsx-runtime.development.js
14
14
  *
15
15
  * Copyright (c) Facebook, Inc. and its affiliates.
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var Fe;function Er(){return Fe||(Fe=1,(function(t){process.env.NODE_ENV!=="production"&&(function(){var s=w,i=rr(),n=60103,y=60106;t.Fragment=60107;var m=60108,j=60114,p=60109,g=60110,c=60112,o=60113,d=60120,f=60115,b=60116,u=60121,I=60122,U=60117,S=60129,D=60131;if(typeof Symbol=="function"&&Symbol.for){var O=Symbol.for;n=O("react.element"),y=O("react.portal"),t.Fragment=O("react.fragment"),m=O("react.strict_mode"),j=O("react.profiler"),p=O("react.provider"),g=O("react.context"),c=O("react.forward_ref"),o=O("react.suspense"),d=O("react.suspense_list"),f=O("react.memo"),b=O("react.lazy"),u=O("react.block"),I=O("react.server.block"),U=O("react.fundamental"),O("react.scope"),O("react.opaque.id"),S=O("react.debug_trace_mode"),O("react.offscreen"),D=O("react.legacy_hidden")}var G=typeof Symbol=="function"&&Symbol.iterator,$="@@iterator";function X(e){if(e===null||typeof e!="object")return null;var a=G&&e[G]||e[$];return typeof a=="function"?a:null}var H=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(e){{for(var a=arguments.length,l=new Array(a>1?a-1:0),x=1;x<a;x++)l[x-1]=arguments[x];Z("error",e,l)}}function Z(e,a,l){{var x=H.ReactDebugCurrentFrame,T=x.getStackAddendum();T!==""&&(a+="%s",l=l.concat([T]));var k=l.map(function(E){return""+E});k.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,k)}}var ee=!1;function z(e){return!!(typeof e=="string"||typeof e=="function"||e===t.Fragment||e===j||e===S||e===m||e===o||e===d||e===D||ee||typeof e=="object"&&e!==null&&(e.$$typeof===b||e.$$typeof===f||e.$$typeof===p||e.$$typeof===g||e.$$typeof===c||e.$$typeof===U||e.$$typeof===u||e[0]===I))}function L(e,a,l){var x=a.displayName||a.name||"";return e.displayName||(x!==""?l+"("+x+")":l)}function W(e){return e.displayName||"Context"}function A(e){if(e==null)return null;if(typeof e.tag=="number"&&R("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case t.Fragment:return"Fragment";case y:return"Portal";case j:return"Profiler";case m:return"StrictMode";case o:return"Suspense";case d:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case g:var a=e;return W(a)+".Consumer";case p:var l=e;return W(l._context)+".Provider";case c:return L(e,e.render,"ForwardRef");case f:return A(e.type);case u:return A(e._render);case b:{var x=e,T=x._payload,k=x._init;try{return A(k(T))}catch{return null}}}return null}var q=0,C,F,K,Q,oe,J,ne;function ie(){}ie.__reactDisabledLog=!0;function Ne(){{if(q===0){C=console.log,F=console.info,K=console.warn,Q=console.error,oe=console.group,J=console.groupCollapsed,ne=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ie,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}q++}}function je(){{if(q--,q===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:i({},e,{value:C}),info:i({},e,{value:F}),warn:i({},e,{value:K}),error:i({},e,{value:Q}),group:i({},e,{value:oe}),groupCollapsed:i({},e,{value:J}),groupEnd:i({},e,{value:ne})})}q<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ce=H.ReactCurrentDispatcher,le;function se(e,a,l){{if(le===void 0)try{throw Error()}catch(T){var x=T.stack.trim().match(/\n( *(at )?)/);le=x&&x[1]||""}return`
20
- `+le+e}}var ue=!1,ae;{var xe=typeof WeakMap=="function"?WeakMap:Map;ae=new xe}function me(e,a){if(!e||ue)return"";{var l=ae.get(e);if(l!==void 0)return l}var x;ue=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var k;k=ce.current,ce.current=null,Ne();try{if(a){var E=function(){throw Error()};if(Object.defineProperty(E.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(E,[])}catch(te){x=te}Reflect.construct(e,[],E)}else{try{E.call()}catch(te){x=te}e.call(E.prototype)}}else{try{throw Error()}catch(te){x=te}e()}}catch(te){if(te&&x&&typeof te.stack=="string"){for(var _=te.stack.split(`
21
- `),Y=x.stack.split(`
22
- `),P=_.length-1,M=Y.length-1;P>=1&&M>=0&&_[P]!==Y[M];)M--;for(;P>=1&&M>=0;P--,M--)if(_[P]!==Y[M]){if(P!==1||M!==1)do if(P--,M--,M<0||_[P]!==Y[M]){var re=`
23
- `+_[P].replace(" at new "," at ");return typeof e=="function"&&ae.set(e,re),re}while(P>=1&&M>=0);break}}}finally{ue=!1,ce.current=k,je(),Error.prepareStackTrace=T}var he=e?e.displayName||e.name:"",qe=he?se(he):"";return typeof e=="function"&&ae.set(e,qe),qe}function ge(e,a,l){return me(e,!1)}function h(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function N(e,a,l){if(e==null)return"";if(typeof e=="function")return me(e,h(e));if(typeof e=="string")return se(e);switch(e){case o:return se("Suspense");case d:return se("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return ge(e.render);case f:return N(e.type,a,l);case u:return ge(e._render);case b:{var x=e,T=x._payload,k=x._init;try{return N(k(T),a,l)}catch{}}}return""}var B={},de=H.ReactDebugCurrentFrame;function be(e){if(e){var a=e._owner,l=N(e.type,e._source,a?a.type:null);de.setExtraStackFrame(l)}else de.setExtraStackFrame(null)}function ar(e,a,l,x,T){{var k=Function.call.bind(Object.prototype.hasOwnProperty);for(var E in e)if(k(e,E)){var _=void 0;try{if(typeof e[E]!="function"){var Y=Error((x||"React class")+": "+l+" type `"+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[E]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Y.name="Invariant Violation",Y}_=e[E](a,E,x,l,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){_=P}_&&!(_ instanceof Error)&&(be(T),R("%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).",x||"React class",l,E,typeof _),be(null)),_ instanceof Error&&!(_.message in B)&&(B[_.message]=!0,be(T),R("Failed %s type: %s",l,_.message),be(null))}}}var Pe=H.ReactCurrentOwner,_e=Object.prototype.hasOwnProperty,or={key:!0,ref:!0,__self:!0,__source:!0},Ie,Me;function cr(e){if(_e.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function lr(e){if(_e.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function ur(e,a){typeof e.ref=="string"&&Pe.current}function dr(e,a){{var l=function(){Ie||(Ie=!0,R("%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)",a))};l.isReactWarning=!0,Object.defineProperty(e,"key",{get:l,configurable:!0})}}function fr(e,a){{var l=function(){Me||(Me=!0,R("%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)",a))};l.isReactWarning=!0,Object.defineProperty(e,"ref",{get:l,configurable:!0})}}var hr=function(e,a,l,x,T,k,E){var _={$$typeof:n,type:e,key:a,ref:l,props:E,_owner:k};return _._store={},Object.defineProperty(_._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(_,"_self",{configurable:!1,enumerable:!1,writable:!1,value:x}),Object.defineProperty(_,"_source",{configurable:!1,enumerable:!1,writable:!1,value:T}),Object.freeze&&(Object.freeze(_.props),Object.freeze(_)),_};function pr(e,a,l,x,T){{var k,E={},_=null,Y=null;l!==void 0&&(_=""+l),lr(a)&&(_=""+a.key),cr(a)&&(Y=a.ref,ur(a,T));for(k in a)_e.call(a,k)&&!or.hasOwnProperty(k)&&(E[k]=a[k]);if(e&&e.defaultProps){var P=e.defaultProps;for(k in P)E[k]===void 0&&(E[k]=P[k])}if(_||Y){var M=typeof e=="function"?e.displayName||e.name||"Unknown":e;_&&dr(E,M),Y&&fr(E,M)}return hr(e,_,Y,T,x,Pe.current,E)}}var Se=H.ReactCurrentOwner,Ae=H.ReactDebugCurrentFrame;function fe(e){if(e){var a=e._owner,l=N(e.type,e._source,a?a.type:null);Ae.setExtraStackFrame(l)}else Ae.setExtraStackFrame(null)}var Ee;Ee=!1;function Ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function De(){{if(Se.current){var e=A(Se.current.type);if(e)return`
19
+ */var We;function Sr(){return We||(We=1,(function(t){process.env.NODE_ENV!=="production"&&(function(){var s=y,i=rr(),n=60103,x=60106;t.Fragment=60107;var p=60108,j=60114,m=60109,g=60110,c=60112,o=60113,d=60120,f=60115,w=60116,u=60121,I=60122,U=60117,E=60129,D=60131;if(typeof Symbol=="function"&&Symbol.for){var O=Symbol.for;n=O("react.element"),x=O("react.portal"),t.Fragment=O("react.fragment"),p=O("react.strict_mode"),j=O("react.profiler"),m=O("react.provider"),g=O("react.context"),c=O("react.forward_ref"),o=O("react.suspense"),d=O("react.suspense_list"),f=O("react.memo"),w=O("react.lazy"),u=O("react.block"),I=O("react.server.block"),U=O("react.fundamental"),O("react.scope"),O("react.opaque.id"),E=O("react.debug_trace_mode"),O("react.offscreen"),D=O("react.legacy_hidden")}var G=typeof Symbol=="function"&&Symbol.iterator,$="@@iterator";function X(e){if(e===null||typeof e!="object")return null;var a=G&&e[G]||e[$];return typeof a=="function"?a:null}var H=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(e){{for(var a=arguments.length,l=new Array(a>1?a-1:0),b=1;b<a;b++)l[b-1]=arguments[b];Z("error",e,l)}}function Z(e,a,l){{var b=H.ReactDebugCurrentFrame,T=b.getStackAddendum();T!==""&&(a+="%s",l=l.concat([T]));var k=l.map(function(S){return""+S});k.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,k)}}var ee=!1;function F(e){return!!(typeof e=="string"||typeof e=="function"||e===t.Fragment||e===j||e===E||e===p||e===o||e===d||e===D||ee||typeof e=="object"&&e!==null&&(e.$$typeof===w||e.$$typeof===f||e.$$typeof===m||e.$$typeof===g||e.$$typeof===c||e.$$typeof===U||e.$$typeof===u||e[0]===I))}function L(e,a,l){var b=a.displayName||a.name||"";return e.displayName||(b!==""?l+"("+b+")":l)}function V(e){return e.displayName||"Context"}function M(e){if(e==null)return null;if(typeof e.tag=="number"&&R("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case t.Fragment:return"Fragment";case x:return"Portal";case j:return"Profiler";case p:return"StrictMode";case o:return"Suspense";case d:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case g:var a=e;return V(a)+".Consumer";case m:var l=e;return V(l._context)+".Provider";case c:return L(e,e.render,"ForwardRef");case f:return M(e.type);case u:return M(e._render);case w:{var b=e,T=b._payload,k=b._init;try{return M(k(T))}catch{return null}}}return null}var z=0,C,W,K,Q,oe,J,ne;function se(){}se.__reactDisabledLog=!0;function Ne(){{if(z===0){C=console.log,W=console.info,K=console.warn,Q=console.error,oe=console.group,J=console.groupCollapsed,ne=console.groupEnd;var e={configurable:!0,enumerable:!0,value:se,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function je(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:i({},e,{value:C}),info:i({},e,{value:W}),warn:i({},e,{value:K}),error:i({},e,{value:Q}),group:i({},e,{value:oe}),groupCollapsed:i({},e,{value:J}),groupEnd:i({},e,{value:ne})})}z<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ce=H.ReactCurrentDispatcher,le;function ie(e,a,l){{if(le===void 0)try{throw Error()}catch(T){var b=T.stack.trim().match(/\n( *(at )?)/);le=b&&b[1]||""}return`
20
+ `+le+e}}var ue=!1,ae;{var xe=typeof WeakMap=="function"?WeakMap:Map;ae=new xe}function me(e,a){if(!e||ue)return"";{var l=ae.get(e);if(l!==void 0)return l}var b;ue=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var k;k=ce.current,ce.current=null,Ne();try{if(a){var S=function(){throw Error()};if(Object.defineProperty(S.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(S,[])}catch(te){b=te}Reflect.construct(e,[],S)}else{try{S.call()}catch(te){b=te}e.call(S.prototype)}}else{try{throw Error()}catch(te){b=te}e()}}catch(te){if(te&&b&&typeof te.stack=="string"){for(var _=te.stack.split(`
21
+ `),Y=b.stack.split(`
22
+ `),P=_.length-1,A=Y.length-1;P>=1&&A>=0&&_[P]!==Y[A];)A--;for(;P>=1&&A>=0;P--,A--)if(_[P]!==Y[A]){if(P!==1||A!==1)do if(P--,A--,A<0||_[P]!==Y[A]){var re=`
23
+ `+_[P].replace(" at new "," at ");return typeof e=="function"&&ae.set(e,re),re}while(P>=1&&A>=0);break}}}finally{ue=!1,ce.current=k,je(),Error.prepareStackTrace=T}var he=e?e.displayName||e.name:"",ze=he?ie(he):"";return typeof e=="function"&&ae.set(e,ze),ze}function ge(e,a,l){return me(e,!1)}function h(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function N(e,a,l){if(e==null)return"";if(typeof e=="function")return me(e,h(e));if(typeof e=="string")return ie(e);switch(e){case o:return ie("Suspense");case d:return ie("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return ge(e.render);case f:return N(e.type,a,l);case u:return ge(e._render);case w:{var b=e,T=b._payload,k=b._init;try{return N(k(T),a,l)}catch{}}}return""}var B={},de=H.ReactDebugCurrentFrame;function be(e){if(e){var a=e._owner,l=N(e.type,e._source,a?a.type:null);de.setExtraStackFrame(l)}else de.setExtraStackFrame(null)}function ar(e,a,l,b,T){{var k=Function.call.bind(Object.prototype.hasOwnProperty);for(var S in e)if(k(e,S)){var _=void 0;try{if(typeof e[S]!="function"){var Y=Error((b||"React class")+": "+l+" type `"+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[S]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Y.name="Invariant Violation",Y}_=e[S](a,S,b,l,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){_=P}_&&!(_ instanceof Error)&&(be(T),R("%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).",b||"React class",l,S,typeof _),be(null)),_ instanceof Error&&!(_.message in B)&&(B[_.message]=!0,be(T),R("Failed %s type: %s",l,_.message),be(null))}}}var Pe=H.ReactCurrentOwner,_e=Object.prototype.hasOwnProperty,or={key:!0,ref:!0,__self:!0,__source:!0},Ie,Ae;function cr(e){if(_e.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function lr(e){if(_e.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function ur(e,a){typeof e.ref=="string"&&Pe.current}function dr(e,a){{var l=function(){Ie||(Ie=!0,R("%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)",a))};l.isReactWarning=!0,Object.defineProperty(e,"key",{get:l,configurable:!0})}}function fr(e,a){{var l=function(){Ae||(Ae=!0,R("%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)",a))};l.isReactWarning=!0,Object.defineProperty(e,"ref",{get:l,configurable:!0})}}var hr=function(e,a,l,b,T,k,S){var _={$$typeof:n,type:e,key:a,ref:l,props:S,_owner:k};return _._store={},Object.defineProperty(_._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(_,"_self",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.defineProperty(_,"_source",{configurable:!1,enumerable:!1,writable:!1,value:T}),Object.freeze&&(Object.freeze(_.props),Object.freeze(_)),_};function pr(e,a,l,b,T){{var k,S={},_=null,Y=null;l!==void 0&&(_=""+l),lr(a)&&(_=""+a.key),cr(a)&&(Y=a.ref,ur(a,T));for(k in a)_e.call(a,k)&&!or.hasOwnProperty(k)&&(S[k]=a[k]);if(e&&e.defaultProps){var P=e.defaultProps;for(k in P)S[k]===void 0&&(S[k]=P[k])}if(_||Y){var A=typeof e=="function"?e.displayName||e.name||"Unknown":e;_&&dr(S,A),Y&&fr(S,A)}return hr(e,_,Y,T,b,Pe.current,S)}}var Ee=H.ReactCurrentOwner,Me=H.ReactDebugCurrentFrame;function fe(e){if(e){var a=e._owner,l=N(e.type,e._source,a?a.type:null);Me.setExtraStackFrame(l)}else Me.setExtraStackFrame(null)}var Se;Se=!1;function Ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function De(){{if(Ee.current){var e=M(Ee.current.type);if(e)return`
24
24
 
25
25
  Check the render method of \``+e+"`."}return""}}function mr(e){return""}var $e={};function gr(e){{var a=De();if(!a){var l=typeof e=="string"?e:e.displayName||e.name;l&&(a=`
26
26
 
27
- Check the top-level render call using <`+l+">.")}return a}}function Le(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var l=gr(a);if($e[l])return;$e[l]=!0;var x="";e&&e._owner&&e._owner!==Se.current&&(x=" It was passed a child from "+A(e._owner.type)+"."),fe(e),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',l,x),fe(null)}}function He(e,a){{if(typeof e!="object")return;if(Array.isArray(e))for(var l=0;l<e.length;l++){var x=e[l];Ce(x)&&Le(x,a)}else if(Ce(e))e._store&&(e._store.validated=!0);else if(e){var T=X(e);if(typeof T=="function"&&T!==e.entries)for(var k=T.call(e),E;!(E=k.next()).done;)Ce(E.value)&&Le(E.value,a)}}}function vr(e){{var a=e.type;if(a==null||typeof a=="string")return;var l;if(typeof a=="function")l=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===c||a.$$typeof===f))l=a.propTypes;else return;if(l){var x=A(a);ar(l,e.props,"prop",x,e)}else if(a.PropTypes!==void 0&&!Ee){Ee=!0;var T=A(a);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function xr(e){{for(var a=Object.keys(e.props),l=0;l<a.length;l++){var x=a[l];if(x!=="children"&&x!=="key"){fe(e),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",x),fe(null);break}}e.ref!==null&&(fe(e),R("Invalid attribute `ref` supplied to `React.Fragment`."),fe(null))}}function ze(e,a,l,x,T,k){{var E=z(e);if(!E){var _="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(_+=" 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 Y=mr();Y?_+=Y:_+=De();var P;e===null?P="null":Array.isArray(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(A(e.type)||"Unknown")+" />",_=" Did you accidentally export a JSX literal instead of a component?"):P=typeof e,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",P,_)}var M=pr(e,a,l,T,k);if(M==null)return M;if(E){var re=a.children;if(re!==void 0)if(x)if(Array.isArray(re)){for(var he=0;he<re.length;he++)He(re[he],e);Object.freeze&&Object.freeze(re)}else R("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 He(re,e)}return e===t.Fragment?xr(M):vr(M),M}}function br(e,a,l){return ze(e,a,l,!0)}function wr(e,a,l){return ze(e,a,l,!1)}var yr=wr,jr=br;t.jsx=yr,t.jsxs=jr})()})(Re)),Re}var Ke;function Cr(){return Ke||(Ke=1,process.env.NODE_ENV==="production"?we.exports=Sr():we.exports=Er()),we.exports}var r=Cr();const Or=({contactInfo:t,quickLinks:s,exploreLinks:i,logoUrl:n,copyrights:y})=>{const m=j=>j??"left";return r.jsxs("footer",{className:"footer",children:[r.jsxs("div",{className:"container",children:[r.jsxs("div",{className:`section ${m(t.align)}`,children:[r.jsx("div",{className:"footer-brand-logo",children:r.jsx("img",{src:n,alt:"Logo"})}),r.jsx("p",{children:t.content.shortdesc}),r.jsxs("p",{children:[t.content.location.label,", ",t.content.location.value]}),r.jsxs("p",{children:["📞 ",t.content.phonenumber]})]}),r.jsx("div",{className:`section ${m(s.align)}`,children:r.jsxs("ul",{children:[r.jsx("h3",{children:"Quick Links"}),s.content.map((j,p)=>r.jsx("li",{children:r.jsx("a",{href:j.link,children:j.label})},p))]})}),r.jsx("div",{className:`section ${m(i.align)}`,children:r.jsxs("ul",{children:[r.jsx("h3",{children:"Explore"}),i.content.map((j,p)=>r.jsx("li",{children:r.jsx("a",{href:j.link,children:j.label})},p))]})})]}),r.jsx("div",{className:"copyright",children:r.jsx("p",{children:y})})]})},tr=w.createContext(void 0),Rr=({children:t})=>{const[s,i]=w.useState(!1),n=()=>{i(m=>!m)},y=m=>{i(m)};return r.jsx(tr.Provider,{value:{isCollapsed:s,toggleSidebar:n,setSidebarCollapsed:y},children:t})},Te=()=>{const t=w.useContext(tr);if(t===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return t},kr=({buttons:t,onNavigate:s,presentPath:i})=>{const{isCollapsed:n,setSidebarCollapsed:y}=Te(),[m,j]=w.useState(!0),p=w.useRef(null),[g,c]=w.useState(()=>document.dir==="rtl"||document.documentElement.dir==="rtl");return w.useEffect(()=>{const o=()=>{c(document.dir==="rtl"||document.documentElement.dir==="rtl")},d=new MutationObserver(o);return d.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),()=>d.disconnect()},[]),w.useEffect(()=>{const o=t.some(d=>d.path===i);j(o),!o&&!n&&i.includes("/course/")&&y(!0)},[i]),w.useEffect(()=>{const o=d=>{!m&&p.current&&!p.current.contains(d.target)&&i.includes("/course/")&&(n||y(!0))};return document.addEventListener("mousedown",o),()=>{document.removeEventListener("mousedown",o)}},[m,n,y]),r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`sidebar ${n?"collapsed":""}`,ref:p,children:r.jsx("div",{className:"sidebar-buttons",children:t.map(o=>{const d=o.path===i||(i.includes("/course/")||i.includes("/course_rerun/"))&&o.path==="/my-courses"||i.includes("/library/")&&o.path==="/libraries"||i.includes("/taxonomy/")&&o.path==="/taxonomies";return r.jsx(v.OverlayTrigger,{placement:g?"left":"right",overlay:r.jsx(v.Tooltip,{id:`tooltip-${o.path}`,children:o.label}),show:n?void 0:!1,popperConfig:{modifiers:[{name:"preventOverflow",options:{altAxis:!0,boundary:"viewport"}}]},children:r.jsx(v.Button,{variant:"tertiary",className:`sidebar-btn ${d?"pgn-btn-active":"pgn-btn-inactive"}`,onClick:()=>s(o.path),children:r.jsxs("div",{className:"btn-content",children:[r.jsx("span",{className:"icon-container",children:o.icon}),r.jsx("span",{className:"btn-label",children:o.label})]})})},o.path)})})}),!m&&!n&&r.jsx("div",{className:"sidebar-extra-space"})]})},Tr=(t=768)=>{const[s,i]=w.useState(!1);return w.useEffect(()=>{const n=()=>{i(window.innerWidth<=t)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[t]),s},Ye=t=>V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},V.createElement("path",{d:"M10.09 15.59 11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM21 3H3v6h2V5h14v14H5v-4H3v6h18V3z",fill:"currentColor"})),Je=t=>V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},V.createElement("path",{d:"M21 3H3v18h18V3zm-8.99 15c-.7 0-1.26-.56-1.26-1.26 0-.71.56-1.25 1.26-1.25.71 0 1.25.54 1.25 1.25-.01.69-.54 1.26-1.25 1.26zm3.01-7.4c-.76 1.11-1.48 1.46-1.87 2.17-.16.29-.22.48-.22 1.41h-1.82c0-.49-.08-1.29.31-1.98.49-.87 1.42-1.39 1.96-2.16.57-.81.25-2.33-1.37-2.33-1.06 0-1.58.8-1.8 1.48l-1.65-.7C9.01 7.15 10.22 6 11.99 6c1.48 0 2.49.67 3.01 1.52.44.72.7 2.07.02 3.08z",fill:"currentColor"})),Nr=t=>V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},V.createElement("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z",fill:"currentColor"})),Pr=t=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2Zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z",fill:"currentColor"})),Ue=t=>V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},V.createElement("path",{d:"M12 22c1.1 0 2-.9 2-2h-4a2 2 0 0 0 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V2.5h-3v2.18C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z",fill:"currentColor"})),Ir=t=>V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},V.createElement("path",{d:"M19 19H5V5h7V3H3v18h18v-9h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z",fill:"currentColor"})),Mr=t=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},V.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5Zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14Z",fill:"currentColor"})),Ge=t=>V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},V.createElement("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z",fill:"currentColor"})),Ar=({id:t,buttonTitle:s,items:i})=>(console.log("NavDropdownMenu Props:",i),r.jsx(v.DropdownButton,{id:t,title:s,variant:"tertiary",className:"mr-2",children:i.map(n=>r.jsx(v.Dropdown.Item,{href:n.href,as:"a",className:"small",children:n.title},`${n.title}-dropdown-item`))})),Xe=({username:t,authenticatedUserAvatar:s,isMobile:i,menuItems:n})=>{const y=s?r.jsx("img",{className:"d-block w-100 h-100",src:s,alt:t,"data-testid":"avatar-image"}):r.jsx(v.Avatar,{size:"sm",className:"mr-2",alt:"avatar","data-testid":"avatar-icon"}),m=i?y:r.jsxs(r.Fragment,{children:[t,"   ",y]});return r.jsx(Ar,{buttonTitle:m,id:"user-dropdown-menu",items:n})};var ve={},Ze;function Dr(){if(Ze)return ve;Ze=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.parse=j,ve.serialize=c;const t=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,s=/^[\u0021-\u003A\u003C-\u007E]*$/,i=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,y=Object.prototype.toString,m=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function j(f,b){const u=new m,I=f.length;if(I<2)return u;const U=(b==null?void 0:b.decode)||o;let S=0;do{const D=f.indexOf("=",S);if(D===-1)break;const O=f.indexOf(";",S),G=O===-1?I:O;if(D>G){S=f.lastIndexOf(";",D-1)+1;continue}const $=p(f,S,D),X=g(f,D,$),H=f.slice($,X);if(u[H]===void 0){let R=p(f,D+1,G),Z=g(f,G,R);const ee=U(f.slice(R,Z));u[H]=ee}S=G+1}while(S<I);return u}function p(f,b,u){do{const I=f.charCodeAt(b);if(I!==32&&I!==9)return b}while(++b<u);return u}function g(f,b,u){for(;b>u;){const I=f.charCodeAt(--b);if(I!==32&&I!==9)return b+1}return u}function c(f,b,u){const I=(u==null?void 0:u.encode)||encodeURIComponent;if(!t.test(f))throw new TypeError(`argument name is invalid: ${f}`);const U=I(b);if(!s.test(U))throw new TypeError(`argument val is invalid: ${b}`);let S=f+"="+U;if(!u)return S;if(u.maxAge!==void 0){if(!Number.isInteger(u.maxAge))throw new TypeError(`option maxAge is invalid: ${u.maxAge}`);S+="; Max-Age="+u.maxAge}if(u.domain){if(!i.test(u.domain))throw new TypeError(`option domain is invalid: ${u.domain}`);S+="; Domain="+u.domain}if(u.path){if(!n.test(u.path))throw new TypeError(`option path is invalid: ${u.path}`);S+="; Path="+u.path}if(u.expires){if(!d(u.expires)||!Number.isFinite(u.expires.valueOf()))throw new TypeError(`option expires is invalid: ${u.expires}`);S+="; Expires="+u.expires.toUTCString()}if(u.httpOnly&&(S+="; HttpOnly"),u.secure&&(S+="; Secure"),u.partitioned&&(S+="; Partitioned"),u.priority)switch(typeof u.priority=="string"?u.priority.toLowerCase():void 0){case"low":S+="; Priority=Low";break;case"medium":S+="; Priority=Medium";break;case"high":S+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${u.priority}`)}if(u.sameSite)switch(typeof u.sameSite=="string"?u.sameSite.toLowerCase():u.sameSite){case!0:case"strict":S+="; SameSite=Strict";break;case"lax":S+="; SameSite=Lax";break;case"none":S+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${u.sameSite}`)}return S}function o(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch{return f}}function d(f){return y.call(f)==="[object Date]"}return ve}var ye=Dr();function $r(){const t=typeof global>"u"?void 0:global.TEST_HAS_DOCUMENT_COOKIE;return typeof t=="boolean"?t:typeof document=="object"&&typeof document.cookie=="string"}function Lr(t){return typeof t=="string"?ye.parse(t):typeof t=="object"&&t!==null?t:{}}function ke(t,s={}){const i=Hr(t);if(!s.doNotParse)try{return JSON.parse(i)}catch{}return t}function Hr(t){return t&&t[0]==="j"&&t[1]===":"?t.substr(2):t}class zr{constructor(s,i={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const y=this.cookies;this.cookies=ye.parse(document.cookie),this._checkChanges(y)};const n=typeof document>"u"?"":document.cookie;this.cookies=Lr(s||n),this.defaultSetOptions=i,this.HAS_DOCUMENT_COOKIE=$r()}_emitChange(s){for(let i=0;i<this.changeListeners.length;++i)this.changeListeners[i](s)}_checkChanges(s){new Set(Object.keys(s).concat(Object.keys(this.cookies))).forEach(n=>{s[n]!==this.cookies[n]&&this._emitChange({name:n,value:ke(this.cookies[n])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(s,i={}){return i.doNotUpdate||this.update(),ke(this.cookies[s],i)}getAll(s={}){s.doNotUpdate||this.update();const i={};for(let n in this.cookies)i[n]=ke(this.cookies[n],s);return i}set(s,i,n){n?n=Object.assign(Object.assign({},this.defaultSetOptions),n):n=this.defaultSetOptions;const y=typeof i=="string"?i:JSON.stringify(i);this.cookies=Object.assign(Object.assign({},this.cookies),{[s]:y}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=ye.serialize(s,y,n)),this._emitChange({name:s,value:i,options:n})}remove(s,i){const n=i=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),i),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[s],this.HAS_DOCUMENT_COOKIE&&(document.cookie=ye.serialize(s,"",n)),this._emitChange({name:s,value:void 0,options:i})}addChangeListener(s){this.changeListeners.push(s),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(s){const i=this.changeListeners.indexOf(s);i>=0&&this.changeListeners.splice(i,1),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===0&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}removeAllChangeListeners(){for(;this.changeListeners.length>0;)this.removeChangeListener(this.changeListeners[0])}}class qr{constructor(s){if(!s.host)throw new Error("MeiliSearch host is required");if(!s.apiKey)throw new Error("MeiliSearch apiKey is required");if(!s.indexName)throw new Error("MeiliSearch indexName is required");this.config=s,this.headers={"Content-Type":"application/json",Authorization:`Bearer ${s.apiKey}`,"X-Meilisearch-Client":"Meilisearch JavaScript (v0.41.0)"}}updateHeadersFromClient(s){s&&s.httpRequest&&s.httpRequest.headers&&(this.headers={"Content-Type":s.httpRequest.headers["Content-Type"]||"application/json",Authorization:s.httpRequest.headers.Authorization||`Bearer ${this.config.apiKey}`,"X-Meilisearch-Client":s.httpRequest.headers["X-Meilisearch-Client"]||"Meilisearch JavaScript (v0.41.0)"})}async search(s,i={}){const{limit:n=20,offset:y=0,filter:m=['type = "course_block"'],attributesToHighlight:j=["display_name","description","published"],attributesToCrop:p=["description","published"],sort:g=[]}=i;if(!this.config.indexName)throw new Error("MeiliSearch indexName is required");const c={queries:[{indexUid:this.config.indexName,q:s,filter:[[],...m],attributesToHighlight:j,highlightPreTag:"__meili-highlight__",highlightPostTag:"__/meili-highlight__",attributesToCrop:p,sort:g,offset:y,limit:n},{indexUid:this.config.indexName,facets:["block_type","content.problem_types"],filter:m,limit:0}]},o={...this.headers};try{const d=await fetch(`${this.config.host}/multi-search`,{method:"POST",headers:o,body:JSON.stringify(c)});if(!d.ok)throw new Error(`MeiliSearch API error: ${d.status} ${d.statusText}`);const f=await d.json(),b=f.results[0],u=f.results[1];return{hits:b.hits||[],totalHits:b.estimatedTotalHits||0,facets:u.facetDistribution,processingTimeMs:b.processingTimeMs}}catch(d){throw console.error("MeiliSearch service error:",d),new Error(`Search failed: ${d instanceof Error?d.message:"Unknown error"}`)}}async simpleSearch(s,i={}){const{limit:n=20,offset:y=0,filter:m=['type = "course_block"'],attributesToHighlight:j=["display_name","description","published"],attributesToCrop:p=["description","published"],sort:g=[]}=i,c={queries:[{indexUid:this.config.indexName,q:s,filter:[[],...m],attributesToHighlight:j,highlightPreTag:"__meili-highlight__",highlightPostTag:"__/meili-highlight__",attributesToCrop:p,sort:g,offset:y,limit:n}]},o={...this.headers};try{const d=await fetch(`${this.config.host}/multi-search`,{method:"POST",headers:o,body:JSON.stringify(c)});if(!d.ok)throw new Error(`MeiliSearch API error: ${d.status} ${d.statusText}`);const b=(await d.json()).results[0];return{hits:b.hits||[],totalHits:b.estimatedTotalHits||0,processingTimeMs:b.processingTimeMs}}catch(d){throw console.error("MeiliSearch service error:",d),new Error(`Search failed: ${d instanceof Error?d.message:"Unknown error"}`)}}async checkConnection(){try{return(await fetch(`${this.config.host}/health`,{method:"GET",headers:{Authorization:`Bearer ${this.config.apiKey}`,"X-Meilisearch-Client":"Meilisearch JavaScript (v0.41.0)"}})).ok}catch(s){return console.error("MeiliSearch connection check failed:",s),!1}}}const nr=t=>new qr(t);function ir(t,s){const{contextKey:i,usageKey:n}=t;return i?i.startsWith("course-v1:")?`${s||""}/course/${i}?show=${encodeURIComponent(n||"")}`:i.startsWith("library-v1:")?`${s||""}/library/${i}`:"#":"#"}function Vr(t,s,i){const n=ir(t,s);return n==="#"?(console.warn("Could not generate URL for search hit:",t),"#"):(i?i(n):(n.startsWith("http"),window.location.href=n),n)}const Qe=({text:t,highlightTag:s="__meili-highlight__"})=>{if(!t)return null;const i="__/meili-highlight__",n=t.split(s),y=[];return n.forEach((m,j)=>{if(j===0)m&&y.push(m);else{const p=m.indexOf(i);if(p!==-1){const g=m.substring(0,p),c=m.substring(p+i.length);g&&y.push(r.jsx("mark",{className:"search-highlight",children:g},`highlight-${j}`)),c&&y.push(c)}else y.push(r.jsx("mark",{className:"search-highlight",children:m},`highlight-${j}`))}}),r.jsx(r.Fragment,{children:y})};function Wr(t){return{html:"text",video:"video",problem:"quiz",vertical:"folder",sequential:"folder",chapter:"folder",about:"info",static_tab:"text",openassessment:"quiz",lti_consumer:"link",pdf:"file",scorm:"file",itembank:"library",library_content:"library"}[t]||"text"}const Be=({result:t,onNavigate:s,baseUrl:i})=>{var g,c;const n=o=>{var b;o.preventDefault(),o.stopPropagation();const d={id:t.id,blockType:t.block_type||t.type,contextKey:t.context_key,usageKey:t.usage_key,breadcrumbs:((b=t.breadcrumbs)==null?void 0:b.map(u=>({displayName:u.display_name,usageKey:u.usage_key})))||[]};if(t.url){s?s(t.url):window.location.href=t.url;return}Vr(d,i,s)==="#"&&(s?s(`/search-result/${t.id}`):window.location.href=`/search-result/${t.id}`)},y=o=>{var b;o.preventDefault(),o.stopPropagation();const d={id:t.id,blockType:t.block_type||t.type,contextKey:t.context_key,usageKey:t.usage_key,breadcrumbs:((b=t.breadcrumbs)==null?void 0:b.map(u=>({displayName:u.display_name,usageKey:u.usage_key})))||[]},f=ir(d,i);f&&f!=="#"&&window.open(f,"_blank")},m=((g=t._formatted)==null?void 0:g.display_name)||t.display_name,j=((c=t._formatted)==null?void 0:c.description)||t.description,p=t.block_type||t.type;return r.jsx("div",{className:"search-result-item",onClick:n,role:"button",tabIndex:0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&n(o)},children:r.jsxs("div",{className:"search-result-content",children:[r.jsx("div",{className:"search-result-icon",children:r.jsx(v.Icon,{src:Wr(p)})}),r.jsxs("div",{className:"search-result-text",children:[r.jsx("div",{className:"search-result-title",children:r.jsx(Qe,{text:m})}),j&&r.jsx("div",{className:"search-result-description",children:r.jsx(Qe,{text:j})}),t.breadcrumbs&&t.breadcrumbs.length>0&&r.jsx("div",{className:"search-result-breadcrumbs",children:t.breadcrumbs.map(o=>o.display_name).join(" / ")})]}),r.jsx("div",{className:"search-result-actions",children:r.jsx(v.IconButton,{src:Ir,iconAs:v.Icon,onClick:y,alt:"Open in new window",size:"sm"})})]})})},er=new zr,Fr=({logoUrl:t,menuList:s,loginSignupButtons:i,authenticatedUser:n=null,userMenuItems:y,menuAlignment:m,onLanguageChange:j,getBaseUrl:p,meiliSearchConfig:g,headerButtons:c,languageSelectorList:o})=>{const d=Tr(),{toggleSidebar:f,setSidebarCollapsed:b}=Te(),[u,I]=w.useState(()=>er.get("openedx-language-preference")||"en"),[U,S]=w.useState(!1),[D,O]=w.useState(!1),[G,$]=w.useState(!1),[X,H]=w.useState(""),[R,Z]=w.useState([]),[ee,z]=w.useState(!1),[L,W]=w.useState(null),[A,q]=w.useState(0),[C,F]=w.useState(!1),[K,Q]=w.useState(5),oe=w.useRef(null),J=w.useRef(null),ne=w.useRef(g?nr(g):null);console.log("languageSelectorList",o),w.useEffect(()=>{g!=null&&g.client&&ne.current&&ne.current.updateHeadersFromClient(g.client)},[g==null?void 0:g.client]),w.useEffect(()=>()=>{J.current&&clearTimeout(J.current)},[]),w.useEffect(()=>{document.body.dir=u==="ar"?"rtl":"ltr"},[u]),w.useEffect(()=>{d&&b(!0)},[d,b]),w.useEffect(()=>{if(!D)return;function h(N){oe.current&&!oe.current.contains(N.target)&&O(!1)}return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[D]);const ie=h=>{I(h),er.set("openedx-language-preference",h,{path:p?p():"/"}),j&&j()},je=m&&{left:"justify-content-start",center:"justify-content-center",right:"justify-content-end"}[m.toLowerCase()]||"justify-content-start",ce=async h=>{if(!h.trim()||!g||!ne.current){Z([]),q(0),$(!1),F(!1);return}z(!0),W(null),$(!1),Q(5);try{const N=await ne.current.simpleSearch(h,{limit:20,offset:0});Z(N.hits),q(N.totalHits),$(N.totalHits===0),F(!0)}catch(N){W(N instanceof Error?N.message:"Search failed"),$(!0),Z([]),q(0)}finally{z(!1)}},le=h=>{H(h),ce(h),d&&U&&S(!1)},se=h=>{H(h),G&&h.trim()===""&&($(!1),F(!1)),J.current&&clearTimeout(J.current),h.trim().length>0?J.current=setTimeout(()=>{ce(h)},500):(Z([]),q(0),$(!1),F(!1))},ue=()=>{J.current&&(clearTimeout(J.current),J.current=null),H(""),Z([]),q(0),$(!1),F(!1),W(null),z(!1)},ae=()=>{H(""),Z([]),q(0),$(!1),F(!1),W(null),z(!1),Q(5),J.current&&(clearTimeout(J.current),J.current=null)},xe=()=>{Q(h=>Math.min(h+10,R.length))},me=h=>{if(o&&o.length>0){const B=o.find(de=>de[h]);if(B)return B[h]}return{en:"English",ar:"Arabic",hi:"Hindi"}[h]||h.toUpperCase()},ge=()=>(console.log("renderLanguageOptions - languageSelectorList:",o),console.log("renderLanguageOptions - length:",o==null?void 0:o.length),o&&o.length>0?(console.log("Using custom languageSelectorList"),o.map((h,N)=>{const[B,de]=Object.entries(h)[0];return r.jsx(v.Dropdown.Item,{onClick:()=>ie(B),children:de},`lang-${B}-${N}`)})):(console.log("Using fallback languages"),r.jsxs(r.Fragment,{children:[r.jsx(v.Dropdown.Item,{onClick:()=>ie("en"),children:"English"}),r.jsx(v.Dropdown.Item,{onClick:()=>ie("ar"),children:"Arabic"}),r.jsx(v.Dropdown.Item,{onClick:()=>ie("hi"),children:"Hindi"})]})));return r.jsxs(v.Navbar,{expand:"lg",className:"navbarContainer py-1",children:[r.jsxs("div",{className:"d-flex align-items-center",children:[r.jsx("div",{className:"toggle-sidebar-icon",children:r.jsx(v.IconButton,{src:Nr,iconAs:v.Icon,alt:"Toggle Sidebar",onClick:f,className:"ms-2 ml-2",onMouseDown:h=>h.stopPropagation()})}),r.jsx(v.Navbar.Brand,{href:"/",className:"navbar-brand",children:r.jsx("img",{src:t,alt:"Logo"})})]}),n!==null&&r.jsx(r.Fragment,{children:d?r.jsx("div",{className:"d-flex justify-content-between align-items-center ml-auto",children:r.jsxs("div",{className:"d-flex align-items-center navbar-buttons",children:[g&&r.jsx(v.IconButton,{src:Mr,iconAs:v.Icon,alt:"Search",onClick:()=>S(!0)}),r.jsx("div",{className:"ml-2 usermenu-dropdown-mobile",children:r.jsx(Xe,{username:n==null?void 0:n.username,authenticatedUserAvatar:n==null?void 0:n.avatar,isMobile:d,isAdmin:n==null?void 0:n.administrator,menuItems:y})}),r.jsx(v.IconButton,{src:Pr,iconAs:v.Icon,alt:"More",onMouseDown:h=>h.stopPropagation(),onClick:()=>O(h=>!h)}),D&&r.jsxs("div",{className:"more-menu-dropdown",ref:oe,children:[r.jsxs("div",{className:"more-menu-icons-row",children:[(c==null?void 0:c.reSync)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ge,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Re-Sync"})}),(c==null?void 0:c.contextSwitcher)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ye,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Switch to User Mode"})}),(c==null?void 0:c.help)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Je,iconAs:v.Icon,alt:"Help",tooltipPlacement:"bottom",tooltipContent:"Help"})}),(c==null?void 0:c.notification)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ue,iconAs:v.Icon,alt:"Notifications",tooltipPlacement:"bottom",tooltipContent:"Notifications"})})]}),(c==null?void 0:c.translation)&&r.jsxs(v.Dropdown,{className:"language-dropdown",children:[r.jsx(v.Dropdown.Toggle,{variant:"tertiary",id:"language-dropdown",children:me(u)}),r.jsx(v.Dropdown.Menu,{children:ge()})]})]})]})}):r.jsxs(r.Fragment,{children:[g&&r.jsx("div",{className:"d-flex align-items-center justify-content-start flex-grow-1 ml-4",children:r.jsxs("div",{style:{width:"30rem",position:"relative"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",border:"2px solid #ccc",borderRadius:"25px",padding:"8px 16px",background:"#fff",position:"relative"},children:[r.jsx("input",{type:"text",value:X,onChange:h=>{se(h.target.value)},onKeyDown:h=>{h.key==="Enter"&&le(X)},placeholder:"Search",style:{flex:1,border:"none",outline:"none",fontSize:"16px",background:"transparent",padding:"4px"},autoComplete:"off"}),X&&r.jsx("button",{type:"button",onClick:()=>{ue()},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",marginRight:"8px"},children:"✕"})]}),ee&&r.jsxs("div",{className:"search-loading-spinner-container",children:[r.jsx("div",{className:"search-loading-spinner"}),r.jsx("span",{children:"Searching..."})]}),G&&!ee&&r.jsx("div",{className:"no-results-message-desktop",children:r.jsx("p",{children:"We didn't find anything matching your search"})}),L&&r.jsx("div",{className:"search-error-message-desktop",children:r.jsxs("p",{children:["Search error: ",L]})}),C&&R.length>0&&r.jsxs("div",{className:"search-results-dropdown",children:[r.jsx("div",{className:"search-results-header",children:r.jsxs("span",{children:[A," result",A!==1?"s":""," found"]})}),r.jsxs("div",{className:"search-results-list",children:[R.slice(0,K).map((h,N)=>r.jsx(Be,{result:h,onNavigate:B=>{ae(),window.location.href=B},baseUrl:p?p():void 0},h.id||N)),K<R.length&&r.jsx("div",{className:"search-results-more",children:r.jsxs("button",{onClick:xe,style:{background:"none",border:"none",color:"#007bff",cursor:"pointer",padding:"8px 16px",width:"100%",textAlign:"center",fontSize:"14px"},children:["Show ",Math.min(10,R.length-K)," more results"]})})]})]})]})}),r.jsxs("div",{className:"d-flex align-items-center gap-2 ms-auto order-lg-3",children:[(c==null?void 0:c.reSync)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ge,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Re-Sync"})}),(c==null?void 0:c.contextSwitcher)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ye,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Switch to User Mode"})}),(c==null?void 0:c.help)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Je,iconAs:v.Icon,alt:"Help",tooltipPlacement:"bottom",tooltipContent:"Help"})}),(c==null?void 0:c.notification)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ue,iconAs:v.Icon,alt:"Notifications",tooltipPlacement:"bottom",tooltipContent:"Notifications"})}),(c==null?void 0:c.translation)&&r.jsxs(v.Dropdown,{className:"language-dropdown",children:[r.jsx(v.Dropdown.Toggle,{variant:"tertiary",id:"language-dropdown",children:me(u)}),r.jsx(v.Dropdown.Menu,{children:ge()})]}),r.jsx("div",{className:"usermenu-dropdown",children:r.jsx(Xe,{username:n==null?void 0:n.username,authenticatedUserAvatar:n==null?void 0:n.avatar,isMobile:d,isAdmin:n==null?void 0:n.administrator,menuItems:y})})]})]})}),n===null&&r.jsxs(r.Fragment,{children:[r.jsx(v.Navbar.Toggle,{"aria-controls":"main-navbar-nav"}),r.jsx("div",{className:"d-flex align-items-center gap-2 ms-auto order-lg-3",children:i&&r.jsxs(r.Fragment,{children:[r.jsx(v.Button,{variant:"primary",children:"Log In"}),r.jsx(v.Button,{variant:"outline-primary",children:"Sign Up"})]})})]}),r.jsx(v.Navbar.Collapse,{id:"main-navbar-nav",className:"justify-content-between",children:r.jsx(v.Nav,{className:`nav-gap gap-3 flex-grow-1 ${je}`,children:n===null&&s.map(h=>h.subMenu?r.jsx(v.NavDropdown,{title:h.label,id:`nav-dropdown-${h.label}`,children:h.subMenu.map(N=>r.jsx(v.NavDropdown.Item,{onClick:()=>console.log("Selected submenu:",N.label),children:N.label},`sub-${N.label}`))},`menu-${h.label}`):r.jsx(v.Nav.Link,{as:"span",className:"text-uppercase fw-semibold",children:h.label},`menu-${h.label}`))})}),g&&U&&r.jsxs("div",{className:"fixed-search-bar",children:[r.jsxs("div",{className:"fixed-search-bar-inner",children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",border:"2px solid #ccc",borderRadius:"25px",padding:"12px 16px",background:"#fff",position:"relative",width:"100%"},children:[r.jsx("input",{type:"text",value:X,onChange:h=>{se(h.target.value)},onKeyDown:h=>{h.key==="Enter"&&le(X)},placeholder:"Search",style:{flex:1,border:"none",outline:"none",fontSize:"18px",background:"transparent",padding:"4px"},autoComplete:"off",autoFocus:!0}),X&&r.jsx("button",{type:"button",onClick:()=>{ue()},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",marginRight:"8px",fontSize:"18px"},children:"✕"})]}),r.jsx("button",{className:"close-search-bar",type:"button",onClick:()=>S(!1),"aria-label":"Close Search",children:"×"})]}),ee&&r.jsxs("div",{className:"search-loading-spinner-container",children:[r.jsx("div",{className:"search-loading-spinner"}),r.jsx("span",{children:"Searching..."})]}),G&&!ee&&r.jsx("div",{className:"no-results-message",children:r.jsx("p",{children:"We didn't find anything matching your search"})}),L&&r.jsx("div",{className:"search-error-message",children:r.jsxs("p",{children:["Search error: ",L]})}),C&&R.length>0&&r.jsxs("div",{className:"search-results-mobile",children:[r.jsx("div",{className:"search-results-header",children:r.jsxs("span",{children:[A," result",A!==1?"s":""," found"]})}),r.jsxs("div",{className:"search-results-list",children:[R.slice(0,K).map((h,N)=>r.jsx(Be,{result:h,onNavigate:B=>{ae(),window.location.href=B},baseUrl:p?p():void 0},h.id||N)),K<R.length&&r.jsx("div",{className:"search-results-more",children:r.jsxs("button",{onClick:xe,style:{background:"none",border:"none",color:"#007bff",cursor:"pointer",padding:"12px 16px",width:"100%",textAlign:"center",fontSize:"16px"},children:["Show ",Math.min(10,R.length-K)," more results"]})})]})]})]})]})},sr=w.createContext(void 0),Kr=({children:t,meiliSearchConfig:s})=>{const[i,n]=w.useState(""),[y,m]=w.useState([]),[j,p]=w.useState(0),[g,c]=w.useState(!1),[o,d]=w.useState(!1),[f,b]=w.useState(null),[u,I]=w.useState(0),[U,S]=w.useState(!1),[D,O]=w.useState(!1),[G,$]=w.useState(null),X=nr(s),H=async z=>{if(!z.trim()){Z();return}c(!0),d(!1),b(null),I(0);try{const L=await X.search(z,{limit:20,offset:0}),W=L.hits.map(C=>{var F,K,Q;return{id:C.id,title:((F=C._formatted)==null?void 0:F.display_name)||C.display_name,type:C.type,url:C.url,description:((K=C._formatted)==null?void 0:K.description)||C.description,block_type:C.block_type,published:((Q=C._formatted)==null?void 0:Q.published)||C.published,_formatted:C._formatted}}),A=L.totalHits,q=W.length===20&&A>W.length;m(W),p(A),S(q),$(L.facets||null)}catch(L){console.error("Search error:",L),d(!0),b(L instanceof Error?L.message:"Search failed"),m([]),p(0),S(!1),$(null)}finally{c(!1)}},R=async()=>{if(!(!U||D)){O(!0);try{const z=u+20,L=await X.simpleSearch(i,{limit:20,offset:z}),W=L.hits.map(C=>{var F,K,Q;return{id:C.id,title:((F=C._formatted)==null?void 0:F.display_name)||C.display_name,type:C.type,url:C.url,description:((K=C._formatted)==null?void 0:K.description)||C.description,block_type:C.block_type,published:((Q=C._formatted)==null?void 0:Q.published)||C.published,_formatted:C._formatted}}),A=L.totalHits,q=W.length===20&&A>y.length+W.length;m(C=>[...C,...W]),p(A),S(q),I(z)}catch(z){console.error("Error fetching next page:",z),d(!0),b(z instanceof Error?z.message:"Failed to load more results")}finally{O(!1)}}},Z=()=>{n(""),m([]),p(0),d(!1),b(null),I(0),S(!1),$(null)},ee={searchKeywords:i,setSearchKeywords:n,searchResults:y,totalHits:j,isLoading:g,hasError:o,errorMessage:f,facets:G,performSearch:H,clearSearch:Z,hasNextPage:U,fetchNextPage:R,isFetchingNextPage:D};return r.jsx(sr.Provider,{value:ee,children:t})},Yr=()=>{const t=w.useContext(sr);if(t===void 0)throw new Error("useSimpleSearch must be used within a SimpleSearchProvider");return t};exports.Footer=Or;exports.MainHeader=Fr;exports.Sidebar=kr;exports.SidebarProvider=Rr;exports.SimpleSearchProvider=Kr;exports.useSidebar=Te;exports.useSimpleSearch=Yr;
27
+ Check the top-level render call using <`+l+">.")}return a}}function Le(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var l=gr(a);if($e[l])return;$e[l]=!0;var b="";e&&e._owner&&e._owner!==Ee.current&&(b=" It was passed a child from "+M(e._owner.type)+"."),fe(e),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',l,b),fe(null)}}function He(e,a){{if(typeof e!="object")return;if(Array.isArray(e))for(var l=0;l<e.length;l++){var b=e[l];Ce(b)&&Le(b,a)}else if(Ce(e))e._store&&(e._store.validated=!0);else if(e){var T=X(e);if(typeof T=="function"&&T!==e.entries)for(var k=T.call(e),S;!(S=k.next()).done;)Ce(S.value)&&Le(S.value,a)}}}function vr(e){{var a=e.type;if(a==null||typeof a=="string")return;var l;if(typeof a=="function")l=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===c||a.$$typeof===f))l=a.propTypes;else return;if(l){var b=M(a);ar(l,e.props,"prop",b,e)}else if(a.PropTypes!==void 0&&!Se){Se=!0;var T=M(a);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function xr(e){{for(var a=Object.keys(e.props),l=0;l<a.length;l++){var b=a[l];if(b!=="children"&&b!=="key"){fe(e),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),fe(null);break}}e.ref!==null&&(fe(e),R("Invalid attribute `ref` supplied to `React.Fragment`."),fe(null))}}function Fe(e,a,l,b,T,k){{var S=F(e);if(!S){var _="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(_+=" 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 Y=mr();Y?_+=Y:_+=De();var P;e===null?P="null":Array.isArray(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(M(e.type)||"Unknown")+" />",_=" Did you accidentally export a JSX literal instead of a component?"):P=typeof e,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",P,_)}var A=pr(e,a,l,T,k);if(A==null)return A;if(S){var re=a.children;if(re!==void 0)if(b)if(Array.isArray(re)){for(var he=0;he<re.length;he++)He(re[he],e);Object.freeze&&Object.freeze(re)}else R("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 He(re,e)}return e===t.Fragment?xr(A):vr(A),A}}function br(e,a,l){return Fe(e,a,l,!0)}function wr(e,a,l){return Fe(e,a,l,!1)}var yr=wr,jr=br;t.jsx=yr,t.jsxs=jr})()})(Re)),Re}var Ke;function Cr(){return Ke||(Ke=1,process.env.NODE_ENV==="production"?we.exports=Er():we.exports=Sr()),we.exports}var r=Cr();const Or=({contactInfo:t,quickLinks:s,exploreLinks:i,logoUrl:n,copyrights:x})=>{const p=j=>j??"left";return r.jsxs("footer",{className:"footer",children:[r.jsxs("div",{className:"container",children:[r.jsxs("div",{className:`section ${p(t.align)}`,children:[r.jsx("div",{className:"footer-brand-logo",children:r.jsx("img",{src:n,alt:"Logo"})}),r.jsx("p",{children:t.content.shortdesc}),r.jsxs("p",{children:[t.content.location.label,", ",t.content.location.value]}),r.jsxs("p",{children:["📞 ",t.content.phonenumber]})]}),r.jsx("div",{className:`section ${p(s.align)}`,children:r.jsxs("ul",{children:[r.jsx("h3",{children:"Quick Links"}),s.content.map((j,m)=>r.jsx("li",{children:r.jsx("a",{href:j.link,children:j.label})},m))]})}),r.jsx("div",{className:`section ${p(i.align)}`,children:r.jsxs("ul",{children:[r.jsx("h3",{children:"Explore"}),i.content.map((j,m)=>r.jsx("li",{children:r.jsx("a",{href:j.link,children:j.label})},m))]})})]}),r.jsx("div",{className:"copyright",children:r.jsx("p",{children:x})})]})},tr=y.createContext(void 0),Rr=({children:t})=>{const[s,i]=y.useState(!1),n=()=>{i(p=>!p)},x=p=>{i(p)};return r.jsx(tr.Provider,{value:{isCollapsed:s,toggleSidebar:n,setSidebarCollapsed:x},children:t})},Te=()=>{const t=y.useContext(tr);if(t===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return t},kr=({buttons:t,onNavigate:s,presentPath:i})=>{const{isCollapsed:n,setSidebarCollapsed:x}=Te(),[p,j]=y.useState(!0),m=y.useRef(null),[g,c]=y.useState(()=>document.dir==="rtl"||document.documentElement.dir==="rtl");return y.useEffect(()=>{const o=()=>{c(document.dir==="rtl"||document.documentElement.dir==="rtl")},d=new MutationObserver(o);return d.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),()=>d.disconnect()},[]),y.useEffect(()=>{const o=t.some(d=>d.path===i);j(o),!o&&!n&&i.includes("/course/")&&x(!0)},[i]),y.useEffect(()=>{const o=d=>{!p&&m.current&&!m.current.contains(d.target)&&i.includes("/course/")&&(n||x(!0))};return document.addEventListener("mousedown",o),()=>{document.removeEventListener("mousedown",o)}},[p,n,x]),r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`sidebar ${n?"collapsed":""}`,ref:m,children:r.jsx("div",{className:"sidebar-buttons",children:t.map(o=>{const d=o.path===i||(i.includes("/course/")||i.includes("/course_rerun/"))&&o.path==="/my-courses"||i.includes("/library/")&&o.path==="/libraries"||i.includes("/taxonomy/")&&o.path==="/taxonomies";return r.jsx(v.OverlayTrigger,{placement:g?"left":"right",overlay:r.jsx(v.Tooltip,{id:`tooltip-${o.path}`,children:o.label}),show:n?void 0:!1,popperConfig:{modifiers:[{name:"preventOverflow",options:{altAxis:!0,boundary:"viewport"}}]},children:r.jsx(v.Button,{variant:"tertiary",className:`sidebar-btn ${d?"pgn-btn-active":"pgn-btn-inactive"}`,onClick:()=>s(o.path),children:r.jsxs("div",{className:"btn-content",children:[r.jsx("span",{className:"icon-container",children:o.icon}),r.jsx("span",{className:"btn-label",children:o.label})]})})},o.path)})})}),!p&&!n&&r.jsx("div",{className:"sidebar-extra-space"})]})},Tr=(t=768)=>{const[s,i]=y.useState(!1);return y.useEffect(()=>{const n=()=>{i(window.innerWidth<=t)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[t]),s},Ye=t=>q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},q.createElement("path",{d:"M10.09 15.59 11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM21 3H3v6h2V5h14v14H5v-4H3v6h18V3z",fill:"currentColor"})),Je=t=>q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},q.createElement("path",{d:"M21 3H3v18h18V3zm-8.99 15c-.7 0-1.26-.56-1.26-1.26 0-.71.56-1.25 1.26-1.25.71 0 1.25.54 1.25 1.25-.01.69-.54 1.26-1.25 1.26zm3.01-7.4c-.76 1.11-1.48 1.46-1.87 2.17-.16.29-.22.48-.22 1.41h-1.82c0-.49-.08-1.29.31-1.98.49-.87 1.42-1.39 1.96-2.16.57-.81.25-2.33-1.37-2.33-1.06 0-1.58.8-1.8 1.48l-1.65-.7C9.01 7.15 10.22 6 11.99 6c1.48 0 2.49.67 3.01 1.52.44.72.7 2.07.02 3.08z",fill:"currentColor"})),Nr=t=>q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},q.createElement("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z",fill:"currentColor"})),Pr=t=>q.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},q.createElement("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2Zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z",fill:"currentColor"})),Ue=t=>q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},q.createElement("path",{d:"M12 22c1.1 0 2-.9 2-2h-4a2 2 0 0 0 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V2.5h-3v2.18C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z",fill:"currentColor"})),Ir=t=>q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},q.createElement("path",{d:"M19 19H5V5h7V3H3v18h18v-9h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z",fill:"currentColor"})),Ar=t=>q.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},q.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5Zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14Z",fill:"currentColor"})),Ge=t=>q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},q.createElement("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z",fill:"currentColor"})),Mr=({id:t,buttonTitle:s,items:i})=>(console.log("NavDropdownMenu Props:",i),r.jsx(v.DropdownButton,{id:t,title:s,variant:"tertiary",className:"mr-2",children:i.map(n=>r.jsx(v.Dropdown.Item,{href:n.href,as:"a",className:"small",children:n.title},`${n.title}-dropdown-item`))})),Xe=({username:t,authenticatedUserAvatar:s,isMobile:i,menuItems:n})=>{const x=s?r.jsx("img",{className:"d-block w-100 h-100",src:s,alt:t,"data-testid":"avatar-image"}):r.jsx(v.Avatar,{size:"sm",className:"mr-2",alt:"avatar","data-testid":"avatar-icon"}),p=i?x:r.jsxs(r.Fragment,{children:[t,"   ",x]});return r.jsx(Mr,{buttonTitle:p,id:"user-dropdown-menu",items:n})};var ve={},Ze;function Dr(){if(Ze)return ve;Ze=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.parse=j,ve.serialize=c;const t=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,s=/^[\u0021-\u003A\u003C-\u007E]*$/,i=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,x=Object.prototype.toString,p=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function j(f,w){const u=new p,I=f.length;if(I<2)return u;const U=(w==null?void 0:w.decode)||o;let E=0;do{const D=f.indexOf("=",E);if(D===-1)break;const O=f.indexOf(";",E),G=O===-1?I:O;if(D>G){E=f.lastIndexOf(";",D-1)+1;continue}const $=m(f,E,D),X=g(f,D,$),H=f.slice($,X);if(u[H]===void 0){let R=m(f,D+1,G),Z=g(f,G,R);const ee=U(f.slice(R,Z));u[H]=ee}E=G+1}while(E<I);return u}function m(f,w,u){do{const I=f.charCodeAt(w);if(I!==32&&I!==9)return w}while(++w<u);return u}function g(f,w,u){for(;w>u;){const I=f.charCodeAt(--w);if(I!==32&&I!==9)return w+1}return u}function c(f,w,u){const I=(u==null?void 0:u.encode)||encodeURIComponent;if(!t.test(f))throw new TypeError(`argument name is invalid: ${f}`);const U=I(w);if(!s.test(U))throw new TypeError(`argument val is invalid: ${w}`);let E=f+"="+U;if(!u)return E;if(u.maxAge!==void 0){if(!Number.isInteger(u.maxAge))throw new TypeError(`option maxAge is invalid: ${u.maxAge}`);E+="; Max-Age="+u.maxAge}if(u.domain){if(!i.test(u.domain))throw new TypeError(`option domain is invalid: ${u.domain}`);E+="; Domain="+u.domain}if(u.path){if(!n.test(u.path))throw new TypeError(`option path is invalid: ${u.path}`);E+="; Path="+u.path}if(u.expires){if(!d(u.expires)||!Number.isFinite(u.expires.valueOf()))throw new TypeError(`option expires is invalid: ${u.expires}`);E+="; Expires="+u.expires.toUTCString()}if(u.httpOnly&&(E+="; HttpOnly"),u.secure&&(E+="; Secure"),u.partitioned&&(E+="; Partitioned"),u.priority)switch(typeof u.priority=="string"?u.priority.toLowerCase():void 0){case"low":E+="; Priority=Low";break;case"medium":E+="; Priority=Medium";break;case"high":E+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${u.priority}`)}if(u.sameSite)switch(typeof u.sameSite=="string"?u.sameSite.toLowerCase():u.sameSite){case!0:case"strict":E+="; SameSite=Strict";break;case"lax":E+="; SameSite=Lax";break;case"none":E+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${u.sameSite}`)}return E}function o(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch{return f}}function d(f){return x.call(f)==="[object Date]"}return ve}var ye=Dr();function $r(){const t=typeof global>"u"?void 0:global.TEST_HAS_DOCUMENT_COOKIE;return typeof t=="boolean"?t:typeof document=="object"&&typeof document.cookie=="string"}function Lr(t){return typeof t=="string"?ye.parse(t):typeof t=="object"&&t!==null?t:{}}function ke(t,s={}){const i=Hr(t);if(!s.doNotParse)try{return JSON.parse(i)}catch{}return t}function Hr(t){return t&&t[0]==="j"&&t[1]===":"?t.substr(2):t}class Fr{constructor(s,i={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const x=this.cookies;this.cookies=ye.parse(document.cookie),this._checkChanges(x)};const n=typeof document>"u"?"":document.cookie;this.cookies=Lr(s||n),this.defaultSetOptions=i,this.HAS_DOCUMENT_COOKIE=$r()}_emitChange(s){for(let i=0;i<this.changeListeners.length;++i)this.changeListeners[i](s)}_checkChanges(s){new Set(Object.keys(s).concat(Object.keys(this.cookies))).forEach(n=>{s[n]!==this.cookies[n]&&this._emitChange({name:n,value:ke(this.cookies[n])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(s,i={}){return i.doNotUpdate||this.update(),ke(this.cookies[s],i)}getAll(s={}){s.doNotUpdate||this.update();const i={};for(let n in this.cookies)i[n]=ke(this.cookies[n],s);return i}set(s,i,n){n?n=Object.assign(Object.assign({},this.defaultSetOptions),n):n=this.defaultSetOptions;const x=typeof i=="string"?i:JSON.stringify(i);this.cookies=Object.assign(Object.assign({},this.cookies),{[s]:x}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=ye.serialize(s,x,n)),this._emitChange({name:s,value:i,options:n})}remove(s,i){const n=i=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),i),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[s],this.HAS_DOCUMENT_COOKIE&&(document.cookie=ye.serialize(s,"",n)),this._emitChange({name:s,value:void 0,options:i})}addChangeListener(s){this.changeListeners.push(s),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(s){const i=this.changeListeners.indexOf(s);i>=0&&this.changeListeners.splice(i,1),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===0&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}removeAllChangeListeners(){for(;this.changeListeners.length>0;)this.removeChangeListener(this.changeListeners[0])}}class zr{constructor(s){if(!s.host)throw new Error("MeiliSearch host is required");if(!s.apiKey)throw new Error("MeiliSearch apiKey is required");if(!s.indexName)throw new Error("MeiliSearch indexName is required");this.config=s,this.headers={"Content-Type":"application/json",Authorization:`Bearer ${s.apiKey}`,"X-Meilisearch-Client":"Meilisearch JavaScript (v0.41.0)"}}updateHeadersFromClient(s){s&&s.httpRequest&&s.httpRequest.headers&&(this.headers={"Content-Type":s.httpRequest.headers["Content-Type"]||"application/json",Authorization:s.httpRequest.headers.Authorization||`Bearer ${this.config.apiKey}`,"X-Meilisearch-Client":s.httpRequest.headers["X-Meilisearch-Client"]||"Meilisearch JavaScript (v0.41.0)"})}async search(s,i={}){const{limit:n=20,offset:x=0,filter:p=['type = "course_block"'],attributesToHighlight:j=["display_name","description","published"],attributesToCrop:m=["description","published"],sort:g=[]}=i;if(!this.config.indexName)throw new Error("MeiliSearch indexName is required");const c={queries:[{indexUid:this.config.indexName,q:s,filter:[[],...p],attributesToHighlight:j,highlightPreTag:"__meili-highlight__",highlightPostTag:"__/meili-highlight__",attributesToCrop:m,sort:g,offset:x,limit:n},{indexUid:this.config.indexName,facets:["block_type","content.problem_types"],filter:p,limit:0}]},o={...this.headers};try{const d=await fetch(`${this.config.host}/multi-search`,{method:"POST",headers:o,body:JSON.stringify(c)});if(!d.ok)throw new Error(`MeiliSearch API error: ${d.status} ${d.statusText}`);const f=await d.json(),w=f.results[0],u=f.results[1];return{hits:w.hits||[],totalHits:w.estimatedTotalHits||0,facets:u.facetDistribution,processingTimeMs:w.processingTimeMs}}catch(d){throw console.error("MeiliSearch service error:",d),new Error(`Search failed: ${d instanceof Error?d.message:"Unknown error"}`)}}async simpleSearch(s,i={}){const{limit:n=20,offset:x=0,filter:p=['type = "course_block"'],attributesToHighlight:j=["display_name","description","published"],attributesToCrop:m=["description","published"],sort:g=[]}=i,c={queries:[{indexUid:this.config.indexName,q:s,filter:[[],...p],attributesToHighlight:j,highlightPreTag:"__meili-highlight__",highlightPostTag:"__/meili-highlight__",attributesToCrop:m,sort:g,offset:x,limit:n}]},o={...this.headers};try{const d=await fetch(`${this.config.host}/multi-search`,{method:"POST",headers:o,body:JSON.stringify(c)});if(!d.ok)throw new Error(`MeiliSearch API error: ${d.status} ${d.statusText}`);const w=(await d.json()).results[0];return{hits:w.hits||[],totalHits:w.estimatedTotalHits||0,processingTimeMs:w.processingTimeMs}}catch(d){throw console.error("MeiliSearch service error:",d),new Error(`Search failed: ${d instanceof Error?d.message:"Unknown error"}`)}}async checkConnection(){try{return(await fetch(`${this.config.host}/health`,{method:"GET",headers:{Authorization:`Bearer ${this.config.apiKey}`,"X-Meilisearch-Client":"Meilisearch JavaScript (v0.41.0)"}})).ok}catch(s){return console.error("MeiliSearch connection check failed:",s),!1}}}const nr=t=>new zr(t);function sr(t,s){const{contextKey:i,usageKey:n}=t;return i?i.startsWith("course-v1:")?`${s||""}/course/${i}?show=${encodeURIComponent(n||"")}`:i.startsWith("library-v1:")?`${s||""}/library/${i}`:"#":"#"}function qr(t,s,i){const n=sr(t,s);return n==="#"?(console.warn("Could not generate URL for search hit:",t),"#"):(i?i(n):(n.startsWith("http"),window.location.href=n),n)}const Qe=({text:t,highlightTag:s="__meili-highlight__"})=>{if(!t)return null;const i="__/meili-highlight__",n=t.split(s),x=[];return n.forEach((p,j)=>{if(j===0)p&&x.push(p);else{const m=p.indexOf(i);if(m!==-1){const g=p.substring(0,m),c=p.substring(m+i.length);g&&x.push(r.jsx("mark",{className:"search-highlight",children:g},`highlight-${j}`)),c&&x.push(c)}else x.push(r.jsx("mark",{className:"search-highlight",children:p},`highlight-${j}`))}}),r.jsx(r.Fragment,{children:x})};function Vr(t){return{html:"text",video:"video",problem:"quiz",vertical:"folder",sequential:"folder",chapter:"folder",about:"info",static_tab:"text",openassessment:"quiz",lti_consumer:"link",pdf:"file",scorm:"file",itembank:"library",library_content:"library"}[t]||"text"}const Be=({result:t,onNavigate:s,baseUrl:i})=>{var g,c;const n=o=>{var w;o.preventDefault(),o.stopPropagation();const d={id:t.id,blockType:t.block_type||t.type,contextKey:t.context_key,usageKey:t.usage_key,breadcrumbs:((w=t.breadcrumbs)==null?void 0:w.map(u=>({displayName:u.display_name,usageKey:u.usage_key})))||[]};if(t.url){s?s(t.url):window.location.href=t.url;return}qr(d,i,s)==="#"&&(s?s(`/search-result/${t.id}`):window.location.href=`/search-result/${t.id}`)},x=o=>{var w;o.preventDefault(),o.stopPropagation();const d={id:t.id,blockType:t.block_type||t.type,contextKey:t.context_key,usageKey:t.usage_key,breadcrumbs:((w=t.breadcrumbs)==null?void 0:w.map(u=>({displayName:u.display_name,usageKey:u.usage_key})))||[]},f=sr(d,i);f&&f!=="#"&&window.open(f,"_blank")},p=((g=t._formatted)==null?void 0:g.display_name)||t.display_name,j=((c=t._formatted)==null?void 0:c.description)||t.description,m=t.block_type||t.type;return r.jsx("div",{className:"search-result-item",onClick:n,role:"button",tabIndex:0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&n(o)},children:r.jsxs("div",{className:"search-result-content",children:[r.jsx("div",{className:"search-result-icon",children:r.jsx(v.Icon,{src:Vr(m)})}),r.jsxs("div",{className:"search-result-text",children:[r.jsx("div",{className:"search-result-title",children:r.jsx(Qe,{text:p})}),j&&r.jsx("div",{className:"search-result-description",children:r.jsx(Qe,{text:j})}),t.breadcrumbs&&t.breadcrumbs.length>0&&r.jsx("div",{className:"search-result-breadcrumbs",children:t.breadcrumbs.map(o=>o.display_name).join(" / ")})]}),r.jsx("div",{className:"search-result-actions",children:r.jsx(v.IconButton,{src:Ir,iconAs:v.Icon,onClick:x,alt:"Open in new window",size:"sm"})})]})})},er=new Fr,Wr=({logoUrl:t,menuList:s,loginSignupButtons:i,authenticatedUser:n=null,userMenuItems:x,menuAlignment:p,onLanguageChange:j,getBaseUrl:m,meiliSearchConfig:g,headerButtons:c,languageSelectorList:o})=>{const d=Tr(),{toggleSidebar:f,setSidebarCollapsed:w}=Te(),[u,I]=y.useState(()=>er.get("openedx-language-preference")||"en"),[U,E]=y.useState(!1),[D,O]=y.useState(!1),[G,$]=y.useState(!1),[X,H]=y.useState(""),[R,Z]=y.useState([]),[ee,F]=y.useState(!1),[L,V]=y.useState(null),[M,z]=y.useState(0),[C,W]=y.useState(!1),[K,Q]=y.useState(5),oe=y.useRef(null),J=y.useRef(null),ne=y.useRef(g?nr(g):null);console.log("languageSelectorList",o),y.useEffect(()=>{g!=null&&g.client&&ne.current&&ne.current.updateHeadersFromClient(g.client)},[g==null?void 0:g.client]),y.useEffect(()=>()=>{J.current&&clearTimeout(J.current)},[]),y.useEffect(()=>{document.body.dir=u==="ar"?"rtl":"ltr"},[u]),y.useEffect(()=>{d&&w(!0)},[d,w]),y.useEffect(()=>{if(!D)return;function h(N){oe.current&&!oe.current.contains(N.target)&&O(!1)}return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[D]);const se=h=>{I(h),er.set("openedx-language-preference",h,{path:m?m():"/"}),j&&j()},je=p&&{left:"justify-content-start",center:"justify-content-center",right:"justify-content-end"}[p.toLowerCase()]||"justify-content-start",ce=async h=>{if(!h.trim()||!g||!ne.current){Z([]),z(0),$(!1),W(!1);return}F(!0),V(null),$(!1),Q(5);try{const N=await ne.current.simpleSearch(h,{limit:20,offset:0});Z(N.hits),z(N.totalHits),$(N.totalHits===0),W(!0)}catch(N){V(N instanceof Error?N.message:"Search failed"),$(!0),Z([]),z(0)}finally{F(!1)}},le=h=>{H(h),ce(h),d&&U&&E(!1)},ie=h=>{H(h),G&&h.trim()===""&&($(!1),W(!1)),J.current&&clearTimeout(J.current),h.trim().length>0?J.current=setTimeout(()=>{ce(h)},500):(Z([]),z(0),$(!1),W(!1))},ue=()=>{J.current&&(clearTimeout(J.current),J.current=null),H(""),Z([]),z(0),$(!1),W(!1),V(null),F(!1)},ae=()=>{H(""),Z([]),z(0),$(!1),W(!1),V(null),F(!1),Q(5),J.current&&(clearTimeout(J.current),J.current=null)},xe=()=>{Q(h=>Math.min(h+10,R.length))},me=h=>{if(o&&o.length>0){const B=o.find(de=>de[h]);if(B)return B[h]}return{en:"English",ar:"Arabic",hi:"Hindi"}[h]||h.toUpperCase()},ge=()=>(console.log("renderLanguageOptions - languageSelectorList:",o),console.log("renderLanguageOptions - length:",o==null?void 0:o.length),o&&o.length>0?(console.log("Using custom languageSelectorList"),o.map((h,N)=>{const[B,de]=Object.entries(h)[0];return r.jsx(v.Dropdown.Item,{onClick:()=>se(B),children:de},`lang-${B}-${N}`)})):(console.log("Using fallback languages"),r.jsxs(r.Fragment,{children:[r.jsx(v.Dropdown.Item,{onClick:()=>se("en"),children:"English"}),r.jsx(v.Dropdown.Item,{onClick:()=>se("ar"),children:"Arabic"}),r.jsx(v.Dropdown.Item,{onClick:()=>se("hi"),children:"Hindi"})]})));return r.jsxs(v.Navbar,{expand:"lg",className:"navbarContainer py-1",children:[r.jsxs("div",{className:"d-flex align-items-center",children:[r.jsx("div",{className:"toggle-sidebar-icon",children:r.jsx(v.IconButton,{src:Nr,iconAs:v.Icon,alt:"Toggle Sidebar",onClick:f,className:"ms-2 ml-2",onMouseDown:h=>h.stopPropagation()})}),r.jsx(v.Navbar.Brand,{href:"/",className:"navbar-brand",children:r.jsx("img",{src:t,alt:"Logo"})})]}),n!==null&&r.jsx(r.Fragment,{children:d?r.jsx("div",{className:"d-flex justify-content-between align-items-center ml-auto",children:r.jsxs("div",{className:"d-flex align-items-center navbar-buttons",children:[g&&r.jsx(v.IconButton,{src:Ar,iconAs:v.Icon,alt:"Search",onClick:()=>E(!0)}),r.jsx("div",{className:"ml-2 usermenu-dropdown-mobile",children:r.jsx(Xe,{username:n==null?void 0:n.username,authenticatedUserAvatar:n==null?void 0:n.avatar,isMobile:d,isAdmin:n==null?void 0:n.administrator,menuItems:x})}),r.jsx(v.IconButton,{src:Pr,iconAs:v.Icon,alt:"More",onMouseDown:h=>h.stopPropagation(),onClick:()=>O(h=>!h)}),D&&r.jsxs("div",{className:"more-menu-dropdown",ref:oe,children:[r.jsxs("div",{className:"more-menu-icons-row",children:[(c==null?void 0:c.reSync)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ge,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Re-Sync"})}),(c==null?void 0:c.contextSwitcher)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ye,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Switch to User Mode"})}),(c==null?void 0:c.help)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Je,iconAs:v.Icon,alt:"Help",tooltipPlacement:"bottom",tooltipContent:"Help"})}),(c==null?void 0:c.notification)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ue,iconAs:v.Icon,alt:"Notifications",tooltipPlacement:"bottom",tooltipContent:"Notifications"})})]}),(c==null?void 0:c.translation)&&r.jsxs(v.Dropdown,{className:"language-dropdown",children:[r.jsx(v.Dropdown.Toggle,{variant:"tertiary",id:"language-dropdown",children:me(u)}),r.jsx(v.Dropdown.Menu,{children:ge()})]})]})]})}):r.jsxs(r.Fragment,{children:[g&&r.jsx("div",{className:"d-flex align-items-center justify-content-start flex-grow-1 ml-4",children:r.jsxs("div",{style:{width:"30rem",position:"relative"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",border:"2px solid #ccc",borderRadius:"25px",padding:"8px 16px",background:"#fff",position:"relative"},children:[r.jsx("input",{type:"text",value:X,onChange:h=>{ie(h.target.value)},onKeyDown:h=>{h.key==="Enter"&&le(X)},placeholder:"Search",style:{flex:1,border:"none",outline:"none",fontSize:"16px",background:"transparent",padding:"4px"},autoComplete:"off"}),X&&r.jsx("button",{type:"button",onClick:()=>{ue()},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",marginRight:"8px"},children:"✕"})]}),ee&&r.jsxs("div",{className:"search-loading-spinner-container",children:[r.jsx("div",{className:"search-loading-spinner"}),r.jsx("span",{children:"Searching..."})]}),G&&!ee&&r.jsx("div",{className:"no-results-message-desktop",children:r.jsx("p",{children:"We didn't find anything matching your search"})}),L&&r.jsx("div",{className:"search-error-message-desktop",children:r.jsxs("p",{children:["Search error: ",L]})}),C&&R.length>0&&r.jsxs("div",{className:"search-results-dropdown",children:[r.jsx("div",{className:"search-results-header",children:r.jsxs("span",{children:[M," result",M!==1?"s":""," found"]})}),r.jsxs("div",{className:"search-results-list",children:[R.slice(0,K).map((h,N)=>r.jsx(Be,{result:h,onNavigate:B=>{ae(),window.location.href=B},baseUrl:m?m():void 0},h.id||N)),K<R.length&&r.jsx("div",{className:"search-results-more",children:r.jsxs("button",{onClick:xe,style:{background:"none",border:"none",color:"#007bff",cursor:"pointer",padding:"8px 16px",width:"100%",textAlign:"center",fontSize:"14px"},children:["Show ",Math.min(10,R.length-K)," more results"]})})]})]})]})}),r.jsxs("div",{className:"d-flex align-items-center gap-2 ms-auto order-lg-3",children:[(c==null?void 0:c.reSync)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ge,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Re-Sync"})}),(c==null?void 0:c.contextSwitcher)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ye,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Switch to User Mode"})}),(c==null?void 0:c.help)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Je,iconAs:v.Icon,alt:"Help",tooltipPlacement:"bottom",tooltipContent:"Help"})}),(c==null?void 0:c.notification)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ue,iconAs:v.Icon,alt:"Notifications",tooltipPlacement:"bottom",tooltipContent:"Notifications"})}),(c==null?void 0:c.translation)&&r.jsxs(v.Dropdown,{className:"language-dropdown",children:[r.jsx(v.Dropdown.Toggle,{variant:"tertiary",id:"language-dropdown",children:me(u)}),r.jsx(v.Dropdown.Menu,{children:ge()})]}),r.jsx("div",{className:"usermenu-dropdown",children:r.jsx(Xe,{username:n==null?void 0:n.username,authenticatedUserAvatar:n==null?void 0:n.avatar,isMobile:d,isAdmin:n==null?void 0:n.administrator,menuItems:x})})]})]})}),n===null&&r.jsxs(r.Fragment,{children:[r.jsx(v.Navbar.Toggle,{"aria-controls":"main-navbar-nav"}),r.jsx("div",{className:"d-flex align-items-center gap-2 ms-auto order-lg-3",children:i&&r.jsxs(r.Fragment,{children:[r.jsx(v.Button,{variant:"primary",children:"Log In"}),r.jsx(v.Button,{variant:"outline-primary",children:"Sign Up"})]})})]}),r.jsx(v.Navbar.Collapse,{id:"main-navbar-nav",className:"justify-content-between",children:r.jsx(v.Nav,{className:`nav-gap gap-3 flex-grow-1 ${je}`,children:n===null&&s.map(h=>h.subMenu?r.jsx(v.NavDropdown,{title:h.label,id:`nav-dropdown-${h.label}`,children:h.subMenu.map(N=>r.jsx(v.NavDropdown.Item,{onClick:()=>console.log("Selected submenu:",N.label),children:N.label},`sub-${N.label}`))},`menu-${h.label}`):r.jsx(v.Nav.Link,{as:"span",className:"text-uppercase fw-semibold",children:h.label},`menu-${h.label}`))})}),g&&U&&r.jsxs("div",{className:"fixed-search-bar",children:[r.jsxs("div",{className:"fixed-search-bar-inner",children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",border:"2px solid #ccc",borderRadius:"25px",padding:"12px 16px",background:"#fff",position:"relative",width:"100%"},children:[r.jsx("input",{type:"text",value:X,onChange:h=>{ie(h.target.value)},onKeyDown:h=>{h.key==="Enter"&&le(X)},placeholder:"Search",style:{flex:1,border:"none",outline:"none",fontSize:"18px",background:"transparent",padding:"4px"},autoComplete:"off",autoFocus:!0}),X&&r.jsx("button",{type:"button",onClick:()=>{ue()},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",marginRight:"8px",fontSize:"18px"},children:"✕"})]}),r.jsx("button",{className:"close-search-bar",type:"button",onClick:()=>E(!1),"aria-label":"Close Search",children:"×"})]}),ee&&r.jsxs("div",{className:"search-loading-spinner-container",children:[r.jsx("div",{className:"search-loading-spinner"}),r.jsx("span",{children:"Searching..."})]}),G&&!ee&&r.jsx("div",{className:"no-results-message",children:r.jsx("p",{children:"We didn't find anything matching your search"})}),L&&r.jsx("div",{className:"search-error-message",children:r.jsxs("p",{children:["Search error: ",L]})}),C&&R.length>0&&r.jsxs("div",{className:"search-results-mobile",children:[r.jsx("div",{className:"search-results-header",children:r.jsxs("span",{children:[M," result",M!==1?"s":""," found"]})}),r.jsxs("div",{className:"search-results-list",children:[R.slice(0,K).map((h,N)=>r.jsx(Be,{result:h,onNavigate:B=>{ae(),window.location.href=B},baseUrl:m?m():void 0},h.id||N)),K<R.length&&r.jsx("div",{className:"search-results-more",children:r.jsxs("button",{onClick:xe,style:{background:"none",border:"none",color:"#007bff",cursor:"pointer",padding:"12px 16px",width:"100%",textAlign:"center",fontSize:"16px"},children:["Show ",Math.min(10,R.length-K)," more results"]})})]})]})]})]})},ir=y.createContext(void 0),Kr=({children:t,meiliSearchConfig:s})=>{const[i,n]=y.useState(""),[x,p]=y.useState([]),[j,m]=y.useState(0),[g,c]=y.useState(!1),[o,d]=y.useState(!1),[f,w]=y.useState(null),[u,I]=y.useState(0),[U,E]=y.useState(!1),[D,O]=y.useState(!1),[G,$]=y.useState(null),X=nr(s),H=async F=>{if(!F.trim()){Z();return}c(!0),d(!1),w(null),I(0);try{const L=await X.search(F,{limit:20,offset:0}),V=L.hits.map(C=>{var W,K,Q;return{id:C.id,title:((W=C._formatted)==null?void 0:W.display_name)||C.display_name,type:C.type,url:C.url,description:((K=C._formatted)==null?void 0:K.description)||C.description,block_type:C.block_type,published:((Q=C._formatted)==null?void 0:Q.published)||C.published,_formatted:C._formatted}}),M=L.totalHits,z=V.length===20&&M>V.length;p(V),m(M),E(z),$(L.facets||null)}catch(L){console.error("Search error:",L),d(!0),w(L instanceof Error?L.message:"Search failed"),p([]),m(0),E(!1),$(null)}finally{c(!1)}},R=async()=>{if(!(!U||D)){O(!0);try{const F=u+20,L=await X.simpleSearch(i,{limit:20,offset:F}),V=L.hits.map(C=>{var W,K,Q;return{id:C.id,title:((W=C._formatted)==null?void 0:W.display_name)||C.display_name,type:C.type,url:C.url,description:((K=C._formatted)==null?void 0:K.description)||C.description,block_type:C.block_type,published:((Q=C._formatted)==null?void 0:Q.published)||C.published,_formatted:C._formatted}}),M=L.totalHits,z=V.length===20&&M>x.length+V.length;p(C=>[...C,...V]),m(M),E(z),I(F)}catch(F){console.error("Error fetching next page:",F),d(!0),w(F instanceof Error?F.message:"Failed to load more results")}finally{O(!1)}}},Z=()=>{n(""),p([]),m(0),d(!1),w(null),I(0),E(!1),$(null)},ee={searchKeywords:i,setSearchKeywords:n,searchResults:x,totalHits:j,isLoading:g,hasError:o,errorMessage:f,facets:G,performSearch:H,clearSearch:Z,hasNextPage:U,fetchNextPage:R,isFetchingNextPage:D};return r.jsx(ir.Provider,{value:ee,children:t})},Yr=()=>{const t=y.useContext(ir);if(t===void 0)throw new Error("useSimpleSearch must be used within a SimpleSearchProvider");return t},Jr=t=>{try{if(t.status!==200)throw new Error("Failed to fetch theme config");const s=t.data.theme_colors;if(!s||typeof s!="object")throw new Error("Invalid theme_colors in API response");const i=document.documentElement;for(const n in s)if(Object.prototype.hasOwnProperty.call(s,n)){const x=s[n];i.style.setProperty(`--${n.replace(/_/g,"-")}`,x)}console.log("Theme applied successfully from API:",s)}catch(s){console.error("Error applying theme from API:",s.message);const i={primary:"#2B2399",primary_alt:"#3C32B5",primary_hover:"#E2E1F9",primary_active:"#1F1A7D",primary_light:"#E2E1F9",secondary:"#7A8AFF",secondary_alt:"#5C6EF0",secondary_hover:"#ECEEFF",secondary_active:"#4A5BD1",secondary_light:"#ECEEFF"},n=document.documentElement;for(const x in i)if(Object.prototype.hasOwnProperty.call(i,x)){const p=i[x];n.style.setProperty(`--${x.replace(/_/g,"-")}`,p)}console.log("Fallback theme applied")}};exports.Footer=Or;exports.MainHeader=Wr;exports.Sidebar=kr;exports.SidebarProvider=Rr;exports.SimpleSearchProvider=Kr;exports.dynamicTheme=Jr;exports.useSidebar=Te;exports.useSimpleSearch=Yr;
package/dist/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export { default as MainHeader } from './components/common/Header/MainHeader';
6
6
  export { SimpleSearchProvider, useSimpleSearch } from './components/common/Header/SimpleSearchContext';
7
7
  export type { MainHeaderProps, MeiliSearchConfig } from './interfaces/components';
8
8
  export type { SearchResult } from './components/common/Header/SimpleSearchContext';
9
+ export { dynamicTheme } from './components/common/dynamicTheme/dynamicTheme';