1import{j as i}from"./app-C1iegf7Q.js";import{L as T,f as C}from"./inertia-BpyZy4w-.js";import{S as I}from"./seo-meta-BiuXzdeE.js";import{E as k}from"./evidence-builder-DOSzY-as.js";import{A as D}from"./app-layout-N5SYko6V.js";import{A as P}from"./arrow-left-DCX0fhKH.js";/* empty css */import"./document-canvas-DXwi1o4d.js";import"./sheet-DNayBxlr.js";import"./index-BewtL6Hn.js";import"./index-Dc_FVRD7.js";import"./index-CGXdj8xB.js";import"./index-C_n-C52S.js";import"./index-CL12STDK.js";import"./index-XydtsrKA.js";import"./index-BDqbV96p.js";import"./index-Cja0wFUH.js";import"./Combination-Cr5kvm8y.js";import"./index-B1PKR-s8.js";import"./utils-BiuKVCuu.js";import"./x-DQSeRCcH.js";import"./createLucideIcon-wqc1LSWg.js";import"./download-CXbkSkxk.js";import"./message-square-E9C1K8Gx.js";import"./history-29VTm3ac.js";import"./paperclip-Cc7CaGPI.js";import"./check-0O-UND6N.js";import"./circle-alert-D8tEThd5.js";import"./chevron-down-B1YaU0K5.js";import"./document-builder-5UH2XUUr.js";import"./trash-2-CrI9a2Po.js";import"./loader-circle-C_KBZAGS.js";import"./sparkles-C0aC1RHI.js";import"./image-plus-Drz-1lbN.js";import"./plus-BJl-aJiX.js";import"./triangle-alert-C7AVwNi-.js";import"./index-DJlprK4q.js";import"./index-DV0GpYST.js";import"./index-B9qJRYKv.js";import"./link-DKPEjeqT.js";import"./list-BgP0xxm1.js";import"./pen-line-DxMOfwPU.js";import"./markdown-renderer-CJUAlNY6.js";import"./video-embed-XSCcqTy1.js";import"./index-DnOwzyLg.js";import"./refresh-cw-Cog2DILh.js";import"./ellipsis-dh0qVsjB.js";import"./arrow-right-CQhEyoMD.js";import"./template-specimen-Dl-ug0G8.js";import"./info-D2ZN_yLm.js";import"./link-2-D0ZKUr8N.js";import"./image-vCg-0Xge.js";import"./button-BE4q1_FS.js";import"./unit-badge-B1FxxFNU.js";import"./dialog-DrkalYDs.js";import"./stamp-DioeSsh-.js";import"./file-text-XcQuIA-l.js";import"./zap-Bczke022.js";import"./gauge-DL0bVHaV.js";import"./eye-DoZffUO5.js";import"./upload-C1CGckSw.js";import"./message-square-plus-DhS9yu8k.js";import"./case-shell-EPUgGCr1.js";import"./mobile-chrome-C0ug21w9.js";import"./shield-alert-CGX6PHoz.js";import"./menu-BR3Nc3Gr.js";import"./message-circle-c43k_fjC.js";import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./circle-x-Bp6Mbpgt.js";import"./circle-check-BMWvzPMx.js";import"./site-announcement-fVSM8f3a.js";import"./use-funnel-tracking-DZvQDmiU.js";import"./journey-labels-D75PCX0v.js";import"./bell-BvDZckLh.js";import"./guest-nav-Dk8jWUwY.js";function u(){return document.querySelector('meta[name="csrf-token"]')?.content??""}function no({case:r,document_id:m=null,can_write:f=!0,asks:y=[],can_resolve_asks:h=!1,review_notes:x=null,editing:w=null,headings_are_labels:S=!1,review_state:g=null,base_version:d=null,kind:p,title:s,guide:v,specimen:j,specimen_url:b,min_items:A,initial_items:$,editor_variant:N,profile_owner_name:O=null}){async function E({title:n,summary:e,context:o}){const t=await fetch(`/cases/${r.uuid}/build-document/draft-section`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":u()},body:JSON.stringify({kind:p,title:n,summary:e,context:o})}),a=await t.json().catch(()=>({}));return t.ok&&typeof a.narrative=="string"?a.narrative:null}async function F(n){const e=new FormData;e.append("document",n);const o=await fetch(`/cases/${r.uuid}/import-evidence`,{method:"POST",headers:{Accept:"application/json","X-CSRF-TOKEN":u()},body:e}),t=await o.json().catch(()=>({}));return o.ok&&Array.isArray(t.items)?{items:t.items,images:[]}:null}async function L(n,e,o){const t=new FormData;t.append("kind",p),m!==null&&t.append("document_id",String(m)),t.append("context",e),d!==null&&t.append("base_version",String(d)),t.append("version_key",o.key),t.append("version_source",o.source),o.restoredFrom&&t.append("restored_from_key",o.restoredFrom),t.append("items",JSON.stringify(n.map(l=>({title:l.title,narrative:l.narrative}))));const a=await fetch(`/cases/${r.uuid}/build-document`,{method:"POST",headers:{Accept:"application/json","X-CSRF-TOKEN":u()},body:t}),c=await a.json().catch(()=>({}));if(!a.ok||!c.redirect)return c.message??"Something went wrong. Please try again.";C.visit(c.redirect)}return i.jsxs(D,{children:[i.jsx(I,{title:s,description:`${s}, on your case.`,url:`/cases/${r.uuid}/build-document?kind=${p}`}),i.jsx("div",{className:"mx-auto max-w-3xl px-4 pt-6",children:i.jsxs(T,{href:`/cases/${r.uuid}?tab=documents`,className:"inline-flex items-center gap-1.5 text-xs font-medium text-ink-2 hover:text-ink",children:[i.jsx(P,{size:14}),"Back to your case"]})}),i.jsx(k,{title:s,subtitle:"Add each section, or import a file you already have. We draft in your own voice, then file it to your case.",intro:v,specimen:j,specimenUrl:b,proofs:[],proofsEnabled:!1,headingsAsLabels:S,itemNoun:"section",minItems:A,initialItems:$,metered:null,createLabel:"Save",creatingLabel:"Saving...",contextPlaceholder:"e.g. any figures, sources, or context we should weave in.",onDraftItem:E,onCreate:L,onImport:F,downloadUrl:m!==null?`/cases/${r.uuid}/documents/${m}/download`:`/cases/${r.uuid}/build-document.docx?kind=${p}`,caseUuid:r.uuid,documentId:m,canWrite:f,asks:y,canResolveAsks:h,reviewNotes:x,editing:w,reviewState:g,editorVariant:N,profileOwnerName:O})]})}
1export{no as default};
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.