@hy-bricks/core 0.5.0 → 0.6.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @hy-bricks/core
2
2
 
3
+ ## [0.6.1] - 2026-06-16
4
+
5
+ 随 @hy-bricks fixed 组同步升 0.6.1;本包**无功能改动**(本次仅 `@hy-bricks/canvas` free-split 控件可见性修复 + `freeSplitControlsAlways` 常驻开关)。
6
+
7
+ ## [0.6.0] - 2026-06-15 · 公开面收口 + 坑点修复
8
+
9
+ deliberate API 收口的 minor。从 `@hy-bricks/core` 公开面删掉一批本不该外露的 test-only / SDK 内部符号(收紧合同,业务侧本就不该调),并合入本轮审计发现的运行时坑点修复 + 性能 + 类型收口。@hy-bricks 4 包同步升 0.6.0。
10
+
11
+ ### ⚠️ BREAKING — 公开面移除(test-only / SDK 内部符号)
12
+
13
+ 下列符号从 `@hy-bricks/core` 公开 barrel(及 `dist/index.d.ts`)移除。它们都是 SDK 内部 / 测试隔离用途,源码早已注明"业务不该调";误调会清空全局实例注册表 / lifecycle emitter / 诊断总闸,导致线上 host 活实例全失联。**正常业务零受影响**(从未公开宣传过):
14
+
15
+ - `__resetRegistry` / `__resetLifecycleEmitter` / `__resetDiagnosticsEventsFlag` —— 测试隔离 reset。仍从各自源模块导出供 SDK 内部 spec 走深路径 import。
16
+ - `patchInstanceTimings` / `consumePendingTimings` / `clearInstanceTimings` —— timing buffer 写/清 plumbing(RuntimeBox 打点路径内部用)。**公开面只保留读侧** `getInstanceTimings` + `InstanceTimings` 类型。
17
+ - `debugScopedCssRefs` —— dev 调试 helper,收回 internal;同时删掉其返回类型里 `@deprecated componentId` alias 字段(D 阶段 scopeId ≠ componentId,新代码用 `scopeId`)。
18
+
19
+ ### 🐛 Fixes(本轮审计坑点)
20
+
21
+ - 编译失败路径的 timing buffer 永久泄漏:`RuntimeBox` 卸载无条件 `clearInstanceTimings`(用户 JS 语法错反复编译的长会话不再内存只增不减)。
22
+ - `RuntimeBox` 改 `instanceId` / `canvasId`(source 不变)现在正确按新 id 重注册 + 旧 id 注销(此前旧 handle 泄漏、新 id registry 查不到)。
23
+ - **runtime-only Vue fail-fast**(宿主接入级陷阱,hyperdeck 实踩):宿主漏配 `vue → vue/dist/vue.esm-bundler.js` 别名时 `Vue.compile` 是 no-op stub,组件全部静默渲染成空盒子且常规测试测不出。现在 `compileComponent` 检测 compile 产物非函数直接抛带别名指引的错误。正常宿主(完整版 Vue)零影响。
24
+ - 同 `(canvasId, instanceId)` 被新实例覆盖注册后,旧实例卸载不再按 id **误删新实例**(C13):编译产物 beforeUnmount 先校验 registry 当前 handle 的 `vm` 还是自己才注销。复审补刀:`RuntimeBox` 的 id-rebind watcher(改 instanceId/canvasId 摘旧 key)同口径加 owner 守卫(内层实例 ref 身份比较),旧 id 被接管时不误删接管者。
25
+ - `parseComponentSource` 契约 JSON-safe(C12):custom 默认值写正则字面量(此前序列化成 `{}`)/ BigInt 字面量(此前 `JSON.stringify` 直接 TypeError)现降级为源码原文字符串(`node.raw`)。
26
+
27
+ ### ⚡ Perf / 🧹 Refactor
28
+
29
+ - 类型洞收口:`ComponentInstanceHandle.call<T>` / `CanvasesRegistryAPI.callComponent<T>` 去掉 `as never`(返回值不再无声 assign 给调用方 T);`literalValue` 窄化;`_timings` 私挂改为接口可选只读字段。
30
+
3
31
  ## [0.5.0] - 2026-06-03
4
32
 
5
33
  随 @hy-bricks fixed 组(canvas `free-split` 发版)同步升 0.5.0;`@hy-bricks/core` **无功能改动**。
@@ -147,4 +175,4 @@ grep -rn "instance:ready\|onInstanceLifecycle\|getInstanceReady" src/
147
175
  - 用了就简化:`handle.on("instance:ready", id => { const c = handle.getCachedBySourceId(src); if (c?.status === "success") handle.getInstanceRuntime(id)?.setDataInput?.(key, c.value) })`
148
176
  - workaround(`replayFromCache` / `mountConcurrency:50` / 首屏 reload)**可保留**,SDK 不强制删
149
177
 
150
- 详见 `docs/v1/frontend-sdk/20260523-1648-claude-渲染核心-挂载就绪信号-实施稿-rev1.md`。
178
+ 详见 `docs/archive/development-history/v1/frontend-sdk/20260523-1648-claude-渲染核心-挂载就绪信号-实施稿-rev1.md`。
package/README.md CHANGED
@@ -138,7 +138,6 @@ pnpm add @hy-bricks/core
138
138
  | `injectScopedCss(scopeId, rawCss)` | 只刷新内容,不动 refCount(`watch(cssSource)` 用)|
139
139
  | `removeScopedCss(scopeId)` | 强制移除(测试 / reset 用)|
140
140
  | `getScopedCssCount()` | 返回已挂载 scope 个数 |
141
- | `debugScopedCssRefs()` | dev 调试,返回每个 scope 的 `{scopeId, componentId(deprecated alias), refCount, cssHash}` |
142
141
 
143
142
  > 注意:`compileComponent` 的 LRU 缓存**仍按 sourceHash**(不分 scopeId)— 编译产物只跟 html/js 有关,加 scopeId 反而降低复用率。`scopeId` 只管 CSS / DOM 隔离。
