"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class l{constructor(){this.templates=new Map}register(t){const e={...t,availableTasks:t.availableTasks??t.allowedTasks};return this.templates.set(e.triggerKey,e),this}registerFromApi(t){for(const e of t??[])e!=null&&e.key&&this.register({triggerKey:e.key,label:e.name??e.key,description:e.description,availableTasks:e.allowedTasks,...e.templateUI??{}});return this}lookup(t){return this.templates.get(t)}list(){return[...this.templates.values()]}listByCategory(t){return this.list().filter(e=>e.category===t)}listByTag(t){return this.list().filter(e=>{var s;return(s=e.tags)==null?void 0:s.includes(t)})}search(t){const e=t.toLowerCase();return this.list().filter(s=>{var r,i,a;return s.label.toLowerCase().includes(e)||((r=s.description)==null?void 0:r.toLowerCase().includes(e))||((i=s.tags)==null?void 0:i.some(o=>o.toLowerCase().includes(e)))||((a=s.category)==null?void 0:a.toLowerCase().includes(e))})}categories(){const t=new Set;return this.list().forEach(e=>{e.category&&t.add(e.category)}),Array.from(t)}clear(){return this.templates.clear(),this}}const n=new l;exports.TemplateRegistry=l;exports.templateRegistry=n;
//# sourceMappingURL=templateRegistry.cjs.map
