1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3032],{58087:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/docs/contribute",function(){return r(35185)}])},30455:function(e,t,r){"use strict";r.d(t,{$:function(){return i}});var n=r(85893);r(67294);let i=e=>{let{id:t,className:r="",children:i,background:s="white",hero:a=!1}=e;return(0,n.jsx)("section",{id:t,className:"".concat(a?"pt-0 pb-12 md:pt-8 md:pb-24":"py-12 md:py-24"," ").concat({white:"bg-theme-background",gray:"bg-theme-background-alt",sand:"bg-theme-background-sand"}[s]," ").concat(r),children:(0,n.jsx)("div",{className:"container mx-auto px-4 md:px-6 max-w-7xl",children:i})})}},82884:function(e,t,r){"use strict";r.d(t,{O:function(){return s}});var n=r(85893);r(67294);var i=r(1715);let s=e=>{let{children:t,className:r="",id:s,level:a=2}=e,o=2===a?"text-3xl md:text-4xl font-bold text-theme-text-primary mb-4":"text-2xl md:text-3xl font-bold text-theme-text-primary mb-3";return(0,n.jsx)(i.N,{level:a,className:"".concat(o," ").concat(r),id:s,children:t})}},60073:function(e,t,r){"use strict";r.d(t,{t:function(){return u}});var n=r(85893),i=r(67294),s=r(1715),a=r(16487),o=r(83337),l=r(47507),d=r(48763);let c=e=>{let{children:t,className:r}=e,[s,a]=(0,i.useState)(!1),o=async()=>{try{await navigator.clipboard.writeText(t),a(!0),setTimeout(()=>a(!1),2e3)}catch(e){console.error("Failed to copy text: ",e)}};return(0,n.jsxs)("div",{className:"relative group",children:[(0,n.jsx)("pre",{className:"bg-theme-surface p-4 rounded-lg overflow-x-auto text-sm my-4",children:(0,n.jsx)("code",{className:"text-theme-text-primary font-mono ".concat(r||""),children:t})}),(0,n.jsx)("button",{onClick:o,className:"absolute top-2 right-2 p-2 rounded-md bg-theme-border-sand-strong hover:bg-sand-700 text-theme-text-inverse opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Copy code to clipboard",children:s?(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})},u={h1:e=>{let{node:t,children:r,...i}=e;return(0,n.jsx)(s.N,{level:1,className:"text-3xl md:text-4xl font-bold tracking-tight text-theme-text-primary max-w-[24ch] mb-4 first:mt-0 mt-10",...i,children:r})},h2:e=>{let{node:t,children:r,...i}=e;return(0,n.jsx)(s.N,{level:2,className:"text-[1.4rem] font-bold tracking-tight text-theme-text-primary max-w-[34ch] mt-12 mb-3 scroll-mt-28",...i,children:r})},h3:e=>{let{node:t,children:r,...i}=e;return(0,n.jsx)(s.N,{level:3,className:"text-lg font-semibold text-theme-text-primary max-w-[40ch] mt-8 mb-2 scroll-mt-28",...i,children:r})},h4:e=>{let{node:t,children:r,...i}=e;return(0,n.jsx)(s.N,{level:4,className:"text-base font-semibold text-theme-text-primary max-w-[44ch] mt-6 mb-2 scroll-mt-28",...i,children:r})},p:e=>{let{node:t,children:r,...i}=e,s=(0,d.D$)(t);return s?(0,n.jsx)(l.K,{...s}):(0,n.jsx)("p",{className:"text-theme-text-secondary text-[15px] md:text-base leading-[1.75] max-w-[68ch] mb-5",...i,children:r})},a:e=>{let{node:t,children:r,...i}=e,s=(0,d.tc)(t);return s?(0,n.jsx)(l.K,{...s}):(0,n.jsx)("a",{className:"text-theme-text-primary underline decoration-theme-secondary/50 underline-offset-2 hover:
1decoration-theme-secondary transition-colors",...i,children:r})},ul:e=>{let{node:t,...r}=e;return(0,n.jsx)("ul",{className:"list-disc list-outside pl-5 mb-5 space-y-2 marker:text-theme-text-muted text-theme-text-secondary text-[15px] md:text-base leading-[1.75] max-w-[68ch]",...r})},ol:e=>{let{node:t,...r}=e;return(0,n.jsx)("ol",{className:"list-decimal list-outside pl-5 mb-5 space-y-2 marker:text-theme-text-muted marker:font-mono marker:text-sm text-theme-text-secondary text-[15px] md:text-base leading-[1.75] max-w-[68ch]",...r})},li:e=>{let{node:t,children:r,...i}=e;return(0,n.jsx)("li",{className:"pl-1.5 [&>p]:inline [&>p]:mb-0 [&>ul]:mt-2 [&>ol]:mt-2",...i,children:r})},blockquote:e=>{let{node:t,...r}=e;return(0,n.jsx)("blockquote",{className:"border-l-2 border-theme-secondary/60 bg-theme-surface/40 rounded-r-lg pl-4 pr-4 py-3 my-6 text-theme-text-secondary text-[15px] leading-[1.7] max-w-[68ch] [&>p]:mb-0 [&>p:not(:last-child)]:mb-3",...r})},code:e=>{let{node:t,className:r,children:i,...s}=e;return(null==r?void 0:r.includes("language-"))?i:(0,n.jsx)("code",{className:"bg-theme-surface text-theme-text-primary px-1.5 py-0.5 rounded text-sm font-mono",...s,children:i})},pre:e=>{let{node:t,children:r,...i}=e,s=null==r?void 0:r.props,a=(null==s?void 0:s.children)||"",o=(null==s?void 0:s.className)||"";return(null==o?void 0:o.includes("language-"))?(0,n.jsx)(c,{className:o,children:a}):(0,n.jsx)("pre",{className:"bg-theme-surface p-4 rounded-lg overflow-x-auto text-sm my-4",...i,children:r})},table:e=>{let{node:t,...r}=e;return(0,n.jsx)("div",{className:"overflow-x-auto my-6 rounded-xl border border-theme-border-light",children:(0,n.jsx)("table",{className:"min-w-full text-left",...r})})},thead:e=>{let{node:t,...r}=e;return(0,n.jsx)("thead",{className:"bg-theme-surface border-b border-theme-border-light",...r})},tbody:e=>{let{node:t,...r}=e;return(0,n.jsx)("tbody",{className:"divide-y divide-theme-border-light",...r})},th:e=>{let{node:t,...r}=e;return(0,n.jsx)("th",{className:"px-4 py-3 text-left font-mono text-[11px] font-medium uppercase tracking-[0.1em] text-theme-text-muted",...r})},td:e=>{let{node:t,...r}=e;return(0,n.jsx)("td",{className:"px-4 py-3 align-top text-sm leading-relaxed text-theme-text-secondary [&>a]:break-words",...r})},hr:e=>{let{node:t,...r}=e;return(0,n.jsx)("hr",{className:"my-10 border-theme-border",...r})},img:e=>{let{node:t,...r}=e;return(0,n.jsx)("img",{className:"max-w-full h-auto my-6 rounded-xl border border-theme-border-light",...r})},"build-callout":e=>{let{node:t,builds:r,type:i,children:s,...o}=e;return(0,n.jsx)(a.X,{builds:r||"",type:i||"note",children:s})},"spec-table":e=>{let{node:t,specs:r,title:i,...s}=e,a=[];if("string"==typeof r)try{a=JSON.parse(r)}catch(e){console.error("Invalid specs JSON in spec-table")}return(0,n.jsx)(o.r,{specs:a,title:i})}}},32602:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return o},noSSR:function(){return a}});let n=r(38754);r(85893),r(67294);let i=n._(r(35491));function s(e){return{default:(null==e?void 0:e.default)||e}}function a(e,t){return delete t.webpack,delete t.modules,e(t)}function o(e,t){let r=i.default,n={loading:e=>{let{error:t,isLoading:r,pastDelay:n}=e;return null}};e instanceof Promise?n.loader=()=>e:"function"==typeof e?n.loader=e:"object"==typeof e&&(n={...n,...e});let o=(n={...n,...t}).loader;return(n.loadableGenerated&&(n={...n,...n.loadableGenerated},delete n.loadableGenerated),"boolean"!=typeof n.ssr||n.ssr)?r({...n,loader:()=>null!=o?o().then(s):Promise.resolve(s(()=>null))}):(delete n.webpack,delete n.modules,a(r,n))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1159:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return n}});let n=r(38754)._(r(67294)).default.createContext(null)},35491:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return m}});let n=r(38754)._(r(67294)),i=r(1159),s=[],a=[],o=!1;function l(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}class d{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function c(e){return function(e,t){let r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),s=null;function l(){if(!s){let t=new d(e,r);s={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return s.promise()}if(!o){let e=r.webpack?r.webpack():r.modules;e&&a.push(t=>{for(let r of e)if(t.includes(r))return l()})}function c(e,t){!function(){l();let e=n.default.useContext(i.LoadableContext);e&&Array.isArray(r.modules)&&r.modules.forEach(t=>{e(t)})}();let a=n.default.useSyncExternalStore(s.subscribe,s.getCurrentValue,s.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:s.retry}),[]),n.default.useMemo(()=>{var t;return a.loading||a.error?n.default.createElement(r.loading,{isLoading:a.loading,pastDelay:a.pastDelay,timedOut:a.timedOut,error:a.error,retry:s.retry}):a.loaded?n.default.createElement((t=a.loaded)&&t.default?t.default:t,e):null},[e,a])}return c.preload=()=>l(),c.displayName="LoadableComponent",n.default.forwardRef(c)}(l,e)}function u(e,t){let r=[];for(;e.length;){let n=e.pop();r.push(n(t))}return Promise.all(r).then(()=>{if(e.length)return u(e,t)})}c.preloadAll=()=>new Promise((e,t)=>{u(s).then(e,t)}),c.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let r=()=>(o=!0,t());u(a,e).then(r,r)})),window.__NEXT_PRELOADREADY=c.preloadReady;let m=c},35185:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return q}});var n=r(85893),i=r(67294),s=r(11163),a=r(41664),o=r.n(a),l=r(7376),d=r(25346),c=r(82210),u=r(30455),m=r(82884),h=r(5152),x=r.n(h),b=r(27426),p=r(13384),g=r(16088),f=r(88115),y=r(63623),v=r(60073);let w=[{label:"Draft",hint:"Only you can see this"},{label:"In review",hint:"Waiting on the maintainer"},{label:"Published",hint:"Live in the docs"}],j=e=>{let{status:t,className:r=""}=e;if("rejected"===t)return(0,n.jsx)("div",{className:r,children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full font-mono text-xs uppercase tracking-wide bg-theme-surface-alt text-theme-state-error border border-theme-state-error/40",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-theme-state-error","aria-hidden":"true"}),"Closed"]})});let i=function(e){switch(e){case"draft":case"changes_requested":return 0;case"submitted":return 1;case"approved":return 2;default:return -1}}(t);return(0,n.jsxs)("div",{className:r,children:[(0,n.jsx)("ol",{className:"grid grid-cols-3 gap-2 md:gap-4","aria-label":"Contribution progress",children:w.map((e,r)=>{let s=r===i;return(0,n.jsxs)("li",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"h-0.5 w-full rounded-full transition-colors duration-200 ".concat(s?"bg-theme-secondary":r<i?"bg-theme-secondary/40":"bg-theme-border"),"aria-hidden":"true"}),(0,n.jsx)("p",{className:"mt-2 font-mono text-[11px] md:text-xs uppercase tracking-wide truncate ".concat(s?"text-theme-text-primary":"text-theme-text-tertiary"),children:e.label}),s&&(0,n.jsx)("p",{className:"text-xs text-theme-text-secondary mt-0.5 hidden md:block",children:"changes_requested"===t?"Changes requested":e.hint})]},e.label)})}),(0,n.jsx)("span",{className:"sr-only",children:"changes_requested"===t?"Changes requested. Update your draft and submit again.":"Current stage: ".concat(w[Math.max(i,0)].label)})]})};var N=r(95770);let k=/cid:([a-zA-Z0-9_-]{6,40})/g;var _=r(10246);async function C(){var e;let t=await (null===_.I8||void 0===_.I8?void 0:null===(e=_.I8.currentUser)||void 0===e?void 0:e.getIdToken());if(!t)throw Error("Sign in to continue");return t}async function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=await C(),n=await fetch(e,{...t,headers:{...t.body instanceof FormData?{}:{"Content-Type":"application/json"},...t.headers,Authorization:"Bearer ".concat(r)}}),i=await n.json().catch(()=>({}));if(!n.ok)throw Error(i.error||"Something went wrong. Try again.");return i}function P(e){return S("/api/doc-contributions/".concat(e))}let O=["draft","changes_requested"],T=x()(()=>Promise.all([r.e(5762),r.e(4983),r.e(2348),r.e(6722)]).then(r.bind(r,16722)),{loadableGenerated:{webpack:()=>[16722]},ssr:!1,loading:()=>(0,n.jsx)("div",{className:"h-full min-h-[24rem] flex items-center justify-center font-mono text-xs uppercase tracking-wide text-theme-text-tertiary",children:"Loading editor"})}),E=[{id:"dune-weaver-pro",label:"Pro"},{id:"dune-weaver-mini-pro",label:"Mini Pro"},{id:"dune-weaver-gold",label:"Gold"},{id:"dune-weaver-og",label:"OG"},{id:"dune-weaver-mini",label:"Mini"}],L=e=>{let{contribution:t,onChange:r,onClose:s}=e,{user:a}=(0,N.a)(),[o,l]=(0,i.useState)(t.title),[d,c]=(0,i.useState)(t.description),[u,m]=(0,i.useState)(t.markdown),[h,x]=(0,i.useState)(t.note),[w,_]=(0,i.useState)(t.authorName||(null==a?void 0:a.displayName)||""),[C,P]=(0,i.useState)(t.authorUrl||""),[L,D]=(0,i.useState)(t.relevantBuilds||[]),[q,A]=(0,i.useState)(t.licenseAccepted),[F,M]=(0,i.useState)("write"),[W,R]=(0,i.useState)(null),[I,B]=(0,i.useState)(""),[G,J]=(0,i.useState)(""),U=(0,i.useRef)(null),H=(0,i.useRef)(null),V=t.images,z=O.includes(t.status),X="new"===t.kind,Y=(0,i.useMemo)(()=>{let e={};
1return V.forEach(t=>{e[t.id]=t.url}),u.replace(k,(t,r)=>Object.prototype.hasOwnProperty.call(e,r)?e[r]:t)},[u,V]),Z=(0,i.useCallback)(()=>({title:o,description:d,markdown:u,note:h,authorName:w,authorUrl:C,relevantBuilds:L.length>0?L:null,..."new"===t.kind?{proposedSlug:t.proposedSlug}:{}}),[o,d,u,h,w,C,L,t]),$=e=>{let t=U.current;if(!t){m(t=>"".concat(t,"\n\n").concat(e,"\n"));return}let{from:r,to:n}=t.state.selection.main;t.dispatch({changes:{from:r,to:n,insert:e},selection:{anchor:r+e.length}}),t.focus()},K=async(e,t)=>{R(e),B(""),J("");try{await t()}catch(e){B(e instanceof Error?e.message:"Something went wrong. Try again.")}finally{R(null)}},Q=e=>{let n=null==e?void 0:e[0];if(n){if(n.size>5242880){B("That photo is over ".concat(5," MB. Pick a smaller one."));return}K("upload",async()=>{let{image:e,markdownRef:i}=await function(e,t){let r=new FormData;return r.append("image",t),S("/api/doc-contributions/".concat(e,"/images"),{method:"POST",body:r})}(t.id,n);r({...t,images:[...V,e]}),$("\n\n".concat(i,"\n")),J("Photo added and placed in your content")})}},ee=e=>K("upload",async()=>{var n;await (n=t.id,S("/api/doc-contributions/".concat(n,"/images?imageId=").concat(encodeURIComponent(e)),{method:"DELETE"})),r({...t,images:V.filter(t=>t.id!==e)}),J("Photo removed")}),et=e=>{D(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},er="w-full bg-theme-surface-alt border border-theme-border-light rounded-lg px-4 py-2.5 text-theme-text-primary placeholder:text-theme-text-tertiary focus:outline-none focus:ring-2 focus:ring-theme-focus focus:border-transparent",en="block font-mono text-xs uppercase tracking-wide text-theme-text-tertiary mb-2";return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{className:"bg-theme-surface rounded-xl p-6 md:p-8 border border-theme-border-light shadow-md",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 mb-6",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-mono text-xs uppercase tracking-wide text-theme-secondary mb-1",children:"edit"===t.kind?"Editing /docs/".concat(t.targetSlug):"New guide"}),(0,n.jsx)("h2",{className:"text-xl md:text-2xl font-bold text-theme-text-primary truncate",children:o||"Untitled"})]}),(0,n.jsx)("button",{type:"button",onClick:s,className:"font-mono text-xs uppercase tracking-wide text-theme-text-tertiary hover:text-theme-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus rounded px-2 py-1",children:"Back to all"})]}),(0,n.jsx)(j,{status:t.status}),t.isStale&&(0,n.jsx)("p",{className:"mt-6 text-sm text-theme-text-secondary border-l-2 border-theme-secondary pl-4",children:"This doc changed after you started editing. Your version will replace those changes â check the live page before submitting."}),t.reviewNote&&(0,n.jsxs)("div",{className:"mt-6 bg-theme-surface-alt rounded-lg p-4 border border-theme-border-light",children:[(0,n.jsx)("p",{className:"font-mono text-xs uppercase tracking-wide text-theme-text-tertiary mb-1",children:"Reviewer note"}),(0,n.jsx)("p",{className:"text-sm text-theme-text-secondary leading-relaxed",children:t.reviewNote})]})]}),(0,n.jsxs)("div",{className:"bg-theme-surface rounded-xl border border-theme-border-light shadow-md overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4 px-4 md:px-6 py-3 border-b border-theme-border-light",children:[(0,n.jsx)("div",{className:"flex gap-1 md:hidden","aria-label":"Editor view",children:["write","preview"].map(e=>(0,n.jsx)("button",{type:"button","aria-pressed":F===e,onClick:()=>M(e),className:"font-mono text-xs uppercase tracking-wide px-3 py-1.5 rounded-full transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus ".concat(F===e?"bg-theme-secondary text-theme-text-inverse":"text-theme-text-tertiary hover:text-theme-text-primary"),children:"write"===e?"Write":"Preview"},e))}),(0,n.jsx)("p",{className:"hidden md:block font-mono text-xs uppercase tracking-wide text-theme-text-tertiary",children:"Markdown \xb7 live preview"}),(0,n.jsxs)("p",{className:"font-mono text-xs text-theme-text-tertiary tabular-nums",children:[u.length.toLocaleStr
1ing()," chars"]})]}),(0,n.jsxs)("div",{className:"md:grid md:grid-cols-2 md:divide-x md:divide-theme-border-light",children:[(0,n.jsx)("div",{className:"".concat("write"===F?"block":"hidden"," md:block bg-theme-background"),children:(0,n.jsx)(T,{value:u,editable:z,onChange:m,onCreateEditor:e=>{U.current=e}})}),(0,n.jsx)("div",{className:"".concat("preview"===F?"block":"hidden"," md:block p-4 md:p-8 min-h-[24rem] max-h-[40rem] overflow-y-auto"),children:u.trim()?(0,n.jsx)(b.UG,{remarkPlugins:[p.Z],rehypePlugins:[g.Z,[f.Z,y.X]],components:v.t,children:Y}):(0,n.jsx)("p",{className:"text-theme-text-tertiary text-sm",children:"Start typing on the left. This pane renders your markdown with the docsâ own styling."})})]}),(0,n.jsxs)("div",{className:"border-t border-theme-border-light px-4 md:px-6 py-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4 mb-3",children:[(0,n.jsx)("p",{className:"font-mono text-xs uppercase tracking-wide text-theme-text-tertiary",children:"Photos"}),(0,n.jsxs)("p",{className:"font-mono text-xs text-theme-text-tertiary tabular-nums",children:[V.length," / ",20]})]}),(0,n.jsxs)("div",{className:"flex gap-3 overflow-x-auto pb-2",children:[V.map(e=>(0,n.jsxs)("div",{className:"shrink-0 w-32",children:[(0,n.jsx)("button",{type:"button",onClick:()=>{var t,r;return $((t=e.id,r=e.originalFilename,"![".concat(r.replace(/[[\]]/g,""),"](").concat("cid:").concat(t,")")))},disabled:!z,className:"block w-32 h-20 rounded-lg overflow-hidden border border-theme-border-light hover:border-theme-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus transition-colors motion-reduce:transition-none disabled:opacity-50 disabled:cursor-not-allowed",title:"Place this photo at the cursor",children:(0,n.jsx)("img",{src:e.url,alt:e.originalFilename,className:"w-full h-full object-cover"})}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-1 mt-1.5",children:[(0,n.jsxs)("code",{className:"font-mono text-[10px] text-theme-text-tertiary truncate",children:["cid:",e.id.slice(0,6)]}),z&&(0,n.jsx)("button",{type:"button",onClick:()=>ee(e.id),className:"font-mono text-[10px] uppercase text-theme-text-tertiary hover:text-theme-state-error focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus rounded px-1","aria-label":"Remove ".concat(e.originalFilename),children:"Remove"})]})]},e.id)),z&&V.length<20&&(0,n.jsx)("button",{type:"button",onClick:()=>{var e;return null===(e=H.current)||void 0===e?void 0:e.click()},disabled:"upload"===W,className:"shrink-0 w-32 h-20 rounded-lg border border-dashed border-theme-border-strong text-theme-text-tertiary hover:text-theme-text-primary hover:border-theme-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus transition-colors motion-reduce:transition-none font-mono text-xs uppercase tracking-wide disabled:opacity-50",children:"upload"===W?"Adding":"Add photo"})]}),(0,n.jsx)("input",{ref:H,type:"file",accept:"image/jpeg,image/png,image/webp",className:"sr-only",onChange:e=>{Q(e.target.files),e.target.value=""}}),(0,n.jsxs)("p",{className:"text-xs text-theme-text-tertiary mt-2",children:["JPEG, PNG or WebP up to ",5," MB. Photos are converted to WebP and stay private until your contribution is published."]})]})]}),(0,n.jsxs)("div",{className:"bg-theme-surface rounded-xl p-6 md:p-8 border border-theme-border-light shadow-md space-y-6",children:[(0,n.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"contribution-byline",className:en,children:"Your name"}),(0,n.jsx)("input",{id:"contribution-byline",type:"text",value:w,maxLength:60,disabled:!z,onChange:e=>_(e.target.value),className:er,placeholder:"Sam Whitfield","aria-describedby":"contribution-byline-hint"}),(0,n.jsx)("p",{id:"contribution-byline-hint",className:"text-xs text-theme-text-tertiary mt-2",children:"Credited on the published page as âContributed by â¦â"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"contribution-author-url",className:en,children:"Link to your site (optional)"}),(0,n.jsx)("input",{id:"contribution-author-url",type:"url",value:C,disabled:!z,onChange:e=>P(e.target.value),className:er,placeholder:"https://","aria-describedby":"
1contribution-author-url-hint"}),(0,n.jsx)("p",{id:"contribution-author-url-hint",className:"text-xs text-theme-text-tertiary mt-2",children:"Turns your name into a link."})]})]}),(0,n.jsxs)("details",{open:X,className:"border-t border-theme-border-light pt-6",children:[(0,n.jsxs)("summary",{className:"cursor-pointer font-mono text-xs uppercase tracking-wide text-theme-text-tertiary hover:text-theme-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus rounded",children:["Page details",!X&&(0,n.jsx)("span",{className:"normal-case tracking-normal",children:" â title, summary, which tables"})]}),(0,n.jsxs)("div",{className:"space-y-6 mt-6",children:[!X&&(0,n.jsx)("p",{className:"text-xs text-theme-text-tertiary",children:"Taken from the current page. Change these only if the page itself should be retitled or rescoped."}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"contribution-title",className:en,children:"Title"}),(0,n.jsx)("input",{id:"contribution-title",type:"text",value:o,maxLength:100,disabled:!z,onChange:e=>l(e.target.value),className:er,placeholder:"Adding a second cooling fan"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"contribution-description",className:en,children:"One-line summary"}),(0,n.jsx)("input",{id:"contribution-description",type:"text",value:d,maxLength:300,disabled:!z,onChange:e=>c(e.target.value),className:er,placeholder:"What a reader gets from this page"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:en,children:"Applies to"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:E.map(e=>{let t=L.includes(e.id);return(0,n.jsx)("button",{type:"button",disabled:!z,"aria-pressed":t,onClick:()=>et(e.id),className:"px-3 py-1 rounded-full text-xs font-semibold border transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus disabled:opacity-50 ".concat(t?"bg-theme-secondary text-theme-text-inverse border-theme-secondary":"bg-transparent text-theme-text-secondary border-theme-border-light hover:border-theme-secondary"),children:e.label},e.id)})}),(0,n.jsx)("p",{className:"text-xs text-theme-text-tertiary mt-2",children:"Leave all unselected if this applies to every table."})]})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"contribution-note",className:en,children:"Note to the maintainer (optional)"}),(0,n.jsx)("textarea",{id:"contribution-note",value:h,maxLength:2e3,rows:3,disabled:!z,onChange:e=>x(e.target.value),className:"".concat(er," resize-y"),placeholder:"Anything worth knowing while reviewing this"})]}),z&&(0,n.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer",children:[(0,n.jsx)("input",{type:"checkbox",checked:q,onChange:e=>A(e.target.checked),className:"mt-1 w-4 h-4 accent-theme-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus"}),(0,n.jsx)("span",{className:"text-sm text-theme-text-secondary leading-relaxed",children:"This is my own work, and I grant Dune Weaver a perpetual, worldwide licence to publish and edit it in the documentation."})]}),I&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-theme-state-error border-l-2 border-theme-state-error pl-4",children:I}),G&&!I&&(0,n.jsx)("p",{role:"status",className:"text-sm text-theme-state-success",children:G}),(0,n.jsx)("div",{className:"flex flex-col sm:flex-row gap-3 sm:items-center",children:z?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",onClick:()=>K("save",async()=>{var e,n;let{contribution:i}=await (e=t.id,n=Z(),S("/api/doc-contributions/".concat(e),{method:"PATCH",body:JSON.stringify({action:"save",...n})}));r(i),J("Draft saved")}),disabled:null!==W,className:"px-6 py-3 rounded-full font-medium border border-theme-border-strong text-theme-text-primary hover:border-theme-secondary transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus disabled:opacity-50",children:"save"===W?"Saving":"Save draft"}),(0,n.jsx)("button",{type:"button",onClick:()=>K("submit",async()=>{var e,n;let{contribution:i}=await (e=t.id,n={...Z(),licenseAccepted:q},S("/api/doc-contributions/".concat(e),{method:"PATCH",body:JSON.stringify({action:"submit",...n})}));r(i),J("Submitted for review")}),disabled:null!==W||!q,className:"px-6 py-3 rounded-full font-medium bg-theme-secondary text-theme-text-inverse hover:bg-theme-secondary-dark transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus disabled:opacity-50 disabled:cursor-not-allowed",children:"submit"===W?"Submitting":"Submit for review"})]}):"submitted"===t.status?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm text-theme-text-secondary flex-1",children:"In review. Withdraw it if you want to keep editing."}),(0,n.jsx)("button",{type:"button",onClick:()=>K("withdraw",async()=>{var e;let{contribution:n}=await (e=t.id,S("/api/doc-contributions/".concat(e),{method:"PATCH",body:JSON.stringify({action:"withdraw"})}));r(n),J("Moved back to draft")}),disabled:null!==W,className:"px-6 py-3 rounded-full font-medium border border-theme-border-strong text-theme-text-primary hover:border-theme-secondary transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus disabled:opacity-50",children:"withdraw"===W?"Withdrawing":"Withdraw"})]}):(0,n.jsx)("p",{className:"text-sm text-theme-text-secondary",children:"approved"===t.status?"Published. Thanks for writing it.":"This contribution is closed."})})]})]})},D={draft:"Draft",submitted:"In review",changes_requested:"Changes requested",approved:"Published",rejected:"Closed"};function q(){let e=(0,s.useRouter)(),{user:t,loading:r}=(0,N.a)(),[a,h]=(0,i.useState)([]),[x,b]=(0,i.useState)(null),[p,g]=(0,i.useState)(!0),[f,y]=(0,i.useState)(!1),[v,w]=(0,i.useState)(""),k=(0,i.useCallback)(async()=>{try{let{contributions:e}=await S("/api/doc-contributions");h(e)}catch(e){w(e instanceof Error?e.message:"Could not load your contributions")}finally{g(!1)}},[]);(0,i.useEffect)(()=>
1{if(!r){if(!t){g(!1);return}k()}},[r,t,k]),(0,i.useEffect)(()=>{if(!e.isReady||!t||p)return;let r="string"==typeof e.query.edit?e.query.edit:null,n="string"==typeof e.query.open?e.query.open:null;(r||n)&&(async()=>{y(!0),w("");try{if(n){let{contribution:e}=await P(n);b(e)}else if(r){let e=a.find(e=>e.targetSlug===r&&["draft","changes_requested"].includes(e.status));if(e){let{contribution:t}=await P(e.id);b(t)}else{let{contribution:e}=await S("/api/doc-contributions",{method:"POST",body:JSON.stringify({kind:"edit",targetSlug:r})});b(e),await k()}}}catch(e){w(e instanceof Error?e.message:"Could not open that contribution")}finally{y(!1),e.replace("/docs/contribute",void 0,{shallow:!0})}})()},[e.isReady,e.query.edit,e.query.open,t,p]);let _=async()=>{y(!0),w("");try{var e;let{contribution:t}=await (e={title:"Untitled guide"},S("/api/doc-contributions",{method:"POST",body:JSON.stringify({kind:"new",...e})}));b(t),await k()}catch(e){w(e instanceof Error?e.message:"Could not start a new guide")}finally{y(!1)}},C=async e=>{y(!0),w("");try{let{contribution:t}=await P(e);b(t)}catch(e){w(e instanceof Error?e.message:"Could not open that contribution")}finally{y(!1)}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.H,{title:"Contribute to the docs",description:"Suggest an edit or write a new guide for the Dune Weaver documentation.",noindex:!0}),(0,n.jsx)(d.h,{}),(0,n.jsx)("main",{className:"min-h-screen pt-16",children:(0,n.jsx)(u.$,{background:"white",hero:!0,children:(0,n.jsxs)("div",{className:"max-w-5xl mx-auto",children:[(0,n.jsx)(o(),{href:"/docs",className:"inline-flex items-center gap-1 text-sm text-theme-text-secondary hover:text-theme-secondary transition-colors motion-reduce:transition-none mb-6 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus rounded",children:"â Back to docs"}),(0,n.jsx)("p",{className:"font-mono text-xs uppercase tracking-wide text-theme-secondary mb-3",children:"Contribute"}),(0,n.jsx)(m.O,{children:"Write for the docs"}),(0,n.jsx)("p",{className:"text-lg text-theme-text-secondary leading-relaxed max-w-2xl mb-12",children:"You have run the machine. If a page is wrong, or a guide is missing, write it â your markdown and photos go straight into the documentation once reviewed, under your name."}),v&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-theme-state-error border-l-2 border-theme-state-error pl-4 mb-8",children:v}),r||p?(0,n.jsx)("p",{className:"text-theme-text-secondary",children:"Loadingâ¦"}):t?x?(0,n.jsx)(L,{contribution:x,onChange:e=>{b(e),h(t=>t.map(t=>t.id===e.id?{...t,...e}:t))},onClose:()=>{b(null),k()}}):(0,n.jsxs)("div",{className:"space-y-8",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,n.jsx)("p",{className:"font-mono text-xs uppercase tracking-wide text-theme-text-tertiary",children:"Your contributions"}),(0,n.jsx)("button",{type:"button",onClick:_,disabled:f,className:"px-6 py-3 rounded-full font-medium bg-theme-secondary text-theme-text-inverse hover:bg-theme-secondary-dark transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus disabled:opacity-50",children:f?"Openingâ¦":"Write a guide"})]}),0===a.length?(0,n.jsxs)("div",{className:"bg-theme-surface rounded-xl p-6 md:p-8 border border-theme-border-light shadow-md",children:[(0,n.jsx)("h2",{className:"text-xl md:text-2xl font-bold text-theme-text-primary mb-3",children:"Nothing here yet"}),(0,n.jsx)("p",{className:"text-theme-text-secondary leading-relaxed mb-6",children:"Two ways in: open any page in the docs and choose âSuggest an editâ when something is wrong or missing, or write a new guide for something the docs donât cover yet."}),(0,n.jsx)(o(),{href:"/docs",className:"inline-block px-6 py-3 rounded-full font-medium border border-theme-border-strong text-theme-text-primary hover:border-theme-secondary transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus",children:"Browse the docs"})]}):(0,n.jsx)("ul",{className:"space-y-4",children:a.map(e=>{var t;return(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button",onClick:()=>C(e.id),className:"w-full text-left bg-theme-surface rounded-xl p-6 md:p-8 border border-theme-border-light shadow-md hover:shadow-lg hover:border-theme-secondary transition-all motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 mb-4",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-mono text-xs uppercase tracking-wide text-theme-secondary mb-1",children:"edit"===e.kind?"Edit \xb7 /docs/".concat(e.targetSlug):"New guide"}),(0,n.jsx)("h2",{className:"text-lg md:text-xl font-bold text-theme-text-primary truncate",children:e.title||"Untitled"})]}),(0,n.jsx)("span",{className:"font-mono text-xs uppercase tracking-wide text-theme-text-tertiary shrink-0",children:null!==(t=D[e.status])&&void 0!==t?t:e.status})]}),(0,n.jsx)(j,{status:e.status})]})},e.id)})})]}):(0,n.jsxs)("div",{className:"bg-theme-surface rounded-xl p-6 md:p-8 border border-theme-border-light shadow-md max-w-2xl",children:[(0,n.jsx)("h2",{className:"text-xl md:text-2xl font-bold text-theme-text-primary mb-3",children:"Sign in to contribute"}),(0,n.jsx)("p",{className:"text-theme-text-secondary leading-relaxed mb-6",children:"Documentation contributions are open to Dune Weaver owners. Sign in with the email you bought with, and you can suggest edits or write a new guide."}),(0,n.jsx)(o(),{href:"/login",className:"inline-block px-6 py-3 rounded-full font-medium bg-theme-secondary text-theme-text-inverse hover:bg-theme-secondary-dark transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-focus",children:"Sign in"})]})]})})}),(0,n.jsx)(c.$,{})]})}},5152:function(e,t,r){e.exports=r(32602)},11163:function(e,t,r){e.exports=r(43079)}},function(e){e.O(0,[959,1155,8115,6088,5346,2210,3323,2888,9774,179],function(){return e(e.s=58087)}),_N_E=e.O()}]);
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.