fumapress 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/cli/index.mjs +1 -1
- package/dist/waku/public/assets/Icon-DLjCXBap.js +1 -0
- package/dist/waku/public/assets/{Icon-D30p-2dq.js → Icon-uimJ5tpe.js} +1 -1
- package/dist/waku/public/assets/_root-BWpoCRFY.css +1 -0
- package/dist/waku/public/assets/{_root-BWh8XBln.js → _root-DcSLRIv8.js} +2 -2
- package/dist/waku/public/assets/{algolia-B1uhfuD6.js → algolia-akct_lCZ.js} +1 -1
- package/dist/waku/public/assets/{chevron-right-DmP6Xa1g.js → chevron-right-DJ6X4mXo.js} +1 -1
- package/dist/waku/public/assets/{client-BSFjekJY.js → client-DU5zOesq.js} +1 -1
- package/dist/waku/public/assets/{collapsible-B2rvGry7.js → collapsible-Bqzit3JO.js} +1 -1
- package/dist/waku/public/assets/{core-C4jOG9I2.js → core-BfOvCGca.js} +1 -1
- package/dist/waku/public/assets/{i18n-V4QzeUbV.js → i18n-BU0Gqrrh.js} +1 -1
- package/dist/waku/public/assets/{index-xXa72sZS.js → index-C3-lsDRv.js} +1 -1
- package/dist/waku/public/assets/{index-NB9D4S1v.js → index-CCR9ecA8.js} +1 -1
- package/dist/waku/public/assets/{index-DW9Fo86a.js → index-CWwHJATE.js} +1 -1
- package/dist/waku/public/assets/{index-BQZmdbam.js → index-CY9LswMc.js} +1 -1
- package/dist/waku/public/assets/{index-CYJW3hzB.js → index-Cae1bXCh.js} +1 -1
- package/dist/waku/public/assets/{index-Bojr-xLv.js → index-CkzHlXhF.js} +1 -1
- package/dist/waku/public/assets/{index-B-5ouVG_.js → index-DOC-_zsC.js} +1 -1
- package/dist/waku/public/assets/{index-B65N5043.js → index-DOsFxkYv.js} +1 -1
- package/dist/waku/public/assets/{index-DHENdpwd.js → index-DhgWLnXf.js} +1 -1
- package/dist/waku/public/assets/index-E12FLc8f.js +1 -0
- package/dist/waku/public/assets/{index-OFfnl8sH.js → index-Po1UZSgL.js} +3 -3
- package/dist/waku/public/assets/{index-2HLUYgxN.js → index-T_b7wuyJ.js} +5 -5
- package/dist/waku/public/assets/{index-CBSxJfFU.js → index-yiM3u0f9.js} +1 -1
- package/dist/waku/public/assets/{index-Bonlu0LX.js → index-zSjxh5o9.js} +1 -1
- package/dist/waku/public/assets/{link-item-BlYkot48.js → link-item-CAVxr8-m.js} +1 -1
- package/dist/waku/public/assets/{merge-refs-BIez66Kl.js → merge-refs-B7SuKGTI.js} +1 -1
- package/dist/waku/public/assets/{orama-cloud-CazpSeQ0.js → orama-cloud-D6HIyrrx.js} +1 -1
- package/dist/waku/public/assets/{orama-cloud-legacy-CINWERV2.js → orama-cloud-legacy-AQ__GML5.js} +1 -1
- package/dist/waku/public/assets/{orama-static-DwfVMMmc.js → orama-static-CyMYfAPj.js} +1 -1
- package/dist/waku/public/assets/{page-actions--VStSULV.js → page-actions-CcyvVvdr.js} +1 -1
- package/dist/waku/public/assets/{proxy-CWSxKwWP.js → proxy-DdABrE5r.js} +1 -1
- package/dist/waku/public/assets/{search-D1WUBd3N.js → search-AdRfsIll.js} +1 -1
- package/dist/waku/public/assets/{search-default-B2jTK1EC.js → search-default-B4NAC8AJ.js} +3 -3
- package/dist/waku/public/assets/{use-copy-button-BO3GBlwZ.js → use-copy-button-auHqSfgW.js} +1 -1
- package/dist/waku/public/assets/{x-CB1cQ-bo.js → x-Blg1xIpd.js} +1 -1
- package/dist/waku/server/__vite_rsc_assets_manifest.js +151 -151
- package/dist/waku/server/assets/{_...slugs_-8lFegkVB.js → _...slugs_-DF1SYPMg.js} +32 -30
- package/dist/waku/server/assets/_root-BWpoCRFY.css +1 -0
- package/dist/waku/server/assets/{_root-B7AMftRI.js → _root-BiaZL9xf.js} +1 -1
- package/dist/waku/server/assets/{ai-C1Bf8DXZ.js → ai-vEEzbqB8.js} +2 -2
- package/dist/waku/server/assets/{chat-CN1qUeN-.js → chat-DOZ_Cx8A.js} +202 -12
- package/dist/waku/server/assets/{image.webp-PNGidV2r.js → image.webp-BW_97iH9.js} +1 -1
- package/dist/waku/server/assets/{img-C2Ne7ke5.js → img-B-t2xy2h.js} +1 -1
- package/dist/waku/server/assets/{index-CtEJq0xW.js → index--w0er2WH.js} +5 -5
- package/dist/waku/server/assets/{index-AIo6cWfN.js → index-BK2ZBQW1.js} +132 -54
- package/dist/waku/server/assets/{index-dpJ5KyUl.js → index-BXqq5kje.js} +1 -1
- package/dist/waku/server/assets/{index-D6orYQqE.js → index-CoHTzFHF.js} +1 -1
- package/dist/waku/server/assets/{index-QgPg52ej.js → index-D32Kgl7D.js} +1 -1
- package/dist/waku/server/assets/{index-BtnFj3IN.js → index-DShTeblm.js} +1 -1
- package/dist/waku/server/assets/{index-DFPuXyRR.js → index-DWNJLNyX.js} +1 -1
- package/dist/waku/server/assets/{index-6LQQnOj9.js → index-eAdvdAYz.js} +1 -1
- package/dist/waku/server/assets/{search-BuYfcIgW.js → search-BHsWHDmx.js} +2 -2
- package/dist/waku/server/assets/{server-entry-inner-DrYrCg3c.js → server-entry-inner-CYeTE9pH.js} +230 -189
- package/dist/waku/server/assets/{token-BJQ71htz.js → token-Dc4bIZyb.js} +3 -3
- package/dist/waku/server/assets/{token-util-BdUbceAe.js → token-util-BDWFgKKT.js} +16 -16
- package/dist/waku/server/assets/{token-util-WrcienE5.js → token-util-yHc1UlLV.js} +2 -2
- package/dist/waku/server/build.js +1 -1
- package/dist/waku/server/index.js +1 -1
- package/dist/waku/server/ssr/__vite_rsc_assets_manifest.js +151 -151
- package/dist/waku/server/ssr/assets/{Icon-BkWS2wcn.js → Icon-CjkqongL.js} +2 -2
- package/dist/waku/server/ssr/assets/{core-CLB7CUo5.js → core-Ru16gShL.js} +3 -3
- package/dist/waku/server/ssr/assets/{index-CKMvBRnq.js → index-BFvm1zbH.js} +4 -4
- package/dist/waku/server/ssr/assets/{index-BggSP1CG.js → index-CTD5LS21.js} +3 -3
- package/dist/waku/server/ssr/assets/{index-F8Xj3Sj4.js → index-DR2zqaC5.js} +1 -1
- package/dist/waku/server/ssr/index.js +12 -13
- package/package.json +15 -15
- package/dist/waku/public/assets/Icon-C79MpmBL.js +0 -1
- package/dist/waku/public/assets/_root-CzUOgPm2.css +0 -1
- package/dist/waku/public/assets/index-B7lX48CB.js +0 -1
- package/dist/waku/server/assets/_root-CzUOgPm2.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-
|
|
2
|
-
import{I as nr}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-BfOvCGca.js","assets/index-CkdplsNl.js","assets/index-DOsFxkYv.js","assets/index-Po1UZSgL.js","assets/index-DOC-_zsC.js","assets/merge-refs-B7SuKGTI.js","assets/index-CkzHlXhF.js","assets/Icon-uimJ5tpe.js","assets/schemas-BzqjMV9-.js","assets/use-copy-button-auHqSfgW.js","assets/index-DhgWLnXf.js","assets/x-Blg1xIpd.js","assets/search-AdRfsIll.js","assets/index-Cae1bXCh.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{I as nr}from"./index-DOC-_zsC.js";import{m as sr,C as Ia,L as vt}from"./merge-refs-B7SuKGTI.js";import{g as _a,r as I,c as se,j as f,_ as yt,J as Ea}from"./index-Po1UZSgL.js";import{c as W,e as bt,u as it,k as Rt,j as ir,P as be,h as Q,i as or,f as Ca,d as ot,t as M,b as ge}from"./index-CkzHlXhF.js";import{a as Sa,t as Ta,u as z,s as w,_ as Ze,c as lr,b as Aa,r as Ee,o as D,l as E,e as L,d as Ra,f as Re,g as Na,n as Ma,h as X,i as O,j as ja}from"./schemas-BzqjMV9-.js";import{j as Da,k as Oa,o as xe,u as ve,l as xt,m as Ne,q as ur,w as wt,x as Ce,y as $,A as Pa,B as Fa,C as re,D as Ge,E as La,F as Nt,G as we,H as pe,I as za,t as cr,r as $a,a as Za,v as Ba}from"./index-DOsFxkYv.js";import{u as Va}from"./use-copy-button-auHqSfgW.js";import{u as dr}from"./index-DhgWLnXf.js";import{X as Ua}from"./x-Blg1xIpd.js";import{S as qa}from"./search-AdRfsIll.js";const Wa=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ja=W("circle-check",Wa);const Ga=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ha=W("circle-x",Ga);const Ya=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],Qa=W("clipboard",Ya);const Ka=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Xa=W("info",Ka);const en=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],tn=W("lightbulb",en);const rn=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],an=W("link",rn);const nn=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],sn=W("loader-circle",nn);const on=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],ln=W("message-circle",on);const un=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],cn=W("refresh-cw",un);const dn=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],pn=W("send",dn);const fn=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],mn=W("triangle-alert",fn);var pr="vercel.ai.error",hn=Symbol.for(pr),Mt,jt,G=class fr extends(jt=Error,Mt=hn,jt){constructor({name:t,message:r,cause:a}){super(r),this[Mt]=!0,this.name=t,this.cause=a}static isInstance(t){return fr.hasMarker(t,pr)}static hasMarker(t,r){const a=Symbol.for(r);return t!=null&&typeof t=="object"&&a in t&&typeof t[a]=="boolean"&&t[a]===!0}};function mr(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var hr="AI_InvalidArgumentError",gr=`vercel.ai.error.${hr}`,gn=Symbol.for(gr),Dt,Ot,vn=class extends(Ot=G,Dt=gn,Ot){constructor({message:e,cause:t,argument:r}){super({name:hr,message:e,cause:t}),this[Dt]=!0,this.argument=r}static isInstance(e){return G.hasMarker(e,gr)}},vr="AI_JSONParseError",yr=`vercel.ai.error.${vr}`,yn=Symbol.for(yr),Pt,Ft,Lt=class extends(Ft=G,Pt=yn,Ft){constructor({text:e,cause:t}){super({name:vr,message:`JSON parsing failed: Text: ${e}.
|
|
3
3
|
Error message: ${mr(t)}`,cause:t}),this[Pt]=!0,this.text=e}static isInstance(e){return G.hasMarker(e,yr)}},br="AI_TypeValidationError",xr=`vercel.ai.error.${br}`,bn=Symbol.for(xr),zt,$t,ye=class lt extends($t=G,zt=bn,$t){constructor({value:t,cause:r,context:a}){let n="Type validation failed";if(a?.field&&(n+=` for ${a.field}`),a?.entityName||a?.entityId){n+=" (";const s=[];a.entityName&&s.push(a.entityName),a.entityId&&s.push(`id: "${a.entityId}"`),n+=s.join(", "),n+=")"}super({name:br,message:`${n}: Value: ${JSON.stringify(t)}.
|
|
4
4
|
Error message: ${mr(r)}`,cause:r}),this[zt]=!0,this.value=t,this.context=a}static isInstance(t){return G.hasMarker(t,xr)}static wrap({value:t,cause:r,context:a}){var n,s,i;return lt.isInstance(r)&&r.value===t&&((n=r.context)==null?void 0:n.field)===a?.field&&((s=r.context)==null?void 0:s.entityName)===a?.entityName&&((i=r.context)==null?void 0:i.entityId)===a?.entityId?r:new lt({value:t,cause:r,context:a})}},Se;(function(e){e.assertEqual=n=>{};function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{const s={};for(const i of n)s[i]=i;return s},e.getValidEnumValues=n=>{const s=e.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of s)i[o]=n[o];return e.objectValues(i)},e.objectValues=n=>e.objectKeys(n).map(function(s){return n[s]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const s=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&s.push(i);return s},e.find=(n,s)=>{for(const i of n)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function a(n,s=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=a,e.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(Se||(Se={}));var Zt;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Zt||(Zt={}));Se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Se.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Be extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(s){return s.message},a={_errors:[]},n=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)a._errors.push(r(i));else{let o=a,u=0;for(;u<i.path.length;){const l=i.path[u];u===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(i))):o[l]=o[l]||{_errors:[]},o=o[l],u++}}};return n(this),a}static assert(t){if(!(t instanceof Be))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Se.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r=Object.create(null),a=[];for(const n of this.issues)if(n.path.length>0){const s=n.path[0];r[s]=r[s]||[],r[s].push(t(n))}else a.push(t(n));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}}Be.create=e=>new Be(e);var Bt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Bt||(Bt={}));var S;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(S||(S={}));class Vt extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}function He(e){}function xn(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=He,onError:r=He,onRetry:a=He,onComment:n}=e;let s="",i=!0,o,u="",l="";function p(b){const y=i?b.replace(/^\xEF\xBB\xBF/,""):b,[x,k]=wn(`${s}${y}`);for(const d of x)c(d);s=k,i=!1}function c(b){if(b===""){h();return}if(b.startsWith(":")){n&&n(b.slice(b.startsWith(": ")?2:1));return}const y=b.indexOf(":");if(y!==-1){const x=b.slice(0,y),k=b[y+1]===" "?2:1,d=b.slice(y+k);g(x,d,b);return}g(b,"",b)}function g(b,y,x){switch(b){case"event":l=y;break;case"data":u=`${u}${y}
|
|
5
5
|
`;break;case"id":o=y.includes("\0")?void 0:y;break;case"retry":/^\d+$/.test(y)?a(parseInt(y,10)):r(new Vt(`Invalid \`retry\` value: "${y}"`,{type:"invalid-retry",value:y,line:x}));break;default:r(new Vt(`Unknown field "${b.length>20?`${b.slice(0,20)}…`:b}"`,{type:"unknown-field",field:b,value:y,line:x}));break}}function h(){u.length>0&&t({id:o,event:l||void 0,data:u.endsWith(`
|
|
@@ -18,9 +18,9 @@ Error message: ${mr(r)}`,cause:r}),this[zt]=!0,this.value=t,this.context=a}stati
|
|
|
18
18
|
`)}function Zi(e){return e==null?"":String(e)}function Kt(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Bi(){return{enter:{table:Vi,tableData:Xt,tableHeader:Xt,tableRow:qi},exit:{codeText:Wi,table:Ui,tableData:rt,tableHeader:rt,tableRow:rt}}}function Vi(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function Ui(e){this.exit(e),this.data.inTable=void 0}function qi(e){this.enter({type:"tableRow",children:[]},e)}function rt(e){this.exit(e)}function Xt(e){this.enter({type:"tableCell",children:[]},e)}function Wi(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ji));const r=this.stack[this.stack.length-1];xe(r.type==="inlineCode"),r.value=t,this.exit(e)}function Ji(e,t){return t==="|"?t:e}function Gi(e){const t=e||{},r=t.tableCellPadding,a=t.tablePipeAlign,n=t.stringLength,s=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
19
19
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:i,tableCell:u,tableRow:o}};function i(h,m,b,y){return l(p(h,b,y),h.align)}function o(h,m,b,y){const x=c(h,b,y),k=l([x]);return k.slice(0,k.indexOf(`
|
|
20
20
|
`))}function u(h,m,b,y){const x=b.enter("tableCell"),k=b.enter("phrasing"),d=b.containerPhrasing(h,{...y,before:s,after:s});return k(),x(),d}function l(h,m){return $i(h,{align:m,alignDelimiters:a,padding:r,stringLength:n})}function p(h,m,b){const y=h.children;let x=-1;const k=[],d=m.enter("table");for(;++x<y.length;)k[x]=c(y[x],m,b);return d(),k}function c(h,m,b){const y=h.children;let x=-1;const k=[],d=m.enter("tableRow");for(;++x<y.length;)k[x]=u(y[x],h,m,b);return d(),k}function g(h,m,b){let y=ur.inlineCode(h,m,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Hi(){return{exit:{taskListCheckValueChecked:er,taskListCheckValueUnchecked:er,paragraph:Qi}}}function Yi(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ki}}}function er(e){const t=this.stack[this.stack.length-2];xe(t.type==="listItem"),t.checked=e.type==="taskListCheckValueChecked"}function Qi(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const r=this.stack[this.stack.length-1];xe(r.type==="paragraph");const a=r.children[0];if(a&&a.type==="text"){const n=t.children;let s=-1,i;for(;++s<n.length;){const o=n[s];if(o.type==="paragraph"){i=o;break}}i===r&&(a.value=a.value.slice(1),a.value.length===0?r.children.shift():r.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,r.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function Ki(e,t,r,a){const n=e.children[0],s=typeof e.checked=="boolean"&&n&&n.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",o=r.createTracker(a);s&&o.move(i);let u=ur.listItem(e,t,r,{...a,...o.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(p){return p+i}}function Xi(){return[ui(),Ri(),Di(),Bi(),Hi()]}function eo(e){return{extensions:[ci(),Ni(e),Oi(),Gi(e),Yi()]}}const to={tokenize:oo,partial:!0},Vr={tokenize:lo,partial:!0},Ur={tokenize:uo,partial:!0},qr={tokenize:co,partial:!0},ro={tokenize:po,partial:!0},Wr={name:"wwwAutolink",tokenize:so,previous:Gr},Jr={name:"protocolAutolink",tokenize:io,previous:Hr},K={name:"emailAutolink",tokenize:no,previous:Yr},H={};function ao(){return{text:H}}let oe=48;for(;oe<123;)H[oe]=K,oe++,oe===58?oe=65:oe===91&&(oe=97);H[43]=K;H[45]=K;H[46]=K;H[95]=K;H[72]=[K,Jr];H[104]=[K,Jr];H[87]=[K,Wr];H[119]=[K,Wr];function no(e,t,r){const a=this;let n,s;return i;function i(c){return!mt(c)||!Yr.call(a,a.previous)||_t(a.events)?r(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(c))}function o(c){return mt(c)?(e.consume(c),o):c===64?(e.consume(c),u):r(c)}function u(c){return c===46?e.check(ro,p,l)(c):c===45||c===95||wt(c)?(s=!0,e.consume(c),u):p(c)}function l(c){return e.consume(c),n=!0,u}function p(c){return s&&n&&Ce(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):r(c)}}function so(e,t,r){const a=this;return n;function n(i){return i!==87&&i!==119||!Gr.call(a,a.previous)||_t(a.events)?r(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(to,e.attempt(Vr,e.attempt(Ur,s),r),r)(i))}function s(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function io(e,t,r){const a=this;let n="",s=!1;return i;function i(c){return(c===72||c===104)&&Hr.call(a,a.previous)&&!_t(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),n+=String.fromCodePoint(c),e.consume(c),o):r(c)}function o(c){if(Ce(c)&&n.length<5)return n+=String.fromCodePoint(c),e.consume(c),o;if(c===58){const g=n.toLowerCase();if(g==="http"||g==="https")return e.consume(c),u}return r(c)}function u(c){return c===47?(e.consume(c),s?l:(s=!0,u)):r(c)}function l(c){return c===null||Pa(c)||$(c)||ve(c)||xt(c)?r(c):e.attempt(Vr,e.attempt(Ur,p),r)(c)}function p(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function oo(e,t,r){let a=0;return n;function n(i){return(i===87||i===119)&&a<3?(a++,e.consume(i),n):i===46&&a===3?(e.consume(i),s):r(i)}function s(i){return i===null?r(i):t(i)}}function lo(e,t,r){let a,n,s;return i;function i(l){return l===46||l===95?e.check(qr,u,o)(l):l===null||$(l)||ve(l)||l!==45&&xt(l)?u(l):(s=!0,e.consume(l),i)}function o(l){return l===95?a=!0:(n=a,a=void 0),e.consume(l),i}function u(l){return n||a||!s?r(l):t(l)}}function uo(e,t){let r=0,a=0;return n;function n(i){return i===40?(r++,e.consume(i),n):i===41&&a<r?s(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(qr,t,s)(i):i===null||$(i)||ve(i)?t(i):(e.consume(i),n)}function s(i){return i===41&&a++,e.consume(i),n}}function co(e,t,r){return a;function a(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),a):o===38?(e.consume(o),s):o===93?(e.consume(o),n):o===60||o===null||$(o)||ve(o)?t(o):r(o)}function n(o){return o===null||o===40||o===91||$(o)||ve(o)?t(o):a(o)}function s(o){return Ce(o)?i(o):r(o)}function i(o){return o===59?(e.consume(o),a):Ce(o)?(e.consume(o),i):r(o)}}function po(e,t,r){return a;function a(s){return e.consume(s),n}function n(s){return wt(s)?r(s):t(s)}}function Gr(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||$(e)}function Hr(e){return!Ce(e)}function Yr(e){return!(e===47||mt(e))}function mt(e){return e===43||e===45||e===46||e===95||wt(e)}function _t(e){let t=e.length,r=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){r=!0;break}if(a._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const fo={tokenize:wo,partial:!0};function mo(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yo,continuation:{tokenize:bo},exit:xo}},text:{91:{name:"gfmFootnoteCall",tokenize:vo},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ho,resolveTo:go}}}}function ho(e,t,r){const a=this;let n=a.events.length;const s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let i;for(;n--;){const u=a.events[n][1];if(u.type==="labelImage"){i=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!i||!i._balanced)return r(u);const l=Ne(a.sliceSerialize({start:i.end,end:a.now()}));return l.codePointAt(0)!==94||!s.includes(l.slice(1))?r(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function go(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},n={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};n.end.column++,n.end.offset++,n.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},n.end),end:Object.assign({},e[e.length-1][1].start)},i={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[r+1],e[r+2],["enter",a,t],e[r+3],e[r+4],["enter",n,t],["exit",n,t],["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(r,e.length-r+1,...o),e}function vo(e,t,r){const a=this,n=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let s=0,i;return o;function o(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?r(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(c){if(s>999||c===93&&!i||c===null||c===91||$(c))return r(c);if(c===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return n.includes(Ne(a.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(c)}return $(c)||(i=!0),s++,e.consume(c),c===92?p:l}function p(c){return c===91||c===92||c===93?(e.consume(c),s++,l):l(c)}}function yo(e,t,r){const a=this,n=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let s,i=0,o;return u;function u(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):r(m)}function p(m){if(i>999||m===93&&!o||m===null||m===91||$(m))return r(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=Ne(a.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return $(m)||(o=!0),i++,e.consume(m),m===92?c:p}function c(m){return m===91||m===92||m===93?(e.consume(m),i++,p):p(m)}function g(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),n.includes(s)||n.push(s),re(e,h,"gfmFootnoteDefinitionWhitespace")):r(m)}function h(m){return t(m)}}function bo(e,t,r){return e.check(Fa,t,e.attempt(fo,t,r))}function xo(e){e.exit("gfmFootnoteDefinition")}function wo(e,t,r){const a=this;return re(e,n,"gfmFootnoteDefinitionIndent",5);function n(s){const i=a.events[a.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?t(s):r(s)}}function ko(e){let r=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:s,resolveAll:n};return r==null&&(r=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function n(i,o){let u=-1;for(;++u<i.length;)if(i[u][0]==="enter"&&i[u][1].type==="strikethroughSequenceTemporary"&&i[u][1]._close){let l=u;for(;l--;)if(i[l][0]==="exit"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._open&&i[u][1].end.offset-i[u][1].start.offset===i[l][1].end.offset-i[l][1].start.offset){i[u][1].type="strikethroughSequence",i[l][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},i[l][1].start),end:Object.assign({},i[u][1].end)},c={type:"strikethroughText",start:Object.assign({},i[l][1].end),end:Object.assign({},i[u][1].start)},g=[["enter",p,o],["enter",i[l][1],o],["exit",i[l][1],o],["enter",c,o]],h=o.parser.constructs.insideSpan.null;h&&Ge(g,g.length,0,La(h,i.slice(l+1,u),o)),Ge(g,g.length,0,[["exit",c,o],["enter",i[u][1],o],["exit",i[u][1],o],["exit",p,o]]),Ge(i,l-1,u-l+3,g),u=l+g.length-2;break}}for(u=-1;++u<i.length;)i[u][1].type==="strikethroughSequenceTemporary"&&(i[u][1].type="data");return i}function s(i,o,u){const l=this.previous,p=this.events;let c=0;return g;function g(m){return l===126&&p[p.length-1][1].type!=="characterEscape"?u(m):(i.enter("strikethroughSequenceTemporary"),h(m))}function h(m){const b=Nt(l);if(m===126)return c>1?u(m):(i.consume(m),c++,h);if(c<2&&!r)return u(m);const y=i.exit("strikethroughSequenceTemporary"),x=Nt(m);return y._open=!x||x===2&&!!b,y._close=!b||b===2&&!!x,o(m)}}}class Io{constructor(){this.map=[]}add(t,r,a){_o(this,t,r,a)}consume(t){if(this.map.sort(function(s,i){return s[0]-i[0]}),this.map.length===0)return;let r=this.map.length;const a=[];for(;r>0;)r-=1,a.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];a.push(t.slice()),t.length=0;let n=a.pop();for(;n;){for(const s of n)t.push(s);n=a.pop()}this.map.length=0}}function _o(e,t,r,a){let n=0;if(!(r===0&&a.length===0)){for(;n<e.map.length;){if(e.map[n][0]===t){e.map[n][1]+=r,e.map[n][2].push(...a);return}n+=1}e.map.push([t,r,a])}}function Eo(e,t){let r=!1;const a=[];for(;t<e.length;){const n=e[t];if(r){if(n[0]==="enter")n[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(n[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=a.length-1;a[s]=a[s]==="left"?"center":"right"}}else if(n[1].type==="tableDelimiterRow")break}else n[0]==="enter"&&n[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return a}function Co(){return{flow:{null:{name:"table",tokenize:So,resolveAll:To}}}}function So(e,t,r){const a=this;let n=0,s=0,i;return o;function o(v){let Y=a.events.length-1;for(;Y>-1;){const Je=a.events[Y][1].type;if(Je==="lineEnding"||Je==="linePrefix")Y--;else break}const Oe=Y>-1?a.events[Y][1].type:null,Pe=Oe==="tableHead"||Oe==="tableRow"?_:u;return Pe===_&&a.parser.lazy[a.now().line]?r(v):Pe(v)}function u(v){return e.enter("tableHead"),e.enter("tableRow"),l(v)}function l(v){return v===124||(i=!0,s+=1),p(v)}function p(v){return v===null?r(v):we(v)?s>1?(s=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),h):r(v):pe(v)?re(e,p,"whitespace")(v):(s+=1,i&&(i=!1,n+=1),v===124?(e.enter("tableCellDivider"),e.consume(v),e.exit("tableCellDivider"),i=!0,p):(e.enter("data"),c(v)))}function c(v){return v===null||v===124||$(v)?(e.exit("data"),p(v)):(e.consume(v),v===92?g:c)}function g(v){return v===92||v===124?(e.consume(v),c):c(v)}function h(v){return a.interrupt=!1,a.parser.lazy[a.now().line]?r(v):(e.enter("tableDelimiterRow"),i=!1,pe(v)?re(e,m,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):m(v))}function m(v){return v===45||v===58?y(v):v===124?(i=!0,e.enter("tableCellDivider"),e.consume(v),e.exit("tableCellDivider"),b):T(v)}function b(v){return pe(v)?re(e,y,"whitespace")(v):y(v)}function y(v){return v===58?(s+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(v),e.exit("tableDelimiterMarker"),x):v===45?(s+=1,x(v)):v===null||we(v)?C(v):T(v)}function x(v){return v===45?(e.enter("tableDelimiterFiller"),k(v)):T(v)}function k(v){return v===45?(e.consume(v),k):v===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(v),e.exit("tableDelimiterMarker"),d):(e.exit("tableDelimiterFiller"),d(v))}function d(v){return pe(v)?re(e,C,"whitespace")(v):C(v)}function C(v){return v===124?m(v):v===null||we(v)?!i||n!==s?T(v):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(v)):T(v)}function T(v){return r(v)}function _(v){return e.enter("tableRow"),A(v)}function A(v){return v===124?(e.enter("tableCellDivider"),e.consume(v),e.exit("tableCellDivider"),A):v===null||we(v)?(e.exit("tableRow"),t(v)):pe(v)?re(e,A,"whitespace")(v):(e.enter("data"),N(v))}function N(v){return v===null||v===124||$(v)?(e.exit("data"),A(v)):(e.consume(v),v===92?B:N)}function B(v){return v===92||v===124?(e.consume(v),N):N(v)}}function To(e,t){let r=-1,a=!0,n=0,s=[0,0,0,0],i=[0,0,0,0],o=!1,u=0,l,p,c;const g=new Io;for(;++r<e.length;){const h=e[r],m=h[1];h[0]==="enter"?m.type==="tableHead"?(o=!1,u!==0&&(tr(g,t,u,l,p),p=void 0,u=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},g.add(r,0,[["enter",l,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(a=!0,c=void 0,s=[0,0,0,0],i=[0,r+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},g.add(r,0,[["enter",p,t]])),n=m.type==="tableDelimiterRow"?2:p?3:1):n&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(a=!1,i[2]===0&&(s[1]!==0&&(i[0]=i[1],c=Fe(g,t,s,n,void 0,c),s=[0,0,0,0]),i[2]=r)):m.type==="tableCellDivider"&&(a?a=!1:(s[1]!==0&&(i[0]=i[1],c=Fe(g,t,s,n,void 0,c)),s=i,i=[s[1],r,0,0])):m.type==="tableHead"?(o=!0,u=r):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=r,s[1]!==0?(i[0]=i[1],c=Fe(g,t,s,n,r,c)):i[1]!==0&&(c=Fe(g,t,i,n,r,c)),n=0):n&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(i[3]=r)}for(u!==0&&tr(g,t,u,l,p),g.consume(t.events),r=-1;++r<t.events.length;){const h=t.events[r];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=Eo(t.events,r))}return e}function Fe(e,t,r,a,n,s){const i=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",o="tableContent";r[0]!==0&&(s.end=Object.assign({},he(t.events,r[0])),e.add(r[0],0,[["exit",s,t]]));const u=he(t.events,r[1]);if(s={type:i,start:Object.assign({},u),end:Object.assign({},u)},e.add(r[1],0,[["enter",s,t]]),r[2]!==0){const l=he(t.events,r[2]),p=he(t.events,r[3]),c={type:o,start:Object.assign({},l),end:Object.assign({},p)};if(e.add(r[2],0,[["enter",c,t]]),a!==2){const g=t.events[r[2]],h=t.events[r[3]];if(g[1].end=Object.assign({},h[1].end),g[1].type="chunkText",g[1].contentType="text",r[3]>r[2]+1){const m=r[2]+1,b=r[3]-r[2]-1;e.add(m,b,[])}}e.add(r[3]+1,0,[["exit",c,t]])}return n!==void 0&&(s.end=Object.assign({},he(t.events,n)),e.add(n,0,[["exit",s,t]]),s=void 0),s}function tr(e,t,r,a,n){const s=[],i=he(t.events,r);n&&(n.end=Object.assign({},i),s.push(["exit",n,t])),a.end=Object.assign({},i),s.push(["exit",a,t]),e.add(r+1,0,s)}function he(e,t){const r=e[t],a=r[0]==="enter"?"start":"end";return r[1][a]}const Ao={name:"tasklistCheck",tokenize:No};function Ro(){return{text:{91:Ao}}}function No(e,t,r){const a=this;return n;function n(u){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?r(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),s)}function s(u){return $(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),i):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),i):r(u)}function i(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):r(u)}function o(u){return we(u)?t(u):pe(u)?e.check({tokenize:Mo},t,r)(u):r(u)}}function Mo(e,t,r){return re(e,a,"whitespace");function a(n){return n===null?r(n):t(n)}}function jo(e){return za([ao(),mo(),ko(e),Co(),Ro()])}const Do={};function Oo(e){const t=this,r=e||Do,a=t.data(),n=a.micromarkExtensions||(a.micromarkExtensions=[]),s=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),i=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);n.push(jo(r)),s.push(Xi()),i.push(eo(r))}function Po(e){const t=e+"CollectionProvider",[r,a]=bt(t),[n,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=b=>{const{scope:y,children:x}=b,k=se.useRef(null),d=se.useRef(new Map).current;return f.jsx(n,{scope:y,itemMap:d,collectionRef:k,children:x})};i.displayName=t;const o=e+"CollectionSlot",u=Rt(o),l=se.forwardRef((b,y)=>{const{scope:x,children:k}=b,d=s(o,x),C=it(y,d.collectionRef);return f.jsx(u,{ref:C,children:k})});l.displayName=o;const p=e+"CollectionItemSlot",c="data-radix-collection-item",g=Rt(p),h=se.forwardRef((b,y)=>{const{scope:x,children:k,...d}=b,C=se.useRef(null),T=it(y,C),_=s(p,x);return se.useEffect(()=>(_.itemMap.set(C,{ref:C,...d}),()=>{_.itemMap.delete(C)})),f.jsx(g,{[c]:"",ref:T,children:k})});h.displayName=p;function m(b){const y=s(e+"CollectionConsumer",b);return se.useCallback(()=>{const k=y.collectionRef.current;if(!k)return[];const d=Array.from(k.querySelectorAll(`[${c}]`));return Array.from(y.itemMap.values()).sort((_,A)=>d.indexOf(_.ref.current)-d.indexOf(A.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:l,ItemSlot:h},m,a]}var at="rovingFocusGroup.onEntryFocus",Fo={bubbles:!1,cancelable:!0},De="RovingFocusGroup",[ht,Qr,Lo]=Po(De),[zo,Kr]=bt(De,[Lo]),[$o,Zo]=zo(De),Xr=I.forwardRef((e,t)=>f.jsx(ht.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(ht.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Bo,{...e,ref:t})})}));Xr.displayName=De;var Bo=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:a,loop:n=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:p=!1,...c}=e,g=I.useRef(null),h=it(t,g),m=dr(s),[b,y]=or({prop:i,defaultProp:o??null,onChange:u,caller:De}),[x,k]=I.useState(!1),d=Ca(l),C=Qr(r),T=I.useRef(!1),[_,A]=I.useState(0);return I.useEffect(()=>{const N=g.current;if(N)return N.addEventListener(at,d),()=>N.removeEventListener(at,d)},[d]),f.jsx($o,{scope:r,orientation:a,dir:m,loop:n,currentTabStopId:b,onItemFocus:I.useCallback(N=>y(N),[y]),onItemShiftTab:I.useCallback(()=>k(!0),[]),onFocusableItemAdd:I.useCallback(()=>A(N=>N+1),[]),onFocusableItemRemove:I.useCallback(()=>A(N=>N-1),[]),children:f.jsx(be.div,{tabIndex:x||_===0?-1:0,"data-orientation":a,...c,ref:h,style:{outline:"none",...e.style},onMouseDown:Q(e.onMouseDown,()=>{T.current=!0}),onFocus:Q(e.onFocus,N=>{const B=!T.current;if(N.target===N.currentTarget&&B&&!x){const v=new CustomEvent(at,Fo);if(N.currentTarget.dispatchEvent(v),!v.defaultPrevented){const Y=C().filter(ne=>ne.focusable),Oe=Y.find(ne=>ne.active),Pe=Y.find(ne=>ne.id===b),ka=[Oe,Pe,...Y].filter(Boolean).map(ne=>ne.ref.current);ra(ka,p)}}T.current=!1}),onBlur:Q(e.onBlur,()=>k(!1))})})}),ea="RovingFocusGroupItem",ta=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:a=!0,active:n=!1,tabStopId:s,children:i,...o}=e,u=ir(),l=s||u,p=Zo(ea,r),c=p.currentTabStopId===l,g=Qr(r),{onFocusableItemAdd:h,onFocusableItemRemove:m,currentTabStopId:b}=p;return I.useEffect(()=>{if(a)return h(),()=>m()},[a,h,m]),f.jsx(ht.ItemSlot,{scope:r,id:l,focusable:a,active:n,children:f.jsx(be.span,{tabIndex:c?0:-1,"data-orientation":p.orientation,...o,ref:t,onMouseDown:Q(e.onMouseDown,y=>{a?p.onItemFocus(l):y.preventDefault()}),onFocus:Q(e.onFocus,()=>p.onItemFocus(l)),onKeyDown:Q(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){p.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=qo(y,p.orientation,p.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let d=g().filter(C=>C.focusable).map(C=>C.ref.current);if(x==="last")d.reverse();else if(x==="prev"||x==="next"){x==="prev"&&d.reverse();const C=d.indexOf(y.currentTarget);d=p.loop?Wo(d,C+1):d.slice(C+1)}setTimeout(()=>ra(d))}}),children:typeof i=="function"?i({isCurrentTabStop:c,hasTabStop:b!=null}):i})})});ta.displayName=ea;var Vo={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Uo(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function qo(e,t,r){const a=Uo(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return Vo[a]}function ra(e,t=!1){const r=document.activeElement;for(const a of e)if(a===r||(a.focus({preventScroll:t}),document.activeElement!==r))return}function Wo(e,t){return e.map((r,a)=>e[(t+a)%e.length])}var Jo=Xr,Go=ta,qe="Tabs",[Ho]=bt(qe,[Kr]),aa=Kr(),[Yo,Et]=Ho(qe),na=I.forwardRef((e,t)=>{const{__scopeTabs:r,value:a,onValueChange:n,defaultValue:s,orientation:i="horizontal",dir:o,activationMode:u="automatic",...l}=e,p=dr(o),[c,g]=or({prop:a,onChange:n,defaultProp:s??"",caller:qe});return f.jsx(Yo,{scope:r,baseId:ir(),value:c,onValueChange:g,orientation:i,dir:p,activationMode:u,children:f.jsx(be.div,{dir:p,"data-orientation":i,...l,ref:t})})});na.displayName=qe;var sa="TabsList",ia=I.forwardRef((e,t)=>{const{__scopeTabs:r,loop:a=!0,...n}=e,s=Et(sa,r),i=aa(r);return f.jsx(Jo,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:a,children:f.jsx(be.div,{role:"tablist","aria-orientation":s.orientation,...n,ref:t})})});ia.displayName=sa;var oa="TabsTrigger",la=I.forwardRef((e,t)=>{const{__scopeTabs:r,value:a,disabled:n=!1,...s}=e,i=Et(oa,r),o=aa(r),u=da(i.baseId,a),l=pa(i.baseId,a),p=a===i.value;return f.jsx(Go,{asChild:!0,...o,focusable:!n,active:p,children:f.jsx(be.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":l,"data-state":p?"active":"inactive","data-disabled":n?"":void 0,disabled:n,id:u,...s,ref:t,onMouseDown:Q(e.onMouseDown,c=>{!n&&c.button===0&&c.ctrlKey===!1?i.onValueChange(a):c.preventDefault()}),onKeyDown:Q(e.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&i.onValueChange(a)}),onFocus:Q(e.onFocus,()=>{const c=i.activationMode!=="manual";!p&&!n&&c&&i.onValueChange(a)})})})});la.displayName=oa;var ua="TabsContent",ca=I.forwardRef((e,t)=>{const{__scopeTabs:r,value:a,forceMount:n,children:s,...i}=e,o=Et(ua,r),u=da(o.baseId,a),l=pa(o.baseId,a),p=a===o.value,c=I.useRef(p);return I.useEffect(()=>{const g=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(g)},[]),f.jsx(ot,{present:n||p,children:({present:g})=>f.jsx(be.div,{"data-state":p?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:l,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:c.current?"0s":void 0},children:g&&s})})});ca.displayName=ua;function da(e,t){return`${e}-trigger-${t}`}function pa(e,t){return`${e}-content-${t}`}const nt=new Map,fa=I.createContext(null);function Qo(){const e=I.use(fa);if(!e)throw new Error("You must wrap your component in <Tabs>");return e}const Ko=ia,Xo=la;function el({ref:e,groupId:t,persist:r=!1,updateAnchor:a=!1,defaultValue:n,value:s,onValueChange:i,...o}){const u=I.useRef(null),l=I.useMemo(()=>new Map,[]),[p,c]=s===void 0?I.useState(n):[s,I.useEffectEvent(g=>i?.(g))];return I.useLayoutEffect(()=>{if(!t)return;let g=sessionStorage.getItem(t);r&&(g??=localStorage.getItem(t)),g&&c(g);const h=nt.get(t)??new Set;return h.add(c),nt.set(t,h),()=>{h.delete(c)}},[t,r,c]),I.useLayoutEffect(()=>{const g=window.location.hash.slice(1);if(g){for(const[h,m]of l.entries())if(m===g){c(h),u.current?.scrollIntoView();break}}},[c,l]),f.jsx(na,{ref:sr(e,u),value:p,onValueChange:g=>{if(a){const h=l.get(g);h&&window.history.replaceState(null,"",`#${h}`)}if(t){const h=nt.get(t);if(h)for(const m of h)m(g);sessionStorage.setItem(t,g),r&&localStorage.setItem(t,g)}else c(g)},...o,children:f.jsx(fa,{value:I.useMemo(()=>({valueToIdMap:l}),[l]),children:o.children})})}function tl({value:e,...t}){const{valueToIdMap:r}=Qo();return t.id&&r.set(e,t.id),f.jsx(ca,{value:e,...t,children:t.children})}const gt=I.createContext(null);function Ct(e){return f.jsx("pre",{...e,className:M("min-w-full w-max *:flex *:flex-col",e.className),children:e.children})}function St({ref:e,title:t,allowCopy:r=!0,keepBackground:a=!1,icon:n,viewportProps:s={},children:i,Actions:o=l=>f.jsx("div",{...l,className:M("empty:hidden",l.className)}),...u}){const l=I.use(gt)!==null,p=I.useRef(null);return f.jsxs("figure",{ref:e,dir:"ltr",...u,tabIndex:-1,className:M(l?"bg-fd-secondary -mx-px -mb-px last:rounded-b-xl":"my-4 bg-fd-card rounded-xl",a&&"bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)","shiki relative border shadow-sm not-prose overflow-hidden text-sm",u.className),children:[t?f.jsxs("div",{className:"flex text-fd-muted-foreground items-center gap-2 h-9.5 border-b px-4",children:[typeof n=="string"?f.jsx("div",{className:"[&_svg]:size-3.5",dangerouslySetInnerHTML:{__html:n}}):n,f.jsx("figcaption",{className:"flex-1 truncate",children:t}),o({className:"-me-2",children:r&&f.jsx(rr,{containerRef:p})})]}):o({className:"absolute top-3 right-2 z-2 backdrop-blur-lg rounded-lg text-fd-muted-foreground",children:r&&f.jsx(rr,{containerRef:p})}),f.jsx("div",{ref:p,...s,role:"region",tabIndex:0,className:M("text-[0.8125rem] py-3.5 overflow-auto max-h-[600px] fd-scroll-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-fd-ring",s.className),style:{"--padding-right":t?void 0:"calc(var(--spacing) * 8)",counterSet:u["data-line-numbers"]?`line ${Number(u["data-line-numbers-start"]??1)-1}`:void 0,...s.style},children:i})]})}function rr({className:e,containerRef:t,...r}){const[a,n]=Va(()=>{const s=t.current?.getElementsByTagName("pre").item(0);if(!s)return;const i=s.cloneNode(!0);i.querySelectorAll(".nd-copy-ignore").forEach(o=>{o.replaceWith(`
|
|
21
|
-
`)}),navigator.clipboard.writeText(i.textContent??"")});return f.jsx("button",{type:"button","data-checked":a||void 0,className:M(ge({className:"hover:text-fd-accent-foreground data-checked:text-fd-accent-foreground",size:"icon-xs"}),e),"aria-label":a?"Copied Text":"Copy Text",onClick:n,...r,children:a?f.jsx(Ia,{}):f.jsx(Qa,{})})}function ma({ref:e,...t}){const r=I.useRef(null),a=I.use(gt)!==null;return f.jsx(el,{ref:sr(r,e),...t,className:M("bg-fd-card rounded-xl border",!a&&"my-4",t.className),children:f.jsx(gt,{value:I.useMemo(()=>({containerRef:r,nested:a}),[a]),children:t.children})})}function ha(e){return f.jsx(Ko,{...e,className:M("flex flex-row px-2 overflow-x-auto text-fd-muted-foreground",e.className),children:e.children})}function ga({children:e,...t}){return f.jsxs(Xo,{...t,className:M("relative group inline-flex text-sm font-medium text-nowrap items-center transition-colors gap-2 px-2 py-1.5 hover:text-fd-accent-foreground data-[state=active]:text-fd-primary [&_svg]:size-3.5",t.className),children:[f.jsx("div",{className:"absolute inset-x-2 bottom-0 h-px group-data-[state=active]:bg-fd-primary"}),e]})}function va(e){return f.jsx(tl,{...e})}async function rl(e,t){const{isSpecialTheme:r}=await yt(async()=>{const{isSpecialTheme:n}=await import("./core-
|
|
22
|
-
`).map((n,s)=>f.jsx("span",{className:"line",children:n},s))})})}const cl=nl({async init(e){const{createHighlighter:t,createJavaScriptRegexEngine:r}=await yt(async()=>{const{createHighlighter:a,createJavaScriptRegexEngine:n}=await import("./index-
|
|
23
|
-
`})]})}const Rl={user:"you",assistant:"fumadocs"};function Nl({message:e,...t}){let r="";const a=[];for(const n of e.parts??[]){if(n.type==="text"){r+=n.text;continue}if(n.type.startsWith("tool-")){const s=n.type.slice(5),i=n;if(s!=="search"||!i.toolCallId)continue;a.push(i)}}return f.jsxs("div",{onClick:n=>n.stopPropagation(),...t,children:[f.jsx("p",{className:M("mb-1 text-sm font-medium text-fd-muted-foreground",e.role==="assistant"&&"text-fd-primary"),children:Rl[e.role]??"unknown"}),f.jsx("div",{className:"prose text-sm",children:f.jsx(Il,{text:r})}),a.map(n=>f.jsxs("div",{className:"flex flex-row gap-2 items-center mt-3 rounded-lg border bg-fd-secondary text-fd-muted-foreground text-xs p-2",children:[f.jsx(qa,{className:"size-4"}),n.state==="output-error"||n.state==="output-denied"?f.jsx("p",{className:"text-fd-error",children:n.errorText??"Failed to search"}):f.jsx("p",{children:n.output?`${n.output.length} search results`:"Searching…"})]},n.toolCallId))]})}function Ml({children:e}){const[t,r]=I.useState(!1),a=ai({id:"search",transport:new Fr({api:"/api/chat"})});return f.jsx(Tt,{value:I.useMemo(()=>({chat:a,open:t,setOpen:r}),[a,t]),children:e})}function jl({position:e="default",className:t,...r}){const{open:a,setOpen:n}=We();return f.jsx("button",{"data-state":a?"open":"closed",className:M(e==="float"&&["fixed bottom-4 gap-3 w-24
|
|
21
|
+
`)}),navigator.clipboard.writeText(i.textContent??"")});return f.jsx("button",{type:"button","data-checked":a||void 0,className:M(ge({className:"hover:text-fd-accent-foreground data-checked:text-fd-accent-foreground",size:"icon-xs"}),e),"aria-label":a?"Copied Text":"Copy Text",onClick:n,...r,children:a?f.jsx(Ia,{}):f.jsx(Qa,{})})}function ma({ref:e,...t}){const r=I.useRef(null),a=I.use(gt)!==null;return f.jsx(el,{ref:sr(r,e),...t,className:M("bg-fd-card rounded-xl border",!a&&"my-4",t.className),children:f.jsx(gt,{value:I.useMemo(()=>({containerRef:r,nested:a}),[a]),children:t.children})})}function ha(e){return f.jsx(Ko,{...e,className:M("flex flex-row px-2 overflow-x-auto text-fd-muted-foreground",e.className),children:e.children})}function ga({children:e,...t}){return f.jsxs(Xo,{...t,className:M("relative group inline-flex text-sm font-medium text-nowrap items-center transition-colors gap-2 px-2 py-1.5 hover:text-fd-accent-foreground data-[state=active]:text-fd-primary [&_svg]:size-3.5",t.className),children:[f.jsx("div",{className:"absolute inset-x-2 bottom-0 h-px group-data-[state=active]:bg-fd-primary"}),e]})}function va(e){return f.jsx(tl,{...e})}async function rl(e,t){const{isSpecialTheme:r}=await yt(async()=>{const{isSpecialTheme:n}=await import("./core-BfOvCGca.js");return{isSpecialTheme:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),a=t.filter(n=>{if(r(n))return!1;try{return e.getTheme(n),!1}catch{return!0}});a.length>0&&await e.loadTheme(...a)}function al(e){return"theme"in e?[e.theme]:Object.values(e.themes).filter(t=>t!==void 0)}function nl(e){let t;return{init(r){return t=e.init(r)},getOrInit(){return t??this.init()}}}async function sl(e,t,r){const{fallbackLanguage:a="text",...n}=r,{isSpecialLang:s}=await yt(async()=>{const{isSpecialLang:i}=await import("./core-BfOvCGca.js");return{isSpecialLang:i}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]));return!s(n.lang)&&!(n.lang in e.getBundledLanguages())&&!e.getLoadedLanguages().includes(n.lang)&&(n.lang=a),await Promise.all([rl(e,al(n)),e.loadLanguage(n.lang)]),e.codeToHast(t,n)}function il(e,t,r,a){const[n,s]=I.useState(r.defaultValue),i=I.useRef(null);return I.useEffect(()=>{async function o(){return cr(await sl(typeof e=="function"?await e():e,t,r),{...Ea,components:r.components})}const u=o();return i.current=u,u.then(l=>{i.current===u&&s(l)}),()=>{i.current=null}},a),n}const ya=I.createContext(void 0);function ol(e){const t=I.use(ya);return f.jsx(St,{...e,...t,className:M("my-0",e.className,t?.className),children:f.jsx(Ct,{children:e.children})})}function ll({lang:e,code:t,codeblock:r,options:a,wrapInSuspense:n=!0,highlighter:s}){const i=I.useId(),o={lang:e,defaultColor:!1,...a,components:{pre:ol,...a.components}};let u=il(s,t,o,[i,e,t]);return n&&(u??=f.jsx(ul,{code:t,components:o.components})),f.jsx(ya,{value:r,children:u})}function ul({code:e,components:t={}}){const{pre:r="pre",code:a="code"}=t;return f.jsx(r,{children:f.jsx(a,{children:e.split(`
|
|
22
|
+
`).map((n,s)=>f.jsx("span",{className:"line",children:n},s))})})}const cl=nl({async init(e){const{createHighlighter:t,createJavaScriptRegexEngine:r}=await yt(async()=>{const{createHighlighter:a,createJavaScriptRegexEngine:n}=await import("./index-Cae1bXCh.js");return{createHighlighter:a,createJavaScriptRegexEngine:n}},__vite__mapDeps([13,3,0,1,2,4,5,6,7,8,9,10,11,12]));return t({langs:[],themes:[],langAlias:e?.langAlias,engine:r()})}});function dl(e){return f.jsx(ll,{highlighter:()=>cl.getOrInit(),options:{themes:{light:"github-light",dark:"github-dark"}},...e})}function pl(e){return f.jsx("div",{...e,className:M("grid grid-cols-2 gap-3 @container",e.className),children:e.children})}function fl({icon:e,title:t,description:r,...a}){return f.jsxs(a.href?vt:"div",{...a,"data-card":!0,className:M("block rounded-xl border bg-fd-card p-4 text-fd-card-foreground transition-colors @max-lg:col-span-full",a.href&&"hover:bg-fd-accent/80",a.className),children:[e?f.jsx("div",{className:"not-prose mb-2 w-fit shadow-md rounded-lg border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4",children:e}):null,f.jsx("h3",{className:"not-prose mb-1 text-sm font-medium",children:t}),r?f.jsx("p",{className:"my-0! text-sm text-fd-muted-foreground",children:r}):null,f.jsx("div",{className:"text-sm text-fd-muted-foreground prose-no-margin empty:hidden",children:a.children})]})}const Le="size-5 -me-0.5 fill-(--callout-color) text-fd-card";function ml({children:e,title:t,...r}){return f.jsxs(ba,{...r,children:[t&&f.jsx(xa,{children:t}),f.jsx(wa,{children:e})]})}function hl(e){return e==="warn"?"warning":e==="tip"?"info":e}function ba({type:e="info",icon:t,children:r,className:a,style:n,...s}){const i=hl(e);return f.jsxs("div",{className:M("flex gap-2 my-4 rounded-xl border bg-fd-card p-3 ps-1 text-sm text-fd-card-foreground shadow-md",a),style:{"--callout-color":`var(--color-fd-${i}, var(--color-fd-muted))`,...n},...s,children:[f.jsx("div",{role:"none",className:"w-0.5 bg-(--callout-color)/50 rounded-sm"}),t??{info:f.jsx(Xa,{className:Le}),warning:f.jsx(mn,{className:Le}),error:f.jsx(Ha,{className:Le}),success:f.jsx(Ja,{className:Le}),idea:f.jsx(tn,{className:"size-5 -me-0.5 fill-(--callout-color) text-(--callout-color)"})}[i],f.jsx("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:r})]})}function xa({children:e,className:t,...r}){return f.jsx("p",{className:M("font-medium my-0!",t),...r,children:e})}function wa({children:e,className:t,...r}){return f.jsx("div",{className:M("text-fd-muted-foreground prose-no-margin empty:hidden",t),...r,children:e})}function de({as:e,className:t,...r}){const a=e??"h1";return r.id?f.jsxs(a,{className:M("flex scroll-m-28 flex-row items-center gap-2",t),...r,children:[f.jsx("a",{"data-card":"",href:`#${r.id}`,className:"peer",children:r.children}),f.jsx(an,{"aria-hidden":!0,className:"size-3.5 shrink-0 text-fd-muted-foreground opacity-0 transition-opacity peer-hover:opacity-100"})]}):f.jsx(a,{className:t,...r})}function gl(e){return f.jsx(nr,{sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px",...e,className:M("rounded-lg",e.className)})}function vl(e){return f.jsx("div",{className:"relative overflow-auto prose-no-margin my-6",children:f.jsx("table",{...e})})}const yl={CodeBlockTab:va,CodeBlockTabs:ma,CodeBlockTabsList:ha,CodeBlockTabsTrigger:ga,pre:e=>f.jsx(St,{...e,children:f.jsx(Ct,{children:e.children})}),Card:fl,Cards:pl,a:vt,img:gl,h1:e=>f.jsx(de,{as:"h1",...e}),h2:e=>f.jsx(de,{as:"h2",...e}),h3:e=>f.jsx(de,{as:"h3",...e}),h4:e=>f.jsx(de,{as:"h4",...e}),h5:e=>f.jsx(de,{as:"h5",...e}),h6:e=>f.jsx(de,{as:"h6",...e}),table:vl,Callout:ml,CalloutContainer:ba,CalloutTitle:xa,CalloutDescription:wa};function bl(){return e=>{Ba(e,["text","element"],(t,r,a)=>{if(t.type==="element"&&t.tagName==="pre")return"skip";if(t.type!=="text"||!a||r===void 0)return;const s=t.value.split(/(?=\s)/).flatMap(i=>i.length===0?[]:{type:"element",tagName:"span",properties:{class:"animate-fd-fade-in"},children:[{type:"text",value:i}]});return Object.assign(t,{type:"element",tagName:"span",properties:{},children:s}),"skip"})}}function xl(){const e=$a().use(Oo).use(Za).use(bl);return{async process(t){const r=e.parse({value:t}),a=await e.run(r);return cr(a,{development:!1,jsx:f.jsx,jsxs:f.jsxs,Fragment:f.Fragment,components:{...yl,pre:wl,img:void 0}})}}}function wl(e){const r=I.Children.only(e.children).props,a=r.children;if(typeof a!="string")return null;let n=r.className?.split(" ").find(s=>s.startsWith("language-"))?.slice(9)??"text";return n==="mdx"&&(n="md"),f.jsx(dl,{lang:n,code:a.trimEnd()})}const kl=xl();function Il({text:e}){const t=I.useDeferredValue(e);return f.jsx(I.Suspense,{fallback:f.jsx("p",{className:"invisible",children:e}),children:f.jsx(_l,{text:t})})}const ar=new Map;function _l({text:e}){const t=ar.get(e)??kl.process(e);return ar.set(e,t),I.use(t)}const Tt=I.createContext(null);function El({className:e,...t}){const{setOpen:r}=We();return f.jsxs("div",{className:M("sticky top-0 flex items-start gap-2 border rounded-xl bg-fd-secondary text-fd-secondary-foreground shadow-sm",e),...t,children:[f.jsxs("div",{className:"px-3 py-2 flex-1",children:[f.jsx("p",{className:"text-sm font-medium mb-2",children:"AI Chat"}),f.jsx("p",{className:"text-xs text-fd-muted-foreground",children:"AI can be inaccurate, please verify the answers."})]}),f.jsx("button",{"aria-label":"Close",tabIndex:-1,className:M(ge({size:"icon-sm",color:"ghost",className:"text-fd-muted-foreground rounded-full"})),onClick:()=>r(!1),children:f.jsx(Ua,{})})]})}function Cl(){const{messages:e,status:t,setMessages:r,regenerate:a}=At(),n=t==="streaming";return e.length===0?null:f.jsxs(f.Fragment,{children:[!n&&e.at(-1)?.role==="assistant"&&f.jsxs("button",{type:"button",className:M(ge({color:"secondary",size:"sm",className:"rounded-full gap-1.5"})),onClick:()=>a(),children:[f.jsx(cn,{className:"size-4"}),"Retry"]}),f.jsx("button",{type:"button",className:M(ge({color:"secondary",size:"sm",className:"rounded-full"})),onClick:()=>r([]),children:"Clear Chat"})]})}const st="__ai_search_input";function Sl(e){const{status:t,sendMessage:r,stop:a}=At(),[n,s]=I.useState(()=>localStorage.getItem(st)??""),i=t==="streaming"||t==="submitted",o=u=>{u?.preventDefault(),r({text:n}),s(""),localStorage.removeItem(st)};return I.useEffect(()=>{i&&document.getElementById("nd-ai-input")?.focus()},[i]),f.jsxs("form",{...e,className:M("flex items-start pe-2",e.className),onSubmit:o,children:[f.jsx(Al,{value:n,placeholder:i?"AI is answering...":"Ask a question",autoFocus:!0,className:"p-3",disabled:t==="streaming"||t==="submitted",onChange:u=>{s(u.target.value),localStorage.setItem(st,u.target.value)},onKeyDown:u=>{!u.shiftKey&&u.key==="Enter"&&o(u)}}),i?f.jsxs("button",{type:"button",className:M(ge({color:"secondary",className:"transition-all rounded-full mt-2 gap-2"})),onClick:a,children:[f.jsx(sn,{className:"size-4 animate-spin text-fd-muted-foreground"}),"Abort Answer"]},"bn"):f.jsx("button",{type:"submit",className:M(ge({color:"primary",className:"transition-all rounded-full mt-2"})),disabled:n.length===0,children:f.jsx(pn,{className:"size-4"})},"bn")]})}function Tl(e){const t=I.useRef(null);return I.useEffect(()=>{if(!t.current)return;function r(){const s=t.current;s&&s.scrollTo({top:s.scrollHeight,behavior:"instant"})}const a=new ResizeObserver(r);r();const n=t.current?.firstElementChild;return n&&a.observe(n),()=>{a.disconnect()}},[]),f.jsx("div",{ref:t,...e,className:M("fd-scroll-container overflow-y-auto min-w-0 flex flex-col",e.className),children:e.children})}function Al(e){const t=I.useRef(null),r=M("col-start-1 row-start-1",e.className);return f.jsxs("div",{className:"grid flex-1",children:[f.jsx("textarea",{id:"nd-ai-input",...e,className:M("resize-none bg-transparent placeholder:text-fd-muted-foreground focus-visible:outline-none",r)}),f.jsx("div",{ref:t,className:M(r,"break-all invisible"),children:`${e.value?.toString()??""}
|
|
23
|
+
`})]})}const Rl={user:"you",assistant:"fumadocs"};function Nl({message:e,...t}){let r="";const a=[];for(const n of e.parts??[]){if(n.type==="text"){r+=n.text;continue}if(n.type.startsWith("tool-")){const s=n.type.slice(5),i=n;if(s!=="search"||!i.toolCallId)continue;a.push(i)}}return f.jsxs("div",{onClick:n=>n.stopPropagation(),...t,children:[f.jsx("p",{className:M("mb-1 text-sm font-medium text-fd-muted-foreground",e.role==="assistant"&&"text-fd-primary"),children:Rl[e.role]??"unknown"}),f.jsx("div",{className:"prose text-sm",children:f.jsx(Il,{text:r})}),a.map(n=>f.jsxs("div",{className:"flex flex-row gap-2 items-center mt-3 rounded-lg border bg-fd-secondary text-fd-muted-foreground text-xs p-2",children:[f.jsx(qa,{className:"size-4"}),n.state==="output-error"||n.state==="output-denied"?f.jsx("p",{className:"text-fd-error",children:n.errorText??"Failed to search"}):f.jsx("p",{children:n.output?`${n.output.length} search results`:"Searching…"})]},n.toolCallId))]})}function Ml({children:e}){const[t,r]=I.useState(!1),a=ai({id:"search",transport:new Fr({api:"/api/chat"})});return f.jsx(Tt,{value:I.useMemo(()=>({chat:a,open:t,setOpen:r}),[a,t]),children:e})}function jl({position:e="default",className:t,...r}){const{open:a,setOpen:n}=We();return f.jsx("button",{"data-state":a?"open":"closed",className:M(e==="float"&&["fixed bottom-4 gap-3 w-24 inset-e-[calc(--spacing(4)+var(--removed-body-scroll-bar-size,0px))] shadow-lg z-20 transition-[translate,opacity]",a&&"translate-y-10 opacity-0"],t),onClick:()=>n(!a),...r,children:r.children})}function Dl(){const{open:e,setOpen:t}=We();return Pl(),f.jsxs(f.Fragment,{children:[f.jsx("style",{children:`
|
|
24
24
|
@keyframes ask-ai-open {
|
|
25
25
|
from {
|
|
26
26
|
translate: 100% 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,u as y,d as z,C as R,e as q,i as J,f as K,g as Q,_ as X}from"./collapsible-
|
|
1
|
+
import{c as S,u as y,d as z,C as R,e as q,i as J,f as K,g as Q,_ as X}from"./collapsible-Bqzit3JO.js";import{I as O,u as v}from"./i18n-BU0Gqrrh.js";import{t as l,b as Y}from"./index-CkzHlXhF.js";import{u as T,c as k,d as D,T as P,a as Z,b as W,e as ee,f as te,C as se,S as re,V as I,M as L}from"./page-actions-CcyvVvdr.js";import{u as oe}from"./client-DU5zOesq.js";import{r as m,j as e}from"./index-Po1UZSgL.js";import"./index-zSjxh5o9.js";import{a as ne}from"./index-DOC-_zsC.js";import{L as B}from"./merge-refs-B7SuKGTI.js";import{C as E}from"./chevron-right-DJ6X4mXo.js";import"./index-C3-lsDRv.js";import"./Icon-uimJ5tpe.js";import"./use-copy-button-auHqSfgW.js";import"./link-item-CAVxr8-m.js";import"./search-AdRfsIll.js";import"./index-DhgWLnXf.js";function ae(t){return e.jsx(W,{...t})}function ce({container:t,header:r,footer:s,style:a="normal"}){const o=T(),{TOCItems:d,TOCEmpty:i,TOCItem:c}=a==="clerk"?k:D;return e.jsxs("div",{id:"nd-toc",...t,className:l("sticky top-(--fd-docs-row-1) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] flex flex-col [grid-area:toc] w-(--fd-toc-width) pt-12 pe-4 pb-2 max-xl:hidden",t?.className),children:[r,e.jsxs("h3",{id:"toc-title",className:"inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground",children:[e.jsx(Z,{className:"size-4"}),e.jsx(O,{label:"toc"})]}),e.jsx(P,{children:e.jsxs(d,{children:[o.length===0&&e.jsx(i,{}),o.map(n=>e.jsx(c,{item:n},n.url))]})}),s]})}const M=m.createContext(null);function ie({container:t,trigger:r,content:s,header:a,footer:o,style:d="normal"}){const i=T(),c=m.useRef(null),[n,u]=m.useState(!1),{isNavTransparent:p}=oe(),{TOCItems:f,TOCItem:g,TOCEmpty:j}=d==="clerk"?k:D,x=m.useEffectEvent(h=>{!n||!(h.target instanceof HTMLElement)||c.current&&!c.current.contains(h.target)&&u(!1)}),U=()=>{u(!1)};return m.useEffect(()=>(window.addEventListener("click",x),()=>{window.removeEventListener("click",x)}),[]),e.jsx(M,{value:m.useMemo(()=>({open:n,setOpen:u}),[u,n]),children:e.jsx(S,{open:n,onOpenChange:u,"data-toc-popover":"",...t,className:l("sticky top-(--fd-docs-row-2) z-10 [grid-area:toc-popover] h-(--fd-toc-popover-height) xl:hidden max-xl:layout:[--fd-toc-popover-height:--spacing(10)]",t?.className),children:e.jsxs("header",{ref:c,className:l("border-b backdrop-blur-sm transition-colors",(!p||n)&&"bg-fd-background/80",n&&"shadow-lg"),children:[e.jsx(le,{...r}),e.jsxs(me,{...s,children:[a,e.jsx(P,{children:e.jsxs(f,{children:[i.length===0&&e.jsx(j,{}),i.map(h=>e.jsx(g,{item:h,onClick:U},h.url))]})}),o]})]})})})}function le({className:t,...r}){const{text:s}=v(),{open:a}=m.use(M),o=ee(),d=o.findIndex(n=>n.active),i=y().at(-1),c=d!==-1&&!a;return e.jsxs(z,{className:l("flex w-full h-10 items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:size-4 md:px-6",t),"data-toc-popover-trigger":"",...r,children:[e.jsx(ue,{value:(d+1)/Math.max(1,o.length),max:1,className:l("shrink-0",a&&"text-fd-primary")}),e.jsxs("span",{className:"grid flex-1 *:my-auto *:row-start-1 *:col-start-1",children:[e.jsx("span",{className:l("truncate transition-[opacity,translate,color]",a&&"text-fd-foreground",c&&"opacity-0 -translate-y-full pointer-events-none"),children:i?.name??s.toc}),e.jsx("span",{className:l("truncate transition-[opacity,translate]",!c&&"opacity-0 translate-y-full pointer-events-none"),children:o[d]?.original.title})]}),e.jsx(R,{className:l("shrink-0 transition-transform mx-0.5",a&&"rotate-180")})]})}function de(t,r,s){return t<r?r:t>s?s:t}function ue({value:t,strokeWidth:r=2,size:s=24,min:a=0,max:o=100,...d}){const i=de(t,a,o),c=(s-r)/2,n=2*Math.PI*c,u=i/o*n,p={cx:s/2,cy:s/2,r:c,fill:"none",strokeWidth:r};return e.jsxs("svg",{role:"progressbar",viewBox:`0 0 ${s} ${s}`,"aria-valuenow":i,"aria-valuemin":a,"aria-valuemax":o,...d,children:[e.jsx("circle",{...p,className:"stroke-current/25"}),e.jsx("circle",{...p,stroke:"currentColor",strokeDasharray:n,strokeDashoffset:n-u,strokeLinecap:"round",transform:`rotate(-90 ${s/2} ${s/2})`,className:"transition-all"})]})}function me(t){return e.jsx(q,{"data-toc-popover-content":"",...t,children:e.jsx("div",{className:"flex flex-col px-4 max-h-[50vh] md:px-6",children:t.children})})}function C({items:t,children:r,className:s,...a}){const o=te(),d=ne(),{previous:i,next:c}=m.useMemo(()=>{if(t)return t;const n=o.findIndex(u=>J(u.url,d));return n===-1?{}:{previous:o[n-1],next:o[n+1]}},[o,t,d]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:l("@container grid gap-4",i&&c?"grid-cols-2":"grid-cols-1",s),...a,children:[i&&e.jsx(w,{item:i,index:0}),c&&e.jsx(w,{item:c,index:1})]}),r]})}function w({item:t,index:r}){const{text:s}=v(),a=r===0?se:E;return e.jsxs(B,{href:t.url,className:l("flex flex-col gap-2 rounded-lg border p-4 text-sm transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground @max-lg:col-span-full",r===1&&"text-end"),children:[e.jsxs("div",{className:l("inline-flex items-center gap-1.5 font-medium",r===1&&"flex-row-reverse"),children:[e.jsx(a,{className:"-mx-1 size-4 shrink-0 rtl:rotate-180"}),e.jsx("p",{children:t.name})]}),e.jsx("p",{className:"text-fd-muted-foreground truncate",children:t.description??(r===0?s.previousPage:s.nextPage)})]})}function b({includeRoot:t,includeSeparator:r,includePage:s,...a}){const o=y(),{root:d}=K(),i=m.useMemo(()=>Q(d,o,{includePage:s,includeSeparator:r,includeRoot:t}),[s,t,r,o,d]);return i.length===0?null:e.jsx("div",{...a,className:l("flex items-center gap-1.5 text-sm text-fd-muted-foreground",a.className),children:i.map((c,n)=>{const u=l("truncate",n===i.length-1&&"text-fd-primary font-medium");return e.jsxs(m.Fragment,{children:[n!==0&&e.jsx(E,{className:"size-3.5 shrink-0"}),c.url?e.jsx(B,{href:c.url,className:l(u,"transition-opacity hover:opacity-80"),children:c.name}):e.jsx("span",{className:u,children:c.name})]},n)})})}function xe(t){const{props:{full:r}}=N();return e.jsx("article",{id:"nd-page","data-full":r,...t,className:l("flex flex-col w-full max-w-[900px] mx-auto [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14",r?"max-w-[1168px]":"xl:layout:[--fd-toc-width:268px]",t.className),children:t.children})}var pe=X({DocsBody:()=>$,DocsDescription:()=>A,DocsPage:()=>F,DocsTitle:()=>G,EditOnGitHub:()=>V,MarkdownCopyButton:()=>L,PageBreadcrumb:()=>b,PageFooter:()=>C,PageLastUpdate:()=>H,ViewOptionsPopover:()=>I,useDocsPage:()=>N});const _=m.createContext(null);function N(){const t=m.use(_);if(!t)throw new Error("Please use page components under <DocsPage /> (`fumadocs-ui/layouts/docs/page`).");return t}function F({tableOfContent:{enabled:t,single:r,...s}={},tableOfContentPopover:{enabled:a,...o}={},breadcrumb:{enabled:d=!0,...i}={},footer:{enabled:c=!0,...n}={},full:u=!1,toc:p=[],slots:f={},children:g,...j}){t??=!!(!u&&(p.length>0||s.footer||s.header)),a??=!!(p.length>0||o.header||o.footer);const x={breadcrumb:f.breadcrumb??b,footer:f.footer??C,toc:f.toc??{provider:ae,main:ce,popover:ie},container:f.container??xe};return e.jsx(_,{value:{props:{full:u},slots:x},children:e.jsxs(x.toc.provider,{single:r,toc:t||a?p:[],children:[a&&(o.component??e.jsx(x.toc.popover,{...o})),e.jsxs(x.container,{...j,children:[d&&(i.component??e.jsx(x.breadcrumb,{...i})),g,c&&(n.component??e.jsx(x.footer,{...n}))]}),t&&(s.component??e.jsx(x.toc.main,{...s}))]})})}function V(t){return e.jsx("a",{target:"_blank",rel:"noreferrer noopener",...t,className:l(Y({color:"secondary",size:"sm"}),"gap-1.5 not-prose",t.className),children:t.children??e.jsxs(e.Fragment,{children:[e.jsx(re,{className:"size-3.5"}),e.jsx(O,{label:"editOnGithub"})]})})}function $({children:t,className:r,...s}){return e.jsx("div",{...s,className:l("prose flex-1",r),children:t})}function A({children:t,className:r,...s}){return t===void 0?null:e.jsx("p",{...s,className:l("mb-8 text-lg text-fd-muted-foreground",r),children:t})}function G({children:t,className:r,...s}){return e.jsx("h1",{...s,className:l("text-[1.75em] font-semibold",r),children:t})}function H({date:t,...r}){const{text:s}=v(),[a,o]=m.useState("");return m.useEffect(()=>{o(t.toLocaleDateString())},[t]),e.jsxs("p",{...r,className:l("text-sm text-fd-muted-foreground",r.className),children:[s.lastUpdate," ",a]})}const Le={DocsBody:$,DocsDescription:A,DocsPage:F,DocsTitle:G,EditOnGitHub:V,MarkdownCopyButton:L,PageBreadcrumb:b,PageFooter:C,PageLastUpdate:H,ViewOptionsPopover:I,page_exports:pe,useDocsPage:N};export{Le as export_598340e25603};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,j as C}from"./index-
|
|
1
|
+
import{r as t,j as C}from"./index-Po1UZSgL.js";const I=t.createContext({enabled:!1,open:!1,hotKey:[],setOpenSearch:()=>{}});function Q(){return t.use(I)}function D(){const[e,r]=t.useState("⌘");return t.useEffect(()=>{window.navigator.userAgent.includes("Windows")&&r("Ctrl")},[]),e}function U({SearchDialog:e,children:r,preload:s=!0,options:f,hotKey:u=[{key:n=>n.metaKey||n.ctrlKey,display:C.jsx(D,{})},{key:"k",display:"K"}],links:o}){const[n,h]=t.useState(s?!1:void 0),a=t.useEffectEvent(y=>{u.every(d=>typeof d.key=="string"?y.key===d.key:d.key(y))&&(h(d=>!d),y.preventDefault())});return t.useEffect(()=>(window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}),[u]),C.jsxs(I,{value:t.useMemo(()=>({enabled:!0,open:n??!1,hotKey:u,setOpenSearch:h}),[n,u]),children:[n!==void 0&&C.jsx(t.Suspense,{fallback:null,children:C.jsx(e,{open:n,onOpenChange:h,links:o,...f})}),r]})}var H=(e,r,s,f,u,o,n,h)=>{let a=document.documentElement,y=["light","dark"];function d(l){(Array.isArray(e)?e:[e]).forEach(p=>{let g=p==="class",T=g&&o?u.map(w=>o[w]||w):u;g?(a.classList.remove(...T),a.classList.add(o&&o[l]?o[l]:l)):a.setAttribute(p,l)}),x(l)}function x(l){h&&y.includes(l)&&(a.style.colorScheme=l)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(f)d(f);else try{let l=localStorage.getItem(r)||s,p=n&&l==="system"?m():l;d(p)}catch{}},j=["light","dark"],K="(prefers-color-scheme: dark)",N=typeof window>"u",A=t.createContext(void 0),V={setTheme:e=>{},themes:[]},q=()=>{var e;return(e=t.useContext(A))!=null?e:V},B=e=>t.useContext(A)?t.createElement(t.Fragment,null,e.children):t.createElement(z,{...e}),_=["light","dark"],z=({forcedTheme:e,disableTransitionOnChange:r=!1,enableSystem:s=!0,enableColorScheme:f=!0,storageKey:u="theme",themes:o=_,defaultTheme:n=s?"system":"light",attribute:h="data-theme",value:a,children:y,nonce:d,scriptProps:x})=>{let[m,l]=t.useState(()=>R(u,n)),[p,g]=t.useState(()=>m==="system"?L():m),T=a?Object.values(a):o,w=t.useCallback(i=>{let c=i;if(!c)return;i==="system"&&s&&(c=L());let S=a?a[c]:c,O=r?$(d):null,b=document.documentElement,M=v=>{v==="class"?(b.classList.remove(...T),S&&b.classList.add(S)):v.startsWith("data-")&&(S?b.setAttribute(v,S):b.removeAttribute(v))};if(Array.isArray(h)?h.forEach(M):M(h),f){let v=j.includes(n)?n:null,W=j.includes(c)?c:v;b.style.colorScheme=W}O?.()},[d]),k=t.useCallback(i=>{let c=typeof i=="function"?i(m):i;l(c);try{localStorage.setItem(u,c)}catch{}},[m]),E=t.useCallback(i=>{let c=L(i);g(c),m==="system"&&s&&!e&&w("system")},[m,e]);t.useEffect(()=>{let i=window.matchMedia(K);return i.addListener(E),E(i),()=>i.removeListener(E)},[E]),t.useEffect(()=>{let i=c=>{c.key===u&&(c.newValue?l(c.newValue):k(n))};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[k]),t.useEffect(()=>{w(e??m)},[e,m]);let P=t.useMemo(()=>({theme:m,setTheme:k,forcedTheme:e,resolvedTheme:m==="system"?p:m,themes:s?[...o,"system"]:o,systemTheme:s?p:void 0}),[m,k,e,p,s,o]);return t.createElement(A.Provider,{value:P},t.createElement(J,{forcedTheme:e,storageKey:u,attribute:h,enableSystem:s,enableColorScheme:f,defaultTheme:n,value:a,themes:o,nonce:d,scriptProps:x}),y)},J=t.memo(({forcedTheme:e,storageKey:r,attribute:s,enableSystem:f,enableColorScheme:u,defaultTheme:o,value:n,themes:h,nonce:a,scriptProps:y})=>{let d=JSON.stringify([s,r,o,e,h,n,f,u]).slice(1,-1);return t.createElement("script",{...y,suppressHydrationWarning:!0,nonce:typeof window>"u"?a:"",dangerouslySetInnerHTML:{__html:`(${H.toString()})(${d})`}})}),R=(e,r)=>{if(N)return;let s;try{s=localStorage.getItem(e)||void 0}catch{}return s||r},$=e=>{let r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(r)},1)}},L=e=>(e||(e=window.matchMedia(K)),e.matches?"dark":"light");export{B as J,U as S,Q as u,q as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as R,t as x,b as le,a as je,u as A,P as D,d as L,e as Pe,f as T,g as Ee,h as j}from"./index-Bojr-xLv.js";import{u as X}from"./i18n-V4QzeUbV.js";import{P as Re,a as Ae,b as Le,h as _e,n as ke,i as N,_ as Ne,E as De,c as Me,d as Oe,C as ae,e as Ie,f as ze,u as He}from"./collapsible-B2rvGry7.js";import{j as c,r as i}from"./index-OFfnl8sH.js";import{u as se,z as Fe}from"./index-Bonlu0LX.js";import{S as ce}from"./search-D1WUBd3N.js";import{a as Y}from"./index-B-5ouVG_.js";import{L as B}from"./merge-refs-BIez66Kl.js";import{u as We}from"./index-DHENdpwd.js";import{u as Q,e as Ve}from"./index-xXa72sZS.js";const Xe=[["path",{d:"M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",key:"ns4c3b"}],["path",{d:"m12 15 5 6H7Z",key:"14qnn2"}]],Ye=R("airplay",Xe);const Be=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Qt=R("chevrons-up-down",Be);const Ue=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],Kt=R("languages",Ue);const $e=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],qe=R("moon",$e);const Ge=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Zt=R("panel-left",Ge);const Qe=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ke=R("sun",Qe);function Ze({className:e,variant:t="ghost",children:r,...a}){const n=X();if(!n.locales)throw new Error("Missing `<I18nProvider />`");return c.jsxs(Re,{children:[c.jsx(Ae,{"aria-label":n.text.chooseLanguage,className:x(le({variant:t}),"gap-1.5 p-1.5 data-[state=open]:bg-fd-accent",e),...a,children:r}),c.jsxs(Le,{className:"flex flex-col gap-0.5 p-1",children:[c.jsx("p",{className:"p-2 text-xs font-medium text-fd-muted-foreground",children:n.text.chooseLanguage}),n.locales.map(l=>c.jsx("button",{type:"button",className:x("px-2 py-1.5 text-start text-sm rounded-lg transition-colors",l.locale===n.locale?"bg-fd-primary/10 text-fd-primary":"text-fd-muted-foreground hover:bg-fd-accent hover:text-fd-accent-foreground"),onClick:()=>{n.onChange?.(l.locale)},children:l.name},l.locale))]})]})}function Je(e){const{locales:t,locale:r}=X(),a=t?.find(n=>n.locale===r)?.name;return c.jsx("span",{...e,children:a})}function et({hideIfDisabled:e,size:t="icon-sm",color:r="ghost",...a}){const{setOpenSearch:n,enabled:l}=se();return e&&!l?null:c.jsx("button",{type:"button",className:x(le({size:t,color:r}),a.className),"data-search":"","aria-label":"Open Search",onClick:()=>{n(!0)},children:c.jsx(ce,{})})}function tt({hideIfDisabled:e,...t}){const{enabled:r,hotKey:a,setOpenSearch:n}=se(),{text:l}=X();return e&&!r?null:c.jsxs("button",{type:"button","data-search-full":"",...t,className:x("inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground",t.className),onClick:()=>{n(!0)},children:[c.jsx(ce,{className:"size-4"}),l.search,c.jsx("div",{className:"ms-auto inline-flex gap-0.5",children:a.map((o,u)=>c.jsx("kbd",{className:"rounded-md border bg-fd-background px-1.5",children:o.display},u))})]})}const te=je("size-6.5 p-1.5 text-fd-muted-foreground",{variants:{active:{true:"bg-fd-accent text-fd-accent-foreground",false:"text-fd-muted-foreground"}}}),re=[["light",Ke],["dark",qe],["system",Ye]];function rt({className:e,mode:t="light-dark",...r}){const{setTheme:a,theme:n,resolvedTheme:l}=Fe(),[o,u]=i.useState(!1);i.useEffect(()=>{u(!0)},[]);const s=x("inline-flex items-center rounded-full border p-1 overflow-hidden *:rounded-full",e);if(t==="light-dark"){const d=o?l:null;return c.jsx("button",{className:s,"aria-label":"Toggle Theme",onClick:()=>a(d==="light"?"dark":"light"),"data-theme-toggle":"",children:re.map(([m,h])=>{if(m!=="system")return c.jsx(h,{fill:"currentColor",className:x(te({active:d===m}))},m)})})}const f=o?n:null;return c.jsx("div",{className:s,"data-theme-toggle":"",...r,children:re.map(([d,m])=>c.jsx("button",{"aria-label":d,className:x(te({active:f===d})),onClick:()=>a(d),children:c.jsx(m,{className:"size-full",fill:"currentColor"})},d))})}const nt=(e,t)=>t.icon?{...e,icon:c.jsx("div",{className:"size-full [&_svg]:size-full max-md:p-1.5 max-md:rounded-md max-md:border max-md:bg-fd-secondary",children:t.icon})}:e;function Jt(e,{transform:t=nt}={}){const r=[];function a(n,l){if("root"in n&&n.root){const o=n.index?.url??n.children.find(u=>u.type==="page")?.url;if(o){const u={title:n.name,icon:n.icon,description:n.description,url:o,unlisted:l,$folder:n},s=t?t(u,n):u;s&&r.push(s)}}for(const o of n.children)o.type==="folder"&&a(o,l)}return a(e),e.fallback&&a(e.fallback,!0),r}function er(e,t){return e.$folder?_e(e.$folder.children,r=>r.type==="page"&&N(r.url,t))!==null:e.urls?e.urls.has(ke(t)):N(e.url,t,!0)}function ot({links:e=[],githubUrl:t}){const r=[...e];return t&&r.push({type:"icon",url:t,text:"Github",label:"GitHub",icon:c.jsx("svg",{role:"img",viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),external:!0}),r}function tr({githubUrl:e,links:t}){return i.useMemo(()=>{const r=ot({links:t,githubUrl:e}),a=[],n=[];for(const l of r)switch(l.on){case"menu":n.push(l);break;case"nav":a.push(l);break;default:a.push(l),n.push(l)}return{navItems:a,menuItems:n,all:r}},[t,e])}function ie(e,t){return e.type==="custom"||!e.url||e.active==="none"?!1:N(e.url,t,e.active==="nested-url")}function rr({ref:e,item:t,...r}){const a=ie(t,Y());return c.jsx(B,{ref:e,href:t.url,external:t.external,...r,"data-active":a,children:r.children})}function nr({useProps:e}){function t(l){const{themeSwitch:o}=e();return o.component?o.component:c.jsx(rt,{...l,...o})}function r(l){const{searchToggle:o}=e();return o.components?.sm?o.components.sm:c.jsx(et,{...l,...o.sm})}function a(l){const{searchToggle:o}=e();return o.components?.lg?o.components.lg:c.jsx(tt,{...l,...o.full})}function n({href:l="/",...o}){const{url:u=l,title:s}=e().nav??{};return typeof s=="function"?s({href:u,...o}):c.jsx(B,{href:u,...o,children:s})}return{useProvider(l){const{locales:o=[]}=X(),{nav:u,slots:s={},i18n:f=o.length>1,searchToggle:{enabled:d=!0,...m}={},themeSwitch:{enabled:h=!0,...p}={}}=l;return{baseSlots:{navTitle:s.navTitle??n,themeSwitch:h&&(s.themeSwitch??t),languageSelect:f?s.languageSelect??{root:Ze,text:Je}:!1,searchTrigger:d&&(s.searchTrigger??{sm:r,full:a})},baseProps:{nav:u,searchToggle:m,themeSwitch:p}}}}}function lt(e,[t,r]){return Math.min(r,Math.max(t,e))}function at(e,t){return i.useReducer((r,a)=>t[r][a]??r,e)}var K="ScrollArea",[ue]=Pe(K),[st,S]=ue(K),de=i.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:a="hover",dir:n,scrollHideDelay:l=600,...o}=e,[u,s]=i.useState(null),[f,d]=i.useState(null),[m,h]=i.useState(null),[p,g]=i.useState(null),[_,q]=i.useState(null),[y,O]=i.useState(0),[G,I]=i.useState(0),[z,k]=i.useState(!1),[H,F]=i.useState(!1),b=A(t,P=>s(P)),v=We(n);return c.jsx(st,{scope:r,type:a,dir:v,scrollHideDelay:l,scrollArea:u,viewport:f,onViewportChange:d,content:m,onContentChange:h,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:z,onScrollbarXEnabledChange:k,scrollbarY:_,onScrollbarYChange:q,scrollbarYEnabled:H,onScrollbarYEnabledChange:F,onCornerWidthChange:O,onCornerHeightChange:I,children:c.jsx(D.div,{dir:v,...o,ref:b,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":G+"px",...e.style}})})});de.displayName=K;var fe="ScrollAreaViewport",he=i.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:a,nonce:n,...l}=e,o=S(fe,r),u=i.useRef(null),s=A(t,u,o.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),c.jsx(D.div,{"data-radix-scroll-area-viewport":"",...l,ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});he.displayName=fe;var w="ScrollAreaScrollbar",me=i.forwardRef((e,t)=>{const{forceMount:r,...a}=e,n=S(w,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:o}=n,u=e.orientation==="horizontal";return i.useEffect(()=>(u?l(!0):o(!0),()=>{u?l(!1):o(!1)}),[u,l,o]),n.type==="hover"?c.jsx(ct,{...a,ref:t,forceMount:r}):n.type==="scroll"?c.jsx(it,{...a,ref:t,forceMount:r}):n.type==="auto"?c.jsx(pe,{...a,ref:t,forceMount:r}):n.type==="always"?c.jsx(Z,{...a,ref:t}):null});me.displayName=w;var ct=i.forwardRef((e,t)=>{const{forceMount:r,...a}=e,n=S(w,e.__scopeScrollArea),[l,o]=i.useState(!1);return i.useEffect(()=>{const u=n.scrollArea;let s=0;if(u){const f=()=>{window.clearTimeout(s),o(!0)},d=()=>{s=window.setTimeout(()=>o(!1),n.scrollHideDelay)};return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",d),()=>{window.clearTimeout(s),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",d)}}},[n.scrollArea,n.scrollHideDelay]),c.jsx(L,{present:r||l,children:c.jsx(pe,{"data-state":l?"visible":"hidden",...a,ref:t})})}),it=i.forwardRef((e,t)=>{const{forceMount:r,...a}=e,n=S(w,e.__scopeScrollArea),l=e.orientation==="horizontal",o=$(()=>s("SCROLL_END"),100),[u,s]=at("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return i.useEffect(()=>{if(u==="idle"){const f=window.setTimeout(()=>s("HIDE"),n.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,n.scrollHideDelay,s]),i.useEffect(()=>{const f=n.viewport,d=l?"scrollLeft":"scrollTop";if(f){let m=f[d];const h=()=>{const p=f[d];m!==p&&(s("SCROLL"),o()),m=p};return f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[n.viewport,l,s,o]),c.jsx(L,{present:r||u!=="hidden",children:c.jsx(Z,{"data-state":u==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:j(e.onPointerEnter,()=>s("POINTER_ENTER")),onPointerLeave:j(e.onPointerLeave,()=>s("POINTER_LEAVE"))})})}),pe=i.forwardRef((e,t)=>{const r=S(w,e.__scopeScrollArea),{forceMount:a,...n}=e,[l,o]=i.useState(!1),u=e.orientation==="horizontal",s=$(()=>{if(r.viewport){const f=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;o(u?f:d)}},10);return E(r.viewport,s),E(r.content,s),c.jsx(L,{present:a||l,children:c.jsx(Z,{"data-state":l?"visible":"hidden",...n,ref:t})})}),Z=i.forwardRef((e,t)=>{const{orientation:r="vertical",...a}=e,n=S(w,e.__scopeScrollArea),l=i.useRef(null),o=i.useRef(0),[u,s]=i.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=ve(u.viewport,u.content),d={...a,sizes:u,onSizesChange:s,hasThumb:f>0&&f<1,onThumbChange:h=>l.current=h,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:h=>o.current=h};function m(h,p){return pt(h,o.current,u,p)}return r==="horizontal"?c.jsx(ut,{...d,ref:t,onThumbPositionChange:()=>{if(n.viewport&&l.current){const h=n.viewport.scrollLeft,p=ne(h,u,n.dir);l.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{n.viewport&&(n.viewport.scrollLeft=h)},onDragScroll:h=>{n.viewport&&(n.viewport.scrollLeft=m(h,n.dir))}}):r==="vertical"?c.jsx(dt,{...d,ref:t,onThumbPositionChange:()=>{if(n.viewport&&l.current){const h=n.viewport.scrollTop,p=ne(h,u);l.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{n.viewport&&(n.viewport.scrollTop=h)},onDragScroll:h=>{n.viewport&&(n.viewport.scrollTop=m(h))}}):null}),ut=i.forwardRef((e,t)=>{const{sizes:r,onSizesChange:a,...n}=e,l=S(w,e.__scopeScrollArea),[o,u]=i.useState(),s=i.useRef(null),f=A(t,s,l.onScrollbarXChange);return i.useEffect(()=>{s.current&&u(getComputedStyle(s.current))},[s]),c.jsx(xe,{"data-orientation":"horizontal",...n,ref:f,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":U(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,m)=>{if(l.viewport){const h=l.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),Ce(h,m)&&d.preventDefault()}},onResize:()=>{s.current&&l.viewport&&o&&a({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:s.current.clientWidth,paddingStart:V(o.paddingLeft),paddingEnd:V(o.paddingRight)}})}})}),dt=i.forwardRef((e,t)=>{const{sizes:r,onSizesChange:a,...n}=e,l=S(w,e.__scopeScrollArea),[o,u]=i.useState(),s=i.useRef(null),f=A(t,s,l.onScrollbarYChange);return i.useEffect(()=>{s.current&&u(getComputedStyle(s.current))},[s]),c.jsx(xe,{"data-orientation":"vertical",...n,ref:f,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":U(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,m)=>{if(l.viewport){const h=l.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),Ce(h,m)&&d.preventDefault()}},onResize:()=>{s.current&&l.viewport&&o&&a({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:s.current.clientHeight,paddingStart:V(o.paddingTop),paddingEnd:V(o.paddingBottom)}})}})}),[ft,be]=ue(w),xe=i.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:a,hasThumb:n,onThumbChange:l,onThumbPointerUp:o,onThumbPointerDown:u,onThumbPositionChange:s,onDragScroll:f,onWheelScroll:d,onResize:m,...h}=e,p=S(w,r),[g,_]=i.useState(null),q=A(t,b=>_(b)),y=i.useRef(null),O=i.useRef(""),G=p.viewport,I=a.content-a.viewport,z=T(d),k=T(s),H=$(m,10);function F(b){if(y.current){const v=b.clientX-y.current.left,P=b.clientY-y.current.top;f({x:v,y:P})}}return i.useEffect(()=>{const b=v=>{const P=v.target;g?.contains(P)&&z(v,I)};return document.addEventListener("wheel",b,{passive:!1}),()=>document.removeEventListener("wheel",b,{passive:!1})},[G,g,I,z]),i.useEffect(k,[a,k]),E(g,H),E(p.content,H),c.jsx(ft,{scope:r,scrollbar:g,hasThumb:n,onThumbChange:T(l),onThumbPointerUp:T(o),onThumbPositionChange:k,onThumbPointerDown:T(u),children:c.jsx(D.div,{...h,ref:q,style:{position:"absolute",...h.style},onPointerDown:j(e.onPointerDown,b=>{b.button===0&&(b.target.setPointerCapture(b.pointerId),y.current=g.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),F(b))}),onPointerMove:j(e.onPointerMove,F),onPointerUp:j(e.onPointerUp,b=>{const v=b.target;v.hasPointerCapture(b.pointerId)&&v.releasePointerCapture(b.pointerId),document.body.style.webkitUserSelect=O.current,p.viewport&&(p.viewport.style.scrollBehavior=""),y.current=null})})})}),W="ScrollAreaThumb",ge=i.forwardRef((e,t)=>{const{forceMount:r,...a}=e,n=be(W,e.__scopeScrollArea);return c.jsx(L,{present:r||n.hasThumb,children:c.jsx(ht,{ref:t,...a})})}),ht=i.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:a,...n}=e,l=S(W,r),o=be(W,r),{onThumbPositionChange:u}=o,s=A(t,m=>o.onThumbChange(m)),f=i.useRef(void 0),d=$(()=>{f.current&&(f.current(),f.current=void 0)},100);return i.useEffect(()=>{const m=l.viewport;if(m){const h=()=>{if(d(),!f.current){const p=bt(m,u);f.current=p,u()}};return u(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[l.viewport,d,u]),c.jsx(D.div,{"data-state":o.hasThumb?"visible":"hidden",...n,ref:s,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:j(e.onPointerDownCapture,m=>{const p=m.target.getBoundingClientRect(),g=m.clientX-p.left,_=m.clientY-p.top;o.onThumbPointerDown({x:g,y:_})}),onPointerUp:j(e.onPointerUp,o.onThumbPointerUp)})});ge.displayName=W;var J="ScrollAreaCorner",Se=i.forwardRef((e,t)=>{const r=S(J,e.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?c.jsx(mt,{...e,ref:t}):null});Se.displayName=J;var mt=i.forwardRef((e,t)=>{const{__scopeScrollArea:r,...a}=e,n=S(J,r),[l,o]=i.useState(0),[u,s]=i.useState(0),f=!!(l&&u);return E(n.scrollbarX,()=>{const d=n.scrollbarX?.offsetHeight||0;n.onCornerHeightChange(d),s(d)}),E(n.scrollbarY,()=>{const d=n.scrollbarY?.offsetWidth||0;n.onCornerWidthChange(d),o(d)}),f?c.jsx(D.div,{...a,ref:t,style:{width:l,height:u,position:"absolute",right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function V(e){return e?parseInt(e,10):0}function ve(e,t){const r=e/t;return isNaN(r)?0:r}function U(e){const t=ve(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-r)*t;return Math.max(a,18)}function pt(e,t,r,a="ltr"){const n=U(r),l=n/2,o=t||l,u=n-o,s=r.scrollbar.paddingStart+o,f=r.scrollbar.size-r.scrollbar.paddingEnd-u,d=r.content-r.viewport,m=a==="ltr"?[0,d]:[d*-1,0];return we([s,f],m)(e)}function ne(e,t,r="ltr"){const a=U(t),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-n,o=t.content-t.viewport,u=l-a,s=r==="ltr"?[0,o]:[o*-1,0],f=lt(e,s);return we([0,o],[0,u])(f)}function we(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(r-e[0])}}function Ce(e,t){return e>0&&e<t}var bt=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},a=0;return(function n(){const l={left:e.scrollLeft,top:e.scrollTop},o=r.left!==l.left,u=r.top!==l.top;(o||u)&&t(),r=l,a=window.requestAnimationFrame(n)})(),()=>window.cancelAnimationFrame(a)};function $(e,t){const r=T(e),a=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(a.current),[]),i.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function E(e,t){const r=T(t);Ee(()=>{let a=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(a),n.unobserve(e)}}},[e,r])}var xt=de,gt=he,St=me,vt=Se;function wt({className:e,children:t,...r}){return c.jsxs(xt,{type:"scroll",className:x("overflow-hidden",e),...r,children:[t,c.jsx(vt,{}),c.jsx(yt,{orientation:"vertical"})]})}function Ct({className:e,children:t,...r}){return c.jsx(gt,{className:x("size-full rounded-[inherit]",e),...r,children:t})}function yt({className:e,orientation:t="vertical",...r}){return c.jsx(St,{orientation:t,className:x("flex select-none data-[state=hidden]:animate-fd-fade-out",t==="vertical"&&"h-full w-1.5",t==="horizontal"&&"h-1.5 flex-col",e),...r,children:c.jsx(ge,{className:"relative flex-1 rounded-full bg-fd-border"})})}function Tt(e,t=!1){const[r,a]=i.useState(null);return i.useEffect(()=>{if(t)return;const n=window.matchMedia(e),l=()=>{a(n.matches)};return l(),n.addEventListener("change",l),()=>{n.removeEventListener("change",l)}},[t,e]),r}var or=Ne({SidebarCollapseTrigger:()=>zt,SidebarContent:()=>Et,SidebarDrawerContent:()=>Lt,SidebarDrawerOverlay:()=>At,SidebarFolder:()=>Nt,SidebarFolderContent:()=>Ot,SidebarFolderLink:()=>Mt,SidebarFolderTrigger:()=>Dt,SidebarItem:()=>kt,SidebarProvider:()=>jt,SidebarSeparator:()=>_t,SidebarTrigger:()=>It,SidebarViewport:()=>Rt,useAutoScroll:()=>ee,useFolder:()=>Pt,useFolderDepth:()=>Te,useSidebar:()=>C});const ye=i.createContext(null),M=i.createContext(null);function jt({defaultOpenLevel:e=0,prefetch:t,children:r}){const a=i.useRef(!0),[n,l]=i.useState(!1),[o,u]=i.useState(!1),s=Y(),f=Tt("(width < 768px)")?"drawer":"full";return Q(s,()=>{a.current&&l(!1),a.current=!0}),c.jsx(ye,{value:i.useMemo(()=>({open:n,setOpen:l,collapsed:o,setCollapsed:u,closeOnRedirect:a,defaultOpenLevel:e,prefetch:t,mode:f}),[n,o,e,t,f]),children:r})}function C(){const e=i.use(ye);if(!e)throw new Error("Missing SidebarContext, make sure you have wrapped the component in <DocsLayout /> and the context is available.");return e}function Pt(){return i.use(M)}function Te(){return i.use(M)?.depth??0}function Et({mode:e="full",children:t}){const{collapsed:r,mode:a}=C(),[n,l]=i.useState(!1),o=i.useRef(null),u=i.useRef(0);if(Q(r,()=>{r&&l(!1)}),e!==!0&&e!==a)return;function s(f){const d=o.current;return d?!r||f.pointerType==="touch"||d.getAnimations().length>0:!0}return t({ref:o,collapsed:r,hovered:n,onPointerEnter(f){s(f)||(window.clearTimeout(u.current),l(!0))},onPointerLeave(f){s(f)||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>l(!1),Math.min(f.clientX,document.body.clientWidth-f.clientX)>100?0:500))}})}function Rt({area:e,viewport:t,children:r}){return c.jsx(wt,{...e,className:x("min-h-0 flex-1",e?.className),children:c.jsx(Ct,{...t,className:x("*:flex! *:flex-col! *:gap-0.5! p-4 overscroll-contain mask-[linear-gradient(to_bottom,transparent,white_12px,white_calc(100%-12px),transparent)]",t?.className),children:r})})}function At(e){const{open:t,setOpen:r,mode:a}=C();if(a==="drawer")return c.jsx(L,{present:t,children:c.jsx("div",{"data-state":t?"open":"closed",onClick:()=>r(!1),...e})})}function Lt({className:e,children:t,...r}){const{open:a,mode:n}=C(),l=a?"open":"closed";if(n==="drawer")return c.jsx(L,{present:a,children:({present:o})=>c.jsx("aside",{id:"nd-sidebar-mobile","data-state":l,className:x(!o&&"invisible",e),...r,children:t})})}function _t(e){return c.jsx("p",{...e})}function kt({icon:e,active:t=!1,children:r,...a}){const n=i.useRef(null),{prefetch:l}=C();return ee(t,n),c.jsxs(B,{ref:n,"data-active":t,prefetch:l,...a,children:[e??(a.external?c.jsx(De,{}):null),r]})}function Nt({defaultOpen:e,collapsible:t=!0,active:r=!1,children:a,...n}){const{defaultOpenLevel:l}=C(),o=Te()+1,u=t===!1||r||(e??l>=o),[s,f]=i.useState(u);return Q(u,d=>{d&&f(d)}),c.jsx(Me,{open:s,onOpenChange:f,disabled:!t,...n,children:c.jsx(M,{value:i.useMemo(()=>({open:s,setOpen:f,depth:o,collapsible:t}),[t,o,s]),children:a})})}function Dt({children:e,...t}){const{open:r,collapsible:a}=i.use(M);return a?c.jsxs(Oe,{...t,children:[e,c.jsx(ae,{"data-icon":!0,className:x("ms-auto transition-transform",!r&&"-rotate-90 rtl:rotate-90")})]}):c.jsx("div",{...t,children:e})}function Mt({children:e,active:t=!1,...r}){const a=i.useRef(null),{open:n,setOpen:l,collapsible:o}=i.use(M),{prefetch:u}=C();return ee(t,a),c.jsxs(B,{ref:a,"data-active":t,onClick:s=>{o&&(s.target instanceof Element&&s.target.matches("[data-icon], [data-icon] *")?(l(!n),s.preventDefault()):l(t?!n:!0))},prefetch:u,...r,children:[e,o&&c.jsx(ae,{"data-icon":!0,className:x("ms-auto transition-transform",!n&&"-rotate-90 rtl:rotate-90")})]})}function Ot(e){return c.jsx(Ie,{...e,children:e.children})}function It({children:e,...t}){const{setOpen:r}=C();return c.jsx("button",{"aria-label":"Open Sidebar",onClick:()=>r(a=>!a),...t,children:e})}function zt(e){const{collapsed:t,setCollapsed:r}=C();return c.jsx("button",{type:"button","aria-label":"Collapse Sidebar","data-collapsed":t,onClick:()=>{r(a=>!a)},...e,children:e.children})}function ee(e,t){const{mode:r}=C();i.useEffect(()=>{e&&t.current&&Ve(t.current,{boundary:document.getElementById(r==="drawer"?"nd-sidebar-mobile":"nd-sidebar"),scrollMode:"if-needed"})},[e,r,t])}const oe=i.createContext(null);function lr({SidebarFolder:e,SidebarFolderContent:t,SidebarFolderLink:r,SidebarFolderTrigger:a,SidebarSeparator:n,SidebarItem:l}){function o(s){return s.map((f,d)=>c.jsx(u,{node:f},d))}function u({node:s}){const{Separator:f,Item:d,Folder:m,pathname:h}=i.use(oe);if(s.type==="separator")return f?c.jsx(f,{item:s}):c.jsxs(n,{children:[s.icon,s.name]});if(s.type==="folder"){const p=He();return m?c.jsx(m,{item:s,children:o(s.children)}):c.jsxs(e,{collapsible:s.collapsible,active:p.includes(s),defaultOpen:s.defaultOpen,children:[s.index?c.jsxs(r,{href:s.index.url,active:N(s.index.url,h),external:s.index.external,children:[s.icon,s.name]}):c.jsxs(a,{children:[s.icon,s.name]}),c.jsx(t,{children:o(s.children)})]})}return d?c.jsx(d,{item:s}):c.jsx(l,{href:s.url,external:s.external,active:N(s.url,h),icon:s.icon,children:s.name})}return function(f){const{Folder:d,Item:m,Separator:h}=f,{root:p}=ze(),g=Y();return c.jsx(oe,{value:i.useMemo(()=>({Folder:d,Item:m,Separator:h,pathname:g}),[d,m,h,g]),children:c.jsx(i.Fragment,{children:o(p.children)},p.$id)})}}function ar({SidebarFolder:e,SidebarFolderContent:t,SidebarFolderLink:r,SidebarFolderTrigger:a,SidebarItem:n}){return function l({item:o,...u}){const s=ie(o,Y());return o.type==="custom"?c.jsx("div",{...u,children:o.children}):o.type==="menu"?c.jsxs(e,{...u,children:[o.url?c.jsxs(r,{href:o.url,active:s,external:o.external,children:[o.icon,o.text]}):c.jsxs(a,{children:[o.icon,o.text]}),c.jsx(t,{children:o.items.map((f,d)=>c.jsx(l,{item:f},d))})]}):c.jsx(n,{href:o.url,icon:o.icon,external:o.external,active:s,...u,children:o.text})}}export{Qt as C,Kt as L,Zt as P,It as S,Rt as a,or as b,rr as c,jt as d,ar as e,lr as f,Et as g,zt as h,et as i,er as j,At as k,Lt as l,Nt as m,Ot as n,Mt as o,Pt as p,Dt as q,_t as r,kt as s,tr as t,Te as u,nr as v,Jt as w};
|
|
1
|
+
import{c as R,t as x,b as le,a as je,u as A,P as D,d as L,e as Pe,f as T,g as Ee,h as j}from"./index-CkzHlXhF.js";import{u as X}from"./i18n-BU0Gqrrh.js";import{P as Re,a as Ae,b as Le,h as _e,n as ke,i as N,_ as Ne,E as De,c as Me,d as Oe,C as ae,e as Ie,f as ze,u as He}from"./collapsible-Bqzit3JO.js";import{j as c,r as i}from"./index-Po1UZSgL.js";import{u as se,z as Fe}from"./index-zSjxh5o9.js";import{S as ce}from"./search-AdRfsIll.js";import{a as Y}from"./index-DOC-_zsC.js";import{L as B}from"./merge-refs-B7SuKGTI.js";import{u as We}from"./index-DhgWLnXf.js";import{u as Q,e as Ve}from"./index-C3-lsDRv.js";const Xe=[["path",{d:"M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",key:"ns4c3b"}],["path",{d:"m12 15 5 6H7Z",key:"14qnn2"}]],Ye=R("airplay",Xe);const Be=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Qt=R("chevrons-up-down",Be);const Ue=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],Kt=R("languages",Ue);const $e=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],qe=R("moon",$e);const Ge=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Zt=R("panel-left",Ge);const Qe=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ke=R("sun",Qe);function Ze({className:e,variant:t="ghost",children:r,...a}){const n=X();if(!n.locales)throw new Error("Missing `<I18nProvider />`");return c.jsxs(Re,{children:[c.jsx(Ae,{"aria-label":n.text.chooseLanguage,className:x(le({variant:t}),"gap-1.5 p-1.5 data-[state=open]:bg-fd-accent",e),...a,children:r}),c.jsxs(Le,{className:"flex flex-col gap-0.5 p-1",children:[c.jsx("p",{className:"p-2 text-xs font-medium text-fd-muted-foreground",children:n.text.chooseLanguage}),n.locales.map(l=>c.jsx("button",{type:"button",className:x("px-2 py-1.5 text-start text-sm rounded-lg transition-colors",l.locale===n.locale?"bg-fd-primary/10 text-fd-primary":"text-fd-muted-foreground hover:bg-fd-accent hover:text-fd-accent-foreground"),onClick:()=>{n.onChange?.(l.locale)},children:l.name},l.locale))]})]})}function Je(e){const{locales:t,locale:r}=X(),a=t?.find(n=>n.locale===r)?.name;return c.jsx("span",{...e,children:a})}function et({hideIfDisabled:e,size:t="icon-sm",color:r="ghost",...a}){const{setOpenSearch:n,enabled:l}=se();return e&&!l?null:c.jsx("button",{type:"button",className:x(le({size:t,color:r}),a.className),"data-search":"","aria-label":"Open Search",onClick:()=>{n(!0)},children:c.jsx(ce,{})})}function tt({hideIfDisabled:e,...t}){const{enabled:r,hotKey:a,setOpenSearch:n}=se(),{text:l}=X();return e&&!r?null:c.jsxs("button",{type:"button","data-search-full":"",...t,className:x("inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground",t.className),onClick:()=>{n(!0)},children:[c.jsx(ce,{className:"size-4"}),l.search,c.jsx("div",{className:"ms-auto inline-flex gap-0.5",children:a.map((o,u)=>c.jsx("kbd",{className:"rounded-md border bg-fd-background px-1.5",children:o.display},u))})]})}const te=je("size-6.5 p-1.5 text-fd-muted-foreground",{variants:{active:{true:"bg-fd-accent text-fd-accent-foreground",false:"text-fd-muted-foreground"}}}),re=[["light",Ke],["dark",qe],["system",Ye]];function rt({className:e,mode:t="light-dark",...r}){const{setTheme:a,theme:n,resolvedTheme:l}=Fe(),[o,u]=i.useState(!1);i.useEffect(()=>{u(!0)},[]);const s=x("inline-flex items-center rounded-full border p-1 overflow-hidden *:rounded-full",e);if(t==="light-dark"){const d=o?l:null;return c.jsx("button",{className:s,"aria-label":"Toggle Theme",onClick:()=>a(d==="light"?"dark":"light"),"data-theme-toggle":"",children:re.map(([m,h])=>{if(m!=="system")return c.jsx(h,{fill:"currentColor",className:x(te({active:d===m}))},m)})})}const f=o?n:null;return c.jsx("div",{className:s,"data-theme-toggle":"",...r,children:re.map(([d,m])=>c.jsx("button",{"aria-label":d,className:x(te({active:f===d})),onClick:()=>a(d),children:c.jsx(m,{className:"size-full",fill:"currentColor"})},d))})}const nt=(e,t)=>t.icon?{...e,icon:c.jsx("div",{className:"size-full [&_svg]:size-full max-md:p-1.5 max-md:rounded-md max-md:border max-md:bg-fd-secondary",children:t.icon})}:e;function Jt(e,{transform:t=nt}={}){const r=[];function a(n,l){if("root"in n&&n.root){const o=n.index?.url??n.children.find(u=>u.type==="page")?.url;if(o){const u={title:n.name,icon:n.icon,description:n.description,url:o,unlisted:l,$folder:n},s=t?t(u,n):u;s&&r.push(s)}}for(const o of n.children)o.type==="folder"&&a(o,l)}return a(e),e.fallback&&a(e.fallback,!0),r}function er(e,t){return e.$folder?_e(e.$folder.children,r=>r.type==="page"&&N(r.url,t))!==null:e.urls?e.urls.has(ke(t)):N(e.url,t,!0)}function ot({links:e=[],githubUrl:t}){const r=[...e];return t&&r.push({type:"icon",url:t,text:"Github",label:"GitHub",icon:c.jsx("svg",{role:"img",viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),external:!0}),r}function tr({githubUrl:e,links:t}){return i.useMemo(()=>{const r=ot({links:t,githubUrl:e}),a=[],n=[];for(const l of r)switch(l.on){case"menu":n.push(l);break;case"nav":a.push(l);break;default:a.push(l),n.push(l)}return{navItems:a,menuItems:n,all:r}},[t,e])}function ie(e,t){return e.type==="custom"||!e.url||e.active==="none"?!1:N(e.url,t,e.active==="nested-url")}function rr({ref:e,item:t,...r}){const a=ie(t,Y());return c.jsx(B,{ref:e,href:t.url,external:t.external,...r,"data-active":a,children:r.children})}function nr({useProps:e}){function t(l){const{themeSwitch:o}=e();return o.component?o.component:c.jsx(rt,{...l,...o})}function r(l){const{searchToggle:o}=e();return o.components?.sm?o.components.sm:c.jsx(et,{...l,...o.sm})}function a(l){const{searchToggle:o}=e();return o.components?.lg?o.components.lg:c.jsx(tt,{...l,...o.full})}function n({href:l="/",...o}){const{url:u=l,title:s}=e().nav??{};return typeof s=="function"?s({href:u,...o}):c.jsx(B,{href:u,...o,children:s})}return{useProvider(l){const{locales:o=[]}=X(),{nav:u,slots:s={},i18n:f=o.length>1,searchToggle:{enabled:d=!0,...m}={},themeSwitch:{enabled:h=!0,...p}={}}=l;return{baseSlots:{navTitle:s.navTitle??n,themeSwitch:h&&(s.themeSwitch??t),languageSelect:f?s.languageSelect??{root:Ze,text:Je}:!1,searchTrigger:d&&(s.searchTrigger??{sm:r,full:a})},baseProps:{nav:u,searchToggle:m,themeSwitch:p}}}}}function lt(e,[t,r]){return Math.min(r,Math.max(t,e))}function at(e,t){return i.useReducer((r,a)=>t[r][a]??r,e)}var K="ScrollArea",[ue]=Pe(K),[st,S]=ue(K),de=i.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:a="hover",dir:n,scrollHideDelay:l=600,...o}=e,[u,s]=i.useState(null),[f,d]=i.useState(null),[m,h]=i.useState(null),[p,g]=i.useState(null),[_,q]=i.useState(null),[y,O]=i.useState(0),[G,I]=i.useState(0),[z,k]=i.useState(!1),[H,F]=i.useState(!1),b=A(t,P=>s(P)),v=We(n);return c.jsx(st,{scope:r,type:a,dir:v,scrollHideDelay:l,scrollArea:u,viewport:f,onViewportChange:d,content:m,onContentChange:h,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:z,onScrollbarXEnabledChange:k,scrollbarY:_,onScrollbarYChange:q,scrollbarYEnabled:H,onScrollbarYEnabledChange:F,onCornerWidthChange:O,onCornerHeightChange:I,children:c.jsx(D.div,{dir:v,...o,ref:b,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":G+"px",...e.style}})})});de.displayName=K;var fe="ScrollAreaViewport",he=i.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:a,nonce:n,...l}=e,o=S(fe,r),u=i.useRef(null),s=A(t,u,o.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),c.jsx(D.div,{"data-radix-scroll-area-viewport":"",...l,ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});he.displayName=fe;var w="ScrollAreaScrollbar",me=i.forwardRef((e,t)=>{const{forceMount:r,...a}=e,n=S(w,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:o}=n,u=e.orientation==="horizontal";return i.useEffect(()=>(u?l(!0):o(!0),()=>{u?l(!1):o(!1)}),[u,l,o]),n.type==="hover"?c.jsx(ct,{...a,ref:t,forceMount:r}):n.type==="scroll"?c.jsx(it,{...a,ref:t,forceMount:r}):n.type==="auto"?c.jsx(pe,{...a,ref:t,forceMount:r}):n.type==="always"?c.jsx(Z,{...a,ref:t}):null});me.displayName=w;var ct=i.forwardRef((e,t)=>{const{forceMount:r,...a}=e,n=S(w,e.__scopeScrollArea),[l,o]=i.useState(!1);return i.useEffect(()=>{const u=n.scrollArea;let s=0;if(u){const f=()=>{window.clearTimeout(s),o(!0)},d=()=>{s=window.setTimeout(()=>o(!1),n.scrollHideDelay)};return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",d),()=>{window.clearTimeout(s),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",d)}}},[n.scrollArea,n.scrollHideDelay]),c.jsx(L,{present:r||l,children:c.jsx(pe,{"data-state":l?"visible":"hidden",...a,ref:t})})}),it=i.forwardRef((e,t)=>{const{forceMount:r,...a}=e,n=S(w,e.__scopeScrollArea),l=e.orientation==="horizontal",o=$(()=>s("SCROLL_END"),100),[u,s]=at("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return i.useEffect(()=>{if(u==="idle"){const f=window.setTimeout(()=>s("HIDE"),n.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,n.scrollHideDelay,s]),i.useEffect(()=>{const f=n.viewport,d=l?"scrollLeft":"scrollTop";if(f){let m=f[d];const h=()=>{const p=f[d];m!==p&&(s("SCROLL"),o()),m=p};return f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[n.viewport,l,s,o]),c.jsx(L,{present:r||u!=="hidden",children:c.jsx(Z,{"data-state":u==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:j(e.onPointerEnter,()=>s("POINTER_ENTER")),onPointerLeave:j(e.onPointerLeave,()=>s("POINTER_LEAVE"))})})}),pe=i.forwardRef((e,t)=>{const r=S(w,e.__scopeScrollArea),{forceMount:a,...n}=e,[l,o]=i.useState(!1),u=e.orientation==="horizontal",s=$(()=>{if(r.viewport){const f=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;o(u?f:d)}},10);return E(r.viewport,s),E(r.content,s),c.jsx(L,{present:a||l,children:c.jsx(Z,{"data-state":l?"visible":"hidden",...n,ref:t})})}),Z=i.forwardRef((e,t)=>{const{orientation:r="vertical",...a}=e,n=S(w,e.__scopeScrollArea),l=i.useRef(null),o=i.useRef(0),[u,s]=i.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=ve(u.viewport,u.content),d={...a,sizes:u,onSizesChange:s,hasThumb:f>0&&f<1,onThumbChange:h=>l.current=h,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:h=>o.current=h};function m(h,p){return pt(h,o.current,u,p)}return r==="horizontal"?c.jsx(ut,{...d,ref:t,onThumbPositionChange:()=>{if(n.viewport&&l.current){const h=n.viewport.scrollLeft,p=ne(h,u,n.dir);l.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{n.viewport&&(n.viewport.scrollLeft=h)},onDragScroll:h=>{n.viewport&&(n.viewport.scrollLeft=m(h,n.dir))}}):r==="vertical"?c.jsx(dt,{...d,ref:t,onThumbPositionChange:()=>{if(n.viewport&&l.current){const h=n.viewport.scrollTop,p=ne(h,u);l.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{n.viewport&&(n.viewport.scrollTop=h)},onDragScroll:h=>{n.viewport&&(n.viewport.scrollTop=m(h))}}):null}),ut=i.forwardRef((e,t)=>{const{sizes:r,onSizesChange:a,...n}=e,l=S(w,e.__scopeScrollArea),[o,u]=i.useState(),s=i.useRef(null),f=A(t,s,l.onScrollbarXChange);return i.useEffect(()=>{s.current&&u(getComputedStyle(s.current))},[s]),c.jsx(xe,{"data-orientation":"horizontal",...n,ref:f,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":U(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,m)=>{if(l.viewport){const h=l.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),Ce(h,m)&&d.preventDefault()}},onResize:()=>{s.current&&l.viewport&&o&&a({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:s.current.clientWidth,paddingStart:V(o.paddingLeft),paddingEnd:V(o.paddingRight)}})}})}),dt=i.forwardRef((e,t)=>{const{sizes:r,onSizesChange:a,...n}=e,l=S(w,e.__scopeScrollArea),[o,u]=i.useState(),s=i.useRef(null),f=A(t,s,l.onScrollbarYChange);return i.useEffect(()=>{s.current&&u(getComputedStyle(s.current))},[s]),c.jsx(xe,{"data-orientation":"vertical",...n,ref:f,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":U(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,m)=>{if(l.viewport){const h=l.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),Ce(h,m)&&d.preventDefault()}},onResize:()=>{s.current&&l.viewport&&o&&a({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:s.current.clientHeight,paddingStart:V(o.paddingTop),paddingEnd:V(o.paddingBottom)}})}})}),[ft,be]=ue(w),xe=i.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:a,hasThumb:n,onThumbChange:l,onThumbPointerUp:o,onThumbPointerDown:u,onThumbPositionChange:s,onDragScroll:f,onWheelScroll:d,onResize:m,...h}=e,p=S(w,r),[g,_]=i.useState(null),q=A(t,b=>_(b)),y=i.useRef(null),O=i.useRef(""),G=p.viewport,I=a.content-a.viewport,z=T(d),k=T(s),H=$(m,10);function F(b){if(y.current){const v=b.clientX-y.current.left,P=b.clientY-y.current.top;f({x:v,y:P})}}return i.useEffect(()=>{const b=v=>{const P=v.target;g?.contains(P)&&z(v,I)};return document.addEventListener("wheel",b,{passive:!1}),()=>document.removeEventListener("wheel",b,{passive:!1})},[G,g,I,z]),i.useEffect(k,[a,k]),E(g,H),E(p.content,H),c.jsx(ft,{scope:r,scrollbar:g,hasThumb:n,onThumbChange:T(l),onThumbPointerUp:T(o),onThumbPositionChange:k,onThumbPointerDown:T(u),children:c.jsx(D.div,{...h,ref:q,style:{position:"absolute",...h.style},onPointerDown:j(e.onPointerDown,b=>{b.button===0&&(b.target.setPointerCapture(b.pointerId),y.current=g.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),F(b))}),onPointerMove:j(e.onPointerMove,F),onPointerUp:j(e.onPointerUp,b=>{const v=b.target;v.hasPointerCapture(b.pointerId)&&v.releasePointerCapture(b.pointerId),document.body.style.webkitUserSelect=O.current,p.viewport&&(p.viewport.style.scrollBehavior=""),y.current=null})})})}),W="ScrollAreaThumb",ge=i.forwardRef((e,t)=>{const{forceMount:r,...a}=e,n=be(W,e.__scopeScrollArea);return c.jsx(L,{present:r||n.hasThumb,children:c.jsx(ht,{ref:t,...a})})}),ht=i.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:a,...n}=e,l=S(W,r),o=be(W,r),{onThumbPositionChange:u}=o,s=A(t,m=>o.onThumbChange(m)),f=i.useRef(void 0),d=$(()=>{f.current&&(f.current(),f.current=void 0)},100);return i.useEffect(()=>{const m=l.viewport;if(m){const h=()=>{if(d(),!f.current){const p=bt(m,u);f.current=p,u()}};return u(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[l.viewport,d,u]),c.jsx(D.div,{"data-state":o.hasThumb?"visible":"hidden",...n,ref:s,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:j(e.onPointerDownCapture,m=>{const p=m.target.getBoundingClientRect(),g=m.clientX-p.left,_=m.clientY-p.top;o.onThumbPointerDown({x:g,y:_})}),onPointerUp:j(e.onPointerUp,o.onThumbPointerUp)})});ge.displayName=W;var J="ScrollAreaCorner",Se=i.forwardRef((e,t)=>{const r=S(J,e.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?c.jsx(mt,{...e,ref:t}):null});Se.displayName=J;var mt=i.forwardRef((e,t)=>{const{__scopeScrollArea:r,...a}=e,n=S(J,r),[l,o]=i.useState(0),[u,s]=i.useState(0),f=!!(l&&u);return E(n.scrollbarX,()=>{const d=n.scrollbarX?.offsetHeight||0;n.onCornerHeightChange(d),s(d)}),E(n.scrollbarY,()=>{const d=n.scrollbarY?.offsetWidth||0;n.onCornerWidthChange(d),o(d)}),f?c.jsx(D.div,{...a,ref:t,style:{width:l,height:u,position:"absolute",right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function V(e){return e?parseInt(e,10):0}function ve(e,t){const r=e/t;return isNaN(r)?0:r}function U(e){const t=ve(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-r)*t;return Math.max(a,18)}function pt(e,t,r,a="ltr"){const n=U(r),l=n/2,o=t||l,u=n-o,s=r.scrollbar.paddingStart+o,f=r.scrollbar.size-r.scrollbar.paddingEnd-u,d=r.content-r.viewport,m=a==="ltr"?[0,d]:[d*-1,0];return we([s,f],m)(e)}function ne(e,t,r="ltr"){const a=U(t),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-n,o=t.content-t.viewport,u=l-a,s=r==="ltr"?[0,o]:[o*-1,0],f=lt(e,s);return we([0,o],[0,u])(f)}function we(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(r-e[0])}}function Ce(e,t){return e>0&&e<t}var bt=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},a=0;return(function n(){const l={left:e.scrollLeft,top:e.scrollTop},o=r.left!==l.left,u=r.top!==l.top;(o||u)&&t(),r=l,a=window.requestAnimationFrame(n)})(),()=>window.cancelAnimationFrame(a)};function $(e,t){const r=T(e),a=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(a.current),[]),i.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function E(e,t){const r=T(t);Ee(()=>{let a=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(a),n.unobserve(e)}}},[e,r])}var xt=de,gt=he,St=me,vt=Se;function wt({className:e,children:t,...r}){return c.jsxs(xt,{type:"scroll",className:x("overflow-hidden",e),...r,children:[t,c.jsx(vt,{}),c.jsx(yt,{orientation:"vertical"})]})}function Ct({className:e,children:t,...r}){return c.jsx(gt,{className:x("size-full rounded-[inherit]",e),...r,children:t})}function yt({className:e,orientation:t="vertical",...r}){return c.jsx(St,{orientation:t,className:x("flex select-none data-[state=hidden]:animate-fd-fade-out",t==="vertical"&&"h-full w-1.5",t==="horizontal"&&"h-1.5 flex-col",e),...r,children:c.jsx(ge,{className:"relative flex-1 rounded-full bg-fd-border"})})}function Tt(e,t=!1){const[r,a]=i.useState(null);return i.useEffect(()=>{if(t)return;const n=window.matchMedia(e),l=()=>{a(n.matches)};return l(),n.addEventListener("change",l),()=>{n.removeEventListener("change",l)}},[t,e]),r}var or=Ne({SidebarCollapseTrigger:()=>zt,SidebarContent:()=>Et,SidebarDrawerContent:()=>Lt,SidebarDrawerOverlay:()=>At,SidebarFolder:()=>Nt,SidebarFolderContent:()=>Ot,SidebarFolderLink:()=>Mt,SidebarFolderTrigger:()=>Dt,SidebarItem:()=>kt,SidebarProvider:()=>jt,SidebarSeparator:()=>_t,SidebarTrigger:()=>It,SidebarViewport:()=>Rt,useAutoScroll:()=>ee,useFolder:()=>Pt,useFolderDepth:()=>Te,useSidebar:()=>C});const ye=i.createContext(null),M=i.createContext(null);function jt({defaultOpenLevel:e=0,prefetch:t,children:r}){const a=i.useRef(!0),[n,l]=i.useState(!1),[o,u]=i.useState(!1),s=Y(),f=Tt("(width < 768px)")?"drawer":"full";return Q(s,()=>{a.current&&l(!1),a.current=!0}),c.jsx(ye,{value:i.useMemo(()=>({open:n,setOpen:l,collapsed:o,setCollapsed:u,closeOnRedirect:a,defaultOpenLevel:e,prefetch:t,mode:f}),[n,o,e,t,f]),children:r})}function C(){const e=i.use(ye);if(!e)throw new Error("Missing SidebarContext, make sure you have wrapped the component in <DocsLayout /> and the context is available.");return e}function Pt(){return i.use(M)}function Te(){return i.use(M)?.depth??0}function Et({mode:e="full",children:t}){const{collapsed:r,mode:a}=C(),[n,l]=i.useState(!1),o=i.useRef(null),u=i.useRef(0);if(Q(r,()=>{r&&l(!1)}),e!==!0&&e!==a)return;function s(f){const d=o.current;return d?!r||f.pointerType==="touch"||d.getAnimations().length>0:!0}return t({ref:o,collapsed:r,hovered:n,onPointerEnter(f){s(f)||(window.clearTimeout(u.current),l(!0))},onPointerLeave(f){s(f)||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>l(!1),Math.min(f.clientX,document.body.clientWidth-f.clientX)>100?0:500))}})}function Rt({area:e,viewport:t,children:r}){return c.jsx(wt,{...e,className:x("min-h-0 flex-1",e?.className),children:c.jsx(Ct,{...t,className:x("*:flex! *:flex-col! *:gap-0.5! p-4 overscroll-contain mask-[linear-gradient(to_bottom,transparent,white_12px,white_calc(100%-12px),transparent)]",t?.className),children:r})})}function At(e){const{open:t,setOpen:r,mode:a}=C();if(a==="drawer")return c.jsx(L,{present:t,children:c.jsx("div",{"data-state":t?"open":"closed",onClick:()=>r(!1),...e})})}function Lt({className:e,children:t,...r}){const{open:a,mode:n}=C(),l=a?"open":"closed";if(n==="drawer")return c.jsx(L,{present:a,children:({present:o})=>c.jsx("aside",{id:"nd-sidebar-mobile","data-state":l,className:x(!o&&"invisible",e),...r,children:t})})}function _t(e){return c.jsx("p",{...e})}function kt({icon:e,active:t=!1,children:r,...a}){const n=i.useRef(null),{prefetch:l}=C();return ee(t,n),c.jsxs(B,{ref:n,"data-active":t,prefetch:l,...a,children:[e??(a.external?c.jsx(De,{}):null),r]})}function Nt({defaultOpen:e,collapsible:t=!0,active:r=!1,children:a,...n}){const{defaultOpenLevel:l}=C(),o=Te()+1,u=t===!1||r||(e??l>=o),[s,f]=i.useState(u);return Q(u,d=>{d&&f(d)}),c.jsx(Me,{open:s,onOpenChange:f,disabled:!t,...n,children:c.jsx(M,{value:i.useMemo(()=>({open:s,setOpen:f,depth:o,collapsible:t}),[t,o,s]),children:a})})}function Dt({children:e,...t}){const{open:r,collapsible:a}=i.use(M);return a?c.jsxs(Oe,{...t,children:[e,c.jsx(ae,{"data-icon":!0,className:x("ms-auto transition-transform",!r&&"-rotate-90 rtl:rotate-90")})]}):c.jsx("div",{...t,children:e})}function Mt({children:e,active:t=!1,...r}){const a=i.useRef(null),{open:n,setOpen:l,collapsible:o}=i.use(M),{prefetch:u}=C();return ee(t,a),c.jsxs(B,{ref:a,"data-active":t,onClick:s=>{o&&(s.target instanceof Element&&s.target.matches("[data-icon], [data-icon] *")?(l(!n),s.preventDefault()):l(t?!n:!0))},prefetch:u,...r,children:[e,o&&c.jsx(ae,{"data-icon":!0,className:x("ms-auto transition-transform",!n&&"-rotate-90 rtl:rotate-90")})]})}function Ot(e){return c.jsx(Ie,{...e,children:e.children})}function It({children:e,...t}){const{setOpen:r}=C();return c.jsx("button",{"aria-label":"Open Sidebar",onClick:()=>r(a=>!a),...t,children:e})}function zt(e){const{collapsed:t,setCollapsed:r}=C();return c.jsx("button",{type:"button","aria-label":"Collapse Sidebar","data-collapsed":t,onClick:()=>{r(a=>!a)},...e,children:e.children})}function ee(e,t){const{mode:r}=C();i.useEffect(()=>{e&&t.current&&Ve(t.current,{boundary:document.getElementById(r==="drawer"?"nd-sidebar-mobile":"nd-sidebar"),scrollMode:"if-needed"})},[e,r,t])}const oe=i.createContext(null);function lr({SidebarFolder:e,SidebarFolderContent:t,SidebarFolderLink:r,SidebarFolderTrigger:a,SidebarSeparator:n,SidebarItem:l}){function o(s){return s.map((f,d)=>c.jsx(u,{node:f},d))}function u({node:s}){const{Separator:f,Item:d,Folder:m,pathname:h}=i.use(oe);if(s.type==="separator")return f?c.jsx(f,{item:s}):c.jsxs(n,{children:[s.icon,s.name]});if(s.type==="folder"){const p=He();return m?c.jsx(m,{item:s,children:o(s.children)}):c.jsxs(e,{collapsible:s.collapsible,active:p.includes(s),defaultOpen:s.defaultOpen,children:[s.index?c.jsxs(r,{href:s.index.url,active:N(s.index.url,h),external:s.index.external,children:[s.icon,s.name]}):c.jsxs(a,{children:[s.icon,s.name]}),c.jsx(t,{children:o(s.children)})]})}return d?c.jsx(d,{item:s}):c.jsx(l,{href:s.url,external:s.external,active:N(s.url,h),icon:s.icon,children:s.name})}return function(f){const{Folder:d,Item:m,Separator:h}=f,{root:p}=ze(),g=Y();return c.jsx(oe,{value:i.useMemo(()=>({Folder:d,Item:m,Separator:h,pathname:g}),[d,m,h,g]),children:c.jsx(i.Fragment,{children:o(p.children)},p.$id)})}}function ar({SidebarFolder:e,SidebarFolderContent:t,SidebarFolderLink:r,SidebarFolderTrigger:a,SidebarItem:n}){return function l({item:o,...u}){const s=ie(o,Y());return o.type==="custom"?c.jsx("div",{...u,children:o.children}):o.type==="menu"?c.jsxs(e,{...u,children:[o.url?c.jsxs(r,{href:o.url,active:s,external:o.external,children:[o.icon,o.text]}):c.jsxs(a,{children:[o.icon,o.text]}),c.jsx(t,{children:o.items.map((f,d)=>c.jsx(l,{item:f},d))})]}):c.jsx(n,{href:o.url,icon:o.icon,external:o.external,active:s,...u,children:o.text})}}export{Qt as C,Kt as L,Zt as P,It as S,Rt as a,or as b,rr as c,jt as d,ar as e,lr as f,Et as g,zt as h,et as i,er as j,At as k,Lt as l,Nt as m,Ot as n,Mt as o,Pt as p,Dt as q,_t as r,kt as s,tr as t,Te as u,nr as v,Jt as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as c}from"./index-
|
|
1
|
+
import{L as c}from"./index-DOC-_zsC.js";import{r as i,j as a}from"./index-Po1UZSgL.js";import{c as m}from"./index-CkzHlXhF.js";const f=i.forwardRef(({href:t="#",external:o=t.match(/^\w+:/)||t.startsWith("//"),prefetch:r,children:e,...n},s)=>o?a.jsx("a",{ref:s,href:t,rel:"noreferrer noopener",target:"_blank",...n,children:e}):a.jsx(c,{ref:s,href:t,prefetch:r,...n,children:e}));f.displayName="Link";const p=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],L=m("check",p);function d(...t){return o=>{t.forEach(r=>{typeof r=="function"?r(o):r&&(r.current=o)})}}export{L as C,f as L,d as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p}from"./index-
|
|
1
|
+
import{c as p}from"./index-CCR9ecA8.js";import{r as g}from"./remove-undefined-PK1FA5gc-oajMeTFk.js";import"./index-DOsFxkYv.js";import"./index-Po1UZSgL.js";function y(u){const{index:l="default",client:c,params:o,tag:n}=u;return{deps:[l,c,n],async search(d){const s=p(d),e=[];if(l==="crawler"){const a=await c.search({datasources:[],...o,term:d,where:{category:n?{eq:n.slice(0,1).toUpperCase()+n.slice(1)}:void 0,...o?.where},limit:10});if(!a)return e;for(const r of a.hits){const i=r.document;e.push({id:r.id,type:"page",content:s.highlightMarkdown(i.title),url:i.path},{id:"page"+r.id,type:"text",content:s.highlightMarkdown(i.content),url:i.path})}return e}const h=await c.search({datasources:[],...o,term:d,limit:20,where:g({tag:n,...o?.where}),groupBy:{properties:["page_id"],max_results:7,...o?.groupBy}});if(!h||!h.groups)return e;for(const a of h.groups){let r=!1;for(const i of a.result){const t=i.document;r||(e.push({id:t.page_id,type:"page",content:s.highlightMarkdown(t.title),breadcrumbs:t.breadcrumbs,url:t.url}),r=!0),e.push({id:t.id,content:s.highlightMarkdown(t.content),type:t.content===t.section?"heading":"text",url:t.section_id?`${t.url}#${t.section_id}`:t.url})}}return e.length>80?e.slice(0,80):e}}}export{y as oramaCloudClient};
|
package/dist/waku/public/assets/{orama-cloud-legacy-CINWERV2.js → orama-cloud-legacy-AQ__GML5.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g}from"./index-
|
|
1
|
+
import{c as g}from"./index-CCR9ecA8.js";import{r as m}from"./remove-undefined-PK1FA5gc-oajMeTFk.js";import"./index-DOsFxkYv.js";import"./index-Po1UZSgL.js";function b(p){const{index:l="default",client:c,params:o={},tag:n}=p;return{deps:[l,c,n],async search(d){const a=g(d),e=[];if(l==="crawler"){const s=await c.search({...o,term:d,where:{category:n?{eq:n.slice(0,1).toUpperCase()+n.slice(1)}:void 0,...o.where},limit:10});if(!s)return e;for(const r of s.hits){const i=r.document;e.push({id:r.id,type:"page",content:a.highlightMarkdown(i.title),url:i.path},{id:"page"+r.id,type:"text",content:a.highlightMarkdown(i.content),url:i.path})}return e}const u={...o,term:d,where:m({tag:n,...o.where}),groupBy:{properties:["page_id"],maxResult:7,...o.groupBy}},h=await c.search(u);if(!h||!h.groups)return e;for(const s of h.groups){let r=!1;for(const i of s.result){const t=i.document;r||(e.push({id:t.page_id,type:"page",content:a.highlightMarkdown(t.title),breadcrumbs:t.breadcrumbs,url:t.url}),r=!0),e.push({id:t.id,content:a.highlightMarkdown(t.content),type:t.content===t.section?"heading":"text",url:t.section_id?`${t.url}#${t.section_id}`:t.url})}}return e}}}export{b as oramaCloudLegacyClient};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ze}from"./index-
|
|
1
|
+
import{c as ze}from"./index-CCR9ecA8.js";import{r as it}from"./remove-undefined-PK1FA5gc-oajMeTFk.js";import"./index-DOsFxkYv.js";import"./index-Po1UZSgL.js";const Be={arabic:"ar",armenian:"am",bulgarian:"bg",czech:"cz",danish:"dk",dutch:"nl",english:"en",finnish:"fi",french:"fr",german:"de",greek:"gr",hungarian:"hu",indian:"in",indonesian:"id",irish:"ie",italian:"it",lithuanian:"lt",nepali:"np",norwegian:"no",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"rs",slovenian:"ru",spanish:"es",swedish:"se",tamil:"ta",turkish:"tr",ukrainian:"uk",sanskrit:"sk"},ct={dutch:/[^A-Za-zàèéìòóù0-9_'-]+/gim,english:/[^A-Za-zàèéìòóù0-9_'-]+/gim,french:/[^a-z0-9äâàéèëêïîöôùüûœç-]+/gim,italian:/[^A-Za-zàèéìòóù0-9_'-]+/gim,norwegian:/[^a-z0-9_æøåÆØÅäÄöÖüÜ]+/gim,portuguese:/[^a-z0-9à-úÀ-Ú]/gim,russian:/[^a-z0-9а-яА-ЯёЁ]+/gim,spanish:/[^a-z0-9A-Zá-úÁ-ÚñÑüÜ]+/gim,swedish:/[^a-z0-9_åÅäÄöÖüÜ-]+/gim,german:/[^a-z0-9A-ZäöüÄÖÜß]+/gim,finnish:/[^a-z0-9äöÄÖ]+/gim,danish:/[^a-z0-9æøåÆØÅ]+/gim,hungarian:/[^a-z0-9áéíóöőúüűÁÉÍÓÖŐÚÜŰ]+/gim,romanian:/[^a-z0-9ăâîșțĂÂÎȘȚ]+/gim,serbian:/[^a-z0-9čćžšđČĆŽŠĐ]+/gim,turkish:/[^a-z0-9çÇğĞıİöÖşŞüÜ]+/gim,lithuanian:/[^a-z0-9ąčęėįšųūžĄČĘĖĮŠŲŪŽ]+/gim,arabic:/[^a-z0-9أ-ي]+/gim,nepali:/[^a-z0-9अ-ह]+/gim,irish:/[^a-z0-9áéíóúÁÉÍÓÚ]+/gim,indian:/[^a-z0-9अ-ह]+/gim,armenian:/[^a-z0-9ա-ֆ]+/gim,greek:/[^a-z0-9α-ωά-ώ]+/gim,indonesian:/[^a-z0-9]+/gim,ukrainian:/[^a-z0-9а-яА-ЯіїєІЇЄ]+/gim,slovenian:/[^a-z0-9螚ȎŠ]+/gim,bulgarian:/[^a-z0-9а-яА-Я]+/gim,tamil:/[^a-z0-9அ-ஹ]+/gim,sanskrit:/[^a-z0-9A-Zāīūṛḷṃṁḥśṣṭḍṇṅñḻḹṝ]+/gim,czech:/[^A-Z0-9a-zěščřžýáíéúůóťďĚŠČŘŽÝÁÍÉÓÚŮŤĎ-]+/gim},se=Object.keys(Be);function at(t){return t!==void 0&&se.includes(t)?Be[t]:void 0}const lt=Date.now().toString().slice(5);let ut=0;const ge=BigInt(1e3),me=BigInt(1e6),ye=BigInt(1e9),ee=65535;function Fe(t,e){if(e.length<ee)Array.prototype.push.apply(t,e);else{const n=e.length;for(let r=0;r<n;r+=ee)Array.prototype.push.apply(t,e.slice(r,r+ee))}}function ft(t,...e){return t.replace(/%(?:(?<position>\d+)\$)?(?<width>-?\d*\.?\d*)(?<type>[dfs])/g,function(...n){const r=n[n.length-1],{width:o,type:s,position:i}=r,c=i?e[Number.parseInt(i)-1]:e.shift(),a=o===""?0:Number.parseInt(o);switch(s){case"d":return c.toString().padStart(a,"0");case"f":{let l=c;const[f,u]=o.split(".").map(d=>Number.parseFloat(d));return typeof u=="number"&&u>=0&&(l=l.toFixed(u)),typeof f=="number"&&f>=0?l.toString().padStart(a,"0"):l.toString()}case"s":return a<0?c.toString().padEnd(-a," "):c.toString().padStart(a," ");default:return c}})}function dt(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function ht(){return typeof process<"u"&&process.release&&process.release.name==="node"}function Se(){return BigInt(Math.floor(performance.now()*1e6))}function ie(t){return typeof t=="number"&&(t=BigInt(t)),t<ge?`${t}ns`:t<me?`${t/ge}μs`:t<ye?`${t/me}ms`:`${t/ye}s`}function C(){return dt()?Se():ht()||typeof process<"u"&&typeof process?.hrtime?.bigint=="function"?process.hrtime.bigint():typeof performance<"u"?Se():BigInt(0)}function Ve(){return`${lt}-${ut++}`}function te(t,e){return Object.hasOwn===void 0?Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0:Object.hasOwn(t,e)?t[e]:void 0}function We(t,e){return e[1]===t[1]?t[0]-e[0]:e[1]-t[1]}function pt(t){if(t.length===0)return[];if(t.length===1)return t[0];for(let n=1;n<t.length;n++)if(t[n].length<t[0].length){const r=t[0];t[0]=t[n],t[n]=r}const e=new Map;for(const n of t[0])e.set(n,1);for(let n=1;n<t.length;n++){let r=0;for(const o of t[n]){const s=e.get(o);s===n&&(e.set(o,s+1),r++)}if(r===0)return[]}return t[0].filter(n=>{const r=e.get(n);return r!==void 0&&e.set(n,0),r===t.length})}function $e(t,e){const n={},r=e.length;for(let o=0;o<r;o++){const s=e[o],i=s.split(".");let c=t;const a=i.length;for(let l=0;l<a;l++)if(c=c[i[l]],typeof c=="object"){if(c!==null&&"lat"in c&&"lon"in c&&typeof c.lat=="number"&&typeof c.lon=="number"){c=n[s]=c;break}else if(!Array.isArray(c)&&c!==null&&l===a-1){c=void 0;break}}else if((c===null||typeof c!="object")&&l<a-1){c=void 0;break}typeof c<"u"&&(n[s]=c)}return n}function ce(t,e){return $e(t,[e])[e]}const gt={cm:.01,m:1,km:1e3,ft:.3048,yd:.9144,mi:1609.344};function Ge(t,e){const n=gt[e];if(n===void 0)throw new Error(O("INVALID_DISTANCE_SUFFIX",t).message);return t*n}function je(t,e){t.hits=t.hits.map(n=>({...n,document:{...n.document,...e.reduce((r,o)=>{const s=o.split("."),i=s.pop();let c=r;for(const a of s)c[a]=c[a]??{},c=c[a];return c[i]=null,r},n.document)}}))}function j(t){return Array.isArray(t)?t.some(e=>j(e)):t?.constructor?.name==="AsyncFunction"}const be="intersection"in new Set;function Ie(...t){if(t.length===0)return new Set;if(t.length===1)return t[0];if(t.length===2){const r=t[0],o=t[1];if(be)return r.intersection(o);const s=new Set,i=r.size<o.size?r:o,c=i===r?o:r;for(const a of i)c.has(a)&&s.add(a);return s}const e={index:0,size:t[0].size};for(let r=1;r<t.length;r++)t[r].size<e.size&&(e.index=r,e.size=t[r].size);if(be){let r=t[e.index];for(let o=0;o<t.length;o++)o!==e.index&&(r=r.intersection(t[o]));return r}const n=t[e.index];for(let r=0;r<t.length;r++){if(r===e.index)continue;const o=t[r];for(const s of n)o.has(s)||n.delete(s)}return n}const mt="union"in new Set;function V(t,e){return mt?t?t.union(e):e:t?new Set([...t,...e]):new Set(e)}function yt(t,e){const n=new Set;for(const r of t)e.has(r)||n.add(r);return n}const St=se.join(`
|
|
2
2
|
- `),bt={NO_LANGUAGE_WITH_CUSTOM_TOKENIZER:"Do not pass the language option to create when using a custom tokenizer.",LANGUAGE_NOT_SUPPORTED:`Language "%s" is not supported.
|
|
3
3
|
Supported languages are:
|
|
4
4
|
- ${St}`,INVALID_STEMMER_FUNCTION_TYPE:"config.stemmer property must be a function.",MISSING_STEMMER:'As of version 1.0.0 @orama/orama does not ship non English stemmers by default. To solve this, please explicitly import and specify the "%s" stemmer from the package @orama/stemmers. See https://docs.orama.com/docs/orama-js/text-analysis/stemming for more information.',CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY:"Custom stop words array must only contain strings.",UNSUPPORTED_COMPONENT:'Unsupported component "%s".',COMPONENT_MUST_BE_FUNCTION:'The component "%s" must be a function.',COMPONENT_MUST_BE_FUNCTION_OR_ARRAY_FUNCTIONS:'The component "%s" must be a function or an array of functions.',INVALID_SCHEMA_TYPE:'Unsupported schema type "%s" at "%s". Expected "string", "boolean" or "number" or array of them.',DOCUMENT_ID_MUST_BE_STRING:'Document id must be of type "string". Got "%s" instead.',DOCUMENT_ALREADY_EXISTS:'A document with id "%s" already exists.',DOCUMENT_DOES_NOT_EXIST:'A document with id "%s" does not exists.',MISSING_DOCUMENT_PROPERTY:'Missing searchable property "%s".',INVALID_DOCUMENT_PROPERTY:'Invalid document property "%s": expected "%s", got "%s"',UNKNOWN_INDEX:'Invalid property name "%s". Expected a wildcard string ("*") or array containing one of the following properties: %s',INVALID_BOOST_VALUE:"Boost value must be a number greater than, or less than 0.",INVALID_FILTER_OPERATION:"You can only use one operation per filter, you requested %d.",SCHEMA_VALIDATION_FAILURE:'Cannot insert document due schema validation failure on "%s" property.',INVALID_SORT_SCHEMA_TYPE:'Unsupported sort schema type "%s" at "%s". Expected "string" or "number".',CANNOT_SORT_BY_ARRAY:'Cannot configure sort for "%s" because it is an array (%s).',UNABLE_TO_SORT_ON_UNKNOWN_FIELD:'Unable to sort on unknown field "%s". Allowed fields: %s',SORT_DISABLED:"Sort is disabled. Please read the documentation at https://docs.orama.com/docs/orama-js for more information.",UNKNOWN_GROUP_BY_PROPERTY:'Unknown groupBy property "%s".',INVALID_GROUP_BY_PROPERTY:'Invalid groupBy property "%s". Allowed types: "%s", but given "%s".',UNKNOWN_FILTER_PROPERTY:'Unknown filter property "%s".',UNKNOWN_VECTOR_PROPERTY:'Unknown vector property "%s". Make sure the property exists in the schema and is configured as a vector.',INVALID_VECTOR_SIZE:'Vector size must be a number greater than 0. Got "%s" instead.',INVALID_VECTOR_VALUE:'Vector value must be a number greater than 0. Got "%s" instead.',INVALID_INPUT_VECTOR:`Property "%s" was declared as a %s-dimensional vector, but got a %s-dimensional vector instead.
|