titaned-frontend-library 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -7
- package/dist/index.js +166 -166
- package/package.json +1 -1
- package/src/components/common/Header/MainHeader.tsx +5 -2
package/dist/index.cjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),v=require("@openedx/paragon");function _r(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(i,s,n.get?n:{enumerable:!0,get:()=>t[s]})}}return i.default=t,Object.freeze(i)}const q=_r(w);var ye={exports:{}},pe={};/*
|
|
2
2
|
object-assign
|
|
3
3
|
(c) Sindre Sorhus
|
|
4
4
|
@license MIT
|
|
5
|
-
*/var Oe,qe;function rr(){if(qe)return Oe;qe=1;var t=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=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)i.call(m,d)&&(g[d]=m[d]);if(t){c=t(m);for(var
|
|
5
|
+
*/var Oe,qe;function rr(){if(qe)return Oe;qe=1;var t=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=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)i.call(m,d)&&(g[d]=m[d]);if(t){c=t(m);for(var h=0;h<c.length;h++)s.call(m,c[h])&&(g[c[h]]=m[c[h]])}}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 Ve;function Er(){if(Ve)return pe;Ve=1,rr();var t=
|
|
12
|
+
*/var Ve;function Er(){if(Ve)return pe;Ve=1,rr();var t=w,i=60103;if(pe.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var s=Symbol.for;i=s("react.element"),pe.Fragment=s("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={},h=null,y=null;c!==void 0&&(h=""+c),g.key!==void 0&&(h=""+g.key),g.ref!==void 0&&(y=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:i,type:m,key:h,ref:y,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 We;function Sr(){return We||(We=1,(function(t){process.env.NODE_ENV!=="production"&&(function(){var i=
|
|
20
|
-
`+
|
|
19
|
+
*/var We;function Sr(){return We||(We=1,(function(t){process.env.NODE_ENV!=="production"&&(function(){var i=w,s=rr(),n=60103,x=60106;t.Fragment=60107;var p=60108,j=60114,m=60109,g=60110,c=60112,o=60113,d=60120,h=60115,y=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"),h=O("react.memo"),y=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=i.__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===y||e.$$typeof===h||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 h:return M(e.type);case u:return M(e._render);case y:{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,se;function ce(){}ce.__reactDisabledLog=!0;function le(){{if(z===0){C=console.log,W=console.info,K=console.warn,Q=console.error,oe=console.group,J=console.groupCollapsed,se=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ce,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function Ne(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:s({},e,{value:C}),info:s({},e,{value:W}),warn:s({},e,{value:K}),error:s({},e,{value:Q}),group:s({},e,{value:oe}),groupCollapsed:s({},e,{value:J}),groupEnd:s({},e,{value:se})})}z<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var me=H.ReactCurrentDispatcher,ue;function ie(e,a,l){{if(ue===void 0)try{throw Error()}catch(T){var b=T.stack.trim().match(/\n( *(at )?)/);ue=b&&b[1]||""}return`
|
|
20
|
+
`+ue+e}}var de=!1,ae;{var be=typeof WeakMap=="function"?WeakMap:Map;ae=new be}function ge(e,a){if(!e||de)return"";{var l=ae.get(e);if(l!==void 0)return l}var b;de=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var k;k=me.current,me.current=null,le();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
21
|
`),Y=b.stack.split(`
|
|
22
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{
|
|
23
|
+
`+_[P].replace(" at new "," at ");return typeof e=="function"&&ae.set(e,re),re}while(P>=1&&A>=0);break}}}finally{de=!1,me.current=k,Ne(),Error.prepareStackTrace=T}var he=e?e.displayName||e.name:"",ze=he?ie(he):"";return typeof e=="function"&&ae.set(e,ze),ze}function ve(e,a,l){return ge(e,!1)}function we(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function f(e,a,l){if(e==null)return"";if(typeof e=="function")return ge(e,we(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 ve(e.render);case h:return f(e.type,a,l);case u:return ve(e._render);case y:{var b=e,T=b._payload,k=b._init;try{return f(k(T),a,l)}catch{}}}return""}var N={},B=H.ReactDebugCurrentFrame;function ne(e){if(e){var a=e._owner,l=f(e.type,e._source,a?a.type:null);B.setExtraStackFrame(l)}else B.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)&&(ne(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 _),ne(null)),_ instanceof Error&&!(_.message in N)&&(N[_.message]=!0,ne(T),R("Failed %s type: %s",l,_.message),ne(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=f(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 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:i,exploreLinks:s,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(i.align)}`,children:r.jsxs("ul",{children:[r.jsx("h3",{children:"Quick Links"}),i.content.map((j,m)=>r.jsx("li",{children:r.jsx("a",{href:j.link,children:j.label})},m))]})}),r.jsx("div",{className:`section ${p(s.align)}`,children:r.jsxs("ul",{children:[r.jsx("h3",{children:"Explore"}),s.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[i,s]=y.useState(!1),n=()=>{s(p=>!p)},x=p=>{s(p)};return r.jsx(tr.Provider,{value:{isCollapsed:i,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:i,presentPath:s})=>{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===s);j(o),!o&&!n&&s.includes("/course/")&&!s.includes("/learning/course/")&&x(!0)},[s]),y.useEffect(()=>{const o=d=>{!p&&m.current&&!m.current.contains(d.target)&&s.includes("/course/")&&!s.includes("/learning/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===s||(s.includes("/course/")||s.includes("/course_rerun/"))&&o.path==="/my-courses"||s.includes("/library/")&&o.path==="/libraries"||s.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:()=>i(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[i,s]=y.useState(!1);return y.useEffect(()=>{const n=()=>{s(window.innerWidth<=t)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[t]),i},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:i,items:s})=>(console.log("NavDropdownMenu Props:",s),r.jsx(v.DropdownButton,{id:t,title:i,variant:"tertiary",className:"mr-2",children:s.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:i,isMobile:s,menuItems:n})=>{const x=i?r.jsx("img",{className:"d-block w-100 h-100",src:i,alt:t,"data-testid":"avatar-image"}):r.jsx(v.Avatar,{size:"sm",className:"mr-2",alt:"avatar","data-testid":"avatar-icon"}),p=s?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]+$/,i=/^[\u0021-\u003A\u003C-\u007E]*$/,s=/^([.]?[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(!i.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(!s.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,i={}){const s=Hr(t);if(!i.doNotParse)try{return JSON.parse(s)}catch{}return t}function Hr(t){return t&&t[0]==="j"&&t[1]===":"?t.substr(2):t}class Fr{constructor(i,s={}){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(i||n),this.defaultSetOptions=s,this.HAS_DOCUMENT_COOKIE=$r()}_emitChange(i){for(let s=0;s<this.changeListeners.length;++s)this.changeListeners[s](i)}_checkChanges(i){new Set(Object.keys(i).concat(Object.keys(this.cookies))).forEach(n=>{i[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(i,s={}){return s.doNotUpdate||this.update(),ke(this.cookies[i],s)}getAll(i={}){i.doNotUpdate||this.update();const s={};for(let n in this.cookies)s[n]=ke(this.cookies[n],i);return s}set(i,s,n){n?n=Object.assign(Object.assign({},this.defaultSetOptions),n):n=this.defaultSetOptions;const x=typeof s=="string"?s:JSON.stringify(s);this.cookies=Object.assign(Object.assign({},this.cookies),{[i]:x}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=ye.serialize(i,x,n)),this._emitChange({name:i,value:s,options:n})}remove(i,s){const n=s=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),s),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[i],this.HAS_DOCUMENT_COOKIE&&(document.cookie=ye.serialize(i,"",n)),this._emitChange({name:i,value:void 0,options:s})}addChangeListener(i){this.changeListeners.push(i),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(i){const s=this.changeListeners.indexOf(i);s>=0&&this.changeListeners.splice(s,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(i){if(!i.host)throw new Error("MeiliSearch host is required");if(!i.apiKey)throw new Error("MeiliSearch apiKey is required");if(!i.indexName)throw new Error("MeiliSearch indexName is required");this.config=i,this.headers={"Content-Type":"application/json",Authorization:`Bearer ${i.apiKey}`,"X-Meilisearch-Client":"Meilisearch JavaScript (v0.41.0)"}}updateHeadersFromClient(i){i&&i.httpRequest&&i.httpRequest.headers&&(this.headers={"Content-Type":i.httpRequest.headers["Content-Type"]||"application/json",Authorization:i.httpRequest.headers.Authorization||`Bearer ${this.config.apiKey}`,"X-Meilisearch-Client":i.httpRequest.headers["X-Meilisearch-Client"]||"Meilisearch JavaScript (v0.41.0)"})}async search(i,s={}){const{limit:n=20,offset:x=0,filter:p=['type = "course_block"'],attributesToHighlight:j=["display_name","description","published"],attributesToCrop:m=["description","published"],sort:g=[]}=s;if(!this.config.indexName)throw new Error("MeiliSearch indexName is required");const c={queries:[{indexUid:this.config.indexName,q:i,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(i,s={}){const{limit:n=20,offset:x=0,filter:p=['type = "course_block"'],attributesToHighlight:j=["display_name","description","published"],attributesToCrop:m=["description","published"],sort:g=[]}=s,c={queries:[{indexUid:this.config.indexName,q:i,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(i){return console.error("MeiliSearch connection check failed:",i),!1}}}const nr=t=>new zr(t);function sr(t,i){const{contextKey:s,usageKey:n}=t;return s?s.startsWith("course-v1:")?`${i||""}/course/${s}?show=${encodeURIComponent(n||"")}`:s.startsWith("library-v1:")?`${i||""}/library/${s}`:"#":"#"}function qr(t,i,s){const n=sr(t,i);return n==="#"?(console.warn("Could not generate URL for search hit:",t),"#"):(s?s(n):(n.startsWith("http"),window.location.href=n),n)}const Qe=({text:t,highlightTag:i="__meili-highlight__"})=>{if(!t)return null;const s="__/meili-highlight__",n=t.split(i),x=[];return n.forEach((p,j)=>{if(j===0)p&&x.push(p);else{const m=p.indexOf(s);if(m!==-1){const g=p.substring(0,m),c=p.substring(m+s.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:i,baseUrl:s})=>{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){i?i(t.url):window.location.href=t.url;return}qr(d,s,i)==="#"&&(i?i(`/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,s);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:i,loginSignupButtons:s,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:s&&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&&i.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:i})=>{const[s,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(i),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(s,{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:s,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 i=t.data.theme_colors;if(!i||typeof i!="object")throw new Error("Invalid theme_colors in API response");const s=document.documentElement;for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)){const x=i[n];s.style.setProperty(`--${n.replace(/_/g,"-")}`,x)}console.log("Theme applied successfully from API:",i)}catch(i){console.error("Error applying theme from API:",i.message);const s={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 s)if(Object.prototype.hasOwnProperty.call(s,x)){const p=s[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;
|
|
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===h))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"?ye.exports=Er():ye.exports=Sr()),ye.exports}var r=Cr();const Or=({contactInfo:t,quickLinks:i,exploreLinks:s,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(i.align)}`,children:r.jsxs("ul",{children:[r.jsx("h3",{children:"Quick Links"}),i.content.map((j,m)=>r.jsx("li",{children:r.jsx("a",{href:j.link,children:j.label})},m))]})}),r.jsx("div",{className:`section ${p(s.align)}`,children:r.jsxs("ul",{children:[r.jsx("h3",{children:"Explore"}),s.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=w.createContext(void 0),Rr=({children:t})=>{const[i,s]=w.useState(!1),n=()=>{s(p=>!p)},x=p=>{s(p)};return r.jsx(tr.Provider,{value:{isCollapsed:i,toggleSidebar:n,setSidebarCollapsed:x},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:i,presentPath:s})=>{const{isCollapsed:n,setSidebarCollapsed:x}=Te(),[p,j]=w.useState(!0),m=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===s);j(o),!o&&!n&&s.includes("/course/")&&!s.includes("/learning/course/")&&x(!0)},[s]),w.useEffect(()=>{const o=d=>{!p&&m.current&&!m.current.contains(d.target)&&s.includes("/course/")&&!s.includes("/learning/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===s||(s.includes("/course/")||s.includes("/course_rerun/"))&&o.path==="/my-courses"||s.includes("/library/")&&o.path==="/libraries"||s.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:()=>i(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[i,s]=w.useState(!1);return w.useEffect(()=>{const n=()=>{s(window.innerWidth<=t)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[t]),i},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:i,items:s})=>(console.log("NavDropdownMenu Props:",s),r.jsx(v.DropdownButton,{id:t,title:i,variant:"tertiary",className:"mr-2",children:s.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:i,isMobile:s,menuItems:n})=>{const x=i?r.jsx("img",{className:"d-block w-100 h-100",src:i,alt:t,"data-testid":"avatar-image"}):r.jsx(v.Avatar,{size:"sm",className:"mr-2",alt:"avatar","data-testid":"avatar-icon"}),p=s?x:r.jsxs(r.Fragment,{children:[t," ",x]});return r.jsx(Mr,{buttonTitle:p,id:"user-dropdown-menu",items:n})};var xe={},Ze;function Dr(){if(Ze)return xe;Ze=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.parse=j,xe.serialize=c;const t=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,i=/^[\u0021-\u003A\u003C-\u007E]*$/,s=/^([.]?[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 h=function(){};return h.prototype=Object.create(null),h})();function j(h,y){const u=new p,I=h.length;if(I<2)return u;const U=(y==null?void 0:y.decode)||o;let E=0;do{const D=h.indexOf("=",E);if(D===-1)break;const O=h.indexOf(";",E),G=O===-1?I:O;if(D>G){E=h.lastIndexOf(";",D-1)+1;continue}const $=m(h,E,D),X=g(h,D,$),H=h.slice($,X);if(u[H]===void 0){let R=m(h,D+1,G),Z=g(h,G,R);const ee=U(h.slice(R,Z));u[H]=ee}E=G+1}while(E<I);return u}function m(h,y,u){do{const I=h.charCodeAt(y);if(I!==32&&I!==9)return y}while(++y<u);return u}function g(h,y,u){for(;y>u;){const I=h.charCodeAt(--y);if(I!==32&&I!==9)return y+1}return u}function c(h,y,u){const I=(u==null?void 0:u.encode)||encodeURIComponent;if(!t.test(h))throw new TypeError(`argument name is invalid: ${h}`);const U=I(y);if(!i.test(U))throw new TypeError(`argument val is invalid: ${y}`);let E=h+"="+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(!s.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(h){if(h.indexOf("%")===-1)return h;try{return decodeURIComponent(h)}catch{return h}}function d(h){return x.call(h)==="[object Date]"}return xe}var je=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"?je.parse(t):typeof t=="object"&&t!==null?t:{}}function ke(t,i={}){const s=Hr(t);if(!i.doNotParse)try{return JSON.parse(s)}catch{}return t}function Hr(t){return t&&t[0]==="j"&&t[1]===":"?t.substr(2):t}class Fr{constructor(i,s={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const x=this.cookies;this.cookies=je.parse(document.cookie),this._checkChanges(x)};const n=typeof document>"u"?"":document.cookie;this.cookies=Lr(i||n),this.defaultSetOptions=s,this.HAS_DOCUMENT_COOKIE=$r()}_emitChange(i){for(let s=0;s<this.changeListeners.length;++s)this.changeListeners[s](i)}_checkChanges(i){new Set(Object.keys(i).concat(Object.keys(this.cookies))).forEach(n=>{i[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(i,s={}){return s.doNotUpdate||this.update(),ke(this.cookies[i],s)}getAll(i={}){i.doNotUpdate||this.update();const s={};for(let n in this.cookies)s[n]=ke(this.cookies[n],i);return s}set(i,s,n){n?n=Object.assign(Object.assign({},this.defaultSetOptions),n):n=this.defaultSetOptions;const x=typeof s=="string"?s:JSON.stringify(s);this.cookies=Object.assign(Object.assign({},this.cookies),{[i]:x}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=je.serialize(i,x,n)),this._emitChange({name:i,value:s,options:n})}remove(i,s){const n=s=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),s),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[i],this.HAS_DOCUMENT_COOKIE&&(document.cookie=je.serialize(i,"",n)),this._emitChange({name:i,value:void 0,options:s})}addChangeListener(i){this.changeListeners.push(i),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(i){const s=this.changeListeners.indexOf(i);s>=0&&this.changeListeners.splice(s,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(i){if(!i.host)throw new Error("MeiliSearch host is required");if(!i.apiKey)throw new Error("MeiliSearch apiKey is required");if(!i.indexName)throw new Error("MeiliSearch indexName is required");this.config=i,this.headers={"Content-Type":"application/json",Authorization:`Bearer ${i.apiKey}`,"X-Meilisearch-Client":"Meilisearch JavaScript (v0.41.0)"}}updateHeadersFromClient(i){i&&i.httpRequest&&i.httpRequest.headers&&(this.headers={"Content-Type":i.httpRequest.headers["Content-Type"]||"application/json",Authorization:i.httpRequest.headers.Authorization||`Bearer ${this.config.apiKey}`,"X-Meilisearch-Client":i.httpRequest.headers["X-Meilisearch-Client"]||"Meilisearch JavaScript (v0.41.0)"})}async search(i,s={}){const{limit:n=20,offset:x=0,filter:p=['type = "course_block"'],attributesToHighlight:j=["display_name","description","published"],attributesToCrop:m=["description","published"],sort:g=[]}=s;if(!this.config.indexName)throw new Error("MeiliSearch indexName is required");const c={queries:[{indexUid:this.config.indexName,q:i,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 h=await d.json(),y=h.results[0],u=h.results[1];return{hits:y.hits||[],totalHits:y.estimatedTotalHits||0,facets:u.facetDistribution,processingTimeMs:y.processingTimeMs}}catch(d){throw console.error("MeiliSearch service error:",d),new Error(`Search failed: ${d instanceof Error?d.message:"Unknown error"}`)}}async simpleSearch(i,s={}){const{limit:n=20,offset:x=0,filter:p=['type = "course_block"'],attributesToHighlight:j=["display_name","description","published"],attributesToCrop:m=["description","published"],sort:g=[]}=s,c={queries:[{indexUid:this.config.indexName,q:i,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 y=(await d.json()).results[0];return{hits:y.hits||[],totalHits:y.estimatedTotalHits||0,processingTimeMs:y.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(i){return console.error("MeiliSearch connection check failed:",i),!1}}}const nr=t=>new zr(t);function sr(t,i){const{contextKey:s,usageKey:n}=t;return s?s.startsWith("course-v1:")?`${i||""}/course/${s}?show=${encodeURIComponent(n||"")}`:s.startsWith("library-v1:")?`${i||""}/library/${s}`:"#":"#"}function qr(t,i,s){const n=sr(t,i);return n==="#"?(console.warn("Could not generate URL for search hit:",t),"#"):(s?s(n):(n.startsWith("http"),window.location.href=n),n)}const Qe=({text:t,highlightTag:i="__meili-highlight__"})=>{if(!t)return null;const s="__/meili-highlight__",n=t.split(i),x=[];return n.forEach((p,j)=>{if(j===0)p&&x.push(p);else{const m=p.indexOf(s);if(m!==-1){const g=p.substring(0,m),c=p.substring(m+s.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:i,baseUrl:s})=>{var g,c;const n=o=>{var y;o.preventDefault(),o.stopPropagation();const d={id:t.id,blockType:t.block_type||t.type,contextKey:t.context_key,usageKey:t.usage_key,breadcrumbs:((y=t.breadcrumbs)==null?void 0:y.map(u=>({displayName:u.display_name,usageKey:u.usage_key})))||[]};if(t.url){i?i(t.url):window.location.href=t.url;return}qr(d,s,i)==="#"&&(i?i(`/search-result/${t.id}`):window.location.href=`/search-result/${t.id}`)},x=o=>{var y;o.preventDefault(),o.stopPropagation();const d={id:t.id,blockType:t.block_type||t.type,contextKey:t.context_key,usageKey:t.usage_key,breadcrumbs:((y=t.breadcrumbs)==null?void 0:y.map(u=>({displayName:u.display_name,usageKey:u.usage_key})))||[]},h=sr(d,s);h&&h!=="#"&&window.open(h,"_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:i,loginSignupButtons:s,authenticatedUser:n=null,userMenuItems:x,menuAlignment:p,onLanguageChange:j,getBaseUrl:m,meiliSearchConfig:g,headerButtons:c,languageSelectorList:o})=>{const d=Tr(),{toggleSidebar:h,setSidebarCollapsed:y}=Te(),[u,I]=w.useState(()=>er.get("openedx-language-preference")||"en"),[U,E]=w.useState(!1),[D,O]=w.useState(!1),[G,$]=w.useState(!1),[X,H]=w.useState(""),[R,Z]=w.useState([]),[ee,F]=w.useState(!1),[L,V]=w.useState(null),[M,z]=w.useState(0),[C,W]=w.useState(!1),[K,Q]=w.useState(5),oe=w.useRef(null),J=w.useRef(null),se=w.useRef(g?nr(g):null),ce=w.useRef(!1);console.log("languageSelectorList",o),w.useEffect(()=>{g!=null&&g.client&&se.current&&se.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&&!ce.current?(y(!0),ce.current=!0):d||(ce.current=!1)},[d,y]),w.useEffect(()=>{if(!D)return;function f(N){oe.current&&!oe.current.contains(N.target)&&O(!1)}return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[D]);const le=f=>{I(f),er.set("openedx-language-preference",f,{path:m?m():"/"}),j&&j()},me=p&&{left:"justify-content-start",center:"justify-content-center",right:"justify-content-end"}[p.toLowerCase()]||"justify-content-start",ue=async f=>{if(!f.trim()||!g||!se.current){Z([]),z(0),$(!1),W(!1);return}F(!0),V(null),$(!1),Q(5);try{const N=await se.current.simpleSearch(f,{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)}},ie=f=>{H(f),ue(f),d&&U&&E(!1)},de=f=>{H(f),G&&f.trim()===""&&($(!1),W(!1)),J.current&&clearTimeout(J.current),f.trim().length>0?J.current=setTimeout(()=>{ue(f)},500):(Z([]),z(0),$(!1),W(!1))},ae=()=>{J.current&&(clearTimeout(J.current),J.current=null),H(""),Z([]),z(0),$(!1),W(!1),V(null),F(!1)},be=()=>{H(""),Z([]),z(0),$(!1),W(!1),V(null),F(!1),Q(5),J.current&&(clearTimeout(J.current),J.current=null)},ge=()=>{Q(f=>Math.min(f+10,R.length))},ve=f=>{if(o&&o.length>0){const B=o.find(ne=>ne[f]);if(B)return B[f]}return{en:"English",ar:"Arabic",hi:"Hindi"}[f]||f.toUpperCase()},we=()=>(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((f,N)=>{const[B,ne]=Object.entries(f)[0];return r.jsx(v.Dropdown.Item,{onClick:()=>le(B),children:ne},`lang-${B}-${N}`)})):(console.log("Using fallback languages"),r.jsxs(r.Fragment,{children:[r.jsx(v.Dropdown.Item,{onClick:()=>le("en"),children:"English"}),r.jsx(v.Dropdown.Item,{onClick:()=>le("ar"),children:"Arabic"}),r.jsx(v.Dropdown.Item,{onClick:()=>le("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:h,className:"ms-2 ml-2",onMouseDown:f=>f.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:f=>f.stopPropagation(),onClick:()=>O(f=>!f)}),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:ve(u)}),r.jsx(v.Dropdown.Menu,{children:we()})]})]})]})}):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:f=>{de(f.target.value)},onKeyDown:f=>{f.key==="Enter"&&ie(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:()=>{ae()},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((f,N)=>r.jsx(Be,{result:f,onNavigate:B=>{be(),window.location.href=B},baseUrl:m?m():void 0},f.id||N)),K<R.length&&r.jsx("div",{className:"search-results-more",children:r.jsxs("button",{onClick:ge,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:ve(u)}),r.jsx(v.Dropdown.Menu,{children:we()})]}),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:s&&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 ${me}`,children:n===null&&i.map(f=>f.subMenu?r.jsx(v.NavDropdown,{title:f.label,id:`nav-dropdown-${f.label}`,children:f.subMenu.map(N=>r.jsx(v.NavDropdown.Item,{onClick:()=>console.log("Selected submenu:",N.label),children:N.label},`sub-${N.label}`))},`menu-${f.label}`):r.jsx(v.Nav.Link,{as:"span",className:"text-uppercase fw-semibold",children:f.label},`menu-${f.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:f=>{de(f.target.value)},onKeyDown:f=>{f.key==="Enter"&&ie(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:()=>{ae()},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((f,N)=>r.jsx(Be,{result:f,onNavigate:B=>{be(),window.location.href=B},baseUrl:m?m():void 0},f.id||N)),K<R.length&&r.jsx("div",{className:"search-results-more",children:r.jsxs("button",{onClick:ge,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=w.createContext(void 0),Kr=({children:t,meiliSearchConfig:i})=>{const[s,n]=w.useState(""),[x,p]=w.useState([]),[j,m]=w.useState(0),[g,c]=w.useState(!1),[o,d]=w.useState(!1),[h,y]=w.useState(null),[u,I]=w.useState(0),[U,E]=w.useState(!1),[D,O]=w.useState(!1),[G,$]=w.useState(null),X=nr(i),H=async F=>{if(!F.trim()){Z();return}c(!0),d(!1),y(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),y(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(s,{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),y(F instanceof Error?F.message:"Failed to load more results")}finally{O(!1)}}},Z=()=>{n(""),p([]),m(0),d(!1),y(null),I(0),E(!1),$(null)},ee={searchKeywords:s,setSearchKeywords:n,searchResults:x,totalHits:j,isLoading:g,hasError:o,errorMessage:h,facets:G,performSearch:H,clearSearch:Z,hasNextPage:U,fetchNextPage:R,isFetchingNextPage:D};return r.jsx(ir.Provider,{value:ee,children:t})},Yr=()=>{const t=w.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 i=t.data.theme_colors;if(!i||typeof i!="object")throw new Error("Invalid theme_colors in API response");const s=document.documentElement;for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)){const x=i[n];s.style.setProperty(`--${n.replace(/_/g,"-")}`,x)}console.log("Theme applied successfully from API:",i)}catch(i){console.error("Error applying theme from API:",i.message);const s={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 s)if(Object.prototype.hasOwnProperty.call(s,x)){const p=s[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.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as z from "react";
|
|
2
|
-
import lr, { createContext as ur, useState as k, useContext as dr, useRef as
|
|
3
|
-
import { OverlayTrigger as Ir, Button as $e, Tooltip as $r, DropdownButton as Dr, Dropdown as ee, Avatar as Lr, Icon as Z, IconButton as
|
|
4
|
-
var
|
|
2
|
+
import lr, { createContext as ur, useState as k, useContext as dr, useRef as je, useEffect as ie } from "react";
|
|
3
|
+
import { OverlayTrigger as Ir, Button as $e, Tooltip as $r, DropdownButton as Dr, Dropdown as ee, Avatar as Lr, Icon as Z, IconButton as Oe, Navbar as Se, IconButtonWithTooltip as ae, Nav as Ue, NavDropdown as Ge } from "@openedx/paragon";
|
|
4
|
+
var Ce = { exports: {} }, ve = {};
|
|
5
5
|
/*
|
|
6
6
|
object-assign
|
|
7
7
|
(c) Sindre Sorhus
|
|
@@ -46,8 +46,8 @@ function fr() {
|
|
|
46
46
|
s.call(m, d) && (g[d] = m[d]);
|
|
47
47
|
if (t) {
|
|
48
48
|
c = t(m);
|
|
49
|
-
for (var
|
|
50
|
-
i.call(m, c[
|
|
49
|
+
for (var h = 0; h < c.length; h++)
|
|
50
|
+
i.call(m, c[h]) && (g[c[h]] = m[c[h]]);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
return g;
|
|
@@ -72,11 +72,11 @@ function Hr() {
|
|
|
72
72
|
}
|
|
73
73
|
var n = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = Object.prototype.hasOwnProperty, p = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
74
74
|
function w(m, g, c) {
|
|
75
|
-
var o, d = {},
|
|
76
|
-
c !== void 0 && (
|
|
75
|
+
var o, d = {}, h = null, b = null;
|
|
76
|
+
c !== void 0 && (h = "" + c), g.key !== void 0 && (h = "" + g.key), g.ref !== void 0 && (b = g.ref);
|
|
77
77
|
for (o in g) v.call(g, o) && !p.hasOwnProperty(o) && (d[o] = g[o]);
|
|
78
78
|
if (m && m.defaultProps) for (o in g = m.defaultProps, g) d[o] === void 0 && (d[o] = g[o]);
|
|
79
|
-
return { $$typeof: s, type: m, key:
|
|
79
|
+
return { $$typeof: s, type: m, key: h, ref: b, props: d, _owner: n.current };
|
|
80
80
|
}
|
|
81
81
|
return ve.jsx = w, ve.jsxs = w, ve;
|
|
82
82
|
}
|
|
@@ -95,10 +95,10 @@ function Fr() {
|
|
|
95
95
|
process.env.NODE_ENV !== "production" && (function() {
|
|
96
96
|
var s = lr, i = fr(), n = 60103, v = 60106;
|
|
97
97
|
t.Fragment = 60107;
|
|
98
|
-
var p = 60108, w = 60114, m = 60109, g = 60110, c = 60112, o = 60113, d = 60120,
|
|
98
|
+
var p = 60108, w = 60114, m = 60109, g = 60110, c = 60112, o = 60113, d = 60120, h = 60115, b = 60116, u = 60121, P = 60122, J = 60117, j = 60129, I = 60131;
|
|
99
99
|
if (typeof Symbol == "function" && Symbol.for) {
|
|
100
100
|
var S = Symbol.for;
|
|
101
|
-
n = S("react.element"), v = S("react.portal"), t.Fragment = S("react.fragment"), p = S("react.strict_mode"), w = S("react.profiler"), m = S("react.provider"), g = S("react.context"), c = S("react.forward_ref"), o = S("react.suspense"), d = S("react.suspense_list"),
|
|
101
|
+
n = S("react.element"), v = S("react.portal"), t.Fragment = S("react.fragment"), p = S("react.strict_mode"), w = S("react.profiler"), m = S("react.provider"), g = S("react.context"), c = S("react.forward_ref"), o = S("react.suspense"), d = S("react.suspense_list"), h = S("react.memo"), b = S("react.lazy"), u = S("react.block"), P = S("react.server.block"), J = S("react.fundamental"), S("react.scope"), S("react.opaque.id"), j = S("react.debug_trace_mode"), S("react.offscreen"), I = S("react.legacy_hidden");
|
|
102
102
|
}
|
|
103
103
|
var U = typeof Symbol == "function" && Symbol.iterator, $ = "@@iterator";
|
|
104
104
|
function G(e) {
|
|
@@ -127,7 +127,7 @@ function Fr() {
|
|
|
127
127
|
}
|
|
128
128
|
var re = !1;
|
|
129
129
|
function H(e) {
|
|
130
|
-
return !!(typeof e == "string" || typeof e == "function" || e === t.Fragment || e === w || e === j || e === p || e === o || e === d || e === I || re || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof ===
|
|
130
|
+
return !!(typeof e == "string" || typeof e == "function" || e === t.Fragment || e === w || e === j || e === p || e === o || e === d || e === I || re || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === h || e.$$typeof === m || e.$$typeof === g || e.$$typeof === c || e.$$typeof === J || e.$$typeof === u || e[0] === P));
|
|
131
131
|
}
|
|
132
132
|
function D(e, a, l) {
|
|
133
133
|
var x = a.displayName || a.name || "";
|
|
@@ -167,7 +167,7 @@ function Fr() {
|
|
|
167
167
|
return V(l._context) + ".Provider";
|
|
168
168
|
case c:
|
|
169
169
|
return D(e, e.render, "ForwardRef");
|
|
170
|
-
case
|
|
170
|
+
case h:
|
|
171
171
|
return M(e.type);
|
|
172
172
|
case u:
|
|
173
173
|
return M(e._render);
|
|
@@ -182,18 +182,18 @@ function Fr() {
|
|
|
182
182
|
}
|
|
183
183
|
return null;
|
|
184
184
|
}
|
|
185
|
-
var F = 0, E, q, K, Q, ue, Y,
|
|
186
|
-
function
|
|
185
|
+
var F = 0, E, q, K, Q, ue, Y, oe;
|
|
186
|
+
function de() {
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
function
|
|
188
|
+
de.__reactDisabledLog = !0;
|
|
189
|
+
function fe() {
|
|
190
190
|
{
|
|
191
191
|
if (F === 0) {
|
|
192
|
-
E = console.log, q = console.info, K = console.warn, Q = console.error, ue = console.group, Y = console.groupCollapsed,
|
|
192
|
+
E = console.log, q = console.info, K = console.warn, Q = console.error, ue = console.group, Y = console.groupCollapsed, oe = console.groupEnd;
|
|
193
193
|
var e = {
|
|
194
194
|
configurable: !0,
|
|
195
195
|
enumerable: !0,
|
|
196
|
-
value:
|
|
196
|
+
value: de,
|
|
197
197
|
writable: !0
|
|
198
198
|
};
|
|
199
199
|
Object.defineProperties(console, {
|
|
@@ -209,7 +209,7 @@ function Fr() {
|
|
|
209
209
|
F++;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function De() {
|
|
213
213
|
{
|
|
214
214
|
if (F--, F === 0) {
|
|
215
215
|
var e = {
|
|
@@ -237,34 +237,34 @@ function Fr() {
|
|
|
237
237
|
value: Y
|
|
238
238
|
}),
|
|
239
239
|
groupEnd: i({}, e, {
|
|
240
|
-
value:
|
|
240
|
+
value: oe
|
|
241
241
|
})
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
F < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
var
|
|
247
|
+
var xe = L.ReactCurrentDispatcher, he;
|
|
248
248
|
function ce(e, a, l) {
|
|
249
249
|
{
|
|
250
|
-
if (
|
|
250
|
+
if (he === void 0)
|
|
251
251
|
try {
|
|
252
252
|
throw Error();
|
|
253
253
|
} catch (R) {
|
|
254
254
|
var x = R.stack.trim().match(/\n( *(at )?)/);
|
|
255
|
-
|
|
255
|
+
he = x && x[1] || "";
|
|
256
256
|
}
|
|
257
257
|
return `
|
|
258
|
-
` +
|
|
258
|
+
` + he + e;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
-
var
|
|
261
|
+
var pe = !1, le;
|
|
262
262
|
{
|
|
263
|
-
var
|
|
264
|
-
le = new
|
|
263
|
+
var _e = typeof WeakMap == "function" ? WeakMap : Map;
|
|
264
|
+
le = new _e();
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
if (!e ||
|
|
266
|
+
function be(e, a) {
|
|
267
|
+
if (!e || pe)
|
|
268
268
|
return "";
|
|
269
269
|
{
|
|
270
270
|
var l = le.get(e);
|
|
@@ -272,11 +272,11 @@ function Fr() {
|
|
|
272
272
|
return l;
|
|
273
273
|
}
|
|
274
274
|
var x;
|
|
275
|
-
|
|
275
|
+
pe = !0;
|
|
276
276
|
var R = Error.prepareStackTrace;
|
|
277
277
|
Error.prepareStackTrace = void 0;
|
|
278
278
|
var O;
|
|
279
|
-
O =
|
|
279
|
+
O = xe.current, xe.current = null, fe();
|
|
280
280
|
try {
|
|
281
281
|
if (a) {
|
|
282
282
|
var _ = function() {
|
|
@@ -329,23 +329,23 @@ function Fr() {
|
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
} finally {
|
|
332
|
-
|
|
332
|
+
pe = !1, xe.current = O, De(), Error.prepareStackTrace = R;
|
|
333
333
|
}
|
|
334
334
|
var ge = e ? e.displayName || e.name : "", Je = ge ? ce(ge) : "";
|
|
335
335
|
return typeof e == "function" && le.set(e, Je), Je;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
return
|
|
337
|
+
function we(e, a, l) {
|
|
338
|
+
return be(e, !1);
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function Ee(e) {
|
|
341
341
|
var a = e.prototype;
|
|
342
342
|
return !!(a && a.isReactComponent);
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function f(e, a, l) {
|
|
345
345
|
if (e == null)
|
|
346
346
|
return "";
|
|
347
347
|
if (typeof e == "function")
|
|
348
|
-
return
|
|
348
|
+
return be(e, Ee(e));
|
|
349
349
|
if (typeof e == "string")
|
|
350
350
|
return ce(e);
|
|
351
351
|
switch (e) {
|
|
@@ -357,28 +357,28 @@ function Fr() {
|
|
|
357
357
|
if (typeof e == "object")
|
|
358
358
|
switch (e.$$typeof) {
|
|
359
359
|
case c:
|
|
360
|
-
return
|
|
361
|
-
case
|
|
362
|
-
return
|
|
360
|
+
return we(e.render);
|
|
361
|
+
case h:
|
|
362
|
+
return f(e.type, a, l);
|
|
363
363
|
case u:
|
|
364
|
-
return
|
|
364
|
+
return we(e._render);
|
|
365
365
|
case b: {
|
|
366
366
|
var x = e, R = x._payload, O = x._init;
|
|
367
367
|
try {
|
|
368
|
-
return
|
|
368
|
+
return f(O(R), a, l);
|
|
369
369
|
} catch {
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
373
|
return "";
|
|
374
374
|
}
|
|
375
|
-
var
|
|
376
|
-
function
|
|
375
|
+
var T = {}, B = L.ReactDebugCurrentFrame;
|
|
376
|
+
function se(e) {
|
|
377
377
|
if (e) {
|
|
378
|
-
var a = e._owner, l =
|
|
379
|
-
|
|
378
|
+
var a = e._owner, l = f(e.type, e._source, a ? a.type : null);
|
|
379
|
+
B.setExtraStackFrame(l);
|
|
380
380
|
} else
|
|
381
|
-
|
|
381
|
+
B.setExtraStackFrame(null);
|
|
382
382
|
}
|
|
383
383
|
function xr(e, a, l, x, R) {
|
|
384
384
|
{
|
|
@@ -395,7 +395,7 @@ function Fr() {
|
|
|
395
395
|
} catch (N) {
|
|
396
396
|
y = N;
|
|
397
397
|
}
|
|
398
|
-
y && !(y instanceof Error) && (
|
|
398
|
+
y && !(y instanceof Error) && (se(R), C("%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, _, typeof y), se(null)), y instanceof Error && !(y.message in T) && (T[y.message] = !0, se(R), C("Failed %s type: %s", l, y.message), se(null));
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
}
|
|
@@ -496,7 +496,7 @@ function Fr() {
|
|
|
496
496
|
var Te = L.ReactCurrentOwner, ze = L.ReactDebugCurrentFrame;
|
|
497
497
|
function me(e) {
|
|
498
498
|
if (e) {
|
|
499
|
-
var a = e._owner, l =
|
|
499
|
+
var a = e._owner, l = f(e.type, e._source, a ? a.type : null);
|
|
500
500
|
ze.setExtraStackFrame(l);
|
|
501
501
|
} else
|
|
502
502
|
ze.setExtraStackFrame(null);
|
|
@@ -576,7 +576,7 @@ Check the top-level render call using <` + l + ">.");
|
|
|
576
576
|
l = a.propTypes;
|
|
577
577
|
else if (typeof a == "object" && (a.$$typeof === c || // Note: Memo only checks outer props here.
|
|
578
578
|
// Inner props are checked in the reconciler.
|
|
579
|
-
a.$$typeof ===
|
|
579
|
+
a.$$typeof === h))
|
|
580
580
|
l = a.propTypes;
|
|
581
581
|
else
|
|
582
582
|
return;
|
|
@@ -646,7 +646,7 @@ Check the top-level render call using <` + l + ">.");
|
|
|
646
646
|
}
|
|
647
647
|
var Be;
|
|
648
648
|
function zr() {
|
|
649
|
-
return Be || (Be = 1, process.env.NODE_ENV === "production" ?
|
|
649
|
+
return Be || (Be = 1, process.env.NODE_ENV === "production" ? Ce.exports = Hr() : Ce.exports = Fr()), Ce.exports;
|
|
650
650
|
}
|
|
651
651
|
var r = zr();
|
|
652
652
|
const it = ({ contactInfo: t, quickLinks: s, exploreLinks: i, logoUrl: n, copyrights: v }) => {
|
|
@@ -696,7 +696,7 @@ const it = ({ contactInfo: t, quickLinks: s, exploreLinks: i, logoUrl: n, copyri
|
|
|
696
696
|
throw new Error("useSidebar must be used within a SidebarProvider");
|
|
697
697
|
return t;
|
|
698
698
|
}, at = ({ buttons: t, onNavigate: s, presentPath: i }) => {
|
|
699
|
-
const { isCollapsed: n, setSidebarCollapsed: v } = pr(), [p, w] = k(!0), m =
|
|
699
|
+
const { isCollapsed: n, setSidebarCollapsed: v } = pr(), [p, w] = k(!0), m = je(null), [g, c] = k(
|
|
700
700
|
() => document.dir === "rtl" || document.documentElement.dir === "rtl"
|
|
701
701
|
);
|
|
702
702
|
return ie(() => {
|
|
@@ -911,64 +911,64 @@ const it = ({ contactInfo: t, quickLinks: s, exploreLinks: i, logoUrl: n, copyri
|
|
|
911
911
|
}
|
|
912
912
|
);
|
|
913
913
|
};
|
|
914
|
-
var
|
|
914
|
+
var ye = {}, sr;
|
|
915
915
|
function Ur() {
|
|
916
|
-
if (sr) return
|
|
917
|
-
sr = 1, Object.defineProperty(
|
|
916
|
+
if (sr) return ye;
|
|
917
|
+
sr = 1, Object.defineProperty(ye, "__esModule", { value: !0 }), ye.parse = w, ye.serialize = c;
|
|
918
918
|
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]*$/, v = Object.prototype.toString, p = /* @__PURE__ */ (() => {
|
|
919
|
-
const
|
|
919
|
+
const h = function() {
|
|
920
920
|
};
|
|
921
|
-
return
|
|
921
|
+
return h.prototype = /* @__PURE__ */ Object.create(null), h;
|
|
922
922
|
})();
|
|
923
|
-
function w(
|
|
924
|
-
const u = new p(), P =
|
|
923
|
+
function w(h, b) {
|
|
924
|
+
const u = new p(), P = h.length;
|
|
925
925
|
if (P < 2)
|
|
926
926
|
return u;
|
|
927
927
|
const J = (b == null ? void 0 : b.decode) || o;
|
|
928
928
|
let j = 0;
|
|
929
929
|
do {
|
|
930
|
-
const I =
|
|
930
|
+
const I = h.indexOf("=", j);
|
|
931
931
|
if (I === -1)
|
|
932
932
|
break;
|
|
933
|
-
const S =
|
|
933
|
+
const S = h.indexOf(";", j), U = S === -1 ? P : S;
|
|
934
934
|
if (I > U) {
|
|
935
|
-
j =
|
|
935
|
+
j = h.lastIndexOf(";", I - 1) + 1;
|
|
936
936
|
continue;
|
|
937
937
|
}
|
|
938
|
-
const $ = m(
|
|
938
|
+
const $ = m(h, j, I), G = g(h, I, $), L = h.slice($, G);
|
|
939
939
|
if (u[L] === void 0) {
|
|
940
|
-
let C = m(
|
|
941
|
-
const re = J(
|
|
940
|
+
let C = m(h, I + 1, U), X = g(h, U, C);
|
|
941
|
+
const re = J(h.slice(C, X));
|
|
942
942
|
u[L] = re;
|
|
943
943
|
}
|
|
944
944
|
j = U + 1;
|
|
945
945
|
} while (j < P);
|
|
946
946
|
return u;
|
|
947
947
|
}
|
|
948
|
-
function m(
|
|
948
|
+
function m(h, b, u) {
|
|
949
949
|
do {
|
|
950
|
-
const P =
|
|
950
|
+
const P = h.charCodeAt(b);
|
|
951
951
|
if (P !== 32 && P !== 9)
|
|
952
952
|
return b;
|
|
953
953
|
} while (++b < u);
|
|
954
954
|
return u;
|
|
955
955
|
}
|
|
956
|
-
function g(
|
|
956
|
+
function g(h, b, u) {
|
|
957
957
|
for (; b > u; ) {
|
|
958
|
-
const P =
|
|
958
|
+
const P = h.charCodeAt(--b);
|
|
959
959
|
if (P !== 32 && P !== 9)
|
|
960
960
|
return b + 1;
|
|
961
961
|
}
|
|
962
962
|
return u;
|
|
963
963
|
}
|
|
964
|
-
function c(
|
|
964
|
+
function c(h, b, u) {
|
|
965
965
|
const P = (u == null ? void 0 : u.encode) || encodeURIComponent;
|
|
966
|
-
if (!t.test(
|
|
967
|
-
throw new TypeError(`argument name is invalid: ${
|
|
966
|
+
if (!t.test(h))
|
|
967
|
+
throw new TypeError(`argument name is invalid: ${h}`);
|
|
968
968
|
const J = P(b);
|
|
969
969
|
if (!s.test(J))
|
|
970
970
|
throw new TypeError(`argument val is invalid: ${b}`);
|
|
971
|
-
let j =
|
|
971
|
+
let j = h + "=" + J;
|
|
972
972
|
if (!u)
|
|
973
973
|
return j;
|
|
974
974
|
if (u.maxAge !== void 0) {
|
|
@@ -1022,27 +1022,27 @@ function Ur() {
|
|
|
1022
1022
|
}
|
|
1023
1023
|
return j;
|
|
1024
1024
|
}
|
|
1025
|
-
function o(
|
|
1026
|
-
if (
|
|
1027
|
-
return
|
|
1025
|
+
function o(h) {
|
|
1026
|
+
if (h.indexOf("%") === -1)
|
|
1027
|
+
return h;
|
|
1028
1028
|
try {
|
|
1029
|
-
return decodeURIComponent(
|
|
1029
|
+
return decodeURIComponent(h);
|
|
1030
1030
|
} catch {
|
|
1031
|
-
return
|
|
1031
|
+
return h;
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
|
-
function d(
|
|
1035
|
-
return v.call(
|
|
1034
|
+
function d(h) {
|
|
1035
|
+
return v.call(h) === "[object Date]";
|
|
1036
1036
|
}
|
|
1037
|
-
return
|
|
1037
|
+
return ye;
|
|
1038
1038
|
}
|
|
1039
|
-
var
|
|
1039
|
+
var Re = Ur();
|
|
1040
1040
|
function Gr() {
|
|
1041
1041
|
const t = typeof global > "u" ? void 0 : global.TEST_HAS_DOCUMENT_COOKIE;
|
|
1042
1042
|
return typeof t == "boolean" ? t : typeof document == "object" && typeof document.cookie == "string";
|
|
1043
1043
|
}
|
|
1044
1044
|
function Xr(t) {
|
|
1045
|
-
return typeof t == "string" ?
|
|
1045
|
+
return typeof t == "string" ? Re.parse(t) : typeof t == "object" && t !== null ? t : {};
|
|
1046
1046
|
}
|
|
1047
1047
|
function Ie(t, s = {}) {
|
|
1048
1048
|
const i = Zr(t);
|
|
@@ -1062,7 +1062,7 @@ class Qr {
|
|
|
1062
1062
|
if (!this.HAS_DOCUMENT_COOKIE)
|
|
1063
1063
|
return;
|
|
1064
1064
|
const v = this.cookies;
|
|
1065
|
-
this.cookies =
|
|
1065
|
+
this.cookies = Re.parse(document.cookie), this._checkChanges(v);
|
|
1066
1066
|
};
|
|
1067
1067
|
const n = typeof document > "u" ? "" : document.cookie;
|
|
1068
1068
|
this.cookies = Xr(s || n), this.defaultSetOptions = i, this.HAS_DOCUMENT_COOKIE = Gr();
|
|
@@ -1098,11 +1098,11 @@ class Qr {
|
|
|
1098
1098
|
set(s, i, n) {
|
|
1099
1099
|
n ? n = Object.assign(Object.assign({}, this.defaultSetOptions), n) : n = this.defaultSetOptions;
|
|
1100
1100
|
const v = typeof i == "string" ? i : JSON.stringify(i);
|
|
1101
|
-
this.cookies = Object.assign(Object.assign({}, this.cookies), { [s]: v }), this.HAS_DOCUMENT_COOKIE && (document.cookie =
|
|
1101
|
+
this.cookies = Object.assign(Object.assign({}, this.cookies), { [s]: v }), this.HAS_DOCUMENT_COOKIE && (document.cookie = Re.serialize(s, v, n)), this._emitChange({ name: s, value: i, options: n });
|
|
1102
1102
|
}
|
|
1103
1103
|
remove(s, i) {
|
|
1104
1104
|
const n = i = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), i), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 });
|
|
1105
|
-
this.cookies = Object.assign({}, this.cookies), delete this.cookies[s], this.HAS_DOCUMENT_COOKIE && (document.cookie =
|
|
1105
|
+
this.cookies = Object.assign({}, this.cookies), delete this.cookies[s], this.HAS_DOCUMENT_COOKIE && (document.cookie = Re.serialize(s, "", n)), this._emitChange({ name: s, value: void 0, options: i });
|
|
1106
1106
|
}
|
|
1107
1107
|
addChangeListener(s) {
|
|
1108
1108
|
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());
|
|
@@ -1186,7 +1186,7 @@ class Br {
|
|
|
1186
1186
|
});
|
|
1187
1187
|
if (!d.ok)
|
|
1188
1188
|
throw new Error(`MeiliSearch API error: ${d.status} ${d.statusText}`);
|
|
1189
|
-
const
|
|
1189
|
+
const h = await d.json(), b = h.results[0], u = h.results[1];
|
|
1190
1190
|
return {
|
|
1191
1191
|
hits: b.hits || [],
|
|
1192
1192
|
totalHits: b.estimatedTotalHits || 0,
|
|
@@ -1347,8 +1347,8 @@ const or = ({
|
|
|
1347
1347
|
displayName: u.display_name,
|
|
1348
1348
|
usageKey: u.usage_key
|
|
1349
1349
|
}))) || []
|
|
1350
|
-
},
|
|
1351
|
-
|
|
1350
|
+
}, h = gr(d, i);
|
|
1351
|
+
h && h !== "#" && window.open(h, "_blank");
|
|
1352
1352
|
}, p = ((g = t._formatted) == null ? void 0 : g.display_name) || t.display_name, w = ((c = t._formatted) == null ? void 0 : c.description) || t.description, m = t.block_type || t.type;
|
|
1353
1353
|
return /* @__PURE__ */ r.jsx(
|
|
1354
1354
|
"div",
|
|
@@ -1368,7 +1368,7 @@ const or = ({
|
|
|
1368
1368
|
t.breadcrumbs && t.breadcrumbs.length > 0 && /* @__PURE__ */ r.jsx("div", { className: "search-result-breadcrumbs", children: t.breadcrumbs.map((o) => o.display_name).join(" / ") })
|
|
1369
1369
|
] }),
|
|
1370
1370
|
/* @__PURE__ */ r.jsx("div", { className: "search-result-actions", children: /* @__PURE__ */ r.jsx(
|
|
1371
|
-
|
|
1371
|
+
Oe,
|
|
1372
1372
|
{
|
|
1373
1373
|
src: Wr,
|
|
1374
1374
|
iconAs: Z,
|
|
@@ -1393,42 +1393,42 @@ const or = ({
|
|
|
1393
1393
|
headerButtons: c,
|
|
1394
1394
|
languageSelectorList: o
|
|
1395
1395
|
}) => {
|
|
1396
|
-
const d = Vr(), { toggleSidebar:
|
|
1396
|
+
const d = Vr(), { toggleSidebar: h, setSidebarCollapsed: b } = pr(), [u, P] = k(() => cr.get("openedx-language-preference") || "en"), [J, j] = k(!1), [I, S] = k(!1), [U, $] = k(!1), [G, L] = k(""), [C, X] = k([]), [re, H] = k(!1), [D, V] = k(null), [M, F] = k(0), [E, q] = k(!1), [K, Q] = k(5), ue = je(null), Y = je(null), oe = je(g ? mr(g) : null), de = je(!1);
|
|
1397
1397
|
console.log("languageSelectorList", o), ie(() => {
|
|
1398
|
-
g != null && g.client &&
|
|
1398
|
+
g != null && g.client && oe.current && oe.current.updateHeadersFromClient(g.client);
|
|
1399
1399
|
}, [g == null ? void 0 : g.client]), ie(() => () => {
|
|
1400
1400
|
Y.current && clearTimeout(Y.current);
|
|
1401
1401
|
}, []), ie(() => {
|
|
1402
1402
|
document.body.dir = u === "ar" ? "rtl" : "ltr";
|
|
1403
1403
|
}, [u]), ie(() => {
|
|
1404
|
-
d && b(!0);
|
|
1404
|
+
d && !de.current ? (b(!0), de.current = !0) : d || (de.current = !1);
|
|
1405
1405
|
}, [d, b]), ie(() => {
|
|
1406
1406
|
if (!I) return;
|
|
1407
|
-
function
|
|
1407
|
+
function f(T) {
|
|
1408
1408
|
ue.current && !ue.current.contains(T.target) && S(!1);
|
|
1409
1409
|
}
|
|
1410
|
-
return document.addEventListener("mousedown",
|
|
1411
|
-
document.removeEventListener("mousedown",
|
|
1410
|
+
return document.addEventListener("mousedown", f), () => {
|
|
1411
|
+
document.removeEventListener("mousedown", f);
|
|
1412
1412
|
};
|
|
1413
1413
|
}, [I]);
|
|
1414
|
-
const
|
|
1415
|
-
P(
|
|
1414
|
+
const fe = (f) => {
|
|
1415
|
+
P(f), cr.set("openedx-language-preference", f, {
|
|
1416
1416
|
path: m ? m() : "/"
|
|
1417
1417
|
// secure: process.env.NODE_ENV === 'production',
|
|
1418
1418
|
// sameSite: 'strict'
|
|
1419
1419
|
}), w && w();
|
|
1420
|
-
},
|
|
1420
|
+
}, xe = p && {
|
|
1421
1421
|
left: "justify-content-start",
|
|
1422
1422
|
center: "justify-content-center",
|
|
1423
1423
|
right: "justify-content-end"
|
|
1424
|
-
}[p.toLowerCase()] || "justify-content-start",
|
|
1425
|
-
if (!
|
|
1424
|
+
}[p.toLowerCase()] || "justify-content-start", he = async (f) => {
|
|
1425
|
+
if (!f.trim() || !g || !oe.current) {
|
|
1426
1426
|
X([]), F(0), $(!1), q(!1);
|
|
1427
1427
|
return;
|
|
1428
1428
|
}
|
|
1429
1429
|
H(!0), V(null), $(!1), Q(5);
|
|
1430
1430
|
try {
|
|
1431
|
-
const T = await
|
|
1431
|
+
const T = await oe.current.simpleSearch(f, {
|
|
1432
1432
|
limit: 20,
|
|
1433
1433
|
offset: 0
|
|
1434
1434
|
});
|
|
@@ -1438,51 +1438,51 @@ const or = ({
|
|
|
1438
1438
|
} finally {
|
|
1439
1439
|
H(!1);
|
|
1440
1440
|
}
|
|
1441
|
-
},
|
|
1442
|
-
L(
|
|
1443
|
-
},
|
|
1444
|
-
L(
|
|
1445
|
-
|
|
1441
|
+
}, ce = (f) => {
|
|
1442
|
+
L(f), he(f), d && J && j(!1);
|
|
1443
|
+
}, pe = (f) => {
|
|
1444
|
+
L(f), U && f.trim() === "" && ($(!1), q(!1)), Y.current && clearTimeout(Y.current), f.trim().length > 0 ? Y.current = setTimeout(() => {
|
|
1445
|
+
he(f);
|
|
1446
1446
|
}, 500) : (X([]), F(0), $(!1), q(!1));
|
|
1447
|
-
}, he = () => {
|
|
1448
|
-
Y.current && (clearTimeout(Y.current), Y.current = null), L(""), X([]), F(0), $(!1), q(!1), V(null), H(!1);
|
|
1449
1447
|
}, le = () => {
|
|
1448
|
+
Y.current && (clearTimeout(Y.current), Y.current = null), L(""), X([]), F(0), $(!1), q(!1), V(null), H(!1);
|
|
1449
|
+
}, _e = () => {
|
|
1450
1450
|
L(""), X([]), F(0), $(!1), q(!1), V(null), H(!1), Q(5), Y.current && (clearTimeout(Y.current), Y.current = null);
|
|
1451
|
-
},
|
|
1452
|
-
Q((
|
|
1453
|
-
},
|
|
1451
|
+
}, be = () => {
|
|
1452
|
+
Q((f) => Math.min(f + 10, C.length));
|
|
1453
|
+
}, we = (f) => {
|
|
1454
1454
|
if (o && o.length > 0) {
|
|
1455
|
-
const B = o.find((
|
|
1455
|
+
const B = o.find((se) => se[f]);
|
|
1456
1456
|
if (B)
|
|
1457
|
-
return B[
|
|
1457
|
+
return B[f];
|
|
1458
1458
|
}
|
|
1459
1459
|
return {
|
|
1460
1460
|
en: "English",
|
|
1461
1461
|
ar: "Arabic",
|
|
1462
1462
|
hi: "Hindi"
|
|
1463
|
-
}[
|
|
1464
|
-
},
|
|
1465
|
-
const [B,
|
|
1466
|
-
return /* @__PURE__ */ r.jsx(ee.Item, { onClick: () =>
|
|
1463
|
+
}[f] || f.toUpperCase();
|
|
1464
|
+
}, Ee = () => (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((f, T) => {
|
|
1465
|
+
const [B, se] = Object.entries(f)[0];
|
|
1466
|
+
return /* @__PURE__ */ r.jsx(ee.Item, { onClick: () => fe(B), children: se }, `lang-${B}-${T}`);
|
|
1467
1467
|
})) : (console.log("Using fallback languages"), /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1468
|
-
/* @__PURE__ */ r.jsx(ee.Item, { onClick: () =>
|
|
1469
|
-
/* @__PURE__ */ r.jsx(ee.Item, { onClick: () =>
|
|
1470
|
-
/* @__PURE__ */ r.jsx(ee.Item, { onClick: () =>
|
|
1468
|
+
/* @__PURE__ */ r.jsx(ee.Item, { onClick: () => fe("en"), children: "English" }),
|
|
1469
|
+
/* @__PURE__ */ r.jsx(ee.Item, { onClick: () => fe("ar"), children: "Arabic" }),
|
|
1470
|
+
/* @__PURE__ */ r.jsx(ee.Item, { onClick: () => fe("hi"), children: "Hindi" })
|
|
1471
1471
|
] })));
|
|
1472
|
-
return /* @__PURE__ */ r.jsxs(
|
|
1472
|
+
return /* @__PURE__ */ r.jsxs(Se, { expand: "lg", className: "navbarContainer py-1", children: [
|
|
1473
1473
|
/* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-center", children: [
|
|
1474
1474
|
/* @__PURE__ */ r.jsx("div", { className: "toggle-sidebar-icon", children: /* @__PURE__ */ r.jsx(
|
|
1475
|
-
|
|
1475
|
+
Oe,
|
|
1476
1476
|
{
|
|
1477
1477
|
src: qr,
|
|
1478
1478
|
iconAs: Z,
|
|
1479
1479
|
alt: "Toggle Sidebar",
|
|
1480
|
-
onClick:
|
|
1480
|
+
onClick: h,
|
|
1481
1481
|
className: "ms-2 ml-2",
|
|
1482
|
-
onMouseDown: (
|
|
1482
|
+
onMouseDown: (f) => f.stopPropagation()
|
|
1483
1483
|
}
|
|
1484
1484
|
) }),
|
|
1485
|
-
/* @__PURE__ */ r.jsx(
|
|
1485
|
+
/* @__PURE__ */ r.jsx(Se.Brand, { href: "/", className: "navbar-brand", children: /* @__PURE__ */ r.jsx(
|
|
1486
1486
|
"img",
|
|
1487
1487
|
{
|
|
1488
1488
|
src: t,
|
|
@@ -1492,7 +1492,7 @@ const or = ({
|
|
|
1492
1492
|
] }),
|
|
1493
1493
|
n !== null && /* @__PURE__ */ r.jsx(r.Fragment, { children: d ? /* @__PURE__ */ r.jsx("div", { className: "d-flex justify-content-between align-items-center ml-auto", children: /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-center navbar-buttons", children: [
|
|
1494
1494
|
g && /* @__PURE__ */ r.jsx(
|
|
1495
|
-
|
|
1495
|
+
Oe,
|
|
1496
1496
|
{
|
|
1497
1497
|
src: Yr,
|
|
1498
1498
|
iconAs: Z,
|
|
@@ -1511,25 +1511,25 @@ const or = ({
|
|
|
1511
1511
|
}
|
|
1512
1512
|
) }),
|
|
1513
1513
|
/* @__PURE__ */ r.jsx(
|
|
1514
|
-
|
|
1514
|
+
Oe,
|
|
1515
1515
|
{
|
|
1516
1516
|
src: Kr,
|
|
1517
1517
|
iconAs: Z,
|
|
1518
1518
|
alt: "More",
|
|
1519
|
-
onMouseDown: (
|
|
1520
|
-
onClick: () => S((
|
|
1519
|
+
onMouseDown: (f) => f.stopPropagation(),
|
|
1520
|
+
onClick: () => S((f) => !f)
|
|
1521
1521
|
}
|
|
1522
1522
|
),
|
|
1523
1523
|
I && /* @__PURE__ */ r.jsxs("div", { className: "more-menu-dropdown", ref: ue, children: [
|
|
1524
1524
|
/* @__PURE__ */ r.jsxs("div", { className: "more-menu-icons-row", children: [
|
|
1525
|
-
(c == null ? void 0 : c.reSync) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(
|
|
1526
|
-
(c == null ? void 0 : c.contextSwitcher) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(
|
|
1527
|
-
(c == null ? void 0 : c.help) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(
|
|
1528
|
-
(c == null ? void 0 : c.notification) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(
|
|
1525
|
+
(c == null ? void 0 : c.reSync) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(ae, { src: nr, iconAs: Z, alt: "Sync", tooltipPlacement: "bottom", tooltipContent: "Re-Sync" }) }),
|
|
1526
|
+
(c == null ? void 0 : c.contextSwitcher) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(ae, { src: er, iconAs: Z, alt: "Sync", tooltipPlacement: "bottom", tooltipContent: "Switch to User Mode" }) }),
|
|
1527
|
+
(c == null ? void 0 : c.help) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(ae, { src: rr, iconAs: Z, alt: "Help", tooltipPlacement: "bottom", tooltipContent: "Help" }) }),
|
|
1528
|
+
(c == null ? void 0 : c.notification) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(ae, { src: tr, iconAs: Z, alt: "Notifications", tooltipPlacement: "bottom", tooltipContent: "Notifications" }) })
|
|
1529
1529
|
] }),
|
|
1530
1530
|
(c == null ? void 0 : c.translation) && /* @__PURE__ */ r.jsxs(ee, { className: "language-dropdown", children: [
|
|
1531
|
-
/* @__PURE__ */ r.jsx(ee.Toggle, { variant: "tertiary", id: "language-dropdown", children:
|
|
1532
|
-
/* @__PURE__ */ r.jsx(ee.Menu, { children:
|
|
1531
|
+
/* @__PURE__ */ r.jsx(ee.Toggle, { variant: "tertiary", id: "language-dropdown", children: we(u) }),
|
|
1532
|
+
/* @__PURE__ */ r.jsx(ee.Menu, { children: Ee() })
|
|
1533
1533
|
] })
|
|
1534
1534
|
] })
|
|
1535
1535
|
] }) }) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
@@ -1548,11 +1548,11 @@ const or = ({
|
|
|
1548
1548
|
{
|
|
1549
1549
|
type: "text",
|
|
1550
1550
|
value: G,
|
|
1551
|
-
onChange: (
|
|
1552
|
-
|
|
1551
|
+
onChange: (f) => {
|
|
1552
|
+
pe(f.target.value);
|
|
1553
1553
|
},
|
|
1554
|
-
onKeyDown: (
|
|
1555
|
-
|
|
1554
|
+
onKeyDown: (f) => {
|
|
1555
|
+
f.key === "Enter" && ce(G);
|
|
1556
1556
|
},
|
|
1557
1557
|
placeholder: "Search",
|
|
1558
1558
|
style: {
|
|
@@ -1571,7 +1571,7 @@ const or = ({
|
|
|
1571
1571
|
{
|
|
1572
1572
|
type: "button",
|
|
1573
1573
|
onClick: () => {
|
|
1574
|
-
|
|
1574
|
+
le();
|
|
1575
1575
|
},
|
|
1576
1576
|
style: {
|
|
1577
1577
|
background: "none",
|
|
@@ -1601,21 +1601,21 @@ const or = ({
|
|
|
1601
1601
|
" found"
|
|
1602
1602
|
] }) }),
|
|
1603
1603
|
/* @__PURE__ */ r.jsxs("div", { className: "search-results-list", children: [
|
|
1604
|
-
C.slice(0, K).map((
|
|
1604
|
+
C.slice(0, K).map((f, T) => /* @__PURE__ */ r.jsx(
|
|
1605
1605
|
or,
|
|
1606
1606
|
{
|
|
1607
|
-
result:
|
|
1607
|
+
result: f,
|
|
1608
1608
|
onNavigate: (B) => {
|
|
1609
|
-
|
|
1609
|
+
_e(), window.location.href = B;
|
|
1610
1610
|
},
|
|
1611
1611
|
baseUrl: m ? m() : void 0
|
|
1612
1612
|
},
|
|
1613
|
-
|
|
1613
|
+
f.id || T
|
|
1614
1614
|
)),
|
|
1615
1615
|
K < C.length && /* @__PURE__ */ r.jsx("div", { className: "search-results-more", children: /* @__PURE__ */ r.jsxs(
|
|
1616
1616
|
"button",
|
|
1617
1617
|
{
|
|
1618
|
-
onClick:
|
|
1618
|
+
onClick: be,
|
|
1619
1619
|
style: {
|
|
1620
1620
|
background: "none",
|
|
1621
1621
|
border: "none",
|
|
@@ -1637,13 +1637,13 @@ const or = ({
|
|
|
1637
1637
|
] })
|
|
1638
1638
|
] }) }),
|
|
1639
1639
|
/* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-center gap-2 ms-auto order-lg-3", children: [
|
|
1640
|
-
(c == null ? void 0 : c.reSync) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(
|
|
1641
|
-
(c == null ? void 0 : c.contextSwitcher) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(
|
|
1642
|
-
(c == null ? void 0 : c.help) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(
|
|
1643
|
-
(c == null ? void 0 : c.notification) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(
|
|
1640
|
+
(c == null ? void 0 : c.reSync) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(ae, { src: nr, iconAs: Z, alt: "Sync", tooltipPlacement: "bottom", tooltipContent: "Re-Sync" }) }),
|
|
1641
|
+
(c == null ? void 0 : c.contextSwitcher) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(ae, { src: er, iconAs: Z, alt: "Sync", tooltipPlacement: "bottom", tooltipContent: "Switch to User Mode" }) }),
|
|
1642
|
+
(c == null ? void 0 : c.help) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(ae, { src: rr, iconAs: Z, alt: "Help", tooltipPlacement: "bottom", tooltipContent: "Help" }) }),
|
|
1643
|
+
(c == null ? void 0 : c.notification) && /* @__PURE__ */ r.jsx("div", { className: "icon-curved-square", children: /* @__PURE__ */ r.jsx(ae, { src: tr, iconAs: Z, alt: "Notifications", tooltipPlacement: "bottom", tooltipContent: "Notifications" }) }),
|
|
1644
1644
|
(c == null ? void 0 : c.translation) && /* @__PURE__ */ r.jsxs(ee, { className: "language-dropdown", children: [
|
|
1645
|
-
/* @__PURE__ */ r.jsx(ee.Toggle, { variant: "tertiary", id: "language-dropdown", children:
|
|
1646
|
-
/* @__PURE__ */ r.jsx(ee.Menu, { children:
|
|
1645
|
+
/* @__PURE__ */ r.jsx(ee.Toggle, { variant: "tertiary", id: "language-dropdown", children: we(u) }),
|
|
1646
|
+
/* @__PURE__ */ r.jsx(ee.Menu, { children: Ee() })
|
|
1647
1647
|
] }),
|
|
1648
1648
|
/* @__PURE__ */ r.jsx("div", { className: "usermenu-dropdown", children: /* @__PURE__ */ r.jsx(
|
|
1649
1649
|
ir,
|
|
@@ -1658,13 +1658,13 @@ const or = ({
|
|
|
1658
1658
|
] })
|
|
1659
1659
|
] }) }),
|
|
1660
1660
|
n === null && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1661
|
-
/* @__PURE__ */ r.jsx(
|
|
1661
|
+
/* @__PURE__ */ r.jsx(Se.Toggle, { "aria-controls": "main-navbar-nav" }),
|
|
1662
1662
|
/* @__PURE__ */ r.jsx("div", { className: "d-flex align-items-center gap-2 ms-auto order-lg-3", children: i && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1663
1663
|
/* @__PURE__ */ r.jsx($e, { variant: "primary", children: "Log In" }),
|
|
1664
1664
|
/* @__PURE__ */ r.jsx($e, { variant: "outline-primary", children: "Sign Up" })
|
|
1665
1665
|
] }) })
|
|
1666
1666
|
] }),
|
|
1667
|
-
/* @__PURE__ */ r.jsx(
|
|
1667
|
+
/* @__PURE__ */ r.jsx(Se.Collapse, { id: "main-navbar-nav", className: "justify-content-between", children: /* @__PURE__ */ r.jsx(Ue, { className: `nav-gap gap-3 flex-grow-1 ${xe}`, children: n === null && s.map((f) => f.subMenu ? /* @__PURE__ */ r.jsx(Ge, { title: f.label, id: `nav-dropdown-${f.label}`, children: f.subMenu.map((T) => /* @__PURE__ */ r.jsx(Ge.Item, { onClick: () => console.log("Selected submenu:", T.label), children: T.label }, `sub-${T.label}`)) }, `menu-${f.label}`) : /* @__PURE__ */ r.jsx(Ue.Link, { as: "span", className: "text-uppercase fw-semibold", children: f.label }, `menu-${f.label}`)) }) }),
|
|
1668
1668
|
g && J && /* @__PURE__ */ r.jsxs("div", { className: "fixed-search-bar", children: [
|
|
1669
1669
|
/* @__PURE__ */ r.jsxs("div", { className: "fixed-search-bar-inner", children: [
|
|
1670
1670
|
/* @__PURE__ */ r.jsxs("div", { style: {
|
|
@@ -1682,11 +1682,11 @@ const or = ({
|
|
|
1682
1682
|
{
|
|
1683
1683
|
type: "text",
|
|
1684
1684
|
value: G,
|
|
1685
|
-
onChange: (
|
|
1686
|
-
|
|
1685
|
+
onChange: (f) => {
|
|
1686
|
+
pe(f.target.value);
|
|
1687
1687
|
},
|
|
1688
|
-
onKeyDown: (
|
|
1689
|
-
|
|
1688
|
+
onKeyDown: (f) => {
|
|
1689
|
+
f.key === "Enter" && ce(G);
|
|
1690
1690
|
},
|
|
1691
1691
|
placeholder: "Search",
|
|
1692
1692
|
style: {
|
|
@@ -1706,7 +1706,7 @@ const or = ({
|
|
|
1706
1706
|
{
|
|
1707
1707
|
type: "button",
|
|
1708
1708
|
onClick: () => {
|
|
1709
|
-
|
|
1709
|
+
le();
|
|
1710
1710
|
},
|
|
1711
1711
|
style: {
|
|
1712
1712
|
background: "none",
|
|
@@ -1739,21 +1739,21 @@ const or = ({
|
|
|
1739
1739
|
" found"
|
|
1740
1740
|
] }) }),
|
|
1741
1741
|
/* @__PURE__ */ r.jsxs("div", { className: "search-results-list", children: [
|
|
1742
|
-
C.slice(0, K).map((
|
|
1742
|
+
C.slice(0, K).map((f, T) => /* @__PURE__ */ r.jsx(
|
|
1743
1743
|
or,
|
|
1744
1744
|
{
|
|
1745
|
-
result:
|
|
1745
|
+
result: f,
|
|
1746
1746
|
onNavigate: (B) => {
|
|
1747
|
-
|
|
1747
|
+
_e(), window.location.href = B;
|
|
1748
1748
|
},
|
|
1749
1749
|
baseUrl: m ? m() : void 0
|
|
1750
1750
|
},
|
|
1751
|
-
|
|
1751
|
+
f.id || T
|
|
1752
1752
|
)),
|
|
1753
1753
|
K < C.length && /* @__PURE__ */ r.jsx("div", { className: "search-results-more", children: /* @__PURE__ */ r.jsxs(
|
|
1754
1754
|
"button",
|
|
1755
1755
|
{
|
|
1756
|
-
onClick:
|
|
1756
|
+
onClick: be,
|
|
1757
1757
|
style: {
|
|
1758
1758
|
background: "none",
|
|
1759
1759
|
border: "none",
|
|
@@ -1776,7 +1776,7 @@ const or = ({
|
|
|
1776
1776
|
] })
|
|
1777
1777
|
] });
|
|
1778
1778
|
}, vr = ur(void 0), ct = ({ children: t, meiliSearchConfig: s }) => {
|
|
1779
|
-
const [i, n] = k(""), [v, p] = k([]), [w, m] = k(0), [g, c] = k(!1), [o, d] = k(!1), [
|
|
1779
|
+
const [i, n] = k(""), [v, p] = k([]), [w, m] = k(0), [g, c] = k(!1), [o, d] = k(!1), [h, b] = k(null), [u, P] = k(0), [J, j] = k(!1), [I, S] = k(!1), [U, $] = k(null), G = mr(s), L = async (H) => {
|
|
1780
1780
|
if (!H.trim()) {
|
|
1781
1781
|
X();
|
|
1782
1782
|
return;
|
|
@@ -1841,7 +1841,7 @@ const or = ({
|
|
|
1841
1841
|
totalHits: w,
|
|
1842
1842
|
isLoading: g,
|
|
1843
1843
|
hasError: o,
|
|
1844
|
-
errorMessage:
|
|
1844
|
+
errorMessage: h,
|
|
1845
1845
|
facets: U,
|
|
1846
1846
|
performSearch: L,
|
|
1847
1847
|
clearSearch: X,
|
package/package.json
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
Nav,
|
|
5
5
|
NavDropdown,
|
|
6
6
|
Button,
|
|
7
|
-
SearchField,
|
|
8
7
|
Icon,
|
|
9
8
|
IconButton,
|
|
10
9
|
Dropdown,
|
|
@@ -56,6 +55,7 @@ const MainHeader: React.FC<MainHeaderProps> = ({
|
|
|
56
55
|
const moreMenuRef = useRef<HTMLDivElement>(null);
|
|
57
56
|
const searchTimeoutRef = useRef<number | null>(null);
|
|
58
57
|
const searchService = useRef(meiliSearchConfig ? createMeiliSearchService(meiliSearchConfig) : null);
|
|
58
|
+
const initialMobileDetection = useRef(false);
|
|
59
59
|
|
|
60
60
|
console.log('languageSelectorList', languageSelectorList);
|
|
61
61
|
|
|
@@ -81,8 +81,11 @@ const MainHeader: React.FC<MainHeaderProps> = ({
|
|
|
81
81
|
}, [selectedLanguage]);
|
|
82
82
|
|
|
83
83
|
useEffect(() => {
|
|
84
|
-
if (isMobile) {
|
|
84
|
+
if (isMobile && !initialMobileDetection.current) {
|
|
85
85
|
setSidebarCollapsed(true);
|
|
86
|
+
initialMobileDetection.current = true;
|
|
87
|
+
} else if (!isMobile) {
|
|
88
|
+
initialMobileDetection.current = false;
|
|
86
89
|
}
|
|
87
90
|
}, [isMobile, setSidebarCollapsed]);
|
|
88
91
|
|