1import"../chunks/DsnmJJEf.js";import{p as z,s as t,f as B,t as E,m as a,a as I,l as v,u as K,c as r,n as l,aG as N,r as o,aH as Q}from"../chunks/C-MxqaeR.js";import{s as M}from"../chunks/kpVQidKG.js";import{a as D,f as J}from"../chunks/BofaTy4F.js";import{i as R}from"../chunks/DqwbgKwX.js";import{h as S}from"../chunks/C9XwA4oU.js";import{s as V,r as W}from"../chunks/CgDy3fbo.js";import{d as X,e as Y,a as Z}from"../chunks/BjBxWCRw.js";import{b as O}from"../chunks/CGvgS6UW.js";import{b as ee}from"../chunks/5nfGUs91.js";import{g as ae}from"../chunks/DTbQJO05.js";import{s as te}from"../chunks/nZTzld1b.js";var se=J('<meta name="robots" content="noindex"/>'),le=J('<p class="error svelte-cs0phd"> </p>'),re=J(`<a class="brand svelte-cs0phd" href="/">JAMtime.ai</a> <section class="card svelte-cs0phd"><h1 class="svelte-cs0phd">Upload a JDL</h1> <p class="lede svelte-cs0phd">Paste or upload a JDL patch and drop into a fresh chat with it on 2 the bench. Older-spec patches are upgraded automatically on load.</p> <form class="svelte-cs0phd"><label class="row svelte-cs0phd"><span class="svelte-cs0phd">Device</span> <select class="svelte-cs0phd"><option>fx1 â effects pedal</option><option>vi1 â virtual instrument</option></select></label> <label class="row svelte-cs0phd"><span class="svelte-cs0phd">Label</span> <input type="text" placeholder="optional â shown above the patch" maxlength="200" class="svelte-cs0phd"/></label> <label class="row svelte-cs0phd"><span class="svelte-cs0phd">JDL file</span> <input type="file" accept=".jdl,text/plain" class="svelte-cs0phd"/></label> <label class="rowblock svelte-cs0phd"><span class="svelte-cs0phd">or paste JDL here</span> <textarea spellcheck="false" rows="20" class="svelte-cs0phd"></textarea></label> <!> <button type="submit" class="primary svelte-cs0phd"> </button></form></section>`,1);function _e(C,F){z(F,!0);let p=v(""),i=v(""),f=v("fx1"),n=v(!1),c=v(null);async function G(e){const d=e.currentTarget.files?.[0];if(d)try{l(p,await d.text(),!0),a(i)||l(i,d.name.replace(/\.jdl$/i,""),!0)}catch(A){l(c,A instanceof Error?A.message:"couldn't read file",!0)}}async function H(e){if(e.preventDefault(),!a(n)){if(l(c,null),a(p).trim().length===0){l(c,"paste or upload some JDL first");return}l(n,!0);try{const s=await te(a(p),(a(i).trim()||"Uploaded JDL").slice(0,200),a(f),{source:"upload"});await ae(`/chat/${s}`)}catch(s){l(c,s instanceof Error?s.message:"upload failed",!0),l(n,!1)}}}var L=re();S("cs0phd",e=>{var s=se();K(()=>{N.title="Upload JDL â JAMtime.ai"}),D(e,s)});var j=t(B(L),2),h=t(r(j),4),m=r(h),u=t(r(m),2),b=r(u);b.value=b.__value="fx1";var k=t(b);k.value=k.__value="vi1",o(u),o(m);var _=t(m,2),U=t(r(_),2);W(U),o(_);var g=t(_,2),P=t(r(g),2);o(g);var x=t(g,2),w=t(r(x),2);Q(w),V(w,"placeholder",`// spec_version: 1.0 3patch { ... }`),o(x);var $=t(x,2);{var T=e=>{var s=le(),d=r(s,!0);o(s),E(()=>M(d,a(c))),D(e,s)};R($,e=>{a(c)&&e(T)})}var y=t($,2),q=r(y,!0);o(y),o(h),o(j),E(()=>{y.disabled=a(n),M(q,a(n)?"uploadingâ¦":"Open in chat")}),Y("submit",h,H),ee(u,()=>a(f),e=>l(f,e)),O(U,()=>a(i),e=>l(i,e)),Z("change",P,G),O(w,()=>a(p),e=>l(p,e)),D(C,L),I()}X(["change"]);export{_e as component};
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.