titaned-frontend-library 1.0.12 → 1.0.15
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 +1 -1
- package/dist/index.js +6 -8
- package/package.json +1 -1
- package/src/App.tsx +0 -1
- package/src/components/common/Header/MainHeader.tsx +0 -5
- package/src/components/common/NavDropdownMenu/NavDropdownMenu.tsx +0 -1
- package/src/components/common/dynamicTheme/dynamicTheme.ts +0 -2
- package/src/examples/MeiliSearchUsageExample.tsx +0 -1
package/dist/index.cjs
CHANGED
|
@@ -24,4 +24,4 @@ object-assign
|
|
|
24
24
|
|
|
25
25
|
Check the render method of \``+e+"`."}return""}}function mr(e){return""}var Le={};function gr(e){{var a=$e();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 He(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var l=gr(a);if(Le[l])return;Le[l]=!0;var b="";e&&e._owner&&e._owner!==Se.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 Fe(e,a){{if(typeof e!="object")return;if(Array.isArray(e))for(var l=0;l<e.length;l++){var b=e[l];Oe(b)&&He(b,a)}else if(Oe(e))e._store&&(e._store.validated=!0);else if(e){var T=Z(e);if(typeof T=="function"&&T!==e.entries)for(var k=T.call(e),S;!(S=k.next()).done;)Oe(S.value)&&He(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===o||a.$$typeof===f))l=a.propTypes;else return;if(l){var b=M(a);xe(l,e.props,"prop",b,e)}else if(a.PropTypes!==void 0&&!Ce){Ce=!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 ze(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:_+=$e();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++)Fe(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 Fe(re,e)}return e===t.Fragment?xr(A):vr(A),A}}function br(e,a,l){return ze(e,a,l,!0)}function wr(e,a,l){return ze(e,a,l,!1)}var yr=wr,jr=br;t.jsx=yr,t.jsxs=jr})()})(ke)),ke}var Ye;function Cr(){return Ye||(Ye=1,process.env.NODE_ENV==="production"?je.exports=Er():je.exports=Sr()),je.exports}var r=Cr();const Or=({contactInfo:t,quickLinks:s,exploreLinks:i,logoUrl:n,copyrights:x})=>{const p=j=>j??"left";return r.jsxs("footer",{className:"footer",children:[r.jsxs("div",{className:"container",children:[r.jsxs("div",{className:`section ${p(t.align)}`,children:[r.jsx("div",{className:"footer-brand-logo",children:r.jsx("img",{src:n,alt:"Logo"})}),r.jsx("p",{children:t.content.shortdesc}),r.jsxs("p",{children:[t.content.location.label,", ",t.content.location.value]}),r.jsxs("p",{children:["📞 ",t.content.phonenumber]})]}),r.jsx("div",{className:`section ${p(s.align)}`,children:r.jsxs("ul",{children:[r.jsx("h3",{children:"Quick Links"}),s.content.map((j,m)=>r.jsx("li",{children:r.jsx("a",{href:j.link,children:j.label})},m))]})}),r.jsx("div",{className:`section ${p(i.align)}`,children:r.jsxs("ul",{children:[r.jsx("h3",{children:"Explore"}),i.content.map((j,m)=>r.jsx("li",{children:r.jsx("a",{href:j.link,children:j.label})},m))]})})]}),r.jsx("div",{className:"copyright",children:r.jsx("p",{children:x})})]})},nr=w.createContext(void 0),Rr=({children:t})=>{const[s,i]=w.useState(!1),n=()=>{i(p=>!p)},x=p=>{i(p)};return r.jsx(nr.Provider,{value:{isCollapsed:s,toggleSidebar:n,setSidebarCollapsed:x},children:t})},Ne=()=>{const t=w.useContext(nr);if(t===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return t},kr=({buttons:t,onNavigate:s,presentPath:i})=>{const{isCollapsed:n,setSidebarCollapsed:x}=Ne(),[p,j]=w.useState(!0),m=w.useRef(null),[g,o]=w.useState(()=>document.dir==="rtl"||document.documentElement.dir==="rtl");return w.useEffect(()=>{const c=()=>{o(document.dir==="rtl"||document.documentElement.dir==="rtl")},d=new MutationObserver(c);return d.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),()=>d.disconnect()},[]),w.useEffect(()=>{const c=t.some(d=>d.path===i);j(c),!c&&!n&&i.includes("/course/")&&!i.includes("/learning/course/")&&x(!0)},[i]),w.useEffect(()=>{const c=d=>{!p&&m.current&&!m.current.contains(d.target)&&i.includes("/course/")&&!i.includes("/learning/course/")&&(n||x(!0))};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[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(c=>{const d=c.path===i||(i.includes("/course/")||i.includes("/course_rerun/"))&&c.path==="/my-courses"||i.includes("/library/")&&c.path==="/libraries"||i.includes("/taxonomy/")&&c.path==="/taxonomies";return r.jsx(v.OverlayTrigger,{placement:g?"left":"right",overlay:r.jsx(v.Tooltip,{id:`tooltip-${c.path}`,children:c.label}),show:n?void 0:!1,popperConfig:{modifiers:[{name:"preventOverflow",options:{altAxis:!0,boundary:"viewport"}}]},children:r.jsx(v.Button,{variant:"tertiary",className:`sidebar-btn ${d?"pgn-btn-active":"pgn-btn-inactive"}`,onClick:()=>s(c.path),children:r.jsxs("div",{className:"btn-content",children:[r.jsx("span",{className:"icon-container",children:c.icon}),r.jsx("span",{className:"btn-label",children:c.label})]})})},c.path)})})}),!p&&!n&&r.jsx("div",{className:"sidebar-extra-space"})]})},Tr=(t=768)=>{const[s,i]=w.useState(!1);return w.useEffect(()=>{const n=()=>{i(window.innerWidth<=t)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[t]),s},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:"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"})),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:"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"})),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 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"})),Xe=t=>q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},q.createElement("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z",fill:"currentColor"})),Mr=({id:t,buttonTitle:s,items:i})=>(console.log("NavDropdownMenu Props:",i),r.jsx(v.DropdownButton,{id:t,title:s,variant:"tertiary",className:"mr-2",children:i.map(n=>r.jsx(v.Dropdown.Item,{href:n.href,as:"a",className:"small",children:n.title},`${n.title}-dropdown-item`))})),Ze=({username:t,authenticatedUserAvatar:s,isMobile:i,menuItems:n})=>{const x=s?r.jsx("img",{className:"d-block w-100 h-100",src:s,alt:t,"data-testid":"avatar-image"}):r.jsx(v.Avatar,{size:"sm",className:"mr-2",alt:"avatar","data-testid":"avatar-icon"}),p=i?x:r.jsxs(r.Fragment,{children:[t," ",x]});return r.jsx(Mr,{buttonTitle:p,id:"user-dropdown-menu",items:n})};var be={},Qe;function Dr(){if(Qe)return be;Qe=1,Object.defineProperty(be,"__esModule",{value:!0}),be.parse=j,be.serialize=o;const t=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,s=/^[\u0021-\u003A\u003C-\u007E]*$/,i=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,x=Object.prototype.toString,p=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function j(f,y){const u=new p,I=f.length;if(I<2)return u;const G=(y==null?void 0:y.decode)||c;let E=0;do{const D=f.indexOf("=",E);if(D===-1)break;const O=f.indexOf(";",E),X=O===-1?I:O;if(D>X){E=f.lastIndexOf(";",D-1)+1;continue}const $=m(f,E,D),Z=g(f,D,$),H=f.slice($,Z);if(u[H]===void 0){let R=m(f,D+1,X),Q=g(f,X,R);const ee=G(f.slice(R,Q));u[H]=ee}E=X+1}while(E<I);return u}function m(f,y,u){do{const I=f.charCodeAt(y);if(I!==32&&I!==9)return y}while(++y<u);return u}function g(f,y,u){for(;y>u;){const I=f.charCodeAt(--y);if(I!==32&&I!==9)return y+1}return u}function o(f,y,u){const I=(u==null?void 0:u.encode)||encodeURIComponent;if(!t.test(f))throw new TypeError(`argument name is invalid: ${f}`);const G=I(y);if(!s.test(G))throw new TypeError(`argument val is invalid: ${y}`);let E=f+"="+G;if(!u)return E;if(u.maxAge!==void 0){if(!Number.isInteger(u.maxAge))throw new TypeError(`option maxAge is invalid: ${u.maxAge}`);E+="; Max-Age="+u.maxAge}if(u.domain){if(!i.test(u.domain))throw new TypeError(`option domain is invalid: ${u.domain}`);E+="; Domain="+u.domain}if(u.path){if(!n.test(u.path))throw new TypeError(`option path is invalid: ${u.path}`);E+="; Path="+u.path}if(u.expires){if(!d(u.expires)||!Number.isFinite(u.expires.valueOf()))throw new TypeError(`option expires is invalid: ${u.expires}`);E+="; Expires="+u.expires.toUTCString()}if(u.httpOnly&&(E+="; HttpOnly"),u.secure&&(E+="; Secure"),u.partitioned&&(E+="; Partitioned"),u.priority)switch(typeof u.priority=="string"?u.priority.toLowerCase():void 0){case"low":E+="; Priority=Low";break;case"medium":E+="; Priority=Medium";break;case"high":E+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${u.priority}`)}if(u.sameSite)switch(typeof u.sameSite=="string"?u.sameSite.toLowerCase():u.sameSite){case!0:case"strict":E+="; SameSite=Strict";break;case"lax":E+="; SameSite=Lax";break;case"none":E+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${u.sameSite}`)}return E}function c(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch{return f}}function d(f){return x.call(f)==="[object Date]"}return be}var _e=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"?_e.parse(t):typeof t=="object"&&t!==null?t:{}}function Te(t,s={}){const i=Hr(t);if(!s.doNotParse)try{return JSON.parse(i)}catch{}return t}function Hr(t){return t&&t[0]==="j"&&t[1]===":"?t.substr(2):t}class Fr{constructor(s,i={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const x=this.cookies;this.cookies=_e.parse(document.cookie),this._checkChanges(x)};const n=typeof document>"u"?"":document.cookie;this.cookies=Lr(s||n),this.defaultSetOptions=i,this.HAS_DOCUMENT_COOKIE=$r()}_emitChange(s){for(let i=0;i<this.changeListeners.length;++i)this.changeListeners[i](s)}_checkChanges(s){new Set(Object.keys(s).concat(Object.keys(this.cookies))).forEach(n=>{s[n]!==this.cookies[n]&&this._emitChange({name:n,value:Te(this.cookies[n])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(s,i={}){return i.doNotUpdate||this.update(),Te(this.cookies[s],i)}getAll(s={}){s.doNotUpdate||this.update();const i={};for(let n in this.cookies)i[n]=Te(this.cookies[n],s);return i}set(s,i,n){n?n=Object.assign(Object.assign({},this.defaultSetOptions),n):n=this.defaultSetOptions;const x=typeof i=="string"?i:JSON.stringify(i);this.cookies=Object.assign(Object.assign({},this.cookies),{[s]:x}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=_e.serialize(s,x,n)),this._emitChange({name:s,value:i,options:n})}remove(s,i){const n=i=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),i),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[s],this.HAS_DOCUMENT_COOKIE&&(document.cookie=_e.serialize(s,"",n)),this._emitChange({name:s,value:void 0,options:i})}addChangeListener(s){this.changeListeners.push(s),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(s){const i=this.changeListeners.indexOf(s);i>=0&&this.changeListeners.splice(i,1),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===0&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}removeAllChangeListeners(){for(;this.changeListeners.length>0;)this.removeChangeListener(this.changeListeners[0])}}class zr{constructor(s){if(!s.host)throw new Error("MeiliSearch host is required");if(!s.apiKey)throw new Error("MeiliSearch apiKey is required");if(!s.indexName)throw new Error("MeiliSearch indexName is required");this.config=s,this.headers={"Content-Type":"application/json",Authorization:`Bearer ${s.apiKey}`,"X-Meilisearch-Client":"Meilisearch JavaScript (v0.41.0)"}}updateHeadersFromClient(s){s&&s.httpRequest&&s.httpRequest.headers&&(this.headers={"Content-Type":s.httpRequest.headers["Content-Type"]||"application/json",Authorization:s.httpRequest.headers.Authorization||`Bearer ${this.config.apiKey}`,"X-Meilisearch-Client":s.httpRequest.headers["X-Meilisearch-Client"]||"Meilisearch JavaScript (v0.41.0)"})}async search(s,i={}){const{limit:n=20,offset:x=0,filter:p=['type = "course_block"'],attributesToHighlight:j=["display_name","description","published"],attributesToCrop:m=["description","published"],sort:g=[]}=i;if(!this.config.indexName)throw new Error("MeiliSearch indexName is required");const o={queries:[{indexUid:this.config.indexName,q:s,filter:[[],...p],attributesToHighlight:j,highlightPreTag:"__meili-highlight__",highlightPostTag:"__/meili-highlight__",attributesToCrop:m,sort:g,offset:x,limit:n},{indexUid:this.config.indexName,facets:["block_type","content.problem_types"],filter:p,limit:0}]},c={...this.headers};try{const d=await fetch(`${this.config.host}/multi-search`,{method:"POST",headers:c,body:JSON.stringify(o)});if(!d.ok)throw new Error(`MeiliSearch API error: ${d.status} ${d.statusText}`);const f=await d.json(),y=f.results[0],u=f.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(s,i={}){const{limit:n=20,offset:x=0,filter:p=['type = "course_block"'],attributesToHighlight:j=["display_name","description","published"],attributesToCrop:m=["description","published"],sort:g=[]}=i,o={queries:[{indexUid:this.config.indexName,q:s,filter:[[],...p],attributesToHighlight:j,highlightPreTag:"__meili-highlight__",highlightPostTag:"__/meili-highlight__",attributesToCrop:m,sort:g,offset:x,limit:n}]},c={...this.headers};try{const d=await fetch(`${this.config.host}/multi-search`,{method:"POST",headers:c,body:JSON.stringify(o)});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(s){return console.error("MeiliSearch connection check failed:",s),!1}}}const ir=t=>new zr(t);function sr(t,s){const{contextKey:i,usageKey:n}=t;return i?i.startsWith("course-v1:")?`${s||""}/course/${i}?show=${encodeURIComponent(n||"")}`:i.startsWith("library-v1:")?`${s||""}/library/${i}`:"#":"#"}function qr(t,s,i){const n=sr(t,s);return n==="#"?(console.warn("Could not generate URL for search hit:",t),"#"):(i?i(n):(n.startsWith("http"),window.location.href=n),n)}const Be=({text:t,highlightTag:s="__meili-highlight__"})=>{if(!t)return null;const i="__/meili-highlight__",n=t.split(s),x=[];return n.forEach((p,j)=>{if(j===0)p&&x.push(p);else{const m=p.indexOf(i);if(m!==-1){const g=p.substring(0,m),o=p.substring(m+i.length);g&&x.push(r.jsx("mark",{className:"search-highlight",children:g},`highlight-${j}`)),o&&x.push(o)}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 er=({result:t,onNavigate:s,baseUrl:i})=>{var g,o;const n=c=>{var y;c.preventDefault(),c.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){s?s(t.url):window.location.href=t.url;return}qr(d,i,s)==="#"&&(s?s(`/search-result/${t.id}`):window.location.href=`/search-result/${t.id}`)},x=c=>{var y;c.preventDefault(),c.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})))||[]},f=sr(d,i);f&&f!=="#"&&window.open(f,"_blank")},p=((g=t._formatted)==null?void 0:g.display_name)||t.display_name,j=((o=t._formatted)==null?void 0:o.description)||t.description,m=t.block_type||t.type;return r.jsx("div",{className:"search-result-item",onClick:n,role:"button",tabIndex:0,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&n(c)},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(Be,{text:p})}),j&&r.jsx("div",{className:"search-result-description",children:r.jsx(Be,{text:j})}),t.breadcrumbs&&t.breadcrumbs.length>0&&r.jsx("div",{className:"search-result-breadcrumbs",children:t.breadcrumbs.map(c=>c.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"})})]})})},rr=new Fr,Wr=({logoUrl:t,menuList:s,loginSignupButtons:i,authenticatedUser:n=null,userMenuItems:x,menuAlignment:p,onLanguageChange:j,getBaseUrl:m,meiliSearchConfig:g,headerButtons:o,languageSelectorList:c})=>{const d=Tr(),{toggleSidebar:f,setSidebarCollapsed:y}=Ne(),[u,I]=w.useState(()=>rr.get("openedx-language-preference")||"en"),[G,E]=w.useState(!1),[D,O]=w.useState(!1),[X,$]=w.useState(!1),[Z,H]=w.useState(""),[R,Q]=w.useState([]),[ee,F]=w.useState(!1),[L,V]=w.useState(null),[M,z]=w.useState(0),[C,W]=w.useState(!1),[K,B]=w.useState(5),oe=w.useRef(null),J=w.useRef(null),ne=w.useRef(g?ir(g):null),ce=w.useRef(!1);console.log("languageSelectorList",c),w.useEffect(()=>{g!=null&&g.client&&ne.current&&ne.current.updateHeadersFromClient(g.client)},[g==null?void 0:g.client]),w.useEffect(()=>()=>{J.current&&clearTimeout(J.current)},[]),w.useEffect(()=>{document.body.dir=u==="ar"?"rtl":"ltr"},[u]),w.useEffect(()=>{d&&!ce.current?(y(!0),ce.current=!0):d||(ce.current=!1)},[d,y]),w.useEffect(()=>{if(!D)return;function h(N){oe.current&&!oe.current.contains(N.target)&&O(!1)}return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[D]);const le=h=>{I(h),rr.set("openedx-language-preference",h,{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 h=>{if(!h.trim()||!g||!ne.current){Q([]),z(0),$(!1),W(!1);return}F(!0),V(null),$(!1),B(5);try{const N=await ne.current.simpleSearch(h,{limit:20,offset:0});Q(N.hits),z(N.totalHits),$(N.totalHits===0),W(!0)}catch(N){V(N instanceof Error?N.message:"Search failed"),$(!0),Q([]),z(0)}finally{F(!1)}},ie=h=>{H(h),ue(h),d&&G&&E(!1)},de=h=>{H(h),X&&h.trim()===""&&($(!1),W(!1)),J.current&&clearTimeout(J.current),h.trim().length>0?J.current=setTimeout(()=>{ue(h)},500):(Q([]),z(0),$(!1),W(!1))},se=()=>{J.current&&(clearTimeout(J.current),J.current=null),H(""),Q([]),z(0),$(!1),W(!1),V(null),F(!1)},we=()=>{H(""),Q([]),z(0),$(!1),W(!1),V(null),F(!1),B(5),J.current&&(clearTimeout(J.current),J.current=null)},ge=()=>{B(h=>Math.min(h+10,R.length))},ve=h=>{if(c&&c.length>0){const U=c.find(xe=>xe[h]);if(U)return U[h]}return{en:"English",ar:"Arabic",hi:"Hindi"}[h]||h.toUpperCase()},ye=()=>(console.log("renderLanguageOptions - languageSelectorList:",c),console.log("renderLanguageOptions - length:",c==null?void 0:c.length),c&&c.length>0?(console.log("Using custom languageSelectorList"),c.map((h,N)=>{const[U,xe]=Object.entries(h)[0];return r.jsx(v.Dropdown.Item,{onClick:()=>le(U),children:xe},`lang-${U}-${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"})]}))),ae=(o==null?void 0:o.reSync)||(o==null?void 0:o.contextSwitcher)||(o==null?void 0:o.help)||(o==null?void 0:o.notification)||(o==null?void 0:o.translation);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(Ze,{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})}),ae&&r.jsx(v.IconButton,{src:Pr,iconAs:v.Icon,alt:"More",onMouseDown:h=>h.stopPropagation(),onClick:()=>O(h=>!h)}),D&&ae&&r.jsxs("div",{className:"more-menu-dropdown",ref:oe,children:[r.jsxs("div",{className:"more-menu-icons-row",children:[(o==null?void 0:o.reSync)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Xe,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Re-Sync"})}),(o==null?void 0:o.contextSwitcher)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Je,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Switch to User Mode"})}),(o==null?void 0:o.help)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ue,iconAs:v.Icon,alt:"Help",tooltipPlacement:"bottom",tooltipContent:"Help"})}),(o==null?void 0:o.notification)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ge,iconAs:v.Icon,alt:"Notifications",tooltipPlacement:"bottom",tooltipContent:"Notifications"})})]}),(o==null?void 0:o.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:ye()})]})]})]})}):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:Z,onChange:h=>{de(h.target.value)},onKeyDown:h=>{h.key==="Enter"&&ie(Z)},placeholder:"Search",style:{flex:1,border:"none",outline:"none",fontSize:"16px",background:"transparent",padding:"4px"},autoComplete:"off"}),Z&&r.jsx("button",{type:"button",onClick:()=>{se()},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..."})]}),X&&!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(er,{result:h,onNavigate:U=>{we(),window.location.href=U},baseUrl:m?m():void 0},h.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:[(o==null?void 0:o.reSync)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Xe,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Re-Sync"})}),(o==null?void 0:o.contextSwitcher)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Je,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Switch to User Mode"})}),(o==null?void 0:o.help)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ue,iconAs:v.Icon,alt:"Help",tooltipPlacement:"bottom",tooltipContent:"Help"})}),(o==null?void 0:o.notification)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ge,iconAs:v.Icon,alt:"Notifications",tooltipPlacement:"bottom",tooltipContent:"Notifications"})}),(o==null?void 0:o.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:ye()})]}),r.jsx("div",{className:"usermenu-dropdown",children:r.jsx(Ze,{username:n==null?void 0:n.username,authenticatedUserAvatar:n==null?void 0:n.avatar,isMobile:d,isAdmin:n==null?void 0:n.administrator,menuItems:x})})]})]})}),n===null&&r.jsxs(r.Fragment,{children:[r.jsx(v.Navbar.Toggle,{"aria-controls":"main-navbar-nav"}),r.jsx("div",{className:"d-flex align-items-center gap-2 ms-auto order-lg-3",children:i&&r.jsxs(r.Fragment,{children:[r.jsx(v.Button,{variant:"primary",children:"Log In"}),r.jsx(v.Button,{variant:"outline-primary",children:"Sign Up"})]})})]}),r.jsx(v.Navbar.Collapse,{id:"main-navbar-nav",className:"justify-content-between",children:r.jsx(v.Nav,{className:`nav-gap gap-3 flex-grow-1 ${me}`,children:n===null&&s.map(h=>h.subMenu?r.jsx(v.NavDropdown,{title:h.label,id:`nav-dropdown-${h.label}`,children:h.subMenu.map(N=>r.jsx(v.NavDropdown.Item,{onClick:()=>console.log("Selected submenu:",N.label),children:N.label},`sub-${N.label}`))},`menu-${h.label}`):r.jsx(v.Nav.Link,{as:"span",className:"text-uppercase fw-semibold",children:h.label},`menu-${h.label}`))})}),g&&G&&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:Z,onChange:h=>{de(h.target.value)},onKeyDown:h=>{h.key==="Enter"&&ie(Z)},placeholder:"Search",style:{flex:1,border:"none",outline:"none",fontSize:"18px",background:"transparent",padding:"4px"},autoComplete:"off",autoFocus:!0}),Z&&r.jsx("button",{type:"button",onClick:()=>{se()},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..."})]}),X&&!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(er,{result:h,onNavigate:U=>{we(),window.location.href=U},baseUrl:m?m():void 0},h.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"]})})]})]})]})]})},ar=w.createContext(void 0),Kr=({children:t,meiliSearchConfig:s})=>{const[i,n]=w.useState(""),[x,p]=w.useState([]),[j,m]=w.useState(0),[g,o]=w.useState(!1),[c,d]=w.useState(!1),[f,y]=w.useState(null),[u,I]=w.useState(0),[G,E]=w.useState(!1),[D,O]=w.useState(!1),[X,$]=w.useState(null),Z=ir(s),H=async F=>{if(!F.trim()){Q();return}o(!0),d(!1),y(null),I(0);try{const L=await Z.search(F,{limit:20,offset:0}),V=L.hits.map(C=>{var W,K,B;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:((B=C._formatted)==null?void 0:B.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{o(!1)}},R=async()=>{if(!(!G||D)){O(!0);try{const F=u+20,L=await Z.simpleSearch(i,{limit:20,offset:F}),V=L.hits.map(C=>{var W,K,B;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:((B=C._formatted)==null?void 0:B.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)}}},Q=()=>{n(""),p([]),m(0),d(!1),y(null),I(0),E(!1),$(null)},ee={searchKeywords:i,setSearchKeywords:n,searchResults:x,totalHits:j,isLoading:g,hasError:c,errorMessage:f,facets:X,performSearch:H,clearSearch:Q,hasNextPage:G,fetchNextPage:R,isFetchingNextPage:D};return r.jsx(ar.Provider,{value:ee,children:t})},Yr=()=>{const t=w.useContext(ar);if(t===void 0)throw new Error("useSimpleSearch must be used within a SimpleSearchProvider");return t},Jr=t=>{try{if(t.status!==200)throw new Error("Failed to fetch theme config");const s=t.data.theme_colors;if(!s||typeof s!="object")throw new Error("Invalid theme_colors in API response");const i=document.documentElement;for(const n in s)if(Object.prototype.hasOwnProperty.call(s,n)){const x=s[n];i.style.setProperty(`--${n.replace(/_/g,"-")}`,x)}console.log("Theme applied successfully from API:",s)}catch(s){console.error("Error applying theme from API:",s.message);const i={primary:"#2B2399",primary_alt:"#3C32B5",primary_hover:"#E2E1F9",primary_active:"#1F1A7D",primary_light:"#E2E1F9",secondary:"#7A8AFF",secondary_alt:"#5C6EF0",secondary_hover:"#ECEEFF",secondary_active:"#4A5BD1",secondary_light:"#ECEEFF"},n=document.documentElement;for(const x in i)if(Object.prototype.hasOwnProperty.call(i,x)){const p=i[x];n.style.setProperty(`--${x.replace(/_/g,"-")}`,p)}console.log("Fallback theme applied")}};exports.Footer=Or;exports.MainHeader=Wr;exports.Sidebar=kr;exports.SidebarProvider=Rr;exports.SimpleSearchProvider=Kr;exports.dynamicTheme=Jr;exports.useSidebar=Ne;exports.useSimpleSearch=Yr;
|
|
27
|
+
Check the top-level render call using <`+l+">.")}return a}}function He(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var l=gr(a);if(Le[l])return;Le[l]=!0;var b="";e&&e._owner&&e._owner!==Se.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 Fe(e,a){{if(typeof e!="object")return;if(Array.isArray(e))for(var l=0;l<e.length;l++){var b=e[l];Oe(b)&&He(b,a)}else if(Oe(e))e._store&&(e._store.validated=!0);else if(e){var T=Z(e);if(typeof T=="function"&&T!==e.entries)for(var k=T.call(e),S;!(S=k.next()).done;)Oe(S.value)&&He(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===o||a.$$typeof===f))l=a.propTypes;else return;if(l){var b=M(a);xe(l,e.props,"prop",b,e)}else if(a.PropTypes!==void 0&&!Ce){Ce=!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 ze(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:_+=$e();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++)Fe(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 Fe(re,e)}return e===t.Fragment?xr(A):vr(A),A}}function br(e,a,l){return ze(e,a,l,!0)}function wr(e,a,l){return ze(e,a,l,!1)}var yr=wr,jr=br;t.jsx=yr,t.jsxs=jr})()})(ke)),ke}var Ye;function Cr(){return Ye||(Ye=1,process.env.NODE_ENV==="production"?je.exports=Er():je.exports=Sr()),je.exports}var r=Cr();const Or=({contactInfo:t,quickLinks:s,exploreLinks:i,logoUrl:n,copyrights:x})=>{const p=j=>j??"left";return r.jsxs("footer",{className:"footer",children:[r.jsxs("div",{className:"container",children:[r.jsxs("div",{className:`section ${p(t.align)}`,children:[r.jsx("div",{className:"footer-brand-logo",children:r.jsx("img",{src:n,alt:"Logo"})}),r.jsx("p",{children:t.content.shortdesc}),r.jsxs("p",{children:[t.content.location.label,", ",t.content.location.value]}),r.jsxs("p",{children:["📞 ",t.content.phonenumber]})]}),r.jsx("div",{className:`section ${p(s.align)}`,children:r.jsxs("ul",{children:[r.jsx("h3",{children:"Quick Links"}),s.content.map((j,m)=>r.jsx("li",{children:r.jsx("a",{href:j.link,children:j.label})},m))]})}),r.jsx("div",{className:`section ${p(i.align)}`,children:r.jsxs("ul",{children:[r.jsx("h3",{children:"Explore"}),i.content.map((j,m)=>r.jsx("li",{children:r.jsx("a",{href:j.link,children:j.label})},m))]})})]}),r.jsx("div",{className:"copyright",children:r.jsx("p",{children:x})})]})},nr=w.createContext(void 0),Rr=({children:t})=>{const[s,i]=w.useState(!1),n=()=>{i(p=>!p)},x=p=>{i(p)};return r.jsx(nr.Provider,{value:{isCollapsed:s,toggleSidebar:n,setSidebarCollapsed:x},children:t})},Ne=()=>{const t=w.useContext(nr);if(t===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return t},kr=({buttons:t,onNavigate:s,presentPath:i})=>{const{isCollapsed:n,setSidebarCollapsed:x}=Ne(),[p,j]=w.useState(!0),m=w.useRef(null),[g,o]=w.useState(()=>document.dir==="rtl"||document.documentElement.dir==="rtl");return w.useEffect(()=>{const c=()=>{o(document.dir==="rtl"||document.documentElement.dir==="rtl")},d=new MutationObserver(c);return d.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]}),()=>d.disconnect()},[]),w.useEffect(()=>{const c=t.some(d=>d.path===i);j(c),!c&&!n&&i.includes("/course/")&&!i.includes("/learning/course/")&&x(!0)},[i]),w.useEffect(()=>{const c=d=>{!p&&m.current&&!m.current.contains(d.target)&&i.includes("/course/")&&!i.includes("/learning/course/")&&(n||x(!0))};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[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(c=>{const d=c.path===i||(i.includes("/course/")||i.includes("/course_rerun/"))&&c.path==="/my-courses"||i.includes("/library/")&&c.path==="/libraries"||i.includes("/taxonomy/")&&c.path==="/taxonomies";return r.jsx(v.OverlayTrigger,{placement:g?"left":"right",overlay:r.jsx(v.Tooltip,{id:`tooltip-${c.path}`,children:c.label}),show:n?void 0:!1,popperConfig:{modifiers:[{name:"preventOverflow",options:{altAxis:!0,boundary:"viewport"}}]},children:r.jsx(v.Button,{variant:"tertiary",className:`sidebar-btn ${d?"pgn-btn-active":"pgn-btn-inactive"}`,onClick:()=>s(c.path),children:r.jsxs("div",{className:"btn-content",children:[r.jsx("span",{className:"icon-container",children:c.icon}),r.jsx("span",{className:"btn-label",children:c.label})]})})},c.path)})})}),!p&&!n&&r.jsx("div",{className:"sidebar-extra-space"})]})},Tr=(t=768)=>{const[s,i]=w.useState(!1);return w.useEffect(()=>{const n=()=>{i(window.innerWidth<=t)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[t]),s},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:"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"})),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:"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"})),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 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"})),Xe=t=>q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},q.createElement("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z",fill:"currentColor"})),Mr=({id:t,buttonTitle:s,items:i})=>r.jsx(v.DropdownButton,{id:t,title:s,variant:"tertiary",className:"mr-2",children:i.map(n=>r.jsx(v.Dropdown.Item,{href:n.href,as:"a",className:"small",children:n.title},`${n.title}-dropdown-item`))}),Ze=({username:t,authenticatedUserAvatar:s,isMobile:i,menuItems:n})=>{const x=s?r.jsx("img",{className:"d-block w-100 h-100",src:s,alt:t,"data-testid":"avatar-image"}):r.jsx(v.Avatar,{size:"sm",className:"mr-2",alt:"avatar","data-testid":"avatar-icon"}),p=i?x:r.jsxs(r.Fragment,{children:[t," ",x]});return r.jsx(Mr,{buttonTitle:p,id:"user-dropdown-menu",items:n})};var be={},Qe;function Dr(){if(Qe)return be;Qe=1,Object.defineProperty(be,"__esModule",{value:!0}),be.parse=j,be.serialize=o;const t=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,s=/^[\u0021-\u003A\u003C-\u007E]*$/,i=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,x=Object.prototype.toString,p=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function j(f,y){const u=new p,I=f.length;if(I<2)return u;const G=(y==null?void 0:y.decode)||c;let E=0;do{const D=f.indexOf("=",E);if(D===-1)break;const O=f.indexOf(";",E),X=O===-1?I:O;if(D>X){E=f.lastIndexOf(";",D-1)+1;continue}const $=m(f,E,D),Z=g(f,D,$),H=f.slice($,Z);if(u[H]===void 0){let R=m(f,D+1,X),Q=g(f,X,R);const ee=G(f.slice(R,Q));u[H]=ee}E=X+1}while(E<I);return u}function m(f,y,u){do{const I=f.charCodeAt(y);if(I!==32&&I!==9)return y}while(++y<u);return u}function g(f,y,u){for(;y>u;){const I=f.charCodeAt(--y);if(I!==32&&I!==9)return y+1}return u}function o(f,y,u){const I=(u==null?void 0:u.encode)||encodeURIComponent;if(!t.test(f))throw new TypeError(`argument name is invalid: ${f}`);const G=I(y);if(!s.test(G))throw new TypeError(`argument val is invalid: ${y}`);let E=f+"="+G;if(!u)return E;if(u.maxAge!==void 0){if(!Number.isInteger(u.maxAge))throw new TypeError(`option maxAge is invalid: ${u.maxAge}`);E+="; Max-Age="+u.maxAge}if(u.domain){if(!i.test(u.domain))throw new TypeError(`option domain is invalid: ${u.domain}`);E+="; Domain="+u.domain}if(u.path){if(!n.test(u.path))throw new TypeError(`option path is invalid: ${u.path}`);E+="; Path="+u.path}if(u.expires){if(!d(u.expires)||!Number.isFinite(u.expires.valueOf()))throw new TypeError(`option expires is invalid: ${u.expires}`);E+="; Expires="+u.expires.toUTCString()}if(u.httpOnly&&(E+="; HttpOnly"),u.secure&&(E+="; Secure"),u.partitioned&&(E+="; Partitioned"),u.priority)switch(typeof u.priority=="string"?u.priority.toLowerCase():void 0){case"low":E+="; Priority=Low";break;case"medium":E+="; Priority=Medium";break;case"high":E+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${u.priority}`)}if(u.sameSite)switch(typeof u.sameSite=="string"?u.sameSite.toLowerCase():u.sameSite){case!0:case"strict":E+="; SameSite=Strict";break;case"lax":E+="; SameSite=Lax";break;case"none":E+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${u.sameSite}`)}return E}function c(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch{return f}}function d(f){return x.call(f)==="[object Date]"}return be}var _e=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"?_e.parse(t):typeof t=="object"&&t!==null?t:{}}function Te(t,s={}){const i=Hr(t);if(!s.doNotParse)try{return JSON.parse(i)}catch{}return t}function Hr(t){return t&&t[0]==="j"&&t[1]===":"?t.substr(2):t}class Fr{constructor(s,i={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const x=this.cookies;this.cookies=_e.parse(document.cookie),this._checkChanges(x)};const n=typeof document>"u"?"":document.cookie;this.cookies=Lr(s||n),this.defaultSetOptions=i,this.HAS_DOCUMENT_COOKIE=$r()}_emitChange(s){for(let i=0;i<this.changeListeners.length;++i)this.changeListeners[i](s)}_checkChanges(s){new Set(Object.keys(s).concat(Object.keys(this.cookies))).forEach(n=>{s[n]!==this.cookies[n]&&this._emitChange({name:n,value:Te(this.cookies[n])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(s,i={}){return i.doNotUpdate||this.update(),Te(this.cookies[s],i)}getAll(s={}){s.doNotUpdate||this.update();const i={};for(let n in this.cookies)i[n]=Te(this.cookies[n],s);return i}set(s,i,n){n?n=Object.assign(Object.assign({},this.defaultSetOptions),n):n=this.defaultSetOptions;const x=typeof i=="string"?i:JSON.stringify(i);this.cookies=Object.assign(Object.assign({},this.cookies),{[s]:x}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=_e.serialize(s,x,n)),this._emitChange({name:s,value:i,options:n})}remove(s,i){const n=i=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),i),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[s],this.HAS_DOCUMENT_COOKIE&&(document.cookie=_e.serialize(s,"",n)),this._emitChange({name:s,value:void 0,options:i})}addChangeListener(s){this.changeListeners.push(s),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(s){const i=this.changeListeners.indexOf(s);i>=0&&this.changeListeners.splice(i,1),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===0&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}removeAllChangeListeners(){for(;this.changeListeners.length>0;)this.removeChangeListener(this.changeListeners[0])}}class zr{constructor(s){if(!s.host)throw new Error("MeiliSearch host is required");if(!s.apiKey)throw new Error("MeiliSearch apiKey is required");if(!s.indexName)throw new Error("MeiliSearch indexName is required");this.config=s,this.headers={"Content-Type":"application/json",Authorization:`Bearer ${s.apiKey}`,"X-Meilisearch-Client":"Meilisearch JavaScript (v0.41.0)"}}updateHeadersFromClient(s){s&&s.httpRequest&&s.httpRequest.headers&&(this.headers={"Content-Type":s.httpRequest.headers["Content-Type"]||"application/json",Authorization:s.httpRequest.headers.Authorization||`Bearer ${this.config.apiKey}`,"X-Meilisearch-Client":s.httpRequest.headers["X-Meilisearch-Client"]||"Meilisearch JavaScript (v0.41.0)"})}async search(s,i={}){const{limit:n=20,offset:x=0,filter:p=['type = "course_block"'],attributesToHighlight:j=["display_name","description","published"],attributesToCrop:m=["description","published"],sort:g=[]}=i;if(!this.config.indexName)throw new Error("MeiliSearch indexName is required");const o={queries:[{indexUid:this.config.indexName,q:s,filter:[[],...p],attributesToHighlight:j,highlightPreTag:"__meili-highlight__",highlightPostTag:"__/meili-highlight__",attributesToCrop:m,sort:g,offset:x,limit:n},{indexUid:this.config.indexName,facets:["block_type","content.problem_types"],filter:p,limit:0}]},c={...this.headers};try{const d=await fetch(`${this.config.host}/multi-search`,{method:"POST",headers:c,body:JSON.stringify(o)});if(!d.ok)throw new Error(`MeiliSearch API error: ${d.status} ${d.statusText}`);const f=await d.json(),y=f.results[0],u=f.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(s,i={}){const{limit:n=20,offset:x=0,filter:p=['type = "course_block"'],attributesToHighlight:j=["display_name","description","published"],attributesToCrop:m=["description","published"],sort:g=[]}=i,o={queries:[{indexUid:this.config.indexName,q:s,filter:[[],...p],attributesToHighlight:j,highlightPreTag:"__meili-highlight__",highlightPostTag:"__/meili-highlight__",attributesToCrop:m,sort:g,offset:x,limit:n}]},c={...this.headers};try{const d=await fetch(`${this.config.host}/multi-search`,{method:"POST",headers:c,body:JSON.stringify(o)});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(s){return console.error("MeiliSearch connection check failed:",s),!1}}}const ir=t=>new zr(t);function sr(t,s){const{contextKey:i,usageKey:n}=t;return i?i.startsWith("course-v1:")?`${s||""}/course/${i}?show=${encodeURIComponent(n||"")}`:i.startsWith("library-v1:")?`${s||""}/library/${i}`:"#":"#"}function qr(t,s,i){const n=sr(t,s);return n==="#"?(console.warn("Could not generate URL for search hit:",t),"#"):(i?i(n):(n.startsWith("http"),window.location.href=n),n)}const Be=({text:t,highlightTag:s="__meili-highlight__"})=>{if(!t)return null;const i="__/meili-highlight__",n=t.split(s),x=[];return n.forEach((p,j)=>{if(j===0)p&&x.push(p);else{const m=p.indexOf(i);if(m!==-1){const g=p.substring(0,m),o=p.substring(m+i.length);g&&x.push(r.jsx("mark",{className:"search-highlight",children:g},`highlight-${j}`)),o&&x.push(o)}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 er=({result:t,onNavigate:s,baseUrl:i})=>{var g,o;const n=c=>{var y;c.preventDefault(),c.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){s?s(t.url):window.location.href=t.url;return}qr(d,i,s)==="#"&&(s?s(`/search-result/${t.id}`):window.location.href=`/search-result/${t.id}`)},x=c=>{var y;c.preventDefault(),c.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})))||[]},f=sr(d,i);f&&f!=="#"&&window.open(f,"_blank")},p=((g=t._formatted)==null?void 0:g.display_name)||t.display_name,j=((o=t._formatted)==null?void 0:o.description)||t.description,m=t.block_type||t.type;return r.jsx("div",{className:"search-result-item",onClick:n,role:"button",tabIndex:0,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&n(c)},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(Be,{text:p})}),j&&r.jsx("div",{className:"search-result-description",children:r.jsx(Be,{text:j})}),t.breadcrumbs&&t.breadcrumbs.length>0&&r.jsx("div",{className:"search-result-breadcrumbs",children:t.breadcrumbs.map(c=>c.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"})})]})})},rr=new Fr,Wr=({logoUrl:t,menuList:s,loginSignupButtons:i,authenticatedUser:n=null,userMenuItems:x,menuAlignment:p,onLanguageChange:j,getBaseUrl:m,meiliSearchConfig:g,headerButtons:o,languageSelectorList:c})=>{const d=Tr(),{toggleSidebar:f,setSidebarCollapsed:y}=Ne(),[u,I]=w.useState(()=>rr.get("openedx-language-preference")||"en"),[G,E]=w.useState(!1),[D,O]=w.useState(!1),[X,$]=w.useState(!1),[Z,H]=w.useState(""),[R,Q]=w.useState([]),[ee,F]=w.useState(!1),[L,V]=w.useState(null),[M,z]=w.useState(0),[C,W]=w.useState(!1),[K,B]=w.useState(5),oe=w.useRef(null),J=w.useRef(null),ne=w.useRef(g?ir(g):null),ce=w.useRef(!1);w.useEffect(()=>{g!=null&&g.client&&ne.current&&ne.current.updateHeadersFromClient(g.client)},[g==null?void 0:g.client]),w.useEffect(()=>()=>{J.current&&clearTimeout(J.current)},[]),w.useEffect(()=>{document.body.dir=u==="ar"?"rtl":"ltr"},[u]),w.useEffect(()=>{d&&!ce.current?(y(!0),ce.current=!0):d||(ce.current=!1)},[d,y]),w.useEffect(()=>{if(!D)return;function h(N){oe.current&&!oe.current.contains(N.target)&&O(!1)}return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[D]);const le=h=>{I(h),rr.set("openedx-language-preference",h,{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 h=>{if(!h.trim()||!g||!ne.current){Q([]),z(0),$(!1),W(!1);return}F(!0),V(null),$(!1),B(5);try{const N=await ne.current.simpleSearch(h,{limit:20,offset:0});Q(N.hits),z(N.totalHits),$(N.totalHits===0),W(!0)}catch(N){V(N instanceof Error?N.message:"Search failed"),$(!0),Q([]),z(0)}finally{F(!1)}},ie=h=>{H(h),ue(h),d&&G&&E(!1)},de=h=>{H(h),X&&h.trim()===""&&($(!1),W(!1)),J.current&&clearTimeout(J.current),h.trim().length>0?J.current=setTimeout(()=>{ue(h)},500):(Q([]),z(0),$(!1),W(!1))},se=()=>{J.current&&(clearTimeout(J.current),J.current=null),H(""),Q([]),z(0),$(!1),W(!1),V(null),F(!1)},we=()=>{H(""),Q([]),z(0),$(!1),W(!1),V(null),F(!1),B(5),J.current&&(clearTimeout(J.current),J.current=null)},ge=()=>{B(h=>Math.min(h+10,R.length))},ve=h=>{if(c&&c.length>0){const U=c.find(xe=>xe[h]);if(U)return U[h]}return{en:"English",ar:"Arabic",hi:"Hindi"}[h]||h.toUpperCase()},ye=()=>c&&c.length>0?c.map((h,N)=>{const[U,xe]=Object.entries(h)[0];return r.jsx(v.Dropdown.Item,{onClick:()=>le(U),children:xe},`lang-${U}-${N}`)}):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"})]}),ae=(o==null?void 0:o.reSync)||(o==null?void 0:o.contextSwitcher)||(o==null?void 0:o.help)||(o==null?void 0:o.notification)||(o==null?void 0:o.translation);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(Ze,{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})}),ae&&r.jsx(v.IconButton,{src:Pr,iconAs:v.Icon,alt:"More",onMouseDown:h=>h.stopPropagation(),onClick:()=>O(h=>!h)}),D&&ae&&r.jsxs("div",{className:"more-menu-dropdown",ref:oe,children:[r.jsxs("div",{className:"more-menu-icons-row",children:[(o==null?void 0:o.reSync)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Xe,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Re-Sync"})}),(o==null?void 0:o.contextSwitcher)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Je,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Switch to User Mode"})}),(o==null?void 0:o.help)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ue,iconAs:v.Icon,alt:"Help",tooltipPlacement:"bottom",tooltipContent:"Help"})}),(o==null?void 0:o.notification)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ge,iconAs:v.Icon,alt:"Notifications",tooltipPlacement:"bottom",tooltipContent:"Notifications"})})]}),(o==null?void 0:o.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:ye()})]})]})]})}):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:Z,onChange:h=>{de(h.target.value)},onKeyDown:h=>{h.key==="Enter"&&ie(Z)},placeholder:"Search",style:{flex:1,border:"none",outline:"none",fontSize:"16px",background:"transparent",padding:"4px"},autoComplete:"off"}),Z&&r.jsx("button",{type:"button",onClick:()=>{se()},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..."})]}),X&&!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(er,{result:h,onNavigate:U=>{we(),window.location.href=U},baseUrl:m?m():void 0},h.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:[(o==null?void 0:o.reSync)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Xe,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Re-Sync"})}),(o==null?void 0:o.contextSwitcher)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Je,iconAs:v.Icon,alt:"Sync",tooltipPlacement:"bottom",tooltipContent:"Switch to User Mode"})}),(o==null?void 0:o.help)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ue,iconAs:v.Icon,alt:"Help",tooltipPlacement:"bottom",tooltipContent:"Help"})}),(o==null?void 0:o.notification)&&r.jsx("div",{className:"icon-curved-square",children:r.jsx(v.IconButtonWithTooltip,{src:Ge,iconAs:v.Icon,alt:"Notifications",tooltipPlacement:"bottom",tooltipContent:"Notifications"})}),(o==null?void 0:o.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:ye()})]}),r.jsx("div",{className:"usermenu-dropdown",children:r.jsx(Ze,{username:n==null?void 0:n.username,authenticatedUserAvatar:n==null?void 0:n.avatar,isMobile:d,isAdmin:n==null?void 0:n.administrator,menuItems:x})})]})]})}),n===null&&r.jsxs(r.Fragment,{children:[r.jsx(v.Navbar.Toggle,{"aria-controls":"main-navbar-nav"}),r.jsx("div",{className:"d-flex align-items-center gap-2 ms-auto order-lg-3",children:i&&r.jsxs(r.Fragment,{children:[r.jsx(v.Button,{variant:"primary",children:"Log In"}),r.jsx(v.Button,{variant:"outline-primary",children:"Sign Up"})]})})]}),r.jsx(v.Navbar.Collapse,{id:"main-navbar-nav",className:"justify-content-between",children:r.jsx(v.Nav,{className:`nav-gap gap-3 flex-grow-1 ${me}`,children:n===null&&s.map(h=>h.subMenu?r.jsx(v.NavDropdown,{title:h.label,id:`nav-dropdown-${h.label}`,children:h.subMenu.map(N=>r.jsx(v.NavDropdown.Item,{onClick:()=>console.log("Selected submenu:",N.label),children:N.label},`sub-${N.label}`))},`menu-${h.label}`):r.jsx(v.Nav.Link,{as:"span",className:"text-uppercase fw-semibold",children:h.label},`menu-${h.label}`))})}),g&&G&&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:Z,onChange:h=>{de(h.target.value)},onKeyDown:h=>{h.key==="Enter"&&ie(Z)},placeholder:"Search",style:{flex:1,border:"none",outline:"none",fontSize:"18px",background:"transparent",padding:"4px"},autoComplete:"off",autoFocus:!0}),Z&&r.jsx("button",{type:"button",onClick:()=>{se()},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..."})]}),X&&!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(er,{result:h,onNavigate:U=>{we(),window.location.href=U},baseUrl:m?m():void 0},h.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"]})})]})]})]})]})},ar=w.createContext(void 0),Kr=({children:t,meiliSearchConfig:s})=>{const[i,n]=w.useState(""),[x,p]=w.useState([]),[j,m]=w.useState(0),[g,o]=w.useState(!1),[c,d]=w.useState(!1),[f,y]=w.useState(null),[u,I]=w.useState(0),[G,E]=w.useState(!1),[D,O]=w.useState(!1),[X,$]=w.useState(null),Z=ir(s),H=async F=>{if(!F.trim()){Q();return}o(!0),d(!1),y(null),I(0);try{const L=await Z.search(F,{limit:20,offset:0}),V=L.hits.map(C=>{var W,K,B;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:((B=C._formatted)==null?void 0:B.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{o(!1)}},R=async()=>{if(!(!G||D)){O(!0);try{const F=u+20,L=await Z.simpleSearch(i,{limit:20,offset:F}),V=L.hits.map(C=>{var W,K,B;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:((B=C._formatted)==null?void 0:B.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)}}},Q=()=>{n(""),p([]),m(0),d(!1),y(null),I(0),E(!1),$(null)},ee={searchKeywords:i,setSearchKeywords:n,searchResults:x,totalHits:j,isLoading:g,hasError:c,errorMessage:f,facets:X,performSearch:H,clearSearch:Q,hasNextPage:G,fetchNextPage:R,isFetchingNextPage:D};return r.jsx(ar.Provider,{value:ee,children:t})},Yr=()=>{const t=w.useContext(ar);if(t===void 0)throw new Error("useSimpleSearch must be used within a SimpleSearchProvider");return t},Jr=t=>{try{if(t.status!==200)throw new Error("Failed to fetch theme config");const s=t.data.theme_colors;if(!s||typeof s!="object")throw new Error("Invalid theme_colors in API response");const i=document.documentElement;for(const n in s)if(Object.prototype.hasOwnProperty.call(s,n)){const x=s[n];i.style.setProperty(`--${n.replace(/_/g,"-")}`,x)}}catch(s){console.error("Error applying theme from API:",s.message);const i={primary:"#2B2399",primary_alt:"#3C32B5",primary_hover:"#E2E1F9",primary_active:"#1F1A7D",primary_light:"#E2E1F9",secondary:"#7A8AFF",secondary_alt:"#5C6EF0",secondary_hover:"#ECEEFF",secondary_active:"#4A5BD1",secondary_light:"#ECEEFF"},n=document.documentElement;for(const x in i)if(Object.prototype.hasOwnProperty.call(i,x)){const p=i[x];n.style.setProperty(`--${x.replace(/_/g,"-")}`,p)}}};exports.Footer=Or;exports.MainHeader=Wr;exports.Sidebar=kr;exports.SidebarProvider=Rr;exports.SimpleSearchProvider=Kr;exports.dynamicTheme=Jr;exports.useSidebar=Ne;exports.useSimpleSearch=Yr;
|
package/dist/index.js
CHANGED
|
@@ -854,7 +854,7 @@ const it = ({ contactInfo: t, quickLinks: s, exploreLinks: i, logoUrl: n, copyri
|
|
|
854
854
|
id: t,
|
|
855
855
|
buttonTitle: s,
|
|
856
856
|
items: i
|
|
857
|
-
}) =>
|
|
857
|
+
}) => /* @__PURE__ */ r.jsx(
|
|
858
858
|
Dr,
|
|
859
859
|
{
|
|
860
860
|
id: t,
|
|
@@ -872,7 +872,7 @@ const it = ({ contactInfo: t, quickLinks: s, exploreLinks: i, logoUrl: n, copyri
|
|
|
872
872
|
`${n.title}-dropdown-item`
|
|
873
873
|
))
|
|
874
874
|
}
|
|
875
|
-
)
|
|
875
|
+
), sr = ({
|
|
876
876
|
username: t,
|
|
877
877
|
// studioBaseUrl,
|
|
878
878
|
// logoutUrl,
|
|
@@ -1394,7 +1394,7 @@ const cr = ({
|
|
|
1394
1394
|
languageSelectorList: c
|
|
1395
1395
|
}) => {
|
|
1396
1396
|
const d = Vr(), { toggleSidebar: f, setSidebarCollapsed: b } = mr(), [u, P] = k(() => lr.get("openedx-language-preference") || "en"), [U, j] = k(!1), [I, S] = k(!1), [G, $] = k(!1), [X, L] = k(""), [C, Z] = k([]), [re, H] = k(!1), [D, V] = k(null), [M, F] = k(0), [E, q] = k(!1), [K, B] = k(5), ue = _e(null), Y = _e(null), ae = _e(g ? gr(g) : null), de = _e(!1);
|
|
1397
|
-
|
|
1397
|
+
ie(() => {
|
|
1398
1398
|
g != null && g.client && ae.current && ae.current.updateHeadersFromClient(g.client);
|
|
1399
1399
|
}, [g == null ? void 0 : g.client]), ie(() => () => {
|
|
1400
1400
|
Y.current && clearTimeout(Y.current);
|
|
@@ -1461,14 +1461,14 @@ const cr = ({
|
|
|
1461
1461
|
ar: "Arabic",
|
|
1462
1462
|
hi: "Hindi"
|
|
1463
1463
|
}[h] || h.toUpperCase();
|
|
1464
|
-
}, Se = () =>
|
|
1464
|
+
}, Se = () => c && c.length > 0 ? c.map((h, T) => {
|
|
1465
1465
|
const [J, ye] = Object.entries(h)[0];
|
|
1466
1466
|
return /* @__PURE__ */ r.jsx(ee.Item, { onClick: () => fe(J), children: ye }, `lang-${J}-${T}`);
|
|
1467
|
-
})
|
|
1467
|
+
}) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
1468
1468
|
/* @__PURE__ */ r.jsx(ee.Item, { onClick: () => fe("en"), children: "English" }),
|
|
1469
1469
|
/* @__PURE__ */ r.jsx(ee.Item, { onClick: () => fe("ar"), children: "Arabic" }),
|
|
1470
1470
|
/* @__PURE__ */ r.jsx(ee.Item, { onClick: () => fe("hi"), children: "Hindi" })
|
|
1471
|
-
] })
|
|
1471
|
+
] }), le = (o == null ? void 0 : o.reSync) || (o == null ? void 0 : o.contextSwitcher) || (o == null ? void 0 : o.help) || (o == null ? void 0 : o.notification) || (o == null ? void 0 : o.translation);
|
|
1472
1472
|
return /* @__PURE__ */ r.jsxs(Ce, { 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(
|
|
@@ -1868,7 +1868,6 @@ const cr = ({
|
|
|
1868
1868
|
const v = s[n];
|
|
1869
1869
|
i.style.setProperty(`--${n.replace(/_/g, "-")}`, v);
|
|
1870
1870
|
}
|
|
1871
|
-
console.log("Theme applied successfully from API:", s);
|
|
1872
1871
|
} catch (s) {
|
|
1873
1872
|
console.error("Error applying theme from API:", s.message);
|
|
1874
1873
|
const i = {
|
|
@@ -1888,7 +1887,6 @@ const cr = ({
|
|
|
1888
1887
|
const p = i[v];
|
|
1889
1888
|
n.style.setProperty(`--${v.replace(/_/g, "-")}`, p);
|
|
1890
1889
|
}
|
|
1891
|
-
console.log("Fallback theme applied");
|
|
1892
1890
|
}
|
|
1893
1891
|
};
|
|
1894
1892
|
export {
|
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -16,7 +16,6 @@ function App() {
|
|
|
16
16
|
const response = await axios.get("http://localhost:5000/templateData", {
|
|
17
17
|
headers: { "Cache-Control": "no-store" },
|
|
18
18
|
})
|
|
19
|
-
console.log("Fetched Theme Data:", response.data?.content?.header?.mainHeader)
|
|
20
19
|
setTemplateData(response.data?.content?.header?.mainHeader)
|
|
21
20
|
setFooterData(response.data?.content?.footer)
|
|
22
21
|
} catch (error) {
|
|
@@ -57,7 +57,6 @@ const MainHeader: React.FC<MainHeaderProps> = ({
|
|
|
57
57
|
const searchService = useRef(meiliSearchConfig ? createMeiliSearchService(meiliSearchConfig) : null);
|
|
58
58
|
const initialMobileDetection = useRef(false);
|
|
59
59
|
|
|
60
|
-
console.log('languageSelectorList', languageSelectorList);
|
|
61
60
|
|
|
62
61
|
|
|
63
62
|
// Update headers from MeiliSearch client if provided
|
|
@@ -267,12 +266,9 @@ const MainHeader: React.FC<MainHeaderProps> = ({
|
|
|
267
266
|
|
|
268
267
|
// Helper function to render language options
|
|
269
268
|
const renderLanguageOptions = () => {
|
|
270
|
-
console.log('renderLanguageOptions - languageSelectorList:', languageSelectorList);
|
|
271
|
-
console.log('renderLanguageOptions - length:', languageSelectorList?.length);
|
|
272
269
|
|
|
273
270
|
// Only use custom languageSelectorList if it's provided and has items
|
|
274
271
|
if (languageSelectorList && languageSelectorList.length > 0) {
|
|
275
|
-
console.log('Using custom languageSelectorList');
|
|
276
272
|
return languageSelectorList.map((langObj, index) => {
|
|
277
273
|
const [langCode, langName] = Object.entries(langObj)[0];
|
|
278
274
|
return (
|
|
@@ -284,7 +280,6 @@ const MainHeader: React.FC<MainHeaderProps> = ({
|
|
|
284
280
|
}
|
|
285
281
|
|
|
286
282
|
// Fallback to default languages ONLY if no languageSelectorList provided
|
|
287
|
-
console.log('Using fallback languages');
|
|
288
283
|
return (
|
|
289
284
|
<>
|
|
290
285
|
<Dropdown.Item onClick={() => handleLanguageChange('en')}>English</Dropdown.Item>
|
|
@@ -20,7 +20,6 @@ export const dynamicTheme = (response: ThemeResponse): void => {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
console.log('Theme applied successfully from API:', themeColors);
|
|
24
23
|
} catch (error) {
|
|
25
24
|
console.error('Error applying theme from API:', (error as Error).message);
|
|
26
25
|
|
|
@@ -44,6 +43,5 @@ export const dynamicTheme = (response: ThemeResponse): void => {
|
|
|
44
43
|
root.style.setProperty(`--${key.replace(/_/g, '-')}`, value);
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
|
-
console.log('Fallback theme applied');
|
|
48
46
|
}
|
|
49
47
|
};
|