@kanorio/elements 1.3.0 → 1.4.0

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.
Files changed (54) hide show
  1. package/dist/{KanorioAccount-GXRAMZCI.js → KanorioAccount-BGIMYMGL.js} +2 -2
  2. package/dist/{KanorioAccount-P6IIPIZ2.js → KanorioAccount-E3NDKUX5.js} +2 -2
  3. package/dist/{KanorioAnalytics-XHKBWYTS.js → KanorioAnalytics-CNEIZ4VZ.js} +2 -2
  4. package/dist/{KanorioAnalytics-KYTK3T2L.js → KanorioAnalytics-RTCJ62AP.js} +2 -2
  5. package/dist/KanorioCurriculum-CDHXCPSI.js +2 -0
  6. package/dist/{KanorioCurriculum-SQ4S3U5T.js → KanorioCurriculum-JIKUHPOJ.js} +2 -2
  7. package/dist/{KanorioForm-FDS5UKUT.js → KanorioForm-QU243SAP.js} +2 -2
  8. package/dist/{KanorioForm-K3H3YUQH.js → KanorioForm-W6XBJW74.js} +2 -2
  9. package/dist/{KanorioLightbox-QPJQJLNO.js → KanorioLightbox-2YTEYM57.js} +2 -2
  10. package/dist/{KanorioLightbox-WBMR7MLG.js → KanorioLightbox-WCQ4NW5Z.js} +2 -2
  11. package/dist/{KanorioLogin-QMPBTK55.js → KanorioLogin-CDSAAJJE.js} +2 -2
  12. package/dist/{KanorioLogin-JMHHBRU7.js → KanorioLogin-OYIESFJL.js} +2 -2
  13. package/dist/{KanorioMedia-5P63OK4U.js → KanorioMedia-BEFSUKSN.js} +2 -2
  14. package/dist/KanorioMedia-ZGHENDE3.js +2 -0
  15. package/dist/KanorioReviews-O67GJZ24.js +2 -0
  16. package/dist/{KanorioReviews-AAQ27MYU.js → KanorioReviews-V5RUA2TV.js} +2 -2
  17. package/dist/KanorioUnit-2FXOUNOP.js +2 -0
  18. package/dist/{KanorioUnit-YBKFHGLB.js → KanorioUnit-AIM4O7QI.js} +2 -2
  19. package/dist/account.js +1 -1
  20. package/dist/analytics.js +1 -1
  21. package/dist/bot-protection.js +1 -1
  22. package/dist/{chunk-RI64PHGM.js → chunk-73S6VKNV.js} +2 -2
  23. package/dist/{chunk-QRKYFFDH.js → chunk-7UCZ56EJ.js} +2 -2
  24. package/dist/{chunk-HAHAYDYM.js → chunk-A4ZGBTRT.js} +2 -2
  25. package/dist/{chunk-GWUOOGNK.js → chunk-DIHLDYIG.js} +2 -2
  26. package/dist/{chunk-RTF2NUMK.js → chunk-EGMCB2MQ.js} +2 -2
  27. package/dist/{chunk-WKKPZXK3.js → chunk-FFSPNYLJ.js} +2 -2
  28. package/dist/{chunk-G5673RJK.js → chunk-FXDWRWZ3.js} +2 -2
  29. package/dist/{chunk-IDY2ZCXL.js → chunk-I6KLZIN6.js} +2 -2
  30. package/dist/{chunk-SB5665ZK.js → chunk-J24HGQ7U.js} +2 -2
  31. package/dist/{chunk-CIVS7LYU.js → chunk-JYBSXLT3.js} +2 -2
  32. package/dist/{chunk-EGJ6SNTR.js → chunk-N4Y3DCC6.js} +2 -2
  33. package/dist/{chunk-SGFVHVLE.js → chunk-OSXFUIAV.js} +2 -2
  34. package/dist/{chunk-R5M6FXXQ.js → chunk-UWRJBUJY.js} +2 -2
  35. package/dist/{chunk-CD7JDUB6.js → chunk-VRD67HVO.js} +2 -2
  36. package/dist/{chunk-J5SMJRYC.js → chunk-VT2B53EX.js} +2 -2
  37. package/dist/{chunk-OWXGUUSI.js → chunk-W5QS3RHM.js} +2 -2
  38. package/dist/{chunk-CMYBXWO5.js → chunk-XJPS3G7J.js} +2 -2
  39. package/dist/curriculum.js +1 -1
  40. package/dist/form.js +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/kanorio-elements.js +1 -1
  43. package/dist/lightbox.js +1 -1
  44. package/dist/login.js +1 -1
  45. package/dist/media.js +1 -1
  46. package/dist/provider.js +1 -1
  47. package/dist/reviews.js +1 -1
  48. package/dist/unit.js +1 -1
  49. package/dist/web-components.js +1 -1
  50. package/package.json +2 -2
  51. package/dist/KanorioCurriculum-3TLNLUL4.js +0 -2
  52. package/dist/KanorioMedia-LONTU7H2.js +0 -2
  53. package/dist/KanorioReviews-LUB4KF23.js +0 -2
  54. package/dist/KanorioUnit-ADFQ7POH.js +0 -2
