PageSourceSearch

https://edutoolsfactory.com/build/assets/Create-Dvq_x1kJ.js

js edutoolsfactory.com collected 2026-10-02 01:28:50 UTC 2,750 bytes, 1 lines download raw bytes

1import{r,a as g,j as e,H as v,L as N}from"./app-DFIp5Htm.js";import{A as b}from"./AuthenticatedLayout-DMDEM-p1.js";import{B as _}from"./BackLink-BNTbmboK.js";import{T as y}from"./TimeLimitInput-DBgGxouY.js";import{R as k}from"./RichEditor-C-12g5gW.js";import{u as S}from"./csrf-C4hPLC2l.js";import{f as C,a as L}from"./planSnapshot-DGtubbTo.js";import"./Dropdown-CqFLw4H_.js";import"./transition-o0hBPGmW.js";function q(d){const i=S(),[x,p]=r.useState(null),[l,u]=r.useState(!1),{data:n,setData:a,post:h,processing:o,errors:s}=g({name:"",description:"",time_limit_seconds:"",_token:i});r.useEffect(()=>{a("_token",i)},[i,a]),r.useEffect(()=>{let t=!0;return C().then(j=>{t&&p(j)}).catch(()=>{t&&u(!0)}),()=>{t=!1}},[]);const m=L(x).tests_remaining,c=Number.isInteger(m)&&m<=0;function f(t){t.preventDefault(),h(route("tests.store"),{preserveScroll:!0})}return e.jsxs(b,{user:d.auth?.user,header:e.jsx("h2",{className:"font-semibold text-xl text-gray-800 leading-tight",children:"Create Test"}),children:[e.jsx(v,{title:"Create Test"}),e.jsx("div",{className:"py-8",children:e.jsxs("div",{className:"max-w-4xl mx-auto sm:px-6 lg:px-8",children:[e.jsx(_,{}),e.jsx("div",{className:"bg-white overflow-hidden shadow-sm p-6 space-y-4",children:e.jsxs("form",{onSubmit:f,className:"space-y-3",children:[e.jsx("input",{type:"hidden",name:"_token",value:i}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-sm",children:"Name"}),e.jsx("input",{name:"name",className:"border p-2 w-full",required:!0,maxLength:255,value:n.name,onChange:t=>a("name",t.target.value)}),s.name&&e.jsx("div",{className:"text-xs text-red-600 mt-1",children:s.name})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-sm",children:"Description"}),e.jsx("div",{className:"mt-1",children:e.jsx(k,{name:"description",value:n.description,onChange:t=>a("description",t),placeholder:"Optional details / description for this test"})}),s.description&&e.jsx("div",{className:"text-xs text-red-600 mt-1",children:s.description})]}),e.jsx(y,{label:"Time limit",value:n.time_limit_seconds,onChange:t=>a("time_limit_seconds",t),helpText:"Leave empty for unlimited duration."}),s.time_limit_seconds&&e.jsx("div",{className:"text-xs text-red-600 mt-1",children:s.time_limit_seconds}),e.jsxs("div",{className:"flex gap-2",children:[c&&!l&&e.jsx("div",{className:"text-xs text-orange-700 self-center",children:"Test limit reached for your plan. Upgrade to add more tests."}),e.jsx("button",{type:"submit",className:"rounded px-4 py-2 bg-blue-600 text-white disabled:opacity-50",disabled:o||c&&!l,children:o?"Saving...":"Save"}),e.jsx(N,{href:route("tests.index"),className:"px-4 py-2 border",children:"Cancel"})]})]})})]})})]})}export{q 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.