lula2 0.1.1-nightly.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_app/immutable/assets/0.Dv98laBw.css +1 -0
- package/dist/_app/immutable/chunks/{DSi9HfzB.js → CKNf7CSU.js} +1 -1
- package/dist/_app/immutable/chunks/{D4wsprzy.js → Ca3ZVyCu.js} +1 -1
- package/dist/_app/immutable/chunks/Dacgmabg.js +3 -0
- package/dist/_app/immutable/entry/{app.pY_jLQAk.js → app.lS9kJbUY.js} +2 -2
- package/dist/_app/immutable/entry/start.z83Vr3Ay.js +1 -0
- package/dist/_app/immutable/nodes/{0.BLkz8enN.js → 0.DNlUjA6t.js} +1 -1
- package/dist/_app/immutable/nodes/{1.CfOyMeub.js → 1.C8f84F9P.js} +1 -1
- package/dist/_app/immutable/nodes/{2.DOcHSA9J.js → 2.NGPmbiD7.js} +1 -1
- package/dist/_app/immutable/nodes/{3.D2EgveDf.js → 3.BJr8tGL-.js} +1 -1
- package/dist/_app/immutable/nodes/4.37t6YhN2.js +12 -0
- package/dist/_app/version.json +1 -1
- package/dist/cli/commands/ui.js +37 -2
- package/dist/cli/server/index.js +37 -2
- package/dist/cli/server/server.js +37 -2
- package/dist/cli/server/spreadsheetRoutes.js +35 -0
- package/dist/cli/server/websocketServer.js +37 -2
- package/dist/index.html +6 -6
- package/dist/index.js +37 -2
- package/package.json +21 -20
- package/src/lib/components/setup/SpreadsheetImport.svelte +105 -2
- package/dist/_app/immutable/assets/0.BjwH76RW.css +0 -1
- package/dist/_app/immutable/chunks/D3AAXov_.js +0 -3
- package/dist/_app/immutable/entry/start.Cdw5p6kF.js +0 -1
- package/dist/_app/immutable/nodes/4.Dg1K2qE0.js +0 -9
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{b2 as Ee,o as $e,g as U,h as L,d as P,bg as wt,as as De}from"./Cby0Z7eP.js";class le{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Se{constructor(t,n){this.status=t,this.location=n}}class Re extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function yt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function vt(e){return e.split("%25").map(decodeURI).join("%25")}function bt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function kt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(i,o){if(o==="get"||o==="getAll"||o==="has")return u=>(n(u),i[o](u));t();const c=Reflect.get(i,o);return typeof c=="function"?c.bind(i):c}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const i of s)Object.defineProperty(a,i,{get(){return t(),e[i]},enumerable:!0,configurable:!0});return a}function At(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;const Et=new TextDecoder;function St(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const Rt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&H.delete(Te(e)),Rt(e,t));const H=new Map;function Tt(e,t){const n=Te(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&H.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=St(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function It(e,t,n){if(H.size>0){const r=Te(e,n),a=H.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);H.delete(r)}}return window.fetch(t,n)}function Te(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${At(...a)}"]`}return r}const Ut=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Lt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${xt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,u)=>{if(u%2){if(c.startsWith("x+"))return _e(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return _e(String.fromCharCode(...c.slice(2).split("-").map(y=>parseInt(y,16))));const d=Ut.exec(c),[,p,f,l,h]=d;return t.push({name:l,matcher:h,optional:!!p,rest:!!f,chained:f?u===1&&i[0]==="":!1}),f?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return _e(c)}).join("")}).join("")}/?$`),params:t}}function Pt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function xt(e){return e.slice(1).split("/").filter(Pt)}function Ct(e,t,n){const r={},a=e.slice(1),s=a.filter(o=>o!==void 0);let i=0;for(let o=0;o<t.length;o+=1){const c=t[o];let u=a[o-i];if(c.chained&&c.rest&&i&&(u=a.slice(o-i,o+1).filter(d=>d).join("/"),i=0),u===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](u)){r[c.name]=u;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&c.chained&&(i=0),!d&&!p&&Object.keys(r).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Nt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,u,d]])=>{const{pattern:p,params:f}=Lt(o),l={id:o,exec:h=>{const y=p.exec(h);if(y)return Ct(y,f,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...u||[]].map(i),leaf:s(c)};return l.errors.length=l.layouts.length=Math.max(l.errors.length,l.layouts.length),l});function s(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function i(o){return o===void 0?o:[a.has(o),e[o]]}}function Je(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Fe(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const I=globalThis.__sveltekit_1lw4tcu?.base??"",Ot=globalThis.__sveltekit_1lw4tcu?.assets??I,jt="1758119468164",ze="sveltekit:snapshot",Xe="sveltekit:scroll",Ze="sveltekit:states",$t="sveltekit:pageurl",B="sveltekit:history",W="sveltekit:navigation",j={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Z=location.origin;function Ie(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function ue(){return{x:pageXOffset,y:pageYOffset}}function F(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Be={...j,"":j.hover};function Qe(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function et(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Qe(e)}}function ve(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||fe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=r?.origin===Z&&e.hasAttribute("download");return{url:r,external:s,target:a,download:i}}function te(e){let t=null,n=null,r=null,a=null,s=null,i=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=F(o,"preload-code")),a===null&&(a=F(o,"preload-data")),t===null&&(t=F(o,"keepfocus")),n===null&&(n=F(o,"noscroll")),s===null&&(s=F(o,"reload")),i===null&&(i=F(o,"replacestate")),o=Qe(o);function c(u){switch(u){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Be[r??"off"],preload_data:Be[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Ve(e){const t=Ee(e);let n=!0;function r(){n=!0,t.update(i=>i)}function a(i){n=!1,t.set(i)}function s(i){let o;return t.subscribe(c=>{(o===void 0||n&&c!==o)&&i(o=c)})}return{notify:r,set:a,subscribe:s}}const tt={v:()=>{}};function Dt(){const{set:e,subscribe:t}=Ee(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Ot}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==jt;return i&&(e(!0),tt.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:r}}function fe(e,t,n){return e.origin!==Z||!e.pathname.startsWith(t)?!0:n?!(e.pathname===t+"/"||e.pathname===t+"/index.html"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===t):!1}function En(e){}function Ft(e){const t=Vt(e),n=new ArrayBuffer(t.length),r=new DataView(n);for(let a=0;a<n.byteLength;a++)r.setUint8(a,t.charCodeAt(a));return n}const Bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Vt(e){e.length%4===0&&(e=e.replace(/==?$/,""));let t="",n=0,r=0;for(let a=0;a<e.length;a++)n<<=6,n|=Bt.indexOf(e[a]),r+=6,r===24&&(t+=String.fromCharCode((n&16711680)>>16),t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,t+=String.fromCharCode(n)):r===18&&(n>>=2,t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255)),t}const Mt=-1,qt=-2,Gt=-3,Ht=-4,Kt=-5,Yt=-6;function Wt(e,t){if(typeof e=="number")return a(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);function a(s,i=!1){if(s===Mt)return;if(s===Gt)return NaN;if(s===Ht)return 1/0;if(s===Kt)return-1/0;if(s===Yt)return-0;if(i||typeof s!="number")throw new Error("Invalid input");if(s in r)return r[s];const o=n[s];if(!o||typeof o!="object")r[s]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const c=o[0],u=t?.[c];if(u)return r[s]=u(a(o[1]));switch(c){case"Date":r[s]=new Date(o[1]);break;case"Set":const d=new Set;r[s]=d;for(let l=1;l<o.length;l+=1)d.add(a(o[l]));break;case"Map":const p=new Map;r[s]=p;for(let l=1;l<o.length;l+=2)p.set(a(o[l]),a(o[l+1]));break;case"RegExp":r[s]=new RegExp(o[1],o[2]);break;case"Object":r[s]=Object(o[1]);break;case"BigInt":r[s]=BigInt(o[1]);break;case"null":const f=Object.create(null);r[s]=f;for(let l=1;l<o.length;l+=2)f[o[l]]=a(o[l+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const l=globalThis[c],h=new l(a(o[1]));r[s]=o[2]!==void 0?h.subarray(o[2],o[3]):h;break}case"ArrayBuffer":{const l=o[1],h=Ft(l);r[s]=h;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const l=c.slice(9);r[s]=Temporal[l].from(o[1]);break}case"URL":{const l=new URL(o[1]);r[s]=l;break}case"URLSearchParams":{const l=new URLSearchParams(o[1]);r[s]=l;break}default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(o.length);r[s]=c;for(let u=0;u<o.length;u+=1){const d=o[u];d!==qt&&(c[u]=a(d))}}else{const c={};r[s]=c;for(const u in o){if(u==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const d=o[u];c[u]=a(d)}}return r[s]}return a(0)}const nt=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...nt];const Jt=new Set([...nt]);[...Jt];function zt(e){return e.filter(t=>t!=null)}const Xt="x-sveltekit-invalidated",Zt="x-sveltekit-trailing-slash";function ne(e){return e instanceof le||e instanceof Re?e.status:500}function Qt(e){return e instanceof Re?e.text:"Internal Error"}let S,J,we;const en=$e.toString().includes("$$")||/function \w+\(\) \{\}/.test($e.toString());en?(S={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},J={current:null},we={current:!1}):(S=new class{#e=U({});get data(){return L(this.#e)}set data(t){P(this.#e,t)}#t=U(null);get form(){return L(this.#t)}set form(t){P(this.#t,t)}#n=U(null);get error(){return L(this.#n)}set error(t){P(this.#n,t)}#r=U({});get params(){return L(this.#r)}set params(t){P(this.#r,t)}#a=U({id:null});get route(){return L(this.#a)}set route(t){P(this.#a,t)}#o=U({});get state(){return L(this.#o)}set state(t){P(this.#o,t)}#s=U(-1);get status(){return L(this.#s)}set status(t){P(this.#s,t)}#i=U(new URL("https://example.com"));get url(){return L(this.#i)}set url(t){P(this.#i,t)}},J=new class{#e=U(null);get current(){return L(this.#e)}set current(t){P(this.#e,t)}},we=new class{#e=U(!1);get current(){return L(this.#e)}set current(t){P(this.#e,t)}},tt.v=()=>we.current=!0);function tn(e){Object.assign(S,e)}const nn="/__data.json",rn=".html__data.json";function an(e){return e.endsWith(".html")?e.replace(/\.html$/,rn):e.replace(/\/$/,"")+nn}const Me={spanContext(){return on},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},on={traceId:"",spanId:"",traceFlags:0},{tick:sn}=wt,cn=new Set(["icon","shortcut icon","apple-touch-icon"]),D=Je(Xe)??{},z=Je(ze)??{},O={url:Ve({}),page:Ve({}),navigating:Ee(null),updated:Dt()};function Ue(e){D[e]=ue()}function ln(e,t){let n=e+1;for(;D[n];)delete D[n],n+=1;for(n=t+1;z[n];)delete z[n],n+=1}function q(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function rt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(I||"/");e&&await e.update()}}function qe(){}let Le,be,re,x,ke,v;const ae=[],oe=[];let C=null;const ee=new Map,at=new Set,un=new Set,K=new Set;let w={branch:[],error:null,url:null},Pe=!1,se=!1,Ge=!0,X=!1,G=!1,ot=!1,xe=!1,st,E,T,$;const Y=new Set,He=new Map;async function In(e,t,n){globalThis.__sveltekit_1lw4tcu.data&&globalThis.__sveltekit_1lw4tcu?.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Le=Nt(e),x=document.documentElement,ke=t,be=e.nodes[0],re=e.nodes[1],be(),re(),E=history.state?.[B],T=history.state?.[W],E||(E=T=Date.now(),history.replaceState({...history.state,[B]:E,[W]:T},""));const r=D[E];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await vn(ke,n)):(await V({type:"enter",url:Ie(v.hash?kn(new URL(location.href)):location.href),replace_state:!0}),a()),yn()}function fn(){ae.length=0,xe=!1}function it(e){oe.some(t=>t?.snapshot)&&(z[e]=oe.map(t=>t?.snapshot?.capture()))}function ct(e){z[e]?.forEach((t,n)=>{oe[n]?.snapshot?.restore(t)})}function Ke(){Ue(E),Fe(Xe,D),it(T),Fe(ze,z)}async function lt(e,t,n,r){let a;t.invalidateAll&&(C=null),await V({type:"goto",url:Ie(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(xe=!0,a=[...He.keys()]),t.invalidate&&t.invalidate.forEach(wn)}}),t.invalidateAll&&De().then(De).then(()=>{He.forEach(({resource:s},i)=>{a?.includes(i)&&s.refresh?.()})})}async function dn(e){if(e.id!==C?.id){const t={};Y.add(t),C={id:e.id,token:t,promise:dt({...e,preload:t}).then(n=>(Y.delete(t),n.type==="loaded"&&n.state.error&&(C=null),n))}}return C.promise}async function ye(e){const t=(await he(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}function ut(e,t,n){w=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(S,e.props.page),st=new v.root({target:t,props:{...e.props,stores:O,components:oe},hydrate:n,sync:!1}),ct(T),n){const a={from:null,to:{params:w.params,route:{id:w.route?.id??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};K.forEach(s=>s(a))}se=!0}function ie({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if(I&&(e.pathname===I||e.pathname===I+"/"))o="always";else for(const l of n)l?.slash!==void 0&&(o=l.slash);e.pathname=yt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:s},props:{constructors:zt(n).map(l=>l.node.component),page:je(S)}};i!==void 0&&(c.props.form=i);let u={},d=!S,p=0;for(let l=0;l<Math.max(n.length,w.branch.length);l+=1){const h=n[l],y=w.branch[l];h?.data!==y?.data&&(d=!0),h&&(u={...u,...h.data},d&&(c.props[`data_${p}`]=u),p+=1)}return(!w.url||e.href!==w.url.href||w.error!==a||i!==void 0&&i!==S.form||d)&&(c.props.page={error:a,params:t,route:{id:s?.id??null},state:{},status:r,url:new URL(e),form:i??null,data:d?u:S.data}),c}async function Ce({loader:e,parent:t,url:n,params:r,route:a,server_data_node:s}){let i=null,o=!0;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},u=await e();if(u.universal?.load){let d=function(...f){for(const l of f){const{href:h}=new URL(l,n);c.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Me,current:Me},route:new Proxy(a,{get:(f,l)=>(o&&(c.route=!0),f[l])}),params:new Proxy(r,{get:(f,l)=>(o&&c.params.add(l),f[l])}),data:s?.data??null,url:kt(n,()=>{o&&(c.url=!0)},f=>{o&&c.search_params.add(f)},v.hash),async fetch(f,l){f instanceof Request&&(l={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...l});const{resolved:h,promise:y}=ft(f,l,n);return o&&d(h.href),y},setHeaders:()=>{},depends:d,parent(){return o&&(c.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};i=await u.universal.load.call(null,p)??null}return{node:u,loader:e,server:s,universal:u.universal?.load?{type:"data",data:i,uses:c}:null,data:i??s?.data??null,slash:u.universal?.trailingSlash??s?.slash}}function ft(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=se?It(r,a.href,t):Tt(r,t);return{resolved:a,promise:s}}function Ye(e,t,n,r,a,s){if(xe)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(s[i]!==w.params[i])return!0;for(const i of a.dependencies)if(ae.some(o=>o(new URL(i))))return!0;return!1}function Ne(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function hn(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(i=>s.includes(i))&&s.every(i=>a.includes(i))&&n.delete(r)}return n}function We({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:je(S),constructors:[]}}}async function dt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if(C?.id===e)return Y.delete(C.token),C.promise;const{errors:i,layouts:o,leaf:c}=a,u=[...o,c];i.forEach(_=>_?.().catch(()=>{})),u.forEach(_=>_?.[1]().catch(()=>{}));let d=null;const p=w.url?e!==ce(w.url):!1,f=w.route?a.id!==w.route.id:!1,l=hn(w.url,n);let h=!1;const y=u.map((_,g)=>{const b=w.branch[g],k=!!_?.[0]&&(b?.loader!==_[1]||Ye(h,f,p,l,b.server?.uses,r));return k&&(h=!0),k});if(y.some(Boolean)){try{d=await gt(n,y)}catch(_){const g=await M(_,{url:n,params:r,route:{id:e}});return Y.has(s)?We({error:g,url:n,params:r,route:a}):de({status:ne(_),error:g,url:n,route:a})}if(d.type==="redirect")return d}const A=d?.nodes;let m=!1;const N=u.map(async(_,g)=>{if(!_)return;const b=w.branch[g],k=A?.[g];if((!k||k.type==="skip")&&_[1]===b?.loader&&!Ye(m,f,p,l,b.universal?.uses,r))return b;if(m=!0,k?.type==="error")throw k;return Ce({loader:_[1],url:n,params:r,route:a,parent:async()=>{const pe={};for(let ge=0;ge<g;ge+=1)Object.assign(pe,(await N[ge])?.data);return pe},server_data_node:Ne(k===void 0&&_[0]?{type:"skip"}:k??null,_[0]?b?.server:void 0)})});for(const _ of N)_.catch(()=>{});const R=[];for(let _=0;_<u.length;_+=1)if(u[_])try{R.push(await N[_])}catch(g){if(g instanceof Se)return{type:"redirect",location:g.location};if(Y.has(s))return We({error:await M(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let b=ne(g),k;if(A?.includes(g))b=g.status??b,k=g.error;else if(g instanceof le)k=g.body;else{if(await O.updated.check())return await rt(),await q(n);k=await M(g,{params:r,url:n,route:{id:a.id}})}const Q=await pn(_,R,i);return Q?ie({url:n,params:r,branch:R.slice(0,Q.idx).concat(Q.node),status:b,error:k,route:a}):await pt(n,{id:a.id},k,b)}else R.push(void 0);return ie({url:n,params:r,branch:R,status:200,error:null,route:a,form:t?void 0:null})}async function pn(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function de({status:e,error:t,url:n,route:r}){const a={};let s=null;if(v.server_loads[0]===0)try{const o=await gt(n,[!0]);if(o.type!=="data"||o.nodes[0]&&o.nodes[0].type!=="data")throw 0;s=o.nodes[0]??null}catch{(n.origin!==Z||n.pathname!==location.pathname||Pe)&&await q(n)}try{const o=await Ce({loader:be,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ne(s)}),c={node:await re(),loader:re,universal:null,server:null,data:null};return ie({url:n,params:a,branch:[o,c],status:e,error:t,route:null})}catch(o){if(o instanceof Se)return lt(new URL(o.location,location.href),{},0);throw o}}async function gn(e){const t=e.href;if(ee.has(t))return ee.get(t);let n;try{const r=(async()=>{let a=await v.hooks.reroute({url:new URL(e),fetch:async(s,i)=>ft(s,i,e).promise})??e;if(typeof a=="string"){const s=new URL(e);v.hash?s.hash=a:s.pathname=a,a=s}return a})();ee.set(t,r),n=await r}catch{ee.delete(t);return}return n}async function he(e,t){if(e&&!fe(e,I,v.hash)){const n=await gn(e);if(!n)return;const r=mn(n);for(const a of Le){const s=a.exec(r);if(s)return{id:ce(e),invalidating:t,route:a,params:bt(s),url:e}}}}function mn(e){return vt(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(I.length))||"/"}function ce(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function ht({url:e,type:t,intent:n,delta:r,event:a}){let s=!1;const i=Oe(w,n,e,t);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const o={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return X||at.forEach(c=>c(o)),s?null:i}async function V({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:u=qe,block:d=qe,event:p}){const f=$;$=c;const l=await he(t,!1),h=e==="enter"?Oe(w,l,t,e):ht({url:t,type:e,delta:n?.delta,intent:l,event:p});if(!h){d(),$===c&&($=f);return}const y=E,A=T;u(),X=!0,se&&h.navigation.type!=="enter"&&O.navigating.set(J.current=h.navigation);let m=l&&await dt(l);if(!m){if(fe(t,I,v.hash))return await q(t,s);m=await pt(t,{id:null},await M(new Re(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=l?.url||t,$!==c)return h.reject(new Error("navigation aborted")),!1;if(m.type==="redirect"){if(o<20){await V({type:e,url:new URL(m.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i,redirect_count:o+1,nav_token:c}),h.fulfil(void 0);return}m=await de({status:500,error:await M(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else m.props.page.status>=400&&await O.updated.check()&&(await rt(),await q(t,s));if(fn(),Ue(y),it(A),m.props.page.url.pathname!==t.pathname&&(t.pathname=m.props.page.url.pathname),i=n?n.state:i,!n){const g=s?0:1,b={[B]:E+=g,[W]:T+=g,[Ze]:i};(s?history.replaceState:history.pushState).call(history,b,"",t),s||ln(E,T)}if(C=null,m.props.page.state=i,se){const g=(await Promise.all(Array.from(un,b=>b(h.navigation)))).filter(b=>typeof b=="function");if(g.length>0){let b=function(){g.forEach(k=>{K.delete(k)})};g.push(b),g.forEach(k=>{K.add(k)})}w=m.state,m.props.page&&(m.props.page.url=t),st.$set(m.props),tn(m.props.page),ot=!0}else ut(m,ke,!1);const{activeElement:N}=document;await sn();const R=n?n.scroll:a?ue():null;if(Ge){const g=t.hash&&document.getElementById(_t(t));R?scrollTo(R.x,R.y):g?g.scrollIntoView():scrollTo(0,0)}const _=document.activeElement!==N&&document.activeElement!==document.body;!r&&!_&&bn(t),Ge=!0,m.props.page&&Object.assign(S,m.props.page),X=!1,e==="popstate"&&ct(T),h.fulfil(void 0),K.forEach(g=>g(h.navigation)),O.navigating.set(J.current=null)}async function pt(e,t,n,r,a){return e.origin===Z&&e.pathname===location.pathname&&!Pe?await de({status:r,error:n,url:e,route:t}):await q(e,a)}function _n(){let e,t,n;x.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{s(c,j.hover)},20)});function r(o){o.defaultPrevented||s(o.composedPath()[0],j.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(ye(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(o,c){const u=et(o,x),d=u===t&&c>=n;if(!u||d)return;const{url:p,external:f,download:l}=ve(u,I,v.hash);if(f||l)return;const h=te(u),y=p&&ce(w.url)===ce(p);if(!(h.reload||y))if(c<=h.preload_data){t=u,n=j.tap;const A=await he(p,!1);if(!A)return;dn(A)}else c<=h.preload_code&&(t=u,n=c,ye(p))}function i(){a.disconnect();for(const o of x.querySelectorAll("a")){const{url:c,external:u,download:d}=ve(o,I,v.hash);if(u||d)continue;const p=te(o);p.reload||(p.preload_code===j.viewport&&a.observe(o),p.preload_code===j.eager&&ye(c))}}K.add(i),i()}function M(e,t){if(e instanceof le)return e.body;const n=ne(e),r=Qt(e);return v.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Un(e,t={}){return e=new URL(Ie(e)),e.origin!==Z?Promise.reject(new Error("goto: invalid URL")):lt(e,t,0)}function wn(e){if(typeof e=="function")ae.push(e);else{const{href:t}=new URL(e,location.href);ae.push(n=>n.href===t)}}function yn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Ke(),!X){const r=Oe(w,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};at.forEach(s=>s(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ke()}),navigator.connection?.saveData||_n(),x.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=et(t.composedPath()[0],x);if(!n)return;const{url:r,external:a,target:s,download:i}=ve(n,I,v.hash);if(!r)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const o=te(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||i)return;const[u,d]=(v.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=u===me(location);if(a||o.reload&&(!p||!d)){ht({url:r,type:"link",event:t})?X=!0:t.preventDefault();return}if(d!==void 0&&p){const[,f]=w.url.href.split("#");if(f===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const l=n.ownerDocument.getElementById(decodeURIComponent(d));l&&(l.scrollIntoView(),l.focus())}return}if(G=!0,Ue(E),e(r),!o.replace_state)return;G=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await V({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),x.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const i=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(fe(i,I,!1))return;const o=t.target,c=te(o);if(c.reload)return;t.preventDefault(),t.stopPropagation();const u=new FormData(o),d=r?.getAttribute("name");d&&u.append(d,r?.getAttribute("value")??""),i.search=new URLSearchParams(u).toString(),V({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ae){if(t.state?.[B]){const n=t.state[B];if($={},n===E)return;const r=D[n],a=t.state[Ze]??{},s=new URL(t.state[$t]??location.href),i=t.state[W],o=w.url?me(location)===me(w.url):!1;if(i===T&&(ot||o)){a!==S.state&&(S.state=a),e(s),D[E]=ue(),r&&scrollTo(r.x,r.y),E=n;return}const u=n-E;await V({type:"popstate",url:s,popped:{state:a,scroll:r,delta:u},accept:()=>{E=n,T=i},block:()=>{history.go(-u)},nav_token:$,event:t})}else if(!G){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[B]:++E,[W]:T},"",location.href))});for(const t of document.querySelectorAll("link"))cn.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&O.navigating.set(J.current=null)});function e(t){w.url=S.url=t,O.page.set(je(S)),O.page.notify()}}async function vn(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:i,data:o,form:c}){Pe=!0;const u=new URL(location.href);let d;({params:a={},route:s={id:null}}=await he(u,!1)||{}),d=Le.find(({id:l})=>l===s.id);let p,f=!0;try{const l=r.map(async(y,A)=>{const m=o[A];return m?.uses&&(m.uses=mt(m.uses)),Ce({loader:v.nodes[y],url:u,params:a,route:s,parent:async()=>{const N={};for(let R=0;R<A;R+=1)Object.assign(N,(await l[R]).data);return N},server_data_node:Ne(m)})}),h=await Promise.all(l);if(d){const y=d.layouts;for(let A=0;A<y.length;A++)y[A]||h.splice(A,0,void 0)}p=ie({url:u,params:a,branch:h,status:t,error:n,form:c,route:d??null})}catch(l){if(l instanceof Se){await q(new URL(l.location,location.href));return}p=await de({status:ne(l),error:await M(l,{url:u,params:a,route:s}),url:u,route:s}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),ut(p,e,f)}async function gt(e,t){const n=new URL(e);n.pathname=an(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(Zt,"1"),n.searchParams.append(Xt,t.map(s=>s?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let s;throw a.headers.get("content-type")?.includes("application/json")?s=await a.json():a.status===404?s="Not Found":a.status===500&&(s="Internal Error"),new le(a.status,s)}return new Promise(async s=>{const i=new Map,o=a.body.getReader();function c(d){return Wt(d,{...v.decoders,Promise:p=>new Promise((f,l)=>{i.set(p,{fulfil:f,reject:l})})})}let u="";for(;;){const{done:d,value:p}=await o.read();if(d&&!u)break;for(u+=!p&&u?`
|
|
2
|
+
`:Et.decode(p,{stream:!0});;){const f=u.indexOf(`
|
|
3
|
+
`);if(f===-1)break;const l=JSON.parse(u.slice(0,f));if(u=u.slice(f+1),l.type==="redirect")return s(l);if(l.type==="data")l.nodes?.forEach(h=>{h?.type==="data"&&(h.uses=mt(h.uses),h.data=c(h.data))}),s(l);else if(l.type==="chunk"){const{id:h,data:y,error:A}=l,m=i.get(h);i.delete(h),A?m.reject(c(A)):m.fulfil(c(y))}}}})}function mt(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Ae=!1;function bn(e){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=_t(e);if(n&&document.getElementById(n)){const{x:a,y:s}=ue();setTimeout(()=>{const i=history.state;Ae=!0,location.replace(`#${n}`),v.hash&&location.replace(e.hash),history.replaceState(i,"",e.hash),scrollTo(a,s),Ae=!1})}else{const a=document.body,s=a.getAttribute("tabindex");a.tabIndex=-1,a.focus({preventScroll:!0,focusVisible:!1}),s!==null?a.setAttribute("tabindex",s):a.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let s=0;s<r.rangeCount;s+=1)a.push(r.getRangeAt(s));setTimeout(()=>{if(r.rangeCount===a.length){for(let s=0;s<r.rangeCount;s+=1){const i=a[s],o=r.getRangeAt(s);if(i.commonAncestorContainer!==o.commonAncestorContainer||i.startContainer!==o.startContainer||i.endContainer!==o.endContainer||i.startOffset!==o.startOffset||i.endOffset!==o.endOffset)return}r.removeAllRanges()}})}}}function Oe(e,t,n,r){let a,s;const i=new Promise((c,u)=>{a=c,s=u});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n},willUnload:!t,type:r,complete:i},fulfil:a,reject:s}}function je(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function kn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function _t(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{In as a,Un as g,En as l,S as p,O as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.
|
|
2
|
-
import{d as k,aa as U,h as f,ao as Y,ap as G,aq as J,Y as K,ar as W,T as z,p as F,C as H,u as Q,o as X,g as O,as as Z,f as V,a as w,s as $,b as y,e as ee,ak as x,c as te,r as re,al as L,am as se,J as ae,K as ne}from"../chunks/Cby0Z7eP.js";import"../chunks/DsnmJJEf.js";import{p as S,i as A}from"../chunks/DqsOU3kV.js";import{c as C}from"../chunks/CoF2vljD.js";import{b as T}from"../chunks/DnJ0bPgj.js";function oe(c){return class extends ce{constructor(e){super({component:c,...e})}}}class ce{#t;#e;constructor(e){var a=new Map,i=(r,t)=>{var s=z(t,!1,!1);return a.set(r,s),s};const l=new Proxy({...e.props||{},$$events:{}},{get(r,t){return f(a.get(t)??i(t,Reflect.get(r,t)))},has(r,t){return t===U?!0:(f(a.get(t)??i(t,Reflect.get(r,t))),Reflect.has(r,t))},set(r,t,s){return k(a.get(t)??i(t,s),s),Reflect.set(r,t,s)}});this.#e=(e.hydrate?Y:G)(e.component,{target:e.target,anchor:e.anchor,props:l,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&J(),this.#t=l.$$events;for(const r of Object.keys(this.#e))r==="$set"||r==="$destroy"||r==="$on"||K(this,r,{get(){return this.#e[r]},set(t){this.#e[r]=t},enumerable:!0});this.#e.$set=r=>{Object.assign(l,r)},this.#e.$destroy=()=>{W(this.#e)}}$set(e){this.#e.$set(e)}$on(e,a){this.#t[e]=this.#t[e]||[];const i=(...l)=>a.call(this,...l);return this.#t[e].push(i),()=>{this.#t[e]=this.#t[e].filter(l=>l!==i)}}$destroy(){this.#e.$destroy()}}const ie="modulepreload",le=function(c,e){return new URL(c,e).href},I={},P=function(e,a,i){let l=Promise.resolve();if(a&&a.length>0){let p=function(o){return Promise.all(o.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),R=s?.nonce||s?.getAttribute("nonce");l=p(a.map(o=>{if(o=le(o,i),o in I)return;I[o]=!0;const d=o.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!i)for(let n=t.length-1;n>=0;n--){const u=t[n];if(u.href===o&&(!d||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${h}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":ie,d||(m.as="script"),m.crossOrigin="",m.href=o,R&&m.setAttribute("nonce",R),document.head.appendChild(m),d)return new Promise((n,u)=>{m.addEventListener("load",n),m.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${o}`)))})}))}function r(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return l.then(t=>{for(const s of t||[])s.status==="rejected"&&r(s.reason);return e().catch(r)})},Pe={};var ue=V('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),me=V("<!> <!>",1);function de(c,e){F(e,!0);let a=S(e,"components",23,()=>[]),i=S(e,"data_0",3,null),l=S(e,"data_1",3,null);H(()=>e.stores.page.set(e.page)),Q(()=>{e.stores,e.page,e.constructors,a(),e.form,i(),l(),e.stores.page.notify()});let r=O(!1),t=O(!1),s=O(null);X(()=>{const n=e.stores.page.subscribe(()=>{f(r)&&(k(t,!0),Z().then(()=>{k(s,document.title||"untitled page",!0)}))});return k(r,!0),n});const R=L(()=>e.constructors[1]);var p=me(),o=w(p);{var d=n=>{const u=L(()=>e.constructors[0]);var _=x(),E=w(_);C(E,()=>f(u),(v,g)=>{T(g(v,{get data(){return i()},get form(){return e.form},get params(){return e.page.params},children:(b,_e)=>{var D=x(),q=w(D);C(q,()=>f(R),(B,M)=>{T(M(B,{get data(){return l()},get form(){return e.form},get params(){return e.page.params}}),N=>a()[1]=N,()=>a()?.[1])}),y(b,D)},$$slots:{default:!0}}),b=>a()[0]=b,()=>a()?.[0])}),y(n,_)},h=n=>{const u=L(()=>e.constructors[0]);var _=x(),E=w(_);C(E,()=>f(u),(v,g)=>{T(g(v,{get data(){return i()},get form(){return e.form},get params(){return e.page.params}}),b=>a()[0]=b,()=>a()?.[0])}),y(n,_)};A(o,n=>{e.constructors[1]?n(d):n(h,!1)})}var j=$(o,2);{var m=n=>{var u=ue(),_=te(u);{var E=v=>{var g=se();ae(()=>ne(g,f(s))),y(v,g)};A(_,v=>{f(t)&&v(E)})}re(u),y(n,u)};A(j,n=>{f(r)&&n(m)})}y(c,p),ee()}const Re=oe(de),pe=[()=>P(()=>import("../nodes/0.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.DNlUjA6t.js","../chunks/DsnmJJEf.js","../chunks/Cby0Z7eP.js","../chunks/DqsOU3kV.js","../chunks/Dacgmabg.js","../chunks/Ca3ZVyCu.js","../chunks/CoF2vljD.js","../chunks/BtOhWAVU.js","../chunks/C5zWTfmV.js","../assets/0.Dv98laBw.css","../nodes/1.C8f84F9P.js","../nodes/2.NGPmbiD7.js","../chunks/CKNf7CSU.js","../chunks/DnJ0bPgj.js","../assets/DynamicControlEditor.DoNLxeLe.css","../nodes/3.BJr8tGL-.js","../nodes/4.37t6YhN2.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{d as k,aa as U,h as f,ao as Y,ap as G,aq as J,Y as K,ar as W,T as z,p as F,C as H,u as Q,o as X,g as O,as as Z,f as V,a as w,s as $,b as y,e as ee,ak as x,c as te,r as re,al as L,am as se,J as ae,K as ne}from"../chunks/Cby0Z7eP.js";import"../chunks/DsnmJJEf.js";import{p as S,i as A}from"../chunks/DqsOU3kV.js";import{c as C}from"../chunks/CoF2vljD.js";import{b as T}from"../chunks/DnJ0bPgj.js";function oe(c){return class extends ce{constructor(e){super({component:c,...e})}}}class ce{#t;#e;constructor(e){var a=new Map,i=(r,t)=>{var s=z(t,!1,!1);return a.set(r,s),s};const l=new Proxy({...e.props||{},$$events:{}},{get(r,t){return f(a.get(t)??i(t,Reflect.get(r,t)))},has(r,t){return t===U?!0:(f(a.get(t)??i(t,Reflect.get(r,t))),Reflect.has(r,t))},set(r,t,s){return k(a.get(t)??i(t,s),s),Reflect.set(r,t,s)}});this.#e=(e.hydrate?Y:G)(e.component,{target:e.target,anchor:e.anchor,props:l,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&J(),this.#t=l.$$events;for(const r of Object.keys(this.#e))r==="$set"||r==="$destroy"||r==="$on"||K(this,r,{get(){return this.#e[r]},set(t){this.#e[r]=t},enumerable:!0});this.#e.$set=r=>{Object.assign(l,r)},this.#e.$destroy=()=>{W(this.#e)}}$set(e){this.#e.$set(e)}$on(e,a){this.#t[e]=this.#t[e]||[];const i=(...l)=>a.call(this,...l);return this.#t[e].push(i),()=>{this.#t[e]=this.#t[e].filter(l=>l!==i)}}$destroy(){this.#e.$destroy()}}const ie="modulepreload",le=function(c,e){return new URL(c,e).href},I={},P=function(e,a,i){let l=Promise.resolve();if(a&&a.length>0){let p=function(o){return Promise.all(o.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),R=s?.nonce||s?.getAttribute("nonce");l=p(a.map(o=>{if(o=le(o,i),o in I)return;I[o]=!0;const d=o.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!i)for(let n=t.length-1;n>=0;n--){const u=t[n];if(u.href===o&&(!d||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${h}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":ie,d||(m.as="script"),m.crossOrigin="",m.href=o,R&&m.setAttribute("nonce",R),document.head.appendChild(m),d)return new Promise((n,u)=>{m.addEventListener("load",n),m.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${o}`)))})}))}function r(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return l.then(t=>{for(const s of t||[])s.status==="rejected"&&r(s.reason);return e().catch(r)})},Pe={};var ue=V('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),me=V("<!> <!>",1);function de(c,e){F(e,!0);let a=S(e,"components",23,()=>[]),i=S(e,"data_0",3,null),l=S(e,"data_1",3,null);H(()=>e.stores.page.set(e.page)),Q(()=>{e.stores,e.page,e.constructors,a(),e.form,i(),l(),e.stores.page.notify()});let r=O(!1),t=O(!1),s=O(null);X(()=>{const n=e.stores.page.subscribe(()=>{f(r)&&(k(t,!0),Z().then(()=>{k(s,document.title||"untitled page",!0)}))});return k(r,!0),n});const R=L(()=>e.constructors[1]);var p=me(),o=w(p);{var d=n=>{const u=L(()=>e.constructors[0]);var _=x(),E=w(_);C(E,()=>f(u),(v,g)=>{T(g(v,{get data(){return i()},get form(){return e.form},get params(){return e.page.params},children:(b,_e)=>{var D=x(),q=w(D);C(q,()=>f(R),(B,M)=>{T(M(B,{get data(){return l()},get form(){return e.form},get params(){return e.page.params}}),N=>a()[1]=N,()=>a()?.[1])}),y(b,D)},$$slots:{default:!0}}),b=>a()[0]=b,()=>a()?.[0])}),y(n,_)},h=n=>{const u=L(()=>e.constructors[0]);var _=x(),E=w(_);C(E,()=>f(u),(v,g)=>{T(g(v,{get data(){return i()},get form(){return e.form},get params(){return e.page.params}}),b=>a()[0]=b,()=>a()?.[0])}),y(n,_)};A(o,n=>{e.constructors[1]?n(d):n(h,!1)})}var j=$(o,2);{var m=n=>{var u=ue(),_=te(u);{var E=v=>{var g=se();ae(()=>ne(g,f(s))),y(v,g)};A(_,v=>{f(t)&&v(E)})}re(u),y(n,u)};A(j,n=>{f(r)&&n(m)})}y(c,p),ee()}const Re=oe(de),pe=[()=>P(()=>import("../nodes/0.DNlUjA6t.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),()=>P(()=>import("../nodes/1.C8f84F9P.js"),__vite__mapDeps([10,1,8,2,4]),import.meta.url),()=>P(()=>import("../nodes/2.NGPmbiD7.js"),__vite__mapDeps([11,1,8,2,3,12,7,5,4,6,13,14]),import.meta.url),()=>P(()=>import("../nodes/3.BJr8tGL-.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8,12,13,14]),import.meta.url),()=>P(()=>import("../nodes/4.37t6YhN2.js"),__vite__mapDeps([16,1,8,2,3,7,4]),import.meta.url)],we=[],ke={"/":[2],"/control/[id]":[3],"/setup":[4]},fe={handleError:(({error:c})=>{console.error(c)}),reroute:(()=>{}),transport:{}},he=Object.fromEntries(Object.entries(fe.transport).map(([c,e])=>[c,e.decode])),Oe=!1,xe=(c,e)=>he[c](e);export{xe as decode,he as decoders,ke as dictionary,Oe as hash,fe as hooks,Pe as matchers,pe as nodes,Re as root,we as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o,a as r}from"../chunks/Dacgmabg.js";export{o as load_css,r as start};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/DsnmJJEf.js";import{at as le,p as R,ae as y,d as k,T as $,G as m,h as u,af as F,ag as M,c as i,n as A,r as n,b as v,e as N,J as D,K as Y,ak as Q,a as U,f as P,o as xe,au as be,s as V,av as ie}from"../chunks/Cby0Z7eP.js";import{l as z,p as C,i as w,a as te,s as de}from"../chunks/DqsOU3kV.js";import{g as me}from"../chunks/D3AAXov_.js";import{p as _e,D as we}from"../chunks/D4wsprzy.js";import{i as j}from"../chunks/C5zWTfmV.js";import{a as K,f as ce,w as q}from"../chunks/BtOhWAVU.js";le(["change"]);var ye=M("<title> </title>"),ke=M('<svg><!><path d="M11.41 26.59L7.83 23 28 23 28 21 7.83 21 11.41 17.41 10 16 4 22 10 28 11.41 26.59zM28 10L22 4 20.59 5.41 24.17 9 4 9 4 11 24.17 11 20.59 14.59 22 16 28 10z"></path></svg>');function $e(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),j();var s=ke();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=ye(),c=i(a,!0);n(a),D(()=>Y(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(),n(s),v(b,s),N()}var ze=P('<a href="/setup" class="inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors" title="Switch control set"><!> Switch</a>'),Ce=P('<div class="text-sm text-gray-500 dark:text-gray-400">Loading...</div>');function Me(b,t){R(t,!1);const e=()=>te(ce,"$appState",l),[l,o]=de();j();var g=Q(),f=U(g);{var r=p=>{var x=ze(),d=i(x);$e(d,{size:16}),A(),n(x),v(p,x)},s=p=>{var x=Ce();v(p,x)};w(f,p=>{e().isConnected?p(r):p(s,!1)})}v(b,g),N(),o()}var Se=M("<title> </title>"),Le=M('<svg><!><path d="M31 16L24 23 22.59 21.59 28.17 16 22.59 10.41 24 9 31 16zM1 16L8 9 9.41 10.41 3.83 16 9.41 21.59 8 23 1 16z"></path><path d="M5.91 15H26.080000000000002V17H5.91z" transform="rotate(-75 15.996 16)"></path></svg>');function Ae(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),j();var s=Le();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Se(),c=i(a,!0);n(a),D(()=>Y(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(2),n(s),v(b,s),N()}var Ee=M("<title> </title>"),He=M('<svg><!><path d="M13 21L26.17 21 23.59 23.59 25 25 30 20 25 15 23.59 16.41 26.17 19 13 19 13 21z"></path><path d="M22,14V10a1,1,0,0,0-.29-.71l-7-7A1,1,0,0,0,14,2H4A2,2,0,0,0,2,4V28a2,2,0,0,0,2,2H20a2,2,0,0,0,2-2V26H20v2H4V4h8v6a2,2,0,0,0,2,2h6v2Zm-8-4V4.41L19.59,10Z"></path></svg>');function Ve(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),j();var s=He();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Ee(),c=i(a,!0);n(a),D(()=>Y(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(2),n(s),v(b,s),N()}var Re=M("<title> </title>"),Ne=M('<svg><!><path d="M26 24v4H6V24H4v4H4a2 2 0 002 2H26a2 2 0 002-2h0V24zM26 14L24.59 12.59 17 20.17 17 2 15 2 15 20.17 7.41 12.59 6 14 16 24 26 14z"></path></svg>');function ne(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),j();var s=Ne();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Re(),c=i(a,!0);n(a),D(()=>Y(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(),n(s),v(b,s),N()}var Pe=M("<title> </title>"),Te=M('<svg><!><path fill-rule="evenodd" d="M16,2a14,14,0,0,0-4.43,27.28c.7.13,1-.3,1-.67s0-1.21,0-2.38c-3.89.84-4.71-1.88-4.71-1.88A3.71,3.71,0,0,0,6.24,22.3c-1.27-.86.1-.85.1-.85A2.94,2.94,0,0,1,8.48,22.9a3,3,0,0,0,4.08,1.16,2.93,2.93,0,0,1,.88-1.87c-3.1-.36-6.37-1.56-6.37-6.92a5.4,5.4,0,0,1,1.44-3.76,5,5,0,0,1,.14-3.7s1.17-.38,3.85,1.43a13.3,13.3,0,0,1,7,0c2.67-1.81,3.84-1.43,3.84-1.43a5,5,0,0,1,.14,3.7,5.4,5.4,0,0,1,1.44,3.76c0,5.38-3.27,6.56-6.39,6.91a3.33,3.33,0,0,1,.95,2.59c0,1.87,0,3.38,0,3.84s.25.81,1,.67A14,14,0,0,0,16,2Z"></path></svg>');function Be(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),j();var s=Te();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Pe(),c=i(a,!0);n(a),D(()=>Y(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(),n(s),v(b,s),N()}var De=(b,t)=>t("csv"),Ye=(b,t)=>t("excel"),je=(b,t)=>t("json"),Ge=P('<div class="space-y-1 p-1"><button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as CSV</span></div></button> <button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as Excel</span></div></button> <button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as JSON</span></div></button></div>'),Ie=P('<div class="flex-1 flex justify-center items-center"><div class="text-center"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div> <p class="text-gray-500 dark:text-gray-400">Switching control set...</p></div></div>'),Ze=P('<div class="flex-1 flex justify-center items-center"><div class="text-center"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div> <p class="text-gray-500 dark:text-gray-400"> </p></div></div>'),Je=P('<header class="bg-white dark:bg-gray-900 shadow-sm border-b border-gray-200 dark:border-gray-700 flex-shrink-0"><div class="w-full px-6 lg:px-8"><div class="flex justify-between items-center h-16"><div class="flex items-center"><a href="/" class="flex items-center space-x-3 hover:opacity-80 transition-opacity"><img src="/lula.png" class="h-8 w-8" alt="Lula Logo"/> <div class="flex flex-col"><span class="text-xl font-bold text-gray-900 dark:text-white">Lula</span> <span class="text-xs text-gray-500 dark:text-gray-400 -mt-1">Gitops for Compliance</span></div></a></div> <div class="flex items-center space-x-4"><!> <!> <a class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors" title="Github" href="https://github.com/defenseunicorns/lula" target="_blank"><!></a></div></div></div></header> <div class="flex-1 flex gap-6 p-6 overflow-hidden"><!></div>',1),Ue=P('<div class="h-screen flex flex-col"><!></div>');function et(b,t){R(t,!0);const e=()=>te(_e,"$page",o),l=()=>te(ce,"$appState",o),[o,g]=de();let f=!1;async function r(a){try{const c=`/api/export-controls?format=${a}`,h=document.createElement("a");h.href=c,h.download="",document.body.appendChild(h),h.click(),document.body.removeChild(h)}catch(c){console.error("Export failed:",c)}}xe(()=>{q.connect();let a=null;const c=async()=>{if(f||e().url.pathname==="/setup"||l().isSwitchingControlSet)return;const h=l();if(h.isConnected){if(f=!0,(!h.name||h.name==="Unknown Control Set"||h.id==="unknown"||h.id==="default")&&(!h.controls||h.controls.length===0)){await q.scanControlSets();const E=await new Promise(G=>{const T=O=>{window.removeEventListener("control-sets-list",T),G(O.detail)};window.addEventListener("control-sets-list",T),setTimeout(()=>{window.removeEventListener("control-sets-list",T),G(null)},2e3)});E&&Array.isArray(E)&&E.length===1?(console.log("Auto-loading single control set:",E[0].path),await q.switchControlSet(E[0].path)):me("/setup")}}else a=window.setTimeout(c,500)};return a=window.setTimeout(c,100),()=>{a&&clearTimeout(a)}}),be(()=>{q.disconnect()});var s=Ue(),p=i(s);{var x=a=>{var c=Je(),h=U(c),E=i(h),G=i(E),T=V(i(G),2),O=i(T);Me(O,{});var ae=V(O,2);{var ve=_=>{we(_,{buttonLabel:"Export",get buttonIcon(){return ne},buttonClass:"inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors",dropdownClass:"w-48",children:W=>{var Z=Ge(),B=i(Z);B.__click=[De,r];var S=i(B),H=i(S);Ve(H,{class:"w-4 h-4"}),A(2),n(S),n(B);var L=V(B,2);L.__click=[Ye,r];var J=i(L),X=i(J);ne(X,{class:"w-4 h-4"}),A(2),n(J),n(L);var ee=V(L,2);ee.__click=[je,r];var oe=i(ee),pe=i(oe);Ae(pe,{class:"w-4 h-4"}),A(2),n(oe),n(ee),n(Z),v(W,Z)},$$slots:{default:!0}})};w(ae,_=>{l().isConnected&&l().controls&&l().controls.length>0&&_(ve)})}var re=V(ae,2),ue=i(re);Be(ue,{class:"w-5 h-5"}),n(re),n(T),n(G),n(E),n(h);var se=V(h,2),ge=i(se);{var fe=_=>{var I=Ie();v(_,I)},he=_=>{var I=Q(),W=U(I);{var Z=S=>{var H=Ze(),L=i(H),J=V(i(L),2),X=i(J,!0);n(J),n(L),n(H),D(()=>Y(X,l().isConnected?l().fieldSchema?"Loading controls...":"Loading schema...":"Connecting...")),v(S,H)},B=S=>{var H=Q(),L=U(H);ie(L,()=>t.children),v(S,H)};w(W,S=>{!l().isConnected||!l().controls||l().controls.length===0||!l().fieldSchema?S(Z):S(B,!1)},!0)}v(_,I)};w(ge,_=>{l().isSwitchingControlSet?_(fe):_(he,!1)})}n(se),v(a,c)},d=a=>{var c=Q(),h=U(c);ie(h,()=>t.children),v(a,c)};w(p,a=>{e().url.pathname!=="/setup"?a(x):a(d,!1)})}n(s),v(b,s),N(),g()}le(["click"]);export{et as component};
|
|
1
|
+
import"../chunks/DsnmJJEf.js";import{at as le,p as R,ae as y,d as k,T as $,G as m,h as u,af as F,ag as M,c as i,n as A,r as n,b as v,e as N,J as D,K as Y,ak as Q,a as U,f as P,o as xe,au as be,s as V,av as ie}from"../chunks/Cby0Z7eP.js";import{l as z,p as C,i as w,a as te,s as de}from"../chunks/DqsOU3kV.js";import{g as me}from"../chunks/Dacgmabg.js";import{p as _e,D as we}from"../chunks/Ca3ZVyCu.js";import{i as j}from"../chunks/C5zWTfmV.js";import{a as K,f as ce,w as q}from"../chunks/BtOhWAVU.js";le(["change"]);var ye=M("<title> </title>"),ke=M('<svg><!><path d="M11.41 26.59L7.83 23 28 23 28 21 7.83 21 11.41 17.41 10 16 4 22 10 28 11.41 26.59zM28 10L22 4 20.59 5.41 24.17 9 4 9 4 11 24.17 11 20.59 14.59 22 16 28 10z"></path></svg>');function $e(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),j();var s=ke();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=ye(),c=i(a,!0);n(a),D(()=>Y(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(),n(s),v(b,s),N()}var ze=P('<a href="/setup" class="inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors" title="Switch control set"><!> Switch</a>'),Ce=P('<div class="text-sm text-gray-500 dark:text-gray-400">Loading...</div>');function Me(b,t){R(t,!1);const e=()=>te(ce,"$appState",l),[l,o]=de();j();var g=Q(),f=U(g);{var r=p=>{var x=ze(),d=i(x);$e(d,{size:16}),A(),n(x),v(p,x)},s=p=>{var x=Ce();v(p,x)};w(f,p=>{e().isConnected?p(r):p(s,!1)})}v(b,g),N(),o()}var Se=M("<title> </title>"),Le=M('<svg><!><path d="M31 16L24 23 22.59 21.59 28.17 16 22.59 10.41 24 9 31 16zM1 16L8 9 9.41 10.41 3.83 16 9.41 21.59 8 23 1 16z"></path><path d="M5.91 15H26.080000000000002V17H5.91z" transform="rotate(-75 15.996 16)"></path></svg>');function Ae(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),j();var s=Le();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Se(),c=i(a,!0);n(a),D(()=>Y(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(2),n(s),v(b,s),N()}var Ee=M("<title> </title>"),He=M('<svg><!><path d="M13 21L26.17 21 23.59 23.59 25 25 30 20 25 15 23.59 16.41 26.17 19 13 19 13 21z"></path><path d="M22,14V10a1,1,0,0,0-.29-.71l-7-7A1,1,0,0,0,14,2H4A2,2,0,0,0,2,4V28a2,2,0,0,0,2,2H20a2,2,0,0,0,2-2V26H20v2H4V4h8v6a2,2,0,0,0,2,2h6v2Zm-8-4V4.41L19.59,10Z"></path></svg>');function Ve(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),j();var s=He();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Ee(),c=i(a,!0);n(a),D(()=>Y(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(2),n(s),v(b,s),N()}var Re=M("<title> </title>"),Ne=M('<svg><!><path d="M26 24v4H6V24H4v4H4a2 2 0 002 2H26a2 2 0 002-2h0V24zM26 14L24.59 12.59 17 20.17 17 2 15 2 15 20.17 7.41 12.59 6 14 16 24 26 14z"></path></svg>');function ne(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),j();var s=Ne();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Re(),c=i(a,!0);n(a),D(()=>Y(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(),n(s),v(b,s),N()}var Pe=M("<title> </title>"),Te=M('<svg><!><path fill-rule="evenodd" d="M16,2a14,14,0,0,0-4.43,27.28c.7.13,1-.3,1-.67s0-1.21,0-2.38c-3.89.84-4.71-1.88-4.71-1.88A3.71,3.71,0,0,0,6.24,22.3c-1.27-.86.1-.85.1-.85A2.94,2.94,0,0,1,8.48,22.9a3,3,0,0,0,4.08,1.16,2.93,2.93,0,0,1,.88-1.87c-3.1-.36-6.37-1.56-6.37-6.92a5.4,5.4,0,0,1,1.44-3.76,5,5,0,0,1,.14-3.7s1.17-.38,3.85,1.43a13.3,13.3,0,0,1,7,0c2.67-1.81,3.84-1.43,3.84-1.43a5,5,0,0,1,.14,3.7,5.4,5.4,0,0,1,1.44,3.76c0,5.38-3.27,6.56-6.39,6.91a3.33,3.33,0,0,1,.95,2.59c0,1.87,0,3.38,0,3.84s.25.81,1,.67A14,14,0,0,0,16,2Z"></path></svg>');function Be(b,t){const e=z(t,["children","$$slots","$$events","$$legacy"]),l=z(e,["size","title"]);R(t,!1);const o=$(),g=$();let f=C(t,"size",8,16),r=C(t,"title",8,void 0);y(()=>(m(e),m(r())),()=>{k(o,e["aria-label"]||e["aria-labelledby"]||r())}),y(()=>(u(o),m(e)),()=>{k(g,{"aria-hidden":u(o)?void 0:!0,role:u(o)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),F(),j();var s=Te();K(s,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...u(g),...l}));var p=i(s);{var x=d=>{var a=Pe(),c=i(a,!0);n(a),D(()=>Y(c,r())),v(d,a)};w(p,d=>{r()&&d(x)})}A(),n(s),v(b,s),N()}var De=(b,t)=>t("csv"),Ye=(b,t)=>t("excel"),je=(b,t)=>t("json"),Ge=P('<div class="space-y-1 p-1"><button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as CSV</span></div></button> <button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as Excel</span></div></button> <button class="w-full text-left px-3 py-2 text-sm rounded-md transition-colors duration-200 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"><div class="flex items-center gap-2"><!> <span>Export as JSON</span></div></button></div>'),Ie=P('<div class="flex-1 flex justify-center items-center"><div class="text-center"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div> <p class="text-gray-500 dark:text-gray-400">Switching control set...</p></div></div>'),Ze=P('<div class="flex-1 flex justify-center items-center"><div class="text-center"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div> <p class="text-gray-500 dark:text-gray-400"> </p></div></div>'),Je=P('<header class="bg-white dark:bg-gray-900 shadow-sm border-b border-gray-200 dark:border-gray-700 flex-shrink-0"><div class="w-full px-6 lg:px-8"><div class="flex justify-between items-center h-16"><div class="flex items-center"><a href="/" class="flex items-center space-x-3 hover:opacity-80 transition-opacity"><img src="/lula.png" class="h-8 w-8" alt="Lula Logo"/> <div class="flex flex-col"><span class="text-xl font-bold text-gray-900 dark:text-white">Lula</span> <span class="text-xs text-gray-500 dark:text-gray-400 -mt-1">Gitops for Compliance</span></div></a></div> <div class="flex items-center space-x-4"><!> <!> <a class="p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors" title="Github" href="https://github.com/defenseunicorns/lula" target="_blank"><!></a></div></div></div></header> <div class="flex-1 flex gap-6 p-6 overflow-hidden"><!></div>',1),Ue=P('<div class="h-screen flex flex-col"><!></div>');function et(b,t){R(t,!0);const e=()=>te(_e,"$page",o),l=()=>te(ce,"$appState",o),[o,g]=de();let f=!1;async function r(a){try{const c=`/api/export-controls?format=${a}`,h=document.createElement("a");h.href=c,h.download="",document.body.appendChild(h),h.click(),document.body.removeChild(h)}catch(c){console.error("Export failed:",c)}}xe(()=>{q.connect();let a=null;const c=async()=>{if(f||e().url.pathname==="/setup"||l().isSwitchingControlSet)return;const h=l();if(h.isConnected){if(f=!0,(!h.name||h.name==="Unknown Control Set"||h.id==="unknown"||h.id==="default")&&(!h.controls||h.controls.length===0)){await q.scanControlSets();const E=await new Promise(G=>{const T=O=>{window.removeEventListener("control-sets-list",T),G(O.detail)};window.addEventListener("control-sets-list",T),setTimeout(()=>{window.removeEventListener("control-sets-list",T),G(null)},2e3)});E&&Array.isArray(E)&&E.length===1?(console.log("Auto-loading single control set:",E[0].path),await q.switchControlSet(E[0].path)):me("/setup")}}else a=window.setTimeout(c,500)};return a=window.setTimeout(c,100),()=>{a&&clearTimeout(a)}}),be(()=>{q.disconnect()});var s=Ue(),p=i(s);{var x=a=>{var c=Je(),h=U(c),E=i(h),G=i(E),T=V(i(G),2),O=i(T);Me(O,{});var ae=V(O,2);{var ve=_=>{we(_,{buttonLabel:"Export",get buttonIcon(){return ne},buttonClass:"inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors",dropdownClass:"w-48",children:W=>{var Z=Ge(),B=i(Z);B.__click=[De,r];var S=i(B),H=i(S);Ve(H,{class:"w-4 h-4"}),A(2),n(S),n(B);var L=V(B,2);L.__click=[Ye,r];var J=i(L),X=i(J);ne(X,{class:"w-4 h-4"}),A(2),n(J),n(L);var ee=V(L,2);ee.__click=[je,r];var oe=i(ee),pe=i(oe);Ae(pe,{class:"w-4 h-4"}),A(2),n(oe),n(ee),n(Z),v(W,Z)},$$slots:{default:!0}})};w(ae,_=>{l().isConnected&&l().controls&&l().controls.length>0&&_(ve)})}var re=V(ae,2),ue=i(re);Be(ue,{class:"w-5 h-5"}),n(re),n(T),n(G),n(E),n(h);var se=V(h,2),ge=i(se);{var fe=_=>{var I=Ie();v(_,I)},he=_=>{var I=Q(),W=U(I);{var Z=S=>{var H=Ze(),L=i(H),J=V(i(L),2),X=i(J,!0);n(J),n(L),n(H),D(()=>Y(X,l().isConnected?l().fieldSchema?"Loading controls...":"Loading schema...":"Connecting...")),v(S,H)},B=S=>{var H=Q(),L=U(H);ie(L,()=>t.children),v(S,H)};w(W,S=>{!l().isConnected||!l().controls||l().controls.length===0||!l().fieldSchema?S(Z):S(B,!1)},!0)}v(_,I)};w(ge,_=>{l().isSwitchingControlSet?_(fe):_(he,!1)})}n(se),v(a,c)},d=a=>{var c=Q(),h=U(c);ie(h,()=>t.children),v(a,c)};w(p,a=>{e().url.pathname!=="/setup"?a(x):a(d,!1)})}n(s),v(b,s),N(),g()}le(["click"]);export{et as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/DsnmJJEf.js";import{i as u}from"../chunks/C5zWTfmV.js";import{p as h,f as g,a as l,J as v,b as d,e as _,c as s,r as a,s as x,K as o}from"../chunks/Cby0Z7eP.js";import{s as $,p}from"../chunks/
|
|
1
|
+
import"../chunks/DsnmJJEf.js";import{i as u}from"../chunks/C5zWTfmV.js";import{p as h,f as g,a as l,J as v,b as d,e as _,c as s,r as a,s as x,K as o}from"../chunks/Cby0Z7eP.js";import{s as $,p}from"../chunks/Dacgmabg.js";const b={get error(){return p.error},get status(){return p.status}};$.updated.check;const i=b;var k=g("<h1> </h1> <p> </p>",1);function q(m,c){h(c,!1),u();var t=k(),r=l(t),n=s(r,!0);a(r);var e=x(r,2),f=s(e,!0);a(e),v(()=>{o(n,i.status),o(f,i.error?.message)}),d(m,t),_()}export{q as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/DsnmJJEf.js";import"../chunks/C5zWTfmV.js";import{f,a as y,b as n,c as t,r,s as w,n as C}from"../chunks/Cby0Z7eP.js";import{i as k,s as $,a as D}from"../chunks/DqsOU3kV.js";import{C as S,a as j,D as L}from"../chunks/
|
|
1
|
+
import"../chunks/DsnmJJEf.js";import"../chunks/C5zWTfmV.js";import{f,a as y,b as n,c as t,r,s as w,n as C}from"../chunks/Cby0Z7eP.js";import{i as k,s as $,a as D}from"../chunks/DqsOU3kV.js";import{C as S,a as j,D as L}from"../chunks/CKNf7CSU.js";import{s as N}from"../chunks/Ca3ZVyCu.js";var P=f('<div class=" h-full flex flex-col"><div class="flex-1 flex items-center justify-center p-8"><div class="text-center text-gray-500 dark:text-gray-400"><!> <h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">No Control Selected</h3> <p class="text-gray-600 dark:text-gray-400">Select a control from the list to view and edit its details</p></div></div></div>'),q=f('<div class="w-1/2 flex flex-col"><div class="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm h-full flex flex-col"><!></div></div> <div class="w-1/2 flex flex-col"><!></div>',1);function H(m){const o=()=>D(N,"$selectedControl",x),[x,g]=$();var l=q(),a=y(l),i=t(a),p=t(i);S(p,{}),r(i),r(a);var d=w(a,2),_=t(d);{var h=e=>{j(e,{get control(){return o()}})},b=e=>{var s=P(),c=t(s),v=t(c),u=t(v);L(u,{class:"mx-auto h-16 w-16 mb-4"}),C(4),r(v),r(c),r(s),n(e,s)};k(_,e=>{o()?e(h):e(b,!1)})}r(d),n(m,l),g()}export{H as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/DsnmJJEf.js";import{p as S,u as A,d as x,o as B,f as n,a as F,b as i,e as H,c as s,g as N,r as a,s as h,h as P,n as R}from"../chunks/Cby0Z7eP.js";import{a as C,i as b,s as U}from"../chunks/DqsOU3kV.js";import{g as V}from"../chunks/
|
|
1
|
+
import"../chunks/DsnmJJEf.js";import{p as S,u as A,d as x,o as B,f as n,a as F,b as i,e as H,c as s,g as N,r as a,s as h,h as P,n as R}from"../chunks/Cby0Z7eP.js";import{a as C,i as b,s as U}from"../chunks/DqsOU3kV.js";import{g as V}from"../chunks/Dacgmabg.js";import{p as q,s as _}from"../chunks/Ca3ZVyCu.js";import{C as G,a as J,D as K}from"../chunks/CKNf7CSU.js";import{w}from"../chunks/BtOhWAVU.js";var O=n('<div class="absolute top-4 right-4 z-10"><div class="w-8 h-8 flex items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900/30" title="Loading control..."><svg class="w-5 h-5 text-blue-600 dark:text-blue-400 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg></div></div>'),Q=n('<div class=" h-full flex flex-col"><div class="flex-1 flex items-center justify-center p-8"><div class="text-center text-gray-500 dark:text-gray-400"><!> <h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">No Control Selected</h3> <p class="text-gray-600 dark:text-gray-400">Select a control from the list to view and edit its details</p></div></div></div>'),T=n('<div class="w-1/2 flex flex-col"><div class="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm h-full flex flex-col"><!></div></div> <div class="w-1/2 flex flex-col relative"><!> <!></div>',1);function se(y,k){S(k,!0);const $=()=>C(q,"$page",c),d=()=>C(_,"$selectedControl",c),[c,D]=U();let v="",r=N(!1);A(()=>{const e=$().params.id;if(!e)return;const t=decodeURIComponent(e);t&&t!==v&&w.isConnected()&&(v=t,x(r,!0),w.getControlDetails(t))}),B(()=>{const e=t=>{const o=t.detail;x(r,!1),o?_.set(o):V("/")};return window.addEventListener("control-details",e),()=>{window.removeEventListener("control-details",e)}});var f=T(),l=F(f),p=s(l),L=s(p);G(L,{}),a(p),a(l);var g=h(l,2),m=s(g);{var I=e=>{var t=O();i(e,t)};b(m,e=>{P(r)&&e(I)})}var z=h(m,2);{var j=e=>{J(e,{get control(){return d()}})},E=e=>{var t=Q(),o=s(t),u=s(o),M=s(u);K(M,{class:"mx-auto h-16 w-16 mb-4"}),R(4),a(u),a(o),a(t),i(e,t)};b(z,e=>{d()?e(j):e(E,!1)})}a(g),i(y,f),H(),D()}export{se as component};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import"../chunks/DsnmJJEf.js";import{i as Ye}from"../chunks/C5zWTfmV.js";import{p as We,ae as Oe,d as o,T as C,G as se,h as e,af as nr,ag as Be,c as a,n as Me,r,b as v,e as Xe,J as H,K as I,ah as Nr,f as y,s as i,k as _,ai as g,a as we,aj as wr,ak as Fe,a0 as Ae,al as kr,am as sr,an as Cr,o as lt,W as st}from"../chunks/Cby0Z7eP.js";import{l as ir,p as Je,i as A,a as it,s as nt}from"../chunks/DqsOU3kV.js";import{a as Br,s as le,r as jr,e as me,i as De,b as Ne,c as Lr,d as Sr,f as Dr,w as $r}from"../chunks/BtOhWAVU.js";import{g as dt}from"../chunks/Dacgmabg.js";var vt=Be("<title> </title>"),gt=Be('<svg><!><path d="M11 18L12.41 19.41 15 16.83 15 29 17 29 17 16.83 19.59 19.41 21 18 16 13 11 18z"></path><path d="M23.5,22H23V20h.5a4.5,4.5,0,0,0,.36-9L23,11l-.1-.82a7,7,0,0,0-13.88,0L9,11,8.14,11a4.5,4.5,0,0,0,.36,9H9v2H8.5A6.5,6.5,0,0,1,7.2,9.14a9,9,0,0,1,17.6,0A6.5,6.5,0,0,1,23.5,22Z"></path></svg>');function ct(he,G){const E=ir(G,["children","$$slots","$$events","$$legacy"]),de=ir(E,["size","title"]);We(G,!1);const T=C(),V=C();let B=Je(G,"size",8,16),w=Je(G,"title",8,void 0);Oe(()=>(se(E),se(w())),()=>{o(T,E["aria-label"]||E["aria-labelledby"]||w())}),Oe(()=>(e(T),se(E)),()=>{o(V,{"aria-hidden":e(T)?void 0:!0,role:e(T)?"img":void 0,focusable:Number(E.tabindex)===0?!0:void 0})}),nr(),Ye();var h=gt();Br(h,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:B(),height:B(),...e(V),...de}));var S=a(h);{var be=J=>{var F=vt(),c=a(F,!0);r(F),H(()=>I(c,w())),v(J,F)};A(S,J=>{w()&&J(be)})}Me(2),r(h),v(he,h),Xe()}var pt=Be("<title> </title>"),ut=Be('<svg><!><path d="M10 6H14V10H10zM18 6H22V10H18zM10 14H14V18H10zM18 14H22V18H18zM10 22H14V26H10zM18 22H22V26H18z"></path></svg>');function lr(he,G){const E=ir(G,["children","$$slots","$$events","$$legacy"]),de=ir(E,["size","title"]);We(G,!1);const T=C(),V=C();let B=Je(G,"size",8,16),w=Je(G,"title",8,void 0);Oe(()=>(se(E),se(w())),()=>{o(T,E["aria-label"]||E["aria-labelledby"]||w())}),Oe(()=>(e(T),se(E)),()=>{o(V,{"aria-hidden":e(T)?void 0:!0,role:e(T)?"img":void 0,focusable:Number(E.tabindex)===0?!0:void 0})}),nr(),Ye();var h=ut();Br(h,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:B(),height:B(),...e(V),...de}));var S=a(h);{var be=J=>{var F=pt(),c=a(F,!0);r(F),H(()=>I(c,w())),v(J,F)};A(S,J=>{w()&&J(be)})}Me(),r(h),v(he,h),Xe()}var bt=y('<div class="p-4 text-sm text-blue-800 rounded-lg bg-blue-50 dark:bg-gray-800 dark:text-blue-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <div><span class="font-medium">File loaded:</span> <div class="mt-1"><span class="font-medium">Sheets:</span> <span class="font-medium">Fields:</span> <span class="font-medium">Controls found:</span> </div></div></div></div>'),ft=y('<div class="p-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <span> </span></div></div>'),xt=y('<div class="p-4 text-sm text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <span> </span></div></div>'),mt=y("<option> </option>"),ht=y("<option> </option>"),yt=y("<option> </option>"),_t=y('<span class="ml-auto text-xs text-blue-600 dark:text-blue-400">ID</span>'),wt=y('<div draggable="true" role="button" tabindex="0" class="flex items-center px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 rounded text-sm cursor-move hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors opacity-75"><svg class="w-3 h-3 mr-2 flex-shrink-0" fill="currentColor" viewBox="0 0 20 20"><path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"></path></svg> <span class="truncate line-through"> </span> <!></div>'),kt=y('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">No excluded fields</p>'),Ct=y('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),St=y('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),$t=y('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),Dt=y('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),Mt=y('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),zt=y('<div role="region" aria-label="Justification field drop zone"><p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p></div>'),At=y('<div draggable="true" role="button" tabindex="0"><!> <span class="truncate"> </span></div>'),Ft=y('<p class="text-xs text-gray-400 dark:text-gray-500 text-center py-4">Drop fields here</p>'),Ot=y('<th class="px-4 py-2"> </th>'),Ht=y('<td class="px-4 py-2"> </td>'),Pt=y('<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700"></tr>'),Et=y('<div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Sample Data Preview</h3> <div class="overflow-x-auto"><table class="w-full text-sm text-left text-gray-500 dark:text-gray-400"><thead class="text-xs text-gray-700 uppercase bg-gray-100 dark:bg-gray-600 dark:text-gray-400"><tr></tr></thead><tbody></tbody></table></div></div>'),It=y('<span class="flex items-center"><svg class="animate-spin -ml-1 mr-3 h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Importing...</span>'),Tt=y(`<div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">Import Options</h3> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4"><div><label for="controlSetName" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Control Set Name <span class="text-red-500">*</span></label> <input type="text" id="controlSetName" placeholder="e.g., NIST 800-53 Rev 4" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white" required/> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">This will be used as the display name and folder name</p></div> <div><label for="controlSetDescription" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Description</label> <input type="text" id="controlSetDescription" placeholder="Optional description" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"/> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Brief description of this control set</p></div></div> <div class="grid grid-cols-1 md:grid-cols-2 gap-4"><div><label for="sheet" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Sheet</label> <select id="sheet" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Select which worksheet contains your control data</p></div> <div><label for="headerRow" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Select Header Row</label> <select id="headerRow" class="bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white"></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Select the row containing column headers</p></div> <div><label for="controlIdField" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Control ID Field <span class="text-red-500">*</span></label> <select id="controlIdField" required><option disabled>Select Control ID field</option><!></select> <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Column containing unique control identifiers (e.g., AC-1, SC-7)</p></div></div></div> <div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-700"><h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">Organize Fields</h3> <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">Drag fields to organize them. <strong>Overview fields</strong> will appear as table columns in
|
|
2
|
+
the controls list.</p> <div class="grid grid-cols-1 lg:grid-cols-5 gap-4"><div class="border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700 rounded-t-lg"><h4 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Excluded Fields</h4> <p class="text-xs text-gray-500 dark:text-gray-400 mt-1">Not imported</p></div> <div role="region" aria-label="Excluded fields drop zone"><!> <!></div></div> <div class="border border-blue-300 dark:border-blue-700 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/20 rounded-t-lg"><h4 class="text-sm font-semibold text-blue-700 dark:text-blue-300">Overview Tab</h4> <p class="text-xs text-blue-600 dark:text-blue-400 mt-1">Shows in details & table columns</p></div> <div role="region" aria-label="Overview tab drop zone"><!> <!></div></div> <div class="border border-green-300 dark:border-green-700 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-green-200 dark:border-green-800 bg-green-50 dark:bg-green-900/20 rounded-t-lg"><h4 class="text-sm font-semibold text-green-700 dark:text-green-300">Implementation Tab</h4> <p class="text-xs text-green-600 dark:text-green-400 mt-1">Status & compliance</p></div> <div role="region" aria-label="Implementation tab drop zone"><!> <!></div></div> <div class="border border-orange-300 dark:border-orange-700 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-orange-200 dark:border-orange-800 bg-orange-50 dark:bg-orange-900/20 rounded-t-lg"><h4 class="text-sm font-semibold text-orange-700 dark:text-orange-300">Mappings Tab</h4> <p class="text-xs text-orange-600 dark:text-orange-400 mt-1">Pre-populate justification for a control mapping</p></div> <div role="region" aria-label="Justifications tab drop zone"><div class="space-y-2"><!></div></div></div> <div class="border border-purple-300 dark:border-purple-700 rounded-lg bg-white dark:bg-gray-800"><div class="p-3 border-b border-purple-200 dark:border-purple-800 bg-purple-50 dark:bg-purple-900/20 rounded-t-lg"><h4 class="text-sm font-semibold text-purple-700 dark:text-purple-300">Custom Tab</h4> <p class="text-xs text-purple-600 dark:text-purple-400 mt-1">Additional fields</p></div> <div role="region" aria-label="Custom fields drop zone"><!> <!></div></div></div></div> <!> <div class="flex justify-center"><button class="px-5 py-2.5 text-white bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm disabled:opacity-50 disabled:cursor-not-allowed"><!></button></div>`,1),Vt=y('<div class="space-y-6"><div role="button" tabindex="0" class="relative"><label><div class="flex flex-col items-center justify-center pt-5 pb-6"><!> <p class="mb-2 text-sm text-gray-500 dark:text-gray-400"><span class="font-semibold">Click to upload</span> or drag and drop</p> <p class="text-xs text-gray-500 dark:text-gray-400">XLSX, XLS or CSV files</p></div> <input type="file" class="hidden" accept=".xlsx,.xls,.csv"/></label></div> <!> <!> <!> <!></div>');function jt(he,G){We(G,!1);const E=C(),de=Nr();let T=C(null),V=C(""),B=C(""),w=C([]),h=C([]),S=C([]),be=C(0),J=C([]),F=C([]),c=C(new Map),fe=C(1),R=C(""),Z=C(""),ie=C(""),Q=C(!1),ne=C(""),xe=C(""),ve=C(!1),ge=C(!1),$=C(null),W=C(null),ee=C(null);function u(){o(h,[]),o(S,[]),o(be,0),e(c).clear(),o(c,new Map),o(F,[]),o(R,""),o(ne,""),o(xe,""),o($,null),o(W,null),o(ee,null)}function b(l){l.preventDefault(),o(ge,!0)}function D(){o(ge,!1)}function L(l){l.preventDefault(),o(ge,!1);const n=l.dataTransfer?.files;n&&n.length>0&&Y(n[0])}function j(l){const n=l.target;n.files&&n.files.length>0&&Y(n.files[0])}async function Y(l){u(),o(V,l.name),o(T,l),o(ne,""),o(Q,!0),o(Z,e(V).replace(/\.[^.]+$/,"").replace(/[-_]/g," ")),o(ie,`Imported from ${e(V)}`);try{const n=new FormData;n.append("file",l);const z=await fetch("/api/parse-excel",{method:"POST",body:n});if(!z.ok){const x=await z.json();throw new Error(x.error||"Failed to parse file")}const k=await z.json();o(w,k.sheets||[]),o(B,k.selectedSheet||e(w)[0]),o(J,k.rowPreviews||[]),e(J).length>0&&e(fe)===1&&o(fe,e(J)[0].row),await ce(),o(ve,!0)}catch(n){o(ne,"Error reading file: "+n.message)}finally{o(Q,!1)}}async function ce(){if(!(!e(T)||!e(B))){o(Q,!0),e(c).clear(),o(c,new Map),o(R,"");try{const l=new FormData;l.append("file",e(T)),l.append("sheetName",e(B)),l.append("headerRow",e(fe).toString());const n=await fetch("/api/parse-excel-sheet",{method:"POST",body:l});if(!n.ok){const k=await n.json();throw new Error(k.error||"Failed to parse sheet")}const z=await n.json();if(o(h,z.fields||[]),o(S,z.sampleData||[]),o(be,z.controlCount||0),e(h).forEach((k,x)=>{const p=k.toLowerCase();let N="custom",q="text";p.includes("implementation")||p.includes("status")||p.includes("narrative")||p.includes("guidance")?N="implementation":(p.includes("id")||p.includes("title")||p.includes("family")||p.includes("cci")||p.includes("control")||p.includes("acronym"))&&(N="overview"),p.includes("description")||p.includes("narrative")||p.includes("guidance")||p.includes("statement")?q="textarea":p.includes("status")||p.includes("type")||p.includes("designation")?q="select":p.includes("date")?q="date":(p.includes("count")||p.includes("number"))&&(q="number"),e(c).set(k,{originalName:k,tab:N,displayOrder:x,fieldType:q,required:p.includes("id")||p.includes("title")})}),o(c,e(c)),e(R)&&!e(h).includes(e(R))&&o(R,""),!e(R)&&e(h).includes("AP Acronym")){const k=!e(S).length||e(S).every(te=>!te["AP Acronym"]||String(te["AP Acronym"]).length<25),x=e(S).map(te=>te["AP Acronym"]).filter(te=>te!=null&&te!==""&&String(te).trim()!==""),p=new Set(x),N=!x.length||p.size===x.length,q=x.length>0;k&&N&&q&&o(R,"AP Acronym")}}catch(l){o(ne,"Error loading sheet data: "+l.message)}finally{o(Q,!1)}}}function He(l){if(!l)return l;let n=l.trim().replace(/\r?\n/g," ").replace(/\s+/g," ").trim();return ze(n)}function ze(l){return l.replace(/\W+/g," ").split(/ |\s/).map(n=>n.toLowerCase()).join("-")}function re(l,n){o($,n),l.dataTransfer&&(l.dataTransfer.effectAllowed="move",l.dataTransfer.setData("text/plain",n))}function M(){o($,null),o(W,null),o(ee,null)}function pe(l,n){l.preventDefault(),o(W,n),l.dataTransfer&&(l.dataTransfer.dropEffect="move")}function ue(){o(W,null)}function ye(l,n,z){if(l.preventDefault(),e($)&&e(c).has(e($))){const k=e(c).get(e($));if(k.tab==="mappings"&&n!=="mappings"&&o(F,e(F).filter(x=>x!==e($))),n==="mappings"&&!e(F).includes(e($))&&o(F,[...e(F),e($)]),k.tab=n,z!==void 0&&n!==null){const p=Array.from(e(c).entries()).filter(([N,q])=>q.tab===n).sort((N,q)=>N[1].displayOrder-q[1].displayOrder).filter(([N])=>N!==e($));p.splice(z,0,[e($),k]),p.forEach(([N,q],te)=>{q.displayOrder=te,e(c).set(N,q)})}else if(n!==null){const x=Math.max(0,...Array.from(e(c).values()).filter(p=>p.tab===n).map(p=>p.displayOrder));k.displayOrder=x+1}e(c).set(e($),k),o(c,e(c))}o($,null),o(W,null)}function ke(l,n){l.preventDefault(),l.stopPropagation(),o(ee,n)}function Ce(){o(ee,null)}function Se(l,n,z){if(l.preventDefault(),l.stopPropagation(),e($)&&e($)!==n){const x=Array.from(e(c).entries()).filter(([p,N])=>N.tab===z).sort((p,N)=>p[1].displayOrder-N[1].displayOrder).findIndex(([p])=>p===n);x!==-1&&ye(l,z,x)}o(ee,null)}async function dr(){if(!(!e(T)||!e(V))){if(!e(R)){o(ne,"Please select a Control ID field before importing"),o(xe,"");return}if(!e(Z)||e(Z).trim()===""){o(ne,"Please enter a Control Set Name before importing"),o(xe,"");return}o(Q,!0),o(ne,""),o(xe,"");try{const l=new FormData;l.append("file",e(T),e(V)),l.append("controlIdField",e(R)),l.append("startRow",e(fe).toString()),l.append("namingConvention","kebab-case"),l.append("skipEmpty","true"),l.append("skipEmptyRows","true"),l.append("controlSetName",e(Z)||e(V).replace(/\.[^.]+$/,"")),l.append("controlSetDescription",e(ie)||`Imported from ${e(V)}`);const n=Array.from(e(c).entries()).filter(([x,p])=>p.tab!==null).map(([x,p])=>({fieldName:He(x),...p}));l.append("fieldSchema",JSON.stringify(n)),l.append("justificationFields",JSON.stringify(e(F).map(x=>He(x))));const z=await fetch("/api/import-spreadsheet",{method:"POST",body:l});if(!z.ok){const x=await z.json();throw new Error(x.error||"Import failed")}const k=await z.json();o(xe,`Successfully imported ${k.controlCount} controls into ${k.families.length} families`),de("created",{path:k.outputDir})}catch(l){o(ne,"Error importing spreadsheet: "+l.message)}finally{o(Q,!1)}}}Oe(()=>e(h),()=>{o(E,e(h).filter(l=>e(h).includes(l)))}),nr(),Ye();var Pe=Vt(),$e=a(Pe),Ee=a($e),Ze=a(Ee),Ke=a(Ze);ct(Ke,{class:"w-8 h-8 mb-4 text-gray-500 dark:text-gray-400"}),Me(4),r(Ze);var Re=i(Ze,2);r(Ee),r($e);var Ge=i($e,2);{var vr=l=>{var n=bt(),z=a(n),k=i(a(z),2),x=i(a(k)),p=i(x),N=i(a(p)),q=i(N,2),te=i(q,2);r(p),r(k),r(z),r(n),H(()=>{I(x,` ${e(V)??""} `),I(N,` ${e(w),_(()=>e(w).length)??""} | `),I(q,` ${e(h),_(()=>e(h).length)??""} | `),I(te,` ${e(be)??""}`)}),v(l,n)};A(Ge,l=>{e(V)&&l(vr)})}var Qe=i(Ge,2);{var er=l=>{var n=ft(),z=a(n),k=i(a(z),2),x=a(k,!0);r(k),r(z),r(n),H(()=>I(x,e(ne))),v(l,n)};A(Qe,l=>{e(ne)&&l(er)})}var rr=i(Qe,2);{var gr=l=>{var n=xt(),z=a(n),k=i(a(z),2),x=a(k,!0);r(k),r(z),r(n),H(()=>I(x,e(xe))),v(l,n)};A(rr,l=>{e(xe)&&l(gr)})}var cr=i(rr,2);{var X=l=>{var n=Tt(),z=we(n),k=i(a(z),2),x=a(k),p=i(a(x),2);jr(p),Me(2),r(x);var N=i(x,2),q=i(a(N),2);jr(q),Me(2),r(N),r(k);var te=i(k,2),pr=a(te),tr=i(a(pr),2);H(()=>{e(B),wr(()=>{e(w)})}),me(tr,5,()=>e(w),De,(t,s)=>{var f=mt(),m=a(f,!0);r(f);var d={};H(()=>{I(m,e(s)),d!==(d=e(s))&&(f.value=(f.__value=e(s))??"")}),v(t,f)}),r(tr),Me(2),r(pr);var ur=i(pr,2),ar=i(a(ur),2);H(()=>{e(fe),wr(()=>{e(J)})}),me(ar,5,()=>e(J),De,(t,s)=>{var f=ht(),m=a(f);r(f);var d={};H(()=>{I(m,`Row ${e(s),_(()=>e(s).row)??""}: ${e(s),_(()=>e(s).preview)??""}`),d!==(d=(e(s),_(()=>e(s).row)))&&(f.value=(f.__value=(e(s),_(()=>e(s).row)))??"")}),v(t,f)}),r(ar),Me(2),r(ur);var Mr=i(ur,2),or=i(a(Mr),2);H(()=>{e(R),wr(()=>{e(h),e(S)})});var br=a(or);br.value=br.__value="";var Zr=i(br);me(Zr,1,()=>e(h),De,(t,s)=>{const f=Ae(()=>(e(S),e(s),_(()=>e(S).length>0&&e(S)[0][e(s)]?String(e(S)[0][e(s)]).slice(0,30):""))),m=Ae(()=>(e(S),e(s),_(()=>!e(S).length||e(S).every(oe=>!oe[e(s)]||String(oe[e(s)]).length<25)))),d=Ae(()=>(e(S),e(s),_(()=>e(S).map(oe=>oe[e(s)]).filter(oe=>oe!=null&&oe!==""&&String(oe).trim()!=="")))),P=Ae(()=>new Set(e(d))),K=Ae(()=>(se(e(d)),se(e(P)),_(()=>!e(d).length||e(P).size===e(d).length))),U=Ae(()=>(se(e(d)),_(()=>e(d).length>0)));var O=Fe(),ae=we(O);{var Ue=oe=>{var _e=yt(),_r=a(_e);r(_e);var Vr={};H(()=>{I(_r,`${e(s)??""}${e(f)?` (e.g., ${e(f)})`:""}`),Vr!==(Vr=e(s))&&(_e.value=(_e.__value=e(s))??"")}),v(oe,_e)};A(ae,oe=>{e(m)&&e(K)&&e(U)&&oe(Ue)})}v(t,O)}),r(or),Me(2),r(Mr),r(te),r(z);var fr=i(z,2),zr=i(a(fr),4),xr=a(zr),Ie=i(a(xr),2),Ar=a(Ie);me(Ar,1,()=>(e(h),e(c),_(()=>e(h).filter(t=>!e(c).get(t)||e(c).get(t)?.tab===null))),t=>t,(t,s)=>{var f=wt(),m=i(a(f),2),d=a(m,!0);r(m);var P=i(m,2);{var K=U=>{var O=_t();v(U,O)};A(P,U=>{e(s)===e(R)&&U(K)})}r(f),H(()=>{Ne(f,"aria-label",`Drag ${e(s)??""} field`),I(d,e(s))}),g("dragstart",f,U=>re(U,e(s))),g("dragend",f,M),v(t,f)});var Rr=i(Ar,2);{var qr=t=>{var s=kt();v(t,s)};A(Rr,t=>{e(h),e(c),_(()=>e(h).filter(s=>!e(c).get(s)||e(c).get(s)?.tab===null).length===0)&&t(qr)})}r(Ie),r(xr);var mr=i(xr,2),Te=i(a(mr),2),Fr=a(Te);me(Fr,3,()=>(e(c),_(()=>Array.from(e(c).entries()).filter(([t,s])=>s.tab==="overview").sort((t,s)=>t[1].displayOrder-s[1].displayOrder))),([t,s])=>t,(t,s)=>{var f=kr(()=>Cr(e(s),2));let m=()=>e(f)[0];var d=Ct(),P=a(d);lr(P,{class:"w-3 h-3 mr-2 flex-shrink-0"});var K=i(P,2),U=a(K,!0);r(K),r(d),H(()=>{Ne(d,"aria-label",`${m()??""} field in Overview tab`),le(d,1,`flex items-center px-3 py-2 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300 rounded text-sm cursor-move hover:bg-blue-200 dark:hover:bg-blue-800/30 transition-colors
|
|
3
|
+
${e(ee)===m()&&e($)!==m()?"border-t-2 border-blue-500":""}`),I(U,m())}),g("dragstart",d,O=>re(O,m())),g("dragend",d,M),g("dragover",d,O=>ke(O,m())),g("dragleave",d,Ce),g("drop",d,O=>Se(O,m(),"overview")),v(t,d)});var Ur=i(Fr,2);{var Jr=t=>{var s=St();v(t,s)};A(Ur,t=>{e(c),_(()=>Array.from(e(c).entries()).filter(([s,f])=>f.tab==="overview").length===0)&&t(Jr)})}r(Te),r(mr);var hr=i(mr,2),Ve=i(a(hr),2),Or=a(Ve);me(Or,3,()=>(e(c),_(()=>Array.from(e(c).entries()).filter(([t,s])=>s.tab==="implementation").sort((t,s)=>t[1].displayOrder-s[1].displayOrder))),([t,s])=>t,(t,s)=>{var f=kr(()=>Cr(e(s),2));let m=()=>e(f)[0];var d=$t(),P=a(d);lr(P,{class:"w-3 h-3 mr-2 flex-shrink-0"});var K=i(P,2),U=a(K,!0);r(K),r(d),H(()=>{Ne(d,"aria-label",`${m()??""} field in Implementation tab`),le(d,1,`flex items-center px-3 py-2 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300 rounded text-sm cursor-move hover:bg-green-200 dark:hover:bg-green-800/30 transition-colors
|
|
4
|
+
${e(ee)===m()&&e($)!==m()?"border-t-2 border-green-500":""}`),I(U,m())}),g("dragstart",d,O=>re(O,m())),g("dragend",d,M),g("dragover",d,O=>ke(O,m())),g("dragleave",d,Ce),g("drop",d,O=>Se(O,m(),"implementation")),v(t,d)});var Yr=i(Or,2);{var Wr=t=>{var s=Dt();v(t,s)};A(Yr,t=>{e(c),_(()=>Array.from(e(c).entries()).filter(([s,f])=>f.tab==="implementation").length===0)&&t(Wr)})}r(Ve),r(hr);var yr=i(hr,2),je=i(a(yr),2),Hr=a(je),Xr=a(Hr);{var Kr=t=>{var s=Fe(),f=we(s);me(f,1,()=>e(F),De,(m,d)=>{var P=Mt(),K=a(P);lr(K,{class:"w-3 h-3 mr-2 flex-shrink-0"});var U=i(K,2),O=a(U,!0);r(U),r(P),H(()=>{Ne(P,"aria-label",`${e(d)??""} field in Mappings tab`),le(P,1,`flex items-center px-3 py-2 bg-orange-100 dark:bg-orange-900/30 text-orange-800 dark:text-orange-300 rounded text-sm cursor-move hover:bg-orange-200 dark:hover:bg-orange-800/30 transition-colors
|
|
5
|
+
${e(ee)===e(d)&&e($)!==e(d)?"border-t-2 border-orange-500":""}`),I(O,e(d))}),g("dragstart",P,ae=>re(ae,e(d))),g("dragend",P,M),g("dragover",P,ae=>ke(ae,e(d))),g("dragleave",P,Ce),g("drop",P,ae=>Se(ae,e(d),"mappings")),v(m,P)}),v(t,s)},Gr=t=>{var s=zt();H(()=>le(s,1,`p-4 transition-colors
|
|
6
|
+
${e(W)==="mappings"?"bg-orange-50 dark:bg-orange-900/10":""}`)),g("dragover",s,f=>{f.preventDefault(),pe(f,"mappings")}),g("dragleave",s,ue),g("drop",s,f=>{if(f.preventDefault(),e($)&&e(c).has(e($))){e(F).includes(e($))||o(F,[...e(F),e($)]);const m=e(c).get(e($));m.tab="mappings",e(c).set(e($),m),o(c,new Map(e(c))),o(W,null)}}),v(t,s)};A(Xr,t=>{e(F),_(()=>e(F).length>0)?t(Kr):t(Gr,!1)})}r(Hr),r(je),r(yr);var Pr=i(yr,2),Le=i(a(Pr),2),Er=a(Le);me(Er,3,()=>(e(c),_(()=>Array.from(e(c).entries()).filter(([t,s])=>s.tab==="custom").sort((t,s)=>t[1].displayOrder-s[1].displayOrder))),([t,s])=>t,(t,s)=>{var f=kr(()=>Cr(e(s),2));let m=()=>e(f)[0];var d=At(),P=a(d);lr(P,{class:"w-3 h-3 mr-2 flex-shrink-0"});var K=i(P,2),U=a(K,!0);r(K),r(d),H(()=>{Ne(d,"aria-label",`${m()??""} field in Custom tab`),le(d,1,`flex items-center px-3 py-2 bg-purple-100 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300 rounded text-sm cursor-move hover:bg-purple-200 dark:hover:bg-purple-800/30 transition-colors
|
|
7
|
+
${e(ee)===m()&&e($)!==m()?"border-t-2 border-purple-500":""}`),I(U,m())}),g("dragstart",d,O=>re(O,m())),g("dragend",d,M),g("dragover",d,O=>ke(O,m())),g("dragleave",d,Ce),g("drop",d,O=>Se(O,m(),"custom")),v(t,d)});var Qr=i(Er,2);{var et=t=>{var s=Ft();v(t,s)};A(Qr,t=>{e(c),_(()=>Array.from(e(c).entries()).filter(([s,f])=>f.tab==="custom").length===0)&&t(et)})}r(Le),r(Pr),r(zr),r(fr);var Ir=i(fr,2);{var rt=t=>{var s=Et(),f=i(a(s),2),m=a(f),d=a(m),P=a(d);me(P,5,()=>(e(h),_(()=>e(h).slice(0,5))),De,(U,O)=>{var ae=Ot(),Ue=a(ae,!0);r(ae),H(()=>I(Ue,e(O))),v(U,ae)}),r(P),r(d);var K=i(d);me(K,5,()=>e(S),De,(U,O)=>{var ae=Pt();me(ae,5,()=>(e(h),_(()=>e(h).slice(0,5))),De,(Ue,oe)=>{var _e=Ht(),_r=a(_e,!0);r(_e),H(()=>I(_r,(e(O),e(oe),_(()=>e(O)[e(oe)]||"")))),v(Ue,_e)}),r(ae),v(U,ae)}),r(K),r(m),r(f),r(s),v(t,s)};A(Ir,t=>{e(S),_(()=>e(S).length>0)&&t(rt)})}var Tr=i(Ir,2),qe=a(Tr),tt=a(qe);{var at=t=>{var s=It();v(t,s)},ot=t=>{var s=sr("Import to Control Set");v(t,s)};A(tt,t=>{e(Q)?t(at):t(ot,!1)})}r(qe),r(Tr),H(()=>{le(or,1,`bg-white border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:text-white ${e(R)?"":"border-red-500"}`),le(Ie,1,`p-3 min-h-[400px] max-h-[600px] overflow-y-auto space-y-2 transition-colors
|
|
8
|
+
${e(W)===null?"bg-gray-100 dark:bg-gray-800":""}`),le(Te,1,`p-3 min-h-[400px] max-h-[600px] overflow-y-auto space-y-2 transition-colors
|
|
9
|
+
${e(W)==="overview"?"bg-blue-50 dark:bg-blue-900/10":""}`),le(Ve,1,`p-3 min-h-[400px] max-h-[600px] overflow-y-auto space-y-2 transition-colors
|
|
10
|
+
${e(W)==="implementation"?"bg-green-50 dark:bg-green-900/10":""}`),le(je,1,`p-3 min-h-[400px] max-h-[600px] overflow-y-auto transition-colors
|
|
11
|
+
${e(W)==="mappings"?"bg-orange-50 dark:bg-orange-900/10":""}`),le(Le,1,`p-3 min-h-[400px] max-h-[600px] overflow-y-auto space-y-2 transition-colors
|
|
12
|
+
${e(W)==="custom"?"bg-purple-50 dark:bg-purple-900/10":""}`),qe.disabled=e(Q)||!e(T)||!e(R),Ne(qe,"title",e(R)?"":"Please select a Control ID field")}),Lr(p,()=>e(Z),t=>o(Z,t)),Lr(q,()=>e(ie),t=>o(ie,t)),Sr(tr,()=>e(B),t=>o(B,t)),g("change",tr,()=>{ce()}),Sr(ar,()=>e(fe),t=>o(fe,t)),g("change",ar,ce),Sr(or,()=>e(R),t=>o(R,t)),g("dragover",Ie,t=>pe(t,null)),g("dragleave",Ie,ue),g("drop",Ie,t=>ye(t,null)),g("dragover",Te,t=>pe(t,"overview")),g("dragleave",Te,ue),g("drop",Te,t=>ye(t,"overview")),g("dragover",Ve,t=>pe(t,"implementation")),g("dragleave",Ve,ue),g("drop",Ve,t=>ye(t,"implementation")),g("dragover",je,t=>pe(t,"mappings")),g("dragleave",je,ue),g("drop",je,t=>ye(t,"mappings")),g("dragover",Le,t=>pe(t,"custom")),g("dragleave",Le,ue),g("drop",Le,t=>ye(t,"custom")),g("click",qe,dr),v(l,n)};A(cr,l=>{e(ve),e(h),_(()=>e(ve)&&e(h).length>0)&&l(X)})}r(Pe),H(()=>le(Ee,1,`flex flex-col items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer transition-all duration-300 ${e(ge)?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`)),g("change",Re,j),g("dragover",$e,b),g("dragleave",$e,D),g("drop",$e,L),v(he,Pe),Xe()}var Lt=y('<span class="ml-2"> </span>'),Nt=y('<div class="text-sm text-gray-500 dark:text-gray-400"><span class="font-medium"> </span> <!></div>'),Bt=y('<div class="text-center space-y-6"><div class="p-6 bg-gradient-to-br from-green-50 to-emerald-50 dark:from-green-900/20 dark:to-emerald-900/20 rounded-lg border-2 border-green-500"><svg class="w-12 h-12 text-green-600 mx-auto mb-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"></path></svg> <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">Already Using Control Set</h3> <p class="text-gray-600 dark:text-gray-400 mb-4">You are already using the only available control set in this project.</p> <!></div> <div class="flex justify-center gap-4"><a href="/" class="px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors shadow-lg">Continue to Controls</a> <button class="px-6 py-3 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-900 dark:text-white font-medium rounded-lg transition-colors">Import New Control Set</button></div></div>'),Zt=y('<div class="p-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300"><div class="flex items-center"><svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path></svg> <span> </span></div></div>'),Rt=y('<p class="text-sm text-gray-600 dark:text-gray-400 mt-1"> </p>'),qt=y('<span class="text-xs text-gray-500 dark:text-gray-400"><svg class="inline w-3 h-3 mr-1" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z" clip-rule="evenodd"></path></svg> </span>'),Ut=y('<div class="flex flex-col items-center"><svg class="w-8 h-8 text-green-600" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"></path></svg> <span class="text-xs text-green-600 font-medium mt-1">Current</span></div>'),Jt=Be('<svg class="w-8 h-8 text-blue-600" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"></path></svg>'),Yt=Be('<svg class="w-8 h-8 text-gray-300 dark:text-gray-600" fill="none" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="9" stroke="currentColor" stroke-width="2"></circle></svg>'),Wt=y('<div role="button" tabindex="0"><div class="flex items-center justify-between"><div class="flex-1"><div class="flex items-center gap-3"><h3 class="text-lg font-semibold text-gray-900 dark:text-white"> </h3> <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200"> </span></div> <!> <div class="flex items-center gap-4 mt-2"><span class="text-xs text-gray-500 dark:text-gray-400"><svg class="inline w-3 h-3 mr-1" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M2 6a2 2 0 012-2h12a2 2 0 012 2v8a2 2 0 01-2 2H4a2 2 0 01-2-2V6zm2-1a1 1 0 00-1 1v8a1 1 0 001 1h12a1 1 0 001-1V6a1 1 0 00-1-1H4z" clip-rule="evenodd"></path></svg> </span> <!></div></div> <div class="flex items-center ml-4"><!></div></div></div>'),Xt=y('<div class="mt-6 flex justify-center"><button class="px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors shadow-lg">Use Selected Control Set</button></div>'),Kt=y('<div class="space-y-3"></div> <!>',1),Gt=y('<div class="space-y-6"><div class="text-center"><h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-2">Select an Existing Control Set</h2> <p class="text-gray-600 dark:text-gray-400">Choose from control sets found in your project directory</p></div> <!></div>');function Qt(he,G){We(G,!1);const E=()=>it(Dr,"$appState",de),[de,T]=nt(),V=C(),B=Nr();let w=Je(G,"controlSets",24,()=>[]),h=C(""),S=C(null);function be(Z){F(Z)||o(S,Z)}function J(){e(S)&&!F(e(S))&&B("selected",{path:e(S).path})}function F(Z){const ie=e(V)?.replace(/\/$/,""),Q=Z.path?.replace(/\/$/,"");return!!(ie&&Q&&ie===Q)}Oe(()=>E(),()=>{o(V,E().currentPath||"")}),Oe(()=>se(w()),()=>{if(w())if(w().length===0)o(h,"No existing control sets found. Try importing from a spreadsheet instead.");else{const Z=w().filter(ie=>!F(ie));Z.length===1?o(S,Z[0]):Z.length===0&&w().length>0&&o(h,"already-using-only-set")}}),nr(),Ye();var c=Gt(),fe=i(a(c),2);{var R=Z=>{var ie=Fe(),Q=we(ie);{var ne=ve=>{var ge=Bt(),$=a(ge),W=i(a($),6);{var ee=D=>{var L=Nt(),j=a(L),Y=a(j,!0);r(j);var ce=i(j,2);{var He=ze=>{var re=Lt(),M=a(re);r(re),H(()=>I(M,`(${se(w()),_(()=>w()[0].controlCount)??""} controls)`)),v(ze,re)};A(ce,ze=>{se(w()),_(()=>w()[0].controlCount)&&ze(He)})}r(L),H(()=>I(Y,(se(w()),_(()=>w()[0].name)))),v(D,L)};A(W,D=>{se(w()),_(()=>w().length>0)&&D(ee)})}r($);var u=i($,2),b=i(a(u),2);r(u),r(ge),g("click",b,()=>B("tab-change",{tab:"import"})),v(ve,ge)},xe=ve=>{var ge=Fe(),$=we(ge);{var W=u=>{var b=Zt(),D=a(b),L=i(a(D),2),j=a(L,!0);r(L),r(D),r(b),H(()=>I(j,e(h))),v(u,b)},ee=u=>{var b=Fe(),D=we(b);{var L=j=>{var Y=Kt(),ce=we(Y);me(ce,5,w,De,(re,M)=>{const pe=Ae(()=>(e(M),_(()=>F(e(M)))));var ue=Wt(),ye=a(ue),ke=a(ye),Ce=a(ke),Se=a(Ce),dr=a(Se,!0);r(Se);var Pe=i(Se,2),$e=a(Pe);r(Pe),r(Ce);var Ee=i(Ce,2);{var Ze=X=>{var l=Rt(),n=a(l,!0);r(l),H(()=>I(n,(e(M),_(()=>e(M).description)))),v(X,l)};A(Ee,X=>{e(M),_(()=>e(M).description)&&X(Ze)})}var Ke=i(Ee,2),Re=a(Ke),Ge=i(a(Re));r(Re);var vr=i(Re,2);{var Qe=X=>{var l=qt(),n=i(a(l));r(l),H(()=>I(n,` ${e(M),_(()=>e(M).file)??""}`)),v(X,l)};A(vr,X=>{e(M),_(()=>e(M).file)&&X(Qe)})}r(Ke),r(ke);var er=i(ke,2),rr=a(er);{var gr=X=>{var l=Ut();v(X,l)},cr=X=>{var l=Fe(),n=we(l);{var z=x=>{var p=Jt();v(x,p)},k=x=>{var p=Yt();v(x,p)};A(n,x=>{e(S)===e(M)?x(z):x(k,!1)},!0)}v(X,l)};A(rr,X=>{e(pe)?X(gr):X(cr,!1)})}r(er),r(ye),r(ue),H(()=>{le(ue,1,`p-4 bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg border-2 transition-all duration-200 ${e(pe)?"border-green-500 !bg-gradient-to-br from-green-50 to-emerald-50 dark:from-green-900/20 dark:to-emerald-900/20 cursor-not-allowed opacity-75":e(S)===e(M)?"border-blue-500 !bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 shadow-lg cursor-pointer":"border-gray-200 dark:border-gray-700 hover:border-blue-300 dark:hover:border-blue-700 hover:shadow-md cursor-pointer"}`),I(dr,(e(M),_(()=>e(M).name))),I($e,`${e(M),_(()=>e(M).controlCount||0)??""} controls`),I(Ge,` ${e(M),_(()=>e(M).path||"root")??""}`)}),g("click",ue,()=>!e(pe)&&be(e(M))),g("keydown",ue,X=>X.key==="Enter"&&!e(pe)&&be(e(M))),v(re,ue)}),r(ce);var He=i(ce,2);{var ze=re=>{var M=Xt(),pe=a(M);r(M),g("click",pe,J),v(re,M)};A(He,re=>{e(S)&&re(ze)})}v(j,Y)};A(D,j=>{se(w()),_(()=>w().length>0)&&j(L)},!0)}v(u,b)};A($,u=>{e(h)?u(W):u(ee,!1)},!0)}v(ve,ge)};A(Q,ve=>{e(h)==="already-using-only-set"?ve(ne):ve(xe,!1)},!0)}v(Z,ie)};A(fe,Z=>{Z(R,!1)})}r(c),v(he,c),Xe(),T()}var ea=y('<div class="flex justify-center mb-8"><div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 inline-flex"><button data-testid="tab-existing">Select Existing Control Set</button> <button data-testid="tab-import">Import New from Spreadsheet</button></div></div>'),ra=y('<div data-testid="pane-import"><!></div>'),ta=y('<div data-testid="pane-existing"><!></div>'),aa=y('<div data-testid="switch-overlay" class="absolute inset-0 bg-gray-900 bg-opacity-50 flex items-center justify-center rounded-lg"><div class="bg-white dark:bg-gray-700 rounded-lg p-6 text-center"><svg class="animate-spin h-8 w-8 text-blue-600 mx-auto mb-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <p class="text-gray-900 dark:text-white">Switching control set...</p></div></div>'),oa=y('<div class=" p-4"><div class="max-w-6xl mx-auto"><div class="text-center py-8"><h1 class="text-4xl font-extrabold text-gray-900 dark:text-white mb-4 flex items-center justify-center gap-3"><img src="/lula.png" class="h-12 w-12" alt="Lula"/> <span id="title">Lula</span></h1> <p id="description" class="text-lg text-gray-600 dark:text-gray-400"><!></p></div> <!> <div class="bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-800 dark:to-gray-900 rounded-lg shadow-xl p-6 relative border border-gray-200 dark:border-gray-700"><!> <!></div></div></div>');function ga(he,G){We(G,!1);let E=C("import"),de=C(""),T=C(!1),V=C(!1),B=C([]);lt(()=>{$r.connect();const u=Dr.subscribe(D=>{D.name&&D.name!=="Unknown Control Set"&&D.id!=="unknown"&&D.id!=="default"&&o(de,D.currentPath||"")}),b=async D=>{const L=D.detail;if(L&&L.controlSets){if(o(B,L.controlSets||[]),o(T,e(B).length>0),e(B).length===1){const j=e(B)[0];if(!(e(de)&&e(de).includes(j.path))&&!e(de)){console.log("Only one control set found and none loaded, auto-loading:",j.path),await w(j.path);return}}e(T)&&o(E,"existing")}};return window.addEventListener("control-sets-list",b),$r.scanControlSets().catch(D=>{console.error("Error scanning control sets:",D)}),()=>{u(),window.removeEventListener("control-sets-list",b)}});async function w(u){console.log("Starting control set switch to:",u),o(V,!0);try{await $r.switchControlSet(u),console.log("WebSocket command sent, waiting for state update..."),await new Promise(b=>{let D=0;const L=50,j=setInterval(()=>{D++;const Y=st(Dr);!Y.isSwitchingControlSet&&Y.currentPath&&Y.currentPath.includes(u)?(clearInterval(j),console.log("Control set switch completed successfully"),b()):D>=L&&(clearInterval(j),console.error("Control set switch timed out"),alert("Control set switch timed out. Please try again."),b())},100)}),o(V,!1),dt("/")}catch(b){console.error("Error switching control set:",b),alert("Failed to switch control set: "+b.message),o(V,!1)}}async function h(u){const{path:b}=u.detail;await w(b)}async function S(u){const{path:b}=u.detail;await w(b)}function be(u){const{tab:b}=u.detail;b&&o(E,b)}Ye();var J=oa(),F=a(J),c=a(F),fe=i(a(c),2),R=a(fe);{var Z=u=>{var b=sr("You have an existing control set. You can continue using it or create a new one.");v(u,b)},ie=u=>{var b=Fe(),D=we(b);{var L=Y=>{var ce=sr("Select an existing control set or import a new one from a spreadsheet.");v(Y,ce)},j=Y=>{var ce=sr("Let's get started by importing a control set from a spreadsheet.");v(Y,ce)};A(D,Y=>{e(T)?Y(L):Y(j,!1)},!0)}v(u,b)};A(R,u=>{e(de)?u(Z):u(ie,!1)})}r(fe),r(c);var Q=i(c,2);{var ne=u=>{var b=ea(),D=a(b),L=a(D),j=i(L,2);r(D),r(b),H(()=>{le(L,1,`px-6 py-3 rounded-l-lg font-medium transition-colors ${e(E)==="existing"?"bg-blue-600 text-white":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"}`),le(j,1,`px-6 py-3 rounded-r-lg font-medium transition-colors ${e(E)==="import"?"bg-blue-600 text-white":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"}`)}),g("click",L,()=>o(E,"existing")),g("click",j,()=>o(E,"import")),v(u,b)};A(Q,u=>{e(T)&&u(ne)})}var xe=i(Q,2),ve=a(xe);{var ge=u=>{var b=ra(),D=a(b);jt(D,{$$events:{created:h}}),r(b),v(u,b)},$=u=>{var b=ta(),D=a(b);Qt(D,{get controlSets(){return e(B)},$$events:{selected:S,"tab-change":be}}),r(b),v(u,b)};A(ve,u=>{e(E)==="import"?u(ge):u($,!1)})}var W=i(ve,2);{var ee=u=>{var b=aa();v(u,b)};A(W,u=>{e(V)&&u(ee)})}r(xe),r(F),r(J),v(he,J),Xe()}export{ga as component};
|
package/dist/_app/version.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1758119468164"}
|
package/dist/cli/commands/ui.js
CHANGED
|
@@ -2828,6 +2828,7 @@ __export(spreadsheetRoutes_exports, {
|
|
|
2828
2828
|
default: () => spreadsheetRoutes_default,
|
|
2829
2829
|
scanControlSets: () => scanControlSets
|
|
2830
2830
|
});
|
|
2831
|
+
import crypto from "crypto";
|
|
2831
2832
|
import { parse as parseCSVSync } from "csv-parse/sync";
|
|
2832
2833
|
import ExcelJS from "exceljs";
|
|
2833
2834
|
import express from "express";
|
|
@@ -3146,6 +3147,15 @@ var init_spreadsheetRoutes = __esm({
|
|
|
3146
3147
|
controlSetName = "Imported Control Set",
|
|
3147
3148
|
controlSetDescription = "Imported from spreadsheet"
|
|
3148
3149
|
} = req.body;
|
|
3150
|
+
let justificationFields = [];
|
|
3151
|
+
if (req.body.justificationFields) {
|
|
3152
|
+
try {
|
|
3153
|
+
justificationFields = JSON.parse(req.body.justificationFields);
|
|
3154
|
+
debug("Justification fields received:", justificationFields);
|
|
3155
|
+
} catch (e) {
|
|
3156
|
+
console.error("Failed to parse justification fields:", e);
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3149
3159
|
debug("Import parameters received:", {
|
|
3150
3160
|
controlIdField,
|
|
3151
3161
|
startRow,
|
|
@@ -3393,11 +3403,17 @@ var init_spreadsheetRoutes = __esm({
|
|
|
3393
3403
|
};
|
|
3394
3404
|
writeFileSync2(join4(baseDir, "lula.yaml"), yaml4.dump(controlSetData));
|
|
3395
3405
|
const controlsDir = join4(baseDir, "controls");
|
|
3406
|
+
const mappingsDir = join4(baseDir, "mappings");
|
|
3407
|
+
const justificationFieldNames = justificationFields;
|
|
3396
3408
|
families.forEach((familyControls, family) => {
|
|
3397
3409
|
const familyDir = join4(controlsDir, family);
|
|
3410
|
+
const familyMappingsDir = join4(mappingsDir, family);
|
|
3398
3411
|
if (!existsSync3(familyDir)) {
|
|
3399
3412
|
mkdirSync2(familyDir, { recursive: true });
|
|
3400
3413
|
}
|
|
3414
|
+
if (!existsSync3(familyMappingsDir)) {
|
|
3415
|
+
mkdirSync2(familyMappingsDir, { recursive: true });
|
|
3416
|
+
}
|
|
3401
3417
|
familyControls.forEach((control) => {
|
|
3402
3418
|
const controlId = control[controlIdFieldNameClean];
|
|
3403
3419
|
if (!controlId) {
|
|
@@ -3407,12 +3423,24 @@ var init_spreadsheetRoutes = __esm({
|
|
|
3407
3423
|
const controlIdStr = String(controlId).slice(0, 50);
|
|
3408
3424
|
const fileName2 = `${controlIdStr.replace(/[^a-zA-Z0-9-]/g, "_")}.yaml`;
|
|
3409
3425
|
const filePath = join4(familyDir, fileName2);
|
|
3426
|
+
const mappingFileName = `${controlIdStr.replace(/[^a-zA-Z0-9-]/g, "_")}-mappings.yaml`;
|
|
3427
|
+
const mappingFilePath = join4(familyMappingsDir, mappingFileName);
|
|
3410
3428
|
const filteredControl = {};
|
|
3429
|
+
const mappingData = {
|
|
3430
|
+
control_id: controlIdStr,
|
|
3431
|
+
justification: "",
|
|
3432
|
+
uuid: crypto.randomUUID()
|
|
3433
|
+
};
|
|
3434
|
+
const justificationContents = [];
|
|
3411
3435
|
if (control.family !== void 0) {
|
|
3412
3436
|
filteredControl.family = control.family;
|
|
3413
3437
|
}
|
|
3414
3438
|
Object.keys(control).forEach((fieldName) => {
|
|
3415
3439
|
if (fieldName === "family") return;
|
|
3440
|
+
if (justificationFields.includes(fieldName) && control[fieldName] !== void 0 && control[fieldName] !== null) {
|
|
3441
|
+
justificationContents.push(control[fieldName]);
|
|
3442
|
+
return;
|
|
3443
|
+
}
|
|
3416
3444
|
const isInFrontendSchema = frontendFieldSchema?.some((f) => f.fieldName === fieldName);
|
|
3417
3445
|
const isInFieldsMetadata = fields.hasOwnProperty(fieldName);
|
|
3418
3446
|
if (isInFrontendSchema || isInFieldsMetadata) {
|
|
@@ -3420,6 +3448,13 @@ var init_spreadsheetRoutes = __esm({
|
|
|
3420
3448
|
}
|
|
3421
3449
|
});
|
|
3422
3450
|
writeFileSync2(filePath, yaml4.dump(filteredControl));
|
|
3451
|
+
if (justificationContents.length > 0) {
|
|
3452
|
+
mappingData.justification = justificationContents.join("\n\n");
|
|
3453
|
+
}
|
|
3454
|
+
if (mappingData.justification && mappingData.justification.trim() !== "") {
|
|
3455
|
+
const mappingArray = [mappingData];
|
|
3456
|
+
writeFileSync2(mappingFilePath, yaml4.dump(mappingArray));
|
|
3457
|
+
}
|
|
3423
3458
|
});
|
|
3424
3459
|
});
|
|
3425
3460
|
res.json({
|
|
@@ -4533,8 +4568,8 @@ var WebSocketManager = class {
|
|
|
4533
4568
|
if (payload && payload.control_id) {
|
|
4534
4569
|
const mapping = payload;
|
|
4535
4570
|
if (!mapping.uuid) {
|
|
4536
|
-
const
|
|
4537
|
-
mapping.uuid =
|
|
4571
|
+
const crypto2 = await import("crypto");
|
|
4572
|
+
mapping.uuid = crypto2.randomUUID();
|
|
4538
4573
|
}
|
|
4539
4574
|
await state.fileStore.saveMapping(mapping);
|
|
4540
4575
|
state.mappingsCache.set(mapping.uuid, mapping);
|
package/dist/cli/server/index.js
CHANGED
|
@@ -2810,6 +2810,7 @@ __export(spreadsheetRoutes_exports, {
|
|
|
2810
2810
|
default: () => spreadsheetRoutes_default,
|
|
2811
2811
|
scanControlSets: () => scanControlSets
|
|
2812
2812
|
});
|
|
2813
|
+
import crypto from "crypto";
|
|
2813
2814
|
import { parse as parseCSVSync } from "csv-parse/sync";
|
|
2814
2815
|
import ExcelJS from "exceljs";
|
|
2815
2816
|
import express from "express";
|
|
@@ -3128,6 +3129,15 @@ var init_spreadsheetRoutes = __esm({
|
|
|
3128
3129
|
controlSetName = "Imported Control Set",
|
|
3129
3130
|
controlSetDescription = "Imported from spreadsheet"
|
|
3130
3131
|
} = req.body;
|
|
3132
|
+
let justificationFields = [];
|
|
3133
|
+
if (req.body.justificationFields) {
|
|
3134
|
+
try {
|
|
3135
|
+
justificationFields = JSON.parse(req.body.justificationFields);
|
|
3136
|
+
debug("Justification fields received:", justificationFields);
|
|
3137
|
+
} catch (e) {
|
|
3138
|
+
console.error("Failed to parse justification fields:", e);
|
|
3139
|
+
}
|
|
3140
|
+
}
|
|
3131
3141
|
debug("Import parameters received:", {
|
|
3132
3142
|
controlIdField,
|
|
3133
3143
|
startRow,
|
|
@@ -3375,11 +3385,17 @@ var init_spreadsheetRoutes = __esm({
|
|
|
3375
3385
|
};
|
|
3376
3386
|
writeFileSync2(join4(baseDir, "lula.yaml"), yaml4.dump(controlSetData));
|
|
3377
3387
|
const controlsDir = join4(baseDir, "controls");
|
|
3388
|
+
const mappingsDir = join4(baseDir, "mappings");
|
|
3389
|
+
const justificationFieldNames = justificationFields;
|
|
3378
3390
|
families.forEach((familyControls, family) => {
|
|
3379
3391
|
const familyDir = join4(controlsDir, family);
|
|
3392
|
+
const familyMappingsDir = join4(mappingsDir, family);
|
|
3380
3393
|
if (!existsSync3(familyDir)) {
|
|
3381
3394
|
mkdirSync2(familyDir, { recursive: true });
|
|
3382
3395
|
}
|
|
3396
|
+
if (!existsSync3(familyMappingsDir)) {
|
|
3397
|
+
mkdirSync2(familyMappingsDir, { recursive: true });
|
|
3398
|
+
}
|
|
3383
3399
|
familyControls.forEach((control) => {
|
|
3384
3400
|
const controlId = control[controlIdFieldNameClean];
|
|
3385
3401
|
if (!controlId) {
|
|
@@ -3389,12 +3405,24 @@ var init_spreadsheetRoutes = __esm({
|
|
|
3389
3405
|
const controlIdStr = String(controlId).slice(0, 50);
|
|
3390
3406
|
const fileName2 = `${controlIdStr.replace(/[^a-zA-Z0-9-]/g, "_")}.yaml`;
|
|
3391
3407
|
const filePath = join4(familyDir, fileName2);
|
|
3408
|
+
const mappingFileName = `${controlIdStr.replace(/[^a-zA-Z0-9-]/g, "_")}-mappings.yaml`;
|
|
3409
|
+
const mappingFilePath = join4(familyMappingsDir, mappingFileName);
|
|
3392
3410
|
const filteredControl = {};
|
|
3411
|
+
const mappingData = {
|
|
3412
|
+
control_id: controlIdStr,
|
|
3413
|
+
justification: "",
|
|
3414
|
+
uuid: crypto.randomUUID()
|
|
3415
|
+
};
|
|
3416
|
+
const justificationContents = [];
|
|
3393
3417
|
if (control.family !== void 0) {
|
|
3394
3418
|
filteredControl.family = control.family;
|
|
3395
3419
|
}
|
|
3396
3420
|
Object.keys(control).forEach((fieldName) => {
|
|
3397
3421
|
if (fieldName === "family") return;
|
|
3422
|
+
if (justificationFields.includes(fieldName) && control[fieldName] !== void 0 && control[fieldName] !== null) {
|
|
3423
|
+
justificationContents.push(control[fieldName]);
|
|
3424
|
+
return;
|
|
3425
|
+
}
|
|
3398
3426
|
const isInFrontendSchema = frontendFieldSchema?.some((f) => f.fieldName === fieldName);
|
|
3399
3427
|
const isInFieldsMetadata = fields.hasOwnProperty(fieldName);
|
|
3400
3428
|
if (isInFrontendSchema || isInFieldsMetadata) {
|
|
@@ -3402,6 +3430,13 @@ var init_spreadsheetRoutes = __esm({
|
|
|
3402
3430
|
}
|
|
3403
3431
|
});
|
|
3404
3432
|
writeFileSync2(filePath, yaml4.dump(filteredControl));
|
|
3433
|
+
if (justificationContents.length > 0) {
|
|
3434
|
+
mappingData.justification = justificationContents.join("\n\n");
|
|
3435
|
+
}
|
|
3436
|
+
if (mappingData.justification && mappingData.justification.trim() !== "") {
|
|
3437
|
+
const mappingArray = [mappingData];
|
|
3438
|
+
writeFileSync2(mappingFilePath, yaml4.dump(mappingArray));
|
|
3439
|
+
}
|
|
3405
3440
|
});
|
|
3406
3441
|
});
|
|
3407
3442
|
res.json({
|
|
@@ -4510,8 +4545,8 @@ var WebSocketManager = class {
|
|
|
4510
4545
|
if (payload && payload.control_id) {
|
|
4511
4546
|
const mapping = payload;
|
|
4512
4547
|
if (!mapping.uuid) {
|
|
4513
|
-
const
|
|
4514
|
-
mapping.uuid =
|
|
4548
|
+
const crypto2 = await import("crypto");
|
|
4549
|
+
mapping.uuid = crypto2.randomUUID();
|
|
4515
4550
|
}
|
|
4516
4551
|
await state.fileStore.saveMapping(mapping);
|
|
4517
4552
|
state.mappingsCache.set(mapping.uuid, mapping);
|