@hy-bricks/core 0.6.2 → 0.6.3
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 +32 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @hy-bricks/core
|
|
2
2
|
|
|
3
|
+
## [0.6.3] - 2026-06-24 · 组件运行态快照持久化
|
|
4
|
+
|
|
5
|
+
非破坏 patch。@hy-bricks 4 包同步升 0.6.3。本版实际代码改动在 core(快照 store + compileComponent 还原/拍照 + watcher diff + RuntimeBox prop + instanceRegistry disposeCanvas 清快照)。修 portal 反馈「看板组件滚出视口 / 重渲染后,用户运行时选值(如维度=年)变回默认(日)、查询条件丢」。
|
|
6
|
+
|
|
7
|
+
两条独立根因:① **重渲染冲刷** —— 渲染器每次重渲都传"内容相同、引用不同"的新 `:custom-values` 对象,旧 `hcCustomValues` watch 无条件把它写回文档默认,冲掉用户运行时改过的 custom 值;② **视口虚拟化拆/重建丢状态** —— 0.6.2 的 `keepHiddenMounted` 只保住 `v-show` 隐藏(`display:none`)的 root 实例,但 RenderScheduler 会把"滚出视口超 `disposeDelayMs`"的实例**真 dispose 卸 vm**,滚回来重建全新组件、`data()` 重跑、选值复位。
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- **watcher diff(无 gate,所有宿主常开)**:`hcCustomValues` watch 现在只在某 key 的 override 值**相对上次 prop** 真变化时才同步(`Object.is` 比较),重渲染噪声不再冲掉运行时选值;host 经属性面板真改值(old≠new)仍正常同步。初始值走 `data()` merge,该 watch 非 `immediate`。
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **快照持久化(gate:`persistInstanceState`,默认 `false`,opt-in)**:针对实例**真被拆掉**的场景(滚出视口虚拟化 dispose/重建)——vm 销毁前(`beforeUnmount`,owner 守卫:确认 registry 里仍是自己才拍)拍 `$data` 的可序列化子集,重建时还原两次(`created` 一次 + `mounted` 跑完再一次,二次还原赢过组件自己 `mounted` 里的重算)。
|
|
14
|
+
- 类实例(ResizeObserver / Map / Set / Date / DOM / Vue 组件)**跳过不拍**(否则序列化成 `{}`,还原后 `this.resizeObserver.disconnect()` 抛错);custom 只存各键 `.value`(压成 `{k:value}`);`_` 前缀键、函数跳过。
|
|
15
|
+
- `componentId` 版本守卫:同 `(canvasId, instanceId)` 但 `componentId` 变 → 丢弃旧快照走默认;快照表 LRU 封顶 200;画布 `disposeCanvas` 时按 `canvasId` 清;`get` 返回防御性深拷贝(非 store 活引用),防两次还原间被组件原地 mutate 污染。
|
|
16
|
+
- 内部快照 store **不进公开 barrel**(`takeInstanceStateSnapshot` / `getInstanceStateSnapshot` / `captureSnapshotData` 等不导出)。
|
|
17
|
+
- **`RuntimeBox` 新 prop `persistInstanceState`**(`boolean`,默认 `false`):快照持久化开关,由渲染器一路透下来。
|
|
18
|
+
- **编译组件保留 prop `hcPersistInstanceState`**(SDK 注入):组件作者**别声明同名 prop**;由渲染器透下来,host 不直接设。
|
|
19
|
+
|
|
20
|
+
### 与 keepHiddenMounted(0.6.2)的关系(互补)
|
|
21
|
+
- `keepHiddenMounted`(默认 `true`):hidden(`v-show` / `display:none`)的 root 实例不被 dispose,vm 不拆 —— 根本不丢状态,不需要快照。
|
|
22
|
+
- `persistInstanceState`(默认 `false`):实例**真被拆掉**(滚出视口虚拟化 dispose/重建)才拍照+还原。
|
|
23
|
+
- 一句话:hidden 走保活(vm 不拆);scroll-out 拆了才用快照。
|
|
24
|
+
|
|
25
|
+
### 已知限制
|
|
26
|
+
- **异步 mounted 重置不在保护范围**:还原是同步的(跑在 `userMounted` 之后)。组件若在 `mounted` 里**异步**重置状态(如 `fetch().then(set)`),微任务在还原之后才 resolve,会盖过还原值 → 选值仍丢。只保护同步状态;组件应把"被持久化的字段"当 source-of-truth,别在 `mounted` 里盲目异步重置(portal 真实筛选组件不踩:选值是查询的输入,不被查询结果反写)。spec 已锁住该当前行为(known-limitation 用例)。
|
|
27
|
+
- **`instanceId` 必须逻辑唯一、不可删后复用**:快照按 `(canvasId, instanceId)` + `componentId` 守卫。宿主删掉一个实例后,若用**相同 `instanceId` 且相同 `componentId`** 新建另一个,会继承已删实例的陈旧状态(快照仅 canvas dispose / LRU 才清)。用唯一 id,别删了又复用。
|
|
28
|
+
- (沿用 0.6.2)hidden / 保活 / 持久化的实例在不可见时仍在取数 / 订阅;本版未改。
|
|
29
|
+
|
|
30
|
+
### spec
|
|
31
|
+
- core test +3:1 aliasing(watcher diff)+ 2 sync/async known-limitation;core test → 243。
|
|
32
|
+
|
|
33
|
+
> 状态:本条目对应改动已收口、全验证绿,但**尚未 publish npm**(pre-1.0 手动 bump,待 `pnpm release`)。
|
|
34
|
+
|
|
3
35
|
## [0.6.2] - 2026-06-23
|
|
4
36
|
|
|
5
37
|
随 @hy-bricks fixed 组同步升 0.6.2;本包**无功能改动**(本次仅 `@hy-bricks/canvas` 隐藏实例保活修复 + `keepHiddenMounted` prop + `RenderScheduler.setHeld`)。
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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=E(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 c=0;function l(){return c>0}const u=n(),h=new Map;function p(e,t){return`${e}\0${t}`}function f(e,t,s){if(!e||!t)return null;const n=p(e,t),r=h.get(n);return r?r.componentId!==s?(h.delete(n),null):(h.delete(n),h.set(n,r),function(e){try{return JSON.parse(JSON.stringify(e))}catch{return e}}(r.data)):null}function d(e){if(void 0===e||"function"==typeof e||"symbol"==typeof e)return{ok:!1};if(null===e||"object"!=typeof e)return{ok:!0,value:e};if(!function(e){if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(e))return{ok:!1};try{return{ok:!0,value:JSON.parse(JSON.stringify(e))}}catch{return{ok:!1}}}const m="__default__",g="__hcCanvasId",y=e.ref(0),w=n();function v(e,t){w.emit(e,t)}const b=new Set,x=new Map,C=n();function S(e,t,s,i){var a;const c=function(e,t){return`${e}\0${t}`}(e,t);if(b.has(c)){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)}b.add(c);try{const c=!x.has(e),h=function(e){let t=x.get(e);return t||(t=new Map,x.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),v("instance:unmounted",{canvasId:e,instanceId:t}));const p=function(e,t,s,r){const o=n();function i(n,r,o){if(l())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 f=function(e,t){const s=o(e,t),n=r.get(s);return n?(r.delete(s),n):null}(e,t);return f&&(p._timings={...f}),y.value++,c&&C.emit("canvas:added",{canvasId:e}),v("instance:ready",{canvasId:e,instanceId:t}),p}finally{b.delete(c)}}function I(e){const t=x.get(e);if(!t)return;const s=[];for(const[n,r]of t)r.__dispose(),s.push(n),a(e,n);t.clear(),x.delete(e),function(e){if(!e)return;const t=`${e}\0`;for(const e of[...h.keys()])e.startsWith(t)&&h.delete(e)}(e),y.value++;for(const t of s)v("instance:unmounted",{canvasId:e,instanceId:t});C.emit("canvas:removed",{canvasId:e})}function k(){return[...x.keys()]}function O(e,t=m){const s=x.get(t);if(!s)return;const n=s.get(e);n&&(n.__dispose(),s.delete(e),a(t,e),y.value++,v("instance:unmounted",{canvasId:t,instanceId:e}))}function E(e,t){var s;if(void 0!==t)return(null==(s=x.get(t))?void 0:s.get(e))??null;let n=null;const r=[];for(const[t,s]of x){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 A(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=x.get(e.canvasId);return t?[...t.values()].filter(s):[]}const n=[];for(const e of x.values())for(const t of e.values())s(t)&&n.push(t);return n}const P={getInstance:E,listInstances:A,call(e,t,...s){const n=E(e);if(n)return n.call(t,...s);console.debug(`[hc-runtime] call: instance "${e}" not found`)},on(e,t,s){const n=E(e);if(n)return n.on(t,s);console.debug(`[hc-runtime] on: instance "${e}" not found`)},emit(e,t,s){const n=E(e);n?n.emit(t,s):console.debug(`[hc-runtime] emit: instance "${e}" not found`)}},j={pickerUrl:e=>`/a/${e}`};function $(e){return{canvasId:e,listInstances:t=>A({canvasId:e,componentId:null==t?void 0:t.componentId}),getInstance:t=>E(t,e),call(t,s,...n){const r=E(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=E(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=A({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(){I(e)}}}function R(){return{list:()=>k().map(e=>$(e)),get:e=>k().includes(e)?$(e):null,getAll(){const e={};for(const t of k())e[t]=$(t);return e},callComponent(e,t,s,...n){const r=E(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=E(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 k())try{const n=A({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 B(e){return Array.isArray(e)&&e.length>=1?B(e[0]):"object"==typeof e&&null!==e&&"function"==typeof e.install}function M(e){return Array.isArray(e)&&e.length>=1?[e[0],e.slice(1)]:[e,[]]}function D(e){return B(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 U="__HYPERCARD__";function z(e,t){const s=e.$data,n=s.custom;for(const e of Object.keys(t)){if("custom"===e){const e=t.custom;if(e&&n)for(const t of Object.keys(e)){const s=n[t];s&&"object"==typeof s&&(s.value=e[t])}continue}Object.prototype.hasOwnProperty.call(s,e)&&(s[e]=t[e])}}const N=new Set(["init","onClick","onMouseover","onMouseout","onResize","onDestroy"]),L=new Map;function F(e,t){for(L.has(e)&&L.delete(e),L.set(e,t);L.size>100;){const e=L.keys().next().value;if(void 0===e)break;L.delete(e)}}function V(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 T(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 W(e){const n=V(e.html)+"_"+V(e.js),r=L.get(n);if(r)return F(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??{},c=n.custom??{},l=n.style??{},u=n.slots,m=n.data,g=n.methods??{},y=n.computed,w=n.watch,v=n.created,b=n.mounted,x=n.beforeUnmount,C=n.props,I=new Set(["name","method","attribute","custom","style","option","data","methods","computed","watch","created","mounted","beforeUnmount","props","slots"]),k={};for(const e of Object.keys(n))I.has(e)||(k[e]=n[e]);const A={};for(const[e,t]of Object.entries(o))N.has(e)||"function"!=typeof t||(A[e]=t);const P=Object.keys(A),j={...A,...g},$=(t??"").trim()||"<div></div>",R=s.compile($);if("function"!=typeof R)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:R,props:{...C?Array.isArray(C)?Object.fromEntries(C.map(e=>[e,null])):"object"==typeof C?C:{}:{},hcCustomValues:{type:Object,default:()=>({})},hcInstanceId:{type:String,default:""},hcCanvasId:{type:String,default:""},hcComponentId:{type:String,default:""},hcPersistInstanceState:{type:Boolean,default:!1}},data(){const e="function"==typeof m?m.call(this):m??{},t=this.hcCustomValues??{},s={};for(const[e,n]of Object.entries(c)){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:j,computed:y,watch:(()=>{const e=w&&"object"==typeof w?{...w}:{};return e.hcCustomValues={handler(e,t){if(e&&this.custom)for(const[s,n]of Object.entries(e)){if(t&&Object.is(t[s],n))continue;const e=this.custom[s];e&&"object"==typeof e&&(e.value=n)}},deep:!0},e})(),created(){if(this.hcPersistInstanceState&&this.hcInstanceId&&this.hcCanvasId){const e=f(this.hcCanvasId,this.hcInstanceId,this.hcComponentId);e&&z(this,e)}this.hcInstanceId&&this.hcCanvasId&&S(this.hcCanvasId,this.hcInstanceId,this.hcComponentId,this),"function"==typeof v&&v.call(this)},mounted(){try{const e=[],t=this.$el;if(t&&t instanceof HTMLElement){Object.assign(t.style,l);for(const[e,s]of Object.entries(a))"string"==typeof s&&s&&t.setAttribute(e,s);for(const s of N){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 b&&b.call(this);const n=this;if(n.hcPersistInstanceState&&n.hcInstanceId&&n.hcCanvasId){const e=f(n.hcCanvasId,n.hcInstanceId,n.hcComponentId);e&&z(n,e)}}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=E(this.hcInstanceId,this.hcCanvasId);e&&e.vm===this&&(this.hcPersistInstanceState&&function(e,t,s,n){if(!e||!t)return;const r=p(e,t);for(h.delete(r),h.set(r,{data:n,componentId:s});h.size>200;){const e=h.keys().next().value;if(void 0===e)break;h.delete(e)}}(this.hcCanvasId,this.hcInstanceId,this.hcComponentId,function(e){const t={};if(!e||"object"!=typeof e)return t;for(const s of Object.keys(e)){if(s.startsWith("_"))continue;const n=e[s];if("function"==typeof n)continue;if("custom"===s&&n&&"object"==typeof n){const e={};for(const t of Object.keys(n)){const s=n[t];if(s&&"object"==typeof s&&"value"in s){const n=d(s.value);n.ok&&(e[t]=n.value)}}Object.keys(e).length>0&&(t.custom=e);continue}const r=d(n);r.ok&&(t[s]=r.value)}return t}(this.$data)),O(this.hcInstanceId,this.hcCanvasId))}null==(e=this.__hcCleanup)||e.forEach(e=>{try{e()}catch{}}),this.__hcCleanup=void 0,"function"==typeof x&&x.call(this)},...k},meta:{name:r,attribute:a,style:l,customDecl:c,methodNames:P,slotsDecl:T(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 F(n,o),o.catch(()=>{L.get(n)===o&&L.delete(n)}),o}var J,H={exports:{}};const Y=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 G,q,K,Z,Q,X;function ee(){if(q)return G;q=1;let e=function(){if(J)return H.exports;J=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 H.exports=t(),H.exports.createColors=t,H.exports}(),t=Y;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/),c=Math.max(this.line-3,0),l=Math.min(this.line+2,a.length),u=String(l).length;return a.slice(c,l).map((e,t)=>{let s=c+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),c=e.slice(s,a),l=r(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return o(">")+r(n)+i(c)+"\n "+l+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 G=s,s.default=s,G}function te(){if(Z)return K;Z=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"+((c=s)[0].toUpperCase()+c.slice(1));this[n]?r=this[n](i,e):i.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var c;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 K=r,r.default=r,K}function se(){if(X)return Q;X=1;let e=te();function t(t,s){new e(s).stringify(t)}return Q=t,t.default=t,Q}var ne,re,oe,ie,ae,ce,le,ue,he,pe,fe,de,me,ge,ye,we,ve,be,xe,Ce,Se,Ie,ke,Oe,Ee,Ae,Pe,je,$e,Re,_e,Be,Me,De,Ue,ze,Ne,Le,Fe,Ve,Te,We,Je,He,Ye,Ge,qe,Ke,Ze,Qe={};function Xe(){return ne||(ne=1,Qe.isClean=Symbol("isClean"),Qe.my=Symbol("my")),Qe}function et(){if(oe)return re;oe=1;let e=ee(),t=te(),s=se(),{isClean:n,my:r}=Xe();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 re=a,a.default=a,re}function tt(){if(ae)return ie;ae=1;let e=et();class t extends e{constructor(e){super(e),this.type="comment"}}return ie=t,t.default=t,ie}function st(){if(le)return ce;le=1;let e=et();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 ce=t,t.default=t,ce}function nt(){if(he)return ue;he=1;let e,t,s,n,r=tt(),o=st(),i=et(),{isClean:a,my:c}=Xe();function l(e){return e.map(e=>(e.nodes&&(e.nodes=l(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=l(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[c]||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},ue=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[c]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},ue}function rt(){if(fe)return pe;fe=1;let e=nt();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 pe=t,t.default=t,e.registerAtRule(t),pe}function ot(){if(me)return de;me=1;let e,t,s=nt();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},de=n,n.default=n,de}function it(){if(ve)return we;ve=1;let{existsSync:e,readFileSync:t}=Y,{dirname:s,join:n}=Y,{SourceMapConsumer:r,SourceMapGenerator:o}=Y;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 we=i,i.default=i,we}function at(){if(xe)return be;xe=1;let{nanoid:e}=ye?ge:(ye=1,ge={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}=Y,{SourceMapConsumer:n,SourceMapGenerator:r}=Y,{fileURLToPath:o,pathToFileURL:i}=Y,a=ee(),c=it(),l=Y,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 c(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,c,l,u;if(t&&"object"==typeof t){let e=t,n=s;if("number"==typeof e.offset){l=e.offset;let n=this.fromOffset(l);t=n.line,s=n.col}else t=e.line,s=e.column,l=this.fromLineAndColumn(t,s);if("number"==typeof n.offset){c=n.offset;let e=this.fromOffset(c);o=e.line,r=e.col}else o=n.line,r=n.column,c=this.fromLineAndColumn(n.line,n.column)}else if(s)l=this.fromLineAndColumn(t,s);else{l=t;let e=this.fromOffset(l);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:c,line:t,offset:l,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,c,l=this.map.consumer(),u=l.originalPositionFor({column:s,line:e});if(!u.source)return!1;"number"==typeof n&&(a=l.originalPositionFor({column:r,line:n})),c=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:c.toString()};if("file:"===c.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");h.file=o(c)}let p=l.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 be=d,d.default=d,l&&l.registerInput&&l.registerInput(d),be}function ct(){if(Se)return Ce;Se=1;let e,t,s=nt();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},Ce=n,n.default=n,s.registerRoot(n),Ce}function lt(){if(ke)return Ie;ke=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,c="",l=!1;for(let s of e)l?l=!1:"\\"===s?l=!0:a?s===c&&(a=!1):'"'===s||"'"===s?(a=!0,c=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 Ie=e,e.default=e,Ie}function ut(){if(Ee)return Oe;Ee=1;let e=nt(),t=lt();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 Oe=s,s.default=s,e.registerRule(s),Oe}function ht(){if($e)return je;$e=1;let{dirname:e,relative:t,resolve:s,sep:n}=Y,{SourceMapConsumer:r,SourceMapGenerator:o}=Y,{pathToFileURL:i}=Y,a=at(),c=Boolean(r&&o),l=Boolean(e&&s&&t&&n);return je=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(),l&&c&&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,c)=>{if(this.css+=o,a&&"end"!==c&&(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"!==c){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 pt(){if(Ue)return De;Ue=1;let e=nt(),t=at(),s=function(){if(Me)return Be;Me=1;let e=rt(),t=tt(),s=st(),n=ct(),r=ut(),o=function(){if(_e)return Re;_e=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),c="\r".charCodeAt(0),l="[".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 Re=function(S,I={}){let k,O,E,A,P,j,$,R,_,B,M=S.css.valueOf(),D=I.ignoreErrors,U=M.length,z=0,N=[],L=[],F=-1;function V(e){throw S.error("Unclosed "+e,z)}return{back:function(e){L.push(e)},endOfFile:function(){return 0===L.length&&z>=U},nextToken:function(S){if(L.length)return L.pop();if(z>=U)return;let I=!!S&&S.ignoreUnclosed;switch(k=M.charCodeAt(z),k){case r:case o:case a:case c:case i:A=z;do{A+=1,k=M.charCodeAt(A)}while(k===o||k===r||k===a||k===c||k===i);j=["space",M.slice(z,A)],z=A-1;break;case l:case u:case f:case d:case y:case m:case p:{let e=String.fromCharCode(k);j=[e,e,z];break}case h:if(B=N.length?N.pop()[1]:"",_=M.charCodeAt(z+1),"url"===B&&_!==e&&_!==t&&_!==o&&_!==r&&_!==a&&_!==i&&_!==c){A=z;do{if($=!1,A=M.indexOf(")",A+1),-1===A){if(D||I){A=z;break}V("bracket")}for(R=A;M.charCodeAt(R-1)===s;)R-=1,$=!$}while($);j=["brackets",M.slice(z,A+1),z,A],z=A}else z<=F?j=["(","(",z]:(A=M.indexOf(")",z+1),O=M.slice(z,A+1),-1===A||x.test(O)?(F=-1===A?U:A,j=["(","(",z]):(j=["brackets",O,z,A],z=A));break;case e:case t:P=k===e?"'":'"',A=z;do{if($=!1,A=M.indexOf(P,A+1),-1===A){if(D||I){A=z+1;break}V("string")}for(R=A;M.charCodeAt(R-1)===s;)R-=1,$=!$}while($);j=["string",M.slice(z,A+1),z,A],z=A;break;case w:v.lastIndex=z+1,v.test(M),A=0===v.lastIndex?M.length-1:v.lastIndex-2,j=["at-word",M.slice(z,A+1),z,A],z=A;break;case s:for(A=z,E=!0;M.charCodeAt(A+1)===s;)A+=1,E=!E;if(k=M.charCodeAt(A+1),E&&k!==n&&k!==o&&k!==r&&k!==a&&k!==c&&k!==i&&(A+=1,C.test(M.charAt(A)))){for(;C.test(M.charAt(A+1));)A+=1;M.charCodeAt(A+1)===o&&(A+=1)}j=["word",M.slice(z,A+1),z,A],z=A;break;default:k===n&&M.charCodeAt(z+1)===g?(A=M.indexOf("*/",z+2)+1,0===A&&(D||I?A=M.length:V("comment")),j=["comment",M.slice(z,A+1),z,A],z=A):(b.lastIndex=z+1,b.test(M),A=0===b.lastIndex?M.length-1:b.lastIndex-2,j=["word",M.slice(z,A+1),z,A],N.push(j),z=A)}return z++,j},position:function(){return z}}}}();const i={empty:!0,space:!0};return Be=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,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(s=(t=this.tokenizer.nextToken())[0],"("===s||"["===s?l.push("("===s?")":"]"):"{"===s&&l.length>0?l.push("}"):s===l[l.length-1]&&l.pop(),0===l.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(c.length>0){for(r=c.length-1,n=c[r];n&&"space"===n[0];)n=c[--r];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(t);break}c.push(t)}else c.push(t);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(o.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(o,"params",c),i&&(t=c[c.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=[],c=e;for(;c;){if(s=c[0],a.push(c),"("===s||"["===s)r||(r=c),o.push("("===s?")":"]");else if(i&&n&&"{"===s)r||(r=c),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));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(r),t&&n){if(!i)for(;a.length&&(c=a[a.length-1][0],"space"===c||"comment"===c);)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,c,l=s.length,u="",h=!0;for(let e=0;e<l;e+=1)r=s[e],o=r[0],"space"!==o||e!==l-1||n?"comment"===o?(c=s[e-1]?s[e-1][0]:"empty",a=s[e+1]?s[e+1][0]:"empty",i[c]||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 De=n,n.default=n,e.registerParse(n),De}function ft(){if(Ne)return ze;Ne=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 ze=e,e.default=e,ze}function dt(){if(Fe)return Le;Fe=1;let e=ft();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 Le=t,t.default=t,Le}function mt(){if(Te)return Ve;Te=1;let e={};return Ve=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function gt(){if(Je)return We;Je=1;let e=nt(),t=ot(),s=ht(),n=pt(),r=dt(),o=ct(),i=se(),{isClean:a,my:c}=Xe(),l=mt();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[c]&&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||l("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},We=w,w.default=w,o.registerLazyResult(w),t.registerLazyResult(w),We}const yt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(function(){if(Ze)return Ke;Ze=1;let e=rt(),t=tt(),s=nt(),n=ee(),r=st(),o=ot(),i=function(){if(Pe)return Ae;Pe=1;let e=rt(),t=tt(),s=st(),n=at(),r=it(),o=ct(),i=ut();function a(c,l){if(Array.isArray(c))return c.map(e=>a(e));let{inputs:u,...h}=c;if(u){l=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:r.prototype}),l.push(t)}}if(h.nodes&&(h.nodes=c.nodes.map(e=>a(e,l))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=l[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: "+c.type)}return Ae=a,a.default=a,Ae}(),a=at(),c=gt(),l=lt(),u=et(),h=pt(),p=function(){if(qe)return Ge;qe=1;let e=ot(),t=gt(),s=function(){if(Ye)return He;Ye=1;let e=ht(),t=pt(),s=dt(),n=se(),r=mt();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 c=new e(i,void 0,this._opts,r);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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 He=o,o.default=o,He}(),n=ct();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 Ge=r,r.default=r,n.registerProcessor(r),e.registerProcessor(r),Ge}(),f=dt(),d=ct(),m=ut(),g=se(),y=ft();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=l,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,c.registerPostcss(w),Ke=w,w.default=w,Ke}());yt.stringify,yt.fromJSON,yt.plugin,yt.parse,yt.list,yt.document,yt.comment,yt.atRule,yt.rule,yt.decl,yt.root,yt.CssSyntaxError,yt.Declaration,yt.Container,yt.Processor,yt.Document,yt.Comment,yt.Warning,yt.AtRule,yt.Result,yt.Input,yt.Rule,yt.Root,yt.Node;const wt=new Set(["body","html",":root","*"]);function vt(e,t){return e&&e.trim()?yt([(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(wt.has(s))return t;for(const e of wt){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 bt=new Map;function xt(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 Ct(e){const t=e.replace(/[^a-zA-Z0-9_-]/g,"_");return t===e?`hc-style-${t}`:`hc-style-${t}-${xt(e).slice(0,6)}`}function St(e,t){var s;const n=t??"",r=Ct(e),o=bt.get(e);if(!n.trim())return null==(s=document.getElementById(r))||s.remove(),void(o&&bt.set(e,{...o,cssHash:""}));const i=xt(n);if(o&&o.cssHash===i)return;let a;try{a=vt(n,e)}catch(t){return void console.warn("[hc-css-scope]",e,"PostCSS process failed:",t)}!function(e,t){const s=Ct(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?bt.set(e,{...o,cssHash:i}):bt.set(e,{cssHash:i,refCount:0})}function It(e,t){St(e,t);const s=bt.get(e);s?bt.set(e,{...s,refCount:s.refCount+1}):bt.set(e,{cssHash:"",refCount:1})}function kt(e){var t;const s=bt.get(e);if(!s)return;const n=s.refCount-1;n<=0?(null==(t=document.getElementById(Ct(e)))||t.remove(),bt.delete(e)):bt.set(e,{...s,refCount:n})}const Ot=n(),Et={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"},At={class:"font-semibold flex items-center gap-1.5"},Pt={class:"font-mono text-xs text-rose-800 break-all"},jt={key:0,class:"text-[10px] font-mono bg-rose-100/60 p-2 rounded overflow-auto max-h-60 text-rose-800"},$t=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{Ot.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",Et,[e.createElementVNode("div",At,[a[1]||(a[1]=e.createElementVNode("span",null,"⚠️",-1)),e.createElementVNode("span",null,"组件渲染失败"+e.toDisplayString(t.label?` — ${t.label}`:""),1)]),e.createElementVNode("div",Pt,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",jt,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})]))}}),Rt=["data-vbi-id","data-vbi-type","data-vbi-canvas"],_t={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"},Bt={class:"text-[11px] font-mono break-all whitespace-pre-wrap"},Mt={key:1,class:"grid place-items-center min-h-[140px] text-xs text-zinc-400"},Dt=e.defineComponent({__name:"RuntimeBox",props:{instanceId:{},componentId:{},scopeId:{},canvasId:{},htmlSource:{},jsSource:{},cssSource:{default:""},customValues:{default:()=>({})},position:{},size:{},zIndex:{},persistInstanceState:{type:Boolean,default:!1}},setup(t){const s=t,n=e.computed(()=>s.scopeId??s.componentId),r=e.inject(g,null),o=e.computed(()=>s.canvasId??r??m),c=e.shallowRef(null),l=e.ref(null),u=e.ref(!1),h=e.ref(0),p=e.ref(null);e.watch(()=>[s.htmlSource,s.jsSource],()=>{!async function(){u.value=!0,l.value=null;const e=o.value,t=s.instanceId;i(e,t,{compileStartedAt:performance.now()});try{const n=await W({html:s.htmlSource,js:s.jsSource}),r=performance.now();i(e,t,{compileEndedAt:r,mountStartedAt:r}),c.value=n,h.value++}catch(s){l.value=s instanceof Error?s:new Error(String(s)),c.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=E(s,n);r&&r.vm===p.value&&O(s,n),h.value++});let f=!1;e.watch(()=>[s.cssSource,n.value],([e,t],s)=>{const n=(null==s?void 0:s[1])??null;n&&n!==t?(kt(n),It(t,e),f=!0):f?St(t,e):(It(t,e),f=!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(()=>{f&&(kt(n.value),f=!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(d.value)},[l.value?(e.openBlock(),e.createElementBlock("div",_t,[r[0]||(r[0]=e.createElementVNode("div",{class:"font-semibold"},"⚠️ 编译失败",-1)),e.createElementVNode("pre",Bt,e.toDisplayString(l.value.message),1)])):u.value&&!c.value?(e.openBlock(),e.createElementBlock("div",Mt," 编译中… ")):c.value?(e.openBlock(),e.createBlock($t,{key:h.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(c.value.options),{ref_key:"innerVmRef",ref:p,"hc-custom-values":t.customValues,"hc-instance-id":t.instanceId,"hc-canvas-id":o.value,"hc-component-id":t.componentId,"hc-persist-instance-state":t.persistInstanceState},null,8,["hc-custom-values","hc-instance-id","hc-canvas-id","hc-component-id","hc-persist-instance-state"]))]),_:1},8,["label","instance-id","canvas-id","component-id"])):e.createCommentVNode("",!0)],12,Rt))}});exports.parseComponentSource=t.parseComponentSource,exports.DEFAULT_CANVAS_ID=m,exports.ErrorBoundary=$t,exports.HC_CANVAS_ID_KEY=g,exports.HC_INJECT_KEY=U,exports.RuntimeBox=Dt,exports.VERSION="0.0.0-stage2b",exports.assets=j,exports.attachScope=It,exports.clearCompileCache=function(){L.clear()},exports.compileComponent=W,exports.createCanvasesRegistry=R,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])=>B(e)),i=r.filter(([e])=>_.has(e)),a=[`[hypercard] 已注册 ${r.length} 个 libs:`];for(const[e,t]of r)a.push(` ${e.padEnd(16)} ${D(t)}`);console.info(a.join("\n"));const c=[];o.length>1&&c.push(`检测到 ${o.length} 个 Vue plugin(${o.map(([e])=>e).join(", ")}),请确认全局组件命名不冲突`);for(const[e]of i)c.push(`lib 名 "${e}" 是保留词,建议改名`);if(c.length>0){const e=c.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]=M(n);try{e.use(r,...o)}catch(e){if(console.error(`[hypercard] app.use("${s}") 失败:`,e),t)throw e}}const l={};for(const[e,t]of r){const[s]=M(t);l[e]=s}const u={libs:l,runtime:P,assets:j,version:n,canvases:R()};e.provide(U,u),e.config.globalProperties.$hc=u,"undefined"!=typeof window&&(window.__HYPERCARD__=u)}}},exports.detachScope=kt,exports.disableDiagnosticsEvents=function(){c>0?c--:console.warn("[hc-diagnostics] disableDiagnosticsEvents called more times than enableDiagnosticsEvents — ignored")},exports.disposeCanvas=I,exports.enableDiagnosticsEvents=function(){c++},exports.getCompileCacheSize=function(){return L.size},exports.getInstance=E,exports.getInstanceTimings=function(e,t){const s=E(t,e);return s?function(e){return e._timings}(s)??null:r.get(o(e,t))??null},exports.getScopedCssCount=function(){return bt.size},exports.injectScopedCss=St,exports.interactionEmitter=u,exports.isDiagnosticsEventsEnabled=l,exports.isVuePlugin=B,exports.listCanvasIds=k,exports.listInstances=A,exports.onInstanceLifecycle=function(e,t){const s=e=>{try{t(e)}catch(e){console.error("[hc-registry] instance lifecycle listener threw",e)}};return w.on(e,s),()=>w.off(e,s)},exports.register=function(e,t,s){return S(m,e,t,s)},exports.registerInCanvas=S,exports.registryVersion=y,exports.removeScopedCss=function(e){var t;null==(t=document.getElementById(Ct(e)))||t.remove(),bt.delete(e)},exports.runtime=P,exports.runtimeErrorEmitter=Ot,exports.scopeCss=vt,exports.subscribeCanvasInventory=function(e,t){return C.on(e,t),()=>C.off(e,t)},exports.unregister=O;
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ declare type __VLS_Props = {
|
|
|
28
28
|
h: number;
|
|
29
29
|
};
|
|
30
30
|
zIndex?: number;
|
|
31
|
+
persistInstanceState?: boolean;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
declare type __VLS_Props_2 = {
|
|
@@ -313,6 +314,7 @@ export declare interface RuntimeAPI {
|
|
|
313
314
|
export declare const RuntimeBox: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
314
315
|
cssSource: string;
|
|
315
316
|
customValues: Record<string, unknown>;
|
|
317
|
+
persistInstanceState: boolean;
|
|
316
318
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
317
319
|
innerVmRef: unknown;
|
|
318
320
|
}, HTMLDivElement>;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"vue";import{ref as t,defineComponent as s,onErrorCaptured as n,openBlock as r,createElementBlock as o,renderSlot as i,createElementVNode as a,toDisplayString as l,createCommentVNode as c,computed as u,inject as h,shallowRef as p,watch as f,onBeforeUnmount as d,normalizeStyle as m,createBlock as g,withCtx as y,resolveDynamicComponent as w}from"vue";import{p as v}from"./parseSourceEntry-IGf6vyI7.js";import{a as b}from"./parseSourceEntry-IGf6vyI7.js";function x(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 C=new Map;function S(e,t){return`${e}::${t}`}function k(e,t,s){const n=Y(t,e);if(n)return void Object.assign(function(e){return e._timings||(e._timings={}),e._timings}(n),s);const r=S(e,t),o=C.get(r)??{};C.set(r,{...o,...s})}function I(e,t){const s=Y(t,e);return s?function(e){return e._timings}(s)??null:C.get(S(e,t))??null}function O(e,t){C.delete(S(e,t))}let A=0;function E(){A++}function P(){A>0?A--:console.warn("[hc-diagnostics] disableDiagnosticsEvents called more times than enableDiagnosticsEvents — ignored")}function $(){return A>0}const R=x(),j="__default__",_="__hcCanvasId",M=t(0),B=x();function U(e,t){const s=e=>{try{t(e)}catch(e){console.error("[hc-registry] instance lifecycle listener threw",e)}};return B.on(e,s),()=>B.off(e,s)}function D(e,t){B.emit(e,t)}const z=new Set,L=new Map,F=x();function N(e,t){return F.on(e,t),()=>F.off(e,t)}function T(e,t,s,n){var r;const o=function(e,t){return`${e}\0${t}`}(e,t);if(z.has(o)){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)}z.add(o);try{const o=!L.has(e),i=function(e){let t=L.get(e);return t||(t=new Map,L.set(e,t)),t}(e);i.has(t)&&(console.warn(`[hc-registry] instance ${t} already registered in canvas "${e}", overwriting`),null==(r=i.get(t))||r.__dispose(),i.delete(t),D("instance:unmounted",{canvasId:e,instanceId:t}));const a=function(e,t,s,n){const r=x();function o(n,r,o){if($())try{R.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:n,call(e,...s){o("call",e,s);const r=n[e];if("function"!=typeof r)throw new Error(`[hc-registry] method "${e}" not found on instance ${t}`);return r.apply(n,s)},on:(e,t)=>(r.on(e,t),()=>r.off(e,t)),emit(e,t){o("emit",e,[t]),r.emit(e,t)},setProp(e,t){o("setProp",e,[t]),n[e]=t},setDataInput(e,s){o("setDataInput",e,[s]);const r=n.custom;if(!r||!(e in r))return void console.warn(`[hc-registry] setDataInput("${e}"): vm.custom["${e}"] not declared on instance ${t}; binding 改了一个未声明的 dataInput key,组件不会响应`);const i=r[e];i&&"object"==typeof i?!0===i.dataInput?i.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(){r.all.clear()}}}(e,t,s,n);i.set(t,a);const l=function(e,t){const s=S(e,t),n=C.get(s);return n?(C.delete(s),n):null}(e,t);return l&&(a._timings={...l}),M.value++,o&&F.emit("canvas:added",{canvasId:e}),D("instance:ready",{canvasId:e,instanceId:t}),a}finally{z.delete(o)}}function V(e){const t=L.get(e);if(!t)return;const s=[];for(const[n,r]of t)r.__dispose(),s.push(n),O(e,n);t.clear(),L.delete(e),M.value++;for(const t of s)D("instance:unmounted",{canvasId:e,instanceId:t});F.emit("canvas:removed",{canvasId:e})}function W(){return[...L.keys()]}function J(e,t,s){return T(j,e,t,s)}function H(e,t=j){const s=L.get(t);if(!s)return;const n=s.get(e);n&&(n.__dispose(),s.delete(e),O(t,e),M.value++,D("instance:unmounted",{canvasId:t,instanceId:e}))}function Y(e,t){var s;if(void 0!==t)return(null==(s=L.get(t))?void 0:s.get(e))??null;let n=null;const r=[];for(const[t,s]of L){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 G(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=L.get(e.canvasId);return t?[...t.values()].filter(s):[]}const n=[];for(const e of L.values())for(const t of e.values())s(t)&&n.push(t);return n}const Z={getInstance:Y,listInstances:G,call(e,t,...s){const n=Y(e);if(n)return n.call(t,...s);console.debug(`[hc-runtime] call: instance "${e}" not found`)},on(e,t,s){const n=Y(e);if(n)return n.on(t,s);console.debug(`[hc-runtime] on: instance "${e}" not found`)},emit(e,t,s){const n=Y(e);n?n.emit(t,s):console.debug(`[hc-runtime] emit: instance "${e}" not found`)}},q={pickerUrl:e=>`/a/${e}`};function K(e){return{canvasId:e,listInstances:t=>G({canvasId:e,componentId:null==t?void 0:t.componentId}),getInstance:t=>Y(t,e),call(t,s,...n){const r=Y(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=Y(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=G({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(){V(e)}}}function Q(){return{list:()=>W().map(e=>K(e)),get:e=>W().includes(e)?K(e):null,getAll(){const e={};for(const t of W())e[t]=K(t);return e},callComponent(e,t,s,...n){const r=Y(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=Y(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 W())try{const n=G({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 X=new Set(["vue","Vue","window","global","globalThis","console","document","process","$","libs","runtime","assets","version"]);function ee(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])=>te(e)),i=r.filter(([e])=>X.has(e)),a=[`[hypercard] 已注册 ${r.length} 个 libs:`];for(const[e,t]of r)a.push(` ${e.padEnd(16)} ${ne(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]=se(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]=se(t);c[e]=s}const u={libs:c,runtime:Z,assets:q,version:n,canvases:Q()};e.provide(re,u),e.config.globalProperties.$hc=u,"undefined"!=typeof window&&(window.__HYPERCARD__=u)}}}function te(e){return Array.isArray(e)&&e.length>=1?te(e[0]):"object"==typeof e&&null!==e&&"function"==typeof e.install}function se(e){return Array.isArray(e)&&e.length>=1?[e[0],e.slice(1)]:[e,[]]}function ne(e){return te(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 re="__HYPERCARD__",oe=new Set(["init","onClick","onMouseover","onMouseout","onResize","onDestroy"]),ie=new Map;function ae(e,t){for(ie.has(e)&&ie.delete(e),ie.set(e,t);ie.size>100;){const e=ie.keys().next().value;if(void 0===e)break;ie.delete(e)}}function le(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 ce(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 ue(t){const s=le(t.html)+"_"+le(t.js),n=ie.get(s);if(n)return ae(s,n),n;const r=(async()=>function(t,s){if(!t||"object"!=typeof t)throw new Error("[hc-compile] component.js must `export default` an object");const n=t,r=n.name,o=n.method??{},i=n.attribute??{},a=n.custom??{},l=n.style??{},c=n.slots,u=n.data,h=n.methods??{},p=n.computed,f=n.watch,d=n.created,m=n.mounted,g=n.beforeUnmount,y=n.props,w=new Set(["name","method","attribute","custom","style","option","data","methods","computed","watch","created","mounted","beforeUnmount","props","slots"]),v={};for(const e of Object.keys(n))w.has(e)||(v[e]=n[e]);const b={};for(const[e,t]of Object.entries(o))oe.has(e)||"function"!=typeof t||(b[e]=t);const x=Object.keys(b),C={...b,...h},S=(s??"").trim()||"<div></div>",I=e.compile(S);if("function"!=typeof I)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:I,props:{...y?Array.isArray(y)?Object.fromEntries(y.map(e=>[e,null])):"object"==typeof y?y:{}:{},hcCustomValues:{type:Object,default:()=>({})},hcInstanceId:{type:String,default:""},hcCanvasId:{type:String,default:""},hcComponentId:{type:String,default:""}},data(){const e="function"==typeof u?u.call(this):u??{},t=this.hcCustomValues??{},s={};for(const[e,n]of Object.entries(a)){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:C,computed:p,watch:(()=>{const e=f&&"object"==typeof f?{...f}:{};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&&T(this.hcCanvasId,this.hcInstanceId,this.hcComponentId,this),"function"==typeof d&&d.call(this)},mounted(){try{const e=[],t=this.$el;if(t&&t instanceof HTMLElement){Object.assign(t.style,l);for(const[e,s]of Object.entries(i))"string"==typeof s&&s&&t.setAttribute(e,s);for(const s of oe){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 m&&m.call(this)}finally{const e=this.hcInstanceId,t=this.hcCanvasId;"string"==typeof e&&e.length>0&&"string"==typeof t&&t.length>0&&k(t,e,{mountEndedAt:performance.now()})}},beforeUnmount(){var e;if(this.hcInstanceId&&this.hcCanvasId){const e=Y(this.hcInstanceId,this.hcCanvasId);e&&e.vm===this&&H(this.hcInstanceId,this.hcCanvasId)}null==(e=this.__hcCleanup)||e.forEach(e=>{try{e()}catch{}}),this.__hcCleanup=void 0,"function"==typeof g&&g.call(this)},...v},meta:{name:r,attribute:i,style:l,customDecl:a,methodNames:x,slotsDecl:ce(c)}}}(function(e){let t;try{const s=v(e,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:!0}).body.find(e=>"ExportDefaultDeclaration"===e.type);if(!s)throw new Error("[hc-compile] component.js must `export default` an object");t=e.slice(0,s.start)+"module.exports = "+e.slice(s.declaration.start)}catch(e){throw e instanceof Error?e:new Error(String(e))}const s=new Function("module","exports",`"use strict";\n${t}\n;return module.exports;`),n={exports:{}};try{return s(n,n.exports)}catch(e){throw e instanceof Error?e:new Error(String(e))}}(t.js),t.html))();return ae(s,r),r.catch(()=>{ie.get(s)===r&&ie.delete(s)}),r}function he(){ie.clear()}function pe(){return ie.size}function fe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function de(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}var me,ge={exports:{}};function ye(){if(me)return ge.exports;me=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 ge.exports=t(),ge.exports.createColors=t,ge.exports}const we=de(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var ve,be,xe,Ce,Se,ke;function Ie(){if(be)return ve;be=1;let e=ye(),t=we;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 ve=s,s.default=s,ve}function Oe(){if(Ce)return xe;Ce=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 xe=r,r.default=r,xe}function Ae(){if(ke)return Se;ke=1;let e=Oe();function t(t,s){new e(s).stringify(t)}return Se=t,t.default=t,Se}var Ee,Pe,$e,Re,je,_e,Me,Be,Ue,De,ze,Le,Fe,Ne,Te,Ve,We,Je,He,Ye,Ge,Ze,qe,Ke,Qe,Xe,et,tt,st,nt,rt,ot,it,at,lt,ct,ut,ht,pt,ft,dt,mt,gt,yt,wt,vt,bt,xt,Ct,St={};function kt(){return Ee||(Ee=1,St.isClean=Symbol("isClean"),St.my=Symbol("my")),St}function It(){if($e)return Pe;$e=1;let e=Ie(),t=Oe(),s=Ae(),{isClean:n,my:r}=kt();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 Pe=a,a.default=a,Pe}function Ot(){if(je)return Re;je=1;let e=It();class t extends e{constructor(e){super(e),this.type="comment"}}return Re=t,t.default=t,Re}function At(){if(Me)return _e;Me=1;let e=It();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 _e=t,t.default=t,_e}function Et(){if(Ue)return Be;Ue=1;let e,t,s,n,r=Ot(),o=At(),i=It(),{isClean:a,my:l}=kt();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},Be=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)})},Be}function Pt(){if(ze)return De;ze=1;let e=Et();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 De=t,t.default=t,e.registerAtRule(t),De}function $t(){if(Fe)return Le;Fe=1;let e,t,s=Et();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},Le=n,n.default=n,Le}function Rt(){return Te?Ne:(Te=1,Ne={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}})}function jt(){if(We)return Ve;We=1;let{existsSync:e,readFileSync:t}=we,{dirname:s,join:n}=we,{SourceMapConsumer:r,SourceMapGenerator:o}=we;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 Ve=i,i.default=i,Ve}function _t(){if(He)return Je;He=1;let{nanoid:e}=Rt(),{isAbsolute:t,resolve:s}=we,{SourceMapConsumer:n,SourceMapGenerator:r}=we,{fileURLToPath:o,pathToFileURL:i}=we,a=Ie(),l=jt(),c=we,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 Je=d,d.default=d,c&&c.registerInput&&c.registerInput(d),Je}function Mt(){if(Ge)return Ye;Ge=1;let e,t,s=Et();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 Bt(){if(qe)return Ze;qe=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 Ze=e,e.default=e,Ze}function Ut(){if(Qe)return Ke;Qe=1;let e=Et(),t=Bt();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 Ke=s,s.default=s,e.registerRule(s),Ke}function Dt(){if(st)return tt;st=1;let{dirname:e,relative:t,resolve:s,sep:n}=we,{SourceMapConsumer:r,SourceMapGenerator:o}=we,{pathToFileURL:i}=we,a=_t(),l=Boolean(r&&o),c=Boolean(e&&s&&t&&n);return tt=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 zt(){if(lt)return at;lt=1;let e=Et(),t=_t(),s=function(){if(it)return ot;it=1;let e=Pt(),t=Ot(),s=At(),n=Mt(),r=Ut(),o=function(){if(rt)return nt;rt=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 nt=function(S,k={}){let I,O,A,E,P,$,R,j,_,M,B=S.css.valueOf(),U=k.ignoreErrors,D=B.length,z=0,L=[],F=[],N=-1;function T(e){throw S.error("Unclosed "+e,z)}return{back:function(e){F.push(e)},endOfFile:function(){return 0===F.length&&z>=D},nextToken:function(S){if(F.length)return F.pop();if(z>=D)return;let k=!!S&&S.ignoreUnclosed;switch(I=B.charCodeAt(z),I){case r:case o:case a:case l:case i:E=z;do{E+=1,I=B.charCodeAt(E)}while(I===o||I===r||I===a||I===l||I===i);$=["space",B.slice(z,E)],z=E-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]:"",_=B.charCodeAt(z+1),"url"===M&&_!==e&&_!==t&&_!==o&&_!==r&&_!==a&&_!==i&&_!==l){E=z;do{if(R=!1,E=B.indexOf(")",E+1),-1===E){if(U||k){E=z;break}T("bracket")}for(j=E;B.charCodeAt(j-1)===s;)j-=1,R=!R}while(R);$=["brackets",B.slice(z,E+1),z,E],z=E}else z<=N?$=["(","(",z]:(E=B.indexOf(")",z+1),O=B.slice(z,E+1),-1===E||x.test(O)?(N=-1===E?D:E,$=["(","(",z]):($=["brackets",O,z,E],z=E));break;case e:case t:P=I===e?"'":'"',E=z;do{if(R=!1,E=B.indexOf(P,E+1),-1===E){if(U||k){E=z+1;break}T("string")}for(j=E;B.charCodeAt(j-1)===s;)j-=1,R=!R}while(R);$=["string",B.slice(z,E+1),z,E],z=E;break;case w:v.lastIndex=z+1,v.test(B),E=0===v.lastIndex?B.length-1:v.lastIndex-2,$=["at-word",B.slice(z,E+1),z,E],z=E;break;case s:for(E=z,A=!0;B.charCodeAt(E+1)===s;)E+=1,A=!A;if(I=B.charCodeAt(E+1),A&&I!==n&&I!==o&&I!==r&&I!==a&&I!==l&&I!==i&&(E+=1,C.test(B.charAt(E)))){for(;C.test(B.charAt(E+1));)E+=1;B.charCodeAt(E+1)===o&&(E+=1)}$=["word",B.slice(z,E+1),z,E],z=E;break;default:I===n&&B.charCodeAt(z+1)===g?(E=B.indexOf("*/",z+2)+1,0===E&&(U||k?E=B.length:T("comment")),$=["comment",B.slice(z,E+1),z,E],z=E):(b.lastIndex=z+1,b.test(B),E=0===b.lastIndex?B.length-1:b.lastIndex-2,$=["word",B.slice(z,E+1),z,E],L.push($),z=E)}return z++,$},position:function(){return z}}}}();const i={empty:!0,space:!0};return ot=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 at=n,n.default=n,e.registerParse(n),at}function Lt(){if(ut)return ct;ut=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 ct=e,e.default=e,ct}function Ft(){if(pt)return ht;pt=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 ht=t,t.default=t,ht}function Nt(){if(dt)return ft;dt=1;let e={};return ft=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Tt(){if(gt)return mt;gt=1;let e=Et(),t=$t(),s=Dt(),n=zt(),r=Ft(),o=Mt(),i=Ae(),{isClean:a,my:l}=kt(),c=Nt();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},mt=w,w.default=w,o.registerLazyResult(w),t.registerLazyResult(w),mt}const Vt=fe(function(){if(Ct)return xt;Ct=1;let e=Pt(),t=Ot(),s=Et(),n=Ie(),r=At(),o=$t(),i=function(){if(et)return Xe;et=1;let e=Pt(),t=Ot(),s=At(),n=_t(),r=jt(),o=Mt(),i=Ut();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 Xe=a,a.default=a,Xe}(),a=_t(),l=Tt(),c=Bt(),u=It(),h=zt(),p=function(){if(bt)return vt;bt=1;let e=$t(),t=Tt(),s=function(){if(wt)return yt;wt=1;let e=Dt(),t=zt(),s=Ft(),n=Ae(),r=Nt();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 yt=o,o.default=o,yt}(),n=Mt();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 vt=r,r.default=r,n.registerProcessor(r),e.registerProcessor(r),vt}(),f=Ft(),d=Mt(),m=Ut(),g=Ae(),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),xt=w,w.default=w,xt}());Vt.stringify,Vt.fromJSON,Vt.plugin,Vt.parse,Vt.list,Vt.document,Vt.comment,Vt.atRule,Vt.rule,Vt.decl,Vt.root,Vt.CssSyntaxError,Vt.Declaration,Vt.Container,Vt.Processor,Vt.Document,Vt.Comment,Vt.Warning,Vt.AtRule,Vt.Result,Vt.Input,Vt.Rule,Vt.Root,Vt.Node;const Wt=new Set(["body","html",":root","*"]);function Jt(e,t){return e&&e.trim()?Vt([(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(Wt.has(s))return t;for(const e of Wt){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 Ht=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 Gt(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 Zt(e,t){var s;const n=t??"",r=Gt(e),o=Ht.get(e);if(!n.trim())return null==(s=document.getElementById(r))||s.remove(),void(o&&Ht.set(e,{...o,cssHash:""}));const i=Yt(n);if(o&&o.cssHash===i)return;let a;try{a=Jt(n,e)}catch(t){return void console.warn("[hc-css-scope]",e,"PostCSS process failed:",t)}!function(e,t){const s=Gt(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?Ht.set(e,{...o,cssHash:i}):Ht.set(e,{cssHash:i,refCount:0})}function qt(e,t){Zt(e,t);const s=Ht.get(e);s?Ht.set(e,{...s,refCount:s.refCount+1}):Ht.set(e,{cssHash:"",refCount:1})}function Kt(e){var t;const s=Ht.get(e);if(!s)return;const n=s.refCount-1;n<=0?(null==(t=document.getElementById(Gt(e)))||t.remove(),Ht.delete(e)):Ht.set(e,{...s,refCount:n})}function Qt(e){var t;null==(t=document.getElementById(Gt(e)))||t.remove(),Ht.delete(e)}function Xt(){return Ht.size}const es=x(),ts={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"},ss={class:"font-semibold flex items-center gap-1.5"},ns={class:"font-mono text-xs text-rose-800 break-all"},rs={key:0,class:"text-[10px] font-mono bg-rose-100/60 p-2 rounded overflow-auto max-h-60 text-rose-800"},os=s({__name:"ErrorBoundary",props:{label:{},instanceId:{},canvasId:{},componentId:{}},setup(e){const s=e,u=t(null),h=t(0),p=t(!1);function f(){u.value=null,p.value=!1,h.value++}return n(e=>{console.error(`[hc-eb${s.label?" "+s.label:""}]`,e),u.value=e;try{es.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}),(t,s)=>(r(),o("div",{key:h.value,class:"hc-eb-root",style:{width:"100%",height:"100%"}},[u.value?(r(),o("div",ts,[a("div",ss,[s[1]||(s[1]=a("span",null,"⚠️",-1)),a("span",null,"组件渲染失败"+l(e.label?` — ${e.label}`:""),1)]),a("div",ns,l(u.value.message),1),a("button",{class:"text-xs text-rose-700 hover:text-rose-900 underline",onClick:s[0]||(s[0]=e=>p.value=!p.value)},l(p.value?"隐藏":"展开")+"堆栈 ",1),p.value?(r(),o("pre",rs,l(u.value.stack),1)):c("",!0),a("button",{class:"text-xs px-3 py-1 rounded bg-rose-600 hover:bg-rose-700 text-white transition-colors",onClick:f}," 重试 ")])):i(t.$slots,"default",{key:0})]))}}),is=["data-vbi-id","data-vbi-type","data-vbi-canvas"],as={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"},ls={class:"text-[11px] font-mono break-all whitespace-pre-wrap"},cs={key:1,class:"grid place-items-center min-h-[140px] text-xs text-zinc-400"},us=s({__name:"RuntimeBox",props:{instanceId:{},componentId:{},scopeId:{},canvasId:{},htmlSource:{},jsSource:{},cssSource:{default:""},customValues:{default:()=>({})},position:{},size:{},zIndex:{}},setup(e){const s=e,n=u(()=>s.scopeId??s.componentId),i=h(_,null),v=u(()=>s.canvasId??i??j),b=p(null),x=t(null),C=t(!1),S=t(0),I=t(null);f(()=>[s.htmlSource,s.jsSource],()=>{!async function(){C.value=!0,x.value=null;const e=v.value,t=s.instanceId;k(e,t,{compileStartedAt:performance.now()});try{const n=await ue({html:s.htmlSource,js:s.jsSource}),r=performance.now();k(e,t,{compileEndedAt:r,mountStartedAt:r}),b.value=n,S.value++}catch(s){x.value=s instanceof Error?s:new Error(String(s)),b.value=null,k(e,t,{compileEndedAt:performance.now()})}finally{C.value=!1}}()},{immediate:!0}),f(()=>[s.instanceId,v.value],(e,t)=>{const[s,n]=t,r=Y(s,n);r&&r.vm===I.value&&H(s,n),S.value++});let A=!1;f(()=>[s.cssSource,n.value],([e,t],s)=>{const n=(null==s?void 0:s[1])??null;n&&n!==t?(Kt(n),qt(t,e),A=!0):A?Zt(t,e):(qt(t,e),A=!0)},{immediate:!0});const E=u(()=>{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 d(()=>{A&&(Kt(n.value),A=!1),O(v.value,s.instanceId)}),(t,s)=>(r(),o("div",{class:"_vbi_box","data-vbi-id":e.instanceId,"data-vbi-type":n.value,"data-vbi-canvas":v.value,style:m(E.value)},[x.value?(r(),o("div",as,[s[0]||(s[0]=a("div",{class:"font-semibold"},"⚠️ 编译失败",-1)),a("pre",ls,l(x.value.message),1)])):C.value&&!b.value?(r(),o("div",cs," 编译中… ")):b.value?(r(),g(os,{key:S.value,label:e.instanceId,"instance-id":e.instanceId,"canvas-id":v.value,"component-id":e.componentId},{default:y(()=>[(r(),g(w(b.value.options),{ref_key:"innerVmRef",ref:I,"hc-custom-values":e.customValues,"hc-instance-id":e.instanceId,"hc-canvas-id":v.value,"hc-component-id":e.componentId},null,8,["hc-custom-values","hc-instance-id","hc-canvas-id","hc-component-id"]))]),_:1},8,["label","instance-id","canvas-id","component-id"])):c("",!0)],12,is))}}),hs="0.0.0-stage2b";export{j as DEFAULT_CANVAS_ID,os as ErrorBoundary,_ as HC_CANVAS_ID_KEY,re as HC_INJECT_KEY,us as RuntimeBox,hs as VERSION,q as assets,qt as attachScope,he as clearCompileCache,ue as compileComponent,Q as createCanvasesRegistry,ee as createHyperCard,Kt as detachScope,P as disableDiagnosticsEvents,V as disposeCanvas,E as enableDiagnosticsEvents,pe as getCompileCacheSize,Y as getInstance,I as getInstanceTimings,Xt as getScopedCssCount,Zt as injectScopedCss,R as interactionEmitter,$ as isDiagnosticsEventsEnabled,te as isVuePlugin,W as listCanvasIds,G as listInstances,U as onInstanceLifecycle,b as parseComponentSource,J as register,T as registerInCanvas,M as registryVersion,Qt as removeScopedCss,Z as runtime,es as runtimeErrorEmitter,Jt as scopeCss,N as subscribeCanvasInventory,H as unregister};
|
|
1
|
+
import*as t from"vue";import{ref as e,defineComponent as s,onErrorCaptured as n,openBlock as r,createElementBlock as o,renderSlot as i,createElementVNode as a,toDisplayString as l,createCommentVNode as c,computed as u,inject as h,shallowRef as p,watch as f,onBeforeUnmount as d,normalizeStyle as m,createBlock as g,withCtx as y,resolveDynamicComponent as w}from"vue";import{p as v}from"./parseSourceEntry-IGf6vyI7.js";import{a as b}from"./parseSourceEntry-IGf6vyI7.js";function x(t){return{all:t=t||new Map,on:function(e,s){var n=t.get(e);n?n.push(s):t.set(e,[s])},off:function(e,s){var n=t.get(e);n&&(s?n.splice(n.indexOf(s)>>>0,1):t.set(e,[]))},emit:function(e,s){var n=t.get(e);n&&n.slice().map(function(t){t(s)}),(n=t.get("*"))&&n.slice().map(function(t){t(e,s)})}}}const C=new Map;function S(t,e){return`${t}::${e}`}function I(t,e,s){const n=K(e,t);if(n)return void Object.assign(function(t){return t._timings||(t._timings={}),t._timings}(n),s);const r=S(t,e),o=C.get(r)??{};C.set(r,{...o,...s})}function k(t,e){const s=K(e,t);return s?function(t){return t._timings}(s)??null:C.get(S(t,e))??null}function O(t,e){C.delete(S(t,e))}let A=0;function E(){A++}function P(){A>0?A--:console.warn("[hc-diagnostics] disableDiagnosticsEvents called more times than enableDiagnosticsEvents — ignored")}function $(){return A>0}const j=x(),R=new Map;function _(t,e){return`${t}\0${e}`}function M(t,e,s){if(!t||!e)return null;const n=_(t,e),r=R.get(n);return r?r.componentId!==s?(R.delete(n),null):(R.delete(n),R.set(n,r),function(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}(r.data)):null}function B(t){if(void 0===t||"function"==typeof t||"symbol"==typeof t)return{ok:!1};if(null===t||"object"!=typeof t)return{ok:!0,value:t};if(!function(t){if(Array.isArray(t))return!0;const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}(t))return{ok:!1};try{return{ok:!0,value:JSON.parse(JSON.stringify(t))}}catch{return{ok:!1}}}const U="__default__",D="__hcCanvasId",z=e(0),L=x();function F(t,e){const s=t=>{try{e(t)}catch(t){console.error("[hc-registry] instance lifecycle listener threw",t)}};return L.on(t,s),()=>L.off(t,s)}function N(t,e){L.emit(t,e)}const T=new Set,V=new Map,W=x();function J(t,e){return W.on(t,e),()=>W.off(t,e)}function H(t,e,s,n){var r;const o=function(t,e){return`${t}\0${e}`}(t,e);if(T.has(o)){const s=`[hc-registry] re-entrant registerInCanvas("${t}", "${e}") 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)}T.add(o);try{const o=!V.has(t),i=function(t){let e=V.get(t);return e||(e=new Map,V.set(t,e)),e}(t);i.has(e)&&(console.warn(`[hc-registry] instance ${e} already registered in canvas "${t}", overwriting`),null==(r=i.get(e))||r.__dispose(),i.delete(e),N("instance:unmounted",{canvasId:t,instanceId:e}));const a=function(t,e,s,n){const r=x();function o(n,r,o){if($())try{j.emit("interaction",{canvasId:t,instanceId:e,componentId:s,kind:n,key:r,args:o,timestamp:performance.now()})}catch(t){console.warn(`[hc-registry] interactionEmitter.emit threw on ${n}("${r}"); diagnostic stream broken for this event`,t)}}return{instanceId:e,componentId:s,vm:n,call(t,...s){o("call",t,s);const r=n[t];if("function"!=typeof r)throw new Error(`[hc-registry] method "${t}" not found on instance ${e}`);return r.apply(n,s)},on:(t,e)=>(r.on(t,e),()=>r.off(t,e)),emit(t,e){o("emit",t,[e]),r.emit(t,e)},setProp(t,e){o("setProp",t,[e]),n[t]=e},setDataInput(t,s){o("setDataInput",t,[s]);const r=n.custom;if(!r||!(t in r))return void console.warn(`[hc-registry] setDataInput("${t}"): vm.custom["${t}"] not declared on instance ${e}; binding 改了一个未声明的 dataInput key,组件不会响应`);const i=r[t];i&&"object"==typeof i?!0===i.dataInput?i.value=s:console.warn(`[hc-registry] setDataInput("${t}"): vm.custom["${t}"] is not declared with dataInput:true on instance ${e}; 请在组件源码 custom.${t} 上加 \`dataInput: true\` 才能被 binding 灌入`):console.warn(`[hc-registry] setDataInput("${t}"): vm.custom["${t}"] not a {value:...} slot`)},__dispose(){r.all.clear()}}}(t,e,s,n);i.set(e,a);const l=function(t,e){const s=S(t,e),n=C.get(s);return n?(C.delete(s),n):null}(t,e);return l&&(a._timings={...l}),z.value++,o&&W.emit("canvas:added",{canvasId:t}),N("instance:ready",{canvasId:t,instanceId:e}),a}finally{T.delete(o)}}function Y(t){const e=V.get(t);if(!e)return;const s=[];for(const[n,r]of e)r.__dispose(),s.push(n),O(t,n);e.clear(),V.delete(t),function(t){if(!t)return;const e=`${t}\0`;for(const t of[...R.keys()])t.startsWith(e)&&R.delete(t)}(t),z.value++;for(const e of s)N("instance:unmounted",{canvasId:t,instanceId:e});W.emit("canvas:removed",{canvasId:t})}function G(){return[...V.keys()]}function Z(t,e,s){return H(U,t,e,s)}function q(t,e=U){const s=V.get(e);if(!s)return;const n=s.get(t);n&&(n.__dispose(),s.delete(t),O(e,t),z.value++,N("instance:unmounted",{canvasId:e,instanceId:t}))}function K(t,e){var s;if(void 0!==e)return(null==(s=V.get(e))?void 0:s.get(t))??null;let n=null;const r=[];for(const[e,s]of V){const o=s.get(t);o&&(n||(n=o),r.push(e))}return r.length>1&&console.warn(`[hc-registry] getInstance("${t}") matched ${r.length} canvases [${r.join(", ")}]; returning first. Prefer __HYPERCARD__.canvases.callComponent(canvasId, instanceId, ...) for explicit scope.`),n}function Q(t){const e=null==t?void 0:t.componentId,s=e?t=>t.componentId===e:()=>!0;if(void 0!==(null==t?void 0:t.canvasId)){const e=V.get(t.canvasId);return e?[...e.values()].filter(s):[]}const n=[];for(const t of V.values())for(const e of t.values())s(e)&&n.push(e);return n}const X={getInstance:K,listInstances:Q,call(t,e,...s){const n=K(t);if(n)return n.call(e,...s);console.debug(`[hc-runtime] call: instance "${t}" not found`)},on(t,e,s){const n=K(t);if(n)return n.on(e,s);console.debug(`[hc-runtime] on: instance "${t}" not found`)},emit(t,e,s){const n=K(t);n?n.emit(e,s):console.debug(`[hc-runtime] emit: instance "${t}" not found`)}},tt={pickerUrl:t=>`/a/${t}`};function et(t){return{canvasId:t,listInstances:e=>Q({canvasId:t,componentId:null==e?void 0:e.componentId}),getInstance:e=>K(e,t),call(e,s,...n){const r=K(e,t);if(r)try{return r.call(s,...n)}catch(n){return void console.warn(`[hc-canvases] call error: canvas="${t}" instance="${e}" method="${s}":`,n)}else console.warn(`[hc-canvases] call: instance "${e}" not found in canvas "${t}"`)},emit(e,s,n){const r=K(e,t);if(r)try{r.emit(s,n)}catch(n){console.warn(`[hc-canvases] emit error: canvas="${t}" instance="${e}" event="${s}":`,n)}else console.warn(`[hc-canvases] emit: instance "${e}" not found in canvas "${t}"`)},broadcastInCanvas(e,s){const n=Q({canvasId:t});for(const r of n)try{r.emit(e,s)}catch(s){console.warn(`[hc-canvases] broadcastInCanvas: canvas="${t}" instance="${r.instanceId}" event="${e}" emit failed:`,s)}},dispose(){Y(t)}}}function st(){return{list:()=>G().map(t=>et(t)),get:t=>G().includes(t)?et(t):null,getAll(){const t={};for(const e of G())t[e]=et(e);return t},callComponent(t,e,s,...n){const r=K(e,t);if(r)try{return r.call(s,...n)}catch(n){return void console.warn(`[hc-canvases] callComponent error: canvas="${t}" instance="${e}" method="${s}":`,n)}else console.warn(`[hc-canvases] callComponent: canvas="${t}" instance="${e}" not found`)},emitToCanvas(t,e,s,n){const r=K(e,t);if(r)try{r.emit(s,n)}catch(n){console.warn(`[hc-canvases] emitToCanvas error: canvas="${t}" instance="${e}" event="${s}":`,n)}else console.warn(`[hc-canvases] emitToCanvas: canvas="${t}" instance="${e}" not found`)},broadcast(t,e){for(const s of G())try{const n=Q({canvasId:s});for(const r of n)try{r.emit(t,e)}catch(e){console.warn(`[hc-canvases] broadcast: canvas="${s}" instance="${r.instanceId}" event="${t}" emit failed:`,e)}}catch(e){console.warn(`[hc-canvases] broadcast: canvas="${s}" event="${t}" failed:`,e)}}}}const nt=new Set(["vue","Vue","window","global","globalThis","console","document","process","$","libs","runtime","assets","version"]);function rt(t={}){const e=t.strict??!1,s=t.libs??{},n=t.version??"v1";return{install(t){const r=Object.entries(s),o=r.filter(([,t])=>ot(t)),i=r.filter(([t])=>nt.has(t)),a=[`[hypercard] 已注册 ${r.length} 个 libs:`];for(const[t,e]of r)a.push(` ${t.padEnd(16)} ${at(e)}`);console.info(a.join("\n"));const l=[];o.length>1&&l.push(`检测到 ${o.length} 个 Vue plugin(${o.map(([t])=>t).join(", ")}),请确认全局组件命名不冲突`);for(const[t]of i)l.push(`lib 名 "${t}" 是保留词,建议改名`);if(l.length>0){const t=l.map(t=>` - ${t}`).join("\n");if(e)throw new Error(`[hypercard] strict mode 阻止启动:\n${t}`);console.warn(`[hypercard] 警告:\n${t}`)}for(const[s,n]of o){const[r,o]=it(n);try{t.use(r,...o)}catch(t){if(console.error(`[hypercard] app.use("${s}") 失败:`,t),e)throw t}}const c={};for(const[t,e]of r){const[s]=it(e);c[t]=s}const u={libs:c,runtime:X,assets:tt,version:n,canvases:st()};t.provide(lt,u),t.config.globalProperties.$hc=u,"undefined"!=typeof window&&(window.__HYPERCARD__=u)}}}function ot(t){return Array.isArray(t)&&t.length>=1?ot(t[0]):"object"==typeof t&&null!==t&&"function"==typeof t.install}function it(t){return Array.isArray(t)&&t.length>=1?[t[0],t.slice(1)]:[t,[]]}function at(t){return ot(t)?Array.isArray(t)?"✓ Vue plugin (with options) → 已 app.use":"✓ Vue plugin → 已 app.use":"function"==typeof t?"· function":Array.isArray(t)?"· array":"object"==typeof t&&null!==t?"· object":"· "+typeof t}const lt="__HYPERCARD__";function ct(t,e){const s=t.$data,n=s.custom;for(const t of Object.keys(e)){if("custom"===t){const t=e.custom;if(t&&n)for(const e of Object.keys(t)){const s=n[e];s&&"object"==typeof s&&(s.value=t[e])}continue}Object.prototype.hasOwnProperty.call(s,t)&&(s[t]=e[t])}}const ut=new Set(["init","onClick","onMouseover","onMouseout","onResize","onDestroy"]),ht=new Map;function pt(t,e){for(ht.has(t)&&ht.delete(t),ht.set(t,e);ht.size>100;){const t=ht.keys().next().value;if(void 0===t)break;ht.delete(t)}}function ft(t){let e=5381;for(let s=0;s<t.length;s++)e=(e<<5)+e+t.charCodeAt(s)|0;return(e>>>0).toString(36)}function dt(t){if(!Array.isArray(t))return[];const e=[];for(const s of t){if(!s||"object"!=typeof s)continue;const t=s;if("string"!=typeof t.name)continue;const n={name:t.name};"boolean"==typeof t.multiple&&(n.multiple=t.multiple),Array.isArray(t.accepts)&&(n.accepts=t.accepts.filter(t=>"string"==typeof t)),"number"==typeof t.maxChildren&&(n.maxChildren=t.maxChildren),"string"==typeof t.label&&(n.label=t.label),e.push(n)}return e}async function mt(e){const s=ft(e.html)+"_"+ft(e.js),n=ht.get(s);if(n)return pt(s,n),n;const r=(async()=>function(e,s){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??{},i=n.attribute??{},a=n.custom??{},l=n.style??{},c=n.slots,u=n.data,h=n.methods??{},p=n.computed,f=n.watch,d=n.created,m=n.mounted,g=n.beforeUnmount,y=n.props,w=new Set(["name","method","attribute","custom","style","option","data","methods","computed","watch","created","mounted","beforeUnmount","props","slots"]),v={};for(const t of Object.keys(n))w.has(t)||(v[t]=n[t]);const b={};for(const[t,e]of Object.entries(o))ut.has(t)||"function"!=typeof e||(b[t]=e);const x=Object.keys(b),C={...b,...h},S=(s??"").trim()||"<div></div>",k=t.compile(S);if("function"!=typeof k)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:k,props:{...y?Array.isArray(y)?Object.fromEntries(y.map(t=>[t,null])):"object"==typeof y?y:{}:{},hcCustomValues:{type:Object,default:()=>({})},hcInstanceId:{type:String,default:""},hcCanvasId:{type:String,default:""},hcComponentId:{type:String,default:""},hcPersistInstanceState:{type:Boolean,default:!1}},data(){const t="function"==typeof u?u.call(this):u??{},e=this.hcCustomValues??{},s={};for(const[t,n]of Object.entries(a)){let r;try{r=JSON.parse(JSON.stringify(n??{}))}catch{r={...n??{}}}t in e&&r&&"object"==typeof r&&(r.value=e[t]),s[t]=r}return{custom:s,...t}},methods:C,computed:p,watch:(()=>{const t=f&&"object"==typeof f?{...f}:{};return t.hcCustomValues={handler(t,e){if(t&&this.custom)for(const[s,n]of Object.entries(t)){if(e&&Object.is(e[s],n))continue;const t=this.custom[s];t&&"object"==typeof t&&(t.value=n)}},deep:!0},t})(),created(){if(this.hcPersistInstanceState&&this.hcInstanceId&&this.hcCanvasId){const t=M(this.hcCanvasId,this.hcInstanceId,this.hcComponentId);t&&ct(this,t)}this.hcInstanceId&&this.hcCanvasId&&H(this.hcCanvasId,this.hcInstanceId,this.hcComponentId,this),"function"==typeof d&&d.call(this)},mounted(){try{const t=[],e=this.$el;if(e&&e instanceof HTMLElement){Object.assign(e.style,l);for(const[t,s]of Object.entries(i))"string"==typeof s&&s&&e.setAttribute(t,s);for(const s of ut){if("init"===s)continue;const n=o[s];if("function"==typeof n){const r=s.replace(/^on/,"").toLowerCase(),o=t=>{n.call(this,{event:t,data:t})};e.addEventListener(r,o),t.push(()=>e.removeEventListener(r,o))}}}this.__hcCleanup=t;const s=o.init;"function"==typeof s&&s.call(this),"function"==typeof m&&m.call(this);const n=this;if(n.hcPersistInstanceState&&n.hcInstanceId&&n.hcCanvasId){const t=M(n.hcCanvasId,n.hcInstanceId,n.hcComponentId);t&&ct(n,t)}}finally{const t=this.hcInstanceId,e=this.hcCanvasId;"string"==typeof t&&t.length>0&&"string"==typeof e&&e.length>0&&I(e,t,{mountEndedAt:performance.now()})}},beforeUnmount(){var t;if(this.hcInstanceId&&this.hcCanvasId){const t=K(this.hcInstanceId,this.hcCanvasId);t&&t.vm===this&&(this.hcPersistInstanceState&&function(t,e,s,n){if(!t||!e)return;const r=_(t,e);for(R.delete(r),R.set(r,{data:n,componentId:s});R.size>200;){const t=R.keys().next().value;if(void 0===t)break;R.delete(t)}}(this.hcCanvasId,this.hcInstanceId,this.hcComponentId,function(t){const e={};if(!t||"object"!=typeof t)return e;for(const s of Object.keys(t)){if(s.startsWith("_"))continue;const n=t[s];if("function"==typeof n)continue;if("custom"===s&&n&&"object"==typeof n){const t={};for(const e of Object.keys(n)){const s=n[e];if(s&&"object"==typeof s&&"value"in s){const n=B(s.value);n.ok&&(t[e]=n.value)}}Object.keys(t).length>0&&(e.custom=t);continue}const r=B(n);r.ok&&(e[s]=r.value)}return e}(this.$data)),q(this.hcInstanceId,this.hcCanvasId))}null==(t=this.__hcCleanup)||t.forEach(t=>{try{t()}catch{}}),this.__hcCleanup=void 0,"function"==typeof g&&g.call(this)},...v},meta:{name:r,attribute:i,style:l,customDecl:a,methodNames:x,slotsDecl:dt(c)}}}(function(t){let e;try{const s=v(t,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:!0}).body.find(t=>"ExportDefaultDeclaration"===t.type);if(!s)throw new Error("[hc-compile] component.js must `export default` an object");e=t.slice(0,s.start)+"module.exports = "+t.slice(s.declaration.start)}catch(t){throw t instanceof Error?t:new Error(String(t))}const s=new Function("module","exports",`"use strict";\n${e}\n;return module.exports;`),n={exports:{}};try{return s(n,n.exports)}catch(t){throw t instanceof Error?t:new Error(String(t))}}(e.js),e.html))();return pt(s,r),r.catch(()=>{ht.get(s)===r&&ht.delete(s)}),r}function gt(){ht.clear()}function yt(){return ht.size}function wt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function vt(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var s=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})}),s}var bt,xt={exports:{}};function Ct(){if(bt)return xt.exports;bt=1;var t=String,e=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};return xt.exports=e(),xt.exports.createColors=e,xt.exports}const St=vt(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var It,kt,Ot,At,Et,Pt;function $t(){if(kt)return It;kt=1;let t=Ct(),e=St;class s extends Error{constructor(t,e,n,r,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),r&&(this.source=r),i&&(this.plugin=i),void 0!==e&&void 0!==n&&("number"==typeof e?(this.line=e,this.column=n):(this.line=e.line,this.column=e.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=t.isColorSupported);let r=t=>t,o=t=>t,i=t=>t;if(s){let{bold:s,gray:n,red:a}=t.createColors(!0);o=t=>s(a(t)),r=t=>n(t),e&&(i=t=>e(t))}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((t,e)=>{let s=l+1+e,n=" "+(" "+s).slice(-u)+" | ";if(s===this.line){if(t.length>160){let e=20,s=Math.max(0,this.column-e),a=Math.max(this.column+e,this.endColumn+e),l=t.slice(s,a),c=r(n.replace(/\d/g," "))+t.slice(0,Math.min(this.column-1,e-1)).replace(/[^\t]/g," ");return o(">")+r(n)+i(l)+"\n "+c+o("^")}let e=r(n.replace(/\d/g," "))+t.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+r(n)+i(t)+"\n "+e+o("^")}return" "+r(n)+i(t)}).join("\n")}toString(){let t=this.showSourceCode();return t&&(t="\n\n"+t+"\n"),this.name+": "+this.message+t}}return It=s,s.default=s,It}function jt(){if(At)return Ot;At=1;const t=/(<)(\/?style\b)/gi,e=/(<)(!--)/g;function s(s){return"string"!=typeof s?s:s.includes("<")?s.replace(t,"\\3c $2").replace(e,"\\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(t){this.builder=t}atrule(t,e){let n=t.raws,r="@"+t.name,o=t.params?this.rawValue(t,"params"):"";if(void 0!==n.afterName?r+=n.afterName:o&&(r+=" "),t.nodes)this.block(t,r+o);else{let i=(n.between||"")+(e?";":"");this.builder(s(r+o+i),t)}}beforeAfter(t,e){let s;s="decl"===t.type?this.raw(t,null,"beforeDecl"):"comment"===t.type?this.raw(t,null,"beforeComment"):"before"===e?this.raw(t,null,"beforeRule"):this.raw(t,null,"beforeClose");let n=t.parent,r=0;for(;n&&"root"!==n.type;)r+=1,n=n.parent;if(s.includes("\n")){let e=this.raw(t,null,"indent");if(e.length)for(let t=0;t<r;t++)s+=e}return s}block(t,e){let n,r=this.raw(t,"between","beforeOpen");this.builder(s(e+r)+"{",t,"start"),t.nodes&&t.nodes.length?(this.body(t),n=this.raw(t,"after")):n=this.raw(t,"after","emptyBody"),n&&this.builder(s(n)),this.builder("}",t,"end")}body(t){let e=t.nodes,n=e.length-1;for(;n>0&&"comment"===e[n].type;)n-=1;let r=this.raw(t,"semicolon"),o="document"===t.type;for(let t=0;t<e.length;t++){let i=e[t],a=this.raw(i,"before");a&&this.builder(o?a:s(a)),this.stringify(i,n!==t||r)}}comment(t){let e=this.raw(t,"left","commentLeft"),n=this.raw(t,"right","commentRight");this.builder(s("/*"+e+t.text+n+"*/"),t)}decl(t,e){let n=t.raws,r=this.raw(t,"between","colon"),o=t.prop+r+this.rawValue(t,"value");t.important&&(o+=n.important||" !important"),e&&(o+=";"),this.builder(s(o),t)}document(t){this.body(t)}raw(t,e,s){let r;if(s||(s=e),e&&(r=t.raws[e],void 0!==r))return r;let o=t.parent;if("before"===s){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return n[s];let i=t.root(),a=i.rawCache||(i.rawCache={});if(void 0!==a[s])return a[s];if("before"===s||"after"===s)return this.beforeAfter(t,s);{let n="raw"+((l=s)[0].toUpperCase()+l.slice(1));this[n]?r=this[n](i,t):i.walk(t=>{if(r=t.raws[e],void 0!==r)return!1})}var l;return void 0===r&&(r=n[s]),a[s]=r,r}rawBeforeClose(t){let e;return t.walk(t=>{if(t.nodes&&t.nodes.length>0&&void 0!==t.raws.after)return e=t.raws.after,e.includes("\n")&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawBeforeComment(t,e){let s;return t.walkComments(t=>{if(void 0!==t.raws.before)return s=t.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(e,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(t,e){let s;return t.walkDecls(t=>{if(void 0!==t.raws.before)return s=t.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(e,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(t){let e;return t.walk(t=>{if("decl"!==t.type&&(e=t.raws.between,void 0!==e))return!1}),e}rawBeforeRule(t){let e;return t.walk(s=>{if(s.nodes&&(s.parent!==t||t.first!==s)&&void 0!==s.raws.before)return e=s.raws.before,e.includes("\n")&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawColon(t){let e;return t.walkDecls(t=>{if(void 0!==t.raws.between)return e=t.raws.between.replace(/[^\s:]/g,""),!1}),e}rawEmptyBody(t){let e;return t.walk(t=>{if(t.nodes&&0===t.nodes.length&&(e=t.raws.after,void 0!==e))return!1}),e}rawIndent(t){if(t.raws.indent)return t.raws.indent;let e;return t.walk(s=>{let n=s.parent;if(n&&n!==t&&n.parent&&n.parent===t&&void 0!==s.raws.before){let t=s.raws.before.split("\n");return e=t[t.length-1],e=e.replace(/\S/g,""),!1}}),e}rawSemicolon(t){let e;return t.walk(t=>{if(t.nodes&&t.nodes.length&&"decl"===t.last.type&&(e=t.raws.semicolon,void 0!==e))return!1}),e}rawValue(t,e){let s=t[e],n=t.raws[e];return n&&n.value===s?n.raw:s}root(t){if(this.body(t),t.raws.after){let e=t.raws.after,n=t.parent&&"document"===t.parent.type;this.builder(n?e:s(e))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(s(t.raws.ownSemicolon),t,"end")}stringify(t,e){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,e)}}return Ot=r,r.default=r,Ot}function Rt(){if(Pt)return Et;Pt=1;let t=jt();function e(e,s){new t(s).stringify(e)}return Et=e,e.default=e,Et}var _t,Mt,Bt,Ut,Dt,zt,Lt,Ft,Nt,Tt,Vt,Wt,Jt,Ht,Yt,Gt,Zt,qt,Kt,Qt,Xt,te,ee,se,ne,re,oe,ie,ae,le,ce,ue,he,pe,fe,de,me,ge,ye,we,ve,be,xe,Ce,Se,Ie,ke,Oe,Ae,Ee={};function Pe(){return _t||(_t=1,Ee.isClean=Symbol("isClean"),Ee.my=Symbol("my")),Ee}function $e(){if(Bt)return Mt;Bt=1;let t=$t(),e=jt(),s=Rt(),{isClean:n,my:r}=Pe();function o(t,e){let s=new t.constructor;for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;if("proxyCache"===n)continue;let r=t[n],i=typeof r;"parent"===n&&"object"===i?e&&(s[n]=e):"source"===n?s[n]=r:Array.isArray(r)?s[n]=r.map(t=>o(t,s)):("object"===i&&null!==r&&(r=o(r)),s[n]=r)}return s}function i(t,e){if(e&&void 0!==e.offset)return e.offset;let s=1,n=1,r=0;for(let o=0;o<t.length;o++){if(n===e.line&&s===e.column){r=o;break}"\n"===t[o]?(s=1,n+=1):s+=1}return r}class a{get proxyOf(){return this}constructor(t={}){this.raws={},this[n]=!1,this[r]=!0;for(let e in t)if("nodes"===e){this.nodes=[];for(let s of t[e])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}else this[e]=t[e]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let e=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${e.input.from}:${e.start.line}:${e.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let e in t)this[e]=t[e];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let e=o(this);for(let s in t)e[s]=t[s];return e}cloneAfter(t={}){let e=this.clone(t);return this.parent.insertAfter(this,e),e}cloneBefore(t={}){let e=this.clone(t);return this.parent.insertBefore(this,e),e}error(e,s={}){if(this.source){let{end:t,start:n}=this.rangeBy(s);return this.source.input.error(e,{column:n.column,line:n.line},{column:t.column,line:t.line},s)}return new t(e)}getProxyProcessor(){return{get:(t,e)=>"proxyOf"===e?t:"root"===e?()=>t.root().toProxy():t[e],set:(t,e,s)=>(t[e]===s||(t[e]=s,"prop"!==e&&"value"!==e&&"name"!==e&&"params"!==e&&"important"!==e&&"text"!==e||t.markDirty()),!0)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let t=this;for(;t=t.parent;)t[n]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let e=this.source.start;if(t.index)e=this.positionInside(t.index);else if(t.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(t.word);-1!==n&&(e=this.positionInside(n))}return e}positionInside(t){let e=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+t;for(let t=r;t<o;t++)"\n"===n[t]?(e=1,s+=1):e+=1;return{column:e,line:s,offset:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let e="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(e,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(e,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(t.word){let r=e.slice(i(e,this.source.start),i(e,this.source.end)).indexOf(t.word);-1!==r&&(s=this.positionInside(r),n=this.positionInside(r+t.word.length))}else t.start?s={column:t.start.column,line:t.start.line,offset:i(e,t.start)}:t.index&&(s=this.positionInside(t.index)),t.end?n={column:t.end.column,line:t.end.line,offset:i(e,t.end)}:"number"==typeof t.endIndex?n=this.positionInside(t.endIndex):t.index&&(n=this.positionInside(t.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(t,s){return(new e).raw(this,t,s)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,s=!1;for(let n of t)n===this?s=!0:s?(this.parent.insertAfter(e,n),e=n):this.parent.insertBefore(e,n);s||this.remove()}return this}root(){let t=this;for(;t.parent&&"document"!==t.parent.type;)t=t.parent;return t}toJSON(t,e){let s={},n=null==e;e=e||new Map;let r=0;for(let t in this){if(!Object.prototype.hasOwnProperty.call(this,t))continue;if("parent"===t||"proxyCache"===t)continue;let n=this[t];if(Array.isArray(n))s[t]=n.map(t=>"object"==typeof t&&t.toJSON?t.toJSON(null,e):t);else if("object"==typeof n&&n.toJSON)s[t]=n.toJSON(null,e);else if("source"===t){if(null==n)continue;let o=e.get(n.input);null==o&&(o=r,e.set(n.input,r),r++),s[t]={end:n.end,inputId:o,start:n.start}}else s[t]=n}return n&&(s.inputs=[...e.keys()].map(t=>t.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=s){t.stringify&&(t=t.stringify);let e="";return t(this,t=>{e+=t}),e}warn(t,e,s={}){let n={node:this};for(let t in s)n[t]=s[t];return t.warn(e,n)}}return Mt=a,a.default=a,Mt}function je(){if(Dt)return Ut;Dt=1;let t=$e();class e extends t{constructor(t){super(t),this.type="comment"}}return Ut=e,e.default=e,Ut}function Re(){if(Lt)return zt;Lt=1;let t=$e();class e extends t{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(t){t&&void 0!==t.value&&"string"!=typeof t.value&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}}return zt=e,e.default=e,zt}function _e(){if(Nt)return Ft;Nt=1;let t,e,s,n,r=je(),o=Re(),i=$e(),{isClean:a,my:l}=Pe();function c(t){return t.map(t=>(t.nodes&&(t.nodes=c(t.nodes)),delete t.source,t))}function u(t){if(t[a]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)u(e)}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(...t){for(let e of t){let t=this.normalize(e,this.last);for(let e of t)this.proxyOf.nodes.push(e)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let e of this.nodes)e.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let e,s,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(e=this.indexes[n],s=t(this.proxyOf.nodes[e],e),!1!==s);)this.indexes[n]+=1;return delete this.indexes[n],s}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get:(t,e)=>"proxyOf"===e?t:t[e]?"each"===e||"string"==typeof e&&e.startsWith("walk")?(...s)=>t[e](...s.map(t=>"function"==typeof t?(e,s)=>t(e.toProxy(),s):t)):"every"===e||"some"===e?s=>t[e]((t,...e)=>s(t.toProxy(),...e)):"root"===e?()=>t.root().toProxy():"nodes"===e?t.nodes.map(t=>t.toProxy()):"first"===e||"last"===e?t[e].toProxy():t[e]:t[e],set:(t,e,s)=>(t[e]===s||(t[e]=s,"name"!==e&&"params"!==e&&"selector"!==e||t.markDirty()),!0)}}index(t){return"number"==typeof t?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,e){let s,n=this.index(t),r=this.normalize(e,this.proxyOf.nodes[n]).reverse();n=this.index(t);for(let t of r)this.proxyOf.nodes.splice(n+1,0,t);for(let t in this.indexes)s=this.indexes[t],n<s&&(this.indexes[t]=s+r.length);return this.markDirty(),this}insertBefore(t,e){let s,n=this.index(t),r=0===n&&"prepend",o=this.normalize(e,this.proxyOf.nodes[n],r).reverse();n=this.index(t);for(let t of o)this.proxyOf.nodes.splice(n,0,t);for(let t in this.indexes)s=this.indexes[t],n<=s&&(this.indexes[t]=s+o.length);return this.markDirty(),this}normalize(s,i){if("string"==typeof s)s=c(e(s).nodes);else if(void 0===s)s=[];else if(Array.isArray(s)){s=s.slice(0);for(let t of s)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===s.type&&"document"!==this.type){s=s.nodes.slice(0);for(let t of s)t.parent&&t.parent.removeChild(t,"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 t(s)];else{if(!s.text)throw new Error("Unknown node type in node creation");s=[new r(s)]}return s.map(t=>(t[l]||h.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[a]&&u(t),t.raws||(t.raws={}),void 0===t.raws.before&&i&&void 0!==i.raws.before&&(t.raws.before=i.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...t){t=t.reverse();for(let e of t){let t=this.normalize(e,this.first,"prepend").reverse();for(let e of t)this.proxyOf.nodes.unshift(e);for(let e in this.indexes)this.indexes[e]=this.indexes[e]+t.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){let e;t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);for(let s in this.indexes)e=this.indexes[s],e>=t&&(this.indexes[s]=e-1);return this.markDirty(),this}replaceValues(t,e,s){return s||(s=e,e={}),this.walkDecls(n=>{e.props&&!e.props.includes(n.prop)||e.fast&&!n.value.includes(e.fast)||(n.value=n.value.replace(t,s))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((e,s)=>{let n;try{n=t(e,s)}catch(t){throw e.addToError(t)}return!1!==n&&e.walk&&(n=e.walk(t)),n})}walkAtRules(t,e){return e?t instanceof RegExp?this.walk((s,n)=>{if("atrule"===s.type&&t.test(s.name))return e(s,n)}):this.walk((s,n)=>{if("atrule"===s.type&&s.name===t)return e(s,n)}):(e=t,this.walk((t,s)=>{if("atrule"===t.type)return e(t,s)}))}walkComments(t){return this.walk((e,s)=>{if("comment"===e.type)return t(e,s)})}walkDecls(t,e){return e?t instanceof RegExp?this.walk((s,n)=>{if("decl"===s.type&&t.test(s.prop))return e(s,n)}):this.walk((s,n)=>{if("decl"===s.type&&s.prop===t)return e(s,n)}):(e=t,this.walk((t,s)=>{if("decl"===t.type)return e(t,s)}))}walkRules(t,e){return e?t instanceof RegExp?this.walk((s,n)=>{if("rule"===s.type&&t.test(s.selector))return e(s,n)}):this.walk((s,n)=>{if("rule"===s.type&&s.selector===t)return e(s,n)}):(e=t,this.walk((t,s)=>{if("rule"===t.type)return e(t,s)}))}}return h.registerParse=t=>{e=t},h.registerRule=t=>{n=t},h.registerAtRule=e=>{t=e},h.registerRoot=t=>{s=t},Ft=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,t.prototype):"rule"===e.type?Object.setPrototypeOf(e,n.prototype):"decl"===e.type?Object.setPrototypeOf(e,o.prototype):"comment"===e.type?Object.setPrototypeOf(e,r.prototype):"root"===e.type&&Object.setPrototypeOf(e,s.prototype),e[l]=!0,e.nodes&&e.nodes.forEach(t=>{h.rebuild(t)})},Ft}function Me(){if(Vt)return Tt;Vt=1;let t=_e();class e extends t{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}}return Tt=e,e.default=e,t.registerAtRule(e),Tt}function Be(){if(Jt)return Wt;Jt=1;let t,e,s=_e();class n extends s{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(s={}){return new t(new e,this,s).stringify()}}return n.registerLazyResult=e=>{t=e},n.registerProcessor=t=>{e=t},Wt=n,n.default=n,Wt}function Ue(){return Yt?Ht:(Yt=1,Ht={nanoid:(t=21)=>{let e="",s=0|t;for(;s--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e},customAlphabet:(t,e=21)=>(s=e)=>{let n="",r=0|s;for(;r--;)n+=t[Math.random()*t.length|0];return n}})}function De(){if(Zt)return Gt;Zt=1;let{existsSync:t,readFileSync:e}=St,{dirname:s,join:n}=St,{SourceMapConsumer:r,SourceMapGenerator:o}=St;class i{constructor(t,e){if(!1===e.map)return;e.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let n=e.map?e.map.prev:void 0,r=this.loadMap(e.from,n);!this.mapFile&&e.from&&(this.mapFile=e.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(t){let e=t.match(/^data:application\/json;charset=utf-?8,/)||t.match(/^data:application\/json,/);if(e)return decodeURIComponent(t.substr(e[0].length));let s=t.match(/^data:application\/json;charset=utf-?8;base64,/)||t.match(/^data:application\/json;base64,/);if(s)return n=t.substr(s[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let r=t.slice(22);throw r=r.slice(0,r.indexOf(",")),new Error("Unsupported source map encoding "+r)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return"object"==typeof t&&("string"==typeof t.mappings||"string"==typeof t._mappings||Array.isArray(t.sections))}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/g);if(!e)return;let s=t.lastIndexOf(e.pop()),n=t.indexOf("*/",s);s>-1&&n>-1&&(this.annotation=this.getAnnotationURL(t.substring(s,n)))}loadFile(n,r,o){if(o||this.unsafeMap||/\.map$/i.test(n))return this.root=s(n),t(n)?(this.mapFile=n,e(n,"utf-8").toString().trim()):void 0}loadMap(t,e){if(!1===e)return!1;if(e){if("string"==typeof e)return e;if("function"!=typeof e){if(e instanceof r)return o.fromSourceMap(e).toString();if(e instanceof o)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}{let s=e(t);if(s){let e=this.loadFile(s,t,!0);if(!e)throw new Error("Unable to load previous source map: "+s.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;t&&(e=n(s(t),e));let r=this.loadFile(e,t,!1);if(r)try{this.json=JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return r}}}startWith(t,e){return!!t&&t.substr(0,e.length)===e}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Gt=i,i.default=i,Gt}function ze(){if(Kt)return qt;Kt=1;let{nanoid:t}=Ue(),{isAbsolute:e,resolve:s}=St,{SourceMapConsumer:n,SourceMapGenerator:r}=St,{fileURLToPath:o,pathToFileURL:i}=St,a=$t(),l=De(),c=St,u=Symbol("lineToIndexCache"),h=Boolean(n&&r),p=Boolean(s&&e);function f(t){if(t[u])return t[u];let e=t.css.split("\n"),s=new Array(e.length),n=0;for(let t=0,r=e.length;t<r;t++)s[t]=n,n+=e[t].length+1;return t[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)||e(r.from)?this.file=r.from:this.file=s(r.from)),p&&h){let t=new l(this.css,r);if(t.text){this.map=t;let e=t.consumer().file;!this.file&&e&&(this.file=this.mapResolve(e))}}this.file||(this.id="<input css "+t(6)+">"),this.map&&(this.map.file=this.from)}error(t,e,s,n={}){let r,o,l,c,u;if(e&&"object"==typeof e){let t=e,n=s;if("number"==typeof t.offset){c=t.offset;let n=this.fromOffset(c);e=n.line,s=n.col}else e=t.line,s=t.column,c=this.fromLineAndColumn(e,s);if("number"==typeof n.offset){l=n.offset;let t=this.fromOffset(l);o=t.line,r=t.col}else o=n.line,r=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(s)c=this.fromLineAndColumn(e,s);else{c=e;let t=this.fromOffset(c);e=t.line,s=t.col}let h=this.origin(e,s,o,r);return u=h?new a(t,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(t,void 0===o?e:{column:s,line:e},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:e,offset:c,source:this.css},this.file&&(i&&(u.input.url=i(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(t,e){return f(this)[t-1]+e-1}fromOffset(t){let e=f(this),s=0;if(t>=e[e.length-1])s=e.length-1;else{let n,r=e.length-2;for(;s<r;)if(n=s+(r-s>>1),t<e[n])r=n-1;else{if(!(t>=e[n+1])){s=n;break}s=n+1}}return{col:t-e[s]+1,line:s+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:s(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,s,n,r){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:s,line:t});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:r,line:n})),l=e(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 t={};for(let e of["hasBOM","css","file","id"])null!=this[e]&&(t[e]=this[e]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}}return qt=d,d.default=d,c&&c.registerInput&&c.registerInput(d),qt}function Le(){if(Xt)return Qt;Xt=1;let t,e,s=_e();class n extends s{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,e,s){let n=super.normalize(t);if(e)if("prepend"===s)this.nodes.length>1?e.raws.before=this.nodes[1].raws.before:delete e.raws.before;else if(this.first!==e)for(let t of n)t.raws.before=e.raws.before;return n}removeChild(t,e){let s=this.index(t);return!e&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(t)}toResult(s={}){return new t(new e,this,s).stringify()}}return n.registerLazyResult=e=>{t=e},n.registerProcessor=t=>{e=t},Qt=n,n.default=n,s.registerRoot(n),Qt}function Fe(){if(ee)return te;ee=1;let t={comma:e=>t.split(e,[","],!0),space:e=>t.split(e,[" ","\n","\t"]),split(t,e,s){let n=[],r="",o=!1,i=0,a=!1,l="",c=!1;for(let s of t)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&&e.includes(s)&&(o=!0),o?(""!==r&&n.push(r.trim()),r="",o=!1):r+=s;return(s||""!==r)&&n.push(r.trim()),n}};return te=t,t.default=t,te}function Ne(){if(ne)return se;ne=1;let t=_e(),e=Fe();class s extends t{get selectors(){return e.comma(this.selector)}set selectors(t){let e=this.selector?this.selector.match(/,\s*/):null,s=e?e[0]:","+this.raw("between","beforeOpen");this.selector=t.join(s)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}}return se=s,s.default=s,t.registerRule(s),se}function Te(){if(ae)return ie;ae=1;let{dirname:t,relative:e,resolve:s,sep:n}=St,{SourceMapConsumer:r,SourceMapGenerator:o}=St,{pathToFileURL:i}=St,a=ze(),l=Boolean(r&&o),c=Boolean(t&&s&&e&&n);return ie=class{constructor(t,e,s,n){this.stringify=t,this.mapOpts=s.map||{},this.root=e,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 t;t=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 e="\n";this.css.includes("\r\n")&&(e="\r\n"),this.css+=e+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let e of this.previous()){let s,n=this.toUrl(this.path(e.file)),o=e.root||t(e.file);!1===this.mapOpts.sourcesContent?(s=new r(e.text),s.sourcesContent&&(s.sourcesContent=null)):s=e.consumer(),this.map.applySourceMap(s,n,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;e>=0;e--)t=this.root.nodes[e],"comment"===t.type&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(e)}else if(this.css){let t;for(;-1!==(t=this.css.lastIndexOf("/*#"));){let e=this.css.indexOf("*/",t+3);if(-1===e)break;for(;t>0&&"\n"===this.css[t-1];)t--;this.css=this.css.slice(0,t)+this.css.slice(e+2)}}}generate(){if(this.clearAnnotation(),c&&l&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=o.fromSourceMap(t,{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 t,e,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))),e=o.match(/\n/g),e?(s+=e.length,t=o.lastIndexOf("\n"),n=o.length-t):n+=o.length,a&&"start"!==l){let t=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===t.last&&!t.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(t=>t.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let t=this.mapOpts.annotation;return(void 0===t||!0===t)&&(!this.previous().length||this.previous().some(t=>t.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(t=>t.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?t(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=t(s(o,this.mapOpts.annotation)));let i=e(o,n);return this.memoizedPaths.set(n,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new a(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let s=e.source.input.from;if(s&&!t[s]){t[s]=!0;let n=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(n,e.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(i){let e=i(t).toString();return this.memoizedFileURLs.set(t,e),e}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;"\\"===n&&(t=t.replace(/\\/g,"/"));let s=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,s),s}}}function Ve(){if(fe)return pe;fe=1;let t=_e(),e=ze(),s=function(){if(he)return ue;he=1;let t=Me(),e=je(),s=Re(),n=Le(),r=Ne(),o=function(){if(ce)return le;ce=1;const t="'".charCodeAt(0),e='"'.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 le=function(S,I={}){let k,O,A,E,P,$,j,R,_,M,B=S.css.valueOf(),U=I.ignoreErrors,D=B.length,z=0,L=[],F=[],N=-1;function T(t){throw S.error("Unclosed "+t,z)}return{back:function(t){F.push(t)},endOfFile:function(){return 0===F.length&&z>=D},nextToken:function(S){if(F.length)return F.pop();if(z>=D)return;let I=!!S&&S.ignoreUnclosed;switch(k=B.charCodeAt(z),k){case r:case o:case a:case l:case i:E=z;do{E+=1,k=B.charCodeAt(E)}while(k===o||k===r||k===a||k===l||k===i);$=["space",B.slice(z,E)],z=E-1;break;case c:case u:case f:case d:case y:case m:case p:{let t=String.fromCharCode(k);$=[t,t,z];break}case h:if(M=L.length?L.pop()[1]:"",_=B.charCodeAt(z+1),"url"===M&&_!==t&&_!==e&&_!==o&&_!==r&&_!==a&&_!==i&&_!==l){E=z;do{if(j=!1,E=B.indexOf(")",E+1),-1===E){if(U||I){E=z;break}T("bracket")}for(R=E;B.charCodeAt(R-1)===s;)R-=1,j=!j}while(j);$=["brackets",B.slice(z,E+1),z,E],z=E}else z<=N?$=["(","(",z]:(E=B.indexOf(")",z+1),O=B.slice(z,E+1),-1===E||x.test(O)?(N=-1===E?D:E,$=["(","(",z]):($=["brackets",O,z,E],z=E));break;case t:case e:P=k===t?"'":'"',E=z;do{if(j=!1,E=B.indexOf(P,E+1),-1===E){if(U||I){E=z+1;break}T("string")}for(R=E;B.charCodeAt(R-1)===s;)R-=1,j=!j}while(j);$=["string",B.slice(z,E+1),z,E],z=E;break;case w:v.lastIndex=z+1,v.test(B),E=0===v.lastIndex?B.length-1:v.lastIndex-2,$=["at-word",B.slice(z,E+1),z,E],z=E;break;case s:for(E=z,A=!0;B.charCodeAt(E+1)===s;)E+=1,A=!A;if(k=B.charCodeAt(E+1),A&&k!==n&&k!==o&&k!==r&&k!==a&&k!==l&&k!==i&&(E+=1,C.test(B.charAt(E)))){for(;C.test(B.charAt(E+1));)E+=1;B.charCodeAt(E+1)===o&&(E+=1)}$=["word",B.slice(z,E+1),z,E],z=E;break;default:k===n&&B.charCodeAt(z+1)===g?(E=B.indexOf("*/",z+2)+1,0===E&&(U||I?E=B.length:T("comment")),$=["comment",B.slice(z,E+1),z,E],z=E):(b.lastIndex=z+1,b.test(B),E=0===b.lastIndex?B.length-1:b.lastIndex-2,$=["word",B.slice(z,E+1),z,E],L.push($),z=E)}return z++,$},position:function(){return z}}}}();const i={empty:!0,space:!0};return ue=class{constructor(t){this.input=t,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(e){let s,n,r,o=new t;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let i=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(s=(e=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(e[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(e);break}l.push(e)}else l.push(e);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&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[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(t){let e=this.colon(t);if(!1===e)return;let s,n=0;for(let r=e-1;r>=0&&(s=t[r],"space"===s[0]||(n+=1,2!==n));r--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(t){let e,s,n,r=0;for(let[o,i]of t.entries()){if(s=i,n=s[0],"("===n&&(r+=1),")"===n&&(r-=1),0===r&&":"===n){if(e){if("word"===e[0]&&"progid"===e[1])continue;return o}this.doubleColon(s)}e=s}return!1}comment(t){let s=new e;this.init(s,t[2]),s.source.end=this.getPosition(t[3]||t[2]),s.source.end.offset++;let n=t[1].slice(2,-2);if(n.trim()){let t=n.match(/^(\s*)([^]*\S)(\s*)$/);s.text=t[2],s.raws.left=t[1],s.raws.right=t[3]}else s.text="",s.raws.left=n,s.raws.right=""}createTokenizer(){this.tokenizer=o(this.input)}decl(t,e){let n=new s;this.init(n,t[0][2]);let r,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(t){for(let e=t.length-1;e>=0;e--){let s=t[e],n=s[3]||s[2];if(n)return n}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(r=t.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(;t.length&&(i=t[0][0],"space"===i||"comment"===i);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(r=t[e],"!important"===r[1].toLowerCase()){n.important=!0;let s=this.stringFrom(t,e);s=this.spacesFromEnd(t)+s," !important"!==s&&(n.raws.important=s);break}if("important"===r[1].toLowerCase()){let s=t.slice(0),r="";for(let t=e;t>0;t--){let e=s[t][0];if(r.trim().startsWith("!")&&"space"!==e)break;r=s.pop()[1]+r}r.trim().startsWith("!")&&(n.important=!0,n.raws.important=r,t=s)}if("space"!==r[0]&&"comment"!==r[0])break}t.some(t=>"space"!==t[0]&&"comment"!==t[0])&&(n.raws.between+=a.map(t=>t[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),e),n.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new r;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="",e.source.end=this.getPosition(t[2]),e.source.end.offset+=e.raws.ownSemicolon.length)}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="","comment"!==t.type&&(this.semicolon=!1)}other(t){let e=!1,s=null,n=!1,r=null,o=[],i=t[1].startsWith("--"),a=[],l=t;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()),e=!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()&&(e=!0),o.length>0&&this.unclosedBracket(r),e&&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 t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t)}this.endFile()}precheckMissedSemicolon(){}raw(t,e,s,n){let r,o,a,l,c=s.length,u="",h=!0;for(let t=0;t<c;t+=1)r=s[t],o=r[0],"space"!==o||t!==c-1||n?"comment"===o?(l=s[t-1]?s[t-1][0]:"empty",a=s[t+1]?s[t+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((t,e)=>t+e[1],"");t.raws[e]={raw:n,value:u}}t[e]=u}rule(t){t.pop();let e=new r;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],"space"===e||"comment"===e);)s=t.pop()[1]+s;return s}spacesAndCommentsFromStart(t){let e,s="";for(;t.length&&(e=t[0][0],"space"===e||"comment"===e);)s+=t.shift()[1];return s}spacesFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],"space"===e);)s=t.pop()[1]+s;return s}stringFrom(t,e){let s="";for(let n=e;n<t.length;n++)s+=t[n][1];return t.splice(e,t.length-e),s}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}}}();function n(t,n){let r=new e(t,n),o=new s(r);try{o.parse()}catch(t){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===t.name&&n&&n.from&&(/\.scss$/i.test(n.from)?t.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?t.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(t.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),t}return o.root}return pe=n,n.default=n,t.registerParse(n),pe}function We(){if(me)return de;me=1;class t{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let t=e.node.rangeBy(e);this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column}for(let t in e)this[t]=e[t]}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 de=t,t.default=t,de}function Je(){if(ye)return ge;ye=1;let t=We();class e{get content(){return this.css}constructor(t,e,s){this.processor=t,this.messages=[],this.root=e,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(e,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let n=new t(e,s);return this.messages.push(n),n}warnings(){return this.messages.filter(t=>"warning"===t.type)}}return ge=e,e.default=e,ge}function He(){if(ve)return we;ve=1;let t={};return we=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}}function Ye(){if(xe)return be;xe=1;let t=_e(),e=Be(),s=Te(),n=Ve(),r=Je(),o=Le(),i=Rt(),{isClean:a,my:l}=Pe(),c=He();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(t){return"object"==typeof t&&"function"==typeof t.then}function d(t){let e=!1,s=u[t.type];return"decl"===t.type?e=t.prop.toLowerCase():"atrule"===t.type&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,0,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function m(t){let e;return e="document"===t.type?["Document",0,"DocumentExit"]:"root"===t.type?["Root",0,"RootExit"]:d(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function g(t){return t[a]=!1,t.nodes&&t.nodes.forEach(t=>g(t)),t}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(e,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 e=n;o.syntax&&(e=o.syntax.parse),o.parser&&(e=o.parser),e.parse&&(e=e.parse);try{i=e(s,o)}catch(t){this.processed=!0,this.error=t}i&&!i[l]&&t.rebuild(i)}else i=g(s);this.result=new r(e,i,o),this.helpers={...y,postcss:y,result:this.result},this.plugins=this.processor.plugins.map(t=>"object"==typeof t&&t.prepare?{...t,...t.prepare(this.result)}:t)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,e){let s=this.result.lastPlugin;try{if(e&&e.addToError(t),this.error=t,"CssSyntaxError"!==t.name||t.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let t=s.postcssPlugin,e=s.postcssVersion,n=this.result.processor.version,r=e.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 "+t+" uses "+e+". Perhaps this is the source of the error below.")}}else t.plugin=s.postcssPlugin,t.setMessage()}catch(t){console&&console.error&&console.error(t)}return t}prepareVisitors(){this.listeners={};let t=(t,e,s)=>{this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push([t,s])};for(let e of this.plugins)if("object"==typeof e)for(let s in e){if(!h[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${e.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[s])if("object"==typeof e[s])for(let n in e[s])t(e,"*"===n?s:s+"-"+n.toLowerCase(),e[s][n]);else"function"==typeof e[s]&&t(e,s,e[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let e=this.plugins[t],s=this.runOnRoot(e);if(f(s))try{await s}catch(t){throw this.handleError(t)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[a];){t[a]=!0;let e=[m(t)];for(;e.length>0;){let t=this.visitTick(e);if(f(t))try{await t}catch(t){let s=e[e.length-1].node;throw this.handleError(t,s)}}}if(this.listeners.OnceExit)for(let[e,s]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(t=>s(t,this.helpers));await Promise.all(e)}else await s(t,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if("object"==typeof t&&t.Once){if("document"===this.result.root.type){let e=this.result.root.nodes.map(e=>t.Once(e,this.helpers));return f(e[0])?Promise.all(e):e}return t.Once(this.result.root,this.helpers)}if("function"==typeof t)return t(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,e=i;t.syntax&&(e=t.syntax.stringify),t.stringifier&&(e=t.stringifier),e.stringify&&(e=e.stringify);let n=this.result.root.source;if(void 0===t.map&&!(n&&n.input&&n.input.map)){let t="";return e(this.result.root,e=>{t+=e}),this.result.css=t,this.result}let r=new s(e,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 t of this.plugins)if(f(this.runOnRoot(t)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[a];)t[a]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,e){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(t,e)}toString(){return this.css}visitSync(t,e){for(let[s,n]of t){let t;this.result.lastPlugin=s;try{t=n(e,this.helpers)}catch(t){throw this.handleError(t,e.proxyOf)}if("root"!==e.type&&"document"!==e.type&&!e.parent)return!0;if(f(t))throw this.getAsyncError()}}visitTick(t){let e=t[t.length-1],{node:s,visitors:n}=e;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void t.pop();if(n.length>0&&e.visitorIndex<n.length){let[t,r]=n[e.visitorIndex];e.visitorIndex+=1,e.visitorIndex===n.length&&(e.visitors=[],e.visitorIndex=0),this.result.lastPlugin=t;try{return r(s.toProxy(),this.helpers)}catch(t){throw this.handleError(t,s)}}if(0!==e.iterator){let n,r=e.iterator;for(;n=s.nodes[s.indexes[r]];)if(s.indexes[r]+=1,!n[a])return n[a]=!0,void t.push(m(n));e.iterator=0,delete s.indexes[r]}let r=e.events;for(;e.eventIndex<r.length;){let t=r[e.eventIndex];if(e.eventIndex+=1,0===t)return void(s.nodes&&s.nodes.length&&(s[a]=!0,e.iterator=s.getIterator()));if(this.listeners[t])return void(e.visitors=this.listeners[t])}t.pop()}walkSync(t){t[a]=!0;let e=d(t);for(let s of e)if(0===s)t.nodes&&t.each(t=>{t[a]||this.walkSync(t)});else{let e=this.listeners[s];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}}return w.registerPostcss=t=>{y=t},be=w,w.default=w,o.registerLazyResult(w),e.registerLazyResult(w),be}const Ge=wt(function(){if(Ae)return Oe;Ae=1;let t=Me(),e=je(),s=_e(),n=$t(),r=Re(),o=Be(),i=function(){if(oe)return re;oe=1;let t=Me(),e=je(),s=Re(),n=ze(),r=De(),o=Le(),i=Ne();function a(l,c){if(Array.isArray(l))return l.map(t=>a(t));let{inputs:u,...h}=l;if(u){c=[];for(let t of u){let e={...t,__proto__:n.prototype};e.map&&(e.map={...e.map,__proto__:r.prototype}),c.push(e)}}if(h.nodes&&(h.nodes=l.nodes.map(t=>a(t,c))),h.source){let{inputId:t,...e}=h.source;h.source=e,null!=t&&(h.source.input=c[t])}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 e(h);if("atrule"===h.type)return new t(h);throw new Error("Unknown node type: "+l.type)}return re=a,a.default=a,re}(),a=ze(),l=Ye(),c=Fe(),u=$e(),h=Ve(),p=function(){if(ke)return Ie;ke=1;let t=Be(),e=Ye(),s=function(){if(Se)return Ce;Se=1;let t=Te(),e=Ve(),s=Je(),n=Rt(),r=He();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 t,s=e;try{t=s(this._css,this._opts)}catch(t){this.error=t}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(e,r,o){r=r.toString(),this.stringified=!1,this._processor=e,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 t(i,void 0,this._opts,r);if(l.isMap()){let[t,e]=l.generate();t&&(this.result.css=t),e&&(this.result.map=e)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){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(t,e)}toString(){return this._css}warnings(){return[]}}return Ce=o,o.default=o,Ce}(),n=Le();class r{constructor(t=[]){this.version="8.5.14",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let s of t)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))e=e.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)e.push(s);else if("function"==typeof s)e.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 e}process(t,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new e(this,t,n):new s(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}}return Ie=r,r.default=r,n.registerProcessor(r),t.registerProcessor(r),Ie}(),f=Je(),d=Le(),m=Ne(),g=Rt(),y=We();function w(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new p(t)}return w.plugin=function(t,e){let s,n=!1;function r(...s){console&&console.warn&&!n&&(n=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let r=e(...s);return r.postcssPlugin=t,r.postcssVersion=(new p).version,r}return Object.defineProperty(r,"postcss",{get:()=>(s||(s=r()),s)}),r.process=function(t,e,s){return w([r(s)]).process(t,e)},r},w.stringify=g,w.parse=h,w.fromJSON=i,w.list=c,w.comment=t=>new e(t),w.atRule=e=>new t(e),w.decl=t=>new r(t),w.rule=t=>new m(t),w.root=t=>new d(t),w.document=t=>new o(t),w.CssSyntaxError=n,w.Declaration=r,w.Container=s,w.Processor=p,w.Document=o,w.Comment=e,w.Warning=y,w.AtRule=t,w.Result=f,w.Input=a,w.Rule=m,w.Root=d,w.Node=u,l.registerPostcss(w),Oe=w,w.default=w,Oe}());Ge.stringify,Ge.fromJSON,Ge.plugin,Ge.parse,Ge.list,Ge.document,Ge.comment,Ge.atRule,Ge.rule,Ge.decl,Ge.root,Ge.CssSyntaxError,Ge.Declaration,Ge.Container,Ge.Processor,Ge.Document,Ge.Comment,Ge.Warning,Ge.AtRule,Ge.Result,Ge.Input,Ge.Rule,Ge.Root,Ge.Node;const Ze=new Set(["body","html",":root","*"]);function qe(t,e){return t&&t.trim()?Ge([(s=`[data-vbi-type="${e}"]`,{postcssPlugin:"hc-scope",AtRule(t){if("import"===t.name)return console.warn("[hc-css-scope] @import 已被拒绝(防外部资源加载):",t.params),void t.remove();"font-face"===t.name&&console.warn("[hc-css-scope] @font-face 全局生效,font-family 命名注意冲突")},Rule(t){(function(t){let e=t.parent;for(;e&&"object"==typeof e;){const t=e;if("atrule"===t.type&&/keyframes$/i.test(t.name??""))return!0;e=t.parent}return!1})(t)||(t.selectors=t.selectors.map(t=>function(t,e){const s=t.trim();if(!s)return s;if(Ze.has(s))return e;for(const t of Ze){const n=s.charAt(t.length);if(s.startsWith(t)&&(" "===n||">"===n||"+"===n||"~"===n||","===n))return e+s.slice(t.length)}return`${e} ${s}`}(t,s)))}})]).process(t,{from:void 0}).css:"";var s}const Ke=new Map;function Qe(t){let e=5381;for(let s=0;s<t.length;s++)e=(e<<5)+e+t.charCodeAt(s)|0;return(e>>>0).toString(36)}function Xe(t){const e=t.replace(/[^a-zA-Z0-9_-]/g,"_");return e===t?`hc-style-${e}`:`hc-style-${e}-${Qe(t).slice(0,6)}`}function ts(t,e){var s;const n=e??"",r=Xe(t),o=Ke.get(t);if(!n.trim())return null==(s=document.getElementById(r))||s.remove(),void(o&&Ke.set(t,{...o,cssHash:""}));const i=Qe(n);if(o&&o.cssHash===i)return;let a;try{a=qe(n,t)}catch(e){return void console.warn("[hc-css-scope]",t,"PostCSS process failed:",e)}!function(t,e){const s=Xe(t);let n=document.getElementById(s);n||(n=document.createElement("style"),n.id=s,n.setAttribute("data-hc-scope",t),document.head.appendChild(n)),n.textContent=e}(t,a),o?Ke.set(t,{...o,cssHash:i}):Ke.set(t,{cssHash:i,refCount:0})}function es(t,e){ts(t,e);const s=Ke.get(t);s?Ke.set(t,{...s,refCount:s.refCount+1}):Ke.set(t,{cssHash:"",refCount:1})}function ss(t){var e;const s=Ke.get(t);if(!s)return;const n=s.refCount-1;n<=0?(null==(e=document.getElementById(Xe(t)))||e.remove(),Ke.delete(t)):Ke.set(t,{...s,refCount:n})}function ns(t){var e;null==(e=document.getElementById(Xe(t)))||e.remove(),Ke.delete(t)}function rs(){return Ke.size}const os=x(),is={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"},as={class:"font-semibold flex items-center gap-1.5"},ls={class:"font-mono text-xs text-rose-800 break-all"},cs={key:0,class:"text-[10px] font-mono bg-rose-100/60 p-2 rounded overflow-auto max-h-60 text-rose-800"},us=s({__name:"ErrorBoundary",props:{label:{},instanceId:{},canvasId:{},componentId:{}},setup(t){const s=t,u=e(null),h=e(0),p=e(!1);function f(){u.value=null,p.value=!1,h.value++}return n(t=>{console.error(`[hc-eb${s.label?" "+s.label:""}]`,t),u.value=t;try{os.emit("error",{canvasId:s.canvasId,instanceId:s.instanceId,componentId:s.componentId,label:s.label,error:t,timestamp:"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now()})}catch{}return!1}),(e,s)=>(r(),o("div",{key:h.value,class:"hc-eb-root",style:{width:"100%",height:"100%"}},[u.value?(r(),o("div",is,[a("div",as,[s[1]||(s[1]=a("span",null,"⚠️",-1)),a("span",null,"组件渲染失败"+l(t.label?` — ${t.label}`:""),1)]),a("div",ls,l(u.value.message),1),a("button",{class:"text-xs text-rose-700 hover:text-rose-900 underline",onClick:s[0]||(s[0]=t=>p.value=!p.value)},l(p.value?"隐藏":"展开")+"堆栈 ",1),p.value?(r(),o("pre",cs,l(u.value.stack),1)):c("",!0),a("button",{class:"text-xs px-3 py-1 rounded bg-rose-600 hover:bg-rose-700 text-white transition-colors",onClick:f}," 重试 ")])):i(e.$slots,"default",{key:0})]))}}),hs=["data-vbi-id","data-vbi-type","data-vbi-canvas"],ps={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"},fs={class:"text-[11px] font-mono break-all whitespace-pre-wrap"},ds={key:1,class:"grid place-items-center min-h-[140px] text-xs text-zinc-400"},ms=s({__name:"RuntimeBox",props:{instanceId:{},componentId:{},scopeId:{},canvasId:{},htmlSource:{},jsSource:{},cssSource:{default:""},customValues:{default:()=>({})},position:{},size:{},zIndex:{},persistInstanceState:{type:Boolean,default:!1}},setup(t){const s=t,n=u(()=>s.scopeId??s.componentId),i=h(D,null),v=u(()=>s.canvasId??i??U),b=p(null),x=e(null),C=e(!1),S=e(0),k=e(null);f(()=>[s.htmlSource,s.jsSource],()=>{!async function(){C.value=!0,x.value=null;const t=v.value,e=s.instanceId;I(t,e,{compileStartedAt:performance.now()});try{const n=await mt({html:s.htmlSource,js:s.jsSource}),r=performance.now();I(t,e,{compileEndedAt:r,mountStartedAt:r}),b.value=n,S.value++}catch(s){x.value=s instanceof Error?s:new Error(String(s)),b.value=null,I(t,e,{compileEndedAt:performance.now()})}finally{C.value=!1}}()},{immediate:!0}),f(()=>[s.instanceId,v.value],(t,e)=>{const[s,n]=e,r=K(s,n);r&&r.vm===k.value&&q(s,n),S.value++});let A=!1;f(()=>[s.cssSource,n.value],([t,e],s)=>{const n=(null==s?void 0:s[1])??null;n&&n!==e?(ss(n),es(e,t),A=!0):A?ts(e,t):(es(e,t),A=!0)},{immediate:!0});const E=u(()=>{const t={width:"100%",height:"100%"};return s.position&&(t.position="absolute",t.left=`${s.position.x}px`,t.top=`${s.position.y}px`),void 0!==s.zIndex&&(t.zIndex=String(s.zIndex)),t});return d(()=>{A&&(ss(n.value),A=!1),O(v.value,s.instanceId)}),(e,s)=>(r(),o("div",{class:"_vbi_box","data-vbi-id":t.instanceId,"data-vbi-type":n.value,"data-vbi-canvas":v.value,style:m(E.value)},[x.value?(r(),o("div",ps,[s[0]||(s[0]=a("div",{class:"font-semibold"},"⚠️ 编译失败",-1)),a("pre",fs,l(x.value.message),1)])):C.value&&!b.value?(r(),o("div",ds," 编译中… ")):b.value?(r(),g(us,{key:S.value,label:t.instanceId,"instance-id":t.instanceId,"canvas-id":v.value,"component-id":t.componentId},{default:y(()=>[(r(),g(w(b.value.options),{ref_key:"innerVmRef",ref:k,"hc-custom-values":t.customValues,"hc-instance-id":t.instanceId,"hc-canvas-id":v.value,"hc-component-id":t.componentId,"hc-persist-instance-state":t.persistInstanceState},null,8,["hc-custom-values","hc-instance-id","hc-canvas-id","hc-component-id","hc-persist-instance-state"]))]),_:1},8,["label","instance-id","canvas-id","component-id"])):c("",!0)],12,hs))}}),gs="0.0.0-stage2b";export{U as DEFAULT_CANVAS_ID,us as ErrorBoundary,D as HC_CANVAS_ID_KEY,lt as HC_INJECT_KEY,ms as RuntimeBox,gs as VERSION,tt as assets,es as attachScope,gt as clearCompileCache,mt as compileComponent,st as createCanvasesRegistry,rt as createHyperCard,ss as detachScope,P as disableDiagnosticsEvents,Y as disposeCanvas,E as enableDiagnosticsEvents,yt as getCompileCacheSize,K as getInstance,k as getInstanceTimings,rs as getScopedCssCount,ts as injectScopedCss,j as interactionEmitter,$ as isDiagnosticsEventsEnabled,ot as isVuePlugin,G as listCanvasIds,Q as listInstances,F as onInstanceLifecycle,b as parseComponentSource,Z as register,H as registerInCanvas,z as registryVersion,ns as removeScopedCss,X as runtime,os as runtimeErrorEmitter,qe as scopeCss,J as subscribeCanvasInventory,q as unregister};
|