@api-now/cli 1.2.1 → 1.3.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/README.md +6 -1
- package/dist/index.js +23 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var Rn=Object.create;var Or=Object.defineProperty;var Pn=Object.getOwnPropertyDescriptor;var Dn=Object.getOwnPropertyNames;var Un=Object.getPrototypeOf,Ln=Object.prototype.hasOwnProperty;var Mn=(o,e)=>()=>{try{return e||o((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},Fa=(o,e)=>{for(var t in e)Or(o,t,{get:e[t],enumerable:!0})},zn=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Dn(e))!Ln.call(o,r)&&r!==t&&Or(o,r,{get:()=>e[r],enumerable:!(i=Pn(e,r))||i.enumerable});return o};var Vn=(o,e,t)=>(t=o!=null?Rn(Un(o)):{},zn(e||!o||!o.__esModule?Or(t,"default",{value:o,enumerable:!0}):t,o));var sn=Mn((bw,an)=>{var ka=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,Xl=Object.getOwnPropertyNames,Zl=Object.prototype.hasOwnProperty,Ql=(o,e)=>{for(var t in e)ka(o,t,{get:e[t],enumerable:!0})},ec=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Xl(e))!Zl.call(o,r)&&r!==t&&ka(o,r,{get:()=>e[r],enumerable:!(i=Yl(e,r))||i.enumerable});return o},tc=o=>ec(ka({},"__esModule",{value:!0}),o),Qs={};Ql(Qs,{AmfModelExpander:()=>ac,JsonLd:()=>mt,JsonLdOptions:()=>tn});an.exports=tc(Qs);var ic=class en{validate(e){if(e===void 0)throw new Error("Node must not be undefined");if(Array.isArray(e))throw new Error("Node must not be an array");if(e["@id"]===void 0)throw new Error("Node must have an @id")}static empty(){return new en}withNode(e){this.validate(e);let t=e["@id"];if(this[t]!==void 0)throw new Error(`Cannot add node with duplicate id ${e["@id"]} to dictionary`);return this[t]=e,this}withNodes(e){return e.forEach(t=>this.withNode(t)),this}},vr=class{static targetOrLink(o,e){let t=e[o["@id"]];return t!==void 0?t:o}static isLinkObject(o){let e=typeof o=="object",t=!Array.isArray(o),i=o["@id"]!==void 0,r=Object.keys(o).length===1;return e&&t&&i&&r}static isArrayOfLinks(o){return o.every(e=>this.isLinkObject(e))}},rc=class{static embedNodeLinks(o,e,t){let r=t||(()=>!0);return Object.entries(o).filter(([a,s])=>r(a,s)).forEach(([a,s])=>{typeof s=="object"&&(vr.isLinkObject(s)?o[a]=vr.targetOrLink(s,e):Array.isArray(s)&&vr.isArrayOfLinks(s)&&(o[a]=s.map(n=>vr.targetOrLink(n,e))))}),o}},Xs=class va{static expandIris(e,t){Object.entries(e).forEach(([i,r])=>{delete e[i];let a=va.expandIri(i,t);e[a]=r})}static compactIris(e,t){Object.entries(e).forEach(([i,r])=>{delete e[i];let a=va.compactIri(i,t);e[a]=r})}static compactIri(e,t){switch(typeof t){case"string":return e.replace(t,"");case"object":if(Array.isArray(t))throw new Error("Context must be either an object or a string");if(this.isCompacted(e,t))return e;try{let[i,r]=Object.entries(t).find(([a,s])=>e.startsWith(s));return e.replace(r,`${i}:`)}catch{return e}default:throw new Error("Context must be either an object or a string")}}static expandIri(e,t){switch(typeof t){case"string":return`${t}${e}`;case"object":if(Array.isArray(t))throw new Error("Context must be either an object or a string");if(this.isCompacted(e,t))try{let[i,r]=Object.entries(t).find(([a,s])=>e.startsWith(a));return e.replace(`${i}:`,r)}catch{return e}else return e;default:throw new Error("Context must be either an object or a string")}}static isCompacted(e,t){let i=!0;return Object.values(t).forEach(r=>{e.startsWith(r)&&(i=!1)}),i}},Zs=class{static expandStructure(o){return Object.entries(o).forEach(([e,t])=>{switch(e){case"@id":break;case"@type":this.expandType(o,t);break;default:this.expandValue(o,e,t);break}}),o}static expandType(o,e){typeof e=="string"?o["@type"]=[e]:o["@type"]=e}static expandValue(o,e,t){switch(typeof t){case"string":case"number":case"boolean":o[e]=[{"@value":t}];break;case"object":Array.isArray(t)?t.map(r=>{switch(typeof r){case"string":case"number":case"boolean":return[{"@value":t}];default:return r}}):o[e]=[t]}}static compactStructure(o){if(Array.isArray(o)){let[e]=o;return this.compactStructure(e)}else return Object.entries(o).forEach(([e,t])=>{switch(e){case"@id":break;case"@type":this.compactType(o,t);break;default:this.compactValue(o,e,t);break}}),o}static compactType(o,e){Array.isArray(e)&&e.length===1&&(o["@type"]=e[0])}static compactValue(o,e,t){if(t.length===1){let[i]=t;this.isWrappedScalar(i)?o[e]=i["@value"]:o[e]=i}else t.map(i=>this.isWrappedScalar(i)?i["@value"]:i)}static isWrappedScalar(o){return o["@value"]!==void 0}},mt=class{static process(o,e){let t=this.getGraph(o),i=this.getContext(o),r=ic.empty().withNodes(t);t.forEach(s=>{e.embeddedLinks&&rc.embedNodeLinks(s,r,e.linkEmbeddingFilter),i!==void 0&&(e.expandedIris?Xs.expandIris(s,i):e.compactedIris&&Xs.compactIris(s,i)),e.expandedStructure?Zs.expandStructure(s):e.compactedStructure&&Zs.compactStructure(s)});let a=e.rootNodeId===void 0?{"@graph":t}:this.findNode(t,e.rootNodeId);return i!==void 0&&(a["@context"]=i),e.expandedStructure?[a]:a}static getContext(o){return o["@context"]}static getGraph(o){return o["@graph"]}static findNode(o,e){return o.find(t=>t["@id"]===e)}static stringify(o,e=!1){return JSON.stringify(o,null,e?2:0)}},tn=class rn{expandedIris;expandedStructure;embeddedLinks;compactedIris;compactedStructure;rootNodeId;linkEmbeddingFilter;static apply(){return new rn}withCompactedStructure(){return this.expandedStructure=!1,this.compactedStructure=!0,this}withRootNode(e){return this.rootNodeId=e,this}withExpandedStructure(){return this.expandedStructure=!0,this.compactedStructure=!1,this}withExpandedIris(){return this.expandedIris=!0,this.compactedIris=!1,this}withCompactedIris(){return this.expandedIris=!1,this.compactedIris=!0,this}withEmbeddedLinks(e){return this.linkEmbeddingFilter=e,this.embeddedLinks=!0,this}},ac=class{static expand(o){if(this.isInExpandedForm(o))return o;{let e=(r,a)=>!r.endsWith("fixPoint");this.preprocessLegacyRootNodeId(o);let t=this.resolveRootNodeId(o),i=tn.apply().withEmbeddedLinks(e).withCompactedIris().withExpandedStructure().withRootNode(t);return mt.process(o,i)}}static isInExpandedForm(o){return o["@graph"]===void 0}static preprocessLegacyRootNodeId(o){let e=mt.getGraph(o);if(e!=null){let t=mt.findNode(e,"./");t!=null&&(t["@id"]="")}}static resolveRootNodeId(o){let e=mt.getGraph(o);if(e==null||mt.findNode(e,"")!=null)return"";let t=mt.getContext(o);if(t!=null&&t["@base"]!=null){let r=t["@base"];if(mt.findNode(e,r)!=null)return r}let i=e.find(r=>Object.entries(r).some(([a,s])=>(a==="doc:root"||a==="http://a.ml/vocabularies/document#root")&&s===!0));return i!=null?i["@id"]:""}}});import Hc from"update-notifier";import{Command as Wc}from"commander";var Ht={name:"@api-now/cli",description:"API Now! CLI",version:"1.2.1",private:!1,publishConfig:{registry:"https://registry.npmjs.org/","@api-now:registry":"https://registry.npmjs.org/",access:"public"},files:["dist"],engines:{node:">=22.0.0"},type:"module",bin:{apinow:"dist/index.js"},scripts:{build:"node esbuild.config.js",postbuild:"node dist/index.js --help",dev:"tsx src/index.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts"',format:'prettier --write "src/**/*.ts"',test:"tsx --test tests/**/*.test.ts",prepare:"husky",prepublishOnly:"npm run build",knip:"knip"},dependencies:{"@inquirer/prompts":"^8.5.0",commander:"^15.0.0",nanoid:"^5.1.6",open:"^11.0.0",tslib:"^2.8.1","update-notifier":"^7.3.1"},devDependencies:{"@api-now/core":"^1.0.0","@commitlint/cli":"^21.0.1","@commitlint/config-conventional":"^21.0.1","@eslint/js":"^10.0.1","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@types/node":"^25.9.1","@types/update-notifier":"^6.0.8",esbuild:"^0.28.0",eslint:"^10.4.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.6",globals:"^17.6.0",husky:"^9.1.7",knip:"^6.14.2",prettier:"^3.8.3","semantic-release":"^25.0.3",tsx:"^4.7.1",typescript:"^6.0.3","typescript-eslint":"^8.60.0"}};import Cr from"node:os";import Ot from"node:path";import Ae from"node:fs";var Ii="https://api.apinow.app",Rr="apinow-cli",Kn="config.json",Pr=class{_resolved=null;get resolved(){this._resolved||this.load();let e=this._resolved;if(!e)throw new Error("Configuration could not be loaded.");return e}configDir=this.#e();configPath=Ot.join(this.configDir,Kn);load(){let e=this.#t(),t=process.env.APINOW_API_TOKEN||process.env.APINOW_TOKEN||e.token,i=process.env.APINOW_API_URL||e.apiUrl||Ii,r=e.org||"";this._resolved={token:t,apiUrl:i,org:r,format:"text"}}saturate(e){this._resolved||this.load();let t=this._resolved;if(!t)throw new Error("Configuration could not be loaded.");this._resolved={token:t.token,apiUrl:e.apiUrl||t.apiUrl,org:t.org,format:e.format==="json"?"json":"text"}}#e(){if(process.platform==="win32"){let e=process.env.APPDATA||Ot.join(Cr.homedir(),"AppData","Roaming");if(!e)throw new Error("Could not determine the configuration directory.");return Ot.join(e,Rr)}return process.platform==="darwin"?Ot.join(Cr.homedir(),"Library","Preferences",Rr):Ot.join(process.env.XDG_CONFIG_HOME||Ot.join(Cr.homedir(),".config"),Rr)}#t(){try{if(!Ae.existsSync(this.configPath))return{apiUrl:Ii};let e=Ae.readFileSync(this.configPath,"utf8"),t=JSON.parse(e);return{apiUrl:Ii,...t}}catch{return{apiUrl:Ii}}}writeProperty(e,t){let i=this.#t();i[e]=t,this.#i(i)}#i(e){try{let i={...this.#t(),...e};Ae.existsSync(this.configDir)||Ae.mkdirSync(this.configDir,{recursive:!0}),Ae.writeFileSync(this.configPath,JSON.stringify(i,null,2),"utf8")}catch(t){console.error("Failed to write configuration:",t)}}clearConfigKey(e){try{let t=this.#t();delete t[e],Ae.existsSync(this.configDir)||Ae.mkdirSync(this.configDir,{recursive:!0}),Ae.writeFileSync(this.configPath,JSON.stringify(t,null,2),"utf8")}catch(t){console.error(`Failed to clear key ${e} from configuration:`,t)}}reset(){try{Ae.existsSync(this.configPath)&&Ae.unlinkSync(this.configPath),Ae.existsSync(this.configDir)&&Ae.readdirSync(this.configDir).length===0&&Ae.rmdirSync(this.configDir),this._resolved=null}catch(e){console.error("Failed to reset configuration:",e)}}},N=new Pr;import{styleText as Ct}from"node:util";var Dr=Ht.version;var G={green:o=>Ct("green",o),red:o=>Ct("red",o),yellow:o=>Ct("yellow",o),cyan:o=>Ct("cyan",o),dim:o=>Ct("dim",o),bold:o=>Ct("bold",o)};function Rt(o,e){(process.argv.includes("--debug")||process.argv.includes("--verbose")||typeof process<"u"&&process.env.DEBUG&&(process.env.DEBUG==="*"||process.env.DEBUG.includes("apinow")))&&console.error(G.dim(`[debug][${o}] ${e}`))}function qn(o,e,t){if(o.length===0)return"No data available.";let i={},r=t||e;for(let l=0;l<e.length;l++){let c=e[l],p=r[l]||c;i[c]=p.length}for(let l of o)for(let c of e){let p=typeof l[c]=="object"&&l[c]!==null?JSON.stringify(l[c]):String(l[c]??"");p.length>(i[c]||0)&&(i[c]=p.length)}let a=e.map((l,c)=>(r[c]||l).toUpperCase().padEnd(i[l])).join(" "),s=e.map(l=>"-".repeat(i[l])).join(" "),n=o.map(l=>e.map(c=>(typeof l[c]=="object"&&l[c]!==null?JSON.stringify(l[c]):String(l[c]??"")).padEnd(i[c])).join(" "));return[a,s,...n].join(`
|
|
2
|
+
var Pn=Object.create;var Cr=Object.defineProperty;var Dn=Object.getOwnPropertyDescriptor;var Un=Object.getOwnPropertyNames;var Ln=Object.getPrototypeOf,Mn=Object.prototype.hasOwnProperty;var zn=(o,e)=>()=>{try{return e||o((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},Fa=(o,e)=>{for(var t in e)Cr(o,t,{get:e[t],enumerable:!0})},Vn=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Un(e))!Mn.call(o,r)&&r!==t&&Cr(o,r,{get:()=>e[r],enumerable:!(i=Dn(e,r))||i.enumerable});return o};var Fn=(o,e,t)=>(t=o!=null?Pn(Ln(o)):{},Vn(e||!o||!o.__esModule?Cr(t,"default",{value:o,enumerable:!0}):t,o));var sn=zn((ww,an)=>{var ka=Object.defineProperty,Xl=Object.getOwnPropertyDescriptor,Zl=Object.getOwnPropertyNames,Ql=Object.prototype.hasOwnProperty,ec=(o,e)=>{for(var t in e)ka(o,t,{get:e[t],enumerable:!0})},tc=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Zl(e))!Ql.call(o,r)&&r!==t&&ka(o,r,{get:()=>e[r],enumerable:!(i=Xl(e,r))||i.enumerable});return o},ic=o=>tc(ka({},"__esModule",{value:!0}),o),Qs={};ec(Qs,{AmfModelExpander:()=>sc,JsonLd:()=>ht,JsonLdOptions:()=>tn});an.exports=ic(Qs);var rc=class en{validate(e){if(e===void 0)throw new Error("Node must not be undefined");if(Array.isArray(e))throw new Error("Node must not be an array");if(e["@id"]===void 0)throw new Error("Node must have an @id")}static empty(){return new en}withNode(e){this.validate(e);let t=e["@id"];if(this[t]!==void 0)throw new Error(`Cannot add node with duplicate id ${e["@id"]} to dictionary`);return this[t]=e,this}withNodes(e){return e.forEach(t=>this.withNode(t)),this}},vr=class{static targetOrLink(o,e){let t=e[o["@id"]];return t!==void 0?t:o}static isLinkObject(o){let e=typeof o=="object",t=!Array.isArray(o),i=o["@id"]!==void 0,r=Object.keys(o).length===1;return e&&t&&i&&r}static isArrayOfLinks(o){return o.every(e=>this.isLinkObject(e))}},ac=class{static embedNodeLinks(o,e,t){let r=t||(()=>!0);return Object.entries(o).filter(([a,s])=>r(a,s)).forEach(([a,s])=>{typeof s=="object"&&(vr.isLinkObject(s)?o[a]=vr.targetOrLink(s,e):Array.isArray(s)&&vr.isArrayOfLinks(s)&&(o[a]=s.map(n=>vr.targetOrLink(n,e))))}),o}},Xs=class va{static expandIris(e,t){Object.entries(e).forEach(([i,r])=>{delete e[i];let a=va.expandIri(i,t);e[a]=r})}static compactIris(e,t){Object.entries(e).forEach(([i,r])=>{delete e[i];let a=va.compactIri(i,t);e[a]=r})}static compactIri(e,t){switch(typeof t){case"string":return e.replace(t,"");case"object":if(Array.isArray(t))throw new Error("Context must be either an object or a string");if(this.isCompacted(e,t))return e;try{let[i,r]=Object.entries(t).find(([a,s])=>e.startsWith(s));return e.replace(r,`${i}:`)}catch{return e}default:throw new Error("Context must be either an object or a string")}}static expandIri(e,t){switch(typeof t){case"string":return`${t}${e}`;case"object":if(Array.isArray(t))throw new Error("Context must be either an object or a string");if(this.isCompacted(e,t))try{let[i,r]=Object.entries(t).find(([a,s])=>e.startsWith(a));return e.replace(`${i}:`,r)}catch{return e}else return e;default:throw new Error("Context must be either an object or a string")}}static isCompacted(e,t){let i=!0;return Object.values(t).forEach(r=>{e.startsWith(r)&&(i=!1)}),i}},Zs=class{static expandStructure(o){return Object.entries(o).forEach(([e,t])=>{switch(e){case"@id":break;case"@type":this.expandType(o,t);break;default:this.expandValue(o,e,t);break}}),o}static expandType(o,e){typeof e=="string"?o["@type"]=[e]:o["@type"]=e}static expandValue(o,e,t){switch(typeof t){case"string":case"number":case"boolean":o[e]=[{"@value":t}];break;case"object":Array.isArray(t)?t.map(r=>{switch(typeof r){case"string":case"number":case"boolean":return[{"@value":t}];default:return r}}):o[e]=[t]}}static compactStructure(o){if(Array.isArray(o)){let[e]=o;return this.compactStructure(e)}else return Object.entries(o).forEach(([e,t])=>{switch(e){case"@id":break;case"@type":this.compactType(o,t);break;default:this.compactValue(o,e,t);break}}),o}static compactType(o,e){Array.isArray(e)&&e.length===1&&(o["@type"]=e[0])}static compactValue(o,e,t){if(t.length===1){let[i]=t;this.isWrappedScalar(i)?o[e]=i["@value"]:o[e]=i}else t.map(i=>this.isWrappedScalar(i)?i["@value"]:i)}static isWrappedScalar(o){return o["@value"]!==void 0}},ht=class{static process(o,e){let t=this.getGraph(o),i=this.getContext(o),r=rc.empty().withNodes(t);t.forEach(s=>{e.embeddedLinks&&ac.embedNodeLinks(s,r,e.linkEmbeddingFilter),i!==void 0&&(e.expandedIris?Xs.expandIris(s,i):e.compactedIris&&Xs.compactIris(s,i)),e.expandedStructure?Zs.expandStructure(s):e.compactedStructure&&Zs.compactStructure(s)});let a=e.rootNodeId===void 0?{"@graph":t}:this.findNode(t,e.rootNodeId);return i!==void 0&&(a["@context"]=i),e.expandedStructure?[a]:a}static getContext(o){return o["@context"]}static getGraph(o){return o["@graph"]}static findNode(o,e){return o.find(t=>t["@id"]===e)}static stringify(o,e=!1){return JSON.stringify(o,null,e?2:0)}},tn=class rn{expandedIris;expandedStructure;embeddedLinks;compactedIris;compactedStructure;rootNodeId;linkEmbeddingFilter;static apply(){return new rn}withCompactedStructure(){return this.expandedStructure=!1,this.compactedStructure=!0,this}withRootNode(e){return this.rootNodeId=e,this}withExpandedStructure(){return this.expandedStructure=!0,this.compactedStructure=!1,this}withExpandedIris(){return this.expandedIris=!0,this.compactedIris=!1,this}withCompactedIris(){return this.expandedIris=!1,this.compactedIris=!0,this}withEmbeddedLinks(e){return this.linkEmbeddingFilter=e,this.embeddedLinks=!0,this}},sc=class{static expand(o){if(this.isInExpandedForm(o))return o;{let e=(r,a)=>!r.endsWith("fixPoint");this.preprocessLegacyRootNodeId(o);let t=this.resolveRootNodeId(o),i=tn.apply().withEmbeddedLinks(e).withCompactedIris().withExpandedStructure().withRootNode(t);return ht.process(o,i)}}static isInExpandedForm(o){return o["@graph"]===void 0}static preprocessLegacyRootNodeId(o){let e=ht.getGraph(o);if(e!=null){let t=ht.findNode(e,"./");t!=null&&(t["@id"]="")}}static resolveRootNodeId(o){let e=ht.getGraph(o);if(e==null||ht.findNode(e,"")!=null)return"";let t=ht.getContext(o);if(t!=null&&t["@base"]!=null){let r=t["@base"];if(ht.findNode(e,r)!=null)return r}let i=e.find(r=>Object.entries(r).some(([a,s])=>(a==="doc:root"||a==="http://a.ml/vocabularies/document#root")&&s===!0));return i!=null?i["@id"]:""}}});import Wc from"update-notifier";import{Command as Yc}from"commander";var Ht={name:"@api-now/cli",description:"API Now! CLI",version:"1.3.0",private:!1,publishConfig:{registry:"https://registry.npmjs.org/","@api-now:registry":"https://registry.npmjs.org/",access:"public"},files:["dist"],engines:{node:">=22.0.0"},type:"module",bin:{apinow:"dist/index.js"},scripts:{build:"node esbuild.config.js",postbuild:"node dist/index.js --help",dev:"tsx src/index.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts"',format:'prettier --write "src/**/*.ts"',test:"tsx --test tests/**/*.test.ts",prepare:"husky",prepublishOnly:"npm run build",knip:"knip"},dependencies:{"@inquirer/prompts":"^8.5.0",commander:"^15.0.0",nanoid:"^5.1.6",open:"^11.0.0",tslib:"^2.8.1","update-notifier":"^7.3.1"},devDependencies:{"@api-now/core":"^1.0.0","@commitlint/cli":"^21.0.1","@commitlint/config-conventional":"^21.0.1","@eslint/js":"^10.0.1","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@types/node":"^25.9.1","@types/update-notifier":"^6.0.8",esbuild:"^0.28.0",eslint:"^10.4.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.6",globals:"^17.6.0",husky:"^9.1.7",knip:"^6.14.2",prettier:"^3.8.3","semantic-release":"^25.0.3",tsx:"^4.7.1",typescript:"^6.0.3","typescript-eslint":"^8.60.0"}};import Or from"node:os";import Be from"node:path";import pe from"node:fs";var Ii="https://api.apinow.app",Rr="apinow-cli",qn="config.json",Pr=class{_resolved=null;get resolved(){this._resolved||this.load();let e=this._resolved;if(!e)throw new Error("Configuration could not be loaded.");return e}configDir=this.#e();configPath=Be.join(this.configDir,qn);load(){let e=this.#i(),t=this.#r(),i=process.env.APINOW_API_TOKEN||process.env.APINOW_TOKEN||t.token||e.token,r=process.env.APINOW_API_URL||t.apiUrl||e.apiUrl||Ii,a=t.org||e.org||"";this._resolved={token:i,apiUrl:r,org:a,format:"text"}}saturate(e){this._resolved||this.load();let t=this._resolved;if(!t)throw new Error("Configuration could not be loaded.");this._resolved={token:t.token,apiUrl:e.apiUrl||t.apiUrl,org:t.org,format:e.format==="json"?"json":"text"}}#e(){if(process.platform==="win32"){let e=process.env.APPDATA||Be.join(Or.homedir(),"AppData","Roaming");if(!e)throw new Error("Could not determine the configuration directory.");return Be.join(e,Rr)}return process.platform==="darwin"?Be.join(Or.homedir(),"Library","Preferences",Rr):Be.join(process.env.XDG_CONFIG_HOME||Be.join(Or.homedir(),".config"),Rr)}#t(){let e=process.cwd();for(;;){let t=Be.join(e,"apinow.json");if(pe.existsSync(t))try{if(pe.statSync(t).isFile())return t}catch{}let i=Be.join(e,".apinowrc.json");if(pe.existsSync(i))try{if(pe.statSync(i).isFile())return i}catch{}let r=Be.dirname(e);if(r===e)break;e=r}return null}#r(){let e=this.#t();if(!e)return{};try{let t=pe.readFileSync(e,"utf8");return JSON.parse(t)}catch{return{}}}#i(){try{if(!pe.existsSync(this.configPath))return{apiUrl:Ii};let e=pe.readFileSync(this.configPath,"utf8"),t=JSON.parse(e);return{apiUrl:Ii,...t}}catch{return{apiUrl:Ii}}}writeProperty(e,t){let i=this.#i();i[e]=t,this.#a(i)}#a(e){try{let i={...this.#i(),...e};pe.existsSync(this.configDir)||pe.mkdirSync(this.configDir,{recursive:!0}),pe.writeFileSync(this.configPath,JSON.stringify(i,null,2),"utf8")}catch(t){console.error("Failed to write configuration:",t)}}clearConfigKey(e){try{let t=this.#i();delete t[e],pe.existsSync(this.configDir)||pe.mkdirSync(this.configDir,{recursive:!0}),pe.writeFileSync(this.configPath,JSON.stringify(t,null,2),"utf8")}catch(t){console.error(`Failed to clear key ${e} from configuration:`,t)}}reset(){try{pe.existsSync(this.configPath)&&pe.unlinkSync(this.configPath),pe.existsSync(this.configDir)&&pe.readdirSync(this.configDir).length===0&&pe.rmdirSync(this.configDir),this._resolved=null}catch(e){console.error("Failed to reset configuration:",e)}}},N=new Pr;import{styleText as Ot}from"node:util";var Dr=Ht.version;var G={green:o=>Ot("green",o),red:o=>Ot("red",o),yellow:o=>Ot("yellow",o),cyan:o=>Ot("cyan",o),dim:o=>Ot("dim",o),bold:o=>Ot("bold",o)};function Rt(o,e){(process.argv.includes("--debug")||process.argv.includes("--verbose")||typeof process<"u"&&process.env.DEBUG&&(process.env.DEBUG==="*"||process.env.DEBUG.includes("apinow")))&&console.error(G.dim(`[debug][${o}] ${e}`))}function Jn(o,e,t){if(o.length===0)return"No data available.";let i={},r=t||e;for(let l=0;l<e.length;l++){let c=e[l],p=r[l]||c;i[c]=p.length}for(let l of o)for(let c of e){let p=typeof l[c]=="object"&&l[c]!==null?JSON.stringify(l[c]):String(l[c]??"");p.length>(i[c]||0)&&(i[c]=p.length)}let a=e.map((l,c)=>(r[c]||l).toUpperCase().padEnd(i[l])).join(" "),s=e.map(l=>"-".repeat(i[l])).join(" "),n=o.map(l=>e.map(c=>(typeof l[c]=="object"&&l[c]!==null?JSON.stringify(l[c]):String(l[c]??"")).padEnd(i[c])).join(" "));return[a,s,...n].join(`
|
|
3
3
|
`)}var B=class{format;constructor(e={}){this.format=e.format||"text"}success(e,t){this.format==="json"?console.log(JSON.stringify({success:!0,message:e,data:t},null,2)):(console.log(G.green(`\u2714 ${e}`)),t!==void 0&&(typeof t=="object"&&t!==null?this.object(t):console.log(t)))}error(e){let t=e.code||"CLI_ERR_UNKNOWN";if(this.format==="json")console.error(JSON.stringify({success:!1,code:t,cliVersion:Dr,...e},null,2));else{if(console.error(G.red(`\u2716 Error [${t}]: ${e.message}`)),e.detail&&console.error(G.dim(e.detail)),e.errors&&e.errors.length>0){console.error(`
|
|
4
4
|
Validation errors:`);for(let i of e.errors)console.error(` - ${G.yellow(i.field)}: ${i.message}`)}if(console.error(G.dim(`(cli v${Dr})`)),t==="CLI_ERR_UNKNOWN"){let i="https://github.com/api-now/cli",r=encodeURIComponent(`[BUG] CLI Crash: ${e.message}`),a=encodeURIComponent(`**CLI Version:** ${Dr}
|
|
5
5
|
**Error Code:** ${t}
|
|
@@ -12,18 +12,18 @@ ${e.message}
|
|
|
12
12
|
${e.detail||"No stack trace available"}
|
|
13
13
|
\`\`\`
|
|
14
14
|
`),s=`${i}/issues/new?title=${r}&body=${a}`;console.error(`
|
|
15
|
-
Please report this bug: ${s}`)}}}list(e,t,i={}){if(this.format==="json")console.log(JSON.stringify(e,null,2));else{if(e.length===0){console.log("No records found.");return}console.log(
|
|
16
|
-
`)}*keys(){let e=Object.keys(this._map);for(let t of e)this._map[t].enabled&&(yield this._map[t].name)}*values(){let e=Object.keys(this._map);for(let t of e)this._map[t].enabled&&(yield this._map[t].value)}*entries(){let e=Object.keys(this._map);for(let t of e)this._map[t].enabled&&(yield[this._map[t].name,this._map[t].value])}*[Symbol.iterator](){let e=Object.keys(this._map);for(let t of e)this._map[t].enabled&&(yield[this._map[t].name,this._map[t].value])}};var h=class extends Error{name;status;static fromRawException(e,t){let i=e,r={};if(i.code!==void 0&&(r.code=String(i.code)),i.status!==void 0){let n=Number(i.status);isNaN(n)||(r.status=n)}i.help!==void 0&&(r.help=String(i.help));let a=i.message!==void 0?String(i.message):t,s=new this(a,r);return i.name!==void 0&&(s.name=String(i.name)),s}constructor(e,t){super(e,t);let i=this.constructor;this.name=i.name,this.message=e??i.message??"",this.status=t?.status??i.status??500;let r=t?.code??i.code;r!==void 0&&(this.code=r);let a=t?.help??i.help;a!==void 0&&(this.help=a),Error.captureStackTrace(this,i)}setHelp(e){return this.help=e,this}setCode(e){return this.code=e,this}setStatus(e){return this.status=e,this}get[Symbol.toStringTag](){return this.constructor.name}toString(){return this.code?`${this.name} [${this.code}]: ${this.message}`:`${this.name}: ${this.message}`}toJSON(){let e={name:this.name,message:this.message};return this.status&&(e.status=this.status),this.code&&(e.code=this.code),this.help&&(e.help=this.help),e}};var I="Invalid JSON response.",$="The response has no value.",_="Invalid response status: ",O="Unknown response from the server.";var H=class{sdk;constructor(e){this.sdk=e}logInvalidResponse(e){if(!this.sdk.silent&&e.body)try{let t=JSON.parse(e.body);t.message&&console.warn(`[Store message]: ${t.message}`)}catch{}}inspectCommonStatusCodes(e){let{status:t,body:i}=e;if(t===404){let r=this.createApiError("Not found",i);throw r.status!==404&&r.setStatus(404),r.code!=="E_NOT_FOUND"&&r.setCode("E_NOT_FOUND"),r}if(t===403){let r=this.createApiError("You have no access to this resource",i);throw r.status!==403&&r.setStatus(403),r.code!=="E_FORBIDDEN"&&r.setCode("E_FORBIDDEN"),r}if(t===401){let r=this.createApiError("Not authorized",i);throw r.status!==401&&r.setStatus(401),r.code!=="E_UNAUTHORIZED"&&r.setCode("E_UNAUTHORIZED"),r}}createApiError(e,t){if(!t)return new h(e);let i;try{i=JSON.parse(t)}catch{return new h(e)}return!i||typeof i!="object"||!i.message?new h(e):h.fromRawException(i,e)}async genericBatchDelete(e,t,i={}){let{token:r}=i,a=await this.sdk.http.post(e.toString(),{token:r,body:JSON.stringify(t)});this.inspectCommonStatusCodes(a);let s="Unable to delete in batch. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);if(!a.body)throw new h(`${s}${$}`,{code:"E_RESPONSE_NO_VALUE",status:a.status});let n;try{n=JSON.parse(a.body)}catch{throw new h(`${s}${I}`,{code:"E_INVALID_JSON",status:a.status})}if(!Array.isArray(n.data))throw new h(`${s}${O}`,{code:"E_RESPONSE_UNKNOWN",status:a.status});return n}async genericDelete(e,t={}){let{token:i}=t,r=await this.sdk.http.delete(e.toString(),{token:i});this.inspectCommonStatusCodes(r);let a="Unable to delete the object. ";if(r.status!==204)throw this.logInvalidResponse(r),this.createApiError(`${a}${_}${r.status}`,r.body)}async genericList(e,t,i={}){let{token:r}=i;this.sdk.appendListOptions(e,t);let a=await this.sdk.http.get(e.toString(),{token:r});this.inspectCommonStatusCodes(a);let s="Unable to list revisions for a file. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);if(!a.body)throw new h(`${s}${$}`,{code:"E_RESPONSE_NO_VALUE",status:a.status});let n;try{n=JSON.parse(a.body)}catch{throw new h(`${s}${I}`,{code:"E_INVALID_JSON",status:a.status})}if(!Array.isArray(n.data))throw new h(`${s}${O}`,{code:"E_RESPONSE_UNKNOWN",status:a.status});return n}readResponseBody(e,t){if(![200,202].includes(e.status))throw this.logInvalidResponse(e),this.createApiError(`${t}${_}${e.status}`,e.body);if(!e.body)throw new h(`${t}${$}`,{code:"E_RESPONSE_NO_VALUE",status:e.status});return e.body}readResponseJSON(e,t){let i=this.readResponseBody(e,t),r;try{r=JSON.parse(i)}catch{throw new h(`${t}${I}`,{code:"E_INVALID_JSON",status:e.status})}return r}processListResponse(e,t){this.inspectCommonStatusCodes(e);let i=this.readResponseJSON(e,t);if(!Array.isArray(i.data))throw new h(`${t}${O}`,{code:"E_RESPONSE_UNKNOWN",status:e.status});return i}assertObjectKind(e,t,i){if(t!==i)throw new h(`${e}${O}`,{code:"E_RESPONSE_UNKNOWN",status:500})}};var $i=class extends H{};var Ti=class extends $i{async get(e,t={}){let i=await this._get(e,t);if([301,302,308,307].includes(i.status)){let r=i.headers.get("location");if(!r)throw new Error('Expected redirection but no "location" header.');let a=new URL(r,e);return this.get(a.toString(),t)}return i}_get(e,t={}){return new Promise((i,r)=>{let{method:a="GET",headers:s={},token:n}=t,l={...s};n&&(l.authorization=`Bearer ${n}`);let u=(e.startsWith("https:")?Ga:Ja).request(e,{method:a,headers:l,rejectUnauthorized:!1});u.on("response",m=>{let g={status:m.statusCode,headers:new Yt(m.headers),body:""};m.on("data",f=>{g.body+=f}),m.on("end",()=>i(g))}),u.on("error",m=>r(m)),u.end()})}post(e,t={}){return new Promise((i,r)=>{let{method:a="POST",headers:s={},token:n}=t,l={...s};n&&(l.authorization=`Bearer ${n}`);let u=(e.startsWith("https:")?Ga:Ja).request(e,{method:a,headers:l});u.on("response",m=>{let g={status:m.statusCode,headers:new Yt(m.headers),body:""};m.on("data",f=>{g.body+=f}),m.on("end",()=>i(g))}),u.on("error",m=>r(m)),t.body&&u.write(t.body),u.end()})}patch(e,t={}){let i={...t,method:"PATCH"};return this.post(e,i)}put(e,t={}){let i={...t,method:"PUT"};return this.post(e,i)}delete(e,t={}){let i={...t,method:"DELETE"};return this.post(e,i)}};var k=class o{static folders(e){return`/v1/orgs/${e}/folders`}static files(e){return`/v1/orgs/${e}/files`}static filesSearch(e){return`${o.files(e)}/search`}static filesAccess(e,t){return`${o.file(e,t)}/access`}static filesBatch(e){return`${o.files(e)}/batch/read-meta`}static file(e,t){return`${o.files(e)}/${t}`}static fileMedia(e,t){return`${o.file(e,t)}/media`}static fileUsers(e,t){return`${o.file(e,t)}/users`}static fileRevisions(e,t){return`${o.file(e,t)}/revisions`}static fileBreadcrumbs(e,t){return`${o.file(e,t)}/breadcrumbs`}static history(){return"/history"}static historyBatchCreate(){return"/history/batch/create"}static historyBatchDelete(){return"/history/batch/delete"}static historyItem(e){return`/history/${e}`}static historyClear(e,...t){return`/history/clear/${e}/${t.join("/")}`}static shared(e){return`/v1/orgs/${e}/shared`}static trash(e){return`/v1/orgs/${e}/trash`}static trashItem(e,t){return`${o.trash(e)}/${t}`}static trashRestore(e,t){return`${o.trashItem(e,t)}/restore`}static trashEmpty(e){return`${o.trash(e)}/empty`}static trashBatchRestore(e){return`${o.trash(e)}/restore`}static trashBatchDelete(e){return`${o.trash(e)}/delete`}static projectExecutions(){return"/project/execution"}static projectExecution(e){return`/project/execution/${e}`}static projectExecutionBulkDelete(){return"/project/execution/delete"}static projectExecutionClear(e){return`/project/execution/clear/${e}`}static organizations(){return"/v1/orgs"}static organization(e){return`/v1/orgs/${e}`}static organizationUsers(e){return`${this.organization(e)}/users`}static organizationUserBatch(e){return`${this.organization(e)}/users/batch/read`}static organizationUser(e,t){return`${this.organization(e)}/users/${t}`}static organizationUserDeactivate(e,t){return`${this.organization(e)}/users/${t}/deactivate`}static organizationUserActivate(e,t){return`${this.organization(e)}/users/${t}/activate`}static invitations(e){return`${this.organization(e)}/invitations`}static invitation(e,t){return`${this.invitations(e)}/${t}`}static findInvitation(){return`${this.organizations()}/find-invitation`}static declineInvitation(e,t){return`${this.invitation(e,t)}/decline`}static resendInvitation(e,t){return`${this.invitation(e,t)}/resend`}static authGoogle(){return"/auth/google"}static authLogout(){return"/auth/logout"}static usersMe(){return"/v1/users/me"}static usersMeTokens(){return`${o.usersMe()}/tokens`}static usersMeToken(e){return`${o.usersMeTokens()}/${e}`}static dataCatalog(){return"/v1/datacatalog"}static dataCatalogStatus(e){return`${o.dataCatalog()}/status/${e}`}static dataCatalogEntry(e){return`${o.dataCatalog()}/${e}`}static dataCatalogEntryVersions(e){return`${o.dataCatalogEntry(e)}/versions`}static dataCatalogDependencies(){return`${o.dataCatalog()}/dependencies`}static dataCatalogUpdates(){return`${o.dataCatalog()}/updates`}static dataCatalogVersion(e,t){return`${o.dataCatalogEntry(e)}/${t}`}static dataCatalogDeprecate(e){return`${o.dataCatalogEntry(e)}/deprecate`}static dataCatalogUnpublish(e){return`${o.dataCatalogEntry(e)}/unpublish`}static dataCatalogVersionDeprecate(e,t){return`${o.dataCatalogVersion(e,t)}/deprecate`}static dataCatalogVersionUnpublish(e,t){return`${o.dataCatalogVersion(e,t)}/unpublish`}static groups(e){return`/v1/orgs/${e}/groups`}static group(e,t){return`/v1/orgs/${e}/groups/${t}`}static groupUsers(e,t){return`/v1/orgs/${e}/groups/${t}/users`}static aiModifyDomain(e,t){return`${this.organization(e)}/ai/domains/${t}/modify/stream`}static aiModifyApi(e,t){return`${this.organization(e)}/ai/apis/${t}/modify/stream`}static aiSessions(e,t){return`${this.organization(e)}/ai/sessions/${t}`}static aiSession(e,t,i){return`${o.aiSessions(e,t)}/${i}`}static aiMessages(e,t){return`${this.organization(e)}/ai/messages/${t}`}static aiMessage(e,t,i){return`${o.aiMessages(e,t)}/${i}`}static orgSlugGenerate(){return"/v1/orgs/slugs/generate"}static orgSlugValidate(){return"/v1/orgs/slugs/validate"}static deployments(e){return`/v1/orgs/${e}/deployments`}static deploymentsApis(e){return`${o.deployments(e)}/apis`}static deployment(e,t){return`${o.deployments(e)}/${t}`}static deploymentsApisByEnvLatest(e,t){return`${o.deploymentsApis(e)}/${t}/environments/latest`}static rollback(e,t){return`${o.deployment(e,t)}/rollback`}static job(e,t){return`/v1/orgs/${e}/jobs/${t}`}};var Oi=class extends H{oauthRedirect(e,t={}){let{redirect:i,token:r,type:a="redirect"}=t,s=new URL(this.sdk.baseUri);if(!["google","github","linkedin"].includes(e))throw new Error(`Invalid provider: ${e}`);let n=new URL(`/auth/${e}/redirect`,s);return i&&n.searchParams.set("r",i),r&&n.searchParams.set("token",r),a==="redirect"?(window.location.href=n.toString(),null):window.open(n.toString(),"_blank")}async logout(e={}){let{token:t}=e,i=this.sdk.getUrl(k.authLogout()),r=await this.sdk.http.post(i.toString(),{token:t});this.inspectCommonStatusCodes(r);let a="Unable to log out. ";if(r.status!==204)throw this.logInvalidResponse(r),this.createApiError(`${a}${_}${r.status}`,r.body)}};import{customAlphabet as Gn}from"nanoid";var R=Gn("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_",21);var Ue="Core#Permission",De=["reader","commenter","writer","owner"],rt=class o{kind=Ue;key="";type="user";granteeId="";role="reader";displayName;expirationTime;addingUser="";itemId="";depth=0;sourceRule="direct_user_grant";static fromUserRole(e,t,i,r){let a={key:R(),kind:Ue,itemId:t,granteeId:i,role:e,type:"user",addingUser:r,depth:0,sourceRule:"direct_user_grant"};return new o(a)}static fromGroupRole(e,t,i,r){let a={key:R(),kind:Ue,itemId:t,granteeId:i,role:e,type:"group",addingUser:r,depth:0,sourceRule:"direct_user_grant"};return new o(a)}static fromOrganizationRole(e,t,i,r){let a={key:R(),kind:Ue,itemId:t,granteeId:i,role:e,type:"organization",addingUser:r,depth:0,sourceRule:"direct_user_grant"};return new o(a)}static fromValues(e){return new o({...e,key:R(),kind:Ue})}constructor(e){let t;typeof e=="string"?t=JSON.parse(e):typeof e=="object"?t=e:t={kind:Ue,key:R(),granteeId:"",itemId:"",role:"reader",type:"user",addingUser:"",depth:0,sourceRule:"direct_user_grant"},this.new(t)}new(e){if(!o.isPermission(e))throw new Error("Not a permission.");let{key:t=R(),granteeId:i,role:r,type:a,displayName:s,expirationTime:n,addingUser:l,itemId:c,depth:p,sourceRule:u}=e;this.kind=Ue,this.key=t,this.granteeId=i,this.itemId=c,this.role=r,this.type=a,this.addingUser=l,this.depth=p||0,this.sourceRule=u||"direct_user_grant",s?this.displayName=s:this.displayName=void 0,typeof n=="number"?this.expirationTime=n:this.expirationTime=void 0}static isPermission(e){return!(!e||e.kind!==Ue)}static hasRole(e,t){if(!t)return!1;let i=De.indexOf(t),r=De.indexOf(e);return i>=r}static isHigherRole(e,t){let i=De.indexOf(e),r=De.indexOf(t);return i>r}hasRole(e){return o.hasRole(e,this.role)}static hasRoleIn(e,t){if(!t||!t.length)return!1;let i=[...t].sort((l,c)=>l.depth-c.depth),r=i[0].depth,a=i.filter(l=>l.depth===r),s,n=a.filter(l=>l.type==="user");if(n.length)s=n.sort((l,c)=>De.indexOf(c.role)-De.indexOf(l.role))[0];else{let l=a.filter(c=>c.type==="group");if(l.length)s=l.sort((c,p)=>De.indexOf(p.role)-De.indexOf(c.role))[0];else{let c=a.filter(p=>p.type==="organization");c.length&&(s=c.sort((p,u)=>De.indexOf(u.role)-De.indexOf(p.role))[0])}}return s?o.hasRole(e,s.role):!1}toJSON(){let e={kind:Ue,key:this.key,role:this.role,type:this.type,addingUser:this.addingUser,granteeId:this.granteeId,itemId:this.itemId,depth:this.depth,sourceRule:this.sourceRule};return this.displayName&&(e.displayName=this.displayName),this.expirationTime&&(e.expirationTime=this.expirationTime),e}};var at="Core#Thing",Ne="Core#Folder";var Xt="Core#User",Zt="Data#DomainFile",Be="Data#Domain",ne="Domain#Namespace",te="Domain#Model",J="Domain#Entity",oe="Domain#Association",Z="Domain#Property",He="Core#DataCatalog",We="Core#DataCatalogVersion";var Pt="Core#Deployment",ye="Core#ApiModel",yt="Core#ExposedEntity",Ur="Core#ApiFile";var Qt="Core#AiSession",Lr="Core#AiMessage",Mr="Core#Job";var W=class o{kind=at;name;displayName;description;version;static fromName(e){return new o({name:e,kind:at})}static fromJSON(e={},t={}){let i=new o,{name:r,displayName:a,description:s,version:n}=e||{};return typeof r=="string"?i.name=r:typeof t.name=="string"&&(i.name=t.name),typeof a=="string"?i.displayName=a:typeof t.displayName=="string"&&(i.displayName=t.displayName),s?i.description=s:typeof t.description=="string"&&(i.description=t.description),n?i.version=n:typeof t.version=="string"&&(i.version=t.version),i}constructor(e){let t;typeof e=="string"?t=JSON.parse(e):typeof e=="object"?t=e:t={kind:at},this.new(t)}new(e){if(!o.isThing(e))throw new Error("Not a thing.");let{description:t,name:i,version:r,displayName:a}=e;this.kind=at,this.name=i,this.displayName=a,this.description=t,this.version=r}static validate(e,t={}){let{strict:i}=t;return e&&typeof e=="object"?!(i&&e.kind!==at):!1}static isThing(e){return!!(e&&e.kind===at)}toJSON(){let e={kind:at};return typeof this.name=="string"&&(e.name=this.name),typeof this.displayName=="string"&&(e.displayName=this.displayName),this.description&&(e.description=this.description),this.version&&(e.version=this.version),e}getLabel(e){return this.displayName||this.name||e||"Unnamed object"}};var zr=Symbol("parents"),Ci=Symbol("deleted"),Ri=Symbol("deletedInfo"),Pi=Symbol("lastModified"),Vr=Symbol("capabilities"),Fr=Symbol("permissions"),Kr=Symbol("permissionIds"),qr=Symbol("shortcutTarget"),ei=class{kind="";key="";info=W.fromName("");iconColor;get isShortcut(){return!!this.shortcutTarget}[qr];get shortcutTarget(){return this[qr]}set shortcutTarget(e){this[qr]=e}static createSchema(e={}){let{key:t=R(),kind:i,iconColor:r,shortcutTarget:a}=e,s={key:t,kind:i||"",info:W.fromJSON(e.info,{name:"Unnamed file"}).toJSON()};return r&&(s.iconColor=r),a&&(s.isShortcut=!0,s.shortcutTarget=a),s}constructor(e){this.kind=e.kind,this.key=e.key,this.info=new W(e.info),e.iconColor&&(this.iconColor=e.iconColor),e.shortcutTarget&&(this.shortcutTarget=e.shortcutTarget)}toJSON(){let e={key:this.key,kind:this.kind,info:this.info.toJSON()};return this.iconColor&&(e.iconColor=this.iconColor),this.shortcutTarget&&(e.isShortcut=!0,e.shortcutTarget=this.shortcutTarget),e}static createFileCapabilities(e,t){let i=rt.hasRole("commenter",t),r=rt.hasRole("owner",t),a=rt.hasRole("reader",t),s=rt.hasRole("writer",t),n=e.kind===Ne;return{canReadMedia:!n&&a,canListChildren:n&&a,canComment:!n&&i,canEditMedia:!n&&s,canEditMeta:s,canReadRevisions:s,canAddChildren:n&&s,canDelete:r,canTrash:r,canUntrash:r,canShare:s,canMove:s}}createFileCapabilities(e){return Ce.createFileCapabilities(this,e)}static updateByMeMeta(e,t){e.deletedInfo&&(e.deletedInfo.byMe=e.deletedInfo.user===t),e.lastModified&&(e.lastModified.byMe=e.lastModified.user===t)}static setLastModified(e,t){if(!e)throw new Error("The file is required.");if(!t)throw new Error("The user is required.");if(t.kind!==Xt)throw new Error('Invalid value for the user when setting "lastModified".');return e.lastModified={byMe:!1,time:Date.now(),user:t.key,name:t.name},e}static setDeleted(e,t){if(!e)throw new Error("The file is required.");if(!t)throw new Error("The user is required.");if(t.kind!==Xt)throw new Error('Invalid value for the user when setting "deletedInfo".');return e.deleted=!0,e.deletedInfo={byMe:!1,time:Date.now(),user:t.key,name:t.name},e}},Ce=class o extends ei{[zr]=[];get parents(){return this[zr]}[Kr]=[];get permissionIds(){return this[Kr]}[Ci];get deleted(){return this[Ci]||!1}[Ri];get deletedInfo(){return this[Ri]}[Pi]={user:"",time:0,byMe:!1};get lastModified(){return this[Pi]}labels;[Vr];get capabilities(){return this[Vr]}[Fr]=[];get permissions(){return this[Fr]}static createSchema(e={}){let t=ei.createSchema(e);return Array.isArray(e.parents)?t.parents=[...e.parents]:t.parents=[],Array.isArray(e.permissionIds)?t.permissionIds=[...e.permissionIds]:t.permissionIds=[],Array.isArray(e.permissions)?t.permissions=e.permissions.map(i=>({...i})):t.permissions=[],e.capabilities&&(t.capabilities={...e.capabilities}),e.lastModified?t.lastModified={...e.lastModified}:t.lastModified={user:"",time:0,byMe:!1},typeof e.deleted=="boolean"&&(t.deleted=e.deleted,t.deletedInfo=e.deletedInfo?{...e.deletedInfo}:void 0),Array.isArray(e.labels)&&(t.labels=[...e.labels]),typeof e.shortcutTarget=="string"&&(t.shortcutTarget=e.shortcutTarget),t}constructor(e){let t=o.createSchema(e);super(t),this[zr]=[...t.parents],this[Kr]=[...t.permissionIds],this[Fr]=t.permissions.map(i=>({...i})),this[Vr]=t.capabilities?{...t.capabilities}:void 0,this[Pi]=Object.freeze({...t.lastModified}),typeof t.deleted=="boolean"&&(this[Ci]=t.deleted,this[Ri]=t.deletedInfo?Object.freeze({...t.deletedInfo}):void 0),Array.isArray(t.labels)&&(this.labels=[...t.labels])}toJSON(){let e={...super.toJSON(),parents:[...this.parents],permissionIds:[...this.permissionIds],lastModified:{...this.lastModified},permissions:[...this.permissions]};return this.deleted&&(e.deleted=this.deleted,e.deletedInfo={...this.deletedInfo}),Array.isArray(this.labels)&&(e.labels=[...this.labels]),e}static fromName(e,t){return new o({kind:t,info:{name:e}})}shortcutTo(e){return this.shortcutTarget=e,this}setLastModified(e){if(!e)throw new Error("The user is required.");if(e.kind!==Xt)throw new Error('Invalid value for the user when setting "lastModified".');this[Pi]={byMe:!1,time:Date.now(),user:e.key,name:e.name}}addLabel(e){if(typeof e!="string")throw new Error("The label must be a string.");if(!e.trim())throw new Error("The label is required.");Array.isArray(this.labels)||(this.labels=[]),!this.labels.includes(e)&&this.labels.push(e)}setDeleted(e){if(!e)throw new Error("The user is required.");if(e.kind!==Xt)throw new Error('Invalid value for the user when setting "deletedInfo".');this[Ci]=!0,this[Ri]={byMe:!1,time:Date.now(),user:e.key,name:e.name}}isFile(){return this.kind!==Ne}isFolder(){return this.kind===Ne}};var ti=class extends Ce{kind=Ne;static fromName(e){return super.fromName(e,Ne)}constructor(e){let t=Ce.createSchema(e);t.kind=Ne,super(t)}static isFolder(e){return!(!e||e.kind!==Ne)}toJSON(){return{...super.toJSON(),kind:Ne}}};var Di=class extends H{async list(e,t={},i={}){let{token:r}=i,a={...t},s=this.sdk.getUrl(k.files(e));this.sdk.appendListOptions(s,a);let n=await this.sdk.http.get(s.toString(),{token:r});this.inspectCommonStatusCodes(n);let l="Unable to list files. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body)}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!Array.isArray(c.data))throw new h(`${l}${O}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c}async search(e,t={},i={}){let{token:r}=i,a=this.sdk.getUrl(k.filesSearch(e)),{searchParams:s}=a;if(t.cursor&&s.set("cursor",t.cursor),typeof t.limit=="number"&&s.set("limit",String(t.limit)),t.parent&&s.set("parent",t.parent),t.kind)for(let l of t.kind)s.append("kind",l);if(t.query)for(let l of t.query)s.append("query",l);let n=await this.sdk.http.get(a.toString(),{token:r});return this.processListResponse(n,"Unable to search files. ")}async create(e,t,i,r={},a={}){let s=await this.createMeta(e,i,r,a);return await this.createMedia(t,i,s.key,r,a),s}async createMeta(e,t,i={},r={}){let{token:a}=r,s=this.sdk.getUrl(k.files(t));i.parent&&s.searchParams.set("parent",i.parent);let n=JSON.stringify(e),l=await this.sdk.http.post(s.toString(),{token:a,body:n,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(l);let c="Unable to create a file. ";if(l.status!==201)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(!p.key)throw new h(`${c}${O}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p}async createMedia(e,t,i,r={},a={}){let{token:s}=a,n=k.fileMedia(t,i),l=this.sdk.getUrl(n),c=r.mime||"application/json",p;c.includes("json")?p=JSON.stringify(e):p=String(e);let u=await this.sdk.http.put(l.toString(),{token:s,body:p,headers:{"content-type":c}});this.inspectCommonStatusCodes(u);let m="Unable to create a file. ";if(u.status!==200)throw this.logInvalidResponse(u),this.createApiError(`${m}${_}${u.status}`,u.body)}async createFolder(e,t,i={},r={}){let a=ti.fromName(e),{token:s}=r,n=this.sdk.getUrl(k.files(t));i.parent&&n.searchParams.set("parent",i.parent);let l=JSON.stringify(a),c=await this.sdk.http.post(n.toString(),{token:s,body:l,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(c);let p="Unable to create a file. ";if(c.status!==201)throw this.logInvalidResponse(c),this.createApiError(`${p}${_}${c.status}`,c.body);if(!c.body)throw new h(`${p}${$}`,{code:"E_RESPONSE_NO_VALUE",status:c.status});let u;try{u=JSON.parse(c.body).data}catch{throw new h(`${p}${I}`,{code:"E_INVALID_JSON",status:c.status})}if(!u.key)throw new h(`${p}${O}`,{code:"E_RESPONSE_UNKNOWN",status:c.status});return u}async read(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.file(e,t)),s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to read a file. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!l.kind)throw new h(`${n}${O}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l}async readMedia(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.fileMedia(e,t)),s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to read a file media. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}let c=s.headers.get("x-version");if(!c)throw new h(`${n}The file media version was not sent by the server.`,{status:s.status,code:"E_RESPONSE_NO_VERSION"});let p=Number(c);if(isNaN(p))throw new h(`${n}The file media version is not a number.`,{status:s.status,code:"E_RESPONSE_INVALID_VERSION"});return{media:l,version:p}}async readBulk(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.filesBatch(e)),s=JSON.stringify({ids:t}),n=await this.sdk.http.post(a.toString(),{token:r,body:s});this.inspectCommonStatusCodes(n);let l="Unable to read files in bulk. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body)}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!Array.isArray(c.data))throw new h(`${l}${O}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c}async patch(e,t,i,r={}){let{token:a}=r,s=k.file(e,t),n=this.sdk.getUrl(s),l=JSON.stringify(i),c=await this.sdk.http.patch(n.toString(),{token:a,body:l});this.inspectCommonStatusCodes(c);let p="Unable to patch a file. ";if(c.status!==200)throw this.logInvalidResponse(c),this.createApiError(`${p}${_}${c.status}`,c.body);if(!c.body)throw new h(`${p}${$}`,{code:"E_RESPONSE_NO_VALUE",status:c.status});let u;try{u=JSON.parse(c.body).data}catch{throw new h(`${p}${I}`,{code:"E_INVALID_JSON",status:c.status})}if(!u.kind)throw new h(`${p}${O}`,{code:"E_RESPONSE_UNKNOWN",status:c.status});return u}async patchMedia(e,t,i,r={}){let{token:a}=r,s=k.fileMedia(e,t),n=this.sdk.getUrl(s),l=JSON.stringify(i),c=await this.sdk.http.patch(n.toString(),{token:a,body:l});this.inspectCommonStatusCodes(c);let p="Unable to patch a file contents. ";if(c.status!==200)throw this.logInvalidResponse(c),this.createApiError(`${p}${_}${c.status}`,c.body);if(!c.body)throw new h(`${p}${$}`,{code:"E_RESPONSE_NO_VALUE",status:c.status});let u;try{u=JSON.parse(c.body).data}catch{throw new h(`${p}${I}`,{code:"E_INVALID_JSON",status:c.status})}return u}async delete(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.file(e,t)),s=await this.sdk.http.delete(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to trash a file. ";if(s.status!==204)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body)}async deleteBulk(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.files(e)),s=await this.sdk.http.delete(a.toString(),{token:r,body:JSON.stringify({ids:t})});this.inspectCommonStatusCodes(s);let n="Unable to trash files. ";if(s.status!==204)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body)}async patchUsers(e,t,i,r={}){let{token:a}=r,s=this.sdk.getUrl(k.filesAccess(e,t)),n=JSON.stringify(i),l=await this.sdk.http.patch(s.toString(),{token:a,body:n});this.inspectCommonStatusCodes(l);let c="Unable to patch the file. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(!p.key)throw new h(`${c}${O}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p}async addUser(e,t,i,r,a,s){let n={op:"add",type:"user",value:r,id:i};typeof a=="number"&&(n.expirationTime=a);let l={patch:[n],id:R()};return this.patchUsers(e,t,l,s)}async removeUser(e,t,i,r){let s={patch:[{op:"remove",type:"user",id:i}],id:R()};return this.patchUsers(e,t,s,r)}async listUsers(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.fileUsers(e,t)),s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to list users in the file. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body)}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!Array.isArray(l.data))throw new h(`${n}${O}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l}async breadcrumbs(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.fileBreadcrumbs(e,t)),s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to read breadcrumbs. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body)}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!Array.isArray(l.data))throw new h(`${n}${O}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l}};var Ui=class extends H{async me(e={}){let{token:t}=e,i=this.sdk.getUrl(k.usersMe()),r=await this.sdk.http.get(i.toString(),{token:t});this.inspectCommonStatusCodes(r);let a="Unable to read a user. ";if(r.status!==200)throw this.logInvalidResponse(r),this.createApiError(`${a}${_}${r.status}`,r.body);if(!r.body)throw new h(`${a}${$}`,{code:"E_RESPONSE_NO_VALUE",status:r.status});let s;try{s=JSON.parse(r.body).data}catch{throw new h(`${a}${I}`,{code:"E_INVALID_JSON",status:r.status})}if(!s.key)throw new h(`${a}${O}`,{code:"E_RESPONSE_UNKNOWN",status:r.status});return s}async listTokens(e={}){let{token:t}=e,i=this.sdk.getUrl(k.usersMeTokens()),r=await this.sdk.http.get(i.toString(),{token:t});this.inspectCommonStatusCodes(r);let a="Unable to list tokens. ";if(r.status!==200)throw this.logInvalidResponse(r),this.createApiError(`${a}${_}${r.status}`,r.body);if(!r.body)throw new h(`${a}${$}`,{code:"E_RESPONSE_NO_VALUE",status:r.status});let s;try{s=JSON.parse(r.body).data}catch{throw new h(`${a}${I}`,{code:"E_INVALID_JSON",status:r.status})}return s}async createToken(e={},t={}){let{token:i}=t,r=this.sdk.getUrl(k.usersMeTokens()),a=JSON.stringify(e),s=await this.sdk.http.post(r.toString(),{token:i,body:a,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(s);let n="Unable to create a token. ";if(s.status!==200&&s.status!==201)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}return l}async deleteToken(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.usersMeToken(e)),a=await this.sdk.http.delete(r.toString(),{token:i});this.inspectCommonStatusCodes(a);let s="Unable to delete a token. ";if(a.status!==204)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body)}};var Li=class extends H{async list(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.shared(e));this.sdk.appendListOptions(a,t);let s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to list shared files. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body)}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!Array.isArray(l.data))throw new h(`${n}${O}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l}};var Mi=class extends H{async list(e,t,i,r={}){let{token:a}=r,s=this.sdk.getUrl(k.fileRevisions(e,t));this.sdk.appendListOptions(s,i);let n=await this.sdk.http.get(s.toString(),{token:a});this.inspectCommonStatusCodes(n);let l="Unable to list revisions for a file. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body)}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!Array.isArray(c.data))throw new h(`${l}${O}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c}};var zi=class extends H{async list(e,t={},i={}){let{token:r}=i,a=this.sdk.getUrl(k.trash(e));this.sdk.appendListOptions(a,t);let s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to list trash. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body)}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!Array.isArray(l.data))throw new h(`${n}${O}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l}async delete(e,t,i={}){let r=k.trashBatchDelete(e),a=this.sdk.getUrl(r),{token:s}=i,n=await this.sdk.http.delete(a.toString(),{token:s,body:JSON.stringify({ids:t})});this.inspectCommonStatusCodes(n);let l="Unable to delete trash. ";if(n.status!==204)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body)}async restore(e,t,i={}){let r=this.sdk.getUrl(k.trashBatchRestore(e)),{token:a}=i,s=await this.sdk.http.post(r.toString(),{token:a,body:JSON.stringify({ids:t})});this.inspectCommonStatusCodes(s);let n="Unable to restore from trash. ";if(s.status!==204)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body)}async empty(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.trashEmpty(e)),a=await this.sdk.http.delete(r.toString(),{token:i});this.inspectCommonStatusCodes(a);let s="Unable to empty trash. ";if(a.status!==204)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body)}};var Vi=class extends H{async list(e={}){let{token:t}=e,i=this.sdk.getUrl(k.organizations()),r=await this.sdk.http.get(i.toString(),{token:t});this.inspectCommonStatusCodes(r);let a="Unable to list your organizations. ";if(r.status!==200)throw this.logInvalidResponse(r),this.createApiError(`${a}${_}${r.status}`,r.body);if(!r.body)throw new h(`${a}${$}`,{code:"E_RESPONSE_NO_VALUE",status:r.status});let s;try{s=JSON.parse(r.body)}catch{throw new h(`${a}${I}`,{code:"E_INVALID_JSON",status:r.status})}if(!Array.isArray(s.data))throw new h(`${a}${O}`,{code:"E_RESPONSE_UNKNOWN",status:r.status});return s}async create(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.organizations()),s={name:e,slug:t},n=await this.sdk.http.post(a.toString(),{body:JSON.stringify(s),token:r,headers:{"Content-Type":"application/json"}});this.inspectCommonStatusCodes(n);let l="Unable to create an organization. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body).data}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!c.kind)throw new h(`${l}${O}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c}invitations={list:async(e,t={})=>{let{token:i}=t,r=this.sdk.getUrl(k.invitations(e)),a=await this.sdk.http.get(r.toString(),{token:i});this.inspectCommonStatusCodes(a);let s="Unable to list organization invitations. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);if(!a.body)throw new h(`${s}${$}`,{code:"E_RESPONSE_NO_VALUE",status:a.status});let n;try{n=JSON.parse(a.body)}catch{throw new h(`${s}${I}`,{code:"E_INVALID_JSON",status:a.status})}if(!Array.isArray(n.data))throw new h(`${s}${O}`,{code:"E_RESPONSE_UNKNOWN",status:a.status});return n},create:async(e,t,i,r,a={})=>{let s=this.sdk.getUrl(k.invitations(e)),n={email:t,name:r,grant_type:i},l=await this.sdk.http.post(s.toString(),{body:JSON.stringify(n),token:a.token,headers:{"Content-Type":"application/json"}});this.inspectCommonStatusCodes(l);let c="Unable to create an invitation. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(!p.kind)throw new h(`${c}${O}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p},findByToken:async(e,t={})=>{let i=this.sdk.getUrl(k.findInvitation());i.searchParams.append("token",e);let r=await this.sdk.http.get(i.toString(),t);this.inspectCommonStatusCodes(r);let a="Unable to find invitation by token. ";if(r.status!==200)throw this.logInvalidResponse(r),this.createApiError(`${a}${_}${r.status}`,r.body);if(!r.body)throw new h(`${a}${$}`,{code:"E_RESPONSE_NO_VALUE",status:r.status});let s;try{s=JSON.parse(r.body).data}catch{throw new h(`${a}${I}`,{code:"E_INVALID_JSON",status:r.status})}if(!s.kind)throw new h(`${a}${O}`,{code:"E_RESPONSE_UNKNOWN",status:r.status});return s},decline:async(e,t,i={})=>{let r=this.sdk.getUrl(k.declineInvitation(e,t)),a=await this.sdk.http.post(r.toString(),i);this.inspectCommonStatusCodes(a);let s="Unable to decline invitation. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);if(!a.body)throw new h(`${s}${$}`,{code:"E_RESPONSE_NO_VALUE",status:a.status});let n;try{n=JSON.parse(a.body).data}catch{throw new h(`${s}${I}`,{code:"E_INVALID_JSON",status:a.status})}if(!n.kind)throw new h(`${s}${O}`,{code:"E_RESPONSE_UNKNOWN",status:a.status});return n},delete:async(e,t,i={})=>{let r=this.sdk.getUrl(k.invitation(e,t)),a=await this.sdk.http.delete(r.toString(),i);this.inspectCommonStatusCodes(a);let s="Unable to delete invitation. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);if(!a.body)throw new h(`${s}${$}`,{code:"E_RESPONSE_NO_VALUE",status:a.status});let n;try{n=JSON.parse(a.body).data}catch{throw new h(`${s}${I}`,{code:"E_INVALID_JSON",status:a.status})}if(!n.kind)throw new h(`${s}${O}`,{code:"E_RESPONSE_UNKNOWN",status:a.status});return n},patch:async(e,t,i,r={})=>{let a=this.sdk.getUrl(k.invitation(e,t)),s=await this.sdk.http.patch(a.toString(),{body:JSON.stringify(i),token:r.token,headers:{"Content-Type":"application/json"}});this.inspectCommonStatusCodes(s);let n="Unable to update invitation. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!l.kind)throw new h(`${n}${O}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l},resend:async(e,t,i={})=>{let r=this.sdk.getUrl(k.resendInvitation(e,t)),a=await this.sdk.http.put(r.toString(),i);this.inspectCommonStatusCodes(a);let s="Unable to resend invitation. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);if(!a.body)throw new h(`${s}${$}`,{code:"E_RESPONSE_NO_VALUE",status:a.status});let n;try{n=JSON.parse(a.body).data}catch{throw new h(`${s}${I}`,{code:"E_INVALID_JSON",status:a.status})}if(!n.kind)throw new h(`${s}${O}`,{code:"E_RESPONSE_UNKNOWN",status:a.status});return n}};users={list:async(e,t,i={})=>{let{token:r}=i,a=this.sdk.getUrl(k.organizationUsers(e));this.sdk.appendListOptions(a,t);let s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to list projects. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body)}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!Array.isArray(l.data))throw new h(`${n}${O}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l},read:async(e,t,i={})=>{let{token:r}=i,a=this.sdk.getUrl(k.organizationUser(e,t)),s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to read the user info. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}return l},readBatch:async(e,t,i={})=>{let{token:r}=i,a=this.sdk.getUrl(k.organizationUserBatch(e)),s={ids:t},n=await this.sdk.http.post(a.toString(),{body:JSON.stringify(s),token:r});this.inspectCommonStatusCodes(n);let l="Unable to read the user batch info. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body)}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!Array.isArray(c.data))throw new h(`${l}${O}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c},activate:async(e,t,i={})=>{let{token:r}=i,a=this.sdk.getUrl(k.organizationUserActivate(e,t)),s=await this.sdk.http.post(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to activate the user. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}return l},deactivate:async(e,t,i={})=>{let{token:r}=i,a=this.sdk.getUrl(k.organizationUserDeactivate(e,t)),s=await this.sdk.http.post(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to deactivate the user. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}return l},delete:async(e,t,i={})=>{let{token:r}=i,a=this.sdk.getUrl(k.organizationUser(e,t)),s=await this.sdk.http.delete(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to delete the user. ";if(s.status!==204)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body)}};slugs={generate:async(e,t={})=>{let{token:i}=t,r=this.sdk.getUrl(k.orgSlugGenerate()).toString(),a={name:e},s=await this.sdk.http.post(r,{body:JSON.stringify(a),token:i});this.inspectCommonStatusCodes(s);let n="Unable to generate the slug. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!l.slug)throw new h(`${n}${O}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l.slug},validate:async(e,t={})=>{let{token:i}=t,r=this.sdk.getUrl(k.orgSlugValidate()).toString(),a={slug:e},s=await this.sdk.http.post(r,{body:JSON.stringify(a),token:i});this.inspectCommonStatusCodes(s);let n="Unable to validate the slug. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(typeof l.valid!="boolean")throw new h(`${n}${O}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l}}};var Fi=class extends H{async list(e={},t={}){let{token:i}=t,r={...e},a=this.sdk.getUrl(k.dataCatalog());this.sdk.appendListOptions(a,r),r.scope&&a.searchParams.set("scope",r.scope);let s=await this.sdk.http.get(a.toString(),{token:i});return this.processListResponse(s,"Unable to list data domains. ")}async listVersions(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.dataCatalogEntryVersions(e)),a=await this.sdk.http.get(r.toString(),{token:i});return this.processListResponse(a,"Unable to list data domain versions. ")}async publish(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.dataCatalog()),a=JSON.stringify(e),s=await this.sdk.http.post(r.toString(),{token:i,body:a,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(s);let n="Unable to publish data domain. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,He,l.kind),l}async read(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.dataCatalogEntry(e)),a=await this.sdk.http.get(r.toString(),{token:i});this.inspectCommonStatusCodes(a);let s="Unable to read data domain. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);let n=this.readResponseJSON(a,s).data;return this.assertObjectKind(s,He,n.kind),n}async deprecate(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.dataCatalogDeprecate(e)),s=JSON.stringify({reason:t}),n=await this.sdk.http.put(a.toString(),{token:r,body:s,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(n);let l="Unable to deprecate data domain. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);let c=this.readResponseJSON(n,l).data;return this.assertObjectKind(l,He,c.kind),c}async unpublish(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.dataCatalogUnpublish(e)),a=await this.sdk.http.put(r.toString(),{token:i});this.inspectCommonStatusCodes(a);let s="Unable to unpublish data domain. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);let n=this.readResponseJSON(a,s).data;return this.assertObjectKind(s,He,n.kind),n}async publishVersion(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.dataCatalogEntryVersions(e)),s=JSON.stringify(t),n=await this.sdk.http.post(a.toString(),{token:r,body:s,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(n);let l="Unable to publish data domain version. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);let c=this.readResponseJSON(n,l).data;return this.assertObjectKind(l,We,c.kind),c}async readVersion(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.dataCatalogVersion(e,t)),s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to read data domain version. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,We,l.kind),l}async listDependencies(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.dataCatalogDependencies()),a=JSON.stringify({items:e}),s=await this.sdk.http.post(r.toString(),{token:i,body:a,headers:{"content-type":"application/json"}});return this.processListResponse(s,"Unable to list data domain dependencies. ")}async checkUpdates(e,t={}){let{token:i}=t,r=e.map(l=>({fid:l.key,version:l.version})),a=this.sdk.getUrl(k.dataCatalogUpdates()),s=JSON.stringify({dependencies:r}),n=await this.sdk.http.post(a.toString(),{token:i,body:s,headers:{"content-type":"application/json"}});return this.processListResponse(n,"Unable to check for data domain updates. ")}async deprecateVersion(e,t,i,r={}){let{token:a}=r,s=this.sdk.getUrl(k.dataCatalogVersionDeprecate(e,t)),n=JSON.stringify({reason:i}),l=await this.sdk.http.put(s.toString(),{token:a,body:n,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(l);let c="Unable to deprecate data domain version. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);let p=this.readResponseJSON(l,c).data;return this.assertObjectKind(c,We,p.kind),p}async unpublishVersion(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.dataCatalogVersionUnpublish(e,t)),s=await this.sdk.http.put(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to unpublish data domain version. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,We,l.kind),l}async checkPublicationStatus(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.dataCatalogStatus(e));t&&a.searchParams.set("oid",t);let s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to check data domain publication status. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,He,l.kind),l}};var Ki=class extends H{async create(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.groups(e)),s=JSON.stringify(t),n=await this.sdk.http.post(a.toString(),{token:r,body:s,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(n);let l="Unable to create a group. ";if(n.status!==201)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body).data}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!c.key)throw new h(`${l}${O}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c}async list(e,t={},i={}){let{token:r}=i,a=this.sdk.getUrl(k.groups(e));this.sdk.appendListOptions(a,t);let s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to create a group. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(n+_+s.status,s.body);if(!s.body)throw new h(n+$,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body)}catch{throw new h(n+I,{code:"E_INVALID_JSON",status:s.status})}return l}async update(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.group(e,t.key)),s=JSON.stringify(t),n=await this.sdk.http.put(a.toString(),{token:r,body:s,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(n);let l="Unable to update a group. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body).data}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!c.key)throw new h(`${l}${O}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c}async delete(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.group(e,t)),s=await this.sdk.http.delete(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to delete a group. ";if(s.status!==204)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body)}async addUsers(e,t,i,r={}){let{token:a}=r,s=this.sdk.getUrl(k.groupUsers(e,t)),n=JSON.stringify({ids:i}),l=await this.sdk.http.post(s.toString(),{token:a,body:n,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(l);let c="Unable to add users to a group. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(!p.key)throw new h(`${c}${O}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p}async removeUsers(e,t,i,r={}){let{token:a}=r,s=this.sdk.getUrl(k.groupUsers(e,t)),n=JSON.stringify({ids:i}),l=await this.sdk.http.delete(s.toString(),{token:a,body:n,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(l);let c="Unable to remove users from a group. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(!p.key)throw new h(`${c}${O}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p}};var qi=class extends H{async*modifyDomain(e,t,i,r,a={}){let{token:s=this.sdk.token,signal:n}=a,l=this.sdk.getUrl(k.aiModifyDomain(e,t)),c=JSON.stringify({goal:i,sid:r}),p={method:"POST",headers:{"content-type":"application/json",accept:"text/event-stream",authorization:`Bearer ${s}`},redirect:"follow",credentials:"include",body:c,signal:n},u=await fetch(l,p);if(!u.ok){let b=await u.text();throw new h(`Failed to modify domain: ${u.status} ${b}`)}let m=u.body?.getReader();if(!m)throw new h("Failed to get reader from response");let g=new TextDecoder,f="";for(;;){let{done:b,value:v}=await m.read();if(b)return;f+=g.decode(v,{stream:!0});let S;for(;(S=f.indexOf(`
|
|
15
|
+
Please report this bug: ${s}`)}}}list(e,t,i={}){if(this.format==="json")console.log(JSON.stringify(e,null,2));else{if(e.length===0){console.log("No records found.");return}console.log(Jn(e,t,i.headers))}}object(e){let t=e;if(this.format==="json")console.log(JSON.stringify(t,null,2));else for(let[i,r]of Object.entries(t)){let a=typeof r=="object"&&r!==null?JSON.stringify(r):String(r);console.log(`${G.bold(i)}: ${a}`)}}};function Ka(o){let e=o.command("config").description("Manage CLI configuration settings");e.command("get <key>").description("Get a configuration value").action(t=>{let i=new B({format:N.resolved.format}),r=N.resolved;if(t in r){let a=r[t];N.resolved.format==="json"?i.object({[t]:a}):console.log(a)}else i.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Configuration key '${t}' not found.`,detail:`Run \`apinow config set ${t} <value>\` to define it.`}),process.exit(1)}),e.command("set <key> <value>").description("Set a configuration value").action((t,i)=>{let r=new B({format:N.resolved.format}),a=["apiUrl","token","org"];a.includes(t)||(r.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Invalid configuration key '${t}'.`,detail:`Allowed keys: ${a.join(", ")}`}),process.exit(1)),N.writeProperty(t,i),r.success(`Configuration '${t}' set to '${i}'.`)}),e.command("reset").description("Reset all configuration settings and remove stored files").action(()=>{let t=new B({format:N.resolved.format});N.reset(),t.success("Configuration has been reset successfully.")})}import{Argument as Zn}from"commander";import Qn from"node:http";import eo from"open";import Ja from"http";import Ga from"https";function Wt(o){return typeof o!="string"&&(o=String(o)),o.toLowerCase()}function qa(o){return typeof o!="string"&&(o=String(o)),o}function*Gn(o){if(!o||o.trim()==="")return[];let e=o.split(/\n(?=[^ \t]+)/gim);for(let t=0,i=e.length;t<i;t++){let r=e[t].trim();if(r==="")continue;let a=r.startsWith("#");a&&(r=r.replace("#","").trim());let s=r.indexOf(":");if(s===-1)yield{name:r,value:"",enabled:!a};else{let n=r.substring(0,s),l=r.substring(s+1).trim();yield{name:n,value:l,enabled:!a}}}}var Yt=class o{_map={};constructor(e){if(e instanceof o)e.forEach((t,i)=>this.append(i,t));else if(typeof e=="string")for(let t of Gn(e))this.append(t.name,t.value,t.enabled);else e&&Object.keys(e).forEach(t=>this.append(t,e[t]))}append(e,t,i=!0){if(Array.isArray(t)){t.forEach(s=>this.append(e,s));return}let r=Wt(e);t=t?qa(t):"";let a=this._map[r];if(a){let s=a.value;a.value=s?`${s},${t}`:t}else a={name:e,value:t,enabled:i};this._map[r]=a}delete(e){delete this._map[Wt(e)]}get(e){if(e=Wt(e),!!this.has(e)&&this._map[e].enabled)return this._map[e].value}has(e){let t=Wt(e);return Object.prototype.hasOwnProperty.call(this._map,t)&&this._map[t].enabled}set(e,t,i=!0){let r=Wt(e);this._map[r]={value:qa(t),name:e,enabled:i}}forEach(e,t){Object.keys(this._map).forEach(r=>{let a=this._map[r];e.call(t,a.value,a.name,a.enabled,this)})}map(e,t){let i=Object.keys(this._map),r=[];for(let a of i){let s=this._map[a],n=e.call(t,s.value,s.name,s.enabled);r.push(n)}return r}toString(){return this._generateString()}toRawString(){return this._generateString(!0)}toJSON(){let e={};for(let[t,i]of this.entries())e[t]=i;return e}_generateString(e=!1){let t=[],i=Object.keys(this._map);for(let r of i){let a=this._map[r],s="";if(!a.enabled)if(e)s+="# ";else continue;s+=`${a.name}: `,a.value&&(s+=a.value),t.push(s)}return t.join(`
|
|
16
|
+
`)}*keys(){let e=Object.keys(this._map);for(let t of e)this._map[t].enabled&&(yield this._map[t].name)}*values(){let e=Object.keys(this._map);for(let t of e)this._map[t].enabled&&(yield this._map[t].value)}*entries(){let e=Object.keys(this._map);for(let t of e)this._map[t].enabled&&(yield[this._map[t].name,this._map[t].value])}*[Symbol.iterator](){let e=Object.keys(this._map);for(let t of e)this._map[t].enabled&&(yield[this._map[t].name,this._map[t].value])}};var h=class extends Error{name;status;static fromRawException(e,t){let i=e,r={};if(i.code!==void 0&&(r.code=String(i.code)),i.status!==void 0){let n=Number(i.status);isNaN(n)||(r.status=n)}i.help!==void 0&&(r.help=String(i.help));let a=i.message!==void 0?String(i.message):t,s=new this(a,r);return i.name!==void 0&&(s.name=String(i.name)),s}constructor(e,t){super(e,t);let i=this.constructor;this.name=i.name,this.message=e??i.message??"",this.status=t?.status??i.status??500;let r=t?.code??i.code;r!==void 0&&(this.code=r);let a=t?.help??i.help;a!==void 0&&(this.help=a),Error.captureStackTrace(this,i)}setHelp(e){return this.help=e,this}setCode(e){return this.code=e,this}setStatus(e){return this.status=e,this}get[Symbol.toStringTag](){return this.constructor.name}toString(){return this.code?`${this.name} [${this.code}]: ${this.message}`:`${this.name}: ${this.message}`}toJSON(){let e={name:this.name,message:this.message};return this.status&&(e.status=this.status),this.code&&(e.code=this.code),this.help&&(e.help=this.help),e}};var I="Invalid JSON response.",$="The response has no value.",_="Invalid response status: ",C="Unknown response from the server.";var H=class{sdk;constructor(e){this.sdk=e}logInvalidResponse(e){if(!this.sdk.silent&&e.body)try{let t=JSON.parse(e.body);t.message&&console.warn(`[Store message]: ${t.message}`)}catch{}}inspectCommonStatusCodes(e){let{status:t,body:i}=e;if(t===404){let r=this.createApiError("Not found",i);throw r.status!==404&&r.setStatus(404),r.code!=="E_NOT_FOUND"&&r.setCode("E_NOT_FOUND"),r}if(t===403){let r=this.createApiError("You have no access to this resource",i);throw r.status!==403&&r.setStatus(403),r.code!=="E_FORBIDDEN"&&r.setCode("E_FORBIDDEN"),r}if(t===401){let r=this.createApiError("Not authorized",i);throw r.status!==401&&r.setStatus(401),r.code!=="E_UNAUTHORIZED"&&r.setCode("E_UNAUTHORIZED"),r}}createApiError(e,t){if(!t)return new h(e);let i;try{i=JSON.parse(t)}catch{return new h(e)}return!i||typeof i!="object"||!i.message?new h(e):h.fromRawException(i,e)}async genericBatchDelete(e,t,i={}){let{token:r}=i,a=await this.sdk.http.post(e.toString(),{token:r,body:JSON.stringify(t)});this.inspectCommonStatusCodes(a);let s="Unable to delete in batch. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);if(!a.body)throw new h(`${s}${$}`,{code:"E_RESPONSE_NO_VALUE",status:a.status});let n;try{n=JSON.parse(a.body)}catch{throw new h(`${s}${I}`,{code:"E_INVALID_JSON",status:a.status})}if(!Array.isArray(n.data))throw new h(`${s}${C}`,{code:"E_RESPONSE_UNKNOWN",status:a.status});return n}async genericDelete(e,t={}){let{token:i}=t,r=await this.sdk.http.delete(e.toString(),{token:i});this.inspectCommonStatusCodes(r);let a="Unable to delete the object. ";if(r.status!==204)throw this.logInvalidResponse(r),this.createApiError(`${a}${_}${r.status}`,r.body)}async genericList(e,t,i={}){let{token:r}=i;this.sdk.appendListOptions(e,t);let a=await this.sdk.http.get(e.toString(),{token:r});this.inspectCommonStatusCodes(a);let s="Unable to list revisions for a file. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);if(!a.body)throw new h(`${s}${$}`,{code:"E_RESPONSE_NO_VALUE",status:a.status});let n;try{n=JSON.parse(a.body)}catch{throw new h(`${s}${I}`,{code:"E_INVALID_JSON",status:a.status})}if(!Array.isArray(n.data))throw new h(`${s}${C}`,{code:"E_RESPONSE_UNKNOWN",status:a.status});return n}readResponseBody(e,t){if(![200,202].includes(e.status))throw this.logInvalidResponse(e),this.createApiError(`${t}${_}${e.status}`,e.body);if(!e.body)throw new h(`${t}${$}`,{code:"E_RESPONSE_NO_VALUE",status:e.status});return e.body}readResponseJSON(e,t){let i=this.readResponseBody(e,t),r;try{r=JSON.parse(i)}catch{throw new h(`${t}${I}`,{code:"E_INVALID_JSON",status:e.status})}return r}processListResponse(e,t){this.inspectCommonStatusCodes(e);let i=this.readResponseJSON(e,t);if(!Array.isArray(i.data))throw new h(`${t}${C}`,{code:"E_RESPONSE_UNKNOWN",status:e.status});return i}assertObjectKind(e,t,i){if(t!==i)throw new h(`${e}${C}`,{code:"E_RESPONSE_UNKNOWN",status:500})}};var $i=class extends H{};var Ti=class extends $i{async get(e,t={}){let i=await this._get(e,t);if([301,302,308,307].includes(i.status)){let r=i.headers.get("location");if(!r)throw new Error('Expected redirection but no "location" header.');let a=new URL(r,e);return this.get(a.toString(),t)}return i}_get(e,t={}){return new Promise((i,r)=>{let{method:a="GET",headers:s={},token:n}=t,l={...s};n&&(l.authorization=`Bearer ${n}`);let u=(e.startsWith("https:")?Ga:Ja).request(e,{method:a,headers:l,rejectUnauthorized:!1});u.on("response",m=>{let g={status:m.statusCode,headers:new Yt(m.headers),body:""};m.on("data",f=>{g.body+=f}),m.on("end",()=>i(g))}),u.on("error",m=>r(m)),u.end()})}post(e,t={}){return new Promise((i,r)=>{let{method:a="POST",headers:s={},token:n}=t,l={...s};n&&(l.authorization=`Bearer ${n}`);let u=(e.startsWith("https:")?Ga:Ja).request(e,{method:a,headers:l});u.on("response",m=>{let g={status:m.statusCode,headers:new Yt(m.headers),body:""};m.on("data",f=>{g.body+=f}),m.on("end",()=>i(g))}),u.on("error",m=>r(m)),t.body&&u.write(t.body),u.end()})}patch(e,t={}){let i={...t,method:"PATCH"};return this.post(e,i)}put(e,t={}){let i={...t,method:"PUT"};return this.post(e,i)}delete(e,t={}){let i={...t,method:"DELETE"};return this.post(e,i)}};var k=class o{static folders(e){return`/v1/orgs/${e}/folders`}static files(e){return`/v1/orgs/${e}/files`}static filesSearch(e){return`${o.files(e)}/search`}static filesAccess(e,t){return`${o.file(e,t)}/access`}static filesBatch(e){return`${o.files(e)}/batch/read-meta`}static file(e,t){return`${o.files(e)}/${t}`}static fileMedia(e,t){return`${o.file(e,t)}/media`}static fileUsers(e,t){return`${o.file(e,t)}/users`}static fileRevisions(e,t){return`${o.file(e,t)}/revisions`}static fileBreadcrumbs(e,t){return`${o.file(e,t)}/breadcrumbs`}static history(){return"/history"}static historyBatchCreate(){return"/history/batch/create"}static historyBatchDelete(){return"/history/batch/delete"}static historyItem(e){return`/history/${e}`}static historyClear(e,...t){return`/history/clear/${e}/${t.join("/")}`}static shared(e){return`/v1/orgs/${e}/shared`}static trash(e){return`/v1/orgs/${e}/trash`}static trashItem(e,t){return`${o.trash(e)}/${t}`}static trashRestore(e,t){return`${o.trashItem(e,t)}/restore`}static trashEmpty(e){return`${o.trash(e)}/empty`}static trashBatchRestore(e){return`${o.trash(e)}/restore`}static trashBatchDelete(e){return`${o.trash(e)}/delete`}static projectExecutions(){return"/project/execution"}static projectExecution(e){return`/project/execution/${e}`}static projectExecutionBulkDelete(){return"/project/execution/delete"}static projectExecutionClear(e){return`/project/execution/clear/${e}`}static organizations(){return"/v1/orgs"}static organization(e){return`/v1/orgs/${e}`}static organizationUsers(e){return`${this.organization(e)}/users`}static organizationUserBatch(e){return`${this.organization(e)}/users/batch/read`}static organizationUser(e,t){return`${this.organization(e)}/users/${t}`}static organizationUserDeactivate(e,t){return`${this.organization(e)}/users/${t}/deactivate`}static organizationUserActivate(e,t){return`${this.organization(e)}/users/${t}/activate`}static invitations(e){return`${this.organization(e)}/invitations`}static invitation(e,t){return`${this.invitations(e)}/${t}`}static findInvitation(){return`${this.organizations()}/find-invitation`}static declineInvitation(e,t){return`${this.invitation(e,t)}/decline`}static resendInvitation(e,t){return`${this.invitation(e,t)}/resend`}static authGoogle(){return"/auth/google"}static authLogout(){return"/auth/logout"}static usersMe(){return"/v1/users/me"}static usersMeTokens(){return`${o.usersMe()}/tokens`}static usersMeToken(e){return`${o.usersMeTokens()}/${e}`}static dataCatalog(){return"/v1/datacatalog"}static dataCatalogStatus(e){return`${o.dataCatalog()}/status/${e}`}static dataCatalogEntry(e){return`${o.dataCatalog()}/${e}`}static dataCatalogEntryVersions(e){return`${o.dataCatalogEntry(e)}/versions`}static dataCatalogDependencies(){return`${o.dataCatalog()}/dependencies`}static dataCatalogUpdates(){return`${o.dataCatalog()}/updates`}static dataCatalogVersion(e,t){return`${o.dataCatalogEntry(e)}/${t}`}static dataCatalogDeprecate(e){return`${o.dataCatalogEntry(e)}/deprecate`}static dataCatalogUnpublish(e){return`${o.dataCatalogEntry(e)}/unpublish`}static dataCatalogVersionDeprecate(e,t){return`${o.dataCatalogVersion(e,t)}/deprecate`}static dataCatalogVersionUnpublish(e,t){return`${o.dataCatalogVersion(e,t)}/unpublish`}static groups(e){return`/v1/orgs/${e}/groups`}static group(e,t){return`/v1/orgs/${e}/groups/${t}`}static groupUsers(e,t){return`/v1/orgs/${e}/groups/${t}/users`}static aiModifyDomain(e,t){return`${this.organization(e)}/ai/domains/${t}/modify/stream`}static aiModifyApi(e,t){return`${this.organization(e)}/ai/apis/${t}/modify/stream`}static aiSessions(e,t){return`${this.organization(e)}/ai/sessions/${t}`}static aiSession(e,t,i){return`${o.aiSessions(e,t)}/${i}`}static aiMessages(e,t){return`${this.organization(e)}/ai/messages/${t}`}static aiMessage(e,t,i){return`${o.aiMessages(e,t)}/${i}`}static orgSlugGenerate(){return"/v1/orgs/slugs/generate"}static orgSlugValidate(){return"/v1/orgs/slugs/validate"}static deployments(e){return`/v1/orgs/${e}/deployments`}static deploymentsApis(e){return`${o.deployments(e)}/apis`}static deployment(e,t){return`${o.deployments(e)}/${t}`}static deploymentsApisByEnvLatest(e,t){return`${o.deploymentsApis(e)}/${t}/environments/latest`}static rollback(e,t){return`${o.deployment(e,t)}/rollback`}static job(e,t){return`/v1/orgs/${e}/jobs/${t}`}};var Ci=class extends H{oauthRedirect(e,t={}){let{redirect:i,token:r,type:a="redirect"}=t,s=new URL(this.sdk.baseUri);if(!["google","github","linkedin"].includes(e))throw new Error(`Invalid provider: ${e}`);let n=new URL(`/auth/${e}/redirect`,s);return i&&n.searchParams.set("r",i),r&&n.searchParams.set("token",r),a==="redirect"?(window.location.href=n.toString(),null):window.open(n.toString(),"_blank")}async logout(e={}){let{token:t}=e,i=this.sdk.getUrl(k.authLogout()),r=await this.sdk.http.post(i.toString(),{token:t});this.inspectCommonStatusCodes(r);let a="Unable to log out. ";if(r.status!==204)throw this.logInvalidResponse(r),this.createApiError(`${a}${_}${r.status}`,r.body)}};import{customAlphabet as Bn}from"nanoid";var R=Bn("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_",21);var De="Core#Permission",Pe=["reader","commenter","writer","owner"],at=class o{kind=De;key="";type="user";granteeId="";role="reader";displayName;expirationTime;addingUser="";itemId="";depth=0;sourceRule="direct_user_grant";static fromUserRole(e,t,i,r){let a={key:R(),kind:De,itemId:t,granteeId:i,role:e,type:"user",addingUser:r,depth:0,sourceRule:"direct_user_grant"};return new o(a)}static fromGroupRole(e,t,i,r){let a={key:R(),kind:De,itemId:t,granteeId:i,role:e,type:"group",addingUser:r,depth:0,sourceRule:"direct_user_grant"};return new o(a)}static fromOrganizationRole(e,t,i,r){let a={key:R(),kind:De,itemId:t,granteeId:i,role:e,type:"organization",addingUser:r,depth:0,sourceRule:"direct_user_grant"};return new o(a)}static fromValues(e){return new o({...e,key:R(),kind:De})}constructor(e){let t;typeof e=="string"?t=JSON.parse(e):typeof e=="object"?t=e:t={kind:De,key:R(),granteeId:"",itemId:"",role:"reader",type:"user",addingUser:"",depth:0,sourceRule:"direct_user_grant"},this.new(t)}new(e){if(!o.isPermission(e))throw new Error("Not a permission.");let{key:t=R(),granteeId:i,role:r,type:a,displayName:s,expirationTime:n,addingUser:l,itemId:c,depth:p,sourceRule:u}=e;this.kind=De,this.key=t,this.granteeId=i,this.itemId=c,this.role=r,this.type=a,this.addingUser=l,this.depth=p||0,this.sourceRule=u||"direct_user_grant",s?this.displayName=s:this.displayName=void 0,typeof n=="number"?this.expirationTime=n:this.expirationTime=void 0}static isPermission(e){return!(!e||e.kind!==De)}static hasRole(e,t){if(!t)return!1;let i=Pe.indexOf(t),r=Pe.indexOf(e);return i>=r}static isHigherRole(e,t){let i=Pe.indexOf(e),r=Pe.indexOf(t);return i>r}hasRole(e){return o.hasRole(e,this.role)}static hasRoleIn(e,t){if(!t||!t.length)return!1;let i=[...t].sort((l,c)=>l.depth-c.depth),r=i[0].depth,a=i.filter(l=>l.depth===r),s,n=a.filter(l=>l.type==="user");if(n.length)s=n.sort((l,c)=>Pe.indexOf(c.role)-Pe.indexOf(l.role))[0];else{let l=a.filter(c=>c.type==="group");if(l.length)s=l.sort((c,p)=>Pe.indexOf(p.role)-Pe.indexOf(c.role))[0];else{let c=a.filter(p=>p.type==="organization");c.length&&(s=c.sort((p,u)=>Pe.indexOf(u.role)-Pe.indexOf(p.role))[0])}}return s?o.hasRole(e,s.role):!1}toJSON(){let e={kind:De,key:this.key,role:this.role,type:this.type,addingUser:this.addingUser,granteeId:this.granteeId,itemId:this.itemId,depth:this.depth,sourceRule:this.sourceRule};return this.displayName&&(e.displayName=this.displayName),this.expirationTime&&(e.expirationTime=this.expirationTime),e}};var st="Core#Thing",Ne="Core#Folder";var Xt="Core#User",Zt="Data#DomainFile",He="Data#Domain",ne="Domain#Namespace",te="Domain#Model",J="Domain#Entity",oe="Domain#Association",Z="Domain#Property",We="Core#DataCatalog",Ye="Core#DataCatalogVersion";var Pt="Core#Deployment",be="Core#ApiModel",bt="Core#ExposedEntity",Ur="Core#ApiFile";var Qt="Core#AiSession",Lr="Core#AiMessage",Mr="Core#Job";var W=class o{kind=st;name;displayName;description;version;static fromName(e){return new o({name:e,kind:st})}static fromJSON(e={},t={}){let i=new o,{name:r,displayName:a,description:s,version:n}=e||{};return typeof r=="string"?i.name=r:typeof t.name=="string"&&(i.name=t.name),typeof a=="string"?i.displayName=a:typeof t.displayName=="string"&&(i.displayName=t.displayName),s?i.description=s:typeof t.description=="string"&&(i.description=t.description),n?i.version=n:typeof t.version=="string"&&(i.version=t.version),i}constructor(e){let t;typeof e=="string"?t=JSON.parse(e):typeof e=="object"?t=e:t={kind:st},this.new(t)}new(e){if(!o.isThing(e))throw new Error("Not a thing.");let{description:t,name:i,version:r,displayName:a}=e;this.kind=st,this.name=i,this.displayName=a,this.description=t,this.version=r}static validate(e,t={}){let{strict:i}=t;return e&&typeof e=="object"?!(i&&e.kind!==st):!1}static isThing(e){return!!(e&&e.kind===st)}toJSON(){let e={kind:st};return typeof this.name=="string"&&(e.name=this.name),typeof this.displayName=="string"&&(e.displayName=this.displayName),this.description&&(e.description=this.description),this.version&&(e.version=this.version),e}getLabel(e){return this.displayName||this.name||e||"Unnamed object"}};var zr=Symbol("parents"),Oi=Symbol("deleted"),Ri=Symbol("deletedInfo"),Pi=Symbol("lastModified"),Vr=Symbol("capabilities"),Fr=Symbol("permissions"),Kr=Symbol("permissionIds"),qr=Symbol("shortcutTarget"),ei=class{kind="";key="";info=W.fromName("");iconColor;get isShortcut(){return!!this.shortcutTarget}[qr];get shortcutTarget(){return this[qr]}set shortcutTarget(e){this[qr]=e}static createSchema(e={}){let{key:t=R(),kind:i,iconColor:r,shortcutTarget:a}=e,s={key:t,kind:i||"",info:W.fromJSON(e.info,{name:"Unnamed file"}).toJSON()};return r&&(s.iconColor=r),a&&(s.isShortcut=!0,s.shortcutTarget=a),s}constructor(e){this.kind=e.kind,this.key=e.key,this.info=new W(e.info),e.iconColor&&(this.iconColor=e.iconColor),e.shortcutTarget&&(this.shortcutTarget=e.shortcutTarget)}toJSON(){let e={key:this.key,kind:this.kind,info:this.info.toJSON()};return this.iconColor&&(e.iconColor=this.iconColor),this.shortcutTarget&&(e.isShortcut=!0,e.shortcutTarget=this.shortcutTarget),e}static createFileCapabilities(e,t){let i=at.hasRole("commenter",t),r=at.hasRole("owner",t),a=at.hasRole("reader",t),s=at.hasRole("writer",t),n=e.kind===Ne;return{canReadMedia:!n&&a,canListChildren:n&&a,canComment:!n&&i,canEditMedia:!n&&s,canEditMeta:s,canReadRevisions:s,canAddChildren:n&&s,canDelete:r,canTrash:r,canUntrash:r,canShare:s,canMove:s}}createFileCapabilities(e){return Oe.createFileCapabilities(this,e)}static updateByMeMeta(e,t){e.deletedInfo&&(e.deletedInfo.byMe=e.deletedInfo.user===t),e.lastModified&&(e.lastModified.byMe=e.lastModified.user===t)}static setLastModified(e,t){if(!e)throw new Error("The file is required.");if(!t)throw new Error("The user is required.");if(t.kind!==Xt)throw new Error('Invalid value for the user when setting "lastModified".');return e.lastModified={byMe:!1,time:Date.now(),user:t.key,name:t.name},e}static setDeleted(e,t){if(!e)throw new Error("The file is required.");if(!t)throw new Error("The user is required.");if(t.kind!==Xt)throw new Error('Invalid value for the user when setting "deletedInfo".');return e.deleted=!0,e.deletedInfo={byMe:!1,time:Date.now(),user:t.key,name:t.name},e}},Oe=class o extends ei{[zr]=[];get parents(){return this[zr]}[Kr]=[];get permissionIds(){return this[Kr]}[Oi];get deleted(){return this[Oi]||!1}[Ri];get deletedInfo(){return this[Ri]}[Pi]={user:"",time:0,byMe:!1};get lastModified(){return this[Pi]}labels;[Vr];get capabilities(){return this[Vr]}[Fr]=[];get permissions(){return this[Fr]}static createSchema(e={}){let t=ei.createSchema(e);return Array.isArray(e.parents)?t.parents=[...e.parents]:t.parents=[],Array.isArray(e.permissionIds)?t.permissionIds=[...e.permissionIds]:t.permissionIds=[],Array.isArray(e.permissions)?t.permissions=e.permissions.map(i=>({...i})):t.permissions=[],e.capabilities&&(t.capabilities={...e.capabilities}),e.lastModified?t.lastModified={...e.lastModified}:t.lastModified={user:"",time:0,byMe:!1},typeof e.deleted=="boolean"&&(t.deleted=e.deleted,t.deletedInfo=e.deletedInfo?{...e.deletedInfo}:void 0),Array.isArray(e.labels)&&(t.labels=[...e.labels]),typeof e.shortcutTarget=="string"&&(t.shortcutTarget=e.shortcutTarget),t}constructor(e){let t=o.createSchema(e);super(t),this[zr]=[...t.parents],this[Kr]=[...t.permissionIds],this[Fr]=t.permissions.map(i=>({...i})),this[Vr]=t.capabilities?{...t.capabilities}:void 0,this[Pi]=Object.freeze({...t.lastModified}),typeof t.deleted=="boolean"&&(this[Oi]=t.deleted,this[Ri]=t.deletedInfo?Object.freeze({...t.deletedInfo}):void 0),Array.isArray(t.labels)&&(this.labels=[...t.labels])}toJSON(){let e={...super.toJSON(),parents:[...this.parents],permissionIds:[...this.permissionIds],lastModified:{...this.lastModified},permissions:[...this.permissions]};return this.deleted&&(e.deleted=this.deleted,e.deletedInfo={...this.deletedInfo}),Array.isArray(this.labels)&&(e.labels=[...this.labels]),e}static fromName(e,t){return new o({kind:t,info:{name:e}})}shortcutTo(e){return this.shortcutTarget=e,this}setLastModified(e){if(!e)throw new Error("The user is required.");if(e.kind!==Xt)throw new Error('Invalid value for the user when setting "lastModified".');this[Pi]={byMe:!1,time:Date.now(),user:e.key,name:e.name}}addLabel(e){if(typeof e!="string")throw new Error("The label must be a string.");if(!e.trim())throw new Error("The label is required.");Array.isArray(this.labels)||(this.labels=[]),!this.labels.includes(e)&&this.labels.push(e)}setDeleted(e){if(!e)throw new Error("The user is required.");if(e.kind!==Xt)throw new Error('Invalid value for the user when setting "deletedInfo".');this[Oi]=!0,this[Ri]={byMe:!1,time:Date.now(),user:e.key,name:e.name}}isFile(){return this.kind!==Ne}isFolder(){return this.kind===Ne}};var ti=class extends Oe{kind=Ne;static fromName(e){return super.fromName(e,Ne)}constructor(e){let t=Oe.createSchema(e);t.kind=Ne,super(t)}static isFolder(e){return!(!e||e.kind!==Ne)}toJSON(){return{...super.toJSON(),kind:Ne}}};var Di=class extends H{async list(e,t={},i={}){let{token:r}=i,a={...t},s=this.sdk.getUrl(k.files(e));this.sdk.appendListOptions(s,a);let n=await this.sdk.http.get(s.toString(),{token:r});this.inspectCommonStatusCodes(n);let l="Unable to list files. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body)}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!Array.isArray(c.data))throw new h(`${l}${C}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c}async search(e,t={},i={}){let{token:r}=i,a=this.sdk.getUrl(k.filesSearch(e)),{searchParams:s}=a;if(t.cursor&&s.set("cursor",t.cursor),typeof t.limit=="number"&&s.set("limit",String(t.limit)),t.parent&&s.set("parent",t.parent),t.kind)for(let l of t.kind)s.append("kind",l);if(t.query)for(let l of t.query)s.append("query",l);let n=await this.sdk.http.get(a.toString(),{token:r});return this.processListResponse(n,"Unable to search files. ")}async create(e,t,i,r={},a={}){let s=await this.createMeta(e,i,r,a);return await this.createMedia(t,i,s.key,r,a),s}async createMeta(e,t,i={},r={}){let{token:a}=r,s=this.sdk.getUrl(k.files(t));i.parent&&s.searchParams.set("parent",i.parent);let n=JSON.stringify(e),l=await this.sdk.http.post(s.toString(),{token:a,body:n,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(l);let c="Unable to create a file. ";if(l.status!==201)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(!p.key)throw new h(`${c}${C}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p}async createMedia(e,t,i,r={},a={}){let{token:s}=a,n=k.fileMedia(t,i),l=this.sdk.getUrl(n),c=r.mime||"application/json",p;c.includes("json")?p=JSON.stringify(e):p=String(e);let u=await this.sdk.http.put(l.toString(),{token:s,body:p,headers:{"content-type":c}});this.inspectCommonStatusCodes(u);let m="Unable to create a file. ";if(u.status!==200)throw this.logInvalidResponse(u),this.createApiError(`${m}${_}${u.status}`,u.body)}async createFolder(e,t,i={},r={}){let a=ti.fromName(e),{token:s}=r,n=this.sdk.getUrl(k.files(t));i.parent&&n.searchParams.set("parent",i.parent);let l=JSON.stringify(a),c=await this.sdk.http.post(n.toString(),{token:s,body:l,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(c);let p="Unable to create a file. ";if(c.status!==201)throw this.logInvalidResponse(c),this.createApiError(`${p}${_}${c.status}`,c.body);if(!c.body)throw new h(`${p}${$}`,{code:"E_RESPONSE_NO_VALUE",status:c.status});let u;try{u=JSON.parse(c.body).data}catch{throw new h(`${p}${I}`,{code:"E_INVALID_JSON",status:c.status})}if(!u.key)throw new h(`${p}${C}`,{code:"E_RESPONSE_UNKNOWN",status:c.status});return u}async read(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.file(e,t)),s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to read a file. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!l.kind)throw new h(`${n}${C}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l}async readMedia(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.fileMedia(e,t)),s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to read a file media. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}let c=s.headers.get("x-version");if(!c)throw new h(`${n}The file media version was not sent by the server.`,{status:s.status,code:"E_RESPONSE_NO_VERSION"});let p=Number(c);if(isNaN(p))throw new h(`${n}The file media version is not a number.`,{status:s.status,code:"E_RESPONSE_INVALID_VERSION"});return{media:l,version:p}}async readBulk(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.filesBatch(e)),s=JSON.stringify({ids:t}),n=await this.sdk.http.post(a.toString(),{token:r,body:s});this.inspectCommonStatusCodes(n);let l="Unable to read files in bulk. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body)}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!Array.isArray(c.data))throw new h(`${l}${C}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c}async patch(e,t,i,r={}){let{token:a}=r,s=k.file(e,t),n=this.sdk.getUrl(s),l=JSON.stringify(i),c=await this.sdk.http.patch(n.toString(),{token:a,body:l});this.inspectCommonStatusCodes(c);let p="Unable to patch a file. ";if(c.status!==200)throw this.logInvalidResponse(c),this.createApiError(`${p}${_}${c.status}`,c.body);if(!c.body)throw new h(`${p}${$}`,{code:"E_RESPONSE_NO_VALUE",status:c.status});let u;try{u=JSON.parse(c.body).data}catch{throw new h(`${p}${I}`,{code:"E_INVALID_JSON",status:c.status})}if(!u.kind)throw new h(`${p}${C}`,{code:"E_RESPONSE_UNKNOWN",status:c.status});return u}async patchMedia(e,t,i,r={}){let{token:a}=r,s=k.fileMedia(e,t),n=this.sdk.getUrl(s),l=JSON.stringify(i),c=await this.sdk.http.patch(n.toString(),{token:a,body:l});this.inspectCommonStatusCodes(c);let p="Unable to patch a file contents. ";if(c.status!==200)throw this.logInvalidResponse(c),this.createApiError(`${p}${_}${c.status}`,c.body);if(!c.body)throw new h(`${p}${$}`,{code:"E_RESPONSE_NO_VALUE",status:c.status});let u;try{u=JSON.parse(c.body).data}catch{throw new h(`${p}${I}`,{code:"E_INVALID_JSON",status:c.status})}return u}async delete(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.file(e,t)),s=await this.sdk.http.delete(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to trash a file. ";if(s.status!==204)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body)}async deleteBulk(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.files(e)),s=await this.sdk.http.delete(a.toString(),{token:r,body:JSON.stringify({ids:t})});this.inspectCommonStatusCodes(s);let n="Unable to trash files. ";if(s.status!==204)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body)}async patchUsers(e,t,i,r={}){let{token:a}=r,s=this.sdk.getUrl(k.filesAccess(e,t)),n=JSON.stringify(i),l=await this.sdk.http.patch(s.toString(),{token:a,body:n});this.inspectCommonStatusCodes(l);let c="Unable to patch the file. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(!p.key)throw new h(`${c}${C}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p}async addUser(e,t,i,r,a,s){let n={op:"add",type:"user",value:r,id:i};typeof a=="number"&&(n.expirationTime=a);let l={patch:[n],id:R()};return this.patchUsers(e,t,l,s)}async removeUser(e,t,i,r){let s={patch:[{op:"remove",type:"user",id:i}],id:R()};return this.patchUsers(e,t,s,r)}async listUsers(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.fileUsers(e,t)),s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to list users in the file. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body)}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!Array.isArray(l.data))throw new h(`${n}${C}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l}async breadcrumbs(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.fileBreadcrumbs(e,t)),s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to read breadcrumbs. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body)}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!Array.isArray(l.data))throw new h(`${n}${C}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l}};var Ui=class extends H{async me(e={}){let{token:t}=e,i=this.sdk.getUrl(k.usersMe()),r=await this.sdk.http.get(i.toString(),{token:t});this.inspectCommonStatusCodes(r);let a="Unable to read a user. ";if(r.status!==200)throw this.logInvalidResponse(r),this.createApiError(`${a}${_}${r.status}`,r.body);if(!r.body)throw new h(`${a}${$}`,{code:"E_RESPONSE_NO_VALUE",status:r.status});let s;try{s=JSON.parse(r.body).data}catch{throw new h(`${a}${I}`,{code:"E_INVALID_JSON",status:r.status})}if(!s.key)throw new h(`${a}${C}`,{code:"E_RESPONSE_UNKNOWN",status:r.status});return s}async listTokens(e={}){let{token:t}=e,i=this.sdk.getUrl(k.usersMeTokens()),r=await this.sdk.http.get(i.toString(),{token:t});this.inspectCommonStatusCodes(r);let a="Unable to list tokens. ";if(r.status!==200)throw this.logInvalidResponse(r),this.createApiError(`${a}${_}${r.status}`,r.body);if(!r.body)throw new h(`${a}${$}`,{code:"E_RESPONSE_NO_VALUE",status:r.status});let s;try{s=JSON.parse(r.body).data}catch{throw new h(`${a}${I}`,{code:"E_INVALID_JSON",status:r.status})}return s}async createToken(e={},t={}){let{token:i}=t,r=this.sdk.getUrl(k.usersMeTokens()),a=JSON.stringify(e),s=await this.sdk.http.post(r.toString(),{token:i,body:a,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(s);let n="Unable to create a token. ";if(s.status!==200&&s.status!==201)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}return l}async deleteToken(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.usersMeToken(e)),a=await this.sdk.http.delete(r.toString(),{token:i});this.inspectCommonStatusCodes(a);let s="Unable to delete a token. ";if(a.status!==204)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body)}};var Li=class extends H{async list(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.shared(e));this.sdk.appendListOptions(a,t);let s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to list shared files. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body)}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!Array.isArray(l.data))throw new h(`${n}${C}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l}};var Mi=class extends H{async list(e,t,i,r={}){let{token:a}=r,s=this.sdk.getUrl(k.fileRevisions(e,t));this.sdk.appendListOptions(s,i);let n=await this.sdk.http.get(s.toString(),{token:a});this.inspectCommonStatusCodes(n);let l="Unable to list revisions for a file. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body)}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!Array.isArray(c.data))throw new h(`${l}${C}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c}};var zi=class extends H{async list(e,t={},i={}){let{token:r}=i,a=this.sdk.getUrl(k.trash(e));this.sdk.appendListOptions(a,t);let s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to list trash. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body)}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!Array.isArray(l.data))throw new h(`${n}${C}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l}async delete(e,t,i={}){let r=k.trashBatchDelete(e),a=this.sdk.getUrl(r),{token:s}=i,n=await this.sdk.http.delete(a.toString(),{token:s,body:JSON.stringify({ids:t})});this.inspectCommonStatusCodes(n);let l="Unable to delete trash. ";if(n.status!==204)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body)}async restore(e,t,i={}){let r=this.sdk.getUrl(k.trashBatchRestore(e)),{token:a}=i,s=await this.sdk.http.post(r.toString(),{token:a,body:JSON.stringify({ids:t})});this.inspectCommonStatusCodes(s);let n="Unable to restore from trash. ";if(s.status!==204)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body)}async empty(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.trashEmpty(e)),a=await this.sdk.http.delete(r.toString(),{token:i});this.inspectCommonStatusCodes(a);let s="Unable to empty trash. ";if(a.status!==204)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body)}};var Vi=class extends H{async list(e={}){let{token:t}=e,i=this.sdk.getUrl(k.organizations()),r=await this.sdk.http.get(i.toString(),{token:t});this.inspectCommonStatusCodes(r);let a="Unable to list your organizations. ";if(r.status!==200)throw this.logInvalidResponse(r),this.createApiError(`${a}${_}${r.status}`,r.body);if(!r.body)throw new h(`${a}${$}`,{code:"E_RESPONSE_NO_VALUE",status:r.status});let s;try{s=JSON.parse(r.body)}catch{throw new h(`${a}${I}`,{code:"E_INVALID_JSON",status:r.status})}if(!Array.isArray(s.data))throw new h(`${a}${C}`,{code:"E_RESPONSE_UNKNOWN",status:r.status});return s}async create(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.organizations()),s={name:e,slug:t},n=await this.sdk.http.post(a.toString(),{body:JSON.stringify(s),token:r,headers:{"Content-Type":"application/json"}});this.inspectCommonStatusCodes(n);let l="Unable to create an organization. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body).data}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!c.kind)throw new h(`${l}${C}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c}invitations={list:async(e,t={})=>{let{token:i}=t,r=this.sdk.getUrl(k.invitations(e)),a=await this.sdk.http.get(r.toString(),{token:i});this.inspectCommonStatusCodes(a);let s="Unable to list organization invitations. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);if(!a.body)throw new h(`${s}${$}`,{code:"E_RESPONSE_NO_VALUE",status:a.status});let n;try{n=JSON.parse(a.body)}catch{throw new h(`${s}${I}`,{code:"E_INVALID_JSON",status:a.status})}if(!Array.isArray(n.data))throw new h(`${s}${C}`,{code:"E_RESPONSE_UNKNOWN",status:a.status});return n},create:async(e,t,i,r,a={})=>{let s=this.sdk.getUrl(k.invitations(e)),n={email:t,name:r,grant_type:i},l=await this.sdk.http.post(s.toString(),{body:JSON.stringify(n),token:a.token,headers:{"Content-Type":"application/json"}});this.inspectCommonStatusCodes(l);let c="Unable to create an invitation. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(!p.kind)throw new h(`${c}${C}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p},findByToken:async(e,t={})=>{let i=this.sdk.getUrl(k.findInvitation());i.searchParams.append("token",e);let r=await this.sdk.http.get(i.toString(),t);this.inspectCommonStatusCodes(r);let a="Unable to find invitation by token. ";if(r.status!==200)throw this.logInvalidResponse(r),this.createApiError(`${a}${_}${r.status}`,r.body);if(!r.body)throw new h(`${a}${$}`,{code:"E_RESPONSE_NO_VALUE",status:r.status});let s;try{s=JSON.parse(r.body).data}catch{throw new h(`${a}${I}`,{code:"E_INVALID_JSON",status:r.status})}if(!s.kind)throw new h(`${a}${C}`,{code:"E_RESPONSE_UNKNOWN",status:r.status});return s},decline:async(e,t,i={})=>{let r=this.sdk.getUrl(k.declineInvitation(e,t)),a=await this.sdk.http.post(r.toString(),i);this.inspectCommonStatusCodes(a);let s="Unable to decline invitation. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);if(!a.body)throw new h(`${s}${$}`,{code:"E_RESPONSE_NO_VALUE",status:a.status});let n;try{n=JSON.parse(a.body).data}catch{throw new h(`${s}${I}`,{code:"E_INVALID_JSON",status:a.status})}if(!n.kind)throw new h(`${s}${C}`,{code:"E_RESPONSE_UNKNOWN",status:a.status});return n},delete:async(e,t,i={})=>{let r=this.sdk.getUrl(k.invitation(e,t)),a=await this.sdk.http.delete(r.toString(),i);this.inspectCommonStatusCodes(a);let s="Unable to delete invitation. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);if(!a.body)throw new h(`${s}${$}`,{code:"E_RESPONSE_NO_VALUE",status:a.status});let n;try{n=JSON.parse(a.body).data}catch{throw new h(`${s}${I}`,{code:"E_INVALID_JSON",status:a.status})}if(!n.kind)throw new h(`${s}${C}`,{code:"E_RESPONSE_UNKNOWN",status:a.status});return n},patch:async(e,t,i,r={})=>{let a=this.sdk.getUrl(k.invitation(e,t)),s=await this.sdk.http.patch(a.toString(),{body:JSON.stringify(i),token:r.token,headers:{"Content-Type":"application/json"}});this.inspectCommonStatusCodes(s);let n="Unable to update invitation. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!l.kind)throw new h(`${n}${C}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l},resend:async(e,t,i={})=>{let r=this.sdk.getUrl(k.resendInvitation(e,t)),a=await this.sdk.http.put(r.toString(),i);this.inspectCommonStatusCodes(a);let s="Unable to resend invitation. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);if(!a.body)throw new h(`${s}${$}`,{code:"E_RESPONSE_NO_VALUE",status:a.status});let n;try{n=JSON.parse(a.body).data}catch{throw new h(`${s}${I}`,{code:"E_INVALID_JSON",status:a.status})}if(!n.kind)throw new h(`${s}${C}`,{code:"E_RESPONSE_UNKNOWN",status:a.status});return n}};users={list:async(e,t,i={})=>{let{token:r}=i,a=this.sdk.getUrl(k.organizationUsers(e));this.sdk.appendListOptions(a,t);let s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to list projects. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body)}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!Array.isArray(l.data))throw new h(`${n}${C}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l},read:async(e,t,i={})=>{let{token:r}=i,a=this.sdk.getUrl(k.organizationUser(e,t)),s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to read the user info. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}return l},readBatch:async(e,t,i={})=>{let{token:r}=i,a=this.sdk.getUrl(k.organizationUserBatch(e)),s={ids:t},n=await this.sdk.http.post(a.toString(),{body:JSON.stringify(s),token:r});this.inspectCommonStatusCodes(n);let l="Unable to read the user batch info. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body)}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!Array.isArray(c.data))throw new h(`${l}${C}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c},activate:async(e,t,i={})=>{let{token:r}=i,a=this.sdk.getUrl(k.organizationUserActivate(e,t)),s=await this.sdk.http.post(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to activate the user. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}return l},deactivate:async(e,t,i={})=>{let{token:r}=i,a=this.sdk.getUrl(k.organizationUserDeactivate(e,t)),s=await this.sdk.http.post(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to deactivate the user. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}return l},delete:async(e,t,i={})=>{let{token:r}=i,a=this.sdk.getUrl(k.organizationUser(e,t)),s=await this.sdk.http.delete(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to delete the user. ";if(s.status!==204)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body)}};slugs={generate:async(e,t={})=>{let{token:i}=t,r=this.sdk.getUrl(k.orgSlugGenerate()).toString(),a={name:e},s=await this.sdk.http.post(r,{body:JSON.stringify(a),token:i});this.inspectCommonStatusCodes(s);let n="Unable to generate the slug. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(!l.slug)throw new h(`${n}${C}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l.slug},validate:async(e,t={})=>{let{token:i}=t,r=this.sdk.getUrl(k.orgSlugValidate()).toString(),a={slug:e},s=await this.sdk.http.post(r,{body:JSON.stringify(a),token:i});this.inspectCommonStatusCodes(s);let n="Unable to validate the slug. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);if(!s.body)throw new h(`${n}${$}`,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body).data}catch{throw new h(`${n}${I}`,{code:"E_INVALID_JSON",status:s.status})}if(typeof l.valid!="boolean")throw new h(`${n}${C}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l}}};var Fi=class extends H{async list(e={},t={}){let{token:i}=t,r={...e},a=this.sdk.getUrl(k.dataCatalog());this.sdk.appendListOptions(a,r),r.scope&&a.searchParams.set("scope",r.scope);let s=await this.sdk.http.get(a.toString(),{token:i});return this.processListResponse(s,"Unable to list data domains. ")}async listVersions(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.dataCatalogEntryVersions(e)),a=await this.sdk.http.get(r.toString(),{token:i});return this.processListResponse(a,"Unable to list data domain versions. ")}async publish(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.dataCatalog()),a=JSON.stringify(e),s=await this.sdk.http.post(r.toString(),{token:i,body:a,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(s);let n="Unable to publish data domain. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,We,l.kind),l}async read(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.dataCatalogEntry(e)),a=await this.sdk.http.get(r.toString(),{token:i});this.inspectCommonStatusCodes(a);let s="Unable to read data domain. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);let n=this.readResponseJSON(a,s).data;return this.assertObjectKind(s,We,n.kind),n}async deprecate(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.dataCatalogDeprecate(e)),s=JSON.stringify({reason:t}),n=await this.sdk.http.put(a.toString(),{token:r,body:s,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(n);let l="Unable to deprecate data domain. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);let c=this.readResponseJSON(n,l).data;return this.assertObjectKind(l,We,c.kind),c}async unpublish(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.dataCatalogUnpublish(e)),a=await this.sdk.http.put(r.toString(),{token:i});this.inspectCommonStatusCodes(a);let s="Unable to unpublish data domain. ";if(a.status!==200)throw this.logInvalidResponse(a),this.createApiError(`${s}${_}${a.status}`,a.body);let n=this.readResponseJSON(a,s).data;return this.assertObjectKind(s,We,n.kind),n}async publishVersion(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.dataCatalogEntryVersions(e)),s=JSON.stringify(t),n=await this.sdk.http.post(a.toString(),{token:r,body:s,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(n);let l="Unable to publish data domain version. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);let c=this.readResponseJSON(n,l).data;return this.assertObjectKind(l,Ye,c.kind),c}async readVersion(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.dataCatalogVersion(e,t)),s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to read data domain version. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,Ye,l.kind),l}async listDependencies(e,t={}){let{token:i}=t,r=this.sdk.getUrl(k.dataCatalogDependencies()),a=JSON.stringify({items:e}),s=await this.sdk.http.post(r.toString(),{token:i,body:a,headers:{"content-type":"application/json"}});return this.processListResponse(s,"Unable to list data domain dependencies. ")}async checkUpdates(e,t={}){let{token:i}=t,r=e.map(l=>({fid:l.key,version:l.version})),a=this.sdk.getUrl(k.dataCatalogUpdates()),s=JSON.stringify({dependencies:r}),n=await this.sdk.http.post(a.toString(),{token:i,body:s,headers:{"content-type":"application/json"}});return this.processListResponse(n,"Unable to check for data domain updates. ")}async deprecateVersion(e,t,i,r={}){let{token:a}=r,s=this.sdk.getUrl(k.dataCatalogVersionDeprecate(e,t)),n=JSON.stringify({reason:i}),l=await this.sdk.http.put(s.toString(),{token:a,body:n,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(l);let c="Unable to deprecate data domain version. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);let p=this.readResponseJSON(l,c).data;return this.assertObjectKind(c,Ye,p.kind),p}async unpublishVersion(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.dataCatalogVersionUnpublish(e,t)),s=await this.sdk.http.put(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to unpublish data domain version. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,Ye,l.kind),l}async checkPublicationStatus(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.dataCatalogStatus(e));t&&a.searchParams.set("oid",t);let s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to check data domain publication status. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,We,l.kind),l}};var Ki=class extends H{async create(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.groups(e)),s=JSON.stringify(t),n=await this.sdk.http.post(a.toString(),{token:r,body:s,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(n);let l="Unable to create a group. ";if(n.status!==201)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body).data}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!c.key)throw new h(`${l}${C}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c}async list(e,t={},i={}){let{token:r}=i,a=this.sdk.getUrl(k.groups(e));this.sdk.appendListOptions(a,t);let s=await this.sdk.http.get(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to create a group. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(n+_+s.status,s.body);if(!s.body)throw new h(n+$,{code:"E_RESPONSE_NO_VALUE",status:s.status});let l;try{l=JSON.parse(s.body)}catch{throw new h(n+I,{code:"E_INVALID_JSON",status:s.status})}return l}async update(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.group(e,t.key)),s=JSON.stringify(t),n=await this.sdk.http.put(a.toString(),{token:r,body:s,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(n);let l="Unable to update a group. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body).data}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!c.key)throw new h(`${l}${C}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c}async delete(e,t,i={}){let{token:r}=i,a=this.sdk.getUrl(k.group(e,t)),s=await this.sdk.http.delete(a.toString(),{token:r});this.inspectCommonStatusCodes(s);let n="Unable to delete a group. ";if(s.status!==204)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body)}async addUsers(e,t,i,r={}){let{token:a}=r,s=this.sdk.getUrl(k.groupUsers(e,t)),n=JSON.stringify({ids:i}),l=await this.sdk.http.post(s.toString(),{token:a,body:n,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(l);let c="Unable to add users to a group. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(!p.key)throw new h(`${c}${C}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p}async removeUsers(e,t,i,r={}){let{token:a}=r,s=this.sdk.getUrl(k.groupUsers(e,t)),n=JSON.stringify({ids:i}),l=await this.sdk.http.delete(s.toString(),{token:a,body:n,headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(l);let c="Unable to remove users from a group. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(!p.key)throw new h(`${c}${C}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p}};var qi=class extends H{async*modifyDomain(e,t,i,r,a={}){let{token:s=this.sdk.token,signal:n}=a,l=this.sdk.getUrl(k.aiModifyDomain(e,t)),c=JSON.stringify({goal:i,sid:r}),p={method:"POST",headers:{"content-type":"application/json",accept:"text/event-stream",authorization:`Bearer ${s}`},redirect:"follow",credentials:"include",body:c,signal:n},u=await fetch(l,p);if(!u.ok){let b=await u.text();throw new h(`Failed to modify domain: ${u.status} ${b}`)}let m=u.body?.getReader();if(!m)throw new h("Failed to get reader from response");let g=new TextDecoder,f="";for(;;){let{done:b,value:v}=await m.read();if(b)return;f+=g.decode(v,{stream:!0});let S;for(;(S=f.indexOf(`
|
|
17
17
|
|
|
18
18
|
`))>=0;){let E=f.slice(0,S);if(f=f.slice(S+2),!E.trim())continue;let V=E.split(`
|
|
19
|
-
`),U="message",L="";for(let le of V)le.startsWith("event:")?U=le.substring(6).trim():le.startsWith("data:")&&(L+=le.substring(5).trim());if(!L)continue;let P;try{P=JSON.parse(L)}catch{console.error("Failed to parse SSE JSON data:",L);continue}switch(U){case"user-message":yield{event:U,data:P};break;case"agent-message":yield{event:U,data:P};break;case"thought-chunk":case"text-chunk":yield{event:U,data:P};break;case"done":yield{event:U,data:P};return;case"error":yield{event:U,data:h.fromRawException(P,"Failed to generate results")};break;case"session-updated":yield{event:U,data:P};break;default:console.warn(`Unknown SSE event: ${U}`)}}}}sessions={list:async(e,t,i={},r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiSessions(e,t));this.sdk.appendListOptions(s,i);let n=await this.sdk.http.get(s.toString(),{token:a});this.inspectCommonStatusCodes(n);let l="Unable to list sessions. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body)}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!Array.isArray(c.data))throw new h(`${l}${O}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c},read:async(e,t,i,r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiSession(e,t,i)),n=await this.sdk.http.get(s.toString(),{token:a});this.inspectCommonStatusCodes(n);let l="Unable to read session. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body).data}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(c.kind!==Qt)throw new h(`${l}${O}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c},create:async(e,t,i,r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiSessions(e,t)),n=JSON.stringify(i),l=await this.sdk.http.post(s.toString(),{token:a,body:n});this.inspectCommonStatusCodes(l);let c="Unable to create session. ";if(l.status!==201)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(p.kind!==Qt)throw new h(`${c}${O}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p},delete:async(e,t,i,r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiSession(e,t,i)),n=await this.sdk.http.delete(s.toString(),{token:a});this.inspectCommonStatusCodes(n);let l="Unable to delete session. ";if(n.status!==204)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body)},update:async(e,t,i,r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiSession(e,t,i.key)),n=JSON.stringify(i),l=await this.sdk.http.put(s.toString(),{token:a,body:n});this.inspectCommonStatusCodes(l);let c="Unable to update session. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(p.kind!==Qt)throw new h(`${c}${O}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p}};messages={list:async(e,t,i={},r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiMessages(e,t));this.sdk.appendListOptions(s,i);let n=await this.sdk.http.get(s.toString(),{token:a});this.inspectCommonStatusCodes(n);let l="Unable to list messages. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body)}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!Array.isArray(c.data))throw new h(`${l}${O}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c},delete:async(e,t,i,r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiMessage(e,t,i)),n=await this.sdk.http.delete(s.toString(),{token:a});this.inspectCommonStatusCodes(n);let l="Unable to delete message. ";if(n.status!==204)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body)},update:async(e,t,i,r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiMessage(e,t,i.key)),n=JSON.stringify(i),l=await this.sdk.http.put(s.toString(),{token:a,body:n});this.inspectCommonStatusCodes(l);let c="Unable to update message. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(p.kind!==Lr)throw new h(`${c}${O}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p}}};var Jr;(function(o){o.Pending="pending",o.Active="active",o.Inactive="inactive",o.Failed="failed"})(Jr||(Jr={}));var Dt;(function(o){o.PROD="prod",o.STAGING="staging",o.DEV="dev"})(Dt||(Dt={}));var Ji=class extends H{async list(e,t={},i={}){let{token:r=this.sdk.token}=i,a=this.sdk.getUrl(k.deployments(e));this.sdk.appendListOptions(a,t);let s=await this.sdk.http.get(a.toString(),{token:r});return this.processListResponse(s,"Unable to list deployments. ")}async create(e,t,i={}){if(t.env===Dt.PROD&&!t.version)throw new h(`Version must not be empty for production environment: ${t.env}`,{code:"INVALID_DEPLOYMENT_VERSION",help:"Please provide a version for production environment",status:400});if(t.env!==Dt.PROD&&t.version)throw new h(`Version must not be present for non-production environment: ${t.env}`,{code:"INVALID_DEPLOYMENT_VERSION",help:"Please remove the version for non-production environment",status:400});let r=this.sdk.getUrl(k.deployments(e)),{token:a=this.sdk.token}=i,s=await this.sdk.http.post(r.toString(),{token:a,body:JSON.stringify(t),headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(s);let n="Unable to create a deployment. ";if(s.status!==202)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,Pt,l.kind),l}async read(e,t,i={}){let r=this.sdk.getUrl(k.deployment(e,t)),{token:a=this.sdk.token}=i,s=await this.sdk.http.get(r.toString(),{token:a});this.inspectCommonStatusCodes(s);let n="Unable to read a deployment. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,Pt,l.kind),l}async deactivate(e,t,i={}){let r=this.sdk.getUrl(k.deployment(e,t)),{token:a=this.sdk.token}=i,s=await this.sdk.http.delete(r.toString(),{token:a});this.inspectCommonStatusCodes(s);let n="Unable to deactivate a deployment. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,Pt,l.kind),l}async rollback(e,t,i={}){let r=this.sdk.getUrl(k.rollback(e,t)),{token:a=this.sdk.token}=i,s=await this.sdk.http.post(r.toString(),{token:a});this.inspectCommonStatusCodes(s);let n="Unable to rollback a deployment. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,Pt,l.kind),l}apis={getLatestPerEnvironment:async(e,t,i={})=>{let r=this.sdk.getUrl(k.deploymentsApisByEnvLatest(e,t)),{token:a=this.sdk.token}=i,s=await this.sdk.http.get(r.toString(),{token:a});this.inspectCommonStatusCodes(s);let n="Unable to list latest deployments for an API. ",l=this.readResponseJSON(s,n);if(!l.data)throw new h(`${n}${O}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l},list:async(e,t={})=>{let i=this.sdk.getUrl(k.deploymentsApis(e)),{token:r=this.sdk.token}=t,a=await this.sdk.http.get(i.toString(),{token:r});return this.processListResponse(a,"Unable to list APIs. ")}}};var Gr;(function(o){o.Pending="pending",o.Running="running",o.Completed="completed",o.Failed="failed"})(Gr||(Gr={}));var Gi=class extends H{async checkStatus(e,t,i={}){let r=this.sdk.getUrl(k.job(e,t)),{token:a=this.sdk.token}=i,s=await this.sdk.http.get(r.toString(),{token:a});this.inspectCommonStatusCodes(s);let n="Unable to check job status. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,Mr,l.kind),l}};var Br=Symbol("baseUri"),Bi=class{basePath;#e;get token(){return this.#e}set token(e){this.#e=e}auth=new Oi(this);files=new Di(this);users=new Ui(this);shared=new Li(this);revisions=new Mi(this);trash=new zi(this);organizations=new Vi(this);dataCatalog=new Fi(this);groups=new Ki(this);ai=new qi(this);deployments=new Ji(this);jobs=new Gi(this);silent=!1;[Br]="";get baseUri(){return this[Br]}set baseUri(e){if(!e)throw new Error("Invalid value for the baseUri");let t;try{t=new URL(e)}catch{throw new Error("Invalid baseUri: Not an URL")}this[Br]=t.origin;let{pathname:i}=t;i&&i!=="/"?this.basePath=i:this.basePath=void 0}constructor(e,t){this.basePath=t,this.baseUri=e}getUrl(e="/"){if(e.startsWith("http:")||e.startsWith("https:"))return new URL(e);let{baseUri:t,basePath:i=""}=this,r=e;return i&&r.startsWith(i)&&(r=r.substring(i.length)),new URL(`${i}${r}`,t)}appendListOptions(e,t={}){let{searchParams:i}=e;if(t.cursor&&i.set("cursor",t.cursor),typeof t.limit=="number"&&i.set("limit",String(t.limit)),t.parent&&i.set("parent",t.parent),t.since&&i.set("since",String(t.since)),t.sort&&i.set("sort",String(t.sort)),t.order&&i.set("order",String(t.order)),t.oid&&i.set("oid",String(t.oid)),t.uid&&i.set("uid",String(t.uid)),t.filter){let r=new TextEncoder().encode(JSON.stringify(t.filter)),a=Array.from(r,s=>String.fromCodePoint(s)).join("");i.set("filter",btoa(a))}}};var Hi=class extends Bi{http=new Ti(this)};function ee(o={}){let e=N.resolved,t=o.apiUrl||e.apiUrl,i=new Hi(t);return e.token&&(i.token=e.token),i}function ie(o){if(o&&typeof o=="object"){let t=o,i=t.status,r=t.code,a=t.message||"An unknown error occurred.",s=t.help;return i===401?(a="Unauthorized. Please login using `auth login`.",{message:a,status:i,code:"CLI_ERR_UNAUTHORIZED",help:s}):{message:a,status:i,code:r||"CLI_ERR_API_FAILURE",help:s}}return{message:o?.message||"An unknown error occurred.",code:"CLI_ERR_UNKNOWN"}}import{input as Bn,confirm as Hn,select as Wn}from"@inquirer/prompts";async function Ye(o,e){return(await Bn({message:o,default:e})).trim()}async function Ba(o,e=!0){return Hn({message:o,default:e})}async function Ut(o,e){return Wn({message:o,choices:e})}async function Hr(o,e){let t;try{t=(await o.organizations.list({token:o.token})).data||[]}catch{return}if(t.length>0){if(!N.resolved.org){let s=t[0],n=s.key;N.writeProperty("org",n),e.format!=="json"&&console.log(`
|
|
19
|
+
`),U="message",L="";for(let le of V)le.startsWith("event:")?U=le.substring(6).trim():le.startsWith("data:")&&(L+=le.substring(5).trim());if(!L)continue;let P;try{P=JSON.parse(L)}catch{console.error("Failed to parse SSE JSON data:",L);continue}switch(U){case"user-message":yield{event:U,data:P};break;case"agent-message":yield{event:U,data:P};break;case"thought-chunk":case"text-chunk":yield{event:U,data:P};break;case"done":yield{event:U,data:P};return;case"error":yield{event:U,data:h.fromRawException(P,"Failed to generate results")};break;case"session-updated":yield{event:U,data:P};break;default:console.warn(`Unknown SSE event: ${U}`)}}}}sessions={list:async(e,t,i={},r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiSessions(e,t));this.sdk.appendListOptions(s,i);let n=await this.sdk.http.get(s.toString(),{token:a});this.inspectCommonStatusCodes(n);let l="Unable to list sessions. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body)}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!Array.isArray(c.data))throw new h(`${l}${C}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c},read:async(e,t,i,r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiSession(e,t,i)),n=await this.sdk.http.get(s.toString(),{token:a});this.inspectCommonStatusCodes(n);let l="Unable to read session. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body).data}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(c.kind!==Qt)throw new h(`${l}${C}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c},create:async(e,t,i,r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiSessions(e,t)),n=JSON.stringify(i),l=await this.sdk.http.post(s.toString(),{token:a,body:n});this.inspectCommonStatusCodes(l);let c="Unable to create session. ";if(l.status!==201)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(p.kind!==Qt)throw new h(`${c}${C}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p},delete:async(e,t,i,r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiSession(e,t,i)),n=await this.sdk.http.delete(s.toString(),{token:a});this.inspectCommonStatusCodes(n);let l="Unable to delete session. ";if(n.status!==204)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body)},update:async(e,t,i,r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiSession(e,t,i.key)),n=JSON.stringify(i),l=await this.sdk.http.put(s.toString(),{token:a,body:n});this.inspectCommonStatusCodes(l);let c="Unable to update session. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(p.kind!==Qt)throw new h(`${c}${C}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p}};messages={list:async(e,t,i={},r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiMessages(e,t));this.sdk.appendListOptions(s,i);let n=await this.sdk.http.get(s.toString(),{token:a});this.inspectCommonStatusCodes(n);let l="Unable to list messages. ";if(n.status!==200)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body);if(!n.body)throw new h(`${l}${$}`,{code:"E_RESPONSE_NO_VALUE",status:n.status});let c;try{c=JSON.parse(n.body)}catch{throw new h(`${l}${I}`,{code:"E_INVALID_JSON",status:n.status})}if(!Array.isArray(c.data))throw new h(`${l}${C}`,{code:"E_RESPONSE_UNKNOWN",status:n.status});return c},delete:async(e,t,i,r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiMessage(e,t,i)),n=await this.sdk.http.delete(s.toString(),{token:a});this.inspectCommonStatusCodes(n);let l="Unable to delete message. ";if(n.status!==204)throw this.logInvalidResponse(n),this.createApiError(`${l}${_}${n.status}`,n.body)},update:async(e,t,i,r={})=>{let{token:a=this.sdk.token}=r,s=this.sdk.getUrl(k.aiMessage(e,t,i.key)),n=JSON.stringify(i),l=await this.sdk.http.put(s.toString(),{token:a,body:n});this.inspectCommonStatusCodes(l);let c="Unable to update message. ";if(l.status!==200)throw this.logInvalidResponse(l),this.createApiError(`${c}${_}${l.status}`,l.body);if(!l.body)throw new h(`${c}${$}`,{code:"E_RESPONSE_NO_VALUE",status:l.status});let p;try{p=JSON.parse(l.body).data}catch{throw new h(`${c}${I}`,{code:"E_INVALID_JSON",status:l.status})}if(p.kind!==Lr)throw new h(`${c}${C}`,{code:"E_RESPONSE_UNKNOWN",status:l.status});return p}}};var Jr;(function(o){o.Pending="pending",o.Active="active",o.Inactive="inactive",o.Failed="failed"})(Jr||(Jr={}));var Dt;(function(o){o.PROD="prod",o.STAGING="staging",o.DEV="dev"})(Dt||(Dt={}));var Ji=class extends H{async list(e,t={},i={}){let{token:r=this.sdk.token}=i,a=this.sdk.getUrl(k.deployments(e));this.sdk.appendListOptions(a,t);let s=await this.sdk.http.get(a.toString(),{token:r});return this.processListResponse(s,"Unable to list deployments. ")}async create(e,t,i={}){if(t.env===Dt.PROD&&!t.version)throw new h(`Version must not be empty for production environment: ${t.env}`,{code:"INVALID_DEPLOYMENT_VERSION",help:"Please provide a version for production environment",status:400});if(t.env!==Dt.PROD&&t.version)throw new h(`Version must not be present for non-production environment: ${t.env}`,{code:"INVALID_DEPLOYMENT_VERSION",help:"Please remove the version for non-production environment",status:400});let r=this.sdk.getUrl(k.deployments(e)),{token:a=this.sdk.token}=i,s=await this.sdk.http.post(r.toString(),{token:a,body:JSON.stringify(t),headers:{"content-type":"application/json"}});this.inspectCommonStatusCodes(s);let n="Unable to create a deployment. ";if(s.status!==202)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,Pt,l.kind),l}async read(e,t,i={}){let r=this.sdk.getUrl(k.deployment(e,t)),{token:a=this.sdk.token}=i,s=await this.sdk.http.get(r.toString(),{token:a});this.inspectCommonStatusCodes(s);let n="Unable to read a deployment. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,Pt,l.kind),l}async deactivate(e,t,i={}){let r=this.sdk.getUrl(k.deployment(e,t)),{token:a=this.sdk.token}=i,s=await this.sdk.http.delete(r.toString(),{token:a});this.inspectCommonStatusCodes(s);let n="Unable to deactivate a deployment. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,Pt,l.kind),l}async rollback(e,t,i={}){let r=this.sdk.getUrl(k.rollback(e,t)),{token:a=this.sdk.token}=i,s=await this.sdk.http.post(r.toString(),{token:a});this.inspectCommonStatusCodes(s);let n="Unable to rollback a deployment. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,Pt,l.kind),l}apis={getLatestPerEnvironment:async(e,t,i={})=>{let r=this.sdk.getUrl(k.deploymentsApisByEnvLatest(e,t)),{token:a=this.sdk.token}=i,s=await this.sdk.http.get(r.toString(),{token:a});this.inspectCommonStatusCodes(s);let n="Unable to list latest deployments for an API. ",l=this.readResponseJSON(s,n);if(!l.data)throw new h(`${n}${C}`,{code:"E_RESPONSE_UNKNOWN",status:s.status});return l},list:async(e,t={})=>{let i=this.sdk.getUrl(k.deploymentsApis(e)),{token:r=this.sdk.token}=t,a=await this.sdk.http.get(i.toString(),{token:r});return this.processListResponse(a,"Unable to list APIs. ")}}};var Gr;(function(o){o.Pending="pending",o.Running="running",o.Completed="completed",o.Failed="failed"})(Gr||(Gr={}));var Gi=class extends H{async checkStatus(e,t,i={}){let r=this.sdk.getUrl(k.job(e,t)),{token:a=this.sdk.token}=i,s=await this.sdk.http.get(r.toString(),{token:a});this.inspectCommonStatusCodes(s);let n="Unable to check job status. ";if(s.status!==200)throw this.logInvalidResponse(s),this.createApiError(`${n}${_}${s.status}`,s.body);let l=this.readResponseJSON(s,n).data;return this.assertObjectKind(n,Mr,l.kind),l}};var Br=Symbol("baseUri"),Bi=class{basePath;#e;get token(){return this.#e}set token(e){this.#e=e}auth=new Ci(this);files=new Di(this);users=new Ui(this);shared=new Li(this);revisions=new Mi(this);trash=new zi(this);organizations=new Vi(this);dataCatalog=new Fi(this);groups=new Ki(this);ai=new qi(this);deployments=new Ji(this);jobs=new Gi(this);silent=!1;[Br]="";get baseUri(){return this[Br]}set baseUri(e){if(!e)throw new Error("Invalid value for the baseUri");let t;try{t=new URL(e)}catch{throw new Error("Invalid baseUri: Not an URL")}this[Br]=t.origin;let{pathname:i}=t;i&&i!=="/"?this.basePath=i:this.basePath=void 0}constructor(e,t){this.basePath=t,this.baseUri=e}getUrl(e="/"){if(e.startsWith("http:")||e.startsWith("https:"))return new URL(e);let{baseUri:t,basePath:i=""}=this,r=e;return i&&r.startsWith(i)&&(r=r.substring(i.length)),new URL(`${i}${r}`,t)}appendListOptions(e,t={}){let{searchParams:i}=e;if(t.cursor&&i.set("cursor",t.cursor),typeof t.limit=="number"&&i.set("limit",String(t.limit)),t.parent&&i.set("parent",t.parent),t.since&&i.set("since",String(t.since)),t.sort&&i.set("sort",String(t.sort)),t.order&&i.set("order",String(t.order)),t.oid&&i.set("oid",String(t.oid)),t.uid&&i.set("uid",String(t.uid)),t.filter){let r=new TextEncoder().encode(JSON.stringify(t.filter)),a=Array.from(r,s=>String.fromCodePoint(s)).join("");i.set("filter",btoa(a))}}};var Hi=class extends Bi{http=new Ti(this)};function ee(o={}){let e=N.resolved,t=o.apiUrl||e.apiUrl,i=new Hi(t);return e.token&&(i.token=e.token),i}function ie(o){if(o&&typeof o=="object"){let t=o,i=t.status,r=t.code,a=t.message||"An unknown error occurred.",s=t.help;return i===401?(a="Unauthorized. Please login using `auth login`.",{message:a,status:i,code:"CLI_ERR_UNAUTHORIZED",help:s}):{message:a,status:i,code:r||"CLI_ERR_API_FAILURE",help:s}}return{message:o?.message||"An unknown error occurred.",code:"CLI_ERR_UNKNOWN"}}import{input as Hn,confirm as Wn,select as Yn}from"@inquirer/prompts";async function Xe(o,e){return(await Hn({message:o,default:e})).trim()}async function Ba(o,e=!0){return Wn({message:o,default:e})}async function Ut(o,e){return Yn({message:o,choices:e})}async function Hr(o,e){let t;try{t=(await o.organizations.list({token:o.token})).data||[]}catch{return}if(t.length>0){if(!N.resolved.org){let s=t[0],n=s.key;N.writeProperty("org",n),e.format!=="json"&&console.log(`
|
|
20
20
|
`+G.cyan(`\u2139 Automatically set default organization to "${s.name}" (${n}).`))}return}if(e.format==="json")return;console.log(`
|
|
21
|
-
`+G.yellow("\u26A0 It looks like you do not have any organizations yet.")),console.log("Let's set up your first organization now.");let i="";for(;!i;)i=await
|
|
21
|
+
`+G.yellow("\u26A0 It looks like you do not have any organizations yet.")),console.log("Let's set up your first organization now.");let i="";for(;!i;)i=await Xe("Enter organization name:"),i||console.log(G.red("Error: Organization name cannot be empty."));let r;try{r=await o.organizations.slugs.generate(i,{token:o.token})}catch{r=i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}if(!await Ba(`Use suggested organization slug "${r}"?`,!0)){let s=!1;for(;!s;){let n=await Xe("Enter organization slug:");if(!n){console.log(G.red("Error: Slug cannot be empty."));continue}try{let l=await o.organizations.slugs.validate(n,{token:o.token});l.valid?(r=n,s=!0):console.log(G.red(`Error: ${l.reason||"Invalid slug"}`))}catch{console.log(G.red("Error validating slug with server. Please try another slug."))}}}console.log(`
|
|
22
22
|
Creating organization "${i}" with slug "${r}"...`);try{let n=(await o.organizations.create(i,r,{token:o.token})).key;N.writeProperty("org",n),console.log(`
|
|
23
|
-
`+G.green(`\u2714 Organization "${i}" created successfully!`)),console.log(`Set as default organization: ${G.cyan(n)}`)}catch(s){let n=ie(s);console.log(G.red(`Error creating organization: ${n.message}`))}}function
|
|
23
|
+
`+G.green(`\u2714 Organization "${i}" created successfully!`)),console.log(`Set as default organization: ${G.cyan(n)}`)}catch(s){let n=ie(s);console.log(G.red(`Error creating organization: ${n.message}`))}}function Xn(){let o=N.resolved.token;if(!o)return null;try{let e=o.split(".");if(e.length===3){let t=e[1],i=Buffer.from(t,"base64url").toString("utf8"),r=JSON.parse(i);if(r&&typeof r=="object")return r.jti||r.id||null}}catch{}return null}function Ha(o){let e=o.command("tokens").description("Manage personal access tokens");e.command("list").description("List all personal access tokens").action(async()=>{let t=new B({format:N.resolved.format});try{let i=ee();i.token||(t.error({code:"CLI_ERR_UNAUTHORIZED",message:"Not logged in.",detail:"Use `apinow auth login <provider>` to authenticate."}),process.exit(1));let r=await i.users.listTokens({token:i.token}),a=Xn(),s=r.map(n=>({id:n.id,name:n.name||"N/A",lastUsedAt:n.lastUsedAt||"Never",expiresAt:n.expiresAt||"Never",active:n.id===a?"Yes":"No"}));t.list(s,["id","name","lastUsedAt","expiresAt","active"],{headers:["ID","NAME","LAST USED","EXPIRES","ACTIVE"]})}catch(i){let r=ie(i);t.error(r),process.exit(1)}}),e.command("create").description("Create a new personal access token").option("--name <name>","Optional name to identify the token").option("--expires-at <expires>",'Optional expiration time (e.g. "30 days", "10 minutes", or timestamp)').action(async t=>{let i=new B({format:N.resolved.format});try{let r=ee();r.token||(i.error({code:"CLI_ERR_UNAUTHORIZED",message:"Not logged in.",detail:"Use `apinow auth login <provider>` to authenticate."}),process.exit(1));let a={};t.name&&(a.name=t.name),t.expiresAt&&(/^\d+$/.test(t.expiresAt)?a.expiresAt=parseInt(t.expiresAt,10):a.expiresAt=t.expiresAt);let s=await r.users.createToken(a,{token:r.token});N.resolved.format==="json"?i.success("Token created successfully!",s):(i.success("Token created successfully!"),console.log(`
|
|
24
24
|
`+G.yellow("\u26A0 WARNING: Make sure to copy your personal access token now. You will NOT be able to see it again!")+`
|
|
25
25
|
`),console.log(`${G.bold("Raw Token")}: ${G.cyan(s.token)}`),console.log(`${G.bold("ID")}: ${s.id}`),console.log(`${G.bold("Name")}: ${s.name||"N/A"}`),console.log(`${G.bold("Type")}: ${s.type}`),console.log(`${G.bold("Expires At")}: ${s.expiresAt||"Never"}
|
|
26
|
-
`))}catch(r){let a=ie(r);i.error(a),process.exit(1)}}),e.command("delete <id>").description("Delete a personal access token by ID").action(async t=>{let i=new B({format:N.resolved.format});try{let r=ee();r.token||(i.error({code:"CLI_ERR_UNAUTHORIZED",message:"Not logged in.",detail:"Use `apinow auth login <provider>` to authenticate."}),process.exit(1)),await r.users.deleteToken(t,{token:r.token}),i.success(`Token '${t}' deleted successfully.`)}catch(r){let a=ie(r);i.error(a),process.exit(1)}})}function Wa(o){let e=o.command("auth").description("Manage CLI authentication");Ha(e),e.command("login").description("Authenticate with the API platform using OAuth2 (google, github, or linkedin)").addArgument(new
|
|
26
|
+
`))}catch(r){let a=ie(r);i.error(a),process.exit(1)}}),e.command("delete <id>").description("Delete a personal access token by ID").action(async t=>{let i=new B({format:N.resolved.format});try{let r=ee();r.token||(i.error({code:"CLI_ERR_UNAUTHORIZED",message:"Not logged in.",detail:"Use `apinow auth login <provider>` to authenticate."}),process.exit(1)),await r.users.deleteToken(t,{token:r.token}),i.success(`Token '${t}' deleted successfully.`)}catch(r){let a=ie(r);i.error(a),process.exit(1)}})}function Wa(o){let e=o.command("auth").description("Manage CLI authentication");Ha(e),e.command("login").description("Authenticate with the API platform using OAuth2 (google, github, or linkedin)").addArgument(new Zn("provider","Authentication provider").choices(["google","github","linkedin"])).action(async t=>{let i=new B({format:N.resolved.format}),r=["google","github","linkedin"];r.includes(t)||(i.error({message:`Invalid provider '${t}'. Allowed: ${r.join(", ")}`}),process.exit(1));let a=N.resolved.apiUrl;N.resolved.format!=="json"&&console.log(`Starting authentication flow using provider '${t}'...`);try{await to(a,t,i),i.success("Successfully authenticated!");let s=ee();await Hr(s,i)}catch(s){s instanceof Error?i.error({message:s.message}):i.error({message:"Authentication failed."}),process.exit(1)}}),e.command("logout").description("Log out and clear the stored token").action(()=>{let t=new B({format:N.resolved.format});N.clearConfigKey("token"),t.success("Logged out successfully.")}),e.command("status").description("Check current authentication status").action(async()=>{let t=new B({format:N.resolved.format}),i=N.resolved;i.token||(t.error({message:"Not logged in. Use `auth login <provider>` to authenticate."}),process.exit(1));try{let r=ee(),a=await r.users.me({token:r.token});i.format==="json"?t.object({authenticated:!0,user:a}):(console.log(G.green("\u2714 Authenticated successfully!")),console.log(`User: ${a.name} (${a.email})`),console.log(`Default Org: ${i.org||"None"}`)),await Hr(r,t)}catch(r){let a=ie(r);t.error({message:"Authentication token is invalid or expired.",detail:a.message}),process.exit(1)}})}function to(o,e,t){return new Promise((i,r)=>{let a=Qn.createServer((c,p)=>{if(c.method==="GET"&&c.url?.startsWith("/callback")){Rt("auth",`Received request for callback: ${c.url}`),p.writeHead(200,{"Content-Type":"text/html"});let u=`
|
|
27
27
|
<!DOCTYPE html>
|
|
28
28
|
<html>
|
|
29
29
|
<head>
|
|
@@ -130,33 +130,33 @@ Creating organization "${i}" with slug "${r}"...`);try{let n=(await o.organizati
|
|
|
130
130
|
</body>
|
|
131
131
|
</html>
|
|
132
132
|
`;p.end(u);return}if(c.method==="POST"&&c.url==="/token"){let u="";c.on("data",m=>{u+=m}),c.on("end",()=>{try{let m=JSON.parse(u);m.token?(Rt("auth","Storing retrieved token to CLI configuration..."),N.writeProperty("token",m.token),p.writeHead(200,{"Content-Type":"application/json"}),p.end(JSON.stringify({success:!0})),i(m.token)):(p.writeHead(400,{"Content-Type":"application/json"}),p.end(JSON.stringify({error:"Token missing"})),r(new Error("Token missing from browser callback.")))}catch(m){m instanceof Error?(p.writeHead(400,{"Content-Type":"application/json"}),p.end(JSON.stringify({error:m.message})),r(new Error("Invalid body received: "+m.message))):(p.writeHead(400,{"Content-Type":"application/json"}),p.end(JSON.stringify({error:"Invalid body received"})),r(new Error("Invalid body received")))}finally{l()}});return}if(c.method==="POST"&&c.url==="/error"){let u="";c.on("data",m=>{u+=m}),c.on("end",()=>{try{let m=JSON.parse(u);Rt("auth",`Received login error from browser callback: ${m.message}`),r(new Error(m.message||"Browser login failed"))}catch{r(new Error("Browser login failed"))}finally{l()}});return}p.writeHead(404),p.end()}),s=()=>{l(),process.exit(130)};process.on("SIGINT",s),process.on("SIGTERM",s);let n=setTimeout(()=>{r(new Error("Authentication timed out.")),l()},3e5);function l(){clearTimeout(n),process.off("SIGINT",s),process.off("SIGTERM",s),a.close()}a.listen(0,"127.0.0.1",async()=>{let c=a.address().port,u=new URL(o).hostname==="localhost"?"localhost":"127.0.0.1",m=`${o}/auth/${e}/redirect?r=http://${u}:${c}/callback`;Rt("auth",`Ephemeral loopback server listening on http://127.0.0.1:${c}`),Rt("auth",`Browser callback origin configured to http://${u}:${c}`),t.format!=="json"&&(console.log("Opening browser to log in..."),console.log(`If it doesn't open automatically, navigate to:
|
|
133
|
-
${m}`));try{await Qn(m)}catch{}})})}function Ya(o){let e=o.command("orgs").description("Manage organization configurations");e.command("list").description("List all organizations you belong to").action(async()=>{let t=new B({format:N.resolved.format});try{let i=ee(),a=(await i.organizations.list({token:i.token})).data||[],s=N.resolved,n=a.map(l=>({id:l.key,name:l.name,slug:l.slug,isDefault:l.key===s.org?"Yes":"No"}));t.list(n,["id","name","slug","isDefault"],{headers:["ID","NAME","SLUG","DEFAULT"]})}catch(i){let r=ie(i);t.error(r),process.exit(1)}}),e.command("set-default <oid>").description("Set your default organization ID").action(async t=>{let i=new B({format:N.resolved.format});try{let r=ee();((await r.organizations.list({token:r.token})).data||[]).some(l=>l.key===t)||(i.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Organization ID '${t}' not found in your authorized list.`,detail:"Run `apinow orgs list` to see all authorized organizations and their IDs."}),process.exit(1)),N.writeProperty("org",t),i.success(`Default organization ID set to '${t}'.`)}catch(r){let a=ie(r);i.error(a),process.exit(1)}}),e.command("default").alias("get-default").description("Get the default configured organization").action(async()=>{let t=new B({format:N.resolved.format});try{let i=N.resolved;i.org||(t.error({code:"CLI_ERR_MISSING_REQUIRED",message:"No default organization configured.",detail:"Set one using `apinow orgs set-default <oid>`. Run `apinow orgs list` to list available organizations."}),process.exit(1));let r=ee(),n=((await r.organizations.list({token:r.token})).data||[]).find(l=>l.key===i.org);n||(t.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Default organization ID '${i.org}' not found in your authorized list.`,detail:"Run `apinow orgs set-default <oid>` to configure a valid default organization."}),process.exit(1)),t.object({id:n.key,name:n.name,slug:n.slug})}catch(i){let r=ie(i);t.error(r),process.exit(1)}})}import ts from"node:fs";import po from"node:path";var ii=class o{key;get kind(){return We}catalogKey;scope;lifecycle;version;publishedBy;unpublishedAt;deprecated;deprecatedAt;deprecatedBy;deprecationReason;createdAt;updatedAt;changelog;static createSchema(e){let{key:t="",scope:i="private",publishedBy:r="",createdAt:a=0,updatedAt:s=0,catalogKey:n="",lifecycle:l="stable",version:c=""}=e;if(["public","private","organization"].indexOf(i)===-1)throw new Error(`Invalid scope: ${i}`);let p={key:t,kind:We,scope:i,publishedBy:r,createdAt:a,updatedAt:s,catalogKey:n,lifecycle:l,version:c};return typeof e.deprecated=="boolean"&&(p.deprecated=e.deprecated),typeof e.deprecatedAt=="number"&&(p.deprecatedAt=e.deprecatedAt),typeof e.deprecatedBy=="string"&&(p.deprecatedBy=e.deprecatedBy),typeof e.changelog=="string"&&(p.changelog=e.changelog),typeof e.deprecationReason=="string"&&(p.deprecationReason=e.deprecationReason),typeof e.unpublishedAt=="number"&&(p.unpublishedAt=e.unpublishedAt),p}constructor(e={}){let t=o.createSchema(e);this.key=t.key,this.catalogKey=t.catalogKey,this.lifecycle=t.lifecycle,this.scope=t.scope,this.version=t.version,this.publishedBy=t.publishedBy,this.createdAt=t.createdAt,this.updatedAt=t.updatedAt,typeof t.changelog=="string"&&(this.changelog=t.changelog),typeof t.deprecated=="boolean"&&(this.deprecated=t.deprecated),typeof t.deprecatedAt=="number"&&(this.deprecatedAt=t.deprecatedAt),typeof t.deprecatedBy=="string"&&(this.deprecatedBy=t.deprecatedBy),typeof t.deprecationReason=="string"&&(this.deprecationReason=t.deprecationReason),typeof t.unpublishedAt=="number"&&(this.unpublishedAt=t.unpublishedAt)}toJSON(){let e={key:this.key,kind:We,scope:this.scope,publishedBy:this.publishedBy,createdAt:this.createdAt,updatedAt:this.updatedAt,catalogKey:this.catalogKey,lifecycle:this.lifecycle,version:this.version};return typeof this.deprecated=="boolean"&&(e.deprecated=this.deprecated),typeof this.deprecatedAt=="number"&&(e.deprecatedAt=this.deprecatedAt),typeof this.deprecatedBy=="string"&&(e.deprecatedBy=this.deprecatedBy),typeof this.deprecationReason=="string"&&(e.deprecationReason=this.deprecationReason),typeof this.unpublishedAt=="number"&&(e.unpublishedAt=this.unpublishedAt),typeof this.changelog=="string"&&this.changelog&&(e.changelog=this.changelog),e}};var y;(function(o){o.User="Semantic#User",o.Address="Semantic#Address",o.Password="Semantic#Password",o.Username="Semantic#Username",o.CreatedTimestamp="Semantic#CreatedTimestamp",o.UpdatedTimestamp="Semantic#UpdatedTimestamp",o.DeletedTimestamp="Semantic#DeletedTimestamp",o.DeletedFlag="Semantic#DeletedFlag",o.PublicUniqueName="Semantic#PublicUniqueName",o.Title="Semantic#Title",o.Name="Semantic#Name",o.UserRole="Semantic#UserRole",o.Status="Semantic#Status",o.Version="Semantic#Version",o.ImageURL="Semantic#ImageURL",o.FileURL="Semantic#FileURL",o.Markdown="Semantic#Markdown",o.HTML="Semantic#HTML",o.GeospatialCoordinates="Semantic#GeospatialCoordinates",o.Email="Semantic#Email",o.Phone="Semantic#Phone",o.Currency="Semantic#Currency",o.URL="Semantic#URL",o.SKU="Semantic#SKU",o.Description="Semantic#Description",o.Summary="Semantic#Summary",o.Calculated="Semantic#Calculated",o.Derived="Semantic#Derived",o.ClientIPAddress="Semantic#ClientIPAddress",o.StreetAddress="Semantic#StreetAddress",o.StreetAddressSupplemental="Semantic#StreetAddressSupplemental",o.City="Semantic#City",o.PostalCode="Semantic#PostalCode",o.Country="Semantic#Country",o.Region="Semantic#Region",o.ResourceOwnerIdentifier="Semantic#ResourceOwnerIdentifier",o.Tags="Semantic#Tags",o.Categories="Semantic#Categories"})(y||(y={}));var D;(function(o){o.Entity="Entity",o.Property="Property",o.Association="Association"})(D||(D={}));var z;(function(o){o.Identity="Identity & Authentication",o.Lifecycle="Timestamps & Versioning",o.Content="Content & Media",o.Business="Business Data",o.Organization="Classification & Organization",o.Location="Location & Geography",o.Contact="Contact Information",o.Computed="Computed Values"})(z||(z={}));var Xa=o=>o.scope===D.Entity,Wi=o=>o.scope===D.Property,Za=o=>o.scope===D.Association,Le={[y.User]:{id:y.User,displayName:"User Entity",scope:D.Entity,description:"System users and accounts",category:z.Identity,hasConfig:!1},[y.Password]:{id:y.Password,displayName:"User Password",scope:D.Property,description:"Secure password field",category:z.Identity,applicableDataTypes:["string"],hasConfig:!0},[y.Username]:{id:y.Username,displayName:"Username",scope:D.Property,description:"User authentication identifier",category:z.Identity,applicableDataTypes:["string"],hasConfig:!1},[y.UserRole]:{id:y.UserRole,displayName:"User Role Field",scope:D.Property,description:"User permissions and access level",category:z.Identity,applicableDataTypes:["string"],hasConfig:!0},[y.ResourceOwnerIdentifier]:{id:y.ResourceOwnerIdentifier,displayName:"Resource Owner Identifier",scope:D.Association,description:"Links record to owner user",category:z.Identity,hasConfig:!1},[y.CreatedTimestamp]:{id:y.CreatedTimestamp,displayName:"Creation Timestamp",scope:D.Property,description:"When record was created",category:z.Lifecycle,applicableDataTypes:["datetime"],hasConfig:!1},[y.UpdatedTimestamp]:{id:y.UpdatedTimestamp,displayName:"Update Timestamp",scope:D.Property,description:"When record was last modified",category:z.Lifecycle,applicableDataTypes:["datetime"],hasConfig:!1},[y.DeletedTimestamp]:{id:y.DeletedTimestamp,displayName:"Soft Delete Timestamp",scope:D.Property,description:"When record was marked deleted",category:z.Lifecycle,applicableDataTypes:["datetime"],hasConfig:!1},[y.DeletedFlag]:{id:y.DeletedFlag,displayName:"Soft Delete Flag",scope:D.Property,description:"Mark record as deleted",category:z.Lifecycle,applicableDataTypes:["boolean"],hasConfig:!1},[y.Address]:{id:y.Address,displayName:"Address Entity",scope:D.Entity,description:"Physical address entity",category:z.Contact,hasConfig:!1},[y.StreetAddress]:{id:y.StreetAddress,displayName:"Street Address",scope:D.Property,description:"Street address line",category:z.Contact,applicableDataTypes:["string"],hasConfig:!1},[y.StreetAddressSupplemental]:{id:y.StreetAddressSupplemental,displayName:"Street Address Supplemental",scope:D.Property,description:"Supplemental street address line (e.g., Unit, Suite, Apartment, Floor)",category:z.Contact,applicableDataTypes:["string"],hasConfig:!1},[y.City]:{id:y.City,displayName:"City",scope:D.Property,description:"City or locality",category:z.Contact,applicableDataTypes:["string"],hasConfig:!1},[y.PostalCode]:{id:y.PostalCode,displayName:"Postal Code",scope:D.Property,description:"Postal or zip code",category:z.Contact,applicableDataTypes:["string"],hasConfig:!0},[y.Country]:{id:y.Country,displayName:"Country",scope:D.Property,description:"Country name or code",category:z.Contact,applicableDataTypes:["string"],hasConfig:!0},[y.Region]:{id:y.Region,displayName:"Region",scope:D.Property,description:"State, province, or region",category:z.Contact,applicableDataTypes:["string"],hasConfig:!1},[y.Version]:{id:y.Version,displayName:"Version Number",scope:D.Property,description:"Auto-incrementing version counter",category:z.Lifecycle,applicableDataTypes:["number"],hasConfig:!1},[y.Title]:{id:y.Title,displayName:"Record Title",scope:D.Property,description:"Main title or heading",category:z.Content,applicableDataTypes:["string"],hasConfig:!1},[y.Name]:{id:y.Name,displayName:"Name",scope:D.Property,description:"A person or pet name",category:z.Content,applicableDataTypes:["string"],hasConfig:!1},[y.Description]:{id:y.Description,displayName:"Description",scope:D.Property,description:"Detailed description text",category:z.Content,applicableDataTypes:["string"],hasConfig:!1},[y.Summary]:{id:y.Summary,displayName:"Summary",scope:D.Property,description:"Brief summary text",category:z.Content,applicableDataTypes:["string"],hasConfig:!1},[y.Markdown]:{id:y.Markdown,displayName:"Markdown Content",scope:D.Property,description:"Formatted text content",category:z.Content,applicableDataTypes:["string"],hasConfig:!0},[y.HTML]:{id:y.HTML,displayName:"HTML Content",scope:D.Property,description:"Rich HTML content",category:z.Content,applicableDataTypes:["string"],hasConfig:!0},[y.ImageURL]:{id:y.ImageURL,displayName:"Image URL",scope:D.Property,description:"Link to image file",category:z.Content,applicableDataTypes:["string"],hasConfig:!0},[y.FileURL]:{id:y.FileURL,displayName:"File URL",scope:D.Property,description:"Link to file attachment",category:z.Content,applicableDataTypes:["string"],hasConfig:!0},[y.Status]:{id:y.Status,displayName:"Record Status",scope:D.Property,description:"Current state of record",category:z.Business,applicableDataTypes:["string"],hasConfig:!0},[y.Currency]:{id:y.Currency,displayName:"Currency",scope:D.Property,description:"Monetary value with currency",category:z.Business,applicableDataTypes:["number","string"],hasConfig:!0},[y.SKU]:{id:y.SKU,displayName:"SKU",scope:D.Property,description:"Product identification code",category:z.Business,applicableDataTypes:["string"],hasConfig:!0},[y.Email]:{id:y.Email,displayName:"Email",scope:D.Property,description:"Email address",category:z.Contact,applicableDataTypes:["string"],hasConfig:!0},[y.Phone]:{id:y.Phone,displayName:"Phone",scope:D.Property,description:"Phone number",category:z.Contact,applicableDataTypes:["string"],hasConfig:!0},[y.URL]:{id:y.URL,displayName:"URL",scope:D.Property,description:"Web address or link",category:z.Contact,applicableDataTypes:["string"],hasConfig:!0},[y.ClientIPAddress]:{id:y.ClientIPAddress,displayName:"Client IP Address",scope:D.Property,description:"Automatically populated client IP address",category:z.Contact,applicableDataTypes:["string"],hasConfig:!1},[y.PublicUniqueName]:{id:y.PublicUniqueName,displayName:"Public Unique Name (Slug)",scope:D.Property,description:"URL-friendly unique identifier",category:z.Organization,applicableDataTypes:["string"],hasConfig:!0},[y.Tags]:{id:y.Tags,displayName:"Tags",scope:D.Association,description:"Enable tagging functionality",category:z.Organization,hasConfig:!0},[y.Categories]:{id:y.Categories,displayName:"Categories",scope:D.Association,description:"Enable categorization functionality",category:z.Organization,hasConfig:!0},[y.GeospatialCoordinates]:{id:y.GeospatialCoordinates,displayName:"Geospatial Coordinates",scope:D.Property,description:"Location coordinates",category:z.Location,applicableDataTypes:["string"],hasConfig:!0},[y.Calculated]:{id:y.Calculated,displayName:"Calculated",scope:D.Property,description:"Auto-calculated field value",category:z.Computed,applicableDataTypes:["string","number","boolean","date","datetime","time","binary"],hasConfig:!0},[y.Derived]:{id:y.Derived,displayName:"Derived",scope:D.Property,description:"Value derived from other fields",category:z.Computed,applicableDataTypes:["string"],hasConfig:!0}};var Wr;(function(o){o[o.Initializing=0]="Initializing",o[o.PendingDns=1]="PendingDns",o[o.Issuing=2]="Issuing",o[o.Active=3]="Active",o[o.Error=4]="Error"})(Wr||(Wr={}));function rs(o){let e=o.command("files").description("Manage files and metadata");e.command("list").description("List files in an organization").option("--org <oid>","Organization ID (optional, defaults to configured default org)").option("--kind <kind>","Filter by file kind (e.g. domain, api, folder)").option("--parent <parent>","Filter by parent folder ID").action(async t=>{let i=new B({format:N.resolved.format}),r=N.resolved,a=t.org||r.org;a||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Organization ID is required.",detail:"Pass --org <oid> or set a default organization using `apinow orgs set-default <oid>`."}),process.exit(1));try{let s=ee(),n={};if(t.parent&&(n.parent=t.parent),t.kind){let u=is(t.kind);n.filter={field:"kind",operator:"eq",value:u}}let p=((await s.files.list(a,n,{token:s.token})).data||[]).map(u=>({id:u.key,name:u.info?.name||"",kind:u.kind,isShortcut:u.isShortcut?"Yes":"No"}));i.list(p,["id","name","kind","isShortcut"],{headers:["ID","NAME","KIND","SHORTCUT"]})}catch(s){let n=ie(s);i.error(n),process.exit(1)}}),e.command("create").description("Create a new file metadata record (and optionally upload media)").option("--name <name>","Name of the file").option("--kind <kind>","Kind of the file (e.g., domain, api)").option("--org <oid>","Organization ID (optional, defaults to configured default org)").option("--parent <parent>","Parent folder ID").option("--media <path>","Local path to the file content/media to upload").option("--stdin","Read media content from STDIN").action(async t=>{let i=new B({format:N.resolved.format}),r=N.resolved,a=t.org||r.org;a||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Organization ID is required.",detail:"Pass --org <oid> or set a default organization using `apinow orgs set-default <oid>`."}),process.exit(1)),t.media&&t.stdin&&(i.error({code:"CLI_ERR_INVALID_ARGUMENT",message:"Cannot specify both --media <path> and --stdin"}),process.exit(1));let s=t.name;!s&&process.stdout.isTTY&&(s=await Ye("Enter file name:")),s||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Name is required.",detail:"Specify --name <name>."}),process.exit(1));let n=t.kind;!n&&process.stdout.isTTY&&(n=await Ut("Select file kind:",[{name:"API Domain / Schema (domain)",value:"domain"},{name:"API Schema (api)",value:"api"},{name:"Folder (folder)",value:"folder"}])),n||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Kind is required.",detail:"Specify --kind <kind> (allowed: api, domain, folder)."}),process.exit(1));try{let l;if(t.media){let v=po.resolve(t.media);ts.existsSync(v)||(i.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Media file not found at path: ${v}`}),process.exit(1)),l=ts.readFileSync(v,"utf8")}else t.stdin&&(l=await uo());let c,p;if(l!==void 0){try{p=JSON.parse(l)}catch{throw new Error("invalid API now platform file")}if(!p||typeof p!="object"||Array.isArray(p)||!("key"in p)||typeof p.key!="string"||!p.key.trim())throw new Error("invalid API now platform file");c=p.key}let u=ee(),m=Ce.createSchema({kind:is(n),info:{name:s},key:c}),g={};t.parent&&(g.parent=t.parent);let f=await u.files.createMeta(m,a,g,{token:u.token}),b=f.key;l!==void 0&&await u.files.createMedia(p,a,b,{},{token:u.token}),i.success("File created successfully!",f)}catch(l){let c=ie(l);i.error({code:"CLI_ERR_API_FAILURE",...c}),process.exit(1)}}),e.command("read").description("Read file metadata or media content").option("--id <fid>","File ID").option("--org <oid>","Organization ID (optional, defaults to configured default org)").option("--meta","Read file metadata (default)").option("--media","Read file media/content").action(async t=>{let i=new B({format:N.resolved.format}),r=N.resolved,a=t.org||r.org;a||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Organization ID is required.",detail:"Pass --org <oid> or set a default organization using `apinow orgs set-default <oid>`."}),process.exit(1));let s=t.id;if(!s&&process.stdout.isTTY)try{let n=ee(),c=(await n.files.list(a,{},{token:n.token})).data||[];c.length>0&&(s=await Ut("Select a file to read:",c.map(p=>({name:`${p.info?.name||"Unnamed"} (${p.kind})`,value:p.key}))))}catch{}s||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"File ID is required.",detail:"Specify --id <fid>."}),process.exit(1));try{let n=ee();if(t.media){let c=(await n.files.readMedia(a,s,{token:n.token})).media;r.format==="json"?console.log(JSON.stringify(c,null,2)):console.log(typeof c=="object"&&c!==null?JSON.stringify(c,null,2):c)}else{let l=await n.files.read(a,s,{token:n.token});i.object(l)}}catch(n){let l=ie(n);i.error(l),process.exit(1)}})}function is(o){let e=o.toLowerCase();if(e==="api")return Ur;if(e==="domain")return Zt;if(e==="folder")return Ne;throw new Error(`Unsupported file kind "${o}". Allowed: api, domain, folder`)}async function uo(){return new Promise((o,e)=>{let t="";process.stdin.setEncoding("utf8"),process.stdin.on("data",i=>{t+=i}),process.stdin.on("end",()=>{o(t)}),process.stdin.on("error",i=>{e(i)})})}function as(o){let e=o.command("catalog").description("Manage Data Catalog items");e.command("publish").description("Publish a data domain file to the data catalog").option("--file <fid>","File ID of the data domain").option("--name <name>","Name for the catalog entry").option("--description <desc>","Description of the catalog entry").option("--scope <scope>","Publish scope: public, organization, private").option("-v, --catalog-version <ver>","Semantic version (e.g. 1.0.0)").option("--org <oid>","Organization ID (optional, defaults to configured default org)").option("--lifecycle <lifecycle>","Version lifecycle status (dev, beta, stable)","stable").option("--changelog <changelog>","Changelog description for this version").action(async t=>{let i=new B({format:N.resolved.format}),r=N.resolved,a=t.org||r.org;a||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Organization ID is required.",detail:"Pass --org <oid> or set a default organization using `apinow orgs set-default <oid>`."}),process.exit(1));let s=t.file;if(!s&&process.stdout.isTTY)try{let g=ee(),b=(await g.files.list(a,{filter:{field:"kind",operator:"eq",value:Zt}},{token:g.token})).data||[];b.length>0&&(s=await Ut("Select a data domain file to publish:",b.map(v=>({name:`${v.info?.name||"Unnamed"} (${v.key})`,value:v.key}))))}catch{}s||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"File ID is required.",detail:"Specify --file <fid>."}),process.exit(1));let n=t.name;!n&&process.stdout.isTTY&&(n=await Ye("Enter catalog entry name:")),n||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Name is required.",detail:"Specify --name <name>."}),process.exit(1));let l=t.description;!l&&process.stdout.isTTY&&(l=await Ye("Enter catalog entry description:")),l||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Description is required.",detail:"Specify --description <desc>."}),process.exit(1));let c=t.scope;!c&&process.stdout.isTTY&&(c=await Ut("Select publish scope:",[{name:"Public (public)",value:"public"},{name:"Organization (organization)",value:"organization"},{name:"Private (private)",value:"private"}])),c||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Scope is required.",detail:"Specify --scope <scope> (allowed: public, organization, private)."}),process.exit(1));let p=["public","organization","private"];p.includes(c)||(i.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Invalid scope '${c}'.`,detail:`Allowed: ${p.join(", ")}`}),process.exit(1));let u=t.catalogVersion;!u&&process.stdout.isTTY&&(u=await Ye("Enter semantic version:","1.0.0")),u||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Version is required.",detail:"Specify --catalog-version <ver> or -v <ver>."}),process.exit(1));let m=["dev","beta","stable"];m.includes(t.lifecycle)||(i.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Invalid lifecycle '${t.lifecycle}'.`,detail:`Allowed: ${m.join(", ")}`}),process.exit(1));try{let g=ee(),f=null;try{f=(await g.dataCatalog.checkPublicationStatus(s,a,{token:g.token})).key}catch(S){if(ie(S).status!==404)throw S}if(f)N.resolved.format!=="json"&&console.log(`Catalog entry already exists (ID: ${f}). Publishing new version...`);else{N.resolved.format!=="json"&&console.log("Catalog entry does not exist. Creating new catalog entry...");let S={key:"",kind:He,organization:a,file:s,scope:c,name:n,description:l,publishedBy:"",publishedAt:0,createdAt:0,updatedAt:0,tags:[]};f=(await g.dataCatalog.publish(S,{token:g.token})).key}let b=ii.createSchema({scope:c,lifecycle:t.lifecycle,version:u,changelog:t.changelog||void 0}),v=await g.dataCatalog.publishVersion(f,b,{token:g.token});i.success(`Successfully published version '${u}' to the data catalog!`,v)}catch(g){let f=ie(g);i.error(f),process.exit(1)}}),e.command("list").description("List published data catalog items or versions of a specific catalog entry").option("--scope <scope>","Filter by scope: all, public, organization, private","all").option("--org <oid>","Organization ID (optional, defaults to configured default org)").option("--key <key>","Data catalog item key to list all versions of a specific data domain").action(async t=>{let i=new B({format:N.resolved.format}),r=N.resolved,a=t.org||r.org,s=["all","public","organization","private"];s.includes(t.scope)||(i.error({message:`Invalid scope '${t.scope}'. Allowed: ${s.join(", ")}`}),process.exit(1)),["organization","private"].includes(t.scope)&&!a&&(i.error({message:`Organization ID (--org <oid>) is required when filtering by scope '${t.scope}'.`}),process.exit(1));try{let n=ee();if(t.key){let p=((await n.dataCatalog.listVersions(t.key,{token:n.token})).data||[]).map(u=>({key:u.key,version:u.version,published:new Date(u.published).toLocaleString()}));i.list(p,["key","version","published"],{headers:["VERSION KEY","VERSION","PUBLISHED AT"]})}else{let l=[];if(t.scope==="all"){let m=await n.dataCatalog.list({scope:"public",oid:a},{token:n.token});if(l.push(...m.data||[]),a){try{let g=await n.dataCatalog.list({scope:"organization",oid:a},{token:n.token});l.push(...g.data||[])}catch{}try{let g=await n.dataCatalog.list({scope:"private",oid:a},{token:n.token});l.push(...g.data||[])}catch{}}}else{let m=await n.dataCatalog.list({scope:t.scope,oid:a},{token:n.token});l.push(...m.data||[])}let c=new Set,u=l.filter(m=>{let g=m.key;return c.has(g)?!1:(c.add(g),!0)}).map(m=>{let g=m.versions&&m.versions[0]?m.versions[0].version:"N/A";return{key:m.key,name:m.name,scope:m.scope,lastVersion:g,organization:m.organization||"N/A"}});i.list(u,["key","name","scope","lastVersion","organization"],{headers:["KEY","NAME","SCOPE","LAST VERSION","ORGANIZATION"]})}}catch(n){let l=ie(n);i.error(l),process.exit(1)}})}import Tr from"node:fs";import $n from"node:path";var ri=class o{description;key;rate;interval;burst;constructor(e={}){this.description=e.description,this.key=o.isRateLimitRuleKey(e.key)?structuredClone(e.key):void 0,this.rate=typeof e.rate=="number"?e.rate:void 0,this.interval=o.isRateLimitRuleInterval(e.interval)?e.interval:void 0,this.burst=typeof e.burst=="number"?e.burst:void 0}toJSON(){let e={};return this.description&&(e.description=this.description),o.isRateLimitRuleKey(this.key)&&(e.key=structuredClone(this.key)),typeof this.rate=="number"&&(e.rate=this.rate),o.isRateLimitRuleInterval(this.interval)&&(e.interval=this.interval),typeof this.burst=="number"&&(e.burst=this.burst),e}static isRateLimitRuleInterval(e){return typeof e!="string"?!1:["second","minute","hour","day"].includes(e)}static isRateLimitRuleKey(e){if(typeof e!="object"||e===null)return!1;let t=e;return"type"in t&&(t.type==="ip"||t.type==="userId"||t.type==="role")}};var Xe=class{rules;constructor(e={}){this.rules=e.rules?.map(t=>new ri(t))||[]}toJSON(){return{rules:this.rules.map(e=>e.toJSON())}}};var j;(function(o){o.PRE_FETCH="pre-fetch",o.FETCH="fetch",o.POST_FETCH="post-fetch"})(j||(j={}));var de=class{type;parent;mandatory;#e;get metadata(){if(!this.#e)throw new Error("Metadata not set for access rule "+this.type);return this.#e}constructor(e,t,i={}){this.parent=e,this.type=i.type??"",this.mandatory=i.mandatory??!1,this.#e=t}toJSON(){let e={type:this.type};return this.mandatory&&(e.mandatory=!0),e}};var Xi=class extends de{type;constructor(e,t={}){super(e,{list:j.PRE_FETCH,create:j.PRE_FETCH,search:j.PRE_FETCH,read:j.PRE_FETCH,update:j.PRE_FETCH,delete:j.PRE_FETCH},t),this.type="allowAuthenticated"}};var Zi=class extends de{type;constructor(e,t={}){super(e,{list:j.PRE_FETCH,create:j.PRE_FETCH,search:j.PRE_FETCH,read:j.PRE_FETCH,update:j.PRE_FETCH,delete:j.PRE_FETCH},t),this.type="allowPublic"}};var Qi=class extends de{type;domains;constructor(e,t={}){super(e,{list:j.PRE_FETCH,create:j.PRE_FETCH,search:j.PRE_FETCH,read:j.PRE_FETCH,update:j.PRE_FETCH,delete:j.PRE_FETCH},t),this.type="matchEmailDomain",this.domains=t.domains?[...t.domains]:[]}toJSON(){return{...super.toJSON(),domains:structuredClone(this.domains)}}};var er=class extends de{type;property;target;constructor(e,t={}){super(e,{list:j.FETCH,search:j.FETCH,read:j.POST_FETCH,update:j.POST_FETCH,delete:j.POST_FETCH},t),this.type="matchResourceOwner",this.property=t.property,this.target=t.target??"property"}toJSON(){let e={...super.toJSON(),target:this.target};return this.property&&(e.property=this.property),e}};var tr=class extends de{type;attribute;value;operator;constructor(e,t={}){super(e,{list:j.FETCH,search:j.FETCH,read:j.POST_FETCH,update:j.POST_FETCH,delete:j.POST_FETCH},t),this.type="matchResourceAttribute",this.attribute=t.attribute??"",this.value=t.value??"",this.operator=t.operator??"equal"}toJSON(){let e={...super.toJSON(),attribute:this.attribute,value:this.value};return this.operator&&(e.operator=this.operator),e}};var ir=class extends de{type;allowedStatuses;deniedStatuses;constructor(e,t={}){super(e,{list:j.FETCH,search:j.FETCH,read:j.POST_FETCH,update:j.POST_FETCH,delete:j.POST_FETCH},t),this.type="lifecycleStatus",this.allowedStatuses=t.allowedStatuses?[...t.allowedStatuses]:[],this.deniedStatuses=t.deniedStatuses?[...t.deniedStatuses]:[]}toJSON(){let e={...super.toJSON()};return this.allowedStatuses.length>0&&(e.allowedStatuses=structuredClone(this.allowedStatuses)),this.deniedStatuses.length>0&&(e.deniedStatuses=structuredClone(this.deniedStatuses)),e}};var rr=class extends de{type;property;value;constructor(e,t={}){super(e,{list:j.PRE_FETCH,create:j.PRE_FETCH,search:j.PRE_FETCH,read:j.PRE_FETCH,update:j.PRE_FETCH,delete:j.PRE_FETCH},t),this.type="matchUserProperty",this.property=t.property??"",this.value=t.value??""}toJSON(){return{...super.toJSON(),property:this.property,value:this.value}}};var ar=class extends de{type;role;constructor(e,t={}){super(e,{list:j.PRE_FETCH,create:j.PRE_FETCH,search:j.PRE_FETCH,read:j.PRE_FETCH,update:j.PRE_FETCH,delete:j.PRE_FETCH},t),this.type="matchUserRole",this.role=t.role?[...t.role]:[]}toJSON(){return{...super.toJSON(),role:structuredClone(this.role)}}};function Mt(o,e){switch(e.type){case"allowAuthenticated":return new Xi(o,e);case"allowPublic":return new Zi(o,e);case"matchEmailDomain":return new Qi(o,e);case"matchResourceOwner":return new er(o,e);case"matchResourceAttribute":return new tr(o,e);case"lifecycleStatus":return new ir(o,e);case"matchUserProperty":return new rr(o,e);case"matchUserRole":return new ar(o,e);default:throw new h("Unknown access rule kind",{code:"E_UNKNOWN_ACCESS_RULE_KIND",status:422})}}var fe=class{kind;accessRule;rateLimiting;parent;constructor(e,t={}){this.parent=e,this.kind=t.kind||"",this.accessRule=t.accessRule?t.accessRule.map(i=>Mt(this,i)):[],this.rateLimiting=t.rateLimiting?new Xe(t.rateLimiting):void 0}toJSON(){let e={kind:this.kind};return this.accessRule.length&&(e.accessRule=this.accessRule.map(t=>t.toJSON())),this.rateLimiting&&(e.rateLimiting=this.rateLimiting.toJSON()),e}getAllRules(){return[...this.parent.getAllRules(),...this.accessRule]}getAllRateLimiters(){let e=this.parent.getAllRateLimiters();return this.rateLimiting&&e.push(this.rateLimiting),e}};var ai=class extends fe{kind;constructor(e,t={}){super(e,t),this.kind="create"}toJSON(){return{...super.toJSON(),kind:"create"}}static isCreateAction(e){return e.kind==="create"}static isCreateActionSchema(e){return e.kind==="create"}};var bt=class extends fe{kind;strategy;retentionPeriod;constructor(e,t={}){super(e,t),this.kind="delete",this.strategy=t.strategy||"soft",this.retentionPeriod=t.retentionPeriod??30}toJSON(){return{...super.toJSON(),kind:"delete",strategy:this.strategy,retentionPeriod:this.retentionPeriod}}static isDeleteAction(e){return e.kind==="delete"}static isDeleteActionSchema(e){return e.kind==="delete"}};var nt=class extends fe{kind;cacheTtl;constructor(e,t={}){super(e,t),this.kind="list",this.cacheTtl=t.cacheTtl}toJSON(){let e={...super.toJSON(),kind:"list"};return this.cacheTtl!==void 0&&(e.cacheTtl=this.cacheTtl),e}static isListAction(e){return e.kind==="list"}static isListActionSchema(e){return e.kind==="list"}};var si=class extends fe{kind;constructor(e,t={}){super(e,t),this.kind="read"}toJSON(){return{...super.toJSON(),kind:"read"}}static isReadAction(e){return e.kind==="read"}static isReadActionSchema(e){return e.kind==="read"}};var ot=class extends fe{kind;maxAstDepth;constructor(e,t={}){super(e,t),this.kind="search",this.maxAstDepth=t.maxAstDepth}toJSON(){let e={...super.toJSON(),kind:"search"};return this.maxAstDepth!==void 0&&(e.maxAstDepth=this.maxAstDepth),e}static isSearchActionSchema(e){return e.kind==="search"}static isSearchAction(e){return e.kind==="search"}};var wt=class extends fe{kind;allowedMethods;constructor(e,t={}){super(e,t),this.kind="update",this.allowedMethods=t.allowedMethods?[...t.allowedMethods]:["PATCH"]}toJSON(){return{...super.toJSON(),kind:"update",allowedMethods:structuredClone(this.allowedMethods)}}static isUpdateAction(e){return e.kind==="update"}static isUpdateActionSchema(e){return e.kind==="update"}};function Yr(o,e){switch(e.kind){case"list":return new nt(o,e);case"read":return new si(o,e);case"create":return new ai(o,e);case"update":return new wt(o,e);case"delete":return new bt(o,e);case"search":return new ot(o,e);default:throw new h("Unknown action kind",{code:"E_UNKNOWN_ACTION_KIND",status:422})}}function ss(o,e){switch(e){case"list":return new nt(o);case"read":return new si(o);case"create":return new ai(o);case"update":return new wt(o);case"delete":return new bt(o);case"search":return new ot(o);default:throw new h("Unknown action kind",{code:"E_UNKNOWN_ACTION_KIND",status:422})}}var w;(function(o){o.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",o.STRING="STRING",o.NUMBER="NUMBER",o.INTEGER="INTEGER",o.BOOLEAN="BOOLEAN",o.ARRAY="ARRAY",o.OBJECT="OBJECT",o.NULL="NULL"})(w||(w={}));var ns={[y.Address]:{type:"object",properties:{}},[y.Calculated]:{type:"object",description:"Use Calculated when you need mathematical operations, aggregations, or complex business logic.",properties:{formula:{type:"string",description:'Formula to calculate the value (e.g., "price * quantity").'},dependencies:{type:"array",items:{type:"string"},description:"List of field keys this calculation depends on."},recalculateOnUpdate:{type:"boolean",default:!0,description:"Whether to automatically recalculate when source fields change."},allowManualOverride:{type:"boolean",default:!1,description:"Whether users can manually override the calculated value."}}},[y.Categories]:{type:"object",description:"Controls allowed categories, hierarchy, and formatting for associations.",properties:{allowedCategories:{type:"array",items:{type:"string"},description:"Pre-defined list of allowed categories."},allowCustomCategories:{type:"boolean",default:!0,description:"Whether users can create new categories not in the allowed list."},allowHierarchy:{type:"boolean",default:!0,description:"Whether categories can have sub-categories (parent-child relationship)."},maxDepth:{type:"number",description:"Maximum nesting depth for category hierarchies."},caseSensitive:{type:"boolean",default:!1},allowUnicode:{type:"boolean",default:!1}}},[y.City]:{type:"object",properties:{}},[y.ClientIPAddress]:{type:"object",properties:{}},[y.Country]:{type:"object",properties:{format:{type:"string",enum:["ISO_3166_Alpha_2","ISO_3166_Alpha_3","Name"],default:"ISO_3166_Alpha_2",description:"Format to store the country in. Alpha_2 is standard 2-letter code (e.g. US), Alpha_3 is 3-letter (e.g. USA), Name is full name."},allowedCountries:{type:"array",items:{type:"string"},description:"List of allowed countries in the specified format. If empty, all are allowed."},disallowedCountries:{type:"array",items:{type:"string"},description:"List of explicitly forbidden countries."}}},[y.CreatedTimestamp]:{type:"object",properties:{}},[y.Currency]:{type:"object",description:"Controls monetary value storage, validation, currency handling, and precision.",properties:{storageFormat:{type:"string",enum:["decimal","integer_cents","complex_object"],default:"decimal",description:"Format to store currency. decimal relies on decimal floating points, integer_cents stores values as an integer of cents, and complex_object stores both amount and currency code."},defaultCurrency:{type:"string",default:"USD",description:"Default ISO 4217 currency code if none is provided."},allowedCurrencies:{type:"array",items:{type:"string"},description:"List of allowed ISO 4217 currency codes. If empty, all are allowed."},decimalPlaces:{type:"number",default:2,description:"Number of decimal places to enforce/round to."},allowNegative:{type:"boolean",default:!1,description:"Whether to allow negative currency values."},validateCurrencyCode:{type:"boolean",default:!0,description:"Whether to validate the currency code against standard ISO codes."}}},[y.DeletedFlag]:{type:"object",properties:{}},[y.DeletedTimestamp]:{type:"object",properties:{}},[y.Derived]:{type:"object",description:"Use Derived when you need to combine, format, or transform existing field values",properties:{sourceFields:{type:"array",items:{type:"string"},description:"Array of field keys that this derived field depends on."},transformation:{type:"string",description:"Name of a transformation function to apply to the source fields."},recalculateOnUpdate:{type:"boolean",default:!0,description:"Whether to automatically recalculate when source fields change."},allowManualOverride:{type:"boolean",default:!1,description:"Whether users can manually override the derived value."}}},[y.Description]:{type:"object",description:"The description field doesn't have any configuration options.",properties:{}},[y.Email]:{type:"object",properties:{allowedDomains:{type:"array",items:{type:"string"},description:"List of allowed domains (e.g. example.com). If empty, all valid domains are permitted."},disallowedDomains:{type:"array",items:{type:"string"},description:"List of disallowed domains (e.g. example.com)."},requireVerification:{type:"boolean",default:!0,description:"Whether the email address requires a verification confirm loop."},allowSubaddressing:{type:"boolean",default:!0,description:"Whether to allow plus addressing e.g. user+tag@example.com"},allowInternational:{type:"boolean",default:!0,description:"Whether to allow internationalized domain names and characters in the local part."}}},[y.FileURL]:{type:"object",properties:{}},[y.GeospatialCoordinates]:{type:"object",properties:{format:{type:"string",enum:["lat,lon","lon,lat","postgis","degree","wkt","geojson"],default:"lat,lon"},spatialReferenceSystem:{type:"string",enum:["EPSG:4326","EPSG:3857","EPSG:4269","EPSG:4267"],default:"EPSG:4326",description:"The spatial reference system (SRS) for the coordinates. Defaults to WGS84 (EPSG:4326)."},defaultDistanceUnit:{type:"string",enum:["meters","kilometers","miles","feet","yards","nautical_miles"],default:"meters",description:"The default distance unit for spatial queries."},enableSpatialIndexing:{type:"boolean",default:!0},enableValidation:{type:"boolean",default:!0},validationBounds:{type:"object",properties:{minLatitude:{type:"number"},maxLatitude:{type:"number"},minLongitude:{type:"number"},maxLongitude:{type:"number"}},description:"Custom validation rules for coordinate bounds in decimal degrees."},enablePostGISIntegration:{type:"boolean",default:!0},postGISGeometryType:{type:"string",enum:["POINT","LINESTRING","POLYGON","MULTIPOINT","MULTILINESTRING","MULTIPOLYGON"],default:"POINT",description:"The PostGIS geometry type to use for storage. Defines the shape of the data and the types of queries."},enableDistanceQueries:{type:"boolean",default:!0},maxQueryDistance:{type:"number",default:1e5},enableBoundingBoxQueries:{type:"boolean",default:!0},enablePolygonQueries:{type:"boolean",default:!1},enableGeoClustering:{type:"boolean",default:!1},maxClusterPrecision:{type:"number"},apiEndpointPrefix:{type:"string",default:"/nearby"},includeElevation:{type:"boolean",default:!1},coordinatePrecision:{type:"number",default:6},enableReverseGeocoding:{type:"boolean",default:!1}}},[y.HTML]:{type:"object",properties:{allowedTags:{type:"array",items:{type:"string"},description:"List of allowed HTML tags. Tags not in this list will be stripped."},sanitizeLevel:{type:"string",enum:["strict","moderate","none"],default:"strict",description:"Sanitization level. Strict removes almost all styling and scripts. Moderate allows some unsafe constructs like scripts. None bypasses sanitization."},allowImages:{type:"boolean",default:!0},allowLinks:{type:"boolean",default:!0},allowTables:{type:"boolean",default:!0},allowForms:{type:"boolean",default:!1},allowScripts:{type:"boolean",default:!1},allowIframes:{type:"boolean",default:!1},allowEmbedded:{type:"boolean",default:!1},allowStyles:{type:"boolean",default:!1},allowDataAttributes:{type:"boolean",default:!1}}},[y.ImageURL]:{type:"object",properties:{}},[y.Markdown]:{type:"object",properties:{allowedTags:{type:"array",items:{type:"string"},description:"Allowed HTML tags within the Markdown."},sanitizeLevel:{type:"string",enum:["strict","moderate","none"],default:"strict",description:"Sanitization level for HTML within Markdown. Strict removes all. Moderate allows basic formatting tags. None bypasses sanitization."},allowImages:{type:"boolean",default:!0},allowLinks:{type:"boolean",default:!0},allowTables:{type:"boolean",default:!0},allowHtml:{type:"boolean",default:!1},allowFootnotes:{type:"boolean",default:!1},allowTaskLists:{type:"boolean",default:!1},allowStrikethrough:{type:"boolean",default:!0},allowMath:{type:"boolean",default:!1}}},[y.Name]:{type:"object",properties:{}},[y.Password]:{type:"object",properties:{requireSpecialChars:{type:"boolean",default:!1},requireNumbers:{type:"boolean",default:!1},requireUppercase:{type:"boolean",default:!1},requireLowercase:{type:"boolean",default:!1},encryptionAlgorithm:{type:"string",enum:["bcrypt","argon2","scrypt"],default:"bcrypt",description:"The algorithm used to hash the password before storage."},saltRounds:{type:"number",default:12,description:"Work factor for hashing algorithms like bcrypt or argon2."},maxAge:{type:"number",description:"Maximum age in days before the password expires."},preventReuse:{type:"boolean",default:!1,description:"Whether to prevent reuse of previous passwords."},preventReuseCount:{type:"number",default:5,description:"Number of previous passwords to remember and prevent reuse of."},customPattern:{type:"string",description:"Custom regex pattern for password validation."},customErrorMessage:{type:"string"},allowCommonPasswords:{type:"boolean",default:!1,description:"Whether to check against dictionaries of common/compromised passwords."}}},[y.Phone]:{type:"object",properties:{allowedCountries:{type:"array",items:{type:"string"},description:"List of allowed country codes (ISO 3166-1 alpha-2 format)."},requireCountryCode:{type:"boolean",default:!0,description:"Whether the phone number must include a country code."},format:{type:"string",enum:["national","international","custom"],default:"international",description:"Format for phone validation and display. national omits country code, international uses E.164 (+1...), custom uses customFormat pattern."},customFormat:{type:"string",description:'Custom pattern like "(###) ###-####"; only used when format is custom.'},allowExtension:{type:"boolean",default:!1},requireVerification:{type:"boolean",default:!1},verificationMethod:{type:"string",enum:["sms","call"],default:"sms"}}},[y.PostalCode]:{type:"object",properties:{validate:{type:"boolean",default:!1,description:"Whether to validate the postal code format."},allowedPostalCodes:{type:"array",items:{type:"string"},description:"List of exactly allowed postal codes."},disallowedPostalCodes:{type:"array",items:{type:"string"},description:"List of explicitly forbidden postal codes."}}},[y.PublicUniqueName]:{type:"object",properties:{sourceField:{type:"string",description:"The field to derive the public unique name from."},separator:{type:"string",default:"-",description:'Character used to replace spaces or combine multiple words (e.g. "-" for slugs).'},caseSensitive:{type:"boolean",default:!1},allowUnicode:{type:"boolean",default:!1,description:"Whether to allow non-ASCII characters."},allowDuplicates:{type:"boolean",default:!1,description:"Whether to append random suffix if the name is already taken. Defaults to failing uniqueness."},fallbackField:{type:"string",description:"A field to use if the source field is empty."}}},[y.Region]:{type:"object",properties:{}},[y.ResourceOwnerIdentifier]:{type:"object",properties:{}},[y.SKU]:{type:"object",properties:{validationMode:{type:"string",enum:["strict","lenient","custom"],default:"strict",description:"Validation strictness. strict enforces alphanumeric + hyphens/underscores. lenient allows more special chars. custom uses customPattern."},customPattern:{type:"string",description:"Regex pattern applied when validationMode is custom."},caseMode:{type:"string",enum:["uppercase","lowercase","preserve"],default:"uppercase"},prefix:{type:"string",description:"Required prefix for all SKUs."},enforceUniqueness:{type:"boolean",default:!0},autoGenerate:{type:"boolean",default:!1,description:"Whether to automatically generate the SKU."},autoGenerateSource:{type:"string",description:"Field to derive the SKU from, if autoGenerate is true."},validateReservedWords:{type:"boolean",default:!0},reservedValues:{type:"array",items:{type:"string"},description:"Specific SKUs that are not permitted to be used."}}},[y.Status]:{type:"object",properties:{allowedStates:{type:"array",items:{type:"string"},description:"Pre-defined list of valid states (e.g., draft, published, archived)."},defaultState:{type:"string",description:"The initial state assigned when an entity is created."},transitions:{type:"object",additionalProperties:{type:"array",items:{type:"string"}},description:"Map representing allowed state transitions. Key is current state and value is array of valid next states."},stateBehaviors:{type:"object",additionalProperties:{type:"object",properties:{isPublic:{type:"boolean",default:!0},isEditable:{type:"boolean",default:!0},isDeletable:{type:"boolean",default:!1},requiresApproval:{type:"boolean",default:!1},displayName:{type:"string"},description:{type:"string"},color:{type:"string"},icon:{type:"string"}}}},workflow:{type:"object",properties:{requiresApproval:{type:"boolean",default:!1},approvalRoles:{type:"array",items:{type:"string"}},sendNotifications:{type:"boolean",default:!1},notificationChannels:{type:"array",items:{type:"string",enum:["email","sms","push","webhook"]}},logHistory:{type:"boolean",default:!0},allowBulkChanges:{type:"boolean",default:!1}}},autoTransitions:{type:"array",items:{type:"object",properties:{from:{type:"string"},to:{type:"string"},condition:{type:"string"},requiresApproval:{type:"boolean",default:!1}},required:["from","to","condition"]}}}},[y.StreetAddress]:{type:"object",properties:{}},[y.StreetAddressSupplemental]:{type:"object",properties:{}},[y.Summary]:{type:"object",properties:{}},[y.Tags]:{type:"object",properties:{allowedTags:{type:"array",items:{type:"string"}},allowCustomTags:{type:"boolean",default:!0},caseSensitive:{type:"boolean",default:!1},allowUnicode:{type:"boolean",default:!1}}},[y.Title]:{type:"object",properties:{}},[y.UpdatedTimestamp]:{type:"object",properties:{}},[y.URL]:{type:"object",properties:{requireHttps:{type:"boolean",default:!1},allowQueryParams:{type:"boolean",default:!0},allowFragments:{type:"boolean",default:!0},allowInternational:{type:"boolean",default:!0},allowIP:{type:"boolean",default:!0},allowPort:{type:"boolean",default:!0},allowAuthentication:{type:"boolean",default:!1}}},[y.User]:{type:"object",properties:{}},[y.Username]:{type:"object",properties:{}},[y.UserRole]:{type:"object",properties:{}},[y.Version]:{type:"object",properties:{}}};var ho=[{functionDeclarations:[{name:"list_semantics",description:"List all available data semantics, their scopes, and whether they have configuration options.",parametersJsonSchema:{type:w.OBJECT,properties:{},required:[]}},{name:"get_semantic_details",description:"Get detailed information about a specific data semantic, notably its JSON configuration schema properties, to determine what additional config you might want to provide.",parametersJsonSchema:{type:w.OBJECT,properties:{semanticId:{type:w.STRING,description:"The exact ID of the semantic (e.g. Semantic#Password, Semantic#Tags)"}},required:["semanticId"]}},{name:"get_entity_details",description:"Get the full details of an entity given its key, including properties, associations, and tags.",parametersJsonSchema:{type:w.OBJECT,properties:{entityKey:{type:w.STRING,description:"The exact key/ID of the entity to fetch details for."}},required:["entityKey"]}},{name:"explain_schema",description:"Explains the schema of a data type.",parametersJsonSchema:{type:w.OBJECT,properties:{dataType:{type:w.STRING,description:"The data type (e.g. string, number, boolean, date, datetime, time, binary)"}},required:["dataType"]}}]}];var Ze={type:w.OBJECT,properties:{id:{type:w.STRING},config:{type:w.OBJECT}},required:["id"]},ls={type:w.OBJECT,properties:{key:{type:w.STRING,description:"The key of the target entity."},domain:{type:w.STRING,description:"The key of the target data domain. Only set when the target is in a different data domain."}},required:["key"]},fo={type:w.OBJECT,properties:{type:{type:w.STRING,description:"Enum: literal, function"},value:{type:w.STRING,description:"The default value of the property"}},required:["type"]},cs={type:w.OBJECT,properties:{minimum:{type:w.NUMBER,nullable:!0},maximum:{type:w.NUMBER,nullable:!0},exclusiveMinimum:{type:w.BOOLEAN,nullable:!0},exclusiveMaximum:{type:w.BOOLEAN,nullable:!0},multipleOf:{type:w.NUMBER,nullable:!0},enum:{type:w.ARRAY,items:{type:w.STRING},nullable:!0},examples:{type:w.ARRAY,items:{type:w.STRING},nullable:!0},defaultValue:{...fo,nullable:!0},pattern:{type:w.STRING,nullable:!0}}},ds={type:w.OBJECT,properties:{required:{type:w.BOOLEAN,nullable:!0},unique:{type:w.BOOLEAN,nullable:!0},index:{type:w.BOOLEAN,nullable:!0},primary:{type:w.BOOLEAN,nullable:!0},multiple:{type:w.BOOLEAN,nullable:!0},readOnly:{type:w.BOOLEAN,nullable:!0},writeOnly:{type:w.BOOLEAN,nullable:!0}}},ps={type:w.OBJECT,properties:{key:{type:w.STRING},name:{type:w.STRING},displayName:{type:w.STRING},description:{type:w.STRING},type:{type:w.STRING,description:"Enum: string, number, boolean, date, datetime, time, binary"},constraints:ds,deprecated:{type:w.BOOLEAN},schema:cs,semantics:{type:w.ARRAY,items:Ze,description:"List of semantics applied to this property. Note: ONLY use semantics with scope='property'."},tags:{type:w.ARRAY,items:{type:w.STRING},nullable:!0}},required:["key","name","type","displayName","description"]},go={type:w.OBJECT,properties:{embedded:{type:w.BOOLEAN,description:"Whether the association should be embedded in the target entity"},unionType:{type:w.STRING,description:"Enum: allOf, anyOf, oneOf, not"}}},us={type:w.OBJECT,properties:{key:{type:w.STRING},name:{type:w.STRING},displayName:{type:w.STRING},description:{type:w.STRING},targets:{type:w.ARRAY,items:ls},required:{type:w.BOOLEAN},multiple:{type:w.BOOLEAN,description:"Whether the association can have multiple targets (like User has multiple addresses)"},onDelete:{type:w.STRING,description:"Enum: restrict, cascade, setNull, doNothing"},semantics:{type:w.ARRAY,items:Ze,description:"List of semantics applied to this association. Note: ONLY use semantics with scope='association'."},schema:go},required:["key","name","targets","displayName","description"]},os={type:w.OBJECT,properties:{key:{type:w.STRING},name:{type:w.STRING},description:{type:w.STRING}},required:["key","name"]},yo={type:w.OBJECT,properties:{key:{type:w.STRING},modelKey:{type:w.STRING,description:'The Domain Model this entity belongs to (e.g. "users", "shipping")'},name:{type:w.STRING},displayName:{type:w.STRING},description:{type:w.STRING},tags:{type:w.ARRAY,items:{type:w.STRING}},semantics:{type:w.ARRAY,items:Ze,description:"List of semantics applied to this entity. Note: ONLY use semantics with scope='entity'."},properties:{type:w.ARRAY,items:ps},associations:{type:w.ARRAY,items:us}},required:["key","name","modelKey","displayName","description"]},bo={type:w.OBJECT,properties:{key:{type:w.STRING},name:{type:w.STRING},displayName:{type:w.STRING},description:{type:w.STRING},type:{type:w.STRING,description:"Enum: string, number, boolean, date, datetime, time, binary"},constraints:{...ds,nullable:!0},deprecated:{type:w.BOOLEAN,nullable:!0},schema:{...cs,nullable:!0},addedSemantics:{type:w.ARRAY,items:Ze,description:"Semantics to add. Note: ONLY use semantics with scope='property'."},modifiedSemantics:{type:w.ARRAY,items:Ze},deletedSemanticIds:{type:w.ARRAY,items:{type:w.STRING}}},required:["key"]},wo={type:w.OBJECT,properties:{key:{type:w.STRING},name:{type:w.STRING},displayName:{type:w.STRING},description:{type:w.STRING},targets:{type:w.ARRAY,items:ls},required:{type:w.BOOLEAN,nullable:!0},multiple:{type:w.BOOLEAN,nullable:!0,description:"Whether the association can have multiple targets (like User has multiple addresses)"},onDelete:{type:w.STRING,nullable:!0,description:"Enum: restrict, cascade, setNull, doNothing"},addedSemantics:{type:w.ARRAY,items:Ze,description:"Semantics to add. Note: ONLY use semantics with scope='association'."},modifiedSemantics:{type:w.ARRAY,items:Ze},deletedSemanticIds:{type:w.ARRAY,items:{type:w.STRING}}},required:["key"]},vo={type:w.OBJECT,properties:{sessionTitle:{type:w.STRING,description:"A short, 3-to-5 word descriptive title for this data modeling session."},reasoning:{type:w.STRING,description:"Conversational response analyzing the request or explaining changes, in markdown format"},delta:{type:w.OBJECT,properties:{addedModels:{type:w.ARRAY,items:os,description:"Brand new models to create"},deletedModelKeys:{type:w.ARRAY,items:{type:w.STRING},description:"Keys of completely removed models. This also removes all entities and associations in the model."},modifiedModels:{type:w.ARRAY,items:os,description:"Models to modify in the domain"},addedEntities:{type:w.ARRAY,items:yo,description:"Brand new entities to create"},deletedEntityKeys:{type:w.ARRAY,items:{type:w.STRING},description:"Keys of completely removed entities"},modifiedEntities:{type:w.ARRAY,items:{type:w.OBJECT,properties:{key:{type:w.STRING,description:"The original key of the existing entity being modified"},modelKey:{type:w.STRING,description:"Change this to migrate the entity to a different model (boundary)"},name:{type:w.STRING},displayName:{type:w.STRING},description:{type:w.STRING},tags:{type:w.ARRAY,items:{type:w.STRING},nullable:!0},addedSemantics:{type:w.ARRAY,items:Ze,description:"Semantics to add. Note: ONLY use semantics with scope='entity'."},modifiedSemantics:{type:w.ARRAY,items:Ze},deletedSemanticIds:{type:w.ARRAY,items:{type:w.STRING}},addedProperties:{type:w.ARRAY,items:ps},modifiedProperties:{type:w.ARRAY,items:bo},deletedPropertyKeys:{type:w.ARRAY,items:{type:w.STRING}},addedAssociations:{type:w.ARRAY,items:us},modifiedAssociations:{type:w.ARRAY,items:wo},deletedAssociationKeys:{type:w.ARRAY,items:{type:w.STRING}}},required:["key"]},description:"Modifications to existing entities like adding, removing, or changing properties/associations"}},required:["addedModels","deletedModelKeys","modifiedModels","addedEntities","deletedEntityKeys","modifiedEntities"]}},required:["reasoning","delta"]};var ko="http://a.ml/",Qe=`${ko}vocabularies/`,M=`${Qe}document#`,Q=`${Qe}core#`,q=`${Qe}security#`,x=`${Qe}apiContract#`,ni=`${Qe}apiBinding#`,T=`${Qe}shapes#`,re=`${Qe}data#`,Re=`${Qe}document-source-maps#`,oi="http://www.w3.org/",Y=`${oi}ns/shacl#`,be=`${oi}2001/XMLSchema#`,sr=`${oi}1999/02/22-rdf-syntax-ns#`,Xr=`${oi}2000/01/rdf-schema#`,d={aml:{key:"http://a.ml/",vocabularies:{key:Qe,document:{key:M,Module:`${M}Module`,Document:`${M}Document`,Fragment:`${M}Fragment`,Unit:`${M}Unit`,SecuritySchemeFragment:`${M}SecuritySchemeFragment`,UserDocumentation:`${M}UserDocumentation`,DataType:`${M}DataType`,NamedExamples:`${M}NamedExamples`,DomainElement:`${M}DomainElement`,DomainProperty:`${M}DomainProperty`,ParametrizedDeclaration:`${M}ParametrizedDeclaration`,AbstractDeclaration:`${M}AbstractDeclaration`,VariableValue:`${M}VariableValue`,ExternalFragment:`${M}ExternalFragment`,ExternalDomainElement:`${M}ExternalDomainElement`,RootDomainElement:`${M}RootDomainElement`,APIContractProcessingData:`${M}APIContractProcessingData`,BaseUnitProcessingData:`${M}BaseUnitProcessingData`,customDomainProperties:`${M}customDomainProperties`,encodes:`${M}encodes`,declares:`${M}declares`,references:`${M}references`,examples:`${M}examples`,linkTarget:`${M}link-target`,linkLabel:`${M}link-label`,referenceId:`${M}reference-id`,structuredValue:`${M}structuredValue`,raw:`${M}raw`,extends:`${M}extends`,value:`${M}value`,name:`${M}name`,strict:`${M}strict`,deprecated:`${M}deprecated`,location:`${M}location`,variable:`${M}variable`,target:`${M}target`,dataNode:`${M}dataNode`,root:`${M}root`,usage:`${M}usage`,version:`${M}version`},core:{key:Q,CreativeWork:`${Q}CreativeWork`,Parameter:`${Q}Parameter`,Organization:`${Q}Organization`,License:`${Q}License`,Operation:`${Q}Operation`,Response:`${Q}Response`,Payload:`${Q}Payload`,Request:`${Q}Request`,version:`${Q}version`,urlTemplate:`${Q}urlTemplate`,displayName:`${Q}displayName`,title:`${Q}title`,name:`${Q}name`,description:`${Q}description`,documentation:`${Q}documentation`,summary:`${Q}summary`,provider:`${Q}provider`,email:`${Q}email`,url:`${Q}url`,termsOfService:`${Q}termsOfService`,license:`${Q}license`,mediaType:`${Q}mediaType`,extensionName:`${Q}extensionName`,deprecated:`${Q}deprecated`},security:{key:q,ParametrizedSecurityScheme:`${q}ParametrizedSecurityScheme`,SecuritySchemeFragment:`${q}SecuritySchemeFragment`,SecurityScheme:`${q}SecurityScheme`,OAuth1Settings:`${q}OAuth1Settings`,OAuth2Settings:`${q}OAuth2Settings`,OAuth2Flow:`${q}OAuth2Flow`,Scope:`${q}Scope`,Settings:`${q}Settings`,HttpSettings:`${q}HttpSettings`,ApiKeySettings:`${q}ApiKeySettings`,OpenIdConnectSettings:`${q}OpenIdConnectSettings`,SecurityRequirement:`${q}SecurityRequirement`,security:`${q}security`,scheme:`${q}scheme`,schemes:`${q}schemes`,settings:`${q}settings`,name:`${q}name`,type:`${q}type`,scope:`${q}scope`,accessTokenUri:`${q}accessTokenUri`,authorizationUri:`${q}authorizationUri`,authorizationGrant:`${q}authorizationGrant`,flows:`${q}flows`,flow:`${q}flow`,signature:`${q}signature`,tokenCredentialsUri:`${q}tokenCredentialsUri`,requestTokenUri:`${q}requestTokenUri`,refreshUri:`${q}refreshUri`,securityRequirement:`${q}SecurityRequirement`,openIdConnectUrl:`${q}openIdConnectUrl`,bearerFormat:`${q}bearerFormat`,in:`${q}in`},apiContract:{key:x,Payload:`${x}Payload`,Request:`${x}Request`,Response:`${x}Response`,EndPoint:`${x}EndPoint`,Parameter:`${x}Parameter`,Operation:`${x}Operation`,WebAPI:`${x}WebAPI`,API:`${x}API`,AsyncAPI:`${x}AsyncAPI`,UserDocumentationFragment:`${x}UserDocumentationFragment`,Example:`${x}Example`,Server:`${x}Server`,ResourceType:`${x}ResourceType`,Trait:`${x}Trait`,TraitFragment:`${x}TraitFragment`,ParametrizedResourceType:`${x}ParametrizedResourceType`,ParametrizedTrait:`${x}ParametrizedTrait`,Callback:`${x}Callback`,TemplatedLink:`${x}TemplatedLink`,IriTemplateMapping:`${x}IriTemplateMapping`,Tag:`${x}Tag`,Message:`${x}Message`,DomainExtension:`${x}DomainExtension`,Encoding:`${x}Encoding`,header:`${x}header`,parameter:`${x}parameter`,paramName:`${x}paramName`,uriParameter:`${x}uriParameter`,cookieParameter:`${x}cookieParameter`,variable:`${x}variable`,payload:`${x}payload`,server:`${x}server`,path:`${x}path`,url:`${x}url`,scheme:`${x}scheme`,endpoint:`${x}endpoint`,queryString:`${x}queryString`,accepts:`${x}accepts`,guiSummary:`${x}guiSummary`,binding:`${x}binding`,response:`${x}response`,returns:`${x}returns`,expects:`${x}expects`,examples:`${x}examples`,supportedOperation:`${x}supportedOperation`,messageId:`${x}messageId`,statusCode:`${x}statusCode`,method:`${x}method`,required:`${x}required`,callback:`${x}callback`,expression:`${x}expression`,link:`${x}link`,linkExpression:`${x}linkExpression`,templateVariable:`${x}templateVariable`,mapping:`${x}mapping`,operationId:`${x}operationId`,protocol:`${x}protocol`,protocolVersion:`${x}protocolVersion`,headerSchema:`${x}headerSchema`,contentType:`${x}contentType`,allowEmptyValue:`${x}allowEmptyValue`,style:`${x}style`,explode:`${x}explode`,allowReserved:`${x}allowReserved`,tag:`${x}tag`,tags:`${x}tags`},apiBinding:{key:ni,binding:`${ni}binding`,bindings:`${ni}bindings`,messageKey:`${ni}messageKey`,type:`${ni}type`},shapes:{key:T,Shape:`${T}Shape`,ScalarShape:`${T}ScalarShape`,ArrayShape:`${T}ArrayShape`,UnionShape:`${T}UnionShape`,NilShape:`${T}NilShape`,FileShape:`${T}FileShape`,AnyShape:`${T}AnyShape`,SchemaShape:`${T}SchemaShape`,MatrixShape:`${T}MatrixShape`,TupleShape:`${T}TupleShape`,RecursiveShape:`${T}RecursiveShape`,DataTypeFragment:`${T}DataTypeFragment`,XMLSerializer:`${T}XMLSerializer`,number:`${T}number`,integer:`${T}integer`,long:`${T}long`,double:`${T}double`,boolean:`${T}boolean`,float:`${T}float`,nil:`${T}nil`,password:`${T}password`,int32:`${T}int32`,int64:`${T}int64`,uint32:`${T}uint32`,uint64:`${T}uint64`,sint32:`${T}sint32`,sint64:`${T}sint64`,fixed32:`${T}fixed32`,fixed64:`${T}fixed64`,sfixed32:`${T}sfixed32`,sfixed64:`${T}sfixed64`,dateTimeOnly:`${T}dateTimeOnly`,range:`${T}range`,items:`${T}items`,anyOf:`${T}anyOf`,fileType:`${T}fileType`,schema:`${T}schema`,xmlSerialization:`${T}xmlSerialization`,xmlName:`${T}xmlName`,xmlAttribute:`${T}xmlAttribute`,xmlWrapped:`${T}xmlWrapped`,xmlNamespace:`${T}xmlNamespace`,xmlPrefix:`${T}xmlPrefix`,readOnly:`${T}readOnly`,writeOnly:`${T}writeOnly`,deprecated:`${T}deprecated`,fixPoint:`${T}fixPoint`,discriminator:`${T}discriminator`,discriminatorValue:`${T}discriminatorValue`,format:`${T}format`,multipleOf:`${T}multipleOf`,uniqueItems:`${T}uniqueItems`},data:{key:re,Scalar:`${re}Scalar`,Object:`${re}Object`,Array:`${re}Array`,Node:`${re}Node`,value:`${re}value`,type:`${re}type`,description:`${re}description`,required:`${re}required`,displayName:`${re}displayName`,minLength:`${re}minLength`,maxLength:`${re}maxLength`,default:`${re}default`,multipleOf:`${re}multipleOf`,minimum:`${re}minimum`,maximum:`${re}maximum`,enum:`${re}enum`,pattern:`${re}pattern`,items:`${re}items`,format:`${re}format`,example:`${re}example`,examples:`${re}examples`},docSourceMaps:{key:Re,SourceMap:`${Re}SourceMap`,sources:`${Re}sources`,element:`${Re}element`,value:`${Re}value`,declaredElement:`${Re}declared-element`,trackedElement:`${Re}tracked-element`,parsedJsonSchema:`${Re}parsed-json-schema`,autoGeneratedName:`${Re}auto-generated-name`,lexical:`${Re}lexical`,synthesizedField:`${Re}synthesized-field`}}},w3:{key:oi,shacl:{key:Y,Shape:`${Y}Shape`,NodeShape:`${Y}NodeShape`,SchemaShape:`${Y}SchemaShape`,PropertyShape:`${Y}PropertyShape`,in:`${Y}in`,defaultValue:`${Y}defaultValue`,defaultValueStr:`${Y}defaultValueStr`,pattern:`${Y}pattern`,minInclusive:`${Y}minInclusive`,maxInclusive:`${Y}maxInclusive`,multipleOf:`${Y}multipleOf`,minLength:`${Y}minLength`,maxLength:`${Y}maxLength`,fileType:`${Y}fileType`,and:`${Y}and`,property:`${Y}property`,name:`${Y}name`,raw:`${Y}raw`,datatype:`${Y}datatype`,minCount:`${Y}minCount`,maxCount:`${Y}maxCount`,xone:`${Y}xone`,not:`${Y}not`,or:`${Y}or`,closed:`${Y}closed`,path:`${Y}path`,additionalPropertiesSchema:`${Y}additionalPropertiesSchema`},xmlSchema:{key:be,boolean:`${be}boolean`,string:`${be}string`,number:`${be}number`,integer:`${be}integer`,long:`${be}long`,double:`${be}double`,float:`${be}float`,nil:`${be}nil`,dateTime:`${be}dateTime`,time:`${be}time`,date:`${be}date`,base64Binary:`${be}base64Binary`,byte:`${be}byte`},rdfSyntax:{key:sr,Seq:`${sr}Seq`,Property:`${sr}Property`,member:`${sr}member`},rdfSchema:{key:Xr,Seq:`${Xr}Seq`,member:`${Xr}member`}}};function zt(o,e=0){if(typeof o!="object")return o;let t="",i=new Array(e).fill(" ").join("");return Object.keys(o).forEach(r=>{t+=Array.isArray(o[r])?"":`${i}<${r}>`,Array.isArray(o[r])?o[r].forEach(a=>{t+=i,t+=`<${r}>
|
|
133
|
+
${m}`));try{await eo(m)}catch{}})})}function Ya(o){let e=o.command("orgs").description("Manage organization configurations");e.command("list").description("List all organizations you belong to").action(async()=>{let t=new B({format:N.resolved.format});try{let i=ee(),a=(await i.organizations.list({token:i.token})).data||[],s=N.resolved,n=a.map(l=>({id:l.key,name:l.name,slug:l.slug,isDefault:l.key===s.org?"Yes":"No"}));t.list(n,["id","name","slug","isDefault"],{headers:["ID","NAME","SLUG","DEFAULT"]})}catch(i){let r=ie(i);t.error(r),process.exit(1)}}),e.command("set-default <oid>").description("Set your default organization ID").action(async t=>{let i=new B({format:N.resolved.format});try{let r=ee();((await r.organizations.list({token:r.token})).data||[]).some(l=>l.key===t)||(i.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Organization ID '${t}' not found in your authorized list.`,detail:"Run `apinow orgs list` to see all authorized organizations and their IDs."}),process.exit(1)),N.writeProperty("org",t),i.success(`Default organization ID set to '${t}'.`)}catch(r){let a=ie(r);i.error(a),process.exit(1)}}),e.command("default").alias("get-default").description("Get the default configured organization").action(async()=>{let t=new B({format:N.resolved.format});try{let i=N.resolved;i.org||(t.error({code:"CLI_ERR_MISSING_REQUIRED",message:"No default organization configured.",detail:"Set one using `apinow orgs set-default <oid>`. Run `apinow orgs list` to list available organizations."}),process.exit(1));let r=ee(),n=((await r.organizations.list({token:r.token})).data||[]).find(l=>l.key===i.org);n||(t.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Default organization ID '${i.org}' not found in your authorized list.`,detail:"Run `apinow orgs set-default <oid>` to configure a valid default organization."}),process.exit(1)),t.object({id:n.key,name:n.name,slug:n.slug})}catch(i){let r=ie(i);t.error(r),process.exit(1)}})}import ts from"node:fs";import uo from"node:path";var ii=class o{key;get kind(){return Ye}catalogKey;scope;lifecycle;version;publishedBy;unpublishedAt;deprecated;deprecatedAt;deprecatedBy;deprecationReason;createdAt;updatedAt;changelog;static createSchema(e){let{key:t="",scope:i="private",publishedBy:r="",createdAt:a=0,updatedAt:s=0,catalogKey:n="",lifecycle:l="stable",version:c=""}=e;if(["public","private","organization"].indexOf(i)===-1)throw new Error(`Invalid scope: ${i}`);let p={key:t,kind:Ye,scope:i,publishedBy:r,createdAt:a,updatedAt:s,catalogKey:n,lifecycle:l,version:c};return typeof e.deprecated=="boolean"&&(p.deprecated=e.deprecated),typeof e.deprecatedAt=="number"&&(p.deprecatedAt=e.deprecatedAt),typeof e.deprecatedBy=="string"&&(p.deprecatedBy=e.deprecatedBy),typeof e.changelog=="string"&&(p.changelog=e.changelog),typeof e.deprecationReason=="string"&&(p.deprecationReason=e.deprecationReason),typeof e.unpublishedAt=="number"&&(p.unpublishedAt=e.unpublishedAt),p}constructor(e={}){let t=o.createSchema(e);this.key=t.key,this.catalogKey=t.catalogKey,this.lifecycle=t.lifecycle,this.scope=t.scope,this.version=t.version,this.publishedBy=t.publishedBy,this.createdAt=t.createdAt,this.updatedAt=t.updatedAt,typeof t.changelog=="string"&&(this.changelog=t.changelog),typeof t.deprecated=="boolean"&&(this.deprecated=t.deprecated),typeof t.deprecatedAt=="number"&&(this.deprecatedAt=t.deprecatedAt),typeof t.deprecatedBy=="string"&&(this.deprecatedBy=t.deprecatedBy),typeof t.deprecationReason=="string"&&(this.deprecationReason=t.deprecationReason),typeof t.unpublishedAt=="number"&&(this.unpublishedAt=t.unpublishedAt)}toJSON(){let e={key:this.key,kind:Ye,scope:this.scope,publishedBy:this.publishedBy,createdAt:this.createdAt,updatedAt:this.updatedAt,catalogKey:this.catalogKey,lifecycle:this.lifecycle,version:this.version};return typeof this.deprecated=="boolean"&&(e.deprecated=this.deprecated),typeof this.deprecatedAt=="number"&&(e.deprecatedAt=this.deprecatedAt),typeof this.deprecatedBy=="string"&&(e.deprecatedBy=this.deprecatedBy),typeof this.deprecationReason=="string"&&(e.deprecationReason=this.deprecationReason),typeof this.unpublishedAt=="number"&&(e.unpublishedAt=this.unpublishedAt),typeof this.changelog=="string"&&this.changelog&&(e.changelog=this.changelog),e}};var y;(function(o){o.User="Semantic#User",o.Address="Semantic#Address",o.Password="Semantic#Password",o.Username="Semantic#Username",o.CreatedTimestamp="Semantic#CreatedTimestamp",o.UpdatedTimestamp="Semantic#UpdatedTimestamp",o.DeletedTimestamp="Semantic#DeletedTimestamp",o.DeletedFlag="Semantic#DeletedFlag",o.PublicUniqueName="Semantic#PublicUniqueName",o.Title="Semantic#Title",o.Name="Semantic#Name",o.UserRole="Semantic#UserRole",o.Status="Semantic#Status",o.Version="Semantic#Version",o.ImageURL="Semantic#ImageURL",o.FileURL="Semantic#FileURL",o.Markdown="Semantic#Markdown",o.HTML="Semantic#HTML",o.GeospatialCoordinates="Semantic#GeospatialCoordinates",o.Email="Semantic#Email",o.Phone="Semantic#Phone",o.Currency="Semantic#Currency",o.URL="Semantic#URL",o.SKU="Semantic#SKU",o.Description="Semantic#Description",o.Summary="Semantic#Summary",o.Calculated="Semantic#Calculated",o.Derived="Semantic#Derived",o.ClientIPAddress="Semantic#ClientIPAddress",o.StreetAddress="Semantic#StreetAddress",o.StreetAddressSupplemental="Semantic#StreetAddressSupplemental",o.City="Semantic#City",o.PostalCode="Semantic#PostalCode",o.Country="Semantic#Country",o.Region="Semantic#Region",o.ResourceOwnerIdentifier="Semantic#ResourceOwnerIdentifier",o.Tags="Semantic#Tags",o.Categories="Semantic#Categories"})(y||(y={}));var D;(function(o){o.Entity="Entity",o.Property="Property",o.Association="Association"})(D||(D={}));var z;(function(o){o.Identity="Identity & Authentication",o.Lifecycle="Timestamps & Versioning",o.Content="Content & Media",o.Business="Business Data",o.Organization="Classification & Organization",o.Location="Location & Geography",o.Contact="Contact Information",o.Computed="Computed Values"})(z||(z={}));var Xa=o=>o.scope===D.Entity,Wi=o=>o.scope===D.Property,Za=o=>o.scope===D.Association,Ue={[y.User]:{id:y.User,displayName:"User Entity",scope:D.Entity,description:"System users and accounts",category:z.Identity,hasConfig:!1},[y.Password]:{id:y.Password,displayName:"User Password",scope:D.Property,description:"Secure password field",category:z.Identity,applicableDataTypes:["string"],hasConfig:!0},[y.Username]:{id:y.Username,displayName:"Username",scope:D.Property,description:"User authentication identifier",category:z.Identity,applicableDataTypes:["string"],hasConfig:!1},[y.UserRole]:{id:y.UserRole,displayName:"User Role Field",scope:D.Property,description:"User permissions and access level",category:z.Identity,applicableDataTypes:["string"],hasConfig:!0},[y.ResourceOwnerIdentifier]:{id:y.ResourceOwnerIdentifier,displayName:"Resource Owner Identifier",scope:D.Association,description:"Links record to owner user",category:z.Identity,hasConfig:!1},[y.CreatedTimestamp]:{id:y.CreatedTimestamp,displayName:"Creation Timestamp",scope:D.Property,description:"When record was created",category:z.Lifecycle,applicableDataTypes:["datetime"],hasConfig:!1},[y.UpdatedTimestamp]:{id:y.UpdatedTimestamp,displayName:"Update Timestamp",scope:D.Property,description:"When record was last modified",category:z.Lifecycle,applicableDataTypes:["datetime"],hasConfig:!1},[y.DeletedTimestamp]:{id:y.DeletedTimestamp,displayName:"Soft Delete Timestamp",scope:D.Property,description:"When record was marked deleted",category:z.Lifecycle,applicableDataTypes:["datetime"],hasConfig:!1},[y.DeletedFlag]:{id:y.DeletedFlag,displayName:"Soft Delete Flag",scope:D.Property,description:"Mark record as deleted",category:z.Lifecycle,applicableDataTypes:["boolean"],hasConfig:!1},[y.Address]:{id:y.Address,displayName:"Address Entity",scope:D.Entity,description:"Physical address entity",category:z.Contact,hasConfig:!1},[y.StreetAddress]:{id:y.StreetAddress,displayName:"Street Address",scope:D.Property,description:"Street address line",category:z.Contact,applicableDataTypes:["string"],hasConfig:!1},[y.StreetAddressSupplemental]:{id:y.StreetAddressSupplemental,displayName:"Street Address Supplemental",scope:D.Property,description:"Supplemental street address line (e.g., Unit, Suite, Apartment, Floor)",category:z.Contact,applicableDataTypes:["string"],hasConfig:!1},[y.City]:{id:y.City,displayName:"City",scope:D.Property,description:"City or locality",category:z.Contact,applicableDataTypes:["string"],hasConfig:!1},[y.PostalCode]:{id:y.PostalCode,displayName:"Postal Code",scope:D.Property,description:"Postal or zip code",category:z.Contact,applicableDataTypes:["string"],hasConfig:!0},[y.Country]:{id:y.Country,displayName:"Country",scope:D.Property,description:"Country name or code",category:z.Contact,applicableDataTypes:["string"],hasConfig:!0},[y.Region]:{id:y.Region,displayName:"Region",scope:D.Property,description:"State, province, or region",category:z.Contact,applicableDataTypes:["string"],hasConfig:!1},[y.Version]:{id:y.Version,displayName:"Version Number",scope:D.Property,description:"Auto-incrementing version counter",category:z.Lifecycle,applicableDataTypes:["number"],hasConfig:!1},[y.Title]:{id:y.Title,displayName:"Record Title",scope:D.Property,description:"Main title or heading",category:z.Content,applicableDataTypes:["string"],hasConfig:!1},[y.Name]:{id:y.Name,displayName:"Name",scope:D.Property,description:"A person or pet name",category:z.Content,applicableDataTypes:["string"],hasConfig:!1},[y.Description]:{id:y.Description,displayName:"Description",scope:D.Property,description:"Detailed description text",category:z.Content,applicableDataTypes:["string"],hasConfig:!1},[y.Summary]:{id:y.Summary,displayName:"Summary",scope:D.Property,description:"Brief summary text",category:z.Content,applicableDataTypes:["string"],hasConfig:!1},[y.Markdown]:{id:y.Markdown,displayName:"Markdown Content",scope:D.Property,description:"Formatted text content",category:z.Content,applicableDataTypes:["string"],hasConfig:!0},[y.HTML]:{id:y.HTML,displayName:"HTML Content",scope:D.Property,description:"Rich HTML content",category:z.Content,applicableDataTypes:["string"],hasConfig:!0},[y.ImageURL]:{id:y.ImageURL,displayName:"Image URL",scope:D.Property,description:"Link to image file",category:z.Content,applicableDataTypes:["string"],hasConfig:!0},[y.FileURL]:{id:y.FileURL,displayName:"File URL",scope:D.Property,description:"Link to file attachment",category:z.Content,applicableDataTypes:["string"],hasConfig:!0},[y.Status]:{id:y.Status,displayName:"Record Status",scope:D.Property,description:"Current state of record",category:z.Business,applicableDataTypes:["string"],hasConfig:!0},[y.Currency]:{id:y.Currency,displayName:"Currency",scope:D.Property,description:"Monetary value with currency",category:z.Business,applicableDataTypes:["number","string"],hasConfig:!0},[y.SKU]:{id:y.SKU,displayName:"SKU",scope:D.Property,description:"Product identification code",category:z.Business,applicableDataTypes:["string"],hasConfig:!0},[y.Email]:{id:y.Email,displayName:"Email",scope:D.Property,description:"Email address",category:z.Contact,applicableDataTypes:["string"],hasConfig:!0},[y.Phone]:{id:y.Phone,displayName:"Phone",scope:D.Property,description:"Phone number",category:z.Contact,applicableDataTypes:["string"],hasConfig:!0},[y.URL]:{id:y.URL,displayName:"URL",scope:D.Property,description:"Web address or link",category:z.Contact,applicableDataTypes:["string"],hasConfig:!0},[y.ClientIPAddress]:{id:y.ClientIPAddress,displayName:"Client IP Address",scope:D.Property,description:"Automatically populated client IP address",category:z.Contact,applicableDataTypes:["string"],hasConfig:!1},[y.PublicUniqueName]:{id:y.PublicUniqueName,displayName:"Public Unique Name (Slug)",scope:D.Property,description:"URL-friendly unique identifier",category:z.Organization,applicableDataTypes:["string"],hasConfig:!0},[y.Tags]:{id:y.Tags,displayName:"Tags",scope:D.Association,description:"Enable tagging functionality",category:z.Organization,hasConfig:!0},[y.Categories]:{id:y.Categories,displayName:"Categories",scope:D.Association,description:"Enable categorization functionality",category:z.Organization,hasConfig:!0},[y.GeospatialCoordinates]:{id:y.GeospatialCoordinates,displayName:"Geospatial Coordinates",scope:D.Property,description:"Location coordinates",category:z.Location,applicableDataTypes:["string"],hasConfig:!0},[y.Calculated]:{id:y.Calculated,displayName:"Calculated",scope:D.Property,description:"Auto-calculated field value",category:z.Computed,applicableDataTypes:["string","number","boolean","date","datetime","time","binary"],hasConfig:!0},[y.Derived]:{id:y.Derived,displayName:"Derived",scope:D.Property,description:"Value derived from other fields",category:z.Computed,applicableDataTypes:["string"],hasConfig:!0}};var Wr;(function(o){o[o.Initializing=0]="Initializing",o[o.PendingDns=1]="PendingDns",o[o.Issuing=2]="Issuing",o[o.Active=3]="Active",o[o.Error=4]="Error"})(Wr||(Wr={}));function rs(o){let e=o.command("files").description("Manage files and metadata");e.command("list").description("List files in an organization").option("--org <oid>","Organization ID (optional, defaults to configured default org)").option("--kind <kind>","Filter by file kind (e.g. domain, api, folder)").option("--parent <parent>","Filter by parent folder ID").action(async t=>{let i=new B({format:N.resolved.format}),r=N.resolved,a=t.org||r.org;a||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Organization ID is required.",detail:"Pass --org <oid> or set a default organization using `apinow orgs set-default <oid>`."}),process.exit(1));try{let s=ee(),n={};if(t.parent&&(n.parent=t.parent),t.kind){let u=is(t.kind);n.filter={field:"kind",operator:"eq",value:u}}let p=((await s.files.list(a,n,{token:s.token})).data||[]).map(u=>({id:u.key,name:u.info?.name||"",kind:u.kind,isShortcut:u.isShortcut?"Yes":"No"}));i.list(p,["id","name","kind","isShortcut"],{headers:["ID","NAME","KIND","SHORTCUT"]})}catch(s){let n=ie(s);i.error(n),process.exit(1)}}),e.command("create").description("Create a new file metadata record (and optionally upload media)").option("--name <name>","Name of the file").option("--kind <kind>","Kind of the file (e.g., domain, api)").option("--org <oid>","Organization ID (optional, defaults to configured default org)").option("--parent <parent>","Parent folder ID").option("--media <path>","Local path to the file content/media to upload").option("--stdin","Read media content from STDIN").action(async t=>{let i=new B({format:N.resolved.format}),r=N.resolved,a=t.org||r.org;a||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Organization ID is required.",detail:"Pass --org <oid> or set a default organization using `apinow orgs set-default <oid>`."}),process.exit(1)),t.media&&t.stdin&&(i.error({code:"CLI_ERR_INVALID_ARGUMENT",message:"Cannot specify both --media <path> and --stdin"}),process.exit(1));let s=t.name;!s&&process.stdout.isTTY&&(s=await Xe("Enter file name:")),s||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Name is required.",detail:"Specify --name <name>."}),process.exit(1));let n=t.kind;!n&&process.stdout.isTTY&&(n=await Ut("Select file kind:",[{name:"API Domain / Schema (domain)",value:"domain"},{name:"API Schema (api)",value:"api"},{name:"Folder (folder)",value:"folder"}])),n||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Kind is required.",detail:"Specify --kind <kind> (allowed: api, domain, folder)."}),process.exit(1));try{let l;if(t.media){let v=uo.resolve(t.media);ts.existsSync(v)||(i.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Media file not found at path: ${v}`}),process.exit(1)),l=ts.readFileSync(v,"utf8")}else t.stdin&&(l=await mo());let c,p;if(l!==void 0){try{p=JSON.parse(l)}catch{throw new Error("invalid API now platform file")}if(!p||typeof p!="object"||Array.isArray(p)||!("key"in p)||typeof p.key!="string"||!p.key.trim())throw new Error("invalid API now platform file");c=p.key}let u=ee(),m=Oe.createSchema({kind:is(n),info:{name:s},key:c}),g={};t.parent&&(g.parent=t.parent);let f=await u.files.createMeta(m,a,g,{token:u.token}),b=f.key;l!==void 0&&await u.files.createMedia(p,a,b,{},{token:u.token}),i.success("File created successfully!",f)}catch(l){let c=ie(l);i.error({code:"CLI_ERR_API_FAILURE",...c}),process.exit(1)}}),e.command("read").description("Read file metadata or media content").option("--id <fid>","File ID").option("--org <oid>","Organization ID (optional, defaults to configured default org)").option("--meta","Read file metadata (default)").option("--media","Read file media/content").action(async t=>{let i=new B({format:N.resolved.format}),r=N.resolved,a=t.org||r.org;a||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Organization ID is required.",detail:"Pass --org <oid> or set a default organization using `apinow orgs set-default <oid>`."}),process.exit(1));let s=t.id;if(!s&&process.stdout.isTTY)try{let n=ee(),c=(await n.files.list(a,{},{token:n.token})).data||[];c.length>0&&(s=await Ut("Select a file to read:",c.map(p=>({name:`${p.info?.name||"Unnamed"} (${p.kind})`,value:p.key}))))}catch{}s||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"File ID is required.",detail:"Specify --id <fid>."}),process.exit(1));try{let n=ee();if(t.media){let c=(await n.files.readMedia(a,s,{token:n.token})).media;r.format==="json"?console.log(JSON.stringify(c,null,2)):console.log(typeof c=="object"&&c!==null?JSON.stringify(c,null,2):c)}else{let l=await n.files.read(a,s,{token:n.token});i.object(l)}}catch(n){let l=ie(n);i.error(l),process.exit(1)}})}function is(o){let e=o.toLowerCase();if(e==="api")return Ur;if(e==="domain")return Zt;if(e==="folder")return Ne;throw new Error(`Unsupported file kind "${o}". Allowed: api, domain, folder`)}async function mo(){return new Promise((o,e)=>{let t="";process.stdin.setEncoding("utf8"),process.stdin.on("data",i=>{t+=i}),process.stdin.on("end",()=>{o(t)}),process.stdin.on("error",i=>{e(i)})})}function as(o){let e=o.command("catalog").description("Manage Data Catalog items");e.command("publish").description("Publish a data domain file to the data catalog").option("--file <fid>","File ID of the data domain").option("--name <name>","Name for the catalog entry").option("--description <desc>","Description of the catalog entry").option("--scope <scope>","Publish scope: public, organization, private").option("-v, --catalog-version <ver>","Semantic version (e.g. 1.0.0)").option("--org <oid>","Organization ID (optional, defaults to configured default org)").option("--lifecycle <lifecycle>","Version lifecycle status (dev, beta, stable)","stable").option("--changelog <changelog>","Changelog description for this version").action(async t=>{let i=new B({format:N.resolved.format}),r=N.resolved,a=t.org||r.org;a||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Organization ID is required.",detail:"Pass --org <oid> or set a default organization using `apinow orgs set-default <oid>`."}),process.exit(1));let s=t.file;if(!s&&process.stdout.isTTY)try{let g=ee(),b=(await g.files.list(a,{filter:{field:"kind",operator:"eq",value:Zt}},{token:g.token})).data||[];b.length>0&&(s=await Ut("Select a data domain file to publish:",b.map(v=>({name:`${v.info?.name||"Unnamed"} (${v.key})`,value:v.key}))))}catch{}s||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"File ID is required.",detail:"Specify --file <fid>."}),process.exit(1));let n=t.name;!n&&process.stdout.isTTY&&(n=await Xe("Enter catalog entry name:")),n||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Name is required.",detail:"Specify --name <name>."}),process.exit(1));let l=t.description;!l&&process.stdout.isTTY&&(l=await Xe("Enter catalog entry description:")),l||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Description is required.",detail:"Specify --description <desc>."}),process.exit(1));let c=t.scope;!c&&process.stdout.isTTY&&(c=await Ut("Select publish scope:",[{name:"Public (public)",value:"public"},{name:"Organization (organization)",value:"organization"},{name:"Private (private)",value:"private"}])),c||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Scope is required.",detail:"Specify --scope <scope> (allowed: public, organization, private)."}),process.exit(1));let p=["public","organization","private"];p.includes(c)||(i.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Invalid scope '${c}'.`,detail:`Allowed: ${p.join(", ")}`}),process.exit(1));let u=t.catalogVersion;!u&&process.stdout.isTTY&&(u=await Xe("Enter semantic version:","1.0.0")),u||(i.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Version is required.",detail:"Specify --catalog-version <ver> or -v <ver>."}),process.exit(1));let m=["dev","beta","stable"];m.includes(t.lifecycle)||(i.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Invalid lifecycle '${t.lifecycle}'.`,detail:`Allowed: ${m.join(", ")}`}),process.exit(1));try{let g=ee(),f=null;try{f=(await g.dataCatalog.checkPublicationStatus(s,a,{token:g.token})).key}catch(S){if(ie(S).status!==404)throw S}if(f)N.resolved.format!=="json"&&console.log(`Catalog entry already exists (ID: ${f}). Publishing new version...`);else{N.resolved.format!=="json"&&console.log("Catalog entry does not exist. Creating new catalog entry...");let S={key:"",kind:We,organization:a,file:s,scope:c,name:n,description:l,publishedBy:"",publishedAt:0,createdAt:0,updatedAt:0,tags:[]};f=(await g.dataCatalog.publish(S,{token:g.token})).key}let b=ii.createSchema({scope:c,lifecycle:t.lifecycle,version:u,changelog:t.changelog||void 0}),v=await g.dataCatalog.publishVersion(f,b,{token:g.token});i.success(`Successfully published version '${u}' to the data catalog!`,v)}catch(g){let f=ie(g);i.error(f),process.exit(1)}}),e.command("list").description("List published data catalog items or versions of a specific catalog entry").option("--scope <scope>","Filter by scope: all, public, organization, private","all").option("--org <oid>","Organization ID (optional, defaults to configured default org)").option("--key <key>","Data catalog item key to list all versions of a specific data domain").action(async t=>{let i=new B({format:N.resolved.format}),r=N.resolved,a=t.org||r.org,s=["all","public","organization","private"];s.includes(t.scope)||(i.error({message:`Invalid scope '${t.scope}'. Allowed: ${s.join(", ")}`}),process.exit(1)),["organization","private"].includes(t.scope)&&!a&&(i.error({message:`Organization ID (--org <oid>) is required when filtering by scope '${t.scope}'.`}),process.exit(1));try{let n=ee();if(t.key){let p=((await n.dataCatalog.listVersions(t.key,{token:n.token})).data||[]).map(u=>({key:u.key,version:u.version,published:new Date(u.published).toLocaleString()}));i.list(p,["key","version","published"],{headers:["VERSION KEY","VERSION","PUBLISHED AT"]})}else{let l=[];if(t.scope==="all"){let m=await n.dataCatalog.list({scope:"public",oid:a},{token:n.token});if(l.push(...m.data||[]),a){try{let g=await n.dataCatalog.list({scope:"organization",oid:a},{token:n.token});l.push(...g.data||[])}catch{}try{let g=await n.dataCatalog.list({scope:"private",oid:a},{token:n.token});l.push(...g.data||[])}catch{}}}else{let m=await n.dataCatalog.list({scope:t.scope,oid:a},{token:n.token});l.push(...m.data||[])}let c=new Set,u=l.filter(m=>{let g=m.key;return c.has(g)?!1:(c.add(g),!0)}).map(m=>{let g=m.versions&&m.versions[0]?m.versions[0].version:"N/A";return{key:m.key,name:m.name,scope:m.scope,lastVersion:g,organization:m.organization||"N/A"}});i.list(u,["key","name","scope","lastVersion","organization"],{headers:["KEY","NAME","SCOPE","LAST VERSION","ORGANIZATION"]})}}catch(n){let l=ie(n);i.error(l),process.exit(1)}})}import Tr from"node:fs";import $n from"node:path";var ri=class o{description;key;rate;interval;burst;constructor(e={}){this.description=e.description,this.key=o.isRateLimitRuleKey(e.key)?structuredClone(e.key):void 0,this.rate=typeof e.rate=="number"?e.rate:void 0,this.interval=o.isRateLimitRuleInterval(e.interval)?e.interval:void 0,this.burst=typeof e.burst=="number"?e.burst:void 0}toJSON(){let e={};return this.description&&(e.description=this.description),o.isRateLimitRuleKey(this.key)&&(e.key=structuredClone(this.key)),typeof this.rate=="number"&&(e.rate=this.rate),o.isRateLimitRuleInterval(this.interval)&&(e.interval=this.interval),typeof this.burst=="number"&&(e.burst=this.burst),e}static isRateLimitRuleInterval(e){return typeof e!="string"?!1:["second","minute","hour","day"].includes(e)}static isRateLimitRuleKey(e){if(typeof e!="object"||e===null)return!1;let t=e;return"type"in t&&(t.type==="ip"||t.type==="userId"||t.type==="role")}};var Ze=class{rules;constructor(e={}){this.rules=e.rules?.map(t=>new ri(t))||[]}toJSON(){return{rules:this.rules.map(e=>e.toJSON())}}};var j;(function(o){o.PRE_FETCH="pre-fetch",o.FETCH="fetch",o.POST_FETCH="post-fetch"})(j||(j={}));var de=class{type;parent;mandatory;#e;get metadata(){if(!this.#e)throw new Error("Metadata not set for access rule "+this.type);return this.#e}constructor(e,t,i={}){this.parent=e,this.type=i.type??"",this.mandatory=i.mandatory??!1,this.#e=t}toJSON(){let e={type:this.type};return this.mandatory&&(e.mandatory=!0),e}};var Xi=class extends de{type;constructor(e,t={}){super(e,{list:j.PRE_FETCH,create:j.PRE_FETCH,search:j.PRE_FETCH,read:j.PRE_FETCH,update:j.PRE_FETCH,delete:j.PRE_FETCH},t),this.type="allowAuthenticated"}};var Zi=class extends de{type;constructor(e,t={}){super(e,{list:j.PRE_FETCH,create:j.PRE_FETCH,search:j.PRE_FETCH,read:j.PRE_FETCH,update:j.PRE_FETCH,delete:j.PRE_FETCH},t),this.type="allowPublic"}};var Qi=class extends de{type;domains;constructor(e,t={}){super(e,{list:j.PRE_FETCH,create:j.PRE_FETCH,search:j.PRE_FETCH,read:j.PRE_FETCH,update:j.PRE_FETCH,delete:j.PRE_FETCH},t),this.type="matchEmailDomain",this.domains=t.domains?[...t.domains]:[]}toJSON(){return{...super.toJSON(),domains:structuredClone(this.domains)}}};var er=class extends de{type;property;target;constructor(e,t={}){super(e,{list:j.FETCH,search:j.FETCH,read:j.POST_FETCH,update:j.POST_FETCH,delete:j.POST_FETCH},t),this.type="matchResourceOwner",this.property=t.property,this.target=t.target??"property"}toJSON(){let e={...super.toJSON(),target:this.target};return this.property&&(e.property=this.property),e}};var tr=class extends de{type;attribute;value;operator;constructor(e,t={}){super(e,{list:j.FETCH,search:j.FETCH,read:j.POST_FETCH,update:j.POST_FETCH,delete:j.POST_FETCH},t),this.type="matchResourceAttribute",this.attribute=t.attribute??"",this.value=t.value??"",this.operator=t.operator??"equal"}toJSON(){let e={...super.toJSON(),attribute:this.attribute,value:this.value};return this.operator&&(e.operator=this.operator),e}};var ir=class extends de{type;allowedStatuses;deniedStatuses;constructor(e,t={}){super(e,{list:j.FETCH,search:j.FETCH,read:j.POST_FETCH,update:j.POST_FETCH,delete:j.POST_FETCH},t),this.type="lifecycleStatus",this.allowedStatuses=t.allowedStatuses?[...t.allowedStatuses]:[],this.deniedStatuses=t.deniedStatuses?[...t.deniedStatuses]:[]}toJSON(){let e={...super.toJSON()};return this.allowedStatuses.length>0&&(e.allowedStatuses=structuredClone(this.allowedStatuses)),this.deniedStatuses.length>0&&(e.deniedStatuses=structuredClone(this.deniedStatuses)),e}};var rr=class extends de{type;property;value;constructor(e,t={}){super(e,{list:j.PRE_FETCH,create:j.PRE_FETCH,search:j.PRE_FETCH,read:j.PRE_FETCH,update:j.PRE_FETCH,delete:j.PRE_FETCH},t),this.type="matchUserProperty",this.property=t.property??"",this.value=t.value??""}toJSON(){return{...super.toJSON(),property:this.property,value:this.value}}};var ar=class extends de{type;role;constructor(e,t={}){super(e,{list:j.PRE_FETCH,create:j.PRE_FETCH,search:j.PRE_FETCH,read:j.PRE_FETCH,update:j.PRE_FETCH,delete:j.PRE_FETCH},t),this.type="matchUserRole",this.role=t.role?[...t.role]:[]}toJSON(){return{...super.toJSON(),role:structuredClone(this.role)}}};function Mt(o,e){switch(e.type){case"allowAuthenticated":return new Xi(o,e);case"allowPublic":return new Zi(o,e);case"matchEmailDomain":return new Qi(o,e);case"matchResourceOwner":return new er(o,e);case"matchResourceAttribute":return new tr(o,e);case"lifecycleStatus":return new ir(o,e);case"matchUserProperty":return new rr(o,e);case"matchUserRole":return new ar(o,e);default:throw new h("Unknown access rule kind",{code:"E_UNKNOWN_ACCESS_RULE_KIND",status:422})}}var ge=class{kind;accessRule;rateLimiting;parent;constructor(e,t={}){this.parent=e,this.kind=t.kind||"",this.accessRule=t.accessRule?t.accessRule.map(i=>Mt(this,i)):[],this.rateLimiting=t.rateLimiting?new Ze(t.rateLimiting):void 0}toJSON(){let e={kind:this.kind};return this.accessRule.length&&(e.accessRule=this.accessRule.map(t=>t.toJSON())),this.rateLimiting&&(e.rateLimiting=this.rateLimiting.toJSON()),e}getAllRules(){return[...this.parent.getAllRules(),...this.accessRule]}getAllRateLimiters(){let e=this.parent.getAllRateLimiters();return this.rateLimiting&&e.push(this.rateLimiting),e}};var ai=class extends ge{kind;constructor(e,t={}){super(e,t),this.kind="create"}toJSON(){return{...super.toJSON(),kind:"create"}}static isCreateAction(e){return e.kind==="create"}static isCreateActionSchema(e){return e.kind==="create"}};var wt=class extends ge{kind;strategy;retentionPeriod;constructor(e,t={}){super(e,t),this.kind="delete",this.strategy=t.strategy||"soft",this.retentionPeriod=t.retentionPeriod??30}toJSON(){return{...super.toJSON(),kind:"delete",strategy:this.strategy,retentionPeriod:this.retentionPeriod}}static isDeleteAction(e){return e.kind==="delete"}static isDeleteActionSchema(e){return e.kind==="delete"}};var ot=class extends ge{kind;cacheTtl;constructor(e,t={}){super(e,t),this.kind="list",this.cacheTtl=t.cacheTtl}toJSON(){let e={...super.toJSON(),kind:"list"};return this.cacheTtl!==void 0&&(e.cacheTtl=this.cacheTtl),e}static isListAction(e){return e.kind==="list"}static isListActionSchema(e){return e.kind==="list"}};var si=class extends ge{kind;constructor(e,t={}){super(e,t),this.kind="read"}toJSON(){return{...super.toJSON(),kind:"read"}}static isReadAction(e){return e.kind==="read"}static isReadActionSchema(e){return e.kind==="read"}};var lt=class extends ge{kind;maxAstDepth;constructor(e,t={}){super(e,t),this.kind="search",this.maxAstDepth=t.maxAstDepth}toJSON(){let e={...super.toJSON(),kind:"search"};return this.maxAstDepth!==void 0&&(e.maxAstDepth=this.maxAstDepth),e}static isSearchActionSchema(e){return e.kind==="search"}static isSearchAction(e){return e.kind==="search"}};var vt=class extends ge{kind;allowedMethods;constructor(e,t={}){super(e,t),this.kind="update",this.allowedMethods=t.allowedMethods?[...t.allowedMethods]:["PATCH"]}toJSON(){return{...super.toJSON(),kind:"update",allowedMethods:structuredClone(this.allowedMethods)}}static isUpdateAction(e){return e.kind==="update"}static isUpdateActionSchema(e){return e.kind==="update"}};function Yr(o,e){switch(e.kind){case"list":return new ot(o,e);case"read":return new si(o,e);case"create":return new ai(o,e);case"update":return new vt(o,e);case"delete":return new wt(o,e);case"search":return new lt(o,e);default:throw new h("Unknown action kind",{code:"E_UNKNOWN_ACTION_KIND",status:422})}}function ss(o,e){switch(e){case"list":return new ot(o);case"read":return new si(o);case"create":return new ai(o);case"update":return new vt(o);case"delete":return new wt(o);case"search":return new lt(o);default:throw new h("Unknown action kind",{code:"E_UNKNOWN_ACTION_KIND",status:422})}}var w;(function(o){o.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",o.STRING="STRING",o.NUMBER="NUMBER",o.INTEGER="INTEGER",o.BOOLEAN="BOOLEAN",o.ARRAY="ARRAY",o.OBJECT="OBJECT",o.NULL="NULL"})(w||(w={}));var ns={[y.Address]:{type:"object",properties:{}},[y.Calculated]:{type:"object",description:"Use Calculated when you need mathematical operations, aggregations, or complex business logic.",properties:{formula:{type:"string",description:'Formula to calculate the value (e.g., "price * quantity").'},dependencies:{type:"array",items:{type:"string"},description:"List of field keys this calculation depends on."},recalculateOnUpdate:{type:"boolean",default:!0,description:"Whether to automatically recalculate when source fields change."},allowManualOverride:{type:"boolean",default:!1,description:"Whether users can manually override the calculated value."}}},[y.Categories]:{type:"object",description:"Controls allowed categories, hierarchy, and formatting for associations.",properties:{allowedCategories:{type:"array",items:{type:"string"},description:"Pre-defined list of allowed categories."},allowCustomCategories:{type:"boolean",default:!0,description:"Whether users can create new categories not in the allowed list."},allowHierarchy:{type:"boolean",default:!0,description:"Whether categories can have sub-categories (parent-child relationship)."},maxDepth:{type:"number",description:"Maximum nesting depth for category hierarchies."},caseSensitive:{type:"boolean",default:!1},allowUnicode:{type:"boolean",default:!1}}},[y.City]:{type:"object",properties:{}},[y.ClientIPAddress]:{type:"object",properties:{}},[y.Country]:{type:"object",properties:{format:{type:"string",enum:["ISO_3166_Alpha_2","ISO_3166_Alpha_3","Name"],default:"ISO_3166_Alpha_2",description:"Format to store the country in. Alpha_2 is standard 2-letter code (e.g. US), Alpha_3 is 3-letter (e.g. USA), Name is full name."},allowedCountries:{type:"array",items:{type:"string"},description:"List of allowed countries in the specified format. If empty, all are allowed."},disallowedCountries:{type:"array",items:{type:"string"},description:"List of explicitly forbidden countries."}}},[y.CreatedTimestamp]:{type:"object",properties:{}},[y.Currency]:{type:"object",description:"Controls monetary value storage, validation, currency handling, and precision.",properties:{storageFormat:{type:"string",enum:["decimal","integer_cents","complex_object"],default:"decimal",description:"Format to store currency. decimal relies on decimal floating points, integer_cents stores values as an integer of cents, and complex_object stores both amount and currency code."},defaultCurrency:{type:"string",default:"USD",description:"Default ISO 4217 currency code if none is provided."},allowedCurrencies:{type:"array",items:{type:"string"},description:"List of allowed ISO 4217 currency codes. If empty, all are allowed."},decimalPlaces:{type:"number",default:2,description:"Number of decimal places to enforce/round to."},allowNegative:{type:"boolean",default:!1,description:"Whether to allow negative currency values."},validateCurrencyCode:{type:"boolean",default:!0,description:"Whether to validate the currency code against standard ISO codes."}}},[y.DeletedFlag]:{type:"object",properties:{}},[y.DeletedTimestamp]:{type:"object",properties:{}},[y.Derived]:{type:"object",description:"Use Derived when you need to combine, format, or transform existing field values",properties:{sourceFields:{type:"array",items:{type:"string"},description:"Array of field keys that this derived field depends on."},transformation:{type:"string",description:"Name of a transformation function to apply to the source fields."},recalculateOnUpdate:{type:"boolean",default:!0,description:"Whether to automatically recalculate when source fields change."},allowManualOverride:{type:"boolean",default:!1,description:"Whether users can manually override the derived value."}}},[y.Description]:{type:"object",description:"The description field doesn't have any configuration options.",properties:{}},[y.Email]:{type:"object",properties:{allowedDomains:{type:"array",items:{type:"string"},description:"List of allowed domains (e.g. example.com). If empty, all valid domains are permitted."},disallowedDomains:{type:"array",items:{type:"string"},description:"List of disallowed domains (e.g. example.com)."},requireVerification:{type:"boolean",default:!0,description:"Whether the email address requires a verification confirm loop."},allowSubaddressing:{type:"boolean",default:!0,description:"Whether to allow plus addressing e.g. user+tag@example.com"},allowInternational:{type:"boolean",default:!0,description:"Whether to allow internationalized domain names and characters in the local part."}}},[y.FileURL]:{type:"object",properties:{}},[y.GeospatialCoordinates]:{type:"object",properties:{format:{type:"string",enum:["lat,lon","lon,lat","postgis","degree","wkt","geojson"],default:"lat,lon"},spatialReferenceSystem:{type:"string",enum:["EPSG:4326","EPSG:3857","EPSG:4269","EPSG:4267"],default:"EPSG:4326",description:"The spatial reference system (SRS) for the coordinates. Defaults to WGS84 (EPSG:4326)."},defaultDistanceUnit:{type:"string",enum:["meters","kilometers","miles","feet","yards","nautical_miles"],default:"meters",description:"The default distance unit for spatial queries."},enableSpatialIndexing:{type:"boolean",default:!0},enableValidation:{type:"boolean",default:!0},validationBounds:{type:"object",properties:{minLatitude:{type:"number"},maxLatitude:{type:"number"},minLongitude:{type:"number"},maxLongitude:{type:"number"}},description:"Custom validation rules for coordinate bounds in decimal degrees."},enablePostGISIntegration:{type:"boolean",default:!0},postGISGeometryType:{type:"string",enum:["POINT","LINESTRING","POLYGON","MULTIPOINT","MULTILINESTRING","MULTIPOLYGON"],default:"POINT",description:"The PostGIS geometry type to use for storage. Defines the shape of the data and the types of queries."},enableDistanceQueries:{type:"boolean",default:!0},maxQueryDistance:{type:"number",default:1e5},enableBoundingBoxQueries:{type:"boolean",default:!0},enablePolygonQueries:{type:"boolean",default:!1},enableGeoClustering:{type:"boolean",default:!1},maxClusterPrecision:{type:"number"},apiEndpointPrefix:{type:"string",default:"/nearby"},includeElevation:{type:"boolean",default:!1},coordinatePrecision:{type:"number",default:6},enableReverseGeocoding:{type:"boolean",default:!1}}},[y.HTML]:{type:"object",properties:{allowedTags:{type:"array",items:{type:"string"},description:"List of allowed HTML tags. Tags not in this list will be stripped."},sanitizeLevel:{type:"string",enum:["strict","moderate","none"],default:"strict",description:"Sanitization level. Strict removes almost all styling and scripts. Moderate allows some unsafe constructs like scripts. None bypasses sanitization."},allowImages:{type:"boolean",default:!0},allowLinks:{type:"boolean",default:!0},allowTables:{type:"boolean",default:!0},allowForms:{type:"boolean",default:!1},allowScripts:{type:"boolean",default:!1},allowIframes:{type:"boolean",default:!1},allowEmbedded:{type:"boolean",default:!1},allowStyles:{type:"boolean",default:!1},allowDataAttributes:{type:"boolean",default:!1}}},[y.ImageURL]:{type:"object",properties:{}},[y.Markdown]:{type:"object",properties:{allowedTags:{type:"array",items:{type:"string"},description:"Allowed HTML tags within the Markdown."},sanitizeLevel:{type:"string",enum:["strict","moderate","none"],default:"strict",description:"Sanitization level for HTML within Markdown. Strict removes all. Moderate allows basic formatting tags. None bypasses sanitization."},allowImages:{type:"boolean",default:!0},allowLinks:{type:"boolean",default:!0},allowTables:{type:"boolean",default:!0},allowHtml:{type:"boolean",default:!1},allowFootnotes:{type:"boolean",default:!1},allowTaskLists:{type:"boolean",default:!1},allowStrikethrough:{type:"boolean",default:!0},allowMath:{type:"boolean",default:!1}}},[y.Name]:{type:"object",properties:{}},[y.Password]:{type:"object",properties:{requireSpecialChars:{type:"boolean",default:!1},requireNumbers:{type:"boolean",default:!1},requireUppercase:{type:"boolean",default:!1},requireLowercase:{type:"boolean",default:!1},encryptionAlgorithm:{type:"string",enum:["bcrypt","argon2","scrypt"],default:"bcrypt",description:"The algorithm used to hash the password before storage."},saltRounds:{type:"number",default:12,description:"Work factor for hashing algorithms like bcrypt or argon2."},maxAge:{type:"number",description:"Maximum age in days before the password expires."},preventReuse:{type:"boolean",default:!1,description:"Whether to prevent reuse of previous passwords."},preventReuseCount:{type:"number",default:5,description:"Number of previous passwords to remember and prevent reuse of."},customPattern:{type:"string",description:"Custom regex pattern for password validation."},customErrorMessage:{type:"string"},allowCommonPasswords:{type:"boolean",default:!1,description:"Whether to check against dictionaries of common/compromised passwords."}}},[y.Phone]:{type:"object",properties:{allowedCountries:{type:"array",items:{type:"string"},description:"List of allowed country codes (ISO 3166-1 alpha-2 format)."},requireCountryCode:{type:"boolean",default:!0,description:"Whether the phone number must include a country code."},format:{type:"string",enum:["national","international","custom"],default:"international",description:"Format for phone validation and display. national omits country code, international uses E.164 (+1...), custom uses customFormat pattern."},customFormat:{type:"string",description:'Custom pattern like "(###) ###-####"; only used when format is custom.'},allowExtension:{type:"boolean",default:!1},requireVerification:{type:"boolean",default:!1},verificationMethod:{type:"string",enum:["sms","call"],default:"sms"}}},[y.PostalCode]:{type:"object",properties:{validate:{type:"boolean",default:!1,description:"Whether to validate the postal code format."},allowedPostalCodes:{type:"array",items:{type:"string"},description:"List of exactly allowed postal codes."},disallowedPostalCodes:{type:"array",items:{type:"string"},description:"List of explicitly forbidden postal codes."}}},[y.PublicUniqueName]:{type:"object",properties:{sourceField:{type:"string",description:"The field to derive the public unique name from."},separator:{type:"string",default:"-",description:'Character used to replace spaces or combine multiple words (e.g. "-" for slugs).'},caseSensitive:{type:"boolean",default:!1},allowUnicode:{type:"boolean",default:!1,description:"Whether to allow non-ASCII characters."},allowDuplicates:{type:"boolean",default:!1,description:"Whether to append random suffix if the name is already taken. Defaults to failing uniqueness."},fallbackField:{type:"string",description:"A field to use if the source field is empty."}}},[y.Region]:{type:"object",properties:{}},[y.ResourceOwnerIdentifier]:{type:"object",properties:{}},[y.SKU]:{type:"object",properties:{validationMode:{type:"string",enum:["strict","lenient","custom"],default:"strict",description:"Validation strictness. strict enforces alphanumeric + hyphens/underscores. lenient allows more special chars. custom uses customPattern."},customPattern:{type:"string",description:"Regex pattern applied when validationMode is custom."},caseMode:{type:"string",enum:["uppercase","lowercase","preserve"],default:"uppercase"},prefix:{type:"string",description:"Required prefix for all SKUs."},enforceUniqueness:{type:"boolean",default:!0},autoGenerate:{type:"boolean",default:!1,description:"Whether to automatically generate the SKU."},autoGenerateSource:{type:"string",description:"Field to derive the SKU from, if autoGenerate is true."},validateReservedWords:{type:"boolean",default:!0},reservedValues:{type:"array",items:{type:"string"},description:"Specific SKUs that are not permitted to be used."}}},[y.Status]:{type:"object",properties:{allowedStates:{type:"array",items:{type:"string"},description:"Pre-defined list of valid states (e.g., draft, published, archived)."},defaultState:{type:"string",description:"The initial state assigned when an entity is created."},transitions:{type:"object",additionalProperties:{type:"array",items:{type:"string"}},description:"Map representing allowed state transitions. Key is current state and value is array of valid next states."},stateBehaviors:{type:"object",additionalProperties:{type:"object",properties:{isPublic:{type:"boolean",default:!0},isEditable:{type:"boolean",default:!0},isDeletable:{type:"boolean",default:!1},requiresApproval:{type:"boolean",default:!1},displayName:{type:"string"},description:{type:"string"},color:{type:"string"},icon:{type:"string"}}}},workflow:{type:"object",properties:{requiresApproval:{type:"boolean",default:!1},approvalRoles:{type:"array",items:{type:"string"}},sendNotifications:{type:"boolean",default:!1},notificationChannels:{type:"array",items:{type:"string",enum:["email","sms","push","webhook"]}},logHistory:{type:"boolean",default:!0},allowBulkChanges:{type:"boolean",default:!1}}},autoTransitions:{type:"array",items:{type:"object",properties:{from:{type:"string"},to:{type:"string"},condition:{type:"string"},requiresApproval:{type:"boolean",default:!1}},required:["from","to","condition"]}}}},[y.StreetAddress]:{type:"object",properties:{}},[y.StreetAddressSupplemental]:{type:"object",properties:{}},[y.Summary]:{type:"object",properties:{}},[y.Tags]:{type:"object",properties:{allowedTags:{type:"array",items:{type:"string"}},allowCustomTags:{type:"boolean",default:!0},caseSensitive:{type:"boolean",default:!1},allowUnicode:{type:"boolean",default:!1}}},[y.Title]:{type:"object",properties:{}},[y.UpdatedTimestamp]:{type:"object",properties:{}},[y.URL]:{type:"object",properties:{requireHttps:{type:"boolean",default:!1},allowQueryParams:{type:"boolean",default:!0},allowFragments:{type:"boolean",default:!0},allowInternational:{type:"boolean",default:!0},allowIP:{type:"boolean",default:!0},allowPort:{type:"boolean",default:!0},allowAuthentication:{type:"boolean",default:!1}}},[y.User]:{type:"object",properties:{}},[y.Username]:{type:"object",properties:{}},[y.UserRole]:{type:"object",properties:{}},[y.Version]:{type:"object",properties:{}}};var fo=[{functionDeclarations:[{name:"list_semantics",description:"List all available data semantics, their scopes, and whether they have configuration options.",parametersJsonSchema:{type:w.OBJECT,properties:{},required:[]}},{name:"get_semantic_details",description:"Get detailed information about a specific data semantic, notably its JSON configuration schema properties, to determine what additional config you might want to provide.",parametersJsonSchema:{type:w.OBJECT,properties:{semanticId:{type:w.STRING,description:"The exact ID of the semantic (e.g. Semantic#Password, Semantic#Tags)"}},required:["semanticId"]}},{name:"get_entity_details",description:"Get the full details of an entity given its key, including properties, associations, and tags.",parametersJsonSchema:{type:w.OBJECT,properties:{entityKey:{type:w.STRING,description:"The exact key/ID of the entity to fetch details for."}},required:["entityKey"]}},{name:"explain_schema",description:"Explains the schema of a data type.",parametersJsonSchema:{type:w.OBJECT,properties:{dataType:{type:w.STRING,description:"The data type (e.g. string, number, boolean, date, datetime, time, binary)"}},required:["dataType"]}}]}];var Qe={type:w.OBJECT,properties:{id:{type:w.STRING},config:{type:w.OBJECT}},required:["id"]},ls={type:w.OBJECT,properties:{key:{type:w.STRING,description:"The key of the target entity."},domain:{type:w.STRING,description:"The key of the target data domain. Only set when the target is in a different data domain."}},required:["key"]},go={type:w.OBJECT,properties:{type:{type:w.STRING,description:"Enum: literal, function"},value:{type:w.STRING,description:"The default value of the property"}},required:["type"]},cs={type:w.OBJECT,properties:{minimum:{type:w.NUMBER,nullable:!0},maximum:{type:w.NUMBER,nullable:!0},exclusiveMinimum:{type:w.BOOLEAN,nullable:!0},exclusiveMaximum:{type:w.BOOLEAN,nullable:!0},multipleOf:{type:w.NUMBER,nullable:!0},enum:{type:w.ARRAY,items:{type:w.STRING},nullable:!0},examples:{type:w.ARRAY,items:{type:w.STRING},nullable:!0},defaultValue:{...go,nullable:!0},pattern:{type:w.STRING,nullable:!0}}},ds={type:w.OBJECT,properties:{required:{type:w.BOOLEAN,nullable:!0},unique:{type:w.BOOLEAN,nullable:!0},index:{type:w.BOOLEAN,nullable:!0},primary:{type:w.BOOLEAN,nullable:!0},multiple:{type:w.BOOLEAN,nullable:!0},readOnly:{type:w.BOOLEAN,nullable:!0},writeOnly:{type:w.BOOLEAN,nullable:!0}}},ps={type:w.OBJECT,properties:{key:{type:w.STRING},name:{type:w.STRING},displayName:{type:w.STRING},description:{type:w.STRING},type:{type:w.STRING,description:"Enum: string, number, boolean, date, datetime, time, binary"},constraints:ds,deprecated:{type:w.BOOLEAN},schema:cs,semantics:{type:w.ARRAY,items:Qe,description:"List of semantics applied to this property. Note: ONLY use semantics with scope='property'."},tags:{type:w.ARRAY,items:{type:w.STRING},nullable:!0}},required:["key","name","type","displayName","description"]},yo={type:w.OBJECT,properties:{embedded:{type:w.BOOLEAN,description:"Whether the association should be embedded in the target entity"},unionType:{type:w.STRING,description:"Enum: allOf, anyOf, oneOf, not"}}},us={type:w.OBJECT,properties:{key:{type:w.STRING},name:{type:w.STRING},displayName:{type:w.STRING},description:{type:w.STRING},targets:{type:w.ARRAY,items:ls},required:{type:w.BOOLEAN},multiple:{type:w.BOOLEAN,description:"Whether the association can have multiple targets (like User has multiple addresses)"},onDelete:{type:w.STRING,description:"Enum: restrict, cascade, setNull, doNothing"},semantics:{type:w.ARRAY,items:Qe,description:"List of semantics applied to this association. Note: ONLY use semantics with scope='association'."},schema:yo},required:["key","name","targets","displayName","description"]},os={type:w.OBJECT,properties:{key:{type:w.STRING},name:{type:w.STRING},description:{type:w.STRING}},required:["key","name"]},bo={type:w.OBJECT,properties:{key:{type:w.STRING},modelKey:{type:w.STRING,description:'The Domain Model this entity belongs to (e.g. "users", "shipping")'},name:{type:w.STRING},displayName:{type:w.STRING},description:{type:w.STRING},tags:{type:w.ARRAY,items:{type:w.STRING}},semantics:{type:w.ARRAY,items:Qe,description:"List of semantics applied to this entity. Note: ONLY use semantics with scope='entity'."},properties:{type:w.ARRAY,items:ps},associations:{type:w.ARRAY,items:us}},required:["key","name","modelKey","displayName","description"]},wo={type:w.OBJECT,properties:{key:{type:w.STRING},name:{type:w.STRING},displayName:{type:w.STRING},description:{type:w.STRING},type:{type:w.STRING,description:"Enum: string, number, boolean, date, datetime, time, binary"},constraints:{...ds,nullable:!0},deprecated:{type:w.BOOLEAN,nullable:!0},schema:{...cs,nullable:!0},addedSemantics:{type:w.ARRAY,items:Qe,description:"Semantics to add. Note: ONLY use semantics with scope='property'."},modifiedSemantics:{type:w.ARRAY,items:Qe},deletedSemanticIds:{type:w.ARRAY,items:{type:w.STRING}}},required:["key"]},vo={type:w.OBJECT,properties:{key:{type:w.STRING},name:{type:w.STRING},displayName:{type:w.STRING},description:{type:w.STRING},targets:{type:w.ARRAY,items:ls},required:{type:w.BOOLEAN,nullable:!0},multiple:{type:w.BOOLEAN,nullable:!0,description:"Whether the association can have multiple targets (like User has multiple addresses)"},onDelete:{type:w.STRING,nullable:!0,description:"Enum: restrict, cascade, setNull, doNothing"},addedSemantics:{type:w.ARRAY,items:Qe,description:"Semantics to add. Note: ONLY use semantics with scope='association'."},modifiedSemantics:{type:w.ARRAY,items:Qe},deletedSemanticIds:{type:w.ARRAY,items:{type:w.STRING}}},required:["key"]},ko={type:w.OBJECT,properties:{sessionTitle:{type:w.STRING,description:"A short, 3-to-5 word descriptive title for this data modeling session."},reasoning:{type:w.STRING,description:"Conversational response analyzing the request or explaining changes, in markdown format"},delta:{type:w.OBJECT,properties:{addedModels:{type:w.ARRAY,items:os,description:"Brand new models to create"},deletedModelKeys:{type:w.ARRAY,items:{type:w.STRING},description:"Keys of completely removed models. This also removes all entities and associations in the model."},modifiedModels:{type:w.ARRAY,items:os,description:"Models to modify in the domain"},addedEntities:{type:w.ARRAY,items:bo,description:"Brand new entities to create"},deletedEntityKeys:{type:w.ARRAY,items:{type:w.STRING},description:"Keys of completely removed entities"},modifiedEntities:{type:w.ARRAY,items:{type:w.OBJECT,properties:{key:{type:w.STRING,description:"The original key of the existing entity being modified"},modelKey:{type:w.STRING,description:"Change this to migrate the entity to a different model (boundary)"},name:{type:w.STRING},displayName:{type:w.STRING},description:{type:w.STRING},tags:{type:w.ARRAY,items:{type:w.STRING},nullable:!0},addedSemantics:{type:w.ARRAY,items:Qe,description:"Semantics to add. Note: ONLY use semantics with scope='entity'."},modifiedSemantics:{type:w.ARRAY,items:Qe},deletedSemanticIds:{type:w.ARRAY,items:{type:w.STRING}},addedProperties:{type:w.ARRAY,items:ps},modifiedProperties:{type:w.ARRAY,items:wo},deletedPropertyKeys:{type:w.ARRAY,items:{type:w.STRING}},addedAssociations:{type:w.ARRAY,items:us},modifiedAssociations:{type:w.ARRAY,items:vo},deletedAssociationKeys:{type:w.ARRAY,items:{type:w.STRING}}},required:["key"]},description:"Modifications to existing entities like adding, removing, or changing properties/associations"}},required:["addedModels","deletedModelKeys","modifiedModels","addedEntities","deletedEntityKeys","modifiedEntities"]}},required:["reasoning","delta"]};var So="http://a.ml/",et=`${So}vocabularies/`,M=`${et}document#`,Q=`${et}core#`,q=`${et}security#`,x=`${et}apiContract#`,ni=`${et}apiBinding#`,T=`${et}shapes#`,re=`${et}data#`,Re=`${et}document-source-maps#`,oi="http://www.w3.org/",Y=`${oi}ns/shacl#`,we=`${oi}2001/XMLSchema#`,sr=`${oi}1999/02/22-rdf-syntax-ns#`,Xr=`${oi}2000/01/rdf-schema#`,d={aml:{key:"http://a.ml/",vocabularies:{key:et,document:{key:M,Module:`${M}Module`,Document:`${M}Document`,Fragment:`${M}Fragment`,Unit:`${M}Unit`,SecuritySchemeFragment:`${M}SecuritySchemeFragment`,UserDocumentation:`${M}UserDocumentation`,DataType:`${M}DataType`,NamedExamples:`${M}NamedExamples`,DomainElement:`${M}DomainElement`,DomainProperty:`${M}DomainProperty`,ParametrizedDeclaration:`${M}ParametrizedDeclaration`,AbstractDeclaration:`${M}AbstractDeclaration`,VariableValue:`${M}VariableValue`,ExternalFragment:`${M}ExternalFragment`,ExternalDomainElement:`${M}ExternalDomainElement`,RootDomainElement:`${M}RootDomainElement`,APIContractProcessingData:`${M}APIContractProcessingData`,BaseUnitProcessingData:`${M}BaseUnitProcessingData`,customDomainProperties:`${M}customDomainProperties`,encodes:`${M}encodes`,declares:`${M}declares`,references:`${M}references`,examples:`${M}examples`,linkTarget:`${M}link-target`,linkLabel:`${M}link-label`,referenceId:`${M}reference-id`,structuredValue:`${M}structuredValue`,raw:`${M}raw`,extends:`${M}extends`,value:`${M}value`,name:`${M}name`,strict:`${M}strict`,deprecated:`${M}deprecated`,location:`${M}location`,variable:`${M}variable`,target:`${M}target`,dataNode:`${M}dataNode`,root:`${M}root`,usage:`${M}usage`,version:`${M}version`},core:{key:Q,CreativeWork:`${Q}CreativeWork`,Parameter:`${Q}Parameter`,Organization:`${Q}Organization`,License:`${Q}License`,Operation:`${Q}Operation`,Response:`${Q}Response`,Payload:`${Q}Payload`,Request:`${Q}Request`,version:`${Q}version`,urlTemplate:`${Q}urlTemplate`,displayName:`${Q}displayName`,title:`${Q}title`,name:`${Q}name`,description:`${Q}description`,documentation:`${Q}documentation`,summary:`${Q}summary`,provider:`${Q}provider`,email:`${Q}email`,url:`${Q}url`,termsOfService:`${Q}termsOfService`,license:`${Q}license`,mediaType:`${Q}mediaType`,extensionName:`${Q}extensionName`,deprecated:`${Q}deprecated`},security:{key:q,ParametrizedSecurityScheme:`${q}ParametrizedSecurityScheme`,SecuritySchemeFragment:`${q}SecuritySchemeFragment`,SecurityScheme:`${q}SecurityScheme`,OAuth1Settings:`${q}OAuth1Settings`,OAuth2Settings:`${q}OAuth2Settings`,OAuth2Flow:`${q}OAuth2Flow`,Scope:`${q}Scope`,Settings:`${q}Settings`,HttpSettings:`${q}HttpSettings`,ApiKeySettings:`${q}ApiKeySettings`,OpenIdConnectSettings:`${q}OpenIdConnectSettings`,SecurityRequirement:`${q}SecurityRequirement`,security:`${q}security`,scheme:`${q}scheme`,schemes:`${q}schemes`,settings:`${q}settings`,name:`${q}name`,type:`${q}type`,scope:`${q}scope`,accessTokenUri:`${q}accessTokenUri`,authorizationUri:`${q}authorizationUri`,authorizationGrant:`${q}authorizationGrant`,flows:`${q}flows`,flow:`${q}flow`,signature:`${q}signature`,tokenCredentialsUri:`${q}tokenCredentialsUri`,requestTokenUri:`${q}requestTokenUri`,refreshUri:`${q}refreshUri`,securityRequirement:`${q}SecurityRequirement`,openIdConnectUrl:`${q}openIdConnectUrl`,bearerFormat:`${q}bearerFormat`,in:`${q}in`},apiContract:{key:x,Payload:`${x}Payload`,Request:`${x}Request`,Response:`${x}Response`,EndPoint:`${x}EndPoint`,Parameter:`${x}Parameter`,Operation:`${x}Operation`,WebAPI:`${x}WebAPI`,API:`${x}API`,AsyncAPI:`${x}AsyncAPI`,UserDocumentationFragment:`${x}UserDocumentationFragment`,Example:`${x}Example`,Server:`${x}Server`,ResourceType:`${x}ResourceType`,Trait:`${x}Trait`,TraitFragment:`${x}TraitFragment`,ParametrizedResourceType:`${x}ParametrizedResourceType`,ParametrizedTrait:`${x}ParametrizedTrait`,Callback:`${x}Callback`,TemplatedLink:`${x}TemplatedLink`,IriTemplateMapping:`${x}IriTemplateMapping`,Tag:`${x}Tag`,Message:`${x}Message`,DomainExtension:`${x}DomainExtension`,Encoding:`${x}Encoding`,header:`${x}header`,parameter:`${x}parameter`,paramName:`${x}paramName`,uriParameter:`${x}uriParameter`,cookieParameter:`${x}cookieParameter`,variable:`${x}variable`,payload:`${x}payload`,server:`${x}server`,path:`${x}path`,url:`${x}url`,scheme:`${x}scheme`,endpoint:`${x}endpoint`,queryString:`${x}queryString`,accepts:`${x}accepts`,guiSummary:`${x}guiSummary`,binding:`${x}binding`,response:`${x}response`,returns:`${x}returns`,expects:`${x}expects`,examples:`${x}examples`,supportedOperation:`${x}supportedOperation`,messageId:`${x}messageId`,statusCode:`${x}statusCode`,method:`${x}method`,required:`${x}required`,callback:`${x}callback`,expression:`${x}expression`,link:`${x}link`,linkExpression:`${x}linkExpression`,templateVariable:`${x}templateVariable`,mapping:`${x}mapping`,operationId:`${x}operationId`,protocol:`${x}protocol`,protocolVersion:`${x}protocolVersion`,headerSchema:`${x}headerSchema`,contentType:`${x}contentType`,allowEmptyValue:`${x}allowEmptyValue`,style:`${x}style`,explode:`${x}explode`,allowReserved:`${x}allowReserved`,tag:`${x}tag`,tags:`${x}tags`},apiBinding:{key:ni,binding:`${ni}binding`,bindings:`${ni}bindings`,messageKey:`${ni}messageKey`,type:`${ni}type`},shapes:{key:T,Shape:`${T}Shape`,ScalarShape:`${T}ScalarShape`,ArrayShape:`${T}ArrayShape`,UnionShape:`${T}UnionShape`,NilShape:`${T}NilShape`,FileShape:`${T}FileShape`,AnyShape:`${T}AnyShape`,SchemaShape:`${T}SchemaShape`,MatrixShape:`${T}MatrixShape`,TupleShape:`${T}TupleShape`,RecursiveShape:`${T}RecursiveShape`,DataTypeFragment:`${T}DataTypeFragment`,XMLSerializer:`${T}XMLSerializer`,number:`${T}number`,integer:`${T}integer`,long:`${T}long`,double:`${T}double`,boolean:`${T}boolean`,float:`${T}float`,nil:`${T}nil`,password:`${T}password`,int32:`${T}int32`,int64:`${T}int64`,uint32:`${T}uint32`,uint64:`${T}uint64`,sint32:`${T}sint32`,sint64:`${T}sint64`,fixed32:`${T}fixed32`,fixed64:`${T}fixed64`,sfixed32:`${T}sfixed32`,sfixed64:`${T}sfixed64`,dateTimeOnly:`${T}dateTimeOnly`,range:`${T}range`,items:`${T}items`,anyOf:`${T}anyOf`,fileType:`${T}fileType`,schema:`${T}schema`,xmlSerialization:`${T}xmlSerialization`,xmlName:`${T}xmlName`,xmlAttribute:`${T}xmlAttribute`,xmlWrapped:`${T}xmlWrapped`,xmlNamespace:`${T}xmlNamespace`,xmlPrefix:`${T}xmlPrefix`,readOnly:`${T}readOnly`,writeOnly:`${T}writeOnly`,deprecated:`${T}deprecated`,fixPoint:`${T}fixPoint`,discriminator:`${T}discriminator`,discriminatorValue:`${T}discriminatorValue`,format:`${T}format`,multipleOf:`${T}multipleOf`,uniqueItems:`${T}uniqueItems`},data:{key:re,Scalar:`${re}Scalar`,Object:`${re}Object`,Array:`${re}Array`,Node:`${re}Node`,value:`${re}value`,type:`${re}type`,description:`${re}description`,required:`${re}required`,displayName:`${re}displayName`,minLength:`${re}minLength`,maxLength:`${re}maxLength`,default:`${re}default`,multipleOf:`${re}multipleOf`,minimum:`${re}minimum`,maximum:`${re}maximum`,enum:`${re}enum`,pattern:`${re}pattern`,items:`${re}items`,format:`${re}format`,example:`${re}example`,examples:`${re}examples`},docSourceMaps:{key:Re,SourceMap:`${Re}SourceMap`,sources:`${Re}sources`,element:`${Re}element`,value:`${Re}value`,declaredElement:`${Re}declared-element`,trackedElement:`${Re}tracked-element`,parsedJsonSchema:`${Re}parsed-json-schema`,autoGeneratedName:`${Re}auto-generated-name`,lexical:`${Re}lexical`,synthesizedField:`${Re}synthesized-field`}}},w3:{key:oi,shacl:{key:Y,Shape:`${Y}Shape`,NodeShape:`${Y}NodeShape`,SchemaShape:`${Y}SchemaShape`,PropertyShape:`${Y}PropertyShape`,in:`${Y}in`,defaultValue:`${Y}defaultValue`,defaultValueStr:`${Y}defaultValueStr`,pattern:`${Y}pattern`,minInclusive:`${Y}minInclusive`,maxInclusive:`${Y}maxInclusive`,multipleOf:`${Y}multipleOf`,minLength:`${Y}minLength`,maxLength:`${Y}maxLength`,fileType:`${Y}fileType`,and:`${Y}and`,property:`${Y}property`,name:`${Y}name`,raw:`${Y}raw`,datatype:`${Y}datatype`,minCount:`${Y}minCount`,maxCount:`${Y}maxCount`,xone:`${Y}xone`,not:`${Y}not`,or:`${Y}or`,closed:`${Y}closed`,path:`${Y}path`,additionalPropertiesSchema:`${Y}additionalPropertiesSchema`},xmlSchema:{key:we,boolean:`${we}boolean`,string:`${we}string`,number:`${we}number`,integer:`${we}integer`,long:`${we}long`,double:`${we}double`,float:`${we}float`,nil:`${we}nil`,dateTime:`${we}dateTime`,time:`${we}time`,date:`${we}date`,base64Binary:`${we}base64Binary`,byte:`${we}byte`},rdfSyntax:{key:sr,Seq:`${sr}Seq`,Property:`${sr}Property`,member:`${sr}member`},rdfSchema:{key:Xr,Seq:`${Xr}Seq`,member:`${Xr}member`}}};function zt(o,e=0){if(typeof o!="object")return o;let t="",i=new Array(e).fill(" ").join("");return Object.keys(o).forEach(r=>{t+=Array.isArray(o[r])?"":`${i}<${r}>`,Array.isArray(o[r])?o[r].forEach(a=>{t+=i,t+=`<${r}>
|
|
134
134
|
`,t+=zt({...a},e+1),t+=i,t+=`</${r}>
|
|
135
135
|
`}):typeof o[r]=="object"?(t+=`
|
|
136
136
|
`,t+=zt({...o[r]},e+1),t+=i):t+=`${o[r]}`,t+=Array.isArray(o[r])?"":`</${r}>
|
|
137
137
|
`}),t=t.replace(/<\/?[0-9]{1,}>/g,""),t}function nr(o,e){return String(e).split(`
|
|
138
138
|
`).filter(a=>!!a).map(a=>`${o}${a}`).join(`
|
|
139
|
-
`)}function Zr(o,e){if(typeof o=="number")return o;let t=Number(o);return Number.isNaN(t)?e:t}function Qr(o,e){let t=typeof o;if(t==="boolean")return o;if(t==="string"){let i=o.trim();if(i==="true")return!0;if(i==="false")return!1}return e}function or(o,e){if(o==null)return o;switch(e){case d.aml.vocabularies.shapes.number:case d.aml.vocabularies.shapes.integer:case d.aml.vocabularies.shapes.float:case d.aml.vocabularies.shapes.long:case d.aml.vocabularies.shapes.double:case d.w3.xmlSchema.number:case d.w3.xmlSchema.integer:case d.w3.xmlSchema.float:case d.w3.xmlSchema.long:case d.w3.xmlSchema.double:return Zr(o,0);case d.aml.vocabularies.shapes.boolean:case d.w3.xmlSchema.boolean:return Qr(o,!1);case d.aml.vocabularies.shapes.nil:case d.w3.xmlSchema.nil:return null;default:return o}}function ea(o,e=[]){let t;return Array.isArray(e)&&e.length&&(t=o.find(i=>e.includes(i.id))),t||([t]=o),t}function lr(o,e){let t=[],{properties:i,inherits:r}=o;i.length&&(t=[...i]),Array.isArray(r)&&r.length&&r.forEach(s=>{let n=s;if(n.types.includes(d.aml.vocabularies.shapes.UnionShape)){let p=n,{anyOf:u=[]}=p;n=ea(u,e)}if(!n.types.includes(d.w3.shacl.NodeShape))return;let c=lr(n);c.length&&(t=t.concat(c))});let a=[];return t.forEach(s=>{a.find(l=>l.name===s.name)||a.push(s)}),a}var
|
|
140
|
-
`):`${zt({[t]:r})}`:`${zt(r,a)}`}};var we={};Fa(we,{anyShape:()=>ct,arrayShape:()=>kl,fileShape:()=>vl,nodeShape:()=>yl,propertyShape:()=>_l,recursiveShape:()=>Al,scalarShape:()=>bl,shape:()=>ha,tupleShape:()=>Sl,unionShape:()=>wl,xmlSerializer:()=>ms});var li={};Fa(li,{IAmfAPIContractProcessingDataTypes:()=>tl,IAmfAnyTypes:()=>oa,IAmfApiKeySettingsTypes:()=>Fo,IAmfArrayNodeTypes:()=>ua,IAmfArrayTypes:()=>ia,IAmfAsyncApiTypes:()=>gl,IAmfBaseUnitProcessingDataTypes:()=>fl,IAmfCallbackTypes:()=>Jo,IAmfCreativeWorkTypes:()=>Qo,IAmfDataTypeFragmentTypes:()=>cl,IAmfDocumentTypes:()=>Zo,IAmfDomainExtensionTypes:()=>Yo,IAmfDomainPropertyTypes:()=>ml,IAmfEncodingTypes:()=>el,IAmfEndpointType:()=>$o,IAmfExampleTypes:()=>Ao,IAmfExternalDomainElementTypes:()=>hl,IAmfExternalFragmentTypes:()=>dl,IAmfFileTypes:()=>na,IAmfHttpSettingsTypes:()=>Vo,IAmfIriTemplateMappingTypes:()=>Bo,IAmfLicenseTypes:()=>Io,IAmfMessageTypes:()=>Wo,IAmfModuleTypes:()=>ll,IAmfNilTypes:()=>So,IAmfNodeTypes:()=>ra,IAmfOAuth1SettingsTypes:()=>zo,IAmfOAuth2FlowTypes:()=>Mo,IAmfOAuth2SettingsTypes:()=>Lo,IAmfObjectNodeTypes:()=>ma,IAmfOpenIdConnectSettingsTypes:()=>Ko,IAmfParameterTypes:()=>No,IAmfParametrizedResourceTypeTypes:()=>rl,IAmfParametrizedSecuritySchemeTypes:()=>Do,IAmfParametrizedTraitTypes:()=>al,IAmfPayloadTypes:()=>Ro,IAmfPropertyTypes:()=>aa,IAmfProviderTypes:()=>jo,IAmfRdfsSeqType:()=>il,IAmfRecursiveTypes:()=>ca,IAmfRequestTypes:()=>Oo,IAmfResourceTypeTypes:()=>sl,IAmfResponseTypes:()=>Co,IAmfScalarNodeTypes:()=>pa,IAmfScalarTypes:()=>ta,IAmfSchemaTypes:()=>_o,IAmfScopeTypes:()=>qo,IAmfSecurityRequirementTypes:()=>Po,IAmfSecuritySchemeFragmentTypes:()=>ul,IAmfSecuritySchemeTypes:()=>Uo,IAmfServerType:()=>Eo,IAmfSourceMapTypes:()=>Xo,IAmfSupportedOperationTypes:()=>To,IAmfTagTypes:()=>Ho,IAmfTemplatedLinkTypes:()=>Go,IAmfTraitFragmentTypes:()=>pl,IAmfTraitTypes:()=>nl,IAmfTupleTypes:()=>la,IAmfUnionTypes:()=>sa,IAmfVariableValueTypes:()=>ol,IAmfWebApiType:()=>xo,IAmfXmlSerializationTypes:()=>da});var ta=[d.aml.vocabularies.shapes.ScalarShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],ia=[d.aml.vocabularies.shapes.ArrayShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],ra=[d.w3.shacl.NodeShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],aa=[d.w3.shacl.PropertyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],So=[d.aml.vocabularies.shapes.NilShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],sa=[d.aml.vocabularies.shapes.UnionShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],na=[d.aml.vocabularies.shapes.FileShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],oa=[d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],_o=[d.aml.vocabularies.shapes.SchemaShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],la=[d.aml.vocabularies.shapes.TupleShape,d.aml.vocabularies.shapes.ArrayShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],ca=[d.aml.vocabularies.shapes.RecursiveShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],da=[d.aml.vocabularies.shapes.XMLSerializer,d.aml.vocabularies.document.DomainElement],pa=[d.aml.vocabularies.data.Scalar,d.aml.vocabularies.data.Node,d.aml.vocabularies.document.DomainElement],ua=[d.aml.vocabularies.data.Array,d.w3.rdfSyntax.Seq,d.aml.vocabularies.data.Node,d.aml.vocabularies.document.DomainElement],ma=[d.aml.vocabularies.data.Object,d.aml.vocabularies.data.Node,d.aml.vocabularies.document.DomainElement],Ao=[d.aml.vocabularies.apiContract.Example,d.aml.vocabularies.document.DomainElement],xo=[d.aml.vocabularies.apiContract.WebAPI,d.aml.vocabularies.apiContract.API,d.aml.vocabularies.document.RootDomainElement,d.aml.vocabularies.document.DomainElement],Eo=[d.aml.vocabularies.apiContract.Server,d.aml.vocabularies.document.DomainElement],No=[d.aml.vocabularies.apiContract.Parameter,d.aml.vocabularies.core.Parameter,d.aml.vocabularies.document.DomainElement],jo=[d.aml.vocabularies.core.Organization,d.aml.vocabularies.document.DomainElement],Io=[d.aml.vocabularies.core.License,d.aml.vocabularies.document.DomainElement],$o=[d.aml.vocabularies.apiContract.EndPoint,d.aml.vocabularies.document.DomainElement],To=[d.aml.vocabularies.apiContract.Operation,d.aml.vocabularies.core.Operation,d.aml.vocabularies.document.DomainElement],Oo=[d.aml.vocabularies.apiContract.Request,d.aml.vocabularies.core.Request,d.aml.vocabularies.apiContract.Message,d.aml.vocabularies.document.DomainElement],Co=[d.aml.vocabularies.apiContract.Response,d.aml.vocabularies.core.Response,d.aml.vocabularies.apiContract.Message,d.aml.vocabularies.document.DomainElement],Ro=[d.aml.vocabularies.apiContract.Payload,d.aml.vocabularies.core.Payload,d.aml.vocabularies.document.DomainElement],Po=[d.aml.vocabularies.security.SecurityRequirement,d.aml.vocabularies.document.DomainElement],Do=[d.aml.vocabularies.security.ParametrizedSecurityScheme,d.aml.vocabularies.document.DomainElement],Uo=[d.aml.vocabularies.security.SecurityScheme,d.aml.vocabularies.document.DomainElement],Lo=[d.aml.vocabularies.security.OAuth2Settings,d.aml.vocabularies.security.Settings,d.aml.vocabularies.document.DomainElement],Mo=[d.aml.vocabularies.security.OAuth2Flow,d.aml.vocabularies.document.DomainElement],zo=[d.aml.vocabularies.security.OAuth1Settings,d.aml.vocabularies.security.Settings,d.aml.vocabularies.document.DomainElement],Vo=[d.aml.vocabularies.security.HttpSettings,d.aml.vocabularies.security.Settings,d.aml.vocabularies.document.DomainElement],Fo=[d.aml.vocabularies.security.ApiKeySettings,d.aml.vocabularies.security.Settings,d.aml.vocabularies.document.DomainElement],Ko=[d.aml.vocabularies.security.OpenIdConnectSettings,d.aml.vocabularies.security.Settings,d.aml.vocabularies.document.DomainElement],qo=[d.aml.vocabularies.security.Scope,d.aml.vocabularies.document.DomainElement],Jo=[d.aml.vocabularies.apiContract.Callback,d.aml.vocabularies.document.DomainElement],Go=[d.aml.vocabularies.apiContract.TemplatedLink,d.aml.vocabularies.document.DomainElement],Bo=[d.aml.vocabularies.apiContract.IriTemplateMapping,d.aml.vocabularies.document.DomainElement],Ho=[d.aml.vocabularies.apiContract.Tag,d.aml.vocabularies.document.DomainElement],Wo=[d.aml.vocabularies.apiContract.Message,d.aml.vocabularies.document.DomainElement],Yo=[d.aml.vocabularies.apiContract.DomainExtension,d.aml.vocabularies.document.DomainElement],Xo=[d.aml.vocabularies.docSourceMaps.SourceMap],Zo=[d.aml.vocabularies.document.Document,d.aml.vocabularies.document.Fragment,d.aml.vocabularies.document.Module,d.aml.vocabularies.document.Unit],Qo=[d.aml.vocabularies.core.CreativeWork,d.aml.vocabularies.document.DomainElement],el=[d.aml.vocabularies.apiContract.Encoding,d.aml.vocabularies.document.DomainElement],tl=[d.aml.vocabularies.document.APIContractProcessingData],il=[d.w3.rdfSchema.Seq],rl=[d.aml.vocabularies.apiContract.ParametrizedResourceType,d.aml.vocabularies.document.ParametrizedDeclaration,d.aml.vocabularies.document.DomainElement],al=[d.aml.vocabularies.apiContract.ParametrizedTrait,d.aml.vocabularies.document.ParametrizedDeclaration,d.aml.vocabularies.document.DomainElement],sl=[d.aml.vocabularies.apiContract.ResourceType,d.aml.vocabularies.document.AbstractDeclaration,d.aml.vocabularies.document.DomainElement],nl=[d.aml.vocabularies.apiContract.Trait,d.aml.vocabularies.document.AbstractDeclaration,d.aml.vocabularies.document.DomainElement],ol=[d.aml.vocabularies.document.VariableValue,d.aml.vocabularies.document.DomainElement],ll=[d.aml.vocabularies.document.Module,d.aml.vocabularies.document.Unit],cl=[d.aml.vocabularies.shapes.DataTypeFragment,d.aml.vocabularies.document.Fragment,d.aml.vocabularies.document.Unit],dl=[d.aml.vocabularies.document.ExternalFragment,d.aml.vocabularies.document.Fragment,d.aml.vocabularies.document.Unit],pl=[d.aml.vocabularies.apiContract.TraitFragment,d.aml.vocabularies.document.Fragment,d.aml.vocabularies.document.Unit],ul=[d.aml.vocabularies.security.SecuritySchemeFragment,d.aml.vocabularies.document.Fragment,d.aml.vocabularies.document.Unit],ml=[d.aml.vocabularies.document.DomainProperty,d.w3.rdfSyntax.Property,d.aml.vocabularies.document.DomainElement],hl=[d.aml.vocabularies.document.ExternalDomainElement,d.aml.vocabularies.document.DomainElement],fl=[d.aml.vocabularies.document.BaseUnitProcessingData],gl=[d.aml.vocabularies.apiContract.AsyncAPI,d.aml.vocabularies.apiContract.API,d.aml.vocabularies.document.RootDomainElement,d.aml.vocabularies.document.DomainElement];function ms(o){return{id:`xml-serializer-${o}`,types:da,customDomainProperties:[]}}function ha(o){return{id:o,types:[],values:[],inherits:[],or:[],and:[],xone:[],customDomainProperties:[]}}function ct(o){return{...ha(o),types:oa,examples:[],xmlSerialization:ms(o)}}function yl(o){let e=ct(o);return e.types=ra,e.id=`node-shape-${o}`,{...e,properties:[],dependencies:[],customShapeProperties:[],customShapePropertyDefinitions:[]}}function bl(o){let e=ct(o);return e.id=`scalar-shape-${o}`,e.types=ta,e}function wl(o){let e=ct(o);return e.id=`union-shape-${o}`,e.types=sa,{...e,anyOf:[]}}function vl(o){let e=ct(o);return e.id=`file-shape-${o}`,e.types=na,e}function kl(o){let e=ct(o);return e.id=`array-shape-${o}`,e.types=ia,e}function Sl(o){let e=ct(o);return e.id=`tuple-shape-${o}`,e.types=la,{...e,items:[]}}function _l(o){let e=ct(o);return e.types=aa,e}function Al(o,e){return{...ha(o),id:`recursive-${o}`,types:ca,fixPoint:e||""}}import{customAlphabet as xl}from"nanoid";var hs=xl("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_",21);var Me=class o{id=hs();types;name;properties;value;dataType;members;customDomainProperties=[];static scalar(e,t){let i=new o("scalar");return i.value=e,i.dataType=t,i}constructor(e){if(typeof e=="string"){if(e==="scalar")this.types=pa;else if(e==="array")this.types=ua;else if(e==="object")this.types=ma;else throw new Error(`Invalid data node init option: ${e}`);return}if(!e)throw new Error("Expected an initialization option.");let t=e,{id:i,types:r,customDomainProperties:a}=t;if(this.id=i,this.types=r,this.customDomainProperties=a,r.includes(d.aml.vocabularies.data.Scalar)){let s=t;this.value=s.value,this.dataType=s.dataType}else if(r.includes(d.aml.vocabularies.data.Object)){let s=t,n={};this.properties=n,Object.keys(s.properties).forEach(l=>{let c=new o(s.properties[l]);n[l]=c})}else if(r.includes(d.aml.vocabularies.data.Array)){let s=t,n=[];this.members=n,Array.isArray(s.members)&&s.members.forEach(l=>{let c=new o(l);n.push(c)})}}toJSON(){let{id:e,customDomainProperties:t,types:i,name:r}=this,a={id:e,types:i,customDomainProperties:t};if(r&&(a.name=r),i.includes(d.aml.vocabularies.data.Scalar)){let s=a;s.dataType=this.dataType,s.value=this.value}else if(i.includes(d.aml.vocabularies.data.Object)){let s=a;s.properties={};let n=this.properties;n&&Object.keys(n).forEach(l=>{s.properties[l]=n[l].toJSON()})}else if(i.includes(d.aml.vocabularies.data.Array)){let s=a;s.members=[],this.members&&this.members.forEach(n=>{s.members.push(n.toJSON())})}return a}addMember(e){if(!this.types.includes(d.aml.vocabularies.data.Array))throw new Error("Not an ArrayNode.");this.members||(this.members=[]),this.members.push(e)}removeMember(e){if(!this.types.includes(d.aml.vocabularies.data.Array))throw new Error("Not an ArrayNode.");if(!this.members)return;let t=this.members.findIndex(i=>i.id===e);t>=0&&this.members.splice(t,1)}addProperty(e,t){if(!this.types.includes(d.aml.vocabularies.data.Object))throw new Error("Not an ObjectNode.");this.properties||(this.properties={}),this.properties[e]=t}removeProperty(e){if(!this.types.includes(d.aml.vocabularies.data.Object))throw new Error("Not an ObjectNode.");this.properties&&delete this.properties[e]}};var pe=Symbol("nValue"),ci=Symbol("mValue"),fs=Symbol("matrixAValue"),cr=Symbol("upperMaskValue"),dr=Symbol("lowerMaskValue"),K=Symbol("mtValue"),Ee=Symbol("mtiValue"),pr=Symbol("instancesValue"),dt=class o{static[pr]=new Map;[pe]=624;[ci]=397;[fs]=2567483615;[cr]=2147483648;[dr]=2147483647;[K]=new Array(this[pe]);[Ee]=this[pe]+1;constructor(e=o.seedFn()){this.initGenRand(e)}static seedFn(){return Math.floor(Math.random()*10**13)}static fromSeed(e=o.seedFn()){if(this[pr].has(e))return this[pr].get(e);let t=new o(e);return this[pr].set(e,t),t}initGenRand(e){let t=e;for(this[K][0]=t>>>0,this[Ee]=1;this[Ee]<this[pe];this[Ee]++)t=this[K][this[Ee]-1]^this[K][this[Ee]-1]>>>30,this[K][this[Ee]]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this[Ee],this[K][this[Ee]]>>>=0}initByArray(e,t){let i=1,r=0,a;this.initGenRand(19650218);let s=this[pe]>t?this[pe]:t;for(;s;s--)a=this[K][i-1]^this[K][i-1]>>>30,this[K][i]=(this[K][i]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+e[r]+r,this[K][i]>>>=0,i++,r++,i>=this[pe]&&(this[K][0]=this[K][this[pe]-1],i=1),r>=t&&(r=0);for(s=this[pe]-1;s;s--)a=this[K][i-1]^this[K][i-1]>>>30,this[K][i]=(this[K][i]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-i,this[K][i]>>>=0,i++,i>=this[pe]&&(this[K][0]=this[K][this[pe]-1],i=1);this[K][0]=2147483648}int32(){let e,t=[0,this[fs]];if(this[Ee]>=this[pe]){let i;for(this[Ee]===this[pe]+1&&this.initGenRand(5489),i=0;i<this[pe]-this[ci];i++)e=this[K][i]&this[cr]|this[K][i+1]&this[dr],this[K][i]=this[K][i+this[ci]]^e>>>1^t[e&1];for(;i<this[pe]-1;i++)e=this[K][i]&this[cr]|this[K][i+1]&this[dr],this[K][i]=this[K][i+(this[ci]-this[pe])]^e>>>1^t[e&1];e=this[K][this[pe]-1]&this[cr]|this[K][0]&this[dr],this[K][this[pe]-1]=this[K][this[ci]-1]^e>>>1^t[e&1],this[Ee]=0}return e=this[K][this[Ee]++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0}int31(){return this.int32()>>>1}real1(){return this.int32()*(1/4294967295)}random(e=32768,t=0){return Math.floor(this.real2()*(e-t)+t)}real2(){return this.int32()*(1/4294967296)}real3(){return(this.int32()+.5)*(1/4294967296)}res53(){let e=this.int32()>>>5,t=this.int32()>>>6;return(e*67108864+t)*(1/9007199254740992)}};var ur="0123456789",di="abcdefghijklmnopqrstuvwxyz",mr=di.toUpperCase(),fa=`${ur}abcdef`;function gs(o=""){return o.replace(/ /g,"-").replace(/[^一-龠ぁ-ゔァ-ヴー\w.-]+/g,"")}function ze(o,e={}){let t={};typeof e=="number"?t.max=e:typeof e=="object"&&(t={...e}),typeof t.min!="number"&&(t.min=0),typeof t.max!="number"&&(t.max=99999),typeof t.precision!="number"&&(t.precision=1),t.max>0&&(t.max+=t.precision);let i=Math.floor(o.random(t.max/t.precision,t.min/t.precision));return t.precision===1||(i/=1/t.precision),i}function hr(o,e={}){let t={};return typeof e=="number"?t.precision=e:typeof e=="object"&&(t={...e}),typeof t.precision!="number"&&(t.precision=.01),ze(o,t)}function ys(o,e=10,t){let i=typeof t=="string"?t:mr+di,r={min:0,max:i.length-1};return new Array(e).fill("").map(()=>i[ze(o,r)]).join("")}function bs(o,e={}){let t={...e},i;switch(t.casing){case"lower":i=di;break;case"upper":i=mr;break;default:i=di+mr}if(!t.pool){t.pool="";let r="!@#$%^&*()[]";t.alpha&&(t.pool+=i),t.numeric&&(t.pool+=ur),t.symbols&&(t.pool+=r),t.pool||(t.pool=`${i}${ur}${r}`)}return t.pool.charAt(ze(o,t.pool.length-1))}function ws(o,e={}){let t={};typeof e=="number"?t.max=e:typeof e=="object"&&(t={...e});let i=864e13;(typeof t.min!="number"||t.min<i*-1)&&(t.min=new Date().setFullYear(1970,1,1)),(typeof t.max!="number"||t.max>i)&&(t.max=new Date().setFullYear(2100,1,1));let r=ze(o,t);return new Date(r)}var Vt=Symbol("mtValue"),pt=class{[Vt];constructor(e){this[Vt]=dt.fromSeed(e)}seed(e){this[Vt]=dt.fromSeed(e)}pick(e,t){let i=t;typeof i!="number"?i=ze(this[Vt],{min:1,max:e.length}):i>e.length?i=e.length:i<0&&(i=0);let r=[...e],a=r.length,s=a-i,n,l;for(;a-- >s;)l=Math.floor((a+1)*hr(this[Vt],{min:0,max:.99})),n=r[l],r[l]=r[a],r[a]=n;return r.slice(s)}pickOne(e){let t=ze(this[Vt],{max:e.length-1});return e[t]}};var pi=Symbol("randomValue"),Ve=Symbol("mtValue"),je=class{[Ve];[pi];constructor(e){this[Ve]=dt.fromSeed(e),this[pi]=new pt(e)}seed(e){this[Ve]=dt.fromSeed(e),this[pi].seed(e)}number(e={}){return ze(this[Ve],e)}float(e={}){return hr(this[Ve],e)}datetime(e={}){return ws(this[Ve],e)}string(e=10,t){return ys(this[Ve],e,t)}character(e={}){return bs(this[Ve],e)}uuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let i=this.number({min:0,max:15});return(t==="x"?i:i&3|8).toString(16)})}hash(e={}){let{length:t=40,casing:i="lower"}=e,r=i==="upper"?fa.toUpperCase():fa;return this.string(t,r)}boolean(e={}){let t={};if(typeof e=="number"?t.likelihood=e:typeof e=="object"&&(t={...e}),typeof t.likelihood>"u"&&(t.likelihood=ze(this[Ve],{min:0,max:100})),t.likelihood<0||t.likelihood>100)throw new RangeError("Invalid likelihood range. Accepted range is [0, 100].");return this[Ve].real2()*100<t.likelihood}falsy(e={}){let t=e.pool||[!1,null,0,NaN,""];return this[pi].pickOne(t)}hexaDecimal(e=1){let t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","A","B","C","D","E","F"];return`0x${this[pi].pick(t,e).join("")}`}};var El={names:["January","February","March","April","May","June","July","August","September","October","November","December"],abbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},ks=El;var Nl={names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},Ss=Nl;var jl={month:ks,weekday:Ss},_s=jl;var Il=Object.freeze({consonants:"bcdfghjklmnprstvwz",vowels:"aeiou"}),As=Il;var $l={free:["gmail.com","yahoo.com","hotmail.com"],example:["example.org","example.com","example.net"]},xs=$l;var Tl={suffix:["com","biz","info","name","net","org"]},Es=Tl;var Ol=["0therplanet_128.jpg","1markiz_128.jpg","2fockus_128.jpg","8d3k_128.jpg","91bilal_128.jpg","9lessons_128.jpg","AM_Kn2_128.jpg","AlbertoCococi_128.jpg","BenouarradeM_128.jpg","BillSKenney_128.jpg","BrianPurkiss_128.jpg","BroumiYoussef_128.jpg","BryanHorsey_128.jpg","Chakintosh_128.jpg","ChrisFarina78_128.jpg","Elt_n_128.jpg","GavicoInd_128.jpg","HenryHoffman_128.jpg","IsaryAmairani_128.jpg","Karimmove_128.jpg","LucasPerdidao_128.jpg","ManikRathee_128.jpg","RussellBishop_128.jpg","S0ufi4n3_128.jpg","SULiik_128.jpg","Shriiiiimp_128.jpg","Silveredge9_128.jpg","Skyhartman_128.jpg","SlaapMe_128.jpg","Stievius_128.jpg","Talbi_ConSept_128.jpg","VMilescu_128.jpg","VinThomas_128.jpg","YoungCutlass_128.jpg","ZacharyZorbas_128.jpg","_dwite__128.jpg","_kkga_128.jpg","_pedropinho_128.jpg","_ragzor_128.jpg","_scottburgess_128.jpg","_shahedk_128.jpg","_victa_128.jpg","_vojto_128.jpg","_williamguerra_128.jpg","_yardenoon_128.jpg","a1chapone_128.jpg","a_brixen_128.jpg","a_harris88_128.jpg","aaronalfred_128.jpg","aaroni_128.jpg","aaronkwhite_128.jpg","abdots_128.jpg","abdulhyeuk_128.jpg","abdullindenis_128.jpg","abelcabans_128.jpg","abotap_128.jpg","abovefunction_128.jpg","adamawesomeface_128.jpg","adammarsbar_128.jpg","adamnac_128.jpg","adamsxu_128.jpg","adellecharles_128.jpg","ademilter_128.jpg","adhamdannaway_128.jpg","adhiardana_128.jpg","adityasutomo_128.jpg","adobi_128.jpg","adrienths_128.jpg","aeon56_128.jpg","afusinatto_128.jpg","agromov_128.jpg","agustincruiz_128.jpg","ah_lice_128.jpg","ahmadajmi_128.jpg","ahmetalpbalkan_128.jpg","ahmetsulek_128.jpg","aiiaiiaii_128.jpg","ainsleywagon_128.jpg","aio____128.jpg","airskylar_128.jpg","aislinnkelly_128.jpg","ajaxy_ru_128.jpg","aka_james_128.jpg","akashsharma39_128.jpg","akmalfikri_128.jpg","akmur_128.jpg","al_li_128.jpg","alagoon_128.jpg","alan_zhang__128.jpg","albertaugustin_128.jpg","alecarpentier_128.jpg","aleclarsoniv_128.jpg","aleinadsays_128.jpg","alek_djuric_128.jpg","aleksitappura_128.jpg","alessandroribe_128.jpg","alevizio_128.jpg","alexandermayes_128.jpg","alexivanichkin_128.jpg","algunsanabria_128.jpg","allagringaus_128.jpg","allfordesign_128.jpg","allthingssmitty_128.jpg","alsobrooks_128.jpg","alterchuca_128.jpg","aluisio_azevedo_128.jpg","alxleroydeval_128.jpg","alxndrustinov_128.jpg","amandabuzard_128.jpg","amanruzaini_128.jpg","amayvs_128.jpg","amywebbb_128.jpg","anaami_128.jpg","anasnakawa_128.jpg","anatolinicolae_128.jpg","andrea211087_128.jpg","andreas_pr_128.jpg","andresdjasso_128.jpg","andresenfredrik_128.jpg","andrewabogado_128.jpg","andrewarrow_128.jpg","andrewcohen_128.jpg","andrewofficer_128.jpg","andyisonline_128.jpg","andysolomon_128.jpg","andytlaw_128.jpg","angelceballos_128.jpg","angelcolberg_128.jpg","angelcreative_128.jpg","anjhero_128.jpg","ankitind_128.jpg","anoff_128.jpg","anthonysukow_128.jpg","antjanus_128.jpg","antongenkin_128.jpg","antonyryndya_128.jpg","antonyzotov_128.jpg","aoimedia_128.jpg","apriendeau_128.jpg","arashmanteghi_128.jpg","areandacom_128.jpg","areus_128.jpg","ariffsetiawan_128.jpg","ariil_128.jpg","arindam__128.jpg","arishi__128.jpg","arkokoley_128.jpg","aroon_sharma_128.jpg","arpitnj_128.jpg","artd_sign_128.jpg","artem_kostenko_128.jpg","arthurholcombe1_128.jpg","artvavs_128.jpg","ashernatali_128.jpg","ashocka18_128.jpg","atanism_128.jpg","atariboy_128.jpg","ateneupopular_128.jpg","attacks_128.jpg","aviddayentonbay_128.jpg","axel_128.jpg","badlittleduck_128.jpg","bagawarman_128.jpg","baires_128.jpg","balakayuriy_128.jpg","balintorosz_128.jpg","baliomega_128.jpg","baluli_128.jpg","bargaorobalo_128.jpg","barputro_128.jpg","bartjo_128.jpg","bartoszdawydzik_128.jpg","bassamology_128.jpg","batsirai_128.jpg","baumann_alex_128.jpg","baumannzone_128.jpg","bboy1895_128.jpg","bcrad_128.jpg","begreative_128.jpg","belyaev_rs_128.jpg","benefritz_128.jpg","benjamin_knight_128.jpg","bennyjien_128.jpg","benoitboucart_128.jpg","bereto_128.jpg","bergmartin_128.jpg","bermonpainter_128.jpg","bertboerland_128.jpg","besbujupi_128.jpg","beshur_128.jpg","betraydan_128.jpg","beweinreich_128.jpg","bfrohs_128.jpg","bighanddesign_128.jpg","bigmancho_128.jpg","billyroshan_128.jpg","bistrianiosip_128.jpg","blakehawksworth_128.jpg","blakesimkins_128.jpg","bluefx__128.jpg","bluesix_128.jpg","bobbytwoshoes_128.jpg","bobwassermann_128.jpg","bolzanmarco_128.jpg","borantula_128.jpg","borges_marcos_128.jpg","bowbrick_128.jpg","boxmodel_128.jpg","bpartridge_128.jpg","bradenhamm_128.jpg","brajeshwar_128.jpg","brandclay_128.jpg","brandonburke_128.jpg","brandonflatsoda_128.jpg","brandonmorreale_128.jpg","brenmurrell_128.jpg","brenton_clarke_128.jpg","bruno_mart_128.jpg","brunodesign1206_128.jpg","bryan_topham_128.jpg","bu7921_128.jpg","bublienko_128.jpg","buddhasource_128.jpg","buleswapnil_128.jpg","bungiwan_128.jpg","buryaknick_128.jpg","buzzusborne_128.jpg","byrnecore_128.jpg","byryan_128.jpg","cadikkara_128.jpg","calebjoyce_128.jpg","calebogden_128.jpg","canapud_128.jpg","carbontwelve_128.jpg","carlfairclough_128.jpg","carlosblanco_eu_128.jpg","carlosgavina_128.jpg","carlosjgsousa_128.jpg","carlosm_128.jpg","carlyson_128.jpg","caseycavanagh_128.jpg","caspergrl_128.jpg","catadeleon_128.jpg","catarino_128.jpg","cboller1_128.jpg","cbracco_128.jpg","ccinojasso1_128.jpg","cdavis565_128.jpg","cdharrison_128.jpg","ceekaytweet_128.jpg","cemshid_128.jpg","cggaurav_128.jpg","chaabane_wail_128.jpg","chacky14_128.jpg","chadami_128.jpg","chadengle_128.jpg","chaensel_128.jpg","chandlervdw_128.jpg","chanpory_128.jpg","charlesrpratt_128.jpg","charliecwaite_128.jpg","charliegann_128.jpg","chatyrko_128.jpg","cherif_b_128.jpg","chris_frees_128.jpg","chris_witko_128.jpg","chrismj83_128.jpg","chrisslowik_128.jpg","chrisstumph_128.jpg","christianoliff_128.jpg","chrisvanderkooi_128.jpg","ciaranr_128.jpg","cicerobr_128.jpg","claudioguglieri_128.jpg","cloudstudio_128.jpg","clubb3rry_128.jpg","cocolero_128.jpg","codepoet_ru_128.jpg","coderdiaz_128.jpg","codysanfilippo_128.jpg","cofla_128.jpg","colgruv_128.jpg","colirpixoil_128.jpg","collegeman_128.jpg","commadelimited_128.jpg","conspirator_128.jpg","constantx_128.jpg","coreyginnivan_128.jpg","coreyhaggard_128.jpg","coreyweb_128.jpg","craigelimeliah_128.jpg","craighenneberry_128.jpg","craigrcoles_128.jpg","creartinc_128.jpg","croakx_128.jpg","curiousoffice_128.jpg","curiousonaut_128.jpg","cybind_128.jpg","cynthiasavard_128.jpg","cyril_gaillard_128.jpg","d00maz_128.jpg","d33pthought_128.jpg","d_kobelyatsky_128.jpg","d_nny_m_cher_128.jpg","dactrtr_128.jpg","dahparra_128.jpg","dallasbpeters_128.jpg","damenleeturks_128.jpg","danillos_128.jpg","daniloc_128.jpg","danmartin70_128.jpg","dannol_128.jpg","danpliego_128.jpg","danro_128.jpg","dansowter_128.jpg","danthms_128.jpg","danvernon_128.jpg","danvierich_128.jpg","darcystonge_128.jpg","darylws_128.jpg","davecraige_128.jpg","davidbaldie_128.jpg","davidcazalis_128.jpg","davidhemphill_128.jpg","davidmerrique_128.jpg","davidsasda_128.jpg","dawidwu_128.jpg","daykiine_128.jpg","dc_user_128.jpg","dcalonaci_128.jpg","ddggccaa_128.jpg","de_ascanio_128.jpg","deeenright_128.jpg","demersdesigns_128.jpg","denisepires_128.jpg","depaulawagner_128.jpg","derekcramer_128.jpg","derekebradley_128.jpg","derienzo777_128.jpg","desastrozo_128.jpg","designervzm_128.jpg","dev_essentials_128.jpg","devankoshal_128.jpg","deviljho__128.jpg","devinhalladay_128.jpg","dgajjar_128.jpg","dgclegg_128.jpg","dhilipsiva_128.jpg","dhoot_amit_128.jpg","dhooyenga_128.jpg","dhrubo_128.jpg","diansigitp_128.jpg","dicesales_128.jpg","diesellaws_128.jpg","digitalmaverick_128.jpg","dimaposnyy_128.jpg","dingyi_128.jpg","divya_128.jpg","dixchen_128.jpg","djsherman_128.jpg","dmackerman_128.jpg","dmitriychuta_128.jpg","dnezkumar_128.jpg","dnirmal_128.jpg","donjain_128.jpg","doooon_128.jpg","doronmalki_128.jpg","dorphern_128.jpg","dotgridline_128.jpg","dparrelli_128.jpg","dpmachado_128.jpg","dreizle_128.jpg","drewbyreese_128.jpg","dshster_128.jpg","dss49_128.jpg","dudestein_128.jpg","duivvv_128.jpg","dutchnadia_128.jpg","dvdwinden_128.jpg","dzantievm_128.jpg","ecommerceil_128.jpg","eddiechen_128.jpg","edgarchris99_128.jpg","edhenderson_128.jpg","edkf_128.jpg","edobene_128.jpg","eduardostuart_128.jpg","ehsandiary_128.jpg","eitarafa_128.jpg","el_fuertisimo_128.jpg","elbuscainfo_128.jpg","elenadissi_128.jpg","elisabethkjaer_128.jpg","elliotlewis_128.jpg","elliotnolten_128.jpg","embrcecreations_128.jpg","emileboudeling_128.jpg","emmandenn_128.jpg","emmeffess_128.jpg","emsgulam_128.jpg","enda_128.jpg","enjoythetau_128.jpg","enricocicconi_128.jpg","envex_128.jpg","ernestsemerda_128.jpg","erwanhesry_128.jpg","estebanuribe_128.jpg","eugeneeweb_128.jpg","evandrix_128.jpg","evanshajed_128.jpg","exentrich_128.jpg","eyronn_128.jpg","fabbianz_128.jpg","fabbrucci_128.jpg","faisalabid_128.jpg","falconerie_128.jpg","falling_soul_128.jpg","falvarad_128.jpg","felipeapiress_128.jpg","felipecsl_128.jpg","ffbel_128.jpg","finchjke_128.jpg","findingjenny_128.jpg","fiterik_128.jpg","fjaguero_128.jpg","flashmurphy_128.jpg","flexrs_128.jpg","foczzi_128.jpg","fotomagin_128.jpg","fran_mchamy_128.jpg","francis_vega_128.jpg","franciscoamk_128.jpg","frankiefreesbie_128.jpg","fronx_128.jpg","funwatercat_128.jpg","g3d_128.jpg","gaborenton_128.jpg","gabrielizalo_128.jpg","gabrielrosser_128.jpg","ganserene_128.jpg","garand_128.jpg","gauchomatt_128.jpg","gauravjassal_128.jpg","gavr1l0_128.jpg","gcmorley_128.jpg","gearpixels_128.jpg","geneseleznev_128.jpg","geobikas_128.jpg","geran7_128.jpg","geshan_128.jpg","giancarlon_128.jpg","gipsy_raf_128.jpg","giuliusa_128.jpg","gizmeedevil1991_128.jpg","gkaam_128.jpg","gmourier_128.jpg","goddardlewis_128.jpg","gofrasdesign_128.jpg","gojeanyn_128.jpg","gonzalorobaina_128.jpg","grahamkennery_128.jpg","greenbes_128.jpg","gregkilian_128.jpg","gregrwilkinson_128.jpg","gregsqueeb_128.jpg","grrr_nl_128.jpg","gseguin_128.jpg","gt_128.jpg","gu5taf_128.jpg","guiiipontes_128.jpg","guillemboti_128.jpg","guischmitt_128.jpg","gusoto_128.jpg","h1brd_128.jpg","hafeeskhan_128.jpg","hai_ninh_nguyen_128.jpg","haligaliharun_128.jpg","hanna_smi_128.jpg","happypeter1983_128.jpg","harry_sistalam_128.jpg","haruintesettden_128.jpg","hasslunsford_128.jpg","haydn_woods_128.jpg","helderleal_128.jpg","hellofeverrrr_128.jpg","her_ruu_128.jpg","herbigt_128.jpg","herkulano_128.jpg","hermanobrother_128.jpg","herrhaase_128.jpg","heycamtaylor_128.jpg","heyimjuani_128.jpg","heykenneth_128.jpg","hfalucas_128.jpg","hgharrygo_128.jpg","hiemil_128.jpg","hjartstrorn_128.jpg","hoangloi_128.jpg","holdenweb_128.jpg","homka_128.jpg","horaciobella_128.jpg","hota_v_128.jpg","hsinyo23_128.jpg","hugocornejo_128.jpg","hugomano_128.jpg","iamgarth_128.jpg","iamglimy_128.jpg","iamjdeleon_128.jpg","iamkarna_128.jpg","iamkeithmason_128.jpg","iamsteffen_128.jpg","id835559_128.jpg","idiot_128.jpg","iduuck_128.jpg","ifarafonow_128.jpg","igorgarybaldi_128.jpg","illyzoren_128.jpg","ilya_pestov_128.jpg","imammuht_128.jpg","imcoding_128.jpg","imomenui_128.jpg","imsoper_128.jpg","increase_128.jpg","incubo82_128.jpg","instalox_128.jpg","ionuss_128.jpg","ipavelek_128.jpg","iqbalperkasa_128.jpg","iqonicd_128.jpg","irae_128.jpg","isaacfifth_128.jpg","isacosta_128.jpg","ismail_biltagi_128.jpg","isnifer_128.jpg","itolmach_128.jpg","itsajimithing_128.jpg","itskawsar_128.jpg","itstotallyamy_128.jpg","ivanfilipovbg_128.jpg","j04ntoh_128.jpg","j2deme_128.jpg","j_drake__128.jpg","jackiesaik_128.jpg","jacksonlatka_128.jpg","jacobbennett_128.jpg","jagan123_128.jpg","jakemoore_128.jpg","jamiebrittain_128.jpg","janpalounek_128.jpg","jarjan_128.jpg","jarsen_128.jpg","jasonmarkjones_128.jpg","javorszky_128.jpg","jay_wilburn_128.jpg","jayphen_128.jpg","jayrobinson_128.jpg","jcubic_128.jpg","jedbridges_128.jpg","jefffis_128.jpg","jeffgolenski_128.jpg","jehnglynn_128.jpg","jennyshen_128.jpg","jennyyo_128.jpg","jeremery_128.jpg","jeremiaha_128.jpg","jeremiespoken_128.jpg","jeremymouton_128.jpg","jeremyshimko_128.jpg","jeremyworboys_128.jpg","jerrybai1907_128.jpg","jervo_128.jpg","jesseddy_128.jpg","jffgrdnr_128.jpg","jghyllebert_128.jpg","jimmuirhead_128.jpg","jitachi_128.jpg","jjshaw14_128.jpg","jjsiii_128.jpg","jlsolerdeltoro_128.jpg","jm_denis_128.jpg","jmfsocial_128.jpg","jmillspaysbills_128.jpg","jnmnrd_128.jpg","joannefournier_128.jpg","joaoedumedeiros_128.jpg","jodytaggart_128.jpg","joe_black_128.jpg","joelcipriano_128.jpg","joelhelin_128.jpg","joemdesign_128.jpg","joetruesdell_128.jpg","joeymurdah_128.jpg","johannesneu_128.jpg","johncafazza_128.jpg","johndezember_128.jpg","johnriordan_128.jpg","johnsmithagency_128.jpg","joki4_128.jpg","jomarmen_128.jpg","jonathansimmons_128.jpg","jonkspr_128.jpg","jonsgotwood_128.jpg","jordyvdboom_128.jpg","joreira_128.jpg","josecarlospsh_128.jpg","josemarques_128.jpg","josep_martins_128.jpg","josevnclch_128.jpg","joshaustin_128.jpg","joshhemsley_128.jpg","joshmedeski_128.jpg","joshuaraichur_128.jpg","joshuasortino_128.jpg","jpenico_128.jpg","jpscribbles_128.jpg","jqiuss_128.jpg","juamperro_128.jpg","juangomezw_128.jpg","juanmamartinez_128.jpg","juaumlol_128.jpg","judzhin_miles_128.jpg","justinrgraham_128.jpg","justinrhee_128.jpg","justinrob_128.jpg","justme_timothyg_128.jpg","jwalter14_128.jpg","jydesign_128.jpg","kaelifa_128.jpg","kalmerrautam_128.jpg","kamal_chaneman_128.jpg","kanickairaj_128.jpg","kapaluccio_128.jpg","karalek_128.jpg","karlkanall_128.jpg","karolkrakowiak__128.jpg","karsh_128.jpg","karthipanraj_128.jpg","kaspernordkvist_128.jpg","katiemdaly_128.jpg","kaysix_dizzy_128.jpg","kazaky999_128.jpg","kennyadr_128.jpg","kerem_128.jpg","kerihenare_128.jpg","keryilmaz_128.jpg","kevinjohndayy_128.jpg","kevinoh_128.jpg","kevka_128.jpg","keyuri85_128.jpg","kianoshp_128.jpg","kijanmaharjan_128.jpg","kikillo_128.jpg","kimcool_128.jpg","kinday_128.jpg","kirangopal_128.jpg","kiwiupover_128.jpg","kkusaa_128.jpg","klefue_128.jpg","klimmka_128.jpg","knilob_128.jpg","kohette_128.jpg","kojourin_128.jpg","kolage_128.jpg","kolmarlopez_128.jpg","kolsvein_128.jpg","konus_128.jpg","koridhandy_128.jpg","kosmar_128.jpg","kostaspt_128.jpg","krasnoukhov_128.jpg","krystalfister_128.jpg","kucingbelang4_128.jpg","kudretkeskin_128.jpg","kuldarkalvik_128.jpg","kumarrajan12123_128.jpg","kurafire_128.jpg","kurtinc_128.jpg","kushsolitary_128.jpg","kvasnic_128.jpg","ky_128.jpg","kylefoundry_128.jpg","kylefrost_128.jpg","laasli_128.jpg","lanceguyatt_128.jpg","langate_128.jpg","larrybolt_128.jpg","larrygerard_128.jpg","laurengray_128.jpg","lawlbwoy_128.jpg","layerssss_128.jpg","leandrovaranda_128.jpg","lebinoclard_128.jpg","lebronjennan_128.jpg","leehambley_128.jpg","leeiio_128.jpg","leemunroe_128.jpg","leonfedotov_128.jpg","lepetitogre_128.jpg","lepinski_128.jpg","levisan_128.jpg","lewisainslie_128.jpg","lhausermann_128.jpg","liminha_128.jpg","lingeswaran_128.jpg","linkibol_128.jpg","linux29_128.jpg","lisovsky_128.jpg","llun_128.jpg","lmjabreu_128.jpg","loganjlambert_128.jpg","logorado_128.jpg","lokesh_coder_128.jpg","lonesomelemon_128.jpg","longlivemyword_128.jpg","looneydoodle_128.jpg","lososina_128.jpg","louis_currie_128.jpg","low_res_128.jpg","lowie_128.jpg","lu4sh1i_128.jpg","ludwiczakpawel_128.jpg","luxe_128.jpg","lvovenok_128.jpg","m4rio_128.jpg","m_kalibry_128.jpg","ma_tiax_128.jpg","mactopus_128.jpg","macxim_128.jpg","madcampos_128.jpg","madebybrenton_128.jpg","madebyvadim_128.jpg","madewulf_128.jpg","madshensel_128.jpg","madysondesigns_128.jpg","magoo04_128.jpg","magugzbrand2d_128.jpg","mahdif_128.jpg","mahmoudmetwally_128.jpg","maikelk_128.jpg","maiklam_128.jpg","malgordon_128.jpg","malykhinv_128.jpg","mandalareopens_128.jpg","manekenthe_128.jpg","mangosango_128.jpg","manigm_128.jpg","marakasina_128.jpg","marciotoledo_128.jpg","marclgonzales_128.jpg","marcobarbosa_128.jpg","marcomano__128.jpg","marcoramires_128.jpg","marcusgorillius_128.jpg","markjenkins_128.jpg","marklamb_128.jpg","markolschesky_128.jpg","markretzloff_128.jpg","markwienands_128.jpg","marlinjayakody_128.jpg","marosholly_128.jpg","marrimo_128.jpg","marshallchen__128.jpg","martinansty_128.jpg","martip07_128.jpg","mashaaaaal_128.jpg","mastermindesign_128.jpg","matbeedotcom_128.jpg","mateaodviteza_128.jpg","matkins_128.jpg","matt3224_128.jpg","mattbilotti_128.jpg","mattdetails_128.jpg","matthewkay__128.jpg","mattlat_128.jpg","mattsapii_128.jpg","mauriolg_128.jpg","maximseshuk_128.jpg","maximsorokin_128.jpg","maxlinderman_128.jpg","maz_128.jpg","mbilalsiddique1_128.jpg","mbilderbach_128.jpg","mcflydesign_128.jpg","mds_128.jpg","mdsisto_128.jpg","meelford_128.jpg","megdraws_128.jpg","mekal_128.jpg","meln1ks_128.jpg","melvindidit_128.jpg","mfacchinello_128.jpg","mgonto_128.jpg","mhaligowski_128.jpg","mhesslow_128.jpg","mhudobivnik_128.jpg","michaelabehsera_128.jpg","michaelbrooksjr_128.jpg","michaelcolenso_128.jpg","michaelcomiskey_128.jpg","michaelkoper_128.jpg","michaelmartinho_128.jpg","michalhron_128.jpg","michigangraham_128.jpg","michzen_128.jpg","mighty55_128.jpg","miguelkooreman_128.jpg","miguelmendes_128.jpg","mikaeljorhult_128.jpg","mikebeecham_128.jpg","mikemai2awesome_128.jpg","millinet_128.jpg","mirfanqureshi_128.jpg","missaaamy_128.jpg","mizhgan_128.jpg","mizko_128.jpg","mkginfo_128.jpg","mocabyte_128.jpg","mohanrohith_128.jpg","moscoz_128.jpg","motionthinks_128.jpg","moynihan_128.jpg","mr_shiznit_128.jpg","mr_subtle_128.jpg","mrebay007_128.jpg","mrjamesnoble_128.jpg","mrmartineau_128.jpg","mrxloka_128.jpg","mslarkina_128.jpg","msveet_128.jpg","mtolokonnikov_128.jpg","mufaddal_mw_128.jpg","mugukamil_128.jpg","muridrahhal_128.jpg","muringa_128.jpg","murrayswift_128.jpg","mutlu82_128.jpg","mutu_krish_128.jpg","mvdheuvel_128.jpg","mwarkentin_128.jpg","myastro_128.jpg","mylesb_128.jpg","mymyboy_128.jpg","n1ght_coder_128.jpg","n3dmax_128.jpg","n_tassone_128.jpg","nacho_128.jpg","naitanamoreno_128.jpg","namankreative_128.jpg","nandini_m_128.jpg","nasirwd_128.jpg","nastya_mane_128.jpg","nateschulte_128.jpg","nathalie_fs_128.jpg","naupintos_128.jpg","nbirckel_128.jpg","nckjrvs_128.jpg","necodymiconer_128.jpg","nehfy_128.jpg","nellleo_128.jpg","nelshd_128.jpg","nelsonjoyce_128.jpg","nemanjaivanovic_128.jpg","nepdud_128.jpg","nerdgr8_128.jpg","nerrsoft_128.jpg","nessoila_128.jpg","netonet_il_128.jpg","newbrushes_128.jpg","nfedoroff_128.jpg","nickfratter_128.jpg","nicklacke_128.jpg","nicolai_larsen_128.jpg","nicolasfolliot_128.jpg","nicoleglynn_128.jpg","nicollerich_128.jpg","nilshelmersson_128.jpg","nilshoenson_128.jpg","ninjad3m0_128.jpg","nitinhayaran_128.jpg","nomidesigns_128.jpg","normanbox_128.jpg","notbadart_128.jpg","noufalibrahim_128.jpg","noxdzine_128.jpg","nsamoylov_128.jpg","ntfblog_128.jpg","nutzumi_128.jpg","nvkznemo_128.jpg","nwdsha_128.jpg","nyancecom_128.jpg","oaktreemedia_128.jpg","okandungel_128.jpg","okansurreel_128.jpg","okcoker_128.jpg","oksanafrewer_128.jpg","okseanjay_128.jpg","oktayelipek_128.jpg","olaolusoga_128.jpg","olgary_128.jpg","omnizya_128.jpg","ooomz_128.jpg","operatino_128.jpg","opnsrce_128.jpg","orkuncaylar_128.jpg","oscarowusu_128.jpg","oskamaya_128.jpg","oskarlevinson_128.jpg","osmanince_128.jpg","osmond_128.jpg","ostirbu_128.jpg","osvaldas_128.jpg","otozk_128.jpg","ovall_128.jpg","overcloacked_128.jpg","overra_128.jpg","panchajanyag_128.jpg","panghal0_128.jpg","patrickcoombe_128.jpg","paulfarino_128.jpg","pcridesagain_128.jpg","peachananr_128.jpg","pechkinator_128.jpg","peejfancher_128.jpg","pehamondello_128.jpg","perfectflow_128.jpg","perretmagali_128.jpg","petar_prog_128.jpg","petebernardo_128.jpg","peter576_128.jpg","peterlandt_128.jpg","petrangr_128.jpg","phillapier_128.jpg","picard102_128.jpg","pierre_nel_128.jpg","pierrestoffe_128.jpg","pifagor_128.jpg","pixage_128.jpg","plasticine_128.jpg","plbabin_128.jpg","pmeissner_128.jpg","polarity_128.jpg","ponchomendivil_128.jpg","poormini_128.jpg","popey_128.jpg","posterjob_128.jpg","praveen_vijaya_128.jpg","prheemo_128.jpg","primozcigler_128.jpg","prinzadi_128.jpg","privetwagner_128.jpg","prrstn_128.jpg","psaikali_128.jpg","psdesignuk_128.jpg","puzik_128.jpg","pyronite_128.jpg","quailandquasar_128.jpg","r_garcia_128.jpg","r_oy_128.jpg","rachelreveley_128.jpg","rahmeen_128.jpg","ralph_lam_128.jpg","ramanathan_pdy_128.jpg","randomlies_128.jpg","rangafangs_128.jpg","raphaelnikson_128.jpg","raquelwilson_128.jpg","ratbus_128.jpg","rawdiggie_128.jpg","rdbannon_128.jpg","rdsaunders_128.jpg","reabo101_128.jpg","reetajayendra_128.jpg","rehatkathuria_128.jpg","reideiredale_128.jpg","renbyrd_128.jpg","rez___a_128.jpg","ricburton_128.jpg","richardgarretts_128.jpg","richwild_128.jpg","rickdt_128.jpg","rickyyean_128.jpg","rikas_128.jpg","ripplemdk_128.jpg","rmlewisuk_128.jpg","rob_thomas10_128.jpg","robbschiller_128.jpg","robergd_128.jpg","robinclediere_128.jpg","robinlayfield_128.jpg","robturlinckx_128.jpg","rodnylobos_128.jpg","rohixx_128.jpg","romanbulah_128.jpg","roxanejammet_128.jpg","roybarberuk_128.jpg","rpatey_128.jpg","rpeezy_128.jpg","rtgibbons_128.jpg","rtyukmaev_128.jpg","rude_128.jpg","ruehldesign_128.jpg","runningskull_128.jpg","russell_baylis_128.jpg","russoedu_128.jpg","ruzinav_128.jpg","rweve_128.jpg","ryandownie_128.jpg","ryanjohnson_me_128.jpg","ryankirkman_128.jpg","ryanmclaughlin_128.jpg","ryhanhassan_128.jpg","ryuchi311_128.jpg","s4f1_128.jpg","saarabpreet_128.jpg","sachacorazzi_128.jpg","sachingawas_128.jpg","safrankov_128.jpg","sainraja_128.jpg","salimianoff_128.jpg","salleedesign_128.jpg","salvafc_128.jpg","samgrover_128.jpg","samihah_128.jpg","samscouto_128.jpg","samuelkraft_128.jpg","sandywoodruff_128.jpg","sangdth_128.jpg","santi_urso_128.jpg","saschadroste_128.jpg","saschamt_128.jpg","sasha_shestakov_128.jpg","saulihirvi_128.jpg","sawalazar_128.jpg","sawrb_128.jpg","sbtransparent_128.jpg","scips_128.jpg","scott_riley_128.jpg","scottfeltham_128.jpg","scottgallant_128.jpg","scottiedude_128.jpg","scottkclark_128.jpg","scrapdnb_128.jpg","sdidonato_128.jpg","sebashton_128.jpg","sementiy_128.jpg","serefka_128.jpg","sergeyalmone_128.jpg","sergeysafonov_128.jpg","sethlouey_128.jpg","seyedhossein1_128.jpg","sgaurav_baghel_128.jpg","shadeed9_128.jpg","shalt0ni_128.jpg","shaneIxD_128.jpg","shanehudson_128.jpg","sharvin_128.jpg","shesgared_128.jpg","shinze_128.jpg","shoaib253_128.jpg","shojberg_128.jpg","shvelo96_128.jpg","silv3rgvn_128.jpg","silvanmuhlemann_128.jpg","simobenso_128.jpg","sindresorhus_128.jpg","sircalebgrove_128.jpg","skkirilov_128.jpg","slowspock_128.jpg","smaczny_128.jpg","smalonso_128.jpg","smenov_128.jpg","snowshade_128.jpg","snowwrite_128.jpg","sokaniwaal_128.jpg","solid_color_128.jpg","souperphly_128.jpg","souuf_128.jpg","sovesove_128.jpg","soyjavi_128.jpg","spacewood__128.jpg","spbroma_128.jpg","spedwig_128.jpg","sprayaga_128.jpg","sreejithexp_128.jpg","ssbb_me_128.jpg","ssiskind_128.jpg","sta1ex_128.jpg","stalewine_128.jpg","stan_128.jpg","stayuber_128.jpg","stefanotirloni_128.jpg","stefanozoffoli_128.jpg","stefooo_128.jpg","stefvdham_128.jpg","stephcoue_128.jpg","sterlingrules_128.jpg","stevedesigner_128.jpg","steynviljoen_128.jpg","strikewan_128.jpg","stushona_128.jpg","sulaqo_128.jpg","sunlandictwin_128.jpg","sunshinedgirl_128.jpg","superoutman_128.jpg","supervova_128.jpg","supjoey_128.jpg","suprb_128.jpg","sur4dye_128.jpg","surgeonist_128.jpg","suribbles_128.jpg","svenlen_128.jpg","swaplord_128.jpg","sweetdelisa_128.jpg","switmer777_128.jpg","swooshycueb_128.jpg","sydlawrence_128.jpg","syropian_128.jpg","tanveerrao_128.jpg","taybenlor_128.jpg","taylorling_128.jpg","tbakdesigns_128.jpg","teddyzetterlund_128.jpg","teeragit_128.jpg","tereshenkov_128.jpg","terpimost_128.jpg","terrorpixel_128.jpg","terryxlife_128.jpg","teylorfeliz_128.jpg","tgerken_128.jpg","tgormtx_128.jpg","thaisselenator__128.jpg","thaodang17_128.jpg","thatonetommy_128.jpg","the_purplebunny_128.jpg","the_winslet_128.jpg","thedamianhdez_128.jpg","thedjpetersen_128.jpg","thehacker_128.jpg","thekevinjones_128.jpg","themadray_128.jpg","themikenagle_128.jpg","themrdave_128.jpg","theonlyzeke_128.jpg","therealmarvin_128.jpg","thewillbeard_128.jpg","thiagovernetti_128.jpg","thibaut_re_128.jpg","thierrykoblentz_128.jpg","thierrymeier__128.jpg","thimo_cz_128.jpg","thinkleft_128.jpg","thomasgeisen_128.jpg","thomasschrijer_128.jpg","timgthomas_128.jpg","timmillwood_128.jpg","timothycd_128.jpg","timpetricola_128.jpg","tjrus_128.jpg","to_soham_128.jpg","tobysaxon_128.jpg","toddrew_128.jpg","tom_even_128.jpg","tomas_janousek_128.jpg","tonymillion_128.jpg","traneblow_128.jpg","travis_arnold_128.jpg","travishines_128.jpg","tristanlegros_128.jpg","trubeatto_128.jpg","trueblood_33_128.jpg","tumski_128.jpg","tur8le_128.jpg","turkutuuli_128.jpg","tweetubhai_128.jpg","twittypork_128.jpg","txcx_128.jpg","uberschizo_128.jpg","ultragex_128.jpg","umurgdk_128.jpg","unterdreht_128.jpg","urrutimeoli_128.jpg","uxalex_128.jpg","uxpiper_128.jpg","uxward_128.jpg","vanchesz_128.jpg","vaughanmoffitt_128.jpg","vc27_128.jpg","vicivadeline_128.jpg","victorDubugras_128.jpg","victor_haydin_128.jpg","victordeanda_128.jpg","victorerixon_128.jpg","victorquinn_128.jpg","victorstuber_128.jpg","vigobronx_128.jpg","vijaykarthik_128.jpg","vikashpathak18_128.jpg","vikasvinfotech_128.jpg","vimarethomas_128.jpg","vinciarts_128.jpg","vitor376_128.jpg","vitorleal_128.jpg","vivekprvr_128.jpg","vj_demien_128.jpg","vladarbatov_128.jpg","vladimirdevic_128.jpg","vladyn_128.jpg","vlajki_128.jpg","vm_f_128.jpg","vocino_128.jpg","vonachoo_128.jpg","vovkasolovev_128.jpg","vytautas_a_128.jpg","waghner_128.jpg","wake_gs_128.jpg","we_social_128.jpg","wearesavas_128.jpg","weavermedia_128.jpg","webtanya_128.jpg","weglov_128.jpg","wegotvices_128.jpg","wesleytrankin_128.jpg","wikiziner_128.jpg","wiljanslofstra_128.jpg","wim1k_128.jpg","wintopia_128.jpg","woodsman001_128.jpg","woodydotmx_128.jpg","wtrsld_128.jpg","xadhix_128.jpg","xalionmalik_128.jpg","xamorep_128.jpg","xiel_128.jpg","xilantra_128.jpg","xravil_128.jpg","xripunov_128.jpg","xtopherpaul_128.jpg","y2graphic_128.jpg","yalozhkin_128.jpg","yassiryahya_128.jpg","yayteejay_128.jpg","yecidsm_128.jpg","yehudab_128.jpg","yesmeck_128.jpg","yigitpinarbasi_128.jpg","zackeeler_128.jpg","zaki3d_128.jpg","zauerkraut_128.jpg","zforrester_128.jpg","zvchkelly_128.jpg"],Ns=Ol;var Cl={email:xs,domain:Es,avatar:Ns},js=Cl;var Rl={female:["Mary","Patricia","Linda","Barbara","Elizabeth","Jennifer","Maria","Susan","Margaret","Dorothy","Lisa","Nancy","Karen","Betty","Helen","Sandra","Donna","Carol","Ruth","Sharon","Michelle","Laura","Sarah","Kimberly","Deborah","Jessica","Shirley","Cynthia","Angela","Melissa","Brenda","Amy","Anna","Rebecca","Virginia","Kathleen","Pamela","Martha","Debra","Amanda","Stephanie","Carolyn","Christine","Marie","Janet","Catherine","Frances","Ann","Joyce","Diane","Alice","Julie","Heather","Teresa","Doris","Gloria","Evelyn","Jean","Cheryl","Mildred","Katherine","Joan","Ashley","Judith","Rose","Janice","Kelly","Nicole","Judy","Christina","Kathy","Theresa","Beverly","Denise","Tammy","Irene","Jane","Lori","Rachel","Marilyn","Andrea","Kathryn","Louise","Sara","Anne","Jacqueline","Wanda","Bonnie","Julia","Ruby","Lois","Tina","Phyllis","Norma","Paula","Diana","Annie","Lillian","Emily","Robin","Peggy","Crystal","Gladys","Rita","Dawn","Connie","Florence","Tracy","Edna","Tiffany","Carmen","Rosa","Cindy","Grace","Wendy","Victoria","Edith","Kim","Sherry","Sylvia","Josephine","Thelma","Shannon","Sheila","Ethel","Ellen","Elaine","Marjorie","Carrie","Charlotte","Monica","Esther","Pauline","Emma","Juanita","Anita","Rhonda","Hazel","Amber","Eva","Debbie","April","Leslie","Clara","Lucille","Jamie","Joanne","Eleanor","Valerie","Danielle","Megan","Alicia","Suzanne","Michele","Gail","Bertha","Darlene","Veronica","Jill","Erin","Geraldine","Lauren","Cathy","Joann","Lorraine","Lynn","Sally","Regina","Erica","Beatrice","Dolores","Bernice","Audrey","Yvonne","Annette","June","Samantha","Marion","Dana","Stacy","Ana","Renee","Ida","Vivian","Roberta","Holly","Brittany","Melanie","Loretta","Yolanda","Jeanette","Laurie","Katie","Kristen","Vanessa","Alma","Sue","Elsie","Beth","Jeanne","Vicki","Carla","Tara","Rosemary","Eileen","Terri","Gertrude","Lucy","Tonya","Ella","Stacey","Wilma","Gina","Kristin","Jessie","Natalie","Agnes","Vera","Willie","Charlene","Bessie","Delores","Melinda","Pearl","Arlene","Maureen","Colleen","Allison","Tamara","Joy","Georgia","Constance","Lillie","Claudia","Jackie","Marcia","Tanya","Nellie","Minnie","Marlene","Heidi","Glenda","Lydia","Viola","Courtney","Marian","Stella","Caroline","Dora","Jo","Vickie","Mattie","Terry","Maxine","Irma","Mabel","Marsha","Myrtle","Lena","Christy","Deanna","Patsy","Hilda","Gwendolyn","Jennie","Nora","Margie","Nina","Cassandra","Leah","Penny","Kay","Priscilla","Naomi","Carole","Brandy","Olga","Billie","Dianne","Tracey","Leona","Jenny","Felicia","Sonia","Miriam","Velma","Becky","Bobbie","Violet","Kristina","Toni","Misty","Mae","Shelly","Daisy","Ramona","Sherri","Erika","Katrina","Claire","Lindsey","Lindsay","Geneva","Guadalupe","Belinda","Margarita","Sheryl","Cora","Faye","Ada","Natasha","Sabrina","Isabel","Marguerite","Hattie","Harriet","Molly","Cecilia","Kristi","Brandi","Blanche","Sandy","Rosie","Joanna","Iris","Eunice","Angie","Inez","Lynda","Madeline","Amelia","Alberta","Genevieve","Monique","Jodi","Janie","Maggie","Kayla","Sonya","Jan","Lee","Kristine","Candace","Fannie","Maryann","Opal","Alison","Yvette","Melody","Luz","Susie","Olivia","Flora","Shelley","Kristy","Mamie","Lula","Lola","Verna","Beulah","Antoinette","Candice","Juana","Jeannette","Pam","Kelli","Hannah","Whitney","Bridget","Karla","Celia","Latoya","Patty","Shelia","Gayle","Della","Vicky","Lynne","Sheri","Marianne","Kara","Jacquelyn","Erma","Blanca","Myra","Leticia","Pat","Krista","Roxanne","Angelica","Johnnie","Robyn","Francis","Adrienne","Rosalie","Alexandra","Brooke","Bethany","Sadie","Bernadette","Traci","Jody","Kendra","Jasmine","Nichole","Rachael","Chelsea","Mable","Ernestine","Muriel","Marcella","Elena","Krystal","Angelina","Nadine","Kari","Estelle","Dianna","Paulette","Lora","Mona","Doreen","Rosemarie","Angel","Desiree","Antonia","Hope","Ginger","Janis","Betsy","Christie","Freda","Mercedes","Meredith","Lynette","Teri","Cristina","Eula","Leigh","Meghan","Sophia","Eloise","Rochelle","Gretchen","Cecelia","Raquel","Henrietta","Alyssa","Jana","Kelley","Gwen","Kerry","Jenna","Tricia","Laverne","Olive","Alexis","Tasha","Silvia","Elvira","Casey","Delia","Sophie","Kate","Patti","Lorena","Kellie","Sonja","Lila","Lana","Darla","May","Mindy","Essie","Mandy","Lorene","Elsa","Josefina","Jeannie","Miranda","Dixie","Lucia","Marta","Faith","Lela","Johanna","Shari","Camille","Tami","Shawna","Elisa","Ebony","Melba","Ora","Nettie","Tabitha","Ollie","Jaime","Winifred","Kristie"],male:["James","John","Robert","Michael","William","David","Richard","Charles","Joseph","Thomas","Christopher","Daniel","Paul","Mark","Donald","George","Kenneth","Steven","Edward","Brian","Ronald","Anthony","Kevin","Jason","Matthew","Gary","Timothy","Jose","Larry","Jeffrey","Frank","Scott","Eric","Stephen","Andrew","Raymond","Gregory","Joshua","Jerry","Dennis","Walter","Patrick","Peter","Harold","Douglas","Henry","Carl","Arthur","Ryan","Roger","Joe","Juan","Jack","Albert","Jonathan","Justin","Terry","Gerald","Keith","Samuel","Willie","Ralph","Lawrence","Nicholas","Roy","Benjamin","Bruce","Brandon","Adam","Harry","Fred","Wayne","Billy","Steve","Louis","Jeremy","Aaron","Randy","Howard","Eugene","Carlos","Russell","Bobby","Victor","Martin","Ernest","Phillip","Todd","Jesse","Craig","Alan","Shawn","Clarence","Sean","Philip","Chris","Johnny","Earl","Jimmy","Antonio","Danny","Bryan","Tony","Luis","Mike","Stanley","Leonard","Nathan","Dale","Manuel","Rodney","Curtis","Norman","Allen","Marvin","Vincent","Glenn","Jeffery","Travis","Jeff","Chad","Jacob","Lee","Melvin","Alfred","Kyle","Francis","Bradley","Jesus","Herbert","Frederick","Ray","Joel","Edwin","Don","Eddie","Ricky","Troy","Randall","Barry","Alexander","Bernard","Mario","Leroy","Francisco","Marcus","Micheal","Theodore","Clifford","Miguel","Oscar","Jay","Jim","Tom","Calvin","Alex","Jon","Ronnie","Bill","Lloyd","Tommy","Leon","Derek","Warren","Darrell","Jerome","Floyd","Leo","Alvin","Tim","Wesley","Gordon","Dean","Greg","Jorge","Dustin","Pedro","Derrick","Dan","Lewis","Zachary","Corey","Herman","Maurice","Vernon","Roberto","Clyde","Glen","Hector","Shane","Ricardo","Sam","Rick","Lester","Brent","Ramon","Charlie","Tyler","Gilbert","Gene","Marc","Reginald","Ruben","Brett","Angel","Nathaniel","Rafael","Leslie","Edgar","Milton","Raul","Ben","Chester","Cecil","Duane","Franklin","Andre","Elmer","Brad","Gabriel","Ron","Mitchell","Roland","Arnold","Harvey","Jared","Adrian","Karl","Cory","Claude","Erik","Darryl","Jamie","Neil","Jessie","Christian","Javier","Fernando","Clinton","Ted","Mathew","Tyrone","Darren","Lonnie","Lance","Cody","Julio","Kelly","Kurt","Allan","Nelson","Guy","Clayton","Hugh","Max","Dwayne","Dwight","Armando","Felix","Jimmie","Everett","Jordan","Ian","Wallace","Ken","Bob","Jaime","Casey","Alfredo","Alberto","Dave","Ivan","Johnnie","Sidney","Byron","Julian","Isaac","Morris","Clifton","Willard","Daryl","Ross","Virgil","Andy","Marshall","Salvador","Perry","Kirk","Sergio","Marion","Tracy","Seth","Kent","Terrance","Rene","Eduardo","Terrence","Enrique","Freddie","Wade","Austin","Stuart","Fredrick","Arturo","Alejandro","Jackie","Joey","Nick","Luther","Wendell","Jeremiah","Evan","Julius","Dana","Donnie","Otis","Shannon","Trevor","Oliver","Luke","Homer","Gerard","Doug","Kenny","Hubert","Angelo","Shaun","Lyle","Matt","Lynn","Alfonso","Orlando","Rex","Carlton","Ernesto","Cameron","Neal","Pablo","Lorenzo","Omar","Wilbur","Blake","Grant","Horace","Roderick","Kerry","Abraham","Willis","Rickey","Jean","Ira","Andres","Cesar","Johnathan","Malcolm","Rudolph","Damon","Kelvin","Rudy","Preston","Alton","Archie","Marco","Wm","Pete","Randolph","Garry","Geoffrey","Jonathon","Felipe","Bennie","Gerardo","Ed","Dominic","Robin","Loren","Delbert","Colin","Guillermo","Earnest","Lucas","Benny","Noel","Spencer","Rodolfo","Myron","Edmund","Garrett","Salvatore","Cedric","Lowell","Gregg","Sherman","Wilson","Devin","Sylvester","Kim","Roosevelt","Israel","Jermaine","Forrest","Wilbert","Leland","Simon","Guadalupe","Clark","Irving","Carroll","Bryant","Owen","Rufus","Woodrow","Sammy","Kristopher","Mack","Levi","Marcos","Gustavo","Jake","Lionel","Marty","Taylor","Ellis","Dallas","Gilberto","Clint","Nicolas","Laurence","Ismael","Orville","Drew","Jody","Ervin","Dewey","Al","Wilfred","Josh","Hugo","Ignacio","Caleb","Tomas","Sheldon","Erick","Frankie","Stewart","Doyle","Darrel","Rogelio","Terence","Santiago","Alonzo","Elias","Bert","Elbert","Ramiro","Conrad","Pat","Noah","Grady","Phil","Cornelius","Lamar","Rolando","Clay","Percy","Dexter","Bradford","Merle","Darin","Amos","Terrell","Moses","Irvin","Saul","Roman","Darnell","Randal","Tommie","Timmy","Darrin","Winston","Brendan","Toby","Van","Abel","Dominick","Boyd","Courtney","Jan","Emilio","Elijah","Cary","Domingo","Santos","Aubrey","Emmett","Marlon","Emanuel","Jerald","Edmond"]},Is=Rl;var ga=["Abbott","Abernathy","Abshire","Adams","Altenwerth","Anderson","Ankunding","Armstrong","Auer","Aufderhar","Bahringer","Bailey","Balistreri","Barrows","Bartell","Bartoletti","Barton","Bashirian","Batz","Bauch","Baumbach","Bayer","Beahan","Beatty","Bechtelar","Becker","Bednar","Beer","Beier","Berge","Bergnaum","Bergstrom","Bernhard","Bernier","Bins","Blanda","Blick","Block","Bode","Boehm","Bogan","Bogisich","Borer","Bosco","Botsford","Boyer","Boyle","Bradtke","Brakus","Braun","Breitenberg","Brekke","Brown","Bruen","Buckridge","Carroll","Carter","Cartwright","Casper","Cassin","Champlin","Christiansen","Cole","Collier","Collins","Conn","Connelly","Conroy","Considine","Corkery","Cormier","Corwin","Cremin","Crist","Crona","Cronin","Crooks","Cruickshank","Cummerata","Cummings","Dach","D'Amore","Daniel","Dare","Daugherty","Davis","Deckow","Denesik","Dibbert","Dickens","Dicki","Dickinson","Dietrich","Donnelly","Dooley","Douglas","Doyle","DuBuque","Durgan","Ebert","Effertz","Emard","Emmerich","Erdman","Ernser","Fadel","Fahey","Farrell","Fay","Feeney","Feest","Feil","Ferry","Fisher","Flatley","Frami","Franecki","Friesen","Fritsch","Funk","Gaylord","Gerhold","Gerlach","Gibson","Gislason","Gleason","Gleichner","Glover","Goldner","Goodwin","Gorczany","Gottlieb","Goyette","Grady","Graham","Grant","Green","Greenfelder","Greenholt","Grimes","Gulgowski","Gusikowski","Gutkowski","Gutmann","Haag","Hackett","Hagenes","Hahn","Haley","Halvorson","Hamill","Hammes","Hand","Hane","Hansen","Harber","Harris","Hartmann","Harvey","Hauck","Hayes","Heaney","Heathcote","Hegmann","Heidenreich","Heller","Herman","Hermann","Hermiston","Herzog","Hessel","Hettinger","Hickle","Hilll","Hills","Hilpert","Hintz","Hirthe","Hodkiewicz","Hoeger","Homenick","Hoppe","Howe","Howell","Hudson","Huel","Huels","Hyatt","Jacobi","Jacobs","Jacobson","Jakubowski","Jaskolski","Jast","Jenkins","Jerde","Johns","Johnson","Johnston","Jones","Kassulke","Kautzer","Keebler","Keeling","Kemmer","Kerluke","Kertzmann","Kessler","Kiehn","Kihn","Kilback","King","Kirlin","Klein","Kling","Klocko","Koch","Koelpin","Koepp","Kohler","Konopelski","Koss","Kovacek","Kozey","Krajcik","Kreiger","Kris","Kshlerin","Kub","Kuhic","Kuhlman","Kuhn","Kulas","Kunde","Kunze","Kuphal","Kutch","Kuvalis","Labadie","Lakin","Lang","Langosh","Langworth","Larkin","Larson","Leannon","Lebsack","Ledner","Leffler","Legros","Lehner","Lemke","Lesch","Leuschke","Lind","Lindgren","Littel","Little","Lockman","Lowe","Lubowitz","Lueilwitz","Luettgen","Lynch","Macejkovic","MacGyver","Maggio","Mann","Mante","Marks","Marquardt","Marvin","Mayer","Mayert","McClure","McCullough","McDermott","McGlynn","McKenzie","McLaughlin","Medhurst","Mertz","Metz","Miller","Mills","Mitchell","Moen","Mohr","Monahan","Moore","Morar","Morissette","Mosciski","Mraz","Mueller","Muller","Murazik","Murphy","Murray","Nader","Nicolas","Nienow","Nikolaus","Nitzsche","Nolan","Oberbrunner","O'Connell","O'Conner","O'Hara","O'Keefe","O'Kon","Okuneva","Olson","Ondricka","O'Reilly","Orn","Ortiz","Osinski","Pacocha","Padberg","Pagac","Parisian","Parker","Paucek","Pfannerstill","Pfeffer","Pollich","Pouros","Powlowski","Predovic","Price","Prohaska","Prosacco","Purdy","Quigley","Quitzon","Rath","Ratke","Rau","Raynor","Reichel","Reichert","Reilly","Reinger","Rempel","Renner","Reynolds","Rice","Rippin","Ritchie","Robel","Roberts","Rodriguez","Rogahn","Rohan","Rolfson","Romaguera","Roob","Rosenbaum","Rowe","Ruecker","Runolfsdottir","Runolfsson","Runte","Russel","Rutherford","Ryan","Sanford","Satterfield","Sauer","Sawayn","Schaden","Schaefer","Schamberger","Schiller","Schimmel","Schinner","Schmeler","Schmidt","Schmitt","Schneider","Schoen","Schowalter","Schroeder","Schulist","Schultz","Schumm","Schuppe","Schuster","Senger","Shanahan","Shields","Simonis","Sipes","Skiles","Smith","Smitham","Spencer","Spinka","Sporer","Stamm","Stanton","Stark","Stehr","Steuber","Stiedemann","Stokes","Stoltenberg","Stracke","Streich","Stroman","Strosin","Swaniawski","Swift","Terry","Thiel","Thompson","Tillman","Torp","Torphy","Towne","Toy","Trantow","Tremblay","Treutel","Tromp","Turcotte","Turner","Ullrich","Upton","Vandervort","Veum","Volkman","Von","VonRueden","Waelchi","Walker","Walsh","Walter","Ward","Waters","Watsica","Weber","Wehner","Weimann","Weissnat","Welch","West","White","Wiegand","Wilderman","Wilkinson","Will","Williamson","Willms","Windler","Wintheiser","Wisoky","Wisozk","Witting","Wiza","Wolf","Wolff","Wuckert","Wunsch","Wyman","Yost","Yundt","Zboncak","Zemlak","Ziemann","Zieme","Zulauf"],Pl={general:ga,female:ga,male:ga},$s=Pl;var Dl={binary:["Female","Male"],pool:["Asexual","Female to male trans man","Female to male transgender man","Female to male transsexual man","F2M","Gender neutral","Hermaphrodite","Intersex man","Intersex person","Intersex woman","Male to female trans woman","Male to female transgender woman","Male to female transsexual woman","Man","M2F","Polygender","T* man","T* woman","Two* person","Two-spirit person","Woman","Agender","Androgyne","Androgynes","Androgynous","Bigender","Cis","Cis Female","Cis Male","Cis Man","Cis Woman","Cisgender","Cisgender Female","Cisgender Male","Cisgender Man","Cisgender Woman","Female to Male","FTM","Gender Fluid","Gender Nonconforming","Gender Questioning","Gender Variant","Genderqueer","Intersex","Male to Female","MTF","Neither","Neutrois","Non-binary","Other","Pangender","Trans","Trans Female","Trans Male","Trans Man","Trans Person","Trans*Female","Trans*Male","Trans*Man","Trans*Person","Trans*Woman","Transexual","Transexual Female","Transexual Male","Transexual Man","Transexual Person","Transexual Woman","Transgender Female","Transgender Person","Transmasculine","Two-spirit"]},Ts=Dl;var Ul={descriptor:["Lead","Senior","Direct","Corporate","Dynamic","Future","Product","National","Regional","District","Central","Global","Customer","Investor","Dynamic","International","Legacy","Forward","Internal","Human","Chief","Principal"],level:["Solutions","Program","Brand","Security","Research","Marketing","Directives","Implementation","Integration","Functionality","Response","Paradigm","Tactics","Identity","Markets","Group","Division","Applications","Optimization","Operations","Infrastructure","Intranet","Communications","Web","Branding","Quality","Assurance","Mobility","Accounts","Data","Creative","Configuration","Accountability","Interactions","Factors","Usability","Metrics"],job:["Supervisor","Associate","Executive","Liaison","Officer","Manager","Engineer","Specialist","Director","Coordinator","Administrator","Architect","Analyst","Designer","Planner","Orchestrator","Technician","Developer","Producer","Consultant","Assistant","Facilitator","Agent","Representative","Strategist"]},Os=Ul;var ya=["Jr.","Sr.","I","II","III","IV","V","MD","DDS","PhD","DVM"],Ll={gender:Ts,firstName:Is,lastName:$s,title:Os,suffix:{general:ya,female:ya,male:ya},prefix:{general:["Mr.","Mrs.","Ms.","Miss","Dr."],female:["Mrs.","Ms.","Miss"],male:["Mr.","Dr."]},templates:["#{prefix} #{first_name} #{last_name}","#{first_name} #{last_name} #{suffix}","#{first_name} #{last_name}","#{first_name} #{last_name}","#{male_first_name} #{last_name}","#{female_first_name} #{last_name}"]},Cs=Ll;var Rs=["abandoned","able","absolute","adorable","adventurous","academic","acceptable","acclaimed","accomplished","accurate","aching","acidic","acrobatic","active","actual","adept","admirable","admired","adolescent","adorable","adored","advanced","afraid","affectionate","aged","aggravating","aggressive","agile","agitated","agonizing","agreeable","ajar","alarmed","alarming","alert","alienated","alive","all","altruistic","amazing","ambitious","ample","amused","amusing","anchored","ancient","angelic","angry","anguished","animated","annual","another","antique","anxious","any","apprehensive","appropriate","apt","arctic","arid","aromatic","artistic","ashamed","assured","astonishing","athletic","attached","attentive","attractive","austere","authentic","authorized","automatic","avaricious","average","aware","awesome","awful","awkward","babyish","bad","back","baggy","bare","barren","basic","beautiful","belated","beloved","beneficial","better","best","bewitched","big","big-hearted","biodegradable","bite-sized","bitter","black","black-and-white","bland","blank","blaring","bleak","blind","blissful","blond","blue","blushing","bogus","boiling","bold","bony","boring","bossy","both","bouncy","bountiful","bowed","brave","breakable","brief","bright","brilliant","brisk","broken","bronze","brown","bruised","bubbly","bulky","bumpy","buoyant","burdensome","burly","bustling","busy","buttery","buzzing","calculating","calm","candid","canine","capital","carefree","careful","careless","caring","cautious","cavernous","celebrated","charming","cheap","cheerful","cheery","chief","chilly","chubby","circular","classic","clean","clear","clear-cut","clever","close","closed","cloudy","clueless","clumsy","cluttered","coarse","cold","colorful","colorless","colossal","comfortable","common","compassionate","competent","complete","complex","complicated","composed","concerned","concrete","confused","conscious","considerate","constant","content","conventional","cooked","cool","cooperative","coordinated","corny","corrupt","costly","courageous","courteous","crafty","crazy","creamy","creative","creepy","criminal","crisp","critical","crooked","crowded","cruel","crushing","cuddly","cultivated","cultured","cumbersome","curly","curvy","cute","cylindrical","damaged","damp","dangerous","dapper","daring","darling","dark","dazzling","dead","deadly","deafening","dear","dearest","decent","decimal","decisive","deep","defenseless","defensive","defiant","deficient","definite","definitive","delayed","delectable","delicious","delightful","delirious","demanding","dense","dental","dependable","dependent","descriptive","deserted","detailed","determined","devoted","different","difficult","digital","diligent","dim","dimpled","dimwitted","direct","disastrous","discrete","disfigured","disgusting","disloyal","dismal","distant","downright","dreary","dirty","disguised","dishonest","dismal","distant","distinct","distorted","dizzy","dopey","doting","double","downright","drab","drafty","dramatic","dreary","droopy","dry","dual","dull","dutiful","each","eager","earnest","early","easy","easy-going","ecstatic","edible","educated","elaborate","elastic","elated","elderly","electric","elegant","elementary","elliptical","embarrassed","embellished","eminent","emotional","empty","enchanted","enchanting","energetic","enlightened","enormous","enraged","entire","envious","equal","equatorial","essential","esteemed","ethical","euphoric","even","evergreen","everlasting","every","evil","exalted","excellent","exemplary","exhausted","excitable","excited","exciting","exotic","expensive","experienced","expert","extraneous","extroverted","extra-large","extra-small","fabulous","failing","faint","fair","faithful","fake","false","familiar","famous","fancy","fantastic","far","faraway","far-flung","far-off","fast","fat","fatal","fatherly","favorable","favorite","fearful","fearless","feisty","feline","female","feminine","few","fickle","filthy","fine","finished","firm","first","firsthand","fitting","fixed","flaky","flamboyant","flashy","flat","flawed","flawless","flickering","flimsy","flippant","flowery","fluffy","fluid","flustered","focused","fond","foolhardy","foolish","forceful","forked","formal","forsaken","forthright","fortunate","fragrant","frail","frank","frayed","free","french","fresh","frequent","friendly","frightened","frightening","frigid","frilly","frizzy","frivolous","front","frosty","frozen","frugal","fruitful","full","fumbling","functional","funny","fussy","fuzzy","gargantuan","gaseous","general","generous","gentle","genuine","giant","giddy","gigantic","gifted","giving","glamorous","glaring","glass","gleaming","gleeful","glistening","glittering","gloomy","glorious","glossy","glum","golden","good","good-natured","gorgeous","graceful","gracious","grand","grandiose","granular","grateful","grave","gray","great","greedy","green","gregarious","grim","grimy","gripping","grizzled","gross","grotesque","grouchy","grounded","growing","growling","grown","grubby","gruesome","grumpy","guilty","gullible","gummy","hairy","half","handmade","handsome","handy","happy","happy-go-lucky","hard","hard-to-find","harmful","harmless","harmonious","harsh","hasty","hateful","haunting","healthy","heartfelt","hearty","heavenly","heavy","hefty","helpful","helpless","hidden","hideous","high","high-level","hilarious","hoarse","hollow","homely","honest","honorable","honored","hopeful","horrible","hospitable","hot","huge","humble","humiliating","humming","humongous","hungry","hurtful","husky","icky","icy","ideal","idealistic","identical","idle","idiotic","idolized","ignorant","ill","illegal","ill-fated","ill-informed","illiterate","illustrious","imaginary","imaginative","immaculate","immaterial","immediate","immense","impassioned","impeccable","impartial","imperfect","imperturbable","impish","impolite","important","impossible","impractical","impressionable","impressive","improbable","impure","inborn","incomparable","incompatible","incomplete","inconsequential","incredible","indelible","inexperienced","indolent","infamous","infantile","infatuated","inferior","infinite","informal","innocent","insecure","insidious","insignificant","insistent","instructive","insubstantial","intelligent","intent","intentional","interesting","internal","international","intrepid","ironclad","irresponsible","irritating","itchy","jaded","jagged","jam-packed","jaunty","jealous","jittery","joint","jolly","jovial","joyful","joyous","jubilant","judicious","juicy","jumbo","junior","jumpy","juvenile","kaleidoscopic","keen","key","kind","kindhearted","kindly","klutzy","knobby","knotty","knowledgeable","knowing","known","kooky","kosher","lame","lanky","large","last","lasting","late","lavish","lawful","lazy","leading","lean","leafy","left","legal","legitimate","light","lighthearted","likable","likely","limited","limp","limping","linear","lined","liquid","little","live","lively","livid","loathsome","lone","lonely","long","long-term","loose","lopsided","lost","loud","lovable","lovely","loving","low","loyal","lucky","lumbering","luminous","lumpy","lustrous","luxurious","mad","made-up","magnificent","majestic","major","male","mammoth","married","marvelous","masculine","massive","mature","meager","mealy","mean","measly","meaty","medical","mediocre","medium","meek","mellow","melodic","memorable","menacing","merry","messy","metallic","mild","milky","mindless","miniature","minor","minty","miserable","miserly","misguided","misty","mixed","modern","modest","moist","monstrous","monthly","monumental","moral","mortified","motherly","motionless","mountainous","muddy","muffled","multicolored","mundane","murky","mushy","musty","muted","mysterious","naive","narrow","nasty","natural","naughty","nautical","near","neat","necessary","needy","negative","neglected","negligible","neighboring","nervous","new","next","nice","nifty","nimble","nippy","nocturnal","noisy","nonstop","normal","notable","noted","noteworthy","novel","noxious","numb","nutritious","nutty","obedient","obese","oblong","oily","oblong","obvious","occasional","odd","oddball","offbeat","offensive","official","old","old-fashioned","only","open","optimal","optimistic","opulent","orange","orderly","organic","ornate","ornery","ordinary","original","other","our","outlying","outgoing","outlandish","outrageous","outstanding","oval","overcooked","overdue","overjoyed","overlooked","palatable","pale","paltry","parallel","parched","partial","passionate","past","pastel","peaceful","peppery","perfect","perfumed","periodic","perky","personal","pertinent","pesky","pessimistic","petty","phony","physical","piercing","pink","pitiful","plain","plaintive","plastic","playful","pleasant","pleased","pleasing","plump","plush","polished","polite","political","pointed","pointless","poised","poor","popular","portly","posh","positive","possible","potable","powerful","powerless","practical","precious","present","prestigious","pretty","precious","previous","pricey","prickly","primary","prime","pristine","private","prize","probable","productive","profitable","profuse","proper","proud","prudent","punctual","pungent","puny","pure","purple","pushy","putrid","puzzled","puzzling","quaint","qualified","quarrelsome","quarterly","queasy","querulous","questionable","quick","quick-witted","quiet","quintessential","quirky","quixotic","quizzical","radiant","ragged","rapid","rare","rash","raw","recent","reckless","rectangular","ready","real","realistic","reasonable","red","reflecting","regal","regular","reliable","relieved","remarkable","remorseful","remote","repentant","required","respectful","responsible","repulsive","revolving","rewarding","rich","rigid","right","ringed","ripe","roasted","robust","rosy","rotating","rotten","rough","round","rowdy","royal","rubbery","rundown","ruddy","rude","runny","rural","rusty","sad","safe","salty","same","sandy","sane","sarcastic","sardonic","satisfied","scaly","scarce","scared","scary","scented","scholarly","scientific","scornful","scratchy","scrawny","second","secondary","second-hand","secret","self-assured","self-reliant","selfish","sentimental","separate","serene","serious","serpentine","several","severe","shabby","shadowy","shady","shallow","shameful","shameless","sharp","shimmering","shiny","shocked","shocking","shoddy","short","short-term","showy","shrill","shy","sick","silent","silky","silly","silver","similar","simple","simplistic","sinful","single","sizzling","skeletal","skinny","sleepy","slight","slim","slimy","slippery","slow","slushy","small","smart","smoggy","smooth","smug","snappy","snarling","sneaky","sniveling","snoopy","sociable","soft","soggy","solid","somber","some","spherical","sophisticated","sore","sorrowful","soulful","soupy","sour","spanish","sparkling","sparse","specific","spectacular","speedy","spicy","spiffy","spirited","spiteful","splendid","spotless","spotted","spry","square","squeaky","squiggly","stable","staid","stained","stale","standard","starchy","stark","starry","steep","sticky","stiff","stimulating","stingy","stormy","straight","strange","steel","strict","strident","striking","striped","strong","studious","stunning","stupendous","stupid","sturdy","stylish","subdued","submissive","substantial","subtle","suburban","sudden","sugary","sunny","super","superb","superficial","superior","supportive","sure-footed","surprised","suspicious","svelte","sweaty","sweet","sweltering","swift","sympathetic","tall","talkative","tame","tan","tangible","tart","tasty","tattered","taut","tedious","teeming","tempting","tender","tense","tepid","terrible","terrific","testy","thankful","that","these","thick","thin","third","thirsty","this","thorough","thorny","those","thoughtful","threadbare","thrifty","thunderous","tidy","tight","timely","tinted","tiny","tired","torn","total","tough","traumatic","treasured","tremendous","tragic","trained","tremendous","triangular","tricky","trifling","trim","trivial","troubled","true","trusting","trustworthy","trusty","truthful","tubby","turbulent","twin","ugly","ultimate","unacceptable","unaware","uncomfortable","uncommon","unconscious","understated","unequaled","uneven","unfinished","unfit","unfolded","unfortunate","unhappy","unhealthy","uniform","unimportant","unique","united","unkempt","unknown","unlawful","unlined","unlucky","unnatural","unpleasant","unrealistic","unripe","unruly","unselfish","unsightly","unsteady","unsung","untidy","untimely","untried","untrue","unused","unusual","unwelcome","unwieldy","unwilling","unwitting","unwritten","upbeat","upright","upset","urban","usable","used","useful","useless","utilized","utter","vacant","vague","vain","valid","valuable","vapid","variable","vast","velvety","venerated","vengeful","verifiable","vibrant","vicious","victorious","vigilant","vigorous","villainous","violet","violent","virtual","virtuous","visible","vital","vivacious","vivid","voluminous","wan","warlike","warm","warmhearted","warped","wary","wasteful","watchful","waterlogged","watery","wavy","wealthy","weak","weary","webbed","wee","weekly","weepy","weighty","weird","welcome","well-documented","well-groomed","well-informed","well-lit","well-made","well-off","well-to-do","well-worn","wet","which","whimsical","whirlwind","whispered","white","whole","whopping","wicked","wide","wide-eyed","wiggly","wild","willing","wilted","winding","windy","winged","wiry","wise","witty","wobbly","woeful","wonderful","wooden","woozy","wordy","worldly","worn","worried","worrisome","worse","worst","worthless","worthwhile","worthy","wrathful","wretched","writhing","wrong","wry","yawning","yearly","yellow","yellowish","young","youthful","yummy","zany","zealous","zesty","zigzag"];var Ps=["abnormally","absentmindedly","accidentally","acidly","actually","adventurously","afterwards","almost","always","angrily","annually","anxiously","arrogantly","awkwardly","badly","bashfully","beautifully","bitterly","bleakly","blindly","blissfully","boastfully","boldly","bravely","briefly","brightly","briskly","broadly","busily","calmly","carefully","carelessly","cautiously","certainly","cheerfully","clearly","cleverly","closely","coaxingly","colorfully","commonly","continually","coolly","correctly","courageously","crossly","cruelly","curiously","daily","daintily","dearly","deceivingly","deeply","defiantly","deliberately","delightfully","diligently","dimly","doubtfully","dreamily","easily","elegantly","energetically","enormously","enthusiastically","equally","especially","even","evenly","eventually","exactly","excitedly","extremely","fairly","faithfully","famously","far","fast","fatally","ferociously","fervently","fiercely","fondly","foolishly","fortunately","frankly","frantically","freely","frenetically","frightfully","fully","furiously","generally","generously","gently","gladly","gleefully","gracefully","gratefully","greatly","greedily","happily","hastily","healthily","heavily","helpfully","helplessly","highly","honestly","hopelessly","hourly","hungrily","immediately","innocently","inquisitively","instantly","intensely","intently","interestingly","inwardly","irritably","jaggedly","jealously","joshingly","jovially","joyfully","joyously","jubilantly","judgementally","justly","keenly","kiddingly","kindheartedly","kindly","kissingly","knavishly","knottily","knowingly","knowledgeably","kookily","lazily","less","lightly","likely","limply","lively","loftily","longingly","loosely","loudly","lovingly","loyally","madly","majestically","meaningfully","mechanically","merrily","miserably","mockingly","monthly","more","mortally","mostly","mysteriously","naturally","nearly","neatly","needily","nervously","never","nicely","noisily","not","obediently","obnoxiously","oddly","offensively","officially","often","only","openly","optimistically","overconfidently","owlishly","painfully","partially","patiently","perfectly","physically","playfully","politely","poorly","positively","potentially","powerfully","promptly","properly","punctually","quaintly","quarrelsomely","queasily","queerly","questionably","questioningly","quicker","quickly","quietly","quirkily","quizzically","rapidly","rarely","readily","really","reassuringly","recklessly","regularly","reluctantly","repeatedly","reproachfully","restfully","righteously","rightfully","rigidly","roughly","rudely","sadly","safely","scarcely","scarily","searchingly","sedately","seemingly","seldom","selfishly","separately","seriously","shakily","sharply","sheepishly","shrilly","shyly","silently","sleepily","slowly","smoothly","softly","solemnly","solidly","sometimes","soon","speedily","stealthily","sternly","strictly","successfully","suddenly","surprisingly","suspiciously","sweetly","swiftly","sympathetically","tenderly","tensely","terribly","thankfully","thoroughly","thoughtfully","tightly","tomorrow","too","tremendously","triumphantly","truly","truthfully","ultimately","unabashedly","unaccountably","unbearably","unethically","unexpectedly","unfortunately","unimpressively","unnaturally","unnecessarily","upbeat","upliftingly","upright","upside-down","upward","upwardly","urgently","usefully","uselessly","usually","utterly","vacantly","vaguely","vainly","valiantly","vastly","verbally","very","viciously","victoriously","violently","vivaciously","voluntarily","warmly","weakly","wearily","well","wetly","wholly","wildly","willfully","wisely","woefully","wonderfully","worriedly","wrongly","yawningly","yearly","yearningly","yesterday","yieldingly","youthfully"];var Ds=["after","after all","although","and","as","as a result","as if","as long as","as much as","as soon as","as though","because","before","but","consequently","even","even if","even though","finally","for","for example","furthermore","hence","however","if","if only","if then","if when","in addition","in fact","in order that","inasmuch","incidentally","indeed","instead","just as","lest","likewise","meanwhile","nor","now","now since","now that","now when","once","or","provided","provided that","rather than","since","so","so that","supposing","that","though","until","whenever","whereas","wherever","which","who","yet"];var Us=["yuck","oh","phooey","blah","boo","whoa","yowza","huzzah","boo hoo","fooey","geez","pfft","ew","ah","yum","brr","hm","yahoo","aha","woot","drat","gah","meh","psst","aw","ugh","yippee","eek","gee","bah","gadzooks","duh","ha","mmm","tsk tsk","ouch","phew","ack","uh-huh","gosh","hmph","pish","zowie","er","ick","oof","um"];var Ls=["ATM","CD","SUV","TV","aardvark","abacus","abbey","abbreviation","abdomen","ability","abnormality","abolishment","abortion","abrogation","absence","abundance","abuse","academics","academy","accelerant","accelerator","accent","acceptance","access","accessory","accident","accommodation","accompanist","accomplishment","accord","accordance","accordion","account","accountability","accountant","accounting","accuracy","accusation","acetate","achievement","achiever","acid","acknowledgment","acorn","acoustics","acquaintance","acquisition","acre","acrylic","act","action","activation","activist","activity","actor","actress","acupuncture","ad","adaptation","adapter","addiction","addition","address","adjective","adjustment","admin","administration","administrator","admire","admission","adobe","adoption","adrenalin","adrenaline","adult","adulthood","advance","advancement","advantage","advent","adverb","advertisement","advertising","advice","adviser","advocacy","advocate","affair","affect","affidavit","affiliate","affinity","afoul","afterlife","aftermath","afternoon","aftershave","aftershock","afterthought","age","agency","agenda","agent","aggradation","aggression","aglet","agony","agreement","agriculture","aid","aide","aim","air","airbag","airbus","aircraft","airfare","airfield","airforce","airline","airmail","airman","airplane","airport","airship","airspace","alarm","alb","albatross","album","alcohol","alcove","alder","ale","alert","alfalfa","algebra","algorithm","alias","alibi","alien","allegation","allergist","alley","alliance","alligator","allocation","allowance","alloy","alluvium","almanac","almighty","almond","alpaca","alpenglow","alpenhorn","alpha","alphabet","altar","alteration","alternative","altitude","alto","aluminium","aluminum","amazement","amazon","ambassador","amber","ambience","ambiguity","ambition","ambulance","amendment","amenity","ammunition","amnesty","amount","amusement","anagram","analgesia","analog","analogue","analogy","analysis","analyst","analytics","anarchist","anarchy","anatomy","ancestor","anchovy","android","anesthesiologist","anesthesiology","angel","anger","angina","angiosperm","angle","angora","angstrom","anguish","animal","anime","anise","ankle","anklet","anniversary","announcement","annual","anorak","answer","ant","anteater","antecedent","antechamber","antelope","antennae","anterior","anthropology","antibody","anticipation","anticodon","antigen","antique","antiquity","antler","antling","anxiety","anybody","anyone","anything","anywhere","apartment","ape","aperitif","apology","app","apparatus","apparel","appeal","appearance","appellation","appendix","appetiser","appetite","appetizer","applause","apple","applewood","appliance","application","appointment","appreciation","apprehension","approach","appropriation","approval","apricot","apron","apse","aquarium","aquifer","arcade","arch","arch-rival","archaeologist","archaeology","archeology","archer","architect","architecture","archives","area","arena","argument","arithmetic","ark","arm","arm-rest","armadillo","armament","armchair","armoire","armor","armour","armpit","armrest","army","arrangement","array","arrest","arrival","arrogance","arrow","art","artery","arthur","artichoke","article","artifact","artificer","artist","ascend","ascent","ascot","ash","ashram","ashtray","aside","asparagus","aspect","asphalt","aspic","ass","assassination","assault","assembly","assertion","assessment","asset","assignment","assist","assistance","assistant","associate","association","assumption","assurance","asterisk","astrakhan","astrolabe","astrologer","astrology","astronomy","asymmetry","atelier","atheist","athlete","athletics","atmosphere","atom","atrium","attachment","attack","attacker","attainment","attempt","attendance","attendant","attention","attenuation","attic","attitude","attorney","attraction","attribute","auction","audience","audit","auditorium","aunt","authentication","authenticity","author","authorisation","authority","authorization","auto","autoimmunity","automation","automaton","autumn","availability","avalanche","avenue","average","avocado","award","awareness","awe","axis","azimuth","babe","baboon","babushka","baby","bachelor","back","back-up","backbone","backburn","backdrop","background","backpack","backup","backyard","bacon","bacterium","badge","badger","bafflement","bag","bagel","baggage","baggie","baggy","bagpipe","bail","bait","bake","baker","bakery","bakeware","balaclava","balalaika","balance","balcony","ball","ballet","balloon","balloonist","ballot","ballpark","bamboo","ban","banana","band","bandana","bandanna","bandolier","bandwidth","bangle","banjo","bank","bankbook","banker","banking","bankruptcy","banner","banquette","banyan","baobab","bar","barbecue","barbeque","barber","barbiturate","bargain","barge","baritone","barium","bark","barley","barn","barometer","barracks","barrage","barrel","barrier","barstool","bartender","base","baseball","baseboard","baseline","basement","basics","basil","basin","basis","basket","basketball","bass","bassinet","bassoon","bat","bath","bather","bathhouse","bathrobe","bathroom","bathtub","battalion","batter","battery","batting","battle","battleship","bay","bayou","beach","bead","beak","beam","bean","beancurd","beanie","beanstalk","bear","beard","beast","beastie","beat","beating","beauty","beaver","beck","bed","bedrock","bedroom","bee","beech","beef","beer","beet","beetle","beggar","beginner","beginning","begonia","behalf","behavior","behaviour","beheading","behest","behold","being","belfry","belief","believer","bell","belligerency","bellows","belly","belt","bench","bend","beneficiary","benefit","beret","berry","best-seller","bestseller","bet","beverage","beyond","bias","bibliography","bicycle","bid","bidder","bidding","bidet","bifocals","bijou","bike","bikini","bill","billboard","billing","billion","bin","binoculars","biology","biopsy","biosphere","biplane","birch","bird","bird-watcher","birdbath","birdcage","birdhouse","birth","birthday","biscuit","bit","bite","bitten","bitter","black","blackberry","blackbird","blackboard","blackfish","blackness","bladder","blade","blame","blank","blanket","blast","blazer","blend","blessing","blight","blind","blinker","blister","blizzard","block","blocker","blog","blogger","blood","bloodflow","bloom","bloomer","blossom","blouse","blow","blowgun","blowhole","blue","blueberry","blush","boar","board","boat","boatload","boatyard","bob","bobcat","body","bog","bolero","bolt","bomb","bomber","bombing","bond","bonding","bondsman","bone","bonfire","bongo","bonnet","bonsai","bonus","boogeyman","book","bookcase","bookend","booking","booklet","bookmark","boolean","boom","boon","boost","booster","boot","bootee","bootie","booty","border","bore","borrower","borrowing","bosom","boss","botany","bother","bottle","bottling","bottom","bottom-line","boudoir","bough","boulder","boulevard","boundary","bouquet","bourgeoisie","bout","boutique","bow","bower","bowl","bowler","bowling","bowtie","box","boxer","boxspring","boy","boycott","boyfriend","boyhood","boysenberry","bra","brace","bracelet","bracket","brain","brake","bran","branch","brand","brandy","brass","brassiere","bratwurst","bread","breadcrumb","breadfruit","break","breakdown","breakfast","breakpoint","breakthrough","breast","breastplate","breath","breeze","brewer","bribery","brick","bricklaying","bride","bridge","brief","briefing","briefly","briefs","brilliant","brink","brisket","broad","broadcast","broccoli","brochure","brocolli","broiler","broker","bronchitis","bronco","bronze","brooch","brood","brook","broom","brother","brother-in-law","brow","brown","brownie","browser","browsing","brunch","brush","brushfire","brushing","bubble","buck","bucket","buckle","buckwheat","bud","buddy","budget","buffalo","buffer","buffet","bug","buggy","bugle","builder","building","bulb","bulk","bull","bull-fighter","bulldozer","bullet","bump","bumper","bun","bunch","bungalow","bunghole","bunkhouse","burden","bureau","burglar","burial","burlesque","burn","burn-out","burning","burrito","burro","burrow","burst","bus","bush","business","businessman","bust","bustle","butane","butcher","butler","butter","butterfly","button","buy","buyer","buying","buzz","buzzard","c-clamp","cabana","cabbage","cabin","cabinet","cable","caboose","cacao","cactus","caddy","cadet","cafe","caffeine","caftan","cage","cake","calcification","calculation","calculator","calculus","calendar","calf","caliber","calibre","calico","call","calm","calorie","camel","cameo","camera","camp","campaign","campaigning","campanile","camper","campus","can","canal","cancer","candelabra","candidacy","candidate","candle","candy","cane","cannibal","cannon","canoe","canon","canopy","cantaloupe","canteen","canvas","cap","capability","capacity","cape","caper","capital","capitalism","capitulation","capon","cappelletti","cappuccino","captain","caption","captor","car","carabao","caramel","caravan","carbohydrate","carbon","carboxyl","card","cardboard","cardigan","care","career","cargo","caribou","carload","carnation","carnival","carol","carotene","carp","carpenter","carpet","carpeting","carport","carriage","carrier","carrot","carry","cart","cartel","carter","cartilage","cartload","cartoon","cartridge","carving","cascade","case","casement","cash","cashew","cashier","casino","casket","cassava","casserole","cassock","cast","castanet","castle","casualty","cat","catacomb","catalogue","catalysis","catalyst","catamaran","catastrophe","catch","catcher","category","caterpillar","cathedral","cation","catsup","cattle","cauliflower","causal","cause","causeway","caution","cave","caviar","cayenne","ceiling","celebration","celebrity","celeriac","celery","cell","cellar","cello","celsius","cement","cemetery","cenotaph","census","cent","center","centimeter","centre","centurion","century","cephalopod","ceramic","ceramics","cereal","ceremony","certainty","certificate","certification","cesspool","chafe","chain","chainstay","chair","chairlift","chairman","chairperson","chaise","chalet","chalice","chalk","challenge","chamber","champagne","champion","championship","chance","chandelier","change","channel","chaos","chap","chapel","chaplain","chapter","character","characteristic","characterization","chard","charge","charger","charity","charlatan","charm","charset","chart","charter","chasm","chassis","chastity","chasuble","chateau","chatter","chauffeur","chauvinist","check","checkbook","checking","checkout","checkroom","cheddar","cheek","cheer","cheese","cheesecake","cheetah","chef","chem","chemical","chemistry","chemotaxis","cheque","cherry","chess","chest","chestnut","chick","chicken","chicory","chief","chiffonier","child","childbirth","childhood","chili","chill","chime","chimpanzee","chin","chinchilla","chino","chip","chipmunk","chit-chat","chivalry","chive","chives","chocolate","choice","choir","choker","cholesterol","choosing","chop","chops","chopstick","chopsticks","chord","chorus","chow","chowder","chrome","chromolithograph","chronicle","chronograph","chronometer","chrysalis","chub","chuck","chug","church","churn","chutney","cicada","cigarette","cilantro","cinder","cinema","cinnamon","circadian","circle","circuit","circulation","circumference","circumstance","cirrhosis","cirrus","citizen","citizenship","citron","citrus","city","civilian","civilisation","civilization","claim","clam","clamp","clan","clank","clapboard","clarification","clarinet","clarity","clasp","class","classic","classification","classmate","classroom","clause","clave","clavicle","clavier","claw","clay","cleaner","clearance","clearing","cleat","cleavage","clef","cleft","clergyman","cleric","clerk","click","client","cliff","climate","climb","clinic","clip","clipboard","clipper","cloak","cloakroom","clock","clockwork","clogs","cloister","clone","close","closet","closing","closure","cloth","clothes","clothing","cloud","cloudburst","clove","clover","cloves","club","clue","cluster","clutch","co-producer","coach","coal","coalition","coast","coaster","coat","cob","cobbler","cobweb","cock","cockpit","cockroach","cocktail","cocoa","coconut","cod","code","codepage","codling","codon","codpiece","coevolution","cofactor","coffee","coffin","cohesion","cohort","coil","coin","coincidence","coinsurance","coke","cold","coleslaw","coliseum","collaboration","collagen","collapse","collar","collard","collateral","colleague","collection","collectivisation","collectivization","collector","college","collision","colloquy","colon","colonial","colonialism","colonisation","colonization","colony","color","colorlessness","colt","column","columnist","comb","combat","combination","combine","comeback","comedy","comestible","comfort","comfortable","comic","comics","comma","command","commander","commandment","comment","commerce","commercial","commission","commitment","committee","commodity","common","commonsense","commotion","communicant","communication","communion","communist","community","commuter","company","comparison","compass","compassion","compassionate","compensation","competence","competition","competitor","complaint","complement","completion","complex","complexity","compliance","complication","complicity","compliment","component","comportment","composer","composite","composition","compost","comprehension","compress","compromise","comptroller","compulsion","computer","comradeship","con","concentrate","concentration","concept","conception","concern","concert","conclusion","concrete","condition","conditioner","condominium","condor","conduct","conductor","cone","confectionery","conference","confidence","confidentiality","configuration","confirmation","conflict","conformation","confusion","conga","congo","congregation","congress","congressman","congressperson","conifer","connection","connotation","conscience","consciousness","consensus","consent","consequence","conservation","conservative","consideration","consignment","consist","consistency","console","consonant","conspiracy","conspirator","constant","constellation","constitution","constraint","construction","consul","consulate","consulting","consumer","consumption","contact","contact lens","contagion","container","content","contention","contest","context","continent","contingency","continuity","contour","contract","contractor","contrail","contrary","contrast","contribution","contributor","control","controller","controversy","convection","convenience","convention","conversation","conversion","convert","convertible","conviction","cook","cookbook","cookie","cooking","coonskin","cooperation","coordination","coordinator","cop","cop-out","cope","copper","copy","copying","copyright","copywriter","coral","cord","corduroy","core","cork","cormorant","corn","corner","cornerstone","cornet","cornflakes","cornmeal","corporal","corporation","corporatism","corps","corral","correspondence","correspondent","corridor","corruption","corsage","cosset","cost","costume","cot","cottage","cotton","couch","cougar","cough","council","councilman","councilor","councilperson","counsel","counseling","counselling","counsellor","counselor","count","counter","counter-force","counterpart","counterterrorism","countess","country","countryside","county","couple","coupon","courage","course","court","courthouse","courtroom","cousin","covariate","cover","coverage","coverall","cow","cowbell","cowboy","coyote","crab","crack","cracker","crackers","cradle","craft","craftsman","cranberry","crane","cranky","crap","crash","crate","cravat","craw","crawdad","crayfish","crayon","crazy","cream","creation","creationism","creationist","creative","creativity","creator","creature","creche","credential","credenza","credibility","credit","creditor","creek","creme brulee","crepe","crest","crew","crewman","crewmate","crewmember","crewmen","cria","crib","cribbage","cricket","cricketer","crime","criminal","crinoline","crisis","crisp","criteria","criterion","critic","criticism","crocodile","crocus","croissant","crook","crop","cross","cross-contamination","cross-stitch","crotch","croup","crow","crowd","crown","crucifixion","crude","cruelty","cruise","crumb","crunch","crusader","crush","crust","cry","crystal","crystallography","cub","cube","cuckoo","cucumber","cue","cuff-link","cuisine","cultivar","cultivator","culture","culvert","cummerbund","cup","cupboard","cupcake","cupola","curd","cure","curio","curiosity","curl","curler","currant","currency","current","curriculum","curry","curse","cursor","curtailment","curtain","curve","cushion","custard","custody","custom","customer","cut","cuticle","cutlet","cutover","cutting","cyclamen","cycle","cyclone","cyclooxygenase","cygnet","cylinder","cymbal","cynic","cyst","cytokine","cytoplasm","dad","daddy","daffodil","dagger","dahlia","daikon","daily","dairy","daisy","dam","damage","dame","damn","dance","dancer","dancing","dandelion","danger","dare","dark","darkness","darn","dart","dash","dashboard","data","database","date","daughter","dawn","day","daybed","daylight","dead","deadline","deal","dealer","dealing","dearest","death","deathwatch","debate","debris","debt","debtor","decade","decadence","decency","decimal","decision","decision-making","deck","declaration","declination","decline","decoder","decongestant","decoration","decrease","decryption","dedication","deduce","deduction","deed","deep","deer","default","defeat","defendant","defender","defense","deficit","definition","deformation","degradation","degree","delay","deliberation","delight","delivery","demand","democracy","democrat","demon","demur","den","denim","denominator","density","dentist","deodorant","department","departure","dependency","dependent","deployment","deposit","deposition","depot","depression","depressive","depth","deputy","derby","derivation","derivative","derrick","descendant","descent","description","desert","design","designation","designer","desire","desk","desktop","dessert","destination","destiny","destroyer","destruction","detail","detainee","detainment","detection","detective","detector","detention","determination","detour","devastation","developer","developing","development","developmental","deviance","deviation","device","devil","dew","dhow","diabetes","diadem","diagnosis","diagram","dial","dialect","dialogue","diam","diamond","diaper","diaphragm","diarist","diary","dibble","dick","dickey","dictaphone","dictator","diction","dictionary","die","diesel","diet","difference","differential","difficulty","diffuse","dig","digestion","digestive","digger","digging","digit","dignity","dilapidation","dill","dilution","dime","dimension","dimple","diner","dinghy","dining","dinner","dinosaur","dioxide","dip","diploma","diplomacy","dipstick","direction","directive","director","directory","dirndl","dirt","disability","disadvantage","disagreement","disappointment","disarmament","disaster","discharge","discipline","disclaimer","disclosure","disco","disconnection","discount","discourse","discovery","discrepancy","discretion","discrimination","discussion","disdain","disease","disembodiment","disengagement","disguise","disgust","dish","dishwasher","disk","disparity","dispatch","displacement","display","disposal","disposer","disposition","dispute","disregard","disruption","dissemination","dissonance","distance","distinction","distortion","distribution","distributor","district","divalent","divan","diver","diversity","divide","dividend","divider","divine","diving","division","divorce","doc","dock","doctor","doctorate","doctrine","document","documentary","documentation","doe","dog","doggie","dogsled","dogwood","doing","doll","dollar","dollop","dolman","dolor","dolphin","domain","dome","domination","donation","donkey","donor","donut","door","doorbell","doorknob","doorpost","doorway","dory","dose","dot","double","doubling","doubt","doubter","dough","doughnut","down","downfall","downforce","downgrade","download","downstairs","downtown","downturn","dozen","draft","drag","dragon","dragonfly","dragonfruit","dragster","drain","drainage","drake","drama","dramaturge","drapes","draw","drawbridge","drawer","drawing","dream","dreamer","dredger","dress","dresser","dressing","drill","drink","drinking","drive","driver","driveway","driving","drizzle","dromedary","drop","drudgery","drug","drum","drummer","drunk","dryer","duck","duckling","dud","dude","due","duel","dueling","duffel","dugout","dulcimer","dumbwaiter","dump","dump truck","dune","dune buggy","dungarees","dungeon","duplexer","duration","durian","dusk","dust","dust storm","duster","duty","dwarf","dwell","dwelling","dynamics","dynamite","dynamo","dynasty","dysfunction","e-book","e-mail","e-reader","eagle","eaglet","ear","eardrum","earmuffs","earnings","earplug","earring","earrings","earth","earthquake","earthworm","ease","easel","east","eating","eaves","eavesdropper","ecclesia","echidna","eclipse","ecliptic","ecology","economics","economy","ecosystem","ectoderm","ectodermal","ecumenist","eddy","edge","edger","edible","editing","edition","editor","editorial","education","eel","effacement","effect","effective","effectiveness","effector","efficacy","efficiency","effort","egg","egghead","eggnog","eggplant","ego","eicosanoid","ejector","elbow","elderberry","election","electricity","electrocardiogram","electronics","element","elephant","elevation","elevator","eleventh","elf","elicit","eligibility","elimination","elite","elixir","elk","ellipse","elm","elongation","elver","email","emanate","embarrassment","embassy","embellishment","embossing","embryo","emerald","emergence","emergency","emergent","emery","emission","emitter","emotion","emphasis","empire","employ","employee","employer","employment","empowerment","emu","enactment","encirclement","enclave","enclosure","encounter","encouragement","encyclopedia","end","endive","endoderm","endorsement","endothelium","endpoint","enemy","energy","enforcement","engagement","engine","engineer","engineering","enigma","enjoyment","enquiry","enrollment","enterprise","entertainment","enthusiasm","entirety","entity","entrance","entree","entrepreneur","entry","envelope","environment","envy","enzyme","epauliere","epee","ephemera","ephemeris","ephyra","epic","episode","epithelium","epoch","eponym","epoxy","equal","equality","equation","equinox","equipment","equity","equivalent","era","eraser","erection","erosion","error","escalator","escape","escort","espadrille","espalier","essay","essence","essential","establishment","estate","estimate","estrogen","estuary","eternity","ethernet","ethics","ethnicity","ethyl","euphonium","eurocentrism","evaluation","evaluator","evaporation","eve","evening","evening-wear","event","everybody","everyone","everything","eviction","evidence","evil","evocation","evolution","ex-husband","ex-wife","exaggeration","exam","examination","examiner","example","exasperation","excellence","exception","excerpt","excess","exchange","excitement","exclamation","excursion","excuse","execution","executive","executor","exercise","exhaust","exhaustion","exhibit","exhibition","exile","existence","exit","exocrine","expansion","expansionism","expectancy","expectation","expedition","expense","experience","experiment","experimentation","expert","expertise","explanation","exploration","explorer","explosion","export","expose","exposition","exposure","expression","extension","extent","exterior","external","extinction","extreme","extremist","eye","eyeball","eyebrow","eyebrows","eyeglasses","eyelash","eyelashes","eyelid","eyelids","eyeliner","eyestrain","eyrie","fabric","face","facelift","facet","facility","facsimile","fact","factor","factory","faculty","fahrenheit","fail","failure","fairness","fairy","faith","faithful","fall","fallacy","falling-out","fame","familiar","familiarity","family","fan","fang","fanlight","fanny","fanny-pack","fantasy","farm","farmer","farming","farmland","farrow","fascia","fashion","fat","fate","father","father-in-law","fatigue","fatigues","faucet","fault","fav","fava","favor","favorite","fawn","fax","fear","feast","feather","feature","fedelini","federation","fedora","fee","feed","feedback","feeding","feel","feeling","fellow","felony","female","fen","fence","fencing","fender","feng","fennel","ferret","ferry","ferryboat","fertilizer","festival","fetus","few","fiber","fiberglass","fibre","fibroblast","fibrosis","ficlet","fiction","fiddle","field","fiery","fiesta","fifth","fig","fight","fighter","figure","figurine","file","filing","fill","fillet","filly","film","filter","filth","final","finance","financing","finding","fine","finer","finger","fingerling","fingernail","finish","finisher","fir","fire","fireman","fireplace","firewall","firm","first","fish","fishbone","fisherman","fishery","fishing","fishmonger","fishnet","fisting","fit","fitness","fix","fixture","flag","flair","flame","flan","flanker","flare","flash","flat","flatboat","flavor","flax","fleck","fledgling","fleece","flesh","flexibility","flick","flicker","flight","flint","flintlock","flip-flops","flock","flood","floodplain","floor","floozie","flour","flow","flower","flu","flugelhorn","fluke","flume","flung","flute","fly","flytrap","foal","foam","fob","focus","fog","fold","folder","folk","folklore","follower","following","fondue","font","food","foodstuffs","fool","foot","footage","football","footnote","footprint","footrest","footstep","footstool","footwear","forage","forager","foray","force","ford","forearm","forebear","forecast","forehead","foreigner","forelimb","forest","forestry","forever","forgery","fork","form","formal","formamide","format","formation","former","formicarium","formula","fort","forte","fortnight","fortress","fortune","forum","foundation","founder","founding","fountain","fourths","fowl","fox","foxglove","fraction","fragrance","frame","framework","fratricide","fraud","fraudster","freak","freckle","freedom","freelance","freezer","freezing","freight","freighter","frenzy","freon","frequency","fresco","friction","fridge","friend","friendship","fries","frigate","fright","fringe","fritter","frock","frog","front","frontier","frost","frosting","frown","fruit","frustration","fry","fuck","fuel","fugato","fulfillment","full","fun","function","functionality","fund","funding","fundraising","funeral","fur","furnace","furniture","furry","fusarium","futon","future","gadget","gaffe","gaffer","gain","gaiters","gale","gall-bladder","gallery","galley","gallon","galoshes","gambling","game","gamebird","gaming","gamma-ray","gander","gang","gap","garage","garb","garbage","garden","garlic","garment","garter","gas","gasket","gasoline","gasp","gastronomy","gastropod","gate","gateway","gather","gathering","gator","gauge","gauntlet","gavel","gazebo","gazelle","gear","gearshift","geek","gel","gelatin","gelding","gem","gemsbok","gender","gene","general","generation","generator","generosity","genetics","genie","genius","genocide","genre","gentleman","geography","geology","geometry","geranium","gerbil","gesture","geyser","gherkin","ghost","giant","gift","gig","gigantism","giggle","ginger","gingerbread","ginseng","giraffe","girdle","girl","girlfriend","git","glacier","gladiolus","glance","gland","glass","glasses","glee","glen","glider","gliding","glimpse","globe","glockenspiel","gloom","glory","glove","glow","glucose","glue","glut","glutamate","gnat","gnu","go-kart","goal","goat","gobbler","god","goddess","godfather","godmother","godparent","goggles","going","gold","goldfish","golf","gondola","gong","good","good-bye","goodbye","goodie","goodness","goodnight","goodwill","goose","gopher","gorilla","gosling","gossip","governance","government","governor","gown","grab-bag","grace","grade","gradient","graduate","graduation","graffiti","graft","grain","gram","grammar","gran","grand","grandchild","granddaughter","grandfather","grandma","grandmom","grandmother","grandpa","grandparent","grandson","granny","granola","grant","grape","grapefruit","graph","graphic","grasp","grass","grasshopper","grassland","gratitude","gravel","gravitas","gravity","gravy","gray","grease","great-grandfather","great-grandmother","greatness","greed","green","greenhouse","greens","grenade","grey","grid","grief","grill","grin","grip","gripper","grit","grocery","ground","group","grouper","grouse","grove","growth","grub","guacamole","guarantee","guard","guava","guerrilla","guess","guest","guestbook","guidance","guide","guideline","guilder","guilt","guilty","guinea","guitar","guitarist","gum","gumshoe","gun","gunpowder","gutter","guy","gym","gymnast","gymnastics","gynaecology","gyro","habit","habitat","hacienda","hacksaw","hackwork","hail","hair","haircut","hake","half","half-brother","half-sister","halibut","hall","halloween","hallway","halt","ham","hamburger","hammer","hammock","hamster","hand","hand-holding","handball","handful","handgun","handicap","handle","handlebar","handmaiden","handover","handrail","handsaw","hanger","happening","happiness","harald","harbor","harbour","hard-hat","hardboard","hardcover","hardening","hardhat","hardship","hardware","hare","harm","harmonica","harmonise","harmonize","harmony","harp","harpooner","harpsichord","harvest","harvester","hash","hashtag","hassock","haste","hat","hatbox","hatchet","hatchling","hate","hatred","haunt","haven","haversack","havoc","hawk","hay","haze","hazel","hazelnut","head","headache","headlight","headline","headphones","headquarters","headrest","health","health-care","hearing","hearsay","heart","heart-throb","heartache","heartbeat","hearth","hearthside","heartwood","heat","heater","heating","heaven","heavy","hectare","hedge","hedgehog","heel","heifer","height","heir","heirloom","helicopter","helium","hell","hellcat","hello","helmet","helo","help","hemisphere","hemp","hen","hepatitis","herb","herbs","heritage","hermit","hero","heroine","heron","herring","hesitation","heterosexual","hexagon","heyday","hiccups","hide","hierarchy","high","high-rise","highland","highlight","highway","hike","hiking","hill","hint","hip","hippodrome","hippopotamus","hire","hiring","historian","history","hit","hive","hobbit","hobby","hockey","hoe","hog","hold","holder","hole","holiday","home","homeland","homeownership","hometown","homework","homicide","homogenate","homonym","homosexual","homosexuality","honesty","honey","honeybee","honeydew","honor","honoree","hood","hoof","hook","hop","hope","hops","horde","horizon","hormone","horn","hornet","horror","horse","horseradish","horst","hose","hosiery","hospice","hospital","hospitalisation","hospitality","hospitalization","host","hostel","hostess","hotdog","hotel","hound","hour","hourglass","house","houseboat","household","housewife","housework","housing","hovel","hovercraft","howard","howitzer","hub","hubcap","hubris","hug","hugger","hull","human","humanity","humidity","hummus","humor","humour","hunchback","hundred","hunger","hunt","hunter","hunting","hurdle","hurdler","hurricane","hurry","hurt","husband","hut","hutch","hyacinth","hybridisation","hybridization","hydrant","hydraulics","hydrocarb","hydrocarbon","hydrofoil","hydrogen","hydrolyse","hydrolysis","hydrolyze","hydroxyl","hyena","hygienic","hype","hyphenation","hypochondria","hypothermia","hypothesis","ice","ice-cream","iceberg","icebreaker","icecream","icicle","icing","icon","icy","id","idea","ideal","identification","identity","ideology","idiom","idiot","igloo","ignorance","ignorant","ikebana","illegal","illiteracy","illness","illusion","illustration","image","imagination","imbalance","imitation","immigrant","immigration","immortal","impact","impairment","impala","impediment","implement","implementation","implication","import","importance","impostor","impress","impression","imprisonment","impropriety","improvement","impudence","impulse","in-joke","in-laws","inability","inauguration","inbox","incandescence","incarnation","incense","incentive","inch","incidence","incident","incision","inclusion","income","incompetence","inconvenience","increase","incubation","independence","independent","index","indication","indicator","indigence","individual","industrialisation","industrialization","industry","inequality","inevitable","infancy","infant","infarction","infection","infiltration","infinite","infix","inflammation","inflation","influence","influx","info","information","infrastructure","infusion","inglenook","ingrate","ingredient","inhabitant","inheritance","inhibition","inhibitor","initial","initialise","initialize","initiative","injunction","injury","injustice","ink","inlay","inn","innervation","innocence","innocent","innovation","input","inquiry","inscription","insect","insectarium","insert","inside","insight","insolence","insomnia","inspection","inspector","inspiration","installation","instance","instant","instinct","institute","institution","instruction","instructor","instrument","instrumentalist","instrumentation","insulation","insurance","insurgence","insurrection","integer","integral","integration","integrity","intellect","intelligence","intensity","intent","intention","intentionality","interaction","interchange","interconnection","intercourse","interest","interface","interferometer","interior","interject","interloper","internet","interpretation","interpreter","interval","intervenor","intervention","interview","interviewer","intestine","introduction","intuition","invader","invasion","invention","inventor","inventory","inverse","inversion","investigation","investigator","investment","investor","invitation","invite","invoice","involvement","iridescence","iris","iron","ironclad","irony","irrigation","ischemia","island","isogloss","isolation","issue","item","itinerary","ivory","jack","jackal","jacket","jackfruit","jade","jaguar","jail","jailhouse","jalape\xC3\xB1o","jam","jar","jasmine","jaw","jazz","jealousy","jeans","jeep","jelly","jellybeans","jellyfish","jerk","jet","jewel","jeweller","jewellery","jewelry","jicama","jiffy","job","jockey","jodhpurs","joey","jogging","joint","joke","jot","journal","journalism","journalist","journey","joy","judge","judgment","judo","jug","juggernaut","juice","julienne","jumbo","jump","jumper","jumpsuit","jungle","junior","junk","junker","junket","jury","justice","justification","jute","kale","kamikaze","kangaroo","karate","kayak","kazoo","kebab","keep","keeper","kendo","kennel","ketch","ketchup","kettle","kettledrum","key","keyboard","keyboarding","keystone","kick","kick-off","kid","kidney","kielbasa","kill","killer","killing","kilogram","kilometer","kilt","kimono","kinase","kind","kindness","king","kingdom","kingfish","kiosk","kiss","kit","kitchen","kite","kitsch","kitten","kitty","kiwi","knee","kneejerk","knickers","knife","knife-edge","knight","knitting","knock","knot","know-how","knowledge","knuckle","koala","kohlrabi","kumquat","lab","label","labor","laboratory","laborer","labour","labourer","lace","lack","lacquerware","lad","ladder","ladle","lady","ladybug","lag","lake","lamb","lambkin","lament","lamp","lanai","land","landform","landing","landmine","landscape","lane","language","lantern","lap","laparoscope","lapdog","laptop","larch","lard","larder","lark","larva","laryngitis","lasagna","lashes","last","latency","latex","lathe","latitude","latte","latter","laugh","laughter","laundry","lava","law","lawmaker","lawn","lawsuit","lawyer","lay","layer","layout","lead","leader","leadership","leading","leaf","league","leaker","leap","learning","leash","leather","leave","leaver","lecture","leek","leeway","left","leg","legacy","legal","legend","legging","legislation","legislator","legislature","legitimacy","legume","leisure","lemon","lemonade","lemur","lender","lending","length","lens","lentil","leopard","leprosy","leptocephalus","lesbian","lesson","letter","lettuce","level","lever","leverage","leveret","liability","liar","liberty","libido","library","licence","license","licensing","licorice","lid","lie","lieu","lieutenant","life","lifestyle","lifetime","lift","ligand","light","lighting","lightning","lightscreen","ligula","likelihood","likeness","lilac","lily","limb","lime","limestone","limit","limitation","limo","line","linen","liner","linguist","linguistics","lining","link","linkage","linseed","lion","lip","lipid","lipoprotein","lipstick","liquid","liquidity","liquor","list","listening","listing","literate","literature","litigation","litmus","litter","littleneck","liver","livestock","living","lizard","llama","load","loading","loaf","loafer","loan","lobby","lobotomy","lobster","local","locality","location","lock","locker","locket","locomotive","locust","lode","loft","log","loggia","logic","login","logistics","logo","loincloth","lollipop","loneliness","longboat","longitude","look","lookout","loop","loophole","loquat","lord","loss","lot","lotion","lottery","lounge","louse","lout","love","lover","lox","loyalty","luck","luggage","lumber","lumberman","lunch","luncheonette","lunchmeat","lunchroom","lung","lunge","lust","lute","luxury","lychee","lycra","lye","lymphocyte","lynx","lyocell","lyre","lyrics","lysine","mRNA","macadamia","macaroni","macaroon","macaw","machine","machinery","macrame","macro","macrofauna","madam","maelstrom","maestro","magazine","maggot","magic","magnet","magnitude","maid","maiden","mail","mailbox","mailer","mailing","mailman","main","mainland","mainstream","maintainer","maintenance","maize","major","major-league","majority","makeover","maker","makeup","making","male","malice","mall","mallard","mallet","malnutrition","mama","mambo","mammoth","man","manacle","management","manager","manatee","mandarin","mandate","mandolin","mangle","mango","mangrove","manhunt","maniac","manicure","manifestation","manipulation","mankind","manner","manor","mansard","manservant","mansion","mantel","mantle","mantua","manufacturer","manufacturing","many","map","maple","mapping","maracas","marathon","marble","march","mare","margarine","margin","mariachi","marimba","marines","marionberry","mark","marker","market","marketer","marketing","marketplace","marksman","markup","marmalade","marriage","marsh","marshland","marshmallow","marten","marxism","mascara","mask","masonry","mass","massage","mast","master","masterpiece","mastication","mastoid","mat","match","matchmaker","mate","material","maternity","math","mathematics","matrix","matter","mattock","mattress","max","maximum","maybe","mayonnaise","mayor","meadow","meal","mean","meander","meaning","means","meantime","measles","measure","measurement","meat","meatball","meatloaf","mecca","mechanic","mechanism","med","medal","media","median","medication","medicine","medium","meet","meeting","melatonin","melody","melon","member","membership","membrane","meme","memo","memorial","memory","men","menopause","menorah","mention","mentor","menu","merchandise","merchant","mercury","meridian","meringue","merit","mesenchyme","mess","message","messenger","messy","metabolite","metal","metallurgist","metaphor","meteor","meteorology","meter","methane","method","methodology","metric","metro","metronome","mezzanine","microlending","micronutrient","microphone","microwave","mid-course","midden","middle","middleman","midline","midnight","midwife","might","migrant","migration","mile","mileage","milepost","milestone","military","milk","milkshake","mill","millennium","millet","millimeter","million","millisecond","millstone","mime","mimosa","min","mincemeat","mind","mine","mineral","mineshaft","mini","mini-skirt","minibus","minimalism","minimum","mining","minion","minister","mink","minnow","minor","minor-league","minority","mint","minute","miracle","mirror","miscarriage","miscommunication","misfit","misnomer","misogyny","misplacement","misreading","misrepresentation","miss","missile","mission","missionary","mist","mistake","mister","misunderstand","miter","mitten","mix","mixer","mixture","moai","moat","mob","mobile","mobility","mobster","moccasins","mocha","mochi","mode","model","modeling","modem","modernist","modernity","modification","molar","molasses","molding","mole","molecule","mom","moment","monastery","monasticism","money","monger","monitor","monitoring","monk","monkey","monocle","monopoly","monotheism","monsoon","monster","month","monument","mood","moody","moon","moonlight","moonscape","moonshine","moose","mop","morale","morbid","morbidity","morning","moron","morphology","morsel","mortal","mortality","mortgage","mortise","mosque","mosquito","most","motel","moth","mother","mother-in-law","motion","motivation","motive","motor","motorboat","motorcar","motorcycle","mound","mountain","mouse","mouser","mousse","moustache","mouth","mouton","movement","mover","movie","mower","mozzarella","mud","muffin","mug","mukluk","mule","multimedia","murder","muscat","muscatel","muscle","musculature","museum","mushroom","music","music-box","music-making","musician","muskrat","mussel","mustache","mustard","mutation","mutt","mutton","mycoplasma","mystery","myth","mythology","nail","name","naming","nanoparticle","napkin","narrative","nasal","nation","nationality","native","naturalisation","nature","navigation","necessity","neck","necklace","necktie","nectar","nectarine","need","needle","neglect","negligee","negotiation","neighbor","neighborhood","neighbour","neighbourhood","neologism","neon","neonate","nephew","nerve","nest","nestling","nestmate","net","netball","netbook","netsuke","network","networking","neurobiologist","neuron","neuropathologist","neuropsychiatry","news","newsletter","newspaper","newsprint","newsstand","nexus","nibble","nicety","niche","nick","nickel","nickname","niece","night","nightclub","nightgown","nightingale","nightlife","nightlight","nightmare","ninja","nit","nitrogen","nobody","nod","node","noir","noise","nonbeliever","nonconformist","nondisclosure","nonsense","noodle","noodles","noon","norm","normal","normalisation","normalization","north","nose","notation","note","notebook","notepad","nothing","notice","notion","notoriety","nougat","noun","nourishment","novel","nucleotidase","nucleotide","nudge","nuke","number","numeracy","numeric","numismatist","nun","nurse","nursery","nursing","nurture","nut","nutmeg","nutrient","nutrition","nylon","nymph","oak","oar","oasis","oat","oatmeal","oats","obedience","obesity","obi","object","objection","objective","obligation","oboe","observation","observatory","obsession","obsidian","obstacle","occasion","occupation","occurrence","ocean","ocelot","octagon","octave","octavo","octet","octopus","odometer","odyssey","oeuvre","off-ramp","offence","offense","offer","offering","office","officer","official","offset","oil","okra","oldie","oleo","olive","omega","omelet","omission","omnivore","oncology","onion","online","onset","opening","opera","operating","operation","operator","ophthalmologist","opinion","opium","opossum","opponent","opportunist","opportunity","opposite","opposition","optimal","optimisation","optimist","optimization","option","orange","orangutan","orator","orchard","orchestra","orchid","order","ordinary","ordination","ore","oregano","organ","organisation","organising","organization","organizing","orient","orientation","origin","original","originality","ornament","osmosis","osprey","ostrich","other","otter","ottoman","ounce","outback","outcome","outfielder","outfit","outhouse","outlaw","outlay","outlet","outline","outlook","output","outrage","outrigger","outrun","outset","outside","oval","ovary","oven","overcharge","overclocking","overcoat","overexertion","overflight","overhead","overheard","overload","overnighter","overshoot","oversight","overview","overweight","owl","owner","ownership","ox","oxford","oxygen","oyster","ozone","pace","pacemaker","pack","package","packaging","packet","pad","paddle","paddock","pagan","page","pagoda","pail","pain","paint","painter","painting","paintwork","pair","pajamas","palace","palate","palm","pamphlet","pan","pancake","pancreas","panda","panel","panic","pannier","panpipe","pansy","panther","panties","pantologist","pantology","pantry","pants","pantsuit","panty","pantyhose","papa","papaya","paper","paperback","paperwork","parable","parachute","parade","paradise","paragraph","parallelogram","paramecium","paramedic","parameter","paranoia","parcel","parchment","pard","pardon","parent","parenthesis","parenting","park","parka","parking","parliament","parole","parrot","parser","parsley","parsnip","part","participant","participation","particle","particular","partner","partnership","partridge","party","pass","passage","passbook","passenger","passing","passion","passive","passport","password","past","pasta","paste","pastor","pastoralist","pastry","pasture","pat","patch","pate","patent","patentee","path","pathogenesis","pathology","pathway","patience","patient","patina","patio","patriarch","patrimony","patriot","patrol","patroller","patrolling","patron","pattern","patty","pattypan","pause","pavement","pavilion","paw","pawnshop","pay","payee","payment","payoff","pea","peace","peach","peacoat","peacock","peak","peanut","pear","pearl","peasant","pecan","pecker","pedal","peek","peen","peer","peer-to-peer","pegboard","pelican","pelt","pen","penalty","pence","pencil","pendant","pendulum","penguin","penicillin","peninsula","penis","pennant","penny","pension","pentagon","peony","people","pepper","pepperoni","percent","percentage","perception","perch","perennial","perfection","performance","perfume","period","periodical","peripheral","permafrost","permission","permit","perp","perpendicular","persimmon","person","personal","personality","personnel","perspective","pest","pet","petal","petition","petitioner","petticoat","pew","pharmacist","pharmacopoeia","phase","pheasant","phenomenon","phenotype","pheromone","philanthropy","philosopher","philosophy","phone","phosphate","photo","photodiode","photograph","photographer","photography","photoreceptor","phrase","phrasing","physical","physics","physiology","pianist","piano","piccolo","pick","pickax","pickaxe","picket","pickle","pickup","picnic","picture","picturesque","pie","piece","pier","piety","pig","pigeon","piglet","pigpen","pigsty","pike","pilaf","pile","pilgrim","pilgrimage","pill","pillar","pillbox","pillow","pilot","pimp","pimple","pin","pinafore","pince-nez","pine","pineapple","pinecone","ping","pink","pinkie","pinot","pinstripe","pint","pinto","pinworm","pioneer","pipe","pipeline","piracy","pirate","piss","pistol","pit","pita","pitch","pitcher","pitching","pith","pizza","place","placebo","placement","placode","plagiarism","plain","plaintiff","plan","plane","planet","planning","plant","plantation","planter","planula","plaster","plasterboard","plastic","plate","platelet","platform","platinum","platter","platypus","play","player","playground","playroom","playwright","plea","pleasure","pleat","pledge","plenty","plier","pliers","plight","plot","plough","plover","plow","plowman","plug","plugin","plum","plumber","plume","plunger","plywood","pneumonia","pocket","pocket-watch","pocketbook","pod","podcast","poem","poet","poetry","poignance","point","poison","poisoning","poker","polarisation","polarization","pole","polenta","police","policeman","policy","polish","politician","politics","poll","polliwog","pollutant","pollution","polo","polyester","polyp","pomegranate","pomelo","pompom","poncho","pond","pony","pool","poor","pop","popcorn","poppy","popsicle","popularity","population","populist","porcelain","porch","porcupine","pork","porpoise","port","porter","portfolio","porthole","portion","portrait","position","possession","possibility","possible","post","postage","postbox","poster","posterior","postfix","pot","potato","potential","pottery","potty","pouch","poultry","pound","pounding","poverty","powder","power","practice","practitioner","prairie","praise","pray","prayer","precedence","precedent","precipitation","precision","predecessor","preface","preference","prefix","pregnancy","prejudice","prelude","premeditation","premier","premise","premium","preoccupation","preparation","prescription","presence","present","presentation","preservation","preserves","presidency","president","press","pressroom","pressure","pressurisation","pressurization","prestige","presume","pretzel","prevalence","prevention","prey","price","pricing","pride","priest","priesthood","primary","primate","prince","princess","principal","principle","print","printer","printing","prior","priority","prison","prisoner","privacy","private","privilege","prize","prizefight","probability","probation","probe","problem","procedure","proceedings","process","processing","processor","proctor","procurement","produce","producer","product","production","productivity","profession","professional","professor","profile","profit","progenitor","program","programme","programming","progress","progression","prohibition","project","proliferation","promenade","promise","promotion","prompt","pronoun","pronunciation","proof","proof-reader","propaganda","propane","property","prophet","proponent","proportion","proposal","proposition","proprietor","prose","prosecution","prosecutor","prospect","prosperity","prostacyclin","prostanoid","prostrate","protection","protein","protest","protocol","providence","provider","province","provision","prow","proximal","proximity","prune","pruner","pseudocode","pseudoscience","psychiatrist","psychoanalyst","psychologist","psychology","ptarmigan","pub","public","publication","publicity","publisher","publishing","pudding","puddle","puffin","pug","puggle","pulley","pulse","puma","pump","pumpernickel","pumpkin","pumpkinseed","pun","punch","punctuation","punishment","pup","pupa","pupil","puppet","puppy","purchase","puritan","purity","purple","purpose","purr","purse","pursuit","push","pusher","put","puzzle","pyramid","pyridine","quadrant","quail","qualification","quality","quantity","quart","quarter","quartet","quartz","queen","query","quest","question","questioner","questionnaire","quiche","quicksand","quiet","quill","quilt","quince","quinoa","quit","quiver","quota","quotation","quote","rabbi","rabbit","raccoon","race","racer","racing","racism","racist","rack","radar","radiator","radio","radiosonde","radish","raffle","raft","rag","rage","raid","rail","railing","railroad","railway","raiment","rain","rainbow","raincoat","rainmaker","rainstorm","rainy","raise","raisin","rake","rally","ram","rambler","ramen","ramie","ranch","rancher","randomisation","randomization","range","ranger","rank","rap","rape","raspberry","rat","rate","ratepayer","rating","ratio","rationale","rations","raven","ravioli","rawhide","ray","rayon","razor","reach","reactant","reaction","read","reader","readiness","reading","real","reality","realization","realm","reamer","rear","reason","reasoning","rebel","rebellion","reboot","recall","recapitulation","receipt","receiver","reception","receptor","recess","recession","recipe","recipient","reciprocity","reclamation","recliner","recognition","recollection","recommendation","reconsideration","record","recorder","recording","recovery","recreation","recruit","rectangle","red","redesign","redhead","redirect","rediscovery","reduction","reef","refectory","reference","referendum","reflection","reform","refreshments","refrigerator","refuge","refund","refusal","refuse","regard","regime","region","regionalism","register","registration","registry","regret","regulation","regulator","rehospitalisation","rehospitalization","reindeer","reinscription","reject","relation","relationship","relative","relaxation","relay","release","reliability","relief","religion","relish","reluctance","remains","remark","reminder","remnant","remote","removal","renaissance","rent","reorganisation","reorganization","repair","reparation","repayment","repeat","replacement","replica","replication","reply","report","reporter","reporting","repository","representation","representative","reprocessing","republic","republican","reputation","request","requirement","resale","rescue","research","researcher","resemblance","reservation","reserve","reservoir","reset","residence","resident","residue","resist","resistance","resolution","resolve","resort","resource","respect","respite","response","responsibility","rest","restaurant","restoration","restriction","restroom","restructuring","result","resume","retailer","retention","rethinking","retina","retirement","retouching","retreat","retrospect","retrospective","retrospectivity","return","reunion","revascularisation","revascularization","reveal","revelation","revenant","revenge","revenue","reversal","reverse","review","revitalisation","revitalization","revival","revolution","revolver","reward","rhetoric","rheumatism","rhinoceros","rhubarb","rhyme","rhythm","rib","ribbon","rice","riddle","ride","rider","ridge","riding","rifle","right","rim","ring","ringworm","riot","rip","ripple","rise","riser","risk","rite","ritual","river","riverbed","rivulet","road","roadway","roar","roast","robe","robin","robot","robotics","rock","rocker","rocket","rocket-ship","rod","role","roll","roller","romaine","romance","roof","room","roommate","rooster","root","rope","rose","rosemary","roster","rostrum","rotation","round","roundabout","route","router","routine","row","rowboat","rowing","rubber","rubbish","rubric","ruby","ruckus","rudiment","ruffle","rug","rugby","ruin","rule","ruler","ruling","rum","rumor","run","runaway","runner","running","runway","rush","rust","rutabaga","rye","sabre","sac","sack","saddle","sadness","safari","safe","safeguard","safety","saffron","sage","sail","sailboat","sailing","sailor","saint","sake","salad","salami","salary","sale","salesman","salmon","salon","saloon","salsa","salt","salute","samovar","sampan","sample","samurai","sanction","sanctity","sanctuary","sand","sandal","sandbar","sandpaper","sandwich","sanity","sardine","sari","sarong","sash","satellite","satin","satire","satisfaction","sauce","saucer","sauerkraut","sausage","savage","savannah","saving","savings","savior","saviour","savory","saw","saxophone","scaffold","scale","scallion","scallops","scalp","scam","scanner","scarecrow","scarf","scarification","scenario","scene","scenery","scent","schedule","scheduling","schema","scheme","schizophrenic","schnitzel","scholar","scholarship","school","schoolhouse","schooner","science","scientist","scimitar","scissors","scooter","scope","score","scorn","scorpion","scotch","scout","scow","scrambled","scrap","scraper","scratch","screamer","screen","screening","screenwriting","screw","screw-up","screwdriver","scrim","scrip","script","scripture","scrutiny","sculpting","sculptural","sculpture","sea","seabass","seafood","seagull","seal","seaplane","search","seashore","seaside","season","seat","seaweed","second","secrecy","secret","secretariat","secretary","secretion","section","sectional","sector","security","sediment","seed","seeder","seeker","seep","segment","seizure","selection","self","self-confidence","self-control","self-esteem","seller","selling","semantics","semester","semicircle","semicolon","semiconductor","seminar","senate","senator","sender","senior","sense","sensibility","sensitive","sensitivity","sensor","sentence","sentencing","sentiment","sepal","separation","septicaemia","sequel","sequence","serial","series","sermon","serum","serval","servant","server","service","servitude","sesame","session","set","setback","setting","settlement","settler","severity","sewer","sex","sexuality","shack","shackle","shade","shadow","shadowbox","shakedown","shaker","shallot","shallows","shame","shampoo","shanty","shape","share","shareholder","shark","shaw","shawl","shear","shearling","sheath","shed","sheep","sheet","shelf","shell","shelter","sherbet","sherry","shield","shift","shin","shine","shingle","ship","shipper","shipping","shipyard","shirt","shirtdress","shit","shoat","shock","shoe","shoe-horn","shoehorn","shoelace","shoemaker","shoes","shoestring","shofar","shoot","shootdown","shop","shopper","shopping","shore","shoreline","short","shortage","shorts","shortwave","shot","shoulder","shout","shovel","show","show-stopper","shower","shred","shrimp","shrine","shutdown","sibling","sick","sickness","side","sideboard","sideburns","sidecar","sidestream","sidewalk","siding","siege","sigh","sight","sightseeing","sign","signal","signature","signet","significance","signify","signup","silence","silica","silicon","silk","silkworm","sill","silly","silo","silver","similarity","simple","simplicity","simplification","simvastatin","sin","singer","singing","singular","sink","sinuosity","sip","sir","sister","sister-in-law","sitar","site","situation","size","skate","skating","skean","skeleton","ski","skiing","skill","skin","skirt","skull","skullcap","skullduggery","skunk","sky","skylight","skyline","skyscraper","skywalk","slang","slapstick","slash","slate","slave","slavery","slaw","sled","sledge","sleep","sleepiness","sleeping","sleet","sleuth","slice","slide","slider","slime","slip","slipper","slippers","slope","slot","sloth","slump","smell","smelting","smile","smith","smock","smog","smoke","smoking","smolt","smuggling","snack","snail","snake","snakebite","snap","snarl","sneaker","sneakers","sneeze","sniffle","snob","snorer","snow","snowboarding","snowflake","snowman","snowmobiling","snowplow","snowstorm","snowsuit","snuck","snug","snuggle","soap","soccer","socialism","socialist","society","sociology","sock","socks","soda","sofa","softball","softdrink","softening","software","soil","soldier","sole","solicitation","solicitor","solidarity","solidity","soliloquy","solitaire","solution","solvency","sombrero","somebody","someone","someplace","somersault","something","somewhere","son","sonar","sonata","song","songbird","sonnet","soot","sophomore","soprano","sorbet","sorghum","sorrel","sorrow","sort","soul","soulmate","sound","soundness","soup","source","sourwood","sousaphone","south","southeast","souvenir","sovereignty","sow","soy","soybean","space","spacing","spade","spaghetti","span","spandex","spank","sparerib","spark","sparrow","spasm","spat","spatula","spawn","speaker","speakerphone","speaking","spear","spec","special","specialist","specialty","species","specification","spectacle","spectacles","spectrograph","spectrum","speculation","speech","speed","speedboat","spell","spelling","spelt","spending","sphere","sphynx","spice","spider","spiderling","spike","spill","spinach","spine","spiral","spirit","spiritual","spirituality","spit","spite","spleen","splendor","split","spokesman","spokeswoman","sponge","sponsor","sponsorship","spool","spoon","spork","sport","sportsman","spot","spotlight","spouse","sprag","sprat","spray","spread","spreadsheet","spree","spring","sprinkles","sprinter","sprout","spruce","spud","spume","spur","spy","spyglass","square","squash","squatter","squeegee","squid","squirrel","stab","stability","stable","stack","stacking","stadium","staff","stag","stage","stain","stair","staircase","stake","stalk","stall","stallion","stamen","stamina","stamp","stance","stand","standard","standardisation","standardization","standing","standoff","standpoint","star","starboard","start","starter","state","statement","statin","station","station-wagon","statistic","statistics","statue","status","statute","stay","steak","stealth","steam","steamroller","steel","steeple","stem","stench","stencil","step","step-aunt","step-brother","step-daughter","step-father","step-grandfather","step-grandmother","step-mother","step-sister","step-son","step-uncle","stepdaughter","stepmother","stepping-stone","stepson","stereo","stew","steward","stick","sticker","stiletto","still","stimulation","stimulus","sting","stinger","stir-fry","stitch","stitcher","stock","stock-in-trade","stockings","stole","stomach","stone","stonework","stool","stop","stopsign","stopwatch","storage","store","storey","storm","story","story-telling","storyboard","stot","stove","strait","strand","stranger","strap","strategy","straw","strawberry","strawman","stream","street","streetcar","strength","stress","stretch","strife","strike","string","strip","stripe","strobe","stroke","structure","strudel","struggle","stucco","stud","student","studio","study","stuff","stumbling","stump","stupidity","sturgeon","sty","style","styling","stylus","sub","subcomponent","subconscious","subcontractor","subexpression","subgroup","subject","submarine","submitter","subprime","subroutine","subscription","subsection","subset","subsidence","subsidiary","subsidy","substance","substitution","subtitle","suburb","subway","success","succotash","suck","sucker","suede","suet","suffocation","sugar","suggestion","suicide","suit","suitcase","suite","sulfur","sultan","sum","summary","summer","summit","sun","sunbeam","sunbonnet","sundae","sunday","sundial","sunflower","sunglasses","sunlamp","sunlight","sunrise","sunroom","sunset","sunshine","superiority","supermarket","supernatural","supervision","supervisor","supper","supplement","supplier","supply","support","supporter","suppression","supreme","surface","surfboard","surge","surgeon","surgery","surname","surplus","surprise","surround","surroundings","surrounds","survey","survival","survivor","sushi","suspect","suspenders","suspension","sustainment","sustenance","swallow","swamp","swan","swanling","swath","sweat","sweater","sweatshirt","sweatshop","sweatsuit","sweets","swell","swim","swimming","swimsuit","swine","swing","switch","switchboard","switching","swivel","sword","swordfight","swordfish","sycamore","symbol","symmetry","sympathy","symptom","syndicate","syndrome","synergy","synod","synonym","synthesis","syrup","system","t-shirt","tab","tabby","tabernacle","table","tablecloth","tablet","tabletop","tachometer","tackle","taco","tactics","tactile","tadpole","tag","tail","tailbud","tailor","tailspin","take-out","takeover","tale","talent","talk","talking","tam-o'-shanter","tamale","tambour","tambourine","tan","tandem","tangerine","tank","tank-top","tanker","tankful","tap","tape","tapioca","target","taro","tarragon","tart","task","tassel","taste","tatami","tattler","tattoo","tavern","tax","taxi","taxicab","taxpayer","tea","teacher","teaching","team","teammate","teapot","tear","tech","technician","technique","technologist","technology","tectonics","teen","teenager","teepee","telephone","telescreen","teletype","television","tell","teller","temp","temper","temperature","temple","tempo","temporariness","temporary","temptation","temptress","tenant","tendency","tender","tenement","tenet","tennis","tenor","tension","tensor","tent","tentacle","tenth","tepee","teriyaki","term","terminal","termination","terminology","termite","terrace","terracotta","terrapin","terrarium","territory","terror","terrorism","terrorist","test","testament","testimonial","testimony","testing","text","textbook","textual","texture","thanks","thaw","theater","theft","theism","theme","theology","theory","therapist","therapy","thermals","thermometer","thermostat","thesis","thickness","thief","thigh","thing","thinking","thirst","thistle","thong","thongs","thorn","thought","thousand","thread","threat","threshold","thrift","thrill","throat","throne","thrush","thrust","thug","thumb","thump","thunder","thunderbolt","thunderhead","thunderstorm","thyme","tiara","tic","tick","ticket","tide","tie","tiger","tights","tile","till","tilt","timbale","timber","time","timeline","timeout","timer","timetable","timing","timpani","tin","tinderbox","tinkle","tintype","tip","tire","tissue","titanium","title","toad","toast","toaster","tobacco","today","toe","toenail","toffee","tofu","tog","toga","toilet","tolerance","tolerant","toll","tom-tom","tomatillo","tomato","tomb","tomography","tomorrow","ton","tonality","tone","tongue","tonic","tonight","tool","toot","tooth","toothbrush","toothpaste","toothpick","top","top-hat","topic","topsail","toque","toreador","tornado","torso","torte","tortellini","tortilla","tortoise","tosser","total","tote","touch","tough-guy","tour","tourism","tourist","tournament","tow-truck","towel","tower","town","townhouse","township","toy","trace","trachoma","track","tracking","tracksuit","tract","tractor","trade","trader","trading","tradition","traditionalism","traffic","trafficker","tragedy","trail","trailer","trailpatrol","train","trainer","training","trait","tram","tramp","trance","transaction","transcript","transfer","transformation","transit","transition","translation","transmission","transom","transparency","transplantation","transport","transportation","trap","trapdoor","trapezium","trapezoid","trash","travel","traveler","tray","treasure","treasury","treat","treatment","treaty","tree","trek","trellis","tremor","trench","trend","triad","trial","triangle","tribe","tributary","trick","trigger","trigonometry","trillion","trim","trinket","trip","tripod","tritone","triumph","trolley","trombone","troop","trooper","trophy","trouble","trousers","trout","trove","trowel","truck","trumpet","trunk","trust","trustee","truth","try","tsunami","tub","tuba","tube","tuber","tug","tugboat","tuition","tulip","tumbler","tummy","tuna","tune","tune-up","tunic","tunnel","turban","turf","turkey","turmeric","turn","turning","turnip","turnover","turnstile","turret","turtle","tusk","tussle","tutu","tuxedo","tweet","tweezers","twig","twilight","twine","twins","twist","twister","twitter","type","typeface","typewriter","typhoon","ukulele","ultimatum","umbrella","unblinking","uncertainty","uncle","underclothes","underestimate","underground","underneath","underpants","underpass","undershirt","understanding","understatement","undertaker","underwear","underweight","underwire","underwriting","unemployment","unibody","uniform","uniformity","union","unique","unit","unity","universe","university","update","upgrade","uplift","upper","upstairs","upward","urge","urgency","urn","usage","use","user","usher","usual","utensil","utilisation","utility","utilization","vacation","vaccine","vacuum","vagrant","valance","valentine","validate","validity","valley","valuable","value","vampire","van","vanadyl","vane","vanilla","vanity","variability","variable","variant","variation","variety","vascular","vase","vault","vaulting","veal","vector","vegetable","vegetarian","vegetarianism","vegetation","vehicle","veil","vein","veldt","vellum","velocity","velodrome","velvet","vendor","veneer","vengeance","venison","venom","venti","venture","venue","veranda","verb","verdict","verification","vermicelli","vernacular","verse","version","vertigo","verve","vessel","vest","vestment","vet","veteran","veterinarian","veto","viability","vibe","vibraphone","vibration","vibrissae","vice","vicinity","victim","victory","video","view","viewer","vignette","villa","village","vine","vinegar","vineyard","vintage","vintner","vinyl","viola","violation","violence","violet","violin","virginal","virtue","virus","visa","viscose","vise","vision","visit","visitor","visor","vista","visual","vitality","vitamin","vitro","vivo","vixen","vodka","vogue","voice","void","vol","volatility","volcano","volleyball","volume","volunteer","volunteering","vomit","vote","voter","voting","voyage","vulture","wad","wafer","waffle","wage","wagon","waist","waistband","wait","waiter","waiting","waitress","waiver","wake","walk","walker","walking","walkway","wall","wallaby","wallet","walnut","walrus","wampum","wannabe","want","war","warden","wardrobe","warfare","warlock","warlord","warm-up","warming","warmth","warning","warrant","warren","warrior","wasabi","wash","washbasin","washcloth","washer","washtub","wasp","waste","wastebasket","wasting","watch","watcher","watchmaker","water","waterbed","watercress","waterfall","waterfront","watermelon","waterskiing","waterspout","waterwheel","wave","waveform","wax","way","weakness","wealth","weapon","wear","weasel","weather","web","webinar","webmail","webpage","website","wedding","wedge","weed","weeder","weedkiller","week","weekend","weekender","weight","weird","welcome","welfare","well","well-being","west","western","wet-bar","wetland","wetsuit","whack","whale","wharf","wheat","wheel","whelp","whey","whip","whirlpool","whirlwind","whisker","whiskey","whisper","whistle","white","whole","wholesale","wholesaler","whorl","wick","widget","widow","width","wife","wifi","wild","wildebeest","wilderness","wildlife","will","willingness","willow","win","wind","wind-chime","windage","window","windscreen","windshield","wine","winery","wing","wingman","wingtip","wink","winner","winter","wire","wiretap","wiring","wisdom","wiseguy","wish","wisteria","wit","witch","witch-hunt","withdrawal","witness","wok","wolf","woman","wombat","wonder","wont","wood","woodchuck","woodland","woodshed","woodwind","wool","woolens","word","wording","work","workbench","worker","workforce","workhorse","working","workout","workplace","workshop","world","worm","worry","worship","worshiper","worth","wound","wrap","wraparound","wrapper","wrapping","wreck","wrecker","wren","wrench","wrestler","wriggler","wrinkle","wrist","writer","writing","wrong","xylophone","yacht","yahoo","yak","yam","yang","yard","yarmulke","yarn","yawl","year","yeast","yellow","yellowjacket","yesterday","yew","yin","yoga","yogurt","yoke","yolk","young","youngster","yourself","youth","yoyo","yurt","zampone","zebra","zebrafish","zen","zephyr","zero","ziggurat","zinc","zipper","zither","zombie","zone","zoo","zoologist","zoology","zoot-suit","zucchini"];var Ms=["a","abaft","aboard","about","above","absent","across","afore","after","against","along","alongside","amid","amidst","among","amongst","an","anenst","anti","apropos","apud","around","as","aside","astride","at","athwart","atop","barring","before","behind","below","beneath","beside","besides","between","beyond","but","by","circa","concerning","considering","despite","down","during","except","excepting","excluding","failing","following","for","forenenst","from","given","in","including","inside","into","lest","like","mid","midst","minus","modulo","near","next","notwithstanding","of","off","on","onto","opposite","out","outside","over","pace","past","per","plus","pro","qua","regarding","round","sans","save","since","than","the","through","throughout","till","times","to","toward","towards","under","underneath","unlike","until","unto","up","upon","versus","via","vice","with","within","without","worth"];var zs=["abandon","abase","abate","abbreviate","abdicate","abduct","abet","abhor","abide","abjure","abnegate","abolish","abominate","abort","abound","abrade","abridge","abrogate","abscond","abseil","absent","absolve","absorb","abstain","abstract","abuse","abut","accede","accelerate","accent","accentuate","accept","access","accessorise","accessorize","acclaim","acclimate","acclimatise","acclimatize","accommodate","accompany","accomplish","accord","accost","account","accouter","accoutre","accredit","accrue","acculturate","accumulate","accuse","accustom","ace","ache","achieve","acidify","acknowledge","acquaint","acquiesce","acquire","acquit","act","action","activate","actualise","actualize","actuate","adapt","add","addle","address","adduce","adhere","adjoin","adjourn","adjudge","adjudicate","adjure","adjust","administer","admire","admit","admonish","adopt","adore","adorn","adsorb","adulterate","adumbrate","advance","advantage","advertise","advise","advocate","aerate","affect","affiliate","affirm","affix","afflict","afford","afforest","affront","age","agglomerate","aggravate","aggregate","agitate","agonise","agonize","agree","aid","ail","aim","air","airbrush","airdrop","airfreight","airlift","alarm","alert","alienate","alight","align","allay","allege","alleviate","allocate","allot","allow","alloy","allude","ally","alphabetise","alphabetize","alter","alternate","amalgamate","amass","amaze","amble","ambush","ameliorate","amend","amortise","amortize","amount","amplify","amputate","amuse","anaesthetise","anaesthetize","analyse","anchor","anesthetize","anger","angle","anglicise","anglicize","animate","anneal","annex","annihilate","annotate","announce","annoy","annul","anodise","anodize","anoint","anonymise","anonymize","answer","antagonise","antagonize","antedate","anthologise","anthologize","anticipate","ape","apologise","apologize","apostrophise","apostrophize","appal","appall","appeal","appear","appease","append","appertain","applaud","apply","appoint","apportion","appraise","appreciate","apprehend","apprentice","apprise","approach","appropriate","approve","approximate","aquaplane","arbitrate","arc","arch","archive","argue","arise","arm","arouse","arraign","arrange","array","arrest","arrive","arrogate","arse","art","articulate","ascend","ascertain","ascribe","ask","asphyxiate","aspirate","aspire","assail","assassinate","assault","assay","assemble","assent","assert","assess","assign","assimilate","assist","associate","assuage","assume","assure","asterisk","astonish","astound","atomise","atomize","atone","atrophy","attach","attack","attain","attempt","attend","attenuate","attest","attract","attribute","auction","audit","audition","augment","augur","authenticate","author","authorise","authorize","autograph","automate","autosave","autowind","avail","avenge","aver","average","avert","avoid","avow","await","awake","awaken","award","awe","ax","axe","baa","babble","baby","babysit","back","backcomb","backdate","backfill","backfire","backlight","backpack","backspace","backtrack","badger","baffle","bag","bail","bait","bake","balance","bale","ball","balloon","ballot","balls","bamboozle","ban","band","bandage","bandy","bang","bangs","banish","bank","bankroll","bankrupt","banter","baptise","baptize","bar","barbecue","bare","barf","bargain","barge","bark","barnstorm","barrack","barrel","barricade","barter","base","bash","bask","bastardise","bastardize","baste","bat","batch","bath","bathe","batten","batter","battle","baulk","bawl","bay","bayonet","be","beach","beam","bean","bear","beard","beat","beatbox","beatboxer","beatify","beautify","beaver","beckon","become","bed","bedazzle","bedeck","bedevil","beef","beep","beetle","befall","befit","befog","befriend","beg","beget","beggar","begin","begrudge","beguile","behave","behead","behold","behoove","behove","belabor","belabour","belay","belch","belie","believe","belittle","bellow","belly","bellyache","belong","belt","bemoan","bemuse","benchmark","bend","benefit","bequeath","berate","bereave","berth","beseech","beset","besiege","besmirch","bespatter","bespeak","best","bestir","bestow","bestride","bet","betake","betide","betoken","betray","better","bewail","beware","bewilder","bewitch","bias","bicker","bicycle","bid","bide","biff","bifurcate","big","bike","bilk","bill","billet","billow","bin","bind","binge","biodegrade","bird","bisect","bitch","bite","bitmap","bivouac","bivvy","blab","blabber","black","blackball","blacken","blacklist","blackmail","blag","blame","blanch","blank","blanket","blare","blaspheme","blast","blather","blaze","blazon","bleach","bleat","bleed","bleep","blemish","blench","blend","bless","blight","blind","blindfold","blindfolded","blindside","blink","bliss","blister","blitz","bloat","block","blockade","blog","blood","bloom","bloop","blossom","blot","blow","blub","blubber","bludge","bludgeon","bluff","blunder","blunt","blur","blurt","blush","bluster","board","boast","bob","bobble","bode","bodge","bog","boggle","boil","bolster","bolt","bomb","bombard","bond","bone","bonk","boo","boob","boogie","book","bookmark","boom","boomerang","boost","boot","bootleg","booze","bop","border","bore","born","borrow","boss","botch","bother","bottle","bottleful","bottom","bounce","bound","bow","bowdlerise","bowdlerize","bowl","bowlful","box","boycott","braai","brace","braces","bracket","brag","braid","brain","brainstorm","brainwash","braise","brake","branch","brand","brandish","brave","brawl","bray","brazen","breach","break","breakfast","breast","breastfeed","breathalyse","breathalyze","breathe","breed","breeze","brew","bribe","brick","bridge","bridle","brief","brighten","brim","bring","bristle","broach","broadcast","broaden","broadside","broil","broker","brood","brook","browbeat","brown","browse","bruise","bruit","brush","brutalise","brutalize","bubble","buck","bucket","bucketful","buckle","bud","buddy","budge","budget","buff","buffer","buffet","bug","bugger","build","bulge","bulk","bulldoze","bullshit","bully","bum","bumble","bump","bunch","bundle","bung","bungle","bunk","bunker","bunt","buoy","burble","burden","burgeon","burglarize","burgle","burn","burnish","burp","burrow","burst","bury","bus","bushwhack","busk","bust","bustle","busy","butcher","butt","butter","button","buttonhole","buttress","buy","buzz","buzzing","bypass","cable","cache","cackle","caddie","cadge","cage","cajole","cake","calcify","calculate","calibrate","call","calm","calve","camouflage","camp","campaign","can","canalise","canalize","cancel","cane","cannibalise","cannibalize","cannon","cannulate","canoe","canonise","canonize","canoodle","canst","cant","canter","canvass","cap","caper","capitalise","capitalize","capitulate","capsize","captain","caption","captivate","capture","caramelise","caramelize","carbonise","carbonize","carburise","carburize","card","care","careen","career","caress","caricature","carjack","carol","carom","carouse","carp","carpet","carpool","carry","cart","cartwheel","carve","cascade","case","cash","cashier","casserole","cast","castigate","castrate","catalog","catalogue","catalyse","catalyze","catapult","catch","categorise","categorize","cater","caterwaul","catnap","caucus","caulk","cause","cauterise","cauterize","caution","cave","cavil","cavort","caw","cc","cease","cede","celebrate","cement","censor","censure","centralise","centralize","centre","certificate","certify","chafe","chaff","chain","chair","chalk","challenge","champ","champion","chance","change","channel","chant","chaperon","chaperone","char","characterise","characterize","charbroil","charge","chargesheet","chargrill","charm","chart","charter","chase","chasten","chastise","chat","chatter","chauffeur","cheapen","cheat","cheater","check","checkmate","cheek","cheep","cheer","cherish","chew","chicken","chide","chill","chillax","chime","chink","chip","chirp","chisel","chivvy","chlorinate","choke","chomp","choose","chop","choreograph","chortle","chorus","christen","chromakey","chronicle","chuck","chuckle","chug","chunder","chunter","churn","cinch","circle","circulate","circumcise","circumnavigate","circumscribe","circumvent","cite","civilise","civilize","clack","claim","clam","clamber","clamor","clamour","clamp","clang","clank","clap","clarify","clash","clasp","class","classify","clatter","claw","clean","cleanse","clear","cleave","clench","clerk","click","climax","climb","clinch","cling","clink","clinking","clip","cloak","clobber","clock","clog","clone","clonk","close","closet","clot","clothe","cloud","clout","clown","club","cluck","clue","clump","clunk","cluster","clutch","clutter","coach","coagulate","coalesce","coarsen","coast","coat","coax","cobble","cock","cocoon","coddle","code","codify","coerce","coexist","cogitate","cohabit","cohere","coil","coin","coincide","collaborate","collapse","collar","collate","collect","collectivise","collectivize","collide","colligate","collocate","collude","colonise","colonize","colorize","colour","comb","combat","combine","combust","come","comfort","command","commandeer","commemorate","commence","commend","comment","commentate","commercialise","commercialize","commingle","commiserate","commission","commit","commune","communicate","commute","compact","compare","compartmentalise","compartmentalize","compel","compensate","compete","compile","complain","complement","complete","complicate","compliment","comply","comport","compose","compost","compound","comprehend","compress","comprise","compromise","compute","computerise","computerize","con","conceal","concede","conceive","concentrate","conceptualise","conceptualize","concern","concertina","conciliate","conclude","concoct","concrete","concur","concuss","condemn","condense","condescend","condition","condone","conduct","cone","confer","confess","confide","configure","confine","confirm","confiscate","conflate","conflict","conform","confound","confront","confuse","confute","congeal","congratulate","congregate","conjecture","conjoin","conjugate","conjure","conk","connect","connive","connote","conquer","conscientise","conscientize","conscript","consecrate","consent","conserve","consider","consign","consist","console","consolidate","consort","conspire","constitute","constrain","constrict","construct","construe","consult","consume","consummate","contact","contain","contaminate","contemplate","contend","content","contest","contextualise","contextualize","continue","contort","contract","contradict","contraindicate","contrast","contravene","contribute","contrive","control","controvert","convalesce","convene","converge","converse","convert","convey","convict","convince","convoke","convulse","coo","cook","cool","coop","cooperate","coordinate","cop","cope","coppice","copulate","copy","copyright","cordon","core","cork","corkscrew","corner","corral","correct","correlate","correspond","corrode","corrupt","coruscate","cosh","cosset","cost","cosy","cotton","couch","cough","counsel","count","countenance","counter","counteract","counterbalance","counterfeit","countermand","counterpoint","countersign","couple","courier","course","court","covenant","cover","covet","cow","cower","cox","cozy","crack","crackle","cradle","craft","cram","cramp","crane","crank","crap","crash","crate","crave","crawl","crayon","creak","creaking","cream","crease","create","credential","credit","creep","cremate","creolise","creolize","creosote","crest","crew","crib","crick","criminalise","criminalize","crimp","cringe","crinkle","cripple","crisp","criticise","criticize","critique","croak","crochet","crook","croon","crop","cross","crouch","crow","crowd","crown","crucify","cruise","crumble","crumple","crunch","crusade","crush","cry","crystallise","crystallize","cube","cuckold","cuddle","cudgel","cue","cuff","cull","culminate","cultivate","culture","cup","curate","curb","curdle","cure","curl","curry","curse","curtail","curtain","curtsy","curve","cushion","cuss","customise","customize","cut","cwtch","cycle","dab","dabble","dally","dam","damage","dammit","damn","damp","dampen","dance","dandle","dangle","dare","darken","darn","dart","dash","date","daub","daunt","dawdle","dawn","daydream","dazzle","deactivate","deaden","deadhead","deafen","deal","debar","debase","debate","debilitate","debit","debrief","debug","debunk","debut","decamp","decant","decapitate","decay","deceive","decelerate","decentralise","decentralize","decide","decimalise","decimalize","decimate","decipher","deck","declaim","declare","declassify","decline","declutter","decode","decommission","decompose","decompress","deconsecrate","deconstruct","decontaminate","decontrol","decorate","decouple","decoy","decrease","decree","decriminalise","decriminalize","decry","decrypt","dedicate","deduce","deduct","deejay","deem","deepen","deface","defame","default","defeat","defecate","defect","defend","defer","defile","define","deflate","deflect","deflower","defog","defoliate","deforest","deform","defrag","defragment","defraud","defray","defrock","defrost","defuse","defy","degenerate","deglaze","degrade","degrease","dehumanise","dehumanize","dehydrate","deify","deign","delay","delegate","delete","deliberate","delight","delimit","delineate","deliquesce","deliver","delouse","delude","deluge","delve","demand","demarcate","demean","demerge","demilitarise","demilitarize","demineralise","demineralize","demist","demo","demob","demobilise","demobilize","democratise","democratize","demolish","demonise","demonize","demonstrate","demoralise","demoralize","demote","demotivate","demur","demystify","denationalise","denationalize","denigrate","denitrify","denominate","denote","denounce","dent","denude","deny","depart","depend","depersonalise","depersonalize","depict","deplane","deplete","deplore","deploy","depopulate","deport","depose","deposit","deprave","deprecate","depreciate","depress","depressurise","depressurize","deprive","depute","deputise","deputize","deracinate","derail","dereference","deregulate","deride","derive","derogate","descale","descend","describe","descry","desecrate","desegregate","deselect","desensitise","desensitize","desert","deserve","design","designate","desire","desist","deskill","desolate","despair","despise","despoil","destabilise","destabilize","destock","destroy","detach","detail","detain","detect","deter","deteriorate","determine","detest","dethrone","detonate","detour","detoxify","detract","detrain","devalue","devastate","develop","deviate","devise","devoice","devolve","devote","devour","diagnose","dial","dice","dicker","dictate","diddle","die","diet","differ","differentiate","diffract","diffuse","dig","digest","digitalise","digitalize","digitise","digitize","dignify","digress","dilate","dilute","diluted","dim","diminish","dimple","dine","ding","dink","dip","diphthongise","diphthongize","direct","dirty","dis","disable","disabuse","disadvantage","disaffiliate","disafforest","disagree","disallow","disambiguate","disappear","disappoint","disapprove","disarm","disarrange","disassemble","disassociate","disavow","disband","disbar","disbelieve","disburse","discard","discern","discharge","discipline","disclaim","disclose","discolor","discolour","discomfit","discomfort","discompose","disconcert","disconnect","discontinue","discount","discourage","discourse","discover","discredit","discriminate","discuss","disdain","disembark","disembowel","disenfranchise","disengage","disentangle","disestablish","disfigure","disgorge","disgrace","disguise","disgust","dish","dishearten","dishonor","dishonour","disillusion","disincentivise","disincentivize","disinfect","disinherit","disinhibit","disintegrate","disinter","disinvest","dislike","dislocate","dislodge","dismantle","dismay","dismember","dismiss","dismount","disobey","disorient","disorientate","disown","disparage","dispatch","dispel","dispense","disperse","displace","display","displease","disport","dispose","dispossess","disprove","dispute","disqualify","disregard","disrespect","disrobe","disrupt","dissect","dissemble","disseminate","dissent","dissimulate","dissipate","dissociate","dissolve","dissuade","distance","distend","distil","distill","distinguish","distort","distract","distress","distribute","distrust","disturb","disunite","ditch","dither","dive","diverge","diversify","divert","divest","divide","divine","divorce","divulge","divvy","do","dob","dock","doctor","document","dodge","doff","dog","dole","doll","dollarise","dollarize","domesticate","dominate","don","donate","doodle","doom","doorstep","dop","dope","dose","doss","dot","dote","double","doubt","douche","douse","dovetail","down","downchange","downgrade","downlink","download","downplay","downshift","downsize","dowse","doze","draft","drag","dragoon","drain","dramatise","dramatize","drape","draught","draw","drawl","dread","dream","dredge","drench","dress","dribble","drift","drill","drink","drip","drive","drivel","drizzle","drone","drool","droop","drop","drown","drowse","drug","drum","dry","dub","duck","duckie","ducks","duel","duff","dull","dumb","dumbfound","dummy","dump","dunk","dunt","dupe","duplicate","dust","dwarf","dwell","dwindle","dye","dynamite","earmark","earn","earth","ease","eat","eavesdrop","ebb","echo","eclipse","economise","economize","eddy","edge","edify","edit","editorialise","editorialize","educate","eff","efface","effect","effectuate","egg","ejaculate","eject","eke","elaborate","elapse","elbow","elect","electrify","electrocute","electroplate","elevate","elicit","elide","eliminate","elongate","elope","elucidate","elude","email","emanate","emancipate","emasculate","embalm","embargo","embark","embarrass","embed","embellish","embezzle","embitter","emblazon","embody","embolden","emboss","embrace","embroider","embroil","emcee","emend","emerge","emigrate","emit","emote","empathise","empathize","emphasise","emphasize","employ","empower","empty","emulate","emulsify","enable","enact","encamp","encapsulate","encase","encash","enchant","encircle","enclose","encode","encompass","encounter","encourage","encroach","encrypt","encumber","end","endanger","endear","endeavor","endeavour","endorse","endow","endure","energise","energize","enervate","enfeeble","enfold","enforce","enfranchise","engage","engender","engineer","engorge","engrave","engross","engulf","enhance","enjoin","enjoy","enlarge","enlighten","enlist","enliven","enmesh","ennoble","enquire","enrage","enrapture","enrich","enrol","enroll","ensconce","enshrine","enshroud","enslave","ensnare","ensue","ensure","entail","entangle","enter","entertain","enthral","enthrall","enthrone","enthuse","entice","entitle","entomb","entrance","entrap","entreat","entrench","entrust","entwine","enumerate","enunciate","envelop","envisage","envision","envy","epitomise","epitomize","equal","equalise","equalize","equate","equip","equivocate","eradicate","erase","erect","erode","err","erupt","escalate","escape","eschew","escort","espouse","espy","essay","establish","esteem","estimate","etch","eulogise","eulogize","euthanise","euthanize","evacuate","evade","evaluate","evangelise","evangelize","evaporate","even","eventuate","evict","evidence","evince","eviscerate","evoke","evolve","exacerbate","exact","exaggerate","exalt","examine","exasperate","excavate","exceed","excel","except","excerpt","exchange","excise","excite","exclaim","exclude","excommunicate","excoriate","excrete","exculpate","excuse","execute","exemplify","exempt","exercise","exert","exeunt","exfoliate","exhale","exhaust","exhibit","exhilarate","exhort","exhume","exile","exist","exit","exonerate","exorcise","exorcize","expand","expatiate","expect","expectorate","expedite","expel","expend","experience","experiment","expiate","expire","explain","explicate","explode","exploit","explore","export","expose","expostulate","expound","express","expropriate","expunge","expurgate","extemporise","extemporize","extend","exterminate","externalise","externalize","extinguish","extirpate","extol","extort","extract","extradite","extrapolate","extricate","extrude","exude","exult","eye","eyeball","eyeglasses","fabricate","face","facilitate","factor","factorise","factorize","fade","faff","fail","faint","fake","fall","falsify","falter","familiarise","familiarize","fan","fancy","fantasise","fantasize","fare","farewell","farm","farrow","fart","fascinate","fashion","fast","fasten","father","fathom","fatten","fault","favor","favour","fawn","fax","faze","fear","feast","feather","feature","federate","feed","feel","feign","feint","fell","fellate","feminise","feminize","fence","fend","ferment","ferret","ferry","fertilise","fertilize","fess","fester","festoon","fetch","fete","fetishise","fetishize","fetter","feud","fib","fictionalise","fictionalize","fiddle","fidget","field","fight","figure","filch","file","filibuster","fill","fillet","film","filter","finagle","finalise","finalize","finance","find","fine","finesse","finger","fingerprint","finish","fire","firebomb","firm","fish","fishtail","fit","fix","fizz","fizzle","flag","flagellate","flail","flake","flame","flank","flap","flare","flash","flat","flatline","flatten","flatter","flaunt","flavour","flay","fleck","flee","fleece","flesh","flex","flick","flicker","flight","flinch","fling","flip","flirt","flit","float","flock","flog","flood","floodlight","floor","flop","floss","flounce","flounder","flour","flourish","flout","flow","flower","flub","fluctuate","fluff","flummox","flunk","flush","fluster","flutter","fly","foal","foam","fob","focalise","focalize","focus","fog","foil","foist","fold","follow","foment","fondle","fool","foot","forage","forbear","forbid","force","ford","forearm","forecast","foreclose","foregather","foreground","foresee","foreshadow","foreshorten","forestall","foretell","forewarn","forfeit","forfend","forgather","forge","forget","forgive","forgo","fork","form","formalise","formalize","format","formulate","fornicate","forsake","forswear","fortify","forward","forwards","fossick","fossilise","fossilize","foster","foul","found","founder","fox","fracture","fragment","frame","franchise","frank","fraternise","fraternize","fray","freak","free","freelance","freeload","freestyle","freewheel","freeze","freight","frequent","freshen","fret","frighten","fringe","frisk","fritter","frizz","frizzle","frogmarch","frolic","front","frost","froth","frown","fruit","frustrate","fry","fuck","fudge","fuel","fulfil","fulfill","fulminate","fumble","fume","fumigate","function","fund","funk","funnel","furl","furlough","furnish","furrow","further","fuse","fuss","gab","gabble","gad","gag","gain","gainsay","gall","gallivant","gallop","galumph","galvanise","galvanize","gamble","gambol","gang","gape","garage","garden","gargle","garland","garner","garnish","garrison","garrote","garrotte","gas","gash","gasp","gatecrash","gather","gauge","gawk","gawp","gaze","gazump","gazunder","gear","gee","gel","geld","gen","generalise","generalize","generate","gentrify","genuflect","germinate","gerrymander","gestate","gesticulate","gesture","get","ghost","ghostwrite","gibber","gift","giggle","gild","ginger","gird","girdle","give","gladden","glamorise","glamorize","glance","glare","glass","glaze","gleam","glean","glide","glimmer","glimmering","glimpse","glint","glisten","glister","glitter","gloat","globalise","globalize","glom","glorify","glory","gloss","glow","glower","glue","glug","glut","gnash","gnaw","go","goad","gob","gobble","goggle","goldbrick","goof","google","goose","gore","gorge","gossip","gouge","govern","grab","grace","grade","graduate","graft","grant","grapple","grasp","grass","grate","gratify","gravitate","graze","grease","green","greet","grey","grieve","grill","grimace","grin","grind","grip","gripe","grit","grizzle","groan","grok","groom","grope","gross","grouch","ground","group","grouse","grout","grovel","grow","growl","grub","grudge","grumble","grunt","guarantee","guard","guess","guest","guffaw","guide","guillotine","guilt","gulp","gum","gun","gurgle","gurn","gush","gussy","gust","gut","gutter","guzzle","gybe","gyp","gyrate","hack","haemorrhage","haggle","hail","hallmark","halloo","hallucinate","halt","halve","ham","hammer","hamper","hamstring","hand","handcuff","handicap","handle","hang","hanker","happen","harangue","harass","harbor","harbour","harden","hare","hark","harm","harmonise","harmonize","harness","harp","harpoon","harrow","harrumph","harry","harvest","hash","hassle","hasten","hatch","hate","haul","haunt","have","haw","hawk","hazard","haze","head","headbutt","headhunt","headline","heal","heap","hear","hearken","hearten","heat","heave","heckle","hector","hedge","heed","heel","heft","heighten","heist","help","hem","hemorrhage","herald","herd","hesitate","hew","hex","hibernate","hiccough","hiccup","hide","hie","highball","highlight","hightail","hijack","hike","hinder","hinge","hint","hire","hiss","hit","hitch","hitchhike","hive","hoard","hoax","hobble","hobnob","hock","hoe","hog","hoick","hoist","hold","hole","holiday","holler","hollow","holster","home","homeschool","homestead","hone","honeymoon","honk","honour","hoodwink","hoof","hook","hoon","hoot","hoover","hop","hope","horn","horrify","horse","horsewhip","hose","hosepipe","hospitalise","hospitalize","host","hot","hotfoot","hound","house","hover","howl","huddle","huff","hug","hull","hum","humanise","humanize","humble","humiliate","humour","hump","hunch","hunger","hunker","hunt","hurdle","hurl","hurry","hurt","hurtle","husband","hush","husk","hustle","hybridise","hybridize","hydrate","hydroplane","hype","hyperventilate","hyphenate","hypnotise","hypnotize","hypothesise","hypothesize","ice","iconify","idealise","idealize","ideate","identify","idle","idolise","idolize","ignite","ignore","illuminate","illumine","illustrate","imagine","imagineer","imbibe","imbue","imitate","immerse","immigrate","immobilise","immobilize","immolate","immortalise","immortalize","immunise","immunize","immure","impact","impair","impale","impanel","impart","impeach","impede","impel","imperil","impersonate","impinge","implant","implement","implicate","implode","implore","imply","import","importune","impose","impound","impoverish","impregnate","impress","imprint","imprison","improve","improvise","impugn","inactivate","inaugurate","incapacitate","incarcerate","incarnate","incense","incentivise","incentivize","inch","incinerate","incise","incite","incline","include","incommode","inconvenience","incorporate","increase","incriminate","incubate","inculcate","incur","indemnify","indent","index","indicate","indict","individualise","individualize","individuate","indoctrinate","induce","induct","indulge","industrialise","industrialize","infantilise","infantilize","infect","infer","infest","infill","infiltrate","inflame","inflate","inflect","inflict","influence","inform","infringe","infuriate","infuse","ingest","ingratiate","inhabit","inhale","inhere","inherit","inhibit","initial","initialise","initialize","initiate","inject","injure","ink","inlay","innovate","inoculate","input","inscribe","inseminate","insert","inset","insinuate","insist","inspect","inspire","install","instance","instigate","instil","instill","institute","institutionalise","institutionalize","instruct","insulate","insult","insure","integrate","intend","intensify","inter","interact","interbreed","intercede","intercept","interchange","interconnect","intercut","interest","interface","interfere","interject","interlace","interleave","interlink","interlock","intermarry","intermesh","intermingle","intermix","intern","internalise","internalize","internationalise","internationalize","interpenetrate","interpolate","interpose","interpret","interrelate","interrogate","interrupt","intersect","intersperse","intertwine","intervene","interview","interweave","interwork","intimate","intimidate","intone","intoxicate","intrigue","introduce","intrude","intubate","intuit","inundate","inure","invade","invalid","invalidate","inveigh","inveigle","invent","inventory","invert","invest","investigate","invigilate","invigorate","invite","invoice","invoke","involve","ionise","ionize","irk","iron","irradiate","irrigate","irritate","irrupt","isolate","issue","italicise","italicize","itch","itemise","itemize","iterate","jab","jabber","jack","jackknife","jail","jam","jangle","jar","jaw","jaywalk","jazz","jeer","jell","jeopardise","jeopardize","jerk","jest","jet","jettison","jib","jibe","jig","jiggle","jilt","jingle","jink","jinx","jive","jockey","jog","joggle","join","joint","joke","jol","jolly","jolt","josh","jostle","jot","journey","joust","judder","judge","juggle","juice","jumble","jump","junk","justify","jut","juxtapose","keel","keelhaul","keen","keep","ken","key","keyboard","kibitz","kick","kid","kidnap","kill","kindle","kink","kip","kiss","kit","kite","klap","kludge","knacker","knead","knee","kneecap","kneel","knife","knight","knit","knock","knot","know","knuckle","kowtow","kvetch","label","labour","lace","lacerate","lack","lacquer","lactate","ladder","ladle","lag","lam","lamb","lambast","lambaste","lament","lamp","lampoon","lance","land","lands","landscape","languish","lap","lapse","lard","large","lark","lash","lasso","last","latch","lather","laud","laugh","launch","launder","lavish","lay","layer","laze","leach","lead","leaf","leaflet","leak","lean","leap","leapfrog","learn","lease","leash","leave","leaven","lech","lecture","leer","leg","legalise","legalize","legislate","legitimise","legitimize","lend","lengthen","lessen","let","letter","letterbox","level","lever","leverage","levitate","levy","liaise","libel","liberalise","liberalize","liberate","license","lick","lie","lift","ligate","light","lighten","like","liken","limber","lime","limit","limp","line","linger","link","lionise","lionize","liquefy","liquidate","liquidise","liquidize","lisp","list","listen","litigate","litter","live","liven","load","loads","loaf","loan","loathe","lob","lobby","lobotomise","lobotomize","localise","localize","locate","lock","lodge","loft","log","loiter","loll","lollop","long","look","looks","loom","loop","loose","loosen","loot","lop","lope","lord","lose","lounge","lour","louse","love","low","lowball","lower","lubricate","luck","lug","lull","lumber","lump","lunch","lunge","lurch","lure","lurk","lust","luxuriate","lynch","macerate","machine","madden","magic","magnetise","magnetize","magnify","mail","maim","mainline","mainstream","maintain","major","make","malfunction","malign","malinger","maltreat","man","manacle","manage","mandate","mangle","manhandle","manicure","manifest","manipulate","manoeuvre","mantle","manufacture","manure","map","mar","march","marginalise","marginalize","marinate","mark","market","maroon","marry","marshal","martyr","marvel","masculinise","masculinize","mash","mask","masquerade","mass","massacre","massage","master","mastermind","masticate","masturbate","match","mate","materialise","materialize","matriculate","matter","mature","maul","maunder","max","maximise","maximize","mean","meander","measure","mechanise","mechanize","medal","meddle","mediate","medicate","meditate","meet","meld","mellow","melt","memorialise","memorialize","memorise","memorize","menace","mend","menstruate","mention","meow","mercerise","mercerize","merchandise","merge","merit","mesh","mesmerise","mesmerize","mess","message","metabolise","metabolize","metamorphose","mete","meter","methinks","mew","mewl","miaow","microblog","microchip","micromanage","microwave","micturate","migrate","militarise","militarize","militate","milk","mill","mime","mimic","mince","mind","mine","mingle","miniaturise","miniaturize","minimise","minimize","minister","minor","mint","minute","mirror","misapply","misappropriate","misbehave","miscalculate","miscarry","miscast","misconceive","misconstrue","miscount","misdiagnose","misdial","misdirect","misfile","misfire","misgovern","mishandle","mishear","mishit","misinform","misinterpret","misjudge","miskey","mislay","mislead","mismanage","mismatch","misname","misplace","misplay","mispronounce","misquote","misread","misreport","misrepresent","miss","mission","misspell","misspend","mist","mistake","mistime","mistreat","mistrust","misunderstand","misuse","mitigate","mitre","mix","moan","mob","mobilise","mobilize","mock","mod","model","moderate","modernise","modernize","modify","modulate","moisten","moisturise","moisturize","mold","molder","molest","mollify","mollycoddle","molt","monitor","monopolise","monopolize","moo","mooch","moon","moonlight","moonwalk","moor","moot","mop","mope","moralise","moralize","morph","mortar","mortgage","mortify","mosey","mosh","mothball","mother","motion","motivate","motor","mould","moulder","moult","mount","mourn","mouse","mouth","move","movies","mow","muck","muddle","muddy","muff","muffle","mug","mulch","mull","multicast","multiply","multitask","mumble","mumbling","mummify","munch","murder","murmur","murmuring","murmurings","muscle","muse","mushroom","muss","muster","mutate","mute","mutilate","mutiny","mutter","muzzle","mystify","nab","nag","nail","name","namecheck","nap","narrate","narrow","narrowcast","nasalise","nasalize","nationalise","nationalize","natter","naturalise","naturalize","nauseate","navigate","near","nearer","nearest","neaten","necessitate","neck","necklace","need","needle","negate","negative","neglect","negotiate","neigh","nerve","nest","nestle","net","nettle","network","neuter","neutralise","neutralize","nibble","nick","nickname","niggle","nip","nitrify","nix","nobble","nod","nominalize","nominate","norm","normalise","normalize","nose","nosedive","nosh","notarise","notarize","notch","note","notice","notify","nourish","nudge","nuke","nullify","numb","number","nurse","nurture","nut","nuzzle","obey","obfuscate","object","objectify","oblige","obliterate","obscure","observe","obsess","obstruct","obtain","obtrude","obviate","occasion","occlude","occupy","occur","off","offend","offer","officiate","offload","offset","offshore","ogle","oil","okay","omit","ooze","open","operate","opine","oppose","oppress","opt","optimise","optimize","option","orbit","orchestrate","ordain","order","organise","organize","orient","orientate","originate","ornament","orphan","oscillate","ossify","ostracise","ostracize","oust","out","outbid","outclass","outdistance","outdo","outface","outfit","outflank","outfox","outgrow","outgun","outlast","outlaw","outline","outlive","outmaneuver","outmanoeuvre","outnumber","outpace","outperform","outplay","outpoint","output","outrage","outrank","outrun","outsell","outshine","outsmart","outsource","outstay","outstrip","outvote","outweigh","outwit","overachieve","overact","overawe","overbalance","overbook","overburden","overcharge","overcome","overcompensate","overcook","overdevelop","overdo","overdose","overdraw","overdub","overeat","overemphasize","overestimate","overexpose","overextend","overfeed","overflow","overfly","overgeneralise","overgeneralize","overgraze","overhang","overhaul","overhear","overheat","overindulge","overlap","overlay","overlie","overload","overlook","overpay","overplay","overpower","overprint","overproduce","overrate","overreach","overreact","override","overrule","overrun","oversee","oversell","overshadow","overshoot","oversimplify","oversleep","overspend","overstate","overstay","overstep","overstock","overstretch","overtake","overtax","overthrow","overtrain","overturn","overuse","overvalue","overwhelm","overwinter","overwork","overwrite","ovulate","owe","own","oxidise","oxidize","oxygenate","pace","pacify","pack","package","packetise","packetize","pad","paddle","padlock","page","paginate","pailful","pain","paint","pair","pal","palatalise","palatalize","pale","pall","palliate","palm","palpate","palpitate","pamper","pan","pander","panel","panhandle","panic","pant","paper","parachute","parade","parallel","paralyse","paralyze","paraphrase","parboil","parcel","parch","pardon","pare","park","parlay","parley","parody","parole","parrot","parry","parse","part","partake","participate","particularise","particularize","partition","partner","party","pass","passivise","passivize","paste","pasteurise","pasteurize","pasture","pat","patch","patent","patrol","patronise","patronize","patter","pattern","pause","pave","paw","pawn","pay","peak","peal","peck","pedal","peddle","pedestrianise","pedestrianize","pee","peek","peel","peep","peer","peg","pelt","pen","penalise","penalize","pencil","penetrate","pension","people","pep","pepper","perambulate","perceive","perch","percolate","perfect","perforate","perform","perfume","perish","perjure","perk","perm","permeate","permit","perpetrate","perpetuate","perplex","persecute","persevere","persist","personalise","personalize","personify","perspire","persuade","pertain","perturb","peruse","pervade","pervert","pester","pet","peter","petition","petrify","phase","philosophise","philosophize","phone","photocopy","photograph","photoshop","photosynthesise","photosynthesize","phrase","pick","picket","pickle","picnic","picture","picturise","picturize","piddle","piece","pierce","pig","pigeonhole","piggyback","pike","pile","pilfer","pill","pillage","pillory","pillow","pilot","pimp","pin","pinch","pine","ping","pinion","pink","pinpoint","pioneer","pip","pipe","pique","pirate","pirouette","piss","pit","pitch","pity","pivot","pixelate","pixellate","placate","place","plagiarise","plagiarize","plague","plait","plan","plane","plant","plaster","plasticise","plasticize","plate","plateau","play","plead","please","pledge","plight","plod","plonk","plop","plot","plough","pluck","plug","plumb","plummet","plump","plunder","plunge","plunk","pluralise","pluralize","ply","poach","pocket","point","poise","poison","poke","polarise","polarize","pole","poleax","poleaxe","police","polish","politicise","politicize","poll","pollard","pollinate","pollute","polymerise","polymerize","ponce","ponder","pong","pontificate","pony","poo","pooh","pool","poop","pootle","pop","popularise","popularize","populate","pore","port","portend","portion","portray","pose","posit","position","possess","posset","post","postmark","postpone","postulate","posture","pot","potter","pounce","pound","pour","pout","powder","power","practice","practise","praise","praises","prance","prang","prate","prattle","pray","preach","precede","precipitate","precis","preclude","predate","predecease","predetermine","predicate","predict","predispose","predominate","preen","preface","prefer","prefigure","prefix","preheat","prejudge","prejudice","preload","premaster","premiere","preoccupy","prep","prepare","prepone","preregister","presage","prescind","prescribe","preselect","presell","present","preserve","preset","preside","press","pressure","pressurise","pressurize","presume","presuppose","pretend","pretest","prettify","prevail","prevaricate","prevent","preview","prey","price","prick","prickle","pride","prime","primp","print","prioritise","prioritize","prise","privatise","privatize","privilege","prize","probate","probe","proceed","process","proclaim","procrastinate","procreate","proctor","procure","prod","produce","profane","profess","professionalise","professionalize","proffer","profile","profit","program","programme","progress","prohibit","project","proliferate","prolong","promenade","promise","promote","prompt","promulgate","pronounce","proof","proofread","prop","propagandise","propagandize","propagate","propel","prophesy","propitiate","propose","proposition","propound","proscribe","prosecute","proselytise","proselytize","prospect","prosper","prostitute","prostrate","protect","protest","protrude","prove","provide","provision","provoke","prowl","prune","pry","psych","psychoanalyse","publicise","publicize","publish","pucker","puff","puke","pull","pullulate","pulp","pulsate","pulse","pulverise","pulverize","pummel","pump","pun","punch","punctuate","puncture","punish","punt","pupate","purchase","purge","purify","purl","purloin","purport","purr","purse","pursue","purvey","push","pussyfoot","put","putrefy","putt","putter","puzzle","quack","quadruple","quaff","quail","quake","qualify","quantify","quarantine","quarrel","quarry","quarter","quarterback","quash","quaver","queer","quell","quench","query","quest","question","queue","quibble","quicken","quiet","quieten","quintuple","quip","quirk","quit","quiver","quiz","quote","quoth","rabbit","race","rack","radiate","radicalise","radicalize","radio","raffle","rag","rage","raid","rail","railroad","rain","raise","rake","rally","ram","ramble","ramp","rampage","randomise","randomize","range","rank","rankle","ransack","ransom","rant","rap","rape","rappel","rasp","rasterise","rasterize","rat","ratchet","rate","ratify","ration","rationalise","rationalize","rattle","ravage","rave","ravel","ravish","raze","razz","reach","reacquaint","react","reactivate","read","readdress","readies","readjust","readmit","ready","reaffirm","realign","realise","realize","reallocate","ream","reanimate","reap","reappear","reapply","reappoint","reappraise","rear","rearm","rearrange","reason","reassemble","reassert","reassess","reassign","reassure","reawaken","rebel","reboot","reborn","rebound","rebrand","rebuff","rebuild","rebuke","rebut","recall","recant","recap","recapitulate","recapture","recast","recede","receive","recess","recharge","reciprocate","recite","reckon","reclaim","reclassify","recline","recognise","recognize","recoil","recollect","recommence","recommend","recompense","reconcile","recondition","reconfigure","reconfirm","reconnect","reconnoitre","reconquer","reconsider","reconstitute","reconstruct","reconvene","record","recount","recoup","recover","recreate","recrudesce","recruit","rectify","recuperate","recur","recycle","redact","redden","redecorate","redeem","redefine","redeploy","redesign","redevelop","redial","redirect","rediscover","redistribute","redistrict","redo","redouble","redound","redraft","redraw","redress","reduce","reduplicate","reef","reek","reel","ref","refer","referee","reference","refill","refinance","refine","refit","reflate","reflect","refloat","refocus","reform","reformat","reformulate","refract","refrain","refresh","refrigerate","refuel","refund","refurbish","refuse","refute","regain","regale","regard","regenerate","register","regress","regret","regroup","regularise","regularize","regulate","regurgitate","rehabilitate","rehash","rehear","rehearse","reheat","rehome","rehouse","reign","reignite","reimburse","rein","reincarnate","reinforce","reinstate","reinterpret","reintroduce","reinvent","reinvest","reinvigorate","reissue","reiterate","reject","rejig","rejigger","rejoice","rejoin","rejuvenate","rekindle","relapse","relate","relaunch","relax","relay","release","relegate","relent","relieve","relinquish","relish","relive","reload","relocate","rely","remain","remainder","remake","remand","remap","remark","remarry","remaster","remediate","remedy","remember","remind","reminisce","remit","remix","remodel","remonstrate","remortgage","remould","remount","remove","remunerate","rename","rend","render","rendezvous","renege","renew","renounce","renovate","rent","reoccur","reoffend","reopen","reorder","reorganise","reorganize","reorient","repackage","repair","repatriate","repay","repeal","repeat","repel","repent","rephrase","replace","replay","replenish","replicate","reply","report","repose","repossess","represent","repress","reprieve","reprimand","reprint","reproach","reprocess","reproduce","reprove","repudiate","repulse","repurpose","request","require","requisition","requite","rerun","reschedule","rescind","rescue","research","researches","resect","resell","resemble","resent","reserve","reset","resettle","reshape","reshuffle","reside","resign","resist","resit","resize","reskill","resolve","resonate","resort","resound","resource","respect","respire","respond","respray","rest","restart","restate","restock","restore","restrain","restrict","restring","restructure","result","resume","resupply","resurface","resurrect","resuscitate","retail","retain","retake","retaliate","retard","retch","retell","retest","rethink","retire","retool","retort","retouch","retrace","retract","retrain","retreat","retrench","retrieve","retrofit","retry","return","reunify","reunite","reuse","rev","revalue","revamp","reveal","revel","revenge","reverberate","revere","reverse","revert","review","revile","revise","revisit","revitalise","revitalize","revive","revivify","revoke","revolt","revolutionise","revolutionize","revolve","reward","rewind","rewire","reword","rework","rewrite","rhapsodise","rhapsodize","rhyme","rib","rick","ricochet","rid","riddle","ride","ridge","ridicule","riffle","rifle","rig","right","rightsize","rile","rim","ring","rinse","riot","rip","ripen","riposte","ripple","rise","risk","ritualise","ritualize","rival","rivet","roam","roar","roast","rob","robe","rock","rocket","roger","roll","romance","romanticise","romanticize","romp","roof","room","roost","root","rope","rosin","roster","rot","rotate","rouge","rough","roughen","roughhouse","round","rouse","roust","rout","route","rove","row","rub","rubberneck","rubbish","ruck","rue","ruffle","ruin","ruins","rule","rumble","ruminate","rummage","rumor","rumour","rumple","run","rupture","rush","rust","rustle","sabotage","sack","sacrifice","sadden","saddle","safeguard","sag","sail","salaam","salivate","sally","salt","salute","salvage","salve","sample","sanctify","sanction","sand","sandbag","sandblast","sandpaper","sandwich","sanitise","sanitize","sap","sashay","sass","sate","satiate","satirise","satirize","satisfy","saturate","saunter","savage","save","savor","savour","saw","say","scald","scale","scallop","scalp","scamper","scan","scandalise","scandalize","scapegoat","scar","scare","scarf","scarify","scarper","scatter","scattering","scavenge","scent","schedule","schematise","schematize","scheme","schlep","schlepp","schmooze","school","schtup","schuss","scoff","scold","scoop","scoot","scope","scorch","score","scorn","scotch","scour","scourge","scout","scowl","scrabble","scram","scramble","scrap","scrape","scratch","scrawl","scream","screech","screen","screw","scribble","scrimp","script","scroll","scrounge","scrub","scrummage","scrunch","scruple","scrutinise","scrutinize","scud","scuff","scuffle","scull","sculpt","scupper","scurry","scuttle","scythe","seal","sealift","sear","search","season","seat","secede","seclude","second","secrete","section","secularise","secularize","secure","sedate","seduce","see","seed","seek","seep","seethe","segment","segregate","segue","seize","select","sell","sellotape","semaphore","send","sensationalise","sensationalize","sense","sensitise","sensitize","sentence","sentimentalise","sentimentalize","separate","sequence","sequester","sequestrate","serenade","serialise","serialize","sermonise","sermonize","serve","service","set","settle","sever","sew","sex","sexualise","sexualize","shack","shackle","shade","shadow","shaft","shag","shake","shalt","sham","shamble","shame","shampoo","shanghai","shape","share","sharpen","shatter","shave","shear","sheathe","shed","sheer","shell","shellac","shelter","shelve","shepherd","shield","shift","shimmer","shimmy","shin","shine","shinny","ship","shipwreck","shirk","shit","shiver","shock","shoe","shoehorn","shoo","shoot","shop","shoplift","shore","short","shorten","shortlist","shoulder","shout","shove","shovel","show","showboat","showcase","shower","shred","shriek","shrill","shrink","shrivel","shroom","shroud","shrug","shtup","shuck","shudder","shuffle","shun","shunt","shush","shut","shuttle","shy","sic","sick","sicken","side","sideline","sidestep","sideswipe","sidetrack","sidle","sieve","sift","sigh","sight","sightsee","sign","signal","signify","signpost","silence","silhouette","silt","silver","simmer","simper","simplify","simulate","simulcast","sin","sing","singe","single","sink","sip","siphon","sire","sit","site","situate","size","sizzle","skate","skateboard","skedaddle","sketch","skew","skewer","ski","skid","skim","skimp","skin","skip","skipper","skirmish","skirt","skitter","skive","skivvy","skulk","sky","skyjack","skyrocket","slack","slacken","slag","slake","slam","slander","slant","slap","slash","slate","slather","slaughter","slave","slaver","slay","sledge","sleek","sleep","sleepwalk","sleet","slew","slice","slick","slide","slight","slim","sling","slink","slip","slit","slither","slob","slobber","slog","slop","slope","slosh","slot","slouch","slough","slow","slug","sluice","slum","slumber","slump","slur","slurp","smack","smart","smarten","smash","smear","smell","smelt","smile","smirk","smite","smoke","smooch","smoodge","smooth","smother","smoulder","smudge","smuggle","snack","snaffle","snag","snaggle","snake","snap","snare","snarf","snarl","snatch","sneak","sneer","sneeze","snicker","sniff","sniffle","snigger","snip","snipe","snitch","snivel","snog","snooker","snoop","snooper","snooze","snore","snorkel","snort","snow","snowball","snowplough","snowplow","snub","snuff","snuffle","snuffling","snuggle","soak","soap","soar","sob","sober","socialise","socialize","sock","sod","sodomise","sodomize","soften","soil","sojourn","solace","solder","soldier","sole","solemnise","solemnize","solicit","solidify","soliloquize","solve","somersault","soothe","sorrow","sort","sough","sound","soundproof","soup","sour","source","souse","sow","space","span","spangle","spank","spar","spare","spark","sparkle","spatter","spattering","spawn","spay","speak","spear","spearhead","spec","specialise","specialize","specify","spectacles","spectate","speculate","speed","spell","spellcheck","spend","spew","spice","spiff","spike","spill","spin","spiral","spirit","spit","spite","splash","splatter","splay","splice","splinter","split","splosh","splurge","splutter","spoil","sponge","sponsor","spoof","spook","spool","spoon","sport","sports","spot","spotlight","spout","sprain","sprawl","spray","spread","spreadeagle","spring","springboard","sprinkle","sprint","spritz","sprout","spruce","spur","spurn","spurt","sputter","spy","squabble","squall","squander","square","squash","squat","squawk","squeak","squeal","squeeze","squelch","squint","squirm","squirrel","squirt","squish","stab","stabilise","stabilize","stable","stables","stack","staff","stage","stagger","stagnate","stain","stake","stalk","stall","stammer","stamp","stampede","stanch","stand","standardise","standardize","staple","star","starch","stare","start","startle","starve","stash","state","statement","station","staunch","stave","stay","steady","steal","steam","steamroller","steel","steep","steepen","steer","stem","stencil","step","stereotype","sterilise","sterilize","stew","stick","stickybeak","stiff","stiffen","stifle","stigmatise","stigmatize","still","stimulate","sting","stinger","stink","stint","stipple","stipulate","stir","stitch","stock","stockpile","stoke","stomach","stomp","stone","stonewall","stoop","stop","stopper","store","storm","storyboard","stow","straddle","strafe","straggle","straighten","strain","strand","strangle","strap","stratify","stravage","stravaig","stray","streak","stream","streamline","strengthen","stress","stretch","stretcher","strew","stride","strike","string","strip","strive","stroke","stroll","structure","struggle","strum","strut","stub","stud","study","stuff","stultify","stumble","stump","stun","stunt","stupefy","stutter","style","stymie","sub","subcontract","subdivide","subdue","subedit","subject","subjugate","sublet","sublimate","submerge","submit","subordinate","suborn","subpoena","subscribe","subside","subsidise","subsidize","subsist","substantiate","substitute","subsume","subtend","subtitle","subtract","subvert","succeed","succor","succour","succumb","suck","sucker","suckle","suction","sue","suffer","suffice","suffocate","suffuse","sugar","suggest","suit","sulk","sulks","sully","sum","summarise","summarize","summon","summons","sun","sunbathe","sunder","sunset","sup","superimpose","superintend","superpose","supersede","supersize","supersized","supervene","supervise","supplant","supplement","supply","support","suppose","suppress","suppurate","surcharge","surf","surface","surge","surmise","surmount","surpass","surprise","surrender","surround","survey","survive","suspect","suspend","suspenders","suss","sustain","suture","swab","swaddle","swagger","swallow","swamp","swan","swank","swap","swarm","swat","swath","swathe","sway","swear","sweat","sweep","sweeps","sweeten","swell","swelter","swerve","swig","swill","swim","swindle","swing","swipe","swirl","swish","switch","swivel","swoon","swoop","swoosh","swot","symbolise","symbolize","sympathise","sympathize","symptomize","synchronise","synchronize","syndicate","synthesise","synthesize","syringe","systematise","systematize","tab","table","tabulate","tack","tackle","tag","tail","tailgate","tailor","taint","take","talk","tally","tame","tamp","tamper","tan","tangle","tango","tank","tankful","tantalise","tantalize","tap","tape","taper","tar","target","tarmac","tarnish","tarry","tart","task","taste","tattle","tattoo","taunt","tauten","tax","taxi","taxicab","teach","team","tear","tease","tee","teem","teeter","teethe","telecast","telecommute","teleconference","telegraph","telemeter","teleoperate","telephone","teleport","telescope","televise","telex","tell","telnet","temp","temper","temporise","temporize","tempt","tenant","tend","tender","tenderise","tenderize","tense","tension","tergiversate","term","terminate","terraform","terrify","terrorise","terrorize","test","testify","tether","text","thank","thatch","thaw","theorise","theorize","thicken","thin","think","thirst","thrash","thread","threaten","thresh","thrill","thrive","throb","throbbing","throng","throttle","throw","thrust","thud","thumb","thump","thunder","thwack","thwart","tick","ticket","tickle","tide","tidy","tie","tighten","tile","till","tilt","time","timetable","tinge","tingle","tingling","tinker","tinkle","tinkling","tint","tip","tippex","tipple","tiptoe","tire","titillate","titivate","title","titrate","titter","toady","toast","toboggan","toddle","toe","tog","toggle","toil","toke","tolerate","toll","tone","tongue","tonify","tool","toot","tootle","top","topple","torch","torment","torpedo","torture","toss","tot","total","tote","totter","touch","tough","toughen","tour","tousle","tout","tow","towel","tower","toy","trace","track","trade","traduce","traffic","trail","train","traipse","trammel","tramp","trample","trampoline","tranquilize","tranquillize","transact","transcend","transcribe","transfer","transfigure","transfix","transform","transfuse","transgress","transit","translate","transliterate","transmit","transmogrify","transmute","transpire","transplant","transport","transpose","trap","trash","traumatise","traumatize","travel","traverse","trawl","tread","treasure","treat","treble","trek","tremble","trembling","trepan","trespass","trial","trick","trickle","trifle","trigger","trill","trim","trip","triple","triumph","trivialise","trivialize","troll","tromp","troop","trot","trouble","troubleshoot","trounce","trouser","truant","truck","trudge","trump","trumpet","truncate","trundle","truss","trust","try","tuck","tug","tugboat","tumble","tune","tunnel","turbocharge","turf","turn","tussle","tut","tutor","twang","tweak","tweet","twiddle","twig","twin","twine","twinkle","twirl","twist","twitch","twitter","twittering","type","typecast","typeset","typify","tyrannise","tyrannize","ulcerate","ululate","ump","umpire","unbalance","unban","unbend","unblock","unbuckle","unburden","unbutton","uncoil","uncork","uncouple","uncover","uncurl","undelete","underachieve","underbid","undercharge","undercook","undercut","underestimate","underestimation","underexpose","undergo","underlie","underline","undermine","underpay","underperform","underpin","underplay","underrate","underscore","undersell","undershoot","underspend","understand","understate","understudy","undertake","undervalue","underwrite","undo","undock","undress","undulate","unearth","unfasten","unfold","unfreeze","unfurl","unhand","unhinge","unhitch","unhook","unify","uninstall","unionise","unionize","unite","unlace","unlearn","unleash","unload","unlock","unloose","unloosen","unmask","unnerve","unpack","unpick","unplug","unravel","unroll","unsaddle","unscramble","unscrew","unseat","unsettle","unsubscribe","untangle","untie","unveil","unwind","unwrap","unzip","up","upbraid","upchange","upchuck","update","upend","upgrade","uphold","upholster","uplift","upload","uproot","upsell","upset","upshift","upskill","upstage","urge","urinate","use","usher","usurp","utilise","utilize","utter","vacate","vacation","vaccinate","vacillate","vacuum","valet","validate","value","vamoose","vandalise","vandalize","vanish","vanquish","vaporise","vaporize","varnish","vary","vault","veer","veg","vegetate","veil","vend","veneer","venerate","vent","ventilate","venture","verbalise","verbalize","verge","verify","versify","vest","vet","veto","vex","vibrate","victimise","victimize","vide","video","videotape","vie","view","viewing","vilify","vindicate","violate","visit","visualise","visualize","vitiate","vitrify","vocalize","voice","void","volley","volumise","volumize","volunteer","vomit","vote","vouch","vouchsafe","vow","voyage","vulgarise","vulgarize","wad","waddle","wade","waffle","waft","wag","wage","wager","waggle","wail","wait","waive","wake","wakeboard","waken","walk","wall","wallop","wallow","wallpaper","waltz","wander","wane","wangle","wank","want","warble","ward","warm","warn","warp","warrant","wash","wassail","waste","watch","water","waterproof","waterski","wave","waver","wax","waylay","weaken","wean","weaponise","weaponize","wear","weary","weasel","weather","weatherise","weatherize","weave","wed","wedge","wee","weed","weekend","weep","weigh","weight","weird","welch","welcome","weld","well","welly","welsh","wend","westernise","westernize","wet","whack","wheedle","wheel","wheeze","whelp","whet","whiff","while","whilst","whimper","whine","whinge","whinny","whip","whirl","whirr","whirring","whisk","whisper","whispering","whistle","whiten","whitewash","whittle","whiz","whizz","whoop","whoosh","whup","wick","widen","widow","wield","wig","wiggle","wildcat","will","wilt","wimp","win","wince","winch","wind","winds","windsurf","wine","wing","wink","winkle","winnow","winter","wipe","wire","wiretap","wise","wisecrack","wish","withdraw","wither","withhold","withstand","witness","witter","wobble","wolf","wonder","woo","woof","word","work","worm","worry","worsen","worship","worst","wound","wow","wowee","wrangle","wrap","wreak","wreathe","wreck","wrench","wrest","wrestle","wriggle","wring","wrinkle","writ","write","writhe","wrong","wrought","xerox","yack","yak","yank","yap","yaw","yawn","yearn","yell","yellow","yelp","yield","yodel","yoke","yomp","yowl","yuppify","zap","zero","zigzag","zing","zip","zone","zoom"];var Ml=Object.freeze({adjective:Rs,adverb:Ps,conjunction:Ds,interjection:Us,noun:Ls,preposition:Ms,verb:zs}),Vs=Ml;var zl=Object.freeze({title:"English",syntax:As,time:_s,internet:js,person:Cs,word:Vs}),X=zl;var Fe=["male","female"],se=Symbol("randomValue"),ui=Symbol("typesValue"),Ie=Symbol("localeValue"),fr=class{[ui];[se];[Ie];constructor(e={}){this[ui]=new je(e.seed),this[se]=new pt(e.seed),this[Ie]=e.locale||X}seed(e){this[se].seed(e),this[ui].seed(e)}locale(e){this[Ie]=e||X}firstName(e){let{person:t}=this[Ie],i=e&&Fe.includes(e)?e:this[se].pickOne(Fe),r;t&&t.firstName&&t.firstName[i]?r=t.firstName:r=X.person.firstName;let a=r[i];return this[se].pickOne(a)}lastName(e){let{person:t}=this[Ie];if(!e){let s=t&&t.lastName||X.person.lastName;if(Array.isArray(s.general)&&s.general.length)return this[se].pickOne(s.general);throw new Error("The locale does not have a general last name pool.")}let i=e&&Fe.includes(e)?e:this[se].pickOne(Fe),r;t&&t.lastName&&t.lastName[i]?r=t.lastName:r=X.person.lastName;let a=r[i];return this[se].pickOne(a)}middleName(e){let{person:t}=this[Ie],i=t&&t.middleName||t&&t.firstName||X.person.firstName,r=e&&Fe.includes(e)?e:this[se].pickOne(Fe),a=i[r];return this[se].pickOne(a)}name(e={}){let{firstName:t,lastName:i,gender:r}=e,a=[];return this[ui].boolean({likelihood:10})&&a.push(this.prefix(r)),a.push(t||this.firstName(r)),a.push(i||this.lastName(r)),this[ui].boolean({likelihood:10})&&a.push(this.suffix(r)),a.join(" ")}gender(e){let{person:t}=this[Ie],i=t&&t.gender||X.person.gender;return e?this[se].pickOne(i.binary||X.person.gender.binary):this[se].pickOne(i.pool||X.person.gender.pool)}prefix(e){let{person:t}=this[Ie],i=t&&t.prefix||X.person.prefix;if(!e&&Array.isArray(i.general)&&i.general.length)return this[se].pickOne(i.general);let r=e&&Fe.includes(e)?e:this[se].pickOne(Fe),a=i[r]||X.person.prefix[r];return this[se].pickOne(a)}suffix(e){let{person:t}=this[Ie],i=t&&t.suffix||X.person.suffix;if(Array.isArray(i.general)&&i.general.length)return this[se].pickOne(i.general);let r=e&&Fe.includes(e)?e:this[se].pickOne(Fe),a=i[r]||X.person.suffix[r];return this[se].pickOne(a)}jobTitle(){let e=this.jobDescriptor(),t=this.jobArea(),i=this.jobType();return`${e} ${t} ${i}`}jobDescriptor(){let{person:e}=this[Ie],t;return e&&e.title&&e.title.descriptor?t=e.title:t=X.person.title,this[se].pickOne(t.descriptor)}jobArea(){let{person:e}=this[Ie],t;return e&&e.title&&e.title.level?t=e.title:t=X.person.title,this[se].pickOne(t.level)}jobType(){let{person:e}=this[Ie],t;return e&&e.title&&e.title.job?t=e.title:t=X.person.title,this[se].pickOne(t.job||[])}};var gr=Symbol("randomValue"),$e=Symbol("typesValue"),yr=Symbol("localeValue"),br=class{[$e];[gr];[yr];constructor(e={}){this[$e]=new je(e.seed),this[gr]=new pt(e.seed),this[yr]=e.locale||X}seed(e){this[gr].seed(e),this[$e].seed(e)}locale(e){this[yr]=e||X}word(e={}){let t={...e};if(typeof t.syllables=="number"&&typeof t.length=="number")throw new RangeError('Cannot specify both "syllables" and "length".');let i="";if(typeof t.length=="number"){do i+=this.syllable();while(i.length<t.length);i=i.substring(0,t.length)}else{let r=t.syllables||this[$e].number({min:1,max:3});for(let a=0;a<r;a++)i+=this.syllable()}return t.capitalize&&(i=this.capitalize(i)),i}capitalize(e){return e.charAt(0).toUpperCase()+e.substr(1)}words(e=3){return new Array(e).fill("").map(()=>this.word()).join(" ")}sentence(e={}){let t={...e},{words:i=this[$e].number({min:12,max:18})}=t,r=new Array(i).fill("").map(()=>this.word()).join(" ");r=this.capitalize(r);let{punctuation:a}=t;return a!==!1&&!/^[.?;!:]$/.test(String(a))&&(a="."),a&&(r+=a),r}sentences(e={}){let t={};typeof e=="number"?t.size=e:t={...e};let{size:i=this[$e].number({min:2,max:6})}=t;return new Array(i).fill("").map(()=>this.sentence()).join(" ")}slug(e){let t=this.words(e);return gs(t)}paragraph(e={}){let t={};typeof e=="number"?t.sentences=e:t={...e};let{lineBreak:i,sentences:r=this[$e].number({min:3,max:7})}=t;return new Array(r).fill("").map(()=>this.sentence()).join(i===!0?`\r
|
|
139
|
+
`)}function Zr(o,e){if(typeof o=="number")return o;let t=Number(o);return Number.isNaN(t)?e:t}function Qr(o,e){let t=typeof o;if(t==="boolean")return o;if(t==="string"){let i=o.trim();if(i==="true")return!0;if(i==="false")return!1}return e}function or(o,e){if(o==null)return o;switch(e){case d.aml.vocabularies.shapes.number:case d.aml.vocabularies.shapes.integer:case d.aml.vocabularies.shapes.float:case d.aml.vocabularies.shapes.long:case d.aml.vocabularies.shapes.double:case d.w3.xmlSchema.number:case d.w3.xmlSchema.integer:case d.w3.xmlSchema.float:case d.w3.xmlSchema.long:case d.w3.xmlSchema.double:return Zr(o,0);case d.aml.vocabularies.shapes.boolean:case d.w3.xmlSchema.boolean:return Qr(o,!1);case d.aml.vocabularies.shapes.nil:case d.w3.xmlSchema.nil:return null;default:return o}}function ea(o,e=[]){let t;return Array.isArray(e)&&e.length&&(t=o.find(i=>e.includes(i.id))),t||([t]=o),t}function lr(o,e){let t=[],{properties:i,inherits:r}=o;i.length&&(t=[...i]),Array.isArray(r)&&r.length&&r.forEach(s=>{let n=s;if(n.types.includes(d.aml.vocabularies.shapes.UnionShape)){let p=n,{anyOf:u=[]}=p;n=ea(u,e)}if(!n.types.includes(d.w3.shacl.NodeShape))return;let c=lr(n);c.length&&(t=t.concat(c))});let a=[];return t.forEach(s=>{a.find(l=>l.name===s.name)||a.push(s)}),a}var ct=class{processNode(e){let{types:t}=e;if(t.includes(d.aml.vocabularies.data.Scalar))return this.processScalarNode(e);if(t.includes(d.aml.vocabularies.data.Array))return this.processArrayNode(e);if(t.includes(d.aml.vocabularies.data.Object))return this.processObjectNode(e)}processScalarNode(e){return or(e.value,e.dataType)}processArrayNode(e){let t=[];return e.members.forEach(i=>{let r=this.processNode(i);r!==void 0&&t.push(r)}),t}processObjectNode(e){let t={},{properties:i}=e;return Object.keys(i).forEach(r=>{let a=i[r],s=this.processNode(a);if(typeof s<"u"){let n=this.normalizePropertyName(r);t[n]=s}}),t}normalizePropertyName(e){let t=e;try{t=decodeURIComponent(t)}catch{}return t}};var xe=class extends ct{generate(e){let t=this.processNode(e);return!t||typeof t=="string"?t:JSON.stringify(t,null,2)}};var ye=class extends ct{generate(e,t,i={}){let r=this.processNode(e);if(!r)return r;let{indent:a=0}=i,s=new Array(a).fill(" ").join("");return t?Array.isArray(r)?r.map(n=>`${s}<${t}>${zt(n)}</${t}>`).filter(n=>!!n).join(`
|
|
140
|
+
`):`${zt({[t]:r})}`:`${zt(r,a)}`}};var ve={};Fa(ve,{anyShape:()=>dt,arrayShape:()=>Sl,fileShape:()=>kl,nodeShape:()=>bl,propertyShape:()=>Al,recursiveShape:()=>xl,scalarShape:()=>wl,shape:()=>ha,tupleShape:()=>_l,unionShape:()=>vl,xmlSerializer:()=>ms});var li={};Fa(li,{IAmfAPIContractProcessingDataTypes:()=>il,IAmfAnyTypes:()=>oa,IAmfApiKeySettingsTypes:()=>Ko,IAmfArrayNodeTypes:()=>ua,IAmfArrayTypes:()=>ia,IAmfAsyncApiTypes:()=>yl,IAmfBaseUnitProcessingDataTypes:()=>gl,IAmfCallbackTypes:()=>Go,IAmfCreativeWorkTypes:()=>el,IAmfDataTypeFragmentTypes:()=>dl,IAmfDocumentTypes:()=>Qo,IAmfDomainExtensionTypes:()=>Xo,IAmfDomainPropertyTypes:()=>hl,IAmfEncodingTypes:()=>tl,IAmfEndpointType:()=>To,IAmfExampleTypes:()=>xo,IAmfExternalDomainElementTypes:()=>fl,IAmfExternalFragmentTypes:()=>pl,IAmfFileTypes:()=>na,IAmfHttpSettingsTypes:()=>Fo,IAmfIriTemplateMappingTypes:()=>Ho,IAmfLicenseTypes:()=>$o,IAmfMessageTypes:()=>Yo,IAmfModuleTypes:()=>cl,IAmfNilTypes:()=>_o,IAmfNodeTypes:()=>ra,IAmfOAuth1SettingsTypes:()=>Vo,IAmfOAuth2FlowTypes:()=>zo,IAmfOAuth2SettingsTypes:()=>Mo,IAmfObjectNodeTypes:()=>ma,IAmfOpenIdConnectSettingsTypes:()=>qo,IAmfParameterTypes:()=>jo,IAmfParametrizedResourceTypeTypes:()=>al,IAmfParametrizedSecuritySchemeTypes:()=>Uo,IAmfParametrizedTraitTypes:()=>sl,IAmfPayloadTypes:()=>Po,IAmfPropertyTypes:()=>aa,IAmfProviderTypes:()=>Io,IAmfRdfsSeqType:()=>rl,IAmfRecursiveTypes:()=>ca,IAmfRequestTypes:()=>Oo,IAmfResourceTypeTypes:()=>nl,IAmfResponseTypes:()=>Ro,IAmfScalarNodeTypes:()=>pa,IAmfScalarTypes:()=>ta,IAmfSchemaTypes:()=>Ao,IAmfScopeTypes:()=>Jo,IAmfSecurityRequirementTypes:()=>Do,IAmfSecuritySchemeFragmentTypes:()=>ml,IAmfSecuritySchemeTypes:()=>Lo,IAmfServerType:()=>No,IAmfSourceMapTypes:()=>Zo,IAmfSupportedOperationTypes:()=>Co,IAmfTagTypes:()=>Wo,IAmfTemplatedLinkTypes:()=>Bo,IAmfTraitFragmentTypes:()=>ul,IAmfTraitTypes:()=>ol,IAmfTupleTypes:()=>la,IAmfUnionTypes:()=>sa,IAmfVariableValueTypes:()=>ll,IAmfWebApiType:()=>Eo,IAmfXmlSerializationTypes:()=>da});var ta=[d.aml.vocabularies.shapes.ScalarShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],ia=[d.aml.vocabularies.shapes.ArrayShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],ra=[d.w3.shacl.NodeShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],aa=[d.w3.shacl.PropertyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],_o=[d.aml.vocabularies.shapes.NilShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],sa=[d.aml.vocabularies.shapes.UnionShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],na=[d.aml.vocabularies.shapes.FileShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],oa=[d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],Ao=[d.aml.vocabularies.shapes.SchemaShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],la=[d.aml.vocabularies.shapes.TupleShape,d.aml.vocabularies.shapes.ArrayShape,d.aml.vocabularies.shapes.AnyShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],ca=[d.aml.vocabularies.shapes.RecursiveShape,d.w3.shacl.Shape,d.aml.vocabularies.shapes.Shape,d.aml.vocabularies.document.DomainElement],da=[d.aml.vocabularies.shapes.XMLSerializer,d.aml.vocabularies.document.DomainElement],pa=[d.aml.vocabularies.data.Scalar,d.aml.vocabularies.data.Node,d.aml.vocabularies.document.DomainElement],ua=[d.aml.vocabularies.data.Array,d.w3.rdfSyntax.Seq,d.aml.vocabularies.data.Node,d.aml.vocabularies.document.DomainElement],ma=[d.aml.vocabularies.data.Object,d.aml.vocabularies.data.Node,d.aml.vocabularies.document.DomainElement],xo=[d.aml.vocabularies.apiContract.Example,d.aml.vocabularies.document.DomainElement],Eo=[d.aml.vocabularies.apiContract.WebAPI,d.aml.vocabularies.apiContract.API,d.aml.vocabularies.document.RootDomainElement,d.aml.vocabularies.document.DomainElement],No=[d.aml.vocabularies.apiContract.Server,d.aml.vocabularies.document.DomainElement],jo=[d.aml.vocabularies.apiContract.Parameter,d.aml.vocabularies.core.Parameter,d.aml.vocabularies.document.DomainElement],Io=[d.aml.vocabularies.core.Organization,d.aml.vocabularies.document.DomainElement],$o=[d.aml.vocabularies.core.License,d.aml.vocabularies.document.DomainElement],To=[d.aml.vocabularies.apiContract.EndPoint,d.aml.vocabularies.document.DomainElement],Co=[d.aml.vocabularies.apiContract.Operation,d.aml.vocabularies.core.Operation,d.aml.vocabularies.document.DomainElement],Oo=[d.aml.vocabularies.apiContract.Request,d.aml.vocabularies.core.Request,d.aml.vocabularies.apiContract.Message,d.aml.vocabularies.document.DomainElement],Ro=[d.aml.vocabularies.apiContract.Response,d.aml.vocabularies.core.Response,d.aml.vocabularies.apiContract.Message,d.aml.vocabularies.document.DomainElement],Po=[d.aml.vocabularies.apiContract.Payload,d.aml.vocabularies.core.Payload,d.aml.vocabularies.document.DomainElement],Do=[d.aml.vocabularies.security.SecurityRequirement,d.aml.vocabularies.document.DomainElement],Uo=[d.aml.vocabularies.security.ParametrizedSecurityScheme,d.aml.vocabularies.document.DomainElement],Lo=[d.aml.vocabularies.security.SecurityScheme,d.aml.vocabularies.document.DomainElement],Mo=[d.aml.vocabularies.security.OAuth2Settings,d.aml.vocabularies.security.Settings,d.aml.vocabularies.document.DomainElement],zo=[d.aml.vocabularies.security.OAuth2Flow,d.aml.vocabularies.document.DomainElement],Vo=[d.aml.vocabularies.security.OAuth1Settings,d.aml.vocabularies.security.Settings,d.aml.vocabularies.document.DomainElement],Fo=[d.aml.vocabularies.security.HttpSettings,d.aml.vocabularies.security.Settings,d.aml.vocabularies.document.DomainElement],Ko=[d.aml.vocabularies.security.ApiKeySettings,d.aml.vocabularies.security.Settings,d.aml.vocabularies.document.DomainElement],qo=[d.aml.vocabularies.security.OpenIdConnectSettings,d.aml.vocabularies.security.Settings,d.aml.vocabularies.document.DomainElement],Jo=[d.aml.vocabularies.security.Scope,d.aml.vocabularies.document.DomainElement],Go=[d.aml.vocabularies.apiContract.Callback,d.aml.vocabularies.document.DomainElement],Bo=[d.aml.vocabularies.apiContract.TemplatedLink,d.aml.vocabularies.document.DomainElement],Ho=[d.aml.vocabularies.apiContract.IriTemplateMapping,d.aml.vocabularies.document.DomainElement],Wo=[d.aml.vocabularies.apiContract.Tag,d.aml.vocabularies.document.DomainElement],Yo=[d.aml.vocabularies.apiContract.Message,d.aml.vocabularies.document.DomainElement],Xo=[d.aml.vocabularies.apiContract.DomainExtension,d.aml.vocabularies.document.DomainElement],Zo=[d.aml.vocabularies.docSourceMaps.SourceMap],Qo=[d.aml.vocabularies.document.Document,d.aml.vocabularies.document.Fragment,d.aml.vocabularies.document.Module,d.aml.vocabularies.document.Unit],el=[d.aml.vocabularies.core.CreativeWork,d.aml.vocabularies.document.DomainElement],tl=[d.aml.vocabularies.apiContract.Encoding,d.aml.vocabularies.document.DomainElement],il=[d.aml.vocabularies.document.APIContractProcessingData],rl=[d.w3.rdfSchema.Seq],al=[d.aml.vocabularies.apiContract.ParametrizedResourceType,d.aml.vocabularies.document.ParametrizedDeclaration,d.aml.vocabularies.document.DomainElement],sl=[d.aml.vocabularies.apiContract.ParametrizedTrait,d.aml.vocabularies.document.ParametrizedDeclaration,d.aml.vocabularies.document.DomainElement],nl=[d.aml.vocabularies.apiContract.ResourceType,d.aml.vocabularies.document.AbstractDeclaration,d.aml.vocabularies.document.DomainElement],ol=[d.aml.vocabularies.apiContract.Trait,d.aml.vocabularies.document.AbstractDeclaration,d.aml.vocabularies.document.DomainElement],ll=[d.aml.vocabularies.document.VariableValue,d.aml.vocabularies.document.DomainElement],cl=[d.aml.vocabularies.document.Module,d.aml.vocabularies.document.Unit],dl=[d.aml.vocabularies.shapes.DataTypeFragment,d.aml.vocabularies.document.Fragment,d.aml.vocabularies.document.Unit],pl=[d.aml.vocabularies.document.ExternalFragment,d.aml.vocabularies.document.Fragment,d.aml.vocabularies.document.Unit],ul=[d.aml.vocabularies.apiContract.TraitFragment,d.aml.vocabularies.document.Fragment,d.aml.vocabularies.document.Unit],ml=[d.aml.vocabularies.security.SecuritySchemeFragment,d.aml.vocabularies.document.Fragment,d.aml.vocabularies.document.Unit],hl=[d.aml.vocabularies.document.DomainProperty,d.w3.rdfSyntax.Property,d.aml.vocabularies.document.DomainElement],fl=[d.aml.vocabularies.document.ExternalDomainElement,d.aml.vocabularies.document.DomainElement],gl=[d.aml.vocabularies.document.BaseUnitProcessingData],yl=[d.aml.vocabularies.apiContract.AsyncAPI,d.aml.vocabularies.apiContract.API,d.aml.vocabularies.document.RootDomainElement,d.aml.vocabularies.document.DomainElement];function ms(o){return{id:`xml-serializer-${o}`,types:da,customDomainProperties:[]}}function ha(o){return{id:o,types:[],values:[],inherits:[],or:[],and:[],xone:[],customDomainProperties:[]}}function dt(o){return{...ha(o),types:oa,examples:[],xmlSerialization:ms(o)}}function bl(o){let e=dt(o);return e.types=ra,e.id=`node-shape-${o}`,{...e,properties:[],dependencies:[],customShapeProperties:[],customShapePropertyDefinitions:[]}}function wl(o){let e=dt(o);return e.id=`scalar-shape-${o}`,e.types=ta,e}function vl(o){let e=dt(o);return e.id=`union-shape-${o}`,e.types=sa,{...e,anyOf:[]}}function kl(o){let e=dt(o);return e.id=`file-shape-${o}`,e.types=na,e}function Sl(o){let e=dt(o);return e.id=`array-shape-${o}`,e.types=ia,e}function _l(o){let e=dt(o);return e.id=`tuple-shape-${o}`,e.types=la,{...e,items:[]}}function Al(o){let e=dt(o);return e.types=aa,e}function xl(o,e){return{...ha(o),id:`recursive-${o}`,types:ca,fixPoint:e||""}}import{customAlphabet as El}from"nanoid";var hs=El("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_",21);var Le=class o{id=hs();types;name;properties;value;dataType;members;customDomainProperties=[];static scalar(e,t){let i=new o("scalar");return i.value=e,i.dataType=t,i}constructor(e){if(typeof e=="string"){if(e==="scalar")this.types=pa;else if(e==="array")this.types=ua;else if(e==="object")this.types=ma;else throw new Error(`Invalid data node init option: ${e}`);return}if(!e)throw new Error("Expected an initialization option.");let t=e,{id:i,types:r,customDomainProperties:a}=t;if(this.id=i,this.types=r,this.customDomainProperties=a,r.includes(d.aml.vocabularies.data.Scalar)){let s=t;this.value=s.value,this.dataType=s.dataType}else if(r.includes(d.aml.vocabularies.data.Object)){let s=t,n={};this.properties=n,Object.keys(s.properties).forEach(l=>{let c=new o(s.properties[l]);n[l]=c})}else if(r.includes(d.aml.vocabularies.data.Array)){let s=t,n=[];this.members=n,Array.isArray(s.members)&&s.members.forEach(l=>{let c=new o(l);n.push(c)})}}toJSON(){let{id:e,customDomainProperties:t,types:i,name:r}=this,a={id:e,types:i,customDomainProperties:t};if(r&&(a.name=r),i.includes(d.aml.vocabularies.data.Scalar)){let s=a;s.dataType=this.dataType,s.value=this.value}else if(i.includes(d.aml.vocabularies.data.Object)){let s=a;s.properties={};let n=this.properties;n&&Object.keys(n).forEach(l=>{s.properties[l]=n[l].toJSON()})}else if(i.includes(d.aml.vocabularies.data.Array)){let s=a;s.members=[],this.members&&this.members.forEach(n=>{s.members.push(n.toJSON())})}return a}addMember(e){if(!this.types.includes(d.aml.vocabularies.data.Array))throw new Error("Not an ArrayNode.");this.members||(this.members=[]),this.members.push(e)}removeMember(e){if(!this.types.includes(d.aml.vocabularies.data.Array))throw new Error("Not an ArrayNode.");if(!this.members)return;let t=this.members.findIndex(i=>i.id===e);t>=0&&this.members.splice(t,1)}addProperty(e,t){if(!this.types.includes(d.aml.vocabularies.data.Object))throw new Error("Not an ObjectNode.");this.properties||(this.properties={}),this.properties[e]=t}removeProperty(e){if(!this.types.includes(d.aml.vocabularies.data.Object))throw new Error("Not an ObjectNode.");this.properties&&delete this.properties[e]}};var ue=Symbol("nValue"),ci=Symbol("mValue"),fs=Symbol("matrixAValue"),cr=Symbol("upperMaskValue"),dr=Symbol("lowerMaskValue"),K=Symbol("mtValue"),Ee=Symbol("mtiValue"),pr=Symbol("instancesValue"),pt=class o{static[pr]=new Map;[ue]=624;[ci]=397;[fs]=2567483615;[cr]=2147483648;[dr]=2147483647;[K]=new Array(this[ue]);[Ee]=this[ue]+1;constructor(e=o.seedFn()){this.initGenRand(e)}static seedFn(){return Math.floor(Math.random()*10**13)}static fromSeed(e=o.seedFn()){if(this[pr].has(e))return this[pr].get(e);let t=new o(e);return this[pr].set(e,t),t}initGenRand(e){let t=e;for(this[K][0]=t>>>0,this[Ee]=1;this[Ee]<this[ue];this[Ee]++)t=this[K][this[Ee]-1]^this[K][this[Ee]-1]>>>30,this[K][this[Ee]]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this[Ee],this[K][this[Ee]]>>>=0}initByArray(e,t){let i=1,r=0,a;this.initGenRand(19650218);let s=this[ue]>t?this[ue]:t;for(;s;s--)a=this[K][i-1]^this[K][i-1]>>>30,this[K][i]=(this[K][i]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+e[r]+r,this[K][i]>>>=0,i++,r++,i>=this[ue]&&(this[K][0]=this[K][this[ue]-1],i=1),r>=t&&(r=0);for(s=this[ue]-1;s;s--)a=this[K][i-1]^this[K][i-1]>>>30,this[K][i]=(this[K][i]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-i,this[K][i]>>>=0,i++,i>=this[ue]&&(this[K][0]=this[K][this[ue]-1],i=1);this[K][0]=2147483648}int32(){let e,t=[0,this[fs]];if(this[Ee]>=this[ue]){let i;for(this[Ee]===this[ue]+1&&this.initGenRand(5489),i=0;i<this[ue]-this[ci];i++)e=this[K][i]&this[cr]|this[K][i+1]&this[dr],this[K][i]=this[K][i+this[ci]]^e>>>1^t[e&1];for(;i<this[ue]-1;i++)e=this[K][i]&this[cr]|this[K][i+1]&this[dr],this[K][i]=this[K][i+(this[ci]-this[ue])]^e>>>1^t[e&1];e=this[K][this[ue]-1]&this[cr]|this[K][0]&this[dr],this[K][this[ue]-1]=this[K][this[ci]-1]^e>>>1^t[e&1],this[Ee]=0}return e=this[K][this[Ee]++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0}int31(){return this.int32()>>>1}real1(){return this.int32()*(1/4294967295)}random(e=32768,t=0){return Math.floor(this.real2()*(e-t)+t)}real2(){return this.int32()*(1/4294967296)}real3(){return(this.int32()+.5)*(1/4294967296)}res53(){let e=this.int32()>>>5,t=this.int32()>>>6;return(e*67108864+t)*(1/9007199254740992)}};var ur="0123456789",di="abcdefghijklmnopqrstuvwxyz",mr=di.toUpperCase(),fa=`${ur}abcdef`;function gs(o=""){return o.replace(/ /g,"-").replace(/[^一-龠ぁ-ゔァ-ヴー\w.-]+/g,"")}function Me(o,e={}){let t={};typeof e=="number"?t.max=e:typeof e=="object"&&(t={...e}),typeof t.min!="number"&&(t.min=0),typeof t.max!="number"&&(t.max=99999),typeof t.precision!="number"&&(t.precision=1),t.max>0&&(t.max+=t.precision);let i=Math.floor(o.random(t.max/t.precision,t.min/t.precision));return t.precision===1||(i/=1/t.precision),i}function hr(o,e={}){let t={};return typeof e=="number"?t.precision=e:typeof e=="object"&&(t={...e}),typeof t.precision!="number"&&(t.precision=.01),Me(o,t)}function ys(o,e=10,t){let i=typeof t=="string"?t:mr+di,r={min:0,max:i.length-1};return new Array(e).fill("").map(()=>i[Me(o,r)]).join("")}function bs(o,e={}){let t={...e},i;switch(t.casing){case"lower":i=di;break;case"upper":i=mr;break;default:i=di+mr}if(!t.pool){t.pool="";let r="!@#$%^&*()[]";t.alpha&&(t.pool+=i),t.numeric&&(t.pool+=ur),t.symbols&&(t.pool+=r),t.pool||(t.pool=`${i}${ur}${r}`)}return t.pool.charAt(Me(o,t.pool.length-1))}function ws(o,e={}){let t={};typeof e=="number"?t.max=e:typeof e=="object"&&(t={...e});let i=864e13;(typeof t.min!="number"||t.min<i*-1)&&(t.min=new Date().setFullYear(1970,1,1)),(typeof t.max!="number"||t.max>i)&&(t.max=new Date().setFullYear(2100,1,1));let r=Me(o,t);return new Date(r)}var Vt=Symbol("mtValue"),ut=class{[Vt];constructor(e){this[Vt]=pt.fromSeed(e)}seed(e){this[Vt]=pt.fromSeed(e)}pick(e,t){let i=t;typeof i!="number"?i=Me(this[Vt],{min:1,max:e.length}):i>e.length?i=e.length:i<0&&(i=0);let r=[...e],a=r.length,s=a-i,n,l;for(;a-- >s;)l=Math.floor((a+1)*hr(this[Vt],{min:0,max:.99})),n=r[l],r[l]=r[a],r[a]=n;return r.slice(s)}pickOne(e){let t=Me(this[Vt],{max:e.length-1});return e[t]}};var pi=Symbol("randomValue"),ze=Symbol("mtValue"),je=class{[ze];[pi];constructor(e){this[ze]=pt.fromSeed(e),this[pi]=new ut(e)}seed(e){this[ze]=pt.fromSeed(e),this[pi].seed(e)}number(e={}){return Me(this[ze],e)}float(e={}){return hr(this[ze],e)}datetime(e={}){return ws(this[ze],e)}string(e=10,t){return ys(this[ze],e,t)}character(e={}){return bs(this[ze],e)}uuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let i=this.number({min:0,max:15});return(t==="x"?i:i&3|8).toString(16)})}hash(e={}){let{length:t=40,casing:i="lower"}=e,r=i==="upper"?fa.toUpperCase():fa;return this.string(t,r)}boolean(e={}){let t={};if(typeof e=="number"?t.likelihood=e:typeof e=="object"&&(t={...e}),typeof t.likelihood>"u"&&(t.likelihood=Me(this[ze],{min:0,max:100})),t.likelihood<0||t.likelihood>100)throw new RangeError("Invalid likelihood range. Accepted range is [0, 100].");return this[ze].real2()*100<t.likelihood}falsy(e={}){let t=e.pool||[!1,null,0,NaN,""];return this[pi].pickOne(t)}hexaDecimal(e=1){let t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","A","B","C","D","E","F"];return`0x${this[pi].pick(t,e).join("")}`}};var Nl={names:["January","February","March","April","May","June","July","August","September","October","November","December"],abbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},ks=Nl;var jl={names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},Ss=jl;var Il={month:ks,weekday:Ss},_s=Il;var $l=Object.freeze({consonants:"bcdfghjklmnprstvwz",vowels:"aeiou"}),As=$l;var Tl={free:["gmail.com","yahoo.com","hotmail.com"],example:["example.org","example.com","example.net"]},xs=Tl;var Cl={suffix:["com","biz","info","name","net","org"]},Es=Cl;var Ol=["0therplanet_128.jpg","1markiz_128.jpg","2fockus_128.jpg","8d3k_128.jpg","91bilal_128.jpg","9lessons_128.jpg","AM_Kn2_128.jpg","AlbertoCococi_128.jpg","BenouarradeM_128.jpg","BillSKenney_128.jpg","BrianPurkiss_128.jpg","BroumiYoussef_128.jpg","BryanHorsey_128.jpg","Chakintosh_128.jpg","ChrisFarina78_128.jpg","Elt_n_128.jpg","GavicoInd_128.jpg","HenryHoffman_128.jpg","IsaryAmairani_128.jpg","Karimmove_128.jpg","LucasPerdidao_128.jpg","ManikRathee_128.jpg","RussellBishop_128.jpg","S0ufi4n3_128.jpg","SULiik_128.jpg","Shriiiiimp_128.jpg","Silveredge9_128.jpg","Skyhartman_128.jpg","SlaapMe_128.jpg","Stievius_128.jpg","Talbi_ConSept_128.jpg","VMilescu_128.jpg","VinThomas_128.jpg","YoungCutlass_128.jpg","ZacharyZorbas_128.jpg","_dwite__128.jpg","_kkga_128.jpg","_pedropinho_128.jpg","_ragzor_128.jpg","_scottburgess_128.jpg","_shahedk_128.jpg","_victa_128.jpg","_vojto_128.jpg","_williamguerra_128.jpg","_yardenoon_128.jpg","a1chapone_128.jpg","a_brixen_128.jpg","a_harris88_128.jpg","aaronalfred_128.jpg","aaroni_128.jpg","aaronkwhite_128.jpg","abdots_128.jpg","abdulhyeuk_128.jpg","abdullindenis_128.jpg","abelcabans_128.jpg","abotap_128.jpg","abovefunction_128.jpg","adamawesomeface_128.jpg","adammarsbar_128.jpg","adamnac_128.jpg","adamsxu_128.jpg","adellecharles_128.jpg","ademilter_128.jpg","adhamdannaway_128.jpg","adhiardana_128.jpg","adityasutomo_128.jpg","adobi_128.jpg","adrienths_128.jpg","aeon56_128.jpg","afusinatto_128.jpg","agromov_128.jpg","agustincruiz_128.jpg","ah_lice_128.jpg","ahmadajmi_128.jpg","ahmetalpbalkan_128.jpg","ahmetsulek_128.jpg","aiiaiiaii_128.jpg","ainsleywagon_128.jpg","aio____128.jpg","airskylar_128.jpg","aislinnkelly_128.jpg","ajaxy_ru_128.jpg","aka_james_128.jpg","akashsharma39_128.jpg","akmalfikri_128.jpg","akmur_128.jpg","al_li_128.jpg","alagoon_128.jpg","alan_zhang__128.jpg","albertaugustin_128.jpg","alecarpentier_128.jpg","aleclarsoniv_128.jpg","aleinadsays_128.jpg","alek_djuric_128.jpg","aleksitappura_128.jpg","alessandroribe_128.jpg","alevizio_128.jpg","alexandermayes_128.jpg","alexivanichkin_128.jpg","algunsanabria_128.jpg","allagringaus_128.jpg","allfordesign_128.jpg","allthingssmitty_128.jpg","alsobrooks_128.jpg","alterchuca_128.jpg","aluisio_azevedo_128.jpg","alxleroydeval_128.jpg","alxndrustinov_128.jpg","amandabuzard_128.jpg","amanruzaini_128.jpg","amayvs_128.jpg","amywebbb_128.jpg","anaami_128.jpg","anasnakawa_128.jpg","anatolinicolae_128.jpg","andrea211087_128.jpg","andreas_pr_128.jpg","andresdjasso_128.jpg","andresenfredrik_128.jpg","andrewabogado_128.jpg","andrewarrow_128.jpg","andrewcohen_128.jpg","andrewofficer_128.jpg","andyisonline_128.jpg","andysolomon_128.jpg","andytlaw_128.jpg","angelceballos_128.jpg","angelcolberg_128.jpg","angelcreative_128.jpg","anjhero_128.jpg","ankitind_128.jpg","anoff_128.jpg","anthonysukow_128.jpg","antjanus_128.jpg","antongenkin_128.jpg","antonyryndya_128.jpg","antonyzotov_128.jpg","aoimedia_128.jpg","apriendeau_128.jpg","arashmanteghi_128.jpg","areandacom_128.jpg","areus_128.jpg","ariffsetiawan_128.jpg","ariil_128.jpg","arindam__128.jpg","arishi__128.jpg","arkokoley_128.jpg","aroon_sharma_128.jpg","arpitnj_128.jpg","artd_sign_128.jpg","artem_kostenko_128.jpg","arthurholcombe1_128.jpg","artvavs_128.jpg","ashernatali_128.jpg","ashocka18_128.jpg","atanism_128.jpg","atariboy_128.jpg","ateneupopular_128.jpg","attacks_128.jpg","aviddayentonbay_128.jpg","axel_128.jpg","badlittleduck_128.jpg","bagawarman_128.jpg","baires_128.jpg","balakayuriy_128.jpg","balintorosz_128.jpg","baliomega_128.jpg","baluli_128.jpg","bargaorobalo_128.jpg","barputro_128.jpg","bartjo_128.jpg","bartoszdawydzik_128.jpg","bassamology_128.jpg","batsirai_128.jpg","baumann_alex_128.jpg","baumannzone_128.jpg","bboy1895_128.jpg","bcrad_128.jpg","begreative_128.jpg","belyaev_rs_128.jpg","benefritz_128.jpg","benjamin_knight_128.jpg","bennyjien_128.jpg","benoitboucart_128.jpg","bereto_128.jpg","bergmartin_128.jpg","bermonpainter_128.jpg","bertboerland_128.jpg","besbujupi_128.jpg","beshur_128.jpg","betraydan_128.jpg","beweinreich_128.jpg","bfrohs_128.jpg","bighanddesign_128.jpg","bigmancho_128.jpg","billyroshan_128.jpg","bistrianiosip_128.jpg","blakehawksworth_128.jpg","blakesimkins_128.jpg","bluefx__128.jpg","bluesix_128.jpg","bobbytwoshoes_128.jpg","bobwassermann_128.jpg","bolzanmarco_128.jpg","borantula_128.jpg","borges_marcos_128.jpg","bowbrick_128.jpg","boxmodel_128.jpg","bpartridge_128.jpg","bradenhamm_128.jpg","brajeshwar_128.jpg","brandclay_128.jpg","brandonburke_128.jpg","brandonflatsoda_128.jpg","brandonmorreale_128.jpg","brenmurrell_128.jpg","brenton_clarke_128.jpg","bruno_mart_128.jpg","brunodesign1206_128.jpg","bryan_topham_128.jpg","bu7921_128.jpg","bublienko_128.jpg","buddhasource_128.jpg","buleswapnil_128.jpg","bungiwan_128.jpg","buryaknick_128.jpg","buzzusborne_128.jpg","byrnecore_128.jpg","byryan_128.jpg","cadikkara_128.jpg","calebjoyce_128.jpg","calebogden_128.jpg","canapud_128.jpg","carbontwelve_128.jpg","carlfairclough_128.jpg","carlosblanco_eu_128.jpg","carlosgavina_128.jpg","carlosjgsousa_128.jpg","carlosm_128.jpg","carlyson_128.jpg","caseycavanagh_128.jpg","caspergrl_128.jpg","catadeleon_128.jpg","catarino_128.jpg","cboller1_128.jpg","cbracco_128.jpg","ccinojasso1_128.jpg","cdavis565_128.jpg","cdharrison_128.jpg","ceekaytweet_128.jpg","cemshid_128.jpg","cggaurav_128.jpg","chaabane_wail_128.jpg","chacky14_128.jpg","chadami_128.jpg","chadengle_128.jpg","chaensel_128.jpg","chandlervdw_128.jpg","chanpory_128.jpg","charlesrpratt_128.jpg","charliecwaite_128.jpg","charliegann_128.jpg","chatyrko_128.jpg","cherif_b_128.jpg","chris_frees_128.jpg","chris_witko_128.jpg","chrismj83_128.jpg","chrisslowik_128.jpg","chrisstumph_128.jpg","christianoliff_128.jpg","chrisvanderkooi_128.jpg","ciaranr_128.jpg","cicerobr_128.jpg","claudioguglieri_128.jpg","cloudstudio_128.jpg","clubb3rry_128.jpg","cocolero_128.jpg","codepoet_ru_128.jpg","coderdiaz_128.jpg","codysanfilippo_128.jpg","cofla_128.jpg","colgruv_128.jpg","colirpixoil_128.jpg","collegeman_128.jpg","commadelimited_128.jpg","conspirator_128.jpg","constantx_128.jpg","coreyginnivan_128.jpg","coreyhaggard_128.jpg","coreyweb_128.jpg","craigelimeliah_128.jpg","craighenneberry_128.jpg","craigrcoles_128.jpg","creartinc_128.jpg","croakx_128.jpg","curiousoffice_128.jpg","curiousonaut_128.jpg","cybind_128.jpg","cynthiasavard_128.jpg","cyril_gaillard_128.jpg","d00maz_128.jpg","d33pthought_128.jpg","d_kobelyatsky_128.jpg","d_nny_m_cher_128.jpg","dactrtr_128.jpg","dahparra_128.jpg","dallasbpeters_128.jpg","damenleeturks_128.jpg","danillos_128.jpg","daniloc_128.jpg","danmartin70_128.jpg","dannol_128.jpg","danpliego_128.jpg","danro_128.jpg","dansowter_128.jpg","danthms_128.jpg","danvernon_128.jpg","danvierich_128.jpg","darcystonge_128.jpg","darylws_128.jpg","davecraige_128.jpg","davidbaldie_128.jpg","davidcazalis_128.jpg","davidhemphill_128.jpg","davidmerrique_128.jpg","davidsasda_128.jpg","dawidwu_128.jpg","daykiine_128.jpg","dc_user_128.jpg","dcalonaci_128.jpg","ddggccaa_128.jpg","de_ascanio_128.jpg","deeenright_128.jpg","demersdesigns_128.jpg","denisepires_128.jpg","depaulawagner_128.jpg","derekcramer_128.jpg","derekebradley_128.jpg","derienzo777_128.jpg","desastrozo_128.jpg","designervzm_128.jpg","dev_essentials_128.jpg","devankoshal_128.jpg","deviljho__128.jpg","devinhalladay_128.jpg","dgajjar_128.jpg","dgclegg_128.jpg","dhilipsiva_128.jpg","dhoot_amit_128.jpg","dhooyenga_128.jpg","dhrubo_128.jpg","diansigitp_128.jpg","dicesales_128.jpg","diesellaws_128.jpg","digitalmaverick_128.jpg","dimaposnyy_128.jpg","dingyi_128.jpg","divya_128.jpg","dixchen_128.jpg","djsherman_128.jpg","dmackerman_128.jpg","dmitriychuta_128.jpg","dnezkumar_128.jpg","dnirmal_128.jpg","donjain_128.jpg","doooon_128.jpg","doronmalki_128.jpg","dorphern_128.jpg","dotgridline_128.jpg","dparrelli_128.jpg","dpmachado_128.jpg","dreizle_128.jpg","drewbyreese_128.jpg","dshster_128.jpg","dss49_128.jpg","dudestein_128.jpg","duivvv_128.jpg","dutchnadia_128.jpg","dvdwinden_128.jpg","dzantievm_128.jpg","ecommerceil_128.jpg","eddiechen_128.jpg","edgarchris99_128.jpg","edhenderson_128.jpg","edkf_128.jpg","edobene_128.jpg","eduardostuart_128.jpg","ehsandiary_128.jpg","eitarafa_128.jpg","el_fuertisimo_128.jpg","elbuscainfo_128.jpg","elenadissi_128.jpg","elisabethkjaer_128.jpg","elliotlewis_128.jpg","elliotnolten_128.jpg","embrcecreations_128.jpg","emileboudeling_128.jpg","emmandenn_128.jpg","emmeffess_128.jpg","emsgulam_128.jpg","enda_128.jpg","enjoythetau_128.jpg","enricocicconi_128.jpg","envex_128.jpg","ernestsemerda_128.jpg","erwanhesry_128.jpg","estebanuribe_128.jpg","eugeneeweb_128.jpg","evandrix_128.jpg","evanshajed_128.jpg","exentrich_128.jpg","eyronn_128.jpg","fabbianz_128.jpg","fabbrucci_128.jpg","faisalabid_128.jpg","falconerie_128.jpg","falling_soul_128.jpg","falvarad_128.jpg","felipeapiress_128.jpg","felipecsl_128.jpg","ffbel_128.jpg","finchjke_128.jpg","findingjenny_128.jpg","fiterik_128.jpg","fjaguero_128.jpg","flashmurphy_128.jpg","flexrs_128.jpg","foczzi_128.jpg","fotomagin_128.jpg","fran_mchamy_128.jpg","francis_vega_128.jpg","franciscoamk_128.jpg","frankiefreesbie_128.jpg","fronx_128.jpg","funwatercat_128.jpg","g3d_128.jpg","gaborenton_128.jpg","gabrielizalo_128.jpg","gabrielrosser_128.jpg","ganserene_128.jpg","garand_128.jpg","gauchomatt_128.jpg","gauravjassal_128.jpg","gavr1l0_128.jpg","gcmorley_128.jpg","gearpixels_128.jpg","geneseleznev_128.jpg","geobikas_128.jpg","geran7_128.jpg","geshan_128.jpg","giancarlon_128.jpg","gipsy_raf_128.jpg","giuliusa_128.jpg","gizmeedevil1991_128.jpg","gkaam_128.jpg","gmourier_128.jpg","goddardlewis_128.jpg","gofrasdesign_128.jpg","gojeanyn_128.jpg","gonzalorobaina_128.jpg","grahamkennery_128.jpg","greenbes_128.jpg","gregkilian_128.jpg","gregrwilkinson_128.jpg","gregsqueeb_128.jpg","grrr_nl_128.jpg","gseguin_128.jpg","gt_128.jpg","gu5taf_128.jpg","guiiipontes_128.jpg","guillemboti_128.jpg","guischmitt_128.jpg","gusoto_128.jpg","h1brd_128.jpg","hafeeskhan_128.jpg","hai_ninh_nguyen_128.jpg","haligaliharun_128.jpg","hanna_smi_128.jpg","happypeter1983_128.jpg","harry_sistalam_128.jpg","haruintesettden_128.jpg","hasslunsford_128.jpg","haydn_woods_128.jpg","helderleal_128.jpg","hellofeverrrr_128.jpg","her_ruu_128.jpg","herbigt_128.jpg","herkulano_128.jpg","hermanobrother_128.jpg","herrhaase_128.jpg","heycamtaylor_128.jpg","heyimjuani_128.jpg","heykenneth_128.jpg","hfalucas_128.jpg","hgharrygo_128.jpg","hiemil_128.jpg","hjartstrorn_128.jpg","hoangloi_128.jpg","holdenweb_128.jpg","homka_128.jpg","horaciobella_128.jpg","hota_v_128.jpg","hsinyo23_128.jpg","hugocornejo_128.jpg","hugomano_128.jpg","iamgarth_128.jpg","iamglimy_128.jpg","iamjdeleon_128.jpg","iamkarna_128.jpg","iamkeithmason_128.jpg","iamsteffen_128.jpg","id835559_128.jpg","idiot_128.jpg","iduuck_128.jpg","ifarafonow_128.jpg","igorgarybaldi_128.jpg","illyzoren_128.jpg","ilya_pestov_128.jpg","imammuht_128.jpg","imcoding_128.jpg","imomenui_128.jpg","imsoper_128.jpg","increase_128.jpg","incubo82_128.jpg","instalox_128.jpg","ionuss_128.jpg","ipavelek_128.jpg","iqbalperkasa_128.jpg","iqonicd_128.jpg","irae_128.jpg","isaacfifth_128.jpg","isacosta_128.jpg","ismail_biltagi_128.jpg","isnifer_128.jpg","itolmach_128.jpg","itsajimithing_128.jpg","itskawsar_128.jpg","itstotallyamy_128.jpg","ivanfilipovbg_128.jpg","j04ntoh_128.jpg","j2deme_128.jpg","j_drake__128.jpg","jackiesaik_128.jpg","jacksonlatka_128.jpg","jacobbennett_128.jpg","jagan123_128.jpg","jakemoore_128.jpg","jamiebrittain_128.jpg","janpalounek_128.jpg","jarjan_128.jpg","jarsen_128.jpg","jasonmarkjones_128.jpg","javorszky_128.jpg","jay_wilburn_128.jpg","jayphen_128.jpg","jayrobinson_128.jpg","jcubic_128.jpg","jedbridges_128.jpg","jefffis_128.jpg","jeffgolenski_128.jpg","jehnglynn_128.jpg","jennyshen_128.jpg","jennyyo_128.jpg","jeremery_128.jpg","jeremiaha_128.jpg","jeremiespoken_128.jpg","jeremymouton_128.jpg","jeremyshimko_128.jpg","jeremyworboys_128.jpg","jerrybai1907_128.jpg","jervo_128.jpg","jesseddy_128.jpg","jffgrdnr_128.jpg","jghyllebert_128.jpg","jimmuirhead_128.jpg","jitachi_128.jpg","jjshaw14_128.jpg","jjsiii_128.jpg","jlsolerdeltoro_128.jpg","jm_denis_128.jpg","jmfsocial_128.jpg","jmillspaysbills_128.jpg","jnmnrd_128.jpg","joannefournier_128.jpg","joaoedumedeiros_128.jpg","jodytaggart_128.jpg","joe_black_128.jpg","joelcipriano_128.jpg","joelhelin_128.jpg","joemdesign_128.jpg","joetruesdell_128.jpg","joeymurdah_128.jpg","johannesneu_128.jpg","johncafazza_128.jpg","johndezember_128.jpg","johnriordan_128.jpg","johnsmithagency_128.jpg","joki4_128.jpg","jomarmen_128.jpg","jonathansimmons_128.jpg","jonkspr_128.jpg","jonsgotwood_128.jpg","jordyvdboom_128.jpg","joreira_128.jpg","josecarlospsh_128.jpg","josemarques_128.jpg","josep_martins_128.jpg","josevnclch_128.jpg","joshaustin_128.jpg","joshhemsley_128.jpg","joshmedeski_128.jpg","joshuaraichur_128.jpg","joshuasortino_128.jpg","jpenico_128.jpg","jpscribbles_128.jpg","jqiuss_128.jpg","juamperro_128.jpg","juangomezw_128.jpg","juanmamartinez_128.jpg","juaumlol_128.jpg","judzhin_miles_128.jpg","justinrgraham_128.jpg","justinrhee_128.jpg","justinrob_128.jpg","justme_timothyg_128.jpg","jwalter14_128.jpg","jydesign_128.jpg","kaelifa_128.jpg","kalmerrautam_128.jpg","kamal_chaneman_128.jpg","kanickairaj_128.jpg","kapaluccio_128.jpg","karalek_128.jpg","karlkanall_128.jpg","karolkrakowiak__128.jpg","karsh_128.jpg","karthipanraj_128.jpg","kaspernordkvist_128.jpg","katiemdaly_128.jpg","kaysix_dizzy_128.jpg","kazaky999_128.jpg","kennyadr_128.jpg","kerem_128.jpg","kerihenare_128.jpg","keryilmaz_128.jpg","kevinjohndayy_128.jpg","kevinoh_128.jpg","kevka_128.jpg","keyuri85_128.jpg","kianoshp_128.jpg","kijanmaharjan_128.jpg","kikillo_128.jpg","kimcool_128.jpg","kinday_128.jpg","kirangopal_128.jpg","kiwiupover_128.jpg","kkusaa_128.jpg","klefue_128.jpg","klimmka_128.jpg","knilob_128.jpg","kohette_128.jpg","kojourin_128.jpg","kolage_128.jpg","kolmarlopez_128.jpg","kolsvein_128.jpg","konus_128.jpg","koridhandy_128.jpg","kosmar_128.jpg","kostaspt_128.jpg","krasnoukhov_128.jpg","krystalfister_128.jpg","kucingbelang4_128.jpg","kudretkeskin_128.jpg","kuldarkalvik_128.jpg","kumarrajan12123_128.jpg","kurafire_128.jpg","kurtinc_128.jpg","kushsolitary_128.jpg","kvasnic_128.jpg","ky_128.jpg","kylefoundry_128.jpg","kylefrost_128.jpg","laasli_128.jpg","lanceguyatt_128.jpg","langate_128.jpg","larrybolt_128.jpg","larrygerard_128.jpg","laurengray_128.jpg","lawlbwoy_128.jpg","layerssss_128.jpg","leandrovaranda_128.jpg","lebinoclard_128.jpg","lebronjennan_128.jpg","leehambley_128.jpg","leeiio_128.jpg","leemunroe_128.jpg","leonfedotov_128.jpg","lepetitogre_128.jpg","lepinski_128.jpg","levisan_128.jpg","lewisainslie_128.jpg","lhausermann_128.jpg","liminha_128.jpg","lingeswaran_128.jpg","linkibol_128.jpg","linux29_128.jpg","lisovsky_128.jpg","llun_128.jpg","lmjabreu_128.jpg","loganjlambert_128.jpg","logorado_128.jpg","lokesh_coder_128.jpg","lonesomelemon_128.jpg","longlivemyword_128.jpg","looneydoodle_128.jpg","lososina_128.jpg","louis_currie_128.jpg","low_res_128.jpg","lowie_128.jpg","lu4sh1i_128.jpg","ludwiczakpawel_128.jpg","luxe_128.jpg","lvovenok_128.jpg","m4rio_128.jpg","m_kalibry_128.jpg","ma_tiax_128.jpg","mactopus_128.jpg","macxim_128.jpg","madcampos_128.jpg","madebybrenton_128.jpg","madebyvadim_128.jpg","madewulf_128.jpg","madshensel_128.jpg","madysondesigns_128.jpg","magoo04_128.jpg","magugzbrand2d_128.jpg","mahdif_128.jpg","mahmoudmetwally_128.jpg","maikelk_128.jpg","maiklam_128.jpg","malgordon_128.jpg","malykhinv_128.jpg","mandalareopens_128.jpg","manekenthe_128.jpg","mangosango_128.jpg","manigm_128.jpg","marakasina_128.jpg","marciotoledo_128.jpg","marclgonzales_128.jpg","marcobarbosa_128.jpg","marcomano__128.jpg","marcoramires_128.jpg","marcusgorillius_128.jpg","markjenkins_128.jpg","marklamb_128.jpg","markolschesky_128.jpg","markretzloff_128.jpg","markwienands_128.jpg","marlinjayakody_128.jpg","marosholly_128.jpg","marrimo_128.jpg","marshallchen__128.jpg","martinansty_128.jpg","martip07_128.jpg","mashaaaaal_128.jpg","mastermindesign_128.jpg","matbeedotcom_128.jpg","mateaodviteza_128.jpg","matkins_128.jpg","matt3224_128.jpg","mattbilotti_128.jpg","mattdetails_128.jpg","matthewkay__128.jpg","mattlat_128.jpg","mattsapii_128.jpg","mauriolg_128.jpg","maximseshuk_128.jpg","maximsorokin_128.jpg","maxlinderman_128.jpg","maz_128.jpg","mbilalsiddique1_128.jpg","mbilderbach_128.jpg","mcflydesign_128.jpg","mds_128.jpg","mdsisto_128.jpg","meelford_128.jpg","megdraws_128.jpg","mekal_128.jpg","meln1ks_128.jpg","melvindidit_128.jpg","mfacchinello_128.jpg","mgonto_128.jpg","mhaligowski_128.jpg","mhesslow_128.jpg","mhudobivnik_128.jpg","michaelabehsera_128.jpg","michaelbrooksjr_128.jpg","michaelcolenso_128.jpg","michaelcomiskey_128.jpg","michaelkoper_128.jpg","michaelmartinho_128.jpg","michalhron_128.jpg","michigangraham_128.jpg","michzen_128.jpg","mighty55_128.jpg","miguelkooreman_128.jpg","miguelmendes_128.jpg","mikaeljorhult_128.jpg","mikebeecham_128.jpg","mikemai2awesome_128.jpg","millinet_128.jpg","mirfanqureshi_128.jpg","missaaamy_128.jpg","mizhgan_128.jpg","mizko_128.jpg","mkginfo_128.jpg","mocabyte_128.jpg","mohanrohith_128.jpg","moscoz_128.jpg","motionthinks_128.jpg","moynihan_128.jpg","mr_shiznit_128.jpg","mr_subtle_128.jpg","mrebay007_128.jpg","mrjamesnoble_128.jpg","mrmartineau_128.jpg","mrxloka_128.jpg","mslarkina_128.jpg","msveet_128.jpg","mtolokonnikov_128.jpg","mufaddal_mw_128.jpg","mugukamil_128.jpg","muridrahhal_128.jpg","muringa_128.jpg","murrayswift_128.jpg","mutlu82_128.jpg","mutu_krish_128.jpg","mvdheuvel_128.jpg","mwarkentin_128.jpg","myastro_128.jpg","mylesb_128.jpg","mymyboy_128.jpg","n1ght_coder_128.jpg","n3dmax_128.jpg","n_tassone_128.jpg","nacho_128.jpg","naitanamoreno_128.jpg","namankreative_128.jpg","nandini_m_128.jpg","nasirwd_128.jpg","nastya_mane_128.jpg","nateschulte_128.jpg","nathalie_fs_128.jpg","naupintos_128.jpg","nbirckel_128.jpg","nckjrvs_128.jpg","necodymiconer_128.jpg","nehfy_128.jpg","nellleo_128.jpg","nelshd_128.jpg","nelsonjoyce_128.jpg","nemanjaivanovic_128.jpg","nepdud_128.jpg","nerdgr8_128.jpg","nerrsoft_128.jpg","nessoila_128.jpg","netonet_il_128.jpg","newbrushes_128.jpg","nfedoroff_128.jpg","nickfratter_128.jpg","nicklacke_128.jpg","nicolai_larsen_128.jpg","nicolasfolliot_128.jpg","nicoleglynn_128.jpg","nicollerich_128.jpg","nilshelmersson_128.jpg","nilshoenson_128.jpg","ninjad3m0_128.jpg","nitinhayaran_128.jpg","nomidesigns_128.jpg","normanbox_128.jpg","notbadart_128.jpg","noufalibrahim_128.jpg","noxdzine_128.jpg","nsamoylov_128.jpg","ntfblog_128.jpg","nutzumi_128.jpg","nvkznemo_128.jpg","nwdsha_128.jpg","nyancecom_128.jpg","oaktreemedia_128.jpg","okandungel_128.jpg","okansurreel_128.jpg","okcoker_128.jpg","oksanafrewer_128.jpg","okseanjay_128.jpg","oktayelipek_128.jpg","olaolusoga_128.jpg","olgary_128.jpg","omnizya_128.jpg","ooomz_128.jpg","operatino_128.jpg","opnsrce_128.jpg","orkuncaylar_128.jpg","oscarowusu_128.jpg","oskamaya_128.jpg","oskarlevinson_128.jpg","osmanince_128.jpg","osmond_128.jpg","ostirbu_128.jpg","osvaldas_128.jpg","otozk_128.jpg","ovall_128.jpg","overcloacked_128.jpg","overra_128.jpg","panchajanyag_128.jpg","panghal0_128.jpg","patrickcoombe_128.jpg","paulfarino_128.jpg","pcridesagain_128.jpg","peachananr_128.jpg","pechkinator_128.jpg","peejfancher_128.jpg","pehamondello_128.jpg","perfectflow_128.jpg","perretmagali_128.jpg","petar_prog_128.jpg","petebernardo_128.jpg","peter576_128.jpg","peterlandt_128.jpg","petrangr_128.jpg","phillapier_128.jpg","picard102_128.jpg","pierre_nel_128.jpg","pierrestoffe_128.jpg","pifagor_128.jpg","pixage_128.jpg","plasticine_128.jpg","plbabin_128.jpg","pmeissner_128.jpg","polarity_128.jpg","ponchomendivil_128.jpg","poormini_128.jpg","popey_128.jpg","posterjob_128.jpg","praveen_vijaya_128.jpg","prheemo_128.jpg","primozcigler_128.jpg","prinzadi_128.jpg","privetwagner_128.jpg","prrstn_128.jpg","psaikali_128.jpg","psdesignuk_128.jpg","puzik_128.jpg","pyronite_128.jpg","quailandquasar_128.jpg","r_garcia_128.jpg","r_oy_128.jpg","rachelreveley_128.jpg","rahmeen_128.jpg","ralph_lam_128.jpg","ramanathan_pdy_128.jpg","randomlies_128.jpg","rangafangs_128.jpg","raphaelnikson_128.jpg","raquelwilson_128.jpg","ratbus_128.jpg","rawdiggie_128.jpg","rdbannon_128.jpg","rdsaunders_128.jpg","reabo101_128.jpg","reetajayendra_128.jpg","rehatkathuria_128.jpg","reideiredale_128.jpg","renbyrd_128.jpg","rez___a_128.jpg","ricburton_128.jpg","richardgarretts_128.jpg","richwild_128.jpg","rickdt_128.jpg","rickyyean_128.jpg","rikas_128.jpg","ripplemdk_128.jpg","rmlewisuk_128.jpg","rob_thomas10_128.jpg","robbschiller_128.jpg","robergd_128.jpg","robinclediere_128.jpg","robinlayfield_128.jpg","robturlinckx_128.jpg","rodnylobos_128.jpg","rohixx_128.jpg","romanbulah_128.jpg","roxanejammet_128.jpg","roybarberuk_128.jpg","rpatey_128.jpg","rpeezy_128.jpg","rtgibbons_128.jpg","rtyukmaev_128.jpg","rude_128.jpg","ruehldesign_128.jpg","runningskull_128.jpg","russell_baylis_128.jpg","russoedu_128.jpg","ruzinav_128.jpg","rweve_128.jpg","ryandownie_128.jpg","ryanjohnson_me_128.jpg","ryankirkman_128.jpg","ryanmclaughlin_128.jpg","ryhanhassan_128.jpg","ryuchi311_128.jpg","s4f1_128.jpg","saarabpreet_128.jpg","sachacorazzi_128.jpg","sachingawas_128.jpg","safrankov_128.jpg","sainraja_128.jpg","salimianoff_128.jpg","salleedesign_128.jpg","salvafc_128.jpg","samgrover_128.jpg","samihah_128.jpg","samscouto_128.jpg","samuelkraft_128.jpg","sandywoodruff_128.jpg","sangdth_128.jpg","santi_urso_128.jpg","saschadroste_128.jpg","saschamt_128.jpg","sasha_shestakov_128.jpg","saulihirvi_128.jpg","sawalazar_128.jpg","sawrb_128.jpg","sbtransparent_128.jpg","scips_128.jpg","scott_riley_128.jpg","scottfeltham_128.jpg","scottgallant_128.jpg","scottiedude_128.jpg","scottkclark_128.jpg","scrapdnb_128.jpg","sdidonato_128.jpg","sebashton_128.jpg","sementiy_128.jpg","serefka_128.jpg","sergeyalmone_128.jpg","sergeysafonov_128.jpg","sethlouey_128.jpg","seyedhossein1_128.jpg","sgaurav_baghel_128.jpg","shadeed9_128.jpg","shalt0ni_128.jpg","shaneIxD_128.jpg","shanehudson_128.jpg","sharvin_128.jpg","shesgared_128.jpg","shinze_128.jpg","shoaib253_128.jpg","shojberg_128.jpg","shvelo96_128.jpg","silv3rgvn_128.jpg","silvanmuhlemann_128.jpg","simobenso_128.jpg","sindresorhus_128.jpg","sircalebgrove_128.jpg","skkirilov_128.jpg","slowspock_128.jpg","smaczny_128.jpg","smalonso_128.jpg","smenov_128.jpg","snowshade_128.jpg","snowwrite_128.jpg","sokaniwaal_128.jpg","solid_color_128.jpg","souperphly_128.jpg","souuf_128.jpg","sovesove_128.jpg","soyjavi_128.jpg","spacewood__128.jpg","spbroma_128.jpg","spedwig_128.jpg","sprayaga_128.jpg","sreejithexp_128.jpg","ssbb_me_128.jpg","ssiskind_128.jpg","sta1ex_128.jpg","stalewine_128.jpg","stan_128.jpg","stayuber_128.jpg","stefanotirloni_128.jpg","stefanozoffoli_128.jpg","stefooo_128.jpg","stefvdham_128.jpg","stephcoue_128.jpg","sterlingrules_128.jpg","stevedesigner_128.jpg","steynviljoen_128.jpg","strikewan_128.jpg","stushona_128.jpg","sulaqo_128.jpg","sunlandictwin_128.jpg","sunshinedgirl_128.jpg","superoutman_128.jpg","supervova_128.jpg","supjoey_128.jpg","suprb_128.jpg","sur4dye_128.jpg","surgeonist_128.jpg","suribbles_128.jpg","svenlen_128.jpg","swaplord_128.jpg","sweetdelisa_128.jpg","switmer777_128.jpg","swooshycueb_128.jpg","sydlawrence_128.jpg","syropian_128.jpg","tanveerrao_128.jpg","taybenlor_128.jpg","taylorling_128.jpg","tbakdesigns_128.jpg","teddyzetterlund_128.jpg","teeragit_128.jpg","tereshenkov_128.jpg","terpimost_128.jpg","terrorpixel_128.jpg","terryxlife_128.jpg","teylorfeliz_128.jpg","tgerken_128.jpg","tgormtx_128.jpg","thaisselenator__128.jpg","thaodang17_128.jpg","thatonetommy_128.jpg","the_purplebunny_128.jpg","the_winslet_128.jpg","thedamianhdez_128.jpg","thedjpetersen_128.jpg","thehacker_128.jpg","thekevinjones_128.jpg","themadray_128.jpg","themikenagle_128.jpg","themrdave_128.jpg","theonlyzeke_128.jpg","therealmarvin_128.jpg","thewillbeard_128.jpg","thiagovernetti_128.jpg","thibaut_re_128.jpg","thierrykoblentz_128.jpg","thierrymeier__128.jpg","thimo_cz_128.jpg","thinkleft_128.jpg","thomasgeisen_128.jpg","thomasschrijer_128.jpg","timgthomas_128.jpg","timmillwood_128.jpg","timothycd_128.jpg","timpetricola_128.jpg","tjrus_128.jpg","to_soham_128.jpg","tobysaxon_128.jpg","toddrew_128.jpg","tom_even_128.jpg","tomas_janousek_128.jpg","tonymillion_128.jpg","traneblow_128.jpg","travis_arnold_128.jpg","travishines_128.jpg","tristanlegros_128.jpg","trubeatto_128.jpg","trueblood_33_128.jpg","tumski_128.jpg","tur8le_128.jpg","turkutuuli_128.jpg","tweetubhai_128.jpg","twittypork_128.jpg","txcx_128.jpg","uberschizo_128.jpg","ultragex_128.jpg","umurgdk_128.jpg","unterdreht_128.jpg","urrutimeoli_128.jpg","uxalex_128.jpg","uxpiper_128.jpg","uxward_128.jpg","vanchesz_128.jpg","vaughanmoffitt_128.jpg","vc27_128.jpg","vicivadeline_128.jpg","victorDubugras_128.jpg","victor_haydin_128.jpg","victordeanda_128.jpg","victorerixon_128.jpg","victorquinn_128.jpg","victorstuber_128.jpg","vigobronx_128.jpg","vijaykarthik_128.jpg","vikashpathak18_128.jpg","vikasvinfotech_128.jpg","vimarethomas_128.jpg","vinciarts_128.jpg","vitor376_128.jpg","vitorleal_128.jpg","vivekprvr_128.jpg","vj_demien_128.jpg","vladarbatov_128.jpg","vladimirdevic_128.jpg","vladyn_128.jpg","vlajki_128.jpg","vm_f_128.jpg","vocino_128.jpg","vonachoo_128.jpg","vovkasolovev_128.jpg","vytautas_a_128.jpg","waghner_128.jpg","wake_gs_128.jpg","we_social_128.jpg","wearesavas_128.jpg","weavermedia_128.jpg","webtanya_128.jpg","weglov_128.jpg","wegotvices_128.jpg","wesleytrankin_128.jpg","wikiziner_128.jpg","wiljanslofstra_128.jpg","wim1k_128.jpg","wintopia_128.jpg","woodsman001_128.jpg","woodydotmx_128.jpg","wtrsld_128.jpg","xadhix_128.jpg","xalionmalik_128.jpg","xamorep_128.jpg","xiel_128.jpg","xilantra_128.jpg","xravil_128.jpg","xripunov_128.jpg","xtopherpaul_128.jpg","y2graphic_128.jpg","yalozhkin_128.jpg","yassiryahya_128.jpg","yayteejay_128.jpg","yecidsm_128.jpg","yehudab_128.jpg","yesmeck_128.jpg","yigitpinarbasi_128.jpg","zackeeler_128.jpg","zaki3d_128.jpg","zauerkraut_128.jpg","zforrester_128.jpg","zvchkelly_128.jpg"],Ns=Ol;var Rl={email:xs,domain:Es,avatar:Ns},js=Rl;var Pl={female:["Mary","Patricia","Linda","Barbara","Elizabeth","Jennifer","Maria","Susan","Margaret","Dorothy","Lisa","Nancy","Karen","Betty","Helen","Sandra","Donna","Carol","Ruth","Sharon","Michelle","Laura","Sarah","Kimberly","Deborah","Jessica","Shirley","Cynthia","Angela","Melissa","Brenda","Amy","Anna","Rebecca","Virginia","Kathleen","Pamela","Martha","Debra","Amanda","Stephanie","Carolyn","Christine","Marie","Janet","Catherine","Frances","Ann","Joyce","Diane","Alice","Julie","Heather","Teresa","Doris","Gloria","Evelyn","Jean","Cheryl","Mildred","Katherine","Joan","Ashley","Judith","Rose","Janice","Kelly","Nicole","Judy","Christina","Kathy","Theresa","Beverly","Denise","Tammy","Irene","Jane","Lori","Rachel","Marilyn","Andrea","Kathryn","Louise","Sara","Anne","Jacqueline","Wanda","Bonnie","Julia","Ruby","Lois","Tina","Phyllis","Norma","Paula","Diana","Annie","Lillian","Emily","Robin","Peggy","Crystal","Gladys","Rita","Dawn","Connie","Florence","Tracy","Edna","Tiffany","Carmen","Rosa","Cindy","Grace","Wendy","Victoria","Edith","Kim","Sherry","Sylvia","Josephine","Thelma","Shannon","Sheila","Ethel","Ellen","Elaine","Marjorie","Carrie","Charlotte","Monica","Esther","Pauline","Emma","Juanita","Anita","Rhonda","Hazel","Amber","Eva","Debbie","April","Leslie","Clara","Lucille","Jamie","Joanne","Eleanor","Valerie","Danielle","Megan","Alicia","Suzanne","Michele","Gail","Bertha","Darlene","Veronica","Jill","Erin","Geraldine","Lauren","Cathy","Joann","Lorraine","Lynn","Sally","Regina","Erica","Beatrice","Dolores","Bernice","Audrey","Yvonne","Annette","June","Samantha","Marion","Dana","Stacy","Ana","Renee","Ida","Vivian","Roberta","Holly","Brittany","Melanie","Loretta","Yolanda","Jeanette","Laurie","Katie","Kristen","Vanessa","Alma","Sue","Elsie","Beth","Jeanne","Vicki","Carla","Tara","Rosemary","Eileen","Terri","Gertrude","Lucy","Tonya","Ella","Stacey","Wilma","Gina","Kristin","Jessie","Natalie","Agnes","Vera","Willie","Charlene","Bessie","Delores","Melinda","Pearl","Arlene","Maureen","Colleen","Allison","Tamara","Joy","Georgia","Constance","Lillie","Claudia","Jackie","Marcia","Tanya","Nellie","Minnie","Marlene","Heidi","Glenda","Lydia","Viola","Courtney","Marian","Stella","Caroline","Dora","Jo","Vickie","Mattie","Terry","Maxine","Irma","Mabel","Marsha","Myrtle","Lena","Christy","Deanna","Patsy","Hilda","Gwendolyn","Jennie","Nora","Margie","Nina","Cassandra","Leah","Penny","Kay","Priscilla","Naomi","Carole","Brandy","Olga","Billie","Dianne","Tracey","Leona","Jenny","Felicia","Sonia","Miriam","Velma","Becky","Bobbie","Violet","Kristina","Toni","Misty","Mae","Shelly","Daisy","Ramona","Sherri","Erika","Katrina","Claire","Lindsey","Lindsay","Geneva","Guadalupe","Belinda","Margarita","Sheryl","Cora","Faye","Ada","Natasha","Sabrina","Isabel","Marguerite","Hattie","Harriet","Molly","Cecilia","Kristi","Brandi","Blanche","Sandy","Rosie","Joanna","Iris","Eunice","Angie","Inez","Lynda","Madeline","Amelia","Alberta","Genevieve","Monique","Jodi","Janie","Maggie","Kayla","Sonya","Jan","Lee","Kristine","Candace","Fannie","Maryann","Opal","Alison","Yvette","Melody","Luz","Susie","Olivia","Flora","Shelley","Kristy","Mamie","Lula","Lola","Verna","Beulah","Antoinette","Candice","Juana","Jeannette","Pam","Kelli","Hannah","Whitney","Bridget","Karla","Celia","Latoya","Patty","Shelia","Gayle","Della","Vicky","Lynne","Sheri","Marianne","Kara","Jacquelyn","Erma","Blanca","Myra","Leticia","Pat","Krista","Roxanne","Angelica","Johnnie","Robyn","Francis","Adrienne","Rosalie","Alexandra","Brooke","Bethany","Sadie","Bernadette","Traci","Jody","Kendra","Jasmine","Nichole","Rachael","Chelsea","Mable","Ernestine","Muriel","Marcella","Elena","Krystal","Angelina","Nadine","Kari","Estelle","Dianna","Paulette","Lora","Mona","Doreen","Rosemarie","Angel","Desiree","Antonia","Hope","Ginger","Janis","Betsy","Christie","Freda","Mercedes","Meredith","Lynette","Teri","Cristina","Eula","Leigh","Meghan","Sophia","Eloise","Rochelle","Gretchen","Cecelia","Raquel","Henrietta","Alyssa","Jana","Kelley","Gwen","Kerry","Jenna","Tricia","Laverne","Olive","Alexis","Tasha","Silvia","Elvira","Casey","Delia","Sophie","Kate","Patti","Lorena","Kellie","Sonja","Lila","Lana","Darla","May","Mindy","Essie","Mandy","Lorene","Elsa","Josefina","Jeannie","Miranda","Dixie","Lucia","Marta","Faith","Lela","Johanna","Shari","Camille","Tami","Shawna","Elisa","Ebony","Melba","Ora","Nettie","Tabitha","Ollie","Jaime","Winifred","Kristie"],male:["James","John","Robert","Michael","William","David","Richard","Charles","Joseph","Thomas","Christopher","Daniel","Paul","Mark","Donald","George","Kenneth","Steven","Edward","Brian","Ronald","Anthony","Kevin","Jason","Matthew","Gary","Timothy","Jose","Larry","Jeffrey","Frank","Scott","Eric","Stephen","Andrew","Raymond","Gregory","Joshua","Jerry","Dennis","Walter","Patrick","Peter","Harold","Douglas","Henry","Carl","Arthur","Ryan","Roger","Joe","Juan","Jack","Albert","Jonathan","Justin","Terry","Gerald","Keith","Samuel","Willie","Ralph","Lawrence","Nicholas","Roy","Benjamin","Bruce","Brandon","Adam","Harry","Fred","Wayne","Billy","Steve","Louis","Jeremy","Aaron","Randy","Howard","Eugene","Carlos","Russell","Bobby","Victor","Martin","Ernest","Phillip","Todd","Jesse","Craig","Alan","Shawn","Clarence","Sean","Philip","Chris","Johnny","Earl","Jimmy","Antonio","Danny","Bryan","Tony","Luis","Mike","Stanley","Leonard","Nathan","Dale","Manuel","Rodney","Curtis","Norman","Allen","Marvin","Vincent","Glenn","Jeffery","Travis","Jeff","Chad","Jacob","Lee","Melvin","Alfred","Kyle","Francis","Bradley","Jesus","Herbert","Frederick","Ray","Joel","Edwin","Don","Eddie","Ricky","Troy","Randall","Barry","Alexander","Bernard","Mario","Leroy","Francisco","Marcus","Micheal","Theodore","Clifford","Miguel","Oscar","Jay","Jim","Tom","Calvin","Alex","Jon","Ronnie","Bill","Lloyd","Tommy","Leon","Derek","Warren","Darrell","Jerome","Floyd","Leo","Alvin","Tim","Wesley","Gordon","Dean","Greg","Jorge","Dustin","Pedro","Derrick","Dan","Lewis","Zachary","Corey","Herman","Maurice","Vernon","Roberto","Clyde","Glen","Hector","Shane","Ricardo","Sam","Rick","Lester","Brent","Ramon","Charlie","Tyler","Gilbert","Gene","Marc","Reginald","Ruben","Brett","Angel","Nathaniel","Rafael","Leslie","Edgar","Milton","Raul","Ben","Chester","Cecil","Duane","Franklin","Andre","Elmer","Brad","Gabriel","Ron","Mitchell","Roland","Arnold","Harvey","Jared","Adrian","Karl","Cory","Claude","Erik","Darryl","Jamie","Neil","Jessie","Christian","Javier","Fernando","Clinton","Ted","Mathew","Tyrone","Darren","Lonnie","Lance","Cody","Julio","Kelly","Kurt","Allan","Nelson","Guy","Clayton","Hugh","Max","Dwayne","Dwight","Armando","Felix","Jimmie","Everett","Jordan","Ian","Wallace","Ken","Bob","Jaime","Casey","Alfredo","Alberto","Dave","Ivan","Johnnie","Sidney","Byron","Julian","Isaac","Morris","Clifton","Willard","Daryl","Ross","Virgil","Andy","Marshall","Salvador","Perry","Kirk","Sergio","Marion","Tracy","Seth","Kent","Terrance","Rene","Eduardo","Terrence","Enrique","Freddie","Wade","Austin","Stuart","Fredrick","Arturo","Alejandro","Jackie","Joey","Nick","Luther","Wendell","Jeremiah","Evan","Julius","Dana","Donnie","Otis","Shannon","Trevor","Oliver","Luke","Homer","Gerard","Doug","Kenny","Hubert","Angelo","Shaun","Lyle","Matt","Lynn","Alfonso","Orlando","Rex","Carlton","Ernesto","Cameron","Neal","Pablo","Lorenzo","Omar","Wilbur","Blake","Grant","Horace","Roderick","Kerry","Abraham","Willis","Rickey","Jean","Ira","Andres","Cesar","Johnathan","Malcolm","Rudolph","Damon","Kelvin","Rudy","Preston","Alton","Archie","Marco","Wm","Pete","Randolph","Garry","Geoffrey","Jonathon","Felipe","Bennie","Gerardo","Ed","Dominic","Robin","Loren","Delbert","Colin","Guillermo","Earnest","Lucas","Benny","Noel","Spencer","Rodolfo","Myron","Edmund","Garrett","Salvatore","Cedric","Lowell","Gregg","Sherman","Wilson","Devin","Sylvester","Kim","Roosevelt","Israel","Jermaine","Forrest","Wilbert","Leland","Simon","Guadalupe","Clark","Irving","Carroll","Bryant","Owen","Rufus","Woodrow","Sammy","Kristopher","Mack","Levi","Marcos","Gustavo","Jake","Lionel","Marty","Taylor","Ellis","Dallas","Gilberto","Clint","Nicolas","Laurence","Ismael","Orville","Drew","Jody","Ervin","Dewey","Al","Wilfred","Josh","Hugo","Ignacio","Caleb","Tomas","Sheldon","Erick","Frankie","Stewart","Doyle","Darrel","Rogelio","Terence","Santiago","Alonzo","Elias","Bert","Elbert","Ramiro","Conrad","Pat","Noah","Grady","Phil","Cornelius","Lamar","Rolando","Clay","Percy","Dexter","Bradford","Merle","Darin","Amos","Terrell","Moses","Irvin","Saul","Roman","Darnell","Randal","Tommie","Timmy","Darrin","Winston","Brendan","Toby","Van","Abel","Dominick","Boyd","Courtney","Jan","Emilio","Elijah","Cary","Domingo","Santos","Aubrey","Emmett","Marlon","Emanuel","Jerald","Edmond"]},Is=Pl;var ga=["Abbott","Abernathy","Abshire","Adams","Altenwerth","Anderson","Ankunding","Armstrong","Auer","Aufderhar","Bahringer","Bailey","Balistreri","Barrows","Bartell","Bartoletti","Barton","Bashirian","Batz","Bauch","Baumbach","Bayer","Beahan","Beatty","Bechtelar","Becker","Bednar","Beer","Beier","Berge","Bergnaum","Bergstrom","Bernhard","Bernier","Bins","Blanda","Blick","Block","Bode","Boehm","Bogan","Bogisich","Borer","Bosco","Botsford","Boyer","Boyle","Bradtke","Brakus","Braun","Breitenberg","Brekke","Brown","Bruen","Buckridge","Carroll","Carter","Cartwright","Casper","Cassin","Champlin","Christiansen","Cole","Collier","Collins","Conn","Connelly","Conroy","Considine","Corkery","Cormier","Corwin","Cremin","Crist","Crona","Cronin","Crooks","Cruickshank","Cummerata","Cummings","Dach","D'Amore","Daniel","Dare","Daugherty","Davis","Deckow","Denesik","Dibbert","Dickens","Dicki","Dickinson","Dietrich","Donnelly","Dooley","Douglas","Doyle","DuBuque","Durgan","Ebert","Effertz","Emard","Emmerich","Erdman","Ernser","Fadel","Fahey","Farrell","Fay","Feeney","Feest","Feil","Ferry","Fisher","Flatley","Frami","Franecki","Friesen","Fritsch","Funk","Gaylord","Gerhold","Gerlach","Gibson","Gislason","Gleason","Gleichner","Glover","Goldner","Goodwin","Gorczany","Gottlieb","Goyette","Grady","Graham","Grant","Green","Greenfelder","Greenholt","Grimes","Gulgowski","Gusikowski","Gutkowski","Gutmann","Haag","Hackett","Hagenes","Hahn","Haley","Halvorson","Hamill","Hammes","Hand","Hane","Hansen","Harber","Harris","Hartmann","Harvey","Hauck","Hayes","Heaney","Heathcote","Hegmann","Heidenreich","Heller","Herman","Hermann","Hermiston","Herzog","Hessel","Hettinger","Hickle","Hilll","Hills","Hilpert","Hintz","Hirthe","Hodkiewicz","Hoeger","Homenick","Hoppe","Howe","Howell","Hudson","Huel","Huels","Hyatt","Jacobi","Jacobs","Jacobson","Jakubowski","Jaskolski","Jast","Jenkins","Jerde","Johns","Johnson","Johnston","Jones","Kassulke","Kautzer","Keebler","Keeling","Kemmer","Kerluke","Kertzmann","Kessler","Kiehn","Kihn","Kilback","King","Kirlin","Klein","Kling","Klocko","Koch","Koelpin","Koepp","Kohler","Konopelski","Koss","Kovacek","Kozey","Krajcik","Kreiger","Kris","Kshlerin","Kub","Kuhic","Kuhlman","Kuhn","Kulas","Kunde","Kunze","Kuphal","Kutch","Kuvalis","Labadie","Lakin","Lang","Langosh","Langworth","Larkin","Larson","Leannon","Lebsack","Ledner","Leffler","Legros","Lehner","Lemke","Lesch","Leuschke","Lind","Lindgren","Littel","Little","Lockman","Lowe","Lubowitz","Lueilwitz","Luettgen","Lynch","Macejkovic","MacGyver","Maggio","Mann","Mante","Marks","Marquardt","Marvin","Mayer","Mayert","McClure","McCullough","McDermott","McGlynn","McKenzie","McLaughlin","Medhurst","Mertz","Metz","Miller","Mills","Mitchell","Moen","Mohr","Monahan","Moore","Morar","Morissette","Mosciski","Mraz","Mueller","Muller","Murazik","Murphy","Murray","Nader","Nicolas","Nienow","Nikolaus","Nitzsche","Nolan","Oberbrunner","O'Connell","O'Conner","O'Hara","O'Keefe","O'Kon","Okuneva","Olson","Ondricka","O'Reilly","Orn","Ortiz","Osinski","Pacocha","Padberg","Pagac","Parisian","Parker","Paucek","Pfannerstill","Pfeffer","Pollich","Pouros","Powlowski","Predovic","Price","Prohaska","Prosacco","Purdy","Quigley","Quitzon","Rath","Ratke","Rau","Raynor","Reichel","Reichert","Reilly","Reinger","Rempel","Renner","Reynolds","Rice","Rippin","Ritchie","Robel","Roberts","Rodriguez","Rogahn","Rohan","Rolfson","Romaguera","Roob","Rosenbaum","Rowe","Ruecker","Runolfsdottir","Runolfsson","Runte","Russel","Rutherford","Ryan","Sanford","Satterfield","Sauer","Sawayn","Schaden","Schaefer","Schamberger","Schiller","Schimmel","Schinner","Schmeler","Schmidt","Schmitt","Schneider","Schoen","Schowalter","Schroeder","Schulist","Schultz","Schumm","Schuppe","Schuster","Senger","Shanahan","Shields","Simonis","Sipes","Skiles","Smith","Smitham","Spencer","Spinka","Sporer","Stamm","Stanton","Stark","Stehr","Steuber","Stiedemann","Stokes","Stoltenberg","Stracke","Streich","Stroman","Strosin","Swaniawski","Swift","Terry","Thiel","Thompson","Tillman","Torp","Torphy","Towne","Toy","Trantow","Tremblay","Treutel","Tromp","Turcotte","Turner","Ullrich","Upton","Vandervort","Veum","Volkman","Von","VonRueden","Waelchi","Walker","Walsh","Walter","Ward","Waters","Watsica","Weber","Wehner","Weimann","Weissnat","Welch","West","White","Wiegand","Wilderman","Wilkinson","Will","Williamson","Willms","Windler","Wintheiser","Wisoky","Wisozk","Witting","Wiza","Wolf","Wolff","Wuckert","Wunsch","Wyman","Yost","Yundt","Zboncak","Zemlak","Ziemann","Zieme","Zulauf"],Dl={general:ga,female:ga,male:ga},$s=Dl;var Ul={binary:["Female","Male"],pool:["Asexual","Female to male trans man","Female to male transgender man","Female to male transsexual man","F2M","Gender neutral","Hermaphrodite","Intersex man","Intersex person","Intersex woman","Male to female trans woman","Male to female transgender woman","Male to female transsexual woman","Man","M2F","Polygender","T* man","T* woman","Two* person","Two-spirit person","Woman","Agender","Androgyne","Androgynes","Androgynous","Bigender","Cis","Cis Female","Cis Male","Cis Man","Cis Woman","Cisgender","Cisgender Female","Cisgender Male","Cisgender Man","Cisgender Woman","Female to Male","FTM","Gender Fluid","Gender Nonconforming","Gender Questioning","Gender Variant","Genderqueer","Intersex","Male to Female","MTF","Neither","Neutrois","Non-binary","Other","Pangender","Trans","Trans Female","Trans Male","Trans Man","Trans Person","Trans*Female","Trans*Male","Trans*Man","Trans*Person","Trans*Woman","Transexual","Transexual Female","Transexual Male","Transexual Man","Transexual Person","Transexual Woman","Transgender Female","Transgender Person","Transmasculine","Two-spirit"]},Ts=Ul;var Ll={descriptor:["Lead","Senior","Direct","Corporate","Dynamic","Future","Product","National","Regional","District","Central","Global","Customer","Investor","Dynamic","International","Legacy","Forward","Internal","Human","Chief","Principal"],level:["Solutions","Program","Brand","Security","Research","Marketing","Directives","Implementation","Integration","Functionality","Response","Paradigm","Tactics","Identity","Markets","Group","Division","Applications","Optimization","Operations","Infrastructure","Intranet","Communications","Web","Branding","Quality","Assurance","Mobility","Accounts","Data","Creative","Configuration","Accountability","Interactions","Factors","Usability","Metrics"],job:["Supervisor","Associate","Executive","Liaison","Officer","Manager","Engineer","Specialist","Director","Coordinator","Administrator","Architect","Analyst","Designer","Planner","Orchestrator","Technician","Developer","Producer","Consultant","Assistant","Facilitator","Agent","Representative","Strategist"]},Cs=Ll;var ya=["Jr.","Sr.","I","II","III","IV","V","MD","DDS","PhD","DVM"],Ml={gender:Ts,firstName:Is,lastName:$s,title:Cs,suffix:{general:ya,female:ya,male:ya},prefix:{general:["Mr.","Mrs.","Ms.","Miss","Dr."],female:["Mrs.","Ms.","Miss"],male:["Mr.","Dr."]},templates:["#{prefix} #{first_name} #{last_name}","#{first_name} #{last_name} #{suffix}","#{first_name} #{last_name}","#{first_name} #{last_name}","#{male_first_name} #{last_name}","#{female_first_name} #{last_name}"]},Os=Ml;var Rs=["abandoned","able","absolute","adorable","adventurous","academic","acceptable","acclaimed","accomplished","accurate","aching","acidic","acrobatic","active","actual","adept","admirable","admired","adolescent","adorable","adored","advanced","afraid","affectionate","aged","aggravating","aggressive","agile","agitated","agonizing","agreeable","ajar","alarmed","alarming","alert","alienated","alive","all","altruistic","amazing","ambitious","ample","amused","amusing","anchored","ancient","angelic","angry","anguished","animated","annual","another","antique","anxious","any","apprehensive","appropriate","apt","arctic","arid","aromatic","artistic","ashamed","assured","astonishing","athletic","attached","attentive","attractive","austere","authentic","authorized","automatic","avaricious","average","aware","awesome","awful","awkward","babyish","bad","back","baggy","bare","barren","basic","beautiful","belated","beloved","beneficial","better","best","bewitched","big","big-hearted","biodegradable","bite-sized","bitter","black","black-and-white","bland","blank","blaring","bleak","blind","blissful","blond","blue","blushing","bogus","boiling","bold","bony","boring","bossy","both","bouncy","bountiful","bowed","brave","breakable","brief","bright","brilliant","brisk","broken","bronze","brown","bruised","bubbly","bulky","bumpy","buoyant","burdensome","burly","bustling","busy","buttery","buzzing","calculating","calm","candid","canine","capital","carefree","careful","careless","caring","cautious","cavernous","celebrated","charming","cheap","cheerful","cheery","chief","chilly","chubby","circular","classic","clean","clear","clear-cut","clever","close","closed","cloudy","clueless","clumsy","cluttered","coarse","cold","colorful","colorless","colossal","comfortable","common","compassionate","competent","complete","complex","complicated","composed","concerned","concrete","confused","conscious","considerate","constant","content","conventional","cooked","cool","cooperative","coordinated","corny","corrupt","costly","courageous","courteous","crafty","crazy","creamy","creative","creepy","criminal","crisp","critical","crooked","crowded","cruel","crushing","cuddly","cultivated","cultured","cumbersome","curly","curvy","cute","cylindrical","damaged","damp","dangerous","dapper","daring","darling","dark","dazzling","dead","deadly","deafening","dear","dearest","decent","decimal","decisive","deep","defenseless","defensive","defiant","deficient","definite","definitive","delayed","delectable","delicious","delightful","delirious","demanding","dense","dental","dependable","dependent","descriptive","deserted","detailed","determined","devoted","different","difficult","digital","diligent","dim","dimpled","dimwitted","direct","disastrous","discrete","disfigured","disgusting","disloyal","dismal","distant","downright","dreary","dirty","disguised","dishonest","dismal","distant","distinct","distorted","dizzy","dopey","doting","double","downright","drab","drafty","dramatic","dreary","droopy","dry","dual","dull","dutiful","each","eager","earnest","early","easy","easy-going","ecstatic","edible","educated","elaborate","elastic","elated","elderly","electric","elegant","elementary","elliptical","embarrassed","embellished","eminent","emotional","empty","enchanted","enchanting","energetic","enlightened","enormous","enraged","entire","envious","equal","equatorial","essential","esteemed","ethical","euphoric","even","evergreen","everlasting","every","evil","exalted","excellent","exemplary","exhausted","excitable","excited","exciting","exotic","expensive","experienced","expert","extraneous","extroverted","extra-large","extra-small","fabulous","failing","faint","fair","faithful","fake","false","familiar","famous","fancy","fantastic","far","faraway","far-flung","far-off","fast","fat","fatal","fatherly","favorable","favorite","fearful","fearless","feisty","feline","female","feminine","few","fickle","filthy","fine","finished","firm","first","firsthand","fitting","fixed","flaky","flamboyant","flashy","flat","flawed","flawless","flickering","flimsy","flippant","flowery","fluffy","fluid","flustered","focused","fond","foolhardy","foolish","forceful","forked","formal","forsaken","forthright","fortunate","fragrant","frail","frank","frayed","free","french","fresh","frequent","friendly","frightened","frightening","frigid","frilly","frizzy","frivolous","front","frosty","frozen","frugal","fruitful","full","fumbling","functional","funny","fussy","fuzzy","gargantuan","gaseous","general","generous","gentle","genuine","giant","giddy","gigantic","gifted","giving","glamorous","glaring","glass","gleaming","gleeful","glistening","glittering","gloomy","glorious","glossy","glum","golden","good","good-natured","gorgeous","graceful","gracious","grand","grandiose","granular","grateful","grave","gray","great","greedy","green","gregarious","grim","grimy","gripping","grizzled","gross","grotesque","grouchy","grounded","growing","growling","grown","grubby","gruesome","grumpy","guilty","gullible","gummy","hairy","half","handmade","handsome","handy","happy","happy-go-lucky","hard","hard-to-find","harmful","harmless","harmonious","harsh","hasty","hateful","haunting","healthy","heartfelt","hearty","heavenly","heavy","hefty","helpful","helpless","hidden","hideous","high","high-level","hilarious","hoarse","hollow","homely","honest","honorable","honored","hopeful","horrible","hospitable","hot","huge","humble","humiliating","humming","humongous","hungry","hurtful","husky","icky","icy","ideal","idealistic","identical","idle","idiotic","idolized","ignorant","ill","illegal","ill-fated","ill-informed","illiterate","illustrious","imaginary","imaginative","immaculate","immaterial","immediate","immense","impassioned","impeccable","impartial","imperfect","imperturbable","impish","impolite","important","impossible","impractical","impressionable","impressive","improbable","impure","inborn","incomparable","incompatible","incomplete","inconsequential","incredible","indelible","inexperienced","indolent","infamous","infantile","infatuated","inferior","infinite","informal","innocent","insecure","insidious","insignificant","insistent","instructive","insubstantial","intelligent","intent","intentional","interesting","internal","international","intrepid","ironclad","irresponsible","irritating","itchy","jaded","jagged","jam-packed","jaunty","jealous","jittery","joint","jolly","jovial","joyful","joyous","jubilant","judicious","juicy","jumbo","junior","jumpy","juvenile","kaleidoscopic","keen","key","kind","kindhearted","kindly","klutzy","knobby","knotty","knowledgeable","knowing","known","kooky","kosher","lame","lanky","large","last","lasting","late","lavish","lawful","lazy","leading","lean","leafy","left","legal","legitimate","light","lighthearted","likable","likely","limited","limp","limping","linear","lined","liquid","little","live","lively","livid","loathsome","lone","lonely","long","long-term","loose","lopsided","lost","loud","lovable","lovely","loving","low","loyal","lucky","lumbering","luminous","lumpy","lustrous","luxurious","mad","made-up","magnificent","majestic","major","male","mammoth","married","marvelous","masculine","massive","mature","meager","mealy","mean","measly","meaty","medical","mediocre","medium","meek","mellow","melodic","memorable","menacing","merry","messy","metallic","mild","milky","mindless","miniature","minor","minty","miserable","miserly","misguided","misty","mixed","modern","modest","moist","monstrous","monthly","monumental","moral","mortified","motherly","motionless","mountainous","muddy","muffled","multicolored","mundane","murky","mushy","musty","muted","mysterious","naive","narrow","nasty","natural","naughty","nautical","near","neat","necessary","needy","negative","neglected","negligible","neighboring","nervous","new","next","nice","nifty","nimble","nippy","nocturnal","noisy","nonstop","normal","notable","noted","noteworthy","novel","noxious","numb","nutritious","nutty","obedient","obese","oblong","oily","oblong","obvious","occasional","odd","oddball","offbeat","offensive","official","old","old-fashioned","only","open","optimal","optimistic","opulent","orange","orderly","organic","ornate","ornery","ordinary","original","other","our","outlying","outgoing","outlandish","outrageous","outstanding","oval","overcooked","overdue","overjoyed","overlooked","palatable","pale","paltry","parallel","parched","partial","passionate","past","pastel","peaceful","peppery","perfect","perfumed","periodic","perky","personal","pertinent","pesky","pessimistic","petty","phony","physical","piercing","pink","pitiful","plain","plaintive","plastic","playful","pleasant","pleased","pleasing","plump","plush","polished","polite","political","pointed","pointless","poised","poor","popular","portly","posh","positive","possible","potable","powerful","powerless","practical","precious","present","prestigious","pretty","precious","previous","pricey","prickly","primary","prime","pristine","private","prize","probable","productive","profitable","profuse","proper","proud","prudent","punctual","pungent","puny","pure","purple","pushy","putrid","puzzled","puzzling","quaint","qualified","quarrelsome","quarterly","queasy","querulous","questionable","quick","quick-witted","quiet","quintessential","quirky","quixotic","quizzical","radiant","ragged","rapid","rare","rash","raw","recent","reckless","rectangular","ready","real","realistic","reasonable","red","reflecting","regal","regular","reliable","relieved","remarkable","remorseful","remote","repentant","required","respectful","responsible","repulsive","revolving","rewarding","rich","rigid","right","ringed","ripe","roasted","robust","rosy","rotating","rotten","rough","round","rowdy","royal","rubbery","rundown","ruddy","rude","runny","rural","rusty","sad","safe","salty","same","sandy","sane","sarcastic","sardonic","satisfied","scaly","scarce","scared","scary","scented","scholarly","scientific","scornful","scratchy","scrawny","second","secondary","second-hand","secret","self-assured","self-reliant","selfish","sentimental","separate","serene","serious","serpentine","several","severe","shabby","shadowy","shady","shallow","shameful","shameless","sharp","shimmering","shiny","shocked","shocking","shoddy","short","short-term","showy","shrill","shy","sick","silent","silky","silly","silver","similar","simple","simplistic","sinful","single","sizzling","skeletal","skinny","sleepy","slight","slim","slimy","slippery","slow","slushy","small","smart","smoggy","smooth","smug","snappy","snarling","sneaky","sniveling","snoopy","sociable","soft","soggy","solid","somber","some","spherical","sophisticated","sore","sorrowful","soulful","soupy","sour","spanish","sparkling","sparse","specific","spectacular","speedy","spicy","spiffy","spirited","spiteful","splendid","spotless","spotted","spry","square","squeaky","squiggly","stable","staid","stained","stale","standard","starchy","stark","starry","steep","sticky","stiff","stimulating","stingy","stormy","straight","strange","steel","strict","strident","striking","striped","strong","studious","stunning","stupendous","stupid","sturdy","stylish","subdued","submissive","substantial","subtle","suburban","sudden","sugary","sunny","super","superb","superficial","superior","supportive","sure-footed","surprised","suspicious","svelte","sweaty","sweet","sweltering","swift","sympathetic","tall","talkative","tame","tan","tangible","tart","tasty","tattered","taut","tedious","teeming","tempting","tender","tense","tepid","terrible","terrific","testy","thankful","that","these","thick","thin","third","thirsty","this","thorough","thorny","those","thoughtful","threadbare","thrifty","thunderous","tidy","tight","timely","tinted","tiny","tired","torn","total","tough","traumatic","treasured","tremendous","tragic","trained","tremendous","triangular","tricky","trifling","trim","trivial","troubled","true","trusting","trustworthy","trusty","truthful","tubby","turbulent","twin","ugly","ultimate","unacceptable","unaware","uncomfortable","uncommon","unconscious","understated","unequaled","uneven","unfinished","unfit","unfolded","unfortunate","unhappy","unhealthy","uniform","unimportant","unique","united","unkempt","unknown","unlawful","unlined","unlucky","unnatural","unpleasant","unrealistic","unripe","unruly","unselfish","unsightly","unsteady","unsung","untidy","untimely","untried","untrue","unused","unusual","unwelcome","unwieldy","unwilling","unwitting","unwritten","upbeat","upright","upset","urban","usable","used","useful","useless","utilized","utter","vacant","vague","vain","valid","valuable","vapid","variable","vast","velvety","venerated","vengeful","verifiable","vibrant","vicious","victorious","vigilant","vigorous","villainous","violet","violent","virtual","virtuous","visible","vital","vivacious","vivid","voluminous","wan","warlike","warm","warmhearted","warped","wary","wasteful","watchful","waterlogged","watery","wavy","wealthy","weak","weary","webbed","wee","weekly","weepy","weighty","weird","welcome","well-documented","well-groomed","well-informed","well-lit","well-made","well-off","well-to-do","well-worn","wet","which","whimsical","whirlwind","whispered","white","whole","whopping","wicked","wide","wide-eyed","wiggly","wild","willing","wilted","winding","windy","winged","wiry","wise","witty","wobbly","woeful","wonderful","wooden","woozy","wordy","worldly","worn","worried","worrisome","worse","worst","worthless","worthwhile","worthy","wrathful","wretched","writhing","wrong","wry","yawning","yearly","yellow","yellowish","young","youthful","yummy","zany","zealous","zesty","zigzag"];var Ps=["abnormally","absentmindedly","accidentally","acidly","actually","adventurously","afterwards","almost","always","angrily","annually","anxiously","arrogantly","awkwardly","badly","bashfully","beautifully","bitterly","bleakly","blindly","blissfully","boastfully","boldly","bravely","briefly","brightly","briskly","broadly","busily","calmly","carefully","carelessly","cautiously","certainly","cheerfully","clearly","cleverly","closely","coaxingly","colorfully","commonly","continually","coolly","correctly","courageously","crossly","cruelly","curiously","daily","daintily","dearly","deceivingly","deeply","defiantly","deliberately","delightfully","diligently","dimly","doubtfully","dreamily","easily","elegantly","energetically","enormously","enthusiastically","equally","especially","even","evenly","eventually","exactly","excitedly","extremely","fairly","faithfully","famously","far","fast","fatally","ferociously","fervently","fiercely","fondly","foolishly","fortunately","frankly","frantically","freely","frenetically","frightfully","fully","furiously","generally","generously","gently","gladly","gleefully","gracefully","gratefully","greatly","greedily","happily","hastily","healthily","heavily","helpfully","helplessly","highly","honestly","hopelessly","hourly","hungrily","immediately","innocently","inquisitively","instantly","intensely","intently","interestingly","inwardly","irritably","jaggedly","jealously","joshingly","jovially","joyfully","joyously","jubilantly","judgementally","justly","keenly","kiddingly","kindheartedly","kindly","kissingly","knavishly","knottily","knowingly","knowledgeably","kookily","lazily","less","lightly","likely","limply","lively","loftily","longingly","loosely","loudly","lovingly","loyally","madly","majestically","meaningfully","mechanically","merrily","miserably","mockingly","monthly","more","mortally","mostly","mysteriously","naturally","nearly","neatly","needily","nervously","never","nicely","noisily","not","obediently","obnoxiously","oddly","offensively","officially","often","only","openly","optimistically","overconfidently","owlishly","painfully","partially","patiently","perfectly","physically","playfully","politely","poorly","positively","potentially","powerfully","promptly","properly","punctually","quaintly","quarrelsomely","queasily","queerly","questionably","questioningly","quicker","quickly","quietly","quirkily","quizzically","rapidly","rarely","readily","really","reassuringly","recklessly","regularly","reluctantly","repeatedly","reproachfully","restfully","righteously","rightfully","rigidly","roughly","rudely","sadly","safely","scarcely","scarily","searchingly","sedately","seemingly","seldom","selfishly","separately","seriously","shakily","sharply","sheepishly","shrilly","shyly","silently","sleepily","slowly","smoothly","softly","solemnly","solidly","sometimes","soon","speedily","stealthily","sternly","strictly","successfully","suddenly","surprisingly","suspiciously","sweetly","swiftly","sympathetically","tenderly","tensely","terribly","thankfully","thoroughly","thoughtfully","tightly","tomorrow","too","tremendously","triumphantly","truly","truthfully","ultimately","unabashedly","unaccountably","unbearably","unethically","unexpectedly","unfortunately","unimpressively","unnaturally","unnecessarily","upbeat","upliftingly","upright","upside-down","upward","upwardly","urgently","usefully","uselessly","usually","utterly","vacantly","vaguely","vainly","valiantly","vastly","verbally","very","viciously","victoriously","violently","vivaciously","voluntarily","warmly","weakly","wearily","well","wetly","wholly","wildly","willfully","wisely","woefully","wonderfully","worriedly","wrongly","yawningly","yearly","yearningly","yesterday","yieldingly","youthfully"];var Ds=["after","after all","although","and","as","as a result","as if","as long as","as much as","as soon as","as though","because","before","but","consequently","even","even if","even though","finally","for","for example","furthermore","hence","however","if","if only","if then","if when","in addition","in fact","in order that","inasmuch","incidentally","indeed","instead","just as","lest","likewise","meanwhile","nor","now","now since","now that","now when","once","or","provided","provided that","rather than","since","so","so that","supposing","that","though","until","whenever","whereas","wherever","which","who","yet"];var Us=["yuck","oh","phooey","blah","boo","whoa","yowza","huzzah","boo hoo","fooey","geez","pfft","ew","ah","yum","brr","hm","yahoo","aha","woot","drat","gah","meh","psst","aw","ugh","yippee","eek","gee","bah","gadzooks","duh","ha","mmm","tsk tsk","ouch","phew","ack","uh-huh","gosh","hmph","pish","zowie","er","ick","oof","um"];var Ls=["ATM","CD","SUV","TV","aardvark","abacus","abbey","abbreviation","abdomen","ability","abnormality","abolishment","abortion","abrogation","absence","abundance","abuse","academics","academy","accelerant","accelerator","accent","acceptance","access","accessory","accident","accommodation","accompanist","accomplishment","accord","accordance","accordion","account","accountability","accountant","accounting","accuracy","accusation","acetate","achievement","achiever","acid","acknowledgment","acorn","acoustics","acquaintance","acquisition","acre","acrylic","act","action","activation","activist","activity","actor","actress","acupuncture","ad","adaptation","adapter","addiction","addition","address","adjective","adjustment","admin","administration","administrator","admire","admission","adobe","adoption","adrenalin","adrenaline","adult","adulthood","advance","advancement","advantage","advent","adverb","advertisement","advertising","advice","adviser","advocacy","advocate","affair","affect","affidavit","affiliate","affinity","afoul","afterlife","aftermath","afternoon","aftershave","aftershock","afterthought","age","agency","agenda","agent","aggradation","aggression","aglet","agony","agreement","agriculture","aid","aide","aim","air","airbag","airbus","aircraft","airfare","airfield","airforce","airline","airmail","airman","airplane","airport","airship","airspace","alarm","alb","albatross","album","alcohol","alcove","alder","ale","alert","alfalfa","algebra","algorithm","alias","alibi","alien","allegation","allergist","alley","alliance","alligator","allocation","allowance","alloy","alluvium","almanac","almighty","almond","alpaca","alpenglow","alpenhorn","alpha","alphabet","altar","alteration","alternative","altitude","alto","aluminium","aluminum","amazement","amazon","ambassador","amber","ambience","ambiguity","ambition","ambulance","amendment","amenity","ammunition","amnesty","amount","amusement","anagram","analgesia","analog","analogue","analogy","analysis","analyst","analytics","anarchist","anarchy","anatomy","ancestor","anchovy","android","anesthesiologist","anesthesiology","angel","anger","angina","angiosperm","angle","angora","angstrom","anguish","animal","anime","anise","ankle","anklet","anniversary","announcement","annual","anorak","answer","ant","anteater","antecedent","antechamber","antelope","antennae","anterior","anthropology","antibody","anticipation","anticodon","antigen","antique","antiquity","antler","antling","anxiety","anybody","anyone","anything","anywhere","apartment","ape","aperitif","apology","app","apparatus","apparel","appeal","appearance","appellation","appendix","appetiser","appetite","appetizer","applause","apple","applewood","appliance","application","appointment","appreciation","apprehension","approach","appropriation","approval","apricot","apron","apse","aquarium","aquifer","arcade","arch","arch-rival","archaeologist","archaeology","archeology","archer","architect","architecture","archives","area","arena","argument","arithmetic","ark","arm","arm-rest","armadillo","armament","armchair","armoire","armor","armour","armpit","armrest","army","arrangement","array","arrest","arrival","arrogance","arrow","art","artery","arthur","artichoke","article","artifact","artificer","artist","ascend","ascent","ascot","ash","ashram","ashtray","aside","asparagus","aspect","asphalt","aspic","ass","assassination","assault","assembly","assertion","assessment","asset","assignment","assist","assistance","assistant","associate","association","assumption","assurance","asterisk","astrakhan","astrolabe","astrologer","astrology","astronomy","asymmetry","atelier","atheist","athlete","athletics","atmosphere","atom","atrium","attachment","attack","attacker","attainment","attempt","attendance","attendant","attention","attenuation","attic","attitude","attorney","attraction","attribute","auction","audience","audit","auditorium","aunt","authentication","authenticity","author","authorisation","authority","authorization","auto","autoimmunity","automation","automaton","autumn","availability","avalanche","avenue","average","avocado","award","awareness","awe","axis","azimuth","babe","baboon","babushka","baby","bachelor","back","back-up","backbone","backburn","backdrop","background","backpack","backup","backyard","bacon","bacterium","badge","badger","bafflement","bag","bagel","baggage","baggie","baggy","bagpipe","bail","bait","bake","baker","bakery","bakeware","balaclava","balalaika","balance","balcony","ball","ballet","balloon","balloonist","ballot","ballpark","bamboo","ban","banana","band","bandana","bandanna","bandolier","bandwidth","bangle","banjo","bank","bankbook","banker","banking","bankruptcy","banner","banquette","banyan","baobab","bar","barbecue","barbeque","barber","barbiturate","bargain","barge","baritone","barium","bark","barley","barn","barometer","barracks","barrage","barrel","barrier","barstool","bartender","base","baseball","baseboard","baseline","basement","basics","basil","basin","basis","basket","basketball","bass","bassinet","bassoon","bat","bath","bather","bathhouse","bathrobe","bathroom","bathtub","battalion","batter","battery","batting","battle","battleship","bay","bayou","beach","bead","beak","beam","bean","beancurd","beanie","beanstalk","bear","beard","beast","beastie","beat","beating","beauty","beaver","beck","bed","bedrock","bedroom","bee","beech","beef","beer","beet","beetle","beggar","beginner","beginning","begonia","behalf","behavior","behaviour","beheading","behest","behold","being","belfry","belief","believer","bell","belligerency","bellows","belly","belt","bench","bend","beneficiary","benefit","beret","berry","best-seller","bestseller","bet","beverage","beyond","bias","bibliography","bicycle","bid","bidder","bidding","bidet","bifocals","bijou","bike","bikini","bill","billboard","billing","billion","bin","binoculars","biology","biopsy","biosphere","biplane","birch","bird","bird-watcher","birdbath","birdcage","birdhouse","birth","birthday","biscuit","bit","bite","bitten","bitter","black","blackberry","blackbird","blackboard","blackfish","blackness","bladder","blade","blame","blank","blanket","blast","blazer","blend","blessing","blight","blind","blinker","blister","blizzard","block","blocker","blog","blogger","blood","bloodflow","bloom","bloomer","blossom","blouse","blow","blowgun","blowhole","blue","blueberry","blush","boar","board","boat","boatload","boatyard","bob","bobcat","body","bog","bolero","bolt","bomb","bomber","bombing","bond","bonding","bondsman","bone","bonfire","bongo","bonnet","bonsai","bonus","boogeyman","book","bookcase","bookend","booking","booklet","bookmark","boolean","boom","boon","boost","booster","boot","bootee","bootie","booty","border","bore","borrower","borrowing","bosom","boss","botany","bother","bottle","bottling","bottom","bottom-line","boudoir","bough","boulder","boulevard","boundary","bouquet","bourgeoisie","bout","boutique","bow","bower","bowl","bowler","bowling","bowtie","box","boxer","boxspring","boy","boycott","boyfriend","boyhood","boysenberry","bra","brace","bracelet","bracket","brain","brake","bran","branch","brand","brandy","brass","brassiere","bratwurst","bread","breadcrumb","breadfruit","break","breakdown","breakfast","breakpoint","breakthrough","breast","breastplate","breath","breeze","brewer","bribery","brick","bricklaying","bride","bridge","brief","briefing","briefly","briefs","brilliant","brink","brisket","broad","broadcast","broccoli","brochure","brocolli","broiler","broker","bronchitis","bronco","bronze","brooch","brood","brook","broom","brother","brother-in-law","brow","brown","brownie","browser","browsing","brunch","brush","brushfire","brushing","bubble","buck","bucket","buckle","buckwheat","bud","buddy","budget","buffalo","buffer","buffet","bug","buggy","bugle","builder","building","bulb","bulk","bull","bull-fighter","bulldozer","bullet","bump","bumper","bun","bunch","bungalow","bunghole","bunkhouse","burden","bureau","burglar","burial","burlesque","burn","burn-out","burning","burrito","burro","burrow","burst","bus","bush","business","businessman","bust","bustle","butane","butcher","butler","butter","butterfly","button","buy","buyer","buying","buzz","buzzard","c-clamp","cabana","cabbage","cabin","cabinet","cable","caboose","cacao","cactus","caddy","cadet","cafe","caffeine","caftan","cage","cake","calcification","calculation","calculator","calculus","calendar","calf","caliber","calibre","calico","call","calm","calorie","camel","cameo","camera","camp","campaign","campaigning","campanile","camper","campus","can","canal","cancer","candelabra","candidacy","candidate","candle","candy","cane","cannibal","cannon","canoe","canon","canopy","cantaloupe","canteen","canvas","cap","capability","capacity","cape","caper","capital","capitalism","capitulation","capon","cappelletti","cappuccino","captain","caption","captor","car","carabao","caramel","caravan","carbohydrate","carbon","carboxyl","card","cardboard","cardigan","care","career","cargo","caribou","carload","carnation","carnival","carol","carotene","carp","carpenter","carpet","carpeting","carport","carriage","carrier","carrot","carry","cart","cartel","carter","cartilage","cartload","cartoon","cartridge","carving","cascade","case","casement","cash","cashew","cashier","casino","casket","cassava","casserole","cassock","cast","castanet","castle","casualty","cat","catacomb","catalogue","catalysis","catalyst","catamaran","catastrophe","catch","catcher","category","caterpillar","cathedral","cation","catsup","cattle","cauliflower","causal","cause","causeway","caution","cave","caviar","cayenne","ceiling","celebration","celebrity","celeriac","celery","cell","cellar","cello","celsius","cement","cemetery","cenotaph","census","cent","center","centimeter","centre","centurion","century","cephalopod","ceramic","ceramics","cereal","ceremony","certainty","certificate","certification","cesspool","chafe","chain","chainstay","chair","chairlift","chairman","chairperson","chaise","chalet","chalice","chalk","challenge","chamber","champagne","champion","championship","chance","chandelier","change","channel","chaos","chap","chapel","chaplain","chapter","character","characteristic","characterization","chard","charge","charger","charity","charlatan","charm","charset","chart","charter","chasm","chassis","chastity","chasuble","chateau","chatter","chauffeur","chauvinist","check","checkbook","checking","checkout","checkroom","cheddar","cheek","cheer","cheese","cheesecake","cheetah","chef","chem","chemical","chemistry","chemotaxis","cheque","cherry","chess","chest","chestnut","chick","chicken","chicory","chief","chiffonier","child","childbirth","childhood","chili","chill","chime","chimpanzee","chin","chinchilla","chino","chip","chipmunk","chit-chat","chivalry","chive","chives","chocolate","choice","choir","choker","cholesterol","choosing","chop","chops","chopstick","chopsticks","chord","chorus","chow","chowder","chrome","chromolithograph","chronicle","chronograph","chronometer","chrysalis","chub","chuck","chug","church","churn","chutney","cicada","cigarette","cilantro","cinder","cinema","cinnamon","circadian","circle","circuit","circulation","circumference","circumstance","cirrhosis","cirrus","citizen","citizenship","citron","citrus","city","civilian","civilisation","civilization","claim","clam","clamp","clan","clank","clapboard","clarification","clarinet","clarity","clasp","class","classic","classification","classmate","classroom","clause","clave","clavicle","clavier","claw","clay","cleaner","clearance","clearing","cleat","cleavage","clef","cleft","clergyman","cleric","clerk","click","client","cliff","climate","climb","clinic","clip","clipboard","clipper","cloak","cloakroom","clock","clockwork","clogs","cloister","clone","close","closet","closing","closure","cloth","clothes","clothing","cloud","cloudburst","clove","clover","cloves","club","clue","cluster","clutch","co-producer","coach","coal","coalition","coast","coaster","coat","cob","cobbler","cobweb","cock","cockpit","cockroach","cocktail","cocoa","coconut","cod","code","codepage","codling","codon","codpiece","coevolution","cofactor","coffee","coffin","cohesion","cohort","coil","coin","coincidence","coinsurance","coke","cold","coleslaw","coliseum","collaboration","collagen","collapse","collar","collard","collateral","colleague","collection","collectivisation","collectivization","collector","college","collision","colloquy","colon","colonial","colonialism","colonisation","colonization","colony","color","colorlessness","colt","column","columnist","comb","combat","combination","combine","comeback","comedy","comestible","comfort","comfortable","comic","comics","comma","command","commander","commandment","comment","commerce","commercial","commission","commitment","committee","commodity","common","commonsense","commotion","communicant","communication","communion","communist","community","commuter","company","comparison","compass","compassion","compassionate","compensation","competence","competition","competitor","complaint","complement","completion","complex","complexity","compliance","complication","complicity","compliment","component","comportment","composer","composite","composition","compost","comprehension","compress","compromise","comptroller","compulsion","computer","comradeship","con","concentrate","concentration","concept","conception","concern","concert","conclusion","concrete","condition","conditioner","condominium","condor","conduct","conductor","cone","confectionery","conference","confidence","confidentiality","configuration","confirmation","conflict","conformation","confusion","conga","congo","congregation","congress","congressman","congressperson","conifer","connection","connotation","conscience","consciousness","consensus","consent","consequence","conservation","conservative","consideration","consignment","consist","consistency","console","consonant","conspiracy","conspirator","constant","constellation","constitution","constraint","construction","consul","consulate","consulting","consumer","consumption","contact","contact lens","contagion","container","content","contention","contest","context","continent","contingency","continuity","contour","contract","contractor","contrail","contrary","contrast","contribution","contributor","control","controller","controversy","convection","convenience","convention","conversation","conversion","convert","convertible","conviction","cook","cookbook","cookie","cooking","coonskin","cooperation","coordination","coordinator","cop","cop-out","cope","copper","copy","copying","copyright","copywriter","coral","cord","corduroy","core","cork","cormorant","corn","corner","cornerstone","cornet","cornflakes","cornmeal","corporal","corporation","corporatism","corps","corral","correspondence","correspondent","corridor","corruption","corsage","cosset","cost","costume","cot","cottage","cotton","couch","cougar","cough","council","councilman","councilor","councilperson","counsel","counseling","counselling","counsellor","counselor","count","counter","counter-force","counterpart","counterterrorism","countess","country","countryside","county","couple","coupon","courage","course","court","courthouse","courtroom","cousin","covariate","cover","coverage","coverall","cow","cowbell","cowboy","coyote","crab","crack","cracker","crackers","cradle","craft","craftsman","cranberry","crane","cranky","crap","crash","crate","cravat","craw","crawdad","crayfish","crayon","crazy","cream","creation","creationism","creationist","creative","creativity","creator","creature","creche","credential","credenza","credibility","credit","creditor","creek","creme brulee","crepe","crest","crew","crewman","crewmate","crewmember","crewmen","cria","crib","cribbage","cricket","cricketer","crime","criminal","crinoline","crisis","crisp","criteria","criterion","critic","criticism","crocodile","crocus","croissant","crook","crop","cross","cross-contamination","cross-stitch","crotch","croup","crow","crowd","crown","crucifixion","crude","cruelty","cruise","crumb","crunch","crusader","crush","crust","cry","crystal","crystallography","cub","cube","cuckoo","cucumber","cue","cuff-link","cuisine","cultivar","cultivator","culture","culvert","cummerbund","cup","cupboard","cupcake","cupola","curd","cure","curio","curiosity","curl","curler","currant","currency","current","curriculum","curry","curse","cursor","curtailment","curtain","curve","cushion","custard","custody","custom","customer","cut","cuticle","cutlet","cutover","cutting","cyclamen","cycle","cyclone","cyclooxygenase","cygnet","cylinder","cymbal","cynic","cyst","cytokine","cytoplasm","dad","daddy","daffodil","dagger","dahlia","daikon","daily","dairy","daisy","dam","damage","dame","damn","dance","dancer","dancing","dandelion","danger","dare","dark","darkness","darn","dart","dash","dashboard","data","database","date","daughter","dawn","day","daybed","daylight","dead","deadline","deal","dealer","dealing","dearest","death","deathwatch","debate","debris","debt","debtor","decade","decadence","decency","decimal","decision","decision-making","deck","declaration","declination","decline","decoder","decongestant","decoration","decrease","decryption","dedication","deduce","deduction","deed","deep","deer","default","defeat","defendant","defender","defense","deficit","definition","deformation","degradation","degree","delay","deliberation","delight","delivery","demand","democracy","democrat","demon","demur","den","denim","denominator","density","dentist","deodorant","department","departure","dependency","dependent","deployment","deposit","deposition","depot","depression","depressive","depth","deputy","derby","derivation","derivative","derrick","descendant","descent","description","desert","design","designation","designer","desire","desk","desktop","dessert","destination","destiny","destroyer","destruction","detail","detainee","detainment","detection","detective","detector","detention","determination","detour","devastation","developer","developing","development","developmental","deviance","deviation","device","devil","dew","dhow","diabetes","diadem","diagnosis","diagram","dial","dialect","dialogue","diam","diamond","diaper","diaphragm","diarist","diary","dibble","dick","dickey","dictaphone","dictator","diction","dictionary","die","diesel","diet","difference","differential","difficulty","diffuse","dig","digestion","digestive","digger","digging","digit","dignity","dilapidation","dill","dilution","dime","dimension","dimple","diner","dinghy","dining","dinner","dinosaur","dioxide","dip","diploma","diplomacy","dipstick","direction","directive","director","directory","dirndl","dirt","disability","disadvantage","disagreement","disappointment","disarmament","disaster","discharge","discipline","disclaimer","disclosure","disco","disconnection","discount","discourse","discovery","discrepancy","discretion","discrimination","discussion","disdain","disease","disembodiment","disengagement","disguise","disgust","dish","dishwasher","disk","disparity","dispatch","displacement","display","disposal","disposer","disposition","dispute","disregard","disruption","dissemination","dissonance","distance","distinction","distortion","distribution","distributor","district","divalent","divan","diver","diversity","divide","dividend","divider","divine","diving","division","divorce","doc","dock","doctor","doctorate","doctrine","document","documentary","documentation","doe","dog","doggie","dogsled","dogwood","doing","doll","dollar","dollop","dolman","dolor","dolphin","domain","dome","domination","donation","donkey","donor","donut","door","doorbell","doorknob","doorpost","doorway","dory","dose","dot","double","doubling","doubt","doubter","dough","doughnut","down","downfall","downforce","downgrade","download","downstairs","downtown","downturn","dozen","draft","drag","dragon","dragonfly","dragonfruit","dragster","drain","drainage","drake","drama","dramaturge","drapes","draw","drawbridge","drawer","drawing","dream","dreamer","dredger","dress","dresser","dressing","drill","drink","drinking","drive","driver","driveway","driving","drizzle","dromedary","drop","drudgery","drug","drum","drummer","drunk","dryer","duck","duckling","dud","dude","due","duel","dueling","duffel","dugout","dulcimer","dumbwaiter","dump","dump truck","dune","dune buggy","dungarees","dungeon","duplexer","duration","durian","dusk","dust","dust storm","duster","duty","dwarf","dwell","dwelling","dynamics","dynamite","dynamo","dynasty","dysfunction","e-book","e-mail","e-reader","eagle","eaglet","ear","eardrum","earmuffs","earnings","earplug","earring","earrings","earth","earthquake","earthworm","ease","easel","east","eating","eaves","eavesdropper","ecclesia","echidna","eclipse","ecliptic","ecology","economics","economy","ecosystem","ectoderm","ectodermal","ecumenist","eddy","edge","edger","edible","editing","edition","editor","editorial","education","eel","effacement","effect","effective","effectiveness","effector","efficacy","efficiency","effort","egg","egghead","eggnog","eggplant","ego","eicosanoid","ejector","elbow","elderberry","election","electricity","electrocardiogram","electronics","element","elephant","elevation","elevator","eleventh","elf","elicit","eligibility","elimination","elite","elixir","elk","ellipse","elm","elongation","elver","email","emanate","embarrassment","embassy","embellishment","embossing","embryo","emerald","emergence","emergency","emergent","emery","emission","emitter","emotion","emphasis","empire","employ","employee","employer","employment","empowerment","emu","enactment","encirclement","enclave","enclosure","encounter","encouragement","encyclopedia","end","endive","endoderm","endorsement","endothelium","endpoint","enemy","energy","enforcement","engagement","engine","engineer","engineering","enigma","enjoyment","enquiry","enrollment","enterprise","entertainment","enthusiasm","entirety","entity","entrance","entree","entrepreneur","entry","envelope","environment","envy","enzyme","epauliere","epee","ephemera","ephemeris","ephyra","epic","episode","epithelium","epoch","eponym","epoxy","equal","equality","equation","equinox","equipment","equity","equivalent","era","eraser","erection","erosion","error","escalator","escape","escort","espadrille","espalier","essay","essence","essential","establishment","estate","estimate","estrogen","estuary","eternity","ethernet","ethics","ethnicity","ethyl","euphonium","eurocentrism","evaluation","evaluator","evaporation","eve","evening","evening-wear","event","everybody","everyone","everything","eviction","evidence","evil","evocation","evolution","ex-husband","ex-wife","exaggeration","exam","examination","examiner","example","exasperation","excellence","exception","excerpt","excess","exchange","excitement","exclamation","excursion","excuse","execution","executive","executor","exercise","exhaust","exhaustion","exhibit","exhibition","exile","existence","exit","exocrine","expansion","expansionism","expectancy","expectation","expedition","expense","experience","experiment","experimentation","expert","expertise","explanation","exploration","explorer","explosion","export","expose","exposition","exposure","expression","extension","extent","exterior","external","extinction","extreme","extremist","eye","eyeball","eyebrow","eyebrows","eyeglasses","eyelash","eyelashes","eyelid","eyelids","eyeliner","eyestrain","eyrie","fabric","face","facelift","facet","facility","facsimile","fact","factor","factory","faculty","fahrenheit","fail","failure","fairness","fairy","faith","faithful","fall","fallacy","falling-out","fame","familiar","familiarity","family","fan","fang","fanlight","fanny","fanny-pack","fantasy","farm","farmer","farming","farmland","farrow","fascia","fashion","fat","fate","father","father-in-law","fatigue","fatigues","faucet","fault","fav","fava","favor","favorite","fawn","fax","fear","feast","feather","feature","fedelini","federation","fedora","fee","feed","feedback","feeding","feel","feeling","fellow","felony","female","fen","fence","fencing","fender","feng","fennel","ferret","ferry","ferryboat","fertilizer","festival","fetus","few","fiber","fiberglass","fibre","fibroblast","fibrosis","ficlet","fiction","fiddle","field","fiery","fiesta","fifth","fig","fight","fighter","figure","figurine","file","filing","fill","fillet","filly","film","filter","filth","final","finance","financing","finding","fine","finer","finger","fingerling","fingernail","finish","finisher","fir","fire","fireman","fireplace","firewall","firm","first","fish","fishbone","fisherman","fishery","fishing","fishmonger","fishnet","fisting","fit","fitness","fix","fixture","flag","flair","flame","flan","flanker","flare","flash","flat","flatboat","flavor","flax","fleck","fledgling","fleece","flesh","flexibility","flick","flicker","flight","flint","flintlock","flip-flops","flock","flood","floodplain","floor","floozie","flour","flow","flower","flu","flugelhorn","fluke","flume","flung","flute","fly","flytrap","foal","foam","fob","focus","fog","fold","folder","folk","folklore","follower","following","fondue","font","food","foodstuffs","fool","foot","footage","football","footnote","footprint","footrest","footstep","footstool","footwear","forage","forager","foray","force","ford","forearm","forebear","forecast","forehead","foreigner","forelimb","forest","forestry","forever","forgery","fork","form","formal","formamide","format","formation","former","formicarium","formula","fort","forte","fortnight","fortress","fortune","forum","foundation","founder","founding","fountain","fourths","fowl","fox","foxglove","fraction","fragrance","frame","framework","fratricide","fraud","fraudster","freak","freckle","freedom","freelance","freezer","freezing","freight","freighter","frenzy","freon","frequency","fresco","friction","fridge","friend","friendship","fries","frigate","fright","fringe","fritter","frock","frog","front","frontier","frost","frosting","frown","fruit","frustration","fry","fuck","fuel","fugato","fulfillment","full","fun","function","functionality","fund","funding","fundraising","funeral","fur","furnace","furniture","furry","fusarium","futon","future","gadget","gaffe","gaffer","gain","gaiters","gale","gall-bladder","gallery","galley","gallon","galoshes","gambling","game","gamebird","gaming","gamma-ray","gander","gang","gap","garage","garb","garbage","garden","garlic","garment","garter","gas","gasket","gasoline","gasp","gastronomy","gastropod","gate","gateway","gather","gathering","gator","gauge","gauntlet","gavel","gazebo","gazelle","gear","gearshift","geek","gel","gelatin","gelding","gem","gemsbok","gender","gene","general","generation","generator","generosity","genetics","genie","genius","genocide","genre","gentleman","geography","geology","geometry","geranium","gerbil","gesture","geyser","gherkin","ghost","giant","gift","gig","gigantism","giggle","ginger","gingerbread","ginseng","giraffe","girdle","girl","girlfriend","git","glacier","gladiolus","glance","gland","glass","glasses","glee","glen","glider","gliding","glimpse","globe","glockenspiel","gloom","glory","glove","glow","glucose","glue","glut","glutamate","gnat","gnu","go-kart","goal","goat","gobbler","god","goddess","godfather","godmother","godparent","goggles","going","gold","goldfish","golf","gondola","gong","good","good-bye","goodbye","goodie","goodness","goodnight","goodwill","goose","gopher","gorilla","gosling","gossip","governance","government","governor","gown","grab-bag","grace","grade","gradient","graduate","graduation","graffiti","graft","grain","gram","grammar","gran","grand","grandchild","granddaughter","grandfather","grandma","grandmom","grandmother","grandpa","grandparent","grandson","granny","granola","grant","grape","grapefruit","graph","graphic","grasp","grass","grasshopper","grassland","gratitude","gravel","gravitas","gravity","gravy","gray","grease","great-grandfather","great-grandmother","greatness","greed","green","greenhouse","greens","grenade","grey","grid","grief","grill","grin","grip","gripper","grit","grocery","ground","group","grouper","grouse","grove","growth","grub","guacamole","guarantee","guard","guava","guerrilla","guess","guest","guestbook","guidance","guide","guideline","guilder","guilt","guilty","guinea","guitar","guitarist","gum","gumshoe","gun","gunpowder","gutter","guy","gym","gymnast","gymnastics","gynaecology","gyro","habit","habitat","hacienda","hacksaw","hackwork","hail","hair","haircut","hake","half","half-brother","half-sister","halibut","hall","halloween","hallway","halt","ham","hamburger","hammer","hammock","hamster","hand","hand-holding","handball","handful","handgun","handicap","handle","handlebar","handmaiden","handover","handrail","handsaw","hanger","happening","happiness","harald","harbor","harbour","hard-hat","hardboard","hardcover","hardening","hardhat","hardship","hardware","hare","harm","harmonica","harmonise","harmonize","harmony","harp","harpooner","harpsichord","harvest","harvester","hash","hashtag","hassock","haste","hat","hatbox","hatchet","hatchling","hate","hatred","haunt","haven","haversack","havoc","hawk","hay","haze","hazel","hazelnut","head","headache","headlight","headline","headphones","headquarters","headrest","health","health-care","hearing","hearsay","heart","heart-throb","heartache","heartbeat","hearth","hearthside","heartwood","heat","heater","heating","heaven","heavy","hectare","hedge","hedgehog","heel","heifer","height","heir","heirloom","helicopter","helium","hell","hellcat","hello","helmet","helo","help","hemisphere","hemp","hen","hepatitis","herb","herbs","heritage","hermit","hero","heroine","heron","herring","hesitation","heterosexual","hexagon","heyday","hiccups","hide","hierarchy","high","high-rise","highland","highlight","highway","hike","hiking","hill","hint","hip","hippodrome","hippopotamus","hire","hiring","historian","history","hit","hive","hobbit","hobby","hockey","hoe","hog","hold","holder","hole","holiday","home","homeland","homeownership","hometown","homework","homicide","homogenate","homonym","homosexual","homosexuality","honesty","honey","honeybee","honeydew","honor","honoree","hood","hoof","hook","hop","hope","hops","horde","horizon","hormone","horn","hornet","horror","horse","horseradish","horst","hose","hosiery","hospice","hospital","hospitalisation","hospitality","hospitalization","host","hostel","hostess","hotdog","hotel","hound","hour","hourglass","house","houseboat","household","housewife","housework","housing","hovel","hovercraft","howard","howitzer","hub","hubcap","hubris","hug","hugger","hull","human","humanity","humidity","hummus","humor","humour","hunchback","hundred","hunger","hunt","hunter","hunting","hurdle","hurdler","hurricane","hurry","hurt","husband","hut","hutch","hyacinth","hybridisation","hybridization","hydrant","hydraulics","hydrocarb","hydrocarbon","hydrofoil","hydrogen","hydrolyse","hydrolysis","hydrolyze","hydroxyl","hyena","hygienic","hype","hyphenation","hypochondria","hypothermia","hypothesis","ice","ice-cream","iceberg","icebreaker","icecream","icicle","icing","icon","icy","id","idea","ideal","identification","identity","ideology","idiom","idiot","igloo","ignorance","ignorant","ikebana","illegal","illiteracy","illness","illusion","illustration","image","imagination","imbalance","imitation","immigrant","immigration","immortal","impact","impairment","impala","impediment","implement","implementation","implication","import","importance","impostor","impress","impression","imprisonment","impropriety","improvement","impudence","impulse","in-joke","in-laws","inability","inauguration","inbox","incandescence","incarnation","incense","incentive","inch","incidence","incident","incision","inclusion","income","incompetence","inconvenience","increase","incubation","independence","independent","index","indication","indicator","indigence","individual","industrialisation","industrialization","industry","inequality","inevitable","infancy","infant","infarction","infection","infiltration","infinite","infix","inflammation","inflation","influence","influx","info","information","infrastructure","infusion","inglenook","ingrate","ingredient","inhabitant","inheritance","inhibition","inhibitor","initial","initialise","initialize","initiative","injunction","injury","injustice","ink","inlay","inn","innervation","innocence","innocent","innovation","input","inquiry","inscription","insect","insectarium","insert","inside","insight","insolence","insomnia","inspection","inspector","inspiration","installation","instance","instant","instinct","institute","institution","instruction","instructor","instrument","instrumentalist","instrumentation","insulation","insurance","insurgence","insurrection","integer","integral","integration","integrity","intellect","intelligence","intensity","intent","intention","intentionality","interaction","interchange","interconnection","intercourse","interest","interface","interferometer","interior","interject","interloper","internet","interpretation","interpreter","interval","intervenor","intervention","interview","interviewer","intestine","introduction","intuition","invader","invasion","invention","inventor","inventory","inverse","inversion","investigation","investigator","investment","investor","invitation","invite","invoice","involvement","iridescence","iris","iron","ironclad","irony","irrigation","ischemia","island","isogloss","isolation","issue","item","itinerary","ivory","jack","jackal","jacket","jackfruit","jade","jaguar","jail","jailhouse","jalape\xC3\xB1o","jam","jar","jasmine","jaw","jazz","jealousy","jeans","jeep","jelly","jellybeans","jellyfish","jerk","jet","jewel","jeweller","jewellery","jewelry","jicama","jiffy","job","jockey","jodhpurs","joey","jogging","joint","joke","jot","journal","journalism","journalist","journey","joy","judge","judgment","judo","jug","juggernaut","juice","julienne","jumbo","jump","jumper","jumpsuit","jungle","junior","junk","junker","junket","jury","justice","justification","jute","kale","kamikaze","kangaroo","karate","kayak","kazoo","kebab","keep","keeper","kendo","kennel","ketch","ketchup","kettle","kettledrum","key","keyboard","keyboarding","keystone","kick","kick-off","kid","kidney","kielbasa","kill","killer","killing","kilogram","kilometer","kilt","kimono","kinase","kind","kindness","king","kingdom","kingfish","kiosk","kiss","kit","kitchen","kite","kitsch","kitten","kitty","kiwi","knee","kneejerk","knickers","knife","knife-edge","knight","knitting","knock","knot","know-how","knowledge","knuckle","koala","kohlrabi","kumquat","lab","label","labor","laboratory","laborer","labour","labourer","lace","lack","lacquerware","lad","ladder","ladle","lady","ladybug","lag","lake","lamb","lambkin","lament","lamp","lanai","land","landform","landing","landmine","landscape","lane","language","lantern","lap","laparoscope","lapdog","laptop","larch","lard","larder","lark","larva","laryngitis","lasagna","lashes","last","latency","latex","lathe","latitude","latte","latter","laugh","laughter","laundry","lava","law","lawmaker","lawn","lawsuit","lawyer","lay","layer","layout","lead","leader","leadership","leading","leaf","league","leaker","leap","learning","leash","leather","leave","leaver","lecture","leek","leeway","left","leg","legacy","legal","legend","legging","legislation","legislator","legislature","legitimacy","legume","leisure","lemon","lemonade","lemur","lender","lending","length","lens","lentil","leopard","leprosy","leptocephalus","lesbian","lesson","letter","lettuce","level","lever","leverage","leveret","liability","liar","liberty","libido","library","licence","license","licensing","licorice","lid","lie","lieu","lieutenant","life","lifestyle","lifetime","lift","ligand","light","lighting","lightning","lightscreen","ligula","likelihood","likeness","lilac","lily","limb","lime","limestone","limit","limitation","limo","line","linen","liner","linguist","linguistics","lining","link","linkage","linseed","lion","lip","lipid","lipoprotein","lipstick","liquid","liquidity","liquor","list","listening","listing","literate","literature","litigation","litmus","litter","littleneck","liver","livestock","living","lizard","llama","load","loading","loaf","loafer","loan","lobby","lobotomy","lobster","local","locality","location","lock","locker","locket","locomotive","locust","lode","loft","log","loggia","logic","login","logistics","logo","loincloth","lollipop","loneliness","longboat","longitude","look","lookout","loop","loophole","loquat","lord","loss","lot","lotion","lottery","lounge","louse","lout","love","lover","lox","loyalty","luck","luggage","lumber","lumberman","lunch","luncheonette","lunchmeat","lunchroom","lung","lunge","lust","lute","luxury","lychee","lycra","lye","lymphocyte","lynx","lyocell","lyre","lyrics","lysine","mRNA","macadamia","macaroni","macaroon","macaw","machine","machinery","macrame","macro","macrofauna","madam","maelstrom","maestro","magazine","maggot","magic","magnet","magnitude","maid","maiden","mail","mailbox","mailer","mailing","mailman","main","mainland","mainstream","maintainer","maintenance","maize","major","major-league","majority","makeover","maker","makeup","making","male","malice","mall","mallard","mallet","malnutrition","mama","mambo","mammoth","man","manacle","management","manager","manatee","mandarin","mandate","mandolin","mangle","mango","mangrove","manhunt","maniac","manicure","manifestation","manipulation","mankind","manner","manor","mansard","manservant","mansion","mantel","mantle","mantua","manufacturer","manufacturing","many","map","maple","mapping","maracas","marathon","marble","march","mare","margarine","margin","mariachi","marimba","marines","marionberry","mark","marker","market","marketer","marketing","marketplace","marksman","markup","marmalade","marriage","marsh","marshland","marshmallow","marten","marxism","mascara","mask","masonry","mass","massage","mast","master","masterpiece","mastication","mastoid","mat","match","matchmaker","mate","material","maternity","math","mathematics","matrix","matter","mattock","mattress","max","maximum","maybe","mayonnaise","mayor","meadow","meal","mean","meander","meaning","means","meantime","measles","measure","measurement","meat","meatball","meatloaf","mecca","mechanic","mechanism","med","medal","media","median","medication","medicine","medium","meet","meeting","melatonin","melody","melon","member","membership","membrane","meme","memo","memorial","memory","men","menopause","menorah","mention","mentor","menu","merchandise","merchant","mercury","meridian","meringue","merit","mesenchyme","mess","message","messenger","messy","metabolite","metal","metallurgist","metaphor","meteor","meteorology","meter","methane","method","methodology","metric","metro","metronome","mezzanine","microlending","micronutrient","microphone","microwave","mid-course","midden","middle","middleman","midline","midnight","midwife","might","migrant","migration","mile","mileage","milepost","milestone","military","milk","milkshake","mill","millennium","millet","millimeter","million","millisecond","millstone","mime","mimosa","min","mincemeat","mind","mine","mineral","mineshaft","mini","mini-skirt","minibus","minimalism","minimum","mining","minion","minister","mink","minnow","minor","minor-league","minority","mint","minute","miracle","mirror","miscarriage","miscommunication","misfit","misnomer","misogyny","misplacement","misreading","misrepresentation","miss","missile","mission","missionary","mist","mistake","mister","misunderstand","miter","mitten","mix","mixer","mixture","moai","moat","mob","mobile","mobility","mobster","moccasins","mocha","mochi","mode","model","modeling","modem","modernist","modernity","modification","molar","molasses","molding","mole","molecule","mom","moment","monastery","monasticism","money","monger","monitor","monitoring","monk","monkey","monocle","monopoly","monotheism","monsoon","monster","month","monument","mood","moody","moon","moonlight","moonscape","moonshine","moose","mop","morale","morbid","morbidity","morning","moron","morphology","morsel","mortal","mortality","mortgage","mortise","mosque","mosquito","most","motel","moth","mother","mother-in-law","motion","motivation","motive","motor","motorboat","motorcar","motorcycle","mound","mountain","mouse","mouser","mousse","moustache","mouth","mouton","movement","mover","movie","mower","mozzarella","mud","muffin","mug","mukluk","mule","multimedia","murder","muscat","muscatel","muscle","musculature","museum","mushroom","music","music-box","music-making","musician","muskrat","mussel","mustache","mustard","mutation","mutt","mutton","mycoplasma","mystery","myth","mythology","nail","name","naming","nanoparticle","napkin","narrative","nasal","nation","nationality","native","naturalisation","nature","navigation","necessity","neck","necklace","necktie","nectar","nectarine","need","needle","neglect","negligee","negotiation","neighbor","neighborhood","neighbour","neighbourhood","neologism","neon","neonate","nephew","nerve","nest","nestling","nestmate","net","netball","netbook","netsuke","network","networking","neurobiologist","neuron","neuropathologist","neuropsychiatry","news","newsletter","newspaper","newsprint","newsstand","nexus","nibble","nicety","niche","nick","nickel","nickname","niece","night","nightclub","nightgown","nightingale","nightlife","nightlight","nightmare","ninja","nit","nitrogen","nobody","nod","node","noir","noise","nonbeliever","nonconformist","nondisclosure","nonsense","noodle","noodles","noon","norm","normal","normalisation","normalization","north","nose","notation","note","notebook","notepad","nothing","notice","notion","notoriety","nougat","noun","nourishment","novel","nucleotidase","nucleotide","nudge","nuke","number","numeracy","numeric","numismatist","nun","nurse","nursery","nursing","nurture","nut","nutmeg","nutrient","nutrition","nylon","nymph","oak","oar","oasis","oat","oatmeal","oats","obedience","obesity","obi","object","objection","objective","obligation","oboe","observation","observatory","obsession","obsidian","obstacle","occasion","occupation","occurrence","ocean","ocelot","octagon","octave","octavo","octet","octopus","odometer","odyssey","oeuvre","off-ramp","offence","offense","offer","offering","office","officer","official","offset","oil","okra","oldie","oleo","olive","omega","omelet","omission","omnivore","oncology","onion","online","onset","opening","opera","operating","operation","operator","ophthalmologist","opinion","opium","opossum","opponent","opportunist","opportunity","opposite","opposition","optimal","optimisation","optimist","optimization","option","orange","orangutan","orator","orchard","orchestra","orchid","order","ordinary","ordination","ore","oregano","organ","organisation","organising","organization","organizing","orient","orientation","origin","original","originality","ornament","osmosis","osprey","ostrich","other","otter","ottoman","ounce","outback","outcome","outfielder","outfit","outhouse","outlaw","outlay","outlet","outline","outlook","output","outrage","outrigger","outrun","outset","outside","oval","ovary","oven","overcharge","overclocking","overcoat","overexertion","overflight","overhead","overheard","overload","overnighter","overshoot","oversight","overview","overweight","owl","owner","ownership","ox","oxford","oxygen","oyster","ozone","pace","pacemaker","pack","package","packaging","packet","pad","paddle","paddock","pagan","page","pagoda","pail","pain","paint","painter","painting","paintwork","pair","pajamas","palace","palate","palm","pamphlet","pan","pancake","pancreas","panda","panel","panic","pannier","panpipe","pansy","panther","panties","pantologist","pantology","pantry","pants","pantsuit","panty","pantyhose","papa","papaya","paper","paperback","paperwork","parable","parachute","parade","paradise","paragraph","parallelogram","paramecium","paramedic","parameter","paranoia","parcel","parchment","pard","pardon","parent","parenthesis","parenting","park","parka","parking","parliament","parole","parrot","parser","parsley","parsnip","part","participant","participation","particle","particular","partner","partnership","partridge","party","pass","passage","passbook","passenger","passing","passion","passive","passport","password","past","pasta","paste","pastor","pastoralist","pastry","pasture","pat","patch","pate","patent","patentee","path","pathogenesis","pathology","pathway","patience","patient","patina","patio","patriarch","patrimony","patriot","patrol","patroller","patrolling","patron","pattern","patty","pattypan","pause","pavement","pavilion","paw","pawnshop","pay","payee","payment","payoff","pea","peace","peach","peacoat","peacock","peak","peanut","pear","pearl","peasant","pecan","pecker","pedal","peek","peen","peer","peer-to-peer","pegboard","pelican","pelt","pen","penalty","pence","pencil","pendant","pendulum","penguin","penicillin","peninsula","penis","pennant","penny","pension","pentagon","peony","people","pepper","pepperoni","percent","percentage","perception","perch","perennial","perfection","performance","perfume","period","periodical","peripheral","permafrost","permission","permit","perp","perpendicular","persimmon","person","personal","personality","personnel","perspective","pest","pet","petal","petition","petitioner","petticoat","pew","pharmacist","pharmacopoeia","phase","pheasant","phenomenon","phenotype","pheromone","philanthropy","philosopher","philosophy","phone","phosphate","photo","photodiode","photograph","photographer","photography","photoreceptor","phrase","phrasing","physical","physics","physiology","pianist","piano","piccolo","pick","pickax","pickaxe","picket","pickle","pickup","picnic","picture","picturesque","pie","piece","pier","piety","pig","pigeon","piglet","pigpen","pigsty","pike","pilaf","pile","pilgrim","pilgrimage","pill","pillar","pillbox","pillow","pilot","pimp","pimple","pin","pinafore","pince-nez","pine","pineapple","pinecone","ping","pink","pinkie","pinot","pinstripe","pint","pinto","pinworm","pioneer","pipe","pipeline","piracy","pirate","piss","pistol","pit","pita","pitch","pitcher","pitching","pith","pizza","place","placebo","placement","placode","plagiarism","plain","plaintiff","plan","plane","planet","planning","plant","plantation","planter","planula","plaster","plasterboard","plastic","plate","platelet","platform","platinum","platter","platypus","play","player","playground","playroom","playwright","plea","pleasure","pleat","pledge","plenty","plier","pliers","plight","plot","plough","plover","plow","plowman","plug","plugin","plum","plumber","plume","plunger","plywood","pneumonia","pocket","pocket-watch","pocketbook","pod","podcast","poem","poet","poetry","poignance","point","poison","poisoning","poker","polarisation","polarization","pole","polenta","police","policeman","policy","polish","politician","politics","poll","polliwog","pollutant","pollution","polo","polyester","polyp","pomegranate","pomelo","pompom","poncho","pond","pony","pool","poor","pop","popcorn","poppy","popsicle","popularity","population","populist","porcelain","porch","porcupine","pork","porpoise","port","porter","portfolio","porthole","portion","portrait","position","possession","possibility","possible","post","postage","postbox","poster","posterior","postfix","pot","potato","potential","pottery","potty","pouch","poultry","pound","pounding","poverty","powder","power","practice","practitioner","prairie","praise","pray","prayer","precedence","precedent","precipitation","precision","predecessor","preface","preference","prefix","pregnancy","prejudice","prelude","premeditation","premier","premise","premium","preoccupation","preparation","prescription","presence","present","presentation","preservation","preserves","presidency","president","press","pressroom","pressure","pressurisation","pressurization","prestige","presume","pretzel","prevalence","prevention","prey","price","pricing","pride","priest","priesthood","primary","primate","prince","princess","principal","principle","print","printer","printing","prior","priority","prison","prisoner","privacy","private","privilege","prize","prizefight","probability","probation","probe","problem","procedure","proceedings","process","processing","processor","proctor","procurement","produce","producer","product","production","productivity","profession","professional","professor","profile","profit","progenitor","program","programme","programming","progress","progression","prohibition","project","proliferation","promenade","promise","promotion","prompt","pronoun","pronunciation","proof","proof-reader","propaganda","propane","property","prophet","proponent","proportion","proposal","proposition","proprietor","prose","prosecution","prosecutor","prospect","prosperity","prostacyclin","prostanoid","prostrate","protection","protein","protest","protocol","providence","provider","province","provision","prow","proximal","proximity","prune","pruner","pseudocode","pseudoscience","psychiatrist","psychoanalyst","psychologist","psychology","ptarmigan","pub","public","publication","publicity","publisher","publishing","pudding","puddle","puffin","pug","puggle","pulley","pulse","puma","pump","pumpernickel","pumpkin","pumpkinseed","pun","punch","punctuation","punishment","pup","pupa","pupil","puppet","puppy","purchase","puritan","purity","purple","purpose","purr","purse","pursuit","push","pusher","put","puzzle","pyramid","pyridine","quadrant","quail","qualification","quality","quantity","quart","quarter","quartet","quartz","queen","query","quest","question","questioner","questionnaire","quiche","quicksand","quiet","quill","quilt","quince","quinoa","quit","quiver","quota","quotation","quote","rabbi","rabbit","raccoon","race","racer","racing","racism","racist","rack","radar","radiator","radio","radiosonde","radish","raffle","raft","rag","rage","raid","rail","railing","railroad","railway","raiment","rain","rainbow","raincoat","rainmaker","rainstorm","rainy","raise","raisin","rake","rally","ram","rambler","ramen","ramie","ranch","rancher","randomisation","randomization","range","ranger","rank","rap","rape","raspberry","rat","rate","ratepayer","rating","ratio","rationale","rations","raven","ravioli","rawhide","ray","rayon","razor","reach","reactant","reaction","read","reader","readiness","reading","real","reality","realization","realm","reamer","rear","reason","reasoning","rebel","rebellion","reboot","recall","recapitulation","receipt","receiver","reception","receptor","recess","recession","recipe","recipient","reciprocity","reclamation","recliner","recognition","recollection","recommendation","reconsideration","record","recorder","recording","recovery","recreation","recruit","rectangle","red","redesign","redhead","redirect","rediscovery","reduction","reef","refectory","reference","referendum","reflection","reform","refreshments","refrigerator","refuge","refund","refusal","refuse","regard","regime","region","regionalism","register","registration","registry","regret","regulation","regulator","rehospitalisation","rehospitalization","reindeer","reinscription","reject","relation","relationship","relative","relaxation","relay","release","reliability","relief","religion","relish","reluctance","remains","remark","reminder","remnant","remote","removal","renaissance","rent","reorganisation","reorganization","repair","reparation","repayment","repeat","replacement","replica","replication","reply","report","reporter","reporting","repository","representation","representative","reprocessing","republic","republican","reputation","request","requirement","resale","rescue","research","researcher","resemblance","reservation","reserve","reservoir","reset","residence","resident","residue","resist","resistance","resolution","resolve","resort","resource","respect","respite","response","responsibility","rest","restaurant","restoration","restriction","restroom","restructuring","result","resume","retailer","retention","rethinking","retina","retirement","retouching","retreat","retrospect","retrospective","retrospectivity","return","reunion","revascularisation","revascularization","reveal","revelation","revenant","revenge","revenue","reversal","reverse","review","revitalisation","revitalization","revival","revolution","revolver","reward","rhetoric","rheumatism","rhinoceros","rhubarb","rhyme","rhythm","rib","ribbon","rice","riddle","ride","rider","ridge","riding","rifle","right","rim","ring","ringworm","riot","rip","ripple","rise","riser","risk","rite","ritual","river","riverbed","rivulet","road","roadway","roar","roast","robe","robin","robot","robotics","rock","rocker","rocket","rocket-ship","rod","role","roll","roller","romaine","romance","roof","room","roommate","rooster","root","rope","rose","rosemary","roster","rostrum","rotation","round","roundabout","route","router","routine","row","rowboat","rowing","rubber","rubbish","rubric","ruby","ruckus","rudiment","ruffle","rug","rugby","ruin","rule","ruler","ruling","rum","rumor","run","runaway","runner","running","runway","rush","rust","rutabaga","rye","sabre","sac","sack","saddle","sadness","safari","safe","safeguard","safety","saffron","sage","sail","sailboat","sailing","sailor","saint","sake","salad","salami","salary","sale","salesman","salmon","salon","saloon","salsa","salt","salute","samovar","sampan","sample","samurai","sanction","sanctity","sanctuary","sand","sandal","sandbar","sandpaper","sandwich","sanity","sardine","sari","sarong","sash","satellite","satin","satire","satisfaction","sauce","saucer","sauerkraut","sausage","savage","savannah","saving","savings","savior","saviour","savory","saw","saxophone","scaffold","scale","scallion","scallops","scalp","scam","scanner","scarecrow","scarf","scarification","scenario","scene","scenery","scent","schedule","scheduling","schema","scheme","schizophrenic","schnitzel","scholar","scholarship","school","schoolhouse","schooner","science","scientist","scimitar","scissors","scooter","scope","score","scorn","scorpion","scotch","scout","scow","scrambled","scrap","scraper","scratch","screamer","screen","screening","screenwriting","screw","screw-up","screwdriver","scrim","scrip","script","scripture","scrutiny","sculpting","sculptural","sculpture","sea","seabass","seafood","seagull","seal","seaplane","search","seashore","seaside","season","seat","seaweed","second","secrecy","secret","secretariat","secretary","secretion","section","sectional","sector","security","sediment","seed","seeder","seeker","seep","segment","seizure","selection","self","self-confidence","self-control","self-esteem","seller","selling","semantics","semester","semicircle","semicolon","semiconductor","seminar","senate","senator","sender","senior","sense","sensibility","sensitive","sensitivity","sensor","sentence","sentencing","sentiment","sepal","separation","septicaemia","sequel","sequence","serial","series","sermon","serum","serval","servant","server","service","servitude","sesame","session","set","setback","setting","settlement","settler","severity","sewer","sex","sexuality","shack","shackle","shade","shadow","shadowbox","shakedown","shaker","shallot","shallows","shame","shampoo","shanty","shape","share","shareholder","shark","shaw","shawl","shear","shearling","sheath","shed","sheep","sheet","shelf","shell","shelter","sherbet","sherry","shield","shift","shin","shine","shingle","ship","shipper","shipping","shipyard","shirt","shirtdress","shit","shoat","shock","shoe","shoe-horn","shoehorn","shoelace","shoemaker","shoes","shoestring","shofar","shoot","shootdown","shop","shopper","shopping","shore","shoreline","short","shortage","shorts","shortwave","shot","shoulder","shout","shovel","show","show-stopper","shower","shred","shrimp","shrine","shutdown","sibling","sick","sickness","side","sideboard","sideburns","sidecar","sidestream","sidewalk","siding","siege","sigh","sight","sightseeing","sign","signal","signature","signet","significance","signify","signup","silence","silica","silicon","silk","silkworm","sill","silly","silo","silver","similarity","simple","simplicity","simplification","simvastatin","sin","singer","singing","singular","sink","sinuosity","sip","sir","sister","sister-in-law","sitar","site","situation","size","skate","skating","skean","skeleton","ski","skiing","skill","skin","skirt","skull","skullcap","skullduggery","skunk","sky","skylight","skyline","skyscraper","skywalk","slang","slapstick","slash","slate","slave","slavery","slaw","sled","sledge","sleep","sleepiness","sleeping","sleet","sleuth","slice","slide","slider","slime","slip","slipper","slippers","slope","slot","sloth","slump","smell","smelting","smile","smith","smock","smog","smoke","smoking","smolt","smuggling","snack","snail","snake","snakebite","snap","snarl","sneaker","sneakers","sneeze","sniffle","snob","snorer","snow","snowboarding","snowflake","snowman","snowmobiling","snowplow","snowstorm","snowsuit","snuck","snug","snuggle","soap","soccer","socialism","socialist","society","sociology","sock","socks","soda","sofa","softball","softdrink","softening","software","soil","soldier","sole","solicitation","solicitor","solidarity","solidity","soliloquy","solitaire","solution","solvency","sombrero","somebody","someone","someplace","somersault","something","somewhere","son","sonar","sonata","song","songbird","sonnet","soot","sophomore","soprano","sorbet","sorghum","sorrel","sorrow","sort","soul","soulmate","sound","soundness","soup","source","sourwood","sousaphone","south","southeast","souvenir","sovereignty","sow","soy","soybean","space","spacing","spade","spaghetti","span","spandex","spank","sparerib","spark","sparrow","spasm","spat","spatula","spawn","speaker","speakerphone","speaking","spear","spec","special","specialist","specialty","species","specification","spectacle","spectacles","spectrograph","spectrum","speculation","speech","speed","speedboat","spell","spelling","spelt","spending","sphere","sphynx","spice","spider","spiderling","spike","spill","spinach","spine","spiral","spirit","spiritual","spirituality","spit","spite","spleen","splendor","split","spokesman","spokeswoman","sponge","sponsor","sponsorship","spool","spoon","spork","sport","sportsman","spot","spotlight","spouse","sprag","sprat","spray","spread","spreadsheet","spree","spring","sprinkles","sprinter","sprout","spruce","spud","spume","spur","spy","spyglass","square","squash","squatter","squeegee","squid","squirrel","stab","stability","stable","stack","stacking","stadium","staff","stag","stage","stain","stair","staircase","stake","stalk","stall","stallion","stamen","stamina","stamp","stance","stand","standard","standardisation","standardization","standing","standoff","standpoint","star","starboard","start","starter","state","statement","statin","station","station-wagon","statistic","statistics","statue","status","statute","stay","steak","stealth","steam","steamroller","steel","steeple","stem","stench","stencil","step","step-aunt","step-brother","step-daughter","step-father","step-grandfather","step-grandmother","step-mother","step-sister","step-son","step-uncle","stepdaughter","stepmother","stepping-stone","stepson","stereo","stew","steward","stick","sticker","stiletto","still","stimulation","stimulus","sting","stinger","stir-fry","stitch","stitcher","stock","stock-in-trade","stockings","stole","stomach","stone","stonework","stool","stop","stopsign","stopwatch","storage","store","storey","storm","story","story-telling","storyboard","stot","stove","strait","strand","stranger","strap","strategy","straw","strawberry","strawman","stream","street","streetcar","strength","stress","stretch","strife","strike","string","strip","stripe","strobe","stroke","structure","strudel","struggle","stucco","stud","student","studio","study","stuff","stumbling","stump","stupidity","sturgeon","sty","style","styling","stylus","sub","subcomponent","subconscious","subcontractor","subexpression","subgroup","subject","submarine","submitter","subprime","subroutine","subscription","subsection","subset","subsidence","subsidiary","subsidy","substance","substitution","subtitle","suburb","subway","success","succotash","suck","sucker","suede","suet","suffocation","sugar","suggestion","suicide","suit","suitcase","suite","sulfur","sultan","sum","summary","summer","summit","sun","sunbeam","sunbonnet","sundae","sunday","sundial","sunflower","sunglasses","sunlamp","sunlight","sunrise","sunroom","sunset","sunshine","superiority","supermarket","supernatural","supervision","supervisor","supper","supplement","supplier","supply","support","supporter","suppression","supreme","surface","surfboard","surge","surgeon","surgery","surname","surplus","surprise","surround","surroundings","surrounds","survey","survival","survivor","sushi","suspect","suspenders","suspension","sustainment","sustenance","swallow","swamp","swan","swanling","swath","sweat","sweater","sweatshirt","sweatshop","sweatsuit","sweets","swell","swim","swimming","swimsuit","swine","swing","switch","switchboard","switching","swivel","sword","swordfight","swordfish","sycamore","symbol","symmetry","sympathy","symptom","syndicate","syndrome","synergy","synod","synonym","synthesis","syrup","system","t-shirt","tab","tabby","tabernacle","table","tablecloth","tablet","tabletop","tachometer","tackle","taco","tactics","tactile","tadpole","tag","tail","tailbud","tailor","tailspin","take-out","takeover","tale","talent","talk","talking","tam-o'-shanter","tamale","tambour","tambourine","tan","tandem","tangerine","tank","tank-top","tanker","tankful","tap","tape","tapioca","target","taro","tarragon","tart","task","tassel","taste","tatami","tattler","tattoo","tavern","tax","taxi","taxicab","taxpayer","tea","teacher","teaching","team","teammate","teapot","tear","tech","technician","technique","technologist","technology","tectonics","teen","teenager","teepee","telephone","telescreen","teletype","television","tell","teller","temp","temper","temperature","temple","tempo","temporariness","temporary","temptation","temptress","tenant","tendency","tender","tenement","tenet","tennis","tenor","tension","tensor","tent","tentacle","tenth","tepee","teriyaki","term","terminal","termination","terminology","termite","terrace","terracotta","terrapin","terrarium","territory","terror","terrorism","terrorist","test","testament","testimonial","testimony","testing","text","textbook","textual","texture","thanks","thaw","theater","theft","theism","theme","theology","theory","therapist","therapy","thermals","thermometer","thermostat","thesis","thickness","thief","thigh","thing","thinking","thirst","thistle","thong","thongs","thorn","thought","thousand","thread","threat","threshold","thrift","thrill","throat","throne","thrush","thrust","thug","thumb","thump","thunder","thunderbolt","thunderhead","thunderstorm","thyme","tiara","tic","tick","ticket","tide","tie","tiger","tights","tile","till","tilt","timbale","timber","time","timeline","timeout","timer","timetable","timing","timpani","tin","tinderbox","tinkle","tintype","tip","tire","tissue","titanium","title","toad","toast","toaster","tobacco","today","toe","toenail","toffee","tofu","tog","toga","toilet","tolerance","tolerant","toll","tom-tom","tomatillo","tomato","tomb","tomography","tomorrow","ton","tonality","tone","tongue","tonic","tonight","tool","toot","tooth","toothbrush","toothpaste","toothpick","top","top-hat","topic","topsail","toque","toreador","tornado","torso","torte","tortellini","tortilla","tortoise","tosser","total","tote","touch","tough-guy","tour","tourism","tourist","tournament","tow-truck","towel","tower","town","townhouse","township","toy","trace","trachoma","track","tracking","tracksuit","tract","tractor","trade","trader","trading","tradition","traditionalism","traffic","trafficker","tragedy","trail","trailer","trailpatrol","train","trainer","training","trait","tram","tramp","trance","transaction","transcript","transfer","transformation","transit","transition","translation","transmission","transom","transparency","transplantation","transport","transportation","trap","trapdoor","trapezium","trapezoid","trash","travel","traveler","tray","treasure","treasury","treat","treatment","treaty","tree","trek","trellis","tremor","trench","trend","triad","trial","triangle","tribe","tributary","trick","trigger","trigonometry","trillion","trim","trinket","trip","tripod","tritone","triumph","trolley","trombone","troop","trooper","trophy","trouble","trousers","trout","trove","trowel","truck","trumpet","trunk","trust","trustee","truth","try","tsunami","tub","tuba","tube","tuber","tug","tugboat","tuition","tulip","tumbler","tummy","tuna","tune","tune-up","tunic","tunnel","turban","turf","turkey","turmeric","turn","turning","turnip","turnover","turnstile","turret","turtle","tusk","tussle","tutu","tuxedo","tweet","tweezers","twig","twilight","twine","twins","twist","twister","twitter","type","typeface","typewriter","typhoon","ukulele","ultimatum","umbrella","unblinking","uncertainty","uncle","underclothes","underestimate","underground","underneath","underpants","underpass","undershirt","understanding","understatement","undertaker","underwear","underweight","underwire","underwriting","unemployment","unibody","uniform","uniformity","union","unique","unit","unity","universe","university","update","upgrade","uplift","upper","upstairs","upward","urge","urgency","urn","usage","use","user","usher","usual","utensil","utilisation","utility","utilization","vacation","vaccine","vacuum","vagrant","valance","valentine","validate","validity","valley","valuable","value","vampire","van","vanadyl","vane","vanilla","vanity","variability","variable","variant","variation","variety","vascular","vase","vault","vaulting","veal","vector","vegetable","vegetarian","vegetarianism","vegetation","vehicle","veil","vein","veldt","vellum","velocity","velodrome","velvet","vendor","veneer","vengeance","venison","venom","venti","venture","venue","veranda","verb","verdict","verification","vermicelli","vernacular","verse","version","vertigo","verve","vessel","vest","vestment","vet","veteran","veterinarian","veto","viability","vibe","vibraphone","vibration","vibrissae","vice","vicinity","victim","victory","video","view","viewer","vignette","villa","village","vine","vinegar","vineyard","vintage","vintner","vinyl","viola","violation","violence","violet","violin","virginal","virtue","virus","visa","viscose","vise","vision","visit","visitor","visor","vista","visual","vitality","vitamin","vitro","vivo","vixen","vodka","vogue","voice","void","vol","volatility","volcano","volleyball","volume","volunteer","volunteering","vomit","vote","voter","voting","voyage","vulture","wad","wafer","waffle","wage","wagon","waist","waistband","wait","waiter","waiting","waitress","waiver","wake","walk","walker","walking","walkway","wall","wallaby","wallet","walnut","walrus","wampum","wannabe","want","war","warden","wardrobe","warfare","warlock","warlord","warm-up","warming","warmth","warning","warrant","warren","warrior","wasabi","wash","washbasin","washcloth","washer","washtub","wasp","waste","wastebasket","wasting","watch","watcher","watchmaker","water","waterbed","watercress","waterfall","waterfront","watermelon","waterskiing","waterspout","waterwheel","wave","waveform","wax","way","weakness","wealth","weapon","wear","weasel","weather","web","webinar","webmail","webpage","website","wedding","wedge","weed","weeder","weedkiller","week","weekend","weekender","weight","weird","welcome","welfare","well","well-being","west","western","wet-bar","wetland","wetsuit","whack","whale","wharf","wheat","wheel","whelp","whey","whip","whirlpool","whirlwind","whisker","whiskey","whisper","whistle","white","whole","wholesale","wholesaler","whorl","wick","widget","widow","width","wife","wifi","wild","wildebeest","wilderness","wildlife","will","willingness","willow","win","wind","wind-chime","windage","window","windscreen","windshield","wine","winery","wing","wingman","wingtip","wink","winner","winter","wire","wiretap","wiring","wisdom","wiseguy","wish","wisteria","wit","witch","witch-hunt","withdrawal","witness","wok","wolf","woman","wombat","wonder","wont","wood","woodchuck","woodland","woodshed","woodwind","wool","woolens","word","wording","work","workbench","worker","workforce","workhorse","working","workout","workplace","workshop","world","worm","worry","worship","worshiper","worth","wound","wrap","wraparound","wrapper","wrapping","wreck","wrecker","wren","wrench","wrestler","wriggler","wrinkle","wrist","writer","writing","wrong","xylophone","yacht","yahoo","yak","yam","yang","yard","yarmulke","yarn","yawl","year","yeast","yellow","yellowjacket","yesterday","yew","yin","yoga","yogurt","yoke","yolk","young","youngster","yourself","youth","yoyo","yurt","zampone","zebra","zebrafish","zen","zephyr","zero","ziggurat","zinc","zipper","zither","zombie","zone","zoo","zoologist","zoology","zoot-suit","zucchini"];var Ms=["a","abaft","aboard","about","above","absent","across","afore","after","against","along","alongside","amid","amidst","among","amongst","an","anenst","anti","apropos","apud","around","as","aside","astride","at","athwart","atop","barring","before","behind","below","beneath","beside","besides","between","beyond","but","by","circa","concerning","considering","despite","down","during","except","excepting","excluding","failing","following","for","forenenst","from","given","in","including","inside","into","lest","like","mid","midst","minus","modulo","near","next","notwithstanding","of","off","on","onto","opposite","out","outside","over","pace","past","per","plus","pro","qua","regarding","round","sans","save","since","than","the","through","throughout","till","times","to","toward","towards","under","underneath","unlike","until","unto","up","upon","versus","via","vice","with","within","without","worth"];var zs=["abandon","abase","abate","abbreviate","abdicate","abduct","abet","abhor","abide","abjure","abnegate","abolish","abominate","abort","abound","abrade","abridge","abrogate","abscond","abseil","absent","absolve","absorb","abstain","abstract","abuse","abut","accede","accelerate","accent","accentuate","accept","access","accessorise","accessorize","acclaim","acclimate","acclimatise","acclimatize","accommodate","accompany","accomplish","accord","accost","account","accouter","accoutre","accredit","accrue","acculturate","accumulate","accuse","accustom","ace","ache","achieve","acidify","acknowledge","acquaint","acquiesce","acquire","acquit","act","action","activate","actualise","actualize","actuate","adapt","add","addle","address","adduce","adhere","adjoin","adjourn","adjudge","adjudicate","adjure","adjust","administer","admire","admit","admonish","adopt","adore","adorn","adsorb","adulterate","adumbrate","advance","advantage","advertise","advise","advocate","aerate","affect","affiliate","affirm","affix","afflict","afford","afforest","affront","age","agglomerate","aggravate","aggregate","agitate","agonise","agonize","agree","aid","ail","aim","air","airbrush","airdrop","airfreight","airlift","alarm","alert","alienate","alight","align","allay","allege","alleviate","allocate","allot","allow","alloy","allude","ally","alphabetise","alphabetize","alter","alternate","amalgamate","amass","amaze","amble","ambush","ameliorate","amend","amortise","amortize","amount","amplify","amputate","amuse","anaesthetise","anaesthetize","analyse","anchor","anesthetize","anger","angle","anglicise","anglicize","animate","anneal","annex","annihilate","annotate","announce","annoy","annul","anodise","anodize","anoint","anonymise","anonymize","answer","antagonise","antagonize","antedate","anthologise","anthologize","anticipate","ape","apologise","apologize","apostrophise","apostrophize","appal","appall","appeal","appear","appease","append","appertain","applaud","apply","appoint","apportion","appraise","appreciate","apprehend","apprentice","apprise","approach","appropriate","approve","approximate","aquaplane","arbitrate","arc","arch","archive","argue","arise","arm","arouse","arraign","arrange","array","arrest","arrive","arrogate","arse","art","articulate","ascend","ascertain","ascribe","ask","asphyxiate","aspirate","aspire","assail","assassinate","assault","assay","assemble","assent","assert","assess","assign","assimilate","assist","associate","assuage","assume","assure","asterisk","astonish","astound","atomise","atomize","atone","atrophy","attach","attack","attain","attempt","attend","attenuate","attest","attract","attribute","auction","audit","audition","augment","augur","authenticate","author","authorise","authorize","autograph","automate","autosave","autowind","avail","avenge","aver","average","avert","avoid","avow","await","awake","awaken","award","awe","ax","axe","baa","babble","baby","babysit","back","backcomb","backdate","backfill","backfire","backlight","backpack","backspace","backtrack","badger","baffle","bag","bail","bait","bake","balance","bale","ball","balloon","ballot","balls","bamboozle","ban","band","bandage","bandy","bang","bangs","banish","bank","bankroll","bankrupt","banter","baptise","baptize","bar","barbecue","bare","barf","bargain","barge","bark","barnstorm","barrack","barrel","barricade","barter","base","bash","bask","bastardise","bastardize","baste","bat","batch","bath","bathe","batten","batter","battle","baulk","bawl","bay","bayonet","be","beach","beam","bean","bear","beard","beat","beatbox","beatboxer","beatify","beautify","beaver","beckon","become","bed","bedazzle","bedeck","bedevil","beef","beep","beetle","befall","befit","befog","befriend","beg","beget","beggar","begin","begrudge","beguile","behave","behead","behold","behoove","behove","belabor","belabour","belay","belch","belie","believe","belittle","bellow","belly","bellyache","belong","belt","bemoan","bemuse","benchmark","bend","benefit","bequeath","berate","bereave","berth","beseech","beset","besiege","besmirch","bespatter","bespeak","best","bestir","bestow","bestride","bet","betake","betide","betoken","betray","better","bewail","beware","bewilder","bewitch","bias","bicker","bicycle","bid","bide","biff","bifurcate","big","bike","bilk","bill","billet","billow","bin","bind","binge","biodegrade","bird","bisect","bitch","bite","bitmap","bivouac","bivvy","blab","blabber","black","blackball","blacken","blacklist","blackmail","blag","blame","blanch","blank","blanket","blare","blaspheme","blast","blather","blaze","blazon","bleach","bleat","bleed","bleep","blemish","blench","blend","bless","blight","blind","blindfold","blindfolded","blindside","blink","bliss","blister","blitz","bloat","block","blockade","blog","blood","bloom","bloop","blossom","blot","blow","blub","blubber","bludge","bludgeon","bluff","blunder","blunt","blur","blurt","blush","bluster","board","boast","bob","bobble","bode","bodge","bog","boggle","boil","bolster","bolt","bomb","bombard","bond","bone","bonk","boo","boob","boogie","book","bookmark","boom","boomerang","boost","boot","bootleg","booze","bop","border","bore","born","borrow","boss","botch","bother","bottle","bottleful","bottom","bounce","bound","bow","bowdlerise","bowdlerize","bowl","bowlful","box","boycott","braai","brace","braces","bracket","brag","braid","brain","brainstorm","brainwash","braise","brake","branch","brand","brandish","brave","brawl","bray","brazen","breach","break","breakfast","breast","breastfeed","breathalyse","breathalyze","breathe","breed","breeze","brew","bribe","brick","bridge","bridle","brief","brighten","brim","bring","bristle","broach","broadcast","broaden","broadside","broil","broker","brood","brook","browbeat","brown","browse","bruise","bruit","brush","brutalise","brutalize","bubble","buck","bucket","bucketful","buckle","bud","buddy","budge","budget","buff","buffer","buffet","bug","bugger","build","bulge","bulk","bulldoze","bullshit","bully","bum","bumble","bump","bunch","bundle","bung","bungle","bunk","bunker","bunt","buoy","burble","burden","burgeon","burglarize","burgle","burn","burnish","burp","burrow","burst","bury","bus","bushwhack","busk","bust","bustle","busy","butcher","butt","butter","button","buttonhole","buttress","buy","buzz","buzzing","bypass","cable","cache","cackle","caddie","cadge","cage","cajole","cake","calcify","calculate","calibrate","call","calm","calve","camouflage","camp","campaign","can","canalise","canalize","cancel","cane","cannibalise","cannibalize","cannon","cannulate","canoe","canonise","canonize","canoodle","canst","cant","canter","canvass","cap","caper","capitalise","capitalize","capitulate","capsize","captain","caption","captivate","capture","caramelise","caramelize","carbonise","carbonize","carburise","carburize","card","care","careen","career","caress","caricature","carjack","carol","carom","carouse","carp","carpet","carpool","carry","cart","cartwheel","carve","cascade","case","cash","cashier","casserole","cast","castigate","castrate","catalog","catalogue","catalyse","catalyze","catapult","catch","categorise","categorize","cater","caterwaul","catnap","caucus","caulk","cause","cauterise","cauterize","caution","cave","cavil","cavort","caw","cc","cease","cede","celebrate","cement","censor","censure","centralise","centralize","centre","certificate","certify","chafe","chaff","chain","chair","chalk","challenge","champ","champion","chance","change","channel","chant","chaperon","chaperone","char","characterise","characterize","charbroil","charge","chargesheet","chargrill","charm","chart","charter","chase","chasten","chastise","chat","chatter","chauffeur","cheapen","cheat","cheater","check","checkmate","cheek","cheep","cheer","cherish","chew","chicken","chide","chill","chillax","chime","chink","chip","chirp","chisel","chivvy","chlorinate","choke","chomp","choose","chop","choreograph","chortle","chorus","christen","chromakey","chronicle","chuck","chuckle","chug","chunder","chunter","churn","cinch","circle","circulate","circumcise","circumnavigate","circumscribe","circumvent","cite","civilise","civilize","clack","claim","clam","clamber","clamor","clamour","clamp","clang","clank","clap","clarify","clash","clasp","class","classify","clatter","claw","clean","cleanse","clear","cleave","clench","clerk","click","climax","climb","clinch","cling","clink","clinking","clip","cloak","clobber","clock","clog","clone","clonk","close","closet","clot","clothe","cloud","clout","clown","club","cluck","clue","clump","clunk","cluster","clutch","clutter","coach","coagulate","coalesce","coarsen","coast","coat","coax","cobble","cock","cocoon","coddle","code","codify","coerce","coexist","cogitate","cohabit","cohere","coil","coin","coincide","collaborate","collapse","collar","collate","collect","collectivise","collectivize","collide","colligate","collocate","collude","colonise","colonize","colorize","colour","comb","combat","combine","combust","come","comfort","command","commandeer","commemorate","commence","commend","comment","commentate","commercialise","commercialize","commingle","commiserate","commission","commit","commune","communicate","commute","compact","compare","compartmentalise","compartmentalize","compel","compensate","compete","compile","complain","complement","complete","complicate","compliment","comply","comport","compose","compost","compound","comprehend","compress","comprise","compromise","compute","computerise","computerize","con","conceal","concede","conceive","concentrate","conceptualise","conceptualize","concern","concertina","conciliate","conclude","concoct","concrete","concur","concuss","condemn","condense","condescend","condition","condone","conduct","cone","confer","confess","confide","configure","confine","confirm","confiscate","conflate","conflict","conform","confound","confront","confuse","confute","congeal","congratulate","congregate","conjecture","conjoin","conjugate","conjure","conk","connect","connive","connote","conquer","conscientise","conscientize","conscript","consecrate","consent","conserve","consider","consign","consist","console","consolidate","consort","conspire","constitute","constrain","constrict","construct","construe","consult","consume","consummate","contact","contain","contaminate","contemplate","contend","content","contest","contextualise","contextualize","continue","contort","contract","contradict","contraindicate","contrast","contravene","contribute","contrive","control","controvert","convalesce","convene","converge","converse","convert","convey","convict","convince","convoke","convulse","coo","cook","cool","coop","cooperate","coordinate","cop","cope","coppice","copulate","copy","copyright","cordon","core","cork","corkscrew","corner","corral","correct","correlate","correspond","corrode","corrupt","coruscate","cosh","cosset","cost","cosy","cotton","couch","cough","counsel","count","countenance","counter","counteract","counterbalance","counterfeit","countermand","counterpoint","countersign","couple","courier","course","court","covenant","cover","covet","cow","cower","cox","cozy","crack","crackle","cradle","craft","cram","cramp","crane","crank","crap","crash","crate","crave","crawl","crayon","creak","creaking","cream","crease","create","credential","credit","creep","cremate","creolise","creolize","creosote","crest","crew","crib","crick","criminalise","criminalize","crimp","cringe","crinkle","cripple","crisp","criticise","criticize","critique","croak","crochet","crook","croon","crop","cross","crouch","crow","crowd","crown","crucify","cruise","crumble","crumple","crunch","crusade","crush","cry","crystallise","crystallize","cube","cuckold","cuddle","cudgel","cue","cuff","cull","culminate","cultivate","culture","cup","curate","curb","curdle","cure","curl","curry","curse","curtail","curtain","curtsy","curve","cushion","cuss","customise","customize","cut","cwtch","cycle","dab","dabble","dally","dam","damage","dammit","damn","damp","dampen","dance","dandle","dangle","dare","darken","darn","dart","dash","date","daub","daunt","dawdle","dawn","daydream","dazzle","deactivate","deaden","deadhead","deafen","deal","debar","debase","debate","debilitate","debit","debrief","debug","debunk","debut","decamp","decant","decapitate","decay","deceive","decelerate","decentralise","decentralize","decide","decimalise","decimalize","decimate","decipher","deck","declaim","declare","declassify","decline","declutter","decode","decommission","decompose","decompress","deconsecrate","deconstruct","decontaminate","decontrol","decorate","decouple","decoy","decrease","decree","decriminalise","decriminalize","decry","decrypt","dedicate","deduce","deduct","deejay","deem","deepen","deface","defame","default","defeat","defecate","defect","defend","defer","defile","define","deflate","deflect","deflower","defog","defoliate","deforest","deform","defrag","defragment","defraud","defray","defrock","defrost","defuse","defy","degenerate","deglaze","degrade","degrease","dehumanise","dehumanize","dehydrate","deify","deign","delay","delegate","delete","deliberate","delight","delimit","delineate","deliquesce","deliver","delouse","delude","deluge","delve","demand","demarcate","demean","demerge","demilitarise","demilitarize","demineralise","demineralize","demist","demo","demob","demobilise","demobilize","democratise","democratize","demolish","demonise","demonize","demonstrate","demoralise","demoralize","demote","demotivate","demur","demystify","denationalise","denationalize","denigrate","denitrify","denominate","denote","denounce","dent","denude","deny","depart","depend","depersonalise","depersonalize","depict","deplane","deplete","deplore","deploy","depopulate","deport","depose","deposit","deprave","deprecate","depreciate","depress","depressurise","depressurize","deprive","depute","deputise","deputize","deracinate","derail","dereference","deregulate","deride","derive","derogate","descale","descend","describe","descry","desecrate","desegregate","deselect","desensitise","desensitize","desert","deserve","design","designate","desire","desist","deskill","desolate","despair","despise","despoil","destabilise","destabilize","destock","destroy","detach","detail","detain","detect","deter","deteriorate","determine","detest","dethrone","detonate","detour","detoxify","detract","detrain","devalue","devastate","develop","deviate","devise","devoice","devolve","devote","devour","diagnose","dial","dice","dicker","dictate","diddle","die","diet","differ","differentiate","diffract","diffuse","dig","digest","digitalise","digitalize","digitise","digitize","dignify","digress","dilate","dilute","diluted","dim","diminish","dimple","dine","ding","dink","dip","diphthongise","diphthongize","direct","dirty","dis","disable","disabuse","disadvantage","disaffiliate","disafforest","disagree","disallow","disambiguate","disappear","disappoint","disapprove","disarm","disarrange","disassemble","disassociate","disavow","disband","disbar","disbelieve","disburse","discard","discern","discharge","discipline","disclaim","disclose","discolor","discolour","discomfit","discomfort","discompose","disconcert","disconnect","discontinue","discount","discourage","discourse","discover","discredit","discriminate","discuss","disdain","disembark","disembowel","disenfranchise","disengage","disentangle","disestablish","disfigure","disgorge","disgrace","disguise","disgust","dish","dishearten","dishonor","dishonour","disillusion","disincentivise","disincentivize","disinfect","disinherit","disinhibit","disintegrate","disinter","disinvest","dislike","dislocate","dislodge","dismantle","dismay","dismember","dismiss","dismount","disobey","disorient","disorientate","disown","disparage","dispatch","dispel","dispense","disperse","displace","display","displease","disport","dispose","dispossess","disprove","dispute","disqualify","disregard","disrespect","disrobe","disrupt","dissect","dissemble","disseminate","dissent","dissimulate","dissipate","dissociate","dissolve","dissuade","distance","distend","distil","distill","distinguish","distort","distract","distress","distribute","distrust","disturb","disunite","ditch","dither","dive","diverge","diversify","divert","divest","divide","divine","divorce","divulge","divvy","do","dob","dock","doctor","document","dodge","doff","dog","dole","doll","dollarise","dollarize","domesticate","dominate","don","donate","doodle","doom","doorstep","dop","dope","dose","doss","dot","dote","double","doubt","douche","douse","dovetail","down","downchange","downgrade","downlink","download","downplay","downshift","downsize","dowse","doze","draft","drag","dragoon","drain","dramatise","dramatize","drape","draught","draw","drawl","dread","dream","dredge","drench","dress","dribble","drift","drill","drink","drip","drive","drivel","drizzle","drone","drool","droop","drop","drown","drowse","drug","drum","dry","dub","duck","duckie","ducks","duel","duff","dull","dumb","dumbfound","dummy","dump","dunk","dunt","dupe","duplicate","dust","dwarf","dwell","dwindle","dye","dynamite","earmark","earn","earth","ease","eat","eavesdrop","ebb","echo","eclipse","economise","economize","eddy","edge","edify","edit","editorialise","editorialize","educate","eff","efface","effect","effectuate","egg","ejaculate","eject","eke","elaborate","elapse","elbow","elect","electrify","electrocute","electroplate","elevate","elicit","elide","eliminate","elongate","elope","elucidate","elude","email","emanate","emancipate","emasculate","embalm","embargo","embark","embarrass","embed","embellish","embezzle","embitter","emblazon","embody","embolden","emboss","embrace","embroider","embroil","emcee","emend","emerge","emigrate","emit","emote","empathise","empathize","emphasise","emphasize","employ","empower","empty","emulate","emulsify","enable","enact","encamp","encapsulate","encase","encash","enchant","encircle","enclose","encode","encompass","encounter","encourage","encroach","encrypt","encumber","end","endanger","endear","endeavor","endeavour","endorse","endow","endure","energise","energize","enervate","enfeeble","enfold","enforce","enfranchise","engage","engender","engineer","engorge","engrave","engross","engulf","enhance","enjoin","enjoy","enlarge","enlighten","enlist","enliven","enmesh","ennoble","enquire","enrage","enrapture","enrich","enrol","enroll","ensconce","enshrine","enshroud","enslave","ensnare","ensue","ensure","entail","entangle","enter","entertain","enthral","enthrall","enthrone","enthuse","entice","entitle","entomb","entrance","entrap","entreat","entrench","entrust","entwine","enumerate","enunciate","envelop","envisage","envision","envy","epitomise","epitomize","equal","equalise","equalize","equate","equip","equivocate","eradicate","erase","erect","erode","err","erupt","escalate","escape","eschew","escort","espouse","espy","essay","establish","esteem","estimate","etch","eulogise","eulogize","euthanise","euthanize","evacuate","evade","evaluate","evangelise","evangelize","evaporate","even","eventuate","evict","evidence","evince","eviscerate","evoke","evolve","exacerbate","exact","exaggerate","exalt","examine","exasperate","excavate","exceed","excel","except","excerpt","exchange","excise","excite","exclaim","exclude","excommunicate","excoriate","excrete","exculpate","excuse","execute","exemplify","exempt","exercise","exert","exeunt","exfoliate","exhale","exhaust","exhibit","exhilarate","exhort","exhume","exile","exist","exit","exonerate","exorcise","exorcize","expand","expatiate","expect","expectorate","expedite","expel","expend","experience","experiment","expiate","expire","explain","explicate","explode","exploit","explore","export","expose","expostulate","expound","express","expropriate","expunge","expurgate","extemporise","extemporize","extend","exterminate","externalise","externalize","extinguish","extirpate","extol","extort","extract","extradite","extrapolate","extricate","extrude","exude","exult","eye","eyeball","eyeglasses","fabricate","face","facilitate","factor","factorise","factorize","fade","faff","fail","faint","fake","fall","falsify","falter","familiarise","familiarize","fan","fancy","fantasise","fantasize","fare","farewell","farm","farrow","fart","fascinate","fashion","fast","fasten","father","fathom","fatten","fault","favor","favour","fawn","fax","faze","fear","feast","feather","feature","federate","feed","feel","feign","feint","fell","fellate","feminise","feminize","fence","fend","ferment","ferret","ferry","fertilise","fertilize","fess","fester","festoon","fetch","fete","fetishise","fetishize","fetter","feud","fib","fictionalise","fictionalize","fiddle","fidget","field","fight","figure","filch","file","filibuster","fill","fillet","film","filter","finagle","finalise","finalize","finance","find","fine","finesse","finger","fingerprint","finish","fire","firebomb","firm","fish","fishtail","fit","fix","fizz","fizzle","flag","flagellate","flail","flake","flame","flank","flap","flare","flash","flat","flatline","flatten","flatter","flaunt","flavour","flay","fleck","flee","fleece","flesh","flex","flick","flicker","flight","flinch","fling","flip","flirt","flit","float","flock","flog","flood","floodlight","floor","flop","floss","flounce","flounder","flour","flourish","flout","flow","flower","flub","fluctuate","fluff","flummox","flunk","flush","fluster","flutter","fly","foal","foam","fob","focalise","focalize","focus","fog","foil","foist","fold","follow","foment","fondle","fool","foot","forage","forbear","forbid","force","ford","forearm","forecast","foreclose","foregather","foreground","foresee","foreshadow","foreshorten","forestall","foretell","forewarn","forfeit","forfend","forgather","forge","forget","forgive","forgo","fork","form","formalise","formalize","format","formulate","fornicate","forsake","forswear","fortify","forward","forwards","fossick","fossilise","fossilize","foster","foul","found","founder","fox","fracture","fragment","frame","franchise","frank","fraternise","fraternize","fray","freak","free","freelance","freeload","freestyle","freewheel","freeze","freight","frequent","freshen","fret","frighten","fringe","frisk","fritter","frizz","frizzle","frogmarch","frolic","front","frost","froth","frown","fruit","frustrate","fry","fuck","fudge","fuel","fulfil","fulfill","fulminate","fumble","fume","fumigate","function","fund","funk","funnel","furl","furlough","furnish","furrow","further","fuse","fuss","gab","gabble","gad","gag","gain","gainsay","gall","gallivant","gallop","galumph","galvanise","galvanize","gamble","gambol","gang","gape","garage","garden","gargle","garland","garner","garnish","garrison","garrote","garrotte","gas","gash","gasp","gatecrash","gather","gauge","gawk","gawp","gaze","gazump","gazunder","gear","gee","gel","geld","gen","generalise","generalize","generate","gentrify","genuflect","germinate","gerrymander","gestate","gesticulate","gesture","get","ghost","ghostwrite","gibber","gift","giggle","gild","ginger","gird","girdle","give","gladden","glamorise","glamorize","glance","glare","glass","glaze","gleam","glean","glide","glimmer","glimmering","glimpse","glint","glisten","glister","glitter","gloat","globalise","globalize","glom","glorify","glory","gloss","glow","glower","glue","glug","glut","gnash","gnaw","go","goad","gob","gobble","goggle","goldbrick","goof","google","goose","gore","gorge","gossip","gouge","govern","grab","grace","grade","graduate","graft","grant","grapple","grasp","grass","grate","gratify","gravitate","graze","grease","green","greet","grey","grieve","grill","grimace","grin","grind","grip","gripe","grit","grizzle","groan","grok","groom","grope","gross","grouch","ground","group","grouse","grout","grovel","grow","growl","grub","grudge","grumble","grunt","guarantee","guard","guess","guest","guffaw","guide","guillotine","guilt","gulp","gum","gun","gurgle","gurn","gush","gussy","gust","gut","gutter","guzzle","gybe","gyp","gyrate","hack","haemorrhage","haggle","hail","hallmark","halloo","hallucinate","halt","halve","ham","hammer","hamper","hamstring","hand","handcuff","handicap","handle","hang","hanker","happen","harangue","harass","harbor","harbour","harden","hare","hark","harm","harmonise","harmonize","harness","harp","harpoon","harrow","harrumph","harry","harvest","hash","hassle","hasten","hatch","hate","haul","haunt","have","haw","hawk","hazard","haze","head","headbutt","headhunt","headline","heal","heap","hear","hearken","hearten","heat","heave","heckle","hector","hedge","heed","heel","heft","heighten","heist","help","hem","hemorrhage","herald","herd","hesitate","hew","hex","hibernate","hiccough","hiccup","hide","hie","highball","highlight","hightail","hijack","hike","hinder","hinge","hint","hire","hiss","hit","hitch","hitchhike","hive","hoard","hoax","hobble","hobnob","hock","hoe","hog","hoick","hoist","hold","hole","holiday","holler","hollow","holster","home","homeschool","homestead","hone","honeymoon","honk","honour","hoodwink","hoof","hook","hoon","hoot","hoover","hop","hope","horn","horrify","horse","horsewhip","hose","hosepipe","hospitalise","hospitalize","host","hot","hotfoot","hound","house","hover","howl","huddle","huff","hug","hull","hum","humanise","humanize","humble","humiliate","humour","hump","hunch","hunger","hunker","hunt","hurdle","hurl","hurry","hurt","hurtle","husband","hush","husk","hustle","hybridise","hybridize","hydrate","hydroplane","hype","hyperventilate","hyphenate","hypnotise","hypnotize","hypothesise","hypothesize","ice","iconify","idealise","idealize","ideate","identify","idle","idolise","idolize","ignite","ignore","illuminate","illumine","illustrate","imagine","imagineer","imbibe","imbue","imitate","immerse","immigrate","immobilise","immobilize","immolate","immortalise","immortalize","immunise","immunize","immure","impact","impair","impale","impanel","impart","impeach","impede","impel","imperil","impersonate","impinge","implant","implement","implicate","implode","implore","imply","import","importune","impose","impound","impoverish","impregnate","impress","imprint","imprison","improve","improvise","impugn","inactivate","inaugurate","incapacitate","incarcerate","incarnate","incense","incentivise","incentivize","inch","incinerate","incise","incite","incline","include","incommode","inconvenience","incorporate","increase","incriminate","incubate","inculcate","incur","indemnify","indent","index","indicate","indict","individualise","individualize","individuate","indoctrinate","induce","induct","indulge","industrialise","industrialize","infantilise","infantilize","infect","infer","infest","infill","infiltrate","inflame","inflate","inflect","inflict","influence","inform","infringe","infuriate","infuse","ingest","ingratiate","inhabit","inhale","inhere","inherit","inhibit","initial","initialise","initialize","initiate","inject","injure","ink","inlay","innovate","inoculate","input","inscribe","inseminate","insert","inset","insinuate","insist","inspect","inspire","install","instance","instigate","instil","instill","institute","institutionalise","institutionalize","instruct","insulate","insult","insure","integrate","intend","intensify","inter","interact","interbreed","intercede","intercept","interchange","interconnect","intercut","interest","interface","interfere","interject","interlace","interleave","interlink","interlock","intermarry","intermesh","intermingle","intermix","intern","internalise","internalize","internationalise","internationalize","interpenetrate","interpolate","interpose","interpret","interrelate","interrogate","interrupt","intersect","intersperse","intertwine","intervene","interview","interweave","interwork","intimate","intimidate","intone","intoxicate","intrigue","introduce","intrude","intubate","intuit","inundate","inure","invade","invalid","invalidate","inveigh","inveigle","invent","inventory","invert","invest","investigate","invigilate","invigorate","invite","invoice","invoke","involve","ionise","ionize","irk","iron","irradiate","irrigate","irritate","irrupt","isolate","issue","italicise","italicize","itch","itemise","itemize","iterate","jab","jabber","jack","jackknife","jail","jam","jangle","jar","jaw","jaywalk","jazz","jeer","jell","jeopardise","jeopardize","jerk","jest","jet","jettison","jib","jibe","jig","jiggle","jilt","jingle","jink","jinx","jive","jockey","jog","joggle","join","joint","joke","jol","jolly","jolt","josh","jostle","jot","journey","joust","judder","judge","juggle","juice","jumble","jump","junk","justify","jut","juxtapose","keel","keelhaul","keen","keep","ken","key","keyboard","kibitz","kick","kid","kidnap","kill","kindle","kink","kip","kiss","kit","kite","klap","kludge","knacker","knead","knee","kneecap","kneel","knife","knight","knit","knock","knot","know","knuckle","kowtow","kvetch","label","labour","lace","lacerate","lack","lacquer","lactate","ladder","ladle","lag","lam","lamb","lambast","lambaste","lament","lamp","lampoon","lance","land","lands","landscape","languish","lap","lapse","lard","large","lark","lash","lasso","last","latch","lather","laud","laugh","launch","launder","lavish","lay","layer","laze","leach","lead","leaf","leaflet","leak","lean","leap","leapfrog","learn","lease","leash","leave","leaven","lech","lecture","leer","leg","legalise","legalize","legislate","legitimise","legitimize","lend","lengthen","lessen","let","letter","letterbox","level","lever","leverage","levitate","levy","liaise","libel","liberalise","liberalize","liberate","license","lick","lie","lift","ligate","light","lighten","like","liken","limber","lime","limit","limp","line","linger","link","lionise","lionize","liquefy","liquidate","liquidise","liquidize","lisp","list","listen","litigate","litter","live","liven","load","loads","loaf","loan","loathe","lob","lobby","lobotomise","lobotomize","localise","localize","locate","lock","lodge","loft","log","loiter","loll","lollop","long","look","looks","loom","loop","loose","loosen","loot","lop","lope","lord","lose","lounge","lour","louse","love","low","lowball","lower","lubricate","luck","lug","lull","lumber","lump","lunch","lunge","lurch","lure","lurk","lust","luxuriate","lynch","macerate","machine","madden","magic","magnetise","magnetize","magnify","mail","maim","mainline","mainstream","maintain","major","make","malfunction","malign","malinger","maltreat","man","manacle","manage","mandate","mangle","manhandle","manicure","manifest","manipulate","manoeuvre","mantle","manufacture","manure","map","mar","march","marginalise","marginalize","marinate","mark","market","maroon","marry","marshal","martyr","marvel","masculinise","masculinize","mash","mask","masquerade","mass","massacre","massage","master","mastermind","masticate","masturbate","match","mate","materialise","materialize","matriculate","matter","mature","maul","maunder","max","maximise","maximize","mean","meander","measure","mechanise","mechanize","medal","meddle","mediate","medicate","meditate","meet","meld","mellow","melt","memorialise","memorialize","memorise","memorize","menace","mend","menstruate","mention","meow","mercerise","mercerize","merchandise","merge","merit","mesh","mesmerise","mesmerize","mess","message","metabolise","metabolize","metamorphose","mete","meter","methinks","mew","mewl","miaow","microblog","microchip","micromanage","microwave","micturate","migrate","militarise","militarize","militate","milk","mill","mime","mimic","mince","mind","mine","mingle","miniaturise","miniaturize","minimise","minimize","minister","minor","mint","minute","mirror","misapply","misappropriate","misbehave","miscalculate","miscarry","miscast","misconceive","misconstrue","miscount","misdiagnose","misdial","misdirect","misfile","misfire","misgovern","mishandle","mishear","mishit","misinform","misinterpret","misjudge","miskey","mislay","mislead","mismanage","mismatch","misname","misplace","misplay","mispronounce","misquote","misread","misreport","misrepresent","miss","mission","misspell","misspend","mist","mistake","mistime","mistreat","mistrust","misunderstand","misuse","mitigate","mitre","mix","moan","mob","mobilise","mobilize","mock","mod","model","moderate","modernise","modernize","modify","modulate","moisten","moisturise","moisturize","mold","molder","molest","mollify","mollycoddle","molt","monitor","monopolise","monopolize","moo","mooch","moon","moonlight","moonwalk","moor","moot","mop","mope","moralise","moralize","morph","mortar","mortgage","mortify","mosey","mosh","mothball","mother","motion","motivate","motor","mould","moulder","moult","mount","mourn","mouse","mouth","move","movies","mow","muck","muddle","muddy","muff","muffle","mug","mulch","mull","multicast","multiply","multitask","mumble","mumbling","mummify","munch","murder","murmur","murmuring","murmurings","muscle","muse","mushroom","muss","muster","mutate","mute","mutilate","mutiny","mutter","muzzle","mystify","nab","nag","nail","name","namecheck","nap","narrate","narrow","narrowcast","nasalise","nasalize","nationalise","nationalize","natter","naturalise","naturalize","nauseate","navigate","near","nearer","nearest","neaten","necessitate","neck","necklace","need","needle","negate","negative","neglect","negotiate","neigh","nerve","nest","nestle","net","nettle","network","neuter","neutralise","neutralize","nibble","nick","nickname","niggle","nip","nitrify","nix","nobble","nod","nominalize","nominate","norm","normalise","normalize","nose","nosedive","nosh","notarise","notarize","notch","note","notice","notify","nourish","nudge","nuke","nullify","numb","number","nurse","nurture","nut","nuzzle","obey","obfuscate","object","objectify","oblige","obliterate","obscure","observe","obsess","obstruct","obtain","obtrude","obviate","occasion","occlude","occupy","occur","off","offend","offer","officiate","offload","offset","offshore","ogle","oil","okay","omit","ooze","open","operate","opine","oppose","oppress","opt","optimise","optimize","option","orbit","orchestrate","ordain","order","organise","organize","orient","orientate","originate","ornament","orphan","oscillate","ossify","ostracise","ostracize","oust","out","outbid","outclass","outdistance","outdo","outface","outfit","outflank","outfox","outgrow","outgun","outlast","outlaw","outline","outlive","outmaneuver","outmanoeuvre","outnumber","outpace","outperform","outplay","outpoint","output","outrage","outrank","outrun","outsell","outshine","outsmart","outsource","outstay","outstrip","outvote","outweigh","outwit","overachieve","overact","overawe","overbalance","overbook","overburden","overcharge","overcome","overcompensate","overcook","overdevelop","overdo","overdose","overdraw","overdub","overeat","overemphasize","overestimate","overexpose","overextend","overfeed","overflow","overfly","overgeneralise","overgeneralize","overgraze","overhang","overhaul","overhear","overheat","overindulge","overlap","overlay","overlie","overload","overlook","overpay","overplay","overpower","overprint","overproduce","overrate","overreach","overreact","override","overrule","overrun","oversee","oversell","overshadow","overshoot","oversimplify","oversleep","overspend","overstate","overstay","overstep","overstock","overstretch","overtake","overtax","overthrow","overtrain","overturn","overuse","overvalue","overwhelm","overwinter","overwork","overwrite","ovulate","owe","own","oxidise","oxidize","oxygenate","pace","pacify","pack","package","packetise","packetize","pad","paddle","padlock","page","paginate","pailful","pain","paint","pair","pal","palatalise","palatalize","pale","pall","palliate","palm","palpate","palpitate","pamper","pan","pander","panel","panhandle","panic","pant","paper","parachute","parade","parallel","paralyse","paralyze","paraphrase","parboil","parcel","parch","pardon","pare","park","parlay","parley","parody","parole","parrot","parry","parse","part","partake","participate","particularise","particularize","partition","partner","party","pass","passivise","passivize","paste","pasteurise","pasteurize","pasture","pat","patch","patent","patrol","patronise","patronize","patter","pattern","pause","pave","paw","pawn","pay","peak","peal","peck","pedal","peddle","pedestrianise","pedestrianize","pee","peek","peel","peep","peer","peg","pelt","pen","penalise","penalize","pencil","penetrate","pension","people","pep","pepper","perambulate","perceive","perch","percolate","perfect","perforate","perform","perfume","perish","perjure","perk","perm","permeate","permit","perpetrate","perpetuate","perplex","persecute","persevere","persist","personalise","personalize","personify","perspire","persuade","pertain","perturb","peruse","pervade","pervert","pester","pet","peter","petition","petrify","phase","philosophise","philosophize","phone","photocopy","photograph","photoshop","photosynthesise","photosynthesize","phrase","pick","picket","pickle","picnic","picture","picturise","picturize","piddle","piece","pierce","pig","pigeonhole","piggyback","pike","pile","pilfer","pill","pillage","pillory","pillow","pilot","pimp","pin","pinch","pine","ping","pinion","pink","pinpoint","pioneer","pip","pipe","pique","pirate","pirouette","piss","pit","pitch","pity","pivot","pixelate","pixellate","placate","place","plagiarise","plagiarize","plague","plait","plan","plane","plant","plaster","plasticise","plasticize","plate","plateau","play","plead","please","pledge","plight","plod","plonk","plop","plot","plough","pluck","plug","plumb","plummet","plump","plunder","plunge","plunk","pluralise","pluralize","ply","poach","pocket","point","poise","poison","poke","polarise","polarize","pole","poleax","poleaxe","police","polish","politicise","politicize","poll","pollard","pollinate","pollute","polymerise","polymerize","ponce","ponder","pong","pontificate","pony","poo","pooh","pool","poop","pootle","pop","popularise","popularize","populate","pore","port","portend","portion","portray","pose","posit","position","possess","posset","post","postmark","postpone","postulate","posture","pot","potter","pounce","pound","pour","pout","powder","power","practice","practise","praise","praises","prance","prang","prate","prattle","pray","preach","precede","precipitate","precis","preclude","predate","predecease","predetermine","predicate","predict","predispose","predominate","preen","preface","prefer","prefigure","prefix","preheat","prejudge","prejudice","preload","premaster","premiere","preoccupy","prep","prepare","prepone","preregister","presage","prescind","prescribe","preselect","presell","present","preserve","preset","preside","press","pressure","pressurise","pressurize","presume","presuppose","pretend","pretest","prettify","prevail","prevaricate","prevent","preview","prey","price","prick","prickle","pride","prime","primp","print","prioritise","prioritize","prise","privatise","privatize","privilege","prize","probate","probe","proceed","process","proclaim","procrastinate","procreate","proctor","procure","prod","produce","profane","profess","professionalise","professionalize","proffer","profile","profit","program","programme","progress","prohibit","project","proliferate","prolong","promenade","promise","promote","prompt","promulgate","pronounce","proof","proofread","prop","propagandise","propagandize","propagate","propel","prophesy","propitiate","propose","proposition","propound","proscribe","prosecute","proselytise","proselytize","prospect","prosper","prostitute","prostrate","protect","protest","protrude","prove","provide","provision","provoke","prowl","prune","pry","psych","psychoanalyse","publicise","publicize","publish","pucker","puff","puke","pull","pullulate","pulp","pulsate","pulse","pulverise","pulverize","pummel","pump","pun","punch","punctuate","puncture","punish","punt","pupate","purchase","purge","purify","purl","purloin","purport","purr","purse","pursue","purvey","push","pussyfoot","put","putrefy","putt","putter","puzzle","quack","quadruple","quaff","quail","quake","qualify","quantify","quarantine","quarrel","quarry","quarter","quarterback","quash","quaver","queer","quell","quench","query","quest","question","queue","quibble","quicken","quiet","quieten","quintuple","quip","quirk","quit","quiver","quiz","quote","quoth","rabbit","race","rack","radiate","radicalise","radicalize","radio","raffle","rag","rage","raid","rail","railroad","rain","raise","rake","rally","ram","ramble","ramp","rampage","randomise","randomize","range","rank","rankle","ransack","ransom","rant","rap","rape","rappel","rasp","rasterise","rasterize","rat","ratchet","rate","ratify","ration","rationalise","rationalize","rattle","ravage","rave","ravel","ravish","raze","razz","reach","reacquaint","react","reactivate","read","readdress","readies","readjust","readmit","ready","reaffirm","realign","realise","realize","reallocate","ream","reanimate","reap","reappear","reapply","reappoint","reappraise","rear","rearm","rearrange","reason","reassemble","reassert","reassess","reassign","reassure","reawaken","rebel","reboot","reborn","rebound","rebrand","rebuff","rebuild","rebuke","rebut","recall","recant","recap","recapitulate","recapture","recast","recede","receive","recess","recharge","reciprocate","recite","reckon","reclaim","reclassify","recline","recognise","recognize","recoil","recollect","recommence","recommend","recompense","reconcile","recondition","reconfigure","reconfirm","reconnect","reconnoitre","reconquer","reconsider","reconstitute","reconstruct","reconvene","record","recount","recoup","recover","recreate","recrudesce","recruit","rectify","recuperate","recur","recycle","redact","redden","redecorate","redeem","redefine","redeploy","redesign","redevelop","redial","redirect","rediscover","redistribute","redistrict","redo","redouble","redound","redraft","redraw","redress","reduce","reduplicate","reef","reek","reel","ref","refer","referee","reference","refill","refinance","refine","refit","reflate","reflect","refloat","refocus","reform","reformat","reformulate","refract","refrain","refresh","refrigerate","refuel","refund","refurbish","refuse","refute","regain","regale","regard","regenerate","register","regress","regret","regroup","regularise","regularize","regulate","regurgitate","rehabilitate","rehash","rehear","rehearse","reheat","rehome","rehouse","reign","reignite","reimburse","rein","reincarnate","reinforce","reinstate","reinterpret","reintroduce","reinvent","reinvest","reinvigorate","reissue","reiterate","reject","rejig","rejigger","rejoice","rejoin","rejuvenate","rekindle","relapse","relate","relaunch","relax","relay","release","relegate","relent","relieve","relinquish","relish","relive","reload","relocate","rely","remain","remainder","remake","remand","remap","remark","remarry","remaster","remediate","remedy","remember","remind","reminisce","remit","remix","remodel","remonstrate","remortgage","remould","remount","remove","remunerate","rename","rend","render","rendezvous","renege","renew","renounce","renovate","rent","reoccur","reoffend","reopen","reorder","reorganise","reorganize","reorient","repackage","repair","repatriate","repay","repeal","repeat","repel","repent","rephrase","replace","replay","replenish","replicate","reply","report","repose","repossess","represent","repress","reprieve","reprimand","reprint","reproach","reprocess","reproduce","reprove","repudiate","repulse","repurpose","request","require","requisition","requite","rerun","reschedule","rescind","rescue","research","researches","resect","resell","resemble","resent","reserve","reset","resettle","reshape","reshuffle","reside","resign","resist","resit","resize","reskill","resolve","resonate","resort","resound","resource","respect","respire","respond","respray","rest","restart","restate","restock","restore","restrain","restrict","restring","restructure","result","resume","resupply","resurface","resurrect","resuscitate","retail","retain","retake","retaliate","retard","retch","retell","retest","rethink","retire","retool","retort","retouch","retrace","retract","retrain","retreat","retrench","retrieve","retrofit","retry","return","reunify","reunite","reuse","rev","revalue","revamp","reveal","revel","revenge","reverberate","revere","reverse","revert","review","revile","revise","revisit","revitalise","revitalize","revive","revivify","revoke","revolt","revolutionise","revolutionize","revolve","reward","rewind","rewire","reword","rework","rewrite","rhapsodise","rhapsodize","rhyme","rib","rick","ricochet","rid","riddle","ride","ridge","ridicule","riffle","rifle","rig","right","rightsize","rile","rim","ring","rinse","riot","rip","ripen","riposte","ripple","rise","risk","ritualise","ritualize","rival","rivet","roam","roar","roast","rob","robe","rock","rocket","roger","roll","romance","romanticise","romanticize","romp","roof","room","roost","root","rope","rosin","roster","rot","rotate","rouge","rough","roughen","roughhouse","round","rouse","roust","rout","route","rove","row","rub","rubberneck","rubbish","ruck","rue","ruffle","ruin","ruins","rule","rumble","ruminate","rummage","rumor","rumour","rumple","run","rupture","rush","rust","rustle","sabotage","sack","sacrifice","sadden","saddle","safeguard","sag","sail","salaam","salivate","sally","salt","salute","salvage","salve","sample","sanctify","sanction","sand","sandbag","sandblast","sandpaper","sandwich","sanitise","sanitize","sap","sashay","sass","sate","satiate","satirise","satirize","satisfy","saturate","saunter","savage","save","savor","savour","saw","say","scald","scale","scallop","scalp","scamper","scan","scandalise","scandalize","scapegoat","scar","scare","scarf","scarify","scarper","scatter","scattering","scavenge","scent","schedule","schematise","schematize","scheme","schlep","schlepp","schmooze","school","schtup","schuss","scoff","scold","scoop","scoot","scope","scorch","score","scorn","scotch","scour","scourge","scout","scowl","scrabble","scram","scramble","scrap","scrape","scratch","scrawl","scream","screech","screen","screw","scribble","scrimp","script","scroll","scrounge","scrub","scrummage","scrunch","scruple","scrutinise","scrutinize","scud","scuff","scuffle","scull","sculpt","scupper","scurry","scuttle","scythe","seal","sealift","sear","search","season","seat","secede","seclude","second","secrete","section","secularise","secularize","secure","sedate","seduce","see","seed","seek","seep","seethe","segment","segregate","segue","seize","select","sell","sellotape","semaphore","send","sensationalise","sensationalize","sense","sensitise","sensitize","sentence","sentimentalise","sentimentalize","separate","sequence","sequester","sequestrate","serenade","serialise","serialize","sermonise","sermonize","serve","service","set","settle","sever","sew","sex","sexualise","sexualize","shack","shackle","shade","shadow","shaft","shag","shake","shalt","sham","shamble","shame","shampoo","shanghai","shape","share","sharpen","shatter","shave","shear","sheathe","shed","sheer","shell","shellac","shelter","shelve","shepherd","shield","shift","shimmer","shimmy","shin","shine","shinny","ship","shipwreck","shirk","shit","shiver","shock","shoe","shoehorn","shoo","shoot","shop","shoplift","shore","short","shorten","shortlist","shoulder","shout","shove","shovel","show","showboat","showcase","shower","shred","shriek","shrill","shrink","shrivel","shroom","shroud","shrug","shtup","shuck","shudder","shuffle","shun","shunt","shush","shut","shuttle","shy","sic","sick","sicken","side","sideline","sidestep","sideswipe","sidetrack","sidle","sieve","sift","sigh","sight","sightsee","sign","signal","signify","signpost","silence","silhouette","silt","silver","simmer","simper","simplify","simulate","simulcast","sin","sing","singe","single","sink","sip","siphon","sire","sit","site","situate","size","sizzle","skate","skateboard","skedaddle","sketch","skew","skewer","ski","skid","skim","skimp","skin","skip","skipper","skirmish","skirt","skitter","skive","skivvy","skulk","sky","skyjack","skyrocket","slack","slacken","slag","slake","slam","slander","slant","slap","slash","slate","slather","slaughter","slave","slaver","slay","sledge","sleek","sleep","sleepwalk","sleet","slew","slice","slick","slide","slight","slim","sling","slink","slip","slit","slither","slob","slobber","slog","slop","slope","slosh","slot","slouch","slough","slow","slug","sluice","slum","slumber","slump","slur","slurp","smack","smart","smarten","smash","smear","smell","smelt","smile","smirk","smite","smoke","smooch","smoodge","smooth","smother","smoulder","smudge","smuggle","snack","snaffle","snag","snaggle","snake","snap","snare","snarf","snarl","snatch","sneak","sneer","sneeze","snicker","sniff","sniffle","snigger","snip","snipe","snitch","snivel","snog","snooker","snoop","snooper","snooze","snore","snorkel","snort","snow","snowball","snowplough","snowplow","snub","snuff","snuffle","snuffling","snuggle","soak","soap","soar","sob","sober","socialise","socialize","sock","sod","sodomise","sodomize","soften","soil","sojourn","solace","solder","soldier","sole","solemnise","solemnize","solicit","solidify","soliloquize","solve","somersault","soothe","sorrow","sort","sough","sound","soundproof","soup","sour","source","souse","sow","space","span","spangle","spank","spar","spare","spark","sparkle","spatter","spattering","spawn","spay","speak","spear","spearhead","spec","specialise","specialize","specify","spectacles","spectate","speculate","speed","spell","spellcheck","spend","spew","spice","spiff","spike","spill","spin","spiral","spirit","spit","spite","splash","splatter","splay","splice","splinter","split","splosh","splurge","splutter","spoil","sponge","sponsor","spoof","spook","spool","spoon","sport","sports","spot","spotlight","spout","sprain","sprawl","spray","spread","spreadeagle","spring","springboard","sprinkle","sprint","spritz","sprout","spruce","spur","spurn","spurt","sputter","spy","squabble","squall","squander","square","squash","squat","squawk","squeak","squeal","squeeze","squelch","squint","squirm","squirrel","squirt","squish","stab","stabilise","stabilize","stable","stables","stack","staff","stage","stagger","stagnate","stain","stake","stalk","stall","stammer","stamp","stampede","stanch","stand","standardise","standardize","staple","star","starch","stare","start","startle","starve","stash","state","statement","station","staunch","stave","stay","steady","steal","steam","steamroller","steel","steep","steepen","steer","stem","stencil","step","stereotype","sterilise","sterilize","stew","stick","stickybeak","stiff","stiffen","stifle","stigmatise","stigmatize","still","stimulate","sting","stinger","stink","stint","stipple","stipulate","stir","stitch","stock","stockpile","stoke","stomach","stomp","stone","stonewall","stoop","stop","stopper","store","storm","storyboard","stow","straddle","strafe","straggle","straighten","strain","strand","strangle","strap","stratify","stravage","stravaig","stray","streak","stream","streamline","strengthen","stress","stretch","stretcher","strew","stride","strike","string","strip","strive","stroke","stroll","structure","struggle","strum","strut","stub","stud","study","stuff","stultify","stumble","stump","stun","stunt","stupefy","stutter","style","stymie","sub","subcontract","subdivide","subdue","subedit","subject","subjugate","sublet","sublimate","submerge","submit","subordinate","suborn","subpoena","subscribe","subside","subsidise","subsidize","subsist","substantiate","substitute","subsume","subtend","subtitle","subtract","subvert","succeed","succor","succour","succumb","suck","sucker","suckle","suction","sue","suffer","suffice","suffocate","suffuse","sugar","suggest","suit","sulk","sulks","sully","sum","summarise","summarize","summon","summons","sun","sunbathe","sunder","sunset","sup","superimpose","superintend","superpose","supersede","supersize","supersized","supervene","supervise","supplant","supplement","supply","support","suppose","suppress","suppurate","surcharge","surf","surface","surge","surmise","surmount","surpass","surprise","surrender","surround","survey","survive","suspect","suspend","suspenders","suss","sustain","suture","swab","swaddle","swagger","swallow","swamp","swan","swank","swap","swarm","swat","swath","swathe","sway","swear","sweat","sweep","sweeps","sweeten","swell","swelter","swerve","swig","swill","swim","swindle","swing","swipe","swirl","swish","switch","swivel","swoon","swoop","swoosh","swot","symbolise","symbolize","sympathise","sympathize","symptomize","synchronise","synchronize","syndicate","synthesise","synthesize","syringe","systematise","systematize","tab","table","tabulate","tack","tackle","tag","tail","tailgate","tailor","taint","take","talk","tally","tame","tamp","tamper","tan","tangle","tango","tank","tankful","tantalise","tantalize","tap","tape","taper","tar","target","tarmac","tarnish","tarry","tart","task","taste","tattle","tattoo","taunt","tauten","tax","taxi","taxicab","teach","team","tear","tease","tee","teem","teeter","teethe","telecast","telecommute","teleconference","telegraph","telemeter","teleoperate","telephone","teleport","telescope","televise","telex","tell","telnet","temp","temper","temporise","temporize","tempt","tenant","tend","tender","tenderise","tenderize","tense","tension","tergiversate","term","terminate","terraform","terrify","terrorise","terrorize","test","testify","tether","text","thank","thatch","thaw","theorise","theorize","thicken","thin","think","thirst","thrash","thread","threaten","thresh","thrill","thrive","throb","throbbing","throng","throttle","throw","thrust","thud","thumb","thump","thunder","thwack","thwart","tick","ticket","tickle","tide","tidy","tie","tighten","tile","till","tilt","time","timetable","tinge","tingle","tingling","tinker","tinkle","tinkling","tint","tip","tippex","tipple","tiptoe","tire","titillate","titivate","title","titrate","titter","toady","toast","toboggan","toddle","toe","tog","toggle","toil","toke","tolerate","toll","tone","tongue","tonify","tool","toot","tootle","top","topple","torch","torment","torpedo","torture","toss","tot","total","tote","totter","touch","tough","toughen","tour","tousle","tout","tow","towel","tower","toy","trace","track","trade","traduce","traffic","trail","train","traipse","trammel","tramp","trample","trampoline","tranquilize","tranquillize","transact","transcend","transcribe","transfer","transfigure","transfix","transform","transfuse","transgress","transit","translate","transliterate","transmit","transmogrify","transmute","transpire","transplant","transport","transpose","trap","trash","traumatise","traumatize","travel","traverse","trawl","tread","treasure","treat","treble","trek","tremble","trembling","trepan","trespass","trial","trick","trickle","trifle","trigger","trill","trim","trip","triple","triumph","trivialise","trivialize","troll","tromp","troop","trot","trouble","troubleshoot","trounce","trouser","truant","truck","trudge","trump","trumpet","truncate","trundle","truss","trust","try","tuck","tug","tugboat","tumble","tune","tunnel","turbocharge","turf","turn","tussle","tut","tutor","twang","tweak","tweet","twiddle","twig","twin","twine","twinkle","twirl","twist","twitch","twitter","twittering","type","typecast","typeset","typify","tyrannise","tyrannize","ulcerate","ululate","ump","umpire","unbalance","unban","unbend","unblock","unbuckle","unburden","unbutton","uncoil","uncork","uncouple","uncover","uncurl","undelete","underachieve","underbid","undercharge","undercook","undercut","underestimate","underestimation","underexpose","undergo","underlie","underline","undermine","underpay","underperform","underpin","underplay","underrate","underscore","undersell","undershoot","underspend","understand","understate","understudy","undertake","undervalue","underwrite","undo","undock","undress","undulate","unearth","unfasten","unfold","unfreeze","unfurl","unhand","unhinge","unhitch","unhook","unify","uninstall","unionise","unionize","unite","unlace","unlearn","unleash","unload","unlock","unloose","unloosen","unmask","unnerve","unpack","unpick","unplug","unravel","unroll","unsaddle","unscramble","unscrew","unseat","unsettle","unsubscribe","untangle","untie","unveil","unwind","unwrap","unzip","up","upbraid","upchange","upchuck","update","upend","upgrade","uphold","upholster","uplift","upload","uproot","upsell","upset","upshift","upskill","upstage","urge","urinate","use","usher","usurp","utilise","utilize","utter","vacate","vacation","vaccinate","vacillate","vacuum","valet","validate","value","vamoose","vandalise","vandalize","vanish","vanquish","vaporise","vaporize","varnish","vary","vault","veer","veg","vegetate","veil","vend","veneer","venerate","vent","ventilate","venture","verbalise","verbalize","verge","verify","versify","vest","vet","veto","vex","vibrate","victimise","victimize","vide","video","videotape","vie","view","viewing","vilify","vindicate","violate","visit","visualise","visualize","vitiate","vitrify","vocalize","voice","void","volley","volumise","volumize","volunteer","vomit","vote","vouch","vouchsafe","vow","voyage","vulgarise","vulgarize","wad","waddle","wade","waffle","waft","wag","wage","wager","waggle","wail","wait","waive","wake","wakeboard","waken","walk","wall","wallop","wallow","wallpaper","waltz","wander","wane","wangle","wank","want","warble","ward","warm","warn","warp","warrant","wash","wassail","waste","watch","water","waterproof","waterski","wave","waver","wax","waylay","weaken","wean","weaponise","weaponize","wear","weary","weasel","weather","weatherise","weatherize","weave","wed","wedge","wee","weed","weekend","weep","weigh","weight","weird","welch","welcome","weld","well","welly","welsh","wend","westernise","westernize","wet","whack","wheedle","wheel","wheeze","whelp","whet","whiff","while","whilst","whimper","whine","whinge","whinny","whip","whirl","whirr","whirring","whisk","whisper","whispering","whistle","whiten","whitewash","whittle","whiz","whizz","whoop","whoosh","whup","wick","widen","widow","wield","wig","wiggle","wildcat","will","wilt","wimp","win","wince","winch","wind","winds","windsurf","wine","wing","wink","winkle","winnow","winter","wipe","wire","wiretap","wise","wisecrack","wish","withdraw","wither","withhold","withstand","witness","witter","wobble","wolf","wonder","woo","woof","word","work","worm","worry","worsen","worship","worst","wound","wow","wowee","wrangle","wrap","wreak","wreathe","wreck","wrench","wrest","wrestle","wriggle","wring","wrinkle","writ","write","writhe","wrong","wrought","xerox","yack","yak","yank","yap","yaw","yawn","yearn","yell","yellow","yelp","yield","yodel","yoke","yomp","yowl","yuppify","zap","zero","zigzag","zing","zip","zone","zoom"];var zl=Object.freeze({adjective:Rs,adverb:Ps,conjunction:Ds,interjection:Us,noun:Ls,preposition:Ms,verb:zs}),Vs=zl;var Vl=Object.freeze({title:"English",syntax:As,time:_s,internet:js,person:Os,word:Vs}),X=Vl;var Ve=["male","female"],se=Symbol("randomValue"),ui=Symbol("typesValue"),Ie=Symbol("localeValue"),fr=class{[ui];[se];[Ie];constructor(e={}){this[ui]=new je(e.seed),this[se]=new ut(e.seed),this[Ie]=e.locale||X}seed(e){this[se].seed(e),this[ui].seed(e)}locale(e){this[Ie]=e||X}firstName(e){let{person:t}=this[Ie],i=e&&Ve.includes(e)?e:this[se].pickOne(Ve),r;t&&t.firstName&&t.firstName[i]?r=t.firstName:r=X.person.firstName;let a=r[i];return this[se].pickOne(a)}lastName(e){let{person:t}=this[Ie];if(!e){let s=t&&t.lastName||X.person.lastName;if(Array.isArray(s.general)&&s.general.length)return this[se].pickOne(s.general);throw new Error("The locale does not have a general last name pool.")}let i=e&&Ve.includes(e)?e:this[se].pickOne(Ve),r;t&&t.lastName&&t.lastName[i]?r=t.lastName:r=X.person.lastName;let a=r[i];return this[se].pickOne(a)}middleName(e){let{person:t}=this[Ie],i=t&&t.middleName||t&&t.firstName||X.person.firstName,r=e&&Ve.includes(e)?e:this[se].pickOne(Ve),a=i[r];return this[se].pickOne(a)}name(e={}){let{firstName:t,lastName:i,gender:r}=e,a=[];return this[ui].boolean({likelihood:10})&&a.push(this.prefix(r)),a.push(t||this.firstName(r)),a.push(i||this.lastName(r)),this[ui].boolean({likelihood:10})&&a.push(this.suffix(r)),a.join(" ")}gender(e){let{person:t}=this[Ie],i=t&&t.gender||X.person.gender;return e?this[se].pickOne(i.binary||X.person.gender.binary):this[se].pickOne(i.pool||X.person.gender.pool)}prefix(e){let{person:t}=this[Ie],i=t&&t.prefix||X.person.prefix;if(!e&&Array.isArray(i.general)&&i.general.length)return this[se].pickOne(i.general);let r=e&&Ve.includes(e)?e:this[se].pickOne(Ve),a=i[r]||X.person.prefix[r];return this[se].pickOne(a)}suffix(e){let{person:t}=this[Ie],i=t&&t.suffix||X.person.suffix;if(Array.isArray(i.general)&&i.general.length)return this[se].pickOne(i.general);let r=e&&Ve.includes(e)?e:this[se].pickOne(Ve),a=i[r]||X.person.suffix[r];return this[se].pickOne(a)}jobTitle(){let e=this.jobDescriptor(),t=this.jobArea(),i=this.jobType();return`${e} ${t} ${i}`}jobDescriptor(){let{person:e}=this[Ie],t;return e&&e.title&&e.title.descriptor?t=e.title:t=X.person.title,this[se].pickOne(t.descriptor)}jobArea(){let{person:e}=this[Ie],t;return e&&e.title&&e.title.level?t=e.title:t=X.person.title,this[se].pickOne(t.level)}jobType(){let{person:e}=this[Ie],t;return e&&e.title&&e.title.job?t=e.title:t=X.person.title,this[se].pickOne(t.job||[])}};var gr=Symbol("randomValue"),$e=Symbol("typesValue"),yr=Symbol("localeValue"),br=class{[$e];[gr];[yr];constructor(e={}){this[$e]=new je(e.seed),this[gr]=new ut(e.seed),this[yr]=e.locale||X}seed(e){this[gr].seed(e),this[$e].seed(e)}locale(e){this[yr]=e||X}word(e={}){let t={...e};if(typeof t.syllables=="number"&&typeof t.length=="number")throw new RangeError('Cannot specify both "syllables" and "length".');let i="";if(typeof t.length=="number"){do i+=this.syllable();while(i.length<t.length);i=i.substring(0,t.length)}else{let r=t.syllables||this[$e].number({min:1,max:3});for(let a=0;a<r;a++)i+=this.syllable()}return t.capitalize&&(i=this.capitalize(i)),i}capitalize(e){return e.charAt(0).toUpperCase()+e.substr(1)}words(e=3){return new Array(e).fill("").map(()=>this.word()).join(" ")}sentence(e={}){let t={...e},{words:i=this[$e].number({min:12,max:18})}=t,r=new Array(i).fill("").map(()=>this.word()).join(" ");r=this.capitalize(r);let{punctuation:a}=t;return a!==!1&&!/^[.?;!:]$/.test(String(a))&&(a="."),a&&(r+=a),r}sentences(e={}){let t={};typeof e=="number"?t.size=e:t={...e};let{size:i=this[$e].number({min:2,max:6})}=t;return new Array(i).fill("").map(()=>this.sentence()).join(" ")}slug(e){let t=this.words(e);return gs(t)}paragraph(e={}){let t={};typeof e=="number"?t.sentences=e:t={...e};let{lineBreak:i,sentences:r=this[$e].number({min:3,max:7})}=t;return new Array(r).fill("").map(()=>this.sentence()).join(i===!0?`\r
|
|
141
141
|
`:" ")}paragraphs(e={}){let t={};typeof e=="number"?t.size=e:t={...e};let{separator:i=`\r
|
|
142
|
-
`,size:r=this[$e].number({min:1,max:7})}=t;return new Array(r).fill("").map(()=>this.paragraph()).join(i)}syllable(e={}){let{syntax:t}=this[yr],i={...e},r=i.length||this[$e].number({min:2,max:3}),a=t&&t.consonants||X.syntax.consonants,s=t&&t.vowels||X.syntax.vowels,n=a+s,l="",c;for(let p=0;p<r;p++)p===0?c=this[$e].character({pool:n}):c&&s.includes(c)?c=this[$e].character({pool:a}):c=this[$e].character({pool:s}),l+=c;return i.capitalize&&(l=this.capitalize(l)),l}lorem(){let e=["word","words","sentence","sentences","paragraph","paragraphs"],t=this[gr].pickOne(e);return this[t]()}};var Te=Symbol("typesValue"),mi=Symbol("localeValue"),vt=class{[Te];[mi];constructor(e={}){this[Te]=new je(e.seed),this[mi]=e.locale||X}seed(e){this[Te].seed(e)}locale(e){this[mi]=e||X}date(e){return this[Te].datetime(e)}amPm(){return this[Te].boolean()?"am":"pm"}timestamp(e){return this[Te].datetime(e).getTime()}hour(e={}){let t={...e};if(typeof t.min!="number"&&(t.min=t.twentyFour?0:1),typeof t.max!="number"&&(t.max=t.twentyFour?23:12),t.min<0)throw new RangeError(`Provided value ${t.min} for min is less than 0.`);if(t.max>23&&t.twentyFour||t.max>12&&!t.twentyFour)throw new RangeError(`Provided value ${t.max} for max is greater than ${t.twentyFour?23:12}.`);if(t.min>t.max)throw new RangeError(`The min value (${t.min}) cannot be greater than max value (${t.max}).`);return this[Te].number({min:t.min,max:t.max})}minute(e={}){let{min:t=0,max:i=59}=e;if(t<0)throw new RangeError(`Provided value ${t} for min is less than 0.`);if(i>59)throw new RangeError(`Provided value ${i} for max is greater than 59.`);if(t>i)throw new RangeError(`The min value (${t}) cannot be greater than max value (${i}).`);return this[Te].number({min:t,max:i})}millisecond(){return this[Te].number({max:999})}second(){return this[Te].number({max:59})}month(e={}){let{min:t=1,max:i=12}=e;if(t<1)throw new RangeError(`Provided value ${t} for min is less than 1.`);if(i>12)throw new RangeError(`Provided value ${i} for max is greater than 12.`);if(t>i)throw new RangeError(`The min value (${t}) cannot be greater than max value (${i}).`);return this[Te].number({min:t,max:i})}monthName(e={}){let t=this.month(e);return this.months(e.abbr)[t-1]}months(e=!1){let{time:t}=this[mi],i;return t&&t.month&&t.month.abbr&&t.month.abbr.length>0?i=t.month:i=X.time.month,e?i.abbr:i.names}weekdays(e=!1){let{time:t}=this[mi],i;return t&&t.weekday&&t.weekday.abbr&&t.weekday.abbr.length>0?i=t.weekday:i=X.time.weekday,e?i.abbr:i.names}weekday(e={}){let{min:t=1,max:i=7}=e;if(t<1)throw new RangeError(`Provided value ${t} for min is less than 1.`);if(i>7)throw new RangeError(`Provided value ${i} for max is greater than 7.`);if(t>i)throw new RangeError(`The min value (${t}) cannot be greater than max value (${i}).`);return this[Te].number({min:t,max:i})}weekdayName(e={}){let t=this.weekday(e);return this.weekdays(e.abbr)[t-1]}midnight(e=Date.now()){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}dateOnly(e){let t=this.date(e),i=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0");return`${i}-${r}-${a}`}timeOnly(e){let t=this.date(e),i=t.getHours().toString().padStart(2,"0"),r=t.getMinutes().toString().padStart(2,"0"),a=t.getSeconds().toString().padStart(2,"0");return`${i}:${r}:${a}`}dateTime(e="rfc3339",t){let i=this.date(t);if(e==="rfc2616")return i.toUTCString();if(e==="rfc3339"){let r=i.getUTCFullYear(),a=(i.getUTCMonth()+1).toString().padStart(2,"0"),s=i.getUTCDate().toString().padStart(2,"0"),n=i.getUTCHours().toString().padStart(2,"0"),l=i.getUTCMinutes().toString().padStart(2,"0"),c=i.getUTCSeconds().toString().padStart(2,"0"),p=i.getUTCMilliseconds().toString().padStart(3,"0");return`${r}-${a}-${s}T${n}:${l}:${c}.${p}Z`}return""}dateTimeOnly(e){let t=this.date(e),i=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0"),s=t.getHours().toString().padStart(2,"0"),n=t.getMinutes().toString().padStart(2,"0"),l=t.getSeconds().toString().padStart(2,"0");return`${i}-${r}-${a}T${s}:${n}:${l}`}};var A;(function(o){o[o.ROOT=0]="ROOT",o[o.GROUP=1]="GROUP",o[o.POSITION=2]="POSITION",o[o.SET=3]="SET",o[o.RANGE=4]="RANGE",o[o.REPETITION=5]="REPETITION",o[o.REFERENCE=6]="REFERENCE",o[o.CHAR=7]="CHAR"})(A||(A={}));var Vl=()=>({type:A.POSITION,value:"b"}),Fl=()=>({type:A.POSITION,value:"B"}),Kl=()=>({type:A.POSITION,value:"^"}),ql=()=>({type:A.POSITION,value:"$"}),ba=()=>[{type:A.RANGE,from:48,to:57}],Fs=()=>[{type:A.CHAR,value:95},{type:A.RANGE,from:97,to:122},{type:A.RANGE,from:65,to:90},...ba()],Ks=()=>[{type:A.CHAR,value:9},{type:A.CHAR,value:10},{type:A.CHAR,value:11},{type:A.CHAR,value:12},{type:A.CHAR,value:13},{type:A.CHAR,value:32},{type:A.CHAR,value:160},{type:A.CHAR,value:5760},{type:A.CHAR,value:6158},{type:A.CHAR,value:8192},{type:A.CHAR,value:8193},{type:A.CHAR,value:8194},{type:A.CHAR,value:8195},{type:A.CHAR,value:8196},{type:A.CHAR,value:8197},{type:A.CHAR,value:8198},{type:A.CHAR,value:8199},{type:A.CHAR,value:8200},{type:A.CHAR,value:8201},{type:A.CHAR,value:8202},{type:A.CHAR,value:8232},{type:A.CHAR,value:8233},{type:A.CHAR,value:8239},{type:A.CHAR,value:8287},{type:A.CHAR,value:12288},{type:A.CHAR,value:65279}],Jl=()=>[{type:A.CHAR,value:10},{type:A.CHAR,value:13},{type:A.CHAR,value:8232},{type:A.CHAR,value:8233}],qs=()=>({type:A.SET,set:Fs(),not:!1}),Js=()=>({type:A.SET,set:Fs(),not:!0}),Gs=()=>({type:A.SET,set:ba(),not:!1}),Bs=()=>({type:A.SET,set:ba(),not:!0}),Hs=()=>({type:A.SET,set:Ks(),not:!1}),Ws=()=>({type:A.SET,set:Ks(),not:!0}),Gl=()=>({type:A.SET,set:Jl(),not:!0}),Bl={0:0,t:9,n:10,v:11,f:12,r:13},Hl=o=>{let e=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return o.replace(e,(t,i,r,a,s,n,l,c)=>{if(r)return t;let p=i?8:a?parseInt(a,16):s?parseInt(s,16):n?parseInt(n,8):l?"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?".indexOf(l):Bl[c],u=String.fromCharCode(p);return/[[{}^$.|?*+()]/.test(u)&&(u=`\\${u}`),u})},Wl=(o,e)=>{let t=[],i=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?(.)/g,r,a;for(;(r=i.exec(o))!==null;)if(r[1])t.push(qs());else if(r[2])t.push(Gs());else if(r[3])t.push(Hs());else if(r[4])t.push(Js());else if(r[5])t.push(Bs());else if(r[6])t.push(Ws());else if(r[7])t.push({type:A.RANGE,from:(r[8]||r[9]).charCodeAt(0),to:r[10].charCodeAt(0)});else if(a=r[12])t.push({type:A.CHAR,value:a.charCodeAt(0)});else return[t,i.lastIndex];throw new SyntaxError(`Invalid regular expression: /${e}/: Unterminated character class`)},wr=(o,e)=>{throw new SyntaxError(`Invalid regular expression: /${o}/: ${e}`)},Ys=o=>{let e=0,t={type:A.ROOT,stack:[]},i=t,r=t.stack,a=[],s=l=>wr(o,`Nothing to repeat at column ${l-1}`),n=Hl(o);for(;e<n.length;){let l=n[e++];switch(l){case"\\":switch(l=n[e++],l){case"b":r.push(Vl());break;case"B":r.push(Fl());break;case"w":r.push(qs());break;case"W":r.push(Js());break;case"d":r.push(Gs());break;case"D":r.push(Bs());break;case"s":r.push(Hs());break;case"S":r.push(Ws());break;default:/\d/.test(l)?r.push({type:A.REFERENCE,value:parseInt(l,10)}):r.push({type:A.CHAR,value:l.charCodeAt(0)})}break;case"^":r.push(Kl());break;case"$":r.push(ql());break;case"[":{let c=!1;n[e]==="^"&&(c=!0,e++);let[p,u]=Wl(n.slice(e),o);e+=u,r.push({type:A.SET,set:p,not:c});break}case".":r.push(Gl());break;case"(":{let c={type:A.GROUP,stack:[],remember:!0};n[e]==="?"&&(l=n[e+1],e+=2,l==="="?c.followedBy=!0:l==="!"?c.notFollowedBy=!0:l!==":"&&wr(o,`Invalid group, character '${l}' after '?' at column ${e-1}`),c.remember=!1),r.push(c),a.push(i),i=c,r=c.stack;break}case")":a.length===0&&wr(o,`Unmatched ) at column ${e-1}`),i=a.pop(),r=i.options?i.options[i.options.length-1]:i.stack;break;case"|":i.options||(i.options=[i.stack],delete i.stack);{let c=[];i.options.push(c),r=c}break;case"{":{let c=/^(\d+)(,(\d+)?)?\}/.exec(n.slice(e));if(c){r.length===0&&s(e);let p=parseInt(c[1],10),u=c[2]?c[3]?parseInt(c[3],10):1/0:p;e+=c[0].length,r.push({type:A.REPETITION,min:p,max:u,value:r.pop()})}else r.push({type:A.CHAR,value:123});break}case"?":r.length===0&&s(e),r.push({type:A.REPETITION,min:0,max:1,value:r.pop()});break;case"+":r.length===0&&s(e),r.push({type:A.REPETITION,min:1,max:1/0,value:r.pop()});break;case"*":r.length===0&&s(e),r.push({type:A.REPETITION,min:0,max:1/0,value:r.pop()});break;default:r.push({type:A.CHAR,value:l.charCodeAt(0)})}}return a.length!==0&&wr(o,"Unterminated group"),t};var hi=class o{types;constructor(e={}){this.types=new je(e.seed)}seed(e){this.types.seed(e)}fromPattern(e,t={}){let i,r;e instanceof globalThis.RegExp?(r=e.ignoreCase,i=e.source):(r=t.flags?.includes("i")??!1,i=e);let a=10;typeof t.max=="number"&&(a=t.max);let s=Ys(i),n=Array.from({length:95},(l,c)=>c+32);return this._gen(s,[],r,n,a)}_gen(e,t,i,r,a){let s,n,l,c;switch(e.type){case A.ROOT:case A.GROUP:if(e.followedBy||e.notFollowedBy)return"";for(e.remember&&e.groupNumber===void 0&&(e.groupNumber=t.push(null)-1),s=e.options?this._choice(e.options):e.stack,n="",l=0,c=s.length;l<c;l++)n+=this._gen(s[l],t,i,r,a);return e.remember&&(t[e.groupNumber]=n),n;case A.POSITION:return"";case A.SET:{let p=this._processSet(e,i,r);return p.length?String.fromCharCode(this._choice(p)):""}case A.REPETITION:{let p=e.max===1/0?Math.max(e.min,a):e.max,u=this.types.number({min:e.min,max:p});for(n="",l=0;l<u;l++)n+=this._gen(e.value,t,i,r,a);return n}case A.REFERENCE:return t[e.value-1]||"";case A.CHAR:{let p=i&&this._coin()?o._toCaseInverse(e.value):e.value;return String.fromCharCode(p)}}return""}_processSet(e,t,i){if(e.type===A.CHAR)return[e.value];if(e.type===A.RANGE){let a=[];for(let s=e.from;s<=e.to;s++)a.push(s);return a}let r=new Set;for(let a of e.set){let s=this._processSet(a,t,i);if(s.forEach(n=>r.add(n)),t)for(let n of s){let l=n,c=o._toCaseInverse(l);l!==c&&r.add(c)}}return e.not?i.filter(a=>!r.has(a)):Array.from(r)}static _toCaseInverse(e){return e>=97&&e<=122?e-32:e>=65&&e<=90?e+32:e}_coin(){return this.types.number({min:0,max:1})===0}_choice(e){return e[this.types.number({min:0,max:e.length-1})]}};var ut=class o{static types=new je;static person=new fr;static lorem=new br;static regExp=new hi;static readInputValue(e,t,i={}){let{required:r}=e,{defaultValueStr:a,values:s}=t;if(!(!r&&i.requiredOnly===!0)){if(a)return o.readTypedValue(a,t.dataType);if(Array.isArray(s)&&s.length){let n=s[0];return o.readTypedValue(n.value,n.dataType)}if(i.fromExamples){let n;if(Array.isArray(e.examples)&&e.examples.length?n=e.examples.filter(l=>typeof l!="string"):Array.isArray(t.examples)&&t.examples.length&&(n=t.examples),n&&n.length)return o.inputValueFromExamples(n)}return o.generateDefaultValue(t)}}static readInputValues(e,t,i={}){if(!e.required&&i.requiredOnly===!0)return[];let{defaultValue:r}=t;if(r){let n=new xe().processNode(r);if(Array.isArray(n))return n}let a=t;if(i.fromExamples){let s;return Array.isArray(e.examples)&&e.examples.length?s=e.examples.filter(n=>typeof n!="string"):Array.isArray(a.examples)&&a.examples.length&&(s=a.examples),o.arrayValuesFromExamples(s)}return[]}static inputValueFromExamples(e){if(!Array.isArray(e)||!e.length)return;let[t]=e,{structuredValue:i}=t;if(i&&i.types.includes(d.aml.vocabularies.data.Scalar)){let r=i;return o.readTypedValue(r.value,r.dataType)}}static arrayValuesFromExamples(e){let t=[];if(!Array.isArray(e)||!e.length)return t;let[i]=e;if(!i.structuredValue||!i.structuredValue.types.includes(d.aml.vocabularies.data.Array))return t;let r=i.structuredValue,{members:a}=r;return!Array.isArray(a)||!a.length||a.forEach(s=>{let n=s;if(!n.value)return;let l=o.readTypedValue(n.value,n.dataType);typeof r<"u"&&r!==null&&t.push(l)}),t}static generateDefaultValue(e){let{dataType:t}=e;return this.defaultValue(t)}static generateMockedValue(e){let{dataType:t}=e;switch(t){case d.w3.xmlSchema.string:return this.generateStringValue(e);case d.w3.xmlSchema.number:case d.w3.xmlSchema.integer:case d.w3.xmlSchema.float:case d.w3.xmlSchema.long:case d.w3.xmlSchema.double:case d.aml.vocabularies.shapes.number:case d.aml.vocabularies.shapes.integer:case d.aml.vocabularies.shapes.float:case d.aml.vocabularies.shapes.long:case d.aml.vocabularies.shapes.double:return this.generateNumberValue(e);case d.aml.vocabularies.shapes.boolean:case d.w3.xmlSchema.boolean:return this.types.boolean();case d.aml.vocabularies.shapes.nil:case d.w3.xmlSchema.nil:return null;case d.w3.xmlSchema.date:return new vt().dateOnly();case d.w3.xmlSchema.dateTime:return new vt().dateTime(e.format==="date-time"?"rfc3339":e.format);case d.aml.vocabularies.shapes.dateTimeOnly:return new vt().dateTimeOnly();case d.w3.xmlSchema.time:return new vt().timeOnly();default:return}}static defaultValue(e){switch(e){case d.w3.xmlSchema.string:return"";case d.w3.xmlSchema.number:case d.w3.xmlSchema.integer:case d.w3.xmlSchema.float:case d.w3.xmlSchema.long:case d.w3.xmlSchema.double:case d.aml.vocabularies.shapes.number:case d.aml.vocabularies.shapes.integer:case d.aml.vocabularies.shapes.float:case d.aml.vocabularies.shapes.long:case d.aml.vocabularies.shapes.double:return 0;case d.aml.vocabularies.shapes.boolean:case d.w3.xmlSchema.boolean:return!1;case d.aml.vocabularies.shapes.nil:case d.w3.xmlSchema.nil:return null;case d.w3.xmlSchema.date:return"";case d.w3.xmlSchema.dateTime:return"";case d.aml.vocabularies.shapes.dateTimeOnly:return"";case d.w3.xmlSchema.time:return"";default:return}}static generateNumberValue(e){let{minimum:t,maximum:i,format:r,multipleOf:a}=e,s={};typeof t=="number"&&(s.min=t),typeof i=="number"&&(s.max=i);let n;return r&&["float","double"].includes(r)?n=this.types.float.bind(this.types):r&&["uint32","uint64","fixed32","fixed64"].includes(r)&&(s.min=0,s.max&&s.max<0&&delete s.max),n||(n=this.types.number.bind(this.types)),typeof a=="number"&&(s.precision=a),n(s)}static generateStringValue(e){let{minLength:t,maxLength:i,name:r="",format:a,pattern:s}=e;if(s)return new hi().fromPattern(s,{max:10});let n=r.toLowerCase();if(n==="description")return this.lorem.paragraph();if(a==="uuid")return this.types.uuid();if(n==="id"){let p={length:12},u=typeof t=="number";return u?p.length=t:!u&&typeof i=="number"&&(p.length=i),this.types.hash(p)}if(["name","fullname"].includes(n))return this.person.name();if(n==="firstname")return this.person.firstName();if(n==="lastname")return this.person.lastName();let l={},c=typeof t=="number";return c?l.length=t:!c&&typeof i=="number"&&(l.length=i),this.lorem.word(l)}static readTypedValue(e,t){return or(e,t)}static readInputType(e){switch(e){case d.aml.vocabularies.shapes.number:case d.aml.vocabularies.shapes.integer:case d.aml.vocabularies.shapes.float:case d.aml.vocabularies.shapes.long:case d.aml.vocabularies.shapes.double:case d.w3.xmlSchema.number:case d.w3.xmlSchema.integer:case d.w3.xmlSchema.float:case d.w3.xmlSchema.long:case d.w3.xmlSchema.double:return"number";case d.w3.xmlSchema.date:return"date";case d.w3.xmlSchema.time:return"time";case d.w3.xmlSchema.dateTime:case d.aml.vocabularies.shapes.dateTimeOnly:return"datetime-local";case d.aml.vocabularies.shapes.boolean:case d.w3.xmlSchema.boolean:return"boolean";default:return"text"}}static parseNumberInput(e,t){return Zr(e,t)}static parseBooleanInput(e,t){return Qr(e,t)}static parseDateOnlyInput(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return;let i=t.toJSON(),r=i.indexOf("T");return i.substring(0,r)}static parseTimeOnlyInput(e){let t=String(e).trim();if(/^\d\d:\d\d$/.test(t))return`${t}:00`;if(/^\d\d:\d\d:\d\d$/.test(t))return t}static parseDateTimeInput(e,t="rfc3339"){let i=new Date(e);if(!Number.isNaN(i.getTime())){if(t==="rfc2616")return i.toUTCString();if(["rfc3339","date-time"].includes(t))return i.toISOString()}}static parseDateTimeOnlyInput(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return;let i=t.toJSON(),r=i.indexOf(".");return i.substring(0,r)}static parseArrayInput(e,t){let{items:i}=t;return i?o.parseUserInput(e,i):String(e)}static parseUserInput(e,t){if(!t||e===void 0||e===null)return e;let{types:i}=t;return i.includes(d.aml.vocabularies.shapes.ScalarShape)?o.parseScalarInput(e,t):i.includes(d.aml.vocabularies.shapes.ArrayShape)||i.includes(d.aml.vocabularies.shapes.MatrixShape)?o.parseArrayInput(e,t):e}static parseScalarInput(e,t){return this.parseScalar(e,t.dataType,t.format)}static parseScalar(e,t,i){switch(t){case d.aml.vocabularies.shapes.number:case d.aml.vocabularies.shapes.integer:case d.aml.vocabularies.shapes.float:case d.aml.vocabularies.shapes.long:case d.aml.vocabularies.shapes.double:case d.w3.xmlSchema.number:case d.w3.xmlSchema.integer:case d.w3.xmlSchema.float:case d.w3.xmlSchema.long:case d.w3.xmlSchema.double:return o.parseNumberInput(e);case d.aml.vocabularies.shapes.boolean:case d.w3.xmlSchema.boolean:return o.parseBooleanInput(e);case d.w3.xmlSchema.date:return o.parseDateOnlyInput(e);case d.w3.xmlSchema.time:return o.parseTimeOnlyInput(e);case d.w3.xmlSchema.dateTime:return o.parseDateTimeInput(e,i);case d.aml.vocabularies.shapes.dateTimeOnly:return o.parseDateTimeOnlyInput(e);default:return String(e)}}};var kt=class{opts;constructor(e={}){this.opts=Object.freeze({...e})}_scalarValue(e){let{defaultValue:t,examples:i,values:r,inherits:a,dataType:s}=e;if(this.opts.renderExamples&&i&&i.length){let n=i.find(c=>!!c.structuredValue),l=this._exampleToObject(n);if(typeof l<"u")return ut.readTypedValue(l,s)}if(t)return new xe().processNode(t);if(r&&r.length){let n=r[0];if(n.value!==void 0)return ut.readTypedValue(n.value,s)}if(Array.isArray(a)&&a.length)for(let n=0,l=a.length;n<l;n+=1){let c=this._scalarValue(a[n]);if(c!==void 0)return c}return this.opts.renderMocked?ut.generateMockedValue(e):ut.generateDefaultValue(e)}_isNotRequiredUnion(e){let t=0,i=!1;return e.forEach(r=>{r.types.includes(d.aml.vocabularies.shapes.NilShape)?i=!0:r.types.includes(d.aml.vocabularies.shapes.ScalarShape)?r.dataType===d.w3.xmlSchema.nil?i=!0:t+=1:r.types.includes(d.aml.vocabularies.shapes.FileShape)&&(t+=1)}),i?t===e.length-1:!1}};var fi=class extends kt{generate(e){let t;return e.types.includes(d.w3.shacl.PropertyShape)?t=this._propertyShapeObject(e):t=this.toObject(e),t!==null&&typeof t=="object"?this.serialize(t):t}toObject(e){let{types:t}=e;return t.includes(d.aml.vocabularies.shapes.ScalarShape)?this._scalarShapeObject(e):t.includes(d.w3.shacl.NodeShape)?this._nodeShapeObject(e):t.includes(d.aml.vocabularies.shapes.UnionShape)?this._unionShapeObject(e):t.includes(d.aml.vocabularies.shapes.FileShape)?this._fileShapeObject():t.includes(d.aml.vocabularies.shapes.SchemaShape)?this._schemaShapeObject():t.includes(d.aml.vocabularies.shapes.TupleShape)?this._tupleShapeObject(e):t.includes(d.aml.vocabularies.shapes.ArrayShape)||t.includes(d.aml.vocabularies.shapes.MatrixShape)?this._arrayShapeObject(e):this._anyShapeObject(e)}serialize(e){return JSON.stringify(e,null,2)}_scalarShapeObject(e){return this._scalarValue(e)}_nilShapeObject(){}_nodeShapeObject(e){let{inherits:t}=e,{examples:i=[]}=e;if(Array.isArray(t)&&t.length&&t.forEach(s=>{let n=s;Array.isArray(n.examples)&&n.examples.length&&(i=i.concat(n.examples))}),this.opts.renderExamples&&i.length){let s=i.find(l=>!!l.structuredValue),n=this._exampleToObject(s);if(n!==void 0)return n}let r={},{properties:a}=e;return Array.isArray(t)&&t.length&&t.forEach(s=>{let n=this.toObject(s);typeof n=="object"&&(r={...r,...n})}),a.forEach(s=>{let{name:n}=s,l=this._propertyShapeObject(s);typeof l<"u"&&n&&(r[n]=l)}),r}_unionShapeObject(e){return e.and&&e.and.length?this._allOfUnion(e):e.xone&&e.xone.length?this._oneOfUnion(e):this._anyOfUnion(e)}_anyOfUnion(e){let{anyOf:t=[],examples:i=[]}=e;Array.isArray(e.inherits)&&e.inherits&&e.inherits.forEach(n=>{let l=n;Array.isArray(l.examples)&&l.examples.length&&(i=i.concat(l.examples));let c=n;Array.isArray(c.anyOf)&&c.anyOf.length&&(t=t.concat(c.anyOf))});let{opts:r}=this;if(this._isNotRequiredUnion(t))return;if(this.opts.renderExamples){let n=i.find(c=>!!c.structuredValue),l=this._exampleToObject(n);if(l!==void 0)return l}if(e.defaultValue)return this._unionDefaultValue(t,e.defaultValue);let{selectedUnions:a}=r,s;if(a&&a.length?s=t.find(n=>a.includes(n.id)):[s]=t,s)return this.toObject(s)}_oneOfUnion(e){let{examples:t=[]}=e,{xone:i=[]}=e;Array.isArray(e.inherits)&&e.inherits&&e.inherits.forEach(n=>{let l=n;Array.isArray(l.examples)&&l.examples.length&&(t=t.concat(l.examples))});let{opts:r}=this;if(this.opts.renderExamples){let n=t.find(c=>!!c.structuredValue),l=this._exampleToObject(n);if(l!==void 0)return l}if(e.defaultValue)return this._unionDefaultValue(i,e.defaultValue);let{selectedUnions:a}=r,s;if(a&&a.length?s=i.find(n=>a.includes(n.id)):[s]=i,s)return this.toObject(s)}_allOfUnion(e){let{examples:t=[]}=e,{and:i=[]}=e;if(Array.isArray(e.inherits)&&e.inherits&&e.inherits.forEach(a=>{let s=a;Array.isArray(s.examples)&&s.examples.length&&(t=t.concat(s.examples))}),this.opts.renderExamples){let a=t.find(n=>!!n.structuredValue),s=this._exampleToObject(a);if(s!==void 0)return s}let r={};return i.forEach(a=>{let s=this.toObject(a);typeof s=="object"&&(r={...r,...s})}),r}_unionDefaultValue(e,t){let r=new xe().generate(t),a=!1,s=!1,n=!1;if(e.forEach(l=>{if(l.types.includes(d.aml.vocabularies.shapes.NilShape)&&(n=!0),!l.types.includes(d.aml.vocabularies.shapes.ScalarShape))return;let c=l;s||(s=c.dataType===d.w3.xmlSchema.boolean),a||(a=[d.w3.xmlSchema.number,d.w3.xmlSchema.long,d.w3.xmlSchema.integer,d.w3.xmlSchema.float,d.w3.xmlSchema.double,d.aml.vocabularies.shapes.number,d.aml.vocabularies.shapes.long,d.aml.vocabularies.shapes.integer,d.aml.vocabularies.shapes.float,d.aml.vocabularies.shapes.double].includes(c.dataType)),n||(n=c.dataType===d.w3.xmlSchema.nil)}),a){let l=Number(r);if(!Number.isNaN(l))return l}if(s){if(r==="true")return!0;if(r==="false")return!1}return n&&(r==="null"||r==="nil")?null:r}_arrayShapeObject(e){let{items:t}=e,i=e.defaultValue||t&&t.defaultValue,{examples:r=[]}=e,a=t;if(Array.isArray(a.examples)&&(r=r.concat(a.examples)),this.opts.renderExamples&&r&&r.length){let s=r.find(l=>!!l.structuredValue),n=this._exampleToObject(s);if(Array.isArray(n))return n;if(typeof n<"u")return[n]}if(i){let n=new xe().processNode(i);if(Array.isArray(n))return n;if(n)return[n]}if(t){let s=this.toObject(t);if(typeof s<"u")return[s]}return[]}_tupleShapeObject(e){let{items:t,examples:i}=e;if(this.opts.renderExamples&&i&&i.length){let r=i.find(s=>!!s.structuredValue),a=this._exampleToObject(r);if(typeof a<"u")return[a]}if(e.defaultValue){let a=new xe().processNode(e.defaultValue);if(Array.isArray(a))return a}if(t.length){let r=[];return t.forEach(a=>{let s=this.toObject(a);typeof s<"u"&&r.push(s)}),r}return[]}_anyShapeObject(e){let{and:t=[],xone:i=[],or:r=[]}=e;if(t.length){let a={};return t.forEach(s=>{let n=this.toObject(s);typeof n=="object"&&(a={...a,...n})}),a}if(i.length){let{selectedUnions:a=[]}=this.opts,s=i.find(n=>a.includes(n.id));return s||(s=i[0]),this.toObject(s)}if(r.length){let{selectedUnions:a=[]}=this.opts,s=r.find(n=>a.includes(n.id));return s||(s=r[0]),this.toObject(s)}return this._scalarShapeObject(e)}_propertyShapeObject(e){let{minCount:t=0}=e;if(t===0&&!this.opts.renderOptional)return;let{range:i}=e;if(!i)return;let{types:r}=i;if(r.includes(d.aml.vocabularies.shapes.ScalarShape)){let a=i;return this._scalarShapeObject(a)}return this.toObject(i)}_exampleToObject(e){if(e&&e.structuredValue)return new xe().processNode(e.structuredValue)}_fileShapeObject(){}_schemaShapeObject(){}};var ve=o=>o.replace(/[^a-zA-Z0-9-_.]/g,""),wa="unknown-type";function Ke(o){let{name:e,inherits:t=[],xmlSerialization:i}=o,r=i&&i.name?i.name:e||wa;if(r==="schema"&&t.length){let a=t.find(s=>s.name&&s.name!=="schema");a&&(r=a.name==="type"&&a.displayName||a.name)}return ve(String(r))}var gi=class extends kt{generate(e){let t;return e.types.includes(d.w3.shacl.PropertyShape)?t=this._propertyShapeObject(e):t=this.processNode(e,{},!0),t}processNode(e,t={},i=!1){let{types:r}=e;return r.includes(d.aml.vocabularies.shapes.ScalarShape)?this._scalarShapeObject(e,t):r.includes(d.w3.shacl.NodeShape)?this._nodeShapeObject(e,t):r.includes(d.aml.vocabularies.shapes.UnionShape)?this._unionShapeObject(e):r.includes(d.aml.vocabularies.shapes.FileShape)?this._fileShapeObject():r.includes(d.aml.vocabularies.shapes.SchemaShape)?this._schemaShapeObject():r.includes(d.aml.vocabularies.shapes.TupleShape)?this._tupleShapeObject():r.includes(d.aml.vocabularies.shapes.ArrayShape)||r.includes(d.aml.vocabularies.shapes.MatrixShape)?this._arrayShapeObject(e,t,i):this._anyShapeObject(e)}serialize(e){return e}_readCurrentUnion(e){let{selectedUnions:t}=this.opts;return ea(e,t)}_collectProperties(e){let{selectedUnions:t}=this.opts;return lr(e,t)}_nodeShapeObject(e,t={}){let i=t.forceName||Ke(e),r=[],a=t.indent||0,s=this._collectExamples(e,{tagFill:new Array(a*2+0).fill(" ").join(""),indent:a+1,nodeName:i});if(s)return s;let n=[];if(this._collectProperties(e).forEach(u=>{let{range:m,minCount:g=0}=u;if(g===0&&!this.opts.renderOptional||!m)return;let f=m;if(f.xmlSerialization&&f.xmlSerialization.attribute&&f.types.includes(d.aml.vocabularies.shapes.ScalarShape)){let v=ve(f.xmlSerialization.name?f.xmlSerialization.name:u.name||f.name||wa);f.xmlSerialization.prefix&&(v=`${f.xmlSerialization.prefix}:${v}`);let S=this._scalarValue(f);n.push(`${v}="${S}"`);return}let b=this._propertyShapeObject(u,{indent:a});if(typeof b<"u"){let v=t.noWrap?0:2,S=new Array(a*2+v).fill(" ").join("");r.push(nr(S,b))}}),t.noWrap)return r.join(`
|
|
142
|
+
`,size:r=this[$e].number({min:1,max:7})}=t;return new Array(r).fill("").map(()=>this.paragraph()).join(i)}syllable(e={}){let{syntax:t}=this[yr],i={...e},r=i.length||this[$e].number({min:2,max:3}),a=t&&t.consonants||X.syntax.consonants,s=t&&t.vowels||X.syntax.vowels,n=a+s,l="",c;for(let p=0;p<r;p++)p===0?c=this[$e].character({pool:n}):c&&s.includes(c)?c=this[$e].character({pool:a}):c=this[$e].character({pool:s}),l+=c;return i.capitalize&&(l=this.capitalize(l)),l}lorem(){let e=["word","words","sentence","sentences","paragraph","paragraphs"],t=this[gr].pickOne(e);return this[t]()}};var Te=Symbol("typesValue"),mi=Symbol("localeValue"),kt=class{[Te];[mi];constructor(e={}){this[Te]=new je(e.seed),this[mi]=e.locale||X}seed(e){this[Te].seed(e)}locale(e){this[mi]=e||X}date(e){return this[Te].datetime(e)}amPm(){return this[Te].boolean()?"am":"pm"}timestamp(e){return this[Te].datetime(e).getTime()}hour(e={}){let t={...e};if(typeof t.min!="number"&&(t.min=t.twentyFour?0:1),typeof t.max!="number"&&(t.max=t.twentyFour?23:12),t.min<0)throw new RangeError(`Provided value ${t.min} for min is less than 0.`);if(t.max>23&&t.twentyFour||t.max>12&&!t.twentyFour)throw new RangeError(`Provided value ${t.max} for max is greater than ${t.twentyFour?23:12}.`);if(t.min>t.max)throw new RangeError(`The min value (${t.min}) cannot be greater than max value (${t.max}).`);return this[Te].number({min:t.min,max:t.max})}minute(e={}){let{min:t=0,max:i=59}=e;if(t<0)throw new RangeError(`Provided value ${t} for min is less than 0.`);if(i>59)throw new RangeError(`Provided value ${i} for max is greater than 59.`);if(t>i)throw new RangeError(`The min value (${t}) cannot be greater than max value (${i}).`);return this[Te].number({min:t,max:i})}millisecond(){return this[Te].number({max:999})}second(){return this[Te].number({max:59})}month(e={}){let{min:t=1,max:i=12}=e;if(t<1)throw new RangeError(`Provided value ${t} for min is less than 1.`);if(i>12)throw new RangeError(`Provided value ${i} for max is greater than 12.`);if(t>i)throw new RangeError(`The min value (${t}) cannot be greater than max value (${i}).`);return this[Te].number({min:t,max:i})}monthName(e={}){let t=this.month(e);return this.months(e.abbr)[t-1]}months(e=!1){let{time:t}=this[mi],i;return t&&t.month&&t.month.abbr&&t.month.abbr.length>0?i=t.month:i=X.time.month,e?i.abbr:i.names}weekdays(e=!1){let{time:t}=this[mi],i;return t&&t.weekday&&t.weekday.abbr&&t.weekday.abbr.length>0?i=t.weekday:i=X.time.weekday,e?i.abbr:i.names}weekday(e={}){let{min:t=1,max:i=7}=e;if(t<1)throw new RangeError(`Provided value ${t} for min is less than 1.`);if(i>7)throw new RangeError(`Provided value ${i} for max is greater than 7.`);if(t>i)throw new RangeError(`The min value (${t}) cannot be greater than max value (${i}).`);return this[Te].number({min:t,max:i})}weekdayName(e={}){let t=this.weekday(e);return this.weekdays(e.abbr)[t-1]}midnight(e=Date.now()){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}dateOnly(e){let t=this.date(e),i=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0");return`${i}-${r}-${a}`}timeOnly(e){let t=this.date(e),i=t.getHours().toString().padStart(2,"0"),r=t.getMinutes().toString().padStart(2,"0"),a=t.getSeconds().toString().padStart(2,"0");return`${i}:${r}:${a}`}dateTime(e="rfc3339",t){let i=this.date(t);if(e==="rfc2616")return i.toUTCString();if(e==="rfc3339"){let r=i.getUTCFullYear(),a=(i.getUTCMonth()+1).toString().padStart(2,"0"),s=i.getUTCDate().toString().padStart(2,"0"),n=i.getUTCHours().toString().padStart(2,"0"),l=i.getUTCMinutes().toString().padStart(2,"0"),c=i.getUTCSeconds().toString().padStart(2,"0"),p=i.getUTCMilliseconds().toString().padStart(3,"0");return`${r}-${a}-${s}T${n}:${l}:${c}.${p}Z`}return""}dateTimeOnly(e){let t=this.date(e),i=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),a=t.getDate().toString().padStart(2,"0"),s=t.getHours().toString().padStart(2,"0"),n=t.getMinutes().toString().padStart(2,"0"),l=t.getSeconds().toString().padStart(2,"0");return`${i}-${r}-${a}T${s}:${n}:${l}`}};var A;(function(o){o[o.ROOT=0]="ROOT",o[o.GROUP=1]="GROUP",o[o.POSITION=2]="POSITION",o[o.SET=3]="SET",o[o.RANGE=4]="RANGE",o[o.REPETITION=5]="REPETITION",o[o.REFERENCE=6]="REFERENCE",o[o.CHAR=7]="CHAR"})(A||(A={}));var Fl=()=>({type:A.POSITION,value:"b"}),Kl=()=>({type:A.POSITION,value:"B"}),ql=()=>({type:A.POSITION,value:"^"}),Jl=()=>({type:A.POSITION,value:"$"}),ba=()=>[{type:A.RANGE,from:48,to:57}],Fs=()=>[{type:A.CHAR,value:95},{type:A.RANGE,from:97,to:122},{type:A.RANGE,from:65,to:90},...ba()],Ks=()=>[{type:A.CHAR,value:9},{type:A.CHAR,value:10},{type:A.CHAR,value:11},{type:A.CHAR,value:12},{type:A.CHAR,value:13},{type:A.CHAR,value:32},{type:A.CHAR,value:160},{type:A.CHAR,value:5760},{type:A.CHAR,value:6158},{type:A.CHAR,value:8192},{type:A.CHAR,value:8193},{type:A.CHAR,value:8194},{type:A.CHAR,value:8195},{type:A.CHAR,value:8196},{type:A.CHAR,value:8197},{type:A.CHAR,value:8198},{type:A.CHAR,value:8199},{type:A.CHAR,value:8200},{type:A.CHAR,value:8201},{type:A.CHAR,value:8202},{type:A.CHAR,value:8232},{type:A.CHAR,value:8233},{type:A.CHAR,value:8239},{type:A.CHAR,value:8287},{type:A.CHAR,value:12288},{type:A.CHAR,value:65279}],Gl=()=>[{type:A.CHAR,value:10},{type:A.CHAR,value:13},{type:A.CHAR,value:8232},{type:A.CHAR,value:8233}],qs=()=>({type:A.SET,set:Fs(),not:!1}),Js=()=>({type:A.SET,set:Fs(),not:!0}),Gs=()=>({type:A.SET,set:ba(),not:!1}),Bs=()=>({type:A.SET,set:ba(),not:!0}),Hs=()=>({type:A.SET,set:Ks(),not:!1}),Ws=()=>({type:A.SET,set:Ks(),not:!0}),Bl=()=>({type:A.SET,set:Gl(),not:!0}),Hl={0:0,t:9,n:10,v:11,f:12,r:13},Wl=o=>{let e=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return o.replace(e,(t,i,r,a,s,n,l,c)=>{if(r)return t;let p=i?8:a?parseInt(a,16):s?parseInt(s,16):n?parseInt(n,8):l?"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?".indexOf(l):Hl[c],u=String.fromCharCode(p);return/[[{}^$.|?*+()]/.test(u)&&(u=`\\${u}`),u})},Yl=(o,e)=>{let t=[],i=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?(.)/g,r,a;for(;(r=i.exec(o))!==null;)if(r[1])t.push(qs());else if(r[2])t.push(Gs());else if(r[3])t.push(Hs());else if(r[4])t.push(Js());else if(r[5])t.push(Bs());else if(r[6])t.push(Ws());else if(r[7])t.push({type:A.RANGE,from:(r[8]||r[9]).charCodeAt(0),to:r[10].charCodeAt(0)});else if(a=r[12])t.push({type:A.CHAR,value:a.charCodeAt(0)});else return[t,i.lastIndex];throw new SyntaxError(`Invalid regular expression: /${e}/: Unterminated character class`)},wr=(o,e)=>{throw new SyntaxError(`Invalid regular expression: /${o}/: ${e}`)},Ys=o=>{let e=0,t={type:A.ROOT,stack:[]},i=t,r=t.stack,a=[],s=l=>wr(o,`Nothing to repeat at column ${l-1}`),n=Wl(o);for(;e<n.length;){let l=n[e++];switch(l){case"\\":switch(l=n[e++],l){case"b":r.push(Fl());break;case"B":r.push(Kl());break;case"w":r.push(qs());break;case"W":r.push(Js());break;case"d":r.push(Gs());break;case"D":r.push(Bs());break;case"s":r.push(Hs());break;case"S":r.push(Ws());break;default:/\d/.test(l)?r.push({type:A.REFERENCE,value:parseInt(l,10)}):r.push({type:A.CHAR,value:l.charCodeAt(0)})}break;case"^":r.push(ql());break;case"$":r.push(Jl());break;case"[":{let c=!1;n[e]==="^"&&(c=!0,e++);let[p,u]=Yl(n.slice(e),o);e+=u,r.push({type:A.SET,set:p,not:c});break}case".":r.push(Bl());break;case"(":{let c={type:A.GROUP,stack:[],remember:!0};n[e]==="?"&&(l=n[e+1],e+=2,l==="="?c.followedBy=!0:l==="!"?c.notFollowedBy=!0:l!==":"&&wr(o,`Invalid group, character '${l}' after '?' at column ${e-1}`),c.remember=!1),r.push(c),a.push(i),i=c,r=c.stack;break}case")":a.length===0&&wr(o,`Unmatched ) at column ${e-1}`),i=a.pop(),r=i.options?i.options[i.options.length-1]:i.stack;break;case"|":i.options||(i.options=[i.stack],delete i.stack);{let c=[];i.options.push(c),r=c}break;case"{":{let c=/^(\d+)(,(\d+)?)?\}/.exec(n.slice(e));if(c){r.length===0&&s(e);let p=parseInt(c[1],10),u=c[2]?c[3]?parseInt(c[3],10):1/0:p;e+=c[0].length,r.push({type:A.REPETITION,min:p,max:u,value:r.pop()})}else r.push({type:A.CHAR,value:123});break}case"?":r.length===0&&s(e),r.push({type:A.REPETITION,min:0,max:1,value:r.pop()});break;case"+":r.length===0&&s(e),r.push({type:A.REPETITION,min:1,max:1/0,value:r.pop()});break;case"*":r.length===0&&s(e),r.push({type:A.REPETITION,min:0,max:1/0,value:r.pop()});break;default:r.push({type:A.CHAR,value:l.charCodeAt(0)})}}return a.length!==0&&wr(o,"Unterminated group"),t};var hi=class o{types;constructor(e={}){this.types=new je(e.seed)}seed(e){this.types.seed(e)}fromPattern(e,t={}){let i,r;e instanceof globalThis.RegExp?(r=e.ignoreCase,i=e.source):(r=t.flags?.includes("i")??!1,i=e);let a=10;typeof t.max=="number"&&(a=t.max);let s=Ys(i),n=Array.from({length:95},(l,c)=>c+32);return this._gen(s,[],r,n,a)}_gen(e,t,i,r,a){let s,n,l,c;switch(e.type){case A.ROOT:case A.GROUP:if(e.followedBy||e.notFollowedBy)return"";for(e.remember&&e.groupNumber===void 0&&(e.groupNumber=t.push(null)-1),s=e.options?this._choice(e.options):e.stack,n="",l=0,c=s.length;l<c;l++)n+=this._gen(s[l],t,i,r,a);return e.remember&&(t[e.groupNumber]=n),n;case A.POSITION:return"";case A.SET:{let p=this._processSet(e,i,r);return p.length?String.fromCharCode(this._choice(p)):""}case A.REPETITION:{let p=e.max===1/0?Math.max(e.min,a):e.max,u=this.types.number({min:e.min,max:p});for(n="",l=0;l<u;l++)n+=this._gen(e.value,t,i,r,a);return n}case A.REFERENCE:return t[e.value-1]||"";case A.CHAR:{let p=i&&this._coin()?o._toCaseInverse(e.value):e.value;return String.fromCharCode(p)}}return""}_processSet(e,t,i){if(e.type===A.CHAR)return[e.value];if(e.type===A.RANGE){let a=[];for(let s=e.from;s<=e.to;s++)a.push(s);return a}let r=new Set;for(let a of e.set){let s=this._processSet(a,t,i);if(s.forEach(n=>r.add(n)),t)for(let n of s){let l=n,c=o._toCaseInverse(l);l!==c&&r.add(c)}}return e.not?i.filter(a=>!r.has(a)):Array.from(r)}static _toCaseInverse(e){return e>=97&&e<=122?e-32:e>=65&&e<=90?e+32:e}_coin(){return this.types.number({min:0,max:1})===0}_choice(e){return e[this.types.number({min:0,max:e.length-1})]}};var mt=class o{static types=new je;static person=new fr;static lorem=new br;static regExp=new hi;static readInputValue(e,t,i={}){let{required:r}=e,{defaultValueStr:a,values:s}=t;if(!(!r&&i.requiredOnly===!0)){if(a)return o.readTypedValue(a,t.dataType);if(Array.isArray(s)&&s.length){let n=s[0];return o.readTypedValue(n.value,n.dataType)}if(i.fromExamples){let n;if(Array.isArray(e.examples)&&e.examples.length?n=e.examples.filter(l=>typeof l!="string"):Array.isArray(t.examples)&&t.examples.length&&(n=t.examples),n&&n.length)return o.inputValueFromExamples(n)}return o.generateDefaultValue(t)}}static readInputValues(e,t,i={}){if(!e.required&&i.requiredOnly===!0)return[];let{defaultValue:r}=t;if(r){let n=new xe().processNode(r);if(Array.isArray(n))return n}let a=t;if(i.fromExamples){let s;return Array.isArray(e.examples)&&e.examples.length?s=e.examples.filter(n=>typeof n!="string"):Array.isArray(a.examples)&&a.examples.length&&(s=a.examples),o.arrayValuesFromExamples(s)}return[]}static inputValueFromExamples(e){if(!Array.isArray(e)||!e.length)return;let[t]=e,{structuredValue:i}=t;if(i&&i.types.includes(d.aml.vocabularies.data.Scalar)){let r=i;return o.readTypedValue(r.value,r.dataType)}}static arrayValuesFromExamples(e){let t=[];if(!Array.isArray(e)||!e.length)return t;let[i]=e;if(!i.structuredValue||!i.structuredValue.types.includes(d.aml.vocabularies.data.Array))return t;let r=i.structuredValue,{members:a}=r;return!Array.isArray(a)||!a.length||a.forEach(s=>{let n=s;if(!n.value)return;let l=o.readTypedValue(n.value,n.dataType);typeof r<"u"&&r!==null&&t.push(l)}),t}static generateDefaultValue(e){let{dataType:t}=e;return this.defaultValue(t)}static generateMockedValue(e){let{dataType:t}=e;switch(t){case d.w3.xmlSchema.string:return this.generateStringValue(e);case d.w3.xmlSchema.number:case d.w3.xmlSchema.integer:case d.w3.xmlSchema.float:case d.w3.xmlSchema.long:case d.w3.xmlSchema.double:case d.aml.vocabularies.shapes.number:case d.aml.vocabularies.shapes.integer:case d.aml.vocabularies.shapes.float:case d.aml.vocabularies.shapes.long:case d.aml.vocabularies.shapes.double:return this.generateNumberValue(e);case d.aml.vocabularies.shapes.boolean:case d.w3.xmlSchema.boolean:return this.types.boolean();case d.aml.vocabularies.shapes.nil:case d.w3.xmlSchema.nil:return null;case d.w3.xmlSchema.date:return new kt().dateOnly();case d.w3.xmlSchema.dateTime:return new kt().dateTime(e.format==="date-time"?"rfc3339":e.format);case d.aml.vocabularies.shapes.dateTimeOnly:return new kt().dateTimeOnly();case d.w3.xmlSchema.time:return new kt().timeOnly();default:return}}static defaultValue(e){switch(e){case d.w3.xmlSchema.string:return"";case d.w3.xmlSchema.number:case d.w3.xmlSchema.integer:case d.w3.xmlSchema.float:case d.w3.xmlSchema.long:case d.w3.xmlSchema.double:case d.aml.vocabularies.shapes.number:case d.aml.vocabularies.shapes.integer:case d.aml.vocabularies.shapes.float:case d.aml.vocabularies.shapes.long:case d.aml.vocabularies.shapes.double:return 0;case d.aml.vocabularies.shapes.boolean:case d.w3.xmlSchema.boolean:return!1;case d.aml.vocabularies.shapes.nil:case d.w3.xmlSchema.nil:return null;case d.w3.xmlSchema.date:return"";case d.w3.xmlSchema.dateTime:return"";case d.aml.vocabularies.shapes.dateTimeOnly:return"";case d.w3.xmlSchema.time:return"";default:return}}static generateNumberValue(e){let{minimum:t,maximum:i,format:r,multipleOf:a}=e,s={};typeof t=="number"&&(s.min=t),typeof i=="number"&&(s.max=i);let n;return r&&["float","double"].includes(r)?n=this.types.float.bind(this.types):r&&["uint32","uint64","fixed32","fixed64"].includes(r)&&(s.min=0,s.max&&s.max<0&&delete s.max),n||(n=this.types.number.bind(this.types)),typeof a=="number"&&(s.precision=a),n(s)}static generateStringValue(e){let{minLength:t,maxLength:i,name:r="",format:a,pattern:s}=e;if(s)return new hi().fromPattern(s,{max:10});let n=r.toLowerCase();if(n==="description")return this.lorem.paragraph();if(a==="uuid")return this.types.uuid();if(n==="id"){let p={length:12},u=typeof t=="number";return u?p.length=t:!u&&typeof i=="number"&&(p.length=i),this.types.hash(p)}if(["name","fullname"].includes(n))return this.person.name();if(n==="firstname")return this.person.firstName();if(n==="lastname")return this.person.lastName();let l={},c=typeof t=="number";return c?l.length=t:!c&&typeof i=="number"&&(l.length=i),this.lorem.word(l)}static readTypedValue(e,t){return or(e,t)}static readInputType(e){switch(e){case d.aml.vocabularies.shapes.number:case d.aml.vocabularies.shapes.integer:case d.aml.vocabularies.shapes.float:case d.aml.vocabularies.shapes.long:case d.aml.vocabularies.shapes.double:case d.w3.xmlSchema.number:case d.w3.xmlSchema.integer:case d.w3.xmlSchema.float:case d.w3.xmlSchema.long:case d.w3.xmlSchema.double:return"number";case d.w3.xmlSchema.date:return"date";case d.w3.xmlSchema.time:return"time";case d.w3.xmlSchema.dateTime:case d.aml.vocabularies.shapes.dateTimeOnly:return"datetime-local";case d.aml.vocabularies.shapes.boolean:case d.w3.xmlSchema.boolean:return"boolean";default:return"text"}}static parseNumberInput(e,t){return Zr(e,t)}static parseBooleanInput(e,t){return Qr(e,t)}static parseDateOnlyInput(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return;let i=t.toJSON(),r=i.indexOf("T");return i.substring(0,r)}static parseTimeOnlyInput(e){let t=String(e).trim();if(/^\d\d:\d\d$/.test(t))return`${t}:00`;if(/^\d\d:\d\d:\d\d$/.test(t))return t}static parseDateTimeInput(e,t="rfc3339"){let i=new Date(e);if(!Number.isNaN(i.getTime())){if(t==="rfc2616")return i.toUTCString();if(["rfc3339","date-time"].includes(t))return i.toISOString()}}static parseDateTimeOnlyInput(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return;let i=t.toJSON(),r=i.indexOf(".");return i.substring(0,r)}static parseArrayInput(e,t){let{items:i}=t;return i?o.parseUserInput(e,i):String(e)}static parseUserInput(e,t){if(!t||e===void 0||e===null)return e;let{types:i}=t;return i.includes(d.aml.vocabularies.shapes.ScalarShape)?o.parseScalarInput(e,t):i.includes(d.aml.vocabularies.shapes.ArrayShape)||i.includes(d.aml.vocabularies.shapes.MatrixShape)?o.parseArrayInput(e,t):e}static parseScalarInput(e,t){return this.parseScalar(e,t.dataType,t.format)}static parseScalar(e,t,i){switch(t){case d.aml.vocabularies.shapes.number:case d.aml.vocabularies.shapes.integer:case d.aml.vocabularies.shapes.float:case d.aml.vocabularies.shapes.long:case d.aml.vocabularies.shapes.double:case d.w3.xmlSchema.number:case d.w3.xmlSchema.integer:case d.w3.xmlSchema.float:case d.w3.xmlSchema.long:case d.w3.xmlSchema.double:return o.parseNumberInput(e);case d.aml.vocabularies.shapes.boolean:case d.w3.xmlSchema.boolean:return o.parseBooleanInput(e);case d.w3.xmlSchema.date:return o.parseDateOnlyInput(e);case d.w3.xmlSchema.time:return o.parseTimeOnlyInput(e);case d.w3.xmlSchema.dateTime:return o.parseDateTimeInput(e,i);case d.aml.vocabularies.shapes.dateTimeOnly:return o.parseDateTimeOnlyInput(e);default:return String(e)}}};var St=class{opts;constructor(e={}){this.opts=Object.freeze({...e})}_scalarValue(e){let{defaultValue:t,examples:i,values:r,inherits:a,dataType:s}=e;if(this.opts.renderExamples&&i&&i.length){let n=i.find(c=>!!c.structuredValue),l=this._exampleToObject(n);if(typeof l<"u")return mt.readTypedValue(l,s)}if(t)return new xe().processNode(t);if(r&&r.length){let n=r[0];if(n.value!==void 0)return mt.readTypedValue(n.value,s)}if(Array.isArray(a)&&a.length)for(let n=0,l=a.length;n<l;n+=1){let c=this._scalarValue(a[n]);if(c!==void 0)return c}return this.opts.renderMocked?mt.generateMockedValue(e):mt.generateDefaultValue(e)}_isNotRequiredUnion(e){let t=0,i=!1;return e.forEach(r=>{r.types.includes(d.aml.vocabularies.shapes.NilShape)?i=!0:r.types.includes(d.aml.vocabularies.shapes.ScalarShape)?r.dataType===d.w3.xmlSchema.nil?i=!0:t+=1:r.types.includes(d.aml.vocabularies.shapes.FileShape)&&(t+=1)}),i?t===e.length-1:!1}};var fi=class extends St{generate(e){let t;return e.types.includes(d.w3.shacl.PropertyShape)?t=this._propertyShapeObject(e):t=this.toObject(e),t!==null&&typeof t=="object"?this.serialize(t):t}toObject(e){let{types:t}=e;return t.includes(d.aml.vocabularies.shapes.ScalarShape)?this._scalarShapeObject(e):t.includes(d.w3.shacl.NodeShape)?this._nodeShapeObject(e):t.includes(d.aml.vocabularies.shapes.UnionShape)?this._unionShapeObject(e):t.includes(d.aml.vocabularies.shapes.FileShape)?this._fileShapeObject():t.includes(d.aml.vocabularies.shapes.SchemaShape)?this._schemaShapeObject():t.includes(d.aml.vocabularies.shapes.TupleShape)?this._tupleShapeObject(e):t.includes(d.aml.vocabularies.shapes.ArrayShape)||t.includes(d.aml.vocabularies.shapes.MatrixShape)?this._arrayShapeObject(e):this._anyShapeObject(e)}serialize(e){return JSON.stringify(e,null,2)}_scalarShapeObject(e){return this._scalarValue(e)}_nilShapeObject(){}_nodeShapeObject(e){let{inherits:t}=e,{examples:i=[]}=e;if(Array.isArray(t)&&t.length&&t.forEach(s=>{let n=s;Array.isArray(n.examples)&&n.examples.length&&(i=i.concat(n.examples))}),this.opts.renderExamples&&i.length){let s=i.find(l=>!!l.structuredValue),n=this._exampleToObject(s);if(n!==void 0)return n}let r={},{properties:a}=e;return Array.isArray(t)&&t.length&&t.forEach(s=>{let n=this.toObject(s);typeof n=="object"&&(r={...r,...n})}),a.forEach(s=>{let{name:n}=s,l=this._propertyShapeObject(s);typeof l<"u"&&n&&(r[n]=l)}),r}_unionShapeObject(e){return e.and&&e.and.length?this._allOfUnion(e):e.xone&&e.xone.length?this._oneOfUnion(e):this._anyOfUnion(e)}_anyOfUnion(e){let{anyOf:t=[],examples:i=[]}=e;Array.isArray(e.inherits)&&e.inherits&&e.inherits.forEach(n=>{let l=n;Array.isArray(l.examples)&&l.examples.length&&(i=i.concat(l.examples));let c=n;Array.isArray(c.anyOf)&&c.anyOf.length&&(t=t.concat(c.anyOf))});let{opts:r}=this;if(this._isNotRequiredUnion(t))return;if(this.opts.renderExamples){let n=i.find(c=>!!c.structuredValue),l=this._exampleToObject(n);if(l!==void 0)return l}if(e.defaultValue)return this._unionDefaultValue(t,e.defaultValue);let{selectedUnions:a}=r,s;if(a&&a.length?s=t.find(n=>a.includes(n.id)):[s]=t,s)return this.toObject(s)}_oneOfUnion(e){let{examples:t=[]}=e,{xone:i=[]}=e;Array.isArray(e.inherits)&&e.inherits&&e.inherits.forEach(n=>{let l=n;Array.isArray(l.examples)&&l.examples.length&&(t=t.concat(l.examples))});let{opts:r}=this;if(this.opts.renderExamples){let n=t.find(c=>!!c.structuredValue),l=this._exampleToObject(n);if(l!==void 0)return l}if(e.defaultValue)return this._unionDefaultValue(i,e.defaultValue);let{selectedUnions:a}=r,s;if(a&&a.length?s=i.find(n=>a.includes(n.id)):[s]=i,s)return this.toObject(s)}_allOfUnion(e){let{examples:t=[]}=e,{and:i=[]}=e;if(Array.isArray(e.inherits)&&e.inherits&&e.inherits.forEach(a=>{let s=a;Array.isArray(s.examples)&&s.examples.length&&(t=t.concat(s.examples))}),this.opts.renderExamples){let a=t.find(n=>!!n.structuredValue),s=this._exampleToObject(a);if(s!==void 0)return s}let r={};return i.forEach(a=>{let s=this.toObject(a);typeof s=="object"&&(r={...r,...s})}),r}_unionDefaultValue(e,t){let r=new xe().generate(t),a=!1,s=!1,n=!1;if(e.forEach(l=>{if(l.types.includes(d.aml.vocabularies.shapes.NilShape)&&(n=!0),!l.types.includes(d.aml.vocabularies.shapes.ScalarShape))return;let c=l;s||(s=c.dataType===d.w3.xmlSchema.boolean),a||(a=[d.w3.xmlSchema.number,d.w3.xmlSchema.long,d.w3.xmlSchema.integer,d.w3.xmlSchema.float,d.w3.xmlSchema.double,d.aml.vocabularies.shapes.number,d.aml.vocabularies.shapes.long,d.aml.vocabularies.shapes.integer,d.aml.vocabularies.shapes.float,d.aml.vocabularies.shapes.double].includes(c.dataType)),n||(n=c.dataType===d.w3.xmlSchema.nil)}),a){let l=Number(r);if(!Number.isNaN(l))return l}if(s){if(r==="true")return!0;if(r==="false")return!1}return n&&(r==="null"||r==="nil")?null:r}_arrayShapeObject(e){let{items:t}=e,i=e.defaultValue||t&&t.defaultValue,{examples:r=[]}=e,a=t;if(Array.isArray(a.examples)&&(r=r.concat(a.examples)),this.opts.renderExamples&&r&&r.length){let s=r.find(l=>!!l.structuredValue),n=this._exampleToObject(s);if(Array.isArray(n))return n;if(typeof n<"u")return[n]}if(i){let n=new xe().processNode(i);if(Array.isArray(n))return n;if(n)return[n]}if(t){let s=this.toObject(t);if(typeof s<"u")return[s]}return[]}_tupleShapeObject(e){let{items:t,examples:i}=e;if(this.opts.renderExamples&&i&&i.length){let r=i.find(s=>!!s.structuredValue),a=this._exampleToObject(r);if(typeof a<"u")return[a]}if(e.defaultValue){let a=new xe().processNode(e.defaultValue);if(Array.isArray(a))return a}if(t.length){let r=[];return t.forEach(a=>{let s=this.toObject(a);typeof s<"u"&&r.push(s)}),r}return[]}_anyShapeObject(e){let{and:t=[],xone:i=[],or:r=[]}=e;if(t.length){let a={};return t.forEach(s=>{let n=this.toObject(s);typeof n=="object"&&(a={...a,...n})}),a}if(i.length){let{selectedUnions:a=[]}=this.opts,s=i.find(n=>a.includes(n.id));return s||(s=i[0]),this.toObject(s)}if(r.length){let{selectedUnions:a=[]}=this.opts,s=r.find(n=>a.includes(n.id));return s||(s=r[0]),this.toObject(s)}return this._scalarShapeObject(e)}_propertyShapeObject(e){let{minCount:t=0}=e;if(t===0&&!this.opts.renderOptional)return;let{range:i}=e;if(!i)return;let{types:r}=i;if(r.includes(d.aml.vocabularies.shapes.ScalarShape)){let a=i;return this._scalarShapeObject(a)}return this.toObject(i)}_exampleToObject(e){if(e&&e.structuredValue)return new xe().processNode(e.structuredValue)}_fileShapeObject(){}_schemaShapeObject(){}};var ke=o=>o.replace(/[^a-zA-Z0-9-_.]/g,""),wa="unknown-type";function Fe(o){let{name:e,inherits:t=[],xmlSerialization:i}=o,r=i&&i.name?i.name:e||wa;if(r==="schema"&&t.length){let a=t.find(s=>s.name&&s.name!=="schema");a&&(r=a.name==="type"&&a.displayName||a.name)}return ke(String(r))}var gi=class extends St{generate(e){let t;return e.types.includes(d.w3.shacl.PropertyShape)?t=this._propertyShapeObject(e):t=this.processNode(e,{},!0),t}processNode(e,t={},i=!1){let{types:r}=e;return r.includes(d.aml.vocabularies.shapes.ScalarShape)?this._scalarShapeObject(e,t):r.includes(d.w3.shacl.NodeShape)?this._nodeShapeObject(e,t):r.includes(d.aml.vocabularies.shapes.UnionShape)?this._unionShapeObject(e):r.includes(d.aml.vocabularies.shapes.FileShape)?this._fileShapeObject():r.includes(d.aml.vocabularies.shapes.SchemaShape)?this._schemaShapeObject():r.includes(d.aml.vocabularies.shapes.TupleShape)?this._tupleShapeObject():r.includes(d.aml.vocabularies.shapes.ArrayShape)||r.includes(d.aml.vocabularies.shapes.MatrixShape)?this._arrayShapeObject(e,t,i):this._anyShapeObject(e)}serialize(e){return e}_readCurrentUnion(e){let{selectedUnions:t}=this.opts;return ea(e,t)}_collectProperties(e){let{selectedUnions:t}=this.opts;return lr(e,t)}_nodeShapeObject(e,t={}){let i=t.forceName||Fe(e),r=[],a=t.indent||0,s=this._collectExamples(e,{tagFill:new Array(a*2+0).fill(" ").join(""),indent:a+1,nodeName:i});if(s)return s;let n=[];if(this._collectProperties(e).forEach(u=>{let{range:m,minCount:g=0}=u;if(g===0&&!this.opts.renderOptional||!m)return;let f=m;if(f.xmlSerialization&&f.xmlSerialization.attribute&&f.types.includes(d.aml.vocabularies.shapes.ScalarShape)){let v=ke(f.xmlSerialization.name?f.xmlSerialization.name:u.name||f.name||wa);f.xmlSerialization.prefix&&(v=`${f.xmlSerialization.prefix}:${v}`);let S=this._scalarValue(f);n.push(`${v}="${S}"`);return}let b=this._propertyShapeObject(u,{indent:a});if(typeof b<"u"){let v=t.noWrap?0:2,S=new Array(a*2+v).fill(" ").join("");r.push(nr(S,b))}}),t.noWrap)return r.join(`
|
|
143
143
|
`);let c=`<${i}`;n.length&&(c+=" ",c+=n.join(" ")),r.unshift(`${c}>`);let p=new Array(a*2).fill(" ").join("");return r.push(`${p}</${i}>`),r.join(`
|
|
144
|
-
`)}_scalarShapeObject(e,t={}){let{xmlSerialization:i,defaultValue:r}=e,a;r?a=new
|
|
145
|
-
`)}_createTabs(e=0,t=0){return new Array(e*2+t).fill(" ").join("")}_nodePropertyObject(e,t={}){let i=[],r=
|
|
144
|
+
`)}_scalarShapeObject(e,t={}){let{xmlSerialization:i,defaultValue:r}=e,a;r?a=new ye().processNode(r):a=this._scalarValue(e);let s=t.forceName||Fe(e),n=[],l=[];if(i){let{namespace:p,prefix:u}=i;if(p){let m=u?`xmlns:${u}`:"xmlns";n.push(`${m}="${p}"`)}u&&(s=`${u}:${s}`)}let c=`<${s}`;return n.length&&(c+=" ",c+=n.join(" ")),c+=">",l.push(c),l.push(a),l.push(`</${s}>`),l.join("")}_nilShapeObject(e,t={}){let{xmlSerialization:i}=e,r="",a=t.forceName||Fe(e),s=[],n=[];if(i){let{namespace:c,prefix:p}=i;if(c){let u=p?`xmlns:${p}`:"xmlns";s.push(`${u}="${c}"`)}p&&(a=`${p}:${a}`)}let l=`<${a}`;return s.length&&(l+=" ",l+=s.join(" ")),l+=">",n.push(l),n.push(r),n.push(`</${a}>`),n.join("")}_propertyShapeObject(e,t={}){let{range:i,minCount:r=0}=e;if(r===0&&!this.opts.renderOptional||!i)return;let{types:a}=i;if(a.includes(d.aml.vocabularies.shapes.ScalarShape))return this._scalarShapeObject(i,{...t});if(a.includes(d.aml.vocabularies.shapes.NilShape)){let n=Fe(e);return this._nilShapeObject(i,{...t,forceName:n})}if(a.includes(d.aml.vocabularies.shapes.RecursiveShape))return;if(a.includes(d.w3.shacl.NodeShape))return this._nodePropertyObject(e,t);if(a.includes(d.aml.vocabularies.shapes.ArrayShape)||a.includes(d.aml.vocabularies.shapes.MatrixShape))return this._nodePropertyArray(e,t);let s=Fe(e);return this.processNode(i,{...t,forceName:s})}_collectExamples(e,t={}){if(!this.opts.renderExamples)return;let{isWrapped:i,nodeName:r,tagFill:a="",indent:s=0}=t,{examples:n=[]}=e,{inherits:l}=e;Array.isArray(l)&&l.length&&l.forEach(m=>{let g=m;if(g.types.includes(d.aml.vocabularies.shapes.UnionShape)){let b=g,{anyOf:v=[]}=b;g=this._readCurrentUnion(v)}let f=g;Array.isArray(f.examples)&&f.examples.length&&(n=n.concat(f.examples))});let c=n.filter(m=>!!m.structuredValue);if(!c.length)return;let p=[];i&&p.push(`${a}<${r}>`);let u=new ye;return c.forEach(m=>{let g=u.generate(m.structuredValue,r,{indent:s+1});g!==void 0&&p.push(g)}),i&&p.push(`${a}</${r}>`),p.join(`
|
|
145
|
+
`)}_createTabs(e=0,t=0){return new Array(e*2+t).fill(" ").join("")}_nodePropertyObject(e,t={}){let i=[],r=ke(String(e.name)),{indent:a=0}=t,s=this._createTabs(a),n,l=e.range,c=this._collectExamples(l,{tagFill:s,indent:a+1,nodeName:r}),p=[];if(c)n=c;else{let m=[];this._collectProperties(l).forEach(f=>{let{range:b,minCount:v=0}=f;if(v===0&&!this.opts.renderOptional)return;let S=b;if(S.xmlSerialization){let{prefix:V,attribute:U}=S.xmlSerialization;if(U&&S.types.includes(d.aml.vocabularies.shapes.ScalarShape)){let L=ke(S.xmlSerialization.name?S.xmlSerialization.name:f.name||S.name||wa);V&&(L=`${V}:${L}`);let P=this._scalarValue(S);p.push(`${L}="${P}"`);return}}let E=this._propertyShapeObject(f,{indent:a});if(E!==void 0){let V=this._createTabs(a,2);m.push(nr(V,E))}}),n=m.join(`
|
|
146
146
|
`)}let u=`${s}<${r}`;return p.length&&(u+=" ",u+=p.join(" ")),i.unshift(`${u}>`),i.push(n),i.push(`${s}</${r}>`),i.join(`
|
|
147
|
-
`)}_nodePropertyArray(e,t={}){let i=e.range,r=[],a;i.xmlSerialization&&i.xmlSerialization.name?a=
|
|
148
|
-
`)}_arrayShapeObject(e,t={},i=!1){let{items:r}=e,a=!!r&&r.types.includes(d.aml.vocabularies.shapes.ScalarShape),s;i&&e.xmlSerialization&&e.xmlSerialization.name?s=
|
|
149
|
-
`)}}if(a&&e.defaultValue){let g=new
|
|
150
|
-
`)}return""}_scalarItems(e,t={}){let i=e.items,r=t.indent||0,a=new Array(r*2).fill(" ").join(""),s="";if(i.xmlSerialization&&i.xmlSerialization.name?s=
|
|
151
|
-
`)}}if(e.defaultValue){let p=new
|
|
152
|
-
`)}_exampleToObject(e){if(e&&e.structuredValue)return new
|
|
147
|
+
`)}_nodePropertyArray(e,t={}){let i=e.range,r=[],a;i.xmlSerialization&&i.xmlSerialization.name?a=ke(i.xmlSerialization.name):a=ke(String(e.name));let{indent:s=0}=t,n=!!i.items&&i.items.types.includes(d.aml.vocabularies.shapes.ScalarShape),l=this._createTabs(s);n||r.push(`${l}<${a}>`);let c=this._arrayShapeObject(i,{...t,indent:s});return r.push(c),n||r.push(`${l}</${a}>`),r.join(`
|
|
148
|
+
`)}_arrayShapeObject(e,t={},i=!1){let{items:r}=e,a=!!r&&r.types.includes(d.aml.vocabularies.shapes.ScalarShape),s;i&&e.xmlSerialization&&e.xmlSerialization.name?s=ke(e.xmlSerialization.name):i&&e.name?s=ke(e.name):!a&&r?.name?s=ke(r.name):e.name&&(s=ke(e.name));let n=!1;e.xmlSerialization&&typeof e.xmlSerialization.wrapped=="boolean"&&(n=!0);let l=!!e.xmlSerialization&&!!e.xmlSerialization.wrapped,c=t.indent||0,p=new Array(c*2+0).fill(" ").join(""),u=new Array(c*2+(l?2:0)).fill(" ").join("");if(this.opts.renderExamples){let{examples:m=[]}=e,g=m.filter(f=>!!f.structuredValue);if(g.length){let f=[],b=new ye;if(a&&!l){let[v]=g;!s&&r?.name&&(s=ke(r.name));let S=b.generate(v.structuredValue,s,{indent:c});S!==void 0&&f.push(S)}else if(a&&l){let[v]=g,S=b.generate(v.structuredValue,s,{indent:c});f.push(`${p}<${s}>`),S!==void 0&&f.push(S),f.push(`${p}</${s}>`)}else l?g.forEach(v=>{f.push(`${p}<${s}>`);let S=b.generate(v.structuredValue,void 0,{indent:c+2});S!==void 0&&f.push(S),f.push(`${p}</${s}>`)}):g.forEach(v=>{let S=b.generate(v.structuredValue,void 0,{indent:c});S!==void 0&&f.push(S)});return f.join(`
|
|
149
|
+
`)}}if(a&&e.defaultValue){let g=new ye().generate(e.defaultValue);return!s&&r?.name&&(s=ke(r.name)),`<${s}>${g?.trim()}</${s}>`}if(r){let m=[];l&&a&&m.push(`${p}<${s}>`);let g={indent:c+1};s&&(g.forceName=s),!i&&(!n||n&&!l)&&(g.noWrap=!0);let f=this.processNode(r,g);return f!==void 0&&m.push(`${u}${f}`),l&&a&&m.push(`${p}</${s}>`),m.join(`
|
|
150
|
+
`)}return""}_scalarItems(e,t={}){let i=e.items,r=t.indent||0,a=new Array(r*2).fill(" ").join(""),s="";if(i.xmlSerialization&&i.xmlSerialization.name?s=ke(i.xmlSerialization.name):s=Fe(e.name?e:i),this.opts.renderExamples){let{examples:c=[]}=e;Array.isArray(i.examples)&&(c=c.concat(i.examples));let p=c.filter(u=>!!u.structuredValue);if(p.length){let u=[],m=new ye;return p.forEach(g=>{let f=m.generate(g.structuredValue,s);f!==void 0&&u.push(`${a}${f}`)}),u.join(`
|
|
151
|
+
`)}}if(e.defaultValue){let p=new ye().generate(e.defaultValue,s);if(p!==void 0)return`${a}${p}`}let n={indent:r+1,forceName:s},l=this.processNode(i,n);return`${a}${l}`}_nodeItems(e,t={}){let i=e.items,r=t.indent||0,a=new Array(r*2).fill(" ").join(""),s=e.xmlSerialization&&!!e.xmlSerialization.wrapped,n=e.defaultValue||i.defaultValue,l="";i.xmlSerialization&&i.xmlSerialization.name?l=ke(i.xmlSerialization.name):l=Fe(e.name?e:i);let c=s?new Array(r*2+2).fill(" ").join(""):a,p=[];s&&p.push(`${a}<${l}>`);let u=!1;if(this.opts.renderExamples){let{examples:m=[]}=e;Array.isArray(i.examples)&&(m=m.concat(i.examples));let g=m.filter(f=>!!f.structuredValue);if(g.length){let f=[],b=new ye;g.forEach(v=>{let S=b.generate(v.structuredValue,l);S!==void 0&&f.push(`${a}${S}`)}),u=!0}}if(!u&&n){let g=new ye().generate(n,l);g!==void 0&&(p.push(`${a}${g}`),u=!0)}return u||this._collectProperties(i).forEach(g=>{let f=this._propertyShapeObject(g);f&&p.push(`${c}${f}`)}),s&&p.push(`${a}</${l}>`),p.join(`
|
|
152
|
+
`)}_exampleToObject(e){if(e&&e.structuredValue)return new ye().generate(e.structuredValue)}_unionShapeObject(e,t={}){let{anyOf:i=[],examples:r=[]}=e;if(Array.isArray(e.inherits)&&e.inherits&&e.inherits.forEach(a=>{let s=a;Array.isArray(s.examples)&&s.examples.length&&(r=r.concat(s.examples));let n=a;Array.isArray(n.anyOf)&&n.anyOf.length&&(i=i.concat(n.anyOf))}),Array.isArray(i)&&i.length){if(this._isNotRequiredUnion(i))return;let a=r.find(l=>!!l.structuredValue),s=this._exampleToObject(a);if(s!==void 0){let l=Fe(e),c=t.indent||0,p=new Array(c*2).fill(" ").join(""),u=new Array(c*2+2).fill(" ").join(""),m=[];m.push(`${p}<${l}>`);let g=String(s).split(`
|
|
153
153
|
`).filter(f=>!!f).map(f=>`${u}${f}`).join(`
|
|
154
154
|
`);return m.push(`${g}`),m.push(`${p}</${l}>`),m.join(`
|
|
155
|
-
`)}if(e.defaultValue)return this._unionDefaultValue(e,e.defaultValue);let n=this._readCurrentUnion(i);if(n)return this.processNode(n,{...t,forceName:e.name})}}_unionDefaultValue(e,t,i={}){let a=new
|
|
156
|
-
`)}_fileShapeObject(){}_schemaShapeObject(){}_tupleShapeObject(){}_anyShapeObject(e){let{and:t=[],xone:i=[],or:r=[]}=e;if(t.length){let n=structuredClone(e);return n.and=[],n.properties=[],t.forEach(l=>{let{types:c}=l;if(c.includes(d.aml.vocabularies.shapes.ScalarShape)){let p=l;n.properties.push(p)}else if(c.includes(d.w3.shacl.NodeShape))l.properties.forEach(u=>n.properties.push(u));else if(c.includes(d.aml.vocabularies.shapes.ArrayShape)||c.includes(d.aml.vocabularies.shapes.MatrixShape)){let p=l;p.items&&n.properties.push(p.items)}}),this._nodeShapeObject(n)}if(i.length){let{selectedUnions:n=[]}=this.opts,l=i.find(c=>n.includes(c.id));return l||(l=i[0]),this.processNode(l)}if(r.length){let{selectedUnions:n=[]}=this.opts,l=r.find(c=>n.includes(c.id));return l||(l=r[0]),this.processNode(l)}let{examples:a=[]}=e,s=
|
|
157
|
-
`)}return this._scalarShapeObject(e)}};var ln=Vn(sn(),1);var kr=Symbol("findAmfType"),nn=Symbol("findReferenceObject"),ae=Symbol("getArrayItems"),on=Symbol("computeReferenceSecurity"),Sa=o=>{class e extends o{_amf;__cachedKeys;__lastSetValue;get amf(){return this._amf}set amf(i){if(this._amf===i||this.__lastSetValue===i)return;this.__lastSetValue=i;let r=i?this._expand(i):void 0;this.__cachedKeys={},this._amf=r,this._amfChanged(r)}_amfChanged(i){}_expand(i){return ln.AmfModelExpander.expand(i)}_getAmfKey(i,r){if(!i)return"";let{amf:a}=this;if(!a&&!r)return i;Array.isArray(a)&&([a]=a),this.__cachedKeys||(this.__cachedKeys={});let s=r||a&&a["@context"];if(!s||!i)return i;let n=this.__cachedKeys;if(i in n)return n[i];i=String(i);let l=i.indexOf("#"),c=i.substring(0,l+1),p=Object.keys(s);for(let u=0,m=p.length;u<m;u++){let g=p[u];if(s[g]===i)return n[i]=g,g;if(l===-1&&i.indexOf(s[g])===0){let f=i.replace(s[g],`${g}:`);return n[i]=f,f}if(s[g]===c){let f=`${g}:${i.substring(l+1)}`;return n[i]=f,f}}return i}_ensureAmfModel(i){if(i&&(Array.isArray(i)&&([i]=i),this._hasType(i,d.aml.vocabularies.document.Document)))return i}_ensureArray(i){if(i)return i instanceof Array?i:[i]}_getValue(i,r,a){let s=this._getAmfKey(r,a);if(!s)return;let n=i&&i[s];if(!n)return n;if(Array.isArray(n)&&([n]=n),!n)return;let l=typeof n;return["string","number","boolean","undefined"].includes(l)?n:n["@value"]}_getValueArray(i,r,a){let s=this._getAmfKey(r,a);if(!s)return;let n=i&&this._ensureArray(i[s]);if(Array.isArray(n))return n.map(l=>l["@value"]||l)}[ae](i,r,a){let s=this._getAmfKey(r,a);if(!s)return;let n=i&&this._ensureArray(i[s]);if(Array.isArray(n))return n}_getLinkValue(i,r,a){let s=this._getAmfKey(r,a);if(!s)return;let n=i&&i[s];if(n&&(Array.isArray(n)&&([n]=n),!!n))return n["@id"]}_getLinkValues(i,r,a){let s=this._getAmfKey(r,a);if(!s)return;let n=i&&i[s];if(n)return Array.isArray(n)||(n=[n]),n.map(l=>l["@id"])}_hasType(i,r,a){let s=this._ensureArray(i&&i["@type"]);if(!s||!s.length)return!1;let n=this._getAmfKey(r,a);for(let l of s)if(l===n)return!0;return!1}_hasProperty(i,r,a){let s=this._getAmfKey(r,a);return!!(i&&s&&s in i)}_computePropertyArray(i,r,a){if(!i)return;let s=this._getAmfKey(r,a);if(!s)return;let n=this._ensureArray(i&&i[s]);if(!(!n||!Array.isArray(n)))return n}_computeApiVersion(i,r){let a=this._computeApi(i);if(a)return this._getValue(a,d.aml.vocabularies.core.version,r)}_computeEncodes(i,r){if(!i)return;Array.isArray(i)&&([i]=i);let a=this._getAmfKey(d.aml.vocabularies.document.encodes,r);if(!a)return;let s=i[a];if(s)return Array.isArray(s)?s[0]:s}_computeDeclares(i,r){if(!i||(Array.isArray(i)&&([i]=i),!i))return;let a=this._getAmfKey(d.aml.vocabularies.document.declares,r);if(!a)return;let s=this._ensureArray(i[a]);return Array.isArray(s)?s:void 0}_computeReferences(i,r){if(!i||(Array.isArray(i)&&([i]=i),!i))return;let a=this._getAmfKey(d.aml.vocabularies.document.references,r);if(!a)return;let s=this._ensureArray(i[a]);return s instanceof Array?s:void 0}_computeWebApi(i,r){let a=this._computeEncodes(i,r);if(a&&this._hasType(a,d.aml.vocabularies.apiContract.WebAPI,r))return a}_computeApi(i,r){let a=this._computeEncodes(i,r);if(a&&(this._isAPI(i,r)||this._isWebAPI(i,r)||this._isAsyncAPI(i,r)))return a}_isWebAPI(i,r){let a=this._computeEncodes(i,r);return a?this._hasType(a,d.aml.vocabularies.apiContract.WebAPI,r):!1}_isAsyncAPI(i,r){let a=this._computeEncodes(i,r);return a?this._hasType(a,d.aml.vocabularies.apiContract.AsyncAPI,r):!1}_isAPI(i,r){let a=this._computeEncodes(i,r);return a?this._hasType(a,d.aml.vocabularies.apiContract.API,r):!1}_isValidServerPartial(i,r){if(Array.isArray(i)&&([i]=i),!i)return!1;let a=d.aml.vocabularies.apiContract.Operation,s=d.aml.vocabularies.apiContract.EndPoint,n=[this._getAmfKey(a,r),this._getAmfKey(s,r)],l=i["@type"];for(let c of l)if(n.indexOf(c)!==-1)return!0;return!1}_getServers(i={},r){let{endpointId:a,methodId:s}=i,{amf:n}=this;if(!n)return;let l=this._computeApi(n,r);if(Array.isArray(l)&&([l]=l),!l)if(this._isValidServerPartial(n,r))l=n;else return;let c=this._getAmfKey(d.aml.vocabularies.apiContract.server,r),p=()=>this[ae](l,c,r),u=()=>{let g=this._computeEndpointModel(l,a,r),f=this[ae](g,c,r);return f||p()},m=()=>{let g=this._computeMethodModel(l,s,r),f=this[ae](g,c,r);return f||u()};return s?m():a?u():p()}_computeExpects(i,r){let a=d.aml.vocabularies.apiContract.Operation,s=d.aml.vocabularies.apiContract.expects;if(this._hasType(i,a,r)){let n=this._getAmfKey(s,r),l=this._ensureArray(i[n]);if(l)return Array.isArray(l)?l[0]:l}}_computeEndpoints(i,r){if(!i)return[];let a=d.aml.vocabularies.apiContract.endpoint,s=this._getAmfKey(a,r);return this._ensureArray(i[s])}_computeEndpointModel(i,r,a){if(this._hasType(i,d.aml.vocabularies.apiContract.EndPoint,a))return i;let s=this._computeEndpoints(i,a);if(s)return s.find(n=>n["@id"]===r)}_computeMethodModel(i,r,a){let s=this.__computeMethodsListForMethod(i,r,a);if(s)return s.find(n=>n["@id"]===r)}_computeMethodEndpoint(i,r,a){if(!i||!r)return;if(this._hasType(i,d.aml.vocabularies.apiContract.EndPoint,a))return i;let s=this._computeEndpoints(i,a);if(!s)return;let n=this._getAmfKey(d.aml.vocabularies.apiContract.supportedOperation,a);for(let l=0,c=s.length;l<c;l++){let p=s[l],u=p[n];if(u){Array.isArray(u)||(u=[u]);for(let m=0,g=u.length;m<g;m++)if(u[m]["@id"]===r)return p}}}__computeMethodsListForMethod(i,r,a){let s=this._computeMethodEndpoint(i,r,a);if(!s)return;let n=this._getAmfKey(d.aml.vocabularies.apiContract.supportedOperation,a);return this._ensureArray(s[n])}_computeType(i,r,a,s){if(!i&&!r||!a)return;let n=a.replace("amf://id",""),l=i&&i.find(c=>c["@id"]===a||c["@id"]===n);if(!l&&r&&r.length)for(let c=0,p=r.length;c<p&&!(this._hasType(r[c],d.aml.vocabularies.document.Module)&&(l=this._computeReferenceType(r[c],a,s),l));c++);return l}[kr](i,r){let{amf:a}=this;if(!a||!i)return;Array.isArray(a)&&([a]=a);let s=this._computeDeclares(a,r),n=i.replace("amf://id","");if(Array.isArray(s)){let l=s.find(c=>c["@id"]===i||c["@id"]===n);if(l)return l}return this[nn](i)}[nn](i,r){let{amf:a}=this;if(Array.isArray(a)&&([a]=a),!a)return;let s=this._computeReferences(a,r);if(!Array.isArray(s)||!s.length)return;let n=i.replace("amf://id","");for(let l=0,c=s.length;l<c;l++){let p=s[l],u=this._computeDeclares(p,r);if(Array.isArray(u))for(let m=0,g=u.length;m<g;m++){let f=u[m];if(Array.isArray(f)&&([f]=f),f["@id"]===i||f["@id"]===n)return f}}}_computeReferenceType(i,r,a){let s=this._computeDeclares(i,a);if(!s||!r)return;let n=r.replace("amf://id",""),l=s.find(c=>(Array.isArray(c)&&([c]=c),c["@id"]===r||c["@id"]===n));return Array.isArray(l)&&([l]=l),this._resolve(l)}_computeDocument(i,r,a){if(!i||!r)return;let s=this._getAmfKey(d.aml.vocabularies.core.documentation,a),n=this._ensureArray(i[s]);return n&&n.find(l=>l["@id"]===r)}_resolve(i,r){let{amf:a}=this;if(typeof i!="object"||Array.isArray(i)||!a||i.__apicResolved)return i;let s=this._getAmfKey(d.aml.vocabularies.document.linkTarget,r),n=this._ensureArray(i[s]),l;if(n){let u=n[0]["@id"];if(u===i["@id"])return i.__apicResolved=!0,i;l=this._getLinkTarget(a,u,r)}else if(s=this._getAmfKey(d.aml.vocabularies.document.referenceId,r),n=this._ensureArray(i[s]),n){let u=n[0]["@id"];if(u===i["@id"])return i.__apicResolved=!0,i;l=this._getReferenceId(a,u,r)}if(!l)return this._resolveRecursive(i),i.__apicResolved=!0,i;let c={...l};delete c["@id"];let p=c["@type"];return p&&(i["@type"]?i["@type"]=i["@type"].concat(p):i["@type"]=p,delete c["@type"]),this._mergeShapes(i,c,r),i.__apicResolved=!0,this._resolveRecursive(i),i}_getLinkTarget(i,r,a){if(!i||!r)return;let s,n=this._computeDeclares(i,a);if(n&&(s=this._findById(n,r)),!s){let l=this._computeReferences(i,a);s=this._obtainShapeFromReferences(l,r,a)}if(s)return s=this._resolve(s),s}_obtainShapeFromReferences(i,r,a){if(!Array.isArray(i)||!i.length)return;let s;for(let n of i){let l=this._computeEncodes(n,a);if(l&&l["@id"]===r){s=l;break}if(!l&&(s=this._findById(this._computeDeclares(n,a),r),s))break}return s}_findById(i,r){if(!i)return;let a;for(let s of i)if(s&&s["@id"]===r){a=s;break}return a}_getReferenceId(i,r,a){if(!i||!r)return;let s=this._computeReferences(i,a);if(s)for(let n of s){let l=this._computeEncodes(n,a);if(l&&l["@id"]===r)return l}}_resolveRecursive(i,r){Object.keys(i).forEach(a=>{let s=i[a];if(Array.isArray(s))for(let n=0,l=s.length;n<l;n++)s[n]=this._resolve(s[n]);else typeof s=="object"&&(i[a]=this._resolve(s,r))})}_mergeShapes(i,r,a){let s={...i,...r};return[{key:this._getAmfKey(d.aml.vocabularies.docSourceMaps.sources,a),merger:this._mergeSourceMapsSources.bind(this)}].forEach(({key:l,merger:c})=>{this._hasProperty(s,l,a)&&(s[l]=c(i,r,a))}),Object.assign(i,s)}_mergeSourceMapsSources(i,r,a){let s=this._getAmfKey(d.aml.vocabularies.docSourceMaps.sources,a),n=i[s]||{};Array.isArray(n)&&(n=n[0]);let l=r[s]||{};return Array.isArray(l)&&(l=l[0]),[Object.assign(n,l)]}_expandKey(i,r){let{amf:a}=this;if(!i||typeof i!="string"||!a&&!r)return i;Array.isArray(a)&&([a]=a);let s=r||a&&a["@context"];if(!s)return i;let[n,l]=i.split(":");if(!n||!l)return i;let c=s[n];return c?`${c}${l}`:i}findSecurityScheme(i,r){let{amf:a}=this,s=this._computeDeclares(a,r),n;if(s&&(n=s.find(c=>c["@id"]===i)),n)return n=this._resolve(n),n;let l=this._computeReferences(a,r);if(Array.isArray(l)&&l.length){for(let c of l)if(this._hasType(c,d.aml.vocabularies.document.Module,r)&&(n=this[on](c,i,r),n))return n=this._resolve(n),n}}[on](i,r,a){let s=this._computeDeclares(i,a);if(!s)return;let n=s.find(l=>{let c=l;return Array.isArray(c)&&([c]=c),c["@id"]===r});return Array.isArray(n)&&([n]=n),this._resolve(n)}getByType(i,r,a){if(!i)return[];let s=[],n=this._computeDeclares(i),l=this._getAmfKey(r,a);n&&n.length&&n.forEach(p=>{this._hasType(p,l)&&s.push(p)});let c=this._computeReferences(i);if(Array.isArray(c)&&c.length){for(let p of c)if(this._hasType(p,d.aml.vocabularies.document.Module)){let u=this.getByType(p,r,a);u.length&&(s=s.concat(u))}}return s}}return e};var _a=class extends Sa(Object){constructor(e){super(),e&&(this.amf=e)}readTypes(e,t){let i=e;return typeof i=="string"&&(i=[i]),Array.isArray(i)?i.map(r=>this._expandKey(r,t)):[]}apiSummary(e){let t=e["@context"],i={id:e["@id"],types:this.readTypes(e["@type"],t),customDomainProperties:this.customDomainProperties(e,t),sourceMaps:this.sourceMap(e),schemes:[],accepts:[],contentType:[],documentations:[],tags:[]},r=this._getValue(e,d.aml.vocabularies.core.name,t);r&&typeof r=="string"&&(i.name=r);let a=this._getValue(e,d.aml.vocabularies.core.description,t);a&&typeof a=="string"&&(i.description=a);let s=this._getValue(e,d.aml.vocabularies.core.version,t);s&&typeof s=="string"&&(i.version=s);let n=this._getValue(e,d.aml.vocabularies.core.termsOfService,t);n&&typeof n=="string"&&(i.termsOfService=n);let l=e[this._getAmfKey(d.aml.vocabularies.apiContract.accepts,t)];Array.isArray(l)&&l.length&&(i.accepts=this._getValueArray(e,d.aml.vocabularies.apiContract.accepts,t));let c=e[this._getAmfKey(d.aml.vocabularies.apiContract.contentType,t)];Array.isArray(c)&&c.length&&(i.contentType=this._getValueArray(e,d.aml.vocabularies.apiContract.contentType,t));let p=e[this._getAmfKey(d.aml.vocabularies.apiContract.scheme,t)];Array.isArray(p)&&p.length&&(i.schemes=this._getValueArray(e,d.aml.vocabularies.apiContract.scheme,t));let u=e[this._getAmfKey(d.aml.vocabularies.core.provider,t)];Array.isArray(u)&&([u]=u),u&&(i.provider=this.provider(u));let m=e[this._getAmfKey(d.aml.vocabularies.core.license,t)];Array.isArray(m)&&([m]=m),m&&(i.license=this.license(m));let g=e[this._getAmfKey(d.aml.vocabularies.apiContract.tag,t)];Array.isArray(g)&&g.length&&(i.tags=g.map(b=>this.tag(b)));let f=e[this._getAmfKey(d.aml.vocabularies.core.documentation,t)];return Array.isArray(f)&&f.length&&(i.documentations=f.map(b=>this.documentation(b))),i}api(e,t){let i=t||e["@context"],r=this.apiSummary(e);r.endPoints=[],r.servers=[],r.security=[];let a=e[this._getAmfKey(d.aml.vocabularies.apiContract.endpoint,i)];Array.isArray(a)&&a.length&&(r.endPoints=a.map(l=>this.endPoint(l,i)));let s=e[this._getAmfKey(d.aml.vocabularies.apiContract.server,i)];Array.isArray(s)&&s.length&&(r.servers=s.map(l=>this.server(l,i)));let n=e[this._getAmfKey(d.aml.vocabularies.security.security,i)];return Array.isArray(n)&&n.length&&(r.security=n.map(l=>this.securityRequirement(l,i))),r}webApi(e,t){return this.api(e,t)}asyncApi(e,t){return this.api(e,t)}provider(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getLinkValue(e,d.aml.vocabularies.core.url,i);s&&typeof s=="string"&&(r.url=s);let n=this._getValue(e,d.aml.vocabularies.core.email,i);return n&&typeof n=="string"&&(r.email=n),r}license(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getLinkValue(e,d.aml.vocabularies.core.url,i);return s&&typeof s=="string"&&(r.url=s),r}server(e,t){let i=t||e["@context"],r=this._getValue(e,d.aml.vocabularies.core.urlTemplate,i)||"",a={id:e["@id"],types:this.readTypes(e["@type"],i),url:r,variables:[],customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},s=this._getValue(e,d.aml.vocabularies.core.description,i);s&&typeof s=="string"&&(a.description=s);let n=e[this._getAmfKey(d.aml.vocabularies.apiContract.variable,i)];Array.isArray(n)&&n.length&&(a.variables=n.map(u=>this.parameter(u,i)));let l=this._getValue(e,d.aml.vocabularies.apiContract.protocol,i),c=this._getValue(e,d.aml.vocabularies.apiContract.protocolVersion,i);l&&(a.protocol=l),c&&(a.protocolVersion=c);let p=e[this._getAmfKey(d.aml.vocabularies.security.security,i)];return Array.isArray(p)&&p.length&&(a.security=p.map(u=>this.securityRequirement(u,i))),a}parameter(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),payloads:[],examples:[],customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.apiContract.paramName,i);s&&typeof s=="string"&&(r.paramName=s);let n=this._getValue(e,d.aml.vocabularies.core.description,i);n&&typeof n=="string"&&(r.description=n);let l=this._getValue(e,d.aml.vocabularies.apiContract.required,i);typeof l=="boolean"&&(r.required=l);let c=this._getValue(e,d.aml.vocabularies.apiContract.allowEmptyValue,i);typeof c=="boolean"&&(r.allowEmptyValue=c);let p=this._getValue(e,d.aml.vocabularies.document.deprecated,i);typeof p=="boolean"&&(r.deprecated=p);let u=this._getValue(e,d.aml.vocabularies.apiContract.explode,i);typeof u=="boolean"&&(r.explode=u);let m=this._getValue(e,d.aml.vocabularies.apiContract.allowReserved,i);typeof m=="boolean"&&(r.allowReserved=m);let g=this._getValue(e,d.aml.vocabularies.apiContract.style,i);g&&typeof g=="string"&&(r.style=g);let f=this._getValue(e,d.aml.vocabularies.apiContract.binding,i);f&&typeof f=="string"&&(r.binding=f);let b=e[this._getAmfKey(d.aml.vocabularies.shapes.schema,i)];if(Array.isArray(b)&&b.length){let[E]=b;r.schema=this.unknownShape(E,{trackedId:e["@id"]},i)}let v=e[this._getAmfKey(d.aml.vocabularies.apiContract.payload,i)];Array.isArray(v)&&v.length&&(r.payloads=v.map(E=>this.payload(E,i)));let S=e[this._getAmfKey(d.aml.vocabularies.apiContract.examples,i)];return Array.isArray(S)&&S.length&&(r.examples=S.map(E=>this.example(E,i))),r}unknownShape(e,t,i){let r=i||e["@context"],a=this.readTypes(e["@type"],r);return a.includes(d.aml.vocabularies.shapes.ScalarShape)?this.scalarShape(e,t,r):a.includes(d.w3.shacl.NodeShape)?this.nodeShape(e,t,r):a.includes(d.aml.vocabularies.shapes.UnionShape)?this.unionShape(e,t,r):a.includes(d.aml.vocabularies.shapes.FileShape)?this.fileShape(e,t,r):a.includes(d.aml.vocabularies.shapes.SchemaShape)?this.schemaShape(e,t,r):a.includes(d.aml.vocabularies.shapes.TupleShape)?this.tupleShape(e,t,r):a.includes(d.aml.vocabularies.shapes.ArrayShape)||a.includes(d.aml.vocabularies.shapes.MatrixShape)?this.arrayShape(e,t,r):a.includes(d.aml.vocabularies.shapes.RecursiveShape)?this.recursiveShape(e,r):this.anyShape(e,t,r)}isLink(e,t){let i=t||e["@context"];return!!this._getLinkValue(e,d.aml.vocabularies.document.linkTarget,i)}getLinkTarget(e,t){let i=t||e["@context"],r=this._getLinkValue(e,d.aml.vocabularies.document.linkTarget,i);if(r)return this[kr](r,i)}shape(e,t){let i=t||e["@context"];this._resolve(e);let r,a=e;if(this.isLink(a)){r=this._getValue(a,d.aml.vocabularies.document.linkLabel,i);let F=this._getLinkValue(a,d.aml.vocabularies.document.linkTarget,i),ce=this[kr](F,i);ce&&(a=ce)}let s={id:a["@id"],types:this.readTypes(e["@type"],i),values:[],inherits:[],or:[],and:[],xone:[],customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)};r&&(s.linkLabel=r);let n=this._getValue(a,d.w3.shacl.name,i);n&&typeof n=="string"&&(s.name=n);let l=this._getValue(a,d.aml.vocabularies.core.displayName,i);if(l&&typeof l=="string")s.displayName=l;else{let F=this._getValue(a,d.aml.vocabularies.core.name,i);F&&typeof F=="string"&&(s.displayName=F)}let c=this._getValue(a,d.aml.vocabularies.core.description,i);c&&typeof c=="string"&&(s.description=c);let p=this._getValue(a,d.w3.shacl.defaultValueStr,i);p&&typeof p=="string"&&(s.defaultValueStr=p);let u=this._getValue(a,d.aml.vocabularies.shapes.deprecated,i);typeof u=="boolean"&&(s.deprecated=u);let m=this._getValue(a,d.aml.vocabularies.shapes.readOnly,i);typeof m=="boolean"&&(s.readOnly=m);let g=this._getValue(a,d.aml.vocabularies.shapes.writeOnly,i);typeof g=="boolean"&&(s.writeOnly=g);let f=a[this._getAmfKey(d.w3.shacl.defaultValue,i)];Array.isArray(f)&&f.length&&(s.defaultValue=this.unknownDataNode(f[0],i));let b=this._getAmfKey(d.w3.shacl.or,i),v=a[b];Array.isArray(v)&&v.length&&(s.or=v.map(F=>this.unknownShape(F,void 0,i)));let S=this._getAmfKey(d.w3.shacl.and,i),E=a[S];Array.isArray(E)&&E.length&&(s.and=E.map(F=>this.unknownShape(F,void 0,i)));let V=this._getAmfKey(d.w3.shacl.xone,i),U=a[V];Array.isArray(U)&&U.length&&(s.xone=U.map(F=>this.unknownShape(F,void 0,i)));let L=a[this._getAmfKey(d.w3.shacl.in,i)];if(Array.isArray(L)&&L.length){let[F]=L,ce=d.w3.rdfSchema.key,ue=this._getAmfKey(ce,i);Object.keys(F).forEach(he=>{if(he.startsWith(ce)||he.startsWith(ue)){let Ge=F[he];Array.isArray(Ge)&&([Ge]=Ge);let ft=this.unknownDataNode(Ge,i);ft&&s.values.push(ft)}})}let P=this._getAmfKey(d.w3.shacl.not,i),le=a[P];return le&&(Array.isArray(le)&&([le]=le),s.not=this.unknownShape(le,void 0,i)),s}anyShape(e,t={},i){let r=i||e["@context"],a=e,s=this.shape(a,r);if(this.isLink(a)){let p=this.getLinkTarget(a,r);p&&(a=p)}s.examples=[];let n=a[this._getAmfKey(d.aml.vocabularies.apiContract.examples,r)];if(Array.isArray(n)&&n.length)if(t.trackedId){let p=this.filterTrackedExamples(n,t.trackedId,r);s.examples=p.map(u=>this.example(u,r))}else{let p=this.filterNonTrackedExamples(n,r);s.examples=p.map(u=>this.example(u,r))}let l=a[this._getAmfKey(d.aml.vocabularies.core.documentation,r)];if(Array.isArray(l)&&l.length){let[p]=l;s.documentation=this.documentation(p,r)}let c=a[this._getAmfKey(d.aml.vocabularies.shapes.xmlSerialization,r)];return Array.isArray(c)&&c.length&&(s.xmlSerialization=this.xmlSerializer(c[0],r)),s}filterTrackedExamples(e,t,i){let{docSourceMaps:r}=d.aml.vocabularies,a=this._getAmfKey(r.sources,i),s=this._getAmfKey(r.trackedElement,i),n=t.indexOf("amf")===-1?`amf://id${t}`:t;return e.filter(l=>{let c=l;Array.isArray(c)&&([c]=c);let p=c[a];if(!p)return!0;Array.isArray(p)&&([p]=p);let u=p[s];if(!u)return!0;Array.isArray(u)&&([u]=u);let{value:m}=this.synthesizedField(u,i);if(!m)return!0;let g=m.split(",");return g.indexOf(n)!==-1||g.indexOf(t)!==-1})}filterNonTrackedExamples(e,t){let{docSourceMaps:i}=d.aml.vocabularies,r=this._getAmfKey(i.sources,t),a=this._getAmfKey(i.trackedElement,t);return e.filter(s=>{let n=s;Array.isArray(n)&&([n]=n);let l=n[r];if(!l)return!0;Array.isArray(l)&&([l]=l);let c=l[a];if(!c)return!0;Array.isArray(c)&&([c]=c);let{value:p}=this.synthesizedField(c,t);return!p})}scalarShape(e,t={},i){let r=i||e["@context"],a=e,s=this.anyShape(a,t,r);if(this.isLink(a)){let b=this.getLinkTarget(a,r);b&&(a=b)}let n=this._getValue(a,d.w3.shacl.pattern,r);n&&typeof n=="string"&&(s.pattern=n);let l=this._getLinkValue(a,d.w3.shacl.datatype,r);l&&typeof l=="string"&&(s.dataType=l);let c=this._getValue(a,d.aml.vocabularies.shapes.format,r);c&&typeof c=="string"&&(s.format=c);let p=this._getValue(a,d.aml.vocabularies.shapes.multipleOf,r);typeof p=="number"&&(s.multipleOf=p);let u=this._getValue(a,d.w3.shacl.minInclusive,r);typeof u=="number"&&(s.minimum=u,s.exclusiveMinimum=!1);let m=this._getValue(a,d.w3.shacl.maxInclusive,r);typeof m=="number"&&(s.maximum=m,s.exclusiveMaximum=!1);let g=this._getValue(a,d.w3.shacl.minLength,r);typeof g=="number"&&(s.minLength=g);let f=this._getValue(a,d.w3.shacl.maxLength,r);return typeof f=="number"&&(s.maxLength=f),s}nodeShape(e,t={},i){let r=i||e["@context"],a=e,s=this.anyShape(a,t,r);if(this.isLink(a)){let m=this.getLinkTarget(a,r);m&&(a=m)}let n=this._getValue(a,d.aml.vocabularies.shapes.discriminator,r);n&&typeof n=="string"&&(s.discriminator=n);let l=this._getValue(a,d.aml.vocabularies.shapes.discriminatorValue,r);l&&typeof l=="string"&&(s.discriminatorValue=l);let c=this._getValue(a,d.w3.shacl.closed,r);typeof c=="boolean"&&(s.closed=c),s.customShapeProperties=[],s.customShapePropertyDefinitions=[],s.dependencies=[];let p=a[this._getAmfKey(d.w3.shacl.property,r)];Array.isArray(p)&&p.length?s.properties=p.map(m=>this.propertyShape(m,r)):s.properties=[];let u=a[this._getAmfKey(d.w3.shacl.additionalPropertiesSchema,r)];if(Array.isArray(u)&&u.length===1){let[m]=u;s.additionalPropertiesSchema=this.unknownShape(m,void 0,r)}return s}propertyShape(e,t){let i=t||e["@context"],r=e,a=this.shape(r,i);if(this.isLink(r)){let p=this.getLinkTarget(r,i);p&&(r=p)}let s=this._getLinkValue(r,d.w3.shacl.path,i);s&&typeof s=="string"&&(a.path=s);let n=this._getValue(r,d.w3.shacl.minCount,i);typeof n=="number"&&(a.minCount=n);let l=this._getValue(r,d.w3.shacl.maxCount,i);typeof l=="number"&&(a.maxCount=l);let c=r[this._getAmfKey(d.aml.vocabularies.shapes.range,i)];if(Array.isArray(c)&&c.length){let[p]=c;a.range=this.unknownShape(p,void 0,i)}return a}unionShape(e,t={},i){let r=i||e["@context"],a=e[this._getAmfKey(d.aml.vocabularies.shapes.anyOf,r)],s=this.anyShape(e,t,r);if(Array.isArray(a)&&a.length){let n={...t,trackedId:void 0};s.anyOf=a.map(l=>this.unknownShape(l,n,r))}else s.anyOf=[];return s}fileShape(e,t={},i){let r=i||e["@context"],a=e,s=this.anyShape(a,t,r);if(this.isLink(a)){let b=this.getLinkTarget(a,r);b&&(a=b)}let n=this._getValue(a,d.w3.shacl.pattern,r);n&&typeof n=="string"&&(s.pattern=n);let l=this._getValueArray(a,d.aml.vocabularies.shapes.fileType,r);Array.isArray(l)&&l.length&&(s.fileTypes=l);let c=this._getValue(a,d.w3.shacl.minLength,r);typeof c=="number"&&(s.minLength=c);let p=this._getValue(a,d.w3.shacl.maxLength,r);typeof p=="number"&&(s.maxLength=p);let u=this._getValue(a,d.w3.shacl.minInclusive,r);typeof u=="number"&&(s.minimum=u,s.exclusiveMinimum=!1);let m=this._getValue(a,d.w3.shacl.maxInclusive,r);typeof m=="number"&&(s.maximum=m,s.exclusiveMaximum=!1);let g=this._getValue(a,d.aml.vocabularies.shapes.format,r);g&&typeof g=="string"&&(s.format=g);let f=this._getValue(a,d.aml.vocabularies.shapes.multipleOf,r);return typeof f=="number"&&(s.multipleOf=f),s}schemaShape(e,t={},i){let r=i||e["@context"],a=e,s=this.anyShape(a,t,r);if(this.isLink(a)){let c=this.getLinkTarget(a,r);c&&(a=c)}let n=this._getValue(a,d.aml.vocabularies.core.mediaType,r);n&&typeof n=="string"&&(s.mediaType=n);let l=this._getValue(a,d.aml.vocabularies.document.raw,r);return l&&typeof l=="string"&&(s.raw=l),s}recursiveShape(e,t){let i=t||e["@context"],r=e,a=this.shape(r,i);if(this.isLink(r)){let n=this.getLinkTarget(r,i);n&&(r=n)}let s=this._getLinkValue(r,d.aml.vocabularies.shapes.fixPoint,i);return s&&typeof s=="string"&&(a.fixPoint=s),a}dataArrangeShape(e,t={},i){let r=i||e["@context"];return this.anyShape(e,t,r)}arrayShape(e,t={},i){let r=i||e["@context"],a=e,s=this.dataArrangeShape(a,t,r);if(this.isLink(a)){let l=this.getLinkTarget(a,r);l&&(a=l)}let n=a[this._getAmfKey(d.aml.vocabularies.shapes.items,r)];if(Array.isArray(n)&&n.length){let[l]=n;s.items=this.unknownShape(l,void 0,r)}return s}tupleShape(e,t,i){let r=i||e["@context"],a=e,s=this.dataArrangeShape(a,t,r);if(this.isLink(a)){let c=this.getLinkTarget(a,r);c&&(a=c)}let n=a[this._getAmfKey(d.aml.vocabularies.shapes.items,r)],l=this._getAmfKey(d.w3.rdfSchema.key,r);return Array.isArray(n)&&n.length?(s.items=[],n.forEach(c=>{Array.isArray(c)&&([c]=c),Object.keys(c).filter(p=>p.startsWith(l)).forEach(p=>{let u=c[p];Array.isArray(u)&&([u]=u);let m=this.unknownShape(u,void 0,r);s.items.push(m)})})):s.items=[],s}documentation(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getLinkValue(e,d.aml.vocabularies.core.url,i);a&&typeof a=="string"&&(r.url=a);let s=this._getValue(e,d.aml.vocabularies.core.description,i);s&&typeof s=="string"&&(r.description=s);let n=this._getValue(e,d.aml.vocabularies.core.title,i);return n&&typeof n=="string"&&(r.title=n),r}example(e,t){let i=t||e["@context"];this._resolve(e);let r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),strict:!1},a=this._getValue(e,d.aml.vocabularies.document.strict,i);typeof a=="boolean"&&(r.strict=a);let s=this._getValue(e,d.aml.vocabularies.core.name,i);s&&typeof s=="string"&&(r.name=s);let n=this._getValue(e,d.aml.vocabularies.core.displayName,i);n&&typeof n=="string"&&(r.displayName=n);let l=this._getValue(e,d.aml.vocabularies.core.description,i);l&&typeof l=="string"&&(r.description=l);let c=this._getValue(e,d.aml.vocabularies.document.raw,i);c&&typeof c=="string"&&(r.value=c);let p=this._getValue(e,d.aml.vocabularies.document.location,i);p&&typeof p=="string"&&(r.location=p);let u=e[this._getAmfKey(d.aml.vocabularies.document.structuredValue,i)];if(Array.isArray(u)&&u.length){let[m]=u;r.structuredValue=this.unknownDataNode(m,i)}return r}xmlSerializer(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.shapes.xmlAttribute,i);typeof a=="boolean"&&(r.attribute=a);let s=this._getValue(e,d.aml.vocabularies.shapes.xmlWrapped,i);typeof s=="boolean"&&(r.wrapped=s);let n=this._getValue(e,d.aml.vocabularies.shapes.xmlName,i);n&&typeof n=="string"&&(r.name=n);let l=this._getValue(e,d.aml.vocabularies.shapes.xmlNamespace,i);l&&typeof l=="string"&&(r.namespace=l);let c=this._getValue(e,d.aml.vocabularies.shapes.xmlPrefix,i);return c&&typeof c=="string"&&(r.prefix=c),r}unknownDataNode(e,t){let i=this.readTypes(e["@type"],t);if(i.includes(d.aml.vocabularies.data.Scalar))return this.scalarNode(e,t);if(i.includes(d.aml.vocabularies.data.Object))return this.objectNode(e,t);if(i.includes(d.aml.vocabularies.data.Array))return this.arrayNode(e,t)}dataNode(e,t){let i={id:e["@id"],types:this.readTypes(e["@type"],t),customDomainProperties:this.customDomainProperties(e,t)},r=this._getValue(e,d.aml.vocabularies.core.name,t);return r&&typeof r=="string"&&(i.name=r),i}scalarNode(e,t){let i=t||e["@context"],r=this.dataNode(e,t),a=this._getValue(e,d.aml.vocabularies.data.value,i);a&&typeof a=="string"&&(r.value=a);let s=this._getLinkValue(e,d.w3.shacl.datatype,i);return s&&typeof s=="string"&&(r.dataType=s),r}objectNode(e,t){let i=t||e["@context"],r=this.dataNode(e,t);r.properties={};let a=d.aml.vocabularies.data.key,s=`${this._getAmfKey(a,i)}:`;return Object.keys(e).forEach(n=>{if(n.startsWith(a)||n.startsWith(s)){let l=e[n];Array.isArray(l)&&([l]=l);let c=n.replace(a,"").replace(s,""),p=this.unknownDataNode(l,t);p&&(r.properties[c]=p)}}),r}arrayNode(e,t){let i=t||e["@context"],r=this.dataNode(e,i);r.members=[];let a=this._computePropertyArray(e,d.w3.rdfSchema.member);return Array.isArray(a)&&a.length&&a.forEach(s=>{let n=this.unknownDataNode(s);n&&r.members.push(n)}),r}customDomainProperties(e,t){let i=[],r=t||e["@context"],a=this._getLinkValues(e,d.aml.vocabularies.document.customDomainProperties,r);return Array.isArray(a)&&a.length&&a.forEach(s=>{let n=`@base:${s}`,l=e[s]||e[n];if(!l)return;Array.isArray(l)&&([l]=l);let c=this.unknownDataNode(l,r),p=this._getValue(l,d.aml.vocabularies.core.extensionName,r);if(!p||!c)return;let u={id:s,name:p,extension:c};i.push(u)}),i}endPoint(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e),path:"",operations:[],parameters:[],payloads:[],servers:[],security:[],extends:[]},a=this._getValue(e,d.aml.vocabularies.apiContract.path,i);a&&typeof a=="string"&&(r.path=a);let s=this._getValue(e,d.aml.vocabularies.core.name,i);s&&typeof s=="string"&&(r.name=s);let n=this._getValue(e,d.aml.vocabularies.core.description,i);n&&typeof n=="string"&&(r.description=n);let l=this._getValue(e,d.aml.vocabularies.core.summary,i);l&&typeof l=="string"&&(r.summary=l);let c=this[ae](e,d.aml.vocabularies.apiContract.supportedOperation,i);Array.isArray(c)&&c.length&&(r.operations=c.map(b=>this.operation(b,i)));let p=this[ae](e,d.aml.vocabularies.apiContract.parameter,i);Array.isArray(p)&&p.length&&(r.parameters=p.map(b=>this.parameter(b,i)));let u=this[ae](e,d.aml.vocabularies.apiContract.payload,i);Array.isArray(u)&&u.length&&(r.payloads=u.map(b=>this.payload(b,i)));let m=this[ae](e,d.aml.vocabularies.apiContract.server,i);Array.isArray(m)&&m.length&&(r.servers=m.map(b=>this.server(b,i)));let g=this[ae](e,d.aml.vocabularies.security.security,i);Array.isArray(g)&&g.length&&(r.security=g.map(b=>this.securityRequirement(b,i)));let f=this[ae](e,d.aml.vocabularies.document.extends,i);return Array.isArray(f)&&f.length&&(r.extends=[],f.forEach(b=>{let v=b;Array.isArray(v)&&([v]=v),this._hasType(v,d.aml.vocabularies.apiContract.ParametrizedResourceType,i)?r.extends.push(this.parametrizedResourceType(v,i)):this._hasType(v,d.aml.vocabularies.apiContract.ParametrizedTrait,i)&&r.extends.push(this.parametrizedTrait(v,i))})),r}operation(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e),method:"",deprecated:!1,callbacks:[],responses:[],servers:[],security:[],accepts:[],schemes:[],contentType:[],tags:[],extends:[]},a=this._getValue(e,d.aml.vocabularies.apiContract.method,i);a&&typeof a=="string"&&(r.method=a);let s=this._getValue(e,d.aml.vocabularies.core.name,i);s&&typeof s=="string"&&(r.name=s);let n=this._getValue(e,d.aml.vocabularies.core.description,i);n&&typeof n=="string"&&(r.description=n);let l=this._getValue(e,d.aml.vocabularies.apiContract.guiSummary,i);l&&typeof l=="string"&&(r.summary=l);let c=this._getValue(e,d.aml.vocabularies.core.deprecated,i);typeof c=="boolean"&&(r.deprecated=c);let p=this._getValue(e,d.aml.vocabularies.apiContract.operationId,i);p&&typeof p=="string"&&(r.operationId=p);let u=this._getValueArray(e,d.aml.vocabularies.apiContract.accepts,i);Array.isArray(u)&&(r.accepts=u);let m=this._getValueArray(e,d.aml.vocabularies.apiContract.scheme,i);Array.isArray(m)&&(r.schemes=m);let g=this._getValueArray(e,d.aml.vocabularies.apiContract.contentType,i);Array.isArray(g)&&(r.contentType=g);let f=e[this._getAmfKey(d.aml.vocabularies.apiContract.expects,i)];f&&(Array.isArray(f)&&([f]=f),r.request=this.request(f,i));let b=e[this._getAmfKey(d.aml.vocabularies.core.documentation,i)];b&&(Array.isArray(b)&&([b]=b),r.documentation=this.documentation(b,i));let v=e[this._getAmfKey(d.aml.vocabularies.apiContract.returns,i)];Array.isArray(v)&&(r.responses=v.map(P=>this.response(P,i)));let S=e[this._getAmfKey(d.aml.vocabularies.apiContract.callback,i)];Array.isArray(S)&&(r.callbacks=S.map(P=>this.callback(P,i)));let E=e[this._getAmfKey(d.aml.vocabularies.apiContract.server,i)];Array.isArray(E)&&(r.servers=E.map(P=>this.server(P)));let V=e[this._getAmfKey(d.aml.vocabularies.security.security,i)];Array.isArray(V)&&(r.security=V.map(P=>this.securityRequirement(P,i)));let U=e[this._getAmfKey(d.aml.vocabularies.apiContract.tag,i)];Array.isArray(U)&&U.length&&(r.tags=U.map(P=>this.tag(P,i)));let L=e[this._getAmfKey(d.aml.vocabularies.document.extends,i)];return Array.isArray(L)&&L.length&&(r.extends=L.map(P=>this.parametrizedTrait(P,i))),r}tag(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e),name:""},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.core.description,i);s&&typeof s=="string"&&(r.description=s);let n=e[this._getAmfKey(d.aml.vocabularies.core.documentation,i)];return n&&(Array.isArray(n)&&([n]=n),r.documentation=this.documentation(n,i)),r}tagListItem(e,t){let i=t||e["@context"],r={id:e["@id"],name:""},a=this._getValue(e,d.aml.vocabularies.core.name,i);return a&&typeof a=="string"&&(r.name=a),r}callback(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.apiContract.expression,i);s&&typeof s=="string"&&(r.expression=s);let n=e[this._getAmfKey(d.aml.vocabularies.apiContract.endpoint,i)];return n&&(Array.isArray(n)&&([n]=n),r.endpoint=this.endPoint(n,i)),r}request(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e),required:!1,headers:[],queryParameters:[],payloads:[],uriParameters:[],cookieParameters:[]},a=this._getValue(e,d.aml.vocabularies.core.description,i);a&&typeof a=="string"&&(r.description=a);let s=this._getValue(e,d.aml.vocabularies.apiContract.required,i);s&&typeof s=="boolean"&&(r.required=s);let n=e[this._getAmfKey(d.aml.vocabularies.apiContract.queryString,i)];n&&(Array.isArray(n)&&([n]=n),r.queryString=this.unknownShape(n,void 0,i));let l=this[ae](e,d.aml.vocabularies.apiContract.header,i);Array.isArray(l)&&l.length&&(r.headers=l.map(g=>this.parameter(g,i)));let c=this[ae](e,d.aml.vocabularies.apiContract.parameter,i);Array.isArray(c)&&c.length&&(r.queryParameters=c.map(g=>this.parameter(g,i)));let p=this[ae](e,d.aml.vocabularies.apiContract.uriParameter,i);Array.isArray(p)&&p.length&&(r.uriParameters=p.map(g=>this.parameter(g,i)));let u=this[ae](e,d.aml.vocabularies.apiContract.cookieParameter,i);Array.isArray(u)&&u.length&&(r.cookieParameters=u.map(g=>this.parameter(g,i)));let m=this[ae](e,d.aml.vocabularies.apiContract.payload,i);return Array.isArray(m)&&m.length&&(r.payloads=m.map(g=>this.payload(g,i))),r}response(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),headers:[],payloads:[],examples:[],links:[]},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.core.description,i);s&&typeof s=="string"&&(r.description=s);let n=this._getValue(e,d.aml.vocabularies.apiContract.statusCode,i);n&&typeof n=="string"&&(r.statusCode=n);let l=this[ae](e,d.aml.vocabularies.apiContract.header,i);Array.isArray(l)&&l.length&&(r.headers=l.map(m=>this.parameter(m,i)));let c=this[ae](e,d.aml.vocabularies.apiContract.payload,i);Array.isArray(c)&&c.length&&(r.payloads=c.map(m=>this.payload(m,i)));let p=e[this._getAmfKey(d.aml.vocabularies.apiContract.examples,i)];Array.isArray(p)&&p.length&&(r.examples=p.map(m=>this.example(m,i)));let u=e[this._getAmfKey(d.aml.vocabularies.apiContract.link,i)];return Array.isArray(u)&&u.length&&(r.links=u.map(m=>this.templatedLink(m,i))),r}payload(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),examples:[]},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.core.mediaType,i);s&&typeof s=="string"&&(r.mediaType=s);let n=e[this._getAmfKey(d.aml.vocabularies.shapes.schema,i)];n&&(Array.isArray(n)&&([n]=n),r.schema=this.unknownShape(n,{trackedId:r.id},i));let l=e[this._getAmfKey(d.aml.vocabularies.apiContract.examples,i)];return Array.isArray(l)&&l.length&&(r.examples=l.map(c=>this.example(c,i))),r}templatedLink(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),mapping:[]},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.core.description,i);s&&typeof s=="string"&&(r.description=s);let n=this._getValue(e,d.aml.vocabularies.apiContract.operationId,i);n&&typeof n=="string"&&(r.operationId=n);let l=e[this._getAmfKey(d.aml.vocabularies.apiContract.server,i)];l&&(Array.isArray(l)&&([l]=l),r.server=this.server(l,i));let c=e[this._getAmfKey(d.aml.vocabularies.apiContract.mapping,i)];return c&&(c&&!Array.isArray(c)&&(c=[c]),c&&(r.mapping=c.map(p=>this.iriTemplateMapping(p,i)))),r}iriTemplateMapping(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.apiContract.templateVariable,i);a&&typeof a=="string"&&(r.templateVariable=a);let s=this._getValue(e,d.aml.vocabularies.apiContract.linkExpression,i);return s&&typeof s=="string"&&(r.linkExpression=s),r}parametrizedSecurityScheme(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=e[this._getAmfKey(d.aml.vocabularies.security.scheme,i)];s&&(Array.isArray(s)&&([s]=s),r.scheme=this.securityScheme(s,i));let n=e[this._getAmfKey(d.aml.vocabularies.security.settings,i)];return n&&(Array.isArray(n)&&([n]=n),r.settings=this.securitySettings(n,i)),r}securitySchemeListItem(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),type:""},a=this._getValue(e,d.aml.vocabularies.security.type,i);a&&typeof a=="string"&&(r.type=a);let s=this._getValue(e,d.aml.vocabularies.core.name,i);s&&typeof s=="string"&&(r.name=s);let n=this._getValue(e,d.aml.vocabularies.core.displayName,i);return n&&typeof n=="string"&&(r.displayName=n),r}securityScheme(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),headers:[],queryParameters:[],responses:[]},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.core.displayName,i);s&&typeof s=="string"&&(r.displayName=s);let n=this._getValue(e,d.aml.vocabularies.core.description,i);n&&typeof n=="string"&&(r.description=n);let l=this._getValue(e,d.aml.vocabularies.security.type,i);l&&typeof l=="string"&&(r.type=l);let c=e[this._getAmfKey(d.aml.vocabularies.security.settings,i)];c&&(Array.isArray(c)&&([c]=c),r.settings=this.securitySettings(c,i));let p=e[this._getAmfKey(d.aml.vocabularies.apiContract.queryString,i)];p&&(Array.isArray(p)&&([p]=p),r.queryString=this.unknownShape(p,void 0,i));let u=this[ae](e,d.aml.vocabularies.apiContract.header,i);Array.isArray(u)&&u.length&&(r.headers=u.map(f=>this.parameter(f,i)));let m=this[ae](e,d.aml.vocabularies.apiContract.parameter,i);Array.isArray(m)&&m.length&&(r.queryParameters=m.map(f=>this.parameter(f,i)));let g=this[ae](e,d.aml.vocabularies.apiContract.response,i);return Array.isArray(g)&&g.length&&(r.responses=g.map(f=>this.response(f,i))),r}securityRequirement(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),schemes:[]},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=e[this._getAmfKey(d.aml.vocabularies.security.schemes,i)];return Array.isArray(s)&&s.length&&(r.schemes=s.map(n=>this.parametrizedSecurityScheme(n,i))),r}securitySettings(e,t){let i=t||e["@context"],r=this.readTypes(e["@type"],i);return r.includes(d.aml.vocabularies.security.OAuth1Settings)?this.oAuth1Settings(e,i):r.includes(d.aml.vocabularies.security.OAuth2Settings)?this.oAuth2Settings(e,i):r.includes(d.aml.vocabularies.security.ApiKeySettings)?this.apiKeySettings(e,i):r.includes(d.aml.vocabularies.security.HttpSettings)?this.httpSettings(e,i):r.includes(d.aml.vocabularies.security.OpenIdConnectSettings)?this.openIdConnectSettings(e,i):this.settings(e,i)}settings(e,t){let i=t||e["@context"];return{id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)}}oAuth1Settings(e,t){let i=t||e["@context"],r=this.settings(e,i),a=this._getValue(e,d.aml.vocabularies.security.authorizationUri,i);a&&typeof a=="string"&&(r.authorizationUri=a);let s=this._getValue(e,d.aml.vocabularies.security.requestTokenUri,i);s&&typeof s=="string"&&(r.requestTokenUri=s);let n=this._getValue(e,d.aml.vocabularies.security.tokenCredentialsUri,i);n&&typeof n=="string"&&(r.tokenCredentialsUri=n);let l=this._getValueArray(e,d.aml.vocabularies.security.signature,i);return Array.isArray(l)&&l.length?r.signatures=l:r.signatures=[],r}oAuth2Settings(e,t){let i=t||e["@context"],r=this.settings(e,i),a=this._getValueArray(e,d.aml.vocabularies.security.authorizationGrant,i);Array.isArray(a)&&a.length?r.authorizationGrants=a:r.authorizationGrants=[];let s=e[this._getAmfKey(d.aml.vocabularies.security.flows,i)];return Array.isArray(s)&&s.length?r.flows=s.map(n=>this.oAuth2Flow(n,i)):r.flows=[],r}oAuth2Flow(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),scopes:[],sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.security.authorizationUri,i);a&&typeof a=="string"&&(r.authorizationUri=a);let s=this._getValue(e,d.aml.vocabularies.security.accessTokenUri,i);s&&typeof s=="string"&&(r.accessTokenUri=s);let n=this._getValue(e,d.aml.vocabularies.security.flow,i);n&&typeof n=="string"&&(r.flow=n);let l=this._getValue(e,d.aml.vocabularies.security.refreshUri,i);l&&typeof l=="string"&&(r.refreshUri=l);let c=e[this._getAmfKey(d.aml.vocabularies.security.scope,i)];return Array.isArray(c)&&c.length&&(r.scopes=c.map(p=>this.scope(p,i))),r}scope(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.core.description,i);return s&&typeof s=="string"&&(r.description=s),r}apiKeySettings(e,t){let i=t||e["@context"],r=this.settings(e,i),a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.security.in,i);return s&&typeof s=="string"&&(r.in=s),r}httpSettings(e,t){let i=t||e["@context"],r=this.settings(e,i),a=this._getValue(e,d.aml.vocabularies.security.scheme,i);a&&typeof a=="string"&&(r.scheme=a);let s=this._getValue(e,d.aml.vocabularies.security.bearerFormat,i);return s&&typeof s=="string"&&(r.bearerFormat=s),r}openIdConnectSettings(e,t){let i=t||e["@context"],r=this.settings(e,i),a=this._getValue(e,d.aml.vocabularies.security.openIdConnectUrl,i);return a&&typeof a=="string"&&(r.url=a),r}sourceMap(e,t){let i=t||e["@context"],r=e[this._getAmfKey(d.aml.vocabularies.docSourceMaps.sources,i)];if(!r)return;Array.isArray(r)&&([r]=r);let a={id:r["@id"],types:this.readTypes(r["@type"])},s=r[this._getAmfKey(d.aml.vocabularies.docSourceMaps.synthesizedField,i)];Array.isArray(s)&&s.length&&(a.synthesizedField=s.map(m=>this.synthesizedField(m,i)));let n=r[this._getAmfKey(d.aml.vocabularies.docSourceMaps.lexical,i)];Array.isArray(n)&&n.length&&(a.lexical=n.map(m=>this.synthesizedField(m,i)));let l=r[this._getAmfKey(d.aml.vocabularies.docSourceMaps.trackedElement,i)];Array.isArray(l)&&l.length&&(a.trackedElement=this.synthesizedField(l[0],i));let c=r[this._getAmfKey(d.aml.vocabularies.docSourceMaps.autoGeneratedName,i)];Array.isArray(c)&&c.length&&(a.autoGeneratedName=c.map(m=>this.synthesizedField(m,i)));let p=r[this._getAmfKey(d.aml.vocabularies.docSourceMaps.parsedJsonSchema,i)];Array.isArray(p)&&p.length&&(a.parsedJsonSchema=this.synthesizedField(p[0],i));let u=r[this._getAmfKey(d.aml.vocabularies.docSourceMaps.declaredElement,i)];return Array.isArray(u)&&u.length&&(a.declaredElement=this.synthesizedField(u[0],i)),a}synthesizedField(e,t){if(typeof e=="string")return{id:"synthesizedField/generated",value:e};let i={id:e["@id"],value:""},r=this._getValue(e,d.aml.vocabularies.docSourceMaps.element,t);typeof r=="string"&&(i.element=r);let a=this._getValue(e,d.aml.vocabularies.docSourceMaps.value,t);return typeof a=="string"&&(i.value=a),i}parametrizedDeclaration(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),variables:[],customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=e[this._getAmfKey(d.aml.vocabularies.document.variable,i)];Array.isArray(s)&&s.forEach(l=>{r.variables.push(this.variableValue(l,i))});let n=e[this._getAmfKey(d.aml.vocabularies.document.target,i)];if(Array.isArray(n)&&n.length){let[l]=n;r.target=this.abstractDeclaration(l,i)}return r}parametrizedTrait(e,t){let i=t||e["@context"];return this.parametrizedDeclaration(e,i)}parametrizedResourceType(e,t){let i=t||e["@context"];return this.parametrizedDeclaration(e,i)}variableValue(e,t){let i=t||e["@context"],r=this._getValue(e,d.aml.vocabularies.core.name,i),a={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),name:r},s=e[this._getAmfKey(d.aml.vocabularies.document.value,i)];if(Array.isArray(s)){let[n]=s;a.value=this.unknownDataNode(n,i)}return a}abstractDeclaration(e,t){let i=t||e["@context"],r=this._getValue(e,d.aml.vocabularies.core.name,i),a={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),name:r,variables:[]},s=this._getValueArray(e,d.aml.vocabularies.document.variable,i);Array.isArray(s)&&(a.variables=s);let n=this._getValue(e,d.aml.vocabularies.core.description,i);n&&typeof n=="string"&&(a.description=n);let l=e[this._getAmfKey(d.aml.vocabularies.document.dataNode,i)];if(Array.isArray(l)){let[c]=l;a.dataNode=this.unknownDataNode(c,i)}return a}endPointWithOperationsListItem(e,t){let i=this._getValue(e,d.aml.vocabularies.apiContract.path,t),r={id:e["@id"],path:i,operations:[]},a=this[ae](e,d.aml.vocabularies.apiContract.supportedOperation,t);Array.isArray(a)&&a.length&&(r.operations=a.map(n=>this.operationListItem(n,t)));let s=this._getValue(e,d.aml.vocabularies.core.name,t);return s&&typeof s=="string"&&(r.name=s),r}operationListItem(e,t){let i={id:e["@id"],method:""},r=this._getValue(e,d.aml.vocabularies.apiContract.method,t);r&&typeof r=="string"&&(i.method=r);let a=this._getValue(e,d.aml.vocabularies.core.name,t);return a&&typeof a=="string"&&(i.name=a),i}};var St=class o{mime;opts;generator;constructor(e,t={}){this.mime=e,this.opts=Object.freeze({...t}),e.includes("json")?this.generator=new fi(t):e.includes("xml")&&(this.generator=new gi(t))}static asExample(e,t,i){return new o(t,i).toExample(e)}static asSchema(e,t,i){return new o(t,i).toValue(e)}generate(e){let{generator:t}=this;if(t)return t.generate(e)}toValue(e){return this.generate(e)}toExample(e){let t=this.generate(e);if(t==null)return;let i={id:`${e.id}/generated`,strict:!0,types:[d.aml.vocabularies.apiContract.Example],mediaType:this.mime,renderValue:t,customDomainProperties:[]},r=e;if(Array.isArray(r.examples)&&r.examples.length){let[a]=r.examples;a.value&&(i.value=a.value)}return i}};var Ft=Object.freeze({processApiLink:"amfprocessapilink",processBuffer:"amfprocessbuffer",processApiFile:"amfprocessapifile",selectApiMainFile:"amfselectapimainfile"});var nc=Object.freeze({processApiLink:async(o,e,t,i,r=globalThis)=>{let a=new CustomEvent(Ft.processApiLink,{bubbles:!0,composed:!0,cancelable:!0,detail:{url:o,mainFile:e,md5:t,packaging:i}});return r.dispatchEvent(a),a.detail.result},processBuffer:async(o,e,t=globalThis)=>{let i=new CustomEvent(Ft.processBuffer,{bubbles:!0,composed:!0,cancelable:!0,detail:{buffer:o,opts:e}});return t.dispatchEvent(i),i.detail.result},processApiFile:async(o,e=globalThis)=>{let t=new CustomEvent(Ft.processApiFile,{bubbles:!0,composed:!0,cancelable:!0,detail:{file:o}});return e.dispatchEvent(t),t.detail.result},selectApiMainFile:async(o,e=globalThis)=>{let t=new CustomEvent(Ft.selectApiMainFile,{bubbles:!0,composed:!0,cancelable:!0,detail:{candidates:o}});return e.dispatchEvent(t),t.detail.result}});function Sr(o,e){return o==="number"?e?.format==="int32"||e?.format==="int64"?d.w3.xmlSchema.integer:d.w3.xmlSchema.number:o==="boolean"?d.aml.vocabularies.shapes.boolean:o==="date"?d.w3.xmlSchema.date:o==="datetime"?d.w3.xmlSchema.dateTime:o==="time"?d.aml.vocabularies.shapes.dateTimeOnly:o==="binary"&&e&&e.format==="base64"?d.w3.xmlSchema.base64Binary:d.w3.xmlSchema.string}var ht=Symbol("noValue"),Kt=class{increment=0;static noValue=ht;generate(e,t){return t==="string"?this.generateString(e):t==="number"?this.generateNumber(e):t==="date"?this.generateDate(e):t==="time"?this.generateTime(e):t==="datetime"?this.generateDateTime(e):ht}generateString(e){switch(e){case"random":return R(8);case"uuid-v4":return crypto.randomUUID();default:return ht}}generateNumber(e){return e==="incremental"?`${this.increment++}`:ht}generateDate(e){if(e==="now"){let t=new Date,i=t.getFullYear(),r=`${t.getMonth()+1}`.padStart(2,"0"),a=`${t.getDate()}`.padStart(2,"0");return`${i}-${r}-${a}`}return ht}generateTime(e){if(e==="now"){let t=new Date,i=`${t.getHours()}`.padStart(2,"0"),r=`${t.getMinutes()}`.padStart(2,"0"),a=`${t.getSeconds()}`.padStart(2,"0");return`${i}:${r}:${a}`}return ht}generateDateTime(e){if(e==="now"){let t=new Date,i=t.getFullYear(),r=`${t.getMonth()+1}`.padStart(2,"0"),a=`${t.getDate()}`.padStart(2,"0"),s=`${t.getHours()}`.padStart(2,"0"),n=`${t.getMinutes()}`.padStart(2,"0"),l=`${t.getSeconds()}`.padStart(2,"0");return`${i}-${r}-${a}T${s}:${n}:${l}`}return ht}};var Aa="anyOf",oc="allOf",lc="oneOf",cc="not",xa="string",cn="binary",et=class{#e;get valueGenerator(){return this.#e||(this.#e=new Kt),this.#e}entity(e,t=new Set){if(t.has(e.key))return this.createRecursiveShape(e);t.add(e.key);let i=we.nodeShape(e.key);i.id=e.key,this.updateBaseProperties(e,i),i.properties=[];for(let r of e.listProperties()){let a=r.readBinding("web");if(a&&a.hidden)continue;let s=this.property(r);i.properties.push(s)}for(let r of e.listAssociations()){let a=r.readBinding("web");if(a&&a.hidden)continue;let s=this.associationProperty(r,t);i.properties.push(s)}for(let r of e.listParents()){let a=this.entity(r,t);i.inherits.push(a)}return i}property(e){let{required:t,key:i}=e,r=we.propertyShape(i);return r.path=`${d.aml.vocabularies.data.key}${e.info.name}`,t&&(r.minCount=1),r.range=this.getRange(e),this.updateBaseProperties(e,r),r.range.name&&(r.name=r.range.name),r}associationProperty(e,t=new Set){let{required:i,key:r}=e,a=we.propertyShape(r);return a.path=`${d.aml.vocabularies.data.key}${e.info.name}`,i&&(a.minCount=1),a.range=this.associationShape(e,t),this.updateBaseProperties(e,a),a}associationShape(e,t=new Set){let i=e.schema;if(!i?.embedded)return this.createLinkedShape(e);let r=this.associationUnion(e,t);if(!r)return;if(Array.isArray(r))return this.createUnionShape(e,r);if((i&&i.unionType||Aa)===cc){let s=we.anyShape(e.key);return s.id=`not-shape-${e.key}`,s.not=r,s}return e.multiple?this.refactorShapeToArray(e.key,r):r}createLinkedShape(e){let t=we.scalarShape(e.key);return t.id=`link-${e.key}`,t.dataType=Sr(xa),t}createUnionShape(e,t){let i=we.unionShape(e.key);this.updateBaseProperties(e,i),i.anyOf=[];let r=e.schema&&e.schema.unionType||Aa;return r===Aa?i.anyOf=t:r===oc?i.and=t:r===lc?i.xone=t:i.not=t[0],e.multiple?this.refactorShapeToArray(e.key,i):i}associationUnion(e,t=new Set){let i=[];for(let r of e.listTargets())i.push(this.entity(r,t));if(i.length)return i.length>1?i:i[0]}getRange(e){let t=e.readBinding("web"),i;e.schema&&(i=e.schema);let{multiple:r,type:a}=e;return r?this.createArrayShape(e,i,t):a===cn?this.createFileShape(e,t):this.createScalarShape(e,i,t)}setShapeSchema(e,t,i,r,a){if(i.defaultValue){let{type:s}=i.defaultValue,{value:n}=i.defaultValue;if(s==="function"){let l=this.valueGenerator.generate(n,e.type);if(l!==Kt.noValue){let c=Me.scalar(l,s);t.defaultValue=c.toJSON()}}else{let l=Me.scalar(n,r);t.defaultValue=l.toJSON()}}Array.isArray(i.enum)&&(t.values=i.enum.map(s=>Me.scalar(s,r).toJSON())),Array.isArray(i.examples)&&(a?t.examples=this.createArrayExamples(i.examples,r):t.examples=this.createExamples(i.examples,r))}createArrayShape(e,t,i){let r=we.arrayShape(e.key),{type:a}=e;if(a===cn?r.items=this.createFileShape(e,i):r.items=this.createScalarShape(e,void 0,i),t){let s=r.items.dataType;this.setShapeSchema(e,r,t,s,e.multiple)}return r}createScalarShape(e,t,i){let r=we.scalarShape(e.key);return this.updateBaseProperties(e,r),this.setScalarCommonProperties(r,e,i),r.dataType||(r.dataType=Sr(e.type,i)),t&&this.setShapeSchema(e,r,t,r.dataType,e.multiple),r}createExamples(e,t){let i=[];for(let r of e){let a={id:R(),customDomainProperties:[],strict:!0,types:[...li.IAmfExampleTypes],structuredValue:Me.scalar(r,t).toJSON()};i.push(a)}return i}createArrayExamples(e,t){let i={id:R(),customDomainProperties:[],strict:!0,types:[...li.IAmfExampleTypes]},r=new Me("array");for(let a of e){let s=Me.scalar(a,t);r.addMember(s)}return i.structuredValue=r.toJSON(),[i]}createFileShape(e,t){let i=we.fileShape(e.key);return this.updateBaseProperties(e,i),t&&(Array.isArray(t.fileTypes)&&(i.fileTypes=t.fileTypes),this.setScalarCommonProperties(i,e,t),t.format==="base64"&&(i.format=d.w3.xmlSchema.base64Binary)),i}setScalarCommonProperties(e,t,i){i?.name&&(e.name=i.name),i?.xml&&(e.xmlSerialization=i.xml);let{schema:r,type:a}=t;if(r&&(r.pattern&&(e.pattern=r.pattern),typeof r.multipleOf=="number"&&(e.multipleOf=r.multipleOf),typeof r.minimum=="number"&&(a===xa?e.minLength=r.minimum:e.minimum=r.minimum),typeof r.maximum=="number"&&(a===xa?e.maxLength=r.maximum:e.maximum=r.maximum),typeof r.exclusiveMinimum=="boolean"&&(e.exclusiveMinimum=r.exclusiveMinimum),typeof r.exclusiveMaximum=="boolean"&&(e.exclusiveMaximum=r.exclusiveMaximum)),i?.format)switch(i.format){case"base64":e.format=d.w3.xmlSchema.base64Binary;break;case"double":e.format=d.w3.xmlSchema.double;break;case"float":e.format=d.w3.xmlSchema.float;break;case"int32":e.format=d.w3.xmlSchema.integer;break;case"int64":e.format=d.w3.xmlSchema.integer;break}typeof t.readOnly=="boolean"&&(e.readOnly=t.readOnly),typeof t.writeOnly=="boolean"&&(e.writeOnly=t.writeOnly)}updateBaseProperties(e,t){t.name=e.info.name,t.displayName=e.info.displayName,t.description=e.info.description,(e.kind===Z||e.kind===J)&&(t.deprecated=e.deprecated)}createRecursiveShape(e){return we.recursiveShape(e.key,e.key)}refactorShapeToArray(e,t){let i=we.arrayShape(e);return i.items=t,i}};var Oe=class{root;get domain(){return this.root}#e;get key(){return this.#e}#t;get namespace(){return this.#t}constructor(e,t){this.root=e,this.#e=t,this.#t=e.key}};var Ea=["string","number","boolean","date","datetime","time","binary"],yi;(function(o){o.string="string",o.number="number",o.boolean="boolean",o.date="date",o.datetime="datetime",o.time="time",o.file="binary"})(yi||(yi={}));var dn=["required","multiple","primary","index","unique","search","readOnly","writeOnly","deprecated"],pn=["required","multiple"],un=["float","double","int32","int64"],mn=["hex","base64"];var _t=class o extends Oe{kind;info;required;multiple;primary;unique;index;search;readOnly;writeOnly;deprecated;tags=[];semantics=[];type="string";schema;bindings=[];static createSchema(e={}){let{key:t=R(),multiple:i,required:r,type:a=yi.string,index:s,search:n,primary:l,unique:c,readOnly:p,writeOnly:u,tags:m,semantics:g,deprecated:f,schema:b,bindings:v}=e;if(typeof a=="string"&&!Ea.includes(a))throw new Error(`Invalid data property type ${a}`);let S=W.fromJSON(e.info,{name:"new_property"}).toJSON(),E={kind:Z,key:t,info:S,type:a};return typeof i=="boolean"&&(E.multiple=i),typeof r=="boolean"&&(E.required=r),typeof s=="boolean"&&(E.index=s),typeof n=="boolean"&&(E.search=n),typeof l=="boolean"&&(E.primary=l),typeof c=="boolean"&&(E.unique=c),typeof p=="boolean"&&(E.readOnly=p),typeof u=="boolean"&&(E.writeOnly=u),typeof f=="boolean"&&(E.deprecated=f),Array.isArray(m)&&(E.tags=[...m]),Array.isArray(g)&&(E.semantics=[...g]),b&&(E.schema=structuredClone(b)),Array.isArray(v)?E.bindings=v.map(V=>structuredClone(V)):E.bindings=[],E}parent;constructor(e,t,i={}){let r=o.createSchema(i);super(e,r.key),this.parent=t,this.kind=Z,this.info=new W(r.info),this.type=r.type,typeof r.multiple=="boolean"&&(this.multiple=r.multiple),typeof r.required=="boolean"&&(this.required=r.required),typeof r.index=="boolean"&&(this.index=r.index),typeof r.search=="boolean"&&(this.search=r.search),typeof r.deprecated=="boolean"&&(this.deprecated=r.deprecated),typeof r.primary=="boolean"&&(this.primary=r.primary),typeof r.unique=="boolean"&&(this.unique=r.unique),typeof r.readOnly=="boolean"&&(this.readOnly=r.readOnly),typeof r.writeOnly=="boolean"&&(this.writeOnly=r.writeOnly),Array.isArray(r.tags)?this.tags=[...r.tags]:this.tags=[],Array.isArray(r.semantics)?this.semantics=[...r.semantics]:this.semantics=[],r.schema&&(this.schema=structuredClone(r.schema)),Array.isArray(r.bindings)?this.bindings=r.bindings.map(a=>structuredClone(a)):this.bindings=[]}static validate(e,t={}){if(!e||typeof e!="object"&&e!==null)return!1;let i=e;return!(t.strict&&i.kind!==Z)}toJSON(){let e={kind:this.kind,key:this.key,info:this.info.toJSON(),type:this.type||yi.string};return typeof this.index=="boolean"&&(e.index=this.index),typeof this.search=="boolean"&&(e.search=this.search),typeof this.deprecated=="boolean"&&(e.deprecated=this.deprecated),typeof this.primary=="boolean"&&(e.primary=this.primary),typeof this.unique=="boolean"&&(e.unique=this.unique),typeof this.multiple=="boolean"&&(e.multiple=this.multiple),typeof this.required=="boolean"&&(e.required=this.required),typeof this.readOnly=="boolean"&&(e.readOnly=this.readOnly),typeof this.writeOnly=="boolean"&&(e.writeOnly=this.writeOnly),Array.isArray(this.tags)&&this.tags.length&&(e.tags=[...this.tags]),Array.isArray(this.semantics)&&this.semantics.length&&(e.semantics=this.semantics.map(t=>structuredClone(t))),this.schema&&(e.schema=structuredClone(this.schema)),Array.isArray(this.bindings)&&this.bindings.length&&(e.bindings=this.bindings.map(t=>structuredClone(t))),e}remove(){this.getParentInstance()?.removeProperty(this.key)}getParentInstance(){return this.root.graph.node(this.parent)}static isValidType(e){return typeof e!="string"?!1:Ea.includes(e)}static isValidAttribute(e){return typeof e!="string"?!1:dn.includes(e)}static isValidFormat(e){return e===void 0?!0:typeof e!="string"?!1:!!(un.includes(e)||mn.includes(e))}ensureSchema(){return this.schema||(this.schema={}),this.schema}getWebBinding(){let e=this.bindings.find(t=>t.type==="web");return e||(e={type:"web",schema:{}},this.bindings.push(e)),e.schema}readWebBinding(){return this.bindings.find(t=>t.type==="web")?.schema}getExposedName(){let e=this.readWebBinding()?.name||this.info.name;if(!e)throw new h(`Property ${this.key} has no exposed name defined`,{code:"E_MISSING_EXPOSED_NAME",status:500});return e}readBinding(e){return this.bindings.find(i=>i.type===e)?.schema||void 0}toApiShape(){return new et().property(this)}toExample(e,t={}){let i=this.toApiShape();return i.range?new St(e,{renderExamples:t.renderExamples??!0,renderMocked:t.renderMocked??!0,renderOptional:t.renderOptional??!0,selectedUnions:t.selectedUnions}).generate(i):void 0}addSemantic(e){let t=Le[e.id];if(!Wi(t))throw new Error(`Invalid semantic type: ${e.id}. Expected a property semantic.`);let i=this.semantics.findIndex(r=>r.id===e.id);i>=0?this.semantics[i]=e:this.semantics.push(e)}removeSemantic(e){let t=this.semantics.findIndex(i=>i.id===e);t>=0&&this.semantics.splice(t,1)}hasSemantic(e){return this.semantics.some(t=>t.id===e)}getSemantic(e){return this.semantics.find(t=>t.id===e)}duplicate(){let e=this.getParentInstance();if(!e)throw new Error(`Cannot duplicate property ${this.key} as it has no parent entity.`);let t=e.fields.findIndex(c=>c.key===this.key);if(t===-1)throw new Error(`Cannot duplicate property ${this.key} as it does not exist on the parent entity fields list.`);let i=this.info.name||"field",r=e.generateUniqueName(i),a=this.toJSON();delete a.key,delete a.primary,a.info?a.info.name=r:a.info={name:r};let s=e.addProperty(a),n=e.fields.length-1,l=e.fields[n];return e.fields.splice(n,1),e.fields.splice(t+1,0,l),s}};var bi=class extends h{static code="E_REMOVE_PROPERTY";static status=500;static message="Error removing a data property.";static help="Make sure the property exists and can be removed."};var At=class o extends Oe{kind;info;required;multiple;schema;bindings;parent;targets;semantics=[];onDelete;readOnly;static createSchema(e={}){let{key:t=R(),semantics:i=[]}=e,r=W.fromJSON(e.info,{name:"new_association"}).toJSON(),a={kind:oe,key:t,info:r};return Array.isArray(i)&&(a.semantics=[...i]),e.onDelete&&(a.onDelete=e.onDelete),typeof e.readOnly=="boolean"&&(a.readOnly=e.readOnly),e.schema&&(a.schema=structuredClone(e.schema)),typeof e.multiple=="boolean"&&(a.multiple=e.multiple),typeof e.required=="boolean"&&(a.required=e.required),Array.isArray(e.bindings)&&(a.bindings=e.bindings.map(s=>structuredClone(s))),Array.isArray(e.targets)&&(a.targets=e.targets.map(s=>({...s}))),a}constructor(e,t,i){let r=o.createSchema(i);super(e,r.key),this.parent=t,this.kind=oe,this.info=new W(r.info),r.schema&&(this.schema=structuredClone(r.schema)),typeof r.multiple=="boolean"&&(this.multiple=r.multiple),typeof r.required=="boolean"&&(this.required=r.required),Array.isArray(r.bindings)?this.bindings=r.bindings.map(a=>structuredClone(a)):this.bindings=[],Array.isArray(r.targets)?this.targets=r.targets.map(a=>({...a})):this.targets=[],Array.isArray(r.semantics)?this.semantics=r.semantics.map(a=>structuredClone(a)):this.semantics=[],r.onDelete&&(this.onDelete=r.onDelete),typeof r.readOnly=="boolean"&&(this.readOnly=r.readOnly)}toJSON(){let e={kind:this.kind,key:this.key,info:this.info.toJSON()};return this.schema&&(e.schema=structuredClone(this.schema)),typeof this.multiple=="boolean"&&(e.multiple=this.multiple),typeof this.required=="boolean"&&(e.required=this.required),Array.isArray(this.bindings)&&this.bindings.length&&(e.bindings=this.bindings.map(t=>structuredClone(t))),Array.isArray(this.targets)&&this.targets.length&&(e.targets=this.targets.map(t=>({...t}))),Array.isArray(this.semantics)&&this.semantics.length&&(e.semantics=this.semantics.map(t=>structuredClone(t))),this.onDelete&&(e.onDelete=this.onDelete),typeof this.readOnly=="boolean"&&this.readOnly&&(e.readOnly=this.readOnly),e}getParentInstance(){return this.root.graph.node(this.parent)}remove(){this.getParentInstance()?.removeAssociation(this.key)}ensureSchema(){return this.schema||(this.schema={}),this.schema}static isValidAttribute(e){return typeof e!="string"?!1:pn.includes(e)}getWebBinding(){let e=this.bindings.find(t=>t.type==="web");return e||(e={type:"web",schema:{}},this.bindings.push(e)),e.schema}readWebBinding(){return this.bindings?.find(t=>t.type==="web")?.schema}getExposedName(){let e=this.readWebBinding()?.name||this.info.name;if(!e)throw new h(`Association ${this.key} has no exposed name defined`,{code:"E_MISSING_EXPOSED_NAME",status:500});return e}readBinding(e){return this.bindings.find(i=>i.type===e)?.schema||void 0}addTarget(e,t){let i;if(typeof e=="string"?i=e:(i=e.key,e.domain.key!==this.root.key&&(t=e.domain.key)),this.targets.some(n=>n.key===i&&n.domain===t)){let n=`Target ${i} already exists.`;throw new Error(n)}if(t&&!this.root.dependencies.has(t))throw new Error(`Foreign namespace "${t}" does not exist.`);let r={key:i};t&&(r.domain=t),this.targets.push(r);let a=t?`${t}:${i}`:i,s={type:"association"};t&&(s.domain=t,s.foreign=!0),this.root.graph.setEdge(this.key,a,s)}removeTarget(e){let t;typeof e=="string"?t=e:t=e.key;let i=this.targets.findIndex(r=>r.key===t);i>=0&&this.targets.splice(i,1),this.root.graph.removeEdge(this.key,t)}*listTargets(){for(let e of this.targets){let{key:t,domain:i}=e,r=i?`${i}:${t}`:t,a=this.root.graph.node(r);a&&(yield a)}}toApiShape(){return new et().associationProperty(this)}addSemantic(e){let t=Le[e.id];if(!Za(t))throw new Error(`Invalid semantic type: ${e.id}. Expected an association semantic.`);let i=this.semantics.findIndex(r=>r.id===e.id);i>=0?this.semantics[i]=e:this.semantics.push(e)}removeSemantic(e){let t=this.semantics.findIndex(i=>i.id===e);t>=0&&this.semantics.splice(t,1)}hasSemantic(e){return this.semantics.some(t=>t.id===e)}getSemantic(e){return this.semantics.find(t=>t.id===e)}duplicate(){let e=this.getParentInstance();if(!e)throw new Error(`Cannot duplicate association ${this.key} as it has no parent entity.`);let t=e.fields.findIndex(c=>c.key===this.key);if(t===-1)throw new Error(`Cannot duplicate association ${this.key} as it does not exist on the parent entity fields list.`);let i=this.info.name||"field",r=e.generateUniqueName(i),a=this.toJSON();delete a.key,delete a.targets,a.info?a.info.name=r:a.info={name:r};let s=e.addAssociation(a);for(let c of this.targets)s.addTarget(c.key,c.domain);let n=e.fields.length-1,l=e.fields[n];return e.fields.splice(n,1),e.fields.splice(t+1,0,l),s}};var xt=class extends Error{messages;status=422;code="E_VALIDATION_ERROR";constructor(e,t){let i=t?.message||"Validation failure";super(i,t),this.messages=e;let r=this.constructor;"captureStackTrace"in Error&&Error.captureStackTrace(this,r)}get[Symbol.toStringTag](){return this.constructor.name}toString(){return`${this.name} [${this.code}]: ${this.message}`}};function ke(o,e){if(!o.hasNode(e))return;let t=o.node(e);if(t){if(t.kind===oe){o.removeNode(e);return}for(let i of o.children(e))ke(o,i);for(let i of o.outEdges(e)){let r=o.edge(i);r&&(r.type==="association"||r.type==="property")&&ke(o,i.w)}o.removeNode(e)}}var Et=class o extends Oe{kind;#e;#t;#i;#r;info;tags;semantics=[];fields;deprecated;static createSchema(e={}){let{key:t=R(),tags:i,semantics:r,fields:a,deprecated:s}=e,n=W.fromJSON(e.info,{name:"new_entity"}).toJSON(),l={kind:J,key:t,info:n};return Array.isArray(i)&&(l.tags=[...i]),Array.isArray(r)&&(l.semantics=[...r]),Array.isArray(a)&&(l.fields=[...a]),typeof s=="boolean"&&(l.deprecated=s),l}constructor(e,t){let i=o.createSchema(t);super(e,i.key),this.kind=J,this.info=new W(i.info),Array.isArray(i.tags)?this.tags=[...i.tags]:this.tags=[],Array.isArray(i.semantics)?this.semantics=i.semantics.map(r=>structuredClone(r)):this.semantics=[],Array.isArray(i.fields)?this.fields=[...i.fields]:this.fields=[],typeof i.deprecated=="boolean"&&(this.deprecated=i.deprecated)}toJSON(){let e={kind:this.kind,key:this.key,info:this.info.toJSON()};return Array.isArray(this.fields)&&this.fields.length&&(e.fields=[...this.fields]),Array.isArray(this.semantics)&&this.semantics.length&&(e.semantics=this.semantics.map(t=>structuredClone(t))),Array.isArray(this.tags)&&this.tags.length&&(e.tags=[...this.tags]),typeof this.deprecated=="boolean"&&(e.deprecated=this.deprecated),e}getParentInstance(){let e=this.root.graph.parent(this.key);if(e)return this.root.graph.node(e)}getExposedName(){let e=this.info.name;if(!e)throw new h(`Entity ${this.key} has no exposed name defined`,{code:"E_MISSING_EXPOSED_NAME",status:500});return e}addProperty(e){if(e&&e.key&&this.root.graph.hasNode(e.key))throw new Error(`Trying to add a property ${e.key}, but it already exists`);let t=new _t(this.root,this.key,e);return this.root.graph.setNode(t.key,t),this.root.graph.setEdge(this.key,t.key,{type:"property"}),this.fields.push({type:"property",key:t.key}),t}removeProperty(e){if(!this.root.graph.hasNode(e))throw new bi(`Trying to remove the ${e} property, but it doesn't exist`);if(this.root.graph.node(e).getParentInstance()!==this)throw new bi(`Trying to remove the ${e} property, but it doesn't belong to this entity`);ke(this.root.graph,e),this.removeField(e)}get properties(){return this.listProperties()}*listProperties(){for(let{key:e,type:t}of this.fields){if(t!=="property")continue;let i=this.root.graph.node(e);!i||i.kind!==Z||(yield i)}}withInheritedProperties(){if(this.root.readOnly&&this.#e)return this.#e.values();let e=new Map,t=this.listAllParents("up");for(let i of t)for(let r of i.properties)r.info.name&&e.set(r.info.name,r);for(let i of this.properties)i.info.name&&e.set(i.info.name,i);return this.root.readOnly&&(this.#e=Array.from(e.values())),e.values()}hasProperties(){return this.fields.some(e=>e.type==="property")}get parents(){return this.listParents()}*listParents(){for(let e of this.root.graph.outEdges(this.key)){let t=this.root.graph.edge(e);if(!t||t.type!=="parent")continue;let i=this.root.graph.node(e.w);i&&(yield i)}}listAllParents(e="up"){if(this.root.readOnly&&this.#t?.[e])return this.#t[e];let t=new Set,i=[],r=[...this.listParents()],a=0;for(;a<r.length;){let s=r[a++];t.has(s.key)||(t.add(s.key),i.push(s),r.push(...s.listParents()))}return e==="down"&&i.reverse(),this.root.readOnly&&(this.#t||(this.#t={}),this.#t[e]=i),i}addParent(e,t){let i=this.domain.buildReferenceKey(e,t);if(i===this.key){let a="Entity cannot be a parent of itself";throw new xt([{field:"parents",message:a,rule:"circular"}],{message:a})}let{graph:r}=this.root;if(!r.hasNode(i)){let a=`Entity with key "${e}" not found`;throw t&&(a+=` in domain "${t}"`),new xt([{field:"parents",message:a,rule:"required"}],{message:a})}if(this.hasCircularParent(i)){let a=`Circular inheritance detected. Cannot add ${e} as a parent`;throw new xt([{field:"parents",message:a,rule:"circular"}],{message:a})}if(r.outEdges(this.key,i).next().value){let a=`Parent ${e} already exists`;throw new xt([{field:"parents",message:a,rule:"unique"}],{message:a})}return t?r.setEdge(this.key,i,{type:"parent",domain:t,foreign:!0}):r.setEdge(this.key,i,{type:"parent"}),this}removeParent(e,t){let{graph:i}=this.root,r=this.domain.buildReferenceKey(e,t);if(!i.hasEdge(this.key,r)){let s=`Trying to remove a parent ${e} from ${this.key}, but it doesn't exist`;throw t&&(s=`Trying to remove a foreign parent ${e} from domain "${t}" from ${this.key}, but it doesn't exist`),new Error(s)}let a=i.edge(this.key,r);if(!a||a.type!=="parent"){let s=`Edge between ${this.key} and ${e} exists but is not a parent relationship`;throw t&&(s=`Edge between ${this.key} and ${e} in domain "${t}" exists but is not a parent relationship`),new Error(s)}return i.removeEdge(this.key,r),this}hasParents(){for(let e of this.root.graph.outEdges(this.key))if(this.root.graph.edge(e)?.type==="parent")return!0;return!1}hasCircularParent(e){let{graph:t}=this.root;for(let r of t.outEdges(e,this.key))if(t.edge(r)?.type==="parent")return!0;let i=t.node(e);for(;i;){if(i.key===this.key)return!0;let r=[...i.listParents()];if(r.length===0)break;i=r[0]}return!1}breadcrumbs(){let e=[];e.push({key:this.key,name:this.info.getLabel("Unnamed entity"),kind:J});let t=this.getParentInstance();if(t){e.push({key:t.key,kind:t.kind,name:t.info.getLabel("Unnamed model")});let i=t.getParentInstance();for(;i&&i!==this.root;)e.push({key:i.key,kind:i.kind,name:i.info.getLabel("Unnamed namespace")}),i=i.getParentInstance()}return e.push({key:this.root.key,name:this.root.info.getLabel("Unnamed data domain"),kind:this.root.kind}),e.reverse()}addAssociation(e={}){let{graph:t}=this.root,i={...e},r=i.targets;delete i.targets;let a=Array.isArray(r)&&r.length;if(a){for(let n of r)if(n.domain&&n.key){let l=`${n.domain}:${n.key}`;if(!t.hasNode(l))throw new Error(`Foreign entity ${l} not found`)}else if(n.key&&!t.hasNode(n.key))throw new Error(`Target entity ${n.key} not found`)}let s=new At(this.root,this.key,i);if(t.setNode(s.key,s),t.setEdge(this.key,s.key,{type:"association"}),a)for(let n of r)s.addTarget(n.key,n.domain);return this.fields.push({type:"association",key:s.key}),s}removeAssociation(e){if(!this.root.graph.hasEdge(this.key,e))throw new Error(`Unable to find a connection between this entity and the ${e} association`);let t=this.root.graph.edge(this.key,e);if(!t||t.type!=="association")throw new Error(`Association ${e} does not exist`);ke(this.root.graph,e),this.removeField(e)}get associations(){return this.listAssociations()}*listAssociations(){for(let{key:e,type:t}of this.fields){if(t!=="association")continue;let i=this.root.graph.node(e);!i||i.kind!==oe||(yield i)}}hasAssociations(){return this.fields.some(e=>e.type==="association")}*listFields(){for(let{key:e}of this.fields){let t=this.root.graph.node(e);t&&(t.kind===oe||t.kind===Z)&&(yield t)}}hasFields(){return this.fields.length>0}removeField(e){this.fields=this.fields.filter(t=>t.key!==e)}toApiShape(){return new et().entity(this)}toExample(e,t={}){let i=this.toApiShape();return new St(e,{renderExamples:t.renderExamples??!0,renderMocked:t.renderMocked??!0,renderOptional:t.renderOptional??!0,selectedUnions:t.selectedUnions}).generate(i)}isChildOf(e){if(this.key===e)return!1;let t=this.getParentInstance();return t?t.key===e?!0:t.isChildOf(e):!1}primaryKey(){for(let t of this.properties)if(t.primary)return t;let e;for(let t of this.listParents()){let i=t.primaryKey();i&&(e=i)}return e}addSemantic(e){let t=Le[e.id];if(!Xa(t))throw new Error(`Invalid semantic type: ${e.id}. Expected an entity semantic.`);let i=this.semantics.findIndex(r=>r.id===e.id);i>=0?this.semantics[i]=e:this.semantics.push(e)}removeSemantic(e){let t=this.semantics.findIndex(i=>i.id===e);t>=0&&this.semantics.splice(t,1)}hasSemantic(e){return this.semantics.some(t=>t.id===e)}getSemantic(e){return this.semantics.find(t=>t.id===e)}withInheritedAssociations(){if(this.root.readOnly&&this.#i)return this.#i.values();let e=new Map,t=this.listAllParents("up");for(let i of t)for(let r of i.associations)r.info.name&&e.set(r.info.name,r);for(let i of this.associations)i.info.name&&e.set(i.info.name,i);return this.root.readOnly&&(this.#i=Array.from(e.values())),e.values()}listAllSemantics(){if(this.root.readOnly&&this.#r)return this.#r;let e=new Map,t=this.listAllParents("up");for(let r of t)for(let a of r.semantics)e.set(a.id,a);for(let r of this.semantics)e.set(r.id,r);let i=Array.from(e.values());return this.root.readOnly&&(this.#r=i),i}generateUniqueName(e){let t=new Set;for(let a of this.listFields())a.info.name&&t.add(a.info.name);let i=2,r=`${e}_copy`;for(;t.has(r);)r=`${e}_copy_${i}`,i++;return r}};var qt=class extends h{static code="E_REMOVE_ENTITY";static status=500;static message="Error removing a data entity.";static help="Make sure the entity exists and can be removed."};var Se=class extends h{static code="E_ATTACH";static status=500;static message="Error attaching the object.";static help="Make sure you are attaching the right object."};var qe=class extends h{static code="E_DETACH";static status=500;static message="Error detaching the object.";static help="Make sure you are detaching the right object."};var tt=class o extends Oe{kind;info;fields;deprecated;static createSchema(e={}){let{key:t=R(),fields:i,deprecated:r}=e,a=W.fromJSON(e.info,{name:"New model"}).toJSON(),s={kind:te,key:t,info:a};return Array.isArray(i)&&(s.fields=[...i]),typeof r=="boolean"&&(s.deprecated=r),s}constructor(e,t){let i=o.createSchema(t);super(e,i.key),this.kind=te,this.info=new W(i.info),Array.isArray(i.fields)?this.fields=[...i.fields]:this.fields=[],typeof i.deprecated=="boolean"?this.deprecated=i.deprecated:this.deprecated=void 0}toJSON(){let e={kind:this.kind,key:this.key,info:this.info.toJSON()};return Array.isArray(this.fields)&&this.fields.length&&(e.fields=[...this.fields]),typeof this.deprecated=="boolean"&&(e.deprecated=this.deprecated),e}getParentInstance(){let e=this.root.graph.parent(this.key);return e?this.root.graph.node(e):this.root}addEntity(e){if(e&&e.key&&this.root.graph.hasNode(e.key))throw new Error(`Entity with key ${e?.key} already exists`);let t=new Et(this.root,e);return this.root.graph.setNode(t.key,t),this.root.graph.setParent(t.key,this.key),this.fields.push({key:t.key,type:"entity"}),t}removeEntity(e){if(!this.root.graph.hasNode(e))throw new qt(`Trying to remove the ${e} entity, but it doesn't exist`);let t=this.root.graph.node(e);if(!t||t.kind!==J)throw new qt(`Trying to remove the ${e} entity, but it is not an entity`);if(t.getParentInstance()!==this)throw new qt(`Trying to remove the ${e} entity, but it is not a child of this model`);ke(this.root.graph,e),this.removeField(e)}attachEntity(e){if(!this.root.graph.hasNode(e))throw new Se(`Trying to attach the ${e} entity, but it doesn't exist`);let t=this.root.graph.node(e);if(!t||t.kind!==J)throw new Se(`Trying to attach the ${e} entity, but it is not a entity`);if(t.domain.key!==this.root.key)throw new Se(`Trying to attach the ${e} entity, but it is not in the same domain`);let i=t.getParentInstance();if(i===this)throw new Se(`Trying to attach the ${e} entity, but it is already a child of this model`);if(i.detachEntity(e),this.fields.some(a=>a.key===e)||this.fields.push({type:"entity",key:e}),this.root.graph.setParent(e,this.key),this.root.graph.parent(e)!==this.key)throw new Se(`Trying to attach the ${e} entity, but it is not a child of this model`);return this}detachEntity(e){let t=this.fields.findIndex(r=>r.key===e);if(t===-1)throw new qe(`Trying to detach the ${e} entity, but it doesn't exist`);let i=this.root.graph.node(e);if(!i||i.kind!==J)throw new qe(`Trying to detach the ${e} entity, but it is not an entity`);if(i.getParentInstance()!==this)throw new qe(`Trying to detach the ${e} entity, but it is not a child of this model`);return this.fields.splice(t,1),this.root.graph.setParent(e),this}*listEntities(){for(let{key:e,type:t}of this.fields){if(t!=="entity")continue;let i=this.root.graph.node(e);!i||i.kind!==J||(yield i)}}hasEntities(){return this.fields.some(e=>e.type==="entity")}breadcrumbs(){let e=[];e.push({key:this.key,name:this.info.getLabel("Unnamed model"),kind:te});let t=this.getParentInstance();for(;t&&t!==this.root;)e.push({key:t.key,kind:t.kind,name:t.info.getLabel("Unnamed namespace")}),t=t.getParentInstance();return e.push({key:this.root.key,name:this.root.info.getLabel("Unnamed data domain"),kind:this.root.kind}),e.reverse()}hasFields(){return this.fields.length>0}removeField(e){this.fields=this.fields.filter(t=>t.key!==e)}isChildOf(e){if(this.key===e)return!1;let t=this.getParentInstance();return t?t.key===e?!0:t===this.root?!1:t.isChildOf(e):!1}};var Nt=class extends h{static code="E_REMOVE_NAMESPACE";static status=500;static message="Error removing a domain namespace.";static help="Make sure the namespace exists and can be removed."};var wi=class extends h{static code="E_REMOVE_MODEL";static status=500;static message="Error removing a domain model.";static help="Make sure the model exists and can be removed."};var jt=class o extends Oe{kind;info;fields;deprecated;static createSchema(e={}){let{key:t=R(),fields:i,deprecated:r}=e,a=W.fromJSON(e.info,{name:"New namespace"}).toJSON(),s={kind:ne,key:t,info:a};return Array.isArray(i)&&(s.fields=[...i]),typeof r=="boolean"&&(s.deprecated=r),s}constructor(e,t){let i=o.createSchema(t);super(e,i.key),this.kind=ne,this.info=new W(i.info),Array.isArray(i.fields)?this.fields=[...i.fields]:this.fields=[],typeof i.deprecated=="boolean"?this.deprecated=i.deprecated:this.deprecated=void 0}toJSON(){let e={kind:this.kind,key:this.key,info:this.info.toJSON()};return Array.isArray(this.fields)&&this.fields.length&&(e.fields=[...this.fields]),typeof this.deprecated=="boolean"&&(e.deprecated=this.deprecated),e}addNamespace(e){if(e&&e.key&&this.root.graph.hasNode(e.key))throw new Error(`Trying to add a namespace to ${this.key}, but it already exists`);let t=new o(this.root,e);return this.root.graph.setNode(t.key,t),this.root.graph.setParent(t.key,this.key),this.fields.push({type:"namespace",key:t.key}),t}removeNamespace(e){if(!this.root.graph.hasNode(e))throw new Nt(`Trying to remove the ${e} namespace, but it doesn't exist`);let t=this.root.graph.node(e);if(!t||t.kind!==ne)throw new Nt(`Trying to remove the ${e} namespace, but it is not a namespace`);return ke(this.root.graph,e),this.removeField(e),this}attachNamespace(e){if(!this.root.graph.hasNode(e))throw new Error(`Trying to attach the ${e} namespace, but it doesn't exist`);let t=this.root.graph.node(e);if(!t||t.kind!==ne)throw new Error(`Trying to attach the ${e} namespace, but it is not a namespace`);if(t.domain.key!==this.root.key)throw new Error(`Trying to attach the ${e} namespace, but it is not in the same domain`);let i=t.getParentInstance();if(i===this)throw new Se(`Trying to attach the ${e} entity, but it is already a child of this model`);return this.root!==i&&i.detachNamespace(e),this.fields.push({type:"namespace",key:e}),this.root.graph.setParent(e,this.key),this}detachNamespace(e){let t=this.fields.findIndex(r=>r.key===e);if(t===-1)throw new Nt(`Trying to detach the ${e} namespace, but it doesn't exist`);let i=this.root.graph.node(e);if(!i||i.kind!==ne)throw new Nt(`Trying to detach the ${e} namespace, but it is not a namespace`);return this.fields.splice(t,1),this.root.graph.setParent(e),this}*listNamespaces(){for(let{key:e,type:t}of this.fields){if(t!=="namespace")continue;let i=this.root.graph.node(e);!i||i.kind!==ne||(yield i)}}hasNamespaces(){return this.fields.some(e=>e.type==="namespace")}addModel(e){if(e&&e.key&&this.root.graph.hasNode(e.key))throw new Error(`Trying to add a model to ${this.key}, but it already exists`);let t=new tt(this.root,e);return this.root.graph.setNode(t.key,t),this.root.graph.setParent(t.key,this.key),this.fields.push({type:"model",key:t.key}),t}removeModel(e){if(!this.root.graph.hasNode(e))throw new wi(`Trying to remove the ${e} model, but it doesn't exist`);let t=this.root.graph.node(e);if(!t||t.kind!==te)throw new wi(`Trying to remove the ${e} model, but it is not a model`);return ke(this.root.graph,e),this.removeField(e),this}attachModel(e){if(!this.root.graph.hasNode(e))throw new Se(`Trying to attach the ${e} model, but it doesn't exist`);let t=this.root.graph.node(e);if(!t||t.kind!==te)throw new Se(`Trying to attach the ${e} model, but it is not a model`);if(t.domain.key!==this.root.key)throw new Se(`Trying to attach the ${e} model, but it is not in the same domain`);let i=t.getParentInstance();if(i===this)throw new Se(`Trying to attach the ${e} model, but it is already a child of this namespace`);return this.root!==i&&i.detachModel(e),this.fields.push({type:"model",key:e}),this.root.graph.setParent(e,this.key),this}detachModel(e){let t=this.fields.findIndex(r=>r.key===e);if(t===-1)throw new qe(`Trying to detach the ${e} model, but it doesn't exist`);let i=this.root.graph.node(e);if(!i||i.kind!==te)throw new qe(`Trying to detach the ${e} model, but it is not a model`);if(i.getParentInstance()!==this)throw new qe(`Trying to detach the ${e} model, but it is not a child of this namespace`);return this.fields.splice(t,1),this.root.graph.setParent(e),this}*listModels(){for(let{key:e,type:t}of this.fields){if(t!=="model")continue;let i=this.root.graph.node(e);!i||i.kind!==te||(yield i)}}hasModels(){return this.fields.some(e=>e.type==="model")}getParentInstance(){let e;for(let t of this.root.graph.parents(this.key)){e=t;break}return e?this.root.graph.node(e):this.root}*listFields(){for(let{key:e}of this.fields){let t=this.root.graph.node(e);t&&(t.kind===ne||t.kind===te)&&(yield t)}}hasFields(){return this.fields.length>0}removeField(e){this.fields=this.fields.filter(t=>t.key!==e)}isChildOf(e){if(this.key===e)return!1;let t=this.getParentInstance();return t?t.key===e?!0:t===this.root?!1:t.isChildOf(e):!1}};function Jt(o,e,t){return o+""+e+""+(t||"\0")}function Na(o,e,t){let i={v:o,w:e};return t&&(i.name=t),i}var _r=class o{isDirectedValue;isMultigraphValue;isCompoundValue;graphLabelValue;nodesValue;#e;get parentValue(){if(!this.isCompoundValue)throw new Error("Cannot access parentValue in a non-compound graph");return this.#e||(this.#e=new Map),this.#e}#t;get childrenValue(){if(!this.isCompoundValue)throw new Error("Cannot access childrenValue in a non-compound graph");return this.#t||(this.#t=new Map),this.#t}inValue;predecessorsValue;outValue;successorsValue;edgeObjectsValue;edgeLabelsValue;nodeCountValue;edgeCountValue;constructor(e={}){this.isDirectedValue=typeof e.directed=="boolean"?e.directed:!0,this.isMultigraphValue=typeof e.multigraph=="boolean"?e.multigraph:!1,this.isCompoundValue=typeof e.compound=="boolean"?e.compound:!1,this.graphLabelValue=void 0,this.nodesValue=new Map,this.isCompoundValue&&this.childrenValue.set("\0",new Set),this.inValue=new Map,this.outValue=new Map,this.predecessorsValue=new Map,this.successorsValue=new Map,this.edgeObjectsValue=new Map,this.edgeLabelsValue=new Map,this.nodeCountValue=0,this.edgeCountValue=0,this.defaultNodeLabelFn=()=>{},this.defaultEdgeLabelFn=()=>{}}isDirected(){return this.isDirectedValue}isMultigraph(){return this.isMultigraphValue}isCompound(){return this.isCompoundValue}setGraph(e){return this.graphLabelValue=e,this}graph(){return this.graphLabelValue}defaultNodeLabelFn(e){}defaultEdgeLabelFn(e,t,i){}setDefaultNodeLabel(e){return typeof e=="function"?this.defaultNodeLabelFn=e:this.defaultNodeLabelFn=()=>e,this}nodeCount(){return this.nodeCountValue}nodes(){return this.nodesValue.keys()}*sources(){for(let e of this.nodes()){let t=this.inValue.get(e);(!t||t.size===0)&&(yield e)}}*sinks(){for(let e of this.nodes()){let t=this.outValue.get(e);(!t||t.size===0)&&(yield e)}}setNodes(e,t){if(typeof t>"u")for(let i of e)this.setNode(i);else for(let i of e)this.setNode(i,t);return this}setNode(e,t){return this.nodesValue.has(e)?(t&&this.nodesValue.set(e,t),this):(this.nodesValue.set(e,t||this.defaultNodeLabelFn(e)),this.isCompoundValue&&(this.parentValue.set(e,new Set(["\0"])),this.childrenValue.set(e,new Set),this.childrenValue.get("\0").add(e)),this.inValue.set(e,new Map),this.predecessorsValue.set(e,new Map),this.outValue.set(e,new Map),this.successorsValue.set(e,new Map),++this.nodeCountValue,this)}node(e){return this.nodesValue.get(e)}hasNode(e){return this.nodesValue.has(e)}removeNode(e){if(!this.hasNode(e))return this;if(this.nodesValue.delete(e),this.isCompoundValue){this.removeFromParentsChildList(e),this.parentValue.delete(e);for(let r of this.children(e))this.removeParent(r,e);this.childrenValue.delete(e)}let t=this.inValue.get(e);if(t){for(let r of t.keys()){let a=this.edgeObjectsValue.get(r);a&&this.removeEdge(a)}this.inValue.delete(e)}this.predecessorsValue.delete(e);let i=this.outValue.get(e);if(i){for(let r of i.keys()){let a=this.edgeObjectsValue.get(r);a&&this.removeEdge(a)}this.outValue.delete(e)}return this.successorsValue.delete(e),this.nodeCountValue-=1,this}setParent(e,t="\0"){if(!this.isCompoundValue)throw new Error("Cannot set parent in a non-compound graph");return t!=="\0"&&(this.checkParentCycle(e,t),this.nodesValue.has(t)||this.setNode(t)),this.nodesValue.has(e)||this.setNode(e),this.removeFromParentsChildList(e),this.parentValue.set(e,new Set),this.parentValue.get(e).add(t),this.childrenValue.has(t)||this.childrenValue.set(t,new Set),this.childrenValue.get(t).add(e),this}checkParentCycle(e,t){for(let i of this.parents(t)){if(i===e)throw new Error(`Setting ${t} as parent of ${e} would create a cycle`);this.checkParentCycle(e,i)}}addParent(e,t){if(!this.isCompoundValue)throw new Error("Cannot set parent in a non-compound graph");return this.checkParentCycle(e,t),this.nodesValue.has(t)||this.setNode(t),this.nodesValue.has(e)||this.setNode(e),this.parentValue.has(e)||this.parentValue.set(e,new Set),this.parentValue.get(e).add(t),this.childrenValue.has(t)||this.childrenValue.set(t,new Set),this.childrenValue.get(t).add(e),this}removeParent(e,t){if(!this.isCompoundValue)throw new Error("Cannot remove parent in a non-compound graph");return this.nodesValue.has(e)?(t?(this.childrenValue.get(t)?.delete(e),this.parentValue.get(e)?.delete(t)):(this.removeFromParentsChildList(e),this.parentValue.set(e,new Set),this.parentValue.get(e).add("\0"),this.childrenValue.get("\0").add(e)),this):this}removeFromParentsChildList(e){let t=this.parentValue.get(e);if(t)for(let i of t)this.childrenValue.get(i)?.delete(e)}*parents(e){if(this.isCompoundValue){let t=this.parentValue.get(e);if(t)for(let i of t)i!=="\0"&&(yield i)}}hasParents(e){for(let t of this.parents(e))return!0;return!1}hasParent(e,t){if(this.isCompoundValue){let i=this.parentValue.get(e);if(i)return i.has(t)}return!1}parent(e){for(let t of this.parents(e))return t}*children(e="\0"){if(this.isCompoundValue){let t=this.childrenValue.get(e);if(t)for(let i of t.keys())yield i}else if(e==="\0")for(let t of this.nodes())yield t}hasChildren(e="\0"){if(this.isCompoundValue){let t=this.childrenValue.get(e);if(!t)return!1;for(let i of t.keys())return!0;return!1}else if(e==="\0"){for(let t of this.nodes())return!0;return!1}return!1}*predecessors(e){let t=this.predecessorsValue.get(e);if(t)for(let i of t.keys())yield i}*successors(e){let t=this.successorsValue.get(e);if(t)for(let i of t.keys())yield i}*neighbors(e){if(!this.hasNode(e))return;let t=new Set;for(let i of this.predecessors(e))t.has(i)||(t.add(i),yield i);for(let i of this.successors(e))t.has(i)||(t.add(i),yield i)}isLeaf(e){if(this.isDirected()){for(let t of this.successors(e))return!1;return!0}for(let t of this.neighbors(e))return!1;return!0}filterNodes(e){let t=new o({directed:this.isDirectedValue,multigraph:this.isMultigraphValue,compound:this.isCompoundValue}),i=this.graph();t.setGraph(i);let r=new Set;if(this.nodesValue.forEach((a,s)=>{e(s)&&(t.setNode(s,a),r.add(s))}),this.edgeObjectsValue.forEach(a=>{r.has(a.v)&&r.has(a.w)&&t.setEdge(a,this.edge(a))}),this.isCompoundValue){let a=new Map;for(let s of t.nodes()){let n=[...this.parents(s)],l=[];for(;n.length>0;){let c=!1;for(let u of n)t.hasNode(u)&&(l.push(u),c=!0);if(c)break;let p=[];for(let u of n)for(let m of this.parents(u))p.push(m);n=p}l.length===0&&l.push("\0"),a.set(s,l)}for(let[s,n]of a){this.removeParent(s);for(let l of n)t.addParent(s,l)}}return t}setDefaultEdgeLabel(e){return typeof e=="function"?this.defaultEdgeLabelFn=e:this.defaultEdgeLabelFn=()=>e,this}edgeCount(){return this.edgeCountValue}edges(){return this.edgeObjectsValue.values()}setPath(e,t){if(!Array.isArray(e)||!e.length)return this;let i=arguments.length>1;return e.reduce((r,a)=>(i?this.setEdge(r,a,t):this.setEdge(r,a),a)),this}setEdge(e,t,i,r){if(typeof e=="object"&&e!==null&&"v"in e){let a=e;arguments.length>1?this._setEdge({loop:0},a,t):this._setEdge({loop:0},a)}else if(typeof t=="string"){let a=Na(e,t,r);arguments.length>2?this._setEdge({loop:0},a,i):this._setEdge({loop:0},a)}else throw new Error("Invalid arguments for setEdge");return this}_setEdge(e,t,i){let r=!1,a;arguments.length>2&&(a=i,r=!0);let s=Jt(t.v,t.w,t.name);if(this.edgeLabelsValue.has(s)){if(r&&this.edgeLabelsValue.set(s,a),e.loop===0&&!this.isDirectedValue&&t.w!==t.v){let u=Na(t.w,t.v,t.name);r?this._setEdge({loop:1},u,i):this._setEdge({loop:1},u)}return}if(t.name&&!this.isMultigraphValue)throw new Error("Cannot set a named edge when isMultigraph = false");this.hasNode(t.v)||this.setNode(t.v),this.hasNode(t.w)||this.setNode(t.w);let l=r?a:this.defaultEdgeLabelFn(t.v,t.w,t.name);this.edgeLabelsValue.set(s,l),this.edgeObjectsValue.set(s,t);let c=this.predecessorsValue.get(t.w);if(c){let u=(c.get(t.v)||0)+1;c.set(t.v,u)}let p=this.successorsValue.get(t.v);if(p){let u=(p.get(t.w)||0)+1;p.set(t.w,u)}if(this.inValue.get(t.w).set(s,t),this.outValue.get(t.v).set(s,t),this.edgeCountValue++,e.loop===0&&!this.isDirectedValue&&t.w!==t.v){let u=Na(t.w,t.v,t.name);r?this._setEdge({loop:1},u,i):typeof l=="object"&&l!==null?this._setEdge({loop:1},u,l):this._setEdge({loop:1},u)}}edge(e,t,i){let r;return typeof e=="object"?r=Jt(e.v,e.w,e.name):r=Jt(e,t,i),this.edgeLabelsValue.get(r)}hasEdge(e,t,i){let r;return typeof e=="object"?r=Jt(e.v,e.w,e.name):r=Jt(e,t,i),this.edgeLabelsValue.has(r)}removeEdge(e,t,i){return typeof e=="object"?this._removeEdge({loop:0},e.v,e.w,e.name):this._removeEdge({loop:0},e,t,i),this}_removeEdge(e,t,i,r){let a=Jt(t,i,r),s=this.edgeObjectsValue.get(a);if(s){this.edgeLabelsValue.delete(a),this.edgeObjectsValue.delete(a);let n=this.predecessorsValue.get(s.w);if(n){let c=(n.get(s.v)||0)-1;c<=0?n.delete(s.v):n.set(s.v,c)}let l=this.successorsValue.get(s.v);if(l){let c=(l.get(s.w)||0)-1;c<=0?l.delete(s.w):l.set(s.w,c)}this.inValue.get(s.w)?.delete(a),this.outValue.get(s.v)?.delete(a),this.edgeCountValue--}!this.isDirectedValue&&e.loop===0&&this._removeEdge({loop:1},i,t,r)}*inEdges(e,t){let i=this.inValue.get(e);if(i){let r=i.values();if(!t){for(let a of r)yield a;return}for(let a of r)a.v===t&&(yield a)}}*outEdges(e,t){let i=this.outValue.get(e);if(!i)return;let r=i.values();if(!t){for(let a of r)yield a;return}for(let a of r)a.w===t&&(yield a)}*nodeEdges(e,t){for(let i of this.inEdges(e,t))yield i;for(let i of this.outEdges(e,t))i.v!==i.w&&(yield i)}};function pc(o,e){let t=[];for(let i of o.nodes()){let r=o.node(i);if(!r||r.domain.key!==e)continue;let a=[...o.parents(i)],s={v:i};s.value=r.toJSON(),a.length&&(s.parents=a),t.push(s)}return t}function uc(o,e){let t=[];for(let i of o.edges()){let r=o.edge(i);if(!r)continue;let a=o.node(i.v),s=o.node(i.w);if(!a||!s||a.domain.key!==e||s.domain.key!==e&&r.type!=="association"&&r.type!=="parent")continue;let n={v:i.v,w:i.w};i.name&&(n.name=i.name),n.value=structuredClone(r),t.push(n)}return t}function mc(o,e){let t=[],i=new Set;for(let r of o.nodes()){let a=o.node(r);a&&a.domain.key===e&&i.add(r)}for(let r of i){let a=o.node(r);if(a){if(a.kind===Z||a.kind===oe){let n=[...o.inEdges(r)].filter(l=>{let c=o.node(l.v);return c&&c.domain.key===e});if(n.length===0){let l=a.kind===Z?"Property":"Association";t.push(`${l} "${a.info.name}" (${r}) has no parent entity edge. This will cause deserialization to fail.`)}else if(n.length>1){let l=a.kind===Z?"Property":"Association",c=n.map(p=>p.v).join(", ");t.push(`${l} "${a.info.name}" (${r}) has multiple parent edges: ${c}. This may cause deserialization issues.`)}else{let l=n[0],c=o.node(l.v);if(!c||c.kind!==J){let p=a.kind===Z?"Property":"Association";t.push(`${p} "${a.info.name}" (${r}) has a parent that is not an entity. Parent: ${c?.kind||"unknown"} (${l.v})`)}}}if(a.kind===J&&([...o.parents(r)].some(l=>{let c=o.node(l);return c&&c.kind===te})||t.push(`Entity "${a.info.name}" (${r}) has no model parent. Entities must belong to a model.`)),a.kind===te){let s=[...o.parents(r)],n=s.some(l=>{let c=o.node(l);return c&&c.kind===ne});if(s.length>0&&!n){let l=s.map(c=>`${o.node(c)?.kind||"unknown"} (${c})`).join(", ");t.push(`Model "${a.info.name}" (${r}) has invalid parent types: ${l}. Models can only belong to namespaces or be at root level.`)}}}}for(let r of i){let a=o.node(r);if(a&&a.kind===oe){let s=a,l=[...o.outEdges(r)].filter(c=>{let p=o.edge(c);return p&&p.type==="association"});l.length;for(let c of l){let p=o.node(c.w);p?p.kind!==J&&t.push(`Association "${s.info.name}" (${r}) references non-entity target: ${p.kind} (${c.w})`):t.push(`Association "${s.info.name}" (${r}) references non-existent target: ${c.w}`)}}}if(t.length>0)throw new Error(`Graph consistency validation failed for domain "${e}":
|
|
155
|
+
`)}if(e.defaultValue)return this._unionDefaultValue(e,e.defaultValue);let n=this._readCurrentUnion(i);if(n)return this.processNode(n,{...t,forceName:e.name})}}_unionDefaultValue(e,t,i={}){let a=new ye().generate(t),n=Fe(e),l=i.indent||0,c=new Array(l*2).fill(" ").join(""),p=[`${c}<${n}>`],u=new Array(l*2+2).fill(" ").join("");return p.push(`${u}${String(a).trim()}`),p.push(`${c}</${n}>`),p.join(`
|
|
156
|
+
`)}_fileShapeObject(){}_schemaShapeObject(){}_tupleShapeObject(){}_anyShapeObject(e){let{and:t=[],xone:i=[],or:r=[]}=e;if(t.length){let n=structuredClone(e);return n.and=[],n.properties=[],t.forEach(l=>{let{types:c}=l;if(c.includes(d.aml.vocabularies.shapes.ScalarShape)){let p=l;n.properties.push(p)}else if(c.includes(d.w3.shacl.NodeShape))l.properties.forEach(u=>n.properties.push(u));else if(c.includes(d.aml.vocabularies.shapes.ArrayShape)||c.includes(d.aml.vocabularies.shapes.MatrixShape)){let p=l;p.items&&n.properties.push(p.items)}}),this._nodeShapeObject(n)}if(i.length){let{selectedUnions:n=[]}=this.opts,l=i.find(c=>n.includes(c.id));return l||(l=i[0]),this.processNode(l)}if(r.length){let{selectedUnions:n=[]}=this.opts,l=r.find(c=>n.includes(c.id));return l||(l=r[0]),this.processNode(l)}let{examples:a=[]}=e,s=Fe(e);if(this.opts.renderExamples&&a&&a.length){let n=a.find(p=>!!p.structuredValue),l=this._exampleToObject(n),c=[];if(typeof l<"u"){let p=" ";c.push(`<${s}>`),c.push(`${p}${l}`),c.push(`</${s}>`)}return c.join(`
|
|
157
|
+
`)}return this._scalarShapeObject(e)}};var ln=Fn(sn(),1);var kr=Symbol("findAmfType"),nn=Symbol("findReferenceObject"),ae=Symbol("getArrayItems"),on=Symbol("computeReferenceSecurity"),Sa=o=>{class e extends o{_amf;__cachedKeys;__lastSetValue;get amf(){return this._amf}set amf(i){if(this._amf===i||this.__lastSetValue===i)return;this.__lastSetValue=i;let r=i?this._expand(i):void 0;this.__cachedKeys={},this._amf=r,this._amfChanged(r)}_amfChanged(i){}_expand(i){return ln.AmfModelExpander.expand(i)}_getAmfKey(i,r){if(!i)return"";let{amf:a}=this;if(!a&&!r)return i;Array.isArray(a)&&([a]=a),this.__cachedKeys||(this.__cachedKeys={});let s=r||a&&a["@context"];if(!s||!i)return i;let n=this.__cachedKeys;if(i in n)return n[i];i=String(i);let l=i.indexOf("#"),c=i.substring(0,l+1),p=Object.keys(s);for(let u=0,m=p.length;u<m;u++){let g=p[u];if(s[g]===i)return n[i]=g,g;if(l===-1&&i.indexOf(s[g])===0){let f=i.replace(s[g],`${g}:`);return n[i]=f,f}if(s[g]===c){let f=`${g}:${i.substring(l+1)}`;return n[i]=f,f}}return i}_ensureAmfModel(i){if(i&&(Array.isArray(i)&&([i]=i),this._hasType(i,d.aml.vocabularies.document.Document)))return i}_ensureArray(i){if(i)return i instanceof Array?i:[i]}_getValue(i,r,a){let s=this._getAmfKey(r,a);if(!s)return;let n=i&&i[s];if(!n)return n;if(Array.isArray(n)&&([n]=n),!n)return;let l=typeof n;return["string","number","boolean","undefined"].includes(l)?n:n["@value"]}_getValueArray(i,r,a){let s=this._getAmfKey(r,a);if(!s)return;let n=i&&this._ensureArray(i[s]);if(Array.isArray(n))return n.map(l=>l["@value"]||l)}[ae](i,r,a){let s=this._getAmfKey(r,a);if(!s)return;let n=i&&this._ensureArray(i[s]);if(Array.isArray(n))return n}_getLinkValue(i,r,a){let s=this._getAmfKey(r,a);if(!s)return;let n=i&&i[s];if(n&&(Array.isArray(n)&&([n]=n),!!n))return n["@id"]}_getLinkValues(i,r,a){let s=this._getAmfKey(r,a);if(!s)return;let n=i&&i[s];if(n)return Array.isArray(n)||(n=[n]),n.map(l=>l["@id"])}_hasType(i,r,a){let s=this._ensureArray(i&&i["@type"]);if(!s||!s.length)return!1;let n=this._getAmfKey(r,a);for(let l of s)if(l===n)return!0;return!1}_hasProperty(i,r,a){let s=this._getAmfKey(r,a);return!!(i&&s&&s in i)}_computePropertyArray(i,r,a){if(!i)return;let s=this._getAmfKey(r,a);if(!s)return;let n=this._ensureArray(i&&i[s]);if(!(!n||!Array.isArray(n)))return n}_computeApiVersion(i,r){let a=this._computeApi(i);if(a)return this._getValue(a,d.aml.vocabularies.core.version,r)}_computeEncodes(i,r){if(!i)return;Array.isArray(i)&&([i]=i);let a=this._getAmfKey(d.aml.vocabularies.document.encodes,r);if(!a)return;let s=i[a];if(s)return Array.isArray(s)?s[0]:s}_computeDeclares(i,r){if(!i||(Array.isArray(i)&&([i]=i),!i))return;let a=this._getAmfKey(d.aml.vocabularies.document.declares,r);if(!a)return;let s=this._ensureArray(i[a]);return Array.isArray(s)?s:void 0}_computeReferences(i,r){if(!i||(Array.isArray(i)&&([i]=i),!i))return;let a=this._getAmfKey(d.aml.vocabularies.document.references,r);if(!a)return;let s=this._ensureArray(i[a]);return s instanceof Array?s:void 0}_computeWebApi(i,r){let a=this._computeEncodes(i,r);if(a&&this._hasType(a,d.aml.vocabularies.apiContract.WebAPI,r))return a}_computeApi(i,r){let a=this._computeEncodes(i,r);if(a&&(this._isAPI(i,r)||this._isWebAPI(i,r)||this._isAsyncAPI(i,r)))return a}_isWebAPI(i,r){let a=this._computeEncodes(i,r);return a?this._hasType(a,d.aml.vocabularies.apiContract.WebAPI,r):!1}_isAsyncAPI(i,r){let a=this._computeEncodes(i,r);return a?this._hasType(a,d.aml.vocabularies.apiContract.AsyncAPI,r):!1}_isAPI(i,r){let a=this._computeEncodes(i,r);return a?this._hasType(a,d.aml.vocabularies.apiContract.API,r):!1}_isValidServerPartial(i,r){if(Array.isArray(i)&&([i]=i),!i)return!1;let a=d.aml.vocabularies.apiContract.Operation,s=d.aml.vocabularies.apiContract.EndPoint,n=[this._getAmfKey(a,r),this._getAmfKey(s,r)],l=i["@type"];for(let c of l)if(n.indexOf(c)!==-1)return!0;return!1}_getServers(i={},r){let{endpointId:a,methodId:s}=i,{amf:n}=this;if(!n)return;let l=this._computeApi(n,r);if(Array.isArray(l)&&([l]=l),!l)if(this._isValidServerPartial(n,r))l=n;else return;let c=this._getAmfKey(d.aml.vocabularies.apiContract.server,r),p=()=>this[ae](l,c,r),u=()=>{let g=this._computeEndpointModel(l,a,r),f=this[ae](g,c,r);return f||p()},m=()=>{let g=this._computeMethodModel(l,s,r),f=this[ae](g,c,r);return f||u()};return s?m():a?u():p()}_computeExpects(i,r){let a=d.aml.vocabularies.apiContract.Operation,s=d.aml.vocabularies.apiContract.expects;if(this._hasType(i,a,r)){let n=this._getAmfKey(s,r),l=this._ensureArray(i[n]);if(l)return Array.isArray(l)?l[0]:l}}_computeEndpoints(i,r){if(!i)return[];let a=d.aml.vocabularies.apiContract.endpoint,s=this._getAmfKey(a,r);return this._ensureArray(i[s])}_computeEndpointModel(i,r,a){if(this._hasType(i,d.aml.vocabularies.apiContract.EndPoint,a))return i;let s=this._computeEndpoints(i,a);if(s)return s.find(n=>n["@id"]===r)}_computeMethodModel(i,r,a){let s=this.__computeMethodsListForMethod(i,r,a);if(s)return s.find(n=>n["@id"]===r)}_computeMethodEndpoint(i,r,a){if(!i||!r)return;if(this._hasType(i,d.aml.vocabularies.apiContract.EndPoint,a))return i;let s=this._computeEndpoints(i,a);if(!s)return;let n=this._getAmfKey(d.aml.vocabularies.apiContract.supportedOperation,a);for(let l=0,c=s.length;l<c;l++){let p=s[l],u=p[n];if(u){Array.isArray(u)||(u=[u]);for(let m=0,g=u.length;m<g;m++)if(u[m]["@id"]===r)return p}}}__computeMethodsListForMethod(i,r,a){let s=this._computeMethodEndpoint(i,r,a);if(!s)return;let n=this._getAmfKey(d.aml.vocabularies.apiContract.supportedOperation,a);return this._ensureArray(s[n])}_computeType(i,r,a,s){if(!i&&!r||!a)return;let n=a.replace("amf://id",""),l=i&&i.find(c=>c["@id"]===a||c["@id"]===n);if(!l&&r&&r.length)for(let c=0,p=r.length;c<p&&!(this._hasType(r[c],d.aml.vocabularies.document.Module)&&(l=this._computeReferenceType(r[c],a,s),l));c++);return l}[kr](i,r){let{amf:a}=this;if(!a||!i)return;Array.isArray(a)&&([a]=a);let s=this._computeDeclares(a,r),n=i.replace("amf://id","");if(Array.isArray(s)){let l=s.find(c=>c["@id"]===i||c["@id"]===n);if(l)return l}return this[nn](i)}[nn](i,r){let{amf:a}=this;if(Array.isArray(a)&&([a]=a),!a)return;let s=this._computeReferences(a,r);if(!Array.isArray(s)||!s.length)return;let n=i.replace("amf://id","");for(let l=0,c=s.length;l<c;l++){let p=s[l],u=this._computeDeclares(p,r);if(Array.isArray(u))for(let m=0,g=u.length;m<g;m++){let f=u[m];if(Array.isArray(f)&&([f]=f),f["@id"]===i||f["@id"]===n)return f}}}_computeReferenceType(i,r,a){let s=this._computeDeclares(i,a);if(!s||!r)return;let n=r.replace("amf://id",""),l=s.find(c=>(Array.isArray(c)&&([c]=c),c["@id"]===r||c["@id"]===n));return Array.isArray(l)&&([l]=l),this._resolve(l)}_computeDocument(i,r,a){if(!i||!r)return;let s=this._getAmfKey(d.aml.vocabularies.core.documentation,a),n=this._ensureArray(i[s]);return n&&n.find(l=>l["@id"]===r)}_resolve(i,r){let{amf:a}=this;if(typeof i!="object"||Array.isArray(i)||!a||i.__apicResolved)return i;let s=this._getAmfKey(d.aml.vocabularies.document.linkTarget,r),n=this._ensureArray(i[s]),l;if(n){let u=n[0]["@id"];if(u===i["@id"])return i.__apicResolved=!0,i;l=this._getLinkTarget(a,u,r)}else if(s=this._getAmfKey(d.aml.vocabularies.document.referenceId,r),n=this._ensureArray(i[s]),n){let u=n[0]["@id"];if(u===i["@id"])return i.__apicResolved=!0,i;l=this._getReferenceId(a,u,r)}if(!l)return this._resolveRecursive(i),i.__apicResolved=!0,i;let c={...l};delete c["@id"];let p=c["@type"];return p&&(i["@type"]?i["@type"]=i["@type"].concat(p):i["@type"]=p,delete c["@type"]),this._mergeShapes(i,c,r),i.__apicResolved=!0,this._resolveRecursive(i),i}_getLinkTarget(i,r,a){if(!i||!r)return;let s,n=this._computeDeclares(i,a);if(n&&(s=this._findById(n,r)),!s){let l=this._computeReferences(i,a);s=this._obtainShapeFromReferences(l,r,a)}if(s)return s=this._resolve(s),s}_obtainShapeFromReferences(i,r,a){if(!Array.isArray(i)||!i.length)return;let s;for(let n of i){let l=this._computeEncodes(n,a);if(l&&l["@id"]===r){s=l;break}if(!l&&(s=this._findById(this._computeDeclares(n,a),r),s))break}return s}_findById(i,r){if(!i)return;let a;for(let s of i)if(s&&s["@id"]===r){a=s;break}return a}_getReferenceId(i,r,a){if(!i||!r)return;let s=this._computeReferences(i,a);if(s)for(let n of s){let l=this._computeEncodes(n,a);if(l&&l["@id"]===r)return l}}_resolveRecursive(i,r){Object.keys(i).forEach(a=>{let s=i[a];if(Array.isArray(s))for(let n=0,l=s.length;n<l;n++)s[n]=this._resolve(s[n]);else typeof s=="object"&&(i[a]=this._resolve(s,r))})}_mergeShapes(i,r,a){let s={...i,...r};return[{key:this._getAmfKey(d.aml.vocabularies.docSourceMaps.sources,a),merger:this._mergeSourceMapsSources.bind(this)}].forEach(({key:l,merger:c})=>{this._hasProperty(s,l,a)&&(s[l]=c(i,r,a))}),Object.assign(i,s)}_mergeSourceMapsSources(i,r,a){let s=this._getAmfKey(d.aml.vocabularies.docSourceMaps.sources,a),n=i[s]||{};Array.isArray(n)&&(n=n[0]);let l=r[s]||{};return Array.isArray(l)&&(l=l[0]),[Object.assign(n,l)]}_expandKey(i,r){let{amf:a}=this;if(!i||typeof i!="string"||!a&&!r)return i;Array.isArray(a)&&([a]=a);let s=r||a&&a["@context"];if(!s)return i;let[n,l]=i.split(":");if(!n||!l)return i;let c=s[n];return c?`${c}${l}`:i}findSecurityScheme(i,r){let{amf:a}=this,s=this._computeDeclares(a,r),n;if(s&&(n=s.find(c=>c["@id"]===i)),n)return n=this._resolve(n),n;let l=this._computeReferences(a,r);if(Array.isArray(l)&&l.length){for(let c of l)if(this._hasType(c,d.aml.vocabularies.document.Module,r)&&(n=this[on](c,i,r),n))return n=this._resolve(n),n}}[on](i,r,a){let s=this._computeDeclares(i,a);if(!s)return;let n=s.find(l=>{let c=l;return Array.isArray(c)&&([c]=c),c["@id"]===r});return Array.isArray(n)&&([n]=n),this._resolve(n)}getByType(i,r,a){if(!i)return[];let s=[],n=this._computeDeclares(i),l=this._getAmfKey(r,a);n&&n.length&&n.forEach(p=>{this._hasType(p,l)&&s.push(p)});let c=this._computeReferences(i);if(Array.isArray(c)&&c.length){for(let p of c)if(this._hasType(p,d.aml.vocabularies.document.Module)){let u=this.getByType(p,r,a);u.length&&(s=s.concat(u))}}return s}}return e};var _a=class extends Sa(Object){constructor(e){super(),e&&(this.amf=e)}readTypes(e,t){let i=e;return typeof i=="string"&&(i=[i]),Array.isArray(i)?i.map(r=>this._expandKey(r,t)):[]}apiSummary(e){let t=e["@context"],i={id:e["@id"],types:this.readTypes(e["@type"],t),customDomainProperties:this.customDomainProperties(e,t),sourceMaps:this.sourceMap(e),schemes:[],accepts:[],contentType:[],documentations:[],tags:[]},r=this._getValue(e,d.aml.vocabularies.core.name,t);r&&typeof r=="string"&&(i.name=r);let a=this._getValue(e,d.aml.vocabularies.core.description,t);a&&typeof a=="string"&&(i.description=a);let s=this._getValue(e,d.aml.vocabularies.core.version,t);s&&typeof s=="string"&&(i.version=s);let n=this._getValue(e,d.aml.vocabularies.core.termsOfService,t);n&&typeof n=="string"&&(i.termsOfService=n);let l=e[this._getAmfKey(d.aml.vocabularies.apiContract.accepts,t)];Array.isArray(l)&&l.length&&(i.accepts=this._getValueArray(e,d.aml.vocabularies.apiContract.accepts,t));let c=e[this._getAmfKey(d.aml.vocabularies.apiContract.contentType,t)];Array.isArray(c)&&c.length&&(i.contentType=this._getValueArray(e,d.aml.vocabularies.apiContract.contentType,t));let p=e[this._getAmfKey(d.aml.vocabularies.apiContract.scheme,t)];Array.isArray(p)&&p.length&&(i.schemes=this._getValueArray(e,d.aml.vocabularies.apiContract.scheme,t));let u=e[this._getAmfKey(d.aml.vocabularies.core.provider,t)];Array.isArray(u)&&([u]=u),u&&(i.provider=this.provider(u));let m=e[this._getAmfKey(d.aml.vocabularies.core.license,t)];Array.isArray(m)&&([m]=m),m&&(i.license=this.license(m));let g=e[this._getAmfKey(d.aml.vocabularies.apiContract.tag,t)];Array.isArray(g)&&g.length&&(i.tags=g.map(b=>this.tag(b)));let f=e[this._getAmfKey(d.aml.vocabularies.core.documentation,t)];return Array.isArray(f)&&f.length&&(i.documentations=f.map(b=>this.documentation(b))),i}api(e,t){let i=t||e["@context"],r=this.apiSummary(e);r.endPoints=[],r.servers=[],r.security=[];let a=e[this._getAmfKey(d.aml.vocabularies.apiContract.endpoint,i)];Array.isArray(a)&&a.length&&(r.endPoints=a.map(l=>this.endPoint(l,i)));let s=e[this._getAmfKey(d.aml.vocabularies.apiContract.server,i)];Array.isArray(s)&&s.length&&(r.servers=s.map(l=>this.server(l,i)));let n=e[this._getAmfKey(d.aml.vocabularies.security.security,i)];return Array.isArray(n)&&n.length&&(r.security=n.map(l=>this.securityRequirement(l,i))),r}webApi(e,t){return this.api(e,t)}asyncApi(e,t){return this.api(e,t)}provider(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getLinkValue(e,d.aml.vocabularies.core.url,i);s&&typeof s=="string"&&(r.url=s);let n=this._getValue(e,d.aml.vocabularies.core.email,i);return n&&typeof n=="string"&&(r.email=n),r}license(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getLinkValue(e,d.aml.vocabularies.core.url,i);return s&&typeof s=="string"&&(r.url=s),r}server(e,t){let i=t||e["@context"],r=this._getValue(e,d.aml.vocabularies.core.urlTemplate,i)||"",a={id:e["@id"],types:this.readTypes(e["@type"],i),url:r,variables:[],customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},s=this._getValue(e,d.aml.vocabularies.core.description,i);s&&typeof s=="string"&&(a.description=s);let n=e[this._getAmfKey(d.aml.vocabularies.apiContract.variable,i)];Array.isArray(n)&&n.length&&(a.variables=n.map(u=>this.parameter(u,i)));let l=this._getValue(e,d.aml.vocabularies.apiContract.protocol,i),c=this._getValue(e,d.aml.vocabularies.apiContract.protocolVersion,i);l&&(a.protocol=l),c&&(a.protocolVersion=c);let p=e[this._getAmfKey(d.aml.vocabularies.security.security,i)];return Array.isArray(p)&&p.length&&(a.security=p.map(u=>this.securityRequirement(u,i))),a}parameter(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),payloads:[],examples:[],customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.apiContract.paramName,i);s&&typeof s=="string"&&(r.paramName=s);let n=this._getValue(e,d.aml.vocabularies.core.description,i);n&&typeof n=="string"&&(r.description=n);let l=this._getValue(e,d.aml.vocabularies.apiContract.required,i);typeof l=="boolean"&&(r.required=l);let c=this._getValue(e,d.aml.vocabularies.apiContract.allowEmptyValue,i);typeof c=="boolean"&&(r.allowEmptyValue=c);let p=this._getValue(e,d.aml.vocabularies.document.deprecated,i);typeof p=="boolean"&&(r.deprecated=p);let u=this._getValue(e,d.aml.vocabularies.apiContract.explode,i);typeof u=="boolean"&&(r.explode=u);let m=this._getValue(e,d.aml.vocabularies.apiContract.allowReserved,i);typeof m=="boolean"&&(r.allowReserved=m);let g=this._getValue(e,d.aml.vocabularies.apiContract.style,i);g&&typeof g=="string"&&(r.style=g);let f=this._getValue(e,d.aml.vocabularies.apiContract.binding,i);f&&typeof f=="string"&&(r.binding=f);let b=e[this._getAmfKey(d.aml.vocabularies.shapes.schema,i)];if(Array.isArray(b)&&b.length){let[E]=b;r.schema=this.unknownShape(E,{trackedId:e["@id"]},i)}let v=e[this._getAmfKey(d.aml.vocabularies.apiContract.payload,i)];Array.isArray(v)&&v.length&&(r.payloads=v.map(E=>this.payload(E,i)));let S=e[this._getAmfKey(d.aml.vocabularies.apiContract.examples,i)];return Array.isArray(S)&&S.length&&(r.examples=S.map(E=>this.example(E,i))),r}unknownShape(e,t,i){let r=i||e["@context"],a=this.readTypes(e["@type"],r);return a.includes(d.aml.vocabularies.shapes.ScalarShape)?this.scalarShape(e,t,r):a.includes(d.w3.shacl.NodeShape)?this.nodeShape(e,t,r):a.includes(d.aml.vocabularies.shapes.UnionShape)?this.unionShape(e,t,r):a.includes(d.aml.vocabularies.shapes.FileShape)?this.fileShape(e,t,r):a.includes(d.aml.vocabularies.shapes.SchemaShape)?this.schemaShape(e,t,r):a.includes(d.aml.vocabularies.shapes.TupleShape)?this.tupleShape(e,t,r):a.includes(d.aml.vocabularies.shapes.ArrayShape)||a.includes(d.aml.vocabularies.shapes.MatrixShape)?this.arrayShape(e,t,r):a.includes(d.aml.vocabularies.shapes.RecursiveShape)?this.recursiveShape(e,r):this.anyShape(e,t,r)}isLink(e,t){let i=t||e["@context"];return!!this._getLinkValue(e,d.aml.vocabularies.document.linkTarget,i)}getLinkTarget(e,t){let i=t||e["@context"],r=this._getLinkValue(e,d.aml.vocabularies.document.linkTarget,i);if(r)return this[kr](r,i)}shape(e,t){let i=t||e["@context"];this._resolve(e);let r,a=e;if(this.isLink(a)){r=this._getValue(a,d.aml.vocabularies.document.linkLabel,i);let F=this._getLinkValue(a,d.aml.vocabularies.document.linkTarget,i),ce=this[kr](F,i);ce&&(a=ce)}let s={id:a["@id"],types:this.readTypes(e["@type"],i),values:[],inherits:[],or:[],and:[],xone:[],customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)};r&&(s.linkLabel=r);let n=this._getValue(a,d.w3.shacl.name,i);n&&typeof n=="string"&&(s.name=n);let l=this._getValue(a,d.aml.vocabularies.core.displayName,i);if(l&&typeof l=="string")s.displayName=l;else{let F=this._getValue(a,d.aml.vocabularies.core.name,i);F&&typeof F=="string"&&(s.displayName=F)}let c=this._getValue(a,d.aml.vocabularies.core.description,i);c&&typeof c=="string"&&(s.description=c);let p=this._getValue(a,d.w3.shacl.defaultValueStr,i);p&&typeof p=="string"&&(s.defaultValueStr=p);let u=this._getValue(a,d.aml.vocabularies.shapes.deprecated,i);typeof u=="boolean"&&(s.deprecated=u);let m=this._getValue(a,d.aml.vocabularies.shapes.readOnly,i);typeof m=="boolean"&&(s.readOnly=m);let g=this._getValue(a,d.aml.vocabularies.shapes.writeOnly,i);typeof g=="boolean"&&(s.writeOnly=g);let f=a[this._getAmfKey(d.w3.shacl.defaultValue,i)];Array.isArray(f)&&f.length&&(s.defaultValue=this.unknownDataNode(f[0],i));let b=this._getAmfKey(d.w3.shacl.or,i),v=a[b];Array.isArray(v)&&v.length&&(s.or=v.map(F=>this.unknownShape(F,void 0,i)));let S=this._getAmfKey(d.w3.shacl.and,i),E=a[S];Array.isArray(E)&&E.length&&(s.and=E.map(F=>this.unknownShape(F,void 0,i)));let V=this._getAmfKey(d.w3.shacl.xone,i),U=a[V];Array.isArray(U)&&U.length&&(s.xone=U.map(F=>this.unknownShape(F,void 0,i)));let L=a[this._getAmfKey(d.w3.shacl.in,i)];if(Array.isArray(L)&&L.length){let[F]=L,ce=d.w3.rdfSchema.key,me=this._getAmfKey(ce,i);Object.keys(F).forEach(fe=>{if(fe.startsWith(ce)||fe.startsWith(me)){let Ge=F[fe];Array.isArray(Ge)&&([Ge]=Ge);let gt=this.unknownDataNode(Ge,i);gt&&s.values.push(gt)}})}let P=this._getAmfKey(d.w3.shacl.not,i),le=a[P];return le&&(Array.isArray(le)&&([le]=le),s.not=this.unknownShape(le,void 0,i)),s}anyShape(e,t={},i){let r=i||e["@context"],a=e,s=this.shape(a,r);if(this.isLink(a)){let p=this.getLinkTarget(a,r);p&&(a=p)}s.examples=[];let n=a[this._getAmfKey(d.aml.vocabularies.apiContract.examples,r)];if(Array.isArray(n)&&n.length)if(t.trackedId){let p=this.filterTrackedExamples(n,t.trackedId,r);s.examples=p.map(u=>this.example(u,r))}else{let p=this.filterNonTrackedExamples(n,r);s.examples=p.map(u=>this.example(u,r))}let l=a[this._getAmfKey(d.aml.vocabularies.core.documentation,r)];if(Array.isArray(l)&&l.length){let[p]=l;s.documentation=this.documentation(p,r)}let c=a[this._getAmfKey(d.aml.vocabularies.shapes.xmlSerialization,r)];return Array.isArray(c)&&c.length&&(s.xmlSerialization=this.xmlSerializer(c[0],r)),s}filterTrackedExamples(e,t,i){let{docSourceMaps:r}=d.aml.vocabularies,a=this._getAmfKey(r.sources,i),s=this._getAmfKey(r.trackedElement,i),n=t.indexOf("amf")===-1?`amf://id${t}`:t;return e.filter(l=>{let c=l;Array.isArray(c)&&([c]=c);let p=c[a];if(!p)return!0;Array.isArray(p)&&([p]=p);let u=p[s];if(!u)return!0;Array.isArray(u)&&([u]=u);let{value:m}=this.synthesizedField(u,i);if(!m)return!0;let g=m.split(",");return g.indexOf(n)!==-1||g.indexOf(t)!==-1})}filterNonTrackedExamples(e,t){let{docSourceMaps:i}=d.aml.vocabularies,r=this._getAmfKey(i.sources,t),a=this._getAmfKey(i.trackedElement,t);return e.filter(s=>{let n=s;Array.isArray(n)&&([n]=n);let l=n[r];if(!l)return!0;Array.isArray(l)&&([l]=l);let c=l[a];if(!c)return!0;Array.isArray(c)&&([c]=c);let{value:p}=this.synthesizedField(c,t);return!p})}scalarShape(e,t={},i){let r=i||e["@context"],a=e,s=this.anyShape(a,t,r);if(this.isLink(a)){let b=this.getLinkTarget(a,r);b&&(a=b)}let n=this._getValue(a,d.w3.shacl.pattern,r);n&&typeof n=="string"&&(s.pattern=n);let l=this._getLinkValue(a,d.w3.shacl.datatype,r);l&&typeof l=="string"&&(s.dataType=l);let c=this._getValue(a,d.aml.vocabularies.shapes.format,r);c&&typeof c=="string"&&(s.format=c);let p=this._getValue(a,d.aml.vocabularies.shapes.multipleOf,r);typeof p=="number"&&(s.multipleOf=p);let u=this._getValue(a,d.w3.shacl.minInclusive,r);typeof u=="number"&&(s.minimum=u,s.exclusiveMinimum=!1);let m=this._getValue(a,d.w3.shacl.maxInclusive,r);typeof m=="number"&&(s.maximum=m,s.exclusiveMaximum=!1);let g=this._getValue(a,d.w3.shacl.minLength,r);typeof g=="number"&&(s.minLength=g);let f=this._getValue(a,d.w3.shacl.maxLength,r);return typeof f=="number"&&(s.maxLength=f),s}nodeShape(e,t={},i){let r=i||e["@context"],a=e,s=this.anyShape(a,t,r);if(this.isLink(a)){let m=this.getLinkTarget(a,r);m&&(a=m)}let n=this._getValue(a,d.aml.vocabularies.shapes.discriminator,r);n&&typeof n=="string"&&(s.discriminator=n);let l=this._getValue(a,d.aml.vocabularies.shapes.discriminatorValue,r);l&&typeof l=="string"&&(s.discriminatorValue=l);let c=this._getValue(a,d.w3.shacl.closed,r);typeof c=="boolean"&&(s.closed=c),s.customShapeProperties=[],s.customShapePropertyDefinitions=[],s.dependencies=[];let p=a[this._getAmfKey(d.w3.shacl.property,r)];Array.isArray(p)&&p.length?s.properties=p.map(m=>this.propertyShape(m,r)):s.properties=[];let u=a[this._getAmfKey(d.w3.shacl.additionalPropertiesSchema,r)];if(Array.isArray(u)&&u.length===1){let[m]=u;s.additionalPropertiesSchema=this.unknownShape(m,void 0,r)}return s}propertyShape(e,t){let i=t||e["@context"],r=e,a=this.shape(r,i);if(this.isLink(r)){let p=this.getLinkTarget(r,i);p&&(r=p)}let s=this._getLinkValue(r,d.w3.shacl.path,i);s&&typeof s=="string"&&(a.path=s);let n=this._getValue(r,d.w3.shacl.minCount,i);typeof n=="number"&&(a.minCount=n);let l=this._getValue(r,d.w3.shacl.maxCount,i);typeof l=="number"&&(a.maxCount=l);let c=r[this._getAmfKey(d.aml.vocabularies.shapes.range,i)];if(Array.isArray(c)&&c.length){let[p]=c;a.range=this.unknownShape(p,void 0,i)}return a}unionShape(e,t={},i){let r=i||e["@context"],a=e[this._getAmfKey(d.aml.vocabularies.shapes.anyOf,r)],s=this.anyShape(e,t,r);if(Array.isArray(a)&&a.length){let n={...t,trackedId:void 0};s.anyOf=a.map(l=>this.unknownShape(l,n,r))}else s.anyOf=[];return s}fileShape(e,t={},i){let r=i||e["@context"],a=e,s=this.anyShape(a,t,r);if(this.isLink(a)){let b=this.getLinkTarget(a,r);b&&(a=b)}let n=this._getValue(a,d.w3.shacl.pattern,r);n&&typeof n=="string"&&(s.pattern=n);let l=this._getValueArray(a,d.aml.vocabularies.shapes.fileType,r);Array.isArray(l)&&l.length&&(s.fileTypes=l);let c=this._getValue(a,d.w3.shacl.minLength,r);typeof c=="number"&&(s.minLength=c);let p=this._getValue(a,d.w3.shacl.maxLength,r);typeof p=="number"&&(s.maxLength=p);let u=this._getValue(a,d.w3.shacl.minInclusive,r);typeof u=="number"&&(s.minimum=u,s.exclusiveMinimum=!1);let m=this._getValue(a,d.w3.shacl.maxInclusive,r);typeof m=="number"&&(s.maximum=m,s.exclusiveMaximum=!1);let g=this._getValue(a,d.aml.vocabularies.shapes.format,r);g&&typeof g=="string"&&(s.format=g);let f=this._getValue(a,d.aml.vocabularies.shapes.multipleOf,r);return typeof f=="number"&&(s.multipleOf=f),s}schemaShape(e,t={},i){let r=i||e["@context"],a=e,s=this.anyShape(a,t,r);if(this.isLink(a)){let c=this.getLinkTarget(a,r);c&&(a=c)}let n=this._getValue(a,d.aml.vocabularies.core.mediaType,r);n&&typeof n=="string"&&(s.mediaType=n);let l=this._getValue(a,d.aml.vocabularies.document.raw,r);return l&&typeof l=="string"&&(s.raw=l),s}recursiveShape(e,t){let i=t||e["@context"],r=e,a=this.shape(r,i);if(this.isLink(r)){let n=this.getLinkTarget(r,i);n&&(r=n)}let s=this._getLinkValue(r,d.aml.vocabularies.shapes.fixPoint,i);return s&&typeof s=="string"&&(a.fixPoint=s),a}dataArrangeShape(e,t={},i){let r=i||e["@context"];return this.anyShape(e,t,r)}arrayShape(e,t={},i){let r=i||e["@context"],a=e,s=this.dataArrangeShape(a,t,r);if(this.isLink(a)){let l=this.getLinkTarget(a,r);l&&(a=l)}let n=a[this._getAmfKey(d.aml.vocabularies.shapes.items,r)];if(Array.isArray(n)&&n.length){let[l]=n;s.items=this.unknownShape(l,void 0,r)}return s}tupleShape(e,t,i){let r=i||e["@context"],a=e,s=this.dataArrangeShape(a,t,r);if(this.isLink(a)){let c=this.getLinkTarget(a,r);c&&(a=c)}let n=a[this._getAmfKey(d.aml.vocabularies.shapes.items,r)],l=this._getAmfKey(d.w3.rdfSchema.key,r);return Array.isArray(n)&&n.length?(s.items=[],n.forEach(c=>{Array.isArray(c)&&([c]=c),Object.keys(c).filter(p=>p.startsWith(l)).forEach(p=>{let u=c[p];Array.isArray(u)&&([u]=u);let m=this.unknownShape(u,void 0,r);s.items.push(m)})})):s.items=[],s}documentation(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getLinkValue(e,d.aml.vocabularies.core.url,i);a&&typeof a=="string"&&(r.url=a);let s=this._getValue(e,d.aml.vocabularies.core.description,i);s&&typeof s=="string"&&(r.description=s);let n=this._getValue(e,d.aml.vocabularies.core.title,i);return n&&typeof n=="string"&&(r.title=n),r}example(e,t){let i=t||e["@context"];this._resolve(e);let r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),strict:!1},a=this._getValue(e,d.aml.vocabularies.document.strict,i);typeof a=="boolean"&&(r.strict=a);let s=this._getValue(e,d.aml.vocabularies.core.name,i);s&&typeof s=="string"&&(r.name=s);let n=this._getValue(e,d.aml.vocabularies.core.displayName,i);n&&typeof n=="string"&&(r.displayName=n);let l=this._getValue(e,d.aml.vocabularies.core.description,i);l&&typeof l=="string"&&(r.description=l);let c=this._getValue(e,d.aml.vocabularies.document.raw,i);c&&typeof c=="string"&&(r.value=c);let p=this._getValue(e,d.aml.vocabularies.document.location,i);p&&typeof p=="string"&&(r.location=p);let u=e[this._getAmfKey(d.aml.vocabularies.document.structuredValue,i)];if(Array.isArray(u)&&u.length){let[m]=u;r.structuredValue=this.unknownDataNode(m,i)}return r}xmlSerializer(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.shapes.xmlAttribute,i);typeof a=="boolean"&&(r.attribute=a);let s=this._getValue(e,d.aml.vocabularies.shapes.xmlWrapped,i);typeof s=="boolean"&&(r.wrapped=s);let n=this._getValue(e,d.aml.vocabularies.shapes.xmlName,i);n&&typeof n=="string"&&(r.name=n);let l=this._getValue(e,d.aml.vocabularies.shapes.xmlNamespace,i);l&&typeof l=="string"&&(r.namespace=l);let c=this._getValue(e,d.aml.vocabularies.shapes.xmlPrefix,i);return c&&typeof c=="string"&&(r.prefix=c),r}unknownDataNode(e,t){let i=this.readTypes(e["@type"],t);if(i.includes(d.aml.vocabularies.data.Scalar))return this.scalarNode(e,t);if(i.includes(d.aml.vocabularies.data.Object))return this.objectNode(e,t);if(i.includes(d.aml.vocabularies.data.Array))return this.arrayNode(e,t)}dataNode(e,t){let i={id:e["@id"],types:this.readTypes(e["@type"],t),customDomainProperties:this.customDomainProperties(e,t)},r=this._getValue(e,d.aml.vocabularies.core.name,t);return r&&typeof r=="string"&&(i.name=r),i}scalarNode(e,t){let i=t||e["@context"],r=this.dataNode(e,t),a=this._getValue(e,d.aml.vocabularies.data.value,i);a&&typeof a=="string"&&(r.value=a);let s=this._getLinkValue(e,d.w3.shacl.datatype,i);return s&&typeof s=="string"&&(r.dataType=s),r}objectNode(e,t){let i=t||e["@context"],r=this.dataNode(e,t);r.properties={};let a=d.aml.vocabularies.data.key,s=`${this._getAmfKey(a,i)}:`;return Object.keys(e).forEach(n=>{if(n.startsWith(a)||n.startsWith(s)){let l=e[n];Array.isArray(l)&&([l]=l);let c=n.replace(a,"").replace(s,""),p=this.unknownDataNode(l,t);p&&(r.properties[c]=p)}}),r}arrayNode(e,t){let i=t||e["@context"],r=this.dataNode(e,i);r.members=[];let a=this._computePropertyArray(e,d.w3.rdfSchema.member);return Array.isArray(a)&&a.length&&a.forEach(s=>{let n=this.unknownDataNode(s);n&&r.members.push(n)}),r}customDomainProperties(e,t){let i=[],r=t||e["@context"],a=this._getLinkValues(e,d.aml.vocabularies.document.customDomainProperties,r);return Array.isArray(a)&&a.length&&a.forEach(s=>{let n=`@base:${s}`,l=e[s]||e[n];if(!l)return;Array.isArray(l)&&([l]=l);let c=this.unknownDataNode(l,r),p=this._getValue(l,d.aml.vocabularies.core.extensionName,r);if(!p||!c)return;let u={id:s,name:p,extension:c};i.push(u)}),i}endPoint(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e),path:"",operations:[],parameters:[],payloads:[],servers:[],security:[],extends:[]},a=this._getValue(e,d.aml.vocabularies.apiContract.path,i);a&&typeof a=="string"&&(r.path=a);let s=this._getValue(e,d.aml.vocabularies.core.name,i);s&&typeof s=="string"&&(r.name=s);let n=this._getValue(e,d.aml.vocabularies.core.description,i);n&&typeof n=="string"&&(r.description=n);let l=this._getValue(e,d.aml.vocabularies.core.summary,i);l&&typeof l=="string"&&(r.summary=l);let c=this[ae](e,d.aml.vocabularies.apiContract.supportedOperation,i);Array.isArray(c)&&c.length&&(r.operations=c.map(b=>this.operation(b,i)));let p=this[ae](e,d.aml.vocabularies.apiContract.parameter,i);Array.isArray(p)&&p.length&&(r.parameters=p.map(b=>this.parameter(b,i)));let u=this[ae](e,d.aml.vocabularies.apiContract.payload,i);Array.isArray(u)&&u.length&&(r.payloads=u.map(b=>this.payload(b,i)));let m=this[ae](e,d.aml.vocabularies.apiContract.server,i);Array.isArray(m)&&m.length&&(r.servers=m.map(b=>this.server(b,i)));let g=this[ae](e,d.aml.vocabularies.security.security,i);Array.isArray(g)&&g.length&&(r.security=g.map(b=>this.securityRequirement(b,i)));let f=this[ae](e,d.aml.vocabularies.document.extends,i);return Array.isArray(f)&&f.length&&(r.extends=[],f.forEach(b=>{let v=b;Array.isArray(v)&&([v]=v),this._hasType(v,d.aml.vocabularies.apiContract.ParametrizedResourceType,i)?r.extends.push(this.parametrizedResourceType(v,i)):this._hasType(v,d.aml.vocabularies.apiContract.ParametrizedTrait,i)&&r.extends.push(this.parametrizedTrait(v,i))})),r}operation(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e),method:"",deprecated:!1,callbacks:[],responses:[],servers:[],security:[],accepts:[],schemes:[],contentType:[],tags:[],extends:[]},a=this._getValue(e,d.aml.vocabularies.apiContract.method,i);a&&typeof a=="string"&&(r.method=a);let s=this._getValue(e,d.aml.vocabularies.core.name,i);s&&typeof s=="string"&&(r.name=s);let n=this._getValue(e,d.aml.vocabularies.core.description,i);n&&typeof n=="string"&&(r.description=n);let l=this._getValue(e,d.aml.vocabularies.apiContract.guiSummary,i);l&&typeof l=="string"&&(r.summary=l);let c=this._getValue(e,d.aml.vocabularies.core.deprecated,i);typeof c=="boolean"&&(r.deprecated=c);let p=this._getValue(e,d.aml.vocabularies.apiContract.operationId,i);p&&typeof p=="string"&&(r.operationId=p);let u=this._getValueArray(e,d.aml.vocabularies.apiContract.accepts,i);Array.isArray(u)&&(r.accepts=u);let m=this._getValueArray(e,d.aml.vocabularies.apiContract.scheme,i);Array.isArray(m)&&(r.schemes=m);let g=this._getValueArray(e,d.aml.vocabularies.apiContract.contentType,i);Array.isArray(g)&&(r.contentType=g);let f=e[this._getAmfKey(d.aml.vocabularies.apiContract.expects,i)];f&&(Array.isArray(f)&&([f]=f),r.request=this.request(f,i));let b=e[this._getAmfKey(d.aml.vocabularies.core.documentation,i)];b&&(Array.isArray(b)&&([b]=b),r.documentation=this.documentation(b,i));let v=e[this._getAmfKey(d.aml.vocabularies.apiContract.returns,i)];Array.isArray(v)&&(r.responses=v.map(P=>this.response(P,i)));let S=e[this._getAmfKey(d.aml.vocabularies.apiContract.callback,i)];Array.isArray(S)&&(r.callbacks=S.map(P=>this.callback(P,i)));let E=e[this._getAmfKey(d.aml.vocabularies.apiContract.server,i)];Array.isArray(E)&&(r.servers=E.map(P=>this.server(P)));let V=e[this._getAmfKey(d.aml.vocabularies.security.security,i)];Array.isArray(V)&&(r.security=V.map(P=>this.securityRequirement(P,i)));let U=e[this._getAmfKey(d.aml.vocabularies.apiContract.tag,i)];Array.isArray(U)&&U.length&&(r.tags=U.map(P=>this.tag(P,i)));let L=e[this._getAmfKey(d.aml.vocabularies.document.extends,i)];return Array.isArray(L)&&L.length&&(r.extends=L.map(P=>this.parametrizedTrait(P,i))),r}tag(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e),name:""},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.core.description,i);s&&typeof s=="string"&&(r.description=s);let n=e[this._getAmfKey(d.aml.vocabularies.core.documentation,i)];return n&&(Array.isArray(n)&&([n]=n),r.documentation=this.documentation(n,i)),r}tagListItem(e,t){let i=t||e["@context"],r={id:e["@id"],name:""},a=this._getValue(e,d.aml.vocabularies.core.name,i);return a&&typeof a=="string"&&(r.name=a),r}callback(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.apiContract.expression,i);s&&typeof s=="string"&&(r.expression=s);let n=e[this._getAmfKey(d.aml.vocabularies.apiContract.endpoint,i)];return n&&(Array.isArray(n)&&([n]=n),r.endpoint=this.endPoint(n,i)),r}request(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e),required:!1,headers:[],queryParameters:[],payloads:[],uriParameters:[],cookieParameters:[]},a=this._getValue(e,d.aml.vocabularies.core.description,i);a&&typeof a=="string"&&(r.description=a);let s=this._getValue(e,d.aml.vocabularies.apiContract.required,i);s&&typeof s=="boolean"&&(r.required=s);let n=e[this._getAmfKey(d.aml.vocabularies.apiContract.queryString,i)];n&&(Array.isArray(n)&&([n]=n),r.queryString=this.unknownShape(n,void 0,i));let l=this[ae](e,d.aml.vocabularies.apiContract.header,i);Array.isArray(l)&&l.length&&(r.headers=l.map(g=>this.parameter(g,i)));let c=this[ae](e,d.aml.vocabularies.apiContract.parameter,i);Array.isArray(c)&&c.length&&(r.queryParameters=c.map(g=>this.parameter(g,i)));let p=this[ae](e,d.aml.vocabularies.apiContract.uriParameter,i);Array.isArray(p)&&p.length&&(r.uriParameters=p.map(g=>this.parameter(g,i)));let u=this[ae](e,d.aml.vocabularies.apiContract.cookieParameter,i);Array.isArray(u)&&u.length&&(r.cookieParameters=u.map(g=>this.parameter(g,i)));let m=this[ae](e,d.aml.vocabularies.apiContract.payload,i);return Array.isArray(m)&&m.length&&(r.payloads=m.map(g=>this.payload(g,i))),r}response(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),headers:[],payloads:[],examples:[],links:[]},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.core.description,i);s&&typeof s=="string"&&(r.description=s);let n=this._getValue(e,d.aml.vocabularies.apiContract.statusCode,i);n&&typeof n=="string"&&(r.statusCode=n);let l=this[ae](e,d.aml.vocabularies.apiContract.header,i);Array.isArray(l)&&l.length&&(r.headers=l.map(m=>this.parameter(m,i)));let c=this[ae](e,d.aml.vocabularies.apiContract.payload,i);Array.isArray(c)&&c.length&&(r.payloads=c.map(m=>this.payload(m,i)));let p=e[this._getAmfKey(d.aml.vocabularies.apiContract.examples,i)];Array.isArray(p)&&p.length&&(r.examples=p.map(m=>this.example(m,i)));let u=e[this._getAmfKey(d.aml.vocabularies.apiContract.link,i)];return Array.isArray(u)&&u.length&&(r.links=u.map(m=>this.templatedLink(m,i))),r}payload(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),examples:[]},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.core.mediaType,i);s&&typeof s=="string"&&(r.mediaType=s);let n=e[this._getAmfKey(d.aml.vocabularies.shapes.schema,i)];n&&(Array.isArray(n)&&([n]=n),r.schema=this.unknownShape(n,{trackedId:r.id},i));let l=e[this._getAmfKey(d.aml.vocabularies.apiContract.examples,i)];return Array.isArray(l)&&l.length&&(r.examples=l.map(c=>this.example(c,i))),r}templatedLink(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),mapping:[]},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.core.description,i);s&&typeof s=="string"&&(r.description=s);let n=this._getValue(e,d.aml.vocabularies.apiContract.operationId,i);n&&typeof n=="string"&&(r.operationId=n);let l=e[this._getAmfKey(d.aml.vocabularies.apiContract.server,i)];l&&(Array.isArray(l)&&([l]=l),r.server=this.server(l,i));let c=e[this._getAmfKey(d.aml.vocabularies.apiContract.mapping,i)];return c&&(c&&!Array.isArray(c)&&(c=[c]),c&&(r.mapping=c.map(p=>this.iriTemplateMapping(p,i)))),r}iriTemplateMapping(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.apiContract.templateVariable,i);a&&typeof a=="string"&&(r.templateVariable=a);let s=this._getValue(e,d.aml.vocabularies.apiContract.linkExpression,i);return s&&typeof s=="string"&&(r.linkExpression=s),r}parametrizedSecurityScheme(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=e[this._getAmfKey(d.aml.vocabularies.security.scheme,i)];s&&(Array.isArray(s)&&([s]=s),r.scheme=this.securityScheme(s,i));let n=e[this._getAmfKey(d.aml.vocabularies.security.settings,i)];return n&&(Array.isArray(n)&&([n]=n),r.settings=this.securitySettings(n,i)),r}securitySchemeListItem(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),type:""},a=this._getValue(e,d.aml.vocabularies.security.type,i);a&&typeof a=="string"&&(r.type=a);let s=this._getValue(e,d.aml.vocabularies.core.name,i);s&&typeof s=="string"&&(r.name=s);let n=this._getValue(e,d.aml.vocabularies.core.displayName,i);return n&&typeof n=="string"&&(r.displayName=n),r}securityScheme(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),headers:[],queryParameters:[],responses:[]},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.core.displayName,i);s&&typeof s=="string"&&(r.displayName=s);let n=this._getValue(e,d.aml.vocabularies.core.description,i);n&&typeof n=="string"&&(r.description=n);let l=this._getValue(e,d.aml.vocabularies.security.type,i);l&&typeof l=="string"&&(r.type=l);let c=e[this._getAmfKey(d.aml.vocabularies.security.settings,i)];c&&(Array.isArray(c)&&([c]=c),r.settings=this.securitySettings(c,i));let p=e[this._getAmfKey(d.aml.vocabularies.apiContract.queryString,i)];p&&(Array.isArray(p)&&([p]=p),r.queryString=this.unknownShape(p,void 0,i));let u=this[ae](e,d.aml.vocabularies.apiContract.header,i);Array.isArray(u)&&u.length&&(r.headers=u.map(f=>this.parameter(f,i)));let m=this[ae](e,d.aml.vocabularies.apiContract.parameter,i);Array.isArray(m)&&m.length&&(r.queryParameters=m.map(f=>this.parameter(f,i)));let g=this[ae](e,d.aml.vocabularies.apiContract.response,i);return Array.isArray(g)&&g.length&&(r.responses=g.map(f=>this.response(f,i))),r}securityRequirement(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),schemes:[]},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=e[this._getAmfKey(d.aml.vocabularies.security.schemes,i)];return Array.isArray(s)&&s.length&&(r.schemes=s.map(n=>this.parametrizedSecurityScheme(n,i))),r}securitySettings(e,t){let i=t||e["@context"],r=this.readTypes(e["@type"],i);return r.includes(d.aml.vocabularies.security.OAuth1Settings)?this.oAuth1Settings(e,i):r.includes(d.aml.vocabularies.security.OAuth2Settings)?this.oAuth2Settings(e,i):r.includes(d.aml.vocabularies.security.ApiKeySettings)?this.apiKeySettings(e,i):r.includes(d.aml.vocabularies.security.HttpSettings)?this.httpSettings(e,i):r.includes(d.aml.vocabularies.security.OpenIdConnectSettings)?this.openIdConnectSettings(e,i):this.settings(e,i)}settings(e,t){let i=t||e["@context"];return{id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)}}oAuth1Settings(e,t){let i=t||e["@context"],r=this.settings(e,i),a=this._getValue(e,d.aml.vocabularies.security.authorizationUri,i);a&&typeof a=="string"&&(r.authorizationUri=a);let s=this._getValue(e,d.aml.vocabularies.security.requestTokenUri,i);s&&typeof s=="string"&&(r.requestTokenUri=s);let n=this._getValue(e,d.aml.vocabularies.security.tokenCredentialsUri,i);n&&typeof n=="string"&&(r.tokenCredentialsUri=n);let l=this._getValueArray(e,d.aml.vocabularies.security.signature,i);return Array.isArray(l)&&l.length?r.signatures=l:r.signatures=[],r}oAuth2Settings(e,t){let i=t||e["@context"],r=this.settings(e,i),a=this._getValueArray(e,d.aml.vocabularies.security.authorizationGrant,i);Array.isArray(a)&&a.length?r.authorizationGrants=a:r.authorizationGrants=[];let s=e[this._getAmfKey(d.aml.vocabularies.security.flows,i)];return Array.isArray(s)&&s.length?r.flows=s.map(n=>this.oAuth2Flow(n,i)):r.flows=[],r}oAuth2Flow(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),scopes:[],sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.security.authorizationUri,i);a&&typeof a=="string"&&(r.authorizationUri=a);let s=this._getValue(e,d.aml.vocabularies.security.accessTokenUri,i);s&&typeof s=="string"&&(r.accessTokenUri=s);let n=this._getValue(e,d.aml.vocabularies.security.flow,i);n&&typeof n=="string"&&(r.flow=n);let l=this._getValue(e,d.aml.vocabularies.security.refreshUri,i);l&&typeof l=="string"&&(r.refreshUri=l);let c=e[this._getAmfKey(d.aml.vocabularies.security.scope,i)];return Array.isArray(c)&&c.length&&(r.scopes=c.map(p=>this.scope(p,i))),r}scope(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.core.description,i);return s&&typeof s=="string"&&(r.description=s),r}apiKeySettings(e,t){let i=t||e["@context"],r=this.settings(e,i),a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=this._getValue(e,d.aml.vocabularies.security.in,i);return s&&typeof s=="string"&&(r.in=s),r}httpSettings(e,t){let i=t||e["@context"],r=this.settings(e,i),a=this._getValue(e,d.aml.vocabularies.security.scheme,i);a&&typeof a=="string"&&(r.scheme=a);let s=this._getValue(e,d.aml.vocabularies.security.bearerFormat,i);return s&&typeof s=="string"&&(r.bearerFormat=s),r}openIdConnectSettings(e,t){let i=t||e["@context"],r=this.settings(e,i),a=this._getValue(e,d.aml.vocabularies.security.openIdConnectUrl,i);return a&&typeof a=="string"&&(r.url=a),r}sourceMap(e,t){let i=t||e["@context"],r=e[this._getAmfKey(d.aml.vocabularies.docSourceMaps.sources,i)];if(!r)return;Array.isArray(r)&&([r]=r);let a={id:r["@id"],types:this.readTypes(r["@type"])},s=r[this._getAmfKey(d.aml.vocabularies.docSourceMaps.synthesizedField,i)];Array.isArray(s)&&s.length&&(a.synthesizedField=s.map(m=>this.synthesizedField(m,i)));let n=r[this._getAmfKey(d.aml.vocabularies.docSourceMaps.lexical,i)];Array.isArray(n)&&n.length&&(a.lexical=n.map(m=>this.synthesizedField(m,i)));let l=r[this._getAmfKey(d.aml.vocabularies.docSourceMaps.trackedElement,i)];Array.isArray(l)&&l.length&&(a.trackedElement=this.synthesizedField(l[0],i));let c=r[this._getAmfKey(d.aml.vocabularies.docSourceMaps.autoGeneratedName,i)];Array.isArray(c)&&c.length&&(a.autoGeneratedName=c.map(m=>this.synthesizedField(m,i)));let p=r[this._getAmfKey(d.aml.vocabularies.docSourceMaps.parsedJsonSchema,i)];Array.isArray(p)&&p.length&&(a.parsedJsonSchema=this.synthesizedField(p[0],i));let u=r[this._getAmfKey(d.aml.vocabularies.docSourceMaps.declaredElement,i)];return Array.isArray(u)&&u.length&&(a.declaredElement=this.synthesizedField(u[0],i)),a}synthesizedField(e,t){if(typeof e=="string")return{id:"synthesizedField/generated",value:e};let i={id:e["@id"],value:""},r=this._getValue(e,d.aml.vocabularies.docSourceMaps.element,t);typeof r=="string"&&(i.element=r);let a=this._getValue(e,d.aml.vocabularies.docSourceMaps.value,t);return typeof a=="string"&&(i.value=a),i}parametrizedDeclaration(e,t){let i=t||e["@context"],r={id:e["@id"],types:this.readTypes(e["@type"],i),variables:[],customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i)},a=this._getValue(e,d.aml.vocabularies.core.name,i);a&&typeof a=="string"&&(r.name=a);let s=e[this._getAmfKey(d.aml.vocabularies.document.variable,i)];Array.isArray(s)&&s.forEach(l=>{r.variables.push(this.variableValue(l,i))});let n=e[this._getAmfKey(d.aml.vocabularies.document.target,i)];if(Array.isArray(n)&&n.length){let[l]=n;r.target=this.abstractDeclaration(l,i)}return r}parametrizedTrait(e,t){let i=t||e["@context"];return this.parametrizedDeclaration(e,i)}parametrizedResourceType(e,t){let i=t||e["@context"];return this.parametrizedDeclaration(e,i)}variableValue(e,t){let i=t||e["@context"],r=this._getValue(e,d.aml.vocabularies.core.name,i),a={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),name:r},s=e[this._getAmfKey(d.aml.vocabularies.document.value,i)];if(Array.isArray(s)){let[n]=s;a.value=this.unknownDataNode(n,i)}return a}abstractDeclaration(e,t){let i=t||e["@context"],r=this._getValue(e,d.aml.vocabularies.core.name,i),a={id:e["@id"],types:this.readTypes(e["@type"],i),customDomainProperties:this.customDomainProperties(e,i),sourceMaps:this.sourceMap(e,i),name:r,variables:[]},s=this._getValueArray(e,d.aml.vocabularies.document.variable,i);Array.isArray(s)&&(a.variables=s);let n=this._getValue(e,d.aml.vocabularies.core.description,i);n&&typeof n=="string"&&(a.description=n);let l=e[this._getAmfKey(d.aml.vocabularies.document.dataNode,i)];if(Array.isArray(l)){let[c]=l;a.dataNode=this.unknownDataNode(c,i)}return a}endPointWithOperationsListItem(e,t){let i=this._getValue(e,d.aml.vocabularies.apiContract.path,t),r={id:e["@id"],path:i,operations:[]},a=this[ae](e,d.aml.vocabularies.apiContract.supportedOperation,t);Array.isArray(a)&&a.length&&(r.operations=a.map(n=>this.operationListItem(n,t)));let s=this._getValue(e,d.aml.vocabularies.core.name,t);return s&&typeof s=="string"&&(r.name=s),r}operationListItem(e,t){let i={id:e["@id"],method:""},r=this._getValue(e,d.aml.vocabularies.apiContract.method,t);r&&typeof r=="string"&&(i.method=r);let a=this._getValue(e,d.aml.vocabularies.core.name,t);return a&&typeof a=="string"&&(i.name=a),i}};var _t=class o{mime;opts;generator;constructor(e,t={}){this.mime=e,this.opts=Object.freeze({...t}),e.includes("json")?this.generator=new fi(t):e.includes("xml")&&(this.generator=new gi(t))}static asExample(e,t,i){return new o(t,i).toExample(e)}static asSchema(e,t,i){return new o(t,i).toValue(e)}generate(e){let{generator:t}=this;if(t)return t.generate(e)}toValue(e){return this.generate(e)}toExample(e){let t=this.generate(e);if(t==null)return;let i={id:`${e.id}/generated`,strict:!0,types:[d.aml.vocabularies.apiContract.Example],mediaType:this.mime,renderValue:t,customDomainProperties:[]},r=e;if(Array.isArray(r.examples)&&r.examples.length){let[a]=r.examples;a.value&&(i.value=a.value)}return i}};var Ft=Object.freeze({processApiLink:"amfprocessapilink",processBuffer:"amfprocessbuffer",processApiFile:"amfprocessapifile",selectApiMainFile:"amfselectapimainfile"});var oc=Object.freeze({processApiLink:async(o,e,t,i,r=globalThis)=>{let a=new CustomEvent(Ft.processApiLink,{bubbles:!0,composed:!0,cancelable:!0,detail:{url:o,mainFile:e,md5:t,packaging:i}});return r.dispatchEvent(a),a.detail.result},processBuffer:async(o,e,t=globalThis)=>{let i=new CustomEvent(Ft.processBuffer,{bubbles:!0,composed:!0,cancelable:!0,detail:{buffer:o,opts:e}});return t.dispatchEvent(i),i.detail.result},processApiFile:async(o,e=globalThis)=>{let t=new CustomEvent(Ft.processApiFile,{bubbles:!0,composed:!0,cancelable:!0,detail:{file:o}});return e.dispatchEvent(t),t.detail.result},selectApiMainFile:async(o,e=globalThis)=>{let t=new CustomEvent(Ft.selectApiMainFile,{bubbles:!0,composed:!0,cancelable:!0,detail:{candidates:o}});return e.dispatchEvent(t),t.detail.result}});function Sr(o,e){return o==="number"?e?.format==="int32"||e?.format==="int64"?d.w3.xmlSchema.integer:d.w3.xmlSchema.number:o==="boolean"?d.aml.vocabularies.shapes.boolean:o==="date"?d.w3.xmlSchema.date:o==="datetime"?d.w3.xmlSchema.dateTime:o==="time"?d.aml.vocabularies.shapes.dateTimeOnly:o==="binary"&&e&&e.format==="base64"?d.w3.xmlSchema.base64Binary:d.w3.xmlSchema.string}var ft=Symbol("noValue"),Kt=class{increment=0;static noValue=ft;generate(e,t){return t==="string"?this.generateString(e):t==="number"?this.generateNumber(e):t==="date"?this.generateDate(e):t==="time"?this.generateTime(e):t==="datetime"?this.generateDateTime(e):ft}generateString(e){switch(e){case"random":return R(8);case"uuid-v4":return crypto.randomUUID();default:return ft}}generateNumber(e){return e==="incremental"?`${this.increment++}`:ft}generateDate(e){if(e==="now"){let t=new Date,i=t.getFullYear(),r=`${t.getMonth()+1}`.padStart(2,"0"),a=`${t.getDate()}`.padStart(2,"0");return`${i}-${r}-${a}`}return ft}generateTime(e){if(e==="now"){let t=new Date,i=`${t.getHours()}`.padStart(2,"0"),r=`${t.getMinutes()}`.padStart(2,"0"),a=`${t.getSeconds()}`.padStart(2,"0");return`${i}:${r}:${a}`}return ft}generateDateTime(e){if(e==="now"){let t=new Date,i=t.getFullYear(),r=`${t.getMonth()+1}`.padStart(2,"0"),a=`${t.getDate()}`.padStart(2,"0"),s=`${t.getHours()}`.padStart(2,"0"),n=`${t.getMinutes()}`.padStart(2,"0"),l=`${t.getSeconds()}`.padStart(2,"0");return`${i}-${r}-${a}T${s}:${n}:${l}`}return ft}};var Aa="anyOf",lc="allOf",cc="oneOf",dc="not",xa="string",cn="binary",tt=class{#e;get valueGenerator(){return this.#e||(this.#e=new Kt),this.#e}entity(e,t=new Set){if(t.has(e.key))return this.createRecursiveShape(e);t.add(e.key);let i=ve.nodeShape(e.key);i.id=e.key,this.updateBaseProperties(e,i),i.properties=[];for(let r of e.listProperties()){let a=r.readBinding("web");if(a&&a.hidden)continue;let s=this.property(r);i.properties.push(s)}for(let r of e.listAssociations()){let a=r.readBinding("web");if(a&&a.hidden)continue;let s=this.associationProperty(r,t);i.properties.push(s)}for(let r of e.listParents()){let a=this.entity(r,t);i.inherits.push(a)}return i}property(e){let{required:t,key:i}=e,r=ve.propertyShape(i);return r.path=`${d.aml.vocabularies.data.key}${e.info.name}`,t&&(r.minCount=1),r.range=this.getRange(e),this.updateBaseProperties(e,r),r.range.name&&(r.name=r.range.name),r}associationProperty(e,t=new Set){let{required:i,key:r}=e,a=ve.propertyShape(r);return a.path=`${d.aml.vocabularies.data.key}${e.info.name}`,i&&(a.minCount=1),a.range=this.associationShape(e,t),this.updateBaseProperties(e,a),a}associationShape(e,t=new Set){let i=e.schema;if(!i?.embedded)return this.createLinkedShape(e);let r=this.associationUnion(e,t);if(!r)return;if(Array.isArray(r))return this.createUnionShape(e,r);if((i&&i.unionType||Aa)===dc){let s=ve.anyShape(e.key);return s.id=`not-shape-${e.key}`,s.not=r,s}return e.multiple?this.refactorShapeToArray(e.key,r):r}createLinkedShape(e){let t=ve.scalarShape(e.key);return t.id=`link-${e.key}`,t.dataType=Sr(xa),t}createUnionShape(e,t){let i=ve.unionShape(e.key);this.updateBaseProperties(e,i),i.anyOf=[];let r=e.schema&&e.schema.unionType||Aa;return r===Aa?i.anyOf=t:r===lc?i.and=t:r===cc?i.xone=t:i.not=t[0],e.multiple?this.refactorShapeToArray(e.key,i):i}associationUnion(e,t=new Set){let i=[];for(let r of e.listTargets())i.push(this.entity(r,t));if(i.length)return i.length>1?i:i[0]}getRange(e){let t=e.readBinding("web"),i;e.schema&&(i=e.schema);let{multiple:r,type:a}=e;return r?this.createArrayShape(e,i,t):a===cn?this.createFileShape(e,t):this.createScalarShape(e,i,t)}setShapeSchema(e,t,i,r,a){if(i.defaultValue){let{type:s}=i.defaultValue,{value:n}=i.defaultValue;if(s==="function"){let l=this.valueGenerator.generate(n,e.type);if(l!==Kt.noValue){let c=Le.scalar(l,s);t.defaultValue=c.toJSON()}}else{let l=Le.scalar(n,r);t.defaultValue=l.toJSON()}}Array.isArray(i.enum)&&(t.values=i.enum.map(s=>Le.scalar(s,r).toJSON())),Array.isArray(i.examples)&&(a?t.examples=this.createArrayExamples(i.examples,r):t.examples=this.createExamples(i.examples,r))}createArrayShape(e,t,i){let r=ve.arrayShape(e.key),{type:a}=e;if(a===cn?r.items=this.createFileShape(e,i):r.items=this.createScalarShape(e,void 0,i),t){let s=r.items.dataType;this.setShapeSchema(e,r,t,s,e.multiple)}return r}createScalarShape(e,t,i){let r=ve.scalarShape(e.key);return this.updateBaseProperties(e,r),this.setScalarCommonProperties(r,e,i),r.dataType||(r.dataType=Sr(e.type,i)),t&&this.setShapeSchema(e,r,t,r.dataType,e.multiple),r}createExamples(e,t){let i=[];for(let r of e){let a={id:R(),customDomainProperties:[],strict:!0,types:[...li.IAmfExampleTypes],structuredValue:Le.scalar(r,t).toJSON()};i.push(a)}return i}createArrayExamples(e,t){let i={id:R(),customDomainProperties:[],strict:!0,types:[...li.IAmfExampleTypes]},r=new Le("array");for(let a of e){let s=Le.scalar(a,t);r.addMember(s)}return i.structuredValue=r.toJSON(),[i]}createFileShape(e,t){let i=ve.fileShape(e.key);return this.updateBaseProperties(e,i),t&&(Array.isArray(t.fileTypes)&&(i.fileTypes=t.fileTypes),this.setScalarCommonProperties(i,e,t),t.format==="base64"&&(i.format=d.w3.xmlSchema.base64Binary)),i}setScalarCommonProperties(e,t,i){i?.name&&(e.name=i.name),i?.xml&&(e.xmlSerialization=i.xml);let{schema:r,type:a}=t;if(r&&(r.pattern&&(e.pattern=r.pattern),typeof r.multipleOf=="number"&&(e.multipleOf=r.multipleOf),typeof r.minimum=="number"&&(a===xa?e.minLength=r.minimum:e.minimum=r.minimum),typeof r.maximum=="number"&&(a===xa?e.maxLength=r.maximum:e.maximum=r.maximum),typeof r.exclusiveMinimum=="boolean"&&(e.exclusiveMinimum=r.exclusiveMinimum),typeof r.exclusiveMaximum=="boolean"&&(e.exclusiveMaximum=r.exclusiveMaximum)),i?.format)switch(i.format){case"base64":e.format=d.w3.xmlSchema.base64Binary;break;case"double":e.format=d.w3.xmlSchema.double;break;case"float":e.format=d.w3.xmlSchema.float;break;case"int32":e.format=d.w3.xmlSchema.integer;break;case"int64":e.format=d.w3.xmlSchema.integer;break}typeof t.readOnly=="boolean"&&(e.readOnly=t.readOnly),typeof t.writeOnly=="boolean"&&(e.writeOnly=t.writeOnly)}updateBaseProperties(e,t){t.name=e.info.name,t.displayName=e.info.displayName,t.description=e.info.description,(e.kind===Z||e.kind===J)&&(t.deprecated=e.deprecated)}createRecursiveShape(e){return ve.recursiveShape(e.key,e.key)}refactorShapeToArray(e,t){let i=ve.arrayShape(e);return i.items=t,i}};var Ce=class{root;get domain(){return this.root}#e;get key(){return this.#e}#t;get namespace(){return this.#t}constructor(e,t){this.root=e,this.#e=t,this.#t=e.key}};var Ea=["string","number","boolean","date","datetime","time","binary"],yi;(function(o){o.string="string",o.number="number",o.boolean="boolean",o.date="date",o.datetime="datetime",o.time="time",o.file="binary"})(yi||(yi={}));var dn=["required","multiple","primary","index","unique","search","readOnly","writeOnly","deprecated"],pn=["required","multiple"],un=["float","double","int32","int64"],mn=["hex","base64"];var At=class o extends Ce{kind;info;required;multiple;primary;unique;index;search;readOnly;writeOnly;deprecated;tags=[];semantics=[];type="string";schema;bindings=[];static createSchema(e={}){let{key:t=R(),multiple:i,required:r,type:a=yi.string,index:s,search:n,primary:l,unique:c,readOnly:p,writeOnly:u,tags:m,semantics:g,deprecated:f,schema:b,bindings:v}=e;if(typeof a=="string"&&!Ea.includes(a))throw new Error(`Invalid data property type ${a}`);let S=W.fromJSON(e.info,{name:"new_property"}).toJSON(),E={kind:Z,key:t,info:S,type:a};return typeof i=="boolean"&&(E.multiple=i),typeof r=="boolean"&&(E.required=r),typeof s=="boolean"&&(E.index=s),typeof n=="boolean"&&(E.search=n),typeof l=="boolean"&&(E.primary=l),typeof c=="boolean"&&(E.unique=c),typeof p=="boolean"&&(E.readOnly=p),typeof u=="boolean"&&(E.writeOnly=u),typeof f=="boolean"&&(E.deprecated=f),Array.isArray(m)&&(E.tags=[...m]),Array.isArray(g)&&(E.semantics=[...g]),b&&(E.schema=structuredClone(b)),Array.isArray(v)?E.bindings=v.map(V=>structuredClone(V)):E.bindings=[],E}parent;constructor(e,t,i={}){let r=o.createSchema(i);super(e,r.key),this.parent=t,this.kind=Z,this.info=new W(r.info),this.type=r.type,typeof r.multiple=="boolean"&&(this.multiple=r.multiple),typeof r.required=="boolean"&&(this.required=r.required),typeof r.index=="boolean"&&(this.index=r.index),typeof r.search=="boolean"&&(this.search=r.search),typeof r.deprecated=="boolean"&&(this.deprecated=r.deprecated),typeof r.primary=="boolean"&&(this.primary=r.primary),typeof r.unique=="boolean"&&(this.unique=r.unique),typeof r.readOnly=="boolean"&&(this.readOnly=r.readOnly),typeof r.writeOnly=="boolean"&&(this.writeOnly=r.writeOnly),Array.isArray(r.tags)?this.tags=[...r.tags]:this.tags=[],Array.isArray(r.semantics)?this.semantics=[...r.semantics]:this.semantics=[],r.schema&&(this.schema=structuredClone(r.schema)),Array.isArray(r.bindings)?this.bindings=r.bindings.map(a=>structuredClone(a)):this.bindings=[]}static validate(e,t={}){if(!e||typeof e!="object"&&e!==null)return!1;let i=e;return!(t.strict&&i.kind!==Z)}toJSON(){let e={kind:this.kind,key:this.key,info:this.info.toJSON(),type:this.type||yi.string};return typeof this.index=="boolean"&&(e.index=this.index),typeof this.search=="boolean"&&(e.search=this.search),typeof this.deprecated=="boolean"&&(e.deprecated=this.deprecated),typeof this.primary=="boolean"&&(e.primary=this.primary),typeof this.unique=="boolean"&&(e.unique=this.unique),typeof this.multiple=="boolean"&&(e.multiple=this.multiple),typeof this.required=="boolean"&&(e.required=this.required),typeof this.readOnly=="boolean"&&(e.readOnly=this.readOnly),typeof this.writeOnly=="boolean"&&(e.writeOnly=this.writeOnly),Array.isArray(this.tags)&&this.tags.length&&(e.tags=[...this.tags]),Array.isArray(this.semantics)&&this.semantics.length&&(e.semantics=this.semantics.map(t=>structuredClone(t))),this.schema&&(e.schema=structuredClone(this.schema)),Array.isArray(this.bindings)&&this.bindings.length&&(e.bindings=this.bindings.map(t=>structuredClone(t))),e}remove(){this.getParentInstance()?.removeProperty(this.key)}getParentInstance(){return this.root.graph.node(this.parent)}static isValidType(e){return typeof e!="string"?!1:Ea.includes(e)}static isValidAttribute(e){return typeof e!="string"?!1:dn.includes(e)}static isValidFormat(e){return e===void 0?!0:typeof e!="string"?!1:!!(un.includes(e)||mn.includes(e))}ensureSchema(){return this.schema||(this.schema={}),this.schema}getWebBinding(){let e=this.bindings.find(t=>t.type==="web");return e||(e={type:"web",schema:{}},this.bindings.push(e)),e.schema}readWebBinding(){return this.bindings.find(t=>t.type==="web")?.schema}getExposedName(){let e=this.readWebBinding()?.name||this.info.name;if(!e)throw new h(`Property ${this.key} has no exposed name defined`,{code:"E_MISSING_EXPOSED_NAME",status:500});return e}readBinding(e){return this.bindings.find(i=>i.type===e)?.schema||void 0}toApiShape(){return new tt().property(this)}toExample(e,t={}){let i=this.toApiShape();return i.range?new _t(e,{renderExamples:t.renderExamples??!0,renderMocked:t.renderMocked??!0,renderOptional:t.renderOptional??!0,selectedUnions:t.selectedUnions}).generate(i):void 0}addSemantic(e){let t=Ue[e.id];if(!Wi(t))throw new Error(`Invalid semantic type: ${e.id}. Expected a property semantic.`);let i=this.semantics.findIndex(r=>r.id===e.id);i>=0?this.semantics[i]=e:this.semantics.push(e)}removeSemantic(e){let t=this.semantics.findIndex(i=>i.id===e);t>=0&&this.semantics.splice(t,1)}hasSemantic(e){return this.semantics.some(t=>t.id===e)}getSemantic(e){return this.semantics.find(t=>t.id===e)}duplicate(){let e=this.getParentInstance();if(!e)throw new Error(`Cannot duplicate property ${this.key} as it has no parent entity.`);let t=e.fields.findIndex(c=>c.key===this.key);if(t===-1)throw new Error(`Cannot duplicate property ${this.key} as it does not exist on the parent entity fields list.`);let i=this.info.name||"field",r=e.generateUniqueName(i),a=this.toJSON();delete a.key,delete a.primary,a.info?a.info.name=r:a.info={name:r};let s=e.addProperty(a),n=e.fields.length-1,l=e.fields[n];return e.fields.splice(n,1),e.fields.splice(t+1,0,l),s}};var bi=class extends h{static code="E_REMOVE_PROPERTY";static status=500;static message="Error removing a data property.";static help="Make sure the property exists and can be removed."};var xt=class o extends Ce{kind;info;required;multiple;schema;bindings;parent;targets;semantics=[];onDelete;readOnly;static createSchema(e={}){let{key:t=R(),semantics:i=[]}=e,r=W.fromJSON(e.info,{name:"new_association"}).toJSON(),a={kind:oe,key:t,info:r};return Array.isArray(i)&&(a.semantics=[...i]),e.onDelete&&(a.onDelete=e.onDelete),typeof e.readOnly=="boolean"&&(a.readOnly=e.readOnly),e.schema&&(a.schema=structuredClone(e.schema)),typeof e.multiple=="boolean"&&(a.multiple=e.multiple),typeof e.required=="boolean"&&(a.required=e.required),Array.isArray(e.bindings)&&(a.bindings=e.bindings.map(s=>structuredClone(s))),Array.isArray(e.targets)&&(a.targets=e.targets.map(s=>({...s}))),a}constructor(e,t,i){let r=o.createSchema(i);super(e,r.key),this.parent=t,this.kind=oe,this.info=new W(r.info),r.schema&&(this.schema=structuredClone(r.schema)),typeof r.multiple=="boolean"&&(this.multiple=r.multiple),typeof r.required=="boolean"&&(this.required=r.required),Array.isArray(r.bindings)?this.bindings=r.bindings.map(a=>structuredClone(a)):this.bindings=[],Array.isArray(r.targets)?this.targets=r.targets.map(a=>({...a})):this.targets=[],Array.isArray(r.semantics)?this.semantics=r.semantics.map(a=>structuredClone(a)):this.semantics=[],r.onDelete&&(this.onDelete=r.onDelete),typeof r.readOnly=="boolean"&&(this.readOnly=r.readOnly)}toJSON(){let e={kind:this.kind,key:this.key,info:this.info.toJSON()};return this.schema&&(e.schema=structuredClone(this.schema)),typeof this.multiple=="boolean"&&(e.multiple=this.multiple),typeof this.required=="boolean"&&(e.required=this.required),Array.isArray(this.bindings)&&this.bindings.length&&(e.bindings=this.bindings.map(t=>structuredClone(t))),Array.isArray(this.targets)&&this.targets.length&&(e.targets=this.targets.map(t=>({...t}))),Array.isArray(this.semantics)&&this.semantics.length&&(e.semantics=this.semantics.map(t=>structuredClone(t))),this.onDelete&&(e.onDelete=this.onDelete),typeof this.readOnly=="boolean"&&this.readOnly&&(e.readOnly=this.readOnly),e}getParentInstance(){return this.root.graph.node(this.parent)}remove(){this.getParentInstance()?.removeAssociation(this.key)}ensureSchema(){return this.schema||(this.schema={}),this.schema}static isValidAttribute(e){return typeof e!="string"?!1:pn.includes(e)}getWebBinding(){let e=this.bindings.find(t=>t.type==="web");return e||(e={type:"web",schema:{}},this.bindings.push(e)),e.schema}readWebBinding(){return this.bindings?.find(t=>t.type==="web")?.schema}getExposedName(){let e=this.readWebBinding()?.name||this.info.name;if(!e)throw new h(`Association ${this.key} has no exposed name defined`,{code:"E_MISSING_EXPOSED_NAME",status:500});return e}readBinding(e){return this.bindings.find(i=>i.type===e)?.schema||void 0}addTarget(e,t){let i;if(typeof e=="string"?i=e:(i=e.key,e.domain.key!==this.root.key&&(t=e.domain.key)),this.targets.some(n=>n.key===i&&n.domain===t)){let n=`Target ${i} already exists.`;throw new Error(n)}if(t&&!this.root.dependencies.has(t))throw new Error(`Foreign namespace "${t}" does not exist.`);let r={key:i};t&&(r.domain=t),this.targets.push(r);let a=t?`${t}:${i}`:i,s={type:"association"};t&&(s.domain=t,s.foreign=!0),this.root.graph.setEdge(this.key,a,s)}removeTarget(e){let t;typeof e=="string"?t=e:t=e.key;let i=this.targets.findIndex(r=>r.key===t);i>=0&&this.targets.splice(i,1),this.root.graph.removeEdge(this.key,t)}*listTargets(){for(let e of this.targets){let{key:t,domain:i}=e,r=i?`${i}:${t}`:t,a=this.root.graph.node(r);a&&(yield a)}}toApiShape(){return new tt().associationProperty(this)}addSemantic(e){let t=Ue[e.id];if(!Za(t))throw new Error(`Invalid semantic type: ${e.id}. Expected an association semantic.`);let i=this.semantics.findIndex(r=>r.id===e.id);i>=0?this.semantics[i]=e:this.semantics.push(e)}removeSemantic(e){let t=this.semantics.findIndex(i=>i.id===e);t>=0&&this.semantics.splice(t,1)}hasSemantic(e){return this.semantics.some(t=>t.id===e)}getSemantic(e){return this.semantics.find(t=>t.id===e)}duplicate(){let e=this.getParentInstance();if(!e)throw new Error(`Cannot duplicate association ${this.key} as it has no parent entity.`);let t=e.fields.findIndex(c=>c.key===this.key);if(t===-1)throw new Error(`Cannot duplicate association ${this.key} as it does not exist on the parent entity fields list.`);let i=this.info.name||"field",r=e.generateUniqueName(i),a=this.toJSON();delete a.key,delete a.targets,a.info?a.info.name=r:a.info={name:r};let s=e.addAssociation(a);for(let c of this.targets)s.addTarget(c.key,c.domain);let n=e.fields.length-1,l=e.fields[n];return e.fields.splice(n,1),e.fields.splice(t+1,0,l),s}};var Et=class extends Error{messages;status=422;code="E_VALIDATION_ERROR";constructor(e,t){let i=t?.message||"Validation failure";super(i,t),this.messages=e;let r=this.constructor;"captureStackTrace"in Error&&Error.captureStackTrace(this,r)}get[Symbol.toStringTag](){return this.constructor.name}toString(){return`${this.name} [${this.code}]: ${this.message}`}};function Se(o,e){if(!o.hasNode(e))return;let t=o.node(e);if(t){if(t.kind===oe){o.removeNode(e);return}for(let i of o.children(e))Se(o,i);for(let i of o.outEdges(e)){let r=o.edge(i);r&&(r.type==="association"||r.type==="property")&&Se(o,i.w)}o.removeNode(e)}}var Nt=class o extends Ce{kind;#e;#t;#r;#i;info;tags;semantics=[];fields;deprecated;static createSchema(e={}){let{key:t=R(),tags:i,semantics:r,fields:a,deprecated:s}=e,n=W.fromJSON(e.info,{name:"new_entity"}).toJSON(),l={kind:J,key:t,info:n};return Array.isArray(i)&&(l.tags=[...i]),Array.isArray(r)&&(l.semantics=[...r]),Array.isArray(a)&&(l.fields=[...a]),typeof s=="boolean"&&(l.deprecated=s),l}constructor(e,t){let i=o.createSchema(t);super(e,i.key),this.kind=J,this.info=new W(i.info),Array.isArray(i.tags)?this.tags=[...i.tags]:this.tags=[],Array.isArray(i.semantics)?this.semantics=i.semantics.map(r=>structuredClone(r)):this.semantics=[],Array.isArray(i.fields)?this.fields=[...i.fields]:this.fields=[],typeof i.deprecated=="boolean"&&(this.deprecated=i.deprecated)}toJSON(){let e={kind:this.kind,key:this.key,info:this.info.toJSON()};return Array.isArray(this.fields)&&this.fields.length&&(e.fields=[...this.fields]),Array.isArray(this.semantics)&&this.semantics.length&&(e.semantics=this.semantics.map(t=>structuredClone(t))),Array.isArray(this.tags)&&this.tags.length&&(e.tags=[...this.tags]),typeof this.deprecated=="boolean"&&(e.deprecated=this.deprecated),e}getParentInstance(){let e=this.root.graph.parent(this.key);if(e)return this.root.graph.node(e)}getExposedName(){let e=this.info.name;if(!e)throw new h(`Entity ${this.key} has no exposed name defined`,{code:"E_MISSING_EXPOSED_NAME",status:500});return e}addProperty(e){if(e&&e.key&&this.root.graph.hasNode(e.key))throw new Error(`Trying to add a property ${e.key}, but it already exists`);let t=new At(this.root,this.key,e);return this.root.graph.setNode(t.key,t),this.root.graph.setEdge(this.key,t.key,{type:"property"}),this.fields.push({type:"property",key:t.key}),t}removeProperty(e){if(!this.root.graph.hasNode(e))throw new bi(`Trying to remove the ${e} property, but it doesn't exist`);if(this.root.graph.node(e).getParentInstance()!==this)throw new bi(`Trying to remove the ${e} property, but it doesn't belong to this entity`);Se(this.root.graph,e),this.removeField(e)}get properties(){return this.listProperties()}*listProperties(){for(let{key:e,type:t}of this.fields){if(t!=="property")continue;let i=this.root.graph.node(e);!i||i.kind!==Z||(yield i)}}withInheritedProperties(){if(this.root.readOnly&&this.#e)return this.#e.values();let e=new Map,t=this.listAllParents("up");for(let i of t)for(let r of i.properties)r.info.name&&e.set(r.info.name,r);for(let i of this.properties)i.info.name&&e.set(i.info.name,i);return this.root.readOnly&&(this.#e=Array.from(e.values())),e.values()}hasProperties(){return this.fields.some(e=>e.type==="property")}get parents(){return this.listParents()}*listParents(){for(let e of this.root.graph.outEdges(this.key)){let t=this.root.graph.edge(e);if(!t||t.type!=="parent")continue;let i=this.root.graph.node(e.w);i&&(yield i)}}listAllParents(e="up"){if(this.root.readOnly&&this.#t?.[e])return this.#t[e];let t=new Set,i=[],r=[...this.listParents()],a=0;for(;a<r.length;){let s=r[a++];t.has(s.key)||(t.add(s.key),i.push(s),r.push(...s.listParents()))}return e==="down"&&i.reverse(),this.root.readOnly&&(this.#t||(this.#t={}),this.#t[e]=i),i}addParent(e,t){let i=this.domain.buildReferenceKey(e,t);if(i===this.key){let a="Entity cannot be a parent of itself";throw new Et([{field:"parents",message:a,rule:"circular"}],{message:a})}let{graph:r}=this.root;if(!r.hasNode(i)){let a=`Entity with key "${e}" not found`;throw t&&(a+=` in domain "${t}"`),new Et([{field:"parents",message:a,rule:"required"}],{message:a})}if(this.hasCircularParent(i)){let a=`Circular inheritance detected. Cannot add ${e} as a parent`;throw new Et([{field:"parents",message:a,rule:"circular"}],{message:a})}if(r.outEdges(this.key,i).next().value){let a=`Parent ${e} already exists`;throw new Et([{field:"parents",message:a,rule:"unique"}],{message:a})}return t?r.setEdge(this.key,i,{type:"parent",domain:t,foreign:!0}):r.setEdge(this.key,i,{type:"parent"}),this}removeParent(e,t){let{graph:i}=this.root,r=this.domain.buildReferenceKey(e,t);if(!i.hasEdge(this.key,r)){let s=`Trying to remove a parent ${e} from ${this.key}, but it doesn't exist`;throw t&&(s=`Trying to remove a foreign parent ${e} from domain "${t}" from ${this.key}, but it doesn't exist`),new Error(s)}let a=i.edge(this.key,r);if(!a||a.type!=="parent"){let s=`Edge between ${this.key} and ${e} exists but is not a parent relationship`;throw t&&(s=`Edge between ${this.key} and ${e} in domain "${t}" exists but is not a parent relationship`),new Error(s)}return i.removeEdge(this.key,r),this}hasParents(){for(let e of this.root.graph.outEdges(this.key))if(this.root.graph.edge(e)?.type==="parent")return!0;return!1}hasCircularParent(e){let{graph:t}=this.root;for(let r of t.outEdges(e,this.key))if(t.edge(r)?.type==="parent")return!0;let i=t.node(e);for(;i;){if(i.key===this.key)return!0;let r=[...i.listParents()];if(r.length===0)break;i=r[0]}return!1}breadcrumbs(){let e=[];e.push({key:this.key,name:this.info.getLabel("Unnamed entity"),kind:J});let t=this.getParentInstance();if(t){e.push({key:t.key,kind:t.kind,name:t.info.getLabel("Unnamed model")});let i=t.getParentInstance();for(;i&&i!==this.root;)e.push({key:i.key,kind:i.kind,name:i.info.getLabel("Unnamed namespace")}),i=i.getParentInstance()}return e.push({key:this.root.key,name:this.root.info.getLabel("Unnamed data domain"),kind:this.root.kind}),e.reverse()}addAssociation(e={}){let{graph:t}=this.root,i={...e},r=i.targets;delete i.targets;let a=Array.isArray(r)&&r.length;if(a){for(let n of r)if(n.domain&&n.key){let l=`${n.domain}:${n.key}`;if(!t.hasNode(l))throw new Error(`Foreign entity ${l} not found`)}else if(n.key&&!t.hasNode(n.key))throw new Error(`Target entity ${n.key} not found`)}let s=new xt(this.root,this.key,i);if(t.setNode(s.key,s),t.setEdge(this.key,s.key,{type:"association"}),a)for(let n of r)s.addTarget(n.key,n.domain);return this.fields.push({type:"association",key:s.key}),s}removeAssociation(e){if(!this.root.graph.hasEdge(this.key,e))throw new Error(`Unable to find a connection between this entity and the ${e} association`);let t=this.root.graph.edge(this.key,e);if(!t||t.type!=="association")throw new Error(`Association ${e} does not exist`);Se(this.root.graph,e),this.removeField(e)}get associations(){return this.listAssociations()}*listAssociations(){for(let{key:e,type:t}of this.fields){if(t!=="association")continue;let i=this.root.graph.node(e);!i||i.kind!==oe||(yield i)}}hasAssociations(){return this.fields.some(e=>e.type==="association")}*listFields(){for(let{key:e}of this.fields){let t=this.root.graph.node(e);t&&(t.kind===oe||t.kind===Z)&&(yield t)}}hasFields(){return this.fields.length>0}removeField(e){this.fields=this.fields.filter(t=>t.key!==e)}toApiShape(){return new tt().entity(this)}toExample(e,t={}){let i=this.toApiShape();return new _t(e,{renderExamples:t.renderExamples??!0,renderMocked:t.renderMocked??!0,renderOptional:t.renderOptional??!0,selectedUnions:t.selectedUnions}).generate(i)}isChildOf(e){if(this.key===e)return!1;let t=this.getParentInstance();return t?t.key===e?!0:t.isChildOf(e):!1}primaryKey(){for(let t of this.properties)if(t.primary)return t;let e;for(let t of this.listParents()){let i=t.primaryKey();i&&(e=i)}return e}addSemantic(e){let t=Ue[e.id];if(!Xa(t))throw new Error(`Invalid semantic type: ${e.id}. Expected an entity semantic.`);let i=this.semantics.findIndex(r=>r.id===e.id);i>=0?this.semantics[i]=e:this.semantics.push(e)}removeSemantic(e){let t=this.semantics.findIndex(i=>i.id===e);t>=0&&this.semantics.splice(t,1)}hasSemantic(e){return this.semantics.some(t=>t.id===e)}getSemantic(e){return this.semantics.find(t=>t.id===e)}withInheritedAssociations(){if(this.root.readOnly&&this.#r)return this.#r.values();let e=new Map,t=this.listAllParents("up");for(let i of t)for(let r of i.associations)r.info.name&&e.set(r.info.name,r);for(let i of this.associations)i.info.name&&e.set(i.info.name,i);return this.root.readOnly&&(this.#r=Array.from(e.values())),e.values()}listAllSemantics(){if(this.root.readOnly&&this.#i)return this.#i;let e=new Map,t=this.listAllParents("up");for(let r of t)for(let a of r.semantics)e.set(a.id,a);for(let r of this.semantics)e.set(r.id,r);let i=Array.from(e.values());return this.root.readOnly&&(this.#i=i),i}generateUniqueName(e){let t=new Set;for(let a of this.listFields())a.info.name&&t.add(a.info.name);let i=2,r=`${e}_copy`;for(;t.has(r);)r=`${e}_copy_${i}`,i++;return r}};var qt=class extends h{static code="E_REMOVE_ENTITY";static status=500;static message="Error removing a data entity.";static help="Make sure the entity exists and can be removed."};var _e=class extends h{static code="E_ATTACH";static status=500;static message="Error attaching the object.";static help="Make sure you are attaching the right object."};var Ke=class extends h{static code="E_DETACH";static status=500;static message="Error detaching the object.";static help="Make sure you are detaching the right object."};var it=class o extends Ce{kind;info;fields;deprecated;static createSchema(e={}){let{key:t=R(),fields:i,deprecated:r}=e,a=W.fromJSON(e.info,{name:"New model"}).toJSON(),s={kind:te,key:t,info:a};return Array.isArray(i)&&(s.fields=[...i]),typeof r=="boolean"&&(s.deprecated=r),s}constructor(e,t){let i=o.createSchema(t);super(e,i.key),this.kind=te,this.info=new W(i.info),Array.isArray(i.fields)?this.fields=[...i.fields]:this.fields=[],typeof i.deprecated=="boolean"?this.deprecated=i.deprecated:this.deprecated=void 0}toJSON(){let e={kind:this.kind,key:this.key,info:this.info.toJSON()};return Array.isArray(this.fields)&&this.fields.length&&(e.fields=[...this.fields]),typeof this.deprecated=="boolean"&&(e.deprecated=this.deprecated),e}getParentInstance(){let e=this.root.graph.parent(this.key);return e?this.root.graph.node(e):this.root}addEntity(e){if(e&&e.key&&this.root.graph.hasNode(e.key))throw new Error(`Entity with key ${e?.key} already exists`);let t=new Nt(this.root,e);return this.root.graph.setNode(t.key,t),this.root.graph.setParent(t.key,this.key),this.fields.push({key:t.key,type:"entity"}),t}removeEntity(e){if(!this.root.graph.hasNode(e))throw new qt(`Trying to remove the ${e} entity, but it doesn't exist`);let t=this.root.graph.node(e);if(!t||t.kind!==J)throw new qt(`Trying to remove the ${e} entity, but it is not an entity`);if(t.getParentInstance()!==this)throw new qt(`Trying to remove the ${e} entity, but it is not a child of this model`);Se(this.root.graph,e),this.removeField(e)}attachEntity(e){if(!this.root.graph.hasNode(e))throw new _e(`Trying to attach the ${e} entity, but it doesn't exist`);let t=this.root.graph.node(e);if(!t||t.kind!==J)throw new _e(`Trying to attach the ${e} entity, but it is not a entity`);if(t.domain.key!==this.root.key)throw new _e(`Trying to attach the ${e} entity, but it is not in the same domain`);let i=t.getParentInstance();if(i===this)throw new _e(`Trying to attach the ${e} entity, but it is already a child of this model`);if(i.detachEntity(e),this.fields.some(a=>a.key===e)||this.fields.push({type:"entity",key:e}),this.root.graph.setParent(e,this.key),this.root.graph.parent(e)!==this.key)throw new _e(`Trying to attach the ${e} entity, but it is not a child of this model`);return this}detachEntity(e){let t=this.fields.findIndex(r=>r.key===e);if(t===-1)throw new Ke(`Trying to detach the ${e} entity, but it doesn't exist`);let i=this.root.graph.node(e);if(!i||i.kind!==J)throw new Ke(`Trying to detach the ${e} entity, but it is not an entity`);if(i.getParentInstance()!==this)throw new Ke(`Trying to detach the ${e} entity, but it is not a child of this model`);return this.fields.splice(t,1),this.root.graph.setParent(e),this}*listEntities(){for(let{key:e,type:t}of this.fields){if(t!=="entity")continue;let i=this.root.graph.node(e);!i||i.kind!==J||(yield i)}}hasEntities(){return this.fields.some(e=>e.type==="entity")}breadcrumbs(){let e=[];e.push({key:this.key,name:this.info.getLabel("Unnamed model"),kind:te});let t=this.getParentInstance();for(;t&&t!==this.root;)e.push({key:t.key,kind:t.kind,name:t.info.getLabel("Unnamed namespace")}),t=t.getParentInstance();return e.push({key:this.root.key,name:this.root.info.getLabel("Unnamed data domain"),kind:this.root.kind}),e.reverse()}hasFields(){return this.fields.length>0}removeField(e){this.fields=this.fields.filter(t=>t.key!==e)}isChildOf(e){if(this.key===e)return!1;let t=this.getParentInstance();return t?t.key===e?!0:t===this.root?!1:t.isChildOf(e):!1}};var jt=class extends h{static code="E_REMOVE_NAMESPACE";static status=500;static message="Error removing a domain namespace.";static help="Make sure the namespace exists and can be removed."};var wi=class extends h{static code="E_REMOVE_MODEL";static status=500;static message="Error removing a domain model.";static help="Make sure the model exists and can be removed."};var It=class o extends Ce{kind;info;fields;deprecated;static createSchema(e={}){let{key:t=R(),fields:i,deprecated:r}=e,a=W.fromJSON(e.info,{name:"New namespace"}).toJSON(),s={kind:ne,key:t,info:a};return Array.isArray(i)&&(s.fields=[...i]),typeof r=="boolean"&&(s.deprecated=r),s}constructor(e,t){let i=o.createSchema(t);super(e,i.key),this.kind=ne,this.info=new W(i.info),Array.isArray(i.fields)?this.fields=[...i.fields]:this.fields=[],typeof i.deprecated=="boolean"?this.deprecated=i.deprecated:this.deprecated=void 0}toJSON(){let e={kind:this.kind,key:this.key,info:this.info.toJSON()};return Array.isArray(this.fields)&&this.fields.length&&(e.fields=[...this.fields]),typeof this.deprecated=="boolean"&&(e.deprecated=this.deprecated),e}addNamespace(e){if(e&&e.key&&this.root.graph.hasNode(e.key))throw new Error(`Trying to add a namespace to ${this.key}, but it already exists`);let t=new o(this.root,e);return this.root.graph.setNode(t.key,t),this.root.graph.setParent(t.key,this.key),this.fields.push({type:"namespace",key:t.key}),t}removeNamespace(e){if(!this.root.graph.hasNode(e))throw new jt(`Trying to remove the ${e} namespace, but it doesn't exist`);let t=this.root.graph.node(e);if(!t||t.kind!==ne)throw new jt(`Trying to remove the ${e} namespace, but it is not a namespace`);return Se(this.root.graph,e),this.removeField(e),this}attachNamespace(e){if(!this.root.graph.hasNode(e))throw new Error(`Trying to attach the ${e} namespace, but it doesn't exist`);let t=this.root.graph.node(e);if(!t||t.kind!==ne)throw new Error(`Trying to attach the ${e} namespace, but it is not a namespace`);if(t.domain.key!==this.root.key)throw new Error(`Trying to attach the ${e} namespace, but it is not in the same domain`);let i=t.getParentInstance();if(i===this)throw new _e(`Trying to attach the ${e} entity, but it is already a child of this model`);return this.root!==i&&i.detachNamespace(e),this.fields.push({type:"namespace",key:e}),this.root.graph.setParent(e,this.key),this}detachNamespace(e){let t=this.fields.findIndex(r=>r.key===e);if(t===-1)throw new jt(`Trying to detach the ${e} namespace, but it doesn't exist`);let i=this.root.graph.node(e);if(!i||i.kind!==ne)throw new jt(`Trying to detach the ${e} namespace, but it is not a namespace`);return this.fields.splice(t,1),this.root.graph.setParent(e),this}*listNamespaces(){for(let{key:e,type:t}of this.fields){if(t!=="namespace")continue;let i=this.root.graph.node(e);!i||i.kind!==ne||(yield i)}}hasNamespaces(){return this.fields.some(e=>e.type==="namespace")}addModel(e){if(e&&e.key&&this.root.graph.hasNode(e.key))throw new Error(`Trying to add a model to ${this.key}, but it already exists`);let t=new it(this.root,e);return this.root.graph.setNode(t.key,t),this.root.graph.setParent(t.key,this.key),this.fields.push({type:"model",key:t.key}),t}removeModel(e){if(!this.root.graph.hasNode(e))throw new wi(`Trying to remove the ${e} model, but it doesn't exist`);let t=this.root.graph.node(e);if(!t||t.kind!==te)throw new wi(`Trying to remove the ${e} model, but it is not a model`);return Se(this.root.graph,e),this.removeField(e),this}attachModel(e){if(!this.root.graph.hasNode(e))throw new _e(`Trying to attach the ${e} model, but it doesn't exist`);let t=this.root.graph.node(e);if(!t||t.kind!==te)throw new _e(`Trying to attach the ${e} model, but it is not a model`);if(t.domain.key!==this.root.key)throw new _e(`Trying to attach the ${e} model, but it is not in the same domain`);let i=t.getParentInstance();if(i===this)throw new _e(`Trying to attach the ${e} model, but it is already a child of this namespace`);return this.root!==i&&i.detachModel(e),this.fields.push({type:"model",key:e}),this.root.graph.setParent(e,this.key),this}detachModel(e){let t=this.fields.findIndex(r=>r.key===e);if(t===-1)throw new Ke(`Trying to detach the ${e} model, but it doesn't exist`);let i=this.root.graph.node(e);if(!i||i.kind!==te)throw new Ke(`Trying to detach the ${e} model, but it is not a model`);if(i.getParentInstance()!==this)throw new Ke(`Trying to detach the ${e} model, but it is not a child of this namespace`);return this.fields.splice(t,1),this.root.graph.setParent(e),this}*listModels(){for(let{key:e,type:t}of this.fields){if(t!=="model")continue;let i=this.root.graph.node(e);!i||i.kind!==te||(yield i)}}hasModels(){return this.fields.some(e=>e.type==="model")}getParentInstance(){let e;for(let t of this.root.graph.parents(this.key)){e=t;break}return e?this.root.graph.node(e):this.root}*listFields(){for(let{key:e}of this.fields){let t=this.root.graph.node(e);t&&(t.kind===ne||t.kind===te)&&(yield t)}}hasFields(){return this.fields.length>0}removeField(e){this.fields=this.fields.filter(t=>t.key!==e)}isChildOf(e){if(this.key===e)return!1;let t=this.getParentInstance();return t?t.key===e?!0:t===this.root?!1:t.isChildOf(e):!1}};function Jt(o,e,t){return o+""+e+""+(t||"\0")}function Na(o,e,t){let i={v:o,w:e};return t&&(i.name=t),i}var _r=class o{isDirectedValue;isMultigraphValue;isCompoundValue;graphLabelValue;nodesValue;#e;get parentValue(){if(!this.isCompoundValue)throw new Error("Cannot access parentValue in a non-compound graph");return this.#e||(this.#e=new Map),this.#e}#t;get childrenValue(){if(!this.isCompoundValue)throw new Error("Cannot access childrenValue in a non-compound graph");return this.#t||(this.#t=new Map),this.#t}inValue;predecessorsValue;outValue;successorsValue;edgeObjectsValue;edgeLabelsValue;nodeCountValue;edgeCountValue;constructor(e={}){this.isDirectedValue=typeof e.directed=="boolean"?e.directed:!0,this.isMultigraphValue=typeof e.multigraph=="boolean"?e.multigraph:!1,this.isCompoundValue=typeof e.compound=="boolean"?e.compound:!1,this.graphLabelValue=void 0,this.nodesValue=new Map,this.isCompoundValue&&this.childrenValue.set("\0",new Set),this.inValue=new Map,this.outValue=new Map,this.predecessorsValue=new Map,this.successorsValue=new Map,this.edgeObjectsValue=new Map,this.edgeLabelsValue=new Map,this.nodeCountValue=0,this.edgeCountValue=0,this.defaultNodeLabelFn=()=>{},this.defaultEdgeLabelFn=()=>{}}isDirected(){return this.isDirectedValue}isMultigraph(){return this.isMultigraphValue}isCompound(){return this.isCompoundValue}setGraph(e){return this.graphLabelValue=e,this}graph(){return this.graphLabelValue}defaultNodeLabelFn(e){}defaultEdgeLabelFn(e,t,i){}setDefaultNodeLabel(e){return typeof e=="function"?this.defaultNodeLabelFn=e:this.defaultNodeLabelFn=()=>e,this}nodeCount(){return this.nodeCountValue}nodes(){return this.nodesValue.keys()}*sources(){for(let e of this.nodes()){let t=this.inValue.get(e);(!t||t.size===0)&&(yield e)}}*sinks(){for(let e of this.nodes()){let t=this.outValue.get(e);(!t||t.size===0)&&(yield e)}}setNodes(e,t){if(typeof t>"u")for(let i of e)this.setNode(i);else for(let i of e)this.setNode(i,t);return this}setNode(e,t){return this.nodesValue.has(e)?(t&&this.nodesValue.set(e,t),this):(this.nodesValue.set(e,t||this.defaultNodeLabelFn(e)),this.isCompoundValue&&(this.parentValue.set(e,new Set(["\0"])),this.childrenValue.set(e,new Set),this.childrenValue.get("\0").add(e)),this.inValue.set(e,new Map),this.predecessorsValue.set(e,new Map),this.outValue.set(e,new Map),this.successorsValue.set(e,new Map),++this.nodeCountValue,this)}node(e){return this.nodesValue.get(e)}hasNode(e){return this.nodesValue.has(e)}removeNode(e){if(!this.hasNode(e))return this;if(this.nodesValue.delete(e),this.isCompoundValue){this.removeFromParentsChildList(e),this.parentValue.delete(e);for(let r of this.children(e))this.removeParent(r,e);this.childrenValue.delete(e)}let t=this.inValue.get(e);if(t){for(let r of t.keys()){let a=this.edgeObjectsValue.get(r);a&&this.removeEdge(a)}this.inValue.delete(e)}this.predecessorsValue.delete(e);let i=this.outValue.get(e);if(i){for(let r of i.keys()){let a=this.edgeObjectsValue.get(r);a&&this.removeEdge(a)}this.outValue.delete(e)}return this.successorsValue.delete(e),this.nodeCountValue-=1,this}setParent(e,t="\0"){if(!this.isCompoundValue)throw new Error("Cannot set parent in a non-compound graph");return t!=="\0"&&(this.checkParentCycle(e,t),this.nodesValue.has(t)||this.setNode(t)),this.nodesValue.has(e)||this.setNode(e),this.removeFromParentsChildList(e),this.parentValue.set(e,new Set),this.parentValue.get(e).add(t),this.childrenValue.has(t)||this.childrenValue.set(t,new Set),this.childrenValue.get(t).add(e),this}checkParentCycle(e,t){for(let i of this.parents(t)){if(i===e)throw new Error(`Setting ${t} as parent of ${e} would create a cycle`);this.checkParentCycle(e,i)}}addParent(e,t){if(!this.isCompoundValue)throw new Error("Cannot set parent in a non-compound graph");return this.checkParentCycle(e,t),this.nodesValue.has(t)||this.setNode(t),this.nodesValue.has(e)||this.setNode(e),this.parentValue.has(e)||this.parentValue.set(e,new Set),this.parentValue.get(e).add(t),this.childrenValue.has(t)||this.childrenValue.set(t,new Set),this.childrenValue.get(t).add(e),this}removeParent(e,t){if(!this.isCompoundValue)throw new Error("Cannot remove parent in a non-compound graph");return this.nodesValue.has(e)?(t?(this.childrenValue.get(t)?.delete(e),this.parentValue.get(e)?.delete(t)):(this.removeFromParentsChildList(e),this.parentValue.set(e,new Set),this.parentValue.get(e).add("\0"),this.childrenValue.get("\0").add(e)),this):this}removeFromParentsChildList(e){let t=this.parentValue.get(e);if(t)for(let i of t)this.childrenValue.get(i)?.delete(e)}*parents(e){if(this.isCompoundValue){let t=this.parentValue.get(e);if(t)for(let i of t)i!=="\0"&&(yield i)}}hasParents(e){for(let t of this.parents(e))return!0;return!1}hasParent(e,t){if(this.isCompoundValue){let i=this.parentValue.get(e);if(i)return i.has(t)}return!1}parent(e){for(let t of this.parents(e))return t}*children(e="\0"){if(this.isCompoundValue){let t=this.childrenValue.get(e);if(t)for(let i of t.keys())yield i}else if(e==="\0")for(let t of this.nodes())yield t}hasChildren(e="\0"){if(this.isCompoundValue){let t=this.childrenValue.get(e);if(!t)return!1;for(let i of t.keys())return!0;return!1}else if(e==="\0"){for(let t of this.nodes())return!0;return!1}return!1}*predecessors(e){let t=this.predecessorsValue.get(e);if(t)for(let i of t.keys())yield i}*successors(e){let t=this.successorsValue.get(e);if(t)for(let i of t.keys())yield i}*neighbors(e){if(!this.hasNode(e))return;let t=new Set;for(let i of this.predecessors(e))t.has(i)||(t.add(i),yield i);for(let i of this.successors(e))t.has(i)||(t.add(i),yield i)}isLeaf(e){if(this.isDirected()){for(let t of this.successors(e))return!1;return!0}for(let t of this.neighbors(e))return!1;return!0}filterNodes(e){let t=new o({directed:this.isDirectedValue,multigraph:this.isMultigraphValue,compound:this.isCompoundValue}),i=this.graph();t.setGraph(i);let r=new Set;if(this.nodesValue.forEach((a,s)=>{e(s)&&(t.setNode(s,a),r.add(s))}),this.edgeObjectsValue.forEach(a=>{r.has(a.v)&&r.has(a.w)&&t.setEdge(a,this.edge(a))}),this.isCompoundValue){let a=new Map;for(let s of t.nodes()){let n=[...this.parents(s)],l=[];for(;n.length>0;){let c=!1;for(let u of n)t.hasNode(u)&&(l.push(u),c=!0);if(c)break;let p=[];for(let u of n)for(let m of this.parents(u))p.push(m);n=p}l.length===0&&l.push("\0"),a.set(s,l)}for(let[s,n]of a){this.removeParent(s);for(let l of n)t.addParent(s,l)}}return t}setDefaultEdgeLabel(e){return typeof e=="function"?this.defaultEdgeLabelFn=e:this.defaultEdgeLabelFn=()=>e,this}edgeCount(){return this.edgeCountValue}edges(){return this.edgeObjectsValue.values()}setPath(e,t){if(!Array.isArray(e)||!e.length)return this;let i=arguments.length>1;return e.reduce((r,a)=>(i?this.setEdge(r,a,t):this.setEdge(r,a),a)),this}setEdge(e,t,i,r){if(typeof e=="object"&&e!==null&&"v"in e){let a=e;arguments.length>1?this._setEdge({loop:0},a,t):this._setEdge({loop:0},a)}else if(typeof t=="string"){let a=Na(e,t,r);arguments.length>2?this._setEdge({loop:0},a,i):this._setEdge({loop:0},a)}else throw new Error("Invalid arguments for setEdge");return this}_setEdge(e,t,i){let r=!1,a;arguments.length>2&&(a=i,r=!0);let s=Jt(t.v,t.w,t.name);if(this.edgeLabelsValue.has(s)){if(r&&this.edgeLabelsValue.set(s,a),e.loop===0&&!this.isDirectedValue&&t.w!==t.v){let u=Na(t.w,t.v,t.name);r?this._setEdge({loop:1},u,i):this._setEdge({loop:1},u)}return}if(t.name&&!this.isMultigraphValue)throw new Error("Cannot set a named edge when isMultigraph = false");this.hasNode(t.v)||this.setNode(t.v),this.hasNode(t.w)||this.setNode(t.w);let l=r?a:this.defaultEdgeLabelFn(t.v,t.w,t.name);this.edgeLabelsValue.set(s,l),this.edgeObjectsValue.set(s,t);let c=this.predecessorsValue.get(t.w);if(c){let u=(c.get(t.v)||0)+1;c.set(t.v,u)}let p=this.successorsValue.get(t.v);if(p){let u=(p.get(t.w)||0)+1;p.set(t.w,u)}if(this.inValue.get(t.w).set(s,t),this.outValue.get(t.v).set(s,t),this.edgeCountValue++,e.loop===0&&!this.isDirectedValue&&t.w!==t.v){let u=Na(t.w,t.v,t.name);r?this._setEdge({loop:1},u,i):typeof l=="object"&&l!==null?this._setEdge({loop:1},u,l):this._setEdge({loop:1},u)}}edge(e,t,i){let r;return typeof e=="object"?r=Jt(e.v,e.w,e.name):r=Jt(e,t,i),this.edgeLabelsValue.get(r)}hasEdge(e,t,i){let r;return typeof e=="object"?r=Jt(e.v,e.w,e.name):r=Jt(e,t,i),this.edgeLabelsValue.has(r)}removeEdge(e,t,i){return typeof e=="object"?this._removeEdge({loop:0},e.v,e.w,e.name):this._removeEdge({loop:0},e,t,i),this}_removeEdge(e,t,i,r){let a=Jt(t,i,r),s=this.edgeObjectsValue.get(a);if(s){this.edgeLabelsValue.delete(a),this.edgeObjectsValue.delete(a);let n=this.predecessorsValue.get(s.w);if(n){let c=(n.get(s.v)||0)-1;c<=0?n.delete(s.v):n.set(s.v,c)}let l=this.successorsValue.get(s.v);if(l){let c=(l.get(s.w)||0)-1;c<=0?l.delete(s.w):l.set(s.w,c)}this.inValue.get(s.w)?.delete(a),this.outValue.get(s.v)?.delete(a),this.edgeCountValue--}!this.isDirectedValue&&e.loop===0&&this._removeEdge({loop:1},i,t,r)}*inEdges(e,t){let i=this.inValue.get(e);if(i){let r=i.values();if(!t){for(let a of r)yield a;return}for(let a of r)a.v===t&&(yield a)}}*outEdges(e,t){let i=this.outValue.get(e);if(!i)return;let r=i.values();if(!t){for(let a of r)yield a;return}for(let a of r)a.w===t&&(yield a)}*nodeEdges(e,t){for(let i of this.inEdges(e,t))yield i;for(let i of this.outEdges(e,t))i.v!==i.w&&(yield i)}};function uc(o,e){let t=[];for(let i of o.nodes()){let r=o.node(i);if(!r||r.domain.key!==e)continue;let a=[...o.parents(i)],s={v:i};s.value=r.toJSON(),a.length&&(s.parents=a),t.push(s)}return t}function mc(o,e){let t=[];for(let i of o.edges()){let r=o.edge(i);if(!r)continue;let a=o.node(i.v),s=o.node(i.w);if(!a||!s||a.domain.key!==e||s.domain.key!==e&&r.type!=="association"&&r.type!=="parent")continue;let n={v:i.v,w:i.w};i.name&&(n.name=i.name),n.value=structuredClone(r),t.push(n)}return t}function hc(o,e){let t=[],i=new Set;for(let r of o.nodes()){let a=o.node(r);a&&a.domain.key===e&&i.add(r)}for(let r of i){let a=o.node(r);if(a){if(a.kind===Z||a.kind===oe){let n=[...o.inEdges(r)].filter(l=>{let c=o.node(l.v);return c&&c.domain.key===e});if(n.length===0){let l=a.kind===Z?"Property":"Association";t.push(`${l} "${a.info.name}" (${r}) has no parent entity edge. This will cause deserialization to fail.`)}else if(n.length>1){let l=a.kind===Z?"Property":"Association",c=n.map(p=>p.v).join(", ");t.push(`${l} "${a.info.name}" (${r}) has multiple parent edges: ${c}. This may cause deserialization issues.`)}else{let l=n[0],c=o.node(l.v);if(!c||c.kind!==J){let p=a.kind===Z?"Property":"Association";t.push(`${p} "${a.info.name}" (${r}) has a parent that is not an entity. Parent: ${c?.kind||"unknown"} (${l.v})`)}}}if(a.kind===J&&([...o.parents(r)].some(l=>{let c=o.node(l);return c&&c.kind===te})||t.push(`Entity "${a.info.name}" (${r}) has no model parent. Entities must belong to a model.`)),a.kind===te){let s=[...o.parents(r)],n=s.some(l=>{let c=o.node(l);return c&&c.kind===ne});if(s.length>0&&!n){let l=s.map(c=>`${o.node(c)?.kind||"unknown"} (${c})`).join(", ");t.push(`Model "${a.info.name}" (${r}) has invalid parent types: ${l}. Models can only belong to namespaces or be at root level.`)}}}}for(let r of i){let a=o.node(r);if(a&&a.kind===oe){let s=a,l=[...o.outEdges(r)].filter(c=>{let p=o.edge(c);return p&&p.type==="association"});l.length;for(let c of l){let p=o.node(c.w);p?p.kind!==J&&t.push(`Association "${s.info.name}" (${r}) references non-entity target: ${p.kind} (${c.w})`):t.push(`Association "${s.info.name}" (${r}) references non-existent target: ${c.w}`)}}}if(t.length>0)throw new Error(`Graph consistency validation failed for domain "${e}":
|
|
158
158
|
`+t.map(r=>` - ${r}`).join(`
|
|
159
|
-
`))}function fn(o,e){return mc(o,e),{options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:pc(o,e),edges:uc(o,e)}}function gn(o,e){for(let t of o.nodes()){let i=o.node(t);i&&i.domain.key===e&&o.removeNode(t)}}function ja(o,e,t){let i=new Set,r=new Set;for(let s of e.nodes()){let n=e.node(s);if(!n)continue;let l=`${t}:${s}`;o.setNode(l,n),i.add(l)}for(let s of e.edges()){let n=e.edge(s);if(!n)continue;let l=`${t}:${s.v}`,c=`${t}:${s.w}`;o.setEdge(l,c,{foreign:!0,domain:t,...n}),r.add(`${l}|${c}`)}let a=new Set;for(let s of e.nodes()){let n=`${t}:${s}`;for(let l of e.parents(s)){let c=`${t}:${l}`,p=o.node(n),u=o.node(c);p.kind===J&&u.kind===J?a.has(n)?o.addParent(n,c):(a.add(n),o.setParent(n,c)):o.setParent(n,c)}}return{nodes:i,edges:r}}function hn(o,e){for(let t of e)if(t.w===o)return t.v}function hc(o,e,t,i,r){if(!e){let s={type:"malformed_entry",severity:"error",message:"Unable to restore data domain graph. Malformed node entry"};if(r.push(s),i==="strict")throw new Error(s.message);return}let a=e;if(!a.kind){let s={type:"malformed_entry",severity:"error",message:"Unable to restore data domain graph. Node entry missing kind property",affectedKey:a.key};if(r.push(s),i==="strict")throw new Error(s.message);return}try{if(a.kind===ne)return new jt(o,a);if(a.kind===te)return new tt(o,a);if(a.kind===J)return new Et(o,a);if(a.kind===Z){let n=a,l=hn(n.key,t);if(!l){let c={type:"missing_edge",severity:"error",message:`Property "${n.info?.name||n.key}" has no parent entity edge`,affectedKey:n.key,resolution:i==="lenient"?"Property will be skipped":void 0};if(r.push(c),i==="strict")throw new Error("Unable to restore data domain graph. Malformed node entry");return}return new _t(o,l,n)}if(a.kind===oe){let n=a,l=hn(n.key,t);if(!l){let c={type:"missing_edge",severity:"error",message:`Association "${n.info?.name||n.key}" has no parent entity edge`,affectedKey:n.key,resolution:i==="lenient"?"Association will be skipped":void 0};if(r.push(c),i==="strict")throw new Error("Unable to restore data domain graph. Malformed node entry");return}return new At(o,l,n)}let s={type:"unknown_kind",severity:"error",message:`Unknown node kind: ${a.kind}`,affectedKey:a.key};if(r.push(s),i==="strict")throw new Error(`Unable to restore data domain graph. Unknown node kind ${a.kind}`);return}catch(s){let n={type:"malformed_entry",severity:"error",message:`Failed to create node: ${s instanceof Error?s.message:String(s)}`,affectedKey:a.key};if(r.push(n),i==="strict")throw s;return}}function yn(o,e={}){let{json:t,dependencies:i,mode:r="strict"}=e,a=new _r({compound:!0,multigraph:!0,directed:!0}),s=[],n=new Set,l=new Set;if(i)for(let p of i)try{let u=ja(a,p.graph,p.key);u.edges.size&&(l=new Set([...l,...u.edges])),u.nodes.size&&(n=new Set([...n,...u.nodes])),o.dependencies.set(p.key,p)}catch(u){let m=`Failed to merge dependency "${p.key}": ${u instanceof Error?u.message:String(u)}`;if(r==="strict")throw new Error(m,{cause:u});let g={type:"missing_dependency",severity:"error",message:m,affectedKey:p.key,resolution:"Dependency will be skipped"};s.push(g)}if(!t)return{graph:a,issues:s,success:!0};if(Array.isArray(t.nodes)){let p=new Map;for(let u of t.nodes){let m=hc(o,u.value,t.edges,r,s);m&&(a.setNode(u.v,m),u.parents&&p.set(u.v,u.parents))}for(let[u,m]of p){if(!a.hasNode(u)){let g={type:"missing_node",severity:"warning",message:`Cannot set parents for missing node: ${u}`,affectedKey:u,resolution:"Parent relationship will be skipped"};s.push(g);continue}for(let g of m){if(!a.hasNode(g)){let f={type:"missing_node",severity:"warning",message:`Parent node "${g}" not found for child "${u}"`,affectedKey:u,context:{parentKey:g},resolution:"Parent relationship will be skipped"};s.push(f);continue}try{a.setParent(u,g)}catch(f){let v={type:"invalid_parent",severity:"warning",message:`Failed to set parent "${g}" for child "${u}": ${f instanceof Error?f.message:String(f)}`,affectedKey:u,context:{parentKey:g},resolution:"Parent relationship will be skipped"};s.push(v)}}}}if(Array.isArray(t.edges))for(let p of t.edges){if(!p.value){let u="Edge entry missing value";if(r==="strict")throw new Error(u);let m={type:"malformed_entry",severity:"error",message:u,context:{edge:p}};s.push(m);continue}if(p.value.foreign&&!n.has(p.w)){let u={type:"missing_node",severity:"warning",message:`Missing foreign node: ${p.w}`,affectedKey:p.w,resolution:"Edge will be skipped"};s.push(u);continue}if(n.has(p.v)||n.has(p.w)){if(!a.hasNode(p.v)||!a.hasNode(p.w)){let u={type:"missing_node",severity:"warning",message:`Missing foreign node for edge: ${p.v} -> ${p.w}`,context:{sourceNode:p.v,targetNode:p.w},resolution:"Edge will be skipped"};s.push(u);continue}}else{if(!a.hasNode(p.v)){let u={type:"missing_node",severity:"warning",message:`Source node not found for edge: ${p.v}`,affectedKey:p.v,resolution:"Edge will be skipped"};s.push(u);continue}if(!a.hasNode(p.w)){let u={type:"missing_node",severity:"warning",message:`Target node not found for edge: ${p.w}`,affectedKey:p.w,resolution:"Edge will be skipped"};s.push(u);continue}}try{a.setEdge({v:p.v,w:p.w,name:p.name},p.value)}catch(u){let g={type:"malformed_entry",severity:"warning",message:`Failed to create edge ${p.v} -> ${p.w}: ${u instanceof Error?u.message:String(u)}`,context:{sourceNode:p.v,targetNode:p.w},resolution:"Edge will be skipped"};s.push(g)}}let c=s.some(p=>p.severity==="error");return{graph:a,issues:s,success:!c}}var Gt=class extends EventTarget{dependencies=new Map;dependencyList=[];constructor(e=[],t=[]){super(),this.dependencyList=[...e];for(let i of t)this.dependencies.set(i.key,i)}};var Je=class o extends Gt{kind;key;graph;info;#e=!0;#t=!1;readOnly;get domain(){return this}#i;get fields(){return this.#i}set fields(e){this.#i=e}issues=[];static createSchema(e={}){let{key:t=R(),fields:i}=e,r=W.fromJSON(e.info,{name:"Unnamed domain"}).toJSON(),a={kind:Be,key:t,info:r};return e.dependencyList&&(a.dependencyList=structuredClone(e.dependencyList)),e.graph&&(a.graph=e.graph),Array.isArray(i)&&(a.fields=[...i]),a}constructor(e,t=[],i){let r=o.createSchema(e),a=[];for(let l of t)if(l instanceof o)l.readOnly?a.push(l):(console.warn(`Domain ${l.key} is not read only, cloning it. This may have performance implications.`),a.push(l.clone({readOnly:!0})));else if(typeof l=="object"&&l.kind===Be&&l.key){let c=new o(l,void 0,{readOnly:!0});a.push(c)}else throw new Error(`Invalid foreign domain dependency: ${l}`);super(r.dependencyList,a),this.kind=r.kind,this.key=r.key,this.info=new W(r.info),this.readOnly=i?.readOnly||!1;let s=i?.mode||"strict",n=yn(this,{json:r.graph,dependencies:a,mode:s});this.graph=n.graph,n.issues.length>0&&s==="lenient"&&(this.issues=n.issues),Array.isArray(r.fields)?this.fields=[...r.fields]:this.fields=[],Array.isArray(r.dependencyList)?this.dependencyList=[...r.dependencyList]:this.dependencyList=[],this.#e=!1}clone(e){let t=this.toJSON(),i=Array.from(this.dependencies.values()).map(a=>a.clone()),r={readOnly:this.readOnly,...e};return new o(t,i,r)}toJSON(){let e={info:this.info.toJSON(),kind:this.kind,key:this.key,graph:fn(this.graph,this.key)};return this.dependencyList.length>0&&(e.dependencyList=structuredClone(this.dependencyList)),Array.isArray(this.fields)&&this.fields.length&&(e.fields=[...this.fields]),e}notifyChange(){this.#t||this.#e||(this.#t=!0,queueMicrotask(()=>{this.#t=!1;let e=new Event("change");this.dispatchEvent(e)}))}removeField(e){this.fields=this.fields.filter(t=>t.key!==e)}hasFields(){return this.fields.length>0}*listFields(){for(let{key:e}of this.fields){let t=this.graph.node(e);t&&(t.kind===ne||t.kind===te)&&(yield t)}}addNamespace(e,t){if(t){if(!this.graph.hasNode(t))throw new Error(`Parent namespace ${t} does not exist`);let r=this.graph.node(t);if(!r||r.kind!==ne)throw new Error(`Parent namespace ${t} is not a valid namespace`);if(r.domain.key!==this.key)throw new Error("Cannot add a namespace to a foreign domain");return r.addNamespace(e)}let i=new jt(this,e);return this.graph.setNode(i.key,i),this.fields.push({type:"namespace",key:i.key}),i}removeNamespace(e){if(!this.graph.hasNode(e))throw new Error(`Namespace ${e} does not exist`);let t=this.graph.node(e);if(!t||t.kind!==ne)throw new Error(`Namespace ${e} not found`);if(t.domain.key!==this.key)throw new Error("Cannot remove a namespace from a foreign domain");let i=t.getParentInstance();return i===this?(ke(this.graph,e),this.removeField(e)):i.removeNamespace(e),this}*listNamespaces(){for(let{key:e,type:t}of this.fields){if(t!=="namespace")continue;let i=this.graph.node(e);!i||i.kind!==ne||(yield i)}}*listForeignNamespaces(e){let t=this.dependencies.get(e);if(!t)throw new Error(`Foreign domain ${e} not found`);for(let i of t.listNamespaces()){let r=`${e}:${i.key}`;this.graph.node(r)&&(yield i)}}hasNamespaces(){return this.fields.some(e=>e.type==="namespace")}*listGraphNamespaces(e){for(let t of this.graph.children(e)){let i=this.graph.node(t);i.kind===ne&&i.domain.key===this.key&&(yield i)}}buildReferenceKey(e,t){if(t&&t!==this.key){if(typeof t!="string"||t.length===0)throw new Error(`Invalid namespace key. Expected a string, got ${typeof t}`);if(!this.dependencies.get(t))throw new Error(`Foreign domain ${t} not found`);return`${t}:${e}`}return e}findNamespace(e,t){let i=this.graph.node(this.buildReferenceKey(e,t));if(i&&i.kind===ne)return i}moveNamespace(e,t){if(!this.graph.hasNode(e))throw new Error(`Namespace ${e} does not exist`);let i=this.findNamespace(e);if(!i)throw new Error(`Namespace ${e} not found in the graph`);if(t){let s=this.findNamespace(t);if(s&&s.domain.key!==this.key)throw new Error("Cannot move a namespace to a foreign domain");if(!s)throw new Error(`Parent namespace ${t} does not exist`)}if(e===t)throw new Error("Cannot move a namespace to itself");if(i.domain.key!==this.key)throw new Error("Cannot move a namespace from a foreign domain");let r;if(t){if(r=this.findNamespace(t),!r)throw new Error(`Parent namespace ${t} not found`);if(this.isChildOf(t,e))throw new Error("Cannot move a namespace to its own child")}let a=this.graph.parent(e);return a&&!t?this.graph.node(a).detachNamespace(e):a||this.removeField(e),t&&r?r.attachNamespace(e):this.fields.push({type:"namespace",key:e}),this}isChildOf(e,t){let i=this.graph.children(t);for(let r of i)if(r===e||this.isChildOf(e,r))return!0;return!1}addModel(e,t){if(t){if(!this.graph.hasNode(t))throw new Error(`Parent ${t} does not exist`);let r=this.findNamespace(t);if(!r)throw new Error(`Parent namespace ${t} is not a valid namespace`);if(r.domain.key!==this.key)throw new Error("Cannot add a model to a foreign domain");return r.addModel(e)}let i=new tt(this,e);return this.graph.setNode(i.key,i),this.fields.push({type:"model",key:i.key}),i}removeModel(e){if(!this.graph.hasNode(e))throw new Error(`Data model ${e} does not exist`);let t=this.graph.node(e);if(!t||t.kind!==te)throw new Error(`Data model ${e} not found`);if(t.domain.key!==this.key)throw new Error("Cannot remove a model from a foreign domain");let i=t.getParentInstance();return i===this?(ke(this.graph,e),this.removeField(e)):i.removeModel(e),this}*listModels(e){let t=e?.domain,i=e?.includeForeign??!1,r=e?.foreignOnly??!1;if(t){let a=t===this.key?this:this.dependencies.get(t);if(!a)throw new Error(`Foreign domain ${t} not found`);for(let s of a.listModels()){let n=t===this.key?s.key:`${t}:${s.key}`,l=this.graph.node(n);l&&(yield l)}return}if(!r)for(let{key:a,type:s}of this.fields){if(s!=="model")continue;let n=this.graph.node(a);n&&n.kind===te&&(yield n)}if(i||r)for(let[a,s]of this.dependencies)for(let n of s.listModels()){let l=`${a}:${n.key}`,c=this.graph.node(l);c&&(yield c)}}*listForeignModels(e){yield*this.listModels({domain:e})}hasModels(){return this.fields.some(e=>e.type==="model")}*listGraphModels(e){for(let t of this.graph.children(e)){let i=this.graph.node(t);i.kind===te&&i.domain.key===this.key&&(yield i)}}findModel(e,t){let i=this.graph.node(this.buildReferenceKey(e,t));if(i&&i.kind===te)return i}moveModel(e,t){if(!this.graph.hasNode(e))throw new Error(`Data model ${e} does not exist`);let i=this.findModel(e);if(!i)throw new Error(`Data model ${e} not found in the graph`);if(t){let a=this.findNamespace(t);if(a&&a.domain.key!==this.key)throw new Error("Cannot move a model to a foreign domain");if(!a)throw new Error(`Parent namespace ${t} does not exist`)}if(i.domain.key!==this.key)throw new Error("Cannot move a data model to a foreign domain");let r=this.graph.parent(e);if(r&&!t){let a=this.findNamespace(r);if(!a)throw new Error(`The parent namespace ${r} not found`);a.detachModel(e)}else r||this.removeField(e);return t?this.findNamespace(t).attachModel(e):this.fields.push({type:"model",key:e}),this}addEntity(e,t){if(!e)throw new Error("An entity expects a DomainModel parent");if(!this.graph.hasNode(e))throw new Error(`The parent ${e} does not exist`);let i=this.findModel(e);if(!i)throw new Error(`Parent model ${e} is not a valid model`);if(i.domain.key!==this.key)throw new Error("Cannot add an entity to a foreign domain");return i.addEntity(t)}removeEntity(e){if(!this.graph.hasNode(e))throw new Error(`Entity ${e} does not exist`);let t=this.graph.parent(e);if(!t)throw new Error(`Parent model not found for entity ${e}`);let i=this.findModel(t);if(!i)throw new Error(`Parent model ${t} not found`);if(i.domain.key!==this.key)throw new Error("Cannot remove an entity from a foreign domain");return i.removeEntity(e),this}*listEntities(e){let t,i,r=!1,a=!1;if(typeof e=="string"?t=e:e&&typeof e=="object"&&(t=e.parent,i=e.domain,r=e.includeForeign??!1,a=e.foreignOnly??!1),i&&i!==this.key&&!this.dependencies.get(i))throw new Error(`Foreign domain ${i} not found`);let s=t?this.graph.children(t):this.graph.nodes();for(let n of s){let l=this.graph.node(n);if(l&&l.kind===J){let c=l.domain.key===this.key;if(i){l.domain.key===i&&(yield l);continue}a?c||(yield l):r?yield l:c&&(yield l)}}}*listForeignEntities(e){yield*this.listEntities({domain:e})}*listAllForeignEntities(){yield*this.listEntities({foreignOnly:!0})}findEntity(e,t){let i=this.graph.node(this.buildReferenceKey(e,t));if(i&&i.kind===J)return i}moveEntity(e,t,i){if(t===i)throw new Error("Cannot move an entity to the same model");if(!this.graph.hasNode(e))throw new Error(`Entity ${e} does not exist`);if(!this.graph.hasNode(t))throw new Error(`Source model ${t} does not exist`);if(!this.graph.hasNode(i))throw new Error(`Target model ${i} does not exist`);let r=this.findEntity(e),a=this.findModel(t),s=this.findModel(i);if(!r||!a||!s)throw new Error("Entity or models not found in the graph");if(r.domain.key!==this.key)throw new Error("Cannot move an entity from a foreign domain");if(s.domain.key!==this.key)throw new Error("Cannot move an entity to a foreign domain");s.attachEntity(e)}addAssociation(e,t){if(!this.graph.hasNode(e))throw new Error(`Source entity ${e} not found`);let i=this.findEntity(e);if(!i)throw new Error(`Source entity ${e} not found`);if(i.domain.key!==this.key)throw new Error("Cannot add an association to a foreign domain");return i.addAssociation(t)}removeAssociation(e){if(!this.graph.hasNode(e))throw new Error(`Association ${e} does not exist`);let t=this.graph.node(e);if(!t||t.kind!==oe)throw new Error(`Association ${e} not found`);let i=t.getParentInstance();if(!i)throw new Error(`Parent entity not found for association ${e}`);if(i.domain.key!==this.key)throw new Error("Cannot remove an association from a foreign domain");return i.removeAssociation(e),this}findAssociation(e,t){let i=this.graph.node(this.buildReferenceKey(e,t));if(i&&i.kind===oe)return i}addProperty(e,t){if(!e)throw new Error("A property expects a DomainEntity parent");if(!this.graph.hasNode(e))throw new Error(`Parent entity ${e} does not exist`);let i=this.findEntity(e);if(!i)throw new Error(`Parent entity ${e} not found`);if(i.domain.key!==this.key)throw new Error("Cannot add a property to a foreign domain");return i.addProperty(t)}removeProperty(e){if(!this.graph.hasNode(e))throw new Error(`Property ${e} does not exist`);let t=this.graph.node(e);if(!t||t.kind!==Z)throw new Error(`Property ${e} not found`);let i=t.getParentInstance();if(!i)throw new Error(`Parent entity not found for property ${e}`);if(i.domain.key!==this.key)throw new Error("Cannot remove a property from a foreign domain");return i.removeProperty(e),this}findProperty(e,t){let i=this.graph.node(this.buildReferenceKey(e,t));if(i&&i.kind===Z)return i}registerForeignDomain(e){let{info:t,key:i}=e;if(!t.version)throw new Error(`Foreign domain ${i} does not have a version set`);if(this.dependencies.has(i))throw new Error(`Foreign domain with key ${i} already registered`);this.dependencies.set(i,e),this.dependencyList.push({key:i,version:t.version}),ja(this.graph,e.graph,e.key)}unregisterForeignDomain(e){let t=this.dependencies.get(e);if(!t)throw new Error(`Foreign domain with key ${e} not found`);this.dependencies.delete(e),this.dependencyList=this.dependencyList.filter(i=>i.key!==e),gn(this.graph,t.key)}removeDomainElement(e,t){switch(t){case ne:this.removeNamespace(e);break;case te:this.removeModel(e);break;case J:this.removeEntity(e);break;case Z:this.removeProperty(e);break;case oe:this.removeAssociation(e);break;default:throw new Error(`Unknown kind ${t} for the object ${e}`)}}search(e={}){let{query:t,nodeTypes:i,includeForeignDomains:r=!1,caseSensitive:a=!1}=e,s=[],n=!t&&(!i||i.length===0),l=m=>!i||i.length===0?!0:i.includes(m),c=m=>{if(!m||!t)return!t;if(t instanceof RegExp)return t.test(m);let g=a?m:m.toLowerCase(),f=a?t:t.toLowerCase();return g.includes(f)},p=m=>{if(!t)return[];let g=[],{info:f}=m;return c(f.name)&&g.push("name"),c(f.displayName)&&g.push("displayName"),c(f.description)&&g.push("description"),g},u=m=>m.includes(":");for(let m of this.graph.nodes()){let g=this.graph.node(m);if(!g||!g.info)continue;let f=u(m);if(f&&!r||!l(g.kind))continue;if(n){s.push({node:g,matchedFields:[],key:m,isForeign:f});continue}let b=p(g);(!t||b.length>0)&&s.push({node:g,matchedFields:b,key:m,isForeign:f})}return s}};var Ia=[],$a=[],bn={},vi={},ki={};function wn(o){return typeof o=="string"?new RegExp("^"+o+"$","i"):o}function Ar(o,e){return o===e?e:o===o.toLowerCase()?e.toLowerCase():o===o.toUpperCase()?e.toUpperCase():o[0]===o[0].toUpperCase()?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e.toLowerCase()}function gc(o,e){return o.replace(/\$(\d{1,2})/g,function(t,i){return e[i]||""})}function yc(o,e){return o.replace(e[0],function(t,i){let r=gc(e[1],arguments);return Ar(t===""?o[i-1]:t,r)})}function vn(o,e,t){if(!o.length||Object.hasOwn(bn,o))return e;let i=t.length;for(;i--;){let r=t[i];if(r[0].test(e))return yc(e,r)}return e}function kn(o,e,t){return function(i){let r=i.toLowerCase();return Object.prototype.hasOwnProperty.call(e,r)?Ar(i,r):Object.prototype.hasOwnProperty.call(o,r)?Ar(i,o[r]):vn(r,i,t)}}function Sn(o,e,t){return function(i){let r=i.toLowerCase();return Object.prototype.hasOwnProperty.call(e,r)?!0:Object.prototype.hasOwnProperty.call(o,r)?!1:vn(r,r,t)===r}}var me=function(o,e,t){let i=e===1?me.singular(o):me.plural(o);return(t?e+" ":"")+i};me.plural=kn(ki,vi,Ia);me.isPlural=Sn(ki,vi,Ia);me.singular=kn(vi,ki,$a);me.isSingular=Sn(vi,ki,$a);me.addPluralRule=function(o,e){Ia.push([wn(o),e])};me.addSingularRule=function(o,e){$a.push([wn(o),e])};me.addUncountableRule=function(o){if(typeof o=="string"){bn[o.toLowerCase()]=!0;return}me.addPluralRule(o,"$0"),me.addSingularRule(o,"$0")};me.addIrregularRule=function(o,e){e=e.toLowerCase(),o=o.toLowerCase(),ki[o]=e,vi[e]=o};[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["my","our"],["its","their"],["his","their"],["her","their"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"],["canvas","canvases"]].forEach(function(o){me.addIrregularRule(o[0],o[1])});[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(o){me.addPluralRule(o[0],o[1])});[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/(dg|ss|ois|lk|ok|wn|mb|th|ch|ec|oal|is|ck|ix|sser|ts|wb)ies$/i,"$1ie"],[/\b(l|(?:neck|cross|hog|aun)?t|coll|faer|food|gen|goon|group|hipp|junk|vegg|(?:pork)?p|charl|calor|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(o){me.addSingularRule(o[0],o[1])});["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(me.addUncountableRule);var xr=me;function It(o){return o.domain?`${o.domain}:${o.key}`:o.key}function Bt(o){if(!o)throw new h("Cannot generate parameter name from an empty string.",{code:"E_INVALID_PARAM_NAME",help:"The entity name used for path parameter generation is empty."});let e=o.replace(/([a-z])([A-Z])/g,"$1 $2");e=e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2");let i=e.replace(/[^a-zA-Z0-9]/g," ").split(/\s+/).filter(Boolean);if(i.length===0)throw new h(`Cannot generate a valid parameter name from "${o}".`,{code:"E_INVALID_PARAM_NAME",help:"The entity name must contain alphanumeric characters to generate a path parameter."});let a=i.map((s,n)=>{let l=s.toLowerCase();return n===0?l:l.charAt(0).toUpperCase()+l.slice(1)}).join("");return/^[0-9]/.test(a)&&(a="_"+a),`${a}Id`}function $t(o){let e=o.trim(),t=e.startsWith("/")?e:`/${e}`;return t==="/"?"/":t.replace(/\/+$/,"")}function Ta(o,e){let t=o.endsWith("/")?o.slice(0,-1):o,i=e.startsWith("/")?e:`/${e}`;return`${t}${i}`}var Tt=class o{kind;key;entity;hasCollection;collectionPath;resourcePath;isRoot;parent;exposeOptions;actions;accessRule;rateLimiting;paginationContract;truncated;api;static createSchema(e={}){let{key:t=R(),entity:i={key:""},collectionPath:r,resourcePath:a="/",hasCollection:s=!0,isRoot:n,parent:l,exposeOptions:c,actions:p=[],accessRule:u,rateLimiting:m,truncated:g,paginationContract:f}=e,b={kind:yt,key:t,entity:{...i},hasCollection:s,resourcePath:a,actions:p.map(v=>({...v}))};return r!==void 0&&(b.collectionPath=r),n!==void 0&&(b.isRoot=n),l!==void 0&&(b.parent={...l}),c!==void 0&&(b.exposeOptions={...c}),Array.isArray(u)&&(b.accessRule=u.map(v=>({...v}))),m!==void 0&&(b.rateLimiting={...m}),g!==void 0&&(b.truncated=g),f!==void 0&&(b.paginationContract=structuredClone(f)),b}constructor(e,t){this.api=e;let i=o.createSchema(t);this.kind=i.kind,this.key=i.key,this.entity=i.entity,this.hasCollection=i.hasCollection,this.collectionPath=i.collectionPath,this.resourcePath=i.resourcePath,this.isRoot=i.isRoot,this.parent=i.parent,this.exposeOptions=i.exposeOptions,this.actions=i.actions?i.actions.map(r=>Yr(this,r)):[],this.accessRule=i.accessRule?i.accessRule.map(r=>Mt(this,r)):[],i.rateLimiting&&(this.rateLimiting=new Xe(i.rateLimiting)),this.truncated=i.truncated,i.paginationContract&&(this.paginationContract=structuredClone(i.paginationContract))}toJSON(){let e={kind:this.kind,key:this.key,entity:{...this.entity},resourcePath:this.resourcePath,actions:this.actions.map(t=>t.toJSON()),hasCollection:this.hasCollection};return this.collectionPath!==void 0&&(e.collectionPath=this.collectionPath),this.isRoot!==void 0&&(e.isRoot=this.isRoot),this.parent!==void 0&&(e.parent={...this.parent}),this.exposeOptions!==void 0&&(e.exposeOptions={...this.exposeOptions}),Array.isArray(this.accessRule)&&this.accessRule.length>0&&(e.accessRule=this.accessRule.map(t=>t.toJSON())),this.rateLimiting!==void 0&&(e.rateLimiting=this.rateLimiting.toJSON()),this.truncated!==void 0&&(e.truncated=this.truncated),this.paginationContract&&(e.paginationContract=structuredClone(this.paginationContract)),e}setCollectionPath(e){if(!this.hasCollection)throw new h("Cannot set collection path on an exposure that does not have a collection",{code:"E_PATH_MISSING",help:"The exposed entity you are trying to set a collection path for does not have a collection."});let i=$t(e).split("/").filter(Boolean);if(i.length!==1)throw new h(`Collection path must contain exactly one segment. Received: "${e}"`,{code:"E_PATH_SEGMENT_SIZE",help:"The set path must have a single path segment (e.g., `/products`)"});let r=`/${i[0]}`;if(this.isRoot&&this.api.findCollectionPathCollision(r,this.key))throw new h(`Collection path "${r}" is already in use by another root entity.`,{code:"E_PATH_INUSE",help:"The set path is already in use by another root entity."});let a="";if(this.resourcePath&&this.resourcePath!=="/"){let l=this.resourcePath.split("/").filter(Boolean)[1];l&&/^\{[A-Za-z_][A-Za-z0-9_]*\}$/.test(l)&&(a=l)}if(!a){let n=this.api.domain?.findEntity(this.entity.key,this.entity.domain);if(!n||!n.info.name)throw new h("Cannot generate a semantic parameter name because the associated entity or its name is missing.",{code:"E_ENTITY_NOT_FOUND",help:"Ensure the exposed entity points to a valid domain entity with a defined name."});a=`{${Bt(n.info.name)}}`}let s=`${r}/${a}`;this.#i(s),this.collectionPath=r,this.resourcePath=s}setResourcePath(e){let t=$t(e),i=t.split("/").filter(Boolean);if(this.hasCollection){if(!this.collectionPath)throw new h("Cannot set resource path: missing collection path for this exposure",{code:"E_PATH_MISSING",help:"Set the collection path on the exposed entity first."});let r=this.collectionPath.split("/").filter(Boolean);if(r.length!==1)throw new h(`Invalid stored collection path "${this.collectionPath}"`,{code:"E_PATH_SEGMENT_SIZE",help:"The set collection path must have a single path segment (e.g., `/products`)"});if(i.length!==2)throw new h(`Resource path must be exactly two segments (collection + parameter). Received: "${t}"`,{code:"E_PATH_SEGMENT_SIZE",help:"The set resource path must have exactly two segments (collection + parameter)."});let[a,s]=i;if(a!==r[0])throw new h(`Resource path must start with the collection segment "${r[0]}". Received: "${a}"`,{code:"E_PATH_MISMATCH",help:"Set the resource path to the same value as the collection path + the parameter value."});if(!/^\{[A-Za-z_][A-Za-z0-9_]*\}$/.test(s))throw new h(`The second segment must be a parameter in braces, e.g. {id}. Received: "${s}"`,{code:"E_PARAMETER_INVALID",help:"Use the braces to surround the parameter name, e.g., {productId}."});this.resourcePath!==t&&(this.#i(`/${a}/${s}`),this.resourcePath=`/${a}/${s}`);return}if(i.length!==1)throw new h(`Resource path must contain exactly one segment when no collection is present. Received: "${t}"`,{code:"E_PATH_SEGMENT_SIZE",help:"The set resource path must have exactly one segment."});if(this.isRoot&&this.api.findResourcePathCollision(t,this.key))throw new h(`Resource path "${t}" is already in use by another root entity.`,{code:"E_PATH_INUSE",help:"The set path is already in use by another root entity."});this.resourcePath!==t&&(this.#i(`/${i[0]}`),this.resourcePath=`/${i[0]}`)}#e(e){let i=[...e.join("/").matchAll(/\{([^}]+)\}/g)].map(a=>a[1]),r=new Set;for(let a of i){if(r.has(a))throw new h(`Duplicate path parameter "{${a}}" detected in branch hierarchy.`,{code:"E_PATH_PARAM_COLLISION",help:"Change the parameter name in either this resource or its ancestor to ensure unique parameter names."});r.add(a)}}#t(e,t){for(let i of this.api.exposes.values())if(i.parent?.key===e){let r=[...t,i.resourcePath];this.#e(r),this.#t(i.key,r)}}#i(e){let t=[e],i=this.parent?.key;for(;i;){let r=this.api.exposes.get(i);if(!r)break;t.unshift(r.resourcePath),i=r.parent?.key}this.#e(t),this.#t(this.key,t)}getAbsoluteResourcePath(){let e=$t(this.resourcePath),t=this.parent?.key;for(;t;){let i=this.api.exposes.get(t);if(!i)break;let r=$t(i.resourcePath);e=Ta(r,e),t=i.parent?.key}return e}getAbsoluteCollectionPath(){if(!this.hasCollection||!this.collectionPath)return;let e=$t(this.collectionPath),t=this.parent?.key;for(;t;){let i=this.api.exposes.get(t);if(!i)break;let r=$t(i.resourcePath);e=Ta(r,e),t=i.parent?.key}return e}getAllRules(){let e=[];this.api.accessRule.forEach(i=>e.push(i));let t=this;for(;t;)t.accessRule&&e.push(...t.accessRule),t=t.parent?this.api.exposes.get(t.parent.key):void 0;return e}getAllRateLimiters(){let e=[];this.api.rateLimiting&&e.push(this.api.rateLimiting);let t=this;for(;t;)t.rateLimiting&&e.push(t.rateLimiting),t=t.parent?this.api.exposes.get(t.parent.key):void 0;return e}getAllRateLimiterRules(){let e=[];this.api.rateLimiting&&e.push(...this.api.rateLimiting.rules);let t=this;for(;t;)t.rateLimiting&&e.push(...t.rateLimiting.rules),t=t.parent?this.api.exposes.get(t.parent.key):void 0;return e}addAction(e){if(this.actions.some(i=>i.kind===e.kind))throw new h(`Action of kind "${e.kind}" already exists for this exposure`,{code:"E_ACTION_USED",help:"There's no need to add an API action again."});let t=Yr(this,e);return this.actions.push(t),t}addActionFromKind(e){if(this.actions.some(i=>i.kind===e))throw new h(`Action of kind "${e}" already exists for this exposure`,{code:"E_ACTION_USED",help:"There's no need to add an API action again."});let t=ss(this,e);return this.actions.push(t),t}createPaginationContract(){let e=this.api.domain?.findEntity(this.entity.key,this.entity.domain);if(!e)throw new h(`Entity "${this.entity.key}" not found"`,{code:"E_ENTITY_NOT_FOUND",help:"The set entity does not exist."});this.paginationContract?(this.paginationContract.filterableFields=[],this.paginationContract.searchableFields=[],this.paginationContract.sortableFields=[]):this.paginationContract={filterableFields:[],searchableFields:[],sortableFields:[]};for(let t of e.properties)t.index&&(this.paginationContract.filterableFields.push(t.key),this.paginationContract.sortableFields.push(t.key)),t.search&&this.paginationContract.searchableFields.push(t.key)}};var Si=(o={})=>{let e={...Er,...o};return o.metadata&&(e.metadata={...o.metadata}),{id:y.Currency,config:e}},Er={storageFormat:"decimal",defaultCurrency:"USD",decimalPlaces:2,allowNegative:!1,validateCurrencyCode:!0},bS={USD_DECIMAL:Si({storageFormat:"decimal",defaultCurrency:"USD",decimalPlaces:2,allowNegative:!1}),USD_CENTS:Si({storageFormat:"integer_cents",defaultCurrency:"USD",decimalPlaces:2,allowNegative:!1}),MULTI_CURRENCY:Si({storageFormat:"complex_object",allowedCurrencies:["USD","EUR","GBP","JPY","CAD"],decimalPlaces:2,allowNegative:!1}),WITH_NEGATIVES:Si({storageFormat:"decimal",defaultCurrency:"USD",decimalPlaces:2,allowNegative:!0}),HIGH_PRECISION:Si({storageFormat:"decimal",defaultCurrency:"BTC",decimalPlaces:8,allowNegative:!1})};var _n={requireVerification:!0,allowSubaddressing:!0,allowInternational:!0};var An={requireCountryCode:!0,format:"international",allowExtension:!1,requireVerification:!1,verificationMethod:"sms"};function kc(o){let e=o.type,i=o.readWebBinding()?.format,r=o.multiple,a;if(e==="string"){let s=o.schema?.maximum;if(o.schema?.defaultValue?.type==="function"&&o.schema.defaultValue.value==="random"){let n=o.schema.defaultValue.config;if(n){let l=0,c=!1;n.isFixed?n.length&&(l=n.length,c=!0):s&&(l=s,c=!0),c&&(n.prefix&&(l+=n.prefix.length),n.suffix&&(l+=n.suffix.length),(!s||l>s)&&(s=l))}}a=s?`VARCHAR(${s})`:"TEXT"}else if(e==="number"){let s=o.schema?.defaultValue?.type==="function"&&o.schema.defaultValue.value==="incremental";i==="int32"?a="INTEGER":i==="int64"?a="BIGINT":i==="float"||i==="double"?a="DOUBLE PRECISION":s?a="BIGINT":a="NUMERIC"}else e==="boolean"?a="BOOLEAN":e==="date"?a="DATE":e==="datetime"?a="TIMESTAMPTZ":e==="time"?a="TIME":e==="binary"?a="JSONB":a="TEXT";return r?`${a}[]`:a}function xn(o){let e=o.getExposedName();if(!e)throw new h("Property missing a name definition.",{code:"E_PROPERTY_NAME_MISSING",status:500});let t=null;if(o.schema?.defaultValue){let u=o.schema.defaultValue.type,m=String(o.schema.defaultValue.value);if(u==="function"){let g=o.type;if(g==="string"){if(m==="uuid-v4"&&o.primary)throw new h("Function 'uuid-v4' cannot be used as a default for a primary key string.",{code:"E_INVALID_DEFAULT_FUNCTION",status:400});if(m!=="random"&&m!=="uuid-v4")throw new h(`Function '${m}' is not supported for string properties.`,{code:"E_INVALID_DEFAULT_FUNCTION",status:400})}else if(g==="number"){if(m!=="incremental")throw new h(`Function '${m}' is not supported for number properties.`,{code:"E_INVALID_DEFAULT_FUNCTION",status:400})}else if(["date","time","datetime"].includes(g)){if(m!=="now")throw new h(`Function '${m}' is not supported for ${g} properties.`,{code:"E_INVALID_DEFAULT_FUNCTION",status:400})}else throw new h(`Functions are not supported as default values for ${g} properties.`,{code:"E_INVALID_DEFAULT_FUNCTION",status:400})}t={type:u,value:m}}let i=!!o.primary,r=!o.required&&!i,a=!!o.unique;!t&&o.hasSemantic(y.DeletedFlag)&&(t={type:"literal",value:"false"});let s=o.getSemantic(y.Currency);if(s){let u=s.config??{},m=u.storageFormat||Er.storageFormat;if(m==="complex_object")return[{name:e,dataType:"JSONB",isNullable:r,isPrimary:i,isUnique:a,defaultRule:null}];if(m==="decimal"||m==="integer_cents"){let g=u.decimalPlaces??Er.decimalPlaces,f=m==="decimal"?`NUMERIC(19, ${g})`:"BIGINT";return[{name:`${e}_amount`,dataType:f,isNullable:r,isPrimary:i,isUnique:a,defaultRule:t},{name:`${e}_currency`,dataType:"CHAR(3)",isNullable:r,isPrimary:!1,isUnique:!1,defaultRule:{type:"literal",value:u.defaultCurrency||"USD"}}]}}let n=[{name:e,dataType:kc(o),isNullable:r,isPrimary:i,isUnique:a,defaultRule:t}],l=!1,c=o.getSemantic(y.Email);c&&(l=(c.config??_n).requireVerification!==!1);let p=o.getSemantic(y.Phone);return p&&(l=(p.config??An).requireVerification===!0),l&&n.push({name:`_${e}_verified`,dataType:"BOOLEAN",isNullable:!1,isPrimary:!1,isUnique:!1,defaultRule:{type:"literal",value:"false"}},{name:`_${e}_token`,dataType:"VARCHAR(255)",isNullable:!0,isPrimary:!1,isUnique:!1,defaultRule:null},{name:`_${e}_expires_at`,dataType:"TIMESTAMPTZ",isNullable:!0,isPrimary:!1,isUnique:!1,defaultRule:null}),n}function Sc(o){let e=o.toUpperCase().split("(")[0];return e==="CHARACTER VARYING"&&(e="VARCHAR"),e==="CHARACTER"&&(e="CHAR"),e}function _c(o,e){let t=e.toUpperCase(),i=Sc(o.dataType),r=t.split("(")[0];if(i===r){if(i==="VARCHAR"){let s=o.dataType.match(/\((\d+)\)/),n=s?Number.parseInt(s[1],10):null,l=t.match(/\((\d+)\)/),c=l?Number.parseInt(l[1],10):null;return!!(!c||n&&c>=n)}return!0}return{INTEGER:["BIGINT","NUMERIC","VARCHAR","TEXT"],BIGINT:["NUMERIC","VARCHAR","TEXT"],DATE:["TIMESTAMPTZ"],BOOLEAN:["VARCHAR","TEXT"]}[i]?.includes(r)||!1}function En(o,e){let t=o.domain,i={hasUpdate:!1,canProceed:!0,breakingChanges:[],exposedEntitiesToRemove:[],subEndpointsToRemove:[],userModelRemapping:[],sessionPropertiesToRemove:[],accessRulesWithMismatches:[]};if(!t)return i.hasUpdate=!0,i;if(t.key===e.key&&t.info.version===e.info.version)return i;i.hasUpdate=!0;let r=new Map;for(let f of t.listEntities())r.set(f.key,f);let a=new Map;for(let f of e.listEntities())a.set(f.key,f);let s=new Set;for(let[f,b]of o.exposes.entries()){let v=r.has(b.entity.key),S=a.get(b.entity.key);if(!S){let E=r.get(b.entity.key)?.info.getLabel()||b.entity.key;i.exposedEntitiesToRemove.push({key:f,entityKey:b.entity.key,name:b.entity.key,reason:`Entity ${E} no longer exists in the domain.`}),s.add(f);continue}if(v){let E=r.get(b.entity.key),V=new Map;for(let L of E.withInheritedProperties())try{let P=L.getExposedName();P&&V.set(P,L)}catch{}let U=new Map;for(let L of S.withInheritedProperties())try{let P=L.getExposedName();P&&U.set(P,L)}catch{}for(let[L,P]of V.entries()){let le=U.get(L);if(!le)continue;let F=xn(P),ce=xn(le);for(let ue of F){let he=ce.find(_e=>_e.name===ue.name);if(!he)continue;if(ue.isPrimary&&!he.isPrimary){i.canProceed=!1;let _e=E.info.getLabel(),it=`Cannot remove Primary Key constraint from column '${ue.name}' in entity '${_e}'.`;i.breakingChanges.push({type:"primary_key_removed",entityKey:E.key,propertyKey:P.key,reason:it})}if(!_c(ue,he.dataType)){i.canProceed=!1;let _e=E.info.getLabel(),it=`Cannot safely cast column '${ue.name}' in entity '${_e}' from ${ue.dataType} to ${he.dataType}.`;i.breakingChanges.push({type:"type_change_unsafe",entityKey:E.key,propertyKey:P.key,reason:it})}let Ge=ue.isNullable&&!he.isNullable,ft=!!he.defaultRule;if(Ge&&!ft){i.canProceed=!1;let _e=E.info.getLabel(),it=`Cannot make column '${ue.name}' in entity '${_e}' required without providing a default value to backfill existing records.`;i.breakingChanges.push({type:"column_not_null_missing_default",entityKey:E.key,propertyKey:P.key,reason:it})}}}}}let n=!0;for(;n;){n=!1;for(let[f,b]of o.exposes.entries())if(!s.has(f)&&b.parent){let v=o.exposes.get(b.parent.key),S=r.get(v.entity.key),E=S?.info.getLabel()||v.entity.key;if(s.has(b.parent.key)){i.subEndpointsToRemove.push({key:f,parentKey:b.parent.key,associationKey:b.parent.association.key,name:b.entity.key,reason:`Parent exposure for entity ${E} is scheduled for removal.`}),s.add(f),n=!0;continue}let V=a.get(v.entity.key);if(!V){i.subEndpointsToRemove.push({key:f,parentKey:b.parent.key,associationKey:b.parent.association.key,name:b.entity.key,reason:`Parent entity ${E} is scheduled for removal.`}),s.add(f),n=!0;continue}let U=Array.from(V.withInheritedAssociations()).find(F=>F.key===b.parent?.association.key),L=S?Array.from(S.withInheritedAssociations()).find(F=>F.key===b.parent?.association.key):void 0,P=U?.info.getLabel()||L?.info.getLabel()||b.parent?.association.key;if(!U){i.subEndpointsToRemove.push({key:f,parentKey:b.parent.key,associationKey:b.parent.association.key,name:b.entity.key,reason:`Parent association ${P} is missing in the new domain.`}),s.add(f),n=!0;continue}if(!U.targets.some(F=>F.key===b.entity.key&&(!F.domain||F.domain===e.key))){let ce=(r.get(b.entity.key)||a.get(b.entity.key))?.info.getLabel()||b.entity.key;i.subEndpointsToRemove.push({key:f,parentKey:b.parent.key,associationKey:b.parent.association.key,name:b.entity.key,reason:`Target entity ${ce} is no longer a valid target for the parent association ${P}.`}),s.add(f),n=!0;continue}}}let l,c;if(o.user&&(l=r.get(o.user.key),c=a.get(o.user.key),!c)){i.canProceed=!1;let b=`User entity '${l?.info.getLabel()||o.user.key}' no longer exists in the new domain version.`;i.breakingChanges.push({type:"user_entity_missing",entityKey:o.user.key,propertyKey:"",reason:b})}if(o.user&&c&&l){let f=Array.from(l.withInheritedProperties()),b=Array.from(c.withInheritedProperties());if(o.session?.properties)for(let v of o.session.properties){let S=f.find(U=>U.key===v.key);if(!S){i.sessionPropertiesToRemove.push(v.key);continue}let E;try{E=S.getExposedName()}catch{}if(!E){i.sessionPropertiesToRemove.push(v.key);continue}let V=b.find(U=>{try{return U.getExposedName()===E}catch{return!1}});V?V.key!==S.key&&i.userModelRemapping.push({oldPropertyKey:S.key,newPropertyKey:V.key,exposedName:E,reason:`Property ${S.info.getLabel(S.key)} has been renamed to ${V.info.getLabel(V.key)}.`}):i.sessionPropertiesToRemove.push(v.key)}}let p;c&&(p=Array.from(c.withInheritedProperties()).find(f=>f.hasSemantic(y.UserRole)));let u=p?.schema?.enum,m=(f,b)=>{if(f.type==="matchUserRole"){let v=f;if(!p)i.accessRulesWithMismatches.push({ruleType:"matchUserRole",location:b,reason:"No role field configured on the new user model."});else if(u&&Array.isArray(u))for(let S of v.role)u.includes(S)||i.accessRulesWithMismatches.push({ruleType:"matchUserRole",location:b,reason:`Role '${S}' is no longer a valid role in the new user model.`})}},g=(f,b,v)=>{if(f.type==="matchResourceAttribute"){let S=f;if(!v)return;let E=a.get(v);if(!E)return;let V=Array.from(E.withInheritedProperties());if(!V.some(L=>L.key===S.attribute)){let L=r.get(v),P=S.attribute,le=!1;if(L){let F=Array.from(L.withInheritedProperties()).find(ce=>ce.key===S.attribute);if(F){P=F.info.getLabel(F.key);let ce;try{ce=F.getExposedName()}catch{}ce&&V.find(he=>{try{return he.getExposedName()===ce}catch{return!1}})&&(le=!0)}}if(!le){let F=E.info.getLabel();i.accessRulesWithMismatches.push({ruleType:"matchResourceAttribute",location:b,reason:`Property attribute '${P}' no longer exists on entity '${F}'.`})}}}};if(o.accessRule)for(let f of o.accessRule)m(f,{type:"api",key:o.key});for(let[f,b]of o.exposes.entries())if(!s.has(f)){if(b.accessRule)for(let v of b.accessRule)m(v,{type:"exposure",key:f}),g(v,{type:"exposure",key:f},b.entity.key);if(b.actions){for(let v of b.actions)if(v.accessRule)for(let S of v.accessRule)m(S,{type:"action",key:`${f}:${v.kind}`}),g(S,{type:"action",key:`${f}:${v.kind}`},b.entity.key)}}return i}function Nn(o,e,t){if(!t.canProceed)throw new h("Cannot apply domain update because it contains breaking changes. Details in the report.",{code:"E_CANNOT_PROCEED_WITH_UPGRADE",status:400});let i=o.domain;o.dependencies.clear(),o.dependencies.set(e.key,e),o.dependencyList=[{key:e.key,version:e.info.version}];let r=[...t.exposedEntitiesToRemove,...t.subEndpointsToRemove];for(let c of r)o.exposes.delete(c.key);if(o.user&&o.session){let c=new Set(t.sessionPropertiesToRemove),p=new Map;for(let u of t.userModelRemapping)p.set(u.oldPropertyKey,u.newPropertyKey);if(o.session.properties){let u=[];for(let m of o.session.properties){if(c.has(m.key))continue;let g=p.get(m.key);g?u.push({...m,key:g}):u.push(m)}o.session.properties=u}}let a=new Map;for(let c of e.listEntities())a.set(c.key,c);let s;if(o.user){let c=a.get(o.user.key);c&&(s=Array.from(c.withInheritedProperties()).find(p=>p.hasSemantic(y.UserRole)))}let n=s?.schema?.enum,l=(c,p)=>{let u=[];for(let m of c)if(m.type==="matchUserRole"){let g=m;if(!s)continue;if(n&&Array.isArray(n)){let f=g.role.filter(b=>n.includes(b));if(f.length===0)continue;g.role=f}u.push(m)}else if(m.type==="matchResourceAttribute"&&p){let g=m,f=a.get(p);if(!f)continue;let b=Array.from(f.withInheritedProperties());if(b.some(S=>S.key===g.attribute))u.push(m);else{let S,E=i?.findEntity(p);if(E){let U=Array.from(E.withInheritedProperties()).find(L=>L.key===g.attribute);if(U){let L;try{L=U.getExposedName()}catch{}L&&(S=b.find(P=>{try{return P.getExposedName()===L}catch{return!1}}))}}if(S)g.attribute=S.key,u.push(m);else continue}}else u.push(m);return u};o.accessRule&&(o.accessRule=l(o.accessRule));for(let c of o.exposes.values()){if(c.accessRule&&(c.accessRule=l(c.accessRule,c.entity.key)),c.actions)for(let p of c.actions)p.accessRule&&(p.accessRule=l(p.accessRule,c.entity.key));if(c.paginationContract){let p=c.paginationContract,u=c.entity.key,m=a.get(u);if(m){let g=Array.from(m.withInheritedProperties()),f=new Set(g.map(S=>S.key)),b=i?.findEntity(u),v=S=>{if(f.has(S))return S;if(b){let E=Array.from(b.withInheritedProperties()).find(V=>V.key===S);if(E){let V;try{V=E.getExposedName()}catch{}if(V){let U=g.find(L=>{try{return L.getExposedName()===V}catch{return!1}});if(U)return U.key}}}return null};p.filterableFields&&(p.filterableFields=p.filterableFields.map(v).filter(S=>S!==null)),p.sortableFields&&(p.sortableFields=p.sortableFields.map(v).filter(S=>S!==null)),p.searchableFields&&(p.searchableFields=p.searchableFields.map(v).filter(S=>S!==null))}}}o.notifyChange()}var _i=class o extends Gt{kind;key;info;user;authentication;authorization;session;exposes;accessRule;rateLimiting;termsOfService;contact;license;pagination;#e=!0;#t=!1;get domain(){if(this.dependencyList.length===0)return;let e=this.dependencyList[0];return this.dependencies.get(e.key)}static createSchema(e={}){let{key:t=R(),exposes:i=[],pagination:r}=e,a=W.fromJSON(e.info,{name:"Unnamed API"}).toJSON(),s={kind:ye,key:t,info:a,exposes:i,pagination:r?structuredClone(r):{kind:"cursor"}};return e.user&&(s.user=structuredClone(e.user)),e.dependencyList&&(s.dependencyList=structuredClone(e.dependencyList)),e.authentication&&(s.authentication=structuredClone(e.authentication)),e.authorization&&(s.authorization=structuredClone(e.authorization)),e.session&&(s.session=structuredClone(e.session)),Array.isArray(e.accessRule)&&(s.accessRule=structuredClone(e.accessRule)),e.rateLimiting&&(s.rateLimiting=structuredClone(e.rateLimiting)),e.termsOfService&&(s.termsOfService=e.termsOfService),e.contact&&(s.contact=structuredClone(e.contact)),e.license&&(s.license=structuredClone(e.license)),s}constructor(e,t){let i=o.createSchema(e),r=[];if(t instanceof Je)t.readOnly?r.push(t):(console.warn(`Domain ${t.key} is not read only, cloning it. This may have performance implications.`),r.push(t.clone({readOnly:!0})));else if(typeof t=="object"&&t.kind===Be)r.push(new Je(t,void 0,{readOnly:!0}));else if(t)throw new h("Invalid domain provided. Expected a DataDomain instance or schema.",{code:"E_DOMAIN_INVALID",help:"It looks like the provided data domain is not a valid instance or domain schema."});if(t){if(!t.info.version)throw new h(`Domain ${t.key} must have a version.`,{code:"E_DOMAIN_NO_VERSION",help:"Before attaching the data domain, give it a version name. Only versioned domains can be attached to an API model."});i.dependencyList=[{key:t.key,version:t.info.version}]}super(i.dependencyList,r),this.kind=i.kind,this.key=i.key,this.info=new W(i.info),this.user=i.user,this.pagination=i.pagination?structuredClone(i.pagination):{kind:"cursor"},i.authentication&&(this.authentication=structuredClone(i.authentication)),i.authorization&&(this.authorization=structuredClone(i.authorization)),i.session&&(this.session=structuredClone(i.session)),Array.isArray(i.exposes)?this.exposes=new Map(i.exposes.map(a=>[a.key,new Tt(this,a)])):this.exposes=new Map,Array.isArray(i.accessRule)?this.accessRule=i.accessRule.map(a=>Mt(this,a)):this.accessRule=[],i.rateLimiting&&(this.rateLimiting=new Xe(i.rateLimiting)),i.termsOfService&&(this.termsOfService=i.termsOfService),i.contact&&(this.contact=i.contact),i.license&&(this.license=i.license),this.#e=!1}toJSON(){let e={kind:this.kind,key:this.key,info:this.info.toJSON(),exposes:Array.from(this.exposes.values()).map(t=>t.toJSON()),pagination:structuredClone(this.pagination)};return this.user&&(e.user={...this.user}),this.dependencyList.length>0&&(e.dependencyList=structuredClone(this.dependencyList)),this.authentication&&(e.authentication=structuredClone(this.authentication)),this.authorization&&(e.authorization=structuredClone(this.authorization)),this.session&&(e.session=structuredClone(this.session)),Array.isArray(this.accessRule)&&this.accessRule.length>0&&(e.accessRule=this.accessRule.map(t=>t.toJSON())),this.rateLimiting&&(e.rateLimiting=this.rateLimiting.toJSON()),this.termsOfService&&(e.termsOfService=this.termsOfService),this.contact&&(e.contact=structuredClone(this.contact)),this.license&&(e.license=structuredClone(this.license)),e}notifyChange(){this.#t||this.#e||(this.#t=!0,queueMicrotask(()=>{this.#t=!1;let e=new Event("change");this.dispatchEvent(e)}))}exposeEntity(e,t){let i=this.domain;if(!i)throw new h("No domain attached to API model",{code:"E_NO_DOMAIN",help:"Attach a data domain to the API model before exposing entities."});let r=It(e),a;for(let v of this.exposes.values())if(v.isRoot&&It(v.entity)===r){a=v;break}if(a)throw new h(`Entity ${e.key} is already exposed.`,{code:"E_ENTITY_ALREADY_EXPOSED",help:"Do not try to expose already exposed entity."});let s=i.findEntity(e.key,e.domain);if(!s)throw new h(`Entity not found in domain: ${e.key}`,{code:"E_NO_ENTITY",help:"Make sure the entity you are trying to expose exists in the data domain."});let n=s.info.name||"",l=xr(n.toLocaleLowerCase()),c=Bt(n),p=`/${l}`,u=`/${l}/{${c}}`,m=1,g=p;for(;this.findCollectionPathCollision(p);)p=`${g}-${m}`,u=`${p}/{${c}}`,m++;let f={kind:yt,key:R(),entity:{...e},actions:[],isRoot:!0,collectionPath:p,resourcePath:u,hasCollection:!0};t&&(f.exposeOptions={...t});let b=new Tt(this,f);return this.exposes.set(b.key,b),t?.followAssociations&&(t?.maxDepth===void 0||t.maxDepth>0)&&this.followEntityAssociations(f,t),b}followEntityAssociations(e,t){let i=this.domain;if(!i)throw new h("No domain attached to API model",{code:"E_NO_DOMAIN"});let r=t.maxDepth??6,a=(n,l,c,p)=>{let u=i.findEntity(n.key,n.domain);if(u)for(let m of u.listAssociations())for(let g of m.targets){if(g.key===n.key&&g.domain===n.domain)continue;let f=It(g);if(p.includes(f))continue;let b=It(g),v;for(let ue of this.exposes.values())if(It(ue.entity)===b){v=ue;break}if(v){if(!v.isRoot){let ue=i.findEntity(g.key,g.domain);if(ue){let he=ue.info.name||"",Ge=xr(he.toLocaleLowerCase()),ft=Bt(he),_e=`/${Ge}`,it=`/${Ge}/{${ft}}`,Va=1,Cn=_e;for(;this.findCollectionPathCollision(_e);)_e=`${Cn}-${Va}`,it=`${_e}/{${ft}}`,Va++;v.isRoot=!0,v.parent=void 0,v.hasCollection=!0,v.collectionPath=_e,v.setResourcePath(it)}}continue}let S=i.findEntity(g.key,g.domain);if(!S)continue;let E=m.info.name||"",V=xr(E.toLocaleLowerCase()),U=m.multiple!==!1,L=Bt(S.info.name||""),P=U?`/${V}`:void 0,le=U?`/${V}/{${L}}`:`/${V}`,F={kind:yt,key:R(),entity:{...g},actions:[],isRoot:!1,collectionPath:P,resourcePath:"",hasCollection:U,parent:{key:l,association:{key:m.key,domain:n.domain},depth:c+1}},ce=new Tt(this,F);ce.setResourcePath(le),this.exposes.set(ce.key,ce),c+1>=r?F.truncated=!0:a(g,F.key,c+1,[...p,f])}},s=It(e.entity);a(e.entity,e.key,0,[s])}removeExposedEntity(e){if(!this.exposes.has(e))throw new h(`Exposed entity with key "${e}" not found.`,{code:"E_NO_EXPOSURE",help:"The exposed entity you are trying to remove does not exist."});this.removeWithChildren(e)}removeWithChildren(e){if(!this.exposes.has(e))return;this.exposes.delete(e);let t=i=>{for(let r of this.exposes.values())r.parent?.key===i&&(t(r.key),this.exposes.delete(r.key))};t(e)}cleanForDomainChange(){this.dependencies.clear(),this.dependencyList=[],this.exposes=new Map,this.user=void 0,this.session&&(this.session.properties=[])}attachDataDomain(e){if(!e.info.version)throw new h("Cannot attach DataDomain without a version. Please set the version in the domain info.",{code:"E_DOMAIN_NO_VERSION",help:"Before attaching the data domain, give it a version name. Only versioned domains can be attached to an API model."});this.cleanForDomainChange(),this.dependencies.set(e.key,e),this.dependencyList=[{key:e.key,version:e.info.version}];for(let t of e.listEntities())if(t.hasSemantic(y.User)){this.user={key:t.key};break}}findResourcePathCollision(e,t){for(let i of this.exposes.values())if(!(t&&i.key===t)&&i.isRoot&&i.resourcePath===e)return i}findCollectionPathCollision(e,t){for(let i of this.exposes.values())if(!(t&&i.key===t)&&i.isRoot&&i.hasCollection&&i.collectionPath===e)return i}hasDomainUpdate(e){let t=this.domain;return t?t.key!==e.key||t.info.version!==e.info.version:!0}analyzeDomainUpdate(e){return En(this,e)}applyDomainUpdate(e,t){Nn(this,e,t)}};function C(o,e){return`${o}_${e}`}function Oa(o){let e=[],t={apiModelKey:o.key,kind:ye,key:o.key};return o.kind!==ye&&e.push({code:C("API","INVALID_KIND"),message:"The API model type is incorrect.",suggestion:'Set the model type to "ApiModel".',severity:"error",context:{...t,property:"kind"}}),(!o.key||typeof o.key!="string"||o.key.trim()==="")&&e.push({code:C("API","MISSING_KEY"),message:"The API model is missing a unique identifier.",suggestion:"Provide a valid name to use as a unique identifier.",severity:"error",context:{...t,property:"key"}}),(!o.info||!o.info.name||o.info.name.trim()==="")&&e.push({code:C("API","MISSING_NAME"),message:"The API model has no defined name.",suggestion:"Provide a descriptive name for your API.",severity:"error",context:{...t,property:"info.name"}}),(!o.info||!o.info.description||o.info.description.trim()==="")&&e.push({code:C("API","MISSING_DESCRIPTION"),message:"Adding a description helps others understand your API.",suggestion:"Add a description to clarify the purpose of this API.",severity:"warning",context:{...t,property:"info.description"}}),e}function Ca(o){let e=[],t={apiModelKey:o.key,kind:ye,key:o.key},i=o.domain;return i?((!i.info||!i.info.version)&&e.push({code:C("API","MISSING_DOMAIN_VERSION"),message:"The selected Data Domain is missing a version number.",suggestion:"Specify a version for the attached Data Domain.",severity:"error",context:t}),e):(e.push({code:C("API","MISSING_DOMAIN"),message:"No Data Domain is attached to the API.",suggestion:"Select a Data Domain from the settings to power your API.",severity:"error",context:t}),e)}function Ra(o){let e=[],t={apiModelKey:o.key,kind:ye,key:o.key},i=o.domain&&o.user?o.domain.findEntity(o.user.key,o.user.domain):void 0;if(!o.authentication)e.push({code:C("API","MISSING_AUTHENTICATION"),message:"The API is missing authentication settings.",suggestion:"Go to the security settings and configure how users authenticate.",severity:"error",context:{...t,property:"authentication"}});else if(o.authentication.strategy==="UsernamePassword"&&i){let r;for(let s of i.properties)if(s.hasSemantic(y.Password)){r=s;break}r||e.push({code:C("API","MISSING_PASSWORD_SEMANTIC"),message:"The selected user model requires a property with the Password data semantic for authentication.",suggestion:'Go to the Data Modeler and add the "Password" semantic to the password property.',severity:"error",context:{...t,property:"user"}});let a;for(let s of i.properties)if(s.hasSemantic(y.Username)){a=s;break}a||e.push({code:C("API","MISSING_USERNAME_SEMANTIC"),message:"Username & Password authentication requires a field with the Username data semantic.",suggestion:'Go to the Data Modeler and add the "Username" semantic to the property used for login.',severity:"error",context:{...t,property:"user"}})}if(!o.authorization)e.push({code:C("API","MISSING_AUTHORIZATION"),message:"The API is missing authorization settings.",suggestion:"Go to the security settings and configure how to handle user permissions.",severity:"error",context:{...t,property:"authorization"}});else if(o.authorization.strategy==="RBAC"&&i){let r;for(let a of i.properties)if(a.hasSemantic(y.UserRole)){r=a;break}r||e.push({code:C("API","MISSING_ROLE_SEMANTIC"),message:"Role-based access control requires a property with the User Role data semantic on the user model.",suggestion:'Go to the Data Modeler and add the "User Role" semantic to the property used for roles.',severity:"error",context:{...t,property:"user"}})}if(!o.session)e.push({code:C("API","MISSING_SESSION"),message:"The API is missing session configuration.",suggestion:"Configure how user sessions will be handled.",severity:"error",context:{...t,property:"session"}});else{if(o.session.secret||e.push({code:C("API","MISSING_SESSION_SECRET"),message:"A secure encryption key is required for sessions.",suggestion:"Provide a strong security key in the session settings.",severity:"error",context:{...t,property:"session.secret"}}),!o.session.properties||o.session.properties.length===0)e.push({code:C("API","MISSING_SESSION_PROPERTIES"),message:"The session token needs to include at least one piece of user information, like an ID.",suggestion:"Select fields that should be stored securely inside the session payload.",severity:"error",context:{...t,property:"session.properties"}});else if(o.authorization&&o.authorization.strategy==="RBAC"&&i){let s;for(let n of i.properties)if(n.hasSemantic(y.UserRole)){s=n;break}s&&!o.session.properties.find(n=>n.key===s?.key)&&e.push({code:C("API","MISSING_RBAC_SESSION_PROPERTY"),message:"The user role must be included in the session data for permissions to work.",suggestion:"Make sure your selected role property is checked in the session settings.",severity:"error",context:{...t,property:"session.properties"}})}let{cookie:r,jwt:a}=o.session;(!r||!r.enabled)&&(!a||!a.enabled)&&e.push({code:C("API","MISSING_SESSION_TRANSPORT"),message:"No delivery method for sessions (like cookies or tokens) is enabled.",suggestion:"Enable at least one session delivery mechanism in the security settings.",severity:"error",context:{...t,property:"session"}})}return o.user?o.domain&&!o.domain.findEntity(o.user.key,o.user.domain)&&e.push({code:C("API","INVALID_USER_ENTITY"),message:"The selected user model no longer exists in your data domain.",suggestion:"Please navigate to security settings and select a valid user model.",severity:"error",context:{...t,property:"user"}}):e.push({code:C("API","MISSING_USER_ENTITY"),message:"You need to specify what kind of object represents your users.",suggestion:"Select a model from your domain that stores your user accounts.",severity:"error",context:{...t,property:"user"}}),e}function Pa(o){let e=[],t={apiModelKey:o.key,kind:ye,key:o.key},i=/^https?:\/\//i,r=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return o.contact?(o.contact.email&&!r.test(o.contact.email)&&e.push({code:C("API","INVALID_CONTACT_EMAIL"),message:"The contact email address looks invalid.",suggestion:"Please double check the email address formatting.",severity:"error",context:{...t,property:"contact.email"}}),o.contact.url&&!i.test(o.contact.url)&&e.push({code:C("API","INVALID_CONTACT_URL"),message:"The contact link looks invalid.",suggestion:"Provide a working link, starting with http:// or https://.",severity:"error",context:{...t,property:"contact.url"}})):e.push({code:C("API","MISSING_CONTACT"),message:"A contact email or link is highly recommended for API consumers.",suggestion:"Add an email or help desk link in the metadata tab.",severity:"info",context:{...t,property:"contact"}}),o.license?o.license.url&&!i.test(o.license.url)&&e.push({code:C("API","INVALID_LICENSE_URL"),message:"The license link looks invalid.",suggestion:"Provide a working link, starting with http:// or https://.",severity:"error",context:{...t,property:"license.url"}}):e.push({code:C("API","MISSING_LICENSE"),message:"Adding a license to your API helps users understand its usage rights.",suggestion:"Add the name and a link to your API license terms.",severity:"info",context:{...t,property:"license"}}),o.termsOfService||e.push({code:C("API","MISSING_TOS"),message:"Terms of Service help legal compliance.",suggestion:"Add a link to the terms of your API service.",severity:"info",context:{...t,property:"termsOfService"}}),e}function jn(o){let e=[],t={apiModelKey:o.key,kind:ye,key:o.key},i=!1;for(let r of o.exposes.values())if(r.actions.some(a=>nt.isListAction(a)||ot.isSearchAction(a))){i=!0;break}return i&&(!o.pagination||!o.pagination.kind?e.push({code:C("API","MISSING_PAGINATION"),message:"The API must have a defined pagination strategy when it exposes List or Search actions.",suggestion:"Configure how results are loaded (e.g. by page or by a continuous cursor).",severity:"error",context:{...t,property:"pagination"}}):(o.pagination.defaultLimit===void 0&&e.push({code:C("API","MISSING_PAGINATION_DEFAULT_LIMIT"),message:"The API doesn't have a defined default page limit when it exposes List or Search actions.",suggestion:"Set a default page limit for the pagination otherwise the API will use its default limit.",severity:"info",context:{...t,property:"pagination.defaultLimit"}}),o.pagination.maxLimit===void 0&&e.push({code:C("API","MISSING_PAGINATION_MAX_LIMIT"),message:"The API doesn't have a defined page size max limit when it exposes List or Search actions.",suggestion:"Set a max page size limit for the pagination otherwise the API will use its default max limit.",severity:"info",context:{...t,property:"pagination.maxLimit"}}))),e}function Ac(o,e,t){let i=[],r={apiModelKey:t,kind:"Action",key:o.kind,parentExposedEntityKey:e.key};return bt.isDeleteAction(o)&&(o.strategy?o.strategy==="hard"&&i.push({code:C("ACTION","DELETE_HARD_WARNING"),message:"Permanent delete is active. There will be no way to restore deleted data.",suggestion:'Consider switching to "soft delete" if users might need to undo mistakes.',severity:"info",context:{...r,property:"strategy"}}):i.push({code:C("ACTION","DELETE_MISSING_STRATEGY"),message:"A Delete action must know if you want to completely erase the record, or just hide it.",suggestion:"Configure the deletion type (permanent or soft).",severity:"error",context:{...r,property:"strategy"}})),wt.isUpdateAction(o)&&(!o.allowedMethods||o.allowedMethods.length===0)&&i.push({code:C("ACTION","UPDATE_MISSING_METHODS"),message:"An Update action must define how the data is sent (PUT replaces everything; PATCH applies partial changes).",suggestion:"Select at least one allowed HTTP method.",severity:"error",context:{...r,property:"allowedMethods"}}),o.getAllRateLimiters().some(n=>n.rules.length)||i.push({code:C("ACTION","MISSING_RATE_LIMITS"),message:"It is best practice to configure a rate limit so your API is not overwhelmed.",suggestion:"Set a reasonable maximum request speed for this operation.",severity:"warning",context:r}),i}function Da(o,e){let t=[],i={apiModelKey:e.key,kind:yt,key:o.key},r=o.entity?e.domain?.findEntity(o.entity.key,o.entity.domain):void 0,a=r?.info.getLabel()||r?.key||"unknown";if(!o.entity||!o.entity.key?t.push({code:C("EXPOSURE","MISSING_ENTITY_REF"),message:"This exposed endpoint does not point to a specific data model.",suggestion:"Select which database entity this endpoint should serve.",severity:"error",context:{...i,property:"entity"}}):r||t.push({code:C("EXPOSURE","INVALID_ENTITY_REF"),message:"This endpoint points to a data model that no longer exists.",suggestion:"Select a new valid database model or delete this endpoint.",severity:"error",context:{...i,property:"entity"}}),o.hasCollection){if(!o.collectionPath)t.push({code:C("EXPOSURE","MISSING_COLLECTION_PATH"),message:`[${a}]: When an endpoint exposes a collection, it must define what its base URL path is.`,suggestion:'Add a path (e.g., "/items").',severity:"error",context:{...i,property:"collectionPath"}});else{let n=o.collectionPath.split("/").filter(Boolean);(n.length!==1||!o.collectionPath.startsWith("/"))&&t.push({code:C("EXPOSURE","INVALID_COLLECTION_PATH"),message:`[${a}]: The collection URL should start with "/" and have no extra slashes.`,suggestion:`Ensure the path looks like exactly "/${n[0]||"subresource"}".`,severity:"error",context:{...i,property:"collectionPath"}})}o.resourcePath?o.collectionPath&&(new RegExp(`^${o.collectionPath}/\\{[a-zA-Z0-9_]+\\}$`).test(o.resourcePath)||t.push({code:C("EXPOSURE","INVALID_RESOURCE_PATH_FORMAT"),message:`[${a}]: The single item route should match exactly your collection path plus one identifier variable.`,suggestion:`Make sure the item path is formatted exactly like "${o.collectionPath}/{id}".`,severity:"error",context:{...i,property:"resourcePath"}})):t.push({code:C("EXPOSURE","MISSING_RESOURCE_PATH"),message:`[${a}]: You need an identifier to locate single items.`,suggestion:'Specify the identification parameter format, like "{id}".',severity:"error",context:{...i,property:"resourcePath"}})}else o.resourcePath?(o.resourcePath.split("/").filter(Boolean).length!==1||!o.resourcePath.startsWith("/"))&&t.push({code:C("EXPOSURE","INVALID_RESOURCE_PATH_FORMAT"),message:`[${a}]: The URL route ${o.resourcePath} must only contain one exact part or level.`,suggestion:"Simplify the endpoint URL to a single segment.",severity:"error",context:{...i,property:"resourcePath"}}):t.push({code:C("EXPOSURE","MISSING_RESOURCE_PATH"),message:`[${a}]: Exposed entity representing a single item must declare their URL route.`,suggestion:'Set the URL path (such as "/profile").',severity:"error",context:{...i,property:"resourcePath"}});o.isRoot&&(o.collectionPath&&e.findCollectionPathCollision(o.collectionPath,o.key)&&t.push({code:C("EXPOSURE","ROOT_COLLECTION_COLLISION"),message:`[${a}]: The route "${o.collectionPath}" is already used by another view.`,suggestion:"Give this resource a different path to avoid conflicts.",severity:"error",context:{...i,property:"collectionPath"}}),o.resourcePath&&e.findResourcePathCollision(o.resourcePath,o.key)&&t.push({code:C("EXPOSURE","ROOT_RESOURCE_COLLISION"),message:`[${a}]: The route "${o.resourcePath}" is already used by another one.`,suggestion:"Give this single-item resource a different path to avoid conflicts.",severity:"error",context:{...i,property:"resourcePath"}}));let s=o.getAbsoluteResourcePath();if(s){let n=[...s.matchAll(/\{([^}]+)\}/g)].map(c=>c[1]);if(new Set(n).size!==n.length){let p=n.filter((u,m)=>n.indexOf(u)!==m)[0];t.push({code:C("EXPOSURE","DUPLICATE_PATH_PARAMETER"),message:`[${a}]: The path parameter "{${p}}" is duplicated in the resource path hierarchy.`,suggestion:"Change the parameter name in either this resource or its ancestor to ensure unique parameter names.",severity:"error",context:{...i,property:"resourcePath"}})}}if(!o.actions||o.actions.length===0)t.push({code:C("EXPOSURE","MISSING_ACTIONS"),message:`[${a}]: This exposed entity does not let users do anything.`,suggestion:"Enable at least one operation like Create, Read, or Update.",severity:"error",context:{...i,property:"actions"}});else{let n=!1,l=!1;for(let c of o.actions){t.push(...Ac(c,o,e.key)),ot.isSearchAction(c)&&(n=!0),nt.isListAction(c)&&(l=!0);let p=!1;c.accessRule&&c.accessRule.length>0&&(p=!0),!p&&o.accessRule&&o.accessRule.length>0&&(p=!0);let u=o.parent?.key;for(;u&&!p;){let m=e.exposes.get(u);if(m&&m.accessRule&&m.accessRule.length>0){p=!0;break}u=m?.parent?.key}!p&&e.accessRule&&e.accessRule.length>0&&(p=!0),p||t.push({code:C("ACTION","MISSING_ACCESS_RULES"),message:`[${a}]: The ${c.kind} action has no security rules attached, making it entirely inaccessible or open.`,suggestion:"Allow specific user roles to access this operation.",severity:"error",context:{...i,kind:"Action",key:c.kind,parentExposedEntityKey:o.key}})}if(l||n){let c=o.paginationContract;if(!c)t.push({code:C("EXPOSURE","MISSING_PAGINATION_CONTRACT"),message:`[${a}]: The List or Search action needs a pagination contract.`,suggestion:"Add a pagination contract to the exposed entity.",severity:"error",context:i});else if(l&&((!c.filterableFields||c.filterableFields.length===0)&&t.push({code:C("EXPOSURE","LIST_MISSING_FILTERS"),message:`[${a}]: Listing all elements without filters could be overwhelming for large tables.`,suggestion:"Select a few important fields to allow filtering.",severity:"warning",context:i}),(!c.sortableFields||c.sortableFields.length===0)&&t.push({code:C("EXPOSURE","LIST_MISSING_SORTING"),message:`[${a}]: Listing all elements without sorting could be overwhelming for large tables.`,suggestion:"Select a few important fields to allow sorting.",severity:"warning",context:i})),n){let p=[];Array.isArray(c.searchableFields)&&p.push(...c.searchableFields),Array.isArray(c.filterableFields)&&p.push(...c.filterableFields),p.length||t.push({code:C("EXPOSURE","SEARCH_MISSING_FIELDS"),message:`[${a}]: Search action needs to know which text fields to look in.`,suggestion:"Select a few important fields to allow searching or full-text search.",severity:"warning",context:i})}}}return t}var Nr=new Set(["IN","EXISTS","SELECT","FROM","WHERE","AND","OR","NOT","NULL","TRUE","FALSE","BETWEEN","LIKE","INTO","JOIN","INNER JOIN","LEFT JOIN","RIGHT JOIN","FULL JOIN","CROSS JOIN","UNION","INTERSECT","EXCEPT","ORDER BY","GROUP BY","HAVING","DISTINCT","LIMIT","OFFSET","INSERT","UPDATE","DELETE","CREATE","ALTER","DROP","TRUNCATE","RENAME","GRANT","REVOKE","COMMIT","ROLLBACK","SAVEPOINT","BEGIN","END","CASE","WHEN","THEN","ELSE","END CASE","EXCEPTION","RAISE","RETURN","FUNCTION","PROCEDURE"]);function jr(o){let e=[],t=o.info.getLabel(),i=o.getParentInstance(),r=o.kind===Z?"property":"association";if(!o.info.name){let s=`The "${t}" ${r} has no name.`,n=`The ${r} must have a name.`;return e.push({field:"name",rule:"required",message:s,help:n,severity:"error",key:o.key,kind:o.kind,parent:i.key}),e}let a=o.info.name;if(a.length<2){let s=`The "${t}" ${r} name is too short.`;e.push({field:"name",rule:"length",message:s,help:"The name must be at least 2 characters long.",severity:"error",key:o.key,kind:o.kind,parent:i.key})}if(a.length>59){let s=`The "${t}" ${r} name is too long.`;e.push({field:"name",rule:"length",message:s,help:"The name must be at most 59 characters long.",severity:"error",key:o.key,kind:o.kind,parent:i.key})}if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(a)){let s=`The "${t}" ${r} name is invalid.`;e.push({field:"name",rule:"format",message:s,help:"The name must start with a letter (a-z) or underscore (_). Subsequent characters can be letters, digits (0-9), or underscores (_).",severity:"error",key:o.key,kind:o.kind,parent:i.key})}if(/^[A-Z]/.test(a)){let s=`The "${t}" ${r} name is not in snake case.`;e.push({field:"name",rule:"snake_case",message:s,help:"The name should be in snake case (lowercase letters and underscores).",severity:"info",key:o.key,kind:o.kind,parent:i.key})}if(Nr.has(a.toUpperCase())){let s=`The "${t}" ${r} name is a reserved keyword.`;e.push({field:"name",rule:"reserved",message:s,help:"The name should not be a reserved keyword.",severity:"error",key:o.key,kind:o.kind,parent:i.key})}return e}var Ai=class{domain;constructor(e){this.domain=e}validate(e){let t=[],i;if(typeof e=="string"?i=this.domain.findAssociation(e):i=e,!i){let s=`The "${e}" association does not exist.`;return t.push({field:"*",rule:"exists",message:s,help:"The association must be defined in the domain.",key:e,kind:oe,severity:"error"}),t}let r=this.validateName(i);t.push(...r);let a=this.validateTargets(i);return t.push(...a),t}validateName(e){return jr(e)}validateTargets(e){let t=[],i=e.info.getLabel(),r=e.getParentInstance();if(!e.targets.length){let a=`The "${i}" association has no target.`;return t.push({field:"targets",rule:"required",message:a,help:"An association must have at least one target.",severity:"error",key:e.key,kind:e.kind,parent:r.key}),t}for(let a of e.targets)if(!this.domain.findEntity(a.key,a.domain)){let n=`The "${i}" association has an invalid target "${a.key}".`;t.push({field:"targets",rule:"exists",message:n,help:"The target must be defined in the domain.",severity:"error",key:e.key,kind:e.kind,parent:r.key})}return t}};var xi=class{domain;constructor(e){this.domain=e}validate(e){let t=[],i;if(typeof e=="string"?i=this.domain.findEntity(e):i=e,!i){let c=`The "${e}" entity does not exist.`;return t.push({field:"*",rule:"exists",message:c,help:"The entity must be defined in the domain.",key:e,kind:J,severity:"error"}),t}let r=this.validatePrimaryKey(i);t.push(...r);let a=this.minimumRequiredProperties(i);t.push(...a);let s=this.validateName(i);t.push(...s);let n=this.uniqueName(i);t.push(...n);let l=this.validateUserSemantics(i);return t.push(...l),t}validatePrimaryKey(e){let t=[];if(!e.primaryKey()){let r=`The "${e.info.getLabel()}" entity has no identifier.`;t.push({field:"properties",rule:"primary_key",message:r,help:"An entity that can exists by itself must have identifier defined.",severity:"error",key:e.key,kind:e.kind})}return t}hasPropertiesInherited(e){if(e.hasProperties())return!0;for(let t of e.listParents())if(this.hasPropertiesInherited(t))return!0;return!1}hasAssociationsInherited(e){if(e.hasAssociations())return!0;for(let t of e.listParents())if(this.hasAssociationsInherited(t))return!0;return!1}minimumRequiredProperties(e){let t=[],i=this.hasPropertiesInherited(e),r=this.hasAssociationsInherited(e);if(!i&&!r){let a=`The "${e.info.getLabel()}" entity has no properties. It will be ignored.`;t.push({field:"properties",rule:"required",message:a,help:"Entities that have no properties are ignored in the data domain. No schema will be generated for it.",severity:"warning",key:e.key,kind:e.kind})}return t}validateName(e){let t=[],i=e.info.getLabel();if(!e.info.name){let a=`The "${i}" entity has no name.`;return t.push({field:"name",rule:"required",message:a,help:"An entity must have a name.",severity:"error",key:e.key,kind:e.kind}),t}let r=e.info.name;if(r.length<2){let a=`The "${i}" entity name is too short.`;t.push({field:"name",rule:"length",message:a,help:"The name must be at least 2 characters long.",severity:"error",key:e.key,kind:e.kind})}if(r.length>31){let a=`The "${i}" entity name is too long.`;t.push({field:"name",rule:"length",message:a,help:"The name must be at most 31 characters long.",severity:"error",key:e.key,kind:e.kind})}if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r)){let a=`The "${i}" entity name is invalid.`;t.push({field:"name",rule:"format",message:a,help:"The name must start with a letter (a-z) or underscore (_). Subsequent characters can be letters, digits (0-9), or underscores (_).",severity:"error",key:e.key,kind:e.kind})}if(/^[A-Z]/.test(r)){let a=`The "${i}" entity name is not in snake case.`;t.push({field:"name",rule:"snake_case",message:a,help:"The name should be in snake case (lowercase letters and underscores).",severity:"info",key:e.key,kind:e.kind})}if(Nr.has(r.toUpperCase())){let a=`The "${i}" entity name is a reserved keyword.`;t.push({field:"name",rule:"reserved",message:a,help:"The name should not be a reserved keyword.",severity:"error",key:e.key,kind:e.kind})}return t}uniqueName(e){let t=[],i=e.info.name?.toLowerCase();if(!i)return t;for(let r of this.domain.listEntities())if(r.info.name?.toLowerCase()===i&&r.key!==e.key){let a=`The "${i}" entity name is already used in the data domain.`;t.push({field:"name",rule:"unique",message:a,help:"The name must be unique. This includes references to other data domains.",severity:"error",key:r.key,kind:r.kind})}for(let r of this.domain.listAllForeignEntities())if(r.info.name?.toLowerCase()===i&&r.key!==e.key){let a=`The "${i}" entity name is already used in the foreign data domain.`;t.push({field:"name",rule:"unique",message:a,help:"The name must be unique. This includes references to other data domains.",severity:"error",key:r.key,kind:r.kind,parent:r.domain.key})}return t}validateUserSemantics(e){let t=[],i=!1,r=!1;for(let a of e.withInheritedProperties())a.hasSemantic(y.Username)&&(i=!0),a.hasSemantic(y.Password)&&(r=!0);if((i||r)&&!e.hasSemantic(y.User)){let a=`The "${e.info.getLabel()}" entity has Username or Password properties but does not have the User taxonomy.`;t.push({field:"semantics",rule:"user_taxonomy_required",message:a,help:"Entities containing authentication credentials like usernames or passwords must be tagged with the User taxonomy.",severity:"error",key:e.key,kind:e.kind})}if(r&&!i){let a=`The "${e.info.getLabel()}" entity has Password credentials but lacks Username semantics.`;t.push({field:"semantics",rule:"username_required_for_password",message:a,help:"An entity with Password credentials must also define a Username property for authentication.",severity:"error",key:e.key,kind:e.kind})}return t}};var Ei=class{domain;constructor(e){this.domain=e}validate(e){let t=[],i;if(typeof e=="string"?i=this.domain.findProperty(e):i=e,!i){let s=`The "${e}" property does not exist.`;return t.push({field:"*",rule:"exists",message:s,help:"The property must be defined in the domain.",key:e,kind:Z,severity:"error"}),t}let r=this.validateName(i);t.push(...r);let a=this.validatePrimaryKeyDefault(i);return t.push(...a),t}validateName(e){return jr(e)}validatePrimaryKeyDefault(e){let t=[];if(e.primary){let i=e.schema?.defaultValue;if(i){if(i.type!=="function"||i.value!=="random"){let r=`The primary key property "${e.info.getLabel()}" has an invalid default value.`;t.push({field:"schema.defaultValue",rule:"primary_key_default",message:r,help:'Primary key properties can only have the "random" function as their default value.',severity:"error",key:e.key,kind:e.kind})}}else{let r=`The primary key property "${e.info.getLabel()}" has no default value.`;t.push({field:"schema.defaultValue",rule:"primary_key_no_default",message:r,help:'Without a default generator (e.g., the "random" function), the client application must generate and supply primary key values manually.',severity:"warning",key:e.key,kind:e.kind})}}return t}};var Ir=class{domain;constructor(e){this.domain=e}validate(){let e=[],t=this.validateUserEntity();e.push(...t);let i=this.validateTimestampSemantics();e.push(...i);let r=this.validateSoftDeleteSemantics();e.push(...r);let a=this.validatePropertySemanticsDataTypes();e.push(...a);let s=this.validateCurrencySemantics();e.push(...s);let n=this.validateGeospatialEndpoints();return e.push(...n),e}validateUserEntity(){let e=[],t=0;for(let i of this.domain.listEntities())if(i.hasSemantic(y.User)){t++;let r=!1,a=!1,s=!1;for(let n of i.withInheritedProperties())if(n.hasSemantic(y.Username)&&(r=!0),n.hasSemantic(y.Password)&&(a=!0),n.hasSemantic(y.UserRole)&&(s=!0),r&&a&&s)break;r||e.push({field:"semantics",rule:"has_username",message:"No username property on the User entity found.",help:'It is recommended to set the "username" property semantic for APIs supporting authentication.',severity:"warning",key:"user_semantic",kind:J}),a||e.push({field:"semantics",rule:"has_password",message:"No password property on the User entity found.",help:'It is recommended to set the "password" property semantic for APIs supporting authentication.',severity:"warning",key:"user_semantic",kind:J}),s||e.push({field:"semantics",rule:"has_user_role",message:"No role property on the User entity found.",help:'It is recommended to set the "User role" property semantic for APIs supporting authentication.',severity:"warning",key:"user_semantic",kind:J})}return t===0?e.push({field:"semantics",rule:"recommended",message:"No entity with User taxonomy found in the domain.",help:"It is recommended to have an entity with the User taxonomy for authentication purposes.",severity:"warning",key:"user_semantic",kind:J}):t>1&&e.push({field:"semantics",rule:"one_user",message:"There is more than one entity with User taxonomy in the domain.",help:"There can be only one user in the system. Remove the additional User taxonomies.",severity:"error",key:"user_semantic",kind:J}),e}validateTimestampSemantics(){let e=[];for(let t of this.domain.listEntities()){let i=!1,r=!1;for(let a of t.withInheritedProperties())a.hasSemantic(y.CreatedTimestamp)&&(i=!0),a.hasSemantic(y.UpdatedTimestamp)&&(r=!0);i||e.push({field:"semantics",rule:"recommended",message:`The "${t.info.getLabel()}" entity does not have a CreatedTimestamp taxonomy.`,help:"It is recommended to have a CreatedTimestamp property to track when the entity was created.",severity:"info",key:t.key,kind:t.kind}),r||e.push({field:"semantics",rule:"recommended",message:`The "${t.info.getLabel()}" entity does not have an UpdatedTimestamp taxonomy.`,help:"It is recommended to have an UpdatedTimestamp property to track when the entity was last modified.",severity:"info",key:t.key,kind:t.kind})}return e}validateSoftDeleteSemantics(){let e=[];for(let t of this.domain.listEntities()){let i=!1;for(let r of t.withInheritedProperties())if(r.hasSemantic(y.DeletedTimestamp)||r.hasSemantic(y.DeletedFlag)){i=!0;break}i||e.push({field:"semantics",rule:"recommended",message:`The "${t.info.getLabel()}" entity does not have soft delete taxonomy.`,help:"It is recommended to have either a DeletedTimestamp or DeletedFlag property for soft deletion.",severity:"info",key:t.key,kind:t.kind})}return e}validatePropertySemanticsDataTypes(){let e=[];for(let t of this.domain.listEntities())for(let i of t.withInheritedProperties())for(let r of i.semantics){let a=Le[r.id];Wi(a)&&a.applicableDataTypes&&(a.applicableDataTypes.includes(i.type)||e.push({field:"semantics",rule:"type_mismatch",message:`The "${i.info.getLabel()}" property has the "${a.displayName}" semantic applied, but its type "${i.type}" is not compatible.`,help:`The "${a.displayName}" semantic can only be applied to properties of type(s): ${a.applicableDataTypes.join(", ")}.`,severity:"error",key:i.key,kind:i.kind,parent:t.key}))}return e}validateCurrencySemantics(){let e=[];for(let t of this.domain.listEntities())for(let i of t.withInheritedProperties()){let r=i.getSemantic(y.Currency);if(r){let a=r.config;i.type==="number"&&a?.allowedCurrencies&&a.allowedCurrencies.length>1&&e.push({field:"semantics",rule:"currency_number_multiple",message:`The "${i.info.getLabel()}" property has the Currency semantic and is a Number, but allows multiple currencies.`,help:"Number properties cannot accept currency codes. Please change the property type to String, or restrict allowedCurrencies to exactly one currency.",severity:"error",key:i.key,kind:i.kind,parent:t.key})}}return e}validateGeospatialEndpoints(){let e=[];for(let t of this.domain.listEntities()){let i=new Map;for(let r of t.withInheritedProperties()){let a=r.getSemantic(y.GeospatialCoordinates);if(a){let s=a.config??{},n=s.enableDistanceQueries!==!1,l=s.enableBoundingBoxQueries!==!1,c=s.enablePolygonQueries===!0,p=s.enableGeoClustering===!0;if(n||l||c||p){let u=(s.apiEndpointPrefix||"/nearby").trim().toLowerCase();i.has(u)||i.set(u,[]),i.get(u)?.push(r.info.getLabel())}}}for(let[r,a]of i.entries())a.length>1&&e.push({field:"semantics",rule:"geospatial_endpoint_collision",message:`The "${t.info.getLabel()}" entity has multiple geospatial properties (${a.join(", ")}) sharing the same API endpoint prefix "${r}".`,help:"Each geospatial property on the same entity must use a unique apiEndpointPrefix to avoid query endpoint collisions (e.g., /nearby, /nearby-office).",severity:"error",key:t.key,kind:t.kind})}return e}};var Ni=class{domain;report=[];#e=0;#t=0;#i=0;#r=!1;get infoCount(){return this.#r||this.computeIssueCounters(),this.#e}get warningCount(){return this.#r||this.computeIssueCounters(),this.#t}get errorCount(){return this.#r||this.computeIssueCounters(),this.#i}constructor(e){this.domain=e}validate(){this.#r=!1,this.report=[];let e=new xi(this.domain),t=new Ei(this.domain),i=new Ai(this.domain),r=new Ir(this.domain),a=!1;for(let n of this.domain.listEntities()){if(n.domain.key!==this.domain.key)continue;a=!0;let l=e.validate(n);this.report.push(...l);for(let c of n.properties){if(c.domain.key!==this.domain.key)continue;let p=t.validate(c);this.report.push(...p)}for(let c of n.associations){if(c.domain.key!==this.domain.key)continue;let p=i.validate(c);this.report.push(...p)}}if(!a)return this.report;let s=r.validate();return this.report.push(...s),this.report}computeIssueCounters(){this.#e=this.report.filter(e=>e.severity==="info").length,this.#t=this.report.filter(e=>e.severity==="warning").length,this.#i=this.report.filter(e=>e.severity==="error").length,this.#r=!0}};var ji=class{model;report=[];#e=0;#t=0;#i=0;#r=!1;get infoCount(){return this.#r||this.computeIssueCounters(),this.#e}get warningCount(){return this.#r||this.computeIssueCounters(),this.#t}get errorCount(){return this.#r||this.computeIssueCounters(),this.#i}constructor(e){this.model=e}validate(){if(this.#r=!1,this.report=[],this.report.push(...Oa(this.model)),this.report.push(...Ca(this.model)),this.report.push(...Ra(this.model)),this.report.push(...jn(this.model)),this.report.push(...Pa(this.model)),!this.model.exposes||this.model.exposes.size===0)this.report.push({code:"API_NO_EXPOSURES",message:"Your API currently has no exposed data for external clients to request.",suggestion:"Expose a data model so apps can communicate with it.",severity:"warning",context:{apiModelKey:this.model.key,kind:ye,key:this.model.key,property:"exposes"}});else for(let e of this.model.exposes.values())this.report.push(...Da(e,this.model));return this.report}computeIssueCounters(){this.#e=this.report.filter(e=>e.severity==="info").length,this.#t=this.report.filter(e=>e.severity==="warning").length,this.#i=this.report.filter(e=>e.severity==="error").length,this.#r=!0}};var Ua;(function(o){o.LatLon="lat,lon",o.LonLat="lon,lat",o.PostGIS="postgis",o.Degree="degree",o.WKT="wkt",o.GeoJSON="geojson"})(Ua||(Ua={}));var La;(function(o){o.Meters="meters",o.Kilometers="kilometers",o.Miles="miles",o.Feet="feet",o.Yards="yards",o.NauticalMiles="nautical_miles"})(La||(La={}));var Ma;(function(o){o.WGS84="EPSG:4326",o.WebMercator="EPSG:3857",o.NAD83="EPSG:4269",o.NAD27="EPSG:4267"})(Ma||(Ma={}));var R_={format:Ua.LatLon,spatialReferenceSystem:Ma.WGS84,defaultDistanceUnit:La.Meters,enableSpatialIndexing:!0,enableValidation:!0,enablePostGISIntegration:!0,postGISGeometryType:"POINT",enableDistanceQueries:!0,maxQueryDistance:1e5,enableBoundingBoxQueries:!0,enablePolygonQueries:!1,enableGeoClustering:!1,apiEndpointPrefix:"/nearby",includeElevation:!1,coordinatePrecision:6,enableReverseGeocoding:!1};var In;(function(o){o.Bcrypt="bcrypt",o.Argon2="argon2",o.Scrypt="scrypt"})(In||(In={}));var $r=(o={})=>{let e={...zc,...o};return o.metadata&&(e.metadata={...o.metadata}),{id:y.SKU,config:e}},zc={validationMode:"strict",caseMode:"uppercase",enforceUniqueness:!0,autoGenerate:!1,validateReservedWords:!0,reservedValues:["ADMIN","TEST","NULL","DEFAULT","UNDEFINED","SAMPLE","DEMO"]},F_={PRODUCT_STANDARD:$r({validationMode:"strict",caseMode:"uppercase",prefix:"PROD-",enforceUniqueness:!0,validateReservedWords:!0,reservedValues:["ADMIN","TEST","NULL","DEFAULT"]}),SIMPLE:$r({validationMode:"lenient",caseMode:"preserve",enforceUniqueness:!0}),AUTO_GENERATE:$r({validationMode:"strict",caseMode:"uppercase",autoGenerate:!0,autoGenerateSource:"name",enforceUniqueness:!0}),FLEXIBLE:$r({validationMode:"lenient",caseMode:"preserve",enforceUniqueness:!0,validateReservedWords:!1})};function Tn(o){o.command("validate [file]").description("Validate a Data Domain or API Model schema").option("--stdin","Read schema content from STDIN").option("--org <oid>","Organization ID (remote validation)").option("--fid <fid>","File ID / schema ID (remote validation)").option("--domain <path>","Path to local Data Domain schema file (only for local API Model validation)").action(async(e,t)=>{let i=new B({format:N.resolved.format});await new za(e,t,i).execute()})}var za=class{constructor(e,t,i){this.file=e;this.options=t;this.formatter=i}file;options;formatter;async execute(){try{this.validateArguments();let e=await this.loadSchema();this.validateSchemaStructure(e);let t=e.kind,i=[];t===Be?i=await this.validateDataDomain(e):t===ye?i=await this.validateApiModel(e):(this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Unsupported schema kind "${t}". Supported kinds: "${Be}", "${ye}".`}),process.exit(1)),this.reportResults(i,t)}catch(e){let t=ie(e);this.formatter.error(t),process.exit(1)}}get isRemoteValidationWithoutOrg(){return!!(this.options.fid&&!this.options.org&&!N.resolved.org)}get shouldReadFromStdin(){return!!(this.options.stdin||!this.file&&!process.stdin.isTTY)}validateArguments(){this.file&&this.options.stdin&&(this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:"Cannot specify both [file] path and --stdin"}),process.exit(1)),this.options.org&&!this.options.fid&&(this.formatter.error({code:"CLI_ERR_MISSING_REQUIRED",message:"File ID (--fid) is required when using remote validation (--org)."}),process.exit(1)),this.isRemoteValidationWithoutOrg&&(this.formatter.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Organization ID is required for remote validation. Use --org <oid> or configure a default org."}),process.exit(1))}async loadSchema(){return this.options.fid?this.loadRemoteSchema():this.loadLocalSchema()}async loadRemoteSchema(){let e=this.options.org||N.resolved.org;e||(this.formatter.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Organization ID is required for remote validation."}),process.exit(1));let t=ee(),{media:i}=await t.files.readMedia(e,this.options.fid,{token:t.token});return i}async loadLocalSchema(){let e;if(this.shouldReadFromStdin)e=await this.readStdin();else if(this.file){let t=$n.resolve(this.file);Tr.existsSync(t)||(this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`File not found at path: ${t}`}),process.exit(1)),e=Tr.readFileSync(t,"utf8")}else this.formatter.error({code:"CLI_ERR_MISSING_REQUIRED",message:"A file path, --stdin, or remote --org and --fid must be specified."}),process.exit(1);try{return JSON.parse(e)}catch(t){let i=t instanceof Error?t.message:String(t);this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Failed to parse schema JSON: ${i}`}),process.exit(1)}}isValidSchemaStructure(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&"kind"in e}validateSchemaStructure(e){this.isValidSchemaStructure(e)||(this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:'Invalid schema. The schema must be a JSON object containing a "kind" property.'}),process.exit(1))}async validateDataDomain(e){let t=[];if(this.options.fid){let a=ee(),s=e.dependencyList||[];s.length>0&&(t=(await a.dataCatalog.listDependencies(s,{token:a.token})).data||[])}let i=new Je(e,t,{readOnly:!0});return new Ni(i).validate()}async validateApiModel(e){let t;if(this.options.fid){let a=ee(),s=e.dependencyList||[];if(s.length>0){let l=(await a.dataCatalog.listDependencies(s,{token:a.token})).data||[];l.length>0&&(t=new Je(l[0],l,{readOnly:!0}))}}else if(this.options.domain){let a=$n.resolve(this.options.domain);Tr.existsSync(a)||(this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Domain dependency file not found at path: ${a}`}),process.exit(1));let s;try{s=JSON.parse(Tr.readFileSync(a,"utf8"))}catch(n){let l=n instanceof Error?n.message:String(n);this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Failed to parse domain dependency JSON: ${l}`}),process.exit(1)}t=new Je(s,[],{readOnly:!0})}let i=new _i(e,t);return new ji(i).validate()}reportResults(e,t){let i=e.some(r=>r.severity==="error");if(N.resolved.format==="json")console.log(JSON.stringify({isValid:!i,validationIssues:e},null,2));else if(e.length===0)this.formatter.success("Validation passed. No issues found!");else{let r=this.formatIssues(e,t);this.formatter.list(r,["severity","code","message","suggestion","context"],{headers:["SEVERITY","CODE","MESSAGE","SUGGESTION","CONTEXT"]});let a=e.filter(l=>l.severity==="error").length,s=e.filter(l=>l.severity==="warning").length,n=e.filter(l=>l.severity==="info").length;console.log(""),a>0?console.error(G.red(`\u2716 Validation failed: ${a} error(s), ${s} warning(s), ${n} info(s).`)):console.log(G.yellow(`\u26A0 Validation passed with warnings: ${s} warning(s), ${n} info(s).`))}i&&process.exit(1)}formatIssues(e,t){return e.map(i=>{let r=i.severity||"info",a=i.message||"",s,n,l;if(t===Be){let c=i;s=c.rule||"unknown",n=c.help||"",l=c.key?`${c.kind||"unknown"}: ${c.key}`:c.field||""}else{let c=i;s=c.code||"unknown",n=c.suggestion||"";let p=c.context||{};l=`${p.kind||"unknown"}: ${p.key||""}${p.property?"."+p.property:""}`}return{severity:r,code:s,message:a,suggestion:n,context:l}})}async readStdin(){return new Promise((e,t)=>{let i="";process.stdin.setEncoding("utf8"),process.stdin.on("data",r=>{i+=r}),process.stdin.on("end",()=>{e(i)}),process.stdin.on("error",r=>{t(r)})})}};parseInt(process.versions.node.split(".")[0],10)<22&&(console.error("Error: apinow requires Node.js 22 or higher."),process.exit(1));function On(){let o=process.argv.indexOf("--format");if(o!==-1&&o+1<process.argv.length&&process.argv[o+1]==="json")return"json";try{return N.resolved.format||"text"}catch{return"text"}}process.on("uncaughtException",o=>{new B({format:On()}).error({code:"CLI_ERR_UNKNOWN",message:o.message||"An unexpected error occurred.",detail:o.stack}),process.exit(1)});process.on("unhandledRejection",o=>{let e=new B({format:On()}),t=o instanceof Error?o.message:String(o),i=o instanceof Error?o.stack:void 0;e.error({code:"CLI_ERR_UNKNOWN",message:`Unhandled promise rejection: ${t}`,detail:i}),process.exit(1)});Hc({pkg:Ht}).notify();N.load();var Pe=new Wc;Pe.name("apinow").description("API NOW! Platform CLI Tool").version(Ht.version,"--version").option("--format <format>","Output format: text, json","text").option("--api-url <url>","Override target API server base URL").option("--debug","Enable debug/verbose logging");Pe.hook("preAction",()=>{N.saturate({apiUrl:Pe.opts().apiUrl,format:Pe.opts().format})});Ka(Pe);Wa(Pe);Ya(Pe);rs(Pe);as(Pe);Tn(Pe);await Pe.parseAsync(process.argv);
|
|
159
|
+
`))}function fn(o,e){return hc(o,e),{options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:uc(o,e),edges:mc(o,e)}}function gn(o,e){for(let t of o.nodes()){let i=o.node(t);i&&i.domain.key===e&&o.removeNode(t)}}function ja(o,e,t){let i=new Set,r=new Set;for(let s of e.nodes()){let n=e.node(s);if(!n)continue;let l=`${t}:${s}`;o.setNode(l,n),i.add(l)}for(let s of e.edges()){let n=e.edge(s);if(!n)continue;let l=`${t}:${s.v}`,c=`${t}:${s.w}`;o.setEdge(l,c,{foreign:!0,domain:t,...n}),r.add(`${l}|${c}`)}let a=new Set;for(let s of e.nodes()){let n=`${t}:${s}`;for(let l of e.parents(s)){let c=`${t}:${l}`,p=o.node(n),u=o.node(c);p.kind===J&&u.kind===J?a.has(n)?o.addParent(n,c):(a.add(n),o.setParent(n,c)):o.setParent(n,c)}}return{nodes:i,edges:r}}function hn(o,e){for(let t of e)if(t.w===o)return t.v}function fc(o,e,t,i,r){if(!e){let s={type:"malformed_entry",severity:"error",message:"Unable to restore data domain graph. Malformed node entry"};if(r.push(s),i==="strict")throw new Error(s.message);return}let a=e;if(!a.kind){let s={type:"malformed_entry",severity:"error",message:"Unable to restore data domain graph. Node entry missing kind property",affectedKey:a.key};if(r.push(s),i==="strict")throw new Error(s.message);return}try{if(a.kind===ne)return new It(o,a);if(a.kind===te)return new it(o,a);if(a.kind===J)return new Nt(o,a);if(a.kind===Z){let n=a,l=hn(n.key,t);if(!l){let c={type:"missing_edge",severity:"error",message:`Property "${n.info?.name||n.key}" has no parent entity edge`,affectedKey:n.key,resolution:i==="lenient"?"Property will be skipped":void 0};if(r.push(c),i==="strict")throw new Error("Unable to restore data domain graph. Malformed node entry");return}return new At(o,l,n)}if(a.kind===oe){let n=a,l=hn(n.key,t);if(!l){let c={type:"missing_edge",severity:"error",message:`Association "${n.info?.name||n.key}" has no parent entity edge`,affectedKey:n.key,resolution:i==="lenient"?"Association will be skipped":void 0};if(r.push(c),i==="strict")throw new Error("Unable to restore data domain graph. Malformed node entry");return}return new xt(o,l,n)}let s={type:"unknown_kind",severity:"error",message:`Unknown node kind: ${a.kind}`,affectedKey:a.key};if(r.push(s),i==="strict")throw new Error(`Unable to restore data domain graph. Unknown node kind ${a.kind}`);return}catch(s){let n={type:"malformed_entry",severity:"error",message:`Failed to create node: ${s instanceof Error?s.message:String(s)}`,affectedKey:a.key};if(r.push(n),i==="strict")throw s;return}}function yn(o,e={}){let{json:t,dependencies:i,mode:r="strict"}=e,a=new _r({compound:!0,multigraph:!0,directed:!0}),s=[],n=new Set,l=new Set;if(i)for(let p of i)try{let u=ja(a,p.graph,p.key);u.edges.size&&(l=new Set([...l,...u.edges])),u.nodes.size&&(n=new Set([...n,...u.nodes])),o.dependencies.set(p.key,p)}catch(u){let m=`Failed to merge dependency "${p.key}": ${u instanceof Error?u.message:String(u)}`;if(r==="strict")throw new Error(m,{cause:u});let g={type:"missing_dependency",severity:"error",message:m,affectedKey:p.key,resolution:"Dependency will be skipped"};s.push(g)}if(!t)return{graph:a,issues:s,success:!0};if(Array.isArray(t.nodes)){let p=new Map;for(let u of t.nodes){let m=fc(o,u.value,t.edges,r,s);m&&(a.setNode(u.v,m),u.parents&&p.set(u.v,u.parents))}for(let[u,m]of p){if(!a.hasNode(u)){let g={type:"missing_node",severity:"warning",message:`Cannot set parents for missing node: ${u}`,affectedKey:u,resolution:"Parent relationship will be skipped"};s.push(g);continue}for(let g of m){if(!a.hasNode(g)){let f={type:"missing_node",severity:"warning",message:`Parent node "${g}" not found for child "${u}"`,affectedKey:u,context:{parentKey:g},resolution:"Parent relationship will be skipped"};s.push(f);continue}try{a.setParent(u,g)}catch(f){let v={type:"invalid_parent",severity:"warning",message:`Failed to set parent "${g}" for child "${u}": ${f instanceof Error?f.message:String(f)}`,affectedKey:u,context:{parentKey:g},resolution:"Parent relationship will be skipped"};s.push(v)}}}}if(Array.isArray(t.edges))for(let p of t.edges){if(!p.value){let u="Edge entry missing value";if(r==="strict")throw new Error(u);let m={type:"malformed_entry",severity:"error",message:u,context:{edge:p}};s.push(m);continue}if(p.value.foreign&&!n.has(p.w)){let u={type:"missing_node",severity:"warning",message:`Missing foreign node: ${p.w}`,affectedKey:p.w,resolution:"Edge will be skipped"};s.push(u);continue}if(n.has(p.v)||n.has(p.w)){if(!a.hasNode(p.v)||!a.hasNode(p.w)){let u={type:"missing_node",severity:"warning",message:`Missing foreign node for edge: ${p.v} -> ${p.w}`,context:{sourceNode:p.v,targetNode:p.w},resolution:"Edge will be skipped"};s.push(u);continue}}else{if(!a.hasNode(p.v)){let u={type:"missing_node",severity:"warning",message:`Source node not found for edge: ${p.v}`,affectedKey:p.v,resolution:"Edge will be skipped"};s.push(u);continue}if(!a.hasNode(p.w)){let u={type:"missing_node",severity:"warning",message:`Target node not found for edge: ${p.w}`,affectedKey:p.w,resolution:"Edge will be skipped"};s.push(u);continue}}try{a.setEdge({v:p.v,w:p.w,name:p.name},p.value)}catch(u){let g={type:"malformed_entry",severity:"warning",message:`Failed to create edge ${p.v} -> ${p.w}: ${u instanceof Error?u.message:String(u)}`,context:{sourceNode:p.v,targetNode:p.w},resolution:"Edge will be skipped"};s.push(g)}}let c=s.some(p=>p.severity==="error");return{graph:a,issues:s,success:!c}}var Gt=class extends EventTarget{dependencies=new Map;dependencyList=[];constructor(e=[],t=[]){super(),this.dependencyList=[...e];for(let i of t)this.dependencies.set(i.key,i)}};var qe=class o extends Gt{kind;key;graph;info;#e=!0;#t=!1;readOnly;get domain(){return this}#r;get fields(){return this.#r}set fields(e){this.#r=e}issues=[];static createSchema(e={}){let{key:t=R(),fields:i}=e,r=W.fromJSON(e.info,{name:"Unnamed domain"}).toJSON(),a={kind:He,key:t,info:r};return e.dependencyList&&(a.dependencyList=structuredClone(e.dependencyList)),e.graph&&(a.graph=e.graph),Array.isArray(i)&&(a.fields=[...i]),a}constructor(e,t=[],i){let r=o.createSchema(e),a=[];for(let l of t)if(l instanceof o)l.readOnly?a.push(l):(console.warn(`Domain ${l.key} is not read only, cloning it. This may have performance implications.`),a.push(l.clone({readOnly:!0})));else if(typeof l=="object"&&l.kind===He&&l.key){let c=new o(l,void 0,{readOnly:!0});a.push(c)}else throw new Error(`Invalid foreign domain dependency: ${l}`);super(r.dependencyList,a),this.kind=r.kind,this.key=r.key,this.info=new W(r.info),this.readOnly=i?.readOnly||!1;let s=i?.mode||"strict",n=yn(this,{json:r.graph,dependencies:a,mode:s});this.graph=n.graph,n.issues.length>0&&s==="lenient"&&(this.issues=n.issues),Array.isArray(r.fields)?this.fields=[...r.fields]:this.fields=[],Array.isArray(r.dependencyList)?this.dependencyList=[...r.dependencyList]:this.dependencyList=[],this.#e=!1}clone(e){let t=this.toJSON(),i=Array.from(this.dependencies.values()).map(a=>a.clone()),r={readOnly:this.readOnly,...e};return new o(t,i,r)}toJSON(){let e={info:this.info.toJSON(),kind:this.kind,key:this.key,graph:fn(this.graph,this.key)};return this.dependencyList.length>0&&(e.dependencyList=structuredClone(this.dependencyList)),Array.isArray(this.fields)&&this.fields.length&&(e.fields=[...this.fields]),e}notifyChange(){this.#t||this.#e||(this.#t=!0,queueMicrotask(()=>{this.#t=!1;let e=new Event("change");this.dispatchEvent(e)}))}removeField(e){this.fields=this.fields.filter(t=>t.key!==e)}hasFields(){return this.fields.length>0}*listFields(){for(let{key:e}of this.fields){let t=this.graph.node(e);t&&(t.kind===ne||t.kind===te)&&(yield t)}}addNamespace(e,t){if(t){if(!this.graph.hasNode(t))throw new Error(`Parent namespace ${t} does not exist`);let r=this.graph.node(t);if(!r||r.kind!==ne)throw new Error(`Parent namespace ${t} is not a valid namespace`);if(r.domain.key!==this.key)throw new Error("Cannot add a namespace to a foreign domain");return r.addNamespace(e)}let i=new It(this,e);return this.graph.setNode(i.key,i),this.fields.push({type:"namespace",key:i.key}),i}removeNamespace(e){if(!this.graph.hasNode(e))throw new Error(`Namespace ${e} does not exist`);let t=this.graph.node(e);if(!t||t.kind!==ne)throw new Error(`Namespace ${e} not found`);if(t.domain.key!==this.key)throw new Error("Cannot remove a namespace from a foreign domain");let i=t.getParentInstance();return i===this?(Se(this.graph,e),this.removeField(e)):i.removeNamespace(e),this}*listNamespaces(){for(let{key:e,type:t}of this.fields){if(t!=="namespace")continue;let i=this.graph.node(e);!i||i.kind!==ne||(yield i)}}*listForeignNamespaces(e){let t=this.dependencies.get(e);if(!t)throw new Error(`Foreign domain ${e} not found`);for(let i of t.listNamespaces()){let r=`${e}:${i.key}`;this.graph.node(r)&&(yield i)}}hasNamespaces(){return this.fields.some(e=>e.type==="namespace")}*listGraphNamespaces(e){for(let t of this.graph.children(e)){let i=this.graph.node(t);i.kind===ne&&i.domain.key===this.key&&(yield i)}}buildReferenceKey(e,t){if(t&&t!==this.key){if(typeof t!="string"||t.length===0)throw new Error(`Invalid namespace key. Expected a string, got ${typeof t}`);if(!this.dependencies.get(t))throw new Error(`Foreign domain ${t} not found`);return`${t}:${e}`}return e}findNamespace(e,t){let i=this.graph.node(this.buildReferenceKey(e,t));if(i&&i.kind===ne)return i}moveNamespace(e,t){if(!this.graph.hasNode(e))throw new Error(`Namespace ${e} does not exist`);let i=this.findNamespace(e);if(!i)throw new Error(`Namespace ${e} not found in the graph`);if(t){let s=this.findNamespace(t);if(s&&s.domain.key!==this.key)throw new Error("Cannot move a namespace to a foreign domain");if(!s)throw new Error(`Parent namespace ${t} does not exist`)}if(e===t)throw new Error("Cannot move a namespace to itself");if(i.domain.key!==this.key)throw new Error("Cannot move a namespace from a foreign domain");let r;if(t){if(r=this.findNamespace(t),!r)throw new Error(`Parent namespace ${t} not found`);if(this.isChildOf(t,e))throw new Error("Cannot move a namespace to its own child")}let a=this.graph.parent(e);return a&&!t?this.graph.node(a).detachNamespace(e):a||this.removeField(e),t&&r?r.attachNamespace(e):this.fields.push({type:"namespace",key:e}),this}isChildOf(e,t){let i=this.graph.children(t);for(let r of i)if(r===e||this.isChildOf(e,r))return!0;return!1}addModel(e,t){if(t){if(!this.graph.hasNode(t))throw new Error(`Parent ${t} does not exist`);let r=this.findNamespace(t);if(!r)throw new Error(`Parent namespace ${t} is not a valid namespace`);if(r.domain.key!==this.key)throw new Error("Cannot add a model to a foreign domain");return r.addModel(e)}let i=new it(this,e);return this.graph.setNode(i.key,i),this.fields.push({type:"model",key:i.key}),i}removeModel(e){if(!this.graph.hasNode(e))throw new Error(`Data model ${e} does not exist`);let t=this.graph.node(e);if(!t||t.kind!==te)throw new Error(`Data model ${e} not found`);if(t.domain.key!==this.key)throw new Error("Cannot remove a model from a foreign domain");let i=t.getParentInstance();return i===this?(Se(this.graph,e),this.removeField(e)):i.removeModel(e),this}*listModels(e){let t=e?.domain,i=e?.includeForeign??!1,r=e?.foreignOnly??!1;if(t){let a=t===this.key?this:this.dependencies.get(t);if(!a)throw new Error(`Foreign domain ${t} not found`);for(let s of a.listModels()){let n=t===this.key?s.key:`${t}:${s.key}`,l=this.graph.node(n);l&&(yield l)}return}if(!r)for(let{key:a,type:s}of this.fields){if(s!=="model")continue;let n=this.graph.node(a);n&&n.kind===te&&(yield n)}if(i||r)for(let[a,s]of this.dependencies)for(let n of s.listModels()){let l=`${a}:${n.key}`,c=this.graph.node(l);c&&(yield c)}}*listForeignModels(e){yield*this.listModels({domain:e})}hasModels(){return this.fields.some(e=>e.type==="model")}*listGraphModels(e){for(let t of this.graph.children(e)){let i=this.graph.node(t);i.kind===te&&i.domain.key===this.key&&(yield i)}}findModel(e,t){let i=this.graph.node(this.buildReferenceKey(e,t));if(i&&i.kind===te)return i}moveModel(e,t){if(!this.graph.hasNode(e))throw new Error(`Data model ${e} does not exist`);let i=this.findModel(e);if(!i)throw new Error(`Data model ${e} not found in the graph`);if(t){let a=this.findNamespace(t);if(a&&a.domain.key!==this.key)throw new Error("Cannot move a model to a foreign domain");if(!a)throw new Error(`Parent namespace ${t} does not exist`)}if(i.domain.key!==this.key)throw new Error("Cannot move a data model to a foreign domain");let r=this.graph.parent(e);if(r&&!t){let a=this.findNamespace(r);if(!a)throw new Error(`The parent namespace ${r} not found`);a.detachModel(e)}else r||this.removeField(e);return t?this.findNamespace(t).attachModel(e):this.fields.push({type:"model",key:e}),this}addEntity(e,t){if(!e)throw new Error("An entity expects a DomainModel parent");if(!this.graph.hasNode(e))throw new Error(`The parent ${e} does not exist`);let i=this.findModel(e);if(!i)throw new Error(`Parent model ${e} is not a valid model`);if(i.domain.key!==this.key)throw new Error("Cannot add an entity to a foreign domain");return i.addEntity(t)}removeEntity(e){if(!this.graph.hasNode(e))throw new Error(`Entity ${e} does not exist`);let t=this.graph.parent(e);if(!t)throw new Error(`Parent model not found for entity ${e}`);let i=this.findModel(t);if(!i)throw new Error(`Parent model ${t} not found`);if(i.domain.key!==this.key)throw new Error("Cannot remove an entity from a foreign domain");return i.removeEntity(e),this}*listEntities(e){let t,i,r=!1,a=!1;if(typeof e=="string"?t=e:e&&typeof e=="object"&&(t=e.parent,i=e.domain,r=e.includeForeign??!1,a=e.foreignOnly??!1),i&&i!==this.key&&!this.dependencies.get(i))throw new Error(`Foreign domain ${i} not found`);let s=t?this.graph.children(t):this.graph.nodes();for(let n of s){let l=this.graph.node(n);if(l&&l.kind===J){let c=l.domain.key===this.key;if(i){l.domain.key===i&&(yield l);continue}a?c||(yield l):r?yield l:c&&(yield l)}}}*listForeignEntities(e){yield*this.listEntities({domain:e})}*listAllForeignEntities(){yield*this.listEntities({foreignOnly:!0})}findEntity(e,t){let i=this.graph.node(this.buildReferenceKey(e,t));if(i&&i.kind===J)return i}moveEntity(e,t,i){if(t===i)throw new Error("Cannot move an entity to the same model");if(!this.graph.hasNode(e))throw new Error(`Entity ${e} does not exist`);if(!this.graph.hasNode(t))throw new Error(`Source model ${t} does not exist`);if(!this.graph.hasNode(i))throw new Error(`Target model ${i} does not exist`);let r=this.findEntity(e),a=this.findModel(t),s=this.findModel(i);if(!r||!a||!s)throw new Error("Entity or models not found in the graph");if(r.domain.key!==this.key)throw new Error("Cannot move an entity from a foreign domain");if(s.domain.key!==this.key)throw new Error("Cannot move an entity to a foreign domain");s.attachEntity(e)}addAssociation(e,t){if(!this.graph.hasNode(e))throw new Error(`Source entity ${e} not found`);let i=this.findEntity(e);if(!i)throw new Error(`Source entity ${e} not found`);if(i.domain.key!==this.key)throw new Error("Cannot add an association to a foreign domain");return i.addAssociation(t)}removeAssociation(e){if(!this.graph.hasNode(e))throw new Error(`Association ${e} does not exist`);let t=this.graph.node(e);if(!t||t.kind!==oe)throw new Error(`Association ${e} not found`);let i=t.getParentInstance();if(!i)throw new Error(`Parent entity not found for association ${e}`);if(i.domain.key!==this.key)throw new Error("Cannot remove an association from a foreign domain");return i.removeAssociation(e),this}findAssociation(e,t){let i=this.graph.node(this.buildReferenceKey(e,t));if(i&&i.kind===oe)return i}addProperty(e,t){if(!e)throw new Error("A property expects a DomainEntity parent");if(!this.graph.hasNode(e))throw new Error(`Parent entity ${e} does not exist`);let i=this.findEntity(e);if(!i)throw new Error(`Parent entity ${e} not found`);if(i.domain.key!==this.key)throw new Error("Cannot add a property to a foreign domain");return i.addProperty(t)}removeProperty(e){if(!this.graph.hasNode(e))throw new Error(`Property ${e} does not exist`);let t=this.graph.node(e);if(!t||t.kind!==Z)throw new Error(`Property ${e} not found`);let i=t.getParentInstance();if(!i)throw new Error(`Parent entity not found for property ${e}`);if(i.domain.key!==this.key)throw new Error("Cannot remove a property from a foreign domain");return i.removeProperty(e),this}findProperty(e,t){let i=this.graph.node(this.buildReferenceKey(e,t));if(i&&i.kind===Z)return i}registerForeignDomain(e){let{info:t,key:i}=e;if(!t.version)throw new Error(`Foreign domain ${i} does not have a version set`);if(this.dependencies.has(i))throw new Error(`Foreign domain with key ${i} already registered`);this.dependencies.set(i,e),this.dependencyList.push({key:i,version:t.version}),ja(this.graph,e.graph,e.key)}unregisterForeignDomain(e){let t=this.dependencies.get(e);if(!t)throw new Error(`Foreign domain with key ${e} not found`);this.dependencies.delete(e),this.dependencyList=this.dependencyList.filter(i=>i.key!==e),gn(this.graph,t.key)}removeDomainElement(e,t){switch(t){case ne:this.removeNamespace(e);break;case te:this.removeModel(e);break;case J:this.removeEntity(e);break;case Z:this.removeProperty(e);break;case oe:this.removeAssociation(e);break;default:throw new Error(`Unknown kind ${t} for the object ${e}`)}}search(e={}){let{query:t,nodeTypes:i,includeForeignDomains:r=!1,caseSensitive:a=!1}=e,s=[],n=!t&&(!i||i.length===0),l=m=>!i||i.length===0?!0:i.includes(m),c=m=>{if(!m||!t)return!t;if(t instanceof RegExp)return t.test(m);let g=a?m:m.toLowerCase(),f=a?t:t.toLowerCase();return g.includes(f)},p=m=>{if(!t)return[];let g=[],{info:f}=m;return c(f.name)&&g.push("name"),c(f.displayName)&&g.push("displayName"),c(f.description)&&g.push("description"),g},u=m=>m.includes(":");for(let m of this.graph.nodes()){let g=this.graph.node(m);if(!g||!g.info)continue;let f=u(m);if(f&&!r||!l(g.kind))continue;if(n){s.push({node:g,matchedFields:[],key:m,isForeign:f});continue}let b=p(g);(!t||b.length>0)&&s.push({node:g,matchedFields:b,key:m,isForeign:f})}return s}};var Ia=[],$a=[],bn={},vi={},ki={};function wn(o){return typeof o=="string"?new RegExp("^"+o+"$","i"):o}function Ar(o,e){return o===e?e:o===o.toLowerCase()?e.toLowerCase():o===o.toUpperCase()?e.toUpperCase():o[0]===o[0].toUpperCase()?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e.toLowerCase()}function yc(o,e){return o.replace(/\$(\d{1,2})/g,function(t,i){return e[i]||""})}function bc(o,e){return o.replace(e[0],function(t,i){let r=yc(e[1],arguments);return Ar(t===""?o[i-1]:t,r)})}function vn(o,e,t){if(!o.length||Object.hasOwn(bn,o))return e;let i=t.length;for(;i--;){let r=t[i];if(r[0].test(e))return bc(e,r)}return e}function kn(o,e,t){return function(i){let r=i.toLowerCase();return Object.prototype.hasOwnProperty.call(e,r)?Ar(i,r):Object.prototype.hasOwnProperty.call(o,r)?Ar(i,o[r]):vn(r,i,t)}}function Sn(o,e,t){return function(i){let r=i.toLowerCase();return Object.prototype.hasOwnProperty.call(e,r)?!0:Object.prototype.hasOwnProperty.call(o,r)?!1:vn(r,r,t)===r}}var he=function(o,e,t){let i=e===1?he.singular(o):he.plural(o);return(t?e+" ":"")+i};he.plural=kn(ki,vi,Ia);he.isPlural=Sn(ki,vi,Ia);he.singular=kn(vi,ki,$a);he.isSingular=Sn(vi,ki,$a);he.addPluralRule=function(o,e){Ia.push([wn(o),e])};he.addSingularRule=function(o,e){$a.push([wn(o),e])};he.addUncountableRule=function(o){if(typeof o=="string"){bn[o.toLowerCase()]=!0;return}he.addPluralRule(o,"$0"),he.addSingularRule(o,"$0")};he.addIrregularRule=function(o,e){e=e.toLowerCase(),o=o.toLowerCase(),ki[o]=e,vi[e]=o};[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["my","our"],["its","their"],["his","their"],["her","their"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"],["canvas","canvases"]].forEach(function(o){he.addIrregularRule(o[0],o[1])});[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(o){he.addPluralRule(o[0],o[1])});[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/(dg|ss|ois|lk|ok|wn|mb|th|ch|ec|oal|is|ck|ix|sser|ts|wb)ies$/i,"$1ie"],[/\b(l|(?:neck|cross|hog|aun)?t|coll|faer|food|gen|goon|group|hipp|junk|vegg|(?:pork)?p|charl|calor|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(o){he.addSingularRule(o[0],o[1])});["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(he.addUncountableRule);var xr=he;function $t(o){return o.domain?`${o.domain}:${o.key}`:o.key}function Bt(o){if(!o)throw new h("Cannot generate parameter name from an empty string.",{code:"E_INVALID_PARAM_NAME",help:"The entity name used for path parameter generation is empty."});let e=o.replace(/([a-z])([A-Z])/g,"$1 $2");e=e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2");let i=e.replace(/[^a-zA-Z0-9]/g," ").split(/\s+/).filter(Boolean);if(i.length===0)throw new h(`Cannot generate a valid parameter name from "${o}".`,{code:"E_INVALID_PARAM_NAME",help:"The entity name must contain alphanumeric characters to generate a path parameter."});let a=i.map((s,n)=>{let l=s.toLowerCase();return n===0?l:l.charAt(0).toUpperCase()+l.slice(1)}).join("");return/^[0-9]/.test(a)&&(a="_"+a),`${a}Id`}function Tt(o){let e=o.trim(),t=e.startsWith("/")?e:`/${e}`;return t==="/"?"/":t.replace(/\/+$/,"")}function Ta(o,e){let t=o.endsWith("/")?o.slice(0,-1):o,i=e.startsWith("/")?e:`/${e}`;return`${t}${i}`}var Ct=class o{kind;key;entity;hasCollection;collectionPath;resourcePath;isRoot;parent;exposeOptions;actions;accessRule;rateLimiting;paginationContract;truncated;api;static createSchema(e={}){let{key:t=R(),entity:i={key:""},collectionPath:r,resourcePath:a="/",hasCollection:s=!0,isRoot:n,parent:l,exposeOptions:c,actions:p=[],accessRule:u,rateLimiting:m,truncated:g,paginationContract:f}=e,b={kind:bt,key:t,entity:{...i},hasCollection:s,resourcePath:a,actions:p.map(v=>({...v}))};return r!==void 0&&(b.collectionPath=r),n!==void 0&&(b.isRoot=n),l!==void 0&&(b.parent={...l}),c!==void 0&&(b.exposeOptions={...c}),Array.isArray(u)&&(b.accessRule=u.map(v=>({...v}))),m!==void 0&&(b.rateLimiting={...m}),g!==void 0&&(b.truncated=g),f!==void 0&&(b.paginationContract=structuredClone(f)),b}constructor(e,t){this.api=e;let i=o.createSchema(t);this.kind=i.kind,this.key=i.key,this.entity=i.entity,this.hasCollection=i.hasCollection,this.collectionPath=i.collectionPath,this.resourcePath=i.resourcePath,this.isRoot=i.isRoot,this.parent=i.parent,this.exposeOptions=i.exposeOptions,this.actions=i.actions?i.actions.map(r=>Yr(this,r)):[],this.accessRule=i.accessRule?i.accessRule.map(r=>Mt(this,r)):[],i.rateLimiting&&(this.rateLimiting=new Ze(i.rateLimiting)),this.truncated=i.truncated,i.paginationContract&&(this.paginationContract=structuredClone(i.paginationContract))}toJSON(){let e={kind:this.kind,key:this.key,entity:{...this.entity},resourcePath:this.resourcePath,actions:this.actions.map(t=>t.toJSON()),hasCollection:this.hasCollection};return this.collectionPath!==void 0&&(e.collectionPath=this.collectionPath),this.isRoot!==void 0&&(e.isRoot=this.isRoot),this.parent!==void 0&&(e.parent={...this.parent}),this.exposeOptions!==void 0&&(e.exposeOptions={...this.exposeOptions}),Array.isArray(this.accessRule)&&this.accessRule.length>0&&(e.accessRule=this.accessRule.map(t=>t.toJSON())),this.rateLimiting!==void 0&&(e.rateLimiting=this.rateLimiting.toJSON()),this.truncated!==void 0&&(e.truncated=this.truncated),this.paginationContract&&(e.paginationContract=structuredClone(this.paginationContract)),e}setCollectionPath(e){if(!this.hasCollection)throw new h("Cannot set collection path on an exposure that does not have a collection",{code:"E_PATH_MISSING",help:"The exposed entity you are trying to set a collection path for does not have a collection."});let i=Tt(e).split("/").filter(Boolean);if(i.length!==1)throw new h(`Collection path must contain exactly one segment. Received: "${e}"`,{code:"E_PATH_SEGMENT_SIZE",help:"The set path must have a single path segment (e.g., `/products`)"});let r=`/${i[0]}`;if(this.isRoot&&this.api.findCollectionPathCollision(r,this.key))throw new h(`Collection path "${r}" is already in use by another root entity.`,{code:"E_PATH_INUSE",help:"The set path is already in use by another root entity."});let a="";if(this.resourcePath&&this.resourcePath!=="/"){let l=this.resourcePath.split("/").filter(Boolean)[1];l&&/^\{[A-Za-z_][A-Za-z0-9_]*\}$/.test(l)&&(a=l)}if(!a){let n=this.api.domain?.findEntity(this.entity.key,this.entity.domain);if(!n||!n.info.name)throw new h("Cannot generate a semantic parameter name because the associated entity or its name is missing.",{code:"E_ENTITY_NOT_FOUND",help:"Ensure the exposed entity points to a valid domain entity with a defined name."});a=`{${Bt(n.info.name)}}`}let s=`${r}/${a}`;this.#r(s),this.collectionPath=r,this.resourcePath=s}setResourcePath(e){let t=Tt(e),i=t.split("/").filter(Boolean);if(this.hasCollection){if(!this.collectionPath)throw new h("Cannot set resource path: missing collection path for this exposure",{code:"E_PATH_MISSING",help:"Set the collection path on the exposed entity first."});let r=this.collectionPath.split("/").filter(Boolean);if(r.length!==1)throw new h(`Invalid stored collection path "${this.collectionPath}"`,{code:"E_PATH_SEGMENT_SIZE",help:"The set collection path must have a single path segment (e.g., `/products`)"});if(i.length!==2)throw new h(`Resource path must be exactly two segments (collection + parameter). Received: "${t}"`,{code:"E_PATH_SEGMENT_SIZE",help:"The set resource path must have exactly two segments (collection + parameter)."});let[a,s]=i;if(a!==r[0])throw new h(`Resource path must start with the collection segment "${r[0]}". Received: "${a}"`,{code:"E_PATH_MISMATCH",help:"Set the resource path to the same value as the collection path + the parameter value."});if(!/^\{[A-Za-z_][A-Za-z0-9_]*\}$/.test(s))throw new h(`The second segment must be a parameter in braces, e.g. {id}. Received: "${s}"`,{code:"E_PARAMETER_INVALID",help:"Use the braces to surround the parameter name, e.g., {productId}."});this.resourcePath!==t&&(this.#r(`/${a}/${s}`),this.resourcePath=`/${a}/${s}`);return}if(i.length!==1)throw new h(`Resource path must contain exactly one segment when no collection is present. Received: "${t}"`,{code:"E_PATH_SEGMENT_SIZE",help:"The set resource path must have exactly one segment."});if(this.isRoot&&this.api.findResourcePathCollision(t,this.key))throw new h(`Resource path "${t}" is already in use by another root entity.`,{code:"E_PATH_INUSE",help:"The set path is already in use by another root entity."});this.resourcePath!==t&&(this.#r(`/${i[0]}`),this.resourcePath=`/${i[0]}`)}#e(e){let i=[...e.join("/").matchAll(/\{([^}]+)\}/g)].map(a=>a[1]),r=new Set;for(let a of i){if(r.has(a))throw new h(`Duplicate path parameter "{${a}}" detected in branch hierarchy.`,{code:"E_PATH_PARAM_COLLISION",help:"Change the parameter name in either this resource or its ancestor to ensure unique parameter names."});r.add(a)}}#t(e,t){for(let i of this.api.exposes.values())if(i.parent?.key===e){let r=[...t,i.resourcePath];this.#e(r),this.#t(i.key,r)}}#r(e){let t=[e],i=this.parent?.key;for(;i;){let r=this.api.exposes.get(i);if(!r)break;t.unshift(r.resourcePath),i=r.parent?.key}this.#e(t),this.#t(this.key,t)}getAbsoluteResourcePath(){let e=Tt(this.resourcePath),t=this.parent?.key;for(;t;){let i=this.api.exposes.get(t);if(!i)break;let r=Tt(i.resourcePath);e=Ta(r,e),t=i.parent?.key}return e}getAbsoluteCollectionPath(){if(!this.hasCollection||!this.collectionPath)return;let e=Tt(this.collectionPath),t=this.parent?.key;for(;t;){let i=this.api.exposes.get(t);if(!i)break;let r=Tt(i.resourcePath);e=Ta(r,e),t=i.parent?.key}return e}getAllRules(){let e=[];this.api.accessRule.forEach(i=>e.push(i));let t=this;for(;t;)t.accessRule&&e.push(...t.accessRule),t=t.parent?this.api.exposes.get(t.parent.key):void 0;return e}getAllRateLimiters(){let e=[];this.api.rateLimiting&&e.push(this.api.rateLimiting);let t=this;for(;t;)t.rateLimiting&&e.push(t.rateLimiting),t=t.parent?this.api.exposes.get(t.parent.key):void 0;return e}getAllRateLimiterRules(){let e=[];this.api.rateLimiting&&e.push(...this.api.rateLimiting.rules);let t=this;for(;t;)t.rateLimiting&&e.push(...t.rateLimiting.rules),t=t.parent?this.api.exposes.get(t.parent.key):void 0;return e}addAction(e){if(this.actions.some(i=>i.kind===e.kind))throw new h(`Action of kind "${e.kind}" already exists for this exposure`,{code:"E_ACTION_USED",help:"There's no need to add an API action again."});let t=Yr(this,e);return this.actions.push(t),t}addActionFromKind(e){if(this.actions.some(i=>i.kind===e))throw new h(`Action of kind "${e}" already exists for this exposure`,{code:"E_ACTION_USED",help:"There's no need to add an API action again."});let t=ss(this,e);return this.actions.push(t),t}createPaginationContract(){let e=this.api.domain?.findEntity(this.entity.key,this.entity.domain);if(!e)throw new h(`Entity "${this.entity.key}" not found"`,{code:"E_ENTITY_NOT_FOUND",help:"The set entity does not exist."});this.paginationContract?(this.paginationContract.filterableFields=[],this.paginationContract.searchableFields=[],this.paginationContract.sortableFields=[]):this.paginationContract={filterableFields:[],searchableFields:[],sortableFields:[]};for(let t of e.properties)t.index&&(this.paginationContract.filterableFields.push(t.key),this.paginationContract.sortableFields.push(t.key)),t.search&&this.paginationContract.searchableFields.push(t.key)}};var Si=(o={})=>{let e={...Er,...o};return o.metadata&&(e.metadata={...o.metadata}),{id:y.Currency,config:e}},Er={storageFormat:"decimal",defaultCurrency:"USD",decimalPlaces:2,allowNegative:!1,validateCurrencyCode:!0},wS={USD_DECIMAL:Si({storageFormat:"decimal",defaultCurrency:"USD",decimalPlaces:2,allowNegative:!1}),USD_CENTS:Si({storageFormat:"integer_cents",defaultCurrency:"USD",decimalPlaces:2,allowNegative:!1}),MULTI_CURRENCY:Si({storageFormat:"complex_object",allowedCurrencies:["USD","EUR","GBP","JPY","CAD"],decimalPlaces:2,allowNegative:!1}),WITH_NEGATIVES:Si({storageFormat:"decimal",defaultCurrency:"USD",decimalPlaces:2,allowNegative:!0}),HIGH_PRECISION:Si({storageFormat:"decimal",defaultCurrency:"BTC",decimalPlaces:8,allowNegative:!1})};var _n={requireVerification:!0,allowSubaddressing:!0,allowInternational:!0};var An={requireCountryCode:!0,format:"international",allowExtension:!1,requireVerification:!1,verificationMethod:"sms"};function Sc(o){let e=o.type,i=o.readWebBinding()?.format,r=o.multiple,a;if(e==="string"){let s=o.schema?.maximum;if(o.schema?.defaultValue?.type==="function"&&o.schema.defaultValue.value==="random"){let n=o.schema.defaultValue.config;if(n){let l=0,c=!1;n.isFixed?n.length&&(l=n.length,c=!0):s&&(l=s,c=!0),c&&(n.prefix&&(l+=n.prefix.length),n.suffix&&(l+=n.suffix.length),(!s||l>s)&&(s=l))}}a=s?`VARCHAR(${s})`:"TEXT"}else if(e==="number"){let s=o.schema?.defaultValue?.type==="function"&&o.schema.defaultValue.value==="incremental";i==="int32"?a="INTEGER":i==="int64"?a="BIGINT":i==="float"||i==="double"?a="DOUBLE PRECISION":s?a="BIGINT":a="NUMERIC"}else e==="boolean"?a="BOOLEAN":e==="date"?a="DATE":e==="datetime"?a="TIMESTAMPTZ":e==="time"?a="TIME":e==="binary"?a="JSONB":a="TEXT";return r?`${a}[]`:a}function xn(o){let e=o.getExposedName();if(!e)throw new h("Property missing a name definition.",{code:"E_PROPERTY_NAME_MISSING",status:500});let t=null;if(o.schema?.defaultValue){let u=o.schema.defaultValue.type,m=String(o.schema.defaultValue.value);if(u==="function"){let g=o.type;if(g==="string"){if(m==="uuid-v4"&&o.primary)throw new h("Function 'uuid-v4' cannot be used as a default for a primary key string.",{code:"E_INVALID_DEFAULT_FUNCTION",status:400});if(m!=="random"&&m!=="uuid-v4")throw new h(`Function '${m}' is not supported for string properties.`,{code:"E_INVALID_DEFAULT_FUNCTION",status:400})}else if(g==="number"){if(m!=="incremental")throw new h(`Function '${m}' is not supported for number properties.`,{code:"E_INVALID_DEFAULT_FUNCTION",status:400})}else if(["date","time","datetime"].includes(g)){if(m!=="now")throw new h(`Function '${m}' is not supported for ${g} properties.`,{code:"E_INVALID_DEFAULT_FUNCTION",status:400})}else throw new h(`Functions are not supported as default values for ${g} properties.`,{code:"E_INVALID_DEFAULT_FUNCTION",status:400})}t={type:u,value:m}}let i=!!o.primary,r=!o.required&&!i,a=!!o.unique;!t&&o.hasSemantic(y.DeletedFlag)&&(t={type:"literal",value:"false"});let s=o.getSemantic(y.Currency);if(s){let u=s.config??{},m=u.storageFormat||Er.storageFormat;if(m==="complex_object")return[{name:e,dataType:"JSONB",isNullable:r,isPrimary:i,isUnique:a,defaultRule:null}];if(m==="decimal"||m==="integer_cents"){let g=u.decimalPlaces??Er.decimalPlaces,f=m==="decimal"?`NUMERIC(19, ${g})`:"BIGINT";return[{name:`${e}_amount`,dataType:f,isNullable:r,isPrimary:i,isUnique:a,defaultRule:t},{name:`${e}_currency`,dataType:"CHAR(3)",isNullable:r,isPrimary:!1,isUnique:!1,defaultRule:{type:"literal",value:u.defaultCurrency||"USD"}}]}}let n=[{name:e,dataType:Sc(o),isNullable:r,isPrimary:i,isUnique:a,defaultRule:t}],l=!1,c=o.getSemantic(y.Email);c&&(l=(c.config??_n).requireVerification!==!1);let p=o.getSemantic(y.Phone);return p&&(l=(p.config??An).requireVerification===!0),l&&n.push({name:`_${e}_verified`,dataType:"BOOLEAN",isNullable:!1,isPrimary:!1,isUnique:!1,defaultRule:{type:"literal",value:"false"}},{name:`_${e}_token`,dataType:"VARCHAR(255)",isNullable:!0,isPrimary:!1,isUnique:!1,defaultRule:null},{name:`_${e}_expires_at`,dataType:"TIMESTAMPTZ",isNullable:!0,isPrimary:!1,isUnique:!1,defaultRule:null}),n}function _c(o){let e=o.toUpperCase().split("(")[0];return e==="CHARACTER VARYING"&&(e="VARCHAR"),e==="CHARACTER"&&(e="CHAR"),e}function Ac(o,e){let t=e.toUpperCase(),i=_c(o.dataType),r=t.split("(")[0];if(i===r){if(i==="VARCHAR"){let s=o.dataType.match(/\((\d+)\)/),n=s?Number.parseInt(s[1],10):null,l=t.match(/\((\d+)\)/),c=l?Number.parseInt(l[1],10):null;return!!(!c||n&&c>=n)}return!0}return{INTEGER:["BIGINT","NUMERIC","VARCHAR","TEXT"],BIGINT:["NUMERIC","VARCHAR","TEXT"],DATE:["TIMESTAMPTZ"],BOOLEAN:["VARCHAR","TEXT"]}[i]?.includes(r)||!1}function En(o,e){let t=o.domain,i={hasUpdate:!1,canProceed:!0,breakingChanges:[],exposedEntitiesToRemove:[],subEndpointsToRemove:[],userModelRemapping:[],sessionPropertiesToRemove:[],accessRulesWithMismatches:[]};if(!t)return i.hasUpdate=!0,i;if(t.key===e.key&&t.info.version===e.info.version)return i;i.hasUpdate=!0;let r=new Map;for(let f of t.listEntities())r.set(f.key,f);let a=new Map;for(let f of e.listEntities())a.set(f.key,f);let s=new Set;for(let[f,b]of o.exposes.entries()){let v=r.has(b.entity.key),S=a.get(b.entity.key);if(!S){let E=r.get(b.entity.key)?.info.getLabel()||b.entity.key;i.exposedEntitiesToRemove.push({key:f,entityKey:b.entity.key,name:b.entity.key,reason:`Entity ${E} no longer exists in the domain.`}),s.add(f);continue}if(v){let E=r.get(b.entity.key),V=new Map;for(let L of E.withInheritedProperties())try{let P=L.getExposedName();P&&V.set(P,L)}catch{}let U=new Map;for(let L of S.withInheritedProperties())try{let P=L.getExposedName();P&&U.set(P,L)}catch{}for(let[L,P]of V.entries()){let le=U.get(L);if(!le)continue;let F=xn(P),ce=xn(le);for(let me of F){let fe=ce.find(Ae=>Ae.name===me.name);if(!fe)continue;if(me.isPrimary&&!fe.isPrimary){i.canProceed=!1;let Ae=E.info.getLabel(),rt=`Cannot remove Primary Key constraint from column '${me.name}' in entity '${Ae}'.`;i.breakingChanges.push({type:"primary_key_removed",entityKey:E.key,propertyKey:P.key,reason:rt})}if(!Ac(me,fe.dataType)){i.canProceed=!1;let Ae=E.info.getLabel(),rt=`Cannot safely cast column '${me.name}' in entity '${Ae}' from ${me.dataType} to ${fe.dataType}.`;i.breakingChanges.push({type:"type_change_unsafe",entityKey:E.key,propertyKey:P.key,reason:rt})}let Ge=me.isNullable&&!fe.isNullable,gt=!!fe.defaultRule;if(Ge&&!gt){i.canProceed=!1;let Ae=E.info.getLabel(),rt=`Cannot make column '${me.name}' in entity '${Ae}' required without providing a default value to backfill existing records.`;i.breakingChanges.push({type:"column_not_null_missing_default",entityKey:E.key,propertyKey:P.key,reason:rt})}}}}}let n=!0;for(;n;){n=!1;for(let[f,b]of o.exposes.entries())if(!s.has(f)&&b.parent){let v=o.exposes.get(b.parent.key),S=r.get(v.entity.key),E=S?.info.getLabel()||v.entity.key;if(s.has(b.parent.key)){i.subEndpointsToRemove.push({key:f,parentKey:b.parent.key,associationKey:b.parent.association.key,name:b.entity.key,reason:`Parent exposure for entity ${E} is scheduled for removal.`}),s.add(f),n=!0;continue}let V=a.get(v.entity.key);if(!V){i.subEndpointsToRemove.push({key:f,parentKey:b.parent.key,associationKey:b.parent.association.key,name:b.entity.key,reason:`Parent entity ${E} is scheduled for removal.`}),s.add(f),n=!0;continue}let U=Array.from(V.withInheritedAssociations()).find(F=>F.key===b.parent?.association.key),L=S?Array.from(S.withInheritedAssociations()).find(F=>F.key===b.parent?.association.key):void 0,P=U?.info.getLabel()||L?.info.getLabel()||b.parent?.association.key;if(!U){i.subEndpointsToRemove.push({key:f,parentKey:b.parent.key,associationKey:b.parent.association.key,name:b.entity.key,reason:`Parent association ${P} is missing in the new domain.`}),s.add(f),n=!0;continue}if(!U.targets.some(F=>F.key===b.entity.key&&(!F.domain||F.domain===e.key))){let ce=(r.get(b.entity.key)||a.get(b.entity.key))?.info.getLabel()||b.entity.key;i.subEndpointsToRemove.push({key:f,parentKey:b.parent.key,associationKey:b.parent.association.key,name:b.entity.key,reason:`Target entity ${ce} is no longer a valid target for the parent association ${P}.`}),s.add(f),n=!0;continue}}}let l,c;if(o.user&&(l=r.get(o.user.key),c=a.get(o.user.key),!c)){i.canProceed=!1;let b=`User entity '${l?.info.getLabel()||o.user.key}' no longer exists in the new domain version.`;i.breakingChanges.push({type:"user_entity_missing",entityKey:o.user.key,propertyKey:"",reason:b})}if(o.user&&c&&l){let f=Array.from(l.withInheritedProperties()),b=Array.from(c.withInheritedProperties());if(o.session?.properties)for(let v of o.session.properties){let S=f.find(U=>U.key===v.key);if(!S){i.sessionPropertiesToRemove.push(v.key);continue}let E;try{E=S.getExposedName()}catch{}if(!E){i.sessionPropertiesToRemove.push(v.key);continue}let V=b.find(U=>{try{return U.getExposedName()===E}catch{return!1}});V?V.key!==S.key&&i.userModelRemapping.push({oldPropertyKey:S.key,newPropertyKey:V.key,exposedName:E,reason:`Property ${S.info.getLabel(S.key)} has been renamed to ${V.info.getLabel(V.key)}.`}):i.sessionPropertiesToRemove.push(v.key)}}let p;c&&(p=Array.from(c.withInheritedProperties()).find(f=>f.hasSemantic(y.UserRole)));let u=p?.schema?.enum,m=(f,b)=>{if(f.type==="matchUserRole"){let v=f;if(!p)i.accessRulesWithMismatches.push({ruleType:"matchUserRole",location:b,reason:"No role field configured on the new user model."});else if(u&&Array.isArray(u))for(let S of v.role)u.includes(S)||i.accessRulesWithMismatches.push({ruleType:"matchUserRole",location:b,reason:`Role '${S}' is no longer a valid role in the new user model.`})}},g=(f,b,v)=>{if(f.type==="matchResourceAttribute"){let S=f;if(!v)return;let E=a.get(v);if(!E)return;let V=Array.from(E.withInheritedProperties());if(!V.some(L=>L.key===S.attribute)){let L=r.get(v),P=S.attribute,le=!1;if(L){let F=Array.from(L.withInheritedProperties()).find(ce=>ce.key===S.attribute);if(F){P=F.info.getLabel(F.key);let ce;try{ce=F.getExposedName()}catch{}ce&&V.find(fe=>{try{return fe.getExposedName()===ce}catch{return!1}})&&(le=!0)}}if(!le){let F=E.info.getLabel();i.accessRulesWithMismatches.push({ruleType:"matchResourceAttribute",location:b,reason:`Property attribute '${P}' no longer exists on entity '${F}'.`})}}}};if(o.accessRule)for(let f of o.accessRule)m(f,{type:"api",key:o.key});for(let[f,b]of o.exposes.entries())if(!s.has(f)){if(b.accessRule)for(let v of b.accessRule)m(v,{type:"exposure",key:f}),g(v,{type:"exposure",key:f},b.entity.key);if(b.actions){for(let v of b.actions)if(v.accessRule)for(let S of v.accessRule)m(S,{type:"action",key:`${f}:${v.kind}`}),g(S,{type:"action",key:`${f}:${v.kind}`},b.entity.key)}}return i}function Nn(o,e,t){if(!t.canProceed)throw new h("Cannot apply domain update because it contains breaking changes. Details in the report.",{code:"E_CANNOT_PROCEED_WITH_UPGRADE",status:400});let i=o.domain;o.dependencies.clear(),o.dependencies.set(e.key,e),o.dependencyList=[{key:e.key,version:e.info.version}];let r=[...t.exposedEntitiesToRemove,...t.subEndpointsToRemove];for(let c of r)o.exposes.delete(c.key);if(o.user&&o.session){let c=new Set(t.sessionPropertiesToRemove),p=new Map;for(let u of t.userModelRemapping)p.set(u.oldPropertyKey,u.newPropertyKey);if(o.session.properties){let u=[];for(let m of o.session.properties){if(c.has(m.key))continue;let g=p.get(m.key);g?u.push({...m,key:g}):u.push(m)}o.session.properties=u}}let a=new Map;for(let c of e.listEntities())a.set(c.key,c);let s;if(o.user){let c=a.get(o.user.key);c&&(s=Array.from(c.withInheritedProperties()).find(p=>p.hasSemantic(y.UserRole)))}let n=s?.schema?.enum,l=(c,p)=>{let u=[];for(let m of c)if(m.type==="matchUserRole"){let g=m;if(!s)continue;if(n&&Array.isArray(n)){let f=g.role.filter(b=>n.includes(b));if(f.length===0)continue;g.role=f}u.push(m)}else if(m.type==="matchResourceAttribute"&&p){let g=m,f=a.get(p);if(!f)continue;let b=Array.from(f.withInheritedProperties());if(b.some(S=>S.key===g.attribute))u.push(m);else{let S,E=i?.findEntity(p);if(E){let U=Array.from(E.withInheritedProperties()).find(L=>L.key===g.attribute);if(U){let L;try{L=U.getExposedName()}catch{}L&&(S=b.find(P=>{try{return P.getExposedName()===L}catch{return!1}}))}}if(S)g.attribute=S.key,u.push(m);else continue}}else u.push(m);return u};o.accessRule&&(o.accessRule=l(o.accessRule));for(let c of o.exposes.values()){if(c.accessRule&&(c.accessRule=l(c.accessRule,c.entity.key)),c.actions)for(let p of c.actions)p.accessRule&&(p.accessRule=l(p.accessRule,c.entity.key));if(c.paginationContract){let p=c.paginationContract,u=c.entity.key,m=a.get(u);if(m){let g=Array.from(m.withInheritedProperties()),f=new Set(g.map(S=>S.key)),b=i?.findEntity(u),v=S=>{if(f.has(S))return S;if(b){let E=Array.from(b.withInheritedProperties()).find(V=>V.key===S);if(E){let V;try{V=E.getExposedName()}catch{}if(V){let U=g.find(L=>{try{return L.getExposedName()===V}catch{return!1}});if(U)return U.key}}}return null};p.filterableFields&&(p.filterableFields=p.filterableFields.map(v).filter(S=>S!==null)),p.sortableFields&&(p.sortableFields=p.sortableFields.map(v).filter(S=>S!==null)),p.searchableFields&&(p.searchableFields=p.searchableFields.map(v).filter(S=>S!==null))}}}o.notifyChange()}var _i=class o extends Gt{kind;key;info;user;authentication;authorization;session;exposes;accessRule;rateLimiting;termsOfService;contact;license;pagination;#e=!0;#t=!1;get domain(){if(this.dependencyList.length===0)return;let e=this.dependencyList[0];return this.dependencies.get(e.key)}static createSchema(e={}){let{key:t=R(),exposes:i=[],pagination:r}=e,a=W.fromJSON(e.info,{name:"Unnamed API"}).toJSON(),s={kind:be,key:t,info:a,exposes:i,pagination:r?structuredClone(r):{kind:"cursor"}};return e.user&&(s.user=structuredClone(e.user)),e.dependencyList&&(s.dependencyList=structuredClone(e.dependencyList)),e.authentication&&(s.authentication=structuredClone(e.authentication)),e.authorization&&(s.authorization=structuredClone(e.authorization)),e.session&&(s.session=structuredClone(e.session)),Array.isArray(e.accessRule)&&(s.accessRule=structuredClone(e.accessRule)),e.rateLimiting&&(s.rateLimiting=structuredClone(e.rateLimiting)),e.termsOfService&&(s.termsOfService=e.termsOfService),e.contact&&(s.contact=structuredClone(e.contact)),e.license&&(s.license=structuredClone(e.license)),s}constructor(e,t){let i=o.createSchema(e),r=[];if(t instanceof qe)t.readOnly?r.push(t):(console.warn(`Domain ${t.key} is not read only, cloning it. This may have performance implications.`),r.push(t.clone({readOnly:!0})));else if(typeof t=="object"&&t.kind===He)r.push(new qe(t,void 0,{readOnly:!0}));else if(t)throw new h("Invalid domain provided. Expected a DataDomain instance or schema.",{code:"E_DOMAIN_INVALID",help:"It looks like the provided data domain is not a valid instance or domain schema."});if(t){if(!t.info.version)throw new h(`Domain ${t.key} must have a version.`,{code:"E_DOMAIN_NO_VERSION",help:"Before attaching the data domain, give it a version name. Only versioned domains can be attached to an API model."});i.dependencyList=[{key:t.key,version:t.info.version}]}super(i.dependencyList,r),this.kind=i.kind,this.key=i.key,this.info=new W(i.info),this.user=i.user,this.pagination=i.pagination?structuredClone(i.pagination):{kind:"cursor"},i.authentication&&(this.authentication=structuredClone(i.authentication)),i.authorization&&(this.authorization=structuredClone(i.authorization)),i.session&&(this.session=structuredClone(i.session)),Array.isArray(i.exposes)?this.exposes=new Map(i.exposes.map(a=>[a.key,new Ct(this,a)])):this.exposes=new Map,Array.isArray(i.accessRule)?this.accessRule=i.accessRule.map(a=>Mt(this,a)):this.accessRule=[],i.rateLimiting&&(this.rateLimiting=new Ze(i.rateLimiting)),i.termsOfService&&(this.termsOfService=i.termsOfService),i.contact&&(this.contact=i.contact),i.license&&(this.license=i.license),this.#e=!1}toJSON(){let e={kind:this.kind,key:this.key,info:this.info.toJSON(),exposes:Array.from(this.exposes.values()).map(t=>t.toJSON()),pagination:structuredClone(this.pagination)};return this.user&&(e.user={...this.user}),this.dependencyList.length>0&&(e.dependencyList=structuredClone(this.dependencyList)),this.authentication&&(e.authentication=structuredClone(this.authentication)),this.authorization&&(e.authorization=structuredClone(this.authorization)),this.session&&(e.session=structuredClone(this.session)),Array.isArray(this.accessRule)&&this.accessRule.length>0&&(e.accessRule=this.accessRule.map(t=>t.toJSON())),this.rateLimiting&&(e.rateLimiting=this.rateLimiting.toJSON()),this.termsOfService&&(e.termsOfService=this.termsOfService),this.contact&&(e.contact=structuredClone(this.contact)),this.license&&(e.license=structuredClone(this.license)),e}notifyChange(){this.#t||this.#e||(this.#t=!0,queueMicrotask(()=>{this.#t=!1;let e=new Event("change");this.dispatchEvent(e)}))}exposeEntity(e,t){let i=this.domain;if(!i)throw new h("No domain attached to API model",{code:"E_NO_DOMAIN",help:"Attach a data domain to the API model before exposing entities."});let r=$t(e),a;for(let v of this.exposes.values())if(v.isRoot&&$t(v.entity)===r){a=v;break}if(a)throw new h(`Entity ${e.key} is already exposed.`,{code:"E_ENTITY_ALREADY_EXPOSED",help:"Do not try to expose already exposed entity."});let s=i.findEntity(e.key,e.domain);if(!s)throw new h(`Entity not found in domain: ${e.key}`,{code:"E_NO_ENTITY",help:"Make sure the entity you are trying to expose exists in the data domain."});let n=s.info.name||"",l=xr(n.toLocaleLowerCase()),c=Bt(n),p=`/${l}`,u=`/${l}/{${c}}`,m=1,g=p;for(;this.findCollectionPathCollision(p);)p=`${g}-${m}`,u=`${p}/{${c}}`,m++;let f={kind:bt,key:R(),entity:{...e},actions:[],isRoot:!0,collectionPath:p,resourcePath:u,hasCollection:!0};t&&(f.exposeOptions={...t});let b=new Ct(this,f);return this.exposes.set(b.key,b),t?.followAssociations&&(t?.maxDepth===void 0||t.maxDepth>0)&&this.followEntityAssociations(f,t),b}followEntityAssociations(e,t){let i=this.domain;if(!i)throw new h("No domain attached to API model",{code:"E_NO_DOMAIN"});let r=t.maxDepth??6,a=(n,l,c,p)=>{let u=i.findEntity(n.key,n.domain);if(u)for(let m of u.listAssociations())for(let g of m.targets){if(g.key===n.key&&g.domain===n.domain)continue;let f=$t(g);if(p.includes(f))continue;let b=$t(g),v;for(let me of this.exposes.values())if($t(me.entity)===b){v=me;break}if(v){if(!v.isRoot){let me=i.findEntity(g.key,g.domain);if(me){let fe=me.info.name||"",Ge=xr(fe.toLocaleLowerCase()),gt=Bt(fe),Ae=`/${Ge}`,rt=`/${Ge}/{${gt}}`,Va=1,Rn=Ae;for(;this.findCollectionPathCollision(Ae);)Ae=`${Rn}-${Va}`,rt=`${Ae}/{${gt}}`,Va++;v.isRoot=!0,v.parent=void 0,v.hasCollection=!0,v.collectionPath=Ae,v.setResourcePath(rt)}}continue}let S=i.findEntity(g.key,g.domain);if(!S)continue;let E=m.info.name||"",V=xr(E.toLocaleLowerCase()),U=m.multiple!==!1,L=Bt(S.info.name||""),P=U?`/${V}`:void 0,le=U?`/${V}/{${L}}`:`/${V}`,F={kind:bt,key:R(),entity:{...g},actions:[],isRoot:!1,collectionPath:P,resourcePath:"",hasCollection:U,parent:{key:l,association:{key:m.key,domain:n.domain},depth:c+1}},ce=new Ct(this,F);ce.setResourcePath(le),this.exposes.set(ce.key,ce),c+1>=r?F.truncated=!0:a(g,F.key,c+1,[...p,f])}},s=$t(e.entity);a(e.entity,e.key,0,[s])}removeExposedEntity(e){if(!this.exposes.has(e))throw new h(`Exposed entity with key "${e}" not found.`,{code:"E_NO_EXPOSURE",help:"The exposed entity you are trying to remove does not exist."});this.removeWithChildren(e)}removeWithChildren(e){if(!this.exposes.has(e))return;this.exposes.delete(e);let t=i=>{for(let r of this.exposes.values())r.parent?.key===i&&(t(r.key),this.exposes.delete(r.key))};t(e)}cleanForDomainChange(){this.dependencies.clear(),this.dependencyList=[],this.exposes=new Map,this.user=void 0,this.session&&(this.session.properties=[])}attachDataDomain(e){if(!e.info.version)throw new h("Cannot attach DataDomain without a version. Please set the version in the domain info.",{code:"E_DOMAIN_NO_VERSION",help:"Before attaching the data domain, give it a version name. Only versioned domains can be attached to an API model."});this.cleanForDomainChange(),this.dependencies.set(e.key,e),this.dependencyList=[{key:e.key,version:e.info.version}];for(let t of e.listEntities())if(t.hasSemantic(y.User)){this.user={key:t.key};break}}findResourcePathCollision(e,t){for(let i of this.exposes.values())if(!(t&&i.key===t)&&i.isRoot&&i.resourcePath===e)return i}findCollectionPathCollision(e,t){for(let i of this.exposes.values())if(!(t&&i.key===t)&&i.isRoot&&i.hasCollection&&i.collectionPath===e)return i}hasDomainUpdate(e){let t=this.domain;return t?t.key!==e.key||t.info.version!==e.info.version:!0}analyzeDomainUpdate(e){return En(this,e)}applyDomainUpdate(e,t){Nn(this,e,t)}};function O(o,e){return`${o}_${e}`}function Ca(o){let e=[],t={apiModelKey:o.key,kind:be,key:o.key};return o.kind!==be&&e.push({code:O("API","INVALID_KIND"),message:"The API model type is incorrect.",suggestion:'Set the model type to "ApiModel".',severity:"error",context:{...t,property:"kind"}}),(!o.key||typeof o.key!="string"||o.key.trim()==="")&&e.push({code:O("API","MISSING_KEY"),message:"The API model is missing a unique identifier.",suggestion:"Provide a valid name to use as a unique identifier.",severity:"error",context:{...t,property:"key"}}),(!o.info||!o.info.name||o.info.name.trim()==="")&&e.push({code:O("API","MISSING_NAME"),message:"The API model has no defined name.",suggestion:"Provide a descriptive name for your API.",severity:"error",context:{...t,property:"info.name"}}),(!o.info||!o.info.description||o.info.description.trim()==="")&&e.push({code:O("API","MISSING_DESCRIPTION"),message:"Adding a description helps others understand your API.",suggestion:"Add a description to clarify the purpose of this API.",severity:"warning",context:{...t,property:"info.description"}}),e}function Oa(o){let e=[],t={apiModelKey:o.key,kind:be,key:o.key},i=o.domain;return i?((!i.info||!i.info.version)&&e.push({code:O("API","MISSING_DOMAIN_VERSION"),message:"The selected Data Domain is missing a version number.",suggestion:"Specify a version for the attached Data Domain.",severity:"error",context:t}),e):(e.push({code:O("API","MISSING_DOMAIN"),message:"No Data Domain is attached to the API.",suggestion:"Select a Data Domain from the settings to power your API.",severity:"error",context:t}),e)}function Ra(o){let e=[],t={apiModelKey:o.key,kind:be,key:o.key},i=o.domain&&o.user?o.domain.findEntity(o.user.key,o.user.domain):void 0;if(!o.authentication)e.push({code:O("API","MISSING_AUTHENTICATION"),message:"The API is missing authentication settings.",suggestion:"Go to the security settings and configure how users authenticate.",severity:"error",context:{...t,property:"authentication"}});else if(o.authentication.strategy==="UsernamePassword"&&i){let r;for(let s of i.properties)if(s.hasSemantic(y.Password)){r=s;break}r||e.push({code:O("API","MISSING_PASSWORD_SEMANTIC"),message:"The selected user model requires a property with the Password data semantic for authentication.",suggestion:'Go to the Data Modeler and add the "Password" semantic to the password property.',severity:"error",context:{...t,property:"user"}});let a;for(let s of i.properties)if(s.hasSemantic(y.Username)){a=s;break}a||e.push({code:O("API","MISSING_USERNAME_SEMANTIC"),message:"Username & Password authentication requires a field with the Username data semantic.",suggestion:'Go to the Data Modeler and add the "Username" semantic to the property used for login.',severity:"error",context:{...t,property:"user"}})}if(!o.authorization)e.push({code:O("API","MISSING_AUTHORIZATION"),message:"The API is missing authorization settings.",suggestion:"Go to the security settings and configure how to handle user permissions.",severity:"error",context:{...t,property:"authorization"}});else if(o.authorization.strategy==="RBAC"&&i){let r;for(let a of i.properties)if(a.hasSemantic(y.UserRole)){r=a;break}r||e.push({code:O("API","MISSING_ROLE_SEMANTIC"),message:"Role-based access control requires a property with the User Role data semantic on the user model.",suggestion:'Go to the Data Modeler and add the "User Role" semantic to the property used for roles.',severity:"error",context:{...t,property:"user"}})}if(!o.session)e.push({code:O("API","MISSING_SESSION"),message:"The API is missing session configuration.",suggestion:"Configure how user sessions will be handled.",severity:"error",context:{...t,property:"session"}});else{if(o.session.secret||e.push({code:O("API","MISSING_SESSION_SECRET"),message:"A secure encryption key is required for sessions.",suggestion:"Provide a strong security key in the session settings.",severity:"error",context:{...t,property:"session.secret"}}),!o.session.properties||o.session.properties.length===0)e.push({code:O("API","MISSING_SESSION_PROPERTIES"),message:"The session token needs to include at least one piece of user information, like an ID.",suggestion:"Select fields that should be stored securely inside the session payload.",severity:"error",context:{...t,property:"session.properties"}});else if(o.authorization&&o.authorization.strategy==="RBAC"&&i){let s;for(let n of i.properties)if(n.hasSemantic(y.UserRole)){s=n;break}s&&!o.session.properties.find(n=>n.key===s?.key)&&e.push({code:O("API","MISSING_RBAC_SESSION_PROPERTY"),message:"The user role must be included in the session data for permissions to work.",suggestion:"Make sure your selected role property is checked in the session settings.",severity:"error",context:{...t,property:"session.properties"}})}let{cookie:r,jwt:a}=o.session;(!r||!r.enabled)&&(!a||!a.enabled)&&e.push({code:O("API","MISSING_SESSION_TRANSPORT"),message:"No delivery method for sessions (like cookies or tokens) is enabled.",suggestion:"Enable at least one session delivery mechanism in the security settings.",severity:"error",context:{...t,property:"session"}})}return o.user?o.domain&&!o.domain.findEntity(o.user.key,o.user.domain)&&e.push({code:O("API","INVALID_USER_ENTITY"),message:"The selected user model no longer exists in your data domain.",suggestion:"Please navigate to security settings and select a valid user model.",severity:"error",context:{...t,property:"user"}}):e.push({code:O("API","MISSING_USER_ENTITY"),message:"You need to specify what kind of object represents your users.",suggestion:"Select a model from your domain that stores your user accounts.",severity:"error",context:{...t,property:"user"}}),e}function Pa(o){let e=[],t={apiModelKey:o.key,kind:be,key:o.key},i=/^https?:\/\//i,r=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return o.contact?(o.contact.email&&!r.test(o.contact.email)&&e.push({code:O("API","INVALID_CONTACT_EMAIL"),message:"The contact email address looks invalid.",suggestion:"Please double check the email address formatting.",severity:"error",context:{...t,property:"contact.email"}}),o.contact.url&&!i.test(o.contact.url)&&e.push({code:O("API","INVALID_CONTACT_URL"),message:"The contact link looks invalid.",suggestion:"Provide a working link, starting with http:// or https://.",severity:"error",context:{...t,property:"contact.url"}})):e.push({code:O("API","MISSING_CONTACT"),message:"A contact email or link is highly recommended for API consumers.",suggestion:"Add an email or help desk link in the metadata tab.",severity:"info",context:{...t,property:"contact"}}),o.license?o.license.url&&!i.test(o.license.url)&&e.push({code:O("API","INVALID_LICENSE_URL"),message:"The license link looks invalid.",suggestion:"Provide a working link, starting with http:// or https://.",severity:"error",context:{...t,property:"license.url"}}):e.push({code:O("API","MISSING_LICENSE"),message:"Adding a license to your API helps users understand its usage rights.",suggestion:"Add the name and a link to your API license terms.",severity:"info",context:{...t,property:"license"}}),o.termsOfService||e.push({code:O("API","MISSING_TOS"),message:"Terms of Service help legal compliance.",suggestion:"Add a link to the terms of your API service.",severity:"info",context:{...t,property:"termsOfService"}}),e}function jn(o){let e=[],t={apiModelKey:o.key,kind:be,key:o.key},i=!1;for(let r of o.exposes.values())if(r.actions.some(a=>ot.isListAction(a)||lt.isSearchAction(a))){i=!0;break}return i&&(!o.pagination||!o.pagination.kind?e.push({code:O("API","MISSING_PAGINATION"),message:"The API must have a defined pagination strategy when it exposes List or Search actions.",suggestion:"Configure how results are loaded (e.g. by page or by a continuous cursor).",severity:"error",context:{...t,property:"pagination"}}):(o.pagination.defaultLimit===void 0&&e.push({code:O("API","MISSING_PAGINATION_DEFAULT_LIMIT"),message:"The API doesn't have a defined default page limit when it exposes List or Search actions.",suggestion:"Set a default page limit for the pagination otherwise the API will use its default limit.",severity:"info",context:{...t,property:"pagination.defaultLimit"}}),o.pagination.maxLimit===void 0&&e.push({code:O("API","MISSING_PAGINATION_MAX_LIMIT"),message:"The API doesn't have a defined page size max limit when it exposes List or Search actions.",suggestion:"Set a max page size limit for the pagination otherwise the API will use its default max limit.",severity:"info",context:{...t,property:"pagination.maxLimit"}}))),e}function xc(o,e,t){let i=[],r={apiModelKey:t,kind:"Action",key:o.kind,parentExposedEntityKey:e.key};return wt.isDeleteAction(o)&&(o.strategy?o.strategy==="hard"&&i.push({code:O("ACTION","DELETE_HARD_WARNING"),message:"Permanent delete is active. There will be no way to restore deleted data.",suggestion:'Consider switching to "soft delete" if users might need to undo mistakes.',severity:"info",context:{...r,property:"strategy"}}):i.push({code:O("ACTION","DELETE_MISSING_STRATEGY"),message:"A Delete action must know if you want to completely erase the record, or just hide it.",suggestion:"Configure the deletion type (permanent or soft).",severity:"error",context:{...r,property:"strategy"}})),vt.isUpdateAction(o)&&(!o.allowedMethods||o.allowedMethods.length===0)&&i.push({code:O("ACTION","UPDATE_MISSING_METHODS"),message:"An Update action must define how the data is sent (PUT replaces everything; PATCH applies partial changes).",suggestion:"Select at least one allowed HTTP method.",severity:"error",context:{...r,property:"allowedMethods"}}),o.getAllRateLimiters().some(n=>n.rules.length)||i.push({code:O("ACTION","MISSING_RATE_LIMITS"),message:"It is best practice to configure a rate limit so your API is not overwhelmed.",suggestion:"Set a reasonable maximum request speed for this operation.",severity:"warning",context:r}),i}function Da(o,e){let t=[],i={apiModelKey:e.key,kind:bt,key:o.key},r=o.entity?e.domain?.findEntity(o.entity.key,o.entity.domain):void 0,a=r?.info.getLabel()||r?.key||"unknown";if(!o.entity||!o.entity.key?t.push({code:O("EXPOSURE","MISSING_ENTITY_REF"),message:"This exposed endpoint does not point to a specific data model.",suggestion:"Select which database entity this endpoint should serve.",severity:"error",context:{...i,property:"entity"}}):r||t.push({code:O("EXPOSURE","INVALID_ENTITY_REF"),message:"This endpoint points to a data model that no longer exists.",suggestion:"Select a new valid database model or delete this endpoint.",severity:"error",context:{...i,property:"entity"}}),o.hasCollection){if(!o.collectionPath)t.push({code:O("EXPOSURE","MISSING_COLLECTION_PATH"),message:`[${a}]: When an endpoint exposes a collection, it must define what its base URL path is.`,suggestion:'Add a path (e.g., "/items").',severity:"error",context:{...i,property:"collectionPath"}});else{let n=o.collectionPath.split("/").filter(Boolean);(n.length!==1||!o.collectionPath.startsWith("/"))&&t.push({code:O("EXPOSURE","INVALID_COLLECTION_PATH"),message:`[${a}]: The collection URL should start with "/" and have no extra slashes.`,suggestion:`Ensure the path looks like exactly "/${n[0]||"subresource"}".`,severity:"error",context:{...i,property:"collectionPath"}})}o.resourcePath?o.collectionPath&&(new RegExp(`^${o.collectionPath}/\\{[a-zA-Z0-9_]+\\}$`).test(o.resourcePath)||t.push({code:O("EXPOSURE","INVALID_RESOURCE_PATH_FORMAT"),message:`[${a}]: The single item route should match exactly your collection path plus one identifier variable.`,suggestion:`Make sure the item path is formatted exactly like "${o.collectionPath}/{id}".`,severity:"error",context:{...i,property:"resourcePath"}})):t.push({code:O("EXPOSURE","MISSING_RESOURCE_PATH"),message:`[${a}]: You need an identifier to locate single items.`,suggestion:'Specify the identification parameter format, like "{id}".',severity:"error",context:{...i,property:"resourcePath"}})}else o.resourcePath?(o.resourcePath.split("/").filter(Boolean).length!==1||!o.resourcePath.startsWith("/"))&&t.push({code:O("EXPOSURE","INVALID_RESOURCE_PATH_FORMAT"),message:`[${a}]: The URL route ${o.resourcePath} must only contain one exact part or level.`,suggestion:"Simplify the endpoint URL to a single segment.",severity:"error",context:{...i,property:"resourcePath"}}):t.push({code:O("EXPOSURE","MISSING_RESOURCE_PATH"),message:`[${a}]: Exposed entity representing a single item must declare their URL route.`,suggestion:'Set the URL path (such as "/profile").',severity:"error",context:{...i,property:"resourcePath"}});o.isRoot&&(o.collectionPath&&e.findCollectionPathCollision(o.collectionPath,o.key)&&t.push({code:O("EXPOSURE","ROOT_COLLECTION_COLLISION"),message:`[${a}]: The route "${o.collectionPath}" is already used by another view.`,suggestion:"Give this resource a different path to avoid conflicts.",severity:"error",context:{...i,property:"collectionPath"}}),o.resourcePath&&e.findResourcePathCollision(o.resourcePath,o.key)&&t.push({code:O("EXPOSURE","ROOT_RESOURCE_COLLISION"),message:`[${a}]: The route "${o.resourcePath}" is already used by another one.`,suggestion:"Give this single-item resource a different path to avoid conflicts.",severity:"error",context:{...i,property:"resourcePath"}}));let s=o.getAbsoluteResourcePath();if(s){let n=[...s.matchAll(/\{([^}]+)\}/g)].map(c=>c[1]);if(new Set(n).size!==n.length){let p=n.filter((u,m)=>n.indexOf(u)!==m)[0];t.push({code:O("EXPOSURE","DUPLICATE_PATH_PARAMETER"),message:`[${a}]: The path parameter "{${p}}" is duplicated in the resource path hierarchy.`,suggestion:"Change the parameter name in either this resource or its ancestor to ensure unique parameter names.",severity:"error",context:{...i,property:"resourcePath"}})}}if(!o.actions||o.actions.length===0)t.push({code:O("EXPOSURE","MISSING_ACTIONS"),message:`[${a}]: This exposed entity does not let users do anything.`,suggestion:"Enable at least one operation like Create, Read, or Update.",severity:"error",context:{...i,property:"actions"}});else{let n=!1,l=!1;for(let c of o.actions){t.push(...xc(c,o,e.key)),lt.isSearchAction(c)&&(n=!0),ot.isListAction(c)&&(l=!0);let p=!1;c.accessRule&&c.accessRule.length>0&&(p=!0),!p&&o.accessRule&&o.accessRule.length>0&&(p=!0);let u=o.parent?.key;for(;u&&!p;){let m=e.exposes.get(u);if(m&&m.accessRule&&m.accessRule.length>0){p=!0;break}u=m?.parent?.key}!p&&e.accessRule&&e.accessRule.length>0&&(p=!0),p||t.push({code:O("ACTION","MISSING_ACCESS_RULES"),message:`[${a}]: The ${c.kind} action has no security rules attached, making it entirely inaccessible or open.`,suggestion:"Allow specific user roles to access this operation.",severity:"error",context:{...i,kind:"Action",key:c.kind,parentExposedEntityKey:o.key}})}if(l||n){let c=o.paginationContract;if(!c)t.push({code:O("EXPOSURE","MISSING_PAGINATION_CONTRACT"),message:`[${a}]: The List or Search action needs a pagination contract.`,suggestion:"Add a pagination contract to the exposed entity.",severity:"error",context:i});else if(l&&((!c.filterableFields||c.filterableFields.length===0)&&t.push({code:O("EXPOSURE","LIST_MISSING_FILTERS"),message:`[${a}]: Listing all elements without filters could be overwhelming for large tables.`,suggestion:"Select a few important fields to allow filtering.",severity:"warning",context:i}),(!c.sortableFields||c.sortableFields.length===0)&&t.push({code:O("EXPOSURE","LIST_MISSING_SORTING"),message:`[${a}]: Listing all elements without sorting could be overwhelming for large tables.`,suggestion:"Select a few important fields to allow sorting.",severity:"warning",context:i})),n){let p=[];Array.isArray(c.searchableFields)&&p.push(...c.searchableFields),Array.isArray(c.filterableFields)&&p.push(...c.filterableFields),p.length||t.push({code:O("EXPOSURE","SEARCH_MISSING_FIELDS"),message:`[${a}]: Search action needs to know which text fields to look in.`,suggestion:"Select a few important fields to allow searching or full-text search.",severity:"warning",context:i})}}}return t}var Nr=new Set(["IN","EXISTS","SELECT","FROM","WHERE","AND","OR","NOT","NULL","TRUE","FALSE","BETWEEN","LIKE","INTO","JOIN","INNER JOIN","LEFT JOIN","RIGHT JOIN","FULL JOIN","CROSS JOIN","UNION","INTERSECT","EXCEPT","ORDER BY","GROUP BY","HAVING","DISTINCT","LIMIT","OFFSET","INSERT","UPDATE","DELETE","CREATE","ALTER","DROP","TRUNCATE","RENAME","GRANT","REVOKE","COMMIT","ROLLBACK","SAVEPOINT","BEGIN","END","CASE","WHEN","THEN","ELSE","END CASE","EXCEPTION","RAISE","RETURN","FUNCTION","PROCEDURE"]);function jr(o){let e=[],t=o.info.getLabel(),i=o.getParentInstance(),r=o.kind===Z?"property":"association";if(!o.info.name){let s=`The "${t}" ${r} has no name.`,n=`The ${r} must have a name.`;return e.push({field:"name",rule:"required",message:s,help:n,severity:"error",key:o.key,kind:o.kind,parent:i.key}),e}let a=o.info.name;if(a.length<2){let s=`The "${t}" ${r} name is too short.`;e.push({field:"name",rule:"length",message:s,help:"The name must be at least 2 characters long.",severity:"error",key:o.key,kind:o.kind,parent:i.key})}if(a.length>59){let s=`The "${t}" ${r} name is too long.`;e.push({field:"name",rule:"length",message:s,help:"The name must be at most 59 characters long.",severity:"error",key:o.key,kind:o.kind,parent:i.key})}if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(a)){let s=`The "${t}" ${r} name is invalid.`;e.push({field:"name",rule:"format",message:s,help:"The name must start with a letter (a-z) or underscore (_). Subsequent characters can be letters, digits (0-9), or underscores (_).",severity:"error",key:o.key,kind:o.kind,parent:i.key})}if(/^[A-Z]/.test(a)){let s=`The "${t}" ${r} name is not in snake case.`;e.push({field:"name",rule:"snake_case",message:s,help:"The name should be in snake case (lowercase letters and underscores).",severity:"info",key:o.key,kind:o.kind,parent:i.key})}if(Nr.has(a.toUpperCase())){let s=`The "${t}" ${r} name is a reserved keyword.`;e.push({field:"name",rule:"reserved",message:s,help:"The name should not be a reserved keyword.",severity:"error",key:o.key,kind:o.kind,parent:i.key})}return e}var Ai=class{domain;constructor(e){this.domain=e}validate(e){let t=[],i;if(typeof e=="string"?i=this.domain.findAssociation(e):i=e,!i){let s=`The "${e}" association does not exist.`;return t.push({field:"*",rule:"exists",message:s,help:"The association must be defined in the domain.",key:e,kind:oe,severity:"error"}),t}let r=this.validateName(i);t.push(...r);let a=this.validateTargets(i);return t.push(...a),t}validateName(e){return jr(e)}validateTargets(e){let t=[],i=e.info.getLabel(),r=e.getParentInstance();if(!e.targets.length){let a=`The "${i}" association has no target.`;return t.push({field:"targets",rule:"required",message:a,help:"An association must have at least one target.",severity:"error",key:e.key,kind:e.kind,parent:r.key}),t}for(let a of e.targets)if(!this.domain.findEntity(a.key,a.domain)){let n=`The "${i}" association has an invalid target "${a.key}".`;t.push({field:"targets",rule:"exists",message:n,help:"The target must be defined in the domain.",severity:"error",key:e.key,kind:e.kind,parent:r.key})}return t}};var xi=class{domain;constructor(e){this.domain=e}validate(e){let t=[],i;if(typeof e=="string"?i=this.domain.findEntity(e):i=e,!i){let c=`The "${e}" entity does not exist.`;return t.push({field:"*",rule:"exists",message:c,help:"The entity must be defined in the domain.",key:e,kind:J,severity:"error"}),t}let r=this.validatePrimaryKey(i);t.push(...r);let a=this.minimumRequiredProperties(i);t.push(...a);let s=this.validateName(i);t.push(...s);let n=this.uniqueName(i);t.push(...n);let l=this.validateUserSemantics(i);return t.push(...l),t}validatePrimaryKey(e){let t=[];if(!e.primaryKey()){let r=`The "${e.info.getLabel()}" entity has no identifier.`;t.push({field:"properties",rule:"primary_key",message:r,help:"An entity that can exists by itself must have identifier defined.",severity:"error",key:e.key,kind:e.kind})}return t}hasPropertiesInherited(e){if(e.hasProperties())return!0;for(let t of e.listParents())if(this.hasPropertiesInherited(t))return!0;return!1}hasAssociationsInherited(e){if(e.hasAssociations())return!0;for(let t of e.listParents())if(this.hasAssociationsInherited(t))return!0;return!1}minimumRequiredProperties(e){let t=[],i=this.hasPropertiesInherited(e),r=this.hasAssociationsInherited(e);if(!i&&!r){let a=`The "${e.info.getLabel()}" entity has no properties. It will be ignored.`;t.push({field:"properties",rule:"required",message:a,help:"Entities that have no properties are ignored in the data domain. No schema will be generated for it.",severity:"warning",key:e.key,kind:e.kind})}return t}validateName(e){let t=[],i=e.info.getLabel();if(!e.info.name){let a=`The "${i}" entity has no name.`;return t.push({field:"name",rule:"required",message:a,help:"An entity must have a name.",severity:"error",key:e.key,kind:e.kind}),t}let r=e.info.name;if(r.length<2){let a=`The "${i}" entity name is too short.`;t.push({field:"name",rule:"length",message:a,help:"The name must be at least 2 characters long.",severity:"error",key:e.key,kind:e.kind})}if(r.length>31){let a=`The "${i}" entity name is too long.`;t.push({field:"name",rule:"length",message:a,help:"The name must be at most 31 characters long.",severity:"error",key:e.key,kind:e.kind})}if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r)){let a=`The "${i}" entity name is invalid.`;t.push({field:"name",rule:"format",message:a,help:"The name must start with a letter (a-z) or underscore (_). Subsequent characters can be letters, digits (0-9), or underscores (_).",severity:"error",key:e.key,kind:e.kind})}if(/^[A-Z]/.test(r)){let a=`The "${i}" entity name is not in snake case.`;t.push({field:"name",rule:"snake_case",message:a,help:"The name should be in snake case (lowercase letters and underscores).",severity:"info",key:e.key,kind:e.kind})}if(Nr.has(r.toUpperCase())){let a=`The "${i}" entity name is a reserved keyword.`;t.push({field:"name",rule:"reserved",message:a,help:"The name should not be a reserved keyword.",severity:"error",key:e.key,kind:e.kind})}return t}uniqueName(e){let t=[],i=e.info.name?.toLowerCase();if(!i)return t;for(let r of this.domain.listEntities())if(r.info.name?.toLowerCase()===i&&r.key!==e.key){let a=`The "${i}" entity name is already used in the data domain.`;t.push({field:"name",rule:"unique",message:a,help:"The name must be unique. This includes references to other data domains.",severity:"error",key:r.key,kind:r.kind})}for(let r of this.domain.listAllForeignEntities())if(r.info.name?.toLowerCase()===i&&r.key!==e.key){let a=`The "${i}" entity name is already used in the foreign data domain.`;t.push({field:"name",rule:"unique",message:a,help:"The name must be unique. This includes references to other data domains.",severity:"error",key:r.key,kind:r.kind,parent:r.domain.key})}return t}validateUserSemantics(e){let t=[],i=!1,r=!1;for(let a of e.withInheritedProperties())a.hasSemantic(y.Username)&&(i=!0),a.hasSemantic(y.Password)&&(r=!0);if((i||r)&&!e.hasSemantic(y.User)){let a=`The "${e.info.getLabel()}" entity has Username or Password properties but does not have the User taxonomy.`;t.push({field:"semantics",rule:"user_taxonomy_required",message:a,help:"Entities containing authentication credentials like usernames or passwords must be tagged with the User taxonomy.",severity:"error",key:e.key,kind:e.kind})}if(r&&!i){let a=`The "${e.info.getLabel()}" entity has Password credentials but lacks Username semantics.`;t.push({field:"semantics",rule:"username_required_for_password",message:a,help:"An entity with Password credentials must also define a Username property for authentication.",severity:"error",key:e.key,kind:e.kind})}return t}};var Ei=class{domain;constructor(e){this.domain=e}validate(e){let t=[],i;if(typeof e=="string"?i=this.domain.findProperty(e):i=e,!i){let s=`The "${e}" property does not exist.`;return t.push({field:"*",rule:"exists",message:s,help:"The property must be defined in the domain.",key:e,kind:Z,severity:"error"}),t}let r=this.validateName(i);t.push(...r);let a=this.validatePrimaryKeyDefault(i);return t.push(...a),t}validateName(e){return jr(e)}validatePrimaryKeyDefault(e){let t=[];if(e.primary){let i=e.schema?.defaultValue;if(i){if(i.type!=="function"||i.value!=="random"){let r=`The primary key property "${e.info.getLabel()}" has an invalid default value.`;t.push({field:"schema.defaultValue",rule:"primary_key_default",message:r,help:'Primary key properties can only have the "random" function as their default value.',severity:"error",key:e.key,kind:e.kind})}}else{let r=`The primary key property "${e.info.getLabel()}" has no default value.`;t.push({field:"schema.defaultValue",rule:"primary_key_no_default",message:r,help:'Without a default generator (e.g., the "random" function), the client application must generate and supply primary key values manually.',severity:"warning",key:e.key,kind:e.kind})}}return t}};var Ir=class{domain;constructor(e){this.domain=e}validate(){let e=[],t=this.validateUserEntity();e.push(...t);let i=this.validateTimestampSemantics();e.push(...i);let r=this.validateSoftDeleteSemantics();e.push(...r);let a=this.validatePropertySemanticsDataTypes();e.push(...a);let s=this.validateCurrencySemantics();e.push(...s);let n=this.validateGeospatialEndpoints();return e.push(...n),e}validateUserEntity(){let e=[],t=0;for(let i of this.domain.listEntities())if(i.hasSemantic(y.User)){t++;let r=!1,a=!1,s=!1;for(let n of i.withInheritedProperties())if(n.hasSemantic(y.Username)&&(r=!0),n.hasSemantic(y.Password)&&(a=!0),n.hasSemantic(y.UserRole)&&(s=!0),r&&a&&s)break;r||e.push({field:"semantics",rule:"has_username",message:"No username property on the User entity found.",help:'It is recommended to set the "username" property semantic for APIs supporting authentication.',severity:"warning",key:"user_semantic",kind:J}),a||e.push({field:"semantics",rule:"has_password",message:"No password property on the User entity found.",help:'It is recommended to set the "password" property semantic for APIs supporting authentication.',severity:"warning",key:"user_semantic",kind:J}),s||e.push({field:"semantics",rule:"has_user_role",message:"No role property on the User entity found.",help:'It is recommended to set the "User role" property semantic for APIs supporting authentication.',severity:"warning",key:"user_semantic",kind:J})}return t===0?e.push({field:"semantics",rule:"recommended",message:"No entity with User taxonomy found in the domain.",help:"It is recommended to have an entity with the User taxonomy for authentication purposes.",severity:"warning",key:"user_semantic",kind:J}):t>1&&e.push({field:"semantics",rule:"one_user",message:"There is more than one entity with User taxonomy in the domain.",help:"There can be only one user in the system. Remove the additional User taxonomies.",severity:"error",key:"user_semantic",kind:J}),e}validateTimestampSemantics(){let e=[];for(let t of this.domain.listEntities()){let i=!1,r=!1;for(let a of t.withInheritedProperties())a.hasSemantic(y.CreatedTimestamp)&&(i=!0),a.hasSemantic(y.UpdatedTimestamp)&&(r=!0);i||e.push({field:"semantics",rule:"recommended",message:`The "${t.info.getLabel()}" entity does not have a CreatedTimestamp taxonomy.`,help:"It is recommended to have a CreatedTimestamp property to track when the entity was created.",severity:"info",key:t.key,kind:t.kind}),r||e.push({field:"semantics",rule:"recommended",message:`The "${t.info.getLabel()}" entity does not have an UpdatedTimestamp taxonomy.`,help:"It is recommended to have an UpdatedTimestamp property to track when the entity was last modified.",severity:"info",key:t.key,kind:t.kind})}return e}validateSoftDeleteSemantics(){let e=[];for(let t of this.domain.listEntities()){let i=!1;for(let r of t.withInheritedProperties())if(r.hasSemantic(y.DeletedTimestamp)||r.hasSemantic(y.DeletedFlag)){i=!0;break}i||e.push({field:"semantics",rule:"recommended",message:`The "${t.info.getLabel()}" entity does not have soft delete taxonomy.`,help:"It is recommended to have either a DeletedTimestamp or DeletedFlag property for soft deletion.",severity:"info",key:t.key,kind:t.kind})}return e}validatePropertySemanticsDataTypes(){let e=[];for(let t of this.domain.listEntities())for(let i of t.withInheritedProperties())for(let r of i.semantics){let a=Ue[r.id];Wi(a)&&a.applicableDataTypes&&(a.applicableDataTypes.includes(i.type)||e.push({field:"semantics",rule:"type_mismatch",message:`The "${i.info.getLabel()}" property has the "${a.displayName}" semantic applied, but its type "${i.type}" is not compatible.`,help:`The "${a.displayName}" semantic can only be applied to properties of type(s): ${a.applicableDataTypes.join(", ")}.`,severity:"error",key:i.key,kind:i.kind,parent:t.key}))}return e}validateCurrencySemantics(){let e=[];for(let t of this.domain.listEntities())for(let i of t.withInheritedProperties()){let r=i.getSemantic(y.Currency);if(r){let a=r.config;i.type==="number"&&a?.allowedCurrencies&&a.allowedCurrencies.length>1&&e.push({field:"semantics",rule:"currency_number_multiple",message:`The "${i.info.getLabel()}" property has the Currency semantic and is a Number, but allows multiple currencies.`,help:"Number properties cannot accept currency codes. Please change the property type to String, or restrict allowedCurrencies to exactly one currency.",severity:"error",key:i.key,kind:i.kind,parent:t.key})}}return e}validateGeospatialEndpoints(){let e=[];for(let t of this.domain.listEntities()){let i=new Map;for(let r of t.withInheritedProperties()){let a=r.getSemantic(y.GeospatialCoordinates);if(a){let s=a.config??{},n=s.enableDistanceQueries!==!1,l=s.enableBoundingBoxQueries!==!1,c=s.enablePolygonQueries===!0,p=s.enableGeoClustering===!0;if(n||l||c||p){let u=(s.apiEndpointPrefix||"/nearby").trim().toLowerCase();i.has(u)||i.set(u,[]),i.get(u)?.push(r.info.getLabel())}}}for(let[r,a]of i.entries())a.length>1&&e.push({field:"semantics",rule:"geospatial_endpoint_collision",message:`The "${t.info.getLabel()}" entity has multiple geospatial properties (${a.join(", ")}) sharing the same API endpoint prefix "${r}".`,help:"Each geospatial property on the same entity must use a unique apiEndpointPrefix to avoid query endpoint collisions (e.g., /nearby, /nearby-office).",severity:"error",key:t.key,kind:t.kind})}return e}};var Ni=class{domain;report=[];#e=0;#t=0;#r=0;#i=!1;get infoCount(){return this.#i||this.computeIssueCounters(),this.#e}get warningCount(){return this.#i||this.computeIssueCounters(),this.#t}get errorCount(){return this.#i||this.computeIssueCounters(),this.#r}constructor(e){this.domain=e}validate(){this.#i=!1,this.report=[];let e=new xi(this.domain),t=new Ei(this.domain),i=new Ai(this.domain),r=new Ir(this.domain),a=!1;for(let n of this.domain.listEntities()){if(n.domain.key!==this.domain.key)continue;a=!0;let l=e.validate(n);this.report.push(...l);for(let c of n.properties){if(c.domain.key!==this.domain.key)continue;let p=t.validate(c);this.report.push(...p)}for(let c of n.associations){if(c.domain.key!==this.domain.key)continue;let p=i.validate(c);this.report.push(...p)}}if(!a)return this.report;let s=r.validate();return this.report.push(...s),this.report}computeIssueCounters(){this.#e=this.report.filter(e=>e.severity==="info").length,this.#t=this.report.filter(e=>e.severity==="warning").length,this.#r=this.report.filter(e=>e.severity==="error").length,this.#i=!0}};var ji=class{model;report=[];#e=0;#t=0;#r=0;#i=!1;get infoCount(){return this.#i||this.computeIssueCounters(),this.#e}get warningCount(){return this.#i||this.computeIssueCounters(),this.#t}get errorCount(){return this.#i||this.computeIssueCounters(),this.#r}constructor(e){this.model=e}validate(){if(this.#i=!1,this.report=[],this.report.push(...Ca(this.model)),this.report.push(...Oa(this.model)),this.report.push(...Ra(this.model)),this.report.push(...jn(this.model)),this.report.push(...Pa(this.model)),!this.model.exposes||this.model.exposes.size===0)this.report.push({code:"API_NO_EXPOSURES",message:"Your API currently has no exposed data for external clients to request.",suggestion:"Expose a data model so apps can communicate with it.",severity:"warning",context:{apiModelKey:this.model.key,kind:be,key:this.model.key,property:"exposes"}});else for(let e of this.model.exposes.values())this.report.push(...Da(e,this.model));return this.report}computeIssueCounters(){this.#e=this.report.filter(e=>e.severity==="info").length,this.#t=this.report.filter(e=>e.severity==="warning").length,this.#r=this.report.filter(e=>e.severity==="error").length,this.#i=!0}};var Ua;(function(o){o.LatLon="lat,lon",o.LonLat="lon,lat",o.PostGIS="postgis",o.Degree="degree",o.WKT="wkt",o.GeoJSON="geojson"})(Ua||(Ua={}));var La;(function(o){o.Meters="meters",o.Kilometers="kilometers",o.Miles="miles",o.Feet="feet",o.Yards="yards",o.NauticalMiles="nautical_miles"})(La||(La={}));var Ma;(function(o){o.WGS84="EPSG:4326",o.WebMercator="EPSG:3857",o.NAD83="EPSG:4269",o.NAD27="EPSG:4267"})(Ma||(Ma={}));var P_={format:Ua.LatLon,spatialReferenceSystem:Ma.WGS84,defaultDistanceUnit:La.Meters,enableSpatialIndexing:!0,enableValidation:!0,enablePostGISIntegration:!0,postGISGeometryType:"POINT",enableDistanceQueries:!0,maxQueryDistance:1e5,enableBoundingBoxQueries:!0,enablePolygonQueries:!1,enableGeoClustering:!1,apiEndpointPrefix:"/nearby",includeElevation:!1,coordinatePrecision:6,enableReverseGeocoding:!1};var In;(function(o){o.Bcrypt="bcrypt",o.Argon2="argon2",o.Scrypt="scrypt"})(In||(In={}));var $r=(o={})=>{let e={...Vc,...o};return o.metadata&&(e.metadata={...o.metadata}),{id:y.SKU,config:e}},Vc={validationMode:"strict",caseMode:"uppercase",enforceUniqueness:!0,autoGenerate:!1,validateReservedWords:!0,reservedValues:["ADMIN","TEST","NULL","DEFAULT","UNDEFINED","SAMPLE","DEMO"]},K_={PRODUCT_STANDARD:$r({validationMode:"strict",caseMode:"uppercase",prefix:"PROD-",enforceUniqueness:!0,validateReservedWords:!0,reservedValues:["ADMIN","TEST","NULL","DEFAULT"]}),SIMPLE:$r({validationMode:"lenient",caseMode:"preserve",enforceUniqueness:!0}),AUTO_GENERATE:$r({validationMode:"strict",caseMode:"uppercase",autoGenerate:!0,autoGenerateSource:"name",enforceUniqueness:!0}),FLEXIBLE:$r({validationMode:"lenient",caseMode:"preserve",enforceUniqueness:!0,validateReservedWords:!1})};function Tn(o){o.command("validate [file]").description("Validate a Data Domain or API Model schema").option("--stdin","Read schema content from STDIN").option("--org <oid>","Organization ID (remote validation)").option("--fid <fid>","File ID / schema ID (remote validation)").option("--domain <path>","Path to local Data Domain schema file (only for local API Model validation)").action(async(e,t)=>{let i=new B({format:N.resolved.format});await new za(e,t,i).execute()})}var za=class{constructor(e,t,i){this.file=e;this.options=t;this.formatter=i}file;options;formatter;async execute(){try{this.validateArguments();let e=await this.loadSchema();this.validateSchemaStructure(e);let t=e.kind,i=[];t===He?i=await this.validateDataDomain(e):t===be?i=await this.validateApiModel(e):(this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Unsupported schema kind "${t}". Supported kinds: "${He}", "${be}".`}),process.exit(1)),this.reportResults(i,t)}catch(e){let t=ie(e);this.formatter.error(t),process.exit(1)}}get isRemoteValidationWithoutOrg(){return!!(this.options.fid&&!this.options.org&&!N.resolved.org)}get shouldReadFromStdin(){return!!(this.options.stdin||!this.file&&!process.stdin.isTTY)}validateArguments(){this.file&&this.options.stdin&&(this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:"Cannot specify both [file] path and --stdin"}),process.exit(1)),this.options.org&&!this.options.fid&&(this.formatter.error({code:"CLI_ERR_MISSING_REQUIRED",message:"File ID (--fid) is required when using remote validation (--org)."}),process.exit(1)),this.isRemoteValidationWithoutOrg&&(this.formatter.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Organization ID is required for remote validation. Use --org <oid> or configure a default org."}),process.exit(1))}async loadSchema(){return this.options.fid?this.loadRemoteSchema():this.loadLocalSchema()}async loadRemoteSchema(){let e=this.options.org||N.resolved.org;e||(this.formatter.error({code:"CLI_ERR_MISSING_REQUIRED",message:"Organization ID is required for remote validation."}),process.exit(1));let t=ee(),{media:i}=await t.files.readMedia(e,this.options.fid,{token:t.token});return i}async loadLocalSchema(){let e;if(this.shouldReadFromStdin)e=await this.readStdin();else if(this.file){let t=$n.resolve(this.file);Tr.existsSync(t)||(this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`File not found at path: ${t}`}),process.exit(1)),e=Tr.readFileSync(t,"utf8")}else this.formatter.error({code:"CLI_ERR_MISSING_REQUIRED",message:"A file path, --stdin, or remote --org and --fid must be specified."}),process.exit(1);try{return JSON.parse(e)}catch(t){let i=t instanceof Error?t.message:String(t);this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Failed to parse schema JSON: ${i}`}),process.exit(1)}}isValidSchemaStructure(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&"kind"in e}validateSchemaStructure(e){this.isValidSchemaStructure(e)||(this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:'Invalid schema. The schema must be a JSON object containing a "kind" property.'}),process.exit(1))}async validateDataDomain(e){let t=[];if(this.options.fid){let a=ee(),s=e.dependencyList||[];s.length>0&&(t=(await a.dataCatalog.listDependencies(s,{token:a.token})).data||[])}let i=new qe(e,t,{readOnly:!0});return new Ni(i).validate()}async validateApiModel(e){let t;if(this.options.fid){let a=ee(),s=e.dependencyList||[];if(s.length>0){let l=(await a.dataCatalog.listDependencies(s,{token:a.token})).data||[];l.length>0&&(t=new qe(l[0],l,{readOnly:!0}))}}else if(this.options.domain){let a=$n.resolve(this.options.domain);Tr.existsSync(a)||(this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Domain dependency file not found at path: ${a}`}),process.exit(1));let s;try{s=JSON.parse(Tr.readFileSync(a,"utf8"))}catch(n){let l=n instanceof Error?n.message:String(n);this.formatter.error({code:"CLI_ERR_INVALID_ARGUMENT",message:`Failed to parse domain dependency JSON: ${l}`}),process.exit(1)}t=new qe(s,[],{readOnly:!0})}let i=new _i(e,t);return new ji(i).validate()}reportResults(e,t){let i=e.some(r=>r.severity==="error");if(N.resolved.format==="json")console.log(JSON.stringify({isValid:!i,validationIssues:e},null,2));else if(e.length===0)this.formatter.success("Validation passed. No issues found!");else{let r=this.formatIssues(e,t);this.formatter.list(r,["severity","code","message","suggestion","context"],{headers:["SEVERITY","CODE","MESSAGE","SUGGESTION","CONTEXT"]});let a=e.filter(l=>l.severity==="error").length,s=e.filter(l=>l.severity==="warning").length,n=e.filter(l=>l.severity==="info").length;console.log(""),a>0?console.error(G.red(`\u2716 Validation failed: ${a} error(s), ${s} warning(s), ${n} info(s).`)):console.log(G.yellow(`\u26A0 Validation passed with warnings: ${s} warning(s), ${n} info(s).`))}i&&process.exit(1)}formatIssues(e,t){return e.map(i=>{let r=i.severity||"info",a=i.message||"",s,n,l;if(t===He){let c=i;s=c.rule||"unknown",n=c.help||"",l=c.key?`${c.kind||"unknown"}: ${c.key}`:c.field||""}else{let c=i;s=c.code||"unknown",n=c.suggestion||"";let p=c.context||{};l=`${p.kind||"unknown"}: ${p.key||""}${p.property?"."+p.property:""}`}return{severity:r,code:s,message:a,suggestion:n,context:l}})}async readStdin(){return new Promise((e,t)=>{let i="";process.stdin.setEncoding("utf8"),process.stdin.on("data",r=>{i+=r}),process.stdin.on("end",()=>{e(i)}),process.stdin.on("error",r=>{t(r)})})}};parseInt(process.versions.node.split(".")[0],10)<22&&(console.error("Error: apinow requires Node.js 22 or higher."),process.exit(1));function Cn(){let o=process.argv.indexOf("--format");if(o!==-1&&o+1<process.argv.length&&process.argv[o+1]==="json")return"json";try{return N.resolved.format||"text"}catch{return"text"}}process.on("uncaughtException",o=>{new B({format:Cn()}).error({code:"CLI_ERR_UNKNOWN",message:o.message||"An unexpected error occurred.",detail:o.stack}),process.exit(1)});process.on("unhandledRejection",o=>{let e=new B({format:Cn()}),t=o instanceof Error?o.message:String(o),i=o instanceof Error?o.stack:void 0;e.error({code:"CLI_ERR_UNKNOWN",message:`Unhandled promise rejection: ${t}`,detail:i}),process.exit(1)});Wc({pkg:Ht}).notify();N.load();var Je=new Yc;Je.name("apinow").description("API NOW! Platform CLI Tool").version(Ht.version,"--version").option("--format <format>","Output format: text, json","text").option("--api-url <url>","Override target API server base URL").option("--debug","Enable debug/verbose logging");Je.hook("preAction",(o,e)=>{let t,i,r=e;for(;r;){let a=r.opts();a.apiUrl&&!t&&(t=a.apiUrl),a.format&&!i&&(i=a.format),r=r.parent}N.saturate({apiUrl:t,format:i})});Ka(Je);Wa(Je);Ya(Je);rs(Je);as(Je);Tn(Je);function On(o){let e=o.options||[];e.some(t=>t.long==="--api-url")||o.option("--api-url <url>","Override target API server base URL"),e.some(t=>t.long==="--format")||o.option("--format <format>","Output format: text, json"),e.some(t=>t.long==="--debug")||o.option("--debug","Enable debug/verbose logging");for(let t of o.commands)On(t)}for(let o of Je.commands)On(o);await Je.parseAsync(process.argv);
|
|
160
160
|
/*! Bundled license information:
|
|
161
161
|
|
|
162
162
|
@pawel-up/data-mock/build/src/lib/MersenneTwister.js:
|