PageSourceSearch

https://hub.synerise.com/assets/docs-BRIXHfqS.js

js synerise.com collected 2026-09-25 19:07:00 UTC 99,043 bytes, 83 lines download raw bytes

1import{r as o,j as e,b as ge,d as Ee}from"./vendor-react-DT1u1jtI.js";import{L as Y,u as le,b as Ye}from"./vendor-router-2WOn-Obs.js";import{o as Be,i as Ze,D as Qe,a as Je,b as et,c as tt,B as nt}from"./external-links-BhqKNtii.js";import{a as ce,b as Se,T as rt,c as st,u as Le,i as oe,d as ot,P as De,e as at,p as ut,r as it,f as lt,g as ct,h as dt,j as ft,k as ht,S as mt,l as pt,m as xt,n as gt,o as Dt,q as Ft,s as bt,t as Ct,v as Te,w as vt}from"./index-CwGEy1UX.js";import{S as ye}from"./syntax-block-BfdRqoqo.js";import{s as Et,X as yt,j as Fe,t as Re,S as de,F as wt,l as te,o as At,i as pe,E as we,u as jt,v as kt,w as Ae,x as Nt,K as Bt,k as St}from"./vendor-icons-gUlyP0FA.js";import{A as P}from"./animate-in-77zKi0Nc.js";import{T as Lt,a as Ie,b as Me}from"./tab-page-header-HfwDR4Ph.js";import{L as Tt,S as Rt,E as It,b as Mt,D as $t,a as Ht,A as Pt,B as Ot}from"./settings-icon-BZOgx6-V.js";import{d as zt,e as _t,O as qt,f as Ut,g as Wt,h as Gt}from"./vendor-radix-DPG7tobX.js";import{R as $e}from"./return-to-top-button-BdTm9iou.js";import{u as He}from"./use-document-title-CiC73W94.js";import"./vendor-query-C_IJvXp6.js";import"./vendor-prism-Bw3IWo6p.js";import"./vendor-motion-B_gTxQU7.js";const Kt=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D
17E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;function Vt(t,s){return typeof t!="string"?"":(t=t.toLowerCase(),t.replace(Kt,"").replace(/ /g,"-"))}function Xt(t){return Vt(t)}function Pe(t){switch(t.tagName){case"H2":return 2;case"H3":return 3;case"H4":return 4;case"H5":return 5;case"H6":return 6;default:return 6}}function Yt(t){const r=new DOMParser().parseFromString(t,"text/html"),f=[],n=new Set,a=c=>
1{r.querySelectorAll(c).forEach(x=>{const w=x.textContent?.trim()||"";if(!w)return;const y=w.replace(/\s*\{[^}]*\}\s*$/,"").trim();if(!y)return;let E=x.getAttribute("id")||Xt(y),p=E,l=1;for(;n.has(p);)p=`${E}-${l++}`;n.add(p),f.push({id:p,text:y,level:Pe(x)})})};return a("h2, h3"),a("h4"),a("h5"),a("h6"),f}const Oe='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="link-icon"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="check-icon" style="display:none"><polyline points="20 6 9 17 4 12"></polyline></svg>';function je(t){return`<a href="#${t}" class="heading-anchor-link" aria-label="Copy link to section" data-heading-id="${t}">${Oe}</a>`}function Zt(t,s){if(s.length===0)return t;const f=new DOMParser().parseFromString(t,"text/html"),n=f.querySelectorAll("h2, h3, h4, h5, h6"),a=new Map(s.map(x=>[x.id,x])),c=[...s];return n.forEach(x=>{const w=x.getAttribute("id");if(w&&a.has(w)){x.querySelector(".heading-anchor-link")||x.insertAdjacentHTML("beforeend",je(w));const i=c.findIndex(F=>F.id===w);i!==-1&&c.splice(i,1);return}if(c.length===0)return;const y=x.textContent?.trim()||"";if(!y)return;const E=y.replace(/\s*\{[^}]*\}\s*$/,"").trim(),p=E.replace(/\s+/g," "),l=Pe(x),g=c.findIndex(i=>i.level===l&&(i.text===E||i.text.replace(/\s+/g," ")===p));if(g!==-1){const i=c[g].id;x.setAttribute("id",i),x.insertAdjacentHTML("beforeend",je(i)),c.splice(g,1)}}),f.body.innerHTML}function Qt(t,s){const r=new Map(s.map(n=>[n.id,n]));t.querySelectorAll("h2, h3, h4, h5, h6").forEach(n=>{const a=n.getAttribute("id");if(!a||!r.has(a)||n.querySelector(".heading-anchor-link"))return;const c=document.createElement("a");c.href=`#${a}`,c.className="heading-anchor-link",c.setAttribute("aria-label","Copy link to section"),c.setAttribute("data-heading-id",a),c.innerHTML=Oe,n.appendChild(c)})}function Jt({headings:t,scrollContainerRef:s}){const[r,f]=o.useState(""),n=o.useRef(new Map),a=o.useRef(null),c=o.useRef(null),[x,w]=o.useState(null),y=o.useRef(r);y.current=r;const E=o.useCallback(()=>{const l=y.current;if(!l){w(null);return}const g=n.current.get(l),i=a.current;if(!g||!i){w(null);return}w({top:g.offsetTop,height:g.offsetHeight})},[]),p=o.useCallback((l,g)=>{l.preventDefault();const i=document.getElementById(g);if(!i)return;const F=s?.current;if(F){const u=F.getBoundingClientRect(),b=i.getBoundingClientRect().top-u.top+F.scrollTop-80;F.scrollTo({top:b,behavior:"smooth"})}else i.scrollIntoView({behavior:"smooth",block:"start"});f(g),history.replaceState(null,"",`#${g}`)},[s]);return o.useEffect(()=>{E()},[r,t,E]),o.useEffect(()=>{const l=()=>E();return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[E]),o.useEffect(()=>{if(!r)return;const l=n.current.get(r),g=c.current;if(!l||!g||g.scrollHeight<=g.clientHeight)return;const i=g.getBoundingClientRect(),F=l.getBoundingClientRect(),u=32;let h=0;F.top<i.top+u?h=F.top-i.top-u:F.bottom>i.bottom-u&&(h=F.bottom-i.bottom+u),h!==0&&g.scrollBy({top:h,behavior:"smooth"})},[r]),o.useEffect(()=>{if(t.length<2)return;let l=!0;function g(){let b=null;for(const m of t){const v=document.getElementById(m.id);v&&v.getBoundingClientRect().top<=120&&(b=m.id)}f(b||t[0].id)}function i(){const b=s?.current||null;g();let m=null;const v=()=>{m===null&&(m=requestAnimationFrame(()=>{g(),m=null}))},A=b||window;return A.addEventListener("scroll",v,{passive:!0}),()=>{A.removeEventListener("scroll",v),m!==null&&cancelAnimationFrame(m)}}let F=null;const u=setInterval(()=>{if(!l)return;const b=t.every(v=>document.getElementById(v.id)),m=!!s?.current;b&&m&&(clearInterval(u),F=i()||null)},50),h=setTimeout(()=>{clearInterval(u),l&&!F&&(s?.current||!s)&&(F=i()||null)},3e3);return()=>{l=!1,clearInterval(u),clearTimeout(h),F&&F()}},[t,s]),t.length<1?null:e.jsxs("div",{ref:c,className:"overflow-y-auto overscroll-contain",style:{maxHeight:"calc(100dvh - 9.875rem)"},children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:"On this page"}),e.jsxs("nav",{className:"relative",ref:a,children:[e.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-px bg-border"}),x&&e.jsx("span",{className:"absolute left-0 w-[3px] rounded-full bg-brand",style:{to
1p:x.top,height:x.height,transition:"top 150ms ease-out, height 150ms ease-out"}}),t.map(l=>{const g=r===l.id;return e.jsx("a",{ref:i=>{i?n.current.set(l.id,i):n.current.delete(l.id)},href:`#${l.id}`,onClick:i=>p(i,l.id),className:`relative block text-[13px] leading-snug py-1 transition-colors duration-150 ${l.level===3?"pl-5":"pl-3"} ${g?"text-brand-text":"text-muted-foreground hover:text-foreground"}`,children:l.text},l.id)})]})]})}function en({headings:t,scrollContainerRef:s}){const[r,f]=o.useState(!1),[n,a]=o.useState(t.length>0?t[0].id:""),c=o.useRef(null),x=o.useRef(null),[w,y]=o.useState({}),E=o.useRef(!1),p=o.useCallback(()=>{let i=null;for(const F of t){const u=document.getElementById(F.id);if(u)if(u.getBoundingClientRect().top<=120)i=F.id;else break}a(i||(t.length>0?t[0].id:""))},[t]);o.useEffect(()=>{if(t.length<2)return;const F=s?.current||null||window,u=setTimeout(()=>p(),500);let h=null;const b=()=>{h===null&&(h=requestAnimationFrame(()=>{p(),h=null}))};return F.addEventListener("scroll",b,{passive:!0}),()=>{clearTimeout(u),F.removeEventListener("scroll",b),h!==null&&cancelAnimationFrame(h)}},[t,s,p]);const l=o.useCallback(()=>{if(!c.current)return;const i=c.current.getBoundingClientRect();y({position:"fixed",top:i.bottom+6,right:window.innerWidth-i.right})},[]);o.useEffect(()=>{if(!r)return;l();const i=()=>{E.current||f(!1)},F=()=>l(),u=s?.current;return u&&u.addEventListener("scroll",i,{passive:!0}),window.addEventListener("scroll",i,{passive:!0}),window.addEventListener("resize",F,{passive:!0}),()=>{u&&u.removeEventListener("scroll",i),window.removeEventListener("scroll",i),window.removeEventListener("resize",F)}},[r,l,s]),o.useEffect(()=>{if(!r)return;const i=u=>{x.current&&!x.current.contains(u.target)&&c.current&&!c.current.contains(u.target)&&f(!1)},F=u=>{u.key==="Escape"&&f(!1)};return document.addEventListener("mousedown",i),document.addEventListener("keydown",F),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",F)}},[r]);const g=o.useCallback((i,F)=>{i.preventDefault();const u=document.getElementById(F);if(!u)return;E.current=!0,a(F);const h=s?.current;if(h){const b=h.getBoundingClientRect(),v=u.getBoundingClientRect().top-b.top+h.scrollTop-80;h.scrollTo({top:v,behavior:"smooth"})}else u.scrollIntoView({behavior:"smooth",block:"start"});history.replaceState(null,"",`#${F}`),setTimeout(()=>{f(!1),setTimeout(()=>{E.current=!1},800)},50)},[s]);return t.length<1?null:e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:c,onClick:()=>f(!r),className:"inline-flex items-center px-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded-lg border border-border bg-card transition-colors",title:"On this page","aria-label":"On this page","aria-expanded":r,children:e.jsx(Et,{className:"h-3.5 w-3.5"})}),r&&ge.createPortal(e.jsxs("div",{ref:x,className:"w-64 max-h-80 rounded-xl border border-border bg-card shadow-md z-[9999] animate-in fade-in slide-in-from-bottom-1 duration-150 overflow-y-auto",style:w,children:[e.jsx("div",{className:"px-3 py-2 border-b border-border sticky top-0 bg-card",children:e.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"On this page"})}),e.jsx("div",{className:"p-1",children:t.map(i=>{const F=n===i.id;return e.jsx("a",{href:`#${i.id}`,onClick:u=>g(u,i.id),className:`block text-[13px] leading-snug px-3 py-1.5 rounded-lg transition-colors duration-150 ${i.level===3?"pl-6":"pl-3"} ${F?"text-brand-text bg-brand/5 font-medium":"text-muted-foreground hover:text-foreground hover:bg-accent"}`,children:i.text},i.id)})})]}),document.body)]})}const be="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");function tn(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function me(){if(typeof window>"u")return"";const t=window.location.hash.slice(1);try{return decodeURIComponent(t)}catch{return t}}function ke(t){return t.toLowerCase().replace(/[\s&]+/g,"-").replace(/^-+|-+$/g,"")}function nn(){if(typeof window>"u")return[];const t=new URLSearchParams(window.location.search).get("module");return t?t.split(",").map(s=>
1s.trim().toLowerCase()).filter(Boolean):[]}function rn(t){if(typeof document>"u")return t.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();const s=document.createElement("div");return s.innerHTML=t,(s.textContent||"").replace(/\s+/g," ").trim()}function sn(t,s){if(!s||typeof document>"u")return t;const r=document.createElement("div");r.innerHTML=t;const f=new RegExp(tn(s),"gi"),n=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),a=[];let c=n.nextNode();for(;c;){const x=c.parentElement;(!x||x.tagName!=="SCRIPT"&&x.tagName!=="STYLE"&&x.tagName!=="MARK")&&a.push(c),c=n.nextNode()}for(const x of a){const w=x.nodeValue||"";if(f.lastIndex=0,!f.test(w))continue;f.lastIndex=0;const y=document.createDocumentFragment();let E=0,p;for(;(p=f.exec(w))!==null;){p.index>E&&y.appendChild(document.createTextNode(w.slice(E,p.index)));const l=document.createElement("mark");l.className="glossary-search-highlight",l.textContent=p[0],y.appendChild(l),E=p.index+p[0].length,p[0].length===0&&f.lastIndex++}E<w.length&&y.appendChild(document.createTextNode(w.slice(E))),x.replaceWith(y)}return r.innerHTML}function on({text:t,query:s}){if(!s)return e.jsx(e.Fragment,{children:t});const r=t.toLowerCase(),f=s.toLowerCase(),n=[];let a=0,c=0;for(;a<t.length;){const x=r.indexOf(f,a);if(x===-1){n.push(t.slice(a));break}x>a&&n.push(t.slice(a,x)),n.push(e.jsx("mark",{className:"glossary-search-highlight",children:t.slice(x,x+f.length)},c++)),a=x+f.length}return e.jsx("span",{children:n})}function an(t){const s=new Map;for(const r of t){const f=r.term[0]?.toUpperCase()||"?";be.includes(f)&&(s.has(f)||s.set(f,[]),s.get(f).push(r))}return Array.from(s.entries()).sort(([r],[f])=>r.localeCompare(f)).map(([r,f])=>({letter:r,entries:f.sort((n,a)=>n.term.localeCompare(a.term))}))}function un(t){const s=[],r=new Set,a=new DOMParser().parseFromString(t,"text/html").querySelectorAll("h2");for(const c of a){const x=c.textContent?.trim()||"";if(x.length!==1||!be.includes(x))continue;const w=[];let y=c.nextElementSibling;for(;y&&y.tagName!=="H2";){if(y.tagName==="H3"){const E=y.textContent?.trim()||"",p=y.getAttribute("id")||E.toLowerCase().replace(/[^a-z0-9]+/g,"-");let l="",g=null;const i=[],F=[];let u=!1,h=y.nextElementSibling;for(;h&&h.tagName!=="H3"&&h.tagName!=="H2";){if(h.classList.contains("glossary-definition"))l=h.innerHTML,u=!0;else if(h.classList.contains("glossary-learn-more")){const b=h.querySelector("a");b&&(g=b.getAttribute("href"))}else if(h.classList.contains("glossary-related")){const m=(h.textContent||"").match(/Related components:\s*(.*)/);m&&m[1].split(",").map(v=>v.trim()).filter(Boolean).forEach(v=>{i.push(v),r.add(v)})}else if(h.classList.contains("glossary-see-also")){const b=h.querySelectorAll("a.glossary-see-also-link");for(const m of b){const A=(m.getAttribute("href")||"").match(/#(.+)/);F.push({termName:m.textContent?.trim()||"",anchor:A?A[1]:""})}}else!u&&h.tagName==="P"&&(l=h.innerHTML||h.textContent||"");h=h.nextElementSibling}E&&w.push({term:E,anchor:p,definitionHtml:l,learnMoreUrl:g,components:i,seeAlso:F})}y=y.nextElementSibling}w.length>0&&s.push({letter:x,entries:w})}return{sections:s,components:[...r].sort()}}function ln({htmlContent:t}){const s=ce(),[r,f]=o.useState(null),[n,a]=o.useState([]),[c,x]=o.useState(!1),[w,y]=o.useState(null),[E,p]=o.useState(new Set),[l,g]=o.useState("");o.useEffect(()=>{const d=s?`/api/docs/glossary-entries?gitRef=${encodeURIComponent(s)}`:"/api/docs/glossary-entries";y(null),fetch(d).then(async C=>{if(!C.ok){let L=null;try{L=await C.json()}catch{}y({error:L?.error||"fetch_failed",message:L?.message||`HTTP ${C.status}`,gitRef:L?.gitRef,status:C.status});return}const j=await C.json();j.entries?.length>0&&(f(j.entries),a(j.components||[]))}).catch(C=>{s&&y({error:"network_error",message:C.message,status:0})}).finally(()=>x(!0))},[s]);const{sections:i,components:F}=o.useMemo(()=>un(t),[t]),u=r||i.flatMap(d=>d.entries),h=r?n:F,b=o.useMemo(()=>u.map(d=>{const C=rn(d.definitionHtml).toLowerCase(),j=d.seeAlso.map(R=>R.termName).join(" ").toLowerCase(),L=d.components.join(" ").toLowerCase();return{entry:d,searchText:`${d.term.toLowerCase()} 
2 ${C} 
3 ${L} 
4 ${j}`}}),[u]),m=o.useMemo(()=>{const d=l.trim().toLowerCase();
4return b.filter(({entry:C,searchText:j})=>!(E.size>0&&!C.components.some(L=>E.has(L))||d&&!j.includes(d))).map(({entry:C})=>C)},[b,E,l]),v=l.trim(),A=o.useMemo(()=>{const d=new Map;if(!v)return d;for(const C of m)d.set(C.anchor,sn(C.definitionHtml,v));return d},[m,v]),k=o.useMemo(()=>an(m),[m]),B=o.useMemo(()=>k.flatMap(d=>d.entries),[k]),[I,$]=o.useState(""),[Z,q]=o.useState(""),Q=o.useRef(null),J=o.useRef(null),U=o.useRef(new Map),O=o.useRef(new Map),G=o.useMemo(()=>new Set(k.map(d=>d.letter)),[k]),W=Se(),D=o.useRef(!1),N=o.useRef(null),M=o.useRef(null),S=o.useCallback(()=>{const d=J.current;return(d?d.getBoundingClientRect().height:120)+16},[]);o.useEffect(()=>{const d=W.current||window,C=()=>{if(D.current)return;const j=S();let L="";for(const[H,_]of U.current){if(!_.isConnected)continue;_.getBoundingClientRect().top<=j&&(L=H)}$(L);let R="";for(const H of B){const _=O.current.get(H.anchor);if(!_)continue;_.getBoundingClientRect().top<=j+8&&(R=H.anchor)}!R&&B.length>0&&(R=B[0].anchor),q(R)};return C(),d.addEventListener("scroll",C,{passive:!0}),()=>d.removeEventListener("scroll",C)},[W,S,B]),o.useEffect(()=>()=>{N.current&&clearTimeout(N.current),M.current&&cancelAnimationFrame(M.current)},[]);const z=o.useCallback((d,C)=>{D.current=!0,d&&$(d),N.current&&clearTimeout(N.current),M.current&&cancelAnimationFrame(M.current);const j=()=>{D.current=!1,M.current&&(cancelAnimationFrame(M.current),M.current=null),N.current&&(clearTimeout(N.current),N.current=null)};N.current=setTimeout(j,3e3);const L=4,R=W.current,H=()=>R?R.scrollTop:window.scrollY;let _=H(),ee=0;const fe=()=>{const he=S(),Ke=C.getBoundingClientRect(),Ve=R?R.getBoundingClientRect().top:0,Xe=Math.abs(Ke.top-Ve-he),ve=H();if(ve===_?ee++:(ee=0,_=ve),Xe<=L||ee>=3){j();return}M.current=requestAnimationFrame(fe)};M.current=requestAnimationFrame(fe)},[S,W]),V=d=>{const C=U.current.get(d);if(!C)return;z(d,C);const j=S(),L=W.current;if(L){const R=L.getBoundingClientRect(),H=C.getBoundingClientRect();L.scrollTo({top:L.scrollTop+H.top-R.top-j,behavior:"smooth"})}else{const R=C.getBoundingClientRect();window.scrollTo({top:window.scrollY+R.top-j,behavior:"smooth"})}},ae=o.useCallback(d=>{if(q(d),typeof window>"u"||me()===d)return;const C=`${window.location.pathname}${window.location.search}#${d}`;window.history.pushState(null,"",C)},[]),K=o.useCallback((d,C)=>{const j=O.current.get(d);if(!j)return;C?.updateHash?ae(d):q(d),z(null,j);const L=S(),R=W.current;if(R){const H=R.getBoundingClientRect(),_=j.getBoundingClientRect();R.scrollTo({top:R.scrollTop+_.top-H.top-L,behavior:"smooth"})}else{const H=j.getBoundingClientRect();window.scrollTo({top:window.scrollY+H.top-L,behavior:"smooth"})}j.classList.add("glossary-highlight"),setTimeout(()=>j.classList.remove("glossary-highlight"),1500)},[W,S,z,ae]),X=o.useRef(!1);o.useEffect(()=>{if(X.current||B.length===0||typeof window>"u")return;const d=me();if(!d){X.current=!0;return}B.some(j=>j.anchor===d)?(X.current=!0,requestAnimationFrame(()=>K(d))):c&&(X.current=!0)},[B,c,K]),o.useEffect(()=>{const d=()=>{const C=me();C&&O.current.has(C)&&K(C)};return window.addEventListener("hashchange",d),()=>window.removeEventListener("hashchange",d)},[K]);const ne=d=>{p(C=>{const j=new Set(C);return j.has(d)?j.delete(d):j.add(d),j})},re=o.useMemo(()=>{const d=new Map;for(const C of h)d.set(ke(C),C);return d},[h]),se=o.useRef(!1);o.useEffect(()=>{if(se.current||!c)return;const d=nn();if(d.length>0){const C=new Set;for(const j of d){const L=re.get(j);L&&C.add(L)}C.size>0&&p(C)}se.current=!0},[c,re]),o.useEffect(()=>{if(!se.current||typeof window>"u")return;const d=new URLSearchParams(window.location.search);if(E.size>0){const R=h.filter(H=>E.has(H)).map(ke);d.set("module",R.join(","))}else d.delete("module");const C=d.toString(),j=`${window.location.pathname}${C?`?${C}`:""}${window.location.hash}`,L=`${window.location.pathname}${window.location.search}${window.location.hash}`;j!==L&&window.history.replaceState(null,"",j)},[E,h]);const[ue,T]=o.useState(null);return o.useEffect(()=>{const d=document.getElementById("glossary-toc-portal");if(d){T(d);return}const C=new MutationObserver(()=>{const j=document.getElementById("glossary-toc-portal");j&&(T(j),C.disconnect())});return C.observe(document.body,{childList:!0,subtree:!0}),()=>C.disconnect()},[]),e.jsxs("div",{ref:Q,children:[w&&s&&e.jsx("div",{role:"alert",style:{margin:"0 0 1.5rem",padding:"0.875rem 1rem",borderRadius:"0.5rem",border:"1px solid hsl(var(--destructive) / 0.4)",backgroundColor:"hsl(var(--destructive) / 0.06)",color:"hsl(var(--destructive))",fontSize:"0.875rem",lineHeight:"1.5"},children:w.error==="ref_not_found"?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"Preview ref not found:"})," The ref ",e.jsx("code",{style:{fontFamily:"monospace"},children:s}
4)," could not be found on GitHub. Showing entries from the last sync instead."]}):w.error==="ref_lookup_failed"?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"Preview unavailable:"})," Could not reach GitHub to look up ref ",e.jsx("code",{style:{fontFamily:"monospace"},children:s}),". Showing entries from the last sync instead."]}):e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"Preview error:"})," Could not load glossary entries for ref ",e.jsx("code",{style:{fontFamily:"monospace"},children:s}),": ",w.message]})}),ue&&B.length>0&&ge.createPortal(e.jsx(dn,{entries:B,activeAnchor:Z,onEntryClick:d=>K(d,{updateHash:!0})}),ue),e.jsx("style",{children:`
5        .glossary-highlight {
6          background-color: hsl(var(--brand) / 0.08) !important;
7          border-left-color: hsl(var(--brand-text)) !important;
8          transition: background-color 0.3s ease, border-left-color 0.3s ease;
9        }
10        .glossary-def-content a {
11          color: hsl(var(--foreground));
12          text-decoration: none;
13          position: relative;
14        }
15        .glossary-def-content a::after {
16          content: "";
17          position: absolute;
18          left: 0;
19          bottom: -1px;
20          width: 100%;
21          height: 1px;
22          background-color: currentColor;
23          transform: scaleX(1);
24          transform-origin: left;
25        }
26        .glossary-def-content a:hover::after {
27          animation: underline-re-enter 0.6s ease;
28        }
29        .glossary-def-content {
30          color: hsl(var(--foreground) / 0.8);
31          line-height: 1.75;
32        }
33        .glossary-def-content p {
34          margin-bottom: 1rem;
35          line-height: 1.75;
36        }
37        .glossary-def-content p:last-child {
38          margin-bottom: 0;
39        }
40        .glossary-def-content ul {
41          list-style-type: disc;
42          padding-left: 1.5rem;
43          margin-bottom: 1rem;
44        }
45        .glossary-def-content li {
46          margin-bottom: 0.5rem;
47          line-height: 1.75;
48        }
49        .glossary-search-highlight {
50          background-color: hsl(var(--brand) / 0.35);
51          color: hsl(var(--foreground));
52          border-radius: 2px;
53          padding: 0;
54          box-shadow: 0 0 0 1px hsl(var(--brand) / 0.45);
55        }
56        .dark .glossary-search-highlight {
57          background-color: hsl(164.7 100% 49.8% / 0.55);
58          color: hsl(0 0% 100%);
59          box-shadow: 0 0 0 1px hsl(164.7 100% 60% / 0.7);
60        }
61      `}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-medium text-foreground mb-3 tracking-tight",children:"Glossary"}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed max-w-2xl",children:"Key terms and concepts used across the Synerise platform. Click a letter to jump to that section."})]}),e.jsxs("div",{ref:J,className:"sticky top-0 z-10 bg-background/95 backdrop-blur-sm -mx-1 px-1 py-3 mb-12",children:[e.jsx("div",{className:"flex justify-between gap-0.5",children:be.map(d=>{const C=G.has(d),j=I===d;return e.jsx("button",{onClick:()=>C&&V(d),disabled:!C,className:`
62                  w-7 h-7 rounded-md text-xs font-medium transition-all duration-150
63                  flex items-center justify-center
64                  ${j?"bg-brand text-brand-foreground shadow-sm":C?"text-foreground hover:bg-brand/10 hover:text-brand-text":"text-muted-foreground/30 cursor-default"}
65                `,children:d},d)})}),h.length>0&&e.jsxs("div",{className:"mt-4 space-y-5",children:[e.jsxs("div",{className:"relative w-full",children:[e.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-4.35-4.35m0 0A7.5 7.5 0 104.5 4.5a7.5 7.5 0 0012.15 12.15z"})}),e.jsx("input",{type:"text",value:l,onChange:d=>g(d.target.value),placeholder:"Search terms or definitions","aria-label":"Search glossary terms and definitions",className:"w-full pl-9 pr-9 py-2 text-sm rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-brand/30 focus:border-brand-text"}),l&&e.jsx("button",{onClick:()=>g(""),"aria-label":"Clear search",className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:2.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.map(d=>e.jsx(rt,{active:E.has(d),onClick:()=>ne(d),children:d},d)),E.size>0&&e.jsx("button",{onClick:()=>p(new Set),className:"px-2.5 py-1 rounded-full text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",children:"Clear"})]})]})]}),m.length===0&&(E.size>0||l.trim())&&e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsxs("p",{className:"text-sm",children:["No glossary entries match the current ",l.trim()&&E.size>0?"search and filters":l.trim()?"search":"filters","."]}),e.jsxs("button",{onClick:()=>{p(new Set),g("")},className:"mt-2 text-sm text-brand-text hover:underline",children:["Clear ",l.trim()&&E.size>0?"search and filters":l.trim()?"search":"filters"]})]}),e.jsx("div",{className:"space-y-10",children:k.map(d=>e.jsxs("div",{ref:C=>{C?U.current.set(d.letter,C):U.current.delete(d.letter)},id:`glossary-${d.letter}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("span",{className:"text-2xl font-medium text-brand-text",children:d.letter}),e.jsx("div",{className:"flex-1 h-px bg-border"})]}),e.jsx("div",{className:"space-y-8",children:d.entries.map(C=>
65e.jsxs("div",{id:C.anchor,ref:j=>{j?O.current.set(C.anchor,j):O.current.delete(C.anchor)},className:"group/glossary-entry pl-4 border-l-2 border-transparent hover:border-brand-text transition-all duration-300 rounded-r-md",children:[e.jsxs("dt",{className:"text-xl font-medium text-foreground tracking-tight mb-3 flex items-center gap-2",children:[e.jsx(on,{text:C.term,query:v}),e.jsx(cn,{anchor:C.anchor,term:C.term,onCopied:()=>ae(C.anchor)})]}),e.jsxs("dd",{className:"text-base",children:[e.jsx("div",{className:"glossary-def-content md-content",dangerouslySetInnerHTML:{__html:Be(A.get(C.anchor)??C.definitionHtml)}}),C.learnMoreUrl&&e.jsx("div",{className:"mt-3",children:e.jsxs("a",{href:C.learnMoreUrl,...Ze(C.learnMoreUrl)?{target:"_blank",rel:"noopener noreferrer"}:{},className:"inline-flex items-center gap-1 text-base text-foreground link-underline-active",children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})}),"Learn more in the documentation"]})}),C.components.length>0&&e.jsxs("div",{className:"mt-3 text-sm text-muted-foreground/80",children:[e.jsx("span",{className:"font-medium",children:"Related components:"})," ",C.components.join(", ")]}),C.seeAlso.length>0&&e.jsxs("div",{className:"mt-3 text-sm",children:[e.jsx("span",{className:"font-medium text-muted-foreground/80",children:"See also:"})," ",C.seeAlso.map((j,L)=>e.jsxs("span",{children:[L>0&&", ",e.jsx("button",{onClick:()=>K(j.anchor),className:"text-foreground link-underline-active",children:j.termName})]},j.anchor))]})]})]},C.anchor))})]},d.letter))})]})}function cn({anchor:t,term:s,onCopied:r}){const[f,n]=o.useState(!1),a=o.useRef(null);o.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const c=async()=>{r();const x=typeof window<"u"?`${window.location.origin}${window.location.pathname}${window.location.search}#${t}`:`#${t}`;try{await navigator.clipboard.writeText(x)}catch{}n(!0),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)};return e.jsx("button",{type:"button",onClick:c,"aria-label":f?`Copied link to ${s}`:`Copy link to ${s}`,title:"Copy link to this term",className:"opacity-0 group-hover/glossary-entry:opacity-100 focus-visible:opacity-100 focus:opacity-100 transition-opacity duration-150 text-muted-foreground hover:text-brand-text focus:outline-none focus-visible:ring-2 focus-visible:ring-brand/40 rounded p-0.5 shrink-0",children:f?e.jsx("svg",{className:"w-4 h-4 text-brand-text",fill:"none",viewBox:"0 0 24 24",strokeWidth:2.5,stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}):e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})})})}function dn({entries:t,activeAnchor:s,onEntryClick:r}){const f=o.useRef(null),n=o.useRef(new Map),[a,c]=o.useState(null);return o.useEffect(()=>{const x=s?n.current.get(s):null,w=f.current;if(!x||!w){c(null);return}const y=w.getBoundingClientRect(),E=x.getBoundingClientRect();c({top:E.top-y.top,height:E.height})},[s,t]),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:"On this page"}),e.jsxs("nav",{className:"relative max-h-[calc(100dvh-10rem)] overflow-y-auto pr-1",ref:f,children:[e.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-px bg-border"}),a&&e.jsx("span",{className:"absolute left-0 w-[3px] rounded-full bg-brand",style:{top:a.top,height:a.height,transition:"top 150ms ease-out, height 150ms ease-out"}}),t.map(x=>{const w=s===x.anchor;return e.jsx("a",{ref:y=>{y?n.current.set(x.anchor,y):n.current.delete(x.anchor)},href:`#${x.anchor}`,onClick:y=>{y.preventDefault(),r(x.anchor)},className:`relative block text-[13px] leading-snug py-1 pl-3 transition-colors duration-150 truncate ${w?"text-brand-text":"text-muted-foreground hover:text-foreground"}`,title:x.term,children:x.term}
65,x.anchor)})]})]})}function fn({image:t,onClose:s}){return e.jsx(zt,{open:!!t,onOpenChange:r=>{r||s()},children:e.jsxs(_t,{children:[e.jsx(qt,{className:"fixed inset-0 z-[100] bg-black/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.jsxs(Ut,{className:"fixed inset-0 z-[100] flex flex-col items-center justify-center p-4 sm:p-8 outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 duration-200",onClick:r=>{r.target.closest("[data-lightbox-figure]")||s()},"aria-describedby":void 0,children:[e.jsx(Wt,{className:"sr-only",children:t?.alt||"Enlarged image"}),t&&e.jsxs("figure",{"data-lightbox-figure":!0,className:"flex max-h-full max-w-full flex-col items-center gap-3",children:[e.jsx("img",{src:t.src,alt:t.alt,width:t.width,height:t.height,"data-lightbox-image":!0,className:"h-auto min-h-0 w-auto max-h-[calc(100vh-6rem)] max-w-full rounded-lg object-contain shadow-2xl"},t.src),t.caption&&e.jsx("figcaption",{className:"max-w-2xl text-center text-sm italic text-white/80",children:t.caption})]}
65),e.jsxs(Gt,{className:"absolute right-4 top-4 rounded-full bg-black/50 p-2 text-white/90 transition-colors hover:bg-black/70 hover:text-white focus:outline-none focus:ring-2 focus:ring-white/60",children:[e.jsx(yt,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})})}const hn=o.memo(function({html:s,className:r,contentRef:f}){const n=o.useMemo(()=>({__html:s}),[s]);return e.jsx("div",{ref:f,className:r,dangerouslySetInnerHTML:n})});function xe(t){return t.classList.contains("icon")||(t.getAttribute("src")||"").includes("/icons/")}function Ne(t){xe(t)||t.naturalWidth&&t.naturalHeight&&(!t.hasAttribute("width")&&!t.hasAttribute("height")&&(t.setAttribute("width",String(t.naturalWidth)),t.setAttribute("height",String(t.naturalHeight))),t.style.aspectRatio=`${t.naturalWidth} / ${t.naturalHeight}`,t.style.minHeight="")}const mn={negative:"poor",positive:"good"};function pn(){try{const t=document.getElementById("root"),s=[];return document.querySelectorAll('[class*="snrs"], [id*="snrs"], [class*="synerise"], [id*="synerise"]').forEach(n=>{t?.contains(n)||/feedback/i.test(n.className+" "+n.id+" "+(n.textContent??""))&&s.push(n)}),s.length===0&&document.body.querySelectorAll("div, a, button, span").forEach(a=>{if(t?.contains(a)||s.length>0)return;a.textContent?.trim()==="Feedback"&&a.offsetParent!==null&&s.push(a)}),s.length===0?!1:(s.reduce((n,a)=>n.contains(a)?a:n).dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),!0)}catch{return!1}}function xn({className:t}){return e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 28 28",fill:"none",className:t,children:[e.jsx("circle",{cx:"14",cy:"14",r:"12",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("circle",{cx:"10",cy:"11.5",r:"1.2",fill:"currentColor"}),e.jsx("circle",{cx:"18",cy:"11.5",r:"1.2",fill:"currentColor"}),e.jsx("path",{d:"M9.5 17c1.2 2 3.2 3 4.5 3s3.3-1 4.5-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function gn({className:t}){return e.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 28 28",fill:"none",className:t,children:[e.jsx("circle",{cx:"14",cy:"14",r:"12",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("circle",{cx:"10",cy:"11.5",r:"1.2",fill:"currentColor"}),e.jsx("circle",{cx:"18",cy:"11.5",r:"1.2",fill:"currentColor"}),e.jsx("path",{d:"M9.5 19.5c1.2-2 3.2-3 4.5-3s3.3 1 4.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}const Dn=[{value:"negative",icon:gn,label:"Not helpful"},{value:"positive",icon:xn,label:"Very helpful"}],Fn={negative:"text-red-600 dark:text-red-400 bg-red-500/10",positive:"text-brand-text bg-brand/10"};function bn({slug:t,compact:s}){const[r,f]=o.useState(null);return o.useEffect(()=>{f(null)},[t]),e.jsxs("div",{className:s?"":"mt-10",children:[e.jsx("p",{className:`text-sm text-muted-foreground ${s?"mb-2":"mb-3"}`,children:"Was this helpful?"}),e.jsx("div",{className:"inline-flex items-center gap-1 rounded-full border border-border px-2 py-1.5",children:Dn.map(n=>{const a=n.icon,c=r===n.value,x=r!==null&&!c;return e.jsx("button",{type:"button",onClick:()=>{f(n.value);try{window.SR?.event?.trackCustomEvent?.("hub.feedbackClicked",{feedback:mn[n.value]})}catch{}n.value==="negative"&&pn()},title:n.label,"aria-pressed":c,className:`p-1 rounded-full transition-all duration-150 cursor-pointer ${c?Fn[n.value]:x?"text-muted-foreground/30 hover:text-muted-foreground/60":"text-muted-foreground/50 hover:text-muted-foreground hover:bg-muted"}`,children:e.jsx(a,{})},n.value)})}),r&&e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:r==="negative"?"Thanks for letting us know! Please share more details in the feedback widget on the right.":"Thanks for your feedback! We're glad to help!"})]})}function Cn({containerRef:t}){const[s,r]=o.useState(!1),[f,n]=o.useState({top:0,left:0}),[a,c]=o.useState(""),[x,w]=o.useState(!1),y=o.useRef(null),{toast:E}=st(),{setOpen:p,setInitialQuery:l}=Le(),g=o.useCallback(()=>{const u=window.getSelection();if(!u||u.isCollapsed||u.rangeCount===0||!u.toString().trim()){r(!1);return}const h=t.current;if(!h)return;if(!h.contains(u.anchorNode)||!h.contains(u.focusNode)){r(!1);return}let b;try{b=u.getRangeAt(0)}catch{r(!1);return}const m=b.getBoundingClientRect(),v=h.getBoundingClientRect(),A=y.current,k=A?A.offsetWidth:260,B=36;let I=m.left+m.width/2-v.left-k/2;
65I=Math.max(0,Math.min(I,v.width-k));let $=m.top-v.top-B-8;$<0&&($=m.bottom-v.top+8),n({top:$,left:I}),c(u.toString().trim()),w(!1),r(!0)},[t]);o.useEffect(()=>{const u=t.current;if(!u)return;const h=()=>{requestAnimationFrame(g)},b=I=>{I.key==="Escape"&&(r(!1),window.getSelection()?.removeAllRanges())},m=I=>{y.current&&y.current.contains(I.target)||r(!1)},v=()=>{requestAnimationFrame(g)};let A=null;const k=()=>{A===null&&(A=requestAnimationFrame(()=>{g(),A=null}))};u.addEventListener("mouseup",h),document.addEventListener("selectionchange",v),document.addEventListener("keydown",b),document.addEventListener("mousedown",m),window.addEventListener("resize",k);const B=u.closest("[data-scroll-container]")||u.parentElement?.closest("[class*='overflow']");return B&&B.addEventListener("scroll",k,{passive:!0}),window.addEventListener("scroll",k,{passive:!0}),()=>{u.removeEventListener("mouseup",h),document.removeEventListener("selectionchange",v),document.removeEventListener("keydown",b),document.removeEventListener("mousedown",m),window.removeEventListener("resize",k),window.removeEventListener("scroll",k),B&&B.removeEventListener("scroll",k),A!==null&&cancelAnimationFrame(A)}},[g,t]);const i=o.useCallback(async()=>{if(a)try{await navigator.clipboard.writeText(a),w(!0),setTimeout(()=>w(!1),1500)}catch{E({title:"Failed to copy",variant:"destructive"})}},[a,E]),F=o.useCallback(()=>{a&&(l(a),p(!0),r(!1),window.getSelection()?.removeAllRanges())},[a,l,p]);return s?e.jsxs("div",{ref:y,className:"text-selection-toolbar",style:{position:"absolute",top:`${f.top}px`,left:`${f.left}px`},onMouseDown:u=>u.preventDefault(),children:[e.jsxs("button",{onClick:i,className:"toolbar-btn",children:[x?e.jsx(Fe,{size:14}):e.jsx(Re,{size:14}),e.jsx("span",{children:x?"Copied":"Copy"})]}),e.jsx("div",{className:"toolbar-divider"}),e.jsxs("button",{onClick:F,className:"toolbar-btn",children:[e.jsx(de,{size:14}),e.jsx("span",{children:"Search"})]})]}):null}function vn({slug:t}){const[s,r]=o.useState([]),[f,n]=o.useState(!0);return o.useEffect(()=>{let a=!1;return n(!0),fetch(`/api/docs/${t}/related`).then(c=>c.ok?c.json():{related:[]}).then(c=>{a||(r((c.related||[]).filter(x=>!oe(x.slug))),n(!1))}).catch(()=>{a||(r([]),n(!1))}),()=>{a=!0}},[t]),f||s.length===0?null:e.jsxs("div",{className:"mt-12 pt-8 border-t border-border",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4",children:"Related articles"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:s.map(a=>e.jsxs(Y,{href:`/${a.slug}`,className:"group flex items-start gap-3 p-4 rounded-lg border border-border bg-card hover:border-brand-text hover:bg-accent/50 transition-colors",children:[e.jsx(wt,{className:"h-4 w-4 mt-0.5 text-muted-foreground group-hover:text-brand-text transition-colors shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-brand-text transition-colors line-clamp-2",children:a.title}),(a.section||a.category)&&e.jsxs("span",{className:"block text-xs text-muted-foreground mt-1 truncate",children:[a.category,a.category&&a.section&&" · ",a.section]})]}),e.jsx(te,{className:"h-4 w-4 mt-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0"})]},a.slug))})]})}function ze(t,s,r=[]){for(const f of t){const n=[...r,{title:f.title,slug:f.slug}];if(f.slug===s)return n;if(f.children?.length){const a=ze(f.children,s,n);if(a)return a}}return null}function En({slug:t,tree:s,articleTitle:r,leadingSegments:f,dropAncestorSlugs:n}){let a=ze(s,t);a&&n?.length&&(a=a.filter((E,p)=>p===a.length-1||!n.includes(E.slug)));const c=[];if(f?.length&&c.push(...f),a&&a.length>0?c.push(...a):r&&c.push({title:r,slug:t}),c.length===0)return null;const x=r||c[c.length-1].title,w=c.slice(0,-1),y=w.length>1;return e.jsxs("nav",{"aria-label":"Breadcrumb",className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0 flex-wrap",children:[w.map((E,p)=>{const l=p===w.length-1,g=y&&!l;return e.jsxs("span",{className:"contents",children:[l&&y&&e.jsxs("span",{className:"contents sm:hidden",children:[e.jsx("span",{className:"opacity-60",children:"…"}),e.jsx(te,{className:"h-3 w-3 shrink-0 opacity-40"})]}),e.jsxs("span",{className:`contents ${g?"hidden sm:contents":""}`,children:[oe(E.slug)?e.jsx("span",{className:"truncate max-w-[200px]",children:E.title}):e.jsx(Y,{href:`/${E.slug}`,className:"hover:text-brand-text transition-colors truncate max-w-[200px]",children:E.title}),e.jsx(te,{className:"h-3 w-3 shrink-0 opacity-40"})]})]},E.slug)}),e.jsx("span",{className:"text-foreground font-medium truncate","aria-current":"page",children:x})]})}function yn({className:t}){return e.jsx("svg",{className:t,viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M6.345 5h2.1v6.533H6.993l.055-5.31-1.774 5.31H4.072l-1.805-5.31c.04.644.06 5.31.06 5.31H1V5h2.156s1.528 4.493 1.577 4.807L6.345 5zm6.71 3.617v-3.5H11.11v3.5H9.166l2.917 2.916L15 8.617h-1.945z"})})}function wn({className:t}){return e.jsxs("svg",{className:t,viewBox:"0 0 92.2 65",fill:"currentColor",children:[e.jsx("path",{d:"M66.5,0H52.4l25.7,65h14.1L66.5,0z"}),e.jsx("path",{d:"M25.7,0L0,65h14.4l5.3-13.6h26.9L51.8,65h14.4L40.5,0C40.5,0,25.7,0,25.7,0z M24.3,39.3l8.8-22.8l8.8,22.8H24.3z"})]})}function An({className:t}
65){return e.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.998 5.998 0 0 0-3.998 2.9 6.042 6.042 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872v.024zm16.597 3.855l-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66v.018zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681l-.004 6.722zm1.097-2.365l2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5-.005-2.999z"})})}function jn({markdownUrl:t,llmsFullUrl:s,pageTitle:r,pageUrl:f}){const[n,a]=o.useState(!1),[c,x]=o.useState(!1),w=o.useRef(null),y=o.useRef(null),E=o.useRef(null),p=o.useRef(new Map),[l,g]=o.useState(null),[i,F]=o.useState(null),[u,h]=o.useState({}),b=o.useCallback(D=>N=>{N?p.current.set(D,N):p.current.delete(D)},[]),m=o.useCallback(()=>{if(!w.current)return;const D=w.current.getBoundingClientRect(),N=320,M=D.top,S=D.right;M>=N?h({position:"fixed",top:D.top-6,left:S-288,transform:"translateY(-100%)"}):h({position:"fixed",top:D.bottom+6,left:S-288})},[]);o.useEffect(()=>{if(!n)return;m();const D=()=>a(!1);return window.addEventListener("scroll",D,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",D,!0),window.removeEventListener("resize",m)}},[n,m]),o.useEffect(()=>{if(!n)return;function D(N){w.current&&!w.current.contains(N.target)&&y.current&&!y.current.contains(N.target)&&a(!1)}return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[n]);const v=o.useCallback(()=>{a(!1),requestAnimationFrame(()=>E.current?.focus())},[]),A=o.useCallback(D=>{g(D),requestAnimationFrame(()=>{p.current.get(D)?.focus()})},[]),k=async()=>{v();try{const D=await fetch(t);if(!D.ok)throw new Error("Failed to fetch");const N=await D.text();await navigator.clipboard.writeText(N),x(!0),setTimeout(()=>x(!1),2e3)}catch(D){console.warn("Failed to fetch markdown, falling back to page text:",D);try{const N=document.querySelector("main");N&&(await navigator.clipboard.writeText(N.innerText),x(!0),setTimeout(()=>x(!1),2e3))}catch(N){console.error("Failed to copy page content:",N)}}},B=()=>{window.open(t,"_blank"),v()},I=()=>{s&&window.open(s,"_blank"),v()},$=async()=>{try{const D=await fetch(t);if(!D.ok)throw new Error(`Failed to fetch markdown: HTTP ${D.status}`);return await D.text()}catch(D){return console.warn("Failed to fetch markdown content, using page text fallback:",D),document.querySelector("main")?.innerText||""}},Z=(D,N)=>{const M=encodeURIComponent(N);return D==="chatgpt"?`https://chatgpt.com/?q=${M}`:`https://claude.ai/new?q=${M}`},q=async D=>{v();const N=window.open("about:blank","_blank"),S=(await $()).slice(0,8e3),z=`Here is documentation from "${r}" (${f}):
66
67${S}
68
69Please help me understand this documentation.`;N&&(N.location.href=Z(D,z))},Q=()=>{try{const D=new URL(f),N=D.pathname.replace(/\/+$/,"");return N?`${D.origin}${N}.md`:f}catch{return f}},J=D=>{v();const N=window.open("about:blank","_blank"),M=`Please read this Synerise documentation page and help me understand it: "${r}" — ${Q()}`;N&&(N.location.href=Z(D,M))},U=[{kind:"action",key:"copy",label:"Copy page",subtitle:"Copy this page as Markdown",icon:c?e.jsx(Fe,{className:"h-4 w-4 text-emerald-500"}):e.jsx(Re,{className:"h-4 w-4"}),onClick:k},{kind:"action",key:"view-md",label:"View as Markdown",subtitle:"View this page as plain text",icon:e.jsx(yn,{className:"h-4 w-4"}),external:!0,onClick:B},{kind:"expandable",key:"chatgpt",label:"Open in ChatGPT",subtitle:"Ask ChatGPT about this page",icon:e.jsx(An,{className:"h-4 w-4"}),children:[{key:"text",label:"As text",ariaLabel:"Open in ChatGPT as text",onClick:()=>q("chatgpt")},{key:"link",label:"As link",ariaLabel:"Open in ChatGPT as link",onClick:()=>J("chatgpt")}]},{kind:"expandable",key:"claude",label:"Open in Claude",subtitle:"Ask Claude about this page",icon:e.jsx(wn,{className:"h-4 w-4"}),children:[{key:"text",label:"As text",ariaLabel:"Open in Claude as text",onClick:()=>q("claude")},{key:"link",label:"As link",ariaLabel:"Open in Claude as link",onClick:()=>J("claude")}]}
69,...s?[{kind:"action",key:"llms",label:"LLMs full",subtitle:"All docs as a single Markdown file",icon:e.jsx(jt,{className:"h-4 w-4"}),external:!0,onClick:I}]:[]],O=[];U.forEach(D=>{D.kind==="action"?O.push({kind:"action",key:D.key,item:D}):(O.push({kind:"parent",key:D.key,item:D}),i===D.key&&D.children.forEach(N=>{O.push({kind:"child",key:`${D.key}::${N.key}`,parentKey:D.key,child:N})}))}),o.useEffect(()=>{if(!n){g(null),F(null);return}const D=U[0]?.key;D&&A(D)},[n]);const G=D=>{D.kind==="parent"?F(D.key):D.kind==="action"&&F(null)},W=D=>{if(D.key==="Escape"){if(D.preventDefault(),i){const S=i;F(null),A(S)}else v();return}if(D.key==="Tab"){a(!1);return}const N=l?O.findIndex(S=>S.key===l):-1;if(N<0)return;const M=O.length;if(M!==0){if(D.key==="ArrowDown"){D.preventDefault();const S=O[N];if(S.kind==="parent"&&i!==S.key&&S.item.children.length>0){F(S.key),A(`${S.key}::${S.item.children[0].key}`);return}const z=(N+1)%M,V=O[z];G(V),A(V.key)}else if(D.key==="ArrowUp"){D.preventDefault();const S=(N-1+M)%M,z=O[S];G(z),A(z.key)}else if(D.key==="Home"){D.preventDefault();const S=O[0];G(S),A(S.key)}else if(D.key==="End"){D.preventDefault();const S=O[M-1];G(S),A(S.key)}}};return e.jsxs("div",{className:"relative z-50 self-stretch flex",ref:w,children:[e.jsxs("button",{ref:E,onClick:()=>a(!n),onKeyDown:D=>{(D.key==="ArrowDown"||D.key==="ArrowUp")&&(D.preventDefault(),a(!0))},className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-sm font-medium text-muted-foreground hover:text-foreground hover:border-brand-text transition-colors","aria-haspopup":"menu","aria-expanded":n,children:[e.jsx(At,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"hidden sm:inline",children:"Ask"}),e.jsx(pe,{className:`h-3 w-3 transition-transform duration-200 ${n?"rotate-180":""}`})]}),n&&ge.createPortal(e.jsx("div",{ref:y,role:"menu","aria-orientation":"vertical",className:"w-72 rounded-xl border border-border bg-card shadow-md z-[9999] overflow-hidden animate-in fade-in slide-in-from-bottom-1 duration-150",style:u,onKeyDown:W,children:e.jsx("div",{className:"p-1",children:U.map(D=>{if(D.kind==="action"){const S=l===D.key;return e.jsxs("button",{ref:b(D.key),role:"menuitem",tabIndex:S?0:-1,onClick:D.onClick,onMouseEnter:()=>F(null),onFocus:()=>{g(D.key),F(null)},className:"w-full flex items-start gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent focus:bg-accent focus:outline-none transition-colors group",children:[e.jsx("span",{className:"mt-0.5 text-muted-foreground group-hover:text-foreground transition-colors shrink-0",children:D.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:D.label}),e.jsx("div",{className:"text-xs text-muted-foreground leading-tight mt-0.5",children:D.subtitle})]}),D.external&&e.jsx(we,{className:"h-3 w-3 mt-1 text-muted-foreground/50 shrink-0"})]},D.key)}const N=i===D.key,M=l===D.key;return e.jsxs("div",{children:[e.jsxs("button",{ref:b(D.key),role:"menuitem","aria-haspopup":"menu","aria-expanded":N,tabIndex:M?0:-1,onClick:()=>F(S=>S===D.key?null:D.key),onMouseEnter:()=>F(D.key),onFocus:()=>{g(D.key),F(D.key)},className:"w-full flex items-start gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent focus:bg-accent focus:outline-none transition-colors group",children:[e.jsx("span",{className:"mt-0.5 text-muted-foreground group-hover:text-foreground transition-colors shrink-0",children:D.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:D.label}),e.jsx("div",{className:"text-xs text-muted-foreground leading-tight mt-0.5",children:D.subtitle})]}),e.jsx(pe,{className:`h-3.5 w-3.5 mt-1 text-muted-foreground/60 shrink-0 transition-transform duration-150 ${N?"rotate-0":"-rotate-90"}`})]}),N&&e.jsx("div",{className:"pl-9 pr-1 pb-1 pt-0.5 space-y-0.5",children:D.children.map(S=>{const z=`${D.key}::${S.key}`,V=l===z;return e.jsxs("button",{ref:b(z),role:"menuitem","aria-label":S.ariaLabel,tabIndex:V?0:-1,onClick:S.onClick,onFocus:()=>g(z),className:"w-full flex items-center gap-2 px-3 py-1.5 rounded-md text-left text-xs font-medium text-foreground hover:bg-accent focus:bg-accent focus:outline-none transition-colors",children:[e.jsx("span",{className:"flex-1",children:S.label}
69),e.jsx(we,{className:"h-3 w-3 text-muted-foreground/50 shrink-0"})]},z)})})]},D.key)})})}),document.body)]})}const _e={"docs/crm":{animatedIcon:Ot,description:"A place where you keep all the information about your customers"},"docs/ai-hub":{animatedIcon:Pt,description:"All AI-powered features available in one model"},"docs/automation":{animatedIcon:Ht,description:"Automate all your marketing activities"},"docs/analytics":{animatedIcon:$t,description:"Measure the activity of your customers and the results of your messages sent to customers"},"docs/assets":{animatedIcon:Mt,description:"Configure the parameters used in the whole application"},"docs/campaign":{animatedIcon:It,description:"Build strong relations with your customers by reaching them in various channels"},"docs/settings":{animatedIcon:Rt,description:"Configure settings necessary to enjoy the work in the application"},loyalty:{animatedIcon:Tt,description:"Explore captivating loyalty program scenarios"}};function kn(t){return oe(t.slug)||oe(t.path)}function ie(t){const s=[];for(const r of t)kn(r)||s.push({...r,children:r.children?ie(r.children):r.children});return s}function qe(t,s=[]){const r=ce(),[f,n]=o.useState(null),[a,c]=o.useState(!0),[x,w]=o.useState(null),y=o.useCallback(async()=>{c(!0),w(null);try{const E=t.includes("?")?"&":"?",p=r?`/api${t}${E}gitRef=${encodeURIComponent(r)}`:`/api${t}`,l=await fetch(p);if(!l.ok){let i=null;try{i=await l.json()}catch{}const F={status:l.status,message:i?.message||i?.error||`HTTP ${l.status}`,code:typeof i?.error=="string"?i.error:void 0,gitRef:i?.gitRef};w(F);return}const g=await l.json();n(g)}catch(E){w({message:E.message,status:null})}finally{c(!1)}},[t,r,...s]);return o.useEffect(()=>{y()},[y]),ot(y),{data:f,loading:a,error:x,refetch:y}}const Nn=o.memo(function({htmlContent:s,headings:r,scrollContainerRef:f}){const n=o.useRef(null),a=o.useRef(null),[,c]=le(),[x,w]=o.useState(null),y=ce(),E=o.useMemo(()=>{let p=s;return p=p.replace(/ loading="lazy"/g,""),p=p.replace(/img\.youtube\.com\/vi\/([a-zA-Z0-9_-]+)\/hqdefault\.jpg/g,"img.youtube.com/vi/$1/hq720.jpg"),p=p.replace(/youtube-embed youtube-facade(?! not-prose)/g,"youtube-embed youtube-facade not-prose"),p=p.replace(/vimeo-embed vimeo-facade(?! not-prose)/g,"vimeo-embed vimeo-facade not-prose"),p=p.replace(/<div class="youtube-embed"><iframe\s+src="https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]+)"[^>]*><\/iframe><\/div>/g,(l,g)=>`<div class="youtube-embed youtube-facade not-prose" data-youtube-id="${g}" role="button" tabindex="0" aria-label="Play YouTube video"><img src="https://img.youtube.com/vi/${g}/hq720.jpg" alt="YouTube video" class="youtube-facade-thumb" loading="lazy" /><span class="youtube-facade-play" aria-hidden="true"><svg viewBox="0 0 68 48" width="68" height="48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.64 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"/><path d="M45 24 27 14v20" fill="white"/></svg></span></div>`),p=p.replace(/<div class="vimeo-embed"><iframe\s+src="https:\/\/player\.vimeo\.com\/video\/([0-9]+)[^"]*"[^>]*><\/iframe><\/div>/g,(l,g)=>`<div class="vimeo-embed vimeo-facade not-prose" data-vimeo-id="${g}" role="button" tabindex="0" aria-label="Play Vimeo video"><img src="https://vumbnail.com/${g}.jpg" alt="Vimeo video" class="vimeo-facade-thumb" loading="lazy" /><span class="vimeo-facade-play" aria-hidden="true"><svg viewBox="0 0 68 48" width="68" height="48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.64 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="#00adef"/><path d="M45 24 27 14v20" fill="white"/></svg></span></div>`),r.length>0&&(p=Zt(p,r)),p=Be(p),y&&(p=vt(p,y)),p},[s,r,y]);return o.useEffect(()=>{n.current&&r.length>0&&Qt(n.current,r)},[E,r]),o.useEffect(()=>{const p=n.current;
69if(!p)return;const l=p.querySelectorAll("img"),g=[];return l.forEach(i=>{if(i.complete&&i.naturalWidth)Ne(i);else{!xe(i)&&(!i.hasAttribute("width")||!i.hasAttribute("height"))&&(i.style.aspectRatio="16 / 9",i.style.minHeight="200px");const F=new AbortController;g.push(F),i.addEventListener("load",()=>Ne(i),{signal:F.signal,once:!0})}}),()=>{g.forEach(i=>i.abort())}},[E]),o.useEffect(()=>{const p=n.current;if(!p)return;const l=g=>{const i=g.target.closest(".heading-anchor-link");if(!i)return;g.preventDefault(),g.stopPropagation();const F=i.getAttribute("data-heading-id");if(!F)return;const u=`${window.location.origin}${window.location.pathname}#${F}`;navigator.clipboard.writeText(u).then(()=>{const h=i.querySelector(".link-icon"),b=i.querySelector(".check-icon");h&&b&&(h.style.display="none",b.style.display="block",setTimeout(()=>{h.style.display="",b.style.display="none"},1500))}).catch(()=>{const h=i;h.style.color="hsl(var(--destructive))",setTimeout(()=>{h.style.color=""},1500)})};return p.addEventListener("click",l),()=>p.removeEventListener("click",l)},[E,r]),o.useEffect(()=>{const p=n.current;if(!p)return;const l="/".replace(/\/$/,""),g=["docs","developers","use-cases","first-steps","troubleshooting","loyalty","integrations","ai-7-days"],i=u
69=>{const h=document.getElementById(u),b=f?.current;if(h&&b){const m=b.getBoundingClientRect(),A=h.getBoundingClientRect().top-m.top+b.scrollTop-80;b.scrollTo({top:A,behavior:"smooth"})}else h&&h.scrollIntoView({behavior:"smooth",block:"start"})},F=u=>{if(u.defaultPrevented||u.button!==0||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey)return;const h=u.target.closest("a");if(!h||h.classList.contains("heading-anchor-link")||h.getAttribute("target")==="_blank")return;const b=h.getAttribute("href");if(!b)return;if(b.startsWith("#")){u.preventDefault();const Q=b.slice(1);i(Q),history.replaceState(null,"",b);return}let m;try{m=new URL(b,window.location.href)}catch{return}if(m.origin!==window.location.origin)return;const v=m.pathname,A=l&&v.startsWith(l)?v.slice(l.length):v,k=A.replace(/^\/+/,"").split("/")[0];if(!g.includes(k))return;u.preventDefault();const B=A.replace(/\/$/,""),I=m.hash,$=window.location.pathname,q=(l&&$.startsWith(l)?$.slice(l.length):$).replace(/\/$/,"");if(B===q&&I){i(I.slice(1)),history.replaceState(null,"",`${v}${I}`);return}c(`${B}${I}`)};return p.addEventListener("click",F),()=>p.removeEventListener("click",F)},[E,c,f]),o.useEffect(()=>{const p=n.current;if(!p)return;const l=u=>{let h=u.getAttribute("data-youtube-id");h||(h=u.querySelector(".youtube-facade-thumb")?.src?.match(/\/vi\/([a-zA-Z0-9_-]+)\//)?.[1]??null),h&&(u.classList.remove("youtube-facade"),u.removeAttribute("role"),u.removeAttribute("tabindex"),u.removeAttribute("aria-label"),u.innerHTML=`<iframe src="https://www.youtube.com/embed/${h}?autoplay=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`)},g=u=>{const h=u.getAttribute("data-vimeo-id");h&&(u.classList.remove("vimeo-facade"),u.removeAttribute("role"),u.removeAttribute("tabindex"),u.removeAttribute("aria-label"),u.innerHTML=`<iframe src="https://player.vimeo.com/video/${h}?autoplay=1" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>`)},i=u=>{const h=u.target,b=h.closest(".youtube-facade");if(b){u.preventDefault(),l(b);return}const m=h.closest(".vimeo-facade");m&&(u.preventDefault(),g(m))},F=u=>{if(u.key!=="Enter"&&u.key!==" ")return;const h=u.target,b=h.closest(".youtube-facade");if(b){u.preventDefault(),l(b);return}const m=h.closest(".vimeo-facade");m&&(u.preventDefault(),g(m))};return p.addEventListener("click",i),p.addEventListener("keydown",F),()=>{p.removeEventListener("click",i),p.removeEventListener("keydown",F)}},[E]),o.useEffect(()=>{const p=n.current;if(!p)return;const l=g=>{const i=g.target.closest(".tab-button");if(!i)return;const F=i.getAttribute("data-tab-id"),u=i.getAttribute("data-tab-group");if(!F||!u)return;const h=i.closest(".content-tabs");if(!h)return;h.querySelectorAll(`.tab-button[data-tab-group="${u}"]`).forEach(m=>{m.removeAttribute("data-tab-active")}),h.querySelectorAll(`.tab-panel[data-tab-group="${u}"]`).forEach(m=>{m.removeAttribute("data-tab-active")}),i.setAttribute("data-tab-active","true");const b=h.querySelector(`.tab-panel[data-tab-id="${F}"]`);b&&b.setAttribute("data-tab-active","true")};return p.addEventListener("click",l),()=>p.removeEventListener("click",l)},[E]),o.useEffect(()=>{const p=n.current;if(!p)return;const l=[];return p.querySelectorAll(".highlight-code-block").forEach(g=>{if(g.getAttribute("data-hl-processed"))return;g.setAttribute("data-hl-processed","true");
69const i=g.getAttribute("data-hl-lines"),F=i?new Set(i.split(",").map(Number).filter(B=>Number.isFinite(B)&&B>0)):void 0,u=g.querySelector("code");if(!u)return;const b=(u.className||"").match(/language-(\S+)/),m=b?b[1]:"text",v=u.textContent||"",A=document.createElement("div");A.className="highlight-code-mount",g.replaceWith(A);const k=Ee.createRoot(A);k.render(e.jsx(ye,{code:v,language:m,highlightLines:F})),l.push(k)}),p.querySelectorAll("pre > code").forEach(g=>{const i=g.parentElement;if(!i||i.tagName!=="PRE"||i.getAttribute("data-hl-processed")||i.closest(".highlight-code-mount"))return;i.setAttribute("data-hl-processed","true");const u=(g.className||"").match(/language-(\S+)/),h=u?u[1]:"text",b=g.textContent||"",m=document.createElement("div");m.className="highlight-code-mount",i.replaceWith(m);const v=Ee.createRoot(m);v.render(e.jsx(ye,{code:b,language:h})),l.push(v)}),()=>{l.forEach(g=>g.unmount())}},[E]),o.useEffect(()=>{const p=n.current;if(!p)return;const l=i=>{const F=Array.from(i.childNodes);let u=0;for(;u<F.length&&F[u].nodeType===Node.TEXT_NODE&&!(F[u].textContent||"").trim();)u++;if(u>=F.length)return null;const h=F[u];if(h.nodeType===Node.ELEMENT_NODE&&h.tagName==="STRONG"){const b=F[u+1];if(b&&b.nodeType===Node.ELEMENT_NODE&&b.tagName==="BR"){const m=F.slice(u+2);return m.some(A=>A.nodeType===Node.ELEMENT_NODE||A.nodeType===Node.TEXT_NODE&&(A.textContent||"").trim())?{titleHtml:h.innerHTML,bodyNodes:m}:null}if(b&&b.nodeType===Node.TEXT_NODE){const m=b.textContent||"",v=m.indexOf(`
70`),A=m.search(/\S/);if(v!==-1&&(A===-1||v<A)){const k=m.replace(/^[ \t]*\n[ \t]*/,""),B=[];k.length>0&&B.push(document.createTextNode(k));for(let $=u+2;$<F.length;$++)B.push(F[$]);return B.some($=>$.nodeType===Node.ELEMENT_NODE||$.nodeType===Node.TEXT_NODE&&($.textContent||"").trim())?{titleHtml:h.innerHTML,bodyNodes:B}:null}}return null}if(h.nodeType===Node.ELEMENT_NODE&&h.tagName==="P"){const b=Array.from(h.childNodes).filter(m=>m.nodeType!==Node.TEXT_NODE||(m.textContent||"").trim());if(b.length===1&&b[0].nodeType===Node.ELEMENT_NODE&&b[0].tagName==="STRONG"){const m=F.slice(u+1);return m.some(A=>A.nodeType===Node.ELEMENT_NODE||A.nodeType===Node.TEXT_NODE&&(A.textContent||"").trim())?{titleHtml:b[0].innerHTML,bodyNodes:m}:null}}return null};Array.from(p.children).filter(i=>i.tagName==="OL").forEach(i=>{const F=Array.from(i.children).filter(b=>b.tagName==="LI");if(F.length<2)return;const u=F.map(l);if(u.some(b=>b===null))return;const h=document.createElement("div");h.className="doc-steps",u.forEach((b,m)=>{const v=document.createElement("div");v.className="doc-step";const A=document.createElement("div");A.className="doc-step-number",A.textContent=String(m+1);const k=document.createElement("div");k.className="doc-step-body";const B=document.createElement("div");B.className="doc-step-title",B.innerHTML=b.titleHtml;const I=document.createElement("div");I.className="doc-step-content md-content",b.bodyNodes.forEach($=>I.appendChild($)),k.appendChild(B),k.appendChild(I),v.appendChild(A),v.appendChild(k),h.appendChild(v)}),i.replaceWith(h)})},[E]),o.useEffect(()=>{const p=n.current;p&&(p.querySelectorAll("p > img:only-child").forEach(l=>{const g=l.parentElement;if(!g||g.closest("figure"))return;const i=g.nextElementSibling;if(i&&i.tagName==="P"&&i.children.length===1&&i.children[0].tagName==="EM"&&i.children[0].textContent===i.textContent){const F=document.createElement("figure"),u=document.createElement("figcaption");u.textContent=i.textContent||"",g.replaceWith(F),F.appendChild(l),u.appendChild(i.children[0]),F.appendChild(u),i.remove()}}),p.querySelectorAll("img").forEach(l=>{if(l.closest("figure")||l.closest(".youtube-embed")||l.closest(".vimeo-embed")||l.classList.contains("icon"))return;const g=l.parentElement;if(g&&g.tagName==="P"&&g.children.length===1&&(g.textContent||"").trim()===""){const i=document.createElement("figure");g.replaceWith(i),i.appendChild(l)}}))},[E]),o.useEffect(()=>{const p=n.current;if(!p)return;const l=u=>!(xe(u)||u.classList.contains("youtube-facade-thumb")||u.classList.contains("vimeo-facade-thumb")||u.closest(".youtube-embed")||u.closest(".vimeo-embed")||u.closest(".image-carousel")||u.closest("a")),g=()=>{p.querySelectorAll("img").forEach(u=>{l(u)?u.setAttribute("data-zoomable","true"):u.removeAttribute("data-zoomable")})};g();const i=new MutationObserver(g);i.observe(p,{childList:!0,subtree:!0});const F=u=>{if(u.defaultPrevented)return;const h=u.target;if(h.tagName!=="IMG")return;const b=h;if(!l(b))return;u.preventDefault();const v=b.closest("figure")?.querySelector("figcaption")?.textContent?.trim()||void 0;w({src:b.currentSrc||b.src,alt:b.alt||"",caption:v,width:b.naturalWi
70dth||void 0,height:b.naturalHeight||void 0})};return p.addEventListener("click",F),()=>{i.disconnect(),p.removeEventListener("click",F)}},[E]),e.jsxs("div",{ref:a,className:"relative",children:[e.jsx(Cn,{containerRef:a}),e.jsx(fn,{image:x,onClose:()=>w(null)}),e.jsx(hn,{contentRef:n,html:E,className:`doc-content md-content prose max-w-none
71          prose-headings:text-foreground prose-headings:font-medium prose-headings:tracking-tight
72          prose-h2:text-2xl prose-h2:font-medium prose-h2:mt-10 prose-h2:mb-4
73          prose-h3:text-xl prose-h3:font-medium prose-h3:mt-8 prose-h3:mb-3
74          prose-h4:text-lg prose-h4:font-medium prose-h4:mt-6 prose-h4:mb-2
75          prose-p:text-foreground/80 prose-p:leading-[1.75]
76          prose-a:no-underline
77          prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:text-sm prose-code:font-mono
78          prose-img:rounded-lg prose-img:border prose-img:border-border
79          prose-figcaption:italic prose-figcaption:text-center prose-figcaption:text-foreground/70 prose-figcaption:text-sm prose-figcaption:mt-2
80          prose-blockquote:border-brand-text prose-blockquote:text-foreground/70
81          prose-li:text-foreground/80 prose-li:leading-[1.75]
82          prose-strong:text-foreground
83          prose-hr:border-border`})]})}),Bn={"AI Hub":Ct,"Experience Hub":bt,"Data Modeling Hub":Ft,"Decision Hub":Dt,"Automation Hub":gt,"Dashboard & Analytics":xt,Settings:pt,CRM:mt},Sn={beginner:1,intro:1,medium:2,advanced:3,expert:4};function Ln(t){if(!t)return null;const s=Array.isArray(t)?t[0]:t;if(!s)return null;const r=s.toLowerCase().trim();return{filled:Sn[r]??1,label:s.toUpperCase()}}function Tn(t){if(!t?.snrmodule)return[];const s=t.snrmodule;return Array.isArray(s)?s:s.split(",").map(r=>r.trim()).filter(Boolean)}function Rn(t){if(!t?.snrpartnerlogos)return[];const s=t.snrpartnerlogos;return Array.isArray(s)?s.filter(r=>r&&!r.startsWith("#")):typeof s=="string"&&s.trim()&&!s.startsWith("#")?s.split(",").map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")):[]}function In({partnerKeys:t,partnerLogos:s}){const r=t.map(c=>s[c]||s[c.toLowerCase()]).filter(c=>!!c&&!!c.url),[f,n]=o.useState(0);if(o.useEffect(()=>{if(r.length<=1)return;const c=setInterval(()=>{n(x=>(x+1)%r.length)},3e3);return()=>clearInterval(c)},[r.length]),r.length===0)return e.jsx(Te,{className:"h-3 w-auto text-muted-foreground/50"});const a=r[f%r.length];return e.jsx("div",{className:"h-5 flex items-center overflow-hidden",children:e.jsx("img",{src:a.url,alt:a.name,title:a.name,className:"h-5 w-auto max-w-[100px] object-contain opacity-60 transition-opacity duration-300"},a.url)})}function Mn({article:t,partnerLogos:s}){const r=Tn(t.metadata),f=Ln(t.metadata?.snrdifficulty),n=Rn(t.metadata);return e.jsx(Y,{href:`/${t.slug}`,className:"block h-full",children:e.jsxs("div",{className:"hub-card-wrapper group relative rounded-xl border border-border bg-card overflow-hidden transition-all duration-200 hover:border-muted-foreground/30 cursor-pointer h-full flex flex-col",children:[e.jsxs("div",{className:"flex flex-col flex-1 p-5 pb-4",children:[r.length>0&&e.jsx("div",{className:"flex items-center gap-1.5 mb-4",children:r.map(a=>{const c=Bn[a];return c?e.jsx(c,{className:"h-5 w-5",active:!0},a):e.jsx("span",{title:a,className:"h-3.5 w-3.5 rounded-full bg-gray-400 inline-block"},a)})}),e.jsx("h3",{className:"font-medium text-foreground text-[15px] mb-2 line-clamp-2",children:t.title}),t.description&&e.jsx("p",{className:"text-[13px] text-muted-foreground leading-relaxed flex-1 line-clamp-3",children:t.description})]}),e.jsxs("div",{className:"border-t border-border px-5 py-3 flex items-center justify-between mt-auto",children:[n.length>0?e.jsx(In,{partnerKeys:n,partnerLogos:s}):e.jsx(Te,{className:"h-3 w-auto text-muted-foreground/50"}),f&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:4},(a,c)=>e.jsx("span",{className:`h-2 w-2 rounded-full ${c<f.filled?"bg-green-500":"bg-muted-foreground/50"}`},c))}),e.jsx("span",{className:"text-[10px] font-semibold tracking-wider text-muted-foreground uppercase",children:f.label})]})]})]})})}function $n(){He("Use Cases — Synerise Documentation");const t=at(),s=t?.setSelected,r=t?.setSearch,f=t?.setSort,[,n]=le(),a=Ye(),c=o.useRef(null),x=o.useMemo(()=>{const m=new URLSearchParams(a),v=m.get("filters")??"",A=m.get("query")??m.get("q"),k=(m.get("sortBy")??m.get("sort")??"").toLowerCase();let B=null;return k==="title"?B="title":(k==="publishdate"||k==="date")&&(B="date"),{filters:v,query:A,sort:B}},[a]),w=x.filters,[y,E]=o.useState([]),[p,l]=o.useState(!0),[g,i]=o.useState(t?.filters.search??""),[F,u]=o.useState({}),[h,b]=o.useState(()=>!w);return o.useEffect(()=>{fetch("/api/docs/use-cases/partner-logos").then(m=>m.json()).then(m=>{m.partners&&u(m.partners)}).catch(()=>{})},[]),o.useEffect(()=>{if(!s)return;const m=a.startsWith("?")?a.slice(1):a;if(c.current!==null&&c.current===m){c.current=null;return}if(s({}),r&&r(x.query??""),f&&f(x.sort??"date"),!w){b(!0);return}const v=ut(w);if(v.length===0){b(!0);return}b(!1);const A=new AbortController;return fetch("/api/docs/use-cases/filters",{signal:A.signal}).then(k=>k.json()).then(k=>
83{const B=k?.filters??{},I=it(v,B);s(I),b(!0)}).catch(k=>{k?.name!=="AbortError"&&b(!0)}),()=>A.abort()},[a,w,x.query,x.sort,s,r,f]),o.useEffect(()=>{if(!h||!t)return;const m=lt(t.filters.selected),v=new URLSearchParams;m&&v.set("filters",m),t.filters.search&&v.set("query",t.filters.search),t.filters.sort&&t.filters.sort!=="date"&&v.set("sortBy",t.filters.sort);const A=v.toString(),k=A?`?${A}`:"",B=a?a.startsWith("?")?a:`?${a}`:"";k!==B&&(c.current=A,n(`/use-cases${k}`,{replace:!0}))},[t?.filters.selected,t?.filters.search,t?.filters.sort,h,a,n]),o.useEffect(()=>{const m=setTimeout(()=>{i(t?.filters.search??"")},300);return()=>clearTimeout(m)},[t?.filters.search]),o.useEffect(()=>{if(!h)return;const m=new AbortController,v=new URLSearchParams;g&&v.set("q",g);const A={Challenges:"challenges",Channel:"channel",Difficulty:"difficulty",Industry:"industry",Component:"module",Partner:"partner",Tags:"tags"};if(t?.filters.selected)for(const[k,B]of Object.entries(t.filters.selected)){const I=A[k];I&&B.size>0&&v.set(I,Array.from(B).join(","))}return t?.filters.sort&&t.filters.sort!=="date"&&v.set("sort",t.filters.sort),l(!0),fetch(`/api/docs/use-cases/list?${v.toString()}`,{signal:m.signal}).then(k=>k.json()).then(k=>{E(k.articles||[])}).catch(k=>{k.name!=="AbortError"&&E([])}).finally(()=>l(!1)),()=>m.abort()},[g,t?.filters.selected,t?.filters.sort,h]),e.jsxs("div",{children:[e.jsxs(P,{children:[e.jsx("h1",{className:"text-3xl font-medium text-foreground mb-2 tracking-tight",children:"Use cases"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:t?.hasActiveFilters?`${y.length} result${y.length!==1?"s":""}`:`${y.length} articles`}),e.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsx(de,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx("input",{type:"text",placeholder:"Search use cases",value:t?.filters.search??"",onChange:m=>t?.setSearch(m.target.value),className:"w-full pl-9 pr-3 py-2 text-sm rounded-lg border border-border bg-muted/40 text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-brand/30 focus:border-brand-text"})]}),e.jsxs(Qe,{children:[e.jsx(Je,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Sort use cases",className:"shrink-0 inline-flex items-center justify-center h-9 w-9 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-brand/30",children:e.jsx(kt,{className:"h-4 w-4"})})}),e.jsx(et,{align:"end",className:"min-w-[200px]",children:[{value:"date",label:"Publish date (newest)"},{value:"title",label:"Title (A–Z)"}].map(m=>{const v=(t?.filters.sort??"date")===m.value;return e.jsxs(tt,{onSelect:()=>t?.setSort(m.value),className:"flex items-center justify-between gap-2 cursor-pointer",children:[e.jsx("span",{className:v?"font-medium text-foreground":"",children:m.label}),v&&e.jsx(Fe,{className:"h-4 w-4 text-brand-text"})]},m.value)})})]})]})]}),p&&e.jsx(De,{}),!p&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[y.map((m,v)=>e.jsx(P,{delay:Math.min(50+v*30,400),children:e.jsx(Mn,{article:m,partnerLogos:F})},m.slug)),y.length===0&&!p&&e.jsx(P,{className:"col-span-full",children:e.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No use cases match your filters. Try adjusting your search or filters."})})]}),e.jsx($e,{})]})}function Hn({node:t,basePath:s}){const[r,f]=o.useState(""),n=t.children||[],a=r?n.filter(c=>c.title.toLowerCase().includes(r.toLowerCase())):n;return e.jsxs("div",{children:[e.jsxs(P,{children:[e.jsxs("h1",{className:"text-3xl font-medium text-foreground mb-2 tracking-tight flex items-center gap-3",children:[(()=>{const c=s.replace(/^\//,""),x=_e[c];if(x?.animatedIcon){const w=x.animatedIcon;return e.jsx(w,{className:"h-[30px] w-[30px] shrink-0 -translate-y-[1px]"})}return null})(),e.jsx("span",{className:"min-w-0",children:t.title})]}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-6",children:[n.length," articles"]})]}),n.length>15&&e.jsx(P,{delay:100,children:e.jsxs("div",{className:"relative mb-4",children:[e.jsx(de,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx("input",{type:"text",value:r,onChange:c=>f(c.target.value),placeholder:"Filter articles...",className:"w-full pl-9 pr-4 py-2 text-sm rounded-lg border border-border bg-muted/50 focus:bg-background focus:border-brand-text focus:outline-none focus:ring-1 focus:ring-brand/20 transition-colors"})]})}),e.jsxs("div",{className:"space-y-1",children:[a.map((c,x)=>e.jsx(P,{delay:Math.min(150+x*50,600),children:e.jsxs(Y,{href:`/${c.slug}`,className:"flex items-center gap-2 px-3 py-2.5 rounded-lg text-sm text-muted-foreground hover:text-foreground hover:bg-accent transition-colors group",children:[e.jsx(te,{className:"h-3.5 w-3.5 text-muted-foreground
83/50 group-hover:text-brand-text transition-colors shrink-0"}),e.jsx("span",{className:"truncate",children:c.title})]})},c.slug)),a.length===0&&r&&e.jsxs("p",{className:"text-sm text-muted-foreground py-4 text-center",children:['No articles matching "',r,'"']})]}),e.jsx($e,{})]})}function Pn({node:t,hasContentAbove:s}){const[r,f]=o.useState(""),n=t.children||[],a=r?n.filter(c=>c.title.toLowerCase().includes(r.toLowerCase())):n;return e.jsxs("div",{className:s?"mt-8 pt-6 border-t border-border":"",children:[e.jsx(P,{children:e.jsx("div",{className:"flex items-center justify-between mb-4",children:e.jsxs("h2",{className:"text-lg font-medium text-foreground",children:["In this section",e.jsx("span",{className:"text-sm font-normal text-muted-foreground ml-2",children:n.length})]})})}),n.length>10&&e.jsx(P,{delay:50,children:e.jsxs("div",{className:"relative mb-4",children:[e.jsx(de,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx("input",{type:"text",value:r,onChange:c=>f(c.target.value),placeholder:"Filter...",className:"w-full pl-9 pr-4 py-2 text-sm rounded-lg border border-border bg-muted/50 focus:bg-background focus:border-brand-text focus:outline-none focus:ring-1 focus:ring-brand/20 transition-colors"})]})}),a.length>0&&e.jsx("div",{className:"space-y-0.5",children:a.map((c,x)=>e.jsx(P,{delay:Math.min(100+x*50,600),children:e.jsx(Ue,{node:c})},c.slug))}),a.length===0&&r&&e.jsxs("p",{className:"text-sm text-muted-foreground py-4 text-center",children:['No articles matching "',r,'"']})]})}function Ue({node:t}){const[s,r]=o.useState(!1),f=t.children||[];return f.length>0?e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1 px-3 py-2 rounded-lg text-sm text-muted-foreground hover:bg-accent transition-colors group",children:[e.jsx("button",{type:"button",onClick:()=>r(a=>!a),"aria-expanded":s,"aria-label":s?`Collapse ${t.title}`:`Expand ${t.title}`,className:"shrink-0 p-0.5 -ml-0.5 rounded hover:bg-background/60 text-muted-foreground/70 hover:text-foreground transition-colors",children:s?e.jsx(pe,{className:"h-3.5 w-3.5"}):e.jsx(te,{className:"h-3.5 w-3.5"})}),e.jsxs(Y,{href:`/${t.slug}`,className:"flex-1 min-w-0 flex items-center gap-2 hover:text-foreground transition-colors",children:[e.jsx("span",{className:"truncate",children:t.title}),e.jsx("span",{className:"text-xs text-muted-foreground/70 shrink-0",children:f.length})]})]}),s&&e.jsx("div",{className:"ml-5 pl-2 border-l border-border space-y-0.5 mt-0.5",children:f.map(a=>e.jsx(Ue,{node:a},a.slug))})]}):e.jsxs(Y,{href:`/${t.slug}`,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-muted-foreground hover:text-foreground hover:bg-accent transition-colors group",children:[e.jsx(te,{className:"h-3.5 w-3.5 text-muted-foreground/50 group-hover:text-brand-text transition-colors shrink-0"}),e.jsx("span",{className:"truncate",children:t.title})]})}function On(t,s){const[r,f]=o.useState(0);return o.useEffect(()=>{f(0)},[s]),o.useEffect(()=>{const n=t.current;if(!n)return;let a=null,c=n.scrollHeight-n.clientHeight;const x=()=>{const E=n.scrollTop,p=n.scrollHeight-n.clientHeight;if(p<=0){f(0);return}const l=Math.max(20,c*.02);if(Math.abs(p-c)>l&&(c=p),c<=0){f(0);return}const g=Math.min(100,Math.max(0,E/c*100));f(g)},w=()=>{a===null&&(a=requestAnimationFrame(()=>{x(),a=null}))},y=new ResizeObserver(()=>{const E=n.scrollHeight-n.clientHeight,p=Math.max(20,c*.02);Math.abs(E-c)>p&&(c=E,x())});return y.observe(n),n.addEventListener("scroll",w,{passive:!0}),x(),()=>{n.removeEventListener("scroll",w),y.disconnect(),a!==null&&cancelAnimationFrame(a)}},[t,s]),r}function zn({slug:t,tree:s}){return t==="use-cases"?e.jsx($n,{}):e.jsx(_n,{slug:t,tree:s})}function _n({slug:t,tree:s}){const{data:r,loading:f,error:n}=qe(`/docs/${t}`,[t]),[a,c]=le(),x=Se(),{mode:w}=ct(),y=Ge(s,t),E=o.useMemo(()=>y&&{...y,children:y.children?ie(y.children):y.children},[y,t]),p=E&&E.children&&E.children.length>0,l=r?.article,g=l?.title;He(g?`${g} — Synerise Documentation`:!f&&!l?"Page not found — Synerise Documentation":null),o.useEffect(()=>{const T=l?.slug;!T||T===t||T.toLowerCase()===t.toLowerCase()&&c(`/${T}${window.location.search}${window.location.hash}`,{replace:!0})},[l?.slug,t,c]);
83const F=t==="first-steps",u=t==="loyalty",h=F||u,b=u?"Welcome to the Synerise Loyalty Guide!":"Welcome to the Synerise First Steps!",m=o.useMemo(()=>{const T=l?.htmlContent??"";if(!T)return"";let d=T;return t==="first-steps"?d=d.replace(/^\s*<h1[^>]*>\s*Welcome to the Synerise First Steps!\s*<\/h1>\s*<p[^>]*>\s*\.\.\.the ultimate guide, on your way to becoming a Synerise pro-user!\s*<\/p>\s*/i,""):t==="loyalty"&&(d=d.replace(/^\s*<h1[^>]*>\s*Welcome to the Synerise Loyalty Guide!\s*<\/h1>\s*<p[^>]*>\s*\.\.\.the ultimate guide,\s*on your way to becoming a Synerise Loyalty Master!\s*<\/p>\s*/i,"")),d=d.replace(/^(?:\s*<h1\b[^>]*>[\s\S]*?<\/h1>\s*)+/i,""),t!=="glossary"&&(d=d.replace(/<h1\b([^>]*)>/gi,"<h2$1>").replace(/<\/h1\s*>/gi,"</h2>")),dt(d)},[l?.htmlContent,t]),v=!!m.trim(),A=t.startsWith("use-cases/");ft(A?l?.metadata??null:null),o.useEffect(()=>{if(!l?.noIndex&&!oe(t))return;const T=document.createElement("meta");return T.name="robots",T.content="noindex",document.head.appendChild(T),()=>{document.head.removeChild(T)}},[l?.noIndex,t]);const k=On(x,t+(v?":ready":"")),B=k>5,I=o.useCallback(()=>{const T=x.current;T?T.scrollTo({top:0,behavior:"smooth"}):window.scrollTo({top:0,behavior:"smooth"})},[x]),$=o.useMemo(()=>!v||!l?[]:Yt(m),[m,v,l]),Z=o.useMemo(()=>$.filter(T=>T.level<=3),[$]),[q,Q]=o.useState(()=>window.location.hash);o.useEffect(()=>{const T=()=>Q(window.location.hash);return window.addEventListener("hashchange",T),Q(window.location.hash),()=>window.removeEventListener("hashchange",T)},[t]),o.useEffect(()=>{if(!q||!v||t==="glossary")return;const T=q.slice(1);if(!T)return;const d=(R,H="auto")=>{const _=x.current;if(_){const ee=_.getBoundingClientRect(),he=R.getBoundingClientRect().top-ee.top+_.scrollTop-80;_.scrollTo({top:he,behavior:H})}else R.scrollIntoView({behavior:H,block:"start"})};let C=0;const j=30,L=setInterval(()=>{C++;const R=document.getElementById(T);R?(clearInterval(L),d(R,"auto"),setTimeout(()=>{const H=document.getElementById(T);H&&d(H,"auto")},500)):C>=j&&clearInterval(L)},100);return()=>clearInterval(L)},[t,q,v,x]);const J=typeof window<"u"?window.location.href:"",U=o.useMemo(()=>ie(s),[s]),O=oe(t),G=o.useMemo(()=>Ce(U),[U]),{open:W}=Le(),D=ht(),{open:N}=D;o.useEffect(()=>{const T=d=>{if(W||N)return;const C=d.target,j=C.tagName.toLowerCase();if(!(j==="input"||j==="textarea"||C.isContentEditable)&&!(d.metaKey||d.ctrlKey||d.altKey)&&(d.key==="j"||d.key==="k")){const L=G.findIndex(H=>H.slug===t);if(L===-1)return;const R=d.key==="j"?L+1:L-1;if(R<0||R>=G.length)return;d.preventDefault(),c(`/${G[R].slug}`)}};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[t,G,c,W,N]);const M=ce(),S=!!n&&(n.code==="ref_not_found"||n.code==="ref_lookup_failed"),V=!f&&(!!n||!l)&&!p&&!S&&!M,[ae,K]=o.useState("idle"),X=o.useRef(null);if(o.useEffect(()=>{X.current=null,K("idle")},[t]),o.useEffect(()=>{if(!V||X.current===t)return;X.current=t,K("checking");const T=`/${t}`,d=t;fetch(`/api/aliases/resolve?path=${encodeURIComponent(T)}`).then(C=>C.json()).then(C=>{if(X.current!==d)return;const j=C?.redirect;j&&j!==T&&j!==a?c(j,{replace:!0}):K("unresolved")}).catch(()=>{X.current===d&&K("unresolved")})},[V,t,a,c]),f||V&&ae!=="unresolved")return e.jsx(De,{});if(n||!l){if(S){const T=n?.gitRef??M,d=n?.code==="ref_not_found"?"Couldn't load preview":"Couldn't reach GitHub",C=n?.code==="ref_not_found"?e.jsxs(e.Fragment,{children:["Ref ",e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted text-xs font-mono",children:T})," was not found on GitHub. Double-check the branch name, tag, or commit SHA."]}):e.jsxs(e.Fragment,{children:[n?.message||"GitHub lookup failed."," Try again in a moment."]}),j=(()=>{try{const L=new URL(window.location.href);return L.searchParams.delete("gitRef"),L.pathname+(L.search?L.search:"")+L.hash}catch{return"/"}})();return e.jsxs("div",{className:"text-center py-20",children:[e.jsx("h2",{className:"text-xl font-medium text-foreground mb-2",children:d}),e.jsx("p",{className:"text-muted-foreground text-sm max-w-xl mx-auto",children:C}),e.jsxs("a",{href:j,"data-no-git-ref":!0,className:"group inline-flex items-center gap-2 mt-4 text-foreground text-sm",children:[e.jsx(Ae,{className:"h-4 w-4"}
83),e.jsx("span",{className:"link-underline-active",children:"Leave preview and continue browsing"})]})]})}return p?e.jsx(Hn,{node:E,basePath:`/${t}`}):e.jsxs("div",{className:"text-center py-20",children:[e.jsx("h2",{className:"text-xl font-medium text-foreground mb-2",children:"Article not found"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:n?.code==="article_not_found_in_ref"&&n.gitRef?e.jsxs(e.Fragment,{children:["Article ",e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted text-xs font-mono",children:t})," doesn't exist in ref ",e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted text-xs font-mono",children:n.gitRef}),"."]}):"The requested documentation page could not be found."}),e.jsxs(Y,{href:"/",className:"group inline-flex items-center gap-2 mt-4 text-foreground text-sm",children:[e.jsx(Ae,{className:"h-4 w-4"}),e.jsx("span",{className:"link-underline-active",children:"Back to documentation"})]})]})}const ne=t==="glossary",re=Z.length>=1&&!ne,se=ne&&v,ue=re||se;return e.jsxs(e.Fragment,{children:[v&&e.jsx("div",{className:"fixed top-0 left-0 right-0 z-[100] h-[3px] pointer-events-none",style:{background:"transparent"},children:e.jsx("div",{className:"h-full bg-brand transition-[width] duration-150 ease-out",style:{width:`${k}%`}})}),e.jsxs(nt,{variant:"outline",size:"sm",onClick:I,"aria-label":"Return to top",className:`fixed bottom-6 left-1/2 -translate-x-1/2 z-[90] gap-2 rounded-full shadow-lg bg-background/95 backdrop-blur border-border transition-opacity duration-200 ${B?"opacity-100":"opacity-0 pointer-events-none"}`,children:[e.jsx(Nt,{className:"h-4 w-4"}),"Return to top"]}
83),re&&e.jsx("aside",{className:"hidden xl:block fixed top-[6.375rem] w-56 z-10 pt-8 bg-background transition-[right] duration-300 ease-in-out",style:{right:w==="narrow"?"calc((100vw - 1280px) / 2 + 1.5rem)":"1.5rem"},children:e.jsx(Jt,{headings:Z,scrollContainerRef:x})}),se&&e.jsx("aside",{className:"hidden xl:block fixed top-[6.375rem] w-56 z-10 pt-8 bg-background transition-[right] duration-300 ease-in-out",style:{right:w==="narrow"?"calc((100vw - 1280px) / 2 + 1.5rem)":"1.5rem"},children:e.jsx("div",{id:"glossary-toc-portal"})}),e.jsxs("div",{className:ue?"xl:mr-64":"max-w-5xl",children:[e.jsx(P,{className:"relative z-20",children:e.jsxs("div",{className:"flex items-start sm:items-center justify-between mb-8 gap-2",children:[e.jsx(En,{slug:t,tree:s,articleTitle:l?.title,leadingSegments:ne||t==="first-steps"||t.startsWith("first-steps/")||t==="loyalty"||t.startsWith("loyalty/")?[{title:"Resources",slug:"resources"}]:void 0}),e.jsxs("div",{className:"flex items-stretch gap-2 shrink-0",children:[l&&e.jsx(jn,{markdownUrl:`/api/docs/${t}/markdown`,llmsFullUrl:"/api/docs/llms-full",pageTitle:l.title,pageUrl:J}),re&&e.jsx("div",{className:"contents xl:hidden",children:e.jsx(en,{headings:Z,scrollContainerRef:x})})]})]})}),ne&&v?e.jsx(ln,{htmlContent:m}):e.jsxs(e.Fragment,{children:[e.jsx(P,{delay:50,children:h?e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:Ie,children:l.title}),e.jsx("p",{className:Me,children:b}),e.jsx("hr",{className:"border-border mb-8"})]}):e.jsxs("h1",{className:"text-3xl font-medium text-foreground mb-4 tracking-tight flex items-center gap-3",children:[(()=>{const T=_e[t];if(T?.animatedIcon){const d=T.animatedIcon;return e.jsx(d,{className:"h-[30px] w-[30px] shrink-0 -translate-y-[1px]"})}return null})(),e.jsx("span",{className:"min-w-0",children:l.title})]})}),v&&e.jsx(P,{delay:200,threshold:0,children:e.jsx(Nn,{htmlContent:m,headings:$,scrollContainerRef:x})}),p&&e.jsx(P,{delay:300,children:e.jsx(Pn,{node:E,hasContentAbove:v})})]}),e.jsx(P,{delay:350,children:e.jsx("div",{className:"mt-10",children:e.jsx(bn,{slug:t,compact:!0})})}),e.jsx(P,{delay:375,children:e.jsx(vn,{slug:t})}),!O&&e.jsx(P,{delay:400,children:e.jsx(Un,{slug:t,tree:U})}),l?.lastSyncedAt&&e.jsx(P,{delay:500,children:e.jsxs("div",{className:"mt-10 pt-6 border-t border-border text-xs text-muted-foreground flex items-center justify-between",children:[e.jsxs("span",{children:["Last updated: ",new Date(l.lastSyncedAt).toLocaleDateString()]}),e.jsxs("button",{onClick:()=>D.setOpen(!0),className:"flex items-center gap-1.5 text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[e.jsx(Bt,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Shortcuts"})]})]})})]})]})}function Ce(t){const s=[];for(const r of t)s.push({slug:r.slug,title:r.title}),r.children?.length&&s.push(...Ce(r.children));return s}function We(t,s){if(t.slug===s)return!0;if(!t.children?.length)return!1;for(const r of t.children)if(We(r,s))return!0;return!1}function qn(t,s){for(const r of t)if(We(r,s))return r;return null}function Un({slug:t,tree:s}){const r=o.useMemo(()=>{const x=qn(s,t);return x?Ce([x]):[]},[s,t]),f=r.findIndex(x=>x.slug===t);if(f===-1)return null;const n=f>0?r[f-1]:null,a=f<r.length-1?r[f+1]:null;if(!n&&!a)return null;const c=!!n&&!!a;return e.jsxs("div",{className:"mt-10 flex items-stretch gap-4 overflow-hidden min-w-0",children:[n&&e.jsxs(Y,{href:`/${n.slug}`,className:`group min-w-0 overflow-hidden flex items-center gap-3 px-4 py-3 rounded-lg border border-border hover:border-brand-text hover:bg-brand/[0.02] transition-all ${c?"flex-1":"w-1/2 mr-auto"}`,children:[e.jsx(St,{className:"h-4 w-4 text-muted-foreground group-hover:text-brand-text transition-colors shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] text-muted-foreground mb-0.5",children:"Previous"}),e.jsx("div",{className:"text-sm font-medium text-foreground group-hover:text-brand-text transition-colors truncate",children:n.title})]})]}),a&&e.jsxs(Y,{href:`/${a.slug}`,className:`group min-w-0 overflow-hidden flex items-center justify-end gap-3 px-4 py-3 rounded-lg border border-border hover:border-brand-text hover:bg-brand/[0.02] transition-all text-right ${c?"flex-1":"w-1/2 ml-auto"}`,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] text-muted-foreground mb-0.5",children:"Next"}),e.jsx("div",{className:"text-sm font-medium text-foreground group-hover:text-brand-text transition-colors truncate",children:a.title})]}),e.jsx(te,{className:"h-4 w-4 text-muted-foreground group-hover:text-brand-text transition-colors shrink-0"})]})]})}function Ge(t,s){for(const r of t){if(r.slug===s)return r;if(r.children?.length){const f=Ge(r.children,s);if(f)return f}}return null}function Wn({tree:t,loading:s}){return s?e.jsx(De,{}):t.length===0?e.jsxs("div",{className:"text-center py-20",children:[e.jsx("h2",{className:"text-xl font-medium text-foreground mb-2",children:"No documentation synced yet"}),e.jsx("p",{className:"text-muted-foreground text-sm max-w-md mx-auto",children:"Documentation hasn't been synced from GitHub yet."})]}):e.jsxs("div",{children:[e.jsxs(P,{children:[e.jsx("h1",{className:Ie,children:"Documentation"}),e.jsx("p",{className:Me,children:"Browse the Synerise platform documentation. Guides, tutorials, and reference material."})]}),(()=>{const r=ie(t),f=r.filter(n=>n.slug!=="use-cases"&&n.slug!=="developers"&&n.slug!=="first-steps"&&n.slug!=="loyalty"&&n.path!=="docs").concat(...r.filter(n=>n.path==="docs").map(n=>n.children||[]));return e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:f.map((n,a)=>e.jsx(P,{delay:a*80,children:e.jsx(Y,{href:`/${n.slug}`,children:e.jsxs("div",{className:"hub-card-wrapper group rounded-xl border border-border bg-card p-5 hover:border-muted-foreground
83/30 transition-all duration-200 h-full cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-brand"}),e.jsx("h3",{className:"font-medium text-sm text-brand-text",children:n.title}),e.jsx("span",{className:"text-[10px] text-muted-foreground ml-auto",children:n.children?.length||0})]}),e.jsxs("ul",{className:"space-y-1.5",children:[n.children.slice(0,5).map(c=>e.jsx("li",{children:e.jsx("span",{className:"text-xs text-muted-foreground truncate block py-0.5",children:c.title})},c.slug)),n.children.length>5&&e.jsxs("li",{className:"text-xs text-muted-foreground/40 pt-1",children:["+ ",n.children.length-5," more"]})]})]})})},n.path??n.slug))})})()]})}function ur(){const[t]=le(),s=t==="/"||t===""?"":t.replace(/^\//,"").replace(/\/+$/,""),r=s.length>0,{data:f,loading:n}=qe("/docs"),a=f?.tree||[];return e.jsx("div",{className:r?"max-w-7xl mx-auto px-4 sm:px-6 py-4 sm:py-8":Lt,children:r?e.jsx(zn,{slug:s,tree:a}):e.jsx(Wn,{tree:a,loading:n})})}export{ur as default,kn as isTroubleshootingNode,ie as pruneTroubleshooting};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.