UNPKG

@hirebus/academy

Version:

React component library for academy and learning platforms

36 lines 56.4 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),Ge=require("nuqs"),Be=require("nuqs/adapters/react"),b=require("react"),De=require("@radix-ui/react-slot"),We=require("@radix-ui/react-collapsible");function we(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const z=we(b),je=we(We);var S=(e=>(e.AllCourses="All Courses",e.ProfessionalDevelopment="Professional Development",e.SkillsDevelopment="Skills Development",e.WorkplaceSuccess="Workplace Success",e.Management="Management",e.Leadership="Leadership",e))(S||{});function Ce(e){var t,s,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(s=Ce(e[t]))&&(o&&(o+=" "),o+=s)}else for(s in e)e[s]&&(o&&(o+=" "),o+=s);return o}function Fe(){for(var e,t,s=0,o="",i=arguments.length;s<i;s++)(e=arguments[s])&&(t=Ce(e))&&(o&&(o+=" "),o+=t);return o}const re="-",Ue=e=>{const t=$e(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{const a=l.split(re);return a[0]===""&&a.length!==1&&a.shift(),ke(a,t)||Ze(l)},getConflictingClassGroupIds:(l,a)=>{const u=s[l]||[];return a&&o[l]?[...u,...o[l]]:u}}},ke=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const s=e[0],o=t.nextPart.get(s),i=o?ke(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;const n=e.join(re);return(l=t.validators.find(({validator:a})=>a(n)))==null?void 0:l.classGroupId},ue=/^\[(.+)\]$/,Ze=e=>{if(ue.test(e)){const t=ue.exec(e)[1],s=t==null?void 0:t.substring(0,t.indexOf(":"));if(s)return"arbitrary.."+s}},$e=e=>{const{theme:t,prefix:s}=e,o={nextPart:new Map,validators:[]};return He(Object.entries(e.classGroups),s).forEach(([n,l])=>{K(l,o,n,t)}),o},K=(e,t,s,o)=>{e.forEach(i=>{if(typeof i=="string"){const n=i===""?t:me(t,i);n.classGroupId=s;return}if(typeof i=="function"){if(qe(i)){K(i(o),t,s,o);return}t.validators.push({validator:i,classGroupId:s});return}Object.entries(i).forEach(([n,l])=>{K(l,me(t,n),s,o)})})},me=(e,t)=>{let s=e;return t.split(re).forEach(o=>{s.nextPart.has(o)||s.nextPart.set(o,{nextPart:new Map,validators:[]}),s=s.nextPart.get(o)}),s},qe=e=>e.isThemeGetter,He=(e,t)=>t?e.map(([s,o])=>{const i=o.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([l,a])=>[t+l,a])):n);return[s,i]}):e,Qe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=new Map,o=new Map;const i=(n,l)=>{s.set(n,l),t++,t>e&&(t=0,o=s,s=new Map)};return{get(n){let l=s.get(n);if(l!==void 0)return l;if((l=o.get(n))!==void 0)return i(n,l),l},set(n,l){s.has(n)?s.set(n,l):i(n,l)}}},Ne="!",Ve=e=>{const{separator:t,experimentalParseClassName:s}=e,o=t.length===1,i=t[0],n=t.length,l=a=>{const u=[];let d=0,p=0,x;for(let f=0;f<a.length;f++){let y=a[f];if(d===0){if(y===i&&(o||a.slice(f,f+n)===t)){u.push(a.slice(p,f)),p=f+n;continue}if(y==="/"){x=f;continue}}y==="["?d++:y==="]"&&d--}const h=u.length===0?a:a.substring(p),j=h.startsWith(Ne),k=j?h.substring(1):h,c=x&&x>p?x-p:void 0;return{modifiers:u,hasImportantModifier:j,baseClassName:k,maybePostfixModifierPosition:c}};return s?a=>s({className:a,parseClassName:l}):l},Xe=e=>{if(e.length<=1)return e;const t=[];let s=[];return e.forEach(o=>{o[0]==="["?(t.push(...s.sort(),o),s=[]):s.push(o)}),t.push(...s.sort()),t},Je=e=>({cache:Qe(e.cacheSize),parseClassName:Ve(e),...Ue(e)}),Ke=/\s+/,Ye=(e,t)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:i}=t,n=[],l=e.trim().split(Ke);let a="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{modifiers:p,hasImportantModifier:x,baseClassName:h,maybePostfixModifierPosition:j}=s(d);let k=!!j,c=o(k?h.substring(0,j):h);if(!c){if(!k){a=d+(a.length>0?" "+a:a);continue}if(c=o(h),!c){a=d+(a.length>0?" "+a:a);continue}k=!1}const f=Xe(p).join(":"),y=x?f+Ne:f,g=y+c;if(n.includes(g))continue;n.push(g);const N=i(c,k);for(let I=0;I<N.length;++I){const _=N[I];n.push(y+_)}a=d+(a.length>0?" "+a:a)}return a};function et(){let e=0,t,s,o="";for(;e<arguments.length;)(t=arguments[e++])&&(s=Se(t))&&(o&&(o+=" "),o+=s);return o}const Se=e=>{if(typeof e=="string")return e;let t,s="";for(let o=0;o<e.length;o++)e[o]&&(t=Se(e[o]))&&(s&&(s+=" "),s+=t);return s};function tt(e,...t){let s,o,i,n=l;function l(u){const d=t.reduce((p,x)=>x(p),e());return s=Je(d),o=s.cache.get,i=s.cache.set,n=a,a(u)}function a(u){const d=o(u);if(d)return d;const p=Ye(u,s);return i(u,p),p}return function(){return n(et.apply(null,arguments))}}const v=e=>{const t=s=>s[e]||[];return t.isThemeGetter=!0,t},Ie=/^\[(?:([a-z-]+):)?(.+)\]$/i,rt=/^\d+\/\d+$/,st=new Set(["px","full","screen"]),ot=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,it=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,at=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,A=e=>E(e)||st.has(e)||rt.test(e),R=e=>O(e,"length",gt),E=e=>!!e&&!Number.isNaN(Number(e)),J=e=>O(e,"number",E),B=e=>!!e&&Number.isInteger(Number(e)),ct=e=>e.endsWith("%")&&E(e.slice(0,-1)),m=e=>Ie.test(e),M=e=>ot.test(e),dt=new Set(["length","size","percentage"]),ut=e=>O(e,dt,Te),mt=e=>O(e,"position",Te),pt=new Set(["image","url"]),ht=e=>O(e,pt,bt),ft=e=>O(e,"",xt),D=()=>!0,O=(e,t,s)=>{const o=Ie.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):s(o[2]):!1},gt=e=>nt.test(e)&&!it.test(e),Te=()=>!1,xt=e=>at.test(e),bt=e=>lt.test(e),vt=()=>{const e=v("colors"),t=v("spacing"),s=v("blur"),o=v("brightness"),i=v("borderColor"),n=v("borderRadius"),l=v("borderSpacing"),a=v("borderWidth"),u=v("contrast"),d=v("grayscale"),p=v("hueRotate"),x=v("invert"),h=v("gap"),j=v("gradientColorStops"),k=v("gradientColorStopPositions"),c=v("inset"),f=v("margin"),y=v("opacity"),g=v("padding"),N=v("saturate"),I=v("scale"),_=v("sepia"),oe=v("skew"),ne=v("space"),ie=v("translate"),H=()=>["auto","contain","none"],Q=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",m,t],w=()=>[m,t],ae=()=>["",A,R],U=()=>["auto",E,m],le=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",m],de=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>[E,m];return{cacheSize:500,separator:":",theme:{colors:[D],spacing:[A,R],blur:["none","",M,m],brightness:T(),borderColor:[e],borderRadius:["none","","full",M,m],borderSpacing:w(),borderWidth:ae(),contrast:T(),grayscale:G(),hueRotate:T(),invert:G(),gap:w(),gradientColorStops:[e],gradientColorStopPositions:[ct,R],inset:V(),margin:V(),opacity:T(),padding:w(),saturate:T(),scale:T(),sepia:G(),skew:T(),space:w(),translate:w()},classGroups:{aspect:[{aspect:["auto","square","video",m]}],container:["container"],columns:[{columns:[M]}],"break-after":[{"break-after":de()}],"break-before":[{"break-before":de()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...le(),m]}],overflow:[{overflow:Q()}],"overflow-x":[{"overflow-x":Q()}],"overflow-y":[{"overflow-y":Q()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[c]}],"inset-x":[{"inset-x":[c]}],"inset-y":[{"inset-y":[c]}],start:[{start:[c]}],end:[{end:[c]}],top:[{top:[c]}],right:[{right:[c]}],bottom:[{bottom:[c]}],left:[{left:[c]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",B,m]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",m]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",B,m]}],"grid-cols":[{"grid-cols":[D]}],"col-start-end":[{col:["auto",{span:["full",B,m]},m]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[D]}],"row-start-end":[{row:["auto",{span:[B,m]},m]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",m]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",m]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],mt:[{mt:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[ne]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ne]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",m,t]}],"min-w":[{"min-w":[m,t,"min","max","fit"]}],"max-w":[{"max-w":[m,t,"none","full","min","max","fit","prose",{screen:[M]},M]}],h:[{h:[m,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[m,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[m,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[m,t,"auto","min","max","fit"]}],"font-size":[{text:["base",M,R]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",J]}],"font-family":[{font:[D]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",m]}],"line-clamp":[{"line-clamp":["none",E,J]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",A,m]}],"list-image":[{"list-image":["none",m]}],"list-style-type":[{list:["none","disc","decimal",m]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",A,R]}],"underline-offset":[{"underline-offset":["auto",A,m]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",m]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",m]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...le(),mt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ut]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ht]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[k]}],"gradient-via-pos":[{via:[k]}],"gradient-to-pos":[{to:[k]}],"gradient-from":[{from:[j]}],"gradient-via":[{via:[j]}],"gradient-to":[{to:[j]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...Z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:Z()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[A,m]}],"outline-w":[{outline:[A,R]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[A,R]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",M,ft]}],"shadow-color":[{shadow:[D]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...ce(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ce()}],filter:[{filter:["","none"]}],blur:[{blur:[s]}],brightness:[{brightness:[o]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",M,m]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[x]}],saturate:[{saturate:[N]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[s]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",m]}],duration:[{duration:T()}],ease:[{ease:["linear","in","out","in-out",m]}],delay:[{delay:T()}],animate:[{animate:["none","spin","ping","pulse","bounce",m]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[I]}],"scale-x":[{"scale-x":[I]}],"scale-y":[{"scale-y":[I]}],rotate:[{rotate:[B,m]}],"translate-x":[{"translate-x":[ie]}],"translate-y":[{"translate-y":[ie]}],"skew-x":[{"skew-x":[oe]}],"skew-y":[{"skew-y":[oe]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",m]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",m]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",m]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[A,R,J]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},yt=tt(vt);function C(...e){return yt(Fe(e))}const pe={courseView:"course"},he=e=>{let t;const s=new Set,o=(d,p)=>{const x=typeof d=="function"?d(t):d;if(!Object.is(x,t)){const h=t;t=p??(typeof x!="object"||x===null)?x:Object.assign({},t,x),s.forEach(j=>j(t,h))}},i=()=>t,a={setState:o,getState:i,getInitialState:()=>u,subscribe:d=>(s.add(d),()=>s.delete(d))},u=t=e(o,i,a);return a},wt=e=>e?he(e):he,jt=e=>e;function Ct(e,t=jt){const s=b.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return b.useDebugValue(s),s}const fe=e=>{const t=wt(e),s=o=>Ct(t,o);return Object.assign(s,t),s},kt=e=>e?fe(e):fe;function Ae(e,t){let s;try{s=e()}catch{return}return{getItem:i=>{var n;const l=u=>u===null?null:JSON.parse(u,void 0),a=(n=s.getItem(i))!=null?n:null;return a instanceof Promise?a.then(l):l(a)},setItem:(i,n)=>s.setItem(i,JSON.stringify(n,void 0)),removeItem:i=>s.removeItem(i)}}const Y=e=>t=>{try{const s=e(t);return s instanceof Promise?s:{then(o){return Y(o)(s)},catch(o){return this}}}catch(s){return{then(o){return this},catch(o){return Y(o)(s)}}}},Nt=(e,t)=>(s,o,i)=>{let n={storage:Ae(()=>localStorage),partialize:c=>c,version:0,merge:(c,f)=>({...f,...c}),...t},l=!1;const a=new Set,u=new Set;let d=n.storage;if(!d)return e((...c)=>{console.warn(`[zustand persist middleware] Unable to update item '${n.name}', the given storage is currently unavailable.`),s(...c)},o,i);const p=()=>{const c=n.partialize({...o()});return d.setItem(n.name,{state:c,version:n.version})},x=i.setState;i.setState=(c,f)=>{x(c,f),p()};const h=e((...c)=>{s(...c),p()},o,i);i.getInitialState=()=>h;let j;const k=()=>{var c,f;if(!d)return;l=!1,a.forEach(g=>{var N;return g((N=o())!=null?N:h)});const y=((f=n.onRehydrateStorage)==null?void 0:f.call(n,(c=o())!=null?c:h))||void 0;return Y(d.getItem.bind(d))(n.name).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==n.version){if(n.migrate){const N=n.migrate(g.state,g.version);return N instanceof Promise?N.then(I=>[!0,I]):[!0,N]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,g.state];return[!1,void 0]}).then(g=>{var N;const[I,_]=g;if(j=n.merge(_,(N=o())!=null?N:h),s(j,!0),I)return p()}).then(()=>{y==null||y(j,void 0),j=o(),l=!0,u.forEach(g=>g(j))}).catch(g=>{y==null||y(void 0,g)})};return i.persist={setOptions:c=>{n={...n,...c},c.storage&&(d=c.storage)},clearStorage:()=>{d==null||d.removeItem(n.name)},getOptions:()=>n,rehydrate:()=>k(),hasHydrated:()=>l,onHydrate:c=>(a.add(c),()=>{a.delete(c)}),onFinishHydration:c=>(u.add(c),()=>{u.delete(c)})},n.skipHydration||k(),j||h},St=Nt,It={courses:[]},ge=kt()(St(e=>({...It,setInitialCourses:t=>{e({courses:t})},onCreateCourse:t=>{e(s=>({courses:[...s.courses,t]}))},onUpdateCourse:t=>{e(s=>({courses:s.courses.map(o=>o.id===t.id?{...o,...t}:o)}))},onDeleteCourse:t=>{e(s=>({courses:s.courses.filter(o=>o.id!==t)}))}}),{name:"__courses_storage",storage:Ae(()=>localStorage)}));function Tt({className:e,size:t="md"}){const s={sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"};return r.jsx("div",{className:C("flex items-center justify-center py-12",e),"data-testid":"loading-spinner",children:r.jsx("div",{className:C("animate-spin rounded-full border-b-2 border-t-2 border-blue-600",s[t])})})}function ze(e){var t,s,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(s=ze(e[t]))&&(o&&(o+=" "),o+=s);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function At(){for(var e,t,s=0,o="";s<arguments.length;)(e=arguments[s++])&&(t=ze(e))&&(o&&(o+=" "),o+=t);return o}const xe=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,be=At,zt=(e,t)=>s=>{var o;if((t==null?void 0:t.variants)==null)return be(e,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:i,defaultVariants:n}=t,l=Object.keys(i).map(d=>{const p=s==null?void 0:s[d],x=n==null?void 0:n[d];if(p===null)return null;const h=xe(p)||xe(x);return i[d][h]}),a=s&&Object.entries(s).reduce((d,p)=>{let[x,h]=p;return h===void 0||(d[x]=h),d},{}),u=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((d,p)=>{let{class:x,className:h,...j}=p;return Object.entries(j).every(k=>{let[c,f]=k;return Array.isArray(f)?f.includes({...n,...a}[c]):{...n,...a}[c]===f})?[...d,x,h]:d},[]);return be(e,l,u,s==null?void 0:s.class,s==null?void 0:s.className)},Rt=zt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),q=z.forwardRef(({className:e,variant:t,size:s,asChild:o=!1,...i},n)=>{const l=o?De.Slot:"button";return r.jsx(l,{className:C(Rt({variant:t,size:s,className:e})),ref:n,...i})});q.displayName="Button";function Mt({categories:e,activeCategory:t,courseCount:s,onSelectCategory:o,className:i}){return r.jsx("div",{className:C("flex flex-wrap items-center gap-2",i),children:e.map(n=>r.jsxs(q,{variant:t===n?"default":"outline",className:C("rounded-full",t===n?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"),onClick:()=>o(n),children:[n,n===S.AllCourses&&s!==void 0&&r.jsx("span",{className:"ml-1 rounded-full bg-white px-1.5 py-0.5 text-xs text-gray-700",children:s})]},`category.${n}`))})}const L=z.forwardRef(({className:e,...t},s)=>r.jsx("div",{ref:s,className:C("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));L.displayName="Card";const W=z.forwardRef(({className:e,...t},s)=>r.jsx("div",{ref:s,className:C("flex flex-col space-y-1.5 p-6",e),...t}));W.displayName="CardHeader";const F=z.forwardRef(({className:e,...t},s)=>r.jsx("div",{ref:s,className:C("text-2xl font-semibold leading-none tracking-tight",e),...t}));F.displayName="CardTitle";const Lt=z.forwardRef(({className:e,...t},s)=>r.jsx("div",{ref:s,className:C("text-sm text-muted-foreground",e),...t}));Lt.displayName="CardDescription";const P=z.forwardRef(({className:e,...t},s)=>r.jsx("div",{ref:s,className:C("p-6 pt-0",e),...t}));P.displayName="CardContent";const Re=z.forwardRef(({className:e,...t},s)=>r.jsx("div",{ref:s,className:C("flex items-center p-6 pt-0",e),...t}));Re.displayName="CardFooter";/** * @license lucide-react v0.486.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_t=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,o)=>o?o.toUpperCase():s.toLowerCase()),ve=e=>{const t=_t(e);return t.charAt(0).toUpperCase()+t.slice(1)},Me=(...e)=>e.filter((t,s,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===s).join(" ").trim();/** * @license lucide-react v0.486.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Et={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.486.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ot=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:i="",children:n,iconNode:l,...a},u)=>b.createElement("svg",{ref:u,...Et,width:t,height:t,stroke:e,strokeWidth:o?Number(s)*24/Number(t):s,className:Me("lucide",i),...a},[...l.map(([d,p])=>b.createElement(d,p)),...Array.isArray(n)?n:[n]]));/** * @license lucide-react v0.486.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const se=(e,t)=>{const s=b.forwardRef(({className:o,...i},n)=>b.createElement(Ot,{ref:n,iconNode:t,className:Me(`lucide-${Pt(ve(e))}`,`lucide-${e}`,o),...i}));return s.displayName=ve(e),s};/** * @license lucide-react v0.486.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Bt=se("chevron-down",Gt);/** * @license lucide-react v0.486.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Dt=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Wt=se("chevron-up",Dt);/** * @license lucide-react v0.486.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ft=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Ut=se("tag",Ft);function Zt({course:e,onViewCourse:t,className:s}){const[o,i]=b.useState(!1),n=a=>a.split("_").map(u=>u.charAt(0).toUpperCase()+u.slice(1).toLowerCase()).join(" "),l=()=>{t==null||t(e.id)};return r.jsxs(L,{className:C("overflow-hidden border border-gray-200 bg-white shadow-sm","cursor-pointer transition-all duration-300 ease-in-out","flex h-full flex-col",o&&"-translate-y-1 transform shadow-lg",s),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:l,children:[r.jsxs("div",{className:"relative",children:[e.thumbnail?r.jsxs("div",{className:"relative",children:[r.jsx("img",{src:e.thumbnail,alt:e.title,className:"h-[200px] w-full object-cover"}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx("button",{className:C("flex h-16 w-16 items-center justify-center rounded-full bg-blue-600 text-white hover:bg-blue-700","transition-opacity duration-200",o?"opacity-100":"opacity-0"),"aria-label":"Play course",onClick:a=>{a.stopPropagation(),t==null||t(e.id)},children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-8 w-8",children:r.jsx("path",{fillRule:"evenodd",d:"M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z",clipRule:"evenodd"})})})})]}):r.jsxs("div",{className:"relative flex h-[200px] w-full items-center justify-center bg-gray-300",children:[r.jsx("span",{className:"text-gray-600",children:"No image"}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx("button",{className:C("flex h-16 w-16 items-center justify-center rounded-full bg-blue-600 text-white hover:bg-blue-700","transition-opacity duration-200",o?"opacity-100":"opacity-0"),"aria-label":"Play course",onClick:a=>{a.stopPropagation(),t==null||t(e.id)},children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-8 w-8",children:r.jsx("path",{fillRule:"evenodd",d:"M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z",clipRule:"evenodd"})})})})]}),r.jsx("div",{className:"absolute bottom-0 left-0 w-full bg-black/50 p-1",children:r.jsx("div",{className:"flex items-center justify-between text-xs text-white",children:e.duration!==void 0&&r.jsxs("span",{className:"flex items-center text-xs font-medium text-white",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"mr-1 h-4 w-4",children:r.jsx("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z",clipRule:"evenodd"})}),e.duration," min"]})})})]}),r.jsxs(P,{className:"flex-grow bg-white p-4",children:[r.jsx("div",{className:"mb-2",children:r.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-blue-600",children:n(e.category)})}),r.jsx("h3",{className:"mb-2 text-base font-semibold text-gray-900",children:e.title}),e.description&&r.jsx("p",{className:"line-clamp-2 text-sm font-normal text-gray-600",children:e.description}),e.tags&&e.tags.length>0&&r.jsx("div",{className:"mt-3",children:r.jsx("div",{className:"flex flex-col gap-1.5",children:r.jsxs("div",{className:"flex items-center text-xs text-gray-600",children:[r.jsx(Ut,{className:"mr-1.5 h-3.5 w-3.5 text-gray-400"}),r.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tags.slice(0,3).map(a=>r.jsx("span",{className:"inline-flex rounded-full bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-600",children:a},a)),e.tags.length>3&&r.jsxs("span",{className:"inline-flex rounded-full bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-600",children:["+",e.tags.length-3]})]})]})})})]}),r.jsx(Re,{className:"mt-auto bg-white p-4 pt-0",children:r.jsx(q,{className:"w-full bg-blue-600 text-white hover:bg-blue-800",variant:"default",onClick:a=>{a.stopPropagation(),t==null||t(e.id)},children:"View"})})]})}function $t({courses:e,onViewCourse:t,className:s}){return e.length?r.jsx("div",{className:C("grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",s),children:e.map(o=>r.jsx(Zt,{course:o,onViewCourse:t},o.id))}):r.jsx("div",{className:"flex items-center justify-center rounded-lg bg-gray-100 p-8 text-gray-500",children:"No courses found"})}const ee=z.forwardRef(({className:e,type:t,...s},o)=>r.jsx("input",{type:t,className:C("box-border h-[44px] w-full md:w-full","border-base-400 rounded-2xl border","px-3 md:px-4","placeholder:text-base-400","focus:border-primary-focus focus:border-[2px] focus:outline-none focus:ring-0","disabled:border-base-400 disabled:text-base-400 disabled:bg-white",e),ref:o,...s}));ee.displayName="BaseInput";const Le=z.forwardRef(({className:e,type:t,label:s,error:o,required:i,...n},l)=>s?r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsxs("label",{htmlFor:n.id??s,className:"text-muted-foreground",children:[s,i&&r.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),r.jsx(ee,{ref:l,className:C(e,o&&"border-red-500"),type:t,...n,id:n.id??s}),o&&r.jsx("p",{className:"text-sm text-red-500",children:o})]}):r.jsx(ee,{ref:l,className:e,type:t,...n}));Le.displayName="Input";function qt({onSearch:e,className:t}){const[s,o]=b.useState(""),i=b.useRef(null);b.useEffect(()=>(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{e(s)},290),()=>{i.current&&clearTimeout(i.current)}),[s,e]);const n=a=>{a.preventDefault(),i.current&&clearTimeout(i.current),e(s)},l=a=>{o(a.target.value)};return r.jsx("div",{className:C("relative w-full",t),children:r.jsxs("form",{onSubmit:n,children:[r.jsx("div",{className:"pointer-events-none absolute left-3 top-1/2 z-10 -translate-y-1/2 text-gray-500",children:r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("circle",{cx:"11",cy:"11",r:"8"}),r.jsx("path",{d:"m21 21-4.3-4.3"})]})}),r.jsx(Le,{type:"text",placeholder:"Search courses...",value:s,onChange:l,className:"w-full rounded-md border-gray-200 bg-white py-2 pl-8 text-gray-900 focus:border-blue-600 focus:ring-2 focus:ring-blue-600 md:pl-9"})]})})}function Ht({courses:e=[],categories:t=Object.values(S),initialActiveCategory:s=S.AllCourses,onViewCourse:o,isLoading:i=!0,className:n,title:l="Academy"}){const[a,u]=b.useState(s),[d,p]=b.useState(""),x=b.useMemo(()=>e.length,[e]),h=b.useMemo(()=>{let c=e;if(a!==S.AllCourses&&(c=c.filter(f=>f.category===a)),d.trim()){const f=d.toLowerCase();c=c.filter(y=>{var g;return y.title.toLowerCase().includes(f)||((g=y.description)==null?void 0:g.toLowerCase().includes(f))})}return c},[e,d,a]),j=b.useCallback(c=>{u(c)},[]),k=b.useCallback(c=>{p(c)},[]);return r.jsx("div",{className:C("min-h-screen w-full bg-white text-gray-900",n),children:r.jsxs("div",{className:"container mx-auto px-4 py-8",children:[r.jsx("h1",{className:"mb-6 text-4xl font-bold text-gray-900",children:l}),r.jsx("div",{className:"mb-6",children:r.jsx(Mt,{categories:t,activeCategory:a,courseCount:x,onSelectCategory:j})}),r.jsx("div",{className:"mb-6 flex items-center",children:r.jsx("div",{className:"w-full max-w-md",children:r.jsx(qt,{onSearch:k})})}),i?r.jsx(Tt,{}):r.jsxs(r.Fragment,{children:[r.jsxs("h2",{className:"mb-4 text-lg font-medium text-gray-800",children:[a===S.AllCourses?"All Courses":t.find(c=>c===a)||"Courses","(",h.length," ",h.length===1?"course":"courses",")"]}),r.jsx($t,{courses:h,onViewCourse:o})]})]})})}function Qt({onBack:e,label:t="Back to Courses"}){return r.jsxs(q,{onClick:e,variant:"ghost",className:"gap-1 p-0 px-3 py-1 text-gray-600 hover:text-gray-900",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"})}),r.jsx("span",{children:t})]})}const Vt=je.Root,Xt=je.CollapsibleContent;function te({title:e,children:t,defaultOpen:s=!1,className:o,onOpenChange:i}){const[n,l]=b.useState(s),a=u=>{l(u),i==null||i(u)};return r.jsx(L,{className:o,children:r.jsxs(Vt,{open:n,onOpenChange:a,children:[r.jsx("div",{className:"cursor-pointer",onClick:()=>a(!n),children:r.jsx(W,{className:"pb-2",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(F,{className:"text-xl",children:e}),r.jsx("div",{className:"pointer-events-none",children:n?r.jsx(Wt,{className:"h-5 w-5"}):r.jsx(Bt,{className:"h-5 w-5"})})]})})}),r.jsx(Xt,{children:r.jsx(P,{children:t})})]})})}function Jt({title:e,children:t,className:s}){return r.jsxs(L,{className:s,children:[r.jsx(W,{className:"pb-2",children:r.jsx(F,{className:"text-xl",children:e})}),r.jsx(P,{children:t})]})}function ye({chapters:e=[]}){return r.jsx("div",{className:"space-y-4",children:e==null?void 0:e.map(t=>r.jsx(L,{children:r.jsxs(P,{className:"p-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h3",{className:"font-medium",children:t.title}),r.jsxs("span",{className:"text-sm text-gray-500",children:[Math.floor(t.timestamp/60),":",(t.timestamp%60).toString().padStart(2,"0")]})]}),t.keywords&&r.jsx("div",{className:"mt-2",children:t.keywords.map(s=>r.jsx("span",{className:"mr-2 inline-block rounded-full bg-gray-100 px-3 py-1 text-xs",children:s},s))})]})},t.id))})}function Pe({chapters:e,collapsible:t=!1,defaultOpen:s,onOpenChange:o}){return t?r.jsx(te,{title:"Course Chapters",defaultOpen:s,onOpenChange:o,children:r.jsx(ye,{chapters:e})}):r.jsx(Jt,{title:"Course Chapters",children:r.jsx(ye,{chapters:e})})}function $({icon:e,title:t,className:s}){return r.jsxs("div",{className:C("flex items-center gap-2",s),children:[e,r.jsx("h3",{className:"text-sm font-medium text-gray-500",children:t})]})}function Kt(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-500",...e,children:[r.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),r.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),r.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),r.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}function Yt(e){return r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-500",...e,children:r.jsx("path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z"})})}function er(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-500",...e,children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("polyline",{points:"12 6 12 12 16 14"})]})}function tr(e){return r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-500","data-testid":"tag-icon",...e,children:[r.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),r.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]})}function _e({course:e}){return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx($,{icon:r.jsx(Yt,{}),title:"Category"}),r.jsx("p",{children:e.category})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx($,{icon:r.jsx(er,{}),title:"Duration"}),r.jsxs("p",{children:[e.duration," minutes"]})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx($,{icon:r.jsx(Kt,{}),title:"Created"}),r.jsx("p",{children:new Date(e.createdAt).toLocaleDateString()})]}),r.jsxs("div",{children:[r.jsx($,{icon:r.jsx(tr,{}),title:"Tags"}),r.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.tags.map(t=>r.jsx("span",{className:"inline-flex rounded-full bg-gray-100 px-3 py-1 text-xs",children:t},t))})]})]})}function Ee({courseFiles:e=[]}){return r.jsx("ul",{className:"max-h-[230px] space-y-3 overflow-y-auto pr-1",children:e==null?void 0:e.map(t=>r.jsxs("li",{className:"flex items-center",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"})}),r.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 overflow-hidden text-blue-600 hover:underline",children:t.name})]},t.id))})}function Oe({videoUrl:e,title:t}){return r.jsx("div",{className:"overflow-hidden rounded-lg bg-gray-100",children:e?r.jsx("div",{className:"relative pb-[56.25%]",children:r.jsx("iframe",{className:"absolute left-0 top-0 h-full w-full",src:e.replace("watch?v=","embed/"),title:t,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}):r.jsx("div",{className:"flex h-96 items-center justify-center",children:r.jsx("p",{className:"text-gray-500",children:"Video not available"})})})}function rr({course:e}){var t;return r.jsxs("div",{className:"hidden grid-cols-1 gap-8 lg:grid lg:grid-cols-3",children:[r.jsxs("div",{className:"col-span-2",children:[r.jsx(Oe,{videoUrl:e.videoUrl,title:e.title}),r.jsxs("div",{className:"mt-8",children:[r.jsx("h2",{className:"mb-2 text-2xl font-semibold",children:"About this course"}),r.jsx("p",{className:"text-gray-700",children:e.description})]}),((t=e.aiGenerated)==null?void 0:t.chapters)&&r.jsx("div",{className:"mt-8",children:r.jsx(Pe,{chapters:e.aiGenerated.chapters})})]}),r.jsxs("div",{children:[r.jsxs(L,{children:[r.jsx(W,{className:"pb-2",children:r.jsx(F,{className:"text-xl",children:"Course Details"})}),r.jsx(P,{children:r.jsx(_e,{course:e})})]}),e.courseFiles&&e.courseFiles.length>0&&r.jsxs(L,{className:"mt-6",children:[r.jsx(W,{className:"pb-2",children:r.jsx(F,{className:"text-xl",children:"Course Files"})}),r.jsx(P,{children:r.jsx(Ee,{courseFiles:e.courseFiles})})]})]})]})}function sr({course:e,chaptersOpen:t,detailsOpen:s,filesOpen:o,setChaptersOpen:i,setDetailsOpen:n,setFilesOpen:l}){var a;return r.jsx("div",{className:"lg:hidden",children:r.jsxs("div",{className:"mb-8",children:[r.jsx(Oe,{videoUrl:e.videoUrl,title:e.title}),r.jsxs("div",{className:"mt-8",children:[r.jsx("h2",{className:"mb-2 text-2xl font-semibold",children:"About this course"}),r.jsx("p",{className:"text-gray-700",children:e.description})]}),((a=e.aiGenerated)==null?void 0:a.chapters)&&r.jsx("div",{className:"mt-8",children:r.jsx(Pe,{chapters:e.aiGenerated.chapters,collapsible:!0,defaultOpen:t,onOpenChange:i})}),r.jsx("div",{className:"mt-8",children:r.jsx(te,{title:"Course Details",defaultOpen:s,onOpenChange:n,children:r.jsx(_e,{course:e})})}),e.courseFiles&&e.courseFiles.length>0&&r.jsx("div",{className:"mt-8",children:r.jsx(te,{title:"Course Files",defaultOpen:o,onOpenChange:l,children:r.jsx(Ee,{courseFiles:e.courseFiles})})})]})})}function or({course:e,onBack:t,className:s}){const[o,i]=b.useState(!1),[n,l]=b.useState(!1),[a,u]=b.useState(!1);return e?r.jsx("div",{className:C("min-h-screen w-full bg-white text-gray-900",s),children:r.jsxs("div",{className:"container mx-auto px-4 py-8",children:[r.jsxs("div",{className:"mb-6 flex flex-col items-start gap-4",children:[r.jsx(Qt,{onBack:t}),r.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:e.title})]}),r.jsx(sr,{course:e,chaptersOpen:o,detailsOpen:n,filesOpen:a,setChaptersOpen:i,setDetailsOpen:l,setFilesOpen:u}),r.jsx(rr,{course:e})]})}):r.jsx("div",{className:"flex h-64 w-full items-center justify-center",children:r.jsx("p",{className:"text-lg text-gray-500",children:"No course selected"})})}function nr({className:e,courses:t}){const[s,o]=b.useState(!1),[i,n]=Ge.useQueryState("route",{history:"replace"}),l=ge(h=>h.courses),a=ge(h=>h.setInitialCourses);b.useEffect(()=>{t!=null&&t.length&&!s&&(a(t),o(!0))},[t,a,l,s]);const u=b.useCallback(h=>{n(`${pe.courseView}/${h}`)},[n]),d=b.useCallback(()=>{n(null)},[n]),p=b.useMemo(()=>i&&i.startsWith(`${pe.courseView}/`)?i.split("/").pop():null,[i]),x=b.useMemo(()=>p?l.find(h=>h.id===p):void 0,[p,l]);return r.jsx(Be.NuqsAdapter,{children:p?r.jsx(or,{course:x,onBack:d,className:e}):r.jsx(Ht,{courses:l,onViewCourse:u,isLoading:!1,className:e})})}const ir=[{id:"course-1",title:"Effective Communication Techniques",description:"Learn how to conduct effective professional conversations that identify the best outcomes for your team. This course covers structured communication, behavioral questions, and feedback techniques.",category:S.ProfessionalDevelopment,tags:["communication","feedback","conversation techniques"],thumbnail:"https://images.unsplash.com/photo-1516321318423-f06f85e504b3?w=800&auto=format&fit=crop",videoUrl:"https://www.youtube.com/watch?v=dQw4w9WgXcQ",duration:45,createdAt:"2023-10-15T08:00:00Z",isActive:!0,creatorId:"other-user-1",courseFiles:[{id:"file-1",name:"Communication Techniques Guide",url:"https://example.com/files/communication_guide.pdf",size:2456789,type:"application/pdf",uploadedAt:"2023-10-15T10:00:00Z",courseId:"course-1"},{id:"file-2",name:"Feedback Templates",url:"https://example.com/files/feedback_templates.docx",size:1234567,type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",uploadedAt:"2023-10-16T08:30:00Z",courseId:"course-1"}],aiGenerated:{chapters:[{id:"ch1",title:"Introduction to Effective Communication",timestamp:0,keywords:["intro","overview"],courseId:"course-1"},{id:"ch2",title:"Structured Communication Process",timestamp:300,keywords:["structure","process"],courseId:"course-1"},{id:"ch3",title:"Behavioral Questions",timestamp:900,keywords:["behavioral","questions"],courseId:"course-1"},{id:"ch4",title:"Technical Conversations",timestamp:1500,keywords:["technical","skills"],courseId:"course-1"},{id:"ch5",title:"Evaluating Feedback",timestamp:2100,keywords:["evaluation","feedback"],courseId:"course-1"}],transcript:"This is the transcript of the video content...",suggestedTopics:["Communication Bias","Remote Communication","Team Discussions"]}},{id:"course-2",title:"Building High-Performance Teams",description:"Discover strategies for building and managing high-performance teams. This course explores team dynamics, motivation, conflict resolution, and performance management.",category:S.Management,tags:["teams","leadership","management"],thumbnail:"https://images.unsplash.com/photo-1519389950473-47ba0277781c?w=800&auto=format&fit=crop",videoUrl:"https://www.youtube.com/watch?v=dQw4w9WgXcQ",duration:60,createdAt:"2023-11-05T10:30:00Z",isActive:!0,creatorId:"current-user-1",courseFiles:[{id:"file-3",name:"Team Building Exercises",url:"https://example.com/files/team_exercises.p