@skill-map/cli 0.28.0 → 0.30.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.
Files changed (36) hide show
  1. package/dist/cli/tutorial/sm-tutorial.md +94 -20
  2. package/dist/cli.js +1561 -1214
  3. package/dist/cli.js.map +1 -1
  4. package/dist/index.js +116 -99
  5. package/dist/index.js.map +1 -1
  6. package/dist/kernel/index.d.ts +903 -1004
  7. package/dist/kernel/index.js +116 -99
  8. package/dist/kernel/index.js.map +1 -1
  9. package/dist/ui/chunk-3SI3TVER.js +7 -0
  10. package/dist/ui/{chunk-4GTCV7V4.js → chunk-47OZB7LR.js} +1 -1
  11. package/dist/ui/{chunk-JMP2LDMI.js → chunk-5JBW2LUN.js} +1 -1
  12. package/dist/ui/{chunk-Y7MXGXU3.js → chunk-DZBSELHN.js} +1 -1
  13. package/dist/ui/{chunk-Z2667C3S.js → chunk-FEPH4VNB.js} +1 -1
  14. package/dist/ui/{chunk-PY2R7LHN.js → chunk-FQOZBFJ5.js} +1 -1
  15. package/dist/ui/chunk-HOJFYUH4.js +123 -0
  16. package/dist/ui/{chunk-WOLLYGGL.js → chunk-KJQEO6P3.js} +1 -1
  17. package/dist/ui/chunk-LNRQ7VKE.js +1 -0
  18. package/dist/ui/{chunk-VO6NF24F.js → chunk-LS2NXZQZ.js} +1 -1
  19. package/dist/ui/{chunk-J3YWUNFO.js → chunk-LTQTJU54.js} +1 -1
  20. package/dist/ui/{chunk-6BG7PBUN.js → chunk-NGIFGXW7.js} +1 -1
  21. package/dist/ui/{chunk-5W6J6H76.js → chunk-SBCO7ZSP.js} +1 -1
  22. package/dist/ui/chunk-VB56BUGO.js +1 -0
  23. package/dist/ui/{chunk-UXCAEDR6.js → chunk-VDQLDTTR.js} +1 -1
  24. package/dist/ui/{chunk-AD7RBRD3.js → chunk-WJLIYGWJ.js} +5 -5
  25. package/dist/ui/chunk-YQIWQVJ6.js +317 -0
  26. package/dist/ui/favicon-matrix.svg +15 -0
  27. package/dist/ui/index.html +12 -2
  28. package/dist/ui/main-X5YGJFU6.js +2 -0
  29. package/dist/ui/{styles-IKG3B6AM.css → styles-2WO3KNOY.css} +1 -1
  30. package/package.json +10 -7
  31. package/dist/ui/chunk-BGDH7CDV.js +0 -1
  32. package/dist/ui/chunk-H2J55DNK.js +0 -7
  33. package/dist/ui/chunk-Q7L6LLAK.js +0 -1
  34. package/dist/ui/chunk-VH5GRUT7.js +0 -255
  35. package/dist/ui/chunk-XCUOAV77.js +0 -123
  36. package/dist/ui/main-TZL26MZU.js +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skill-map/cli",
3
- "version": "0.28.0",
3
+ "version": "0.30.0",
4
4
  "description": "skill-map reference implementation — kernel + CLI + adapters.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -58,7 +58,7 @@
58
58
  "semver": "7.7.4",
59
59
  "typanion": "3.14.0",
60
60
  "ws": "8.20.0",
61
- "@skill-map/spec": "0.27.0"
61
+ "@skill-map/spec": "0.29.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@eslint/js": "10.0.1",
@@ -90,16 +90,19 @@
90
90
  "lint:fix": "eslint . --fix",
91
91
  "reference": "node scripts/build-reference.js",
92
92
  "reference:check": "node scripts/build-reference.js --check",
93
+ "build-built-ins": "node ../scripts/generate-built-ins.js",
94
+ "built-ins:check": "node ../scripts/generate-built-ins.js --check",
95
+ "prebuild": "pnpm build-built-ins",
93
96
  "validate": "pnpm validate:compile && pnpm validate:test",
94
- "validate:compile": "pnpm typecheck && pnpm lint && pnpm build && pnpm reference:check",
97
+ "validate:compile": "pnpm typecheck && pnpm lint && pnpm build && pnpm reference:check && pnpm built-ins:check",
95
98
  "validate:test": "pnpm test:ci",
96
99
  "pretest": "tsup",
97
100
  "pretest:coverage": "tsup",
98
101
  "pretest:coverage:html": "tsup",
99
- "test": "tsc --noEmit && node --import tsx --test --test-reporter=spec 'test/**/*.test.ts' 'built-in-plugins/**/*.test.ts' 'kernel/**/*.test.ts' 'server/**/*.test.ts'",
100
- "test:ci": "node --import tsx --test 'test/**/*.test.ts' 'built-in-plugins/**/*.test.ts' 'kernel/**/*.test.ts' 'server/**/*.test.ts'",
101
- "test:coverage": "tsc --noEmit && SKILL_MAP_SKIP_BENCHMARK=1 node --experimental-default-config-file --import tsx --test --experimental-test-coverage 'test/**/*.test.ts' 'built-in-plugins/**/*.test.ts' 'kernel/**/*.test.ts' 'server/**/*.test.ts'",
102
- "test:coverage:html": "tsc --noEmit && SKILL_MAP_SKIP_BENCHMARK=1 c8 node --import tsx --test 'test/**/*.test.ts' 'built-in-plugins/**/*.test.ts' 'kernel/**/*.test.ts' 'server/**/*.test.ts'",
102
+ "test": "tsc --noEmit && node --import tsx --test --test-reporter=spec '__tests__/**/*.spec.ts' 'kernel/**/__tests__/**/*.spec.ts' 'cli/**/__tests__/**/*.spec.ts' 'server/**/__tests__/**/*.spec.ts' 'plugins/**/__tests__/**/*.spec.ts' 'core/**/__tests__/**/*.spec.ts' 'conformance/**/__tests__/**/*.spec.ts'",
103
+ "test:ci": "node --import tsx --test '__tests__/**/*.spec.ts' 'kernel/**/__tests__/**/*.spec.ts' 'cli/**/__tests__/**/*.spec.ts' 'server/**/__tests__/**/*.spec.ts' 'plugins/**/__tests__/**/*.spec.ts' 'core/**/__tests__/**/*.spec.ts' 'conformance/**/__tests__/**/*.spec.ts'",
104
+ "test:coverage": "tsc --noEmit && SKILL_MAP_SKIP_BENCHMARK=1 node --experimental-default-config-file --import tsx --test --experimental-test-coverage '__tests__/**/*.spec.ts' 'kernel/**/__tests__/**/*.spec.ts' 'cli/**/__tests__/**/*.spec.ts' 'server/**/__tests__/**/*.spec.ts' 'plugins/**/__tests__/**/*.spec.ts' 'core/**/__tests__/**/*.spec.ts' 'conformance/**/__tests__/**/*.spec.ts'",
105
+ "test:coverage:html": "tsc --noEmit && SKILL_MAP_SKIP_BENCHMARK=1 c8 node --import tsx --test '__tests__/**/*.spec.ts' 'kernel/**/__tests__/**/*.spec.ts' 'cli/**/__tests__/**/*.spec.ts' 'server/**/__tests__/**/*.spec.ts' 'plugins/**/__tests__/**/*.spec.ts' 'core/**/__tests__/**/*.spec.ts' 'conformance/**/__tests__/**/*.spec.ts'",
103
106
  "clean": "rm -rf dist coverage"