@@ -1,2 +1,2 @@
1
- import{LazyMediaPlayer}from"./chunk-UITC3NFQ.js";import{ElementsRoot}from"./chunk-QRKYFFDH.js";import{useKanorio}from"./chunk-RI64PHGM.js";import{jsx}from"react/jsx-runtime";function KanorioMedia({locale,theme,siteUrl,brand,...props}){const ctx=useKanorio({locale,theme,siteUrl,brand});if(!ctx.messages)return jsx(ElementsRoot,{context:ctx,className:"aspect-video w-full animate-pulse rounded-(--media-radius,12px) bg-(--media-surface)",loading:true});return jsx(ElementsRoot,{context:ctx,children:jsx(LazyMediaPlayer,{...props})})}export{KanorioMedia};
2
- //# sourceMappingURL=chunk-EGJ6SNTR.js.map
1
+ import{LazyMediaPlayer}from"./chunk-UITC3NFQ.js";import{ElementsRoot}from"./chunk-7UCZ56EJ.js";import{useKanorio}from"./chunk-73S6VKNV.js";import{jsx}from"react/jsx-runtime";function KanorioMedia({locale,theme,siteUrl,brand,...props}){const ctx=useKanorio({locale,theme,siteUrl,brand});if(!ctx.messages)return jsx(ElementsRoot,{context:ctx,className:"aspect-video w-full animate-pulse rounded-(--media-radius,12px) bg-(--media-surface)",loading:true});return jsx(ElementsRoot,{context:ctx,children:jsx(LazyMediaPlayer,{...props})})}export{KanorioMedia};
2
+ //# sourceMappingURL=chunk-N4Y3DCC6.js.map
@@ -1,2 +1,2 @@
1
- import{KanorioAccount}from"./chunk-G5673RJK.js";import{customerAuthErrorMessage}from"./chunk-4OC7BRQS.js";import{jsx}from"react/jsx-runtime";function mapLoginErrorCode(code,messages){return customerAuthErrorMessage(code,messages)}function KanorioLogin(props){return jsx(KanorioAccount,{...props})}export{mapLoginErrorCode,KanorioLogin};
2
- //# sourceMappingURL=chunk-SGFVHVLE.js.map
1
+ import{KanorioAccount}from"./chunk-FXDWRWZ3.js";import{customerAuthErrorMessage}from"./chunk-4OC7BRQS.js";import{jsx}from"react/jsx-runtime";function mapLoginErrorCode(code,messages){return customerAuthErrorMessage(code,messages)}function KanorioLogin(props){return jsx(KanorioAccount,{...props})}export{mapLoginErrorCode,KanorioLogin};
2
+ //# sourceMappingURL=chunk-OSXFUIAV.js.map
@@ -1,2 +1,2 @@
1
- import{createCustomerClient,writeStoredCustomerToken}from"./chunk-RI64PHGM.js";var PKCE_STORAGE_KEY="kanorio.customer.pkce";function toGrant(wire){return{accessToken:wire.access_token,tokenType:wire.token_type,expiresIn:wire.expires_in,expiresAt:wire.expires_at,refreshToken:wire.refresh_token,refreshTokenExpiresIn:wire.refresh_token_expires_in,contactId:wire.contactId}}function base64url(bytes){let binary="";for(const byte of bytes)binary+=String.fromCharCode(byte);return btoa(binary).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function randomString(bytes=32){const buffer=new Uint8Array(bytes);crypto.getRandomValues(buffer);return base64url(buffer)}async function createPkcePair(){const verifier=randomString(32);const digest=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(verifier));return{verifier,challenge:base64url(new Uint8Array(digest)),method:"S256"}}function buildHostedLoginUrl(params){const base=params.siteUrl.replace(/\/+$/,"");const url=new URL(`${base}${params.localeRoot??""}/account/login`);url.searchParams.set("client_id",params.clientId);url.searchParams.set("redirect_uri",params.redirectUri);url.searchParams.set("code_challenge",params.codeChallenge);url.searchParams.set("code_challenge_method","S256");url.searchParams.set("state",params.state);return url.toString()}function currentRedirectUri(){const url=new URL(window.location.href);url.searchParams.delete("code");url.searchParams.delete("state");url.hash="";return url.toString()}async function startHostedCustomerLogin(options){const storage=options.storage??sessionStorage;const redirectUri=options.redirectUri??currentRedirectUri();const pkce=await createPkcePair();const state=randomString(16);storage.setItem(PKCE_STORAGE_KEY,JSON.stringify({verifier:pkce.verifier,state,redirectUri}));const url=buildHostedLoginUrl({siteUrl:options.siteUrl,clientId:options.clientId,redirectUri,codeChallenge:pkce.challenge,state,localeRoot:options.localeRoot});(options.navigate??(target=>window.location.assign(target)))(url)}async function completeHostedCustomerLogin(options){const url=new URL(window.location.href);const code=url.searchParams.get("code");const state=url.searchParams.get("state");if(!code)return null;const storage=options.storage??sessionStorage;const raw=storage.getItem(PKCE_STORAGE_KEY);storage.removeItem(PKCE_STORAGE_KEY);const saved=raw?JSON.parse(raw):null;if(!saved||saved.state!==state)throw new Error("Hosted sign-in state mismatch; start the sign-in again.");if(options.cleanUrl!==false){url.searchParams.delete("code");url.searchParams.delete("state");window.history.replaceState(window.history.state,"",url.toString())}const grant=await exchangeHostedLoginCode({siteUrl:options.siteUrl,clientId:options.clientId,code,codeVerifier:saved.verifier,redirectUri:saved.redirectUri});if(options.storeToken!==false)writeStoredCustomerToken(grant.accessToken);return grant}async function exchangeHostedLoginCode(params){const client=createCustomerClient({siteUrl:params.siteUrl,serverKey:params.serverKey,visitorIp:params.visitorIp});const wire=await client.post("/auth/oauth2/token",{body:{grant_type:"authorization_code",code:params.code,code_verifier:params.codeVerifier,redirect_uri:params.redirectUri,client_id:params.clientId}});return toGrant(wire)}export{startHostedCustomerLogin,completeHostedCustomerLogin};
2
- //# sourceMappingURL=chunk-R5M6FXXQ.js.map
1
+ import{createCustomerClient,writeStoredCustomerToken}from"./chunk-73S6VKNV.js";var PKCE_STORAGE_KEY="kanorio.customer.pkce";function toGrant(wire){return{accessToken:wire.access_token,tokenType:wire.token_type,expiresIn:wire.expires_in,expiresAt:wire.expires_at,refreshToken:wire.refresh_token,refreshTokenExpiresIn:wire.refresh_token_expires_in,contactId:wire.contactId}}function base64url(bytes){let binary="";for(const byte of bytes)binary+=String.fromCharCode(byte);return btoa(binary).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function randomString(bytes=32){const buffer=new Uint8Array(bytes);crypto.getRandomValues(buffer);return base64url(buffer)}async function createPkcePair(){const verifier=randomString(32);const digest=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(verifier));return{verifier,challenge:base64url(new Uint8Array(digest)),method:"S256"}}function buildHostedLoginUrl(params){const base=params.siteUrl.replace(/\/+$/,"");const url=new URL(`${base}${params.localeRoot??""}/account/login`);url.searchParams.set("client_id",params.clientId);url.searchParams.set("redirect_uri",params.redirectUri);url.searchParams.set("code_challenge",params.codeChallenge);url.searchParams.set("code_challenge_method","S256");url.searchParams.set("state",params.state);return url.toString()}function currentRedirectUri(){const url=new URL(window.location.href);url.searchParams.delete("code");url.searchParams.delete("state");url.hash="";return url.toString()}async function startHostedCustomerLogin(options){const storage=options.storage??sessionStorage;const redirectUri=options.redirectUri??currentRedirectUri();const pkce=await createPkcePair();const state=randomString(16);storage.setItem(PKCE_STORAGE_KEY,JSON.stringify({verifier:pkce.verifier,state,redirectUri}));const url=buildHostedLoginUrl({siteUrl:options.siteUrl,clientId:options.clientId,redirectUri,codeChallenge:pkce.challenge,state,localeRoot:options.localeRoot});(options.navigate??(target=>window.location.assign(target)))(url)}async function completeHostedCustomerLogin(options){const url=new URL(window.location.href);const code=url.searchParams.get("code");const state=url.searchParams.get("state");if(!code)return null;const storage=options.storage??sessionStorage;const raw=storage.getItem(PKCE_STORAGE_KEY);storage.removeItem(PKCE_STORAGE_KEY);const saved=raw?JSON.parse(raw):null;if(!saved||saved.state!==state)throw new Error("Hosted sign-in state mismatch; start the sign-in again.");if(options.cleanUrl!==false){url.searchParams.delete("code");url.searchParams.delete("state");window.history.replaceState(window.history.state,"",url.toString())}const grant=await exchangeHostedLoginCode({siteUrl:options.siteUrl,clientId:options.clientId,code,codeVerifier:saved.verifier,redirectUri:saved.redirectUri});if(options.storeToken!==false)writeStoredCustomerToken(grant.accessToken);return grant}async function exchangeHostedLoginCode(params){const client=createCustomerClient({siteUrl:params.siteUrl,serverKey:params.serverKey,visitorIp:params.visitorIp});const wire=await client.post("/auth/oauth2/token",{body:{grant_type:"authorization_code",code:params.code,code_verifier:params.codeVerifier,redirect_uri:params.redirectUri,client_id:params.clientId}});return toGrant(wire)}export{startHostedCustomerLogin,completeHostedCustomerLogin};
2
+ //# sourceMappingURL=chunk-UWRJBUJY.js.map
@@ -1,2 +1,2 @@
1
- import{AuthorList}from"./chunk-5G3PQI25.js";import{LazyMediaPlayer}from"./chunk-UITC3NFQ.js";import{formatDuration}from"./chunk-4BEKWYEW.js";import{ChevronDown,Download,FileText,Headphones,Lock,Play}from"./chunk-33AQQY6T.js";import{ElementsRoot}from"./chunk-QRKYFFDH.js";import{fillLabel}from"./chunk-KNNN5V3T.js";import{createDeliveryClient,useKanorio}from"./chunk-RI64PHGM.js";import{useEffect,useState}from"react";import{jsx,jsxs}from"react/jsx-runtime";function kindIcon(kind){if(kind==="video")return Play;if(kind==="audio")return Headphones;if(kind==="text"||kind==="pdf")return FileText;return Download}function KanorioCurriculum({product,deliverable,outline:given,expandAll=true,className,...config}){const ctx=useKanorio(config);const[outline,setOutline]=useState(given??null);const[failed,setFailed]=useState(false);const[preview,setPreview]=useState(null);const[collapsed,setCollapsed]=useState(new Set);useEffect(()=>{if(given){setOutline(given);return}let cancelled=false;const client=createDeliveryClient({siteUrl:ctx.siteUrl});const load=locale=>client.get("/products/{slug}",{params:{slug:product},query:locale?{locale}:{}});load(ctx.locale).catch(error=>{if(error.code==="UNSUPPORTED_LOCALE")return load();throw error}).then(res=>{if(!cancelled)setOutline(res.product.deliverables??[])}).catch(()=>{if(!cancelled)setFailed(true)});return()=>{cancelled=true}},[ctx.siteUrl,ctx.locale,product,given]);const openPreview=async unitId=>{const res=await ctx.client.openUnit(unitId,"read");if(res.ok)setPreview({unitId,url:res.url,mimeType:res.mimeType,title:res.title,hls:res.renditions?.find(r=>r.kind==="hls")?.url,thumbnails:res.thumbnails??res.renditions?.find(r=>r.kind==="thumbnails")?.url,captions:res.renditions?.flatMap(r=>r.kind==="captions"&&r.locale?[{locale:r.locale,url:r.url,source:r.source??"ai",edited:r.edited??false}]:[]),chapters:res.renditions?.find(r=>r.kind==="chapters")?.url,poster:res.poster??void 0,partial:res.streaming==="partial"});else setPreview({unitId,error:res.code})};if(!ctx.messages)return jsx(ElementsRoot,{context:ctx,className,loading:true});const a=ctx.messages.account;if(failed)return jsx(ElementsRoot,{context:ctx,className,children:jsx("p",{role:"alert",className:"text-sm text-(--site-fg-muted,#71717a)",children:a.contentLoadError})});if(!outline)return jsx(ElementsRoot,{context:ctx,className,loading:true,children:jsx("div",{className:"h-40 w-full animate-pulse rounded-(--media-radius,12px) bg-(--media-surface)"})});const shown=deliverable?outline.filter(d=>d.id===deliverable):outline;if(shown.length===0)return jsx(ElementsRoot,{context:ctx,className,children:jsx("p",{className:"text-sm text-(--site-fg-muted,#71717a)",children:a.contentNoUnits})});return jsx(ElementsRoot,{context:ctx,className,children:shown.map(d=>{const chapters=d.units.filter(u=>u.parentId===null&&(u.kind==="chapter"||d.units.some(c=>c.parentId===u.id)));const loose=d.units.filter(u=>u.parentId===null&&!chapters.includes(u));const groups=[...loose.length?[{id:`${d.id}:loose`,title:null,units:loose}]:[],...chapters.map(c=>({id:c.id,title:c.title,units:d.units.filter(u=>u.parentId===c.id).sort((x,y)=>x.order-y.order)}))];return jsxs("section",{className:"space-y-3",children:[jsxs("header",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[jsx("h3",{className:"text-lg font-semibold text-(--site-fg,#18181b)",children:d.title}),jsxs("p",{className:"text-sm text-(--site-fg-muted,#71717a)",children:[fillLabel(a.contentUnitsCount,{count:String(d.unitCount)}),d.totalDurationSeconds?` \xB7 ${formatDuration(d.totalDurationSeconds)}`:""]})]}),d.authors&&d.authors.length>0&&jsx(AuthorList,{authors:d.authors}),jsx("ol",{className:"divide-y divide-(--site-border,rgba(0,0,0,0.1)) overflow-hidden rounded-(--media-radius,12px) border border-(--site-border,rgba(0,0,0,0.1))",children:groups.map((g,gi)=>{const isCollapsed=collapsed.has(g.id)||!expandAll&&gi>0&&!collapsed.has(`open:${g.id}`);return jsxs("li",{children:[g.title!==null&&jsxs("button",{type:"button",onClick:()=>setCollapsed(prev=>{const next=new Set(prev);if(expandAll){if(next.has(g.id))next.delete(g.id);else next.add(g.id)}else if(next.has(`open:${g.id}`))next.delete(`open:${g.id}`);else next.add(`open:${g.id}`);return next}),"aria-expanded":!isCollapsed,className:"flex w-full items-center justify-between gap-3 bg-(--media-surface) px-4 py-3 text-left text-sm font-medium text-(--site-fg,#18181b)",children:[jsx("span",{children:g.title}),jsx(ChevronDown,{className:`h-4 w-4 transition-transform ${isCollapsed?"":"rotate-180"}`,"aria-hidden":"true"})]}),!isCollapsed&&jsx("ul",{children:g.units.map(u=>{const Icon=kindIcon(u.kind);const isOpen=preview&&preview.unitId===u.id;return jsxs("li",{className:"border-t border-(--site-border,rgba(0,0,0,0.06)) first:border-t-0",children:[jsxs("div",{className:"flex items-center gap-3 px-4 py-3 text-sm",children:[jsx(Icon,{className:"h-4 w-4 shrink-0 text-(--site-fg-muted,#71717a)","aria-hidden":"true"}),jsx("span",{className:"min-w-0 flex-1 truncate text-(--site-fg,#18181b)",children:u.title??u.kind}),u.countsTowardCompletion===false?jsx("span",{className:"text-xs text-(--site-fg-muted,#71717a)",children:a.contentOptional}):null,u.duration?jsx("span",{className:"text-xs tabular-nums text-(--site-fg-muted,#71717a)",children:formatDuration(u.duration)}):null,u.pageCount?jsxs("span",{className:"text-xs tabular-nums text-(--site-fg-muted,#71717a)",children:[u.pageCount," p"]}):null,u.isPreview&&!(u.releaseAt&&new Date(u.releaseAt)>new Date)?jsx("button",{type:"button",onClick:()=>isOpen?setPreview(null):openPreview(u.id),className:"rounded-full bg-(--brand-color,#18181b) px-2.5 py-1 text-xs font-medium text-(--brand-foreground,#ffffff)",children:a.contentPreviewBadge}):jsx(Lock,{className:"h-3.5 w-3.5 shrink-0 text-(--site-fg-muted,#71717a)","aria-label":a.contentLocked})]}),isOpen&&preview&&"url"in preview&&jsx("div",{className:"px-4 pb-4",children:jsx(LazyMediaPlayer,{src:preview.url,hlsSrc:preview.hls,thumbnails:preview.thumbnails,captions:preview.captions?.length?preview.captions:void 0,chapters:preview.chapters,streamingPartial:preview.partial,thumbnailUrl:preview.poster,mimeType:preview.mimeType??"video/mp4",title:preview.title??void 0,storageKey:`preview:${u.id}`})}),isOpen&&preview&&"error"in preview&&jsx("p",{role:"alert",className:"px-4 pb-3 text-xs text-(--site-fg-muted,#71717a)",children:a.contentLoadError})]},u.id)})})]},g.id)})})]},d.id)})})}export{KanorioCurriculum};
2
- //# sourceMappingURL=chunk-CD7JDUB6.js.map
1
+ import{AuthorList}from"./chunk-5G3PQI25.js";import{LazyMediaPlayer}from"./chunk-UITC3NFQ.js";import{formatDuration}from"./chunk-4BEKWYEW.js";import{ChevronDown,Download,FileText,Headphones,Lock,Play}from"./chunk-33AQQY6T.js";import{ElementsRoot}from"./chunk-7UCZ56EJ.js";import{fillLabel}from"./chunk-KNNN5V3T.js";import{createDeliveryClient,useKanorio}from"./chunk-73S6VKNV.js";import{useEffect,useState}from"react";import{jsx,jsxs}from"react/jsx-runtime";function kindIcon(kind){if(kind==="video")return Play;if(kind==="audio")return Headphones;if(kind==="text"||kind==="pdf")return FileText;return Download}function KanorioCurriculum({product,deliverable,outline:given,expandAll=true,className,...config}){const ctx=useKanorio(config);const[outline,setOutline]=useState(given??null);const[failed,setFailed]=useState(false);const[preview,setPreview]=useState(null);const[collapsed,setCollapsed]=useState(new Set);useEffect(()=>{if(given){setOutline(given);return}let cancelled=false;const client=createDeliveryClient({siteUrl:ctx.siteUrl});const load=locale=>client.get("/products/{slug}",{params:{slug:product},query:locale?{locale}:{}});load(ctx.locale).catch(error=>{if(error.code==="UNSUPPORTED_LOCALE")return load();throw error}).then(res=>{if(!cancelled)setOutline(res.product.deliverables??[])}).catch(()=>{if(!cancelled)setFailed(true)});return()=>{cancelled=true}},[ctx.siteUrl,ctx.locale,product,given]);const openPreview=async unitId=>{const res=await ctx.client.openUnit(unitId,"read");if(res.ok)setPreview({unitId,url:res.url,mimeType:res.mimeType,title:res.title,hls:res.renditions?.find(r=>r.kind==="hls")?.url,thumbnails:res.thumbnails??res.renditions?.find(r=>r.kind==="thumbnails")?.url,captions:res.renditions?.flatMap(r=>r.kind==="captions"&&r.locale?[{locale:r.locale,url:r.url,source:r.source??"ai",edited:r.edited??false}]:[]),chapters:res.renditions?.find(r=>r.kind==="chapters")?.url,poster:res.poster??void 0,partial:res.streaming==="partial"});else setPreview({unitId,error:res.code})};if(!ctx.messages)return jsx(ElementsRoot,{context:ctx,className,loading:true});const a=ctx.messages.account;if(failed)return jsx(ElementsRoot,{context:ctx,className,children:jsx("p",{role:"alert",className:"text-sm text-(--site-fg-muted,#71717a)",children:a.contentLoadError})});if(!outline)return jsx(ElementsRoot,{context:ctx,className,loading:true,children:jsx("div",{className:"h-40 w-full animate-pulse rounded-(--media-radius,12px) bg-(--media-surface)"})});const shown=deliverable?outline.filter(d=>d.id===deliverable):outline;if(shown.length===0)return jsx(ElementsRoot,{context:ctx,className,children:jsx("p",{className:"text-sm text-(--site-fg-muted,#71717a)",children:a.contentNoUnits})});return jsx(ElementsRoot,{context:ctx,className,children:shown.map(d=>{const chapters=d.units.filter(u=>u.parentId===null&&(u.kind==="chapter"||d.units.some(c=>c.parentId===u.id)));const loose=d.units.filter(u=>u.parentId===null&&!chapters.includes(u));const groups=[...loose.length?[{id:`${d.id}:loose`,title:null,units:loose}]:[],...chapters.map(c=>({id:c.id,title:c.title,units:d.units.filter(u=>u.parentId===c.id).sort((x,y)=>x.order-y.order)}))];return jsxs("section",{className:"space-y-3",children:[jsxs("header",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[jsx("h3",{className:"text-lg font-semibold text-(--site-fg,#18181b)",children:d.title}),jsxs("p",{className:"text-sm text-(--site-fg-muted,#71717a)",children:[fillLabel(a.contentUnitsCount,{count:String(d.unitCount)}),d.totalDurationSeconds?` \xB7 ${formatDuration(d.totalDurationSeconds)}`:""]})]}),d.authors&&d.authors.length>0&&jsx(AuthorList,{authors:d.authors}),jsx("ol",{className:"divide-y divide-(--site-border,rgba(0,0,0,0.1)) overflow-hidden rounded-(--media-radius,12px) border border-(--site-border,rgba(0,0,0,0.1))",children:groups.map((g,gi)=>{const isCollapsed=collapsed.has(g.id)||!expandAll&&gi>0&&!collapsed.has(`open:${g.id}`);return jsxs("li",{children:[g.title!==null&&jsxs("button",{type:"button",onClick:()=>setCollapsed(prev=>{const next=new Set(prev);if(expandAll){if(next.has(g.id))next.delete(g.id);else next.add(g.id)}else if(next.has(`open:${g.id}`))next.delete(`open:${g.id}`);else next.add(`open:${g.id}`);return next}),"aria-expanded":!isCollapsed,className:"flex w-full items-center justify-between gap-3 bg-(--media-surface) px-4 py-3 text-left text-sm font-medium text-(--site-fg,#18181b)",children:[jsx("span",{children:g.title}),jsx(ChevronDown,{className:`h-4 w-4 transition-transform ${isCollapsed?"":"rotate-180"}`,"aria-hidden":"true"})]}),!isCollapsed&&jsx("ul",{children:g.units.map(u=>{const Icon=kindIcon(u.kind);const isOpen=preview&&preview.unitId===u.id;return jsxs("li",{className:"border-t border-(--site-border,rgba(0,0,0,0.06)) first:border-t-0",children:[jsxs("div",{className:"flex items-center gap-3 px-4 py-3 text-sm",children:[jsx(Icon,{className:"h-4 w-4 shrink-0 text-(--site-fg-muted,#71717a)","aria-hidden":"true"}),jsx("span",{className:"min-w-0 flex-1 truncate text-(--site-fg,#18181b)",children:u.title??u.kind}),u.countsTowardCompletion===false?jsx("span",{className:"text-xs text-(--site-fg-muted,#71717a)",children:a.contentOptional}):null,u.duration?jsx("span",{className:"text-xs tabular-nums text-(--site-fg-muted,#71717a)",children:formatDuration(u.duration)}):null,u.pageCount?jsxs("span",{className:"text-xs tabular-nums text-(--site-fg-muted,#71717a)",children:[u.pageCount," p"]}):null,u.isPreview&&!(u.releaseAt&&new Date(u.releaseAt)>new Date)?jsx("button",{type:"button",onClick:()=>isOpen?setPreview(null):openPreview(u.id),className:"rounded-full bg-(--brand-color,#18181b) px-2.5 py-1 text-xs font-medium text-(--brand-foreground,#ffffff)",children:a.contentPreviewBadge}):jsx(Lock,{className:"h-3.5 w-3.5 shrink-0 text-(--site-fg-muted,#71717a)","aria-label":a.contentLocked})]}),isOpen&&preview&&"url"in preview&&jsx("div",{className:"px-4 pb-4",children:jsx(LazyMediaPlayer,{src:preview.url,hlsSrc:preview.hls,thumbnails:preview.thumbnails,captions:preview.captions?.length?preview.captions:void 0,chapters:preview.chapters,streamingPartial:preview.partial,thumbnailUrl:preview.poster,mimeType:preview.mimeType??"video/mp4",title:preview.title??void 0,storageKey:`preview:${u.id}`})}),isOpen&&preview&&"error"in preview&&jsx("p",{role:"alert",className:"px-4 pb-3 text-xs text-(--site-fg-muted,#71717a)",children:a.contentLoadError})]},u.id)})})]},g.id)})})]},d.id)})})}export{KanorioCurriculum};
2
+ //# sourceMappingURL=chunk-VRD67HVO.js.map
@@ -1,2 +1,2 @@
1
- import{BotProtectionAltcha,BotProtectionFields,ThirdPartyCaptcha,parsePublicBotProtectionConfig,preloadAltchaWidget,useBotProtection,useBotProtectionConfig}from"./chunk-KYXZNMNA.js";import{useIsInsideElementsRoot}from"./chunk-QRKYFFDH.js";import{PartScopeProvider}from"./chunk-763LNERD.js";import{useOptionalSiteLabels}from"./chunk-U7H3W23Q.js";import{ELEMENTS_PART_CLASS,markScope,optionalSiteUrl,resolveLocale,resolveVisitorLocale,useBrandStyle,useElementsMessages,useKanorioProviderConfig,useKanorioSiteUrl,useSiteMeta}from"./chunk-RI64PHGM.js";import{useEffect,useMemo as useMemo2}from"react";import{createContext,useContext,useMemo}from"react";import{jsx}from"react/jsx-runtime";var BotProtectionContext=createContext(null);import{Fragment,jsx as jsx2,jsxs}from"react/jsx-runtime";function useKanorioBotProtection(options={}){const siteUrl=useKanorioSiteUrl(options.siteUrl);const entry=options.entry??"forms";const contextConfig=useBotProtectionConfig();const givenConfig=options.config!==void 0?options.config:contextConfig;const readsSite=givenConfig===null&&options.config===void 0;const{site,error:siteError}=useSiteMeta(siteUrl,readsSite);const siteConfig=useMemo2(()=>site?parsePublicBotProtectionConfig(site.botProtection):null,[site]);const pending=readsSite&&siteConfig===null&&!siteError;const raw=useBotProtection({...options,entry,config:readsSite?siteConfig:givenConfig,variant:options.variant??"full",challengeUrl:`${siteUrl}/api/form-protection/challenge`,altchaChallengeUrl:`${siteUrl}/api/form-protection/altcha`});const captcha=raw.challengeProps.captcha;const fieldProps=useMemo2(()=>({...raw.fieldProps,captcha,pending}),[raw.fieldProps,captcha,pending]);return{...raw,isReady:raw.isReady&&!pending,isSubmittable:raw.isSubmittable&&!pending,fieldProps}}var ENGLISH_ALTCHA_LABELS={botProtection:"Human verification",botProtectionLoading:"Loading human verification"};function useBotProtectionPart(theme,localeProp,wantsAltcha){const parent=useKanorioProviderConfig();const insideRoot=useIsInsideElementsRoot();const locale=resolveLocale(localeProp??parent?.locale);const hostTheme=theme??(parent?.theme==="light"||parent?.theme==="dark"?parent.theme:null);const resolvedTheme=insideRoot?null:hostTheme;const brandSiteUrl=wantsAltcha&&!insideRoot&&parent!==null&&parent.brand!==false?optionalSiteUrl(parent.siteUrl):null;const{site}=useSiteMeta(brandSiteUrl??"",brandSiteUrl!==null);const brandScope=useBrandStyle(site,locale,brandSiteUrl!==null);const scope=useMemo2(()=>insideRoot?null:{className:ELEMENTS_PART_CLASS,mark:element=>markScope(element,resolvedTheme,brandScope)},[insideRoot,resolvedTheme,brandScope]);const rootLabels=useOptionalSiteLabels();const english=resolveVisitorLocale(locale).startsWith("en");const{messages}=useElementsMessages(locale,wantsAltcha&&rootLabels===null&&!english);const labels=useMemo2(()=>{if(rootLabels)return void 0;if(!messages||english)return ENGLISH_ALTCHA_LABELS;return{botProtection:messages.ui.botProtection,botProtectionLoading:messages.ui.botProtectionLoading}},[rootLabels,messages,english]);useEffect(()=>{if(wantsAltcha)preloadAltchaWidget(locale)},[wantsAltcha,locale]);return{scope,labels,locale,theme:resolvedTheme}}function KanorioBotProtection({theme,captcha,pending,...props}){return jsxs(Fragment,{children:[props.renderAltcha===false?null:jsx2(KanorioBotProtectionAltcha,{theme,captcha,pending,...props}),jsx2(BotProtectionFields,{...props,renderAltcha:false})]})}function KanorioBotProtectionAltcha({theme,captcha,pending,...props}){const part=useBotProtectionPart(theme,props.locale,props.variant==="full"&&!captcha&&!pending);const{scope,labels,locale}=part;if(pending)return null;if(captcha){return jsx2(PartScopeProvider,{value:scope,children:jsx2(ThirdPartyCaptcha,{provider:captcha.provider,siteKey:captcha.siteKey,action:captcha.action,cData:captcha.cData,recaptchaVersion:captcha.recaptchaVersion,locale,theme:part.theme,generation:captcha.generation,onVerified:captcha.onVerified,onInvalidated:captcha.onInvalidated,registerExecutor:captcha.registerExecutor,className:props.className})})}return jsx2(PartScopeProvider,{value:scope,children:jsx2(BotProtectionAltcha,{...props,locale,labels})})}export{useKanorioBotProtection,ENGLISH_ALTCHA_LABELS,KanorioBotProtection,KanorioBotProtectionAltcha};
2
- //# sourceMappingURL=chunk-J5SMJRYC.js.map
1
+ import{BotProtectionAltcha,BotProtectionFields,ThirdPartyCaptcha,parsePublicBotProtectionConfig,preloadAltchaWidget,useBotProtection,useBotProtectionConfig}from"./chunk-KYXZNMNA.js";import{useIsInsideElementsRoot}from"./chunk-7UCZ56EJ.js";import{PartScopeProvider}from"./chunk-763LNERD.js";import{useOptionalSiteLabels}from"./chunk-U7H3W23Q.js";import{ELEMENTS_PART_CLASS,markScope,optionalSiteUrl,resolveLocale,resolveVisitorLocale,useBrandStyle,useElementsMessages,useKanorioProviderConfig,useKanorioSiteUrl,useSiteMeta}from"./chunk-73S6VKNV.js";import{useEffect,useMemo as useMemo2}from"react";import{createContext,useContext,useMemo}from"react";import{jsx}from"react/jsx-runtime";var BotProtectionContext=createContext(null);import{Fragment,jsx as jsx2,jsxs}from"react/jsx-runtime";function useKanorioBotProtection(options={}){const siteUrl=useKanorioSiteUrl(options.siteUrl);const entry=options.entry??"forms";const contextConfig=useBotProtectionConfig();const givenConfig=options.config!==void 0?options.config:contextConfig;const readsSite=givenConfig===null&&options.config===void 0;const{site,error:siteError}=useSiteMeta(siteUrl,readsSite);const siteConfig=useMemo2(()=>site?parsePublicBotProtectionConfig(site.botProtection):null,[site]);const pending=readsSite&&siteConfig===null&&!siteError;const raw=useBotProtection({...options,entry,config:readsSite?siteConfig:givenConfig,variant:options.variant??"full",challengeUrl:`${siteUrl}/api/form-protection/challenge`,altchaChallengeUrl:`${siteUrl}/api/form-protection/altcha`});const captcha=raw.challengeProps.captcha;const fieldProps=useMemo2(()=>({...raw.fieldProps,captcha,pending}),[raw.fieldProps,captcha,pending]);return{...raw,isReady:raw.isReady&&!pending,isSubmittable:raw.isSubmittable&&!pending,fieldProps}}var ENGLISH_ALTCHA_LABELS={botProtection:"Human verification",botProtectionLoading:"Loading human verification"};function useBotProtectionPart(theme,localeProp,wantsAltcha){const parent=useKanorioProviderConfig();const insideRoot=useIsInsideElementsRoot();const locale=resolveLocale(localeProp??parent?.locale);const hostTheme=theme??(parent?.theme==="light"||parent?.theme==="dark"?parent.theme:null);const resolvedTheme=insideRoot?null:hostTheme;const brandSiteUrl=wantsAltcha&&!insideRoot&&parent!==null&&parent.brand!==false?optionalSiteUrl(parent.siteUrl):null;const{site}=useSiteMeta(brandSiteUrl??"",brandSiteUrl!==null);const brandScope=useBrandStyle(site,locale,brandSiteUrl!==null);const scope=useMemo2(()=>insideRoot?null:{className:ELEMENTS_PART_CLASS,mark:element=>markScope(element,resolvedTheme,brandScope)},[insideRoot,resolvedTheme,brandScope]);const rootLabels=useOptionalSiteLabels();const english=resolveVisitorLocale(locale).startsWith("en");const{messages}=useElementsMessages(locale,wantsAltcha&&rootLabels===null&&!english);const labels=useMemo2(()=>{if(rootLabels)return void 0;if(!messages||english)return ENGLISH_ALTCHA_LABELS;return{botProtection:messages.ui.botProtection,botProtectionLoading:messages.ui.botProtectionLoading}},[rootLabels,messages,english]);useEffect(()=>{if(wantsAltcha)preloadAltchaWidget(locale)},[wantsAltcha,locale]);return{scope,labels,locale,theme:resolvedTheme}}function KanorioBotProtection({theme,captcha,pending,...props}){return jsxs(Fragment,{children:[props.renderAltcha===false?null:jsx2(KanorioBotProtectionAltcha,{theme,captcha,pending,...props}),jsx2(BotProtectionFields,{...props,renderAltcha:false})]})}function KanorioBotProtectionAltcha({theme,captcha,pending,...props}){const part=useBotProtectionPart(theme,props.locale,props.variant==="full"&&!captcha&&!pending);const{scope,labels,locale}=part;if(pending)return null;if(captcha){return jsx2(PartScopeProvider,{value:scope,children:jsx2(ThirdPartyCaptcha,{provider:captcha.provider,siteKey:captcha.siteKey,action:captcha.action,cData:captcha.cData,recaptchaVersion:captcha.recaptchaVersion,locale,theme:part.theme,generation:captcha.generation,onVerified:captcha.onVerified,onInvalidated:captcha.onInvalidated,registerExecutor:captcha.registerExecutor,className:props.className})})}return jsx2(PartScopeProvider,{value:scope,children:jsx2(BotProtectionAltcha,{...props,locale,labels})})}export{useKanorioBotProtection,ENGLISH_ALTCHA_LABELS,KanorioBotProtection,KanorioBotProtectionAltcha};
2
+ //# sourceMappingURL=chunk-VT2B53EX.js.map
@@ -1,2 +1,2 @@
1
- import{useKanorioProviderConfig,useKanorioSiteUrl}from"./chunk-RI64PHGM.js";import{useEffect,useState}from"react";import{jsx,jsxs}from"react/jsx-runtime";function reviewDate(publishedAt,timeZone){if(!timeZone)return publishedAt.slice(0,10);try{return new Intl.DateTimeFormat("en-CA",{timeZone,year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(publishedAt))}catch{return publishedAt.slice(0,10)}}function KanorioReviews({target,pageSize,loadMoreLabel,verifiedLabel,replyLabel,className,siteUrl:siteUrlProp,timeZone:timeZoneProp}){const siteUrl=useKanorioSiteUrl(siteUrlProp);const parent=useKanorioProviderConfig();const timeZone=timeZoneProp!==void 0?timeZoneProp:parent?.timeZone??null;const[items,setItems]=useState([]);const[nextCursor,setNextCursor]=useState(null);const[loading,setLoading]=useState(false);async function load(cursor,replace){const url=new URL("/api/v1/reviews",siteUrl);url.searchParams.set("target",target);if(pageSize)url.searchParams.set("limit",String(pageSize));if(cursor)url.searchParams.set("cursor",cursor);setLoading(true);try{const res=await fetch(url.toString());if(!res.ok)throw new Error(String(res.status));const body=await res.json();setItems(prev=>replace?body.data??[]:[...prev,...body.data??[]]);setNextCursor(body.nextCursor??null)}catch{if(replace)setItems([]);setNextCursor(null)}finally{setLoading(false)}}useEffect(()=>{let cancelled=false;const url=new URL("/api/v1/reviews",siteUrl);url.searchParams.set("target",target);if(pageSize)url.searchParams.set("limit",String(pageSize));fetch(url.toString()).then(res=>res.ok?res.json():Promise.reject(new Error(String(res.status)))).then(body=>{if(cancelled)return;setItems(body.data??[]);setNextCursor(body.nextCursor??null)}).catch(()=>{if(cancelled)return;setItems([]);setNextCursor(null)});return()=>{cancelled=true}},[siteUrl,target,pageSize]);if(items.length===0)return null;return jsxs("div",{className,"data-kanorio-reviews":target,children:[jsx("ul",{"data-kanorio-reviews-list":"",children:items.map(item=>jsxs("li",{"data-kanorio-review":"","data-rating":item.rating,"data-verified":item.verified?"":void 0,children:[jsxs("div",{"data-kanorio-review-head":"",children:[jsx("strong",{"data-kanorio-review-author":"",children:item.authorName}),jsxs("span",{"data-kanorio-review-rating":"","aria-label":`${item.rating} / 5`,children:[item.rating,"/5"]}),item.verified&&verifiedLabel?jsx("span",{"data-kanorio-review-verified":"",children:verifiedLabel}):null,jsx("time",{"data-kanorio-review-date":"",dateTime:item.publishedAt,children:reviewDate(item.publishedAt,timeZone)})]}),item.content?jsx("p",{"data-kanorio-review-content":"",children:item.content}):null,item.reply?.body&&replyLabel?jsxs("div",{"data-kanorio-review-reply":"",children:[jsx("span",{"data-kanorio-review-reply-label":"",children:replyLabel}),jsx("p",{"data-kanorio-review-reply-body":"",children:item.reply.body})]}):null]},item.id))}),nextCursor&&loadMoreLabel?jsx("button",{type:"button","data-kanorio-reviews-more":"",disabled:loading,onClick:()=>void load(nextCursor,false),children:loadMoreLabel}):null]})}function KanorioRating({target,countLabel,className,siteUrl:siteUrlProp}){const siteUrl=useKanorioSiteUrl(siteUrlProp);const[summary,setSummary]=useState(null);useEffect(()=>{let cancelled=false;const url=new URL("/api/v1/reviews/summary",siteUrl);url.searchParams.set("target",target);fetch(url.toString()).then(res=>res.ok?res.json():Promise.reject(new Error(String(res.status)))).then(body=>{if(!cancelled)setSummary(body)}).catch(()=>{if(!cancelled)setSummary(null)});return()=>{cancelled=true}},[siteUrl,target]);if(!summary||!summary.visible||summary.rating==null)return null;const rounded=Math.round(summary.rating*10)/10;return jsxs("p",{className,"data-kanorio-rating":target,"data-rating":rounded,"data-count":summary.count,children:[jsx("span",{"data-kanorio-rating-value":"","aria-label":`${rounded} / 5`,children:rounded.toFixed(1)}),jsx("span",{"data-kanorio-rating-count":"",children:countLabel?countLabel.replace("{count}",String(summary.count)):summary.count})]})}export{KanorioReviews,KanorioRating};
2
- //# sourceMappingURL=chunk-OWXGUUSI.js.map
1
+ import{useKanorioProviderConfig,useKanorioSiteUrl}from"./chunk-73S6VKNV.js";import{useEffect,useState}from"react";import{jsx,jsxs}from"react/jsx-runtime";function reviewDate(publishedAt,timeZone){if(!timeZone)return publishedAt.slice(0,10);try{return new Intl.DateTimeFormat("en-CA",{timeZone,year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(publishedAt))}catch{return publishedAt.slice(0,10)}}function KanorioReviews({target,pageSize,loadMoreLabel,verifiedLabel,replyLabel,className,siteUrl:siteUrlProp,timeZone:timeZoneProp}){const siteUrl=useKanorioSiteUrl(siteUrlProp);const parent=useKanorioProviderConfig();const timeZone=timeZoneProp!==void 0?timeZoneProp:parent?.timeZone??null;const[items,setItems]=useState([]);const[nextCursor,setNextCursor]=useState(null);const[loading,setLoading]=useState(false);async function load(cursor,replace){const url=new URL("/api/v1/reviews",siteUrl);url.searchParams.set("target",target);if(pageSize)url.searchParams.set("limit",String(pageSize));if(cursor)url.searchParams.set("cursor",cursor);setLoading(true);try{const res=await fetch(url.toString());if(!res.ok)throw new Error(String(res.status));const body=await res.json();setItems(prev=>replace?body.data??[]:[...prev,...body.data??[]]);setNextCursor(body.nextCursor??null)}catch{if(replace)setItems([]);setNextCursor(null)}finally{setLoading(false)}}useEffect(()=>{let cancelled=false;const url=new URL("/api/v1/reviews",siteUrl);url.searchParams.set("target",target);if(pageSize)url.searchParams.set("limit",String(pageSize));fetch(url.toString()).then(res=>res.ok?res.json():Promise.reject(new Error(String(res.status)))).then(body=>{if(cancelled)return;setItems(body.data??[]);setNextCursor(body.nextCursor??null)}).catch(()=>{if(cancelled)return;setItems([]);setNextCursor(null)});return()=>{cancelled=true}},[siteUrl,target,pageSize]);if(items.length===0)return null;return jsxs("div",{className,"data-kanorio-reviews":target,children:[jsx("ul",{"data-kanorio-reviews-list":"",children:items.map(item=>jsxs("li",{"data-kanorio-review":"","data-rating":item.rating,"data-verified":item.verified?"":void 0,children:[jsxs("div",{"data-kanorio-review-head":"",children:[jsx("strong",{"data-kanorio-review-author":"",children:item.authorName}),jsxs("span",{"data-kanorio-review-rating":"","aria-label":`${item.rating} / 5`,children:[item.rating,"/5"]}),item.verified&&verifiedLabel?jsx("span",{"data-kanorio-review-verified":"",children:verifiedLabel}):null,jsx("time",{"data-kanorio-review-date":"",dateTime:item.publishedAt,children:reviewDate(item.publishedAt,timeZone)})]}),item.content?jsx("p",{"data-kanorio-review-content":"",children:item.content}):null,item.reply?.body&&replyLabel?jsxs("div",{"data-kanorio-review-reply":"",children:[jsx("span",{"data-kanorio-review-reply-label":"",children:replyLabel}),jsx("p",{"data-kanorio-review-reply-body":"",children:item.reply.body})]}):null]},item.id))}),nextCursor&&loadMoreLabel?jsx("button",{type:"button","data-kanorio-reviews-more":"",disabled:loading,onClick:()=>void load(nextCursor,false),children:loadMoreLabel}):null]})}function KanorioRating({target,countLabel,className,siteUrl:siteUrlProp}){const siteUrl=useKanorioSiteUrl(siteUrlProp);const[summary,setSummary]=useState(null);useEffect(()=>{let cancelled=false;const url=new URL("/api/v1/reviews/summary",siteUrl);url.searchParams.set("target",target);fetch(url.toString()).then(res=>res.ok?res.json():Promise.reject(new Error(String(res.status)))).then(body=>{if(!cancelled)setSummary(body)}).catch(()=>{if(!cancelled)setSummary(null)});return()=>{cancelled=true}},[siteUrl,target]);if(!summary||!summary.visible||summary.rating==null)return null;const rounded=Math.round(summary.rating*10)/10;return jsxs("p",{className,"data-kanorio-rating":target,"data-rating":rounded,"data-count":summary.count,children:[jsx("span",{"data-kanorio-rating-value":"","aria-label":`${rounded} / 5`,children:rounded.toFixed(1)}),jsx("span",{"data-kanorio-rating-count":"",children:countLabel?countLabel.replace("{count}",String(summary.count)):summary.count})]})}export{KanorioReviews,KanorioRating};
2
+ //# sourceMappingURL=chunk-W5QS3RHM.js.map
@@ -1,3 +1,3 @@
1
- import{a as $}from"./chunk-QYTK2CW3.js";import{a as M,b as U}from"./chunk-BKNL7ZCI.js";import{a as H}from"./chunk-OU4IOHLN.js";import{a as be}from"./chunk-6LGTFWQS.js";import{c as O}from"./chunk-CDG7S4P5.js";var N="X-Kanorio-Server-Key",V="X-Kanorio-Visitor-IP";var xe="knr_sk_";var pt=`${xe}${"0".repeat(43)}`;function F(e){let t=e.split(".");if(t.length!==4)return null;let n=[];for(let r of t){if(!/^\d{1,3}$/.test(r))return null;let o=Number(r);if(o>255)return null;n.push(o)}return n}function Se(e){if(!e.includes(":")||e.includes("%"))return null;let t=e,n=null,r=e.lastIndexOf(":"),o=e.slice(r+1);if(o.includes(".")){if(n=F(o),!n)return null;t=`${e.slice(0,r)}:0:0`}let i=t.indexOf("::");if(i!==t.lastIndexOf("::"))return null;let s;if(i>=0){let l=t.slice(0,i).split(":").filter(Boolean),c=t.slice(i+2).split(":").filter(Boolean),d=8-l.length-c.length;if(d<1)return null;s=[...l,...Array(d).fill("0"),...c]}else s=t.split(":");if(s.length!==8)return null;let a=[];for(let l of s){if(!/^[0-9a-fA-F]{1,4}$/.test(l))return null;let c=parseInt(l,16);a.push(c>>8,c&255)}return n&&a.splice(12,4,...n),a}function we(e){let t=e.trim();if(!t||t.length>45)return null;let n=F(t);if(n)return{version:4,bytes:n};let r=Se(t);return r?r.slice(0,10).every(i=>i===0)&&r[10]===255&&r[11]===255?{version:4,bytes:r.slice(12)}:{version:6,bytes:r}:null}function Ee(e,t,n){let r=Math.floor(n/8);for(let s=0;s<r;s++)if(e[s]!==t[s])return!1;let o=n%8;if(o===0)return!0;let i=255<<8-o&255;return((e[r]??0)&i)===((t[r]??0)&i)}var Re=[[[0,0,0,0],8],[[10,0,0,0],8],[[100,64,0,0],10],[[127,0,0,0],8],[[169,254,0,0],16],[[172,16,0,0],12],[[192,0,0,0],24],[[192,0,2,0],24],[[192,168,0,0],16],[[198,18,0,0],15],[[198,51,100,0],24],[[203,0,113,0],24],[[224,0,0,0],3]],ve=[[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],127],[[252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],7],[[254,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0],10],[[255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],8],[[32,1,13,184,0,0,0,0,0,0,0,0,0,0,0,0],32]];function ke(e){return!(e.version===4?Re:ve).some(([n,r])=>Ee(e.bytes,n,r))}function Ce(e){if(e.version===4)return e.bytes.join(".");let t=[];for(let n=0;n<16;n+=2)t.push(((e.bytes[n]??0)<<8|(e.bytes[n+1]??0)).toString(16));return t.join(":")}function q(e){if(!e)return null;let t=we(e);return!t||!ke(t)?null:Ce(t)}var Te=/^(localhost|127\.0\.0\.1|\[::1\])$/i;function j(){return typeof window<"u"&&typeof document<"u"}async function B(e,t){let n=e.serverKey?.trim();if(!n)return null;if(j())throw new Error("@kanorio/sdk: `serverKey` must never be used in the browser. Call Kanorio from your server (route handler, server action, middleware) and keep the key in an environment variable.");let r=new URL(t);if(r.protocol!=="https:"&&!Te.test(r.hostname))throw new Error("@kanorio/sdk: `serverKey` requires an https site URL.");let o={[N]:n},i=typeof e.visitorIp=="function"?await e.visitorIp():e.visitorIp,s=q(i);return s&&(o[V]=s),{headers:o,redirect:"error"}}function z(e){return e.headers.get("cf-mitigated")==="challenge"}var W="EDGE_CHALLENGE";function Y(e){return j()?"Kanorio's edge answered this request with a security check page, so it never reached the API. API requests are not normally checked this way: retry in a moment, and contact Kanorio support if it keeps happening.":e?`Kanorio's edge challenged this server-side request even though a server key was sent. Check that the key is a server key (starts with knr_sk_, purpose "Website server") and that it is sent to the site's own hostname.`:'Kanorio\'s edge challenged this server-side request, so it never reached the API. Sending a server key avoids this: create one under Site settings > Developer (purpose "Website server"), store it as KANORIO_SERVER_KEY, and pass `serverKey` to the client. Do not paste the key into chat or commit it.'}var Oe="1.3.0",Pe="x-kanorio-sdk-version";function _e(e){if(typeof e!="object"||e===null)return!1;let t=e.error;if(typeof t!="object"||t===null)return!1;let{code:n,message:r}=t;return typeof n=="string"&&typeof r=="string"}var m=class extends Error{constructor(n,r,o,i,s,a){super(o);this.code=n;this.status=r;this.details=i;this.retryAfter=s;this.availableAt=a;this.name="KanorioApiError"}},P=class extends m{constructor(t){super(W,403,t),this.name="KanorioEdgeChallengeError"}};function Ie(e,t,n){let r=n.get("retry-after"),o=r?Number.parseInt(r,10):void 0;if(_e(t)){let a=t.error.details,l=typeof a?.retryAfter=="number"?a.retryAfter:void 0,c=typeof a?.availableAt=="string"?a.availableAt:void 0;return new m(t.error.code,e,t.error.message,t.error.details,o??l,c)}let i=e===401?"UNAUTHENTICATED":e===404?"NOT_FOUND":e===429?"RATE_LIMITED":e>=500?"UPSTREAM_ERROR":"HTTP_ERROR",s=typeof t=="string"?t.slice(0,200):"";return new m(i,e,s||`Request failed with HTTP ${e}.`,void 0,o)}function Ae(e,t,n){if(!e.has("deprecation"))return null;let r=e.get("link")??"",o=i=>r.match(new RegExp(`<([^>]+)>;\\s*rel="${i}"`))?.[1]??null;return{method:t,path:n,sunset:e.get("sunset"),successor:o("successor-version"),policy:o("deprecation")}}function Ke(e,t,n){let r=new URL(t.replace(/^\//,""),e.endsWith("/")?e:`${e}/`);if(n)for(let[o,i]of Object.entries(n)){let s=Array.isArray(i)?i:[i];for(let a of s)a!=null&&r.searchParams.append(o,String(a))}return r.toString()}function S(e){let t=e.fetch??globalThis.fetch;if(!t)throw new Error("@kanorio/sdk: global fetch is not available; pass `fetch` in options.");let n=new Set,r=e.onDeprecation??(s=>{let a=`${s.method} ${s.path}`;n.has(a)||(n.add(a),console.warn(`[kanorio] ${a} is deprecated${s.sunset?` (sunset ${s.sunset})`:""}${s.successor?`; use ${s.successor}`:""}.`))});async function o(s,a,l={}){let c=new Headers(typeof e.headers=="function"?await e.headers():e.headers);new Headers(l.headers).forEach((h,y)=>c.set(y,h)),c.set("accept","application/json"),typeof document>"u"&&(c.set(Pe,Oe),e.userAgent&&c.set("user-agent",e.userAgent));let d;l.body!==void 0&&(c.set("content-type","application/json"),d=JSON.stringify(l.body));let p=Ke(e.baseUrl,a,l.query),g=await B(e,p);if(g)for(let[h,y]of Object.entries(g.headers))c.set(h,y);let f=e.timeoutMs?new AbortController:null,x=f?setTimeout(()=>f.abort(),e.timeoutMs):null;f&&l.signal&&l.signal.addEventListener("abort",()=>f.abort(),{once:!0});try{return await t(p,{method:s,headers:c,body:d,signal:f?.signal??l.signal,...g?{redirect:g.redirect}:{}})}finally{x&&clearTimeout(x)}}async function i(s,a,l={}){let c=await o(s,a,l);if(z(c))throw new P(Y(!!e.serverKey));let d=Ae(c.headers,s,a);d&&r(d);let p=await c.text(),g=p;if(p)try{g=JSON.parse(p)}catch{g=p}else g=void 0;if(!c.ok)throw Ie(c.status,g,c.headers);return g}return{request:i,raw:o}}var Le=[{source:"/sitemap.xml",apiPath:"/seo/sitemap.xml"},{source:"/robots.txt",apiPath:"/seo/robots.txt"},{source:"/llms.txt",apiPath:"/seo/llms.txt"},{source:"/llms-full.txt",apiPath:"/seo/llms-full.txt"},{source:"/feed.xml",apiPath:"/feed"},{source:"/rss.xml",apiPath:"/feed"},{source:"/feed.atom",apiPath:"/feed.atom"}];function De(e){let t=w(e.siteUrl),n=Le.map(r=>({source:r.source,destination:`${t}${r.apiPath}`}));return e.framework==="astro"?Object.fromEntries(n.map(r=>[r.source,r.destination])):(n.push({source:"/:key([a-f0-9]{32}).txt",destination:`${t}/seo/indexnow-key.txt`}),n)}function He(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}async function Me(e){let t=e.fetch??globalThis.fetch,n=(e.path??"/").trim(),r=n.startsWith("/")?n:`/${n}`,o=`${w(e.siteUrl)}/seo/jsonld?path=${encodeURIComponent(r)}`,i=await t(o);if(!i.ok)return null;let s=await i.json();return{jsonLd:s,scriptJson:He(JSON.stringify(s)),cacheTags:_(i.headers)}}async function Ue(e){let t=e.fetch??globalThis.fetch;try{let n=await t(`${w(e.siteUrl)}/seo/sitemap`);if(!n.ok)return null;let r=await n.json();return typeof r.siteUrl!="string"||!Array.isArray(r.urls)?null:{siteUrl:r.siteUrl,urls:r.urls,cacheTags:_(n.headers)}}catch{return null}}function G(e){function t(n){return De({siteUrl:e.siteUrl,framework:n.framework})}return{rewrites:t,jsonLd:(n="/")=>Me({siteUrl:e.siteUrl,path:n,fetch:e.fetch}),sitemapEntries:()=>Ue({siteUrl:e.siteUrl,fetch:e.fetch})}}function $e(e,t){return e.replace(/\{([^}]+)\}/g,(n,r)=>{let o=t?.[r];if(o==null)throw new Error(`@kanorio/sdk: missing path parameter "${r}" for ${e}`);return encodeURIComponent(String(o))})}function v(e){let t=n=>(r,o)=>{let i=o??{},s={query:i.query,body:i.body,headers:i.headers,signal:i.signal};return e.request(n,$e(r,i.params),s)};return{get:t("GET"),post:t("POST"),put:t("PUT"),patch:t("PATCH"),delete:t("DELETE"),http:e}}var J="x-kanorio-cache-tags";function Ne(e){let t=[],n=new Set;for(let r of e){let o=r.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t}function Q(e){return e?Ne(e.split(/\s+/)):[]}var Ve="x-kanorio-preview";function w(e){return`${e.replace(/\/+$/,"")}/api/v1`}function Z(e){let{siteUrl:t,previewToken:n,headers:r,...o}=e,s=v(S({...o,headers:n===void 0?r:async()=>{let l=new Headers(typeof r=="function"?await r():r),c=typeof n=="function"?await n():n;return c&&l.set(Ve,c),l},baseUrl:w(t)})),a=G({siteUrl:t,fetch:o.fetch});return Object.assign(s,{seo:a})}var X=J;function _(e){if(!e)return[];let t=typeof e.get=="function"?e.get(X):e[X]??e["X-Kanorio-Cache-Tags"];return Q(t)}function Fe(e){return`${e.replace(/\/+$/,"")}/api/v1/customer`}async function ee(e){let t=typeof e=="function"?await e():e;return t||null}function qe(e){let{siteUrl:t,token:n,headers:r,...o}=e,i=S({...o,baseUrl:Fe(t),headers:async()=>{let s=new Headers(r),a=await ee(n);return a&&s.set("authorization",`Bearer ${a}`),s}});return v(i)}var k="kanorio.customer.token";function je(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}function te(e,t=je()){try{e?t?.setItem(k,e):t?.removeItem(k)}catch{}}function b(e){return{...e,ok:!0}}function ne(e){let t=qe(e),n=S({...e,baseUrl:`${e.siteUrl.replace(/\/+$/,"")}/api/v1`}),r=o=>o instanceof m?{ok:!1,code:o.code,...o.availableAt?{availableAt:o.availableAt}:{}}:{ok:!1,code:"NETWORK_ERROR"};return{async openUnit(o,i,s){try{if(!await ee(e.token))return b(await n.request("POST",`units/${encodeURIComponent(o)}/open`,{body:{mode:i}}));let l=s?.attachmentId?{mode:i,attachmentId:s.attachmentId}:{mode:i};return b(await t.post("/units/{id}/open",{params:{id:o},query:e.locale?{locale:e.locale}:{},body:l}))}catch(a){return r(a)}},async reportProgress(o){try{return b(await t.post("/progress",{body:o}))}catch(i){return r(i)}},async submitQuiz(o){try{return b(await t.post("/units/{id}/quiz",{params:{id:o.unitId},body:{answers:o.answers}}))}catch(i){return r(i)}},async getCertificate(o){try{return b(await t.get("/deliverables/{deliverableId}/certificate",{params:{deliverableId:o}}))}catch(i){return r(i)}},async getTranscript(o,i){try{let s=i??e.locale;return b(await t.get("/units/{id}/transcript",{params:{id:o},query:s?{locale:s}:{}}))}catch(s){return r(s)}}}}var u=O(be(),1);var Be="en-US",I={ar:()=>import("./ar-JXAEXYYY.js"),bg:()=>import("./bg-EUIPVVBX.js"),bn:()=>import("./bn-L35GOE5D.js"),cs:()=>import("./cs-MGLMNU2K.js"),da:()=>import("./da-X5HKEDEL.js"),de:()=>import("./de-Y5ELIZBU.js"),el:()=>import("./el-YZGS3PLP.js"),"en-AU":()=>import("./en-AU-IUEA3YQP.js"),"en-CA":()=>import("./en-CA-OFK46Q44.js"),"en-GB":()=>import("./en-GB-VNG2IO2E.js"),"en-US":()=>import("./en-US-5RT4SJ3V.js"),en:()=>import("./en-MCRNEXQP.js"),"es-419":()=>import("./es-419-JFUQ3D4V.js"),"es-ES":()=>import("./es-ES-BMD6JJEO.js"),fa:()=>import("./fa-NE4XJTHW.js"),fi:()=>import("./fi-SCTIKRMX.js"),"fr-CA":()=>import("./fr-CA-RQDI3NIQ.js"),"fr-FR":()=>import("./fr-FR-KGXOTINP.js"),gu:()=>import("./gu-7AJCL43I.js"),he:()=>import("./he-UWYKIUPF.js"),hi:()=>import("./hi-KXKJMKZF.js"),hu:()=>import("./hu-YRF3KPIJ.js"),id:()=>import("./id-SXO4Z54V.js"),it:()=>import("./it-RBRELRA3.js"),ja:()=>import("./ja-2WRUVHKU.js"),km:()=>import("./km-SL6MZB3H.js"),kn:()=>import("./kn-YGEU3PSD.js"),ko:()=>import("./ko-2GI6Z5YH.js"),lo:()=>import("./lo-ZRV6OAH6.js"),ml:()=>import("./ml-BIZEFHNR.js"),mr:()=>import("./mr-PZNRW5MW.js"),ms:()=>import("./ms-NYWKJQEQ.js"),my:()=>import("./my-FHI5JEQF.js"),nb:()=>import("./nb-U4QN5GJE.js"),ne:()=>import("./ne-J3XQJZAY.js"),"nl-BE":()=>import("./nl-BE-VHBDCIRF.js"),"nl-NL":()=>import("./nl-NL-FZMZRVH4.js"),nn:()=>import("./nn-UCSEDGDB.js"),pa:()=>import("./pa-LTF7CWS2.js"),pl:()=>import("./pl-YWCG2YWW.js"),"pt-BR":()=>import("./pt-BR-5JRKIQVH.js"),"pt-PT":()=>import("./pt-PT-Y2UCAKHP.js"),ro:()=>import("./ro-6MQF2KY2.js"),ru:()=>import("./ru-KGU3SC3S.js"),si:()=>import("./si-CTQN6I2M.js"),sv:()=>import("./sv-QGZRDKBJ.js"),sw:()=>import("./sw-CWIRVHYD.js"),ta:()=>import("./ta-E3ZBHC6A.js"),te:()=>import("./te-7JC2KGAU.js"),th:()=>import("./th-JVK4E2AJ.js"),tl:()=>import("./tl-X72423V3.js"),tr:()=>import("./tr-22NUPSET.js"),uk:()=>import("./uk-POKPJJDZ.js"),ur:()=>import("./ur-6LBRTMAE.js"),vi:()=>import("./vi-XC4CGJHX.js"),"zh-CN":()=>import("./zh-CN-XW3PLUG5.js"),"zh-HK":()=>import("./zh-HK-25OZZBHO.js"),"zh-Hant":()=>import("./zh-Hant-LFJZCOMK.js")},At=Object.keys(I);function ze(e){return e&&e in I?e:Be}async function re(e){return(await I[ze(e)]()).default}var We="kanorio-elements",Ye="kanorio-popup",Ge="kanorio-part",C="data-kanorio-brand";function Dt(e,t,n){t?e.setAttribute("data-kanorio-theme",t):e.removeAttribute("data-kanorio-theme"),n?e.setAttribute(C,n):e.removeAttribute(C)}var Je=`:is(.${We}, .${Ye}, .${Ge})`,se=$,Ht=se.join(", "),oe=se.map(e=>`${e} *`).join(", "),ie=['[data-kanorio-theme="dark"]','[data-kanorio-theme="dark"] *',`[data-kanorio-theme="auto"]:where(${oe})`,`[data-kanorio-theme="auto"]:where(${oe}) *`].join(", "),ae='[data-kanorio-theme="auto"], [data-kanorio-theme="auto"] *';var dt=O(H(),1);U(M);var A="kanorio:token-change";function ue(e){let t=e?.replace(/\/+$/,"");if(t)return t;if(typeof window<"u")return window.location.origin;if(e)return"";throw new Error("@kanorio/elements: siteUrl is required outside the browser.")}function qt(e){let t=e?.replace(/\/+$/,"");return t||(typeof window<"u"?window.location.origin:null)}function Qe(e){return e||(typeof document<"u"&&document.documentElement.lang?document.documentElement.lang:"en")}var de=()=>()=>{},R=Object.freeze({value:null,failures:0,round:0}),Xe=()=>R;function pe(e){let t=new Map,n=new Map,r=new Set,o=0,i=()=>{for(let s of[...r])s()};return{entry:s=>t.get(s)??R,subscribe(s){return r.add(s),()=>{r.delete(s)}},load(s){let a=t.get(s);if(a&&a.value!==null)return Promise.resolve(a.value);let l=n.get(s);if(l)return l;let c=o,d=Promise.resolve().then(()=>e(s)).catch(()=>null).then(p=>{if(n.get(s)===d&&n.delete(s),c!==o)return p;let g=t.get(s)??R;return t.set(s,p===null?{...g,failures:g.failures+1}:{value:p,failures:g.failures,round:g.round}),i(),p});return n.set(s,d),d},clear(){o+=1;for(let[s,a]of t)t.set(s,{value:null,failures:a.failures,round:a.round+1});for(let s of n.keys())t.has(s)||t.set(s,{...R,round:1});n.clear(),i()},retryFailed(){let s=!1;for(let[a,l]of t)l.value!==null||n.has(a)||(t.set(a,{...l,round:l.round+1}),s=!0);s&&i()},reset(){o+=1,t.clear(),n.clear(),i()}}}function ge(e,t){let n=(0,u.useSyncExternalStore)(t===null?de:e.subscribe,()=>t===null?R:e.entry(t),Xe),[r,o]=(0,u.useState)(()=>({key:t,failures:t===null?0:e.entry(t).failures})),i=r;r.key!==t&&(i={key:t,failures:t===null?0:e.entry(t).failures},o(i));let s=t!==null&&n.value===null;(0,u.useEffect)(()=>{s&&t!==null&&e.load(t)},[e,t,s,n.round]);let a=t!==null&&n.value===null&&n.failures>i.failures;return(0,u.useMemo)(()=>({value:n.value,error:a}),[n.value,a])}var fe=pe(e=>re(e)),K=pe(e=>Z({siteUrl:e}).get("/site").then(t=>typeof t?.id=="string"?t:null));typeof window<"u"&&window.addEventListener("online",()=>{fe.retryFailed(),K.retryFailed()});function Ze(e,t=!0){let{value:n,error:r}=ge(fe,t?e:null),[o,i]=(0,u.useState)(null);n!==null&&(o===null||o.messages!==n||o.locale!==e)&&i({messages:n,locale:e});let s=n??o?.messages??null,a=n!==null?e:o?.locale??e;return(0,u.useMemo)(()=>({messages:s,locale:a,error:r}),[s,a,r])}function jt(e){return K.load(e)}function et(e,t=!0){let{value:n,error:r}=ge(K,t?e:null),[o,i]=(0,u.useState)(null);n!==null&&(o===null||o.site!==n||o.siteUrl!==e)&&i({site:n,siteUrl:e});let s=n??(t&&o?.siteUrl===e?o.site:null);return(0,u.useMemo)(()=>({site:s,error:r}),[s,r])}function me(e){let t=e.toLowerCase();return t.startsWith("zh-hans")||t.startsWith("zh-cn")||t.startsWith("zh-sg")?"zh-Hans":t.startsWith("zh")?"zh-Hant":t.startsWith("ja")?"ja":t.startsWith("ko")?"ko":"en"}function tt(e,t,n){let r=e.colors.primary.light,o=e.colors.primary.dark,i=Object.entries(e.radius).map(([d,p])=>`--site-radius-${d}: ${p};`).join(" "),s=me(t),a=e.fonts.find(d=>d.locales.includes(s))??e.fonts[0],l=a?`--site-font-family: ${a.family};`:"",c=`--brand-color: ${o.background}; --brand-foreground: ${o.foreground};`;return[`:where(${n}) { --brand-color: ${r.background}; --brand-foreground: ${r.foreground}; ${i} ${l} font-family: var(--site-font-family, inherit); }`,`:where(${n}):where(${ie}) { ${c} }`,`@media (prefers-color-scheme: dark) { :where(${n}):where(${ae}) { ${c} } }`].join(`
1
+ import{a as $}from"./chunk-QYTK2CW3.js";import{a as M,b as U}from"./chunk-BKNL7ZCI.js";import{a as H}from"./chunk-OU4IOHLN.js";import{a as be}from"./chunk-6LGTFWQS.js";import{c as O}from"./chunk-CDG7S4P5.js";var N="X-Kanorio-Server-Key",V="X-Kanorio-Visitor-IP";var xe="knr_sk_";var pt=`${xe}${"0".repeat(43)}`;function F(e){let t=e.split(".");if(t.length!==4)return null;let n=[];for(let r of t){if(!/^\d{1,3}$/.test(r))return null;let o=Number(r);if(o>255)return null;n.push(o)}return n}function Se(e){if(!e.includes(":")||e.includes("%"))return null;let t=e,n=null,r=e.lastIndexOf(":"),o=e.slice(r+1);if(o.includes(".")){if(n=F(o),!n)return null;t=`${e.slice(0,r)}:0:0`}let i=t.indexOf("::");if(i!==t.lastIndexOf("::"))return null;let s;if(i>=0){let l=t.slice(0,i).split(":").filter(Boolean),c=t.slice(i+2).split(":").filter(Boolean),d=8-l.length-c.length;if(d<1)return null;s=[...l,...Array(d).fill("0"),...c]}else s=t.split(":");if(s.length!==8)return null;let a=[];for(let l of s){if(!/^[0-9a-fA-F]{1,4}$/.test(l))return null;let c=parseInt(l,16);a.push(c>>8,c&255)}return n&&a.splice(12,4,...n),a}function we(e){let t=e.trim();if(!t||t.length>45)return null;let n=F(t);if(n)return{version:4,bytes:n};let r=Se(t);return r?r.slice(0,10).every(i=>i===0)&&r[10]===255&&r[11]===255?{version:4,bytes:r.slice(12)}:{version:6,bytes:r}:null}function Ee(e,t,n){let r=Math.floor(n/8);for(let s=0;s<r;s++)if(e[s]!==t[s])return!1;let o=n%8;if(o===0)return!0;let i=255<<8-o&255;return((e[r]??0)&i)===((t[r]??0)&i)}var Re=[[[0,0,0,0],8],[[10,0,0,0],8],[[100,64,0,0],10],[[127,0,0,0],8],[[169,254,0,0],16],[[172,16,0,0],12],[[192,0,0,0],24],[[192,0,2,0],24],[[192,168,0,0],16],[[198,18,0,0],15],[[198,51,100,0],24],[[203,0,113,0],24],[[224,0,0,0],3]],ve=[[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],127],[[252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],7],[[254,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0],10],[[255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],8],[[32,1,13,184,0,0,0,0,0,0,0,0,0,0,0,0],32]];function ke(e){return!(e.version===4?Re:ve).some(([n,r])=>Ee(e.bytes,n,r))}function Ce(e){if(e.version===4)return e.bytes.join(".");let t=[];for(let n=0;n<16;n+=2)t.push(((e.bytes[n]??0)<<8|(e.bytes[n+1]??0)).toString(16));return t.join(":")}function q(e){if(!e)return null;let t=we(e);return!t||!ke(t)?null:Ce(t)}var Te=/^(localhost|127\.0\.0\.1|\[::1\])$/i;function j(){return typeof window<"u"&&typeof document<"u"}async function B(e,t){let n=e.serverKey?.trim();if(!n)return null;if(j())throw new Error("@kanorio/sdk: `serverKey` must never be used in the browser. Call Kanorio from your server (route handler, server action, middleware) and keep the key in an environment variable.");let r=new URL(t);if(r.protocol!=="https:"&&!Te.test(r.hostname))throw new Error("@kanorio/sdk: `serverKey` requires an https site URL.");let o={[N]:n},i=typeof e.visitorIp=="function"?await e.visitorIp():e.visitorIp,s=q(i);return s&&(o[V]=s),{headers:o,redirect:"error"}}function z(e){return e.headers.get("cf-mitigated")==="challenge"}var W="EDGE_CHALLENGE";function Y(e){return j()?"Kanorio's edge answered this request with a security check page, so it never reached the API. API requests are not normally checked this way: retry in a moment, and contact Kanorio support if it keeps happening.":e?`Kanorio's edge challenged this server-side request even though a server key was sent. Check that the key is a server key (starts with knr_sk_, purpose "Website server") and that it is sent to the site's own hostname.`:'Kanorio\'s edge challenged this server-side request, so it never reached the API. Sending a server key avoids this: create one under Site settings > Developer (purpose "Website server"), store it as KANORIO_SERVER_KEY, and pass `serverKey` to the client. Do not paste the key into chat or commit it.'}var Oe="1.4.0",Pe="x-kanorio-sdk-version";function _e(e){if(typeof e!="object"||e===null)return!1;let t=e.error;if(typeof t!="object"||t===null)return!1;let{code:n,message:r}=t;return typeof n=="string"&&typeof r=="string"}var m=class extends Error{constructor(n,r,o,i,s,a){super(o);this.code=n;this.status=r;this.details=i;this.retryAfter=s;this.availableAt=a;this.name="KanorioApiError"}},P=class extends m{constructor(t){super(W,403,t),this.name="KanorioEdgeChallengeError"}};function Ie(e,t,n){let r=n.get("retry-after"),o=r?Number.parseInt(r,10):void 0;if(_e(t)){let a=t.error.details,l=typeof a?.retryAfter=="number"?a.retryAfter:void 0,c=typeof a?.availableAt=="string"?a.availableAt:void 0;return new m(t.error.code,e,t.error.message,t.error.details,o??l,c)}let i=e===401?"UNAUTHENTICATED":e===404?"NOT_FOUND":e===429?"RATE_LIMITED":e>=500?"UPSTREAM_ERROR":"HTTP_ERROR",s=typeof t=="string"?t.slice(0,200):"";return new m(i,e,s||`Request failed with HTTP ${e}.`,void 0,o)}function Ae(e,t,n){if(!e.has("deprecation"))return null;let r=e.get("link")??"",o=i=>r.match(new RegExp(`<([^>]+)>;\\s*rel="${i}"`))?.[1]??null;return{method:t,path:n,sunset:e.get("sunset"),successor:o("successor-version"),policy:o("deprecation")}}function Ke(e,t,n){let r=new URL(t.replace(/^\//,""),e.endsWith("/")?e:`${e}/`);if(n)for(let[o,i]of Object.entries(n)){let s=Array.isArray(i)?i:[i];for(let a of s)a!=null&&r.searchParams.append(o,String(a))}return r.toString()}function S(e){let t=e.fetch??globalThis.fetch;if(!t)throw new Error("@kanorio/sdk: global fetch is not available; pass `fetch` in options.");let n=new Set,r=e.onDeprecation??(s=>{let a=`${s.method} ${s.path}`;n.has(a)||(n.add(a),console.warn(`[kanorio] ${a} is deprecated${s.sunset?` (sunset ${s.sunset})`:""}${s.successor?`; use ${s.successor}`:""}.`))});async function o(s,a,l={}){let c=new Headers(typeof e.headers=="function"?await e.headers():e.headers);new Headers(l.headers).forEach((h,y)=>c.set(y,h)),c.set("accept","application/json"),typeof document>"u"&&(c.set(Pe,Oe),e.userAgent&&c.set("user-agent",e.userAgent));let d;l.body!==void 0&&(c.set("content-type","application/json"),d=JSON.stringify(l.body));let p=Ke(e.baseUrl,a,l.query),g=await B(e,p);if(g)for(let[h,y]of Object.entries(g.headers))c.set(h,y);let f=e.timeoutMs?new AbortController:null,x=f?setTimeout(()=>f.abort(),e.timeoutMs):null;f&&l.signal&&l.signal.addEventListener("abort",()=>f.abort(),{once:!0});try{return await t(p,{method:s,headers:c,body:d,signal:f?.signal??l.signal,...g?{redirect:g.redirect}:{}})}finally{x&&clearTimeout(x)}}async function i(s,a,l={}){let c=await o(s,a,l);if(z(c))throw new P(Y(!!e.serverKey));let d=Ae(c.headers,s,a);d&&r(d);let p=await c.text(),g=p;if(p)try{g=JSON.parse(p)}catch{g=p}else g=void 0;if(!c.ok)throw Ie(c.status,g,c.headers);return g}return{request:i,raw:o}}var Le=[{source:"/sitemap.xml",apiPath:"/seo/sitemap.xml"},{source:"/robots.txt",apiPath:"/seo/robots.txt"},{source:"/llms.txt",apiPath:"/seo/llms.txt"},{source:"/llms-full.txt",apiPath:"/seo/llms-full.txt"},{source:"/feed.xml",apiPath:"/feed"},{source:"/rss.xml",apiPath:"/feed"},{source:"/feed.atom",apiPath:"/feed.atom"}];function De(e){let t=w(e.siteUrl),n=Le.map(r=>({source:r.source,destination:`${t}${r.apiPath}`}));return e.framework==="astro"?Object.fromEntries(n.map(r=>[r.source,r.destination])):(n.push({source:"/:key([a-f0-9]{32}).txt",destination:`${t}/seo/indexnow-key.txt`}),n)}function He(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}async function Me(e){let t=e.fetch??globalThis.fetch,n=(e.path??"/").trim(),r=n.startsWith("/")?n:`/${n}`,o=`${w(e.siteUrl)}/seo/jsonld?path=${encodeURIComponent(r)}`,i=await t(o);if(!i.ok)return null;let s=await i.json();return{jsonLd:s,scriptJson:He(JSON.stringify(s)),cacheTags:_(i.headers)}}async function Ue(e){let t=e.fetch??globalThis.fetch;try{let n=await t(`${w(e.siteUrl)}/seo/sitemap`);if(!n.ok)return null;let r=await n.json();return typeof r.siteUrl!="string"||!Array.isArray(r.urls)?null:{siteUrl:r.siteUrl,urls:r.urls,cacheTags:_(n.headers)}}catch{return null}}function G(e){function t(n){return De({siteUrl:e.siteUrl,framework:n.framework})}return{rewrites:t,jsonLd:(n="/")=>Me({siteUrl:e.siteUrl,path:n,fetch:e.fetch}),sitemapEntries:()=>Ue({siteUrl:e.siteUrl,fetch:e.fetch})}}function $e(e,t){return e.replace(/\{([^}]+)\}/g,(n,r)=>{let o=t?.[r];if(o==null)throw new Error(`@kanorio/sdk: missing path parameter "${r}" for ${e}`);return encodeURIComponent(String(o))})}function v(e){let t=n=>(r,o)=>{let i=o??{},s={query:i.query,body:i.body,headers:i.headers,signal:i.signal};return e.request(n,$e(r,i.params),s)};return{get:t("GET"),post:t("POST"),put:t("PUT"),patch:t("PATCH"),delete:t("DELETE"),http:e}}var J="x-kanorio-cache-tags";function Ne(e){let t=[],n=new Set;for(let r of e){let o=r.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t}function Q(e){return e?Ne(e.split(/\s+/)):[]}var Ve="x-kanorio-preview";function w(e){return`${e.replace(/\/+$/,"")}/api/v1`}function Z(e){let{siteUrl:t,previewToken:n,headers:r,...o}=e,s=v(S({...o,headers:n===void 0?r:async()=>{let l=new Headers(typeof r=="function"?await r():r),c=typeof n=="function"?await n():n;return c&&l.set(Ve,c),l},baseUrl:w(t)})),a=G({siteUrl:t,fetch:o.fetch});return Object.assign(s,{seo:a})}var X=J;function _(e){if(!e)return[];let t=typeof e.get=="function"?e.get(X):e[X]??e["X-Kanorio-Cache-Tags"];return Q(t)}function Fe(e){return`${e.replace(/\/+$/,"")}/api/v1/customer`}async function ee(e){let t=typeof e=="function"?await e():e;return t||null}function qe(e){let{siteUrl:t,token:n,headers:r,...o}=e,i=S({...o,baseUrl:Fe(t),headers:async()=>{let s=new Headers(r),a=await ee(n);return a&&s.set("authorization",`Bearer ${a}`),s}});return v(i)}var k="kanorio.customer.token";function je(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}function te(e,t=je()){try{e?t?.setItem(k,e):t?.removeItem(k)}catch{}}function b(e){return{...e,ok:!0}}function ne(e){let t=qe(e),n=S({...e,baseUrl:`${e.siteUrl.replace(/\/+$/,"")}/api/v1`}),r=o=>o instanceof m?{ok:!1,code:o.code,...o.availableAt?{availableAt:o.availableAt}:{}}:{ok:!1,code:"NETWORK_ERROR"};return{async openUnit(o,i,s){try{if(!await ee(e.token))return b(await n.request("POST",`units/${encodeURIComponent(o)}/open`,{body:{mode:i}}));let l=s?.attachmentId?{mode:i,attachmentId:s.attachmentId}:{mode:i};return b(await t.post("/units/{id}/open",{params:{id:o},query:e.locale?{locale:e.locale}:{},body:l}))}catch(a){return r(a)}},async reportProgress(o){try{return b(await t.post("/progress",{body:o}))}catch(i){return r(i)}},async submitQuiz(o){try{return b(await t.post("/units/{id}/quiz",{params:{id:o.unitId},body:{answers:o.answers}}))}catch(i){return r(i)}},async getCertificate(o){try{return b(await t.get("/deliverables/{deliverableId}/certificate",{params:{deliverableId:o}}))}catch(i){return r(i)}},async getTranscript(o,i){try{let s=i??e.locale;return b(await t.get("/units/{id}/transcript",{params:{id:o},query:s?{locale:s}:{}}))}catch(s){return r(s)}}}}var u=O(be(),1);var Be="en-US",I={ar:()=>import("./ar-JXAEXYYY.js"),bg:()=>import("./bg-EUIPVVBX.js"),bn:()=>import("./bn-L35GOE5D.js"),cs:()=>import("./cs-MGLMNU2K.js"),da:()=>import("./da-X5HKEDEL.js"),de:()=>import("./de-Y5ELIZBU.js"),el:()=>import("./el-YZGS3PLP.js"),"en-AU":()=>import("./en-AU-IUEA3YQP.js"),"en-CA":()=>import("./en-CA-OFK46Q44.js"),"en-GB":()=>import("./en-GB-VNG2IO2E.js"),"en-US":()=>import("./en-US-5RT4SJ3V.js"),en:()=>import("./en-MCRNEXQP.js"),"es-419":()=>import("./es-419-JFUQ3D4V.js"),"es-ES":()=>import("./es-ES-BMD6JJEO.js"),fa:()=>import("./fa-NE4XJTHW.js"),fi:()=>import("./fi-SCTIKRMX.js"),"fr-CA":()=>import("./fr-CA-RQDI3NIQ.js"),"fr-FR":()=>import("./fr-FR-KGXOTINP.js"),gu:()=>import("./gu-7AJCL43I.js"),he:()=>import("./he-UWYKIUPF.js"),hi:()=>import("./hi-KXKJMKZF.js"),hu:()=>import("./hu-YRF3KPIJ.js"),id:()=>import("./id-SXO4Z54V.js"),it:()=>import("./it-RBRELRA3.js"),ja:()=>import("./ja-2WRUVHKU.js"),km:()=>import("./km-SL6MZB3H.js"),kn:()=>import("./kn-YGEU3PSD.js"),ko:()=>import("./ko-2GI6Z5YH.js"),lo:()=>import("./lo-ZRV6OAH6.js"),ml:()=>import("./ml-BIZEFHNR.js"),mr:()=>import("./mr-PZNRW5MW.js"),ms:()=>import("./ms-NYWKJQEQ.js"),my:()=>import("./my-FHI5JEQF.js"),nb:()=>import("./nb-U4QN5GJE.js"),ne:()=>import("./ne-J3XQJZAY.js"),"nl-BE":()=>import("./nl-BE-VHBDCIRF.js"),"nl-NL":()=>import("./nl-NL-FZMZRVH4.js"),nn:()=>import("./nn-UCSEDGDB.js"),pa:()=>import("./pa-LTF7CWS2.js"),pl:()=>import("./pl-YWCG2YWW.js"),"pt-BR":()=>import("./pt-BR-5JRKIQVH.js"),"pt-PT":()=>import("./pt-PT-Y2UCAKHP.js"),ro:()=>import("./ro-6MQF2KY2.js"),ru:()=>import("./ru-KGU3SC3S.js"),si:()=>import("./si-CTQN6I2M.js"),sv:()=>import("./sv-QGZRDKBJ.js"),sw:()=>import("./sw-CWIRVHYD.js"),ta:()=>import("./ta-E3ZBHC6A.js"),te:()=>import("./te-7JC2KGAU.js"),th:()=>import("./th-JVK4E2AJ.js"),tl:()=>import("./tl-X72423V3.js"),tr:()=>import("./tr-22NUPSET.js"),uk:()=>import("./uk-POKPJJDZ.js"),ur:()=>import("./ur-6LBRTMAE.js"),vi:()=>import("./vi-XC4CGJHX.js"),"zh-CN":()=>import("./zh-CN-XW3PLUG5.js"),"zh-HK":()=>import("./zh-HK-25OZZBHO.js"),"zh-Hant":()=>import("./zh-Hant-LFJZCOMK.js")},At=Object.keys(I);function ze(e){return e&&e in I?e:Be}async function re(e){return(await I[ze(e)]()).default}var We="kanorio-elements",Ye="kanorio-popup",Ge="kanorio-part",C="data-kanorio-brand";function Dt(e,t,n){t?e.setAttribute("data-kanorio-theme",t):e.removeAttribute("data-kanorio-theme"),n?e.setAttribute(C,n):e.removeAttribute(C)}var Je=`:is(.${We}, .${Ye}, .${Ge})`,se=$,Ht=se.join(", "),oe=se.map(e=>`${e} *`).join(", "),ie=['[data-kanorio-theme="dark"]','[data-kanorio-theme="dark"] *',`[data-kanorio-theme="auto"]:where(${oe})`,`[data-kanorio-theme="auto"]:where(${oe}) *`].join(", "),ae='[data-kanorio-theme="auto"], [data-kanorio-theme="auto"] *';var dt=O(H(),1);U(M);var A="kanorio:token-change";function ue(e){let t=e?.replace(/\/+$/,"");if(t)return t;if(typeof window<"u")return window.location.origin;if(e)return"";throw new Error("@kanorio/elements: siteUrl is required outside the browser.")}function qt(e){let t=e?.replace(/\/+$/,"");return t||(typeof window<"u"?window.location.origin:null)}function Qe(e){return e||(typeof document<"u"&&document.documentElement.lang?document.documentElement.lang:"en")}var de=()=>()=>{},R=Object.freeze({value:null,failures:0,round:0}),Xe=()=>R;function pe(e){let t=new Map,n=new Map,r=new Set,o=0,i=()=>{for(let s of[...r])s()};return{entry:s=>t.get(s)??R,subscribe(s){return r.add(s),()=>{r.delete(s)}},load(s){let a=t.get(s);if(a&&a.value!==null)return Promise.resolve(a.value);let l=n.get(s);if(l)return l;let c=o,d=Promise.resolve().then(()=>e(s)).catch(()=>null).then(p=>{if(n.get(s)===d&&n.delete(s),c!==o)return p;let g=t.get(s)??R;return t.set(s,p===null?{...g,failures:g.failures+1}:{value:p,failures:g.failures,round:g.round}),i(),p});return n.set(s,d),d},clear(){o+=1;for(let[s,a]of t)t.set(s,{value:null,failures:a.failures,round:a.round+1});for(let s of n.keys())t.has(s)||t.set(s,{...R,round:1});n.clear(),i()},retryFailed(){let s=!1;for(let[a,l]of t)l.value!==null||n.has(a)||(t.set(a,{...l,round:l.round+1}),s=!0);s&&i()},reset(){o+=1,t.clear(),n.clear(),i()}}}function ge(e,t){let n=(0,u.useSyncExternalStore)(t===null?de:e.subscribe,()=>t===null?R:e.entry(t),Xe),[r,o]=(0,u.useState)(()=>({key:t,failures:t===null?0:e.entry(t).failures})),i=r;r.key!==t&&(i={key:t,failures:t===null?0:e.entry(t).failures},o(i));let s=t!==null&&n.value===null;(0,u.useEffect)(()=>{s&&t!==null&&e.load(t)},[e,t,s,n.round]);let a=t!==null&&n.value===null&&n.failures>i.failures;return(0,u.useMemo)(()=>({value:n.value,error:a}),[n.value,a])}var fe=pe(e=>re(e)),K=pe(e=>Z({siteUrl:e}).get("/site").then(t=>typeof t?.id=="string"?t:null));typeof window<"u"&&window.addEventListener("online",()=>{fe.retryFailed(),K.retryFailed()});function Ze(e,t=!0){let{value:n,error:r}=ge(fe,t?e:null),[o,i]=(0,u.useState)(null);n!==null&&(o===null||o.messages!==n||o.locale!==e)&&i({messages:n,locale:e});let s=n??o?.messages??null,a=n!==null?e:o?.locale??e;return(0,u.useMemo)(()=>({messages:s,locale:a,error:r}),[s,a,r])}function jt(e){return K.load(e)}function et(e,t=!0){let{value:n,error:r}=ge(K,t?e:null),[o,i]=(0,u.useState)(null);n!==null&&(o===null||o.site!==n||o.siteUrl!==e)&&i({site:n,siteUrl:e});let s=n??(t&&o?.siteUrl===e?o.site:null);return(0,u.useMemo)(()=>({site:s,error:r}),[s,r])}function me(e){let t=e.toLowerCase();return t.startsWith("zh-hans")||t.startsWith("zh-cn")||t.startsWith("zh-sg")?"zh-Hans":t.startsWith("zh")?"zh-Hant":t.startsWith("ja")?"ja":t.startsWith("ko")?"ko":"en"}function tt(e,t,n){let r=e.colors.primary.light,o=e.colors.primary.dark,i=Object.entries(e.radius).map(([d,p])=>`--site-radius-${d}: ${p};`).join(" "),s=me(t),a=e.fonts.find(d=>d.locales.includes(s))??e.fonts[0],l=a?`--site-font-family: ${a.family};`:"",c=`--brand-color: ${o.background}; --brand-foreground: ${o.foreground};`;return[`:where(${n}) { --brand-color: ${r.background}; --brand-foreground: ${r.foreground}; ${i} ${l} font-family: var(--site-font-family, inherit); }`,`:where(${n}):where(${ie}) { ${c} }`,`@media (prefers-color-scheme: dark) { :where(${n}):where(${ae}) { ${c} } }`].join(`
2
2
  `)}function nt(e,t){return`${e}-${me(t)}`}var rt=typeof window>"u"?u.useEffect:u.useLayoutEffect,le=new Map;function ot(e,t,n){let r=n&&e?.brand?nt(e.id,t):null;return rt(()=>{if(!r||!e?.brand||typeof document>"u")return;let o=le.get(r);if(o&&o.site===e&&o.style.isConnected)return;let i=`kanorio-brand-${r}`,s=tt(e.brand,t,`[${C}="${r}"]`),a=document.getElementById(i);a||(a=document.createElement("style"),a.id=i,document.head.appendChild(a)),a.textContent!==s&&(a.textContent=s);for(let l of e.brand.fonts){if(!l.stylesheetUrl)continue;let c=`link[data-kanorio-font="${CSS.escape(l.stylesheetUrl)}"]`;if(document.head.querySelector(c))continue;let d=document.createElement("link");d.rel="stylesheet",d.href=l.stylesheetUrl,d.dataset.kanorioFont=l.stylesheetUrl,document.head.appendChild(d)}le.set(r,{site:e,style:a})},[r,e,t]),r}var E=new Set;function T(){for(let e of[...E])e()}function st(e){return E.add(e),E.size===1&&(window.addEventListener("storage",T),window.addEventListener(A,T)),()=>{E.delete(e),E.size===0&&(window.removeEventListener("storage",T),window.removeEventListener(A,T))}}var he=null;function it(){try{return localStorage.getItem(k)}catch{return he}}var ce=()=>null;function ye(e){he=e;try{te(e)}catch{}typeof window<"u"&&window.dispatchEvent(new CustomEvent(A,{detail:{token:e}}))}function at(e){let[t,n]=(0,u.useState)({given:e,written:null}),r=t.written;t.given!==e&&(r=null,n({given:e,written:null}));let o=(0,u.useCallback)(i=>{n(s=>({given:s.given,written:{token:i}})),ye(i)},[]);return(0,u.useMemo)(()=>e===void 0?null:{token:r?r.token:e,setToken:o},[e,r,o])}function lt(e,t){let r=at(e)??t,o=(0,u.useSyncExternalStore)(r?de:st,r?ce:it,ce);return(0,u.useMemo)(()=>r??{token:o,setToken:ye},[r,o])}var L=(0,u.createContext)(null);function Bt(){return(0,u.useContext)(L)?.config??null}function zt(e){let t=(0,u.useContext)(L);return ue(e??t?.config.siteUrl)}function ct(e,t={}){let n=(0,u.useContext)(L),r={...n?.config,...ut(e)},o=ue(r.siteUrl),i=r.theme??"auto",s=r.timeZone??null,a=r.brand!==!1,{token:l,setToken:c}=lt(e.token,n?.token??null),d=Ze(Qe(r.locale)),p=d.locale,{site:g,error:f}=et(o,a||t.needsSite===!0),x=ot(g,p,a),h=(0,u.useMemo)(()=>ne({siteUrl:o,token:()=>l,locale:p}),[o,l,p]),y=d.messages,D=d.error;return(0,u.useMemo)(()=>({siteUrl:o,token:l,setToken:c,locale:p,theme:i,timeZone:s,messages:y,messagesError:D,client:h,brandScope:x,site:g,siteError:f}),[o,l,c,p,i,s,y,D,h,x,g,f])}function Wt(e={}){return ct(e)}function ut(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}export{m as a,Z as b,qe as c,te as d,ze as e,We as f,Ye as g,Ge as h,C as i,Dt as j,Ht as k,qt as l,Qe as m,Ze as n,jt as o,et as p,ot as q,Bt as r,zt as s,ct as t,Wt as u};
3
- //# sourceMappingURL=chunk-CMYBXWO5.js.map
3
+ //# sourceMappingURL=chunk-XJPS3G7J.js.map
@@ -1,2 +1,2 @@
1
- import{KanorioCurriculum}from"./chunk-CD7JDUB6.js";import"./chunk-5G3PQI25.js";import"./chunk-UITC3NFQ.js";import"./chunk-R5M6FXXQ.js";import"./chunk-4BEKWYEW.js";import"./chunk-OIKRLEW6.js";import"./chunk-33AQQY6T.js";import"./chunk-VUTODQFX.js";import"./chunk-QRKYFFDH.js";import"./chunk-KNNN5V3T.js";import"./chunk-763LNERD.js";import"./chunk-U7H3W23Q.js";import"./chunk-RI64PHGM.js";import"./chunk-Q4APVE7S.js";import"./chunk-CU2JJTXI.js";import"./chunk-3ZTUZPSD.js";export{KanorioCurriculum};
1
+ import{KanorioCurriculum}from"./chunk-VRD67HVO.js";import"./chunk-5G3PQI25.js";import"./chunk-UITC3NFQ.js";import"./chunk-UWRJBUJY.js";import"./chunk-4BEKWYEW.js";import"./chunk-OIKRLEW6.js";import"./chunk-33AQQY6T.js";import"./chunk-VUTODQFX.js";import"./chunk-7UCZ56EJ.js";import"./chunk-KNNN5V3T.js";import"./chunk-763LNERD.js";import"./chunk-U7H3W23Q.js";import"./chunk-73S6VKNV.js";import"./chunk-Q4APVE7S.js";import"./chunk-CU2JJTXI.js";import"./chunk-3ZTUZPSD.js";export{KanorioCurriculum};
2
2
  //# sourceMappingURL=curriculum.js.map
package/dist/form.js CHANGED
@@ -1,2 +1,2 @@
1
- import{KanorioForm,useKanorioForm}from"./chunk-SB5665ZK.js";import"./chunk-D4KDA3KL.js";import"./chunk-QF55WZDP.js";import"./chunk-SVWEVSYJ.js";import"./chunk-APWDEDWM.js";import"./chunk-RG5JA44V.js";import"./chunk-FFAWYDLJ.js";import"./chunk-E77WGXYW.js";import"./chunk-C7HUM2EN.js";import{FORM_SUBMIT_EVENT}from"./chunk-LWKCGUHS.js";import"./chunk-TEUQV3AT.js";import{KanorioBotProtection,KanorioBotProtectionAltcha,useKanorioBotProtection}from"./chunk-J5SMJRYC.js";import"./chunk-KYXZNMNA.js";import"./chunk-RKEHHJDU.js";import"./chunk-JH5D6YJX.js";import"./chunk-4BEKWYEW.js";import"./chunk-OIKRLEW6.js";import"./chunk-O2SYHUQF.js";import"./chunk-33AQQY6T.js";import"./chunk-VUTODQFX.js";import"./chunk-QRKYFFDH.js";import"./chunk-KNNN5V3T.js";import"./chunk-763LNERD.js";import"./chunk-U7H3W23Q.js";import"./chunk-RI64PHGM.js";import"./chunk-Q4APVE7S.js";import"./chunk-CU2JJTXI.js";import"./chunk-3ZTUZPSD.js";export{FORM_SUBMIT_EVENT,KanorioBotProtection,KanorioBotProtectionAltcha,KanorioForm,useKanorioBotProtection,useKanorioForm};
1
+ import{KanorioForm,useKanorioForm}from"./chunk-J24HGQ7U.js";import"./chunk-D4KDA3KL.js";import"./chunk-QF55WZDP.js";import"./chunk-SVWEVSYJ.js";import"./chunk-APWDEDWM.js";import"./chunk-RG5JA44V.js";import"./chunk-FFAWYDLJ.js";import"./chunk-E77WGXYW.js";import"./chunk-C7HUM2EN.js";import{FORM_SUBMIT_EVENT}from"./chunk-LWKCGUHS.js";import"./chunk-TEUQV3AT.js";import{KanorioBotProtection,KanorioBotProtectionAltcha,useKanorioBotProtection}from"./chunk-VT2B53EX.js";import"./chunk-KYXZNMNA.js";import"./chunk-RKEHHJDU.js";import"./chunk-JH5D6YJX.js";import"./chunk-4BEKWYEW.js";import"./chunk-OIKRLEW6.js";import"./chunk-O2SYHUQF.js";import"./chunk-33AQQY6T.js";import"./chunk-VUTODQFX.js";import"./chunk-7UCZ56EJ.js";import"./chunk-KNNN5V3T.js";import"./chunk-763LNERD.js";import"./chunk-U7H3W23Q.js";import"./chunk-73S6VKNV.js";import"./chunk-Q4APVE7S.js";import"./chunk-CU2JJTXI.js";import"./chunk-3ZTUZPSD.js";export{FORM_SUBMIT_EVENT,KanorioBotProtection,KanorioBotProtectionAltcha,KanorioForm,useKanorioBotProtection,useKanorioForm};
2
2
  //# sourceMappingURL=form.js.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{KanorioLogin,mapLoginErrorCode}from"./chunk-SGFVHVLE.js";import{KanorioMedia}from"./chunk-EGJ6SNTR.js";import{KanorioRating,KanorioReviews}from"./chunk-OWXGUUSI.js";import{KanorioUnit,playerLabelsFrom}from"./chunk-CIVS7LYU.js";import"./chunk-MC63CLSM.js";import{KanorioAccount,createBearerCustomerAuthTransport}from"./chunk-G5673RJK.js";import"./chunk-4OC7BRQS.js";import"./chunk-AQ6F6MIJ.js";import"./chunk-63XJWMJG.js";import{KanorioAnalytics,reportKanorioPageview}from"./chunk-WKKPZXK3.js";import{KanorioCurriculum}from"./chunk-CD7JDUB6.js";import"./chunk-5G3PQI25.js";import"./chunk-UITC3NFQ.js";import"./chunk-R5M6FXXQ.js";import{KanorioForm,useKanorioForm}from"./chunk-SB5665ZK.js";import"./chunk-D4KDA3KL.js";import"./chunk-QF55WZDP.js";import"./chunk-SVWEVSYJ.js";import"./chunk-APWDEDWM.js";import"./chunk-RG5JA44V.js";import"./chunk-FFAWYDLJ.js";import"./chunk-E77WGXYW.js";import"./chunk-C7HUM2EN.js";import{FORM_SUBMIT_EVENT,LOGIN_EVENT,LOGOUT_EVENT}from"./chunk-LWKCGUHS.js";import"./chunk-TEUQV3AT.js";import{KanorioBotProtection,KanorioBotProtectionAltcha,useKanorioBotProtection}from"./chunk-J5SMJRYC.js";import"./chunk-KYXZNMNA.js";import"./chunk-RKEHHJDU.js";import"./chunk-JH5D6YJX.js";import"./chunk-4BEKWYEW.js";import"./chunk-OIKRLEW6.js";import{KanorioLightbox}from"./chunk-HAHAYDYM.js";import"./chunk-OLGITMLA.js";import"./chunk-L66F3USG.js";import"./chunk-L3BUSP27.js";import"./chunk-Z4A5NQWJ.js";import"./chunk-HFYLTH5B.js";import"./chunk-O2SYHUQF.js";import"./chunk-33AQQY6T.js";import"./chunk-VUTODQFX.js";import"./chunk-QRKYFFDH.js";import"./chunk-KNNN5V3T.js";import"./chunk-763LNERD.js";import"./chunk-U7H3W23Q.js";import{KanorioProvider,TOKEN_CHANGE_EVENT,brandCss,clearSiteMetaCache,loadElementsMessages,loadSiteMeta,useKanorio,useSiteMeta}from"./chunk-RI64PHGM.js";import"./chunk-Q4APVE7S.js";import"./chunk-CU2JJTXI.js";import"./chunk-3ZTUZPSD.js";export{FORM_SUBMIT_EVENT,KanorioAccount,KanorioAnalytics,KanorioBotProtection,KanorioBotProtectionAltcha,KanorioCurriculum,KanorioForm,KanorioLightbox,KanorioLogin,KanorioMedia,KanorioProvider,KanorioRating,KanorioReviews,KanorioUnit,LOGIN_EVENT,LOGOUT_EVENT,TOKEN_CHANGE_EVENT,brandCss,clearSiteMetaCache,createBearerCustomerAuthTransport,loadElementsMessages,loadSiteMeta,mapLoginErrorCode,playerLabelsFrom,reportKanorioPageview,useKanorio,useKanorioBotProtection,useKanorioForm,useSiteMeta};
1
+ import{KanorioLogin,mapLoginErrorCode}from"./chunk-OSXFUIAV.js";import{KanorioMedia}from"./chunk-N4Y3DCC6.js";import{KanorioRating,KanorioReviews}from"./chunk-W5QS3RHM.js";import{KanorioUnit,playerLabelsFrom}from"./chunk-JYBSXLT3.js";import"./chunk-MC63CLSM.js";import{KanorioAccount,createBearerCustomerAuthTransport}from"./chunk-FXDWRWZ3.js";import"./chunk-4OC7BRQS.js";import"./chunk-AQ6F6MIJ.js";import"./chunk-63XJWMJG.js";import{KanorioAnalytics,reportKanorioPageview}from"./chunk-FFSPNYLJ.js";import{KanorioCurriculum}from"./chunk-VRD67HVO.js";import"./chunk-5G3PQI25.js";import"./chunk-UITC3NFQ.js";import"./chunk-UWRJBUJY.js";import{KanorioForm,useKanorioForm}from"./chunk-J24HGQ7U.js";import"./chunk-D4KDA3KL.js";import"./chunk-QF55WZDP.js";import"./chunk-SVWEVSYJ.js";import"./chunk-APWDEDWM.js";import"./chunk-RG5JA44V.js";import"./chunk-FFAWYDLJ.js";import"./chunk-E77WGXYW.js";import"./chunk-C7HUM2EN.js";import{FORM_SUBMIT_EVENT,LOGIN_EVENT,LOGOUT_EVENT}from"./chunk-LWKCGUHS.js";import"./chunk-TEUQV3AT.js";import{KanorioBotProtection,KanorioBotProtectionAltcha,useKanorioBotProtection}from"./chunk-VT2B53EX.js";import"./chunk-KYXZNMNA.js";import"./chunk-RKEHHJDU.js";import"./chunk-JH5D6YJX.js";import"./chunk-4BEKWYEW.js";import"./chunk-OIKRLEW6.js";import{KanorioLightbox}from"./chunk-A4ZGBTRT.js";import"./chunk-OLGITMLA.js";import"./chunk-L66F3USG.js";import"./chunk-L3BUSP27.js";import"./chunk-Z4A5NQWJ.js";import"./chunk-HFYLTH5B.js";import"./chunk-O2SYHUQF.js";import"./chunk-33AQQY6T.js";import"./chunk-VUTODQFX.js";import"./chunk-7UCZ56EJ.js";import"./chunk-KNNN5V3T.js";import"./chunk-763LNERD.js";import"./chunk-U7H3W23Q.js";import{KanorioProvider,TOKEN_CHANGE_EVENT,brandCss,clearSiteMetaCache,loadElementsMessages,loadSiteMeta,useKanorio,useSiteMeta}from"./chunk-73S6VKNV.js";import"./chunk-Q4APVE7S.js";import"./chunk-CU2JJTXI.js";import"./chunk-3ZTUZPSD.js";export{FORM_SUBMIT_EVENT,KanorioAccount,KanorioAnalytics,KanorioBotProtection,KanorioBotProtectionAltcha,KanorioCurriculum,KanorioForm,KanorioLightbox,KanorioLogin,KanorioMedia,KanorioProvider,KanorioRating,KanorioReviews,KanorioUnit,LOGIN_EVENT,LOGOUT_EVENT,TOKEN_CHANGE_EVENT,brandCss,clearSiteMetaCache,createBearerCustomerAuthTransport,loadElementsMessages,loadSiteMeta,mapLoginErrorCode,playerLabelsFrom,reportKanorioPageview,useKanorio,useKanorioBotProtection,useKanorioForm,useSiteMeta};
2
2
  //# sourceMappingURL=index.js.map