@ibgib/space-gib 0.0.23 → 0.0.24

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.
@@ -1,4 +1,4 @@
1
- import{a as Ca,b as xa,c as pt,d as Oa,e as Ra,f as Se,g as ke,h as Ma,i as Ua,j as Ba,k as va,l as Fa}from"./chunk-PJDAAEMZ.mjs";import{a as ja,b as z,d as Jt,e as ka,f as qa}from"./chunk-7LVERIWN.mjs";import{$ as ye,$a as ma,$c as Ta,A as X,Aa as Ie,Ad as je,B as j,Ba as aa,Bb as Ae,C as k,Ca as oa,Cb as $a,Da as ia,Ea as sa,F as re,Fa as na,G as Ye,Ga as ca,H as ce,Ha as at,I as Ot,Ia as ot,J as Ne,Ja as la,K as Ce,Ka as da,Kc as zt,L as Ur,Lc as ct,M as Le,Ma as Oe,Mc as Be,N as Je,Na as Re,Nc as Aa,O as Ee,Oa as Ft,P as Br,Pc as Ht,Q as vr,R as Rt,Ra as it,S as Qe,Sa as fa,Sb as ya,T as we,Ta as ba,Tb as q,Ua as pa,Uc as ae,V as Fr,W as jr,Wa as st,Wc as Xt,Xc as Sa,Y as $e,Ya as Me,Yc as lt,Z as De,Za as Ue,Zc as dt,_ as kr,_a as ha,_c as _a,a as b,aa as qr,ab as jt,b as Gt,ba as zr,ca as Mt,cd as Ga,d as x,da as Ut,e as te,ea as Hr,ed as Vt,f as Pt,fa as Xr,fb as ua,g as O,ga as Vr,gd as ve,h as y,ha as Wr,hb as kt,i as se,ia as Ke,ib as ga,j as m,ja as Ze,jb as le,k as Mr,l as We,lb as Ea,lc as Ia,m as Nt,ma as Yr,mb as wa,n as Ct,na as Jr,nd as Pa,o as Lt,oa as Qr,ob as nt,pa as et,pd as ft,qa as Bt,r as ne,ra as Kr,rd as Na,s as ue,sa as Zr,t as Dt,ta as ea,td as Wt,u as ge,ua as tt,ub as T,ud as Fe,va as xe,vb as qt,vd as Yt,w as $,wa as ta,wd as bt,x as N,xa as rt,xd as La,y as xt,ya as vt,yd as Da,za as ra}from"./chunk-JT6UUKP5.mjs";var za={src:["source","from","in","input"],dest:["destination","to","out","output"]};function jo({paramName:s,noBare:e,argTypeName:r,description:t}){let a={name:`src-${s}`,argTypeName:r??"string",synonyms:[...za.src.map(o=>`${o}-${s}`)],description:t};return e||a.synonyms.push(s),a}b(jo,"getParam_src");function ko({paramName:s,argTypeName:e="string",description:r}){return{name:`dest-${s}`,argTypeName:e??"string",synonyms:[...za.dest.map(a=>`${a}-${s}`)],description:r}}b(ko,"getParam_dest");var Ha={name:"bare",description:`special param that is used as the only param allowed that doesn't have a "double-dash-specifier=" form. one "bare" arg is allowed atow. if a bare arg is found, it will be mapped to this param info.`,synonyms:["bare-arg","bare-param","no-name","manco","arg-with-no-name","param-with-no-name"],argTypeName:"string"};var ji=jo({paramName:"path",description:"for referencing/ingesting file(s)/folder(s) in a fs"}),ki=ko({paramName:"path",description:"for indicating where to put generated file(s)/folder(s)"});var V=!1;function ht({paramInfo:s,valueString:e}){let r=`[${ht.name}]`;try{switch(s.argTypeName){case"string":let t=e;return(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))&&(t=t.slice(1),t=t.slice(0,t.length-1)),t;case"integer":if(e===void 0)throw new Error("integer arg value is undefined. integers must be a valid integer string (E: ce17acde3b863ec5e2fdcc594f0f1423)");let a=Number.parseInt(e);if(typeof a!="number")throw new Error(`arg value string (${e})did not parse to an integer. parse result: ${a} (E: 43cde93160458610ffb49fd16a02d123)`);return a;case"boolean":if(e===void 0||e===""){if(!s.isFlag)throw new Error("valueString is undefined or empty string but paramInfo.argTypeName === 'boolean' and paramInfo.isFlag is falsy. (E: 482e595c0ec7344b04def76c1441d623)");return!0}else{if(e===null)throw new Error("(UNEXPECTED) valueString === null? (E: 78f548b93026407968356d9c4f106223)");if(!["true","false"].includes(e))throw new Error(`invalid boolean valueString ("${e}"). must be either "true" or "false" (E: ba7a0d0804131acc2bd9ab37c0382523)`);return e==="true"}default:throw new Error("(UNEXPECTED) invalid paramInfo.argTypeName (E: c8b03ccb71394d22a29858b98753a123)")}}catch(t){throw console.error(`${r} ${m(t)}`),t}}b(ht,"getValueFromRawString");function mt({argIdentifier:s,paramInfos:e,throwIfNotFound:r}){let t=`[${mt.name}]`;try{let a=e.filter(o=>o.name===s||(o.synonyms??[]).includes(s));if(a.length===1)return x(a[0]);if(a.length>1)throw new Error(`(UNEXPECTED) multiple param infos found with argIdentifier. do you have overlapping arg names/synonyms? (${s} found in (${a.length} param infos)) (E: d599a6647c5ead6d9fbac4e4c96e6d23)`);if(r)throw new Error(`(UNEXPECTED) param info not found for argIdentifier (${s}) (E: 47e704068f2eb5a0551cf45d0e72c823)`);return}catch(a){throw console.error(`${t} ${m(a)}`),a}}b(mt,"getParamInfo");function Xa({rawArg:s}){let e=`[${Xa.name}]`;try{V&&console.log(`${e} starting... (I: 5d51b75b7a025e2e3fa498da7c08ac24)`);let r=b(o=>o.startsWith('"')&&o.endsWith('"')?"double":o.startsWith("'")&&o.endsWith("'")?"single":void 0,"fnGetQuoteType"),t=b(o=>r(o)?o.slice(0,o.length-1).slice(1):o,"fnStripQuotes"),a=r(s);if(a)return{prefix:void 0,identifier:void 0,isNameValuePair:!1,valueInfo:{rawValueString:s.concat(),resolvedValueString:t(s),singleQuoted:a==="single",doubleQuoted:a==="double"}};if(s.match(/^(--\w|-\w|:\w)/))if(s.includes("=")){let o=/^(--|-|:)([\w\-]+)=(['"]?.+['"]?)$/,i=s.match(o);if(!i)throw new Error(`invalid rawArg (${s}). expected an arg matching regexp ${o}. (E: 05ca56163e184faeb66456a0e9190b28)`);let[n,l,c,d]=i,f=r(d);return{prefix:l,identifier:c,isNameValuePair:!0,valueInfo:{rawValueString:d,resolvedValueString:f?t(d):d,singleQuoted:f==="single",doubleQuoted:f==="double"}}}else{let o=/^(--|-|:)([\w\-]+)$/,i=s.match(o);if(!i)throw new Error(`invalid rawArg (${s}). expected an arg matching regexp ${o}. at this point, it should have a prefix (e.g. "--"), and a single identifier (should be a flag since there is no equal sign). (E: 93305923465d9449bdce3f81373fae24)`);let[n,l,c]=i;return{prefix:l,identifier:c,isNameValuePair:!1,valueInfo:{rawValueString:void 0,resolvedValueString:"true",singleQuoted:!1,doubleQuoted:!1}}}else{if(s.includes("="))throw new Error(`invalid rawArg (${s}). isn't quoted, doesn't start with prefix, but it does have an equal sign? that's bad. (E: e8ad15211ce6fd56a4a214c2778c4724)`);return{prefix:void 0,identifier:void 0,isNameValuePair:!1,valueInfo:{rawValueString:s,resolvedValueString:s,doubleQuoted:!1,singleQuoted:!1}}}}catch(r){throw console.error(`${e} ${r.message}`),r}finally{V&&console.log(`${e} complete.`)}}b(Xa,"parseRawArg");function ut({args:s,paramInfos:e,bareArgParamInfo:r=x(Ha),logalot:t}){let a=`[${ut.name}]`;try{(V||t)&&console.log(`${a} starting... (I: f389aaa490796dfd823bc7b9d4e58b23)`);let o=!1;return s.map((n,l)=>{let c,d,f,{prefix:h,identifier:g,isNameValuePair:u,valueInfo:w}=Xa({rawArg:n});if(h){if((V||t)&&console.log(`identifier: ${g} (I: 519ce129a1e34753a9070d3a205c9a8b)`),!g)throw new Error("(UNEXPECTED) prefix truthy but identifier falsy? (E: f33ab3a2b623acc0d1bc36685edfaf24)");if(c=g,!w)throw new Error("(UNEXPECTED) !valueInfo? (E: 05249a361a59008cd313d2dfa8f08b24)");if(u){V&&console.log(`${a} identifier with equals: ${g}. (I: 5f8ae91d1ddd4a7f94c0f4fb7e688502)`);let E=mt({argIdentifier:c,paramInfos:e,throwIfNotFound:!0});f={...E,value:ht({paramInfo:E,valueString:w.rawValueString}),identifier:c}}else{V&&console.log(`${a} identifier without equals: ${g}`),c=g;let E=mt({argIdentifier:c,paramInfos:e,throwIfNotFound:!0});f={...E,value:ht({paramInfo:E,valueString:void 0}),identifier:c,isFlag:!0}}}else if(l===0){if(!w)throw new Error("(UNEXPECTED) argIndex === 0 but valueInfo falsy? (E: 4642b42c855593b7ffdacb85f27dab24)");if(!w.rawValueString)throw new Error("(UNEXPECTED) !valueInfo.rawValueString? (E: 0b35f71eb8227cdd67ccfc32f2e45824)");if(w.singleQuoted)throw new Error("first arg is quoted? (single). a bare arg in first position must be a command/flag. (E: 28cce820417fd3b4f95ba6c7e94b4624)");if(w.doubleQuoted)throw new Error("first arg is quoted? (double). a bare arg in first position must be a command/flag. (E: 0b948c87081043fdb168f08ba05ebbce)");c=w.rawValueString,f={...mt({argIdentifier:c,paramInfos:e,throwIfNotFound:!0}),value:!0,identifier:c,isFlag:!0}}else{if((V||t)&&console.log("bare arg found. (I: d6f67074c7e44a63864948d4bf04bee8)"),!r)throw new Error(`bare arg found (one without prefix like "--" or ":") but there is no param info expected for bare args. You must provide which param info a bare arg maps to in this ${ut.name} call. (E: 650dd3695d62f0f87dd0cbafbf068c23)`);if(o)throw new Error('You can have the first arg - a special arg like a command - be bare (without prefix like "--" or ":") and one additional non-positional arg be bare. But more than one non-positional bare arg found. Also remember if the arg has spaces then you have to enclose it with single or double quotes. (E: 74dea8f13f0c14e3b7a2f125c7faca23)');o=!0;let E=x(r);f={...E,isBare:!0,identifier:E.name,value:ht({paramInfo:E,valueString:n})}}return V&&console.log(`${a} argInfo: ${y(f)}`),f})}catch(o){throw console.error(`${a} ${m(o)}`),o}finally{(V||t)&&console.log(`${a} complete.`)}}b(ut,"buildArgInfos");var Qt={encrypt_gib:"encrypt-gib"},Ji=Object.values(Qt);var R={hi:"hi",welcome:"welcome",bye:"bye",yes:"yes",no:"no",learn:"learn",wtg:"wtg"},G={help:"semantic_help",hello:"semantic_hello",bye:"semantic_bye",yes:"semantic_yes",no:"semantic_no",cancel:"semantic_cancel",skip:"semantic_skip",forget:"semantic_forget",next:"semantic_next",please:"semantic_please",in_progress:"semantic_in_progress",list:"semantic_list",request:"semantic_request",count:"semantic_count",options:"semantic_options",ready:"semantic_ready",stop:"semantic_stop",result:"semantic_result",unknown:"semantic_unknown",default:"semantic_default"};function H(s,e){return e.flatMap(r=>({texts:[r],language:"en-US",props:{semanticId:s}}))}b(H,"toLexDatums_Semantics");function de(s,e){return e.flatMap(r=>({texts:[r],language:"en-US",props:{atomicId:s}}))}b(de,"toLexDatums_Atomics");var zo={[G.help]:[...H(G.help,["h","help","help me"])],[G.yes]:[...H(G.yes,["yes","y","yeah","yea","aye","yup","yep","sure","ok","sounds good","go for it","yes please","yes thanks","ok thanks","uh huh","god yes","affirmative","ten four","10-4","roger"])],[G.no]:[...H(G.no,["no","n","nah","nay","nope","uh uh","no thanks","ick","nuh uh","god no","no way","not at all","negative","that's a negative","nein"])],[G.cancel]:[...H(G.cancel,["cancel","nm","nevermind","cancel that","don't worry about it"])],[G.skip]:[...H(G.skip,["skip","sk"])],[G.forget]:[...H(G.forget,["forget","forget this","forget this one"])],[G.next]:[...H(G.next,["next"])],[G.bye]:[...H(G.bye,["bye","bye bye","see you later","see you"])],[G.unknown]:[...H(G.unknown,["are you mocking me, human?","mmhmm...","i see...","does not compute...","indeed"])]},Ho={[R.hi]:[...de(R.hi,["hi","howdy","hello","greetings","good day","hello there","good day to you","yo"])],[R.welcome]:[...de(R.welcome,["welcome"])],[R.yes]:[...de(R.yes,["yes","y","yeah","yea","aye","yup","yep","sure","ok","sounds good","go for it","yes please","yes thanks","ok thanks","uh huh","god yes","affirmative","ten four","10-4","roger"])],[R.no]:[...de(R.no,["no","n","nope","no thanks","no thank you"])],[R.bye]:[...de(R.bye,["bye","bye bye","adios","ciao","later"])],[R.learn]:[...de(R.learn,["learn","study","review"])],[R.wtg]:[...de(R.wtg,["wtg","nice","not bad","pretty good","good job"])]},Xo={...zo,...Ho},Va={...x(Xo)},Vo={...x(Va)},as=new qa(Vo,{requestLanguage:"en-US",defaultLanguage:"en-US",defaultCapitalize:"none",defaultLineConcat:"delim",defaultDelim:`
1
+ import{a as Ca,b as xa,c as pt,d as Oa,e as Ra,f as Se,g as ke,h as Ma,i as Ua,j as Ba,k as va,l as Fa}from"./chunk-XCTEIL2Y.mjs";import{a as ja,b as z,d as Jt,e as ka,f as qa}from"./chunk-4OYF47M6.mjs";import{$ as ye,$a as ma,$c as dt,A as X,Aa as Ie,Ad as Da,B as j,Ba as aa,C as k,Ca as oa,Cd as je,Da as ia,Db as Ae,Ea as sa,Eb as $a,F as re,Fa as na,G as Ye,Ga as ca,H as ce,Ha as at,I as Ot,Ia as ot,J as Ne,Ja as la,K as Ce,Ka as da,L as Ur,M as Le,Ma as Oe,Mc as zt,N as Je,Na as Re,Nc as ct,O as Ee,Oa as Ft,Oc as Be,P as Br,Pc as Aa,Q as vr,R as Rt,Ra as it,Rc as Ht,S as Qe,Sa as fa,T as we,Ta as ba,Ua as pa,Ub as ya,V as Fr,Vb as q,W as jr,Wa as st,Wc as ae,Y as $e,Ya as Me,Yc as Xt,Z as De,Za as Ue,Zc as Sa,_ as kr,_a as ha,_c as lt,a as b,aa as qr,ab as jt,ad as _a,b as Gt,ba as zr,bd as Ta,ca as Mt,d as x,da as Ut,e as te,ea as Hr,ed as Ga,f as Pt,fa as Xr,fb as ua,g as O,ga as Vr,gd as Vt,h as y,ha as Wr,hb as kt,i as se,ia as Ke,ib as ga,id as ve,j as m,ja as Ze,jb as le,k as Mr,l as We,lb as Ea,m as Nt,ma as Yr,mb as wa,n as Ct,na as Jr,nc as Ia,o as Lt,oa as Qr,ob as nt,pa as et,pd as Pa,qa as Bt,r as ne,ra as Kr,rd as ft,s as ue,sa as Zr,t as Dt,ta as ea,td as Na,u as ge,ua as tt,va as xe,vd as Wt,w as $,wa as ta,wb as T,wd as Fe,x as N,xa as rt,xb as qt,xd as Yt,y as xt,ya as vt,yd as bt,za as ra,zd as La}from"./chunk-7PVWSU7S.mjs";var za={src:["source","from","in","input"],dest:["destination","to","out","output"]};function jo({paramName:s,noBare:e,argTypeName:r,description:t}){let a={name:`src-${s}`,argTypeName:r??"string",synonyms:[...za.src.map(o=>`${o}-${s}`)],description:t};return e||a.synonyms.push(s),a}b(jo,"getParam_src");function ko({paramName:s,argTypeName:e="string",description:r}){return{name:`dest-${s}`,argTypeName:e??"string",synonyms:[...za.dest.map(a=>`${a}-${s}`)],description:r}}b(ko,"getParam_dest");var Ha={name:"bare",description:`special param that is used as the only param allowed that doesn't have a "double-dash-specifier=" form. one "bare" arg is allowed atow. if a bare arg is found, it will be mapped to this param info.`,synonyms:["bare-arg","bare-param","no-name","manco","arg-with-no-name","param-with-no-name"],argTypeName:"string"};var ji=jo({paramName:"path",description:"for referencing/ingesting file(s)/folder(s) in a fs"}),ki=ko({paramName:"path",description:"for indicating where to put generated file(s)/folder(s)"});var V=!1;function ht({paramInfo:s,valueString:e}){let r=`[${ht.name}]`;try{switch(s.argTypeName){case"string":let t=e;return(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))&&(t=t.slice(1),t=t.slice(0,t.length-1)),t;case"integer":if(e===void 0)throw new Error("integer arg value is undefined. integers must be a valid integer string (E: ce17acde3b863ec5e2fdcc594f0f1423)");let a=Number.parseInt(e);if(typeof a!="number")throw new Error(`arg value string (${e})did not parse to an integer. parse result: ${a} (E: 43cde93160458610ffb49fd16a02d123)`);return a;case"boolean":if(e===void 0||e===""){if(!s.isFlag)throw new Error("valueString is undefined or empty string but paramInfo.argTypeName === 'boolean' and paramInfo.isFlag is falsy. (E: 482e595c0ec7344b04def76c1441d623)");return!0}else{if(e===null)throw new Error("(UNEXPECTED) valueString === null? (E: 78f548b93026407968356d9c4f106223)");if(!["true","false"].includes(e))throw new Error(`invalid boolean valueString ("${e}"). must be either "true" or "false" (E: ba7a0d0804131acc2bd9ab37c0382523)`);return e==="true"}default:throw new Error("(UNEXPECTED) invalid paramInfo.argTypeName (E: c8b03ccb71394d22a29858b98753a123)")}}catch(t){throw console.error(`${r} ${m(t)}`),t}}b(ht,"getValueFromRawString");function mt({argIdentifier:s,paramInfos:e,throwIfNotFound:r}){let t=`[${mt.name}]`;try{let a=e.filter(o=>o.name===s||(o.synonyms??[]).includes(s));if(a.length===1)return x(a[0]);if(a.length>1)throw new Error(`(UNEXPECTED) multiple param infos found with argIdentifier. do you have overlapping arg names/synonyms? (${s} found in (${a.length} param infos)) (E: d599a6647c5ead6d9fbac4e4c96e6d23)`);if(r)throw new Error(`(UNEXPECTED) param info not found for argIdentifier (${s}) (E: 47e704068f2eb5a0551cf45d0e72c823)`);return}catch(a){throw console.error(`${t} ${m(a)}`),a}}b(mt,"getParamInfo");function Xa({rawArg:s}){let e=`[${Xa.name}]`;try{V&&console.log(`${e} starting... (I: 5d51b75b7a025e2e3fa498da7c08ac24)`);let r=b(o=>o.startsWith('"')&&o.endsWith('"')?"double":o.startsWith("'")&&o.endsWith("'")?"single":void 0,"fnGetQuoteType"),t=b(o=>r(o)?o.slice(0,o.length-1).slice(1):o,"fnStripQuotes"),a=r(s);if(a)return{prefix:void 0,identifier:void 0,isNameValuePair:!1,valueInfo:{rawValueString:s.concat(),resolvedValueString:t(s),singleQuoted:a==="single",doubleQuoted:a==="double"}};if(s.match(/^(--\w|-\w|:\w)/))if(s.includes("=")){let o=/^(--|-|:)([\w\-]+)=(['"]?.+['"]?)$/,i=s.match(o);if(!i)throw new Error(`invalid rawArg (${s}). expected an arg matching regexp ${o}. (E: 05ca56163e184faeb66456a0e9190b28)`);let[n,l,c,d]=i,f=r(d);return{prefix:l,identifier:c,isNameValuePair:!0,valueInfo:{rawValueString:d,resolvedValueString:f?t(d):d,singleQuoted:f==="single",doubleQuoted:f==="double"}}}else{let o=/^(--|-|:)([\w\-]+)$/,i=s.match(o);if(!i)throw new Error(`invalid rawArg (${s}). expected an arg matching regexp ${o}. at this point, it should have a prefix (e.g. "--"), and a single identifier (should be a flag since there is no equal sign). (E: 93305923465d9449bdce3f81373fae24)`);let[n,l,c]=i;return{prefix:l,identifier:c,isNameValuePair:!1,valueInfo:{rawValueString:void 0,resolvedValueString:"true",singleQuoted:!1,doubleQuoted:!1}}}else{if(s.includes("="))throw new Error(`invalid rawArg (${s}). isn't quoted, doesn't start with prefix, but it does have an equal sign? that's bad. (E: e8ad15211ce6fd56a4a214c2778c4724)`);return{prefix:void 0,identifier:void 0,isNameValuePair:!1,valueInfo:{rawValueString:s,resolvedValueString:s,doubleQuoted:!1,singleQuoted:!1}}}}catch(r){throw console.error(`${e} ${r.message}`),r}finally{V&&console.log(`${e} complete.`)}}b(Xa,"parseRawArg");function ut({args:s,paramInfos:e,bareArgParamInfo:r=x(Ha),logalot:t}){let a=`[${ut.name}]`;try{(V||t)&&console.log(`${a} starting... (I: f389aaa490796dfd823bc7b9d4e58b23)`);let o=!1;return s.map((n,l)=>{let c,d,f,{prefix:h,identifier:g,isNameValuePair:u,valueInfo:w}=Xa({rawArg:n});if(h){if((V||t)&&console.log(`identifier: ${g} (I: 519ce129a1e34753a9070d3a205c9a8b)`),!g)throw new Error("(UNEXPECTED) prefix truthy but identifier falsy? (E: f33ab3a2b623acc0d1bc36685edfaf24)");if(c=g,!w)throw new Error("(UNEXPECTED) !valueInfo? (E: 05249a361a59008cd313d2dfa8f08b24)");if(u){V&&console.log(`${a} identifier with equals: ${g}. (I: 5f8ae91d1ddd4a7f94c0f4fb7e688502)`);let E=mt({argIdentifier:c,paramInfos:e,throwIfNotFound:!0});f={...E,value:ht({paramInfo:E,valueString:w.rawValueString}),identifier:c}}else{V&&console.log(`${a} identifier without equals: ${g}`),c=g;let E=mt({argIdentifier:c,paramInfos:e,throwIfNotFound:!0});f={...E,value:ht({paramInfo:E,valueString:void 0}),identifier:c,isFlag:!0}}}else if(l===0){if(!w)throw new Error("(UNEXPECTED) argIndex === 0 but valueInfo falsy? (E: 4642b42c855593b7ffdacb85f27dab24)");if(!w.rawValueString)throw new Error("(UNEXPECTED) !valueInfo.rawValueString? (E: 0b35f71eb8227cdd67ccfc32f2e45824)");if(w.singleQuoted)throw new Error("first arg is quoted? (single). a bare arg in first position must be a command/flag. (E: 28cce820417fd3b4f95ba6c7e94b4624)");if(w.doubleQuoted)throw new Error("first arg is quoted? (double). a bare arg in first position must be a command/flag. (E: 0b948c87081043fdb168f08ba05ebbce)");c=w.rawValueString,f={...mt({argIdentifier:c,paramInfos:e,throwIfNotFound:!0}),value:!0,identifier:c,isFlag:!0}}else{if((V||t)&&console.log("bare arg found. (I: d6f67074c7e44a63864948d4bf04bee8)"),!r)throw new Error(`bare arg found (one without prefix like "--" or ":") but there is no param info expected for bare args. You must provide which param info a bare arg maps to in this ${ut.name} call. (E: 650dd3695d62f0f87dd0cbafbf068c23)`);if(o)throw new Error('You can have the first arg - a special arg like a command - be bare (without prefix like "--" or ":") and one additional non-positional arg be bare. But more than one non-positional bare arg found. Also remember if the arg has spaces then you have to enclose it with single or double quotes. (E: 74dea8f13f0c14e3b7a2f125c7faca23)');o=!0;let E=x(r);f={...E,isBare:!0,identifier:E.name,value:ht({paramInfo:E,valueString:n})}}return V&&console.log(`${a} argInfo: ${y(f)}`),f})}catch(o){throw console.error(`${a} ${m(o)}`),o}finally{(V||t)&&console.log(`${a} complete.`)}}b(ut,"buildArgInfos");var Qt={encrypt_gib:"encrypt-gib"},Ji=Object.values(Qt);var R={hi:"hi",welcome:"welcome",bye:"bye",yes:"yes",no:"no",learn:"learn",wtg:"wtg"},G={help:"semantic_help",hello:"semantic_hello",bye:"semantic_bye",yes:"semantic_yes",no:"semantic_no",cancel:"semantic_cancel",skip:"semantic_skip",forget:"semantic_forget",next:"semantic_next",please:"semantic_please",in_progress:"semantic_in_progress",list:"semantic_list",request:"semantic_request",count:"semantic_count",options:"semantic_options",ready:"semantic_ready",stop:"semantic_stop",result:"semantic_result",unknown:"semantic_unknown",default:"semantic_default"};function H(s,e){return e.flatMap(r=>({texts:[r],language:"en-US",props:{semanticId:s}}))}b(H,"toLexDatums_Semantics");function de(s,e){return e.flatMap(r=>({texts:[r],language:"en-US",props:{atomicId:s}}))}b(de,"toLexDatums_Atomics");var zo={[G.help]:[...H(G.help,["h","help","help me"])],[G.yes]:[...H(G.yes,["yes","y","yeah","yea","aye","yup","yep","sure","ok","sounds good","go for it","yes please","yes thanks","ok thanks","uh huh","god yes","affirmative","ten four","10-4","roger"])],[G.no]:[...H(G.no,["no","n","nah","nay","nope","uh uh","no thanks","ick","nuh uh","god no","no way","not at all","negative","that's a negative","nein"])],[G.cancel]:[...H(G.cancel,["cancel","nm","nevermind","cancel that","don't worry about it"])],[G.skip]:[...H(G.skip,["skip","sk"])],[G.forget]:[...H(G.forget,["forget","forget this","forget this one"])],[G.next]:[...H(G.next,["next"])],[G.bye]:[...H(G.bye,["bye","bye bye","see you later","see you"])],[G.unknown]:[...H(G.unknown,["are you mocking me, human?","mmhmm...","i see...","does not compute...","indeed"])]},Ho={[R.hi]:[...de(R.hi,["hi","howdy","hello","greetings","good day","hello there","good day to you","yo"])],[R.welcome]:[...de(R.welcome,["welcome"])],[R.yes]:[...de(R.yes,["yes","y","yeah","yea","aye","yup","yep","sure","ok","sounds good","go for it","yes please","yes thanks","ok thanks","uh huh","god yes","affirmative","ten four","10-4","roger"])],[R.no]:[...de(R.no,["no","n","nope","no thanks","no thank you"])],[R.bye]:[...de(R.bye,["bye","bye bye","adios","ciao","later"])],[R.learn]:[...de(R.learn,["learn","study","review"])],[R.wtg]:[...de(R.wtg,["wtg","nice","not bad","pretty good","good job"])]},Xo={...zo,...Ho},Va={...x(Xo)},Vo={...x(Va)},as=new qa(Vo,{requestLanguage:"en-US",defaultLanguage:"en-US",defaultCapitalize:"none",defaultLineConcat:"delim",defaultDelim:`
2
2
 
3
3
  `,defaultKeywordMode:"any",defaultPropsMode:"prop"}),Wa={...x(Va)};Wa[G.bye].push({texts:["EOL"],ssmls:[ka.sub("EOL","end of line")],language:"en-US",props:{semanticId:G.bye},weighting:100});Wa[G.unknown]=[...H(G.unknown,["i'm not quite sure what you mean","does not compute"])];var _e=!1;function Ya({robbotData:s}){let e=`[${Ya.name}]`;try{if(_e&&console.log(`${e} starting...`),!s)throw new Error("robbotData required (E: 1ac78ffae5354b67acb64a34cfe23c2f)");let r=[],{name:t,uuid:a,classname:o,outputPrefix:i,outputSuffix:n}=s;return t?t.match(Ne)||r.push(`name must match regexp: ${Ne}`):r.push("name required."),a?a.match(Gt)||r.push(`uuid must match regexp: ${Gt}`):r.push("uuid required."),i&&(i.match(Ce)||r.push(`outputPrefix must match regexp: ${Ce}`)),n&&(n.match(Ce)||r.push(`outputSuffix must match regexp: ${Ce}`)),o&&(o.match(Ne)||r.push(`classname must match regexp: ${Ne}`)),r}catch(r){throw console.error(`${e} ${r.message}`),r}finally{_e&&console.log(`${e} complete.`)}}b(Ya,"validateCommonRobbotData");async function Kt({robbotIbGib:s}){let e=`[${Kt.name}]`;try{_e&&console.log(`${e} starting... (I: f7b34d791a483b8c5a9d188da66d3f22)`);let r=await re({ibGib:s})??[];if(!s.data)throw new Error("robbotIbGib.data required (E: 754a8d2540610696aff04b0d159daa23)");let t=[],{robbotClassname:a,robbotName:o,robbotId:i}=Ja({robbotIb:s.ib});a||t.push("robbotClassname required (E: 3234d39bf1c74ec3aff59f374282dfc8)"),o||t.push("robbotName required (E: b329dcc62ff548d7aa0681393b2c7057)"),i||t.push("robbotId required (E: b562c953bfaf4dd49e4d3a08304ee2fc)");let n=Ya({robbotData:s.data}),l=[...r??[],...t??[],...n??[]];return l.length>0?l:void 0}catch(r){throw console.error(`${e} ${r.message}`),r}finally{_e&&console.log(`${e} complete.`)}}b(Kt,"validateCommonRobbotIbGib");function Ja({robbotIb:s}){let e=`[${Ja.name}]`;try{if(!s)throw new Error("robbotIb required (E: 4a35881058094f1a90bb4ea37052d6d7)");let r=s.split(" ");return{robbotClassname:r[2],robbotName:r[3],robbotId:r[4]}}catch(r){throw console.error(`${e} ${r.message}`),r}}b(Ja,"parseRobbotIb");async function Zt({fnPromptRobbot:s,ibgibs:e,space:r}){let t=`[${Zt.name}]`;try{if(_e&&console.log(`${t} starting...`),!e)throw new Error("(UNEXPECTED) ibgibs service required. (E: 4be5d20dc81fcdabb8d7d4cd47458522)");r=r??await e.getLocalUserSpace({lock:!0});let a=await s(r,null);if(!a)throw new Error("robbot prompt returned nothing. canceled? (E: 1a08529b53bd3d79c6587b196e5e0823)");let o=a.newIbGib;try{await se(1e3);let i=[];i.push(o),a.intermediateIbGibs?.forEach(d=>i.push(d)),a.dnas?.forEach(d=>i.push(d));for(let d=0;d<i.length;d++){let f=i[d],h=await re({ibGib:f});if((h??[]).length>0)throw new Error(`(unexpected) invalid robbot ibgib created. validationErrors: ${h}. robbot: ${y(o.toIbGibDto())} (E: a683268621cd6dd3dd60310b164c4d22)`)}await Ie({resTransform:a,space:r});let{zeroSpace:n,fnBroadcast:l,fnUpdateBootstrap:c}=e;await at({ibGib:o,space:r,fnBroadcast:b(d=>l(d),"fnBroadcast")}),await ot({type:"robbots",rel8nName:Le,ibGibsToRel8:[o],space:r,zeroSpace:n,fnUpdateBootstrap:c,fnBroadcast:l})}catch(i){throw console.error(`${t} ${i.message}`),i}return o}catch(a){console.error(`${t} ${a.message}`);return}finally{_e&&console.log(`${t} complete.`)}}b(Zt,"createNewRobbot");var gt="secret";var p=!1,Et=class s{static{b(this,"MetaspaceBase")}cacheSvc;lc=`[${s.name}]`;instanceId=new Date().toUTCString();_initialized=!1;get initialized(){return this._initialized}_initializedSubj;initialized$;_initializing=!1;get initializing(){return this._initializing}_latestSubj;latestObs;async getLocalUserSpace({lock:e=!1,localSpaceId:r}){let t=`${this.lc}[${this.getLocalUserSpace.name}]`;try{p&&console.log(`${t} starting...`),e??=!1;let a=await Re({zeroSpace:this.zeroSpace})??void 0;return await Ft({zeroSpace:this.zeroSpace,bootstrapIbGib:a,lock:e,callerInstanceId:this.instanceId,localSpaceId:r,fnDtoToSpace:b(i=>this.metaspaceFactory.fnDtoToSpace(i),"fnDtoToSpace"),localSpaceCacheSvc:this.cacheSvc})}catch(a){throw console.error(`${t} ${a.message}`),a}finally{p&&console.log(`${t} complete.`)}}async getLocalUserSpaces({lock:e=!1}){let r=`${this.lc}[${this.getLocalUserSpaces.name}]`;try{p&&console.log(`${r} starting...`);let t=[];e??=!1;let a=await Re({zeroSpace:this.zeroSpace});if(!a)throw new Error("(UNEXPECTED) bootstrapIbGib falsy (E: fff2de921a3ee56a1d70e4ac320e4122)");if(!a.data)throw new Error("(UNEXPECTED) bootstrapIbGib data falsy (E: 7f9d08050f214078b2f85dd2ed47e005)");if(!a.data[ye])throw new Error(`(UNEXPECTED) bootstrapIbGib data invalid. data[${ye}] falsy (E: 37614e2e8f914d6ab7c605cf064a80d2)`);if(a.data[ye].length===0)throw new Error(`(UNEXPECTED) bootstrapIbGib data invalid. data[${ye}] length === 0 (E: d57691d17e6b4d7ea3a8fed36c0f47e5)`);let o=a.data[ye];for(let i=0;i<o.length;i++){let n=o[i];if(!n)throw new Error("(UNEXPECTED) localSpaceId falsy (E: 582c520897f5355d642229eae122ac22)");let l=await Ft({zeroSpace:this.zeroSpace,bootstrapIbGib:a,lock:e,localSpaceId:n,callerInstanceId:this.instanceId,fnDtoToSpace:b(c=>this.metaspaceFactory.fnDtoToSpace(c),"fnDtoToSpace"),localSpaceCacheSvc:this.cacheSvc});t.push(l)}return t}catch(t){throw console.error(`${r} ${t.message}`),t}finally{p&&console.log(`${r} complete.`)}}async deleteLocalUserSpace({spaceId:e,deletePhysicalStorage:r=!0}){let t=`${this.lc}[${this.deleteLocalUserSpace.name}]`;try{if(p&&console.log(`${t} starting... spaceId: ${e} (I: 812fa4810b1241a590b512a8e0915623)`),!e)throw new Error("spaceId required. (E: 19fa5120a4024b819e917f9db0972b23)");await fa({spaceId:e,zeroSpace:this.zeroSpace}),await ba({spaceId:e,zeroSpace:this.zeroSpace}),p&&console.log(`${t} complete.`)}catch(a){throw console.error(`${t} ${a.message}`),a}}passwordCache={};_syncing=!1;get syncing(){return this._syncing}sagaInfoMap={};_alwaysAutosyncTjpAddrsCache=new Set;isPrompting=!1;_precalculatedIds=[];getUUIDSync(){let e=`${this.lc}[${this.getUUIDSync.name}]`;try{p&&console.log(`${e} starting...`);let r=this._precalculatedIds.pop();if(!r)throw new Error("no precalculated ids? (E: 14915489b21d031ee9ca695737ac6923)");return this._precalculatedIds.length<100&&this.precalculateSomeUUIDsPlease(),r}catch(r){throw console.error(`${e} ${r.message}`),r}finally{p&&console.log(`${e} complete.`)}}async precalculateSomeUUIDsPlease(){let e=`${this.lc}[${this.precalculateSomeUUIDsPlease.name}]`;try{p&&console.log(`${e} starting...`);let r=[];for(let t=0;t<500;t++){let a=await O();r.push(a)}this._precalculatedIds=r}catch(r){throw console.error(`${e} ${r.message}`),r}finally{p&&console.log(`${e} complete.`)}}async initializeObservables(){let e=`${this.lc}[${this.initializeObservables.name}]`;try{p&&console.log(`${e} starting... (I: f5dc6d6352eaf2f41809ddec76ea5923)`),this._initializedSubj=await je({replay:!0}),this.initialized$=this._initializedSubj.asObservable(),this._latestSubj=await je(),this.latestObs=this._latestSubj.asObservable()}catch(r){throw console.error(`${e} ${r.message}`),r}finally{p&&console.log(`${e} complete.`)}}metaspaceFactory={};getFnAlert;getFnPrompt;getFnPromptPassword;constructor(e){this.cacheSvc=e;let r=`${this.lc}[ctor]`;p&&(console.log(`${r}${Ot}`),console.timeLog(Ot),console.log(`${r} created. (I: 5fe7af9fccc2488282eecc8255729cec)`))}async initializeMetaspaceFactory({metaspaceFactory:e}){let r=`[${this.initializeMetaspaceFactory.name}]`;try{p&&console.log(`${r} starting... (I: 0b84dfb68c1e89e0af880d4461fe4b23)`),this.metaspaceFactory=e}catch(t){throw console.error(`${r} ${t.message}`),t}finally{p&&console.log(`${r} complete.`)}}async initialize({spaceName:e,metaspaceFactory:r,getFnAlert:t,getFnPrompt:a,getFnPromptPassword:o}){let i=`${this.lc}[${this.initialize.name}]`;try{if(this.instanceId=await O(),!t)throw new Error("getFnAlert required (E: c7ded289d9b6265b6d1294988faba923)");if(!a)throw new Error("getFnPrompt required (E: cce7733db0abbf9a41fa45b6b9bf9523)");if(!o)throw new Error("getFnPromptPassword required (E: cadae9f5df9a7c310e76b63cb6afb623)");this.getFnAlert=t,this.getFnPrompt=a,this.getFnPromptPassword=o;let n=`${i}[timer]`;p&&(n=i+"[timer 71cbfa]",console.log(`${i} starting timer ${n}`),console.time(n)),await this.precalculateSomeUUIDsPlease(),await this.initializeObservables(),p&&console.timeLog(n),await this.initializeMetaspaceFactory({metaspaceFactory:r??={}}),await this.initializeLocalSpaces({spaceName:e}),p&&console.timeLog(n),await this.initializeSpecialIbGibs_required({timerName:n}),await this.initializeSpecialIbGibs_other({timerName:n}),p&&(console.timeEnd(n),console.log(`${i} timer ${n} complete.`)),this._initialized=!0,await this._initializedSubj.next(ue),p&&console.log(`${i} initialized (I: e3b3a9652c09445cb055013166ff089c)`)}catch(n){throw console.error(`${i} ${n.message}`),n}}async initializeSpecialIbGibs_required({timerName:e}){let r=`[${this.initializeSpecialIbGibs_required.name}]`;try{p&&console.log(`${r} starting... (I: 8cb7f63d766ab38885dc63d8da9cd323)`),await this.getSpecialIbGib({type:"latest",initialize:!0}),p&&console.timeLog(e),await this.getSpecialIbGib({type:"roots",initialize:!0}),p&&console.timeLog(e),await this.getSpecialIbGib({type:"tags",initialize:!0}),p&&console.timeLog(e),await this.getSpecialIbGib({type:"apps",initialize:!0}),p&&console.timeLog(e)}catch(t){throw console.error(`${r} ${t.message}`),t}finally{p&&console.log(`${r} complete.`)}}async initializeSpecialIbGibs_outerspaces({timerName:e}){let r=`[${this.initializeSpecialIbGibs_outerspaces.name}]`;try{p&&console.log(`${r} starting... (I: 4f5ca25899384ceabd65e30cdf58f889)`),await this.getSpecialIbGib({type:"outerspaces",initialize:!0}),p&&console.timeLog(e),await this.getSpecialIbGib({type:"autosyncs",initialize:!0}),p&&console.timeLog(e),await this.loadAutoSyncs()}catch(t){throw console.error(`${r} ${t.message}`),t}finally{p&&console.log(`${r} complete.`)}}async initializeSpecialIbGibs_other({timerName:e}){let r=`[${this.initializeSpecialIbGibs_other.name}]`;try{p&&console.log(`${r} starting... (I: 3cad0b16f5dac3686929dd1923ee3623)`)}catch(t){throw console.error(`${r} ${t.message}`),t}finally{p&&console.log(`${r} complete.`)}}async initializeLocalSpaces({spaceName:e}){let r=`${this.lc}[${this.initializeLocalSpaces.name}]`;try{p&&console.log(`${r} starting...`);let t=this.zeroSpace;t.gib||(t.gib=await j({ibGib:t,hasTjp:!1})),p&&console.log(`${r} getting bootstrap ibgib (I: a4ad1cfd5c6f895e879d9e6a5f607b22)`);let a=kr,o=await Re({zeroSpace:t});o?(p&&console.log(`${r} getting bootstrap ibgib with locking from zero space...`),o=await Oe({space:t,scope:a,secondsValid:Fr,fn:b(async()=>{let i=await Re({zeroSpace:t});if(!i)throw new Error("failed to get validated bootstrapIbGib (E: a4318a8183c3d8979981c29bd4ecb223)");return i},"fn"),callerInstanceId:this.instanceId}),p&&console.log(`${r} got bootstrap ibgib with locking from zero space.`)):(p&&console.log(`${r} getting from default space...not found. bootstrap space not found. will create... (I: 3170ac1a310d41f29f2b2b075cde6bdb)`),await this.createLocalSpaceAndUpdateBootstrap({zeroSpace:t,allowCancel:!1,createBootstrap:!0,spaceName:e}))}catch(t){throw p&&console.log(`${r} getting from default space...not found. bootstrap space not found. (E: 617bb62c3b6c4c01a5faec7f06c719fd)`),console.error(`${r} ${t.message}`),t}finally{p&&console.log(`${r} complete.`)}}createNewLocalSpace({opts:e,fnLocalSpaceFactory:r}){let t=`[${this.createNewLocalSpace.name}]`;try{if(p&&console.log(`${t} starting... (I: ac652df9d652459d98832be8483544d1)`),!e)throw new Error("opts required (E: f1d50207b35c96985ba6c2e1a18a4e23)");if(e.getFnPrompt||(p&&console.log(`${t} incoming opts getFnPrompt falsy. using this.getFnPrompt (I: 1f331752ac81ffc48e2da0b27dafba23)`),e.getFnPrompt=this.getFnPrompt),r??=this.metaspaceFactory.fnDefaultLocalSpaceFactory,!r)throw new Error("neither fnLocalSpaceFactory nor this.fnDefaultLocalSpaceFactory provided (E: 5142df9dbae63fd0ffef8165782dc423)");return r(e)}catch(a){throw console.error(`${t} ${a.message}`),a}finally{p&&console.log(`${t} complete.`)}}async createLocalSpaceAndUpdateBootstrap({zeroSpace:e,allowCancel:r,createBootstrap:t,spaceName:a,getFnPrompt:o}){let i=`${this.lc}[${this.createLocalSpaceAndUpdateBootstrap.name}]`;try{let n;if(r){if(n=await this.createNewLocalSpace({opts:{allowCancel:r,spaceName:a,logalot:p,getFnPrompt:o??this.getFnPrompt}}),!n)return}else do n=await this.createNewLocalSpace({opts:{allowCancel:r,spaceName:a,logalot:p,getFnPrompt:o??this.getFnPrompt}});while(!n);t&&(p&&console.log(`${i} creating new bootstrap ibgib (I: ecc58dd4af21a0c69a16b3d71dad9c22)`),await it({space:n,zeroSpace:e,setSpaceAsDefault:!0,createIfNotFound:!0}));let l=await e.argy({ibMetadata:pa({space:n}),argData:{cmd:"put",ibGibAddrs:[$({ibGib:n})]},ibGibs:[n]});p&&console.log(`${i} save the localSpace in default zero space (I: 1b34fb9f548042ab9d9ae0619377e370)`);let c=await e.witness(l);if(c?.data?.success)p&&console.log(`${i} default zero space witnessed the user space (I: b6314ea887d34609904db3bb76ae2f9b)`);else throw new Error(`${c?.data?.errors?.join("|")||"There was a problem with zeroSpace witnessing the new localSpace (E: b952e888a4954cc5b671034b8384e750)"}`);p&&console.log(`${i} save the new localSpace in its own space (I: e1f520f2cc614b1fa9c1ebd1c4dd6957)`);let d=await n.witness(l);if(d?.data?.success)p&&console.log(`${i} user space witnessed itself`);else throw new Error(`${d?.data?.errors?.join("|")||"There was a problem with localSpace witnessing itself. (E: 33d4b1ffcca64160afe67046531958b5)"}`);return await it({space:n,zeroSpace:this.zeroSpace}),n}catch(n){throw console.error(`${i} ${n.message}`),this.getFnAlert()({title:"failed",msg:`failed to initialize the local space. error: ${n.message}`}),n}}async createTagIbGib({text:e,icon:r,description:t,space:a}){let o=`${this.lc}[${this.createTagIbGib.name}]`;try{if(a=a??await this.getLocalUserSpace({}),!a)throw new Error("space falsy and localUserSpace not initialized (E: 18f846b645124210a2ff1611641a8daf)");return da({text:e,icon:r,description:t,space:a,zeroSpace:this.zeroSpace,fnBroadcast:b(i=>this.fnBroadcast(i),"fnBroadcast"),fnUpdateBootstrap:b(i=>this.fnUpdateBootstrap(i),"fnUpdateBootstrap")})}catch(i){throw console.error(`${o} ${i.message}`),i}}async trash({ibGib_Context:e,rel8nName_Context:r,addr:t,space:a}){let o=`${this.lc}[${this.trash.name}]`;try{if(p&&console.log(`${o} starting... (I: 4cf73be6e3294124a78a4a45368bfbcc)`),!e)throw new Error("ibGib_Context required (E: 09dd5e5a9f784953a42d70b1827ba442)");if(!r)throw new Error("rel8nName_Context required (E: cb6edaaac586773b08fd18855fc11322)");if(!t)throw new Error("addr required (E: 14f27805749c499098cebc0b1b11bc57)");if(a=a??await this.getLocalUserSpace({}),!a)throw new Error("space falsy and localUserSpace not initialized (E: f81574e3437a4b88acd044b2abdc1ae4)");await ha({ibGib_Context:e,rel8nName_Context:r,addr:t,space:a,zeroSpace:this.zeroSpace,fnBroadcast:b(i=>this.fnBroadcast(i),"fnBroadcast"),fnUpdateBootstrap:b(i=>this.fnUpdateBootstrap(i),"fnUpdateBootstrap")})}catch(i){throw console.error(`${o} ${i.message}`),i}finally{p&&console.log(`${o} complete.`)}}async archive({ibGib_Context:e,rel8nName_Context:r,addr:t,space:a}){let o=`${this.lc}[${this.archive.name}]`;try{if(p&&console.log(`${o} starting... (I: 785b44dbb7b048cb8c210a907b73b4c8)`),!e)throw new Error("ibGib_Context required (E: dc277b47aa4f42118ad14bfc817bf1d5)");if(!r)throw new Error("rel8nName_Context required (E: 87bd7ffa820645e9bdfb17fc726249ba)");if(!t)throw new Error("addr required (E: f6ce4e1325c84aa9b3da31c5b9dcc787)");if(a=a??await this.getLocalUserSpace({}),!a)throw new Error("space falsy and localUserSpace not initialized (E: d6e0b1618eec400e820de6ac37491d39)");await ma({ibGib_Context:e,rel8nName_Context:r,addr:t,space:a,zeroSpace:this.zeroSpace,fnBroadcast:b(i=>this.fnBroadcast(i),"fnBroadcast"),fnUpdateBootstrap:b(i=>this.fnUpdateBootstrap(i),"fnUpdateBootstrap")}),p&&console.log(`${o} archived '${t.slice(0,32)}...' (I: 767b06c8cadd58c618924f0cd98a1723)`)}catch(i){throw console.error(`${o} ${i.message}`),i}finally{p&&console.log(`${o} complete.`)}}async getConfigAddr({key:e,space:r}){let t=`${this.lc}[${this.getConfigAddr.name}](${e})`;try{if(p&&console.log(`${t} getting...`),r=r??await this.getLocalUserSpace({}),!r)throw new Error("space falsy and could not get local space. (E: b6e7fcc09c6244b99b2e6e6ece398db0)");return ia({key:e,space:r})}catch(a){console.error(`${t} ${a.message}`);return}}fnUpdateBootstrap=b(async e=>{await it({space:e,zeroSpace:this.zeroSpace})},"fnUpdateBootstrap");fnBroadcast=b(e=>{this._latestSubj.next(e)},"fnBroadcast");async setConfigAddr({key:e,addr:r,space:t}){let a=`${this.lc}[${this.setConfigAddr.name}]`;try{if(t=t??await this.getLocalUserSpace({}),!t)throw new Error("space falsy and localUserSpace not initialized (?) (E: 2149c59ebd584a118304dd54656aa800)");return await sa({key:e,addr:r,space:t,zeroSpace:this.zeroSpace,fnUpdateBootstrap:b(o=>this.fnUpdateBootstrap(o),"fnUpdateBootstrap")})}catch(o){throw console.error(`${a} ${o.message}`),o}}async getCurrentRoot({space:e}){let r=`${this.lc}[${this.getCurrentRoot.name}]`;try{if(e=e??await this.getLocalUserSpace({}),!e)throw new Error("space falsy and localUserSpace not initialized (?) (E: 1f4dc5e9560341a993bf0b28accd75fe)");for(;this.initializing;)p&&console.log(`${r} hacky wait while initializing ibgibs service (I: 5fd759510e584cb69b232259b891cca1)`),await se(100);let t=await this.getSpecialIbGib({type:"roots",space:e});if(!t)throw new Error("Roots not initialized. (E: e7712dc3d183487e98cd44a2b4324bc2)");if(!t.rel8ns)throw new Error("Roots not initialized properly. No rel8ns. (E: 689f47f5d1da4a868d1c1ddd2ff13e17)");if(!t.rel8ns.current)throw new Error("Roots not initialized properly. No current root. (E: 962acd3f60474a329bfbd7682c003916)");if(t.rel8ns.current.length===0)throw new Error("Invalid Roots: empty current root rel8n. (E: fbdc13c157514efa86ade1bf9a38bbd6)");if(t.rel8ns.current.length>1)throw new Error("Invalid Roots: multiple current roots selected. (E: 370fe6e3920a4a1299f879e6fcbbc448)");let a=t.rel8ns.current[0],o=await this.get({addr:a,space:e});if(o.ibGibs?.length===1)return o.ibGibs[0];throw new Error(`could not get current root. addr: ${a} (E: 69de35c5f71e45a1a5d83228e136642b)`)}catch(t){console.error(`${r} ${t.message}`);return}}async setCurrentRoot({root:e,space:r}){let t=`${this.lc}[${this.setCurrentRoot.name}]`;try{if(!e)throw new Error("root required.");if(r=r??await this.getLocalUserSpace({}),!r)throw new Error("space falsy and localUserSpace not initialized (?) (E: 222a3f5b39fc47ccb2a4aa3ddcd49969)");return na({root:e,space:r,zeroSpace:this.zeroSpace,fnBroadcast:b(a=>this.fnBroadcast(a),"fnBroadcast"),fnUpdateBootstrap:b(a=>this.fnUpdateBootstrap(a),"fnUpdateBootstrap")})}catch(a){throw console.error(`${t} ${a.message}`),a}}async rel8ToCurrentRoot({ibGib:e,linked:r,rel8nName:t,space:a}){let o=`${this.lc}[${this.rel8ToCurrentRoot.name}]`;try{if(a=a??await this.getLocalUserSpace({}),!a)throw new Error("space falsy and localUserSpace not initialized (?) (E: cbc4e519414a405eab7fe470eadbf8f0)");return ca({ibGib:e,linked:r,rel8nName:t,space:a,zeroSpace:this.zeroSpace,fnBroadcast:b(i=>this.fnBroadcast(i),"fnBroadcast"),fnUpdateBootstrap:b(i=>this.fnUpdateBootstrap(i),"fnUpdateBootstrap")})}catch(i){console.error(`${o} ${i.message}`);return}}async rel8ToSpecialIbGib(e){let r=`${this.lc}[${this.rel8ToSpecialIbGib.name}](type:${e.type},rel8nName:${e.rel8nName})`;try{let{type:t,rel8nName:a,ibGibsToRel8:o,ibGibsToUnRel8:i,addrsToUnRel8:n,linked:l,severPast:c,deletePreviousSpecialIbGib:d,space:f}=e;if(f=f??await this.getLocalUserSpace({}),!f)throw new Error("space falsy and localUserSpace not initialized (?) (E: af863928bbc945549ffc4dcca830a70a)");return ot({...e,space:f,zeroSpace:this.zeroSpace,fnUpdateBootstrap:b(h=>this.fnUpdateBootstrap(h),"fnUpdateBootstrap"),fnBroadcast:b(h=>this.fnBroadcast(h),"fnBroadcast")})}catch(t){throw console.error(`${r} ${t.message}`),t}}async registerNewIbGib({ibGib:e,space:r}){let t=`${this.lc}[${this.registerNewIbGib.name}]`;try{let a=$({ibGib:e});if(t=`${t}[${a}]`,r=r??await this.getLocalUserSpace({}),!r)throw new Error("space falsy and localUserSpace not initialized (?) (E: d7e6d609a784449087cbaf1bbfb6b0c2)");return p&&console.log(`${t} starting...`),at({ibGib:e,space:r,fnBroadcast:b(o=>this.fnBroadcast(o),"fnBroadcast")})}catch(a){throw console.error(`${t} ${a.message}`),a}finally{p&&console.log(`${t} complete.`)}}async pingLatest_Local({ibGib:e,tjpIbGib:r,space:t,useCache:a}){let o=`${this.lc}[${this.pingLatest_Local.name}]`;p&&console.log(`${o} starting...`);try{if(!e){p&&console.log(`${o} ibGib falsy.`);return}if(X({ibGib:e})){console.warn(`${o} tried to ping latest for primitive. returning early... (W: 06c50cfe028cc04cca67e97a48e6fe22)`);return}if(e.ib.startsWith("witness space IonicSpace_V1")){let{spaceId:d}=Me({spaceIb:e.ib}),f=await this.getLocalUserSpace({localSpaceId:d});await this._latestSubj.next({ib:"IbGibTimelineUpdateInfo",latestIbGib:f,latestAddr:$({ibGib:f}),tjpAddr:`${e.ib}^gib`});return}if(t=t??await this.getLocalUserSpace({}),!t){console.warn(`${o} space falsy and localUserSpace not initialized. (W: e6708e58618947a6b66f6a49406cbf35)`);return}let i,n=$({ibGib:e}),l,c=await this.getLatestAddr({ibGib:e,tjp:r,space:t})??n;if(r||(r=await this.getTjpIbGib({ibGib:e,space:t}),r||(console.warn(`${o} tjp not found for ${n}? Should at least just be the ibGib's address itself. (W: 15d9c6daca7e442e968af36b4c18b8f7)`),r=e)),l=$({ibGib:r}),c===n)p&&console.log(`${o} latestAddr === ibGibAddr (I: f38042421fcc3d148a26ed56651c2522)`),i=e;else{p&&console.log(`${o} later version found. ibGibAddr: ${n}
4
4
  latestAddr: ${c} (I: 53cabd1643df7d43635af642e4c90922)`);let d=await this.get({addr:c,space:t});if(!d.success||d.ibGibs?.length!==1)throw new Error("latest not found (E: bc54e433573a5a89c6436dc6a3b60922)");i=d.ibGibs[0]}if(i&&c&&l)await this._latestSubj.next({ib:"IbGibTimelineUpdateInfo",latestIbGib:i,latestAddr:c,tjpAddr:l});else{debugger;throw new Error("(UNEXPECTED) latestIbGib, latestAddr and tjpAddr should all be truthy. (E: 20e71fa1a72c45deb1dc5083903a8622)")}}catch(i){console.error(`${o} ${i.message}`)}finally{p&&console.log(`${o} complete.`)}}async persistTransformResult({resTransform:e,force:r,space:t}){let a=`${this.lc}[${this.persistTransformResult.name}]`;try{if(t=t??await this.getLocalUserSpace({}),!t)throw new Error("space falsy and localUserSpace not initialized (?) (E: f8b3d06006874b479240eb45f4015628)");return Ie({resTransform:e,force:r,space:t})}catch(o){throw console.error(`${a} ${o.message}`),o}}async get({addr:e,addrs:r,isDna:t,space:a}){let o=`${this.lc}[${this.get.name}]`;try{if(a=a??await this.getLocalUserSpace({}),!a)throw new Error("space falsy and localUserSpace not initialized (?) (E: 86ccdcf3417a45b4a3a8c280fb9a6df7)");return rt({addr:e,addrs:r,isDna:t,space:a})}catch(i){return console.error(`${o} ${i.message}`),Promise.resolve({errorMsg:i.message})}}async put({ibGib:e,ibGibs:r,isDna:t,force:a,space:o}){let i=`${this.lc}[${this.put.name}]`;try{if(o=o??await this.getLocalUserSpace({}),!o)throw new Error("space falsy and localUserSpace not initialized (?) (E: a00eebe0e3d348d09fda62a6be486b6c)");return vt({ibGib:e,ibGibs:r,isDna:t,force:a,space:o})}catch(n){return console.error(`${i} ${n.message}`),Promise.resolve({errorMsg:n.message})}}async delete({addr:e,isDna:r,space:t}){let a=`${this.lc}[${this.delete.name}]`;try{if(t=t??await this.getLocalUserSpace({}),!t)throw new Error("space falsy and localUserSpace not initialized (?) (E: b4250b0045dc40629447f2cbd162faaa)");return ra({addr:e,isDna:r,space:t})}catch(o){return console.error(`${a} ${o.message}`),Promise.resolve({errorMsg:o.message})}}async getDependencyGraph(e){let r=`${this.lc}[${this.getDependencyGraph.name}]`;try{if(e.space=e.space??await this.getLocalUserSpace({})??null,!e.space)throw new Error("(UNEXPECTED) space falsy and localUserSpace not initialized (?) (E: e2a35a23d12d48ebadcfd4f1a396d6c1)");return Ia(e)}catch(t){throw console.error(`${r} ${t.message}`),t}}async getLatestAddr({ibGib:e,addr:r,tjpAddr:t,tjp:a,space:o}){let i=`${this.lc}[${this.getLatestAddr.name}]`;p&&console.log(`${i} starting...`);try{if(!e&&!a&&!t&&!r)throw new Error("ibGib && tjp && tjpAddr && addr are all falsy (E: fe725654342c4d80a33219160b5d81d3)");if(o=o??await this.getLocalUserSpace({}),!o)throw new Error("space falsy and localUserSpace not initialized (?) (E: fd01bb85e91f4c54bfe8b35714d48a38)");let n=await Ue({ibGibs:e?[e]:void 0,addrs:r?[r]:void 0,tjpAddrs:t?[t]:void 0,tjps:a?[a]:void 0,space:o});if(!n)throw new Error("resGetLatest falsy (E: 3851bbe4427ae11771f222234e8c6622)");if(!n.data)throw new Error("invalid resGetLatest: data falsy (E: 134e0f1f65edc69c6951c32e00a4bb22)");if(n.data.success){let l=n.data.latestAddrsMap;if(l){let c=Object.keys(l);if(c.length===1)return l[c[0]]||void 0;if(c.length===0)return n.data.addrsNotFound?.length===1,void 0;throw new Error("(UNEXPECTED) latestAddrsMap has multiple entries? We only asked for one. (E: 790518290f6b46729017684698539222)")}else{if(n.data.addrs?.length===1)return n.data.addrs[0];if(n.data.addrsNotFound?.length===1)return}if(n.data.addrsErrored?.length===1){let c=n.data.errors?.join("|")??"[unspecified error(s)] (E: 24f338036aa84ac99e3c39a660207222)";throw new Error(`resGetLatest had error(s): ${c}`)}else throw new Error(`unknown error, invalid resGetLatest: ${y(n)} (E: 6aa5aa225ebf49b588664370cb8feb22)`)}else{let l=n.data.errors?.join("|")??"[unspecified error(s)] (E: dcd6dcd6ec052fd112a4d48f1afa2922)";throw new Error(`resGetLatest had error(s): ${l}`)}}catch(n){throw console.error(`${i} ${n.message}`),n}finally{p&&console.log(`${i} complete.`)}}async getTjpIbGib({ibGib:e,naive:r=!0,space:t}){let a=`${this.lc}[${this.getTjpIbGib.name}]`;try{if(t=t??await this.getLocalUserSpace({}),!t)throw new Error("space falsy and localUserSpace not initialized (?) (E: 0ec806bd2c5641c4844a3698c922e1f6)");return t?la({ibGib:e,naive:r,space:t}):(console.warn(`${a} space falsy and localUserSpace not initialized.`),e)}catch(o){throw console.error(`${a} ${o.message}`),o}}async getSpecialIbGib({type:e,initialize:r,space:t,lock:a,dontWarnIfNotExist:o}){let i=`${this.lc}[${this.getSpecialIbGib.name}]`;try{if(t=t??await this.getLocalUserSpace({lock:a}),!t)throw new Error("space falsy and localUserSpace not initialized (?) (E: e08e85d8422e479f9d101194fd26cbda)");for(;this.initializing;)p&&console.log(`${i} hacky wait while initializing ibgibs service (I: 497d4becb94f4515a2ec389630420d6c)`),await se(100);return oa({type:e,initialize:r,space:t,zeroSpace:this.zeroSpace,fnUpdateBootstrap:b(n=>this.fnUpdateBootstrap(n),"fnUpdateBootstrap"),fnBroadcast:b(n=>this.fnBroadcast(n),"fnBroadcast"),fnGetInitializing:b(()=>this._initializing,"fnGetInitializing"),fnSetInitializing:b(n=>{this._initializing=n},"fnSetInitializing"),dontWarnIfNotExist:o})}catch(n){return console.error(`${i} ${n.message}`),null}}async getSpecialRel8dIbGibs({type:e,rel8nName:r,space:t}){let a=`${this.lc}[${this.getSpecialRel8dIbGibs.name}]`;try{if(t=t??await this.getLocalUserSpace({}),!t)throw new Error("space falsy and localUserSpace not initialized (?) (E: 476c7d7c68f34197b740be5df09238a2)");return aa({type:e,rel8nName:r,space:t})}catch(o){throw console.error(`${a} ${o.message}`),o}}async getPasswordForSecrets({secretIbGibs:e,fnPromptPassword:r,dontPrompt:t,checkCacheFirst:a,cacheAfter:o}){let i=`${this.lc}[${this.getPasswordForSecrets.name}]`,n=!1;try{let l=0;for(;this.isPrompting;)if(p&&console.log(`${i} hacky wait while already prompting (I: 852007c8549d42c096defe0105b5e2e6)`),await se(100),l++,l>1e3)throw n=!0,new Error("attempted to prompt for user password, but already prompting for quite awhile now. (E: 8bd4dc907422dd95862b2038ffe2b822)");let c=e.map(E=>$({ibGib:E})).join("");if(a){let E=await this.getCachedSecretPassword({cacheKey:c});if(E)return p&&console.log(`${i} using cachedPassword.`),E}if(t)return null;this.isPrompting=!0;let d=[];for(let E=0;E<e.length;E++){let S=e[E];if(!S.data)throw new Error("invalid secretIbGib. data falsy.");if(S.data.type==="password"){let A=S.data;d.push(A)}else throw new Error("Only password secrets are implemented atm.")}let f="-------------",h=d.map(E=>`name: ${E.name}
@@ -1,4 +1,4 @@
1
- import{F as j,Va as G,a as m,j as E,ka as y,la as A,lc as T,qd as C,w as I,wd as O,xd as D}from"./chunk-JT6UUKP5.mjs";var P={undefined:"undefined",preparing:"preparing",started:"started",inserted:"inserted",updated:"updated",merged_dna:"merged_dna",merged_state:"merged_state",already_synced:"already_synced",completed:"completed"},V={...A},Q={...V,sync:"sync"};var N=" ";var q=!1;function F({sagaId:b,statusCode:e,spaceType:t,spaceSubtype:a,delimiter:o}){let n=`[${F.name}]`;try{if(!b)throw new Error("sagaId required. (E: cfc923bb29ee4aa788e947b6416740e6)");if(e==null)throw new Error("status code required. (E: 4e0d232a9955496695012623c2e17ca2)");if(!Object.values(P).includes(e))throw new Error(`invalid status code (${e}) (E: 91d7655424c44d9680fff099ee2b54d2)`);if(!t)throw new Error("spaceType required. (E: 86e98694a56a4f599e98e50abf0eed43)");if(!a)throw new Error("spaceSubtype required. (E: 4857d4677ee34e95aeb2251dd633909e)");return o=o||N,`status ${b} ${e} ${t} ${a}`}catch(r){throw console.error(`${n} ${E(r)}`),r}}m(F,"getStatusIb");function K({participants:b}){let e=`[${K.name}]`;try{q&&console.log(`${e} starting... (I: 43c9a4f1fa1bbc944b98f8eed2f81924)`);let t=b.filter(a=>a.s_d==="src");if(t.length!==1)throw new Error("(UNEXPECTED) participants_src.length !== 1? atow (03/2024) only one src participant is expected. (E: ed4b3ae15f5da34c77655553aaf82224)");return t.at(0).id}catch(t){throw console.error(`${e} ${E(t)}`),t}finally{q&&console.log(`${e} complete.`)}}m(K,"getSrcLocalSpaceId");var x=!1,U=class b extends C{static{m(this,"SpaceBase_V1")}lc=`[${b.name}]`;cacheSvc;constructor(e,t){super(e,t),this.initialized=this.initialize()}async witnessImpl(e){let t=`${this.lc}[${this.witnessImpl.name}]`;return x&&console.log(`${t}`),await this.routeAndDoCommand({cmd:e.data.cmd,cmdModifiers:e.data.cmdModifiers??[],arg:e})}routeAndDoCommand({cmd:e,cmdModifiers:t,arg:a}){let o=`${this.lc}[${this.routeAndDoCommand.name}]`;switch(e){case y.get:return(t??[]).length===0?this.get(a):t.includes("can")?this.canGet(a):t.includes("latest")?t.includes("addrs")?this.getLatestAddrs(a):this.getLatestIbGibs(a):t.includes("tjps")?t.includes("addrs")?this.getTjpAddrs(a):this.getTjpIbGibs(a):t.includes("addrs")?this.getAddrs(a):t.includes("dependency-graph")?this.getDependencyGraph(a):this.get(a);case y.put:return(t??[]).length===0?this.put(a):t.includes("can")?this.canPut(a):this.put(a);case y.delete:return(t??[]).length===0?this.delete(a):t.includes("can")?this.canDelete(a):this.delete(a);default:throw new Error(`${o} unknown cmd: ${e}. cmdModifiers: ${t}`)}}get(e){return this.getImpl(e)}put(e){return this.putImpl(e)}delete(e){return this.deleteImpl(e)}deleteImpl(e){let t=`${this.lc}[${this.deleteImpl.name}]`;throw new Error(`${t} not implemented in base class`)}getAddrs(e){return this.getAddrsImpl(e)}getAddrsImpl(e){let t=`${this.lc}[${this.getAddrsImpl.name}]`;throw new Error(`${t} not implemented in base class`)}getLatestIbGibs(e){return this.getLatestIbGibsImpl(e)}getLatestIbGibsImpl(e){let t=`${this.lc}[${this.getLatestIbGibsImpl.name}]`;throw new Error(`${t} not implemented in base class`)}getLatestAddrs(e){return this.getLatestAddrsImpl(e)}getLatestAddrsImpl(e){let t=`${this.lc}[${this.getLatestAddrsImpl.name}]`;throw new Error(`${t} not implemented in base class`)}getTjpIbGibs(e){return this.getTjpIbGibsImpl(e)}getTjpIbGibsImpl(e){let t=`${this.lc}[${this.getTjpIbGibsImpl.name}]`;throw new Error(`${t} not implemented in base class`)}getTjpAddrs(e){return this.getTjpAddrsImpl(e)}getTjpAddrsImpl(e){let t=`${this.lc}[${this.getTjpAddrsImpl.name}]`;throw new Error(`${t} not implemented in base class`)}canGet(e){return this.canGetImpl(e)}canGetImpl(e){let t=`${this.lc}[${this.canGetImpl.name}]`;throw new Error(`${t} not implemented in base class`)}canPut(e){return this.canPutImpl(e)}canPutImpl(e){let t=`${this.lc}[${this.canPutImpl.name}]`;throw new Error(`${t} not implemented in base class`)}canDelete(e){return this.canPutImpl(e)}canDeleteImpl(e){let t=`${this.lc}[${this.canDeleteImpl.name}]`;throw new Error(`${t} not implemented in base class`)}getDependencyGraph(e){return this.getDependencyGraphImpl(e)}async getDependencyGraphImpl(e){let t=`${this.lc}[${this.getDependencyGraphImpl.name}]`;try{if(x&&console.log(`${t} starting... (I: 0e5fe807a0169224781f6c2833f34826)`),!e.data)throw new Error("(UNEXPECTED) arg.data falsy? (E: 45eba816295a97a0e55f981861a03f26)");if((e.data.ibGibAddrs??[]).length===0)throw new Error("arg.data.ibGibAddrs is falsy/empty (E: 70adc939c7b80c9938d8fa18fd7c5826)");let a={space:this,ibGibAddrs:e.data.ibGibAddrs,live:e.data.live||!0},o=await T(a),n=Object.values(o),r={optsAddr:I({ibGib:e}),count:n.length,addrs:Object.keys(o)};return this.resulty({resultData:r,ibGibs:n})}catch(a){throw console.error(`${t} ${E(a)}`),a}finally{x&&console.log(`${t} complete.`)}}async validateWitnessArg(e){let t=`${this.lc}[${this.validateWitnessArg.name}]`,a=[];try{if(a=await super.validateWitnessArg(e),!e.data)return a.push("arg.data required (E: 8ee544d7d88a45c6adcbc15838a283a7)"),a;if(!this.data)return a.push("this.data required (E: 64f80642d7de44329355d6f907e272c8)"),a;let{cmd:o,ibGibAddrs:n}=e.data,r=e.data.cmdModifiers??[],c=e.ibGibs;o||a.push("arg.data.cmd required (E: 72a11ee87a0d4896bcacd65a9c0284d9)"),Object.values(y).includes(o)||a.push(`unknown arg.data.cmd: ${o}. (E: 95282ce61e97429f8049e61ec9f14f0b)`);let s=n?.length??0;if(o===y.get&&!r?.includes("addrs")&&!r?.includes("latest")&&s===0&&a.push(`ibGibAddrs required when cmd is ${o}. (E: ee55a3f60b90423cbe054f27c34ab7d5)`),o===y.put){x&&console.log(`${t} validate put cmd`);let h=c?.length??0;if(h===0)a.push(`ibGibs required when cmd is ${o}. (E: b3a422169f7344a48a1d44e7ad1ba44e)`);else if(this.data.validateIbGibAddrsMatchIbGibs)if(x&&console.log(`${t} validateIbGibAddrsMatchIbGibs true, so doing so.`),h!==s)a.push("ibGibsLength !== ibGibAddrsLength and this.data.validateIbGibAddrsMatchIbGibs is true. (E: 6c6bf824ab32443aa4d6b8bf4f8113dd)");else{x&&console.log(`${t} validateIbGibAddrsMatchIbGibs, lengths match. validating intrinsically`);let l=n.concat();for(let i=0;i<c.length;i++){let d=c[i],u=await j({ibGib:d});if(u?.length??!1){let $=I({ibGib:d});u.forEach(g=>a.push(`(${$}) ERROR: ${g}`))}else{let $=I({ibGib:d}),g=l.indexOf($);if(g===-1){a.push(`ibGibAddrs don't map to calculated ibGib addrs. calculated Addr: (${$}) (E: b21b3a7a74db43e5a8722acc97274646)`);break}else l.splice(g,1)}}}}return a}catch(o){throw console.error(`${t} ${E(o)}`),o}finally{a?.length>0&&console.error(`${t} errors: ${a}`)}}async argy({argData:e,ibMetadata:t,noTimestamp:a,ibGibs:o}){let n=await O({argData:e,ibMetadata:t,noTimestamp:a});return o&&(n.ibGibs=o),n}async resulty({resultData:e,ibGibs:t}){let a=await D({ibMetadata:G({space:this}),resultData:e});return t&&(a.ibGibs=t),a}};var X={characters:"characters",spell_out:"spell-out",cardinal:"cardinal",number:"number",ordinal:"ordinal",digits:"digits",fraction:"fraction",unit:"unit",date:"date",time:"time",telephone:"telephone",address:"address",interjection:"interjection",expletive:"expletive"};var v=class b{static{m(this,"Ssml")}static lc=`[${b.name}]`;static wrapSsmlSpeak(e,t=!0){return"<speak>"+e.reduce((o,n)=>t?o+"<p>"+n+"</p>":o+n,"")+"</speak>"}static unwrapSsmlSpeak(e){return e.replace(/\<speak\>/g,"").replace(/\<\/speak\>/g,"")}static p(e){return"<p>"+e+"</p>"}static s(e){return"<s>"+e+"</s>"}static stripSsml(e){return e.replace(/\<\/p\>[ ]*\<p\>/g,"<p>").replace(/\<p\>(?=[ ])/g,"<p>").replace(/\<\/p\>(?=[ ])/g,"</p>").replace(/\<[\/]*p\>/g,`
1
+ import{F as j,Va as G,a as m,j as E,ka as y,la as A,nc as T,sd as C,w as I,yd as O,zd as D}from"./chunk-7PVWSU7S.mjs";var P={undefined:"undefined",preparing:"preparing",started:"started",inserted:"inserted",updated:"updated",merged_dna:"merged_dna",merged_state:"merged_state",already_synced:"already_synced",completed:"completed"},V={...A},Q={...V,sync:"sync"};var N=" ";var q=!1;function F({sagaId:b,statusCode:e,spaceType:t,spaceSubtype:a,delimiter:o}){let n=`[${F.name}]`;try{if(!b)throw new Error("sagaId required. (E: cfc923bb29ee4aa788e947b6416740e6)");if(e==null)throw new Error("status code required. (E: 4e0d232a9955496695012623c2e17ca2)");if(!Object.values(P).includes(e))throw new Error(`invalid status code (${e}) (E: 91d7655424c44d9680fff099ee2b54d2)`);if(!t)throw new Error("spaceType required. (E: 86e98694a56a4f599e98e50abf0eed43)");if(!a)throw new Error("spaceSubtype required. (E: 4857d4677ee34e95aeb2251dd633909e)");return o=o||N,`status ${b} ${e} ${t} ${a}`}catch(r){throw console.error(`${n} ${E(r)}`),r}}m(F,"getStatusIb");function K({participants:b}){let e=`[${K.name}]`;try{q&&console.log(`${e} starting... (I: 43c9a4f1fa1bbc944b98f8eed2f81924)`);let t=b.filter(a=>a.s_d==="src");if(t.length!==1)throw new Error("(UNEXPECTED) participants_src.length !== 1? atow (03/2024) only one src participant is expected. (E: ed4b3ae15f5da34c77655553aaf82224)");return t.at(0).id}catch(t){throw console.error(`${e} ${E(t)}`),t}finally{q&&console.log(`${e} complete.`)}}m(K,"getSrcLocalSpaceId");var x=!1,U=class b extends C{static{m(this,"SpaceBase_V1")}lc=`[${b.name}]`;cacheSvc;constructor(e,t){super(e,t),this.initialized=this.initialize()}async witnessImpl(e){let t=`${this.lc}[${this.witnessImpl.name}]`;return x&&console.log(`${t}`),await this.routeAndDoCommand({cmd:e.data.cmd,cmdModifiers:e.data.cmdModifiers??[],arg:e})}routeAndDoCommand({cmd:e,cmdModifiers:t,arg:a}){let o=`${this.lc}[${this.routeAndDoCommand.name}]`;switch(e){case y.get:return(t??[]).length===0?this.get(a):t.includes("can")?this.canGet(a):t.includes("latest")?t.includes("addrs")?this.getLatestAddrs(a):this.getLatestIbGibs(a):t.includes("tjps")?t.includes("addrs")?this.getTjpAddrs(a):this.getTjpIbGibs(a):t.includes("addrs")?this.getAddrs(a):t.includes("dependency-graph")?this.getDependencyGraph(a):this.get(a);case y.put:return(t??[]).length===0?this.put(a):t.includes("can")?this.canPut(a):this.put(a);case y.delete:return(t??[]).length===0?this.delete(a):t.includes("can")?this.canDelete(a):this.delete(a);default:throw new Error(`${o} unknown cmd: ${e}. cmdModifiers: ${t}`)}}get(e){return this.getImpl(e)}put(e){return this.putImpl(e)}delete(e){return this.deleteImpl(e)}deleteImpl(e){let t=`${this.lc}[${this.deleteImpl.name}]`;throw new Error(`${t} not implemented in base class`)}getAddrs(e){return this.getAddrsImpl(e)}getAddrsImpl(e){let t=`${this.lc}[${this.getAddrsImpl.name}]`;throw new Error(`${t} not implemented in base class`)}getLatestIbGibs(e){return this.getLatestIbGibsImpl(e)}getLatestIbGibsImpl(e){let t=`${this.lc}[${this.getLatestIbGibsImpl.name}]`;throw new Error(`${t} not implemented in base class`)}getLatestAddrs(e){return this.getLatestAddrsImpl(e)}getLatestAddrsImpl(e){let t=`${this.lc}[${this.getLatestAddrsImpl.name}]`;throw new Error(`${t} not implemented in base class`)}getTjpIbGibs(e){return this.getTjpIbGibsImpl(e)}getTjpIbGibsImpl(e){let t=`${this.lc}[${this.getTjpIbGibsImpl.name}]`;throw new Error(`${t} not implemented in base class`)}getTjpAddrs(e){return this.getTjpAddrsImpl(e)}getTjpAddrsImpl(e){let t=`${this.lc}[${this.getTjpAddrsImpl.name}]`;throw new Error(`${t} not implemented in base class`)}canGet(e){return this.canGetImpl(e)}canGetImpl(e){let t=`${this.lc}[${this.canGetImpl.name}]`;throw new Error(`${t} not implemented in base class`)}canPut(e){return this.canPutImpl(e)}canPutImpl(e){let t=`${this.lc}[${this.canPutImpl.name}]`;throw new Error(`${t} not implemented in base class`)}canDelete(e){return this.canPutImpl(e)}canDeleteImpl(e){let t=`${this.lc}[${this.canDeleteImpl.name}]`;throw new Error(`${t} not implemented in base class`)}getDependencyGraph(e){return this.getDependencyGraphImpl(e)}async getDependencyGraphImpl(e){let t=`${this.lc}[${this.getDependencyGraphImpl.name}]`;try{if(x&&console.log(`${t} starting... (I: 0e5fe807a0169224781f6c2833f34826)`),!e.data)throw new Error("(UNEXPECTED) arg.data falsy? (E: 45eba816295a97a0e55f981861a03f26)");if((e.data.ibGibAddrs??[]).length===0)throw new Error("arg.data.ibGibAddrs is falsy/empty (E: 70adc939c7b80c9938d8fa18fd7c5826)");let a={space:this,ibGibAddrs:e.data.ibGibAddrs,live:e.data.live||!0},o=await T(a),n=Object.values(o),r={optsAddr:I({ibGib:e}),count:n.length,addrs:Object.keys(o)};return this.resulty({resultData:r,ibGibs:n})}catch(a){throw console.error(`${t} ${E(a)}`),a}finally{x&&console.log(`${t} complete.`)}}async validateWitnessArg(e){let t=`${this.lc}[${this.validateWitnessArg.name}]`,a=[];try{if(a=await super.validateWitnessArg(e),!e.data)return a.push("arg.data required (E: 8ee544d7d88a45c6adcbc15838a283a7)"),a;if(!this.data)return a.push("this.data required (E: 64f80642d7de44329355d6f907e272c8)"),a;let{cmd:o,ibGibAddrs:n}=e.data,r=e.data.cmdModifiers??[],c=e.ibGibs;o||a.push("arg.data.cmd required (E: 72a11ee87a0d4896bcacd65a9c0284d9)"),Object.values(y).includes(o)||a.push(`unknown arg.data.cmd: ${o}. (E: 95282ce61e97429f8049e61ec9f14f0b)`);let s=n?.length??0;if(o===y.get&&!r?.includes("addrs")&&!r?.includes("latest")&&s===0&&a.push(`ibGibAddrs required when cmd is ${o}. (E: ee55a3f60b90423cbe054f27c34ab7d5)`),o===y.put){x&&console.log(`${t} validate put cmd`);let h=c?.length??0;if(h===0)a.push(`ibGibs required when cmd is ${o}. (E: b3a422169f7344a48a1d44e7ad1ba44e)`);else if(this.data.validateIbGibAddrsMatchIbGibs)if(x&&console.log(`${t} validateIbGibAddrsMatchIbGibs true, so doing so.`),h!==s)a.push("ibGibsLength !== ibGibAddrsLength and this.data.validateIbGibAddrsMatchIbGibs is true. (E: 6c6bf824ab32443aa4d6b8bf4f8113dd)");else{x&&console.log(`${t} validateIbGibAddrsMatchIbGibs, lengths match. validating intrinsically`);let l=n.concat();for(let i=0;i<c.length;i++){let d=c[i],u=await j({ibGib:d});if(u?.length??!1){let $=I({ibGib:d});u.forEach(g=>a.push(`(${$}) ERROR: ${g}`))}else{let $=I({ibGib:d}),g=l.indexOf($);if(g===-1){a.push(`ibGibAddrs don't map to calculated ibGib addrs. calculated Addr: (${$}) (E: b21b3a7a74db43e5a8722acc97274646)`);break}else l.splice(g,1)}}}}return a}catch(o){throw console.error(`${t} ${E(o)}`),o}finally{a?.length>0&&console.error(`${t} errors: ${a}`)}}async argy({argData:e,ibMetadata:t,noTimestamp:a,ibGibs:o}){let n=await O({argData:e,ibMetadata:t,noTimestamp:a});return o&&(n.ibGibs=o),n}async resulty({resultData:e,ibGibs:t}){let a=await D({ibMetadata:G({space:this}),resultData:e});return t&&(a.ibGibs=t),a}};var X={characters:"characters",spell_out:"spell-out",cardinal:"cardinal",number:"number",ordinal:"ordinal",digits:"digits",fraction:"fraction",unit:"unit",date:"date",time:"time",telephone:"telephone",address:"address",interjection:"interjection",expletive:"expletive"};var v=class b{static{m(this,"Ssml")}static lc=`[${b.name}]`;static wrapSsmlSpeak(e,t=!0){return"<speak>"+e.reduce((o,n)=>t?o+"<p>"+n+"</p>":o+n,"")+"</speak>"}static unwrapSsmlSpeak(e){return e.replace(/\<speak\>/g,"").replace(/\<\/speak\>/g,"")}static p(e){return"<p>"+e+"</p>"}static s(e){return"<s>"+e+"</s>"}static stripSsml(e){return e.replace(/\<\/p\>[ ]*\<p\>/g,"<p>").replace(/\<p\>(?=[ ])/g,"<p>").replace(/\<\/p\>(?=[ ])/g,"</p>").replace(/\<[\/]*p\>/g,`
2
2
 
3
3
  `).replace(/(<([^>]*)>)/ig,"").replace(/ +/g," ").replace(/\\n\\n\\n/g,`
4
4