104
107
  }
105
108
  }
@@ -1 +0,0 @@
1
- import{J as s,O as r,Tb as i,Y as h,Z as p,da as o,ea as u,id as d,jd as m,nd as f}from"./chunk-J3YWUNFO.js";var L={triggerLabel:"Settings",triggerTooltip:"Settings",modalTitle:"Settings",closeLabel:"Close",sections:{plugins:"Plugins",general:"General",project:"Project",changelog:"Changelog",about:"About"},general:{heading:"General",intro:"Per-machine preferences. The update-check toggle is the only setting that lives outside the project; it persists at `~/.skill-map/settings.json` and follows you across projects.",loadErrorPrefix:"Could not load preferences:",saveErrorPrefix:"Could not save preferences:",toggles:{"updateCheck.enabled":{label:"Check for updates",description:"Check npm for newer @skill-map/cli releases."}},localPreferences:{heading:"This browser",intro:"Visual preferences saved in this browser only. They won't sync to another machine."},connectionType:{label:"Edge style",description:"Shape of the lines that connect nodes in the graph view.",options:{segment:{label:"Orthogonal",description:"Right-angled segments (default)."},straight:{label:"Straight",description:"Single straight line."},bezier:{label:"Bezier",description:"Smooth curve."},"adaptive-curve":{label:"Adaptive curve",description:"Curve that follows the connector orientation."}}},extraTheme:{label:"Theme",description:"Pick a specialty theme. Overrides the topbar dark/light toggle while active; click that toggle to exit.",options:{none:{label:"None",description:"Use the topbar dark/light toggle."},matrix:{label:"Matrix",description:"Cyber-green retint on the dark palette."}}}},project:{heading:"Project",intro:"These settings apply only to this project and are saved in its `.skill-map/settings.local.json` file.",loadErrorPrefix:"Could not load project settings:",saveErrorPrefix:"Could not save project settings:",extraFoldersLabel:"Extra folders to scan",extraFoldersDescription:"Additional folders included in the scan. Their files show up in the graph next to this project. Use ~/ for paths inside your home folder. This is the only way to extend the scan beyond this project.",extraFoldersPlaceholder:"~/.claude/agents, /path/to/another/folder",referencePathsLabel:"Folders for link validation",referencePathsDescription:'Folders checked only to validate links. Files here are not indexed and do not appear in the graph, they just stop "broken link" warnings when a link points to a real file outside this project.',referencePathsPlaceholder:"~/Documents/research, ~/.claude",addPathLabel:"Add path",removePathLabel:"Remove",confirmDialogHeader:"Allow access to folders outside this project?",confirmDialogIntro:"This change lets the scan read files in:",confirmDialogAccept:"Allow access",confirmDialogReject:"Cancel"},changelogHeading:"Changelog",changelogIntro:"What's new in skill-map. Each entry covers a release of @skill-map/cli (the CLI + bundled UI) and lists the user-facing changes plus the workspace(s) each one affects.",changelogEmpty:"No release notes yet. Future releases will populate this list automatically from the changesets shipped in each PR.",changelogInternalRelease:"Internal release. Focus on stability, infra, and refactors. No user-facing changes this time.",changelogAffectedPackages:"Affected packages",aboutHeading:"About",aboutIntro:"Version information for the running CLI / server.",aboutCliLabel:"skill-map CLI",aboutSpecLabel:"Spec version",aboutSchemaLabel:"Schema version",aboutFolderLabel:"Project folder",aboutDbLabel:"Project DB",aboutDbValue:(t,e)=>t==="present"?e:`${t} \xB7 ${e}`,aboutLoading:"Loading\u2026",aboutUnknown:"\u2014",aboutErrorPrefix:"Could not read health endpoint:",aboutLinksHeading:"Links",aboutWebsiteLabel:"Website",aboutGithubLabel:"GitHub",aboutWebsiteUrl:"https://skill-map.dev/",aboutGithubUrl:"https://github.com/crystian/skill-map",aboutStarHeading:"Enjoying skill-map?",aboutStarBody:"If it's useful to you, drop us a star on GitHub, it helps a lot and keeps the project alive.",aboutStarCta:"Star on GitHub",aboutStarA11y:"Open the skill-map repository on GitHub to give it a star",pluginsHeading:"Plugins",pluginsIntro:"Enable or disable installed plugins.",pluginsSearchPlaceholder:"Filter by name\u2026",pluginsSearchA11y:"Filter plugins by name",pluginsSearchEmpty:t=>`No plugins match "${t}".`,pluginsKindFilterAll:"All",pluginsKindFilterA11y:"Filter plugins by kind",pluginsKindFilterOptionA11y:(t,e)=>e?`Show only ${t} extensions`:"Show all kinds",unsavedChangesMessage:t=>t===1?'1 unsaved change. Click "Apply" to persist it.':`${t} unsaved changes. Click "Apply" to persist them.`,startsAsDisabledRowHint:"This plugin started disabled and is not loaded in memory. Restart `sm serve` for the change to take effect.",startsAsDisabledFooterHint:"Some plugins were disabled when the server started. Consider restarting `sm serve` so they take effect.",discardChanges:"Discard",applyAndClose:"Apply",discardA11y:"Discard pending plugin changes",applyA11y:"Apply pending plugin changes and refresh the graph",confirmCloseTitle:"Apply pending changes?",confirmCloseBody:t=>t===1?"You have 1 unsaved change.":`You have ${t} unsaved changes.`,keepEditing:"Keep editing",sourceBuiltIn:"Built-in",sourceProject:"Project",enabledLabel:"Enabled",disabledLabel:"Disabled",lockedLabel:"Locked",lockedTooltip:"Locked by the host (cannot be toggled).",expandLabel:"Show extensions",collapseLabel:"Hide extensions",statusFailure:{"incompatible-spec":"Incompatible spec version","invalid-manifest":"Invalid manifest","load-error":"Failed to load","id-collision":"Plugin id collision"},loading:"Loading plugins\u2026",empty:"No plugins installed.",errorPrefix:"Could not load plugins:",toggleErrorPrefix:"Toggle failed:",a11y:{triggerLabel:"Open settings",pluginToggle:(t,e)=>e?`Enable plugin ${t}`:`Disable plugin ${t}`,extensionToggle:(t,e)=>e?`Enable ${t}`:`Disable ${t}`,pluginRow:t=>`Plugin ${t} row`,extensionRow:t=>`Extension ${t} row`}};var b={available:"Update available",tooltip:t=>`v${t} is available. Run \`npm i -g @skill-map/cli@latest\` to update.`,a11yLabel:t=>`Update available: version ${t}`,versionLabel:t=>`v${t}`,versionTooltip:t=>`skill-map CLI v${t}`,versionA11yLabel:t=>`Running version ${t}`,fetchFailed:t=>`UpdateCheckService: fetch failed (${t})`};var y=class t{dataSource=r(d);status=o(null);isOutdated=i(()=>this.status()?.isOutdated===!0);latest=i(()=>this.status()?.latest??null);current=i(()=>this.status()?.current??null);async load(){try{let e=await this.dataSource.getUpdateStatus();this.status.set(e)}catch(e){let a=e instanceof Error?e.message:String(e);console.warn(b.fetchFailed(a))}}static \u0275fac=function(a){return new(a||t)};static \u0275prov=s({token:t,factory:t.\u0275fac,providedIn:"root"})};var T={scanFailed:t=>`scan-trigger failed: ${t}`};var k=class t{dataSource=r(d);loader=r(f);scanning=o(!1);scanError=o(null);async run(){if(!this.scanning()){this.scanning.set(!0),this.scanError.set(null);try{await this.dataSource.runScan(),await this.loader.load()}catch(e){let a=e instanceof m||e instanceof Error?e.message:String(e);this.scanError.set(a),console.warn(T.scanFailed(a))}finally{this.scanning.set(!1)}}}static \u0275fac=function(a){return new(a||t)};static \u0275prov=s({token:t,factory:t.\u0275fac,providedIn:"root"})};var S="skill-map.ui.theme",g="skill-map.ui.extra-theme",A="app-dark",D="dark",P="app-matrix",E="(prefers-color-scheme: dark)",x=class t{doc=r(h);destroyRef=r(p);mode=o(this.readInitialMode());extraTheme=o(this.readInitialExtra());systemPrefersDark=o(this.readSystemPref());resolved=i(()=>{let e=this.mode();return e==="auto"?this.systemPrefersDark()?"dark":"light":e});constructor(){this.subscribeToSystemPref(),u(()=>{let e=this.extraTheme(),n=this.resolved()==="dark"||e==="matrix",l=this.doc.documentElement;l.classList.toggle(A,n),l.classList.toggle(D,n),l.classList.toggle(P,e==="matrix");try{let c=this.doc.defaultView?.localStorage;c?.setItem(S,this.mode()),e===null?c?.removeItem(g):c?.setItem(g,e)}catch{}})}toggle(){this.extraTheme()!==null&&this.extraTheme.set(null),this.mode.update(e=>e==="auto"?"light":e==="light"?"dark":"auto")}set(e){this.mode.set(e)}setExtraTheme(e){this.extraTheme.set(e)}readInitialMode(){try{let e=this.doc.defaultView?.localStorage.getItem(S);if(e==="auto"||e==="light"||e==="dark")return e}catch{}return"auto"}readInitialExtra(){try{let e=this.doc.defaultView?.localStorage.getItem(g);if(e==="matrix")return e}catch{}return null}readSystemPref(){try{return this.doc.defaultView?.matchMedia(E).matches??!1}catch{return!1}}subscribeToSystemPref(){let e=this.doc.defaultView;if(!e||typeof e.matchMedia!="function")return;let a=e.matchMedia(E),n=l=>{this.systemPrefersDark.set(l.matches)};a.addEventListener("change",n),this.destroyRef.onDestroy(()=>a.removeEventListener("change",n))}static \u0275fac=function(a){return new(a||t)};static \u0275prov=s({token:t,factory:t.\u0275fac,providedIn:"root"})};export{b as a,y as b,L as c,k as d,x as e};
@@ -1,7 +0,0 @@
1
- var ft=Object.defineProperty,ve=Object.getOwnPropertySymbols,pt=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable,be=(e,t,n)=>t in e?ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mt=(e,t)=>{for(var n in t||(t={}))pt.call(t,n)&&be(e,n,t[n]);if(ve)for(var n of ve(t))ht.call(t,n)&&be(e,n,t[n]);return e};function W(e){return e==null||e===""||Array.isArray(e)&&e.length===0||!(e instanceof Date)&&typeof e=="object"&&Object.keys(e).length===0}function oe(e,t,n=new WeakSet){if(e===t)return!0;if(!e||!t||typeof e!="object"||typeof t!="object"||n.has(e)||n.has(t))return!1;n.add(e).add(t);let r=Array.isArray(e),i=Array.isArray(t),l,o,s;if(r&&i){if(o=e.length,o!=t.length)return!1;for(l=o;l--!==0;)if(!oe(e[l],t[l],n))return!1;return!0}if(r!=i)return!1;let a=e instanceof Date,u=t instanceof Date;if(a!=u)return!1;if(a&&u)return e.getTime()==t.getTime();let d=e instanceof RegExp,p=t instanceof RegExp;if(d!=p)return!1;if(d&&p)return e.toString()==t.toString();let c=Object.keys(e);if(o=c.length,o!==Object.keys(t).length)return!1;for(l=o;l--!==0;)if(!Object.prototype.hasOwnProperty.call(t,c[l]))return!1;for(l=o;l--!==0;)if(s=c[l],!oe(e[s],t[s],n))return!1;return!0}function gt(e,t){return oe(e,t)}function xe(e){return typeof e=="function"&&"call"in e&&"apply"in e}function h(e){return!W(e)}function Se(e,t){if(!e||!t)return null;try{let n=e[t];if(h(n))return n}catch{}if(Object.keys(e).length){if(xe(t))return t(e);if(t.indexOf(".")===-1)return e[t];{let n=t.split("."),r=e;for(let i=0,l=n.length;i<l;++i){if(r==null)return null;r=r[n[i]]}return r}}return null}function yt(e,t,n){return n?Se(e,n)===Se(t,n):gt(e,t)}function Bt(e,t){if(e!=null&&t&&t.length){for(let n of t)if(yt(e,n))return!0}return!1}function C(e,t=!0){return e instanceof Object&&e.constructor===Object&&(t||Object.keys(e).length!==0)}function Ce(e={},t={}){let n=mt({},e);return Object.keys(t).forEach(r=>{let i=r;C(t[i])&&i in e&&C(e[i])?n[i]=Ce(e[i],t[i]):n[i]=t[i]}),n}function N(...e){return e.reduce((t,n,r)=>r===0?n:Ce(t,n),{})}function It(e,t){let n=-1;if(h(e))try{n=e.findLastIndex(t)}catch{n=e.lastIndexOf([...e].reverse().find(t))}return n}function $(e,...t){return xe(e)?e(...t):e}function O(e,t=!0){return typeof e=="string"&&(t||e!=="")}function we(e){return O(e)?e.replace(/(-|_)/g,"").toLowerCase():e}function le(e,t="",n={}){let r=we(t).split("."),i=r.shift();if(i){if(C(e)){let l=Object.keys(e).find(o=>we(o)===i)||"";return le($(e[l],n),r.join("."),n)}return}return $(e,n)}function Ee(e,t=!0){return Array.isArray(e)&&(t||e.length!==0)}function Mt(e){return e instanceof Date}function ne(e){return h(e)&&!isNaN(e)}function Ht(e=""){return h(e)&&e.length===1&&!!e.match(/\S| /)}function w(e,t){if(t){let n=t.test(e);return t.lastIndex=0,n}return!1}function se(...e){return N(...e)}function ae(e){return e&&e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":").trim()}function Ut(e){if(e&&/[\xC0-\xFF\u0100-\u017E]/.test(e)){let t={A:/[\xC0-\xC5\u0100\u0102\u0104]/g,AE:/[\xC6]/g,C:/[\xC7\u0106\u0108\u010A\u010C]/g,D:/[\xD0\u010E\u0110]/g,E:/[\xC8-\xCB\u0112\u0114\u0116\u0118\u011A]/g,G:/[\u011C\u011E\u0120\u0122]/g,H:/[\u0124\u0126]/g,I:/[\xCC-\xCF\u0128\u012A\u012C\u012E\u0130]/g,IJ:/[\u0132]/g,J:/[\u0134]/g,K:/[\u0136]/g,L:/[\u0139\u013B\u013D\u013F\u0141]/g,N:/[\xD1\u0143\u0145\u0147\u014A]/g,O:/[\xD2-\xD6\xD8\u014C\u014E\u0150]/g,OE:/[\u0152]/g,R:/[\u0154\u0156\u0158]/g,S:/[\u015A\u015C\u015E\u0160]/g,T:/[\u0162\u0164\u0166]/g,U:/[\xD9-\xDC\u0168\u016A\u016C\u016E\u0170\u0172]/g,W:/[\u0174]/g,Y:/[\xDD\u0176\u0178]/g,Z:/[\u0179\u017B\u017D]/g,a:/[\xE0-\xE5\u0101\u0103\u0105]/g,ae:/[\xE6]/g,c:/[\xE7\u0107\u0109\u010B\u010D]/g,d:/[\u010F\u0111]/g,e:/[\xE8-\xEB\u0113\u0115\u0117\u0119\u011B]/g,g:/[\u011D\u011F\u0121\u0123]/g,i:/[\xEC-\xEF\u0129\u012B\u012D\u012F\u0131]/g,ij:/[\u0133]/g,j:/[\u0135]/g,k:/[\u0137,\u0138]/g,l:/[\u013A\u013C\u013E\u0140\u0142]/g,n:/[\xF1\u0144\u0146\u0148\u014B]/g,p:/[\xFE]/g,o:/[\xF2-\xF6\xF8\u014D\u014F\u0151]/g,oe:/[\u0153]/g,r:/[\u0155\u0157\u0159]/g,s:/[\u015B\u015D\u015F\u0161]/g,t:/[\u0163\u0165\u0167]/g,u:/[\xF9-\xFC\u0169\u016B\u016D\u016F\u0171\u0173]/g,w:/[\u0175]/g,y:/[\xFD\xFF\u0177]/g,z:/[\u017A\u017C\u017E]/g};for(let n in t)e=e.replace(t[n],n)}return e}function re(e){return O(e)?e.replace(/(_)/g,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():e}function Kt(e){return e==="auto"?0:typeof e=="number"?e:Number(e.replace(/[^\d.]/g,"").replace(",","."))*1e3}function $e(){let e=new Map;return{on(t,n){let r=e.get(t);return r?r.push(n):r=[n],e.set(t,r),this},off(t,n){let r=e.get(t);return r&&r.splice(r.indexOf(n)>>>0,1),this},emit(t,n){let r=e.get(t);r&&r.forEach(i=>{i(n)})},clear(){e.clear()}}}function vt(e,t){return e?e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className):!1}function Oe(e,t){if(e&&t){let n=r=>{vt(e,r)||(e.classList?e.classList.add(r):e.className+=" "+r)};[t].flat().filter(Boolean).forEach(r=>r.split(" ").forEach(n))}}function bt(){return window.innerWidth-document.documentElement.offsetWidth}function Xt(e){typeof e=="string"?Oe(document.body,e||"p-overflow-hidden"):(e!=null&&e.variableName&&document.body.style.setProperty(e.variableName,bt()+"px"),Oe(document.body,e?.className||"p-overflow-hidden"))}function ke(e,t){if(e&&t){let n=r=>{e.classList?e.classList.remove(r):e.className=e.className.replace(new RegExp("(^|\\b)"+r.split(" ").join("|")+"(\\b|$)","gi")," ")};[t].flat().filter(Boolean).forEach(r=>r.split(" ").forEach(n))}}function Zt(e){typeof e=="string"?ke(document.body,e||"p-overflow-hidden"):(e!=null&&e.variableName&&document.body.style.removeProperty(e.variableName),ke(document.body,e?.className||"p-overflow-hidden"))}function ue(e){for(let t of document?.styleSheets)try{for(let n of t?.cssRules)for(let r of n?.style)if(e.test(r))return{name:r,value:n.style.getPropertyValue(r).trim()}}catch{}return null}function Ae(e){let t={width:0,height:0};if(e){let[n,r]=[e.style.visibility,e.style.display],i=e.getBoundingClientRect();e.style.visibility="hidden",e.style.display="block",t.width=i.width||e.offsetWidth,t.height=i.height||e.offsetHeight,e.style.display=r,e.style.visibility=n}return t}function Ne(){let e=window,t=document,n=t.documentElement,r=t.getElementsByTagName("body")[0],i=e.innerWidth||n.clientWidth||r.clientWidth,l=e.innerHeight||n.clientHeight||r.clientHeight;return{width:i,height:l}}function de(e){return e?Math.abs(e.scrollLeft):0}function St(){let e=document.documentElement;return(window.pageXOffset||de(e))-(e.clientLeft||0)}function wt(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}function xt(e){return e?getComputedStyle(e).direction==="rtl":!1}function Gt(e,t,n=!0){var r,i,l,o;if(e){let s=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:Ae(e),a=s.height,u=s.width,d=t.offsetHeight,p=t.offsetWidth,c=t.getBoundingClientRect(),f=wt(),g=St(),v=Ne(),y,b,S="top";c.top+d+a>v.height?(y=c.top+f-a,S="bottom",y<0&&(y=f)):y=d+c.top+f,c.left+u>v.width?b=Math.max(0,c.left+g+p-u):b=c.left+g,xt(e)?e.style.insetInlineEnd=b+"px":e.style.insetInlineStart=b+"px",e.style.top=y+"px",e.style.transformOrigin=S,n&&(e.style.marginTop=S==="bottom"?`calc(${(i=(r=ue(/-anchor-gutter$/))==null?void 0:r.value)!=null?i:"2px"} * -1)`:(o=(l=ue(/-anchor-gutter$/))==null?void 0:l.value)!=null?o:"")}}function Yt(e,t){e&&(typeof t=="string"?e.style.cssText=t:Object.entries(t||{}).forEach(([n,r])=>e.style[n]=r))}function Jt(e,t){if(e instanceof HTMLElement){let n=e.offsetWidth;if(t){let r=getComputedStyle(e);n+=parseFloat(r.marginLeft)+parseFloat(r.marginRight)}return n}return 0}function Qt(e,t,n=!0,r=void 0){var i;if(e){let l=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:Ae(e),o=t.offsetHeight,s=t.getBoundingClientRect(),a=Ne(),u,d,p=r??"top";if(!r&&s.top+o+l.height>a.height?(u=-1*l.height,p="bottom",s.top+u<0&&(u=-1*s.top)):u=o,l.width>a.width?d=s.left*-1:s.left+l.width>a.width?d=(s.left+l.width-a.width)*-1:d=0,e.style.top=u+"px",e.style.insetInlineStart=d+"px",e.style.transformOrigin=p,n){let c=(i=ue(/-anchor-gutter$/))==null?void 0:i.value;e.style.marginTop=p==="bottom"?`calc(${c??"2px"} * -1)`:c??""}}}function Pe(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function Ct(e){return!!(e!==null&&typeof e<"u"&&e.nodeName&&Pe(e))}function T(e){return typeof Element<"u"?e instanceof Element:e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string"}function je(e){let t=e;return e&&typeof e=="object"&&(Object.hasOwn(e,"current")?t=e.current:Object.hasOwn(e,"el")&&(Object.hasOwn(e.el,"nativeElement")?t=e.el.nativeElement:t=e.el)),T(t)?t:void 0}function Et(e,t){var n,r,i;if(e)switch(e){case"document":return document;case"window":return window;case"body":return document.body;case"@next":return t?.nextElementSibling;case"@prev":return t?.previousElementSibling;case"@first":return t?.firstElementChild;case"@last":return t?.lastElementChild;case"@child":return(n=t?.children)==null?void 0:n[0];case"@parent":return t?.parentElement;case"@grandparent":return(r=t?.parentElement)==null?void 0:r.parentElement;default:{if(typeof e=="string"){let s=e.match(/^@child\[(\d+)]/);return s?((i=t?.children)==null?void 0:i[parseInt(s[1],10)])||null:document.querySelector(e)||null}let l=(s=>typeof s=="function"&&"call"in s&&"apply"in s)(e)?e():e,o=je(l);return Ct(o)?o:l?.nodeType===9?l:void 0}}}function en(e,t){let n=Et(e,t);if(n)n.appendChild(t);else throw new Error("Cannot append "+t+" to "+e)}function Te(e,t={}){if(T(e)){let n=(r,i)=>{var l,o;let s=(l=e?.$attrs)!=null&&l[r]?[(o=e?.$attrs)==null?void 0:o[r]]:[];return[i].flat().reduce((a,u)=>{if(u!=null){let d=typeof u;if(d==="string"||d==="number")a.push(u);else if(d==="object"){let p=Array.isArray(u)?n(r,u):Object.entries(u).map(([c,f])=>r==="style"&&(f||f===0)?`${c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${f}`:f?c:void 0);a=p.length?a.concat(p.filter(c=>!!c)):a}}return a},s)};Object.entries(t).forEach(([r,i])=>{if(i!=null){let l=r.match(/^on(.+)/);l?e.addEventListener(l[1].toLowerCase(),i):r==="p-bind"||r==="pBind"?Te(e,i):(i=r==="class"?[...new Set(n("class",i))].join(" ").trim():r==="style"?n("style",i).join(";").trim():i,(e.$attrs=e.$attrs||{})&&(e.$attrs[r]=i),e.setAttribute(r,i))}})}}function tn(e,t={},...n){if(e){let r=document.createElement(e);return Te(r,t),r.append(...n),r}}function Le(e,t={}){return e?`<style${Object.entries(t).reduce((n,[r,i])=>n+` ${r}="${i}"`,"")}>${e}</style>`:""}function nn(e,t){if(e){e.style.opacity="0";let n=+new Date,r="0",i=function(){r=`${+e.style.opacity+(new Date().getTime()-n)/t}`,e.style.opacity=r,n=+new Date,+r<1&&("requestAnimationFrame"in window?requestAnimationFrame(i):setTimeout(i,16))};i()}}function $t(e,t){return T(e)?Array.from(e.querySelectorAll(t)):[]}function rn(e,t){return T(e)?e.matches(t)?e:e.querySelector(t):null}function on(e,t){e&&document.activeElement!==e&&e.focus(t)}function ln(e,t){if(T(e)){let n=e.getAttribute(t);return isNaN(n)?n==="true"||n==="false"?n==="true":n:+n}}function _e(e,t=""){let n=$t(e,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
2
- [href]:not([tabindex = "-1"]):not([style*="display:none"]):not([hidden])${t},
3
- input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
4
- select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
5
- textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
6
- [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
7
- [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}`),r=[];for(let i of n)getComputedStyle(i).display!="none"&&getComputedStyle(i).visibility!="hidden"&&r.push(i);return r}function sn(e,t){let n=_e(e,t);return n.length>0?n[0]:null}function an(e){if(e){let t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t}return 0}function un(e){var t;if(e){let n=(t=Pe(e))==null?void 0:t.childNodes,r=0;if(n)for(let i=0;i<n.length;i++){if(n[i]===e)return r;n[i].nodeType===1&&r++}}return-1}function dn(e,t){let n=_e(e,t);return n.length>0?n[n.length-1]:null}function cn(e){if(e){let t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:t.left+(window.pageXOffset||de(document.documentElement)||de(document.body)||0)}}return{top:"auto",left:"auto"}}function Ot(e,t){if(e){let n=e.offsetHeight;if(t){let r=getComputedStyle(e);n+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return n}return 0}function fn(){if(window.getSelection)return window.getSelection().toString();if(document.getSelection)return document.getSelection().toString()}function pn(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),t}return 0}function hn(e){if(e){let t=e.nodeName,n=e.parentElement&&e.parentElement.nodeName;return t==="INPUT"||t==="TEXTAREA"||t==="BUTTON"||t==="A"||n==="INPUT"||n==="TEXTAREA"||n==="BUTTON"||n==="A"||!!e.closest(".p-button, .p-checkbox, .p-radiobutton")}return!1}function mn(e){return!!(e&&e.offsetParent!=null)}function gn(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function yn(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function vn(){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(e)})})}function bn(e){var t;e&&("remove"in Element.prototype?e.remove():(t=e.parentNode)==null||t.removeChild(e))}function Sn(e,t){let n=je(e);if(n)n.removeChild(t);else throw new Error("Cannot remove "+t+" from "+e)}function wn(e,t){let n=getComputedStyle(e).getPropertyValue("borderTopWidth"),r=n?parseFloat(n):0,i=getComputedStyle(e).getPropertyValue("paddingTop"),l=i?parseFloat(i):0,o=e.getBoundingClientRect(),s=t.getBoundingClientRect().top+document.body.scrollTop-(o.top+document.body.scrollTop)-r-l,a=e.scrollTop,u=e.clientHeight,d=Ot(t);s<0?e.scrollTop=a+s:s+d>u&&(e.scrollTop=a+s-u+d)}function xn(e,t="",n){T(e)&&n!==null&&n!==void 0&&e.setAttribute(t,n)}function Cn(e,t,n=null,r){var i;t&&((i=e?.style)==null||i.setProperty(t,n,r))}var kt=Object.defineProperty,At=Object.defineProperties,Nt=Object.getOwnPropertyDescriptors,ie=Object.getOwnPropertySymbols,Be=Object.prototype.hasOwnProperty,Ie=Object.prototype.propertyIsEnumerable,Fe=(e,t,n)=>t in e?kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t)=>{for(var n in t||(t={}))Be.call(t,n)&&Fe(e,n,t[n]);if(ie)for(var n of ie(t))Ie.call(t,n)&&Fe(e,n,t[n]);return e},j=(e,t)=>At(e,Nt(t)),k=(e,t)=>{var n={};for(var r in e)Be.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ie)for(var r of ie(e))t.indexOf(r)<0&&Ie.call(e,r)&&(n[r]=e[r]);return n};function On(...e){return N(...e)}var Pt=$e(),P=Pt,A=/{([^}]*)}/g,Me=/(\d+\s+[\+\-\*\/]\s+\d+)/g,He=/var\([^)]+\)/g;function Re(e){return O(e)?e.replace(/[A-Z]/g,(t,n)=>n===0?t:"."+t.toLowerCase()).toLowerCase():e}function Pn(e,t){Ee(e)?e.push(...t||[]):C(e)&&Object.assign(e,t)}function jt(e){return C(e)&&e.hasOwnProperty("$value")&&e.hasOwnProperty("$type")?e.$value:e}function jn(e,t=""){return["opacity","z-index","line-height","font-weight","flex","flex-grow","flex-shrink","order"].some(n=>t.endsWith(n))?e:`${e}`.trim().split(" ").map(n=>ne(n)?`${n}px`:n).join(" ")}function Tt(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function ce(e="",t=""){return Tt(`${O(e,!1)&&O(t,!1)?`${e}-`:e}${t}`)}function Ue(e="",t=""){return`--${ce(e,t)}`}function Lt(e=""){let t=(e.match(/{/g)||[]).length,n=(e.match(/}/g)||[]).length;return(t+n)%2!==0}function Ke(e,t="",n="",r=[],i){if(O(e)){let l=e.trim();if(Lt(l))return;if(w(l,A)){let o=l.replaceAll(A,s=>{let a=s.replace(/{|}/g,"").split(".").filter(u=>!r.some(d=>w(u,d)));return`var(${Ue(n,re(a.join("-")))}${h(i)?`, ${i}`:""})`});return w(o.replace(He,"0"),Me)?`calc(${o})`:o}return l}else if(ne(e))return e}function Tn(e={},t){if(O(t)){let n=t.trim();return w(n,A)?n.replaceAll(A,r=>le(e,r.replace(/{|}/g,""))):n}else if(ne(t))return t}function _t(e,t,n){O(t,!1)&&e.push(`${t}:${n};`)}function L(e,t){return e?`${e}{${t}}`:""}function qe(e,t){if(e.indexOf("dt(")===-1)return e;function n(o,s){let a=[],u=0,d="",p=null,c=0;for(;u<=o.length;){let f=o[u];if((f==='"'||f==="'"||f==="`")&&o[u-1]!=="\\"&&(p=p===f?null:f),!p&&(f==="("&&c++,f===")"&&c--,(f===","||u===o.length)&&c===0)){let g=d.trim();g.startsWith("dt(")?a.push(qe(g,s)):a.push(r(g)),d="",u++;continue}f!==void 0&&(d+=f),u++}return a}function r(o){let s=o[0];if((s==='"'||s==="'"||s==="`")&&o[o.length-1]===s)return o.slice(1,-1);let a=Number(o);return isNaN(a)?o:a}let i=[],l=[];for(let o=0;o<e.length;o++)if(e[o]==="d"&&e.slice(o,o+3)==="dt(")l.push(o),o+=2;else if(e[o]===")"&&l.length>0){let s=l.pop();l.length===0&&i.push([s,o])}if(!i.length)return e;for(let o=i.length-1;o>=0;o--){let[s,a]=i[o],u=e.slice(s+3,a),d=n(u,t),p=t(...d);e=e.slice(0,s)+p+e.slice(a+1)}return e}function Ve(e){return e.length===4?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e}function We(e){let t=parseInt(e.substring(1),16),n=t>>16&255,r=t>>8&255,i=t&255;return{r:n,g:r,b:i}}function Ft(e,t,n){return`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}var ze=(e,t,n)=>{e=Ve(e),t=Ve(t);let r=(n/100*2-1+1)/2,i=1-r,l=We(e),o=We(t),s=Math.round(l.r*r+o.r*i),a=Math.round(l.g*r+o.g*i),u=Math.round(l.b*r+o.b*i);return Ft(s,a,u)},Rt=(e,t)=>ze("#000000",e,t),Vt=(e,t)=>ze("#ffffff",e,t),De=[50,100,200,300,400,500,600,700,800,900,950],Fn=e=>{if(w(e,A)){let t=e.replace(/{|}/g,"");return De.reduce((n,r)=>(n[r]=`{${t}.${r}}`,n),{})}return typeof e=="string"?De.reduce((t,n,r)=>(t[n]=r<=5?Vt(e,(5-r)*19):Rt(e,(r-5)*15),t),{}):e},Wn=e=>{var t;let n=x.getTheme(),r=fe(n,e,void 0,"variable"),i=(t=r?.match(/--[\w-]+/g))==null?void 0:t[0],l=fe(n,e,void 0,"value");return{name:i,variable:r,value:l}},D=(...e)=>fe(x.getTheme(),...e),fe=(e={},t,n,r)=>{if(t){let{variable:i,options:l}=x.defaults||{},{prefix:o,transform:s}=e?.options||l||{},a=w(t,A)?t:`{${t}}`;return r==="value"||W(r)&&s==="strict"?x.getTokenValue(t):Ke(a,void 0,o,[i.excludedKeyRegex],n)}return""};function Dn(e,...t){if(e instanceof Array){let n=e.reduce((r,i,l)=>{var o;return r+i+((o=$(t[l],{dt:D}))!=null?o:"")},"");return qe(n,D)}return $(e,{dt:D})}var pe=(e={})=>{let{preset:t,options:n}=e;return{preset(r){return t=t?se(t,r):r,this},options(r){return n=n?m(m({},n),r):r,this},primaryPalette(r){let{semantic:i}=t||{};return t=j(m({},t),{semantic:j(m({},i),{primary:r})}),this},surfacePalette(r){var i,l;let{semantic:o}=t||{},s=r&&Object.hasOwn(r,"light")?r.light:r,a=r&&Object.hasOwn(r,"dark")?r.dark:r,u={colorScheme:{light:m(m({},(i=o?.colorScheme)==null?void 0:i.light),!!s&&{surface:s}),dark:m(m({},(l=o?.colorScheme)==null?void 0:l.dark),!!a&&{surface:a})}};return t=j(m({},t),{semantic:m(m({},o),u)}),this},define({useDefaultPreset:r=!1,useDefaultOptions:i=!1}={}){return{preset:r?x.getPreset():t,options:i?x.getOptions():n}},update({mergePresets:r=!0,mergeOptions:i=!0}={}){let l={preset:r?se(x.getPreset(),t):t,options:i?m(m({},x.getOptions()),n):n};return x.setTheme(l),l},use(r){let i=this.define(r);return x.setTheme(i),i}}};function Wt(e,t={}){let n=x.defaults.variable,{prefix:r=n.prefix,selector:i=n.selector,excludedKeyRegex:l=n.excludedKeyRegex}=t,o=[],s=[],a=[{node:e,path:r}];for(;a.length;){let{node:d,path:p}=a.pop();for(let c in d){let f=d[c],g=jt(f),v=w(c,l)?ce(p):ce(p,re(c));if(C(g))a.push({node:g,path:v});else{let y=Ue(v),b=Ke(g,v,r,[l]);_t(s,y,b);let S=v;r&&S.startsWith(r+"-")&&(S=S.slice(r.length+1)),o.push(S.replace(/-/g,"."))}}}let u=s.join("");return{value:s,tokens:o,declarations:u,css:L(i,u)}}var E={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e},:host${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:e,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark)",matched:this.pattern.test(e.trim())}}},custom:{resolve(e){return{type:"custom",selector:e,matched:!0}}}},resolve(e){let t=Object.keys(this.rules).filter(n=>n!=="custom").map(n=>this.rules[n]);return[e].flat().map(n=>{var r;return(r=t.map(i=>i.resolve(n)).find(i=>i.matched))!=null?r:this.rules.custom.resolve(n)})}},_toVariables(e,t){return Wt(e,{prefix:t?.prefix})},getCommon({name:e="",theme:t={},params:n,set:r,defaults:i}){var l,o,s,a,u,d,p;let{preset:c,options:f}=t,g,v,y,b,S,_,B;if(h(c)&&f.transform!=="strict"){let{primitive:I,semantic:M,extend:H}=c,F=M||{},{colorScheme:U}=F,K=k(F,["colorScheme"]),q=H||{},{colorScheme:z}=q,R=k(q,["colorScheme"]),V=U||{},{dark:X}=V,Z=k(V,["dark"]),G=z||{},{dark:Y}=G,J=k(G,["dark"]),Q=h(I)?this._toVariables({primitive:I},f):{},ee=h(K)?this._toVariables({semantic:K},f):{},te=h(Z)?this._toVariables({light:Z},f):{},he=h(X)?this._toVariables({dark:X},f):{},me=h(R)?this._toVariables({semantic:R},f):{},ge=h(J)?this._toVariables({light:J},f):{},ye=h(Y)?this._toVariables({dark:Y},f):{},[Xe,Ze]=[(l=Q.declarations)!=null?l:"",Q.tokens],[Ge,Ye]=[(o=ee.declarations)!=null?o:"",ee.tokens||[]],[Je,Qe]=[(s=te.declarations)!=null?s:"",te.tokens||[]],[et,tt]=[(a=he.declarations)!=null?a:"",he.tokens||[]],[nt,rt]=[(u=me.declarations)!=null?u:"",me.tokens||[]],[it,ot]=[(d=ge.declarations)!=null?d:"",ge.tokens||[]],[lt,st]=[(p=ye.declarations)!=null?p:"",ye.tokens||[]];g=this.transformCSS(e,Xe,"light","variable",f,r,i),v=Ze;let at=this.transformCSS(e,`${Ge}${Je}`,"light","variable",f,r,i),ut=this.transformCSS(e,`${et}`,"dark","variable",f,r,i);y=`${at}${ut}`,b=[...new Set([...Ye,...Qe,...tt])];let dt=this.transformCSS(e,`${nt}${it}color-scheme:light`,"light","variable",f,r,i),ct=this.transformCSS(e,`${lt}color-scheme:dark`,"dark","variable",f,r,i);S=`${dt}${ct}`,_=[...new Set([...rt,...ot,...st])],B=$(c.css,{dt:D})}return{primitive:{css:g,tokens:v},semantic:{css:y,tokens:b},global:{css:S,tokens:_},style:B}},getPreset({name:e="",preset:t={},options:n,params:r,set:i,defaults:l,selector:o}){var s,a,u;let d,p,c;if(h(t)&&n.transform!=="strict"){let f=e.replace("-directive",""),g=t,{colorScheme:v,extend:y,css:b}=g,S=k(g,["colorScheme","extend","css"]),_=y||{},{colorScheme:B}=_,I=k(_,["colorScheme"]),M=v||{},{dark:H}=M,F=k(M,["dark"]),U=B||{},{dark:K}=U,q=k(U,["dark"]),z=h(S)?this._toVariables({[f]:m(m({},S),I)},n):{},R=h(F)?this._toVariables({[f]:m(m({},F),q)},n):{},V=h(H)?this._toVariables({[f]:m(m({},H),K)},n):{},[X,Z]=[(s=z.declarations)!=null?s:"",z.tokens||[]],[G,Y]=[(a=R.declarations)!=null?a:"",R.tokens||[]],[J,Q]=[(u=V.declarations)!=null?u:"",V.tokens||[]],ee=this.transformCSS(f,`${X}${G}`,"light","variable",n,i,l,o),te=this.transformCSS(f,J,"dark","variable",n,i,l,o);d=`${ee}${te}`,p=[...new Set([...Z,...Y,...Q])],c=$(b,{dt:D})}return{css:d,tokens:p,style:c}},getPresetC({name:e="",theme:t={},params:n,set:r,defaults:i}){var l;let{preset:o,options:s}=t,a=(l=o?.components)==null?void 0:l[e];return this.getPreset({name:e,preset:a,options:s,params:n,set:r,defaults:i})},getPresetD({name:e="",theme:t={},params:n,set:r,defaults:i}){var l,o;let s=e.replace("-directive",""),{preset:a,options:u}=t,d=((l=a?.components)==null?void 0:l[s])||((o=a?.directives)==null?void 0:o[s]);return this.getPreset({name:s,preset:d,options:u,params:n,set:r,defaults:i})},applyDarkColorScheme(e){return!(e.darkModeSelector==="none"||e.darkModeSelector===!1)},getColorSchemeOption(e,t){var n;return this.applyDarkColorScheme(e)?this.regex.resolve(e.darkModeSelector===!0?t.options.darkModeSelector:(n=e.darkModeSelector)!=null?n:t.options.darkModeSelector):[]},getLayerOrder(e,t={},n,r){let{cssLayer:i}=t;return i?`@layer ${$(i.order||i.name||"primeui",n)}`:""},getCommonStyleSheet({name:e="",theme:t={},params:n,props:r={},set:i,defaults:l}){let o=this.getCommon({name:e,theme:t,params:n,set:i,defaults:l}),s=Object.entries(r).reduce((a,[u,d])=>a.push(`${u}="${d}"`)&&a,[]).join(" ");return Object.entries(o||{}).reduce((a,[u,d])=>{if(C(d)&&Object.hasOwn(d,"css")){let p=ae(d.css),c=`${u}-variables`;a.push(`<style type="text/css" data-primevue-style-id="${c}" ${s}>${p}</style>`)}return a},[]).join("")},getStyleSheet({name:e="",theme:t={},params:n,props:r={},set:i,defaults:l}){var o;let s={name:e,theme:t,params:n,set:i,defaults:l},a=(o=e.includes("-directive")?this.getPresetD(s):this.getPresetC(s))==null?void 0:o.css,u=Object.entries(r).reduce((d,[p,c])=>d.push(`${p}="${c}"`)&&d,[]).join(" ");return a?`<style type="text/css" data-primevue-style-id="${e}-variables" ${u}>${ae(a)}</style>`:""},createTokens(e={},t,n="",r="",i={}){let l=function(s,a={},u=[]){if(u.includes(this.path))return console.warn(`Circular reference detected at ${this.path}`),{colorScheme:s,path:this.path,paths:a,value:void 0};u.push(this.path),a.name=this.path,a.binding||(a.binding={});let d=this.value;if(typeof this.value=="string"&&A.test(this.value)){let p=this.value.trim().replace(A,c=>{var f;let g=c.slice(1,-1),v=this.tokens[g];if(!v)return console.warn(`Token not found for path: ${g}`),"__UNRESOLVED__";let y=v.computed(s,a,u);return Array.isArray(y)&&y.length===2?`light-dark(${y[0].value},${y[1].value})`:(f=y?.value)!=null?f:"__UNRESOLVED__"});d=Me.test(p.replace(He,"0"))?`calc(${p})`:p}return W(a.binding)&&delete a.binding,u.pop(),{colorScheme:s,path:this.path,paths:a,value:d.includes("__UNRESOLVED__")?void 0:d}},o=(s,a,u)=>{Object.entries(s).forEach(([d,p])=>{let c=w(d,t.variable.excludedKeyRegex)?a:a?`${a}.${Re(d)}`:Re(d),f=u?`${u}.${d}`:d;C(p)?o(p,c,f):(i[c]||(i[c]={paths:[],computed:(g,v={},y=[])=>{if(i[c].paths.length===1)return i[c].paths[0].computed(i[c].paths[0].scheme,v.binding,y);if(g&&g!=="none")for(let b=0;b<i[c].paths.length;b++){let S=i[c].paths[b];if(S.scheme===g)return S.computed(g,v.binding,y)}return i[c].paths.map(b=>b.computed(b.scheme,v[b.scheme],y))}}),i[c].paths.push({path:f,value:p,scheme:f.includes("colorScheme.light")?"light":f.includes("colorScheme.dark")?"dark":"none",computed:l,tokens:i}))})};return o(e,n,r),i},getTokenValue(e,t,n){var r;let i=(s=>s.split(".").filter(a=>!w(a.toLowerCase(),n.variable.excludedKeyRegex)).join("."))(t),l=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,o=[(r=e[i])==null?void 0:r.computed(l)].flat().filter(s=>s);return o.length===1?o[0].value:o.reduce((s={},a)=>{let u=a,{colorScheme:d}=u,p=k(u,["colorScheme"]);return s[d]=p,s},void 0)},getSelectorRule(e,t,n,r){return n==="class"||n==="attr"?L(h(t)?`${e}${t},${e} ${t}`:e,r):L(e,L(t??":root,:host",r))},transformCSS(e,t,n,r,i={},l,o,s){if(h(t)){let{cssLayer:a}=i;if(r!=="style"){let u=this.getColorSchemeOption(i,o);t=n==="dark"?u.reduce((d,{type:p,selector:c})=>(h(c)&&(d+=c.includes("[CSS]")?c.replace("[CSS]",t):this.getSelectorRule(c,s,p,t)),d),""):L(s??":root,:host",t)}if(a){let u={name:"primeui",order:"primeui"};C(a)&&(u.name=$(a.name,{name:e,type:r})),h(u.name)&&(t=L(`@layer ${u.name}`,t),l?.layerNames(u.name))}return t}return""}},x={defaults:{variable:{prefix:"p",selector:":root,:host",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){let{theme:t}=e;t&&(this._theme=j(m({},t),{options:m(m({},this.defaults.options),t.options)}),this._tokens=E.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var e;return((e=this.theme)==null?void 0:e.preset)||{}},get options(){var e;return((e=this.theme)==null?void 0:e.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),P.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme=j(m({},this.theme),{preset:e}),this._tokens=E.createTokens(e,this.defaults),this.clearLoadedStyleNames(),P.emit("preset:change",e),P.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme=j(m({},this.theme),{options:e}),this.clearLoadedStyleNames(),P.emit("options:change",e),P.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return E.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return E.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){let n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return E.getPresetC(n)},getDirective(e="",t){let n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return E.getPresetD(n)},getCustomPreset(e="",t,n,r){let i={name:e,preset:t,options:this.options,selector:n,params:r,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return E.getPreset(i)},getLayerOrderCSS(e=""){return E.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,n="style",r){return E.transformCSS(e,t,r,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,n={}){return E.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,n={}){return E.getStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),P.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&P.emit("theme:load"))}};function Mn(...e){let t=N(x.getPreset(),...e);return x.setPreset(t),t}function Hn(e){return pe().primaryPalette(e).update().preset}function Un(e){return pe().surfacePalette(e).update().preset}function qn(...e){let t=N(...e);return x.setPreset(t),t}function zn(e){return pe(e).update({mergePresets:!1})}var Dt=class{constructor({attrs:e}={}){this._styles=new Map,this._attrs=e||{}}get(e){return this._styles.get(e)}has(e){return this._styles.has(e)}delete(e){this._styles.delete(e)}clear(){this._styles.clear()}add(e,t){if(h(t)){let n={name:e,css:t,attrs:this._attrs,markup:Le(t,this._attrs)};this._styles.set(e,j(m({},n),{element:this.createStyleElement(n)}))}}update(){}getStyles(){return this._styles}getAllCSS(){return[...this._styles.values()].map(e=>e.css).filter(String)}getAllMarkup(){return[...this._styles.values()].map(e=>e.markup).filter(String)}getAllElements(){return[...this._styles.values()].map(e=>e.element)}createStyleElement(e={}){}},Zn=Dt;export{vt as a,Oe as b,Xt as c,ke as d,Zt as e,ue as f,Ae as g,Ne as h,St as i,wt as j,Gt as k,Yt as l,Jt as m,Qt as n,Et as o,en as p,Te as q,tn as r,nn as s,$t as t,rn as u,on as v,ln as w,_e as x,sn as y,an as z,un as A,dn as B,cn as C,Ot as D,fn as E,pn as F,hn as G,mn as H,gn as I,yn as J,vn as K,bn as L,Sn as M,wn as N,xn as O,Cn as P,W as Q,gt as R,xe as S,h as T,Se as U,yt as V,Bt as W,It as X,$ as Y,O as Z,we as _,le as $,Ee as aa,Mt as ba,Ht as ca,ae as da,Ut as ea,Kt as fa,On as ga,P as ha,A as ia,Me as ja,He as ka,Re as la,Pn as ma,jt as na,jn as oa,Tt as pa,ce as qa,Ue as ra,Lt as sa,Ke as ta,Tn as ua,_t as va,L as wa,qe as xa,ze as ya,Rt as za,Vt as Aa,Fn as Ba,Wn as Ca,D as Da,fe as Ea,Dn as Fa,pe as Ga,Wt as Ha,E as Ia,x as Ja,Mn as Ka,Hn as La,Un as Ma,qn as Na,zn as Oa,Zn as Pa};
@@ -1 +0,0 @@
1
- var g=Object.defineProperty,j=Object.defineProperties;var k=Object.getOwnPropertyDescriptors;var e=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;var f=(a,b,c)=>b in a?g(a,b,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[b]=c,l=(a,b)=>{for(var c in b||={})h.call(b,c)&&f(a,c,b[c]);if(e)for(var c of e(b))i.call(b,c)&&f(a,c,b[c]);return a},m=(a,b)=>j(a,k(b));var n=(a,b)=>{var c={};for(var d in a)h.call(a,d)&&b.indexOf(d)<0&&(c[d]=a[d]);if(a!=null&&e)for(var d of e(a))b.indexOf(d)<0&&i.call(a,d)&&(c[d]=a[d]);return c};var o=(a,b)=>{for(var c in b)g(a,c,{get:b[c],enumerable:!0})};export{l as a,m as b,n as c,o as d};