144
143
 
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("./parseSourceEntry-UTE53-N3.cjs"),s=function(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const s in e)if("default"!==s){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}(e);function n(e){return{all:e=e||new Map,on:function(t,s){var n=e.get(t);n?n.push(s):e.set(t,[s])},off:function(t,s){var n=e.get(t);n&&(s?n.splice(n.indexOf(s)>>>0,1):e.set(t,[]))},emit:function(t,s){var n=e.get(t);n&&n.slice().map(function(e){e(s)}),(n=e.get("*"))&&n.slice().map(function(e){e(t,s)})}}}const r=new Map;function o(e,t){return`${e}::${t}`}function i(e,t,s){const n=k(t,e);if(n)return void Object.assign(function(e){const t=e;return t._timings||(t._timings={}),t._timings}(n),s);const i=o(e,t),a=r.get(i)??{};r.set(i,{...a,...s})}function a(e,t){const s=o(e,t),n=r.get(s);return n?(r.delete(s),n):null}function l(e,t){r.delete(o(e,t))}let c=0;function u(){return c>0}const h=n(),p="__default__",f="__hcCanvasId",d=e.ref(0),m=n();function g(e,t){m.emit(e,t)}const y=new Set,w=new Map,v=n();function b(e,t,s,r){var o;const i=function(e,t){return`${e}\0${t}`}(e,t);if(y.has(i)){const s=`[hc-registry] re-entrant registerInCanvas("${e}", "${t}") detected — a lifecycle listener tried to register the same id while the outer register is in flight. Nested register blocked to prevent state divergence; defer your register via microtask / setTimeout if you need to re-mount on lifecycle events.`;throw console.warn(s),new Error(s)}y.add(i);try{const i=!w.has(e),l=function(e){let t=w.get(e);return t||(t=new Map,w.set(e,t)),t}(e);l.has(t)&&(console.warn(`[hc-registry] instance ${t} already registered in canvas "${e}", overwriting`),null==(o=l.get(t))||o.__dispose(),l.delete(t),g("instance:unmounted",{canvasId:e,instanceId:t}));const c=function(e,t,s,r){const o=n();function i(n,r,o){if(u())try{h.emit("interaction",{canvasId:e,instanceId:t,componentId:s,kind:n,key:r,args:o,timestamp:performance.now()})}catch(e){console.warn(`[hc-registry] interactionEmitter.emit threw on ${n}("${r}"); diagnostic stream broken for this event`,e)}}return{instanceId:t,componentId:s,vm:r,call(e,...s){i("call",e,s);const n=r[e];if("function"!=typeof n)throw new Error(`[hc-registry] method "${e}" not found on instance ${t}`);return n.apply(r,s)},on:(e,t)=>(o.on(e,t),()=>o.off(e,t)),emit(e,t){i("emit",e,[t]),o.emit(e,t)},setProp(e,t){i("setProp",e,[t]),r[e]=t},setDataInput(e,s){i("setDataInput",e,[s]);const n=r.custom;if(!n||!(e in n))return void console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] not declared on instance ${t}; binding 改了一个未声明的 dataInput key,组件不会响应`);const o=n[e];o&&"object"==typeof o?!0===o.dataInput?o.value=s:console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] is not declared with dataInput:true on instance ${t}; 请在组件源码 custom.${e} 上加 \`dataInput: true\` 才能被 binding 灌入`):console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] not a {value:...} slot`)},__dispose(){o.all.clear()}}}(e,t,s,r);l.set(t,c);const p=a(e,t);return p&&(c._timings={...p}),d.value++,i&&v.emit("canvas:added",{canvasId:e}),g("instance:ready",{canvasId:e,instanceId:t}),c}finally{y.delete(i)}}function x(e){const t=w.get(e);if(!t)return;const s=[];for(const[n,r]of t)r.__dispose(),s.push(n),l(e,n);t.clear(),w.delete(e),d.value++;for(const t of s)g("instance:unmounted",{canvasId:e,instanceId:t});v.emit("canvas:removed",{canvasId:e})}function C(){return[...w.keys()]}function S(e,t=p){const s=w.get(t);if(!s)return;const n=s.get(e);n&&(n.__dispose(),s.delete(e),l(t,e),d.value++,g("instance:unmounted",{canvasId:t,instanceId:e}))}function k(e,t){var s;if(void 0!==t)return(null==(s=w.get(t))?void 0:s.get(e))??null;let n=null;const r=[];for(const[t,s]of w){const o=s.get(e);o&&(n||(n=o),r.push(t))}return r.length>1&&console.warn(`[hc-registry] getInstance("${e}") matched ${r.length} canvases [${r.join(", ")}]; returning first. Prefer __HYPERCARD__.canvases.callComponent(canvasId, instanceId, ...) for explicit scope.`),n}function I(e){const t=null==e?void 0:e.componentId,s=t?e=>e.componentId===t:()=>!0;if(void 0!==(null==e?void 0:e.canvasId)){const t=w.get(e.canvasId);return t?[...t.values()].filter(s):[]}const n=[];for(const e of w.values())for(const t of e.values())s(t)&&n.push(t);return n}const O={getInstance:k,listInstances:I,call(e,t,...s){const n=k(e);if(n)return n.call(t,...s);console.debug(`[hc-runtime] call: instance "${e}" not found`)},on(e,t,s){const n=k(e);if(n)return n.on(t,s);console.debug(`[hc-runtime] on: instance "${e}" not found`)},emit(e,t,s){const n=k(e);n?n.emit(t,s):console.debug(`[hc-runtime] emit: instance "${e}" not found`)}},E={pickerUrl:e=>`/a/${e}`};function A(e){return{canvasId:e,listInstances:t=>I({canvasId:e,componentId:null==t?void 0:t.componentId}),getInstance:t=>k(t,e),call(t,s,...n){const r=k(t,e);if(r)try{return r.call(s,...n)}catch(n){return void console.warn(`[hc-canvases] call error: canvas="${e}" instance="${t}" method="${s}":`,n)}else console.warn(`[hc-canvases] call: instance "${t}" not found in canvas "${e}"`)},emit(t,s,n){const r=k(t,e);if(r)try{r.emit(s,n)}catch(n){console.warn(`[hc-canvases] emit error: canvas="${e}" instance="${t}" event="${s}":`,n)}else console.warn(`[hc-canvases] emit: instance "${t}" not found in canvas "${e}"`)},broadcastInCanvas(t,s){const n=I({canvasId:e});for(const r of n)try{r.emit(t,s)}catch(s){console.warn(`[hc-canvases] broadcastInCanvas: canvas="${e}" instance="${r.instanceId}" event="${t}" emit failed:`,s)}},dispose(){x(e)}}}function P(){return{list:()=>C().map(e=>A(e)),get:e=>C().includes(e)?A(e):null,getAll(){const e={};for(const t of C())e[t]=A(t);return e},callComponent(e,t,s,...n){const r=k(t,e);if(r)try{return r.call(s,...n)}catch(n){return void console.warn(`[hc-canvases] callComponent error: canvas="${e}" instance="${t}" method="${s}":`,n)}else console.warn(`[hc-canvases] callComponent: canvas="${e}" instance="${t}" not found`)},emitToCanvas(e,t,s,n){const r=k(t,e);if(r)try{r.emit(s,n)}catch(n){console.warn(`[hc-canvases] emitToCanvas error: canvas="${e}" instance="${t}" event="${s}":`,n)}else console.warn(`[hc-canvases] emitToCanvas: canvas="${e}" instance="${t}" not found`)},broadcast(e,t){for(const s of C())try{const n=I({canvasId:s});for(const r of n)try{r.emit(e,t)}catch(t){console.warn(`[hc-canvases] broadcast: canvas="${s}" instance="${r.instanceId}" event="${e}" emit failed:`,t)}}catch(t){console.warn(`[hc-canvases] broadcast: canvas="${s}" event="${e}" failed:`,t)}}}}const $=new Set(["vue","Vue","window","global","globalThis","console","document","process","$","libs","runtime","assets","version"]);function _(e){return Array.isArray(e)&&e.length>=1?_(e[0]):"object"==typeof e&&null!==e&&"function"==typeof e.install}function R(e){return Array.isArray(e)&&e.length>=1?[e[0],e.slice(1)]:[e,[]]}function j(e){return _(e)?Array.isArray(e)?"✓ Vue plugin (with options) → 已 app.use":"✓ Vue plugin → 已 app.use":"function"==typeof e?"· function":Array.isArray(e)?"· array":"object"==typeof e&&null!==e?"· object":"· "+typeof e}const M="__HYPERCARD__",B=new Set(["init","onClick","onMouseover","onMouseout","onResize","onDestroy"]),D=new Map;function U(e,t){for(D.has(e)&&D.delete(e),D.set(e,t);D.size>100;){const e=D.keys().next().value;if(void 0===e)break;D.delete(e)}}function z(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s)|0;return(t>>>0).toString(36)}function L(e){if(!Array.isArray(e))return[];const t=[];for(const s of e){if(!s||"object"!=typeof s)continue;const e=s;if("string"!=typeof e.name)continue;const n={name:e.name};"boolean"==typeof e.multiple&&(n.multiple=e.multiple),Array.isArray(e.accepts)&&(n.accepts=e.accepts.filter(e=>"string"==typeof e)),"number"==typeof e.maxChildren&&(n.maxChildren=e.maxChildren),"string"==typeof e.label&&(n.label=e.label),t.push(n)}return t}async function F(e){const n=z(e.html)+"_"+z(e.js),r=D.get(n);if(r)return U(n,r),r;const o=(async()=>function(e,t){if(!e||"object"!=typeof e)throw new Error("[hc-compile] component.js must `export default` an object");const n=e,r=n.name,o=n.method??{},a=n.attribute??{},l=n.custom??{},c=n.style??{},u=n.slots,h=n.data,p=n.methods??{},f=n.computed,d=n.watch,m=n.created,g=n.mounted,y=n.beforeUnmount,w=n.props,v=new Set(["name","method","attribute","custom","style","option","data","methods","computed","watch","created","mounted","beforeUnmount","props","slots"]),x={};for(const e of Object.keys(n))v.has(e)||(x[e]=n[e]);const C={};for(const[e,t]of Object.entries(o))B.has(e)||"function"!=typeof t||(C[e]=t);const k=Object.keys(C),I={...C,...p},O=(t??"").trim()||"<div></div>";return{options:{render:s.compile(O),props:{...w?Array.isArray(w)?Object.fromEntries(w.map(e=>[e,null])):"object"==typeof w?w:{}:{},hcCustomValues:{type:Object,default:()=>({})},hcInstanceId:{type:String,default:""},hcCanvasId:{type:String,default:""},hcComponentId:{type:String,default:""}},data(){const e="function"==typeof h?h.call(this):h??{},t=this.hcCustomValues??{},s={};for(const[e,n]of Object.entries(l)){let r;try{r=JSON.parse(JSON.stringify(n??{}))}catch{r={...n??{}}}e in t&&r&&"object"==typeof r&&(r.value=t[e]),s[e]=r}return{custom:s,...e}},methods:I,computed:f,watch:(()=>{const e=d&&"object"==typeof d?{...d}:{};return e.hcCustomValues={handler(e){if(e&&this.custom)for(const[t,s]of Object.entries(e)){const e=this.custom[t];e&&"object"==typeof e&&(e.value=s)}},deep:!0},e})(),created(){this.hcInstanceId&&this.hcCanvasId&&b(this.hcCanvasId,this.hcInstanceId,this.hcComponentId,this),"function"==typeof m&&m.call(this)},mounted(){try{const e=[],t=this.$el;if(t&&t instanceof HTMLElement){Object.assign(t.style,c);for(const[e,s]of Object.entries(a))"string"==typeof s&&s&&t.setAttribute(e,s);for(const s of B){if("init"===s)continue;const n=o[s];if("function"==typeof n){const r=s.replace(/^on/,"").toLowerCase(),o=e=>{n.call(this,{event:e,data:e})};t.addEventListener(r,o),e.push(()=>t.removeEventListener(r,o))}}}this.__hcCleanup=e;const s=o.init;"function"==typeof s&&s.call(this),"function"==typeof g&&g.call(this)}finally{const e=this.hcInstanceId,t=this.hcCanvasId;"string"==typeof e&&e.length>0&&"string"==typeof t&&t.length>0&&i(t,e,{mountEndedAt:performance.now()})}},beforeUnmount(){var e;this.hcInstanceId&&this.hcCanvasId&&S(this.hcInstanceId,this.hcCanvasId),null==(e=this.__hcCleanup)||e.forEach(e=>{try{e()}catch{}}),this.__hcCleanup=void 0,"function"==typeof y&&y.call(this)},...x},meta:{name:r,attribute:a,style:c,customDecl:l,methodNames:k,slotsDecl:L(u)}}}(function(e){let s;try{const n=t.parse(e,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:!0}).body.find(e=>"ExportDefaultDeclaration"===e.type);if(!n)throw new Error("[hc-compile] component.js must `export default` an object");s=e.slice(0,n.start)+"module.exports = "+e.slice(n.declaration.start)}catch(e){throw e instanceof Error?e:new Error(String(e))}const n=new Function("module","exports",`"use strict";\n${s}\n;return module.exports;`),r={exports:{}};try{return n(r,r.exports)}catch(e){throw e instanceof Error?e:new Error(String(e))}}(e.js),e.html))();return U(n,o),o.catch(()=>D.delete(n)),o}var N,V={exports:{}};const T=function(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),s}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var W,H,J,Y,G,q;function K(){if(H)return W;H=1;let e=function(){if(N)return V.exports;N=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return V.exports=t(),V.exports.createColors=t,V.exports}(),t=T;class s extends Error{constructor(e,t,n,r,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),r&&(this.source=r),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(s){if(!this.source)return"";let n=this.source;null==s&&(s=e.isColorSupported);let r=e=>e,o=e=>e,i=e=>e;if(s){let{bold:s,gray:n,red:a}=e.createColors(!0);o=e=>s(a(e)),r=e=>n(e),t&&(i=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let s=l+1+t,n=" "+(" "+s).slice(-u)+" | ";if(s===this.line){if(e.length>160){let t=20,s=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(s,a),c=r(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return o(">")+r(n)+i(l)+"\n "+c+o("^")}let t=r(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+r(n)+i(e)+"\n "+t+o("^")}return" "+r(n)+i(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return W=s,s.default=s,W}function Z(){if(Y)return J;Y=1;const e=/(<)(\/?style\b)/gi,t=/(<)(!--)/g;function s(s){return"string"!=typeof s?s:s.includes("<")?s.replace(e,"\\3c $2").replace(t,"\\3c $2"):s}const n={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class r{constructor(e){this.builder=e}atrule(e,t){let n=e.raws,r="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(void 0!==n.afterName?r+=n.afterName:o&&(r+=" "),e.nodes)this.block(e,r+o);else{let i=(n.between||"")+(t?";":"");this.builder(s(r+o+i),e)}}beforeAfter(e,t){let s;s="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,r=0;for(;n&&"root"!==n.type;)r+=1,n=n.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<r;e++)s+=t}return s}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(s(t+r)+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(s(n)),this.builder("}",e,"end")}body(e){let t=e.nodes,n=t.length-1;for(;n>0&&"comment"===t[n].type;)n-=1;let r=this.raw(e,"semicolon"),o="document"===e.type;for(let e=0;e<t.length;e++){let i=t[e],a=this.raw(i,"before");a&&this.builder(o?a:s(a)),this.stringify(i,n!==e||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder(s("/*"+t+e.text+n+"*/"),e)}decl(e,t){let n=e.raws,r=this.raw(e,"between","colon"),o=e.prop+r+this.rawValue(e,"value");e.important&&(o+=n.important||" !important"),t&&(o+=";"),this.builder(s(o),e)}document(e){this.body(e)}raw(e,t,s){let r;if(s||(s=t),t&&(r=e.raws[t],void 0!==r))return r;let o=e.parent;if("before"===s){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return n[s];let i=e.root(),a=i.rawCache||(i.rawCache={});if(void 0!==a[s])return a[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let n="raw"+((l=s)[0].toUpperCase()+l.slice(1));this[n]?r=this[n](i,e):i.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var l;return void 0===r&&(r=n[s]),a[s]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let n=s.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let s=e[t],n=e.raws[t];return n&&n.value===s?n.raw:s}root(e){if(this.body(e),e.raws.after){let t=e.raws.after,n=e.parent&&"document"===e.parent.type;this.builder(n?t:s(t))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(s(e.raws.ownSemicolon),e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return J=r,r.default=r,J}function Q(){if(q)return G;q=1;let e=Z();function t(t,s){new e(s).stringify(t)}return G=t,t.default=t,G}var X,ee,te,se,ne,re,oe,ie,ae,le,ce,ue,he,pe,fe,de,me,ge,ye,we,ve,be,xe,Ce,Se,ke,Ie,Oe,Ee,Ae,Pe,$e,_e,Re,je,Me,Be,De,Ue,ze,Le,Fe,Ne,Ve,Te,We,He,Je,Ye,Ge={};function qe(){return X||(X=1,Ge.isClean=Symbol("isClean"),Ge.my=Symbol("my")),Ge}function Ke(){if(te)return ee;te=1;let e=K(),t=Z(),s=Q(),{isClean:n,my:r}=qe();function o(e,t){let s=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let r=e[n],i=typeof r;"parent"===n&&"object"===i?t&&(s[n]=t):"source"===n?s[n]=r:Array.isArray(r)?s[n]=r.map(e=>o(e,s)):("object"===i&&null!==r&&(r=o(r)),s[n]=r)}return s}function i(e,t){if(t&&void 0!==t.offset)return t.offset;let s=1,n=1,r=0;for(let o=0;o<e.length;o++){if(n===t.line&&s===t.column){r=o;break}"\n"===e[o]?(s=1,n+=1):s+=1}return r}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[r]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let s in e)t[s]=e[s];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(t,s={}){if(this.source){let{end:e,start:n}=this.rangeBy(s);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},s)}return new e(t)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,n=s.slice(i(s,this.source.start),i(s,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,s=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,r=i(n,this.source.start),o=r+e;for(let e=r;e<o;e++)"\n"===n[e]?(t=1,s+=1):t+=1;return{column:t,line:s,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:i(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:i(t,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(e.word){let r=t.slice(i(t,this.source.start),i(t,this.source.end)).indexOf(e.word);-1!==r&&(s=this.positionInside(r),n=this.positionInside(r+e.word.length))}else e.start?s={column:e.start.column,line:e.start.line,offset:i(t,e.start)}:e.index&&(s=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:i(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<s.line||n.line===s.line&&n.column<=s.column)&&(n={column:s.column+1,line:s.line,offset:s.offset+1}),{end:n,start:s}}raw(e,s){return(new t).raw(this,e,s)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,s=!1;for(let n of e)n===this?s=!0:s?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},n=null==t;t=t||new Map;let r=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))s[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)s[e]=n.toJSON(null,t);else if("source"===e){if(null==n)continue;let o=t.get(n.input);null==o&&(o=r,t.set(n.input,r),r++),s[e]={end:n.end,inputId:o,start:n.start}}else s[e]=n}return n&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s={}){let n={node:this};for(let e in s)n[e]=s[e];return e.warn(t,n)}}return ee=a,a.default=a,ee}function Ze(){if(ne)return se;ne=1;let e=Ke();class t extends e{constructor(e){super(e),this.type="comment"}}return se=t,t.default=t,se}function Qe(){if(oe)return re;oe=1;let e=Ke();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return re=t,t.default=t,re}function Xe(){if(ae)return ie;ae=1;let e,t,s,n,r=Ze(),o=Qe(),i=Ke(),{isClean:a,my:l}=qe();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends i{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,s,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[n]+=1;return delete this.indexes[n],s}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)s=this.indexes[e],n<s&&(this.indexes[e]=s+r.length);return this.markDirty(),this}insertBefore(e,t){let s,n=this.index(e),r=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)s=this.indexes[e],n<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(s,i){if("string"==typeof s)s=c(t(s).nodes);else if(void 0===s)s=[];else if(Array.isArray(s)){s=s.slice(0);for(let e of s)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===s.type&&"document"!==this.type){s=s.nodes.slice(0);for(let e of s)e.parent&&e.parent.removeChild(e,"ignore")}else if(s.type)s=[s];else if(s.prop){if(void 0===s.value)throw new Error("Value field is missed in node creation");"string"!=typeof s.value&&(s.value=String(s.value)),s=[new o(s)]}else if(s.selector||s.selectors)s=[new n(s)];else if(s.name)s=[new e(s)];else{if(!s.text)throw new Error("Unknown node type in node creation");s=[new r(s)]}return s.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let n;try{n=e(t,s)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,n)=>{if("atrule"===s.type&&e.test(s.name))return t(s,n)}):this.walk((s,n)=>{if("atrule"===s.type&&s.name===e)return t(s,n)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,n)=>{if("decl"===s.type&&e.test(s.prop))return t(s,n)}):this.walk((s,n)=>{if("decl"===s.type&&s.prop===e)return t(s,n)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,n)=>{if("rule"===s.type&&e.test(s.selector))return t(s,n)}):this.walk((s,n)=>{if("rule"===s.type&&s.selector===e)return t(s,n)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,s)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{s=e},ie=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,o.prototype):"comment"===t.type?Object.setPrototypeOf(t,r.prototype):"root"===t.type&&Object.setPrototypeOf(t,s.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},ie}function et(){if(ce)return le;ce=1;let e=Xe();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return le=t,t.default=t,e.registerAtRule(t),le}function tt(){if(he)return ue;he=1;let e,t,s=Xe();class n extends s{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(s={}){return new e(new t,this,s).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},ue=n,n.default=n,ue}function st(){if(me)return de;me=1;let{existsSync:e,readFileSync:t}=T,{dirname:s,join:n}=T,{SourceMapConsumer:r,SourceMapGenerator:o}=T;class i{constructor(e,t){if(!1===t.map)return;t.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new r(this.json||this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let s=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(s)return n=e.substr(s[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let r=e.slice(22);throw r=r.slice(0,r.indexOf(",")),new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let s=e.lastIndexOf(t.pop()),n=e.indexOf("*/",s);s>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,n)))}loadFile(n,r,o){if(o||this.unsafeMap||/\.map$/i.test(n))return this.root=s(n),e(n)?(this.mapFile=n,t(n,"utf-8").toString().trim()):void 0}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return o.fromSourceMap(t).toString();if(t instanceof o)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let t=this.loadFile(s,e,!0);if(!t)throw new Error("Unable to load previous source map: "+s.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;e&&(t=n(s(e),t));let r=this.loadFile(t,e,!1);if(r)try{this.json=JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return r}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return de=i,i.default=i,de}function nt(){if(ye)return ge;ye=1;let{nanoid:e}=fe?pe:(fe=1,pe={nanoid:(e=21)=>{let t="",s=0|e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(s=t)=>{let n="",r=0|s;for(;r--;)n+=e[Math.random()*e.length|0];return n}}),{isAbsolute:t,resolve:s}=T,{SourceMapConsumer:n,SourceMapGenerator:r}=T,{fileURLToPath:o,pathToFileURL:i}=T,a=K(),l=st(),c=T,u=Symbol("lineToIndexCache"),h=Boolean(n&&r),p=Boolean(s&&t);function f(e){if(e[u])return e[u];let t=e.css.split("\n"),s=new Array(t.length),n=0;for(let e=0,r=t.length;e<r;e++)s[e]=n,n+=t[e].length+1;return e[u]=s,s}class d{get from(){return this.file||this.id}constructor(n,r={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,r.document&&(this.document=r.document.toString()),r.from&&(!p||/^\w+:\/\//.test(r.from)||t(r.from)?this.file=r.from:this.file=s(r.from)),p&&h){let e=new l(this.css,r);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,n={}){let r,o,l,c,u;if(t&&"object"==typeof t){let e=t,n=s;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,s=n.col}else t=e.line,s=e.column,c=this.fromLineAndColumn(t,s);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);o=e.line,r=e.col}else o=n.line,r=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(s)c=this.fromLineAndColumn(t,s);else{c=t;let e=this.fromOffset(c);t=e.line,s=e.col}let h=this.origin(t,s,o,r);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:r,line:o},this.css,this.file,n.plugin),u.input={column:s,endColumn:r,endLine:o,endOffset:l,line:t,offset:c,source:this.css},this.file&&(i&&(u.input.url=i(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return f(this)[e-1]+t-1}fromOffset(e){let t=f(this),s=0;if(e>=t[t.length-1])s=t.length-1;else{let n,r=t.length-2;for(;s<r;)if(n=s+(r-s>>1),e<t[n])r=n-1;else{if(!(e>=t[n+1])){s=n;break}s=n+1}}return{col:e-t[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:s(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,s,n,r){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:s,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:r,line:n})),l=t(u.source)?i(u.source):new URL(u.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");h.file=o(l)}let p=c.sourceContentFor(u.source);return p&&(h.source=p),h}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}return ge=d,d.default=d,c&&c.registerInput&&c.registerInput(d),ge}function rt(){if(ve)return we;ve=1;let e,t,s=Xe();class n extends s{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let n=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(s={}){return new e(new t,this,s).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},we=n,n.default=n,s.registerRoot(n),we}function ot(){if(xe)return be;xe=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,s){let n=[],r="",o=!1,i=0,a=!1,l="",c=!1;for(let s of e)c?c=!1:"\\"===s?c=!0:a?s===l&&(a=!1):'"'===s||"'"===s?(a=!0,l=s):"("===s?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==r&&n.push(r.trim()),r="",o=!1):r+=s;return(s||""!==r)&&n.push(r.trim()),n}};return be=e,e.default=e,be}function it(){if(Se)return Ce;Se=1;let e=Xe(),t=ot();class s extends e{get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Ce=s,s.default=s,e.registerRule(s),Ce}function at(){if(Ee)return Oe;Ee=1;let{dirname:e,relative:t,resolve:s,sep:n}=T,{SourceMapConsumer:r,SourceMapGenerator:o}=T,{pathToFileURL:i}=T,a=nt(),l=Boolean(r&&o),c=Boolean(e&&s&&t&&n);return Oe=class{constructor(e,t,s,n){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let s,n=this.toUrl(this.path(t.file)),o=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(s=new r(t.text),s.sourcesContent&&(s.sourcesContent=null)):s=t.consumer(),this.map.applySourceMap(s,n,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else if(this.css){let e;for(;-1!==(e=this.css.lastIndexOf("/*#"));){let t=this.css.indexOf("*/",e+3);if(-1===t)break;for(;e>0&&"\n"===this.css[e-1];)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}generate(){if(this.clearAnnotation(),c&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=o.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=s,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=o.match(/\n/g),t?(s+=t.length,e=o.lastIndexOf("\n"),n=o.length-e):n+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=s,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=s,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let r=this.memoizedPaths.get(n);if(r)return r;let o=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=e(s(o,this.mapOpts.annotation)));let i=t(o,n);return this.memoizedPaths.set(n,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let n=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(i){let t=i(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===n&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}}}function lt(){if(je)return Re;je=1;let e=Xe(),t=nt(),s=function(){if(_e)return $e;_e=1;let e=et(),t=Ze(),s=Qe(),n=rt(),r=it(),o=function(){if(Pe)return Ae;Pe=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),s="\\".charCodeAt(0),n="/".charCodeAt(0),r="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),p=")".charCodeAt(0),f="{".charCodeAt(0),d="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),w="@".charCodeAt(0),v=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,x=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Ae=function(S,k={}){let I,O,E,A,P,$,_,R,j,M,B=S.css.valueOf(),D=k.ignoreErrors,U=B.length,z=0,L=[],F=[],N=-1;function V(e){throw S.error("Unclosed "+e,z)}return{back:function(e){F.push(e)},endOfFile:function(){return 0===F.length&&z>=U},nextToken:function(S){if(F.length)return F.pop();if(z>=U)return;let k=!!S&&S.ignoreUnclosed;switch(I=B.charCodeAt(z),I){case r:case o:case a:case l:case i:A=z;do{A+=1,I=B.charCodeAt(A)}while(I===o||I===r||I===a||I===l||I===i);$=["space",B.slice(z,A)],z=A-1;break;case c:case u:case f:case d:case y:case m:case p:{let e=String.fromCharCode(I);$=[e,e,z];break}case h:if(M=L.length?L.pop()[1]:"",j=B.charCodeAt(z+1),"url"===M&&j!==e&&j!==t&&j!==o&&j!==r&&j!==a&&j!==i&&j!==l){A=z;do{if(_=!1,A=B.indexOf(")",A+1),-1===A){if(D||k){A=z;break}V("bracket")}for(R=A;B.charCodeAt(R-1)===s;)R-=1,_=!_}while(_);$=["brackets",B.slice(z,A+1),z,A],z=A}else z<=N?$=["(","(",z]:(A=B.indexOf(")",z+1),O=B.slice(z,A+1),-1===A||x.test(O)?(N=-1===A?U:A,$=["(","(",z]):($=["brackets",O,z,A],z=A));break;case e:case t:P=I===e?"'":'"',A=z;do{if(_=!1,A=B.indexOf(P,A+1),-1===A){if(D||k){A=z+1;break}V("string")}for(R=A;B.charCodeAt(R-1)===s;)R-=1,_=!_}while(_);$=["string",B.slice(z,A+1),z,A],z=A;break;case w:v.lastIndex=z+1,v.test(B),A=0===v.lastIndex?B.length-1:v.lastIndex-2,$=["at-word",B.slice(z,A+1),z,A],z=A;break;case s:for(A=z,E=!0;B.charCodeAt(A+1)===s;)A+=1,E=!E;if(I=B.charCodeAt(A+1),E&&I!==n&&I!==o&&I!==r&&I!==a&&I!==l&&I!==i&&(A+=1,C.test(B.charAt(A)))){for(;C.test(B.charAt(A+1));)A+=1;B.charCodeAt(A+1)===o&&(A+=1)}$=["word",B.slice(z,A+1),z,A],z=A;break;default:I===n&&B.charCodeAt(z+1)===g?(A=B.indexOf("*/",z+2)+1,0===A&&(D||k?A=B.length:V("comment")),$=["comment",B.slice(z,A+1),z,A],z=A):(b.lastIndex=z+1,b.test(B),A=0===b.lastIndex?B.length-1:b.lastIndex-2,$=["word",B.slice(z,A+1),z,A],L.push($),z=A)}return z++,$},position:function(){return z}}}}();const i={empty:!0,space:!0};return $e=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let s,n,r,o=new e;o.name=t[1].slice(1),""===o.name&&this.unnamedAtrule(o,t),this.init(o,t[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(s=(t=this.tokenizer.nextToken())[0],"("===s||"["===s?c.push("("===s?")":"]"):"{"===s&&c.length>0?c.push("}"):s===c[c.length-1]&&c.pop(),0===c.length){if(";"===s){o.source.end=this.getPosition(t[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===s){a=!0;break}if("}"===s){if(l.length>0){for(r=l.length-1,n=l[r];n&&"space"===n[0];)n=l[--r];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(t=l[l.length-1],o.source.end=this.getPosition(t[3]||t[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,n=0;for(let r=t-1;r>=0&&(s=e[r],"space"===s[0]||(n+=1,2!==n));r--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,n,r=0;for(let[o,i]of e.entries()){if(s=i,n=s[0],"("===n&&(r+=1),")"===n&&(r-=1),0===r&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return o}this.doubleColon(s)}t=s}return!1}comment(e){let s=new t;this.init(s,e[2]),s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++;let n=e[1].slice(2,-2);if(n.trim()){let e=n.match(/^(\s*)([^]*\S)(\s*)$/);s.text=e[2],s.raws.left=e[1],s.raws.right=e[3]}else s.text="",s.raws.left=n,s.raws.right=""}createTokenizer(){this.tokenizer=o(this.input)}decl(e,t){let n=new s;this.init(n,e[0][2]);let r,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],n=s[3]||s[2];if(n)return n}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let s=this.stringFrom(e,t);s=this.spacesFromEnd(e)+s," !important"!==s&&(n.raws.important=s);break}if("important"===r[1].toLowerCase()){let s=e.slice(0),r="";for(let e=t;e>0;e--){let t=s[e][0];if(r.trim().startsWith("!")&&"space"!==t)break;r=s.pop()[1]+r}r.trim().startsWith("!")&&(n.important=!0,n.raws.important=r,e=s)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new r;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,n=!1,r=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)r||(r=l),o.push("("===s?")":"]");else if(i&&n&&"{"===s)r||(r=l),o.push("}");else if(0===o.length){if(";"===s){if(n)return void this.decl(a,i);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(n=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(r=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(r),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,n){let r,o,a,l,c=s.length,u="",h=!0;for(let e=0;e<c;e+=1)r=s[e],o=r[0],"space"!==o||e!==c-1||n?"comment"===o?(l=s[e-1]?s[e-1][0]:"empty",a=s[e+1]?s[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=r[1]):u+=r[1]:h=!1;if(!h){let n=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new r;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let n=t;n<e.length;n++)s+=e[n][1];return e.splice(t,e.length-t),s}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}();function n(e,n){let r=new t(e,n),o=new s(r);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return Re=n,n.default=n,e.registerParse(n),Re}function ct(){if(Be)return Me;Be=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return Me=e,e.default=e,Me}function ut(){if(Ue)return De;Ue=1;let e=ct();class t{get content(){return this.css}constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,s);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}}return De=t,t.default=t,De}function ht(){if(Le)return ze;Le=1;let e={};return ze=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function pt(){if(Ne)return Fe;Ne=1;let e=Xe(),t=tt(),s=at(),n=lt(),r=ut(),o=rt(),i=Q(),{isClean:a,my:l}=qe(),c=ht();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return"object"==typeof e&&"function"==typeof e.then}function d(e){let t=!1,s=u[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:d(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let y={};class w{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,s,o){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof w||s instanceof r)i=g(s.root),s.map&&(void 0===o.map&&(o.map={}),o.map.inline||(o.map.inline=!1),o.map.prev=s.map);else{let t=n;o.syntax&&(t=o.syntax.parse),o.parser&&(t=o.parser),t.parse&&(t=t.parse);try{i=t(s,o)}catch(e){this.processed=!0,this.error=e}i&&!i[l]&&e.rebuild(i)}else i=g(s);this.result=new r(t,i,o),this.helpers={...y,postcss:y,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,n=this.result.processor.version,r=t.split("."),o=n.split(".");(r[0]!==o[0]||parseInt(r[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!h[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[s])if("object"==typeof t[s])for(let n in t[s])e(t,"*"===n?s:s+"-"+n.toLowerCase(),t[s][n]);else"function"==typeof t[s]&&e(t,s,t[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],s=this.runOnRoot(t);if(f(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(f(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=this.result.root.source;if(void 0===e.map&&!(n&&n.input&&n.input.map)){let e="";return t(this.result.root,t=>{e+=t}),this.result.css=e,this.result}let r=new s(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,n]of e){let e;this.result.lastPlugin=s;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(f(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:n}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,r]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return r(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let n,r=t.iterator;for(;n=s.nodes[s.indexes[r]];)if(s.indexes[r]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete s.indexes[r]}let r=t.events;for(;t.eventIndex<r.length;){let e=r[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[a]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=d(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[s];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return w.registerPostcss=e=>{y=e},Fe=w,w.default=w,o.registerLazyResult(w),t.registerLazyResult(w),Fe}const ft=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(function(){if(Ye)return Je;Ye=1;let e=et(),t=Ze(),s=Xe(),n=K(),r=Qe(),o=tt(),i=function(){if(Ie)return ke;Ie=1;let e=et(),t=Ze(),s=Qe(),n=nt(),r=st(),o=rt(),i=it();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:r.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new s(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return ke=a,a.default=a,ke}(),a=nt(),l=pt(),c=ot(),u=Ke(),h=lt(),p=function(){if(He)return We;He=1;let e=tt(),t=pt(),s=function(){if(Te)return Ve;Te=1;let e=at(),t=lt(),s=ut(),n=Q(),r=ht();class o{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,s=t;try{e=s(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,r,o){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=o,this._map=void 0;let i=n;this.result=new s(this._processor,void 0,this._opts),this.result.css=r;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let l=new e(i,void 0,this._opts,r);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}return Ve=o,o.default=o,Ve}(),n=rt();class r{constructor(e=[]){this.version="8.5.14",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new s(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return We=r,r.default=r,n.registerProcessor(r),e.registerProcessor(r),We}(),f=ut(),d=rt(),m=it(),g=Q(),y=ct();function w(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new p(e)}return w.plugin=function(e,t){let s,n=!1;function r(...s){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let r=t(...s);return r.postcssPlugin=e,r.postcssVersion=(new p).version,r}return Object.defineProperty(r,"postcss",{get:()=>(s||(s=r()),s)}),r.process=function(e,t,s){return w([r(s)]).process(e,t)},r},w.stringify=g,w.parse=h,w.fromJSON=i,w.list=c,w.comment=e=>new t(e),w.atRule=t=>new e(t),w.decl=e=>new r(e),w.rule=e=>new m(e),w.root=e=>new d(e),w.document=e=>new o(e),w.CssSyntaxError=n,w.Declaration=r,w.Container=s,w.Processor=p,w.Document=o,w.Comment=t,w.Warning=y,w.AtRule=e,w.Result=f,w.Input=a,w.Rule=m,w.Root=d,w.Node=u,l.registerPostcss(w),Je=w,w.default=w,Je}());ft.stringify,ft.fromJSON,ft.plugin,ft.parse,ft.list,ft.document,ft.comment,ft.atRule,ft.rule,ft.decl,ft.root,ft.CssSyntaxError,ft.Declaration,ft.Container,ft.Processor,ft.Document,ft.Comment,ft.Warning,ft.AtRule,ft.Result,ft.Input,ft.Rule,ft.Root,ft.Node;const dt=new Set(["body","html",":root","*"]);function mt(e,t){return e&&e.trim()?ft([(s=`[data-vbi-type="${t}"]`,{postcssPlugin:"hc-scope",AtRule(e){if("import"===e.name)return console.warn("[hc-css-scope] @import 已被拒绝(防外部资源加载):",e.params),void e.remove();"font-face"===e.name&&console.warn("[hc-css-scope] @font-face 全局生效,font-family 命名注意冲突")},Rule(e){(function(e){let t=e.parent;for(;t&&"object"==typeof t;){const e=t;if("atrule"===e.type&&/keyframes$/i.test(e.name??""))return!0;t=e.parent}return!1})(e)||(e.selectors=e.selectors.map(e=>function(e,t){const s=e.trim();if(!s)return s;if(dt.has(s))return t;for(const e of dt){const n=s.charAt(e.length);if(s.startsWith(e)&&(" "===n||">"===n||"+"===n||"~"===n||","===n))return t+s.slice(e.length)}return`${t} ${s}`}(e,s)))}})]).process(e,{from:void 0}).css:"";var s}const gt=new Map;function yt(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s)|0;return(t>>>0).toString(36)}function wt(e){const t=e.replace(/[^a-zA-Z0-9_-]/g,"_");return t===e?`hc-style-${t}`:`hc-style-${t}-${yt(e).slice(0,6)}`}function vt(e,t){var s;const n=t??"",r=wt(e),o=gt.get(e);if(!n.trim())return null==(s=document.getElementById(r))||s.remove(),void(o&&gt.set(e,{...o,cssHash:""}));const i=yt(n);if(o&&o.cssHash===i)return;let a;try{a=mt(n,e)}catch(t){return void console.warn("[hc-css-scope]",e,"PostCSS process failed:",t)}!function(e,t){const s=wt(e);let n=document.getElementById(s);n||(n=document.createElement("style"),n.id=s,n.setAttribute("data-hc-scope",e),document.head.appendChild(n)),n.textContent=t}(e,a),o?gt.set(e,{...o,cssHash:i}):gt.set(e,{cssHash:i,refCount:0})}function bt(e,t){vt(e,t);const s=gt.get(e);s?gt.set(e,{...s,refCount:s.refCount+1}):gt.set(e,{cssHash:"",refCount:1})}function xt(e){var t;const s=gt.get(e);if(!s)return;const n=s.refCount-1;n<=0?(null==(t=document.getElementById(wt(e)))||t.remove(),gt.delete(e)):gt.set(e,{...s,refCount:n})}const Ct=n(),St={key:1,class:"rounded-md border-2 border-rose-300 bg-rose-50 p-4 text-sm text-rose-900 space-y-2 min-h-[140px] overflow-auto"},kt={class:"font-semibold flex items-center gap-1.5"},It={class:"font-mono text-xs text-rose-800 break-all"},Ot={key:0,class:"text-[10px] font-mono bg-rose-100/60 p-2 rounded overflow-auto max-h-60 text-rose-800"},Et=e.defineComponent({__name:"ErrorBoundary",props:{label:{},instanceId:{},canvasId:{},componentId:{}},setup(t){const s=t,n=e.ref(null),r=e.ref(0),o=e.ref(!1);function i(){n.value=null,o.value=!1,r.value++}return e.onErrorCaptured(e=>{console.error(`[hc-eb${s.label?" "+s.label:""}]`,e),n.value=e;try{Ct.emit("error",{canvasId:s.canvasId,instanceId:s.instanceId,componentId:s.componentId,label:s.label,error:e,timestamp:"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now()})}catch{}return!1}),(s,a)=>(e.openBlock(),e.createElementBlock("div",{key:r.value,class:"hc-eb-root",style:{width:"100%",height:"100%"}},[n.value?(e.openBlock(),e.createElementBlock("div",St,[e.createElementVNode("div",kt,[a[1]||(a[1]=e.createElementVNode("span",null,"⚠️",-1)),e.createElementVNode("span",null,"组件渲染失败"+e.toDisplayString(t.label?` — ${t.label}`:""),1)]),e.createElementVNode("div",It,e.toDisplayString(n.value.message),1),e.createElementVNode("button",{class:"text-xs text-rose-700 hover:text-rose-900 underline",onClick:a[0]||(a[0]=e=>o.value=!o.value)},e.toDisplayString(o.value?"隐藏":"展开")+"堆栈 ",1),o.value?(e.openBlock(),e.createElementBlock("pre",Ot,e.toDisplayString(n.value.stack),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"text-xs px-3 py-1 rounded bg-rose-600 hover:bg-rose-700 text-white transition-colors",onClick:i}," 重试 ")])):e.renderSlot(s.$slots,"default",{key:0})]))}}),At=["data-vbi-id","data-vbi-type","data-vbi-canvas"],Pt={key:0,class:"rounded-md border-2 border-amber-300 bg-amber-50 p-4 text-sm text-amber-900 space-y-2 min-h-[140px] overflow-auto"},$t={class:"text-[11px] font-mono break-all whitespace-pre-wrap"},_t={key:1,class:"grid place-items-center min-h-[140px] text-xs text-zinc-400"},Rt=e.defineComponent({__name:"RuntimeBox",props:{instanceId:{},componentId:{},scopeId:{},canvasId:{},htmlSource:{},jsSource:{},cssSource:{default:""},customValues:{default:()=>({})},position:{},size:{},zIndex:{}},setup(t){const s=t,n=e.computed(()=>s.scopeId??s.componentId),r=e.inject(f,null),o=e.computed(()=>s.canvasId??r??p),a=e.shallowRef(null),l=e.ref(null),c=e.ref(!1),u=e.ref(0);e.watch(()=>[s.htmlSource,s.jsSource],()=>{!async function(){c.value=!0,l.value=null;const e=o.value,t=s.instanceId;i(e,t,{compileStartedAt:performance.now()});try{const n=await F({html:s.htmlSource,js:s.jsSource}),r=performance.now();i(e,t,{compileEndedAt:r,mountStartedAt:r}),a.value=n,u.value++}catch(s){l.value=s instanceof Error?s:new Error(String(s)),a.value=null,i(e,t,{compileEndedAt:performance.now()})}finally{c.value=!1}}()},{immediate:!0});let h=!1;e.watch(()=>[s.cssSource,n.value],([e,t],s)=>{const n=(null==s?void 0:s[1])??null;n&&n!==t?(xt(n),bt(t,e),h=!0):h?vt(t,e):(bt(t,e),h=!0)},{immediate:!0});const d=e.computed(()=>{const e={width:"100%",height:"100%"};return s.position&&(e.position="absolute",e.left=`${s.position.x}px`,e.top=`${s.position.y}px`),void 0!==s.zIndex&&(e.zIndex=String(s.zIndex)),e});return e.onBeforeUnmount(()=>{h&&(xt(n.value),h=!1)}),(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:"_vbi_box","data-vbi-id":t.instanceId,"data-vbi-type":n.value,"data-vbi-canvas":o.value,style:e.normalizeStyle(d.value)},[l.value?(e.openBlock(),e.createElementBlock("div",Pt,[r[0]||(r[0]=e.createElementVNode("div",{class:"font-semibold"},"⚠️ 编译失败",-1)),e.createElementVNode("pre",$t,e.toDisplayString(l.value.message),1)])):c.value&&!a.value?(e.openBlock(),e.createElementBlock("div",_t," 编译中… ")):a.value?(e.openBlock(),e.createBlock(Et,{key:u.value,label:t.instanceId,"instance-id":t.instanceId,"canvas-id":o.value,"component-id":t.componentId},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value.options),{"hc-custom-values":t.customValues,"hc-instance-id":t.instanceId,"hc-canvas-id":o.value,"hc-component-id":t.componentId},null,8,["hc-custom-values","hc-instance-id","hc-canvas-id","hc-component-id"]))]),_:1},8,["label","instance-id","canvas-id","component-id"])):e.createCommentVNode("",!0)],12,At))}});exports.parseComponentSource=t.parseComponentSource,exports.DEFAULT_CANVAS_ID=p,exports.ErrorBoundary=Et,exports.HC_CANVAS_ID_KEY=f,exports.HC_INJECT_KEY=M,exports.RuntimeBox=Rt,exports.VERSION="0.0.0-stage2b",exports.__resetDiagnosticsEventsFlag=function(){c=0},exports.__resetLifecycleEmitter=function(){m.all.clear()},exports.__resetRegistry=function(){const e=[],t=[];for(const[s,n]of w){t.push(s);for(const[t,r]of n)r.__dispose(),e.push({canvasId:s,instanceId:t}),l(s,t)}w.clear(),d.value++;for(const t of e)g("instance:unmounted",t);for(const e of t)v.emit("canvas:removed",{canvasId:e})},exports.assets=E,exports.attachScope=bt,exports.clearCompileCache=function(){D.clear()},exports.clearInstanceTimings=l,exports.compileComponent=F,exports.consumePendingTimings=a,exports.createCanvasesRegistry=P,exports.createHyperCard=function(e={}){const t=e.strict??!1,s=e.libs??{},n=e.version??"v1";return{install(e){const r=Object.entries(s),o=r.filter(([,e])=>_(e)),i=r.filter(([e])=>$.has(e)),a=[`[hypercard] 已注册 ${r.length} 个 libs:`];for(const[e,t]of r)a.push(` ${e.padEnd(16)} ${j(t)}`);console.info(a.join("\n"));const l=[];o.length>1&&l.push(`检测到 ${o.length} 个 Vue plugin(${o.map(([e])=>e).join(", ")}),请确认全局组件命名不冲突`);for(const[e]of i)l.push(`lib 名 "${e}" 是保留词,建议改名`);if(l.length>0){const e=l.map(e=>` - ${e}`).join("\n");if(t)throw new Error(`[hypercard] strict mode 阻止启动:\n${e}`);console.warn(`[hypercard] 警告:\n${e}`)}for(const[s,n]of o){const[r,o]=R(n);try{e.use(r,...o)}catch(e){if(console.error(`[hypercard] app.use("${s}") 失败:`,e),t)throw e}}const c={};for(const[e,t]of r){const[s]=R(t);c[e]=s}const u={libs:c,runtime:O,assets:E,version:n,canvases:P()};e.provide(M,u),e.config.globalProperties.$hc=u,"undefined"!=typeof window&&(window.__HYPERCARD__=u)}}},exports.debugScopedCssRefs=function(){return[...gt.entries()].map(([e,t])=>({scopeId:e,componentId:e,refCount:t.refCount,cssHash:t.cssHash}))},exports.detachScope=xt,exports.disableDiagnosticsEvents=function(){c>0?c--:console.warn("[hc-diagnostics] disableDiagnosticsEvents called more times than enableDiagnosticsEvents — ignored")},exports.disposeCanvas=x,exports.enableDiagnosticsEvents=function(){c++},exports.getCompileCacheSize=function(){return D.size},exports.getInstance=k,exports.getInstanceTimings=function(e,t){const s=k(t,e);return s?function(e){return e._timings}(s)??null:r.get(o(e,t))??null},exports.getScopedCssCount=function(){return gt.size},exports.injectScopedCss=vt,exports.interactionEmitter=h,exports.isDiagnosticsEventsEnabled=u,exports.isVuePlugin=_,exports.listCanvasIds=C,exports.listInstances=I,exports.onInstanceLifecycle=function(e,t){const s=e=>{try{t(e)}catch(e){console.error("[hc-registry] instance lifecycle listener threw",e)}};return m.on(e,s),()=>m.off(e,s)},exports.patchInstanceTimings=i,exports.register=function(e,t,s){return b(p,e,t,s)},exports.registerInCanvas=b,exports.registryVersion=d,exports.removeScopedCss=function(e){var t;null==(t=document.getElementById(wt(e)))||t.remove(),gt.delete(e)},exports.runtime=O,exports.runtimeErrorEmitter=Ct,exports.scopeCss=mt,exports.subscribeCanvasInventory=function(e,t){return v.on(e,t),()=>v.off(e,t)},exports.unregister=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("./parseSourceEntry-DVGEKTC6.cjs"),s=function(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const s in e)if("default"!==s){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}(e);function n(e){return{all:e=e||new Map,on:function(t,s){var n=e.get(t);n?n.push(s):e.set(t,[s])},off:function(t,s){var n=e.get(t);n&&(s?n.splice(n.indexOf(s)>>>0,1):e.set(t,[]))},emit:function(t,s){var n=e.get(t);n&&n.slice().map(function(e){e(s)}),(n=e.get("*"))&&n.slice().map(function(e){e(t,s)})}}}const r=new Map;function o(e,t){return`${e}::${t}`}function i(e,t,s){const n=S(t,e);if(n)return void Object.assign(function(e){return e._timings||(e._timings={}),e._timings}(n),s);const i=o(e,t),a=r.get(i)??{};r.set(i,{...a,...s})}function a(e,t){r.delete(o(e,t))}let l=0;function c(){return l>0}const u=n(),h="__default__",p="__hcCanvasId",f=e.ref(0),d=n();function m(e,t){d.emit(e,t)}const g=new Set,y=new Map,w=n();function v(e,t,s,i){var a;const l=function(e,t){return`${e}\0${t}`}(e,t);if(g.has(l)){const s=`[hc-registry] re-entrant registerInCanvas("${e}", "${t}") detected — a lifecycle listener tried to register the same id while the outer register is in flight. Nested register blocked to prevent state divergence; defer your register via microtask / setTimeout if you need to re-mount on lifecycle events.`;throw console.warn(s),new Error(s)}g.add(l);try{const l=!y.has(e),h=function(e){let t=y.get(e);return t||(t=new Map,y.set(e,t)),t}(e);h.has(t)&&(console.warn(`[hc-registry] instance ${t} already registered in canvas "${e}", overwriting`),null==(a=h.get(t))||a.__dispose(),h.delete(t),m("instance:unmounted",{canvasId:e,instanceId:t}));const p=function(e,t,s,r){const o=n();function i(n,r,o){if(c())try{u.emit("interaction",{canvasId:e,instanceId:t,componentId:s,kind:n,key:r,args:o,timestamp:performance.now()})}catch(e){console.warn(`[hc-registry] interactionEmitter.emit threw on ${n}("${r}"); diagnostic stream broken for this event`,e)}}return{instanceId:t,componentId:s,vm:r,call(e,...s){i("call",e,s);const n=r[e];if("function"!=typeof n)throw new Error(`[hc-registry] method "${e}" not found on instance ${t}`);return n.apply(r,s)},on:(e,t)=>(o.on(e,t),()=>o.off(e,t)),emit(e,t){i("emit",e,[t]),o.emit(e,t)},setProp(e,t){i("setProp",e,[t]),r[e]=t},setDataInput(e,s){i("setDataInput",e,[s]);const n=r.custom;if(!n||!(e in n))return void console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] not declared on instance ${t}; binding 改了一个未声明的 dataInput key,组件不会响应`);const o=n[e];o&&"object"==typeof o?!0===o.dataInput?o.value=s:console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] is not declared with dataInput:true on instance ${t}; 请在组件源码 custom.${e} 上加 \`dataInput: true\` 才能被 binding 灌入`):console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] not a {value:...} slot`)},__dispose(){o.all.clear()}}}(e,t,s,i);h.set(t,p);const d=function(e,t){const s=o(e,t),n=r.get(s);return n?(r.delete(s),n):null}(e,t);return d&&(p._timings={...d}),f.value++,l&&w.emit("canvas:added",{canvasId:e}),m("instance:ready",{canvasId:e,instanceId:t}),p}finally{g.delete(l)}}function b(e){const t=y.get(e);if(!t)return;const s=[];for(const[n,r]of t)r.__dispose(),s.push(n),a(e,n);t.clear(),y.delete(e),f.value++;for(const t of s)m("instance:unmounted",{canvasId:e,instanceId:t});w.emit("canvas:removed",{canvasId:e})}function x(){return[...y.keys()]}function C(e,t=h){const s=y.get(t);if(!s)return;const n=s.get(e);n&&(n.__dispose(),s.delete(e),a(t,e),f.value++,m("instance:unmounted",{canvasId:t,instanceId:e}))}function S(e,t){var s;if(void 0!==t)return(null==(s=y.get(t))?void 0:s.get(e))??null;let n=null;const r=[];for(const[t,s]of y){const o=s.get(e);o&&(n||(n=o),r.push(t))}return r.length>1&&console.warn(`[hc-registry] getInstance("${e}") matched ${r.length} canvases [${r.join(", ")}]; returning first. Prefer __HYPERCARD__.canvases.callComponent(canvasId, instanceId, ...) for explicit scope.`),n}function k(e){const t=null==e?void 0:e.componentId,s=t?e=>e.componentId===t:()=>!0;if(void 0!==(null==e?void 0:e.canvasId)){const t=y.get(e.canvasId);return t?[...t.values()].filter(s):[]}const n=[];for(const e of y.values())for(const t of e.values())s(t)&&n.push(t);return n}const I={getInstance:S,listInstances:k,call(e,t,...s){const n=S(e);if(n)return n.call(t,...s);console.debug(`[hc-runtime] call: instance "${e}" not found`)},on(e,t,s){const n=S(e);if(n)return n.on(t,s);console.debug(`[hc-runtime] on: instance "${e}" not found`)},emit(e,t,s){const n=S(e);n?n.emit(t,s):console.debug(`[hc-runtime] emit: instance "${e}" not found`)}},O={pickerUrl:e=>`/a/${e}`};function E(e){return{canvasId:e,listInstances:t=>k({canvasId:e,componentId:null==t?void 0:t.componentId}),getInstance:t=>S(t,e),call(t,s,...n){const r=S(t,e);if(r)try{return r.call(s,...n)}catch(n){return void console.warn(`[hc-canvases] call error: canvas="${e}" instance="${t}" method="${s}":`,n)}else console.warn(`[hc-canvases] call: instance "${t}" not found in canvas "${e}"`)},emit(t,s,n){const r=S(t,e);if(r)try{r.emit(s,n)}catch(n){console.warn(`[hc-canvases] emit error: canvas="${e}" instance="${t}" event="${s}":`,n)}else console.warn(`[hc-canvases] emit: instance "${t}" not found in canvas "${e}"`)},broadcastInCanvas(t,s){const n=k({canvasId:e});for(const r of n)try{r.emit(t,s)}catch(s){console.warn(`[hc-canvases] broadcastInCanvas: canvas="${e}" instance="${r.instanceId}" event="${t}" emit failed:`,s)}},dispose(){b(e)}}}function A(){return{list:()=>x().map(e=>E(e)),get:e=>x().includes(e)?E(e):null,getAll(){const e={};for(const t of x())e[t]=E(t);return e},callComponent(e,t,s,...n){const r=S(t,e);if(r)try{return r.call(s,...n)}catch(n){return void console.warn(`[hc-canvases] callComponent error: canvas="${e}" instance="${t}" method="${s}":`,n)}else console.warn(`[hc-canvases] callComponent: canvas="${e}" instance="${t}" not found`)},emitToCanvas(e,t,s,n){const r=S(t,e);if(r)try{r.emit(s,n)}catch(n){console.warn(`[hc-canvases] emitToCanvas error: canvas="${e}" instance="${t}" event="${s}":`,n)}else console.warn(`[hc-canvases] emitToCanvas: canvas="${e}" instance="${t}" not found`)},broadcast(e,t){for(const s of x())try{const n=k({canvasId:s});for(const r of n)try{r.emit(e,t)}catch(t){console.warn(`[hc-canvases] broadcast: canvas="${s}" instance="${r.instanceId}" event="${e}" emit failed:`,t)}}catch(t){console.warn(`[hc-canvases] broadcast: canvas="${s}" event="${e}" failed:`,t)}}}}const P=new Set(["vue","Vue","window","global","globalThis","console","document","process","$","libs","runtime","assets","version"]);function $(e){return Array.isArray(e)&&e.length>=1?$(e[0]):"object"==typeof e&&null!==e&&"function"==typeof e.install}function R(e){return Array.isArray(e)&&e.length>=1?[e[0],e.slice(1)]:[e,[]]}function _(e){return $(e)?Array.isArray(e)?"✓ Vue plugin (with options) → 已 app.use":"✓ Vue plugin → 已 app.use":"function"==typeof e?"· function":Array.isArray(e)?"· array":"object"==typeof e&&null!==e?"· object":"· "+typeof e}const j="__HYPERCARD__",M=new Set(["init","onClick","onMouseover","onMouseout","onResize","onDestroy"]),B=new Map;function D(e,t){for(B.has(e)&&B.delete(e),B.set(e,t);B.size>100;){const e=B.keys().next().value;if(void 0===e)break;B.delete(e)}}function U(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s)|0;return(t>>>0).toString(36)}function z(e){if(!Array.isArray(e))return[];const t=[];for(const s of e){if(!s||"object"!=typeof s)continue;const e=s;if("string"!=typeof e.name)continue;const n={name:e.name};"boolean"==typeof e.multiple&&(n.multiple=e.multiple),Array.isArray(e.accepts)&&(n.accepts=e.accepts.filter(e=>"string"==typeof e)),"number"==typeof e.maxChildren&&(n.maxChildren=e.maxChildren),"string"==typeof e.label&&(n.label=e.label),t.push(n)}return t}async function L(e){const n=U(e.html)+"_"+U(e.js),r=B.get(n);if(r)return D(n,r),r;const o=(async()=>function(e,t){if(!e||"object"!=typeof e)throw new Error("[hc-compile] component.js must `export default` an object");const n=e,r=n.name,o=n.method??{},a=n.attribute??{},l=n.custom??{},c=n.style??{},u=n.slots,h=n.data,p=n.methods??{},f=n.computed,d=n.watch,m=n.created,g=n.mounted,y=n.beforeUnmount,w=n.props,b=new Set(["name","method","attribute","custom","style","option","data","methods","computed","watch","created","mounted","beforeUnmount","props","slots"]),x={};for(const e of Object.keys(n))b.has(e)||(x[e]=n[e]);const k={};for(const[e,t]of Object.entries(o))M.has(e)||"function"!=typeof t||(k[e]=t);const I=Object.keys(k),O={...k,...p},E=(t??"").trim()||"<div></div>",A=s.compile(E);if("function"!=typeof A)throw new Error('[hc-compile] 当前 Vue 是 runtime-only 构建,无法运行时编译组件模板(组件会渲染为空)。宿主需在打包器里把 "vue" 别名到 "vue/dist/vue.esm-bundler.js",例如 vite.config: resolve.alias: [{ find: /^vue$/, replacement: \'vue/dist/vue.esm-bundler.js\' }]。');return{options:{render:A,props:{...w?Array.isArray(w)?Object.fromEntries(w.map(e=>[e,null])):"object"==typeof w?w:{}:{},hcCustomValues:{type:Object,default:()=>({})},hcInstanceId:{type:String,default:""},hcCanvasId:{type:String,default:""},hcComponentId:{type:String,default:""}},data(){const e="function"==typeof h?h.call(this):h??{},t=this.hcCustomValues??{},s={};for(const[e,n]of Object.entries(l)){let r;try{r=JSON.parse(JSON.stringify(n??{}))}catch{r={...n??{}}}e in t&&r&&"object"==typeof r&&(r.value=t[e]),s[e]=r}return{custom:s,...e}},methods:O,computed:f,watch:(()=>{const e=d&&"object"==typeof d?{...d}:{};return e.hcCustomValues={handler(e){if(e&&this.custom)for(const[t,s]of Object.entries(e)){const e=this.custom[t];e&&"object"==typeof e&&(e.value=s)}},deep:!0},e})(),created(){this.hcInstanceId&&this.hcCanvasId&&v(this.hcCanvasId,this.hcInstanceId,this.hcComponentId,this),"function"==typeof m&&m.call(this)},mounted(){try{const e=[],t=this.$el;if(t&&t instanceof HTMLElement){Object.assign(t.style,c);for(const[e,s]of Object.entries(a))"string"==typeof s&&s&&t.setAttribute(e,s);for(const s of M){if("init"===s)continue;const n=o[s];if("function"==typeof n){const r=s.replace(/^on/,"").toLowerCase(),o=e=>{n.call(this,{event:e,data:e})};t.addEventListener(r,o),e.push(()=>t.removeEventListener(r,o))}}}this.__hcCleanup=e;const s=o.init;"function"==typeof s&&s.call(this),"function"==typeof g&&g.call(this)}finally{const e=this.hcInstanceId,t=this.hcCanvasId;"string"==typeof e&&e.length>0&&"string"==typeof t&&t.length>0&&i(t,e,{mountEndedAt:performance.now()})}},beforeUnmount(){var e;if(this.hcInstanceId&&this.hcCanvasId){const e=S(this.hcInstanceId,this.hcCanvasId);e&&e.vm===this&&C(this.hcInstanceId,this.hcCanvasId)}null==(e=this.__hcCleanup)||e.forEach(e=>{try{e()}catch{}}),this.__hcCleanup=void 0,"function"==typeof y&&y.call(this)},...x},meta:{name:r,attribute:a,style:c,customDecl:l,methodNames:I,slotsDecl:z(u)}}}(function(e){let s;try{const n=t.parse(e,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:!0}).body.find(e=>"ExportDefaultDeclaration"===e.type);if(!n)throw new Error("[hc-compile] component.js must `export default` an object");s=e.slice(0,n.start)+"module.exports = "+e.slice(n.declaration.start)}catch(e){throw e instanceof Error?e:new Error(String(e))}const n=new Function("module","exports",`"use strict";\n${s}\n;return module.exports;`),r={exports:{}};try{return n(r,r.exports)}catch(e){throw e instanceof Error?e:new Error(String(e))}}(e.js),e.html))();return D(n,o),o.catch(()=>{B.get(n)===o&&B.delete(n)}),o}var N,F={exports:{}};const V=function(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),s}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var T,W,J,H,Y,G;function q(){if(W)return T;W=1;let e=function(){if(N)return F.exports;N=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return F.exports=t(),F.exports.createColors=t,F.exports}(),t=V;class s extends Error{constructor(e,t,n,r,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),r&&(this.source=r),i&&(this.plugin=i),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(s){if(!this.source)return"";let n=this.source;null==s&&(s=e.isColorSupported);let r=e=>e,o=e=>e,i=e=>e;if(s){let{bold:s,gray:n,red:a}=e.createColors(!0);o=e=>s(a(e)),r=e=>n(e),t&&(i=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let s=l+1+t,n=" "+(" "+s).slice(-u)+" | ";if(s===this.line){if(e.length>160){let t=20,s=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(s,a),c=r(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return o(">")+r(n)+i(l)+"\n "+c+o("^")}let t=r(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+r(n)+i(e)+"\n "+t+o("^")}return" "+r(n)+i(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return T=s,s.default=s,T}function K(){if(H)return J;H=1;const e=/(<)(\/?style\b)/gi,t=/(<)(!--)/g;function s(s){return"string"!=typeof s?s:s.includes("<")?s.replace(e,"\\3c $2").replace(t,"\\3c $2"):s}const n={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class r{constructor(e){this.builder=e}atrule(e,t){let n=e.raws,r="@"+e.name,o=e.params?this.rawValue(e,"params"):"";if(void 0!==n.afterName?r+=n.afterName:o&&(r+=" "),e.nodes)this.block(e,r+o);else{let i=(n.between||"")+(t?";":"");this.builder(s(r+o+i),e)}}beforeAfter(e,t){let s;s="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,r=0;for(;n&&"root"!==n.type;)r+=1,n=n.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<r;e++)s+=t}return s}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(s(t+r)+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(s(n)),this.builder("}",e,"end")}body(e){let t=e.nodes,n=t.length-1;for(;n>0&&"comment"===t[n].type;)n-=1;let r=this.raw(e,"semicolon"),o="document"===e.type;for(let e=0;e<t.length;e++){let i=t[e],a=this.raw(i,"before");a&&this.builder(o?a:s(a)),this.stringify(i,n!==e||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder(s("/*"+t+e.text+n+"*/"),e)}decl(e,t){let n=e.raws,r=this.raw(e,"between","colon"),o=e.prop+r+this.rawValue(e,"value");e.important&&(o+=n.important||" !important"),t&&(o+=";"),this.builder(s(o),e)}document(e){this.body(e)}raw(e,t,s){let r;if(s||(s=t),t&&(r=e.raws[t],void 0!==r))return r;let o=e.parent;if("before"===s){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return n[s];let i=e.root(),a=i.rawCache||(i.rawCache={});if(void 0!==a[s])return a[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let n="raw"+((l=s)[0].toUpperCase()+l.slice(1));this[n]?r=this[n](i,e):i.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var l;return void 0===r&&(r=n[s]),a[s]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let n=s.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let s=e[t],n=e.raws[t];return n&&n.value===s?n.raw:s}root(e){if(this.body(e),e.raws.after){let t=e.raws.after,n=e.parent&&"document"===e.parent.type;this.builder(n?t:s(t))}}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(s(e.raws.ownSemicolon),e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}return J=r,r.default=r,J}function Z(){if(G)return Y;G=1;let e=K();function t(t,s){new e(s).stringify(t)}return Y=t,t.default=t,Y}var Q,X,ee,te,se,ne,re,oe,ie,ae,le,ce,ue,he,pe,fe,de,me,ge,ye,we,ve,be,xe,Ce,Se,ke,Ie,Oe,Ee,Ae,Pe,$e,Re,_e,je,Me,Be,De,Ue,ze,Le,Ne,Fe,Ve,Te,We,Je,He,Ye={};function Ge(){return Q||(Q=1,Ye.isClean=Symbol("isClean"),Ye.my=Symbol("my")),Ye}function qe(){if(ee)return X;ee=1;let e=q(),t=K(),s=Z(),{isClean:n,my:r}=Ge();function o(e,t){let s=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let r=e[n],i=typeof r;"parent"===n&&"object"===i?t&&(s[n]=t):"source"===n?s[n]=r:Array.isArray(r)?s[n]=r.map(e=>o(e,s)):("object"===i&&null!==r&&(r=o(r)),s[n]=r)}return s}function i(e,t){if(t&&void 0!==t.offset)return t.offset;let s=1,n=1,r=0;for(let o=0;o<e.length;o++){if(n===t.line&&s===t.column){r=o;break}"\n"===e[o]?(s=1,n+=1):s+=1}return r}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[r]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=o(this);for(let s in e)t[s]=e[s];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(t,s={}){if(this.source){let{end:e,start:n}=this.rangeBy(s);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},s)}return new e(t)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,n=s.slice(i(s,this.source.start),i(s,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,s=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,r=i(n,this.source.start),o=r+e;for(let e=r;e<o;e++)"\n"===n[e]?(t=1,s+=1):t+=1;return{column:t,line:s,offset:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:i(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:i(t,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(e.word){let r=t.slice(i(t,this.source.start),i(t,this.source.end)).indexOf(e.word);-1!==r&&(s=this.positionInside(r),n=this.positionInside(r+e.word.length))}else e.start?s={column:e.start.column,line:e.start.line,offset:i(t,e.start)}:e.index&&(s=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:i(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<s.line||n.line===s.line&&n.column<=s.column)&&(n={column:s.column+1,line:s.line,offset:s.offset+1}),{end:n,start:s}}raw(e,s){return(new t).raw(this,e,s)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,s=!1;for(let n of e)n===this?s=!0:s?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},n=null==t;t=t||new Map;let r=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))s[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)s[e]=n.toJSON(null,t);else if("source"===e){if(null==n)continue;let o=t.get(n.input);null==o&&(o=r,t.set(n.input,r),r++),s[e]={end:n.end,inputId:o,start:n.start}}else s[e]=n}return n&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s={}){let n={node:this};for(let e in s)n[e]=s[e];return e.warn(t,n)}}return X=a,a.default=a,X}function Ke(){if(se)return te;se=1;let e=qe();class t extends e{constructor(e){super(e),this.type="comment"}}return te=t,t.default=t,te}function Ze(){if(re)return ne;re=1;let e=qe();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return ne=t,t.default=t,ne}function Qe(){if(ie)return oe;ie=1;let e,t,s,n,r=Ke(),o=Ze(),i=qe(),{isClean:a,my:l}=Ge();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends i{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,s,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[n]+=1;return delete this.indexes[n],s}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)s=this.indexes[e],n<s&&(this.indexes[e]=s+r.length);return this.markDirty(),this}insertBefore(e,t){let s,n=this.index(e),r=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)s=this.indexes[e],n<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(s,i){if("string"==typeof s)s=c(t(s).nodes);else if(void 0===s)s=[];else if(Array.isArray(s)){s=s.slice(0);for(let e of s)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===s.type&&"document"!==this.type){s=s.nodes.slice(0);for(let e of s)e.parent&&e.parent.removeChild(e,"ignore")}else if(s.type)s=[s];else if(s.prop){if(void 0===s.value)throw new Error("Value field is missed in node creation");"string"!=typeof s.value&&(s.value=String(s.value)),s=[new o(s)]}else if(s.selector||s.selectors)s=[new n(s)];else if(s.name)s=[new e(s)];else{if(!s.text)throw new Error("Unknown node type in node creation");s=[new r(s)]}return s.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let n;try{n=e(t,s)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,n)=>{if("atrule"===s.type&&e.test(s.name))return t(s,n)}):this.walk((s,n)=>{if("atrule"===s.type&&s.name===e)return t(s,n)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,n)=>{if("decl"===s.type&&e.test(s.prop))return t(s,n)}):this.walk((s,n)=>{if("decl"===s.type&&s.prop===e)return t(s,n)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,n)=>{if("rule"===s.type&&e.test(s.selector))return t(s,n)}):this.walk((s,n)=>{if("rule"===s.type&&s.selector===e)return t(s,n)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,s)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{s=e},oe=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,o.prototype):"comment"===t.type?Object.setPrototypeOf(t,r.prototype):"root"===t.type&&Object.setPrototypeOf(t,s.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},oe}function Xe(){if(le)return ae;le=1;let e=Qe();class t extends e{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return ae=t,t.default=t,e.registerAtRule(t),ae}function et(){if(ue)return ce;ue=1;let e,t,s=Qe();class n extends s{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(s={}){return new e(new t,this,s).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},ce=n,n.default=n,ce}function tt(){if(de)return fe;de=1;let{existsSync:e,readFileSync:t}=V,{dirname:s,join:n}=V,{SourceMapConsumer:r,SourceMapGenerator:o}=V;class i{constructor(e,t){if(!1===t.map)return;t.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new r(this.json||this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let s=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(s)return n=e.substr(s[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let r=e.slice(22);throw r=r.slice(0,r.indexOf(",")),new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let s=e.lastIndexOf(t.pop()),n=e.indexOf("*/",s);s>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,n)))}loadFile(n,r,o){if(o||this.unsafeMap||/\.map$/i.test(n))return this.root=s(n),e(n)?(this.mapFile=n,t(n,"utf-8").toString().trim()):void 0}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return o.fromSourceMap(t).toString();if(t instanceof o)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let t=this.loadFile(s,e,!0);if(!t)throw new Error("Unable to load previous source map: "+s.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;e&&(t=n(s(e),t));let r=this.loadFile(t,e,!1);if(r)try{this.json=JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return r}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return fe=i,i.default=i,fe}function st(){if(ge)return me;ge=1;let{nanoid:e}=pe?he:(pe=1,he={nanoid:(e=21)=>{let t="",s=0|e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(s=t)=>{let n="",r=0|s;for(;r--;)n+=e[Math.random()*e.length|0];return n}}),{isAbsolute:t,resolve:s}=V,{SourceMapConsumer:n,SourceMapGenerator:r}=V,{fileURLToPath:o,pathToFileURL:i}=V,a=q(),l=tt(),c=V,u=Symbol("lineToIndexCache"),h=Boolean(n&&r),p=Boolean(s&&t);function f(e){if(e[u])return e[u];let t=e.css.split("\n"),s=new Array(t.length),n=0;for(let e=0,r=t.length;e<r;e++)s[e]=n,n+=t[e].length+1;return e[u]=s,s}class d{get from(){return this.file||this.id}constructor(n,r={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,r.document&&(this.document=r.document.toString()),r.from&&(!p||/^\w+:\/\//.test(r.from)||t(r.from)?this.file=r.from:this.file=s(r.from)),p&&h){let e=new l(this.css,r);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,n={}){let r,o,l,c,u;if(t&&"object"==typeof t){let e=t,n=s;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,s=n.col}else t=e.line,s=e.column,c=this.fromLineAndColumn(t,s);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);o=e.line,r=e.col}else o=n.line,r=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(s)c=this.fromLineAndColumn(t,s);else{c=t;let e=this.fromOffset(c);t=e.line,s=e.col}let h=this.origin(t,s,o,r);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:r,line:o},this.css,this.file,n.plugin),u.input={column:s,endColumn:r,endLine:o,endOffset:l,line:t,offset:c,source:this.css},this.file&&(i&&(u.input.url=i(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return f(this)[e-1]+t-1}fromOffset(e){let t=f(this),s=0;if(e>=t[t.length-1])s=t.length-1;else{let n,r=t.length-2;for(;s<r;)if(n=s+(r-s>>1),e<t[n])r=n-1;else{if(!(e>=t[n+1])){s=n;break}s=n+1}}return{col:e-t[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:s(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,s,n,r){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:s,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:r,line:n})),l=t(u.source)?i(u.source):new URL(u.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");h.file=o(l)}let p=c.sourceContentFor(u.source);return p&&(h.source=p),h}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}}return me=d,d.default=d,c&&c.registerInput&&c.registerInput(d),me}function nt(){if(we)return ye;we=1;let e,t,s=Qe();class n extends s{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let n=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(s={}){return new e(new t,this,s).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},ye=n,n.default=n,s.registerRoot(n),ye}function rt(){if(be)return ve;be=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,s){let n=[],r="",o=!1,i=0,a=!1,l="",c=!1;for(let s of e)c?c=!1:"\\"===s?c=!0:a?s===l&&(a=!1):'"'===s||"'"===s?(a=!0,l=s):"("===s?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==r&&n.push(r.trim()),r="",o=!1):r+=s;return(s||""!==r)&&n.push(r.trim()),n}};return ve=e,e.default=e,ve}function ot(){if(Ce)return xe;Ce=1;let e=Qe(),t=rt();class s extends e{get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return xe=s,s.default=s,e.registerRule(s),xe}function it(){if(Oe)return Ie;Oe=1;let{dirname:e,relative:t,resolve:s,sep:n}=V,{SourceMapConsumer:r,SourceMapGenerator:o}=V,{pathToFileURL:i}=V,a=st(),l=Boolean(r&&o),c=Boolean(e&&s&&t&&n);return Ie=class{constructor(e,t,s,n){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let s,n=this.toUrl(this.path(t.file)),o=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(s=new r(t.text),s.sourcesContent&&(s.sourcesContent=null)):s=t.consumer(),this.map.applySourceMap(s,n,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else if(this.css){let e;for(;-1!==(e=this.css.lastIndexOf("/*#"));){let t=this.css.indexOf("*/",e+3);if(-1===t)break;for(;e>0&&"\n"===this.css[e-1];)e--;this.css=this.css.slice(0,e)+this.css.slice(t+2)}}}generate(){if(this.clearAnnotation(),c&&l&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=o.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new o({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=s,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=o.match(/\n/g),t?(s+=t.length,e=o.lastIndexOf("\n"),n=o.length-e):n+=o.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=s,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=s,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let r=this.memoizedPaths.get(n);if(r)return r;let o=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=e(s(o,this.mapOpts.annotation)));let i=t(o,n);return this.memoizedPaths.set(n,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new a(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let n=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(i){let t=i(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===n&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}}}function at(){if(_e)return Re;_e=1;let e=Qe(),t=st(),s=function(){if($e)return Pe;$e=1;let e=Xe(),t=Ke(),s=Ze(),n=nt(),r=ot(),o=function(){if(Ae)return Ee;Ae=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),s="\\".charCodeAt(0),n="/".charCodeAt(0),r="\n".charCodeAt(0),o=" ".charCodeAt(0),i="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),p=")".charCodeAt(0),f="{".charCodeAt(0),d="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),w="@".charCodeAt(0),v=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,x=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Ee=function(S,k={}){let I,O,E,A,P,$,R,_,j,M,B=S.css.valueOf(),D=k.ignoreErrors,U=B.length,z=0,L=[],N=[],F=-1;function V(e){throw S.error("Unclosed "+e,z)}return{back:function(e){N.push(e)},endOfFile:function(){return 0===N.length&&z>=U},nextToken:function(S){if(N.length)return N.pop();if(z>=U)return;let k=!!S&&S.ignoreUnclosed;switch(I=B.charCodeAt(z),I){case r:case o:case a:case l:case i:A=z;do{A+=1,I=B.charCodeAt(A)}while(I===o||I===r||I===a||I===l||I===i);$=["space",B.slice(z,A)],z=A-1;break;case c:case u:case f:case d:case y:case m:case p:{let e=String.fromCharCode(I);$=[e,e,z];break}case h:if(M=L.length?L.pop()[1]:"",j=B.charCodeAt(z+1),"url"===M&&j!==e&&j!==t&&j!==o&&j!==r&&j!==a&&j!==i&&j!==l){A=z;do{if(R=!1,A=B.indexOf(")",A+1),-1===A){if(D||k){A=z;break}V("bracket")}for(_=A;B.charCodeAt(_-1)===s;)_-=1,R=!R}while(R);$=["brackets",B.slice(z,A+1),z,A],z=A}else z<=F?$=["(","(",z]:(A=B.indexOf(")",z+1),O=B.slice(z,A+1),-1===A||x.test(O)?(F=-1===A?U:A,$=["(","(",z]):($=["brackets",O,z,A],z=A));break;case e:case t:P=I===e?"'":'"',A=z;do{if(R=!1,A=B.indexOf(P,A+1),-1===A){if(D||k){A=z+1;break}V("string")}for(_=A;B.charCodeAt(_-1)===s;)_-=1,R=!R}while(R);$=["string",B.slice(z,A+1),z,A],z=A;break;case w:v.lastIndex=z+1,v.test(B),A=0===v.lastIndex?B.length-1:v.lastIndex-2,$=["at-word",B.slice(z,A+1),z,A],z=A;break;case s:for(A=z,E=!0;B.charCodeAt(A+1)===s;)A+=1,E=!E;if(I=B.charCodeAt(A+1),E&&I!==n&&I!==o&&I!==r&&I!==a&&I!==l&&I!==i&&(A+=1,C.test(B.charAt(A)))){for(;C.test(B.charAt(A+1));)A+=1;B.charCodeAt(A+1)===o&&(A+=1)}$=["word",B.slice(z,A+1),z,A],z=A;break;default:I===n&&B.charCodeAt(z+1)===g?(A=B.indexOf("*/",z+2)+1,0===A&&(D||k?A=B.length:V("comment")),$=["comment",B.slice(z,A+1),z,A],z=A):(b.lastIndex=z+1,b.test(B),A=0===b.lastIndex?B.length-1:b.lastIndex-2,$=["word",B.slice(z,A+1),z,A],L.push($),z=A)}return z++,$},position:function(){return z}}}}();const i={empty:!0,space:!0};return Pe=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let s,n,r,o=new e;o.name=t[1].slice(1),""===o.name&&this.unnamedAtrule(o,t),this.init(o,t[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(s=(t=this.tokenizer.nextToken())[0],"("===s||"["===s?c.push("("===s?")":"]"):"{"===s&&c.length>0?c.push("}"):s===c[c.length-1]&&c.pop(),0===c.length){if(";"===s){o.source.end=this.getPosition(t[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===s){a=!0;break}if("}"===s){if(l.length>0){for(r=l.length-1,n=l[r];n&&"space"===n[0];)n=l[--r];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),i&&(t=l[l.length-1],o.source.end=this.getPosition(t[3]||t[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,n=0;for(let r=t-1;r>=0&&(s=e[r],"space"===s[0]||(n+=1,2!==n));r--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,n,r=0;for(let[o,i]of e.entries()){if(s=i,n=s[0],"("===n&&(r+=1),")"===n&&(r-=1),0===r&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return o}this.doubleColon(s)}t=s}return!1}comment(e){let s=new t;this.init(s,e[2]),s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++;let n=e[1].slice(2,-2);if(n.trim()){let e=n.match(/^(\s*)([^]*\S)(\s*)$/);s.text=e[2],s.raws.left=e[1],s.raws.right=e[3]}else s.text="",s.raws.left=n,s.raws.right=""}createTokenizer(){this.tokenizer=o(this.input)}decl(e,t){let n=new s;this.init(n,e[0][2]);let r,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],n=s[3]||s[2];if(n)return n}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,a=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let s=this.stringFrom(e,t);s=this.spacesFromEnd(e)+s," !important"!==s&&(n.raws.important=s);break}if("important"===r[1].toLowerCase()){let s=e.slice(0),r="";for(let e=t;e>0;e--){let t=s[e][0];if(r.trim().startsWith("!")&&"space"!==t)break;r=s.pop()[1]+r}r.trim().startsWith("!")&&(n.important=!0,n.raws.important=r,e=s)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new r;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,n=!1,r=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)r||(r=l),o.push("("===s?")":"]");else if(i&&n&&"{"===s)r||(r=l),o.push("}");else if(0===o.length){if(";"===s){if(n)return void this.decl(a,i);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(n=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(r=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(r),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,n){let r,o,a,l,c=s.length,u="",h=!0;for(let e=0;e<c;e+=1)r=s[e],o=r[0],"space"!==o||e!==c-1||n?"comment"===o?(l=s[e-1]?s[e-1][0]:"empty",a=s[e+1]?s[e+1][0]:"empty",i[l]||i[a]||","===u.slice(-1)?h=!1:u+=r[1]):u+=r[1]:h=!1;if(!h){let n=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new r;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let n=t;n<e.length;n++)s+=e[n][1];return e.splice(t,e.length-t),s}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}}();function n(e,n){let r=new t(e,n),o=new s(r);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return Re=n,n.default=n,e.registerParse(n),Re}function lt(){if(Me)return je;Me=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return je=e,e.default=e,je}function ct(){if(De)return Be;De=1;let e=lt();class t{get content(){return this.css}constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,s);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}}return Be=t,t.default=t,Be}function ut(){if(ze)return Ue;ze=1;let e={};return Ue=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function ht(){if(Ne)return Le;Ne=1;let e=Qe(),t=et(),s=it(),n=at(),r=ct(),o=nt(),i=Z(),{isClean:a,my:l}=Ge(),c=ut();const u={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return"object"==typeof e&&"function"==typeof e.then}function d(e){let t=!1,s=u[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function m(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:d(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let y={};class w{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,s,o){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof w||s instanceof r)i=g(s.root),s.map&&(void 0===o.map&&(o.map={}),o.map.inline||(o.map.inline=!1),o.map.prev=s.map);else{let t=n;o.syntax&&(t=o.syntax.parse),o.parser&&(t=o.parser),t.parse&&(t=t.parse);try{i=t(s,o)}catch(e){this.processed=!0,this.error=e}i&&!i[l]&&e.rebuild(i)}else i=g(s);this.result=new r(t,i,o),this.helpers={...y,postcss:y,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,n=this.result.processor.version,r=t.split("."),o=n.split(".");(r[0]!==o[0]||parseInt(r[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!h[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[s])if("object"==typeof t[s])for(let n in t[s])e(t,"*"===n?s:s+"-"+n.toLowerCase(),t[s][n]);else"function"==typeof t[s]&&e(t,s,t[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],s=this.runOnRoot(t);if(f(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(f(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=this.result.root.source;if(void 0===e.map&&!(n&&n.input&&n.input.map)){let e="";return t(this.result.root,t=>{e+=t}),this.result.css=e,this.result}let r=new s(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,n]of e){let e;this.result.lastPlugin=s;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(f(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:n}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,r]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return r(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let n,r=t.iterator;for(;n=s.nodes[s.indexes[r]];)if(s.indexes[r]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete s.indexes[r]}let r=t.events;for(;t.eventIndex<r.length;){let e=r[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[a]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=d(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[s];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return w.registerPostcss=e=>{y=e},Le=w,w.default=w,o.registerLazyResult(w),t.registerLazyResult(w),Le}const pt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(function(){if(He)return Je;He=1;let e=Xe(),t=Ke(),s=Qe(),n=q(),r=Ze(),o=et(),i=function(){if(ke)return Se;ke=1;let e=Xe(),t=Ke(),s=Ze(),n=st(),r=tt(),o=nt(),i=ot();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:r.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new s(h);if("rule"===h.type)return new i(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return Se=a,a.default=a,Se}(),a=st(),l=ht(),c=rt(),u=qe(),h=at(),p=function(){if(We)return Te;We=1;let e=et(),t=ht(),s=function(){if(Ve)return Fe;Ve=1;let e=it(),t=at(),s=ct(),n=Z(),r=ut();class o{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,s=t;try{e=s(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,r,o){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=o,this._map=void 0;let i=n;this.result=new s(this._processor,void 0,this._opts),this.result.css=r;let a=this;Object.defineProperty(this.result,"root",{get:()=>a.root});let l=new e(i,void 0,this._opts,r);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}}return Fe=o,o.default=o,Fe}(),n=nt();class r{constructor(e=[]){this.version="8.5.14",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new s(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Te=r,r.default=r,n.registerProcessor(r),e.registerProcessor(r),Te}(),f=ct(),d=nt(),m=ot(),g=Z(),y=lt();function w(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new p(e)}return w.plugin=function(e,t){let s,n=!1;function r(...s){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let r=t(...s);return r.postcssPlugin=e,r.postcssVersion=(new p).version,r}return Object.defineProperty(r,"postcss",{get:()=>(s||(s=r()),s)}),r.process=function(e,t,s){return w([r(s)]).process(e,t)},r},w.stringify=g,w.parse=h,w.fromJSON=i,w.list=c,w.comment=e=>new t(e),w.atRule=t=>new e(t),w.decl=e=>new r(e),w.rule=e=>new m(e),w.root=e=>new d(e),w.document=e=>new o(e),w.CssSyntaxError=n,w.Declaration=r,w.Container=s,w.Processor=p,w.Document=o,w.Comment=t,w.Warning=y,w.AtRule=e,w.Result=f,w.Input=a,w.Rule=m,w.Root=d,w.Node=u,l.registerPostcss(w),Je=w,w.default=w,Je}());pt.stringify,pt.fromJSON,pt.plugin,pt.parse,pt.list,pt.document,pt.comment,pt.atRule,pt.rule,pt.decl,pt.root,pt.CssSyntaxError,pt.Declaration,pt.Container,pt.Processor,pt.Document,pt.Comment,pt.Warning,pt.AtRule,pt.Result,pt.Input,pt.Rule,pt.Root,pt.Node;const ft=new Set(["body","html",":root","*"]);function dt(e,t){return e&&e.trim()?pt([(s=`[data-vbi-type="${t}"]`,{postcssPlugin:"hc-scope",AtRule(e){if("import"===e.name)return console.warn("[hc-css-scope] @import 已被拒绝(防外部资源加载):",e.params),void e.remove();"font-face"===e.name&&console.warn("[hc-css-scope] @font-face 全局生效,font-family 命名注意冲突")},Rule(e){(function(e){let t=e.parent;for(;t&&"object"==typeof t;){const e=t;if("atrule"===e.type&&/keyframes$/i.test(e.name??""))return!0;t=e.parent}return!1})(e)||(e.selectors=e.selectors.map(e=>function(e,t){const s=e.trim();if(!s)return s;if(ft.has(s))return t;for(const e of ft){const n=s.charAt(e.length);if(s.startsWith(e)&&(" "===n||">"===n||"+"===n||"~"===n||","===n))return t+s.slice(e.length)}return`${t} ${s}`}(e,s)))}})]).process(e,{from:void 0}).css:"";var s}const mt=new Map;function gt(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s)|0;return(t>>>0).toString(36)}function yt(e){const t=e.replace(/[^a-zA-Z0-9_-]/g,"_");return t===e?`hc-style-${t}`:`hc-style-${t}-${gt(e).slice(0,6)}`}function wt(e,t){var s;const n=t??"",r=yt(e),o=mt.get(e);if(!n.trim())return null==(s=document.getElementById(r))||s.remove(),void(o&&mt.set(e,{...o,cssHash:""}));const i=gt(n);if(o&&o.cssHash===i)return;let a;try{a=dt(n,e)}catch(t){return void console.warn("[hc-css-scope]",e,"PostCSS process failed:",t)}!function(e,t){const s=yt(e);let n=document.getElementById(s);n||(n=document.createElement("style"),n.id=s,n.setAttribute("data-hc-scope",e),document.head.appendChild(n)),n.textContent=t}(e,a),o?mt.set(e,{...o,cssHash:i}):mt.set(e,{cssHash:i,refCount:0})}function vt(e,t){wt(e,t);const s=mt.get(e);s?mt.set(e,{...s,refCount:s.refCount+1}):mt.set(e,{cssHash:"",refCount:1})}function bt(e){var t;const s=mt.get(e);if(!s)return;const n=s.refCount-1;n<=0?(null==(t=document.getElementById(yt(e)))||t.remove(),mt.delete(e)):mt.set(e,{...s,refCount:n})}const xt=n(),Ct={key:1,class:"rounded-md border-2 border-rose-300 bg-rose-50 p-4 text-sm text-rose-900 space-y-2 min-h-[140px] overflow-auto"},St={class:"font-semibold flex items-center gap-1.5"},kt={class:"font-mono text-xs text-rose-800 break-all"},It={key:0,class:"text-[10px] font-mono bg-rose-100/60 p-2 rounded overflow-auto max-h-60 text-rose-800"},Ot=e.defineComponent({__name:"ErrorBoundary",props:{label:{},instanceId:{},canvasId:{},componentId:{}},setup(t){const s=t,n=e.ref(null),r=e.ref(0),o=e.ref(!1);function i(){n.value=null,o.value=!1,r.value++}return e.onErrorCaptured(e=>{console.error(`[hc-eb${s.label?" "+s.label:""}]`,e),n.value=e;try{xt.emit("error",{canvasId:s.canvasId,instanceId:s.instanceId,componentId:s.componentId,label:s.label,error:e,timestamp:"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now()})}catch{}return!1}),(s,a)=>(e.openBlock(),e.createElementBlock("div",{key:r.value,class:"hc-eb-root",style:{width:"100%",height:"100%"}},[n.value?(e.openBlock(),e.createElementBlock("div",Ct,[e.createElementVNode("div",St,[a[1]||(a[1]=e.createElementVNode("span",null,"⚠️",-1)),e.createElementVNode("span",null,"组件渲染失败"+e.toDisplayString(t.label?` — ${t.label}`:""),1)]),e.createElementVNode("div",kt,e.toDisplayString(n.value.message),1),e.createElementVNode("button",{class:"text-xs text-rose-700 hover:text-rose-900 underline",onClick:a[0]||(a[0]=e=>o.value=!o.value)},e.toDisplayString(o.value?"隐藏":"展开")+"堆栈 ",1),o.value?(e.openBlock(),e.createElementBlock("pre",It,e.toDisplayString(n.value.stack),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"text-xs px-3 py-1 rounded bg-rose-600 hover:bg-rose-700 text-white transition-colors",onClick:i}," 重试 ")])):e.renderSlot(s.$slots,"default",{key:0})]))}}),Et=["data-vbi-id","data-vbi-type","data-vbi-canvas"],At={key:0,class:"rounded-md border-2 border-amber-300 bg-amber-50 p-4 text-sm text-amber-900 space-y-2 min-h-[140px] overflow-auto"},Pt={class:"text-[11px] font-mono break-all whitespace-pre-wrap"},$t={key:1,class:"grid place-items-center min-h-[140px] text-xs text-zinc-400"},Rt=e.defineComponent({__name:"RuntimeBox",props:{instanceId:{},componentId:{},scopeId:{},canvasId:{},htmlSource:{},jsSource:{},cssSource:{default:""},customValues:{default:()=>({})},position:{},size:{},zIndex:{}},setup(t){const s=t,n=e.computed(()=>s.scopeId??s.componentId),r=e.inject(p,null),o=e.computed(()=>s.canvasId??r??h),l=e.shallowRef(null),c=e.ref(null),u=e.ref(!1),f=e.ref(0),d=e.ref(null);e.watch(()=>[s.htmlSource,s.jsSource],()=>{!async function(){u.value=!0,c.value=null;const e=o.value,t=s.instanceId;i(e,t,{compileStartedAt:performance.now()});try{const n=await L({html:s.htmlSource,js:s.jsSource}),r=performance.now();i(e,t,{compileEndedAt:r,mountStartedAt:r}),l.value=n,f.value++}catch(s){c.value=s instanceof Error?s:new Error(String(s)),l.value=null,i(e,t,{compileEndedAt:performance.now()})}finally{u.value=!1}}()},{immediate:!0}),e.watch(()=>[s.instanceId,o.value],(e,t)=>{const[s,n]=t,r=S(s,n);r&&r.vm===d.value&&C(s,n),f.value++});let m=!1;e.watch(()=>[s.cssSource,n.value],([e,t],s)=>{const n=(null==s?void 0:s[1])??null;n&&n!==t?(bt(n),vt(t,e),m=!0):m?wt(t,e):(vt(t,e),m=!0)},{immediate:!0});const g=e.computed(()=>{const e={width:"100%",height:"100%"};return s.position&&(e.position="absolute",e.left=`${s.position.x}px`,e.top=`${s.position.y}px`),void 0!==s.zIndex&&(e.zIndex=String(s.zIndex)),e});return e.onBeforeUnmount(()=>{m&&(bt(n.value),m=!1),a(o.value,s.instanceId)}),(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:"_vbi_box","data-vbi-id":t.instanceId,"data-vbi-type":n.value,"data-vbi-canvas":o.value,style:e.normalizeStyle(g.value)},[c.value?(e.openBlock(),e.createElementBlock("div",At,[r[0]||(r[0]=e.createElementVNode("div",{class:"font-semibold"},"⚠️ 编译失败",-1)),e.createElementVNode("pre",Pt,e.toDisplayString(c.value.message),1)])):u.value&&!l.value?(e.openBlock(),e.createElementBlock("div",$t," 编译中… ")):l.value?(e.openBlock(),e.createBlock(Ot,{key:f.value,label:t.instanceId,"instance-id":t.instanceId,"canvas-id":o.value,"component-id":t.componentId},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value.options),{ref_key:"innerVmRef",ref:d,"hc-custom-values":t.customValues,"hc-instance-id":t.instanceId,"hc-canvas-id":o.value,"hc-component-id":t.componentId},null,8,["hc-custom-values","hc-instance-id","hc-canvas-id","hc-component-id"]))]),_:1},8,["label","instance-id","canvas-id","component-id"])):e.createCommentVNode("",!0)],12,Et))}});exports.parseComponentSource=t.parseComponentSource,exports.DEFAULT_CANVAS_ID=h,exports.ErrorBoundary=Ot,exports.HC_CANVAS_ID_KEY=p,exports.HC_INJECT_KEY=j,exports.RuntimeBox=Rt,exports.VERSION="0.0.0-stage2b",exports.assets=O,exports.attachScope=vt,exports.clearCompileCache=function(){B.clear()},exports.compileComponent=L,exports.createCanvasesRegistry=A,exports.createHyperCard=function(e={}){const t=e.strict??!1,s=e.libs??{},n=e.version??"v1";return{install(e){const r=Object.entries(s),o=r.filter(([,e])=>$(e)),i=r.filter(([e])=>P.has(e)),a=[`[hypercard] 已注册 ${r.length} 个 libs:`];for(const[e,t]of r)a.push(` ${e.padEnd(16)} ${_(t)}`);console.info(a.join("\n"));const l=[];o.length>1&&l.push(`检测到 ${o.length} 个 Vue plugin(${o.map(([e])=>e).join(", ")}),请确认全局组件命名不冲突`);for(const[e]of i)l.push(`lib 名 "${e}" 是保留词,建议改名`);if(l.length>0){const e=l.map(e=>` - ${e}`).join("\n");if(t)throw new Error(`[hypercard] strict mode 阻止启动:\n${e}`);console.warn(`[hypercard] 警告:\n${e}`)}for(const[s,n]of o){const[r,o]=R(n);try{e.use(r,...o)}catch(e){if(console.error(`[hypercard] app.use("${s}") 失败:`,e),t)throw e}}const c={};for(const[e,t]of r){const[s]=R(t);c[e]=s}const u={libs:c,runtime:I,assets:O,version:n,canvases:A()};e.provide(j,u),e.config.globalProperties.$hc=u,"undefined"!=typeof window&&(window.__HYPERCARD__=u)}}},exports.detachScope=bt,exports.disableDiagnosticsEvents=function(){l>0?l--:console.warn("[hc-diagnostics] disableDiagnosticsEvents called more times than enableDiagnosticsEvents — ignored")},exports.disposeCanvas=b,exports.enableDiagnosticsEvents=function(){l++},exports.getCompileCacheSize=function(){return B.size},exports.getInstance=S,exports.getInstanceTimings=function(e,t){const s=S(t,e);return s?function(e){return e._timings}(s)??null:r.get(o(e,t))??null},exports.getScopedCssCount=function(){return mt.size},exports.injectScopedCss=wt,exports.interactionEmitter=u,exports.isDiagnosticsEventsEnabled=c,exports.isVuePlugin=$,exports.listCanvasIds=x,exports.listInstances=k,exports.onInstanceLifecycle=function(e,t){const s=e=>{try{t(e)}catch(e){console.error("[hc-registry] instance lifecycle listener threw",e)}};return d.on(e,s),()=>d.off(e,s)},exports.register=function(e,t,s){return v(h,e,t,s)},exports.registerInCanvas=v,exports.registryVersion=f,exports.removeScopedCss=function(e){var t;null==(t=document.getElementById(yt(e)))||t.remove(),mt.delete(e)},exports.runtime=I,exports.runtimeErrorEmitter=xt,exports.scopeCss=dt,exports.subscribeCanvasInventory=function(e,t){return w.on(e,t),()=>w.off(e,t)},exports.unregister=C;
package/dist/index.d.ts CHANGED
@@ -8,12 +8,6 @@ import { Plugin as Plugin_2 } from 'vue';
8
8
  import { PublicProps } from 'vue';
9
9
  import { Ref } from 'vue';
10
10
 
11
- export declare function __resetDiagnosticsEventsFlag(): void;
12
-
13
- export declare function __resetLifecycleEmitter(): void;
14
-
15
- export declare function __resetRegistry(): void;
16
-
17
11
  declare const __VLS_component: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
18
12
 
19
13
  declare type __VLS_Props = {
@@ -98,8 +92,6 @@ export declare interface CanvasRuntimeHandle {
98
92
 
99
93
  export declare function clearCompileCache(): void;
100
94
 
101
- export declare function clearInstanceTimings(canvasId: string, instanceId: string): void;
102
-
103
95
  export declare function compileComponent(source: ComponentSource): Promise<CompiledComponent>;
104
96
 
105
97
  export declare interface CompiledComponent {
@@ -117,6 +109,7 @@ export declare interface ComponentInstanceHandle {
117
109
  setProp(key: string, value: unknown): void;
118
110
  setDataInput(key: string, value: unknown): void;
119
111
  __dispose(): void;
112
+ _timings?: InstanceTimings;
120
113
  }
121
114
 
122
115
  export declare type ComponentKindRaw = 'visual' | 'layout' | 'data';
@@ -138,8 +131,6 @@ export declare interface ComponentSource {
138
131
  js: string;
139
132
  }
140
133
 
141
- export declare function consumePendingTimings(canvasId: string, instanceId: string): InstanceTimings | null;
142
-
143
134
  export declare function createCanvasesRegistry(): CanvasesRegistryAPI;
144
135
 
145
136
  export declare function createHyperCard(config?: HyperCardConfig): Plugin_2;
@@ -158,13 +149,6 @@ export declare interface DataDirectionDecl {
158
149
  label?: string;
159
150
  }
160
151
 
161
- export declare function debugScopedCssRefs(): Array<{
162
- scopeId: string;
163
- componentId: string;
164
- refCount: number;
165
- cssHash: string;
166
- }>;
167
-
168
152
  export declare const DEFAULT_CANVAS_ID = "__default__";
169
153
 
170
154
  export declare function detachScope(scopeId: string): void;
@@ -298,8 +282,6 @@ export declare interface ParsedSource {
298
282
  kind: ComponentKindRaw;
299
283
  }
300
284
 
301
- export declare function patchInstanceTimings(canvasId: string, instanceId: string, patch: InstanceTimings): void;
302
-
303
285
  export declare interface PropDecl {
304
286
  key: string;
305
287
  value?: unknown;
@@ -331,7 +313,9 @@ export declare interface RuntimeAPI {
331
313
  export declare const RuntimeBox: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
332
314
  cssSource: string;
333
315
  customValues: Record<string, unknown>;
334
- }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
316
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
317
+ innerVmRef: unknown;
318
+ }, HTMLDivElement>;
335
319
 
336
320
  export declare const runtimeErrorEmitter: Emitter<EventMap>;
337
321