From 190a8be207de84f4d93f119a08b1e03e790c1eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Fri, 11 Mar 2022 19:18:43 +0100 Subject: [PATCH] Update example page --- packages/docs/docs/assets/display.38f829d6.js.map | 1 - .../docs/assets/{display.29fe9284.js => display.3df7ba9d.js} | 4 ++-- .../{display.29fe9284.js.map => display.3df7ba9d.js.map} | 2 +- packages/docs/docs/assets/display.3e29429a.js.map | 1 - .../docs/assets/{display.3e29429a.js => display.53aa9250.js} | 4 ++-- packages/docs/docs/assets/display.53aa9250.js.map | 1 + packages/docs/docs/assets/display.9143f05a.js | 2 ++ packages/docs/docs/assets/display.9143f05a.js.map | 1 + .../docs/assets/{display.38f829d6.js => display.b625d393.js} | 4 ++-- packages/docs/docs/assets/display.b625d393.js.map | 1 + packages/docs/docs/assets/display.f1bc6040.js | 2 ++ packages/docs/docs/assets/display.f1bc6040.js.map | 1 + packages/docs/docs/assets/display.fddb0311.js | 2 -- packages/docs/docs/assets/display.fddb0311.js.map | 1 - packages/docs/docs/assets/edit.0e6928af.js | 2 ++ packages/docs/docs/assets/edit.0e6928af.js.map | 1 + packages/docs/docs/assets/edit.146d9acf.js | 2 ++ packages/docs/docs/assets/edit.146d9acf.js.map | 1 + packages/docs/docs/assets/edit.1b0f33cf.js | 2 -- packages/docs/docs/assets/edit.1b0f33cf.js.map | 1 - packages/docs/docs/assets/edit.3e0c191e.js | 2 -- packages/docs/docs/assets/edit.3e0c191e.js.map | 1 - .../docs/docs/assets/{edit.a95f3ab1.js => edit.849203b1.js} | 4 ++-- packages/docs/docs/assets/edit.849203b1.js.map | 1 + packages/docs/docs/assets/edit.a95f3ab1.js.map | 1 - .../docs/docs/assets/{edit.eff76979.js => edit.e32652b3.js} | 4 ++-- packages/docs/docs/assets/edit.e32652b3.js.map | 1 + packages/docs/docs/assets/edit.eff76979.js.map | 1 - packages/docs/docs/assets/index.2f19b693.js | 2 ++ packages/docs/docs/assets/index.2f19b693.js.map | 1 + packages/docs/docs/assets/index.62d1366f.css | 1 - packages/docs/docs/assets/index.73e582b3.css | 1 + packages/docs/docs/assets/index.87211b72.js | 2 -- packages/docs/docs/assets/index.87211b72.js.map | 1 - packages/docs/docs/assets/style.79535ad9.css | 1 + packages/docs/docs/index.html | 4 ++-- 36 files changed, 34 insertions(+), 30 deletions(-) delete mode 100644 packages/docs/docs/assets/display.38f829d6.js.map rename packages/docs/docs/assets/{display.29fe9284.js => display.3df7ba9d.js} (77%) rename packages/docs/docs/assets/{display.29fe9284.js.map => display.3df7ba9d.js.map} (94%) delete mode 100644 packages/docs/docs/assets/display.3e29429a.js.map rename packages/docs/docs/assets/{display.3e29429a.js => display.53aa9250.js} (59%) create mode 100644 packages/docs/docs/assets/display.53aa9250.js.map create mode 100644 packages/docs/docs/assets/display.9143f05a.js create mode 100644 packages/docs/docs/assets/display.9143f05a.js.map rename packages/docs/docs/assets/{display.38f829d6.js => display.b625d393.js} (72%) create mode 100644 packages/docs/docs/assets/display.b625d393.js.map create mode 100644 packages/docs/docs/assets/display.f1bc6040.js create mode 100644 packages/docs/docs/assets/display.f1bc6040.js.map delete mode 100644 packages/docs/docs/assets/display.fddb0311.js delete mode 100644 packages/docs/docs/assets/display.fddb0311.js.map create mode 100644 packages/docs/docs/assets/edit.0e6928af.js create mode 100644 packages/docs/docs/assets/edit.0e6928af.js.map create mode 100644 packages/docs/docs/assets/edit.146d9acf.js create mode 100644 packages/docs/docs/assets/edit.146d9acf.js.map delete mode 100644 packages/docs/docs/assets/edit.1b0f33cf.js delete mode 100644 packages/docs/docs/assets/edit.1b0f33cf.js.map delete mode 100644 packages/docs/docs/assets/edit.3e0c191e.js delete mode 100644 packages/docs/docs/assets/edit.3e0c191e.js.map rename packages/docs/docs/assets/{edit.a95f3ab1.js => edit.849203b1.js} (89%) create mode 100644 packages/docs/docs/assets/edit.849203b1.js.map delete mode 100644 packages/docs/docs/assets/edit.a95f3ab1.js.map rename packages/docs/docs/assets/{edit.eff76979.js => edit.e32652b3.js} (91%) create mode 100644 packages/docs/docs/assets/edit.e32652b3.js.map delete mode 100644 packages/docs/docs/assets/edit.eff76979.js.map create mode 100644 packages/docs/docs/assets/index.2f19b693.js create mode 100644 packages/docs/docs/assets/index.2f19b693.js.map delete mode 100644 packages/docs/docs/assets/index.62d1366f.css create mode 100644 packages/docs/docs/assets/index.73e582b3.css delete mode 100644 packages/docs/docs/assets/index.87211b72.js delete mode 100644 packages/docs/docs/assets/index.87211b72.js.map create mode 100644 packages/docs/docs/assets/style.79535ad9.css diff --git a/packages/docs/docs/assets/display.38f829d6.js.map b/packages/docs/docs/assets/display.38f829d6.js.map deleted file mode 100644 index 263312b..0000000 --- a/packages/docs/docs/assets/display.38f829d6.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"display.38f829d6.js","sources":["../../../image/lib/display.tsx"],"sourcesContent":["import { defineComponent, PropType } from 'vue';\nimport {\n model,\n SbBlock,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n ImageData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-image-display',\n\n model,\n\n props: {\n data: {\n type: (null as unknown) as PropType,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n return () =>
\n \n \n
;\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","default","getDefaultData","setup","src","alt","description"],"mappings":"gGAYA,MAAeA,EAAgB,CAC7BC,KAAM,mBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAO,KACPC,QAASC,IAIbC,MAAML,GACG,sBAAoB,4BAEf,wBACDA,EAAMC,KAAKK,QACXN,EAAMC,KAAKM,sBAEFP,EAAMC,KAAKO"} \ No newline at end of file diff --git a/packages/docs/docs/assets/display.29fe9284.js b/packages/docs/docs/assets/display.3df7ba9d.js similarity index 77% rename from packages/docs/docs/assets/display.29fe9284.js rename to packages/docs/docs/assets/display.3df7ba9d.js index 73a6783..33ade77 100644 --- a/packages/docs/docs/assets/display.29fe9284.js +++ b/packages/docs/docs/assets/display.3df7ba9d.js @@ -1,2 +1,2 @@ -var e=Object.defineProperty,t=Object.prototype.hasOwnProperty,a=Object.getOwnPropertySymbols,n=Object.prototype.propertyIsEnumerable,o=(t,a,n)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[a]=n,r=(e,r)=>{for(var l in r||(r={}))t.call(r,l)&&o(e,l,r[l]);if(a)for(var l of a(r))n.call(r,l)&&o(e,l,r[l]);return e};import{d as l,m as p,q as s,a as i,n as c}from"./index.87211b72.js";var u=l({name:"sb-missing-block",model:p,props:r(r({},s),{name:String,data:{type:null,default:null},eventUpdate:{type:Function,default:()=>{}},eventAppendBlock:{type:Function,default:()=>{}},eventRemoveBlock:{type:Function,default:()=>{}}}),setup:e=>()=>i("div",{class:"sb-missing-block"},[c("Missing block: "),e.name])});export default u; -//# sourceMappingURL=display.29fe9284.js.map +var e=Object.defineProperty,t=Object.prototype.hasOwnProperty,a=Object.getOwnPropertySymbols,n=Object.prototype.propertyIsEnumerable,o=(t,a,n)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[a]=n,r=(e,r)=>{for(var l in r||(r={}))t.call(r,l)&&o(e,l,r[l]);if(a)for(var l of a(r))n.call(r,l)&&o(e,l,r[l]);return e};import{d as l,m as p,t as s,a as i,n as c}from"./index.2f19b693.js";var u=l({name:"sb-missing-block",model:p,props:r(r({},s),{name:String,data:{type:null,default:null},eventUpdate:{type:Function,default:()=>{}},eventAppendBlock:{type:Function,default:()=>{}},eventRemoveBlock:{type:Function,default:()=>{}}}),setup:e=>()=>i("div",{class:"sb-missing-block"},[c("Missing block: "),e.name])});export default u; +//# sourceMappingURL=display.3df7ba9d.js.map diff --git a/packages/docs/docs/assets/display.29fe9284.js.map b/packages/docs/docs/assets/display.3df7ba9d.js.map similarity index 94% rename from packages/docs/docs/assets/display.29fe9284.js.map rename to packages/docs/docs/assets/display.3df7ba9d.js.map index f6f2c7b..4a93be1 100644 --- a/packages/docs/docs/assets/display.29fe9284.js.map +++ b/packages/docs/docs/assets/display.3df7ba9d.js.map @@ -1 +1 @@ -{"version":3,"file":"display.29fe9284.js","sources":["../../../core/lib/components/MissingBlock/display.tsx"],"sourcesContent":["import { defineComponent, PropType } from 'vue';\nimport {\n model,\n blockProps,\n} from '../../block-helpers';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-missing-block',\n\n model,\n\n props: {\n ...blockProps,\n name: String,\n data: {\n type: (null as unknown) as PropType,\n default: null,\n },\n eventUpdate: { type: Function, default: () => {} },\n eventAppendBlock: { type: Function, default: () => {} },\n eventRemoveBlock: { type: Function, default: () => {} },\n },\n\n setup(props) {\n return () => (\n
Missing block: {props.name}
\n );\n },\n});\n"],"names":["defineComponent","name","model","props","__assign","blockProps","String","data","type","default","eventUpdate","Function","eventAppendBlock","eventRemoveBlock","setup"],"mappings":"uZAQeA,EAAgB,CAC7BC,KAAM,mBAENC,MAAAA,EAEAC,MAAOC,OACFC,GADE,CAELJ,KAAMK,OACNC,KAAM,CACJC,KAAO,KACPC,QAAS,MAEXC,YAAa,CAAEF,KAAMG,SAAUF,QAAS,QACxCG,iBAAkB,CAAEJ,KAAMG,SAAUF,QAAS,QAC7CI,iBAAkB,CAAEL,KAAMG,SAAUF,QAAS,UAG/CK,MAAMX,GACG,mBACM,0CAAmCA,EAAMF"} \ No newline at end of file +{"version":3,"file":"display.3df7ba9d.js","sources":["../../../core/lib/components/MissingBlock/display.tsx"],"sourcesContent":["import { defineComponent, PropType } from 'vue';\nimport {\n model,\n blockProps,\n} from '../../block-helpers';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-missing-block',\n\n model,\n\n props: {\n ...blockProps,\n name: String,\n data: {\n type: (null as unknown) as PropType,\n default: null,\n },\n eventUpdate: { type: Function, default: () => {} },\n eventAppendBlock: { type: Function, default: () => {} },\n eventRemoveBlock: { type: Function, default: () => {} },\n },\n\n setup(props) {\n return () => (\n
Missing block: {props.name}
\n );\n },\n});\n"],"names":["defineComponent","name","model","props","__assign","blockProps","String","data","type","default","eventUpdate","Function","eventAppendBlock","eventRemoveBlock","setup"],"mappings":"uZAQeA,EAAgB,CAC7BC,KAAM,mBAENC,MAAAA,EAEAC,MAAOC,OACFC,GADE,CAELJ,KAAMK,OACNC,KAAM,CACJC,KAAO,KACPC,QAAS,MAEXC,YAAa,CAAEF,KAAMG,SAAUF,QAAS,QACxCG,iBAAkB,CAAEJ,KAAMG,SAAUF,QAAS,QAC7CI,iBAAkB,CAAEL,KAAMG,SAAUF,QAAS,UAG/CK,MAAMX,GACG,mBACM,0CAAmCA,EAAMF"} \ No newline at end of file diff --git a/packages/docs/docs/assets/display.3e29429a.js.map b/packages/docs/docs/assets/display.3e29429a.js.map deleted file mode 100644 index 5d78dec..0000000 --- a/packages/docs/docs/assets/display.3e29429a.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"display.3e29429a.js","sources":["../../../layout/lib/display.tsx"],"sourcesContent":["import {\n defineComponent,\n computed,\n PropType,\n} from 'vue';\nimport {\n model,\n SbBlock,\n} from '@schlechtenburg/core';\nimport {\n LayoutData,\n getDefaultData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-layout-display',\n\n model,\n\n props: {\n data: {\n type: (null as unknown) as PropType,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const classes = computed(() => ({\n 'sb-layout': true,\n [`sb-layout_${props.data.orientation}`]: true,\n }));\n\n return () => (\n
\n {...props.data.children.map((child) => (\n \n ))}\n
\n );\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","default","getDefaultData","setup","classes","computed","orientation","value","children","map","child","id"],"mappings":"uGAgBA,MAAeA,EAAgB,CAC7BC,KAAM,oBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAO,KACPC,QAASC,IAIbC,MAAML,SACEM,EAAUC,GAAS,KAAO,cACjB,GACX,aAAYP,EAAMC,KAAKO,gBAAgB,YAGpC,mBACOF,EAAQG,WACdT,EAAMC,KAAKS,SAASC,iBAEfC,EAAMC,SACJD"} \ No newline at end of file diff --git a/packages/docs/docs/assets/display.3e29429a.js b/packages/docs/docs/assets/display.53aa9250.js similarity index 59% rename from packages/docs/docs/assets/display.3e29429a.js rename to packages/docs/docs/assets/display.53aa9250.js index cd1cf53..7250d7a 100644 --- a/packages/docs/docs/assets/display.3e29429a.js +++ b/packages/docs/docs/assets/display.53aa9250.js @@ -1,2 +1,2 @@ -import{d as a,m as s,g as t,c as l,a as e,e as o}from"./index.87211b72.js";/* empty css */var d=a({name:"sb-layout-display",model:s,props:{data:{type:null,default:t}},setup(a){const s=l((()=>({"sb-layout":!0,[`sb-layout_${a.data.orientation}`]:!0})));return()=>e("div",{class:s.value},[...a.data.children.map((a=>e(o,{key:a.id,block:a},null)))])}});export default d; -//# sourceMappingURL=display.3e29429a.js.map +import{d as a,m as s,g as t,c as l,a as e,e as o}from"./index.2f19b693.js";/* empty css */var d=a({name:"sb-layout-display",model:s,props:{data:{type:null,default:t}},setup(a){const s=l((()=>({"sb-layout":!0,[`sb-layout_${a.data.orientation}`]:!0})));return()=>e("div",{class:s.value},[...a.data.children.map((a=>e(o,{key:a.id,block:a},null)))])}});export default d; +//# sourceMappingURL=display.53aa9250.js.map diff --git a/packages/docs/docs/assets/display.53aa9250.js.map b/packages/docs/docs/assets/display.53aa9250.js.map new file mode 100644 index 0000000..49b7d5f --- /dev/null +++ b/packages/docs/docs/assets/display.53aa9250.js.map @@ -0,0 +1 @@ +{"version":3,"file":"display.53aa9250.js","sources":["../../../layout/lib/display.tsx"],"sourcesContent":["import {\n defineComponent,\n computed,\n PropType,\n} from 'vue';\nimport {\n model,\n SbBlock,\n} from '@schlechtenburg/core';\nimport {\n ILayoutData,\n getDefaultData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-layout-display',\n\n model,\n\n props: {\n data: {\n type: (null as unknown) as PropType,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const classes = computed(() => ({\n 'sb-layout': true,\n [`sb-layout_${props.data.orientation}`]: true,\n }));\n\n return () => (\n
\n {...props.data.children.map((child) => (\n \n ))}\n
\n );\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","default","getDefaultData","setup","classes","computed","orientation","value","children","map","child","id"],"mappings":"uGAgBA,MAAeA,EAAgB,CAC7BC,KAAM,oBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAO,KACPC,QAASC,IAIbC,MAAML,SACEM,EAAUC,GAAS,KAAO,cACjB,GACX,aAAYP,EAAMC,KAAKO,gBAAgB,YAGpC,mBACOF,EAAQG,WACdT,EAAMC,KAAKS,SAASC,iBAEfC,EAAMC,SACJD"} \ No newline at end of file diff --git a/packages/docs/docs/assets/display.9143f05a.js b/packages/docs/docs/assets/display.9143f05a.js new file mode 100644 index 0000000..eee82b3 --- /dev/null +++ b/packages/docs/docs/assets/display.9143f05a.js @@ -0,0 +1,2 @@ +import{d as a,m as s,p,c as r,a as e,f as t}from"./index.2f19b693.js";/* empty css */var l=a({name:"sb-paragraph-display",model:s,props:{data:{type:Object,default:p}},setup(a){const s=r((()=>({"sb-paragraph":!0,[`sb-paragraph_align-${a.data.align}`]:!0})));return()=>e("p",t({class:s.value},{innerHTML:a.data.value}),null)}});export default l; +//# sourceMappingURL=display.9143f05a.js.map diff --git a/packages/docs/docs/assets/display.9143f05a.js.map b/packages/docs/docs/assets/display.9143f05a.js.map new file mode 100644 index 0000000..749b837 --- /dev/null +++ b/packages/docs/docs/assets/display.9143f05a.js.map @@ -0,0 +1 @@ +{"version":3,"file":"display.9143f05a.js","sources":["../../../paragraph/lib/display.tsx"],"sourcesContent":["import {\n defineComponent,\n computed,\n PropType,\n} from 'vue';\nimport {\n model,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n IParagraphData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-paragraph-display',\n\n model,\n\n props: {\n data: {\n type: Object as PropType,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const classes = computed(() => ({\n 'sb-paragraph': true,\n [`sb-paragraph_align-${props.data.align}`]: true,\n }));\n\n return () =>

;\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","Object","default","getDefaultData","setup","classes","computed","align","value","innerHTML"],"mappings":"kGAeA,MAAeA,EAAgB,CAC7BC,KAAM,uBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAMC,OACNC,QAASC,IAIbC,MAAMN,SACEO,EAAUC,GAAS,KAAO,iBACd,GACd,sBAAqBR,EAAMC,KAAKQ,UAAU,YAGvC,mBACEF,EAAQG,QAEbC,UAAWX,EAAMC,KAAKS"} \ No newline at end of file diff --git a/packages/docs/docs/assets/display.38f829d6.js b/packages/docs/docs/assets/display.b625d393.js similarity index 72% rename from packages/docs/docs/assets/display.38f829d6.js rename to packages/docs/docs/assets/display.b625d393.js index d3a1ed4..e4e15da 100644 --- a/packages/docs/docs/assets/display.38f829d6.js +++ b/packages/docs/docs/assets/display.b625d393.js @@ -1,2 +1,2 @@ -import{d as a,m as s,p as e,a as t,e as l}from"./index.87211b72.js";/* empty css */var d=a({name:"sb-image-display",model:s,props:{data:{type:null,default:e}},setup:a=>()=>t("figure",{class:"sb-image"},[t("img",{class:"sb-image__content",src:a.data.src,alt:a.data.alt},null),t(l,{block:a.data.description},null)])});export default d; -//# sourceMappingURL=display.38f829d6.js.map +import{d as a,m as s,s as e,a as t,e as l}from"./index.2f19b693.js";/* empty css */var d=a({name:"sb-image-display",model:s,props:{data:{type:null,default:e}},setup:a=>()=>t("figure",{class:"sb-image"},[t("img",{class:"sb-image__content",src:a.data.src,alt:a.data.alt},null),t(l,{block:a.data.description},null)])});export default d; +//# sourceMappingURL=display.b625d393.js.map diff --git a/packages/docs/docs/assets/display.b625d393.js.map b/packages/docs/docs/assets/display.b625d393.js.map new file mode 100644 index 0000000..65c8ec9 --- /dev/null +++ b/packages/docs/docs/assets/display.b625d393.js.map @@ -0,0 +1 @@ +{"version":3,"file":"display.b625d393.js","sources":["../../../image/lib/display.tsx"],"sourcesContent":["import { defineComponent, PropType } from 'vue';\nimport {\n model,\n SbBlock,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n IImageData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-image-display',\n\n model,\n\n props: {\n data: {\n type: (null as unknown) as PropType,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n return () =>
\n \n \n
;\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","default","getDefaultData","setup","src","alt","description"],"mappings":"gGAYA,MAAeA,EAAgB,CAC7BC,KAAM,mBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAO,KACPC,QAASC,IAIbC,MAAML,GACG,sBAAoB,4BAEf,wBACDA,EAAMC,KAAKK,QACXN,EAAMC,KAAKM,sBAEFP,EAAMC,KAAKO"} \ No newline at end of file diff --git a/packages/docs/docs/assets/display.f1bc6040.js b/packages/docs/docs/assets/display.f1bc6040.js new file mode 100644 index 0000000..a53c986 --- /dev/null +++ b/packages/docs/docs/assets/display.f1bc6040.js @@ -0,0 +1,2 @@ +import{d as a,m as e,j as s,c as t,q as d}from"./index.2f19b693.js";/* empty css */var l=a({name:"sb-heading-display",model:e,props:{data:{type:Object,default:s}},setup(a){const e=t((()=>({"sb-heading":!0,[`sb-heading_align-${a.data.align}`]:!0,[`sb-heading_${a.data.level}`]:!0})));return()=>d(`h${a.data.level}`,{class:e.value,innerHTML:a.data.value})}});export default l; +//# sourceMappingURL=display.f1bc6040.js.map diff --git a/packages/docs/docs/assets/display.f1bc6040.js.map b/packages/docs/docs/assets/display.f1bc6040.js.map new file mode 100644 index 0000000..eccc516 --- /dev/null +++ b/packages/docs/docs/assets/display.f1bc6040.js.map @@ -0,0 +1 @@ +{"version":3,"file":"display.f1bc6040.js","sources":["../../../heading/lib/display.ts"],"sourcesContent":["import {\n defineComponent,\n computed,\n PropType,\n h,\n} from 'vue';\nimport {\n model,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n IHeadingData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-heading-display',\n\n model,\n\n props: {\n data: {\n type: Object as PropType,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const classes = computed(() => ({\n 'sb-heading': true,\n [`sb-heading_align-${props.data.align}`]: true,\n [`sb-heading_${props.data.level}`]: true,\n }));\n\n return () => h(\n `h${props.data.level}`,\n {\n class: classes.value,\n innerHTML: props.data.value,\n },\n );\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","Object","default","getDefaultData","[object Object]","classes","computed","sb-heading","align","level","h","class","value","innerHTML"],"mappings":"gGAgBA,MAAeA,EAAgB,CAC7BC,KAAM,qBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAMC,OACNC,QAASC,IAIbC,MAAMN,SACEO,EAAUC,GAAS,MACvBC,cAAc,GACb,oBAAoBT,EAAMC,KAAKS,UAAU,GACzC,cAAcV,EAAMC,KAAKU,UAAU,YAG/B,IAAMC,EACX,IAAIZ,EAAMC,KAAKU,QACf,CACEE,MAAON,EAAQO,MACfC,UAAWf,EAAMC,KAAKa"} \ No newline at end of file diff --git a/packages/docs/docs/assets/display.fddb0311.js b/packages/docs/docs/assets/display.fddb0311.js deleted file mode 100644 index d4a857c..0000000 --- a/packages/docs/docs/assets/display.fddb0311.js +++ /dev/null @@ -1,2 +0,0 @@ -import{d as a,m as s,j as p,c as r,a as e,f as t}from"./index.87211b72.js";/* empty css */var l=a({name:"sb-paragraph-display",model:s,props:{data:{type:Object,default:p}},setup(a){const s=r((()=>({"sb-paragraph":!0,[`sb-paragraph_align-${a.data.align}`]:!0})));return()=>e("p",t({class:s.value},{innerHTML:a.data.value}),null)}});export default l; -//# sourceMappingURL=display.fddb0311.js.map diff --git a/packages/docs/docs/assets/display.fddb0311.js.map b/packages/docs/docs/assets/display.fddb0311.js.map deleted file mode 100644 index 469a82c..0000000 --- a/packages/docs/docs/assets/display.fddb0311.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"display.fddb0311.js","sources":["../../../paragraph/lib/display.tsx"],"sourcesContent":["import {\n defineComponent,\n computed,\n PropType,\n} from 'vue';\nimport {\n model,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n ParagraphData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-paragraph-display',\n\n model,\n\n props: {\n data: {\n type: Object as PropType,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const classes = computed(() => ({\n 'sb-paragraph': true,\n [`sb-paragraph_align-${props.data.align}`]: true,\n }));\n\n return () =>

;\n },\n});\n"],"names":["defineComponent","name","model","props","data","type","Object","default","getDefaultData","setup","classes","computed","align","value","innerHTML"],"mappings":"uGAeA,MAAeA,EAAgB,CAC7BC,KAAM,uBAENC,MAAAA,EAEAC,MAAO,CACLC,KAAM,CACJC,KAAMC,OACNC,QAASC,IAIbC,MAAMN,SACEO,EAAUC,GAAS,KAAO,iBACd,GACd,sBAAqBR,EAAMC,KAAKQ,UAAU,YAGvC,mBACEF,EAAQG,QAEbC,UAAWX,EAAMC,KAAKS"} \ No newline at end of file diff --git a/packages/docs/docs/assets/edit.0e6928af.js b/packages/docs/docs/assets/edit.0e6928af.js new file mode 100644 index 0000000..7c8277c --- /dev/null +++ b/packages/docs/docs/assets/edit.0e6928af.js @@ -0,0 +1,2 @@ +var e=Object.defineProperty,n=Object.prototype.hasOwnProperty,i=Object.getOwnPropertySymbols,t=Object.prototype.propertyIsEnumerable,r=(n,i,t)=>i in n?e(n,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[i]=t,l=(e,l)=>{for(var a in l||(l={}))n.call(l,a)&&r(e,a,l[a]);if(i)for(var a of i(l))t.call(l,a)&&r(e,a,l[a]);return e};import{d as a,m as o,g as c,u as d,r as h,w as s,c as p,a as u,S as f,b,e as v,f as m,h as y,i as U}from"./index.2f19b693.js";/* empty css */var k=a({name:"sb-layout-edit",model:o,props:{onUpdate:{type:Function,default:()=>{}},data:{type:null,default:c}},setup(e){const{activate:n}=d(),i=h({orientation:e.data.orientation,children:[...e.data.children]});s((()=>e.data),(()=>{i.orientation=e.data.orientation,i.children=[...e.data.children]}));const t=p((()=>({"sb-layout":!0,[`sb-layout_${i.orientation}`]:!0}))),r=()=>{e.onUpdate({orientation:"vertical"===i.orientation?"horizontal":"vertical"})},a=t=>{console.log(a),i.children=[...i.children,t],e.onUpdate({children:[...i.children]}),n(t.id)},o=(t,r)=>{i.children=[...i.children.slice(0,t+1),r,...i.children.slice(t+1)],e.onUpdate({children:[...i.children]}),n(r.id)},c=t=>{i.children=[...i.children.slice(0,t),...i.children.slice(t+1)],e.onUpdate({children:[...i.children]});const r=Math.max(t-1,0);n(i.children[r].id)},k=e=>{const t=Math.max(Math.min(i.children.length-1,e),0);n(i.children[t].id)};return()=>u("div",{class:t.value},[u(f,null,{default:()=>[u(b,{type:"button",onClick:r},{default:()=>[i.orientation]})]}),...i.children.map(((n,t)=>u(v,m({key:n.id},{"data-order":t,block:n,onUpdate:t=>((n,t)=>{const r=i.children.indexOf(n);-1!==r&&e.onUpdate({children:[...i.children.slice(0,r),l(l({},n),t),...i.children.slice(r+1)]})})(n,t),onRemoveSelf:()=>c(t),onPrependBlock:e=>o(t-1,e),onAppendBlock:e=>o(t,e),onActivatePrevious:()=>k(t-1),onActivateNext:()=>k(t+1)}),{"context-toolbar":()=>u(y,{onMoveBackward:()=>(n=>{if(0===n)return;const t=i.children[n],r=i.children[n-1];i.children=[...i.children.slice(0,n-1),t,r,...i.children.slice(n+1)],e.onUpdate({children:[...i.children]})})(t),onMoveForward:()=>(n=>{if(n===i.children.length-1)return;const t=i.children[n],r=i.children[n+1];i.children=[...i.children.slice(0,n),r,t,...i.children.slice(n+2)],e.onUpdate({children:[...i.children]})})(t),onRemove:()=>c(t),orientation:i.orientation},null)}))),u(U,{onInsertBlock:a},null)])}});export default k; +//# sourceMappingURL=edit.0e6928af.js.map diff --git a/packages/docs/docs/assets/edit.0e6928af.js.map b/packages/docs/docs/assets/edit.0e6928af.js.map new file mode 100644 index 0000000..e7d840a --- /dev/null +++ b/packages/docs/docs/assets/edit.0e6928af.js.map @@ -0,0 +1 @@ +{"version":3,"file":"edit.0e6928af.js","sources":["../../../layout/lib/edit.tsx"],"sourcesContent":["import {\n defineComponent,\n reactive,\n computed,\n watch,\n PropType,\n} from 'vue';\nimport {\n model,\n IBlockData,\n useActivation,\n\n SbBlock,\n SbButton,\n SbToolbar,\n SbBlockPlaceholder,\n SbBlockOrdering,\n} from '@schlechtenburg/core';\n\nimport {\n ILayoutData,\n getDefaultData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-layout-edit',\n\n model,\n\n props: {\n onUpdate: { type: Function, default: () => {} },\n data: {\n type: (null as unknown) as PropType,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const { activate } = useActivation();\n\n const localData: ILayoutData = reactive({\n orientation: props.data.orientation,\n children: [...props.data.children],\n });\n\n watch(() => props.data, () => {\n localData.orientation = props.data.orientation;\n localData.children = [...props.data.children];\n });\n\n const classes = computed(() => ({\n 'sb-layout': true,\n [`sb-layout_${localData.orientation}`]: true,\n }));\n\n const toggleOrientation = () => {\n props.onUpdate({\n orientation: localData.orientation === 'vertical' ? 'horizontal' : 'vertical',\n });\n };\n\n const onChildUpdate = (child: IBlockData, updated: IBlockData) => {\n const index = localData.children.indexOf(child);\n if (index === -1) {\n return;\n }\n props.onUpdate({\n children: [\n ...localData.children.slice(0, index),\n {\n ...child,\n ...updated,\n },\n ...localData.children.slice(index + 1),\n ],\n });\n };\n\n const appendBlock = (block: IBlockData) => {\n console.log(appendBlock);\n localData.children = [\n ...localData.children,\n block,\n ];\n props.onUpdate({ children: [...localData.children] });\n activate(block.id);\n };\n\n const insertBlock = (index: number, block: IBlockData) => {\n localData.children = [\n ...localData.children.slice(0, index + 1),\n block,\n ...localData.children.slice(index + 1),\n ];\n props.onUpdate({ children: [...localData.children] });\n activate(block.id);\n };\n\n const removeBlock = (index: number) => {\n localData.children = [\n ...localData.children.slice(0, index),\n ...localData.children.slice(index + 1),\n ];\n props.onUpdate({ children: [...localData.children] });\n\n const newActiveIndex = Math.max(index - 1, 0);\n activate(localData.children[newActiveIndex].id);\n };\n\n const activateBlock = (index: number) => {\n const safeIndex =\n Math.max(\n Math.min(\n localData.children.length - 1,\n index,\n ),\n 0,\n );\n activate(localData.children[safeIndex].id);\n };\n\n const moveBackward = (index: number) => {\n if (index === 0) {\n return;\n }\n\n const curr = localData.children[index];\n const prev = localData.children[index - 1];\n localData.children = [\n ...localData.children.slice(0, index - 1),\n curr,\n prev,\n ...localData.children.slice(index + 1),\n ];\n\n props.onUpdate({ children: [...localData.children] });\n };\n\n const moveForward = (index: number) => {\n if (index === localData.children.length - 1) {\n return;\n }\n\n const curr = localData.children[index];\n const next = localData.children[index + 1];\n localData.children = [\n ...localData.children.slice(0, index),\n next,\n curr,\n ...localData.children.slice(index + 2),\n ];\n\n props.onUpdate({ children: [...localData.children] });\n };\n\n return () => (\n
\n \n {localData.orientation}\n \n\n {...localData.children.map((child, index) => (\n ) => onChildUpdate(child, updated)}\n onRemoveSelf={() => removeBlock(index)}\n onPrependBlock={(block: IBlockData) => insertBlock(index - 1, block)}\n onAppendBlock={(block: IBlockData) => insertBlock(index, block)}\n onActivatePrevious={() => activateBlock(index - 1,)}\n onActivateNext={() => activateBlock(index + 1,)}\n >\n {{\n 'context-toolbar': () =>\n moveBackward(index)}\n onMoveForward={() => moveForward(index)}\n onRemove={() => removeBlock(index)}\n orientation={localData.orientation}\n />,\n }}\n \n ))}\n\n \n
\n );\n },\n});\n"],"names":["defineComponent","name","model","props","onUpdate","type","Function","default","data","getDefaultData","setup","activate","useActivation","localData","reactive","orientation","children","classes","computed","toggleOrientation","appendBlock","log","block","id","insertBlock","index","slice","removeBlock","newActiveIndex","Math","max","activateBlock","safeIndex","min","length","value","onClick","map","child","key","updated","indexOf","__assign","onChildUpdate","curr","prev","moveBackward","next","moveForward"],"mappings":"ueA0BA,MAAeA,EAAgB,CAC7BC,KAAM,iBAENC,MAAAA,EAEAC,MAAO,CACLC,SAAU,CAAEC,KAAMC,SAAUC,QAAS,QACrCC,KAAM,CACJH,KAAO,KACPE,QAASE,IAIbC,MAAMP,SACEQ,SAAEA,GAAaC,IAEfC,EAAyBC,EAAS,CACtCC,YAAaZ,EAAMK,KAAKO,YACxBC,SAAU,IAAIb,EAAMK,KAAKQ,eAGrB,IAAMb,EAAMK,OAAM,OACZO,YAAcZ,EAAMK,KAAKO,cACzBC,SAAW,IAAIb,EAAMK,KAAKQ,mBAGhCC,EAAUC,GAAS,KAAO,cACjB,GACX,aAAYL,EAAUE,gBAAgB,MAGpCI,EAAoB,OAClBf,SAAS,CACbW,YAAuC,aAA1BF,EAAUE,YAA6B,aAAe,cAqBjEK,cACIC,IAAID,KACFJ,SAAW,IAChBH,EAAUG,SACbM,KAEIlB,SAAS,CAAEY,SAAU,IAAIH,EAAUG,cAChCM,EAAMC,KAGXC,EAAc,CAACC,EAAeH,OACxBN,SAAW,IAChBH,EAAUG,SAASU,MAAM,EAAGD,EAAQ,GACvCH,KACGT,EAAUG,SAASU,MAAMD,EAAQ,MAEhCrB,SAAS,CAAEY,SAAU,IAAIH,EAAUG,cAChCM,EAAMC,KAGXI,QACMX,SAAW,IAChBH,EAAUG,SAASU,MAAM,EAAGD,MAC5BZ,EAAUG,SAASU,MAAMD,EAAQ,MAEhCrB,SAAS,CAAEY,SAAU,IAAIH,EAAUG,kBAEnCY,EAAiBC,KAAKC,IAAIL,EAAQ,EAAG,KAClCZ,EAAUG,SAASY,GAAgBL,KAGxCQ,YACEC,EACJH,KAAKC,IACFD,KAAKI,IACHpB,EAAUG,SAASkB,OAAS,EAC5BT,GAEH,KAEKZ,EAAUG,SAASgB,GAAWT,WAqClC,mBACON,EAAQkB,oCAIZ9B,KAAM,SACN+B,QAASjB,iBAEXN,EAAUE,qBAGVF,EAAUG,SAASqB,KAAI,CAACC,EAAOb,WAEzBc,IAAKD,EAAMf,kBACLE,QACLa,cA7GO,EAACA,EAAwBE,WACvCf,EAAQZ,EAAUG,SAASyB,QAAQH,QACrCb,KAGErB,SAAS,CACbY,SAAU,IACLH,EAAUG,SAASU,MAAM,EAAGD,GAC/BiB,OACKJ,GACAE,MAEF3B,EAAUG,SAASU,MAAMD,EAAQ,OAkGMkB,CAAcL,EAAOE,gBAC/C,IAAMb,EAAYF,qBACYD,EAAYC,EAAQ,EAAGH,oBACxBE,EAAYC,EAAOH,sBAC1C,IAAMS,EAAcN,EAAQ,kBAChC,IAAMM,EAAcN,EAAQ,wBAGvB,wBAEC,IA5DRA,QACN,IAAVA,eAIEmB,EAAO/B,EAAUG,SAASS,GAC1BoB,EAAOhC,EAAUG,SAASS,EAAQ,KAC9BT,SAAW,IAChBH,EAAUG,SAASU,MAAM,EAAGD,EAAQ,GACvCmB,EACAC,KACGhC,EAAUG,SAASU,MAAMD,EAAQ,MAGhCrB,SAAS,CAAEY,SAAU,IAAIH,EAAUG,aA8CP8B,CAAarB,iBACpB,IA5CRA,QACfA,IAAUZ,EAAUG,SAASkB,OAAS,eAIpCU,EAAO/B,EAAUG,SAASS,GAC1BsB,EAAOlC,EAAUG,SAASS,EAAQ,KAC9BT,SAAW,IAChBH,EAAUG,SAASU,MAAM,EAAGD,GAC/BsB,EACAH,KACG/B,EAAUG,SAASU,MAAMD,EAAQ,MAGhCrB,SAAS,CAAEY,SAAU,IAAIH,EAAUG,aA8BRgC,CAAYvB,YACvB,IAAME,EAAYF,eACfZ,EAAUE,0CAMEK"} \ No newline at end of file diff --git a/packages/docs/docs/assets/edit.146d9acf.js b/packages/docs/docs/assets/edit.146d9acf.js new file mode 100644 index 0000000..b7a4fad --- /dev/null +++ b/packages/docs/docs/assets/edit.146d9acf.js @@ -0,0 +1,2 @@ +var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,l=Object.getOwnPropertySymbols,n=Object.prototype.propertyIsEnumerable,t=(a,l,n)=>l in a?e(a,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[l]=n,o=(e,o)=>{for(var u in o||(o={}))a.call(o,u)&&t(e,u,o[u]);if(l)for(var u of l(o))n.call(o,u)&&t(e,u,o[u]);return e};import{d as u,m as i,j as v,r,k as d,u as s,o as p,w as c,c as f,a as g,S as y,l as b,n as h,p as m}from"./index.2f19b693.js";/* empty css */var w=u({name:"sb-heading-edit",model:i,props:{blockId:{type:String,required:!0},data:{type:null,default:v},onUpdate:{type:Function,default:()=>{}},onAppendBlock:{type:Function,default:()=>{}},onRemoveSelf:{type:Function,default:()=>{}},onActivateNext:{type:Function,default:()=>{}},onActivatePrevious:{type:Function,default:()=>{}}},setup(e){const a=r({value:e.data.value,align:e.data.align,level:e.data.level,focused:!1}),l=d(null),{isActive:n,activate:t}=s(e.blockId),u=()=>{l.value&&n.value&&l.value.focus()};p((()=>{u(),l.value&&(l.value.innerHTML=a.value)})),c(n,u),c((()=>e.data),(()=>{a.value=e.data.value,a.align=e.data.align,a.level=e.data.level,l.value&&(l.value.innerHTML=a.value)}));const i=e=>{a.value=e.target.innerHTML},v=f((()=>({"sb-heading":!0,"sb-heading_focused":a.focused,[`sb-heading_align-${a.align}`]:!0,[`sb-heading_${a.level}`]:!0}))),w=l=>{e.onUpdate(o(o({},a),{level:parseInt(l.target.value,10)}))},k=l=>{e.onUpdate(o(o({},a),{align:l.target.value}))},A=()=>{a.focused=!0,t()},j=()=>{a.focused=!1,e.onUpdate({value:a.value,align:a.align,level:a.level})},O=a=>{if("Enter"===a.key&&!a.shiftKey){const l=""+ +new Date;e.onAppendBlock({id:l,name:"sb-paragraph",data:m()}),t(l),a.preventDefault()}},F=n=>{var t;"Backspace"===n.key&&""===a.value&&e.onRemoveSelf();const o=window.getSelection(),u=null==o?void 0:o.focusNode,i=Array.from((null==(t=null==l?void 0:l.value)?void 0:t.childNodes)||[]),v=u?i.indexOf(u):-1;if(u===l.value||0===v||v===i.length-1)switch(n.key){case"ArrowDown":e.onActivateNext();break;case"ArrowUp":e.onActivatePrevious()}};return()=>g("div",{class:v.value},[g(y,null,{default:()=>[g(b,{value:a.level,onChange:w},{default:()=>[g("option",{value:1},[h("h1")]),g("option",{value:2},[h("h2")]),g("option",{value:3},[h("h3")]),g("option",{value:4},[h("h4")]),g("option",{value:5},[h("h5")]),g("option",{value:6},[h("h6")])]}),g(b,{value:a.align,onChange:k},{default:()=>[g("option",null,[h("left")]),g("option",null,[h("center")]),g("option",null,[h("right")])]})]}),g("p",{class:"sb-heading__input",ref:l,contenteditable:!0,onInput:i,onFocus:A,onBlur:j,onKeydown:O,onKeyup:F},null)])}});export default w; +//# sourceMappingURL=edit.146d9acf.js.map diff --git a/packages/docs/docs/assets/edit.146d9acf.js.map b/packages/docs/docs/assets/edit.146d9acf.js.map new file mode 100644 index 0000000..85e8db0 --- /dev/null +++ b/packages/docs/docs/assets/edit.146d9acf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"edit.146d9acf.js","sources":["../../../heading/lib/edit.tsx"],"sourcesContent":["import {\n defineComponent,\n reactive,\n computed,\n ref,\n Ref,\n onMounted,\n watch,\n PropType,\n} from 'vue';\nimport {\n model,\n useActivation,\n SbToolbar,\n SbSelect,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n IHeadingData\n} from './util';\nimport { getDefaultData as getDefaultParagraphData } from '@schlechtenburg/paragraph';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-heading-edit',\n\n model,\n\n props: {\n blockId: { type: String, required: true },\n data: {\n type: (null as unknown) as PropType,\n default: getDefaultData,\n },\n onUpdate: { type: Function, default: () => {} },\n onAppendBlock: { type: Function, default: () => {} },\n onRemoveSelf: { type: Function, default: () => {} },\n onActivateNext: { type: Function, default: () => {} },\n onActivatePrevious: { type: Function, default: () => {} },\n },\n\n setup(props) {\n const localData = (reactive({\n value: props.data.value,\n align: props.data.align,\n level: props.data.level,\n focused: false,\n }) as unknown) as {\n value: string;\n align: string;\n level: number;\n focused: boolean;\n };\n\n const inputEl: Ref = ref(null);\n\n const { isActive, activate } = useActivation(props.blockId);\n\n const focusInput = () => {\n if (inputEl.value && isActive.value) {\n inputEl.value.focus();\n }\n };\n\n onMounted(() => {\n focusInput();\n if (inputEl.value) {\n inputEl.value.innerHTML = localData.value;\n }\n });\n\n watch(isActive, focusInput);\n\n watch(() => props.data, () => {\n localData.value = props.data.value;\n localData.align = props.data.align;\n localData.level = props.data.level;\n if (inputEl.value) {\n inputEl.value.innerHTML = localData.value;\n }\n });\n\n const onTextUpdate = ($event: Event) => {\n localData.value = ($event.target as HTMLElement).innerHTML;\n };\n\n const classes = computed(() => ({\n 'sb-heading': true,\n 'sb-heading_focused': localData.focused,\n [`sb-heading_align-${localData.align}`]: true,\n [`sb-heading_${localData.level}`]: true,\n }));\n\n const setLevel = ($event: Event) => {\n props.onUpdate({\n ...localData,\n level: parseInt(($event.target as HTMLSelectElement).value, 10),\n });\n };\n\n const setAlignment = ($event: Event) => {\n props.onUpdate({\n ...localData,\n align: ($event.target as HTMLSelectElement).value,\n });\n };\n\n const onFocus = () => {\n localData.focused = true;\n activate();\n };\n\n const onBlur = () => {\n localData.focused = false;\n props.onUpdate({\n value: localData.value,\n align: localData.align,\n level: localData.level,\n });\n };\n\n const onKeydown = ($event: KeyboardEvent) => {\n if ($event.key === 'Enter' && !$event.shiftKey) {\n const id = `${+(new Date())}`;\n props.onAppendBlock({\n id,\n name: 'sb-paragraph',\n data: getDefaultParagraphData(),\n });\n\n activate(id);\n\n $event.preventDefault();\n }\n };\n\n const onKeyup = ($event: KeyboardEvent) => {\n if ($event.key === 'Backspace' && localData.value === '') {\n props.onRemoveSelf();\n }\n\n const selection = window.getSelection();\n const node = selection?.focusNode;\n const childNodes = Array.from(inputEl?.value?.childNodes || []);\n const index = node ? childNodes.indexOf(node as ChildNode) : -1;\n if (node === inputEl.value || index === 0 || index === childNodes.length -1) {\n switch ($event.key) {\n case 'ArrowDown':\n props.onActivateNext();\n break;\n case 'ArrowUp':\n props.onActivatePrevious();\n break;\n }\n }\n };\n\n return () => (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

\n
\n );\n },\n});\n"],"names":["defineComponent","name","model","props","blockId","type","String","required","data","default","getDefaultData","onUpdate","Function","onAppendBlock","onRemoveSelf","onActivateNext","onActivatePrevious","setup","localData","reactive","value","align","level","focused","inputEl","ref","isActive","activate","useActivation","focusInput","focus","innerHTML","onTextUpdate","$event","target","classes","computed","setLevel","__assign","parseInt","setAlignment","onFocus","onBlur","onKeydown","key","shiftKey","id","Date","getDefaultParagraphData","preventDefault","onKeyup","selection","window","getSelection","node","focusNode","childNodes","Array","from","index","indexOf","length","onChange"],"mappings":"ueAwBA,MAAeA,EAAgB,CAC7BC,KAAM,kBAENC,MAAAA,EAEAC,MAAO,CACLC,QAAS,CAAEC,KAAMC,OAAQC,UAAU,GACnCC,KAAM,CACJH,KAAO,KACPI,QAASC,GAEXC,SAAU,CAAEN,KAAMO,SAAUH,QAAS,QACrCI,cAAe,CAAER,KAAMO,SAAUH,QAAS,QAC1CK,aAAc,CAAET,KAAMO,SAAUH,QAAS,QACzCM,eAAgB,CAAEV,KAAMO,SAAUH,QAAS,QAC3CO,mBAAoB,CAAEX,KAAMO,SAAUH,QAAS,SAGjDQ,MAAMd,SACEe,EAAaC,EAAS,CAC1BC,MAAOjB,EAAMK,KAAKY,MAClBC,MAAOlB,EAAMK,KAAKa,MAClBC,MAAOnB,EAAMK,KAAKc,MAClBC,SAAS,IAQLC,EAAiCC,EAAI,OAErCC,SAAEA,WAAUC,GAAaC,EAAczB,EAAMC,SAE7CyB,EAAa,KACbL,EAAQJ,OAASM,EAASN,SACpBA,MAAMU,YAIR,SAEJN,EAAQJ,UACFA,MAAMW,UAAYb,EAAUE,YAIlCM,EAAUG,MAEV,IAAM1B,EAAMK,OAAM,OACZY,MAAQjB,EAAMK,KAAKY,QACnBC,MAAQlB,EAAMK,KAAKa,QACnBC,MAAQnB,EAAMK,KAAKc,MACzBE,EAAQJ,UACFA,MAAMW,UAAYb,EAAUE,gBAIlCY,QACMZ,MAASa,EAAOC,OAAuBH,WAG7CI,EAAUC,GAAS,KAAO,eAChB,uBACQlB,EAAUK,SAC9B,oBAAmBL,EAAUG,UAAU,GACvC,cAAaH,EAAUI,UAAU,MAG/Be,QACE1B,SAAS2B,OACVpB,GADU,CAEbI,MAAOiB,SAAUN,EAAOC,OAA6Bd,MAAO,QAI1DoB,QACE7B,SAAS2B,OACVpB,GADU,CAEbG,MAAQY,EAAOC,OAA6Bd,UAI1CqB,EAAU,OACJlB,SAAU,OAIhBmB,EAAS,OACHnB,SAAU,IACdZ,SAAS,CACbS,MAAOF,EAAUE,MACjBC,MAAOH,EAAUG,MACjBC,MAAOJ,EAAUI,SAIfqB,SACe,UAAfV,EAAOW,MAAoBX,EAAOY,SAAU,OACxCC,EAAM,KAAI,IAAIC,OACdlC,cAAc,CAClBiC,GAAAA,EACA7C,KAAM,eACNO,KAAMwC,QAGCF,KAEFG,mBAILC,YACe,cAAfjB,EAAOW,KAA2C,KAApB1B,EAAUE,SACpCN,qBAGFqC,EAAYC,OAAOC,eACnBC,QAAOH,WAAWI,UAClBC,EAAaC,MAAMC,MAAKlC,0BAASJ,gBAAOoC,aAAc,IACtDG,EAAQL,EAAOE,EAAWI,QAAQN,SACpCA,IAAS9B,EAAQJ,OAAmB,IAAVuC,GAAeA,IAAUH,EAAWK,OAAQ,SAChE5B,EAAOW,SACR,cACG7B,2BAEH,YACGC,6BAMP,mBACOmB,EAAQf,oCAIZA,MAAOF,EAAUI,MACjBwC,SAAUzB,mCAGG,gCACA,gCACA,gCACA,gCACA,gCACA,sBAIbjB,MAAOF,EAAUG,MACjByC,SAAUtB,8HASR,wBACDhB,6BAEIQ"} \ No newline at end of file diff --git a/packages/docs/docs/assets/edit.1b0f33cf.js b/packages/docs/docs/assets/edit.1b0f33cf.js deleted file mode 100644 index 65a0aeb..0000000 --- a/packages/docs/docs/assets/edit.1b0f33cf.js +++ /dev/null @@ -1,2 +0,0 @@ -var e=Object.defineProperty,n=Object.prototype.hasOwnProperty,i=Object.getOwnPropertySymbols,t=Object.prototype.propertyIsEnumerable,r=(n,i,t)=>i in n?e(n,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[i]=t,l=(e,l)=>{for(var a in l||(l={}))n.call(l,a)&&r(e,a,l[a]);if(i)for(var a of i(l))t.call(l,a)&&r(e,a,l[a]);return e};import{d as a,m as o,g as c,u as d,r as h,w as s,c as p,a as u,S as f,b,e as v,f as m,h as y,i as U}from"./index.87211b72.js";/* empty css */var k=a({name:"sb-layout-edit",model:o,props:{onUpdate:{type:Function,default:()=>{}},data:{type:null,default:c}},setup(e){const{activate:n}=d(),i=h({orientation:e.data.orientation,children:[...e.data.children]});s((()=>e.data),(()=>{i.orientation=e.data.orientation,i.children=[...e.data.children]}));const t=p((()=>({"sb-layout":!0,[`sb-layout_${i.orientation}`]:!0}))),r=()=>{e.onUpdate({orientation:"vertical"===i.orientation?"horizontal":"vertical"})},a=t=>{i.children=[...i.children,t],e.onUpdate({children:[...i.children]}),n(t.id)},o=(t,r)=>{i.children=[...i.children.slice(0,t+1),r,...i.children.slice(t+1)],e.onUpdate({children:[...i.children]}),n(r.id)},c=t=>{i.children=[...i.children.slice(0,t),...i.children.slice(t+1)],e.onUpdate({children:[...i.children]});const r=Math.max(t-1,0);n(i.children[r].id)},k=e=>{const t=Math.max(Math.min(i.children.length-1,e),0);n(i.children[t].id)};return()=>u("div",{class:t.value},[u(f,null,{default:()=>[u(b,{type:"button",onClick:r},{default:()=>[i.orientation]})]}),...i.children.map(((n,t)=>u(v,m({key:n.id},{"data-order":t,block:n,onUpdate:t=>((n,t)=>{const r=i.children.indexOf(n);-1!==r&&e.onUpdate({children:[...i.children.slice(0,r),l(l({},n),t),...i.children.slice(r+1)]})})(n,t),onRemoveSelf:()=>c(t),onPrependBlock:e=>o(t-1,e),onAppendBlock:e=>o(t,e),onActivatePrevious:()=>k(t-1),onActivateNext:()=>k(t+1)}),{"context-toolbar":()=>u(y,{onMoveBackward:()=>(n=>{if(0===n)return;const t=i.children[n],r=i.children[n-1];i.children=[...i.children.slice(0,n-1),t,r,...i.children.slice(n+1)],e.onUpdate({children:[...i.children]})})(t),onMoveForward:()=>(n=>{if(n===i.children.length-1)return;const t=i.children[n],r=i.children[n+1];i.children=[...i.children.slice(0,n),r,t,...i.children.slice(n+2)],e.onUpdate({children:[...i.children]})})(t),onRemove:()=>c(t),orientation:i.orientation},null)}))),u(U,{onInsertBlock:a},null)])}});export default k; -//# sourceMappingURL=edit.1b0f33cf.js.map diff --git a/packages/docs/docs/assets/edit.1b0f33cf.js.map b/packages/docs/docs/assets/edit.1b0f33cf.js.map deleted file mode 100644 index ae1e57e..0000000 --- a/packages/docs/docs/assets/edit.1b0f33cf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edit.1b0f33cf.js","sources":["../../../layout/lib/edit.tsx"],"sourcesContent":["import {\n defineComponent,\n reactive,\n computed,\n watch,\n PropType,\n} from 'vue';\nimport {\n model,\n IBlockData,\n useActivation,\n\n SbBlock,\n SbButton,\n SbToolbar,\n SbBlockPlaceholder,\n SbBlockOrdering,\n} from '@schlechtenburg/core';\n\nimport {\n LayoutData,\n getDefaultData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-layout-edit',\n\n model,\n\n props: {\n onUpdate: { type: Function, default: () => {} },\n data: {\n type: (null as unknown) as PropType,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const { activate } = useActivation();\n\n const localData: LayoutData = reactive({\n orientation: props.data.orientation,\n children: [...props.data.children],\n });\n\n watch(() => props.data, () => {\n localData.orientation = props.data.orientation;\n localData.children = [...props.data.children];\n });\n\n const classes = computed(() => ({\n 'sb-layout': true,\n [`sb-layout_${localData.orientation}`]: true,\n }));\n\n const toggleOrientation = () => {\n props.onUpdate({\n orientation: localData.orientation === 'vertical' ? 'horizontal' : 'vertical',\n });\n };\n\n const onChildUpdate = (child: IBlockData, updated: IBlockData) => {\n const index = localData.children.indexOf(child);\n if (index === -1) {\n return;\n }\n props.onUpdate({\n children: [\n ...localData.children.slice(0, index),\n {\n ...child,\n ...updated,\n },\n ...localData.children.slice(index + 1),\n ],\n });\n };\n\n const appendBlock = (block: IBlockData) => {\n localData.children = [\n ...localData.children,\n block,\n ];\n props.onUpdate({ children: [...localData.children] });\n activate(block.id);\n };\n\n const insertBlock = (index: number, block: IBlockData) => {\n localData.children = [\n ...localData.children.slice(0, index + 1),\n block,\n ...localData.children.slice(index + 1),\n ];\n props.onUpdate({ children: [...localData.children] });\n activate(block.id);\n };\n\n const removeBlock = (index: number) => {\n localData.children = [\n ...localData.children.slice(0, index),\n ...localData.children.slice(index + 1),\n ];\n props.onUpdate({ children: [...localData.children] });\n\n const newActiveIndex = Math.max(index - 1, 0);\n activate(localData.children[newActiveIndex].id);\n };\n\n const activateBlock = (index: number) => {\n const safeIndex =\n Math.max(\n Math.min(\n localData.children.length - 1,\n index,\n ),\n 0,\n );\n activate(localData.children[safeIndex].id);\n };\n\n const moveBackward = (index: number) => {\n if (index === 0) {\n return;\n }\n\n const curr = localData.children[index];\n const prev = localData.children[index - 1];\n localData.children = [\n ...localData.children.slice(0, index - 1),\n curr,\n prev,\n ...localData.children.slice(index + 1),\n ];\n\n props.onUpdate({ children: [...localData.children] });\n };\n\n const moveForward = (index: number) => {\n if (index === localData.children.length - 1) {\n return;\n }\n\n const curr = localData.children[index];\n const next = localData.children[index + 1];\n localData.children = [\n ...localData.children.slice(0, index),\n next,\n curr,\n ...localData.children.slice(index + 2),\n ];\n\n props.onUpdate({ children: [...localData.children] });\n };\n\n return () => (\n
\n \n {localData.orientation}\n \n\n {...localData.children.map((child, index) => (\n ) => onChildUpdate(child, updated)}\n onRemoveSelf={() => removeBlock(index)}\n onPrependBlock={(block: IBlockData) => insertBlock(index - 1, block)}\n onAppendBlock={(block: IBlockData) => insertBlock(index, block)}\n onActivatePrevious={() => activateBlock(index - 1,)}\n onActivateNext={() => activateBlock(index + 1,)}\n >\n {{\n 'context-toolbar': () =>\n moveBackward(index)}\n onMoveForward={() => moveForward(index)}\n onRemove={() => removeBlock(index)}\n orientation={localData.orientation}\n />,\n }}\n \n ))}\n\n \n
\n );\n },\n});\n"],"names":["defineComponent","name","model","props","onUpdate","type","Function","default","data","getDefaultData","setup","activate","useActivation","localData","reactive","orientation","children","classes","computed","toggleOrientation","appendBlock","block","id","insertBlock","index","slice","removeBlock","newActiveIndex","Math","max","activateBlock","safeIndex","min","length","value","onClick","map","child","key","updated","indexOf","__assign","onChildUpdate","curr","prev","moveBackward","next","moveForward"],"mappings":"ueA0BA,MAAeA,EAAgB,CAC7BC,KAAM,iBAENC,MAAAA,EAEAC,MAAO,CACLC,SAAU,CAAEC,KAAMC,SAAUC,QAAS,QACrCC,KAAM,CACJH,KAAO,KACPE,QAASE,IAIbC,MAAMP,SACEQ,SAAEA,GAAaC,IAEfC,EAAwBC,EAAS,CACrCC,YAAaZ,EAAMK,KAAKO,YACxBC,SAAU,IAAIb,EAAMK,KAAKQ,eAGrB,IAAMb,EAAMK,OAAM,OACZO,YAAcZ,EAAMK,KAAKO,cACzBC,SAAW,IAAIb,EAAMK,KAAKQ,mBAGhCC,EAAUC,GAAS,KAAO,cACjB,GACX,aAAYL,EAAUE,gBAAgB,MAGpCI,EAAoB,OAClBf,SAAS,CACbW,YAAuC,aAA1BF,EAAUE,YAA6B,aAAe,cAqBjEK,QACMJ,SAAW,IAChBH,EAAUG,SACbK,KAEIjB,SAAS,CAAEY,SAAU,IAAIH,EAAUG,cAChCK,EAAMC,KAGXC,EAAc,CAACC,EAAeH,OACxBL,SAAW,IAChBH,EAAUG,SAASS,MAAM,EAAGD,EAAQ,GACvCH,KACGR,EAAUG,SAASS,MAAMD,EAAQ,MAEhCpB,SAAS,CAAEY,SAAU,IAAIH,EAAUG,cAChCK,EAAMC,KAGXI,QACMV,SAAW,IAChBH,EAAUG,SAASS,MAAM,EAAGD,MAC5BX,EAAUG,SAASS,MAAMD,EAAQ,MAEhCpB,SAAS,CAAEY,SAAU,IAAIH,EAAUG,kBAEnCW,EAAiBC,KAAKC,IAAIL,EAAQ,EAAG,KAClCX,EAAUG,SAASW,GAAgBL,KAGxCQ,YACEC,EACJH,KAAKC,IACFD,KAAKI,IACHnB,EAAUG,SAASiB,OAAS,EAC5BT,GAEH,KAEKX,EAAUG,SAASe,GAAWT,WAqClC,mBACOL,EAAQiB,oCAIZ7B,KAAM,SACN8B,QAAShB,iBAEXN,EAAUE,qBAGVF,EAAUG,SAASoB,KAAI,CAACC,EAAOb,WAEzBc,IAAKD,EAAMf,kBACLE,QACLa,cA5GO,EAACA,EAAuBE,WACtCf,EAAQX,EAAUG,SAASwB,QAAQH,QACrCb,KAGEpB,SAAS,CACbY,SAAU,IACLH,EAAUG,SAASS,MAAM,EAAGD,GAC/BiB,OACKJ,GACAE,MAEF1B,EAAUG,SAASS,MAAMD,EAAQ,OAiGKkB,CAAcL,EAAOE,gBAC9C,IAAMb,EAAYF,qBACWD,EAAYC,EAAQ,EAAGH,oBACxBE,EAAYC,EAAOH,sBACzC,IAAMS,EAAcN,EAAQ,kBAChC,IAAMM,EAAcN,EAAQ,wBAGvB,wBAEC,IA5DRA,QACN,IAAVA,eAIEmB,EAAO9B,EAAUG,SAASQ,GAC1BoB,EAAO/B,EAAUG,SAASQ,EAAQ,KAC9BR,SAAW,IAChBH,EAAUG,SAASS,MAAM,EAAGD,EAAQ,GACvCmB,EACAC,KACG/B,EAAUG,SAASS,MAAMD,EAAQ,MAGhCpB,SAAS,CAAEY,SAAU,IAAIH,EAAUG,aA8CP6B,CAAarB,iBACpB,IA5CRA,QACfA,IAAUX,EAAUG,SAASiB,OAAS,eAIpCU,EAAO9B,EAAUG,SAASQ,GAC1BsB,EAAOjC,EAAUG,SAASQ,EAAQ,KAC9BR,SAAW,IAChBH,EAAUG,SAASS,MAAM,EAAGD,GAC/BsB,EACAH,KACG9B,EAAUG,SAASS,MAAMD,EAAQ,MAGhCpB,SAAS,CAAEY,SAAU,IAAIH,EAAUG,aA8BR+B,CAAYvB,YACvB,IAAME,EAAYF,eACfX,EAAUE,0CAMEK"} diff --git a/packages/docs/docs/assets/edit.3e0c191e.js b/packages/docs/docs/assets/edit.3e0c191e.js deleted file mode 100644 index 3b8758e..0000000 --- a/packages/docs/docs/assets/edit.3e0c191e.js +++ /dev/null @@ -1,2 +0,0 @@ -export default{}; -//# sourceMappingURL=edit.3e0c191e.js.map diff --git a/packages/docs/docs/assets/edit.3e0c191e.js.map b/packages/docs/docs/assets/edit.3e0c191e.js.map deleted file mode 100644 index 2810705..0000000 --- a/packages/docs/docs/assets/edit.3e0c191e.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edit.3e0c191e.js","sources":["../../../heading/lib/edit.tsx"],"sourcesContent":["export default {};\n"],"names":[],"mappings":"cAAe"} \ No newline at end of file diff --git a/packages/docs/docs/assets/edit.a95f3ab1.js b/packages/docs/docs/assets/edit.849203b1.js similarity index 89% rename from packages/docs/docs/assets/edit.a95f3ab1.js rename to packages/docs/docs/assets/edit.849203b1.js index fc1d839..f6d958c 100644 --- a/packages/docs/docs/assets/edit.a95f3ab1.js +++ b/packages/docs/docs/assets/edit.849203b1.js @@ -1,2 +1,2 @@ -var a=Object.defineProperty,e=Object.prototype.hasOwnProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.propertyIsEnumerable,r=(e,t,l)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,n=(a,n)=>{for(var s in n||(n={}))e.call(n,s)&&r(a,s,n[s]);if(t)for(var s of t(n))l.call(n,s)&&r(a,s,n[s]);return a};import{d as s,m as o,p as i,r as d,k as c,w as u,a as p,S as f,b as v,n as m,F as b,e as y}from"./index.87211b72.js";/* empty css */var g=s({name:"sb-image-edit",model:o,props:{onUpdate:{type:Function,default:()=>{}},data:{type:null,default:i}},setup(a){const e=d({src:a.data.src,alt:a.data.alt,description:a.data.description}),t=c(null);u((()=>a.data),(()=>{e.src=a.data.src,e.alt=a.data.alt,e.description=a.data.description}));const l=()=>{t.value&&t.value.click()},r=()=>{if(t.value&&t.value.files&&t.value.files.length){const e=new FileReader;e.addEventListener("load",(()=>{var t;const l=null==(t=null==e?void 0:e.result)?void 0:t.toString();if(!l)throw new Error("Couldn't load image src");a.onUpdate({src:l,alt:a.data.alt,description:a.data.description})})),e.readAsDataURL(t.value.files[0])}};return()=>p("figure",{class:"sb-image"},[p(f,null,{default:()=>[e.src?p(v,{onClick:l},{default:()=>[m("Select Image")]}):null,p("input",{type:"file",ref:t,style:"display: none;",onInput:r},null)]}),e.src?p(b,null,[p("img",{src:e.src,alt:e.alt,class:"sb-image__content"},null),p(y,{block:e.description,onUpdate:e=>{return t=e,void a.onUpdate(n(n({},a.data),{description:t}));var t}},null)]):p(v,{onClick:l},{default:()=>[m("Select Image")]})])}});export default g; -//# sourceMappingURL=edit.a95f3ab1.js.map +var a=Object.defineProperty,e=Object.prototype.hasOwnProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.propertyIsEnumerable,r=(e,t,l)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,n=(a,n)=>{for(var s in n||(n={}))e.call(n,s)&&r(a,s,n[s]);if(t)for(var s of t(n))l.call(n,s)&&r(a,s,n[s]);return a};import{d as s,m as o,s as i,r as d,k as c,w as u,a as p,S as f,b as v,n as m,F as b,e as y}from"./index.2f19b693.js";/* empty css */var g=s({name:"sb-image-edit",model:o,props:{onUpdate:{type:Function,default:()=>{}},data:{type:null,default:i}},setup(a){const e=d({src:a.data.src,alt:a.data.alt,description:a.data.description}),t=c(null);u((()=>a.data),(()=>{e.src=a.data.src,e.alt=a.data.alt,e.description=a.data.description}));const l=()=>{t.value&&t.value.click()},r=()=>{if(t.value&&t.value.files&&t.value.files.length){const e=new FileReader;e.addEventListener("load",(()=>{var t;const l=null==(t=null==e?void 0:e.result)?void 0:t.toString();if(!l)throw new Error("Couldn't load image src");a.onUpdate({src:l,alt:a.data.alt,description:a.data.description})})),e.readAsDataURL(t.value.files[0])}};return()=>p("figure",{class:"sb-image"},[p(f,null,{default:()=>[e.src?p(v,{onClick:l},{default:()=>[m("Select Image")]}):null,p("input",{type:"file",ref:t,style:"display: none;",onInput:r},null)]}),e.src?p(b,null,[p("img",{src:e.src,alt:e.alt,class:"sb-image__content"},null),p(y,{block:e.description,onUpdate:e=>{return t=e,void a.onUpdate(n(n({},a.data),{description:t}));var t}},null)]):p(v,{onClick:l},{default:()=>[m("Select Image")]})])}});export default g; +//# sourceMappingURL=edit.849203b1.js.map diff --git a/packages/docs/docs/assets/edit.849203b1.js.map b/packages/docs/docs/assets/edit.849203b1.js.map new file mode 100644 index 0000000..80063ca --- /dev/null +++ b/packages/docs/docs/assets/edit.849203b1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"edit.849203b1.js","sources":["../../../image/lib/edit.tsx"],"sourcesContent":["import {\n defineComponent,\n reactive,\n ref,\n Ref,\n watch,\n PropType,\n} from 'vue';\nimport {\n model,\n SbToolbar,\n SbButton,\n SbBlock,\n IBlockData,\n} from '@schlechtenburg/core';\nimport { IParagraphData } from '@schlechtenburg/paragraph';\nimport {\n getDefaultData,\n IImageData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-image-edit',\n\n model,\n\n props: {\n onUpdate: { type: Function, default: () => {} },\n data: {\n type: (null as unknown) as PropType,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const localData = reactive({\n src: props.data.src,\n alt: props.data.alt,\n description: props.data.description,\n });\n\n const fileInput: Ref = ref(null);\n\n watch(() => props.data, () => {\n localData.src = props.data.src;\n localData.alt = props.data.alt;\n localData.description = props.data.description;\n });\n\n const selectImage = () => {\n if (fileInput.value) {\n fileInput.value.click();\n }\n };\n\n const onImageSelect = () => {\n if (fileInput.value && fileInput.value.files && fileInput.value.files.length) {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n const src = reader?.result?.toString();\n if (!src) {\n throw new Error('Couldn\\'t load image src');\n }\n\n props.onUpdate({\n src,\n alt: props.data.alt,\n description: props.data.description,\n });\n });\n\n reader.readAsDataURL(fileInput.value.files[0]);\n }\n };\n\n const onDescriptionUpdate = (description: IBlockData) => {\n props.onUpdate({\n ...props.data,\n description,\n });\n };\n\n return () => (\n
\n \n {localData.src\n ? Select Image\n : null}\n \n \n {localData.src\n ? <>\n \n ) => onDescriptionUpdate(updated)}\n />\n \n : Select Image\n }\n
\n );\n },\n});\n"],"names":["defineComponent","name","model","props","onUpdate","type","Function","default","data","getDefaultData","setup","localData","reactive","src","alt","description","fileInput","ref","selectImage","value","click","onImageSelect","files","length","reader","FileReader","addEventListener","result","toString","Error","readAsDataURL","onClick","onDescriptionUpdate","updated","__assign"],"mappings":"8dAuBA,MAAeA,EAAgB,CAC7BC,KAAM,gBAENC,MAAAA,EAEAC,MAAO,CACLC,SAAU,CAAEC,KAAMC,SAAUC,QAAS,QACrCC,KAAM,CACJH,KAAO,KACPE,QAASE,IAIbC,MAAMP,SACEQ,EAAYC,EAAS,CACzBC,IAAKV,EAAMK,KAAKK,IAChBC,IAAKX,EAAMK,KAAKM,IAChBC,YAAaZ,EAAMK,KAAKO,cAGpBC,EAAwCC,EAAI,SAE5C,IAAMd,EAAMK,OAAM,OACZK,IAAMV,EAAMK,KAAKK,MACjBC,IAAMX,EAAMK,KAAKM,MACjBC,YAAcZ,EAAMK,KAAKO,qBAG/BG,EAAc,KACdF,EAAUG,SACFA,MAAMC,SAIdC,EAAgB,QAChBL,EAAUG,OAASH,EAAUG,MAAMG,OAASN,EAAUG,MAAMG,MAAMC,OAAQ,OACtEC,EAAS,IAAIC,aACZC,iBAAiB,QAAQ,iBACxBb,EAAMW,0BAAQG,iBAAQC,eACvBf,QACG,IAAIgB,MAAM,6BAGZzB,SAAS,CACbS,IAAAA,EACAC,IAAKX,EAAMK,KAAKM,IAChBC,YAAaZ,EAAMK,KAAKO,mBAIrBe,cAAcd,EAAUG,MAAMG,MAAM,YAWxC,sBACS,oCAETX,EAAUE,SACSkB,QAASb,sCACzB,qBAEG,WACAF,QACC,yBACGK,YAGZV,EAAUE,2BAGEF,EAAUE,QACVF,EAAUG,UACT,sCAGCH,EAAUI,yBACkCiB,SAAoBC,SA5B3E7B,SAAS8B,OACV/B,EAAMK,MADI,CAEbO,YAAAA,KAHyBA,qBAgCLgB,QAASb"} \ No newline at end of file diff --git a/packages/docs/docs/assets/edit.a95f3ab1.js.map b/packages/docs/docs/assets/edit.a95f3ab1.js.map deleted file mode 100644 index 4f95970..0000000 --- a/packages/docs/docs/assets/edit.a95f3ab1.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edit.a95f3ab1.js","sources":["../../../image/lib/edit.tsx"],"sourcesContent":["import {\n defineComponent,\n reactive,\n ref,\n Ref,\n watch,\n PropType,\n} from 'vue';\nimport {\n model,\n SbToolbar,\n SbButton,\n SbBlock,\n IBlockData,\n} from '@schlechtenburg/core';\nimport { ParagraphData } from '@schlechtenburg/paragraph';\nimport {\n getDefaultData,\n ImageData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-image-edit',\n\n model,\n\n props: {\n onUpdate: { type: Function, default: () => {} },\n data: {\n type: (null as unknown) as PropType,\n default: getDefaultData,\n },\n },\n\n setup(props) {\n const localData = reactive({\n src: props.data.src,\n alt: props.data.alt,\n description: props.data.description,\n });\n\n const fileInput: Ref = ref(null);\n\n watch(() => props.data, () => {\n localData.src = props.data.src;\n localData.alt = props.data.alt;\n localData.description = props.data.description;\n });\n\n const selectImage = () => {\n if (fileInput.value) {\n fileInput.value.click();\n }\n };\n\n const onImageSelect = () => {\n if (fileInput.value && fileInput.value.files && fileInput.value.files.length) {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n const src = reader?.result?.toString();\n if (!src) {\n throw new Error('Couldn\\'t load image src');\n }\n\n props.onUpdate({\n src,\n alt: props.data.alt,\n description: props.data.description,\n });\n });\n\n reader.readAsDataURL(fileInput.value.files[0]);\n }\n };\n\n const onDescriptionUpdate = (description: IBlockData) => {\n props.onUpdate({\n ...props.data,\n description,\n });\n };\n\n return () => (\n
\n \n {localData.src\n ? Select Image\n : null}\n \n \n {localData.src\n ? <>\n \n ) => onDescriptionUpdate(updated)}\n />\n \n : Select Image\n }\n
\n );\n },\n});\n"],"names":["defineComponent","name","model","props","onUpdate","type","Function","default","data","getDefaultData","setup","localData","reactive","src","alt","description","fileInput","ref","selectImage","value","click","onImageSelect","files","length","reader","FileReader","addEventListener","result","toString","Error","readAsDataURL","onClick","onDescriptionUpdate","updated","__assign"],"mappings":"8dAuBA,MAAeA,EAAgB,CAC7BC,KAAM,gBAENC,MAAAA,EAEAC,MAAO,CACLC,SAAU,CAAEC,KAAMC,SAAUC,QAAS,QACrCC,KAAM,CACJH,KAAO,KACPE,QAASE,IAIbC,MAAMP,SACEQ,EAAYC,EAAS,CACzBC,IAAKV,EAAMK,KAAKK,IAChBC,IAAKX,EAAMK,KAAKM,IAChBC,YAAaZ,EAAMK,KAAKO,cAGpBC,EAAwCC,EAAI,SAE5C,IAAMd,EAAMK,OAAM,OACZK,IAAMV,EAAMK,KAAKK,MACjBC,IAAMX,EAAMK,KAAKM,MACjBC,YAAcZ,EAAMK,KAAKO,qBAG/BG,EAAc,KACdF,EAAUG,SACFA,MAAMC,SAIdC,EAAgB,QAChBL,EAAUG,OAASH,EAAUG,MAAMG,OAASN,EAAUG,MAAMG,MAAMC,OAAQ,OACtEC,EAAS,IAAIC,aACZC,iBAAiB,QAAQ,iBACxBb,EAAMW,0BAAQG,iBAAQC,eACvBf,QACG,IAAIgB,MAAM,6BAGZzB,SAAS,CACbS,IAAAA,EACAC,IAAKX,EAAMK,KAAKM,IAChBC,YAAaZ,EAAMK,KAAKO,mBAIrBe,cAAcd,EAAUG,MAAMG,MAAM,YAWxC,sBACS,oCAETX,EAAUE,SACSkB,QAASb,sCACzB,qBAEG,WACAF,QACC,yBACGK,YAGZV,EAAUE,2BAGEF,EAAUE,QACVF,EAAUG,UACT,sCAGCH,EAAUI,yBACgCiB,SAAoBC,SA5BzE7B,SAAS8B,OACV/B,EAAMK,MADI,CAEbO,YAAAA,KAHyBA,qBAgCLgB,QAASb"} diff --git a/packages/docs/docs/assets/edit.eff76979.js b/packages/docs/docs/assets/edit.e32652b3.js similarity index 91% rename from packages/docs/docs/assets/edit.eff76979.js rename to packages/docs/docs/assets/edit.e32652b3.js index 0e4aab6..1d93bfb 100644 --- a/packages/docs/docs/assets/edit.eff76979.js +++ b/packages/docs/docs/assets/edit.e32652b3.js @@ -1,2 +1,2 @@ -import{d as a,m as e,j as n,r as l,k as t,u as o,o as u,w as i,c as s,a as r,S as d,l as p,n as v}from"./index.87211b72.js";/* empty css */var c=a({name:"sb-paragraph-edit",model:e,props:{blockId:{type:String,required:!0},data:{type:null,default:n},onUpdate:{type:Function,default:()=>{}},onAppendBlock:{type:Function,default:()=>{}},onRemoveSelf:{type:Function,default:()=>{}},onActivateNext:{type:Function,default:()=>{}},onActivatePrevious:{type:Function,default:()=>{}}},setup(a){const e=l({value:a.data.value,align:a.data.align,focused:!1}),c=t(null),{isActive:f,activate:g}=o(a.blockId),y=()=>{c.value&&f.value&&c.value.focus()};u((()=>{y(),c.value&&(c.value.innerHTML=e.value)})),i(f,y),i((()=>a.data),(()=>{e.value=a.data.value,e.align=a.data.align,c.value&&(c.value.innerHTML=e.value)}));const b=a=>{e.value=a.target.innerHTML},h=s((()=>({"sb-paragraph":!0,"sb-paragraph_focused":e.focused,[`sb-paragraph_align-${e.align}`]:!0}))),k=n=>{a.onUpdate({value:e.value,align:n.target.value})},m=()=>{e.focused=!0,g()},A=()=>{e.focused=!1,a.onUpdate({value:e.value,align:e.align})},w=e=>{if("Enter"===e.key&&!e.shiftKey){const l=""+ +new Date;a.onAppendBlock({id:l,name:"sb-paragraph",data:n()}),g(l),e.preventDefault()}},F=n=>{var l;"Backspace"===n.key&&""===e.value&&a.onRemoveSelf();const t=window.getSelection(),o=null==t?void 0:t.focusNode,u=Array.from((null==(l=null==c?void 0:c.value)?void 0:l.childNodes)||[]),i=o?u.indexOf(o):-1;if(o===c.value||0===i||i===u.length-1)switch(n.key){case"ArrowDown":a.onActivateNext();break;case"ArrowUp":a.onActivatePrevious()}};return()=>r("div",{class:h.value},[r(d,null,{default:()=>[r(p,{value:e.align,onChange:k},{default:()=>[r("option",null,[v("left")]),r("option",null,[v("center")]),r("option",null,[v("right")])]})]}),r("p",{class:"sb-paragraph__input",ref:c,contenteditable:!0,onInput:b,onFocus:m,onBlur:A,onKeydown:w,onKeyup:F},null)])}});export default c; -//# sourceMappingURL=edit.eff76979.js.map +import{d as a,m as e,p as n,r as l,k as t,u as o,o as u,w as i,c as s,a as r,S as d,l as p,n as v}from"./index.2f19b693.js";/* empty css */var c=a({name:"sb-paragraph-edit",model:e,props:{blockId:{type:String,required:!0},data:{type:null,default:n},onUpdate:{type:Function,default:()=>{}},onAppendBlock:{type:Function,default:()=>{}},onRemoveSelf:{type:Function,default:()=>{}},onActivateNext:{type:Function,default:()=>{}},onActivatePrevious:{type:Function,default:()=>{}}},setup(a){const e=l({value:a.data.value,align:a.data.align,focused:!1}),c=t(null),{isActive:f,activate:g}=o(a.blockId),y=()=>{c.value&&f.value&&c.value.focus()};u((()=>{y(),c.value&&(c.value.innerHTML=e.value)})),i(f,y),i((()=>a.data),(()=>{e.value=a.data.value,e.align=a.data.align,c.value&&(c.value.innerHTML=e.value)}));const b=a=>{e.value=a.target.innerHTML},h=s((()=>({"sb-paragraph":!0,"sb-paragraph_focused":e.focused,[`sb-paragraph_align-${e.align}`]:!0}))),k=n=>{a.onUpdate({value:e.value,align:n.target.value})},m=()=>{e.focused=!0,g()},A=()=>{e.focused=!1,a.onUpdate({value:e.value,align:e.align})},w=e=>{if("Enter"===e.key&&!e.shiftKey){const l=""+ +new Date;a.onAppendBlock({id:l,name:"sb-paragraph",data:n()}),g(l),e.preventDefault()}},F=n=>{var l;"Backspace"===n.key&&""===e.value&&a.onRemoveSelf();const t=window.getSelection(),o=null==t?void 0:t.focusNode,u=Array.from((null==(l=null==c?void 0:c.value)?void 0:l.childNodes)||[]),i=o?u.indexOf(o):-1;if(o===c.value||0===i||i===u.length-1)switch(n.key){case"ArrowDown":a.onActivateNext();break;case"ArrowUp":a.onActivatePrevious()}};return()=>r("div",{class:h.value},[r(d,null,{default:()=>[r(p,{value:e.align,onChange:k},{default:()=>[r("option",null,[v("left")]),r("option",null,[v("center")]),r("option",null,[v("right")])]})]}),r("p",{class:"sb-paragraph__input",ref:c,contenteditable:!0,onInput:b,onFocus:m,onBlur:A,onKeydown:w,onKeyup:F},null)])}});export default c; +//# sourceMappingURL=edit.e32652b3.js.map diff --git a/packages/docs/docs/assets/edit.e32652b3.js.map b/packages/docs/docs/assets/edit.e32652b3.js.map new file mode 100644 index 0000000..e817bfb --- /dev/null +++ b/packages/docs/docs/assets/edit.e32652b3.js.map @@ -0,0 +1 @@ +{"version":3,"file":"edit.e32652b3.js","sources":["../../../paragraph/lib/edit.tsx"],"sourcesContent":["import {\n defineComponent,\n reactive,\n computed,\n ref,\n Ref,\n onMounted,\n watch,\n PropType,\n} from 'vue';\nimport {\n model,\n useActivation,\n SbToolbar,\n SbSelect,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n IParagraphData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-paragraph-edit',\n\n model,\n\n props: {\n blockId: { type: String, required: true },\n data: {\n type: (null as unknown) as PropType,\n default: getDefaultData,\n },\n onUpdate: { type: Function, default: () => {} },\n onAppendBlock: { type: Function, default: () => {} },\n onRemoveSelf: { type: Function, default: () => {} },\n onActivateNext: { type: Function, default: () => {} },\n onActivatePrevious: { type: Function, default: () => {} },\n },\n\n setup(props) {\n const localData = (reactive({\n value: props.data.value,\n align: props.data.align,\n focused: false,\n }) as unknown) as {\n value: string;\n align: string;\n focused: boolean;\n };\n\n const inputEl: Ref = ref(null);\n\n const { isActive, activate } = useActivation(props.blockId);\n\n const focusInput = () => {\n if (inputEl.value && isActive.value) {\n inputEl.value.focus();\n }\n };\n\n onMounted(() => {\n focusInput();\n if (inputEl.value) {\n inputEl.value.innerHTML = localData.value;\n }\n });\n\n watch(isActive, focusInput);\n\n watch(() => props.data, () => {\n localData.value = props.data.value;\n localData.align = props.data.align;\n if (inputEl.value) {\n inputEl.value.innerHTML = localData.value;\n }\n });\n\n const onTextUpdate = ($event: Event) => {\n localData.value = ($event.target as HTMLElement).innerHTML;\n };\n\n const classes = computed(() => ({\n 'sb-paragraph': true,\n 'sb-paragraph_focused': localData.focused,\n [`sb-paragraph_align-${localData.align}`]: true,\n }));\n\n const setAlignment = ($event: Event) => {\n props.onUpdate({\n value: localData.value,\n align: ($event.target as HTMLSelectElement).value,\n });\n };\n\n const onFocus = () => {\n localData.focused = true;\n activate();\n };\n\n const onBlur = () => {\n localData.focused = false;\n props.onUpdate({\n value: localData.value,\n align: localData.align,\n });\n };\n\n const onKeydown = ($event: KeyboardEvent) => {\n if ($event.key === 'Enter' && !$event.shiftKey) {\n const id = `${+(new Date())}`;\n props.onAppendBlock({\n id,\n name: 'sb-paragraph',\n data: getDefaultData(),\n });\n\n activate(id);\n\n $event.preventDefault();\n }\n };\n\n const onKeyup = ($event: KeyboardEvent) => {\n if ($event.key === 'Backspace' && localData.value === '') {\n props.onRemoveSelf();\n }\n\n const selection = window.getSelection();\n const node = selection?.focusNode;\n const childNodes = Array.from(inputEl?.value?.childNodes || []);\n const index = node ? childNodes.indexOf(node as ChildNode) : -1;\n if (node === inputEl.value || index === 0 || index === childNodes.length -1) {\n switch ($event.key) {\n case 'ArrowDown':\n props.onActivateNext();\n break;\n case 'ArrowUp':\n props.onActivatePrevious();\n break;\n }\n }\n };\n\n return () => (\n
\n \n \n \n \n \n \n \n

\n
\n );\n },\n});\n"],"names":["defineComponent","name","model","props","blockId","type","String","required","data","default","getDefaultData","onUpdate","Function","onAppendBlock","onRemoveSelf","onActivateNext","onActivatePrevious","setup","localData","reactive","value","align","focused","inputEl","ref","isActive","activate","useActivation","focusInput","focus","innerHTML","onTextUpdate","$event","target","classes","computed","setAlignment","onFocus","onBlur","onKeydown","key","shiftKey","id","Date","preventDefault","onKeyup","selection","window","getSelection","node","focusNode","childNodes","Array","from","index","indexOf","length","onChange"],"mappings":"wJAuBA,MAAeA,EAAgB,CAC7BC,KAAM,oBAENC,MAAAA,EAEAC,MAAO,CACLC,QAAS,CAAEC,KAAMC,OAAQC,UAAU,GACnCC,KAAM,CACJH,KAAO,KACPI,QAASC,GAEXC,SAAU,CAAEN,KAAMO,SAAUH,QAAS,QACrCI,cAAe,CAAER,KAAMO,SAAUH,QAAS,QAC1CK,aAAc,CAAET,KAAMO,SAAUH,QAAS,QACzCM,eAAgB,CAAEV,KAAMO,SAAUH,QAAS,QAC3CO,mBAAoB,CAAEX,KAAMO,SAAUH,QAAS,SAGjDQ,MAAMd,SACEe,EAAaC,EAAS,CAC1BC,MAAOjB,EAAMK,KAAKY,MAClBC,MAAOlB,EAAMK,KAAKa,MAClBC,SAAS,IAOLC,EAAiCC,EAAI,OAErCC,SAAEA,WAAUC,GAAaC,EAAcxB,EAAMC,SAE7CwB,EAAa,KACbL,EAAQH,OAASK,EAASL,SACpBA,MAAMS,YAIR,SAEJN,EAAQH,UACFA,MAAMU,UAAYZ,EAAUE,YAIlCK,EAAUG,MAEV,IAAMzB,EAAMK,OAAM,OACZY,MAAQjB,EAAMK,KAAKY,QACnBC,MAAQlB,EAAMK,KAAKa,MACzBE,EAAQH,UACFA,MAAMU,UAAYZ,EAAUE,gBAIlCW,QACMX,MAASY,EAAOC,OAAuBH,WAG7CI,EAAUC,GAAS,KAAO,iBACd,yBACQjB,EAAUI,SAChC,sBAAqBJ,EAAUG,UAAU,MAGvCe,QACEzB,SAAS,CACbS,MAAOF,EAAUE,MACjBC,MAAQW,EAAOC,OAA6Bb,SAI1CiB,EAAU,OACJf,SAAU,OAIhBgB,EAAS,OACHhB,SAAU,IACdX,SAAS,CACbS,MAAOF,EAAUE,MACjBC,MAAOH,EAAUG,SAIfkB,SACe,UAAfP,EAAOQ,MAAoBR,EAAOS,SAAU,OACxCC,EAAM,KAAI,IAAIC,OACd9B,cAAc,CAClB6B,GAAAA,EACAzC,KAAM,eACNO,KAAME,QAGCgC,KAEFE,mBAILC,YACe,cAAfb,EAAOQ,KAA2C,KAApBtB,EAAUE,SACpCN,qBAGFgC,EAAYC,OAAOC,eACnBC,QAAOH,WAAWI,UAClBC,EAAaC,MAAMC,MAAK9B,0BAASH,gBAAO+B,aAAc,IACtDG,EAAQL,EAAOE,EAAWI,QAAQN,SACpCA,IAAS1B,EAAQH,OAAmB,IAAVkC,GAAeA,IAAUH,EAAWK,OAAQ,SAChExB,EAAOQ,SACR,cACGzB,2BAEH,YACGC,6BAMP,mBACOkB,EAAQd,oCAIZA,MAAOF,EAAUG,MACjBoC,SAAUrB,8HASR,0BACDb,6BAEIQ"} \ No newline at end of file diff --git a/packages/docs/docs/assets/edit.eff76979.js.map b/packages/docs/docs/assets/edit.eff76979.js.map deleted file mode 100644 index b10ade1..0000000 --- a/packages/docs/docs/assets/edit.eff76979.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"edit.eff76979.js","sources":["../../../paragraph/lib/edit.tsx"],"sourcesContent":["import {\n defineComponent,\n reactive,\n computed,\n ref,\n Ref,\n onMounted,\n watch,\n PropType,\n} from 'vue';\nimport {\n model,\n useActivation,\n SbToolbar,\n SbSelect,\n} from '@schlechtenburg/core';\nimport {\n getDefaultData,\n ParagraphData,\n} from './util';\n\nimport './style.scss';\n\nexport default defineComponent({\n name: 'sb-paragraph-edit',\n\n model,\n\n props: {\n blockId: { type: String, required: true },\n data: {\n type: (null as unknown) as PropType,\n default: getDefaultData,\n },\n onUpdate: { type: Function, default: () => {} },\n onAppendBlock: { type: Function, default: () => {} },\n onRemoveSelf: { type: Function, default: () => {} },\n onActivateNext: { type: Function, default: () => {} },\n onActivatePrevious: { type: Function, default: () => {} },\n },\n\n setup(props) {\n const localData = (reactive({\n value: props.data.value,\n align: props.data.align,\n focused: false,\n }) as unknown) as {\n value: string;\n align: string;\n focused: boolean;\n };\n\n const inputEl: Ref = ref(null);\n\n const { isActive, activate } = useActivation(props.blockId);\n\n const focusInput = () => {\n if (inputEl.value && isActive.value) {\n inputEl.value.focus();\n }\n };\n\n onMounted(() => {\n focusInput();\n if (inputEl.value) {\n inputEl.value.innerHTML = localData.value;\n }\n });\n\n watch(isActive, focusInput);\n\n watch(() => props.data, () => {\n localData.value = props.data.value;\n localData.align = props.data.align;\n if (inputEl.value) {\n inputEl.value.innerHTML = localData.value;\n }\n });\n\n const onTextUpdate = ($event: Event) => {\n localData.value = ($event.target as HTMLElement).innerHTML;\n };\n\n const classes = computed(() => ({\n 'sb-paragraph': true,\n 'sb-paragraph_focused': localData.focused,\n [`sb-paragraph_align-${localData.align}`]: true,\n }));\n\n const setAlignment = ($event: Event) => {\n props.onUpdate({\n value: localData.value,\n align: ($event.target as HTMLSelectElement).value,\n });\n };\n\n const onFocus = () => {\n localData.focused = true;\n activate();\n };\n\n const onBlur = () => {\n localData.focused = false;\n props.onUpdate({\n value: localData.value,\n align: localData.align,\n });\n };\n\n const onKeydown = ($event: KeyboardEvent) => {\n if ($event.key === 'Enter' && !$event.shiftKey) {\n const id = `${+(new Date())}`;\n props.onAppendBlock({\n id,\n name: 'sb-paragraph',\n data: getDefaultData(),\n });\n\n activate(id);\n\n $event.preventDefault();\n }\n };\n\n const onKeyup = ($event: KeyboardEvent) => {\n if ($event.key === 'Backspace' && localData.value === '') {\n props.onRemoveSelf();\n }\n\n const selection = window.getSelection();\n const node = selection?.focusNode;\n const childNodes = Array.from(inputEl?.value?.childNodes || []);\n const index = node ? childNodes.indexOf(node as ChildNode) : -1;\n if (node === inputEl.value || index === 0 || index === childNodes.length -1) {\n switch ($event.key) {\n case 'ArrowDown':\n props.onActivateNext();\n break;\n case 'ArrowUp':\n props.onActivatePrevious();\n break;\n }\n }\n };\n\n return () => (\n
\n \n \n \n \n \n \n \n

\n
\n );\n },\n});\n"],"names":["defineComponent","name","model","props","blockId","type","String","required","data","default","getDefaultData","onUpdate","Function","onAppendBlock","onRemoveSelf","onActivateNext","onActivatePrevious","setup","localData","reactive","value","align","focused","inputEl","ref","isActive","activate","useActivation","focusInput","focus","innerHTML","onTextUpdate","$event","target","classes","computed","setAlignment","onFocus","onBlur","onKeydown","key","shiftKey","id","Date","preventDefault","onKeyup","selection","window","getSelection","node","focusNode","childNodes","Array","from","index","indexOf","length","onChange"],"mappings":"wJAuBA,MAAeA,EAAgB,CAC7BC,KAAM,oBAENC,MAAAA,EAEAC,MAAO,CACLC,QAAS,CAAEC,KAAMC,OAAQC,UAAU,GACnCC,KAAM,CACJH,KAAO,KACPI,QAASC,GAEXC,SAAU,CAAEN,KAAMO,SAAUH,QAAS,QACrCI,cAAe,CAAER,KAAMO,SAAUH,QAAS,QAC1CK,aAAc,CAAET,KAAMO,SAAUH,QAAS,QACzCM,eAAgB,CAAEV,KAAMO,SAAUH,QAAS,QAC3CO,mBAAoB,CAAEX,KAAMO,SAAUH,QAAS,SAGjDQ,MAAMd,SACEe,EAAaC,EAAS,CAC1BC,MAAOjB,EAAMK,KAAKY,MAClBC,MAAOlB,EAAMK,KAAKa,MAClBC,SAAS,IAOLC,EAAiCC,EAAI,OAErCC,SAAEA,WAAUC,GAAaC,EAAcxB,EAAMC,SAE7CwB,EAAa,KACbL,EAAQH,OAASK,EAASL,SACpBA,MAAMS,YAIR,SAEJN,EAAQH,UACFA,MAAMU,UAAYZ,EAAUE,YAIlCK,EAAUG,MAEV,IAAMzB,EAAMK,OAAM,OACZY,MAAQjB,EAAMK,KAAKY,QACnBC,MAAQlB,EAAMK,KAAKa,MACzBE,EAAQH,UACFA,MAAMU,UAAYZ,EAAUE,gBAIlCW,QACMX,MAASY,EAAOC,OAAuBH,WAG7CI,EAAUC,GAAS,KAAO,iBACd,yBACQjB,EAAUI,SAChC,sBAAqBJ,EAAUG,UAAU,MAGvCe,QACEzB,SAAS,CACbS,MAAOF,EAAUE,MACjBC,MAAQW,EAAOC,OAA6Bb,SAI1CiB,EAAU,OACJf,SAAU,OAIhBgB,EAAS,OACHhB,SAAU,IACdX,SAAS,CACbS,MAAOF,EAAUE,MACjBC,MAAOH,EAAUG,SAIfkB,SACe,UAAfP,EAAOQ,MAAoBR,EAAOS,SAAU,OACxCC,EAAM,KAAI,IAAIC,OACd9B,cAAc,CAClB6B,GAAAA,EACAzC,KAAM,eACNO,KAAME,QAGCgC,KAEFE,mBAILC,YACe,cAAfb,EAAOQ,KAA2C,KAApBtB,EAAUE,SACpCN,qBAGFgC,EAAYC,OAAOC,eACnBC,QAAOH,WAAWI,UAClBC,EAAaC,MAAMC,MAAK9B,0BAASH,gBAAO+B,aAAc,IACtDG,EAAQL,EAAOE,EAAWI,QAAQN,SACpCA,IAAS1B,EAAQH,OAAmB,IAAVkC,GAAeA,IAAUH,EAAWK,OAAQ,SAChExB,EAAOQ,SACR,cACGzB,2BAEH,YACGC,6BAMP,mBACOkB,EAAQd,oCAIZA,MAAOF,EAAUG,MACjBoC,SAAUrB,8HASR,0BACDb,6BAEIQ"} \ No newline at end of file diff --git a/packages/docs/docs/assets/index.2f19b693.js b/packages/docs/docs/assets/index.2f19b693.js new file mode 100644 index 0000000..4b2c4d6 --- /dev/null +++ b/packages/docs/docs/assets/index.2f19b693.js @@ -0,0 +1,2 @@ +var e=Object.defineProperty,t=Object.prototype.hasOwnProperty,n=Object.getOwnPropertySymbols,o=Object.prototype.propertyIsEnumerable,r=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,l=(e,l)=>{for(var s in l||(l={}))t.call(l,s)&&r(e,s,l[s]);if(n)for(var s of n(l))o.call(l,s)&&r(e,s,l[s]);return e};function s(e,t){const n=Object.create(null),o=e.split(",");for(let r=0;r!!n[e.toLowerCase()]:e=>!!n[e]}!function(e=".",t="__import__"){try{self[t]=new Function("u","return import(u)")}catch(n){const o=new URL(e,location),r=e=>{URL.revokeObjectURL(e.src),e.remove()};self[t]=e=>new Promise(((n,l)=>{const s=new URL(e,o);if(self[t].moduleMap[s])return n(self[t].moduleMap[s]);const i=new Blob([`import * as m from '${s}';`,`${t}.moduleMap['${s}']=m;`],{type:"text/javascript"}),c=Object.assign(document.createElement("script"),{type:"module",src:URL.createObjectURL(i),onerror(){l(new Error(`Failed to import: ${e}`)),r(c)},onload(){n(self[t].moduleMap[s]),r(c)}});document.head.appendChild(c)})),self[t].moduleMap={}}}("assets/");const i=s("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt"),c=s("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function a(e){if(S(e)){const t={};for(let n=0;n{if(e){const n=e.split(d);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function p(e){let t="";if(R(e))t=e;else if(S(e))for(let n=0;n{},b=()=>!1,g=/^on[^a-z]/,y=e=>g.test(e),_=e=>e.startsWith("onUpdate:"),k=Object.assign,x=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},w=Object.prototype.hasOwnProperty,E=(e,t)=>w.call(e,t),S=Array.isArray,C=e=>"[object Map]"===A(e),O=e=>"function"==typeof e,R=e=>"string"==typeof e,F=e=>"symbol"==typeof e,j=e=>null!==e&&"object"==typeof e,P=e=>j(e)&&O(e.then)&&O(e.catch),T=Object.prototype.toString,A=e=>T.call(e),L=e=>R(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,M=s(",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),I=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},$=/-(\w)/g,U=I((e=>e.replace($,((e,t)=>t?t.toUpperCase():"")))),D=/\B([A-Z])/g,N=I((e=>e.replace(D,"-$1").toLowerCase())),V=I((e=>e.charAt(0).toUpperCase()+e.slice(1))),B=I((e=>e?`on${V(e)}`:"")),W=(e,t)=>e!==t&&(e==e||t==t),z=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},H=e=>{const t=parseFloat(e);return isNaN(t)?e:t},K=new WeakMap,J=[];let G;const X=Symbol(""),Z=Symbol("");function Q(e,t=h){(function(e){return e&&!0===e._isEffect})(e)&&(e=e.raw);const n=function(e,t){const n=function(){if(!n.active)return t.scheduler?void 0:e();if(!J.includes(n)){te(n);try{return oe.push(ne),ne=!0,J.push(n),G=n,e()}finally{J.pop(),le(),G=J[J.length-1]}}};return n.id=ee++,n.allowRecurse=!!t.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}(e,t);return t.lazy||n(),n}function Y(e){e.active&&(te(e),e.options.onStop&&e.options.onStop(),e.active=!1)}let ee=0;function te(e){const{deps:t}=e;if(t.length){for(let n=0;n{e&&e.forEach((e=>{(e!==G||e.allowRecurse)&&i.add(e)}))};if("clear"===t)s.forEach(c);else if("length"===n&&S(e))s.forEach(((e,t)=>{("length"===t||t>=o)&&c(e)}));else switch(void 0!==n&&c(s.get(n)),t){case"add":S(e)?L(n)&&c(s.get("length")):(c(s.get(X)),C(e)&&c(s.get(Z)));break;case"delete":S(e)||(c(s.get(X)),C(e)&&c(s.get(Z)));break;case"set":C(e)&&c(s.get(X))}i.forEach((e=>{e.options.scheduler?e.options.scheduler(e):e()}))}const ce=s("__proto__,__v_isRef,__isVue"),ae=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter(F)),ue=ve(),de=ve(!1,!0),fe=ve(!0),pe=ve(!0,!0),he={};function ve(e=!1,t=!1){return function(n,o,r){if("__v_isReactive"===o)return!e;if("__v_isReadonly"===o)return e;if("__v_raw"===o&&r===(e?Be:Ve).get(n))return n;const l=S(n);if(!e&&l&&E(he,o))return Reflect.get(he,o,r);const s=Reflect.get(n,o,r);if(F(o)?ae.has(o):ce(o))return s;if(e||se(n,0,o),t)return s;if(Ye(s)){return!l||!L(o)?s.value:s}return j(s)?e?He(s):ze(s):s}}["includes","indexOf","lastIndexOf"].forEach((e=>{const t=Array.prototype[e];he[e]=function(...e){const n=Ze(this);for(let t=0,r=this.length;t{const t=Array.prototype[e];he[e]=function(...e){re();const n=t.apply(this,e);return le(),n}}));function me(e=!1){return function(t,n,o,r){const l=t[n];if(!e&&(o=Ze(o),!S(t)&&Ye(l)&&!Ye(o)))return l.value=o,!0;const s=S(t)&&L(n)?Number(n)!0,deleteProperty:(e,t)=>!0},ye=k({},be,{get:de,set:me(!0)});k({},ge,{get:pe});const _e=e=>j(e)?ze(e):e,ke=e=>j(e)?He(e):e,xe=e=>e,we=e=>Reflect.getPrototypeOf(e);function Ee(e,t,n=!1,o=!1){const r=Ze(e=e.__v_raw),l=Ze(t);t!==l&&!n&&se(r,0,t),!n&&se(r,0,l);const{has:s}=we(r),i=n?ke:o?xe:_e;return s.call(r,t)?i(e.get(t)):s.call(r,l)?i(e.get(l)):void 0}function Se(e,t=!1){const n=this.__v_raw,o=Ze(n),r=Ze(e);return e!==r&&!t&&se(o,0,e),!t&&se(o,0,r),e===r?n.has(e):n.has(e)||n.has(r)}function Ce(e,t=!1){return e=e.__v_raw,!t&&se(Ze(e),0,X),Reflect.get(e,"size",e)}function Oe(e){e=Ze(e);const t=Ze(this);return we(t).has.call(t,e)||(t.add(e),ie(t,"add",e,e)),this}function Re(e,t){t=Ze(t);const n=Ze(this),{has:o,get:r}=we(n);let l=o.call(n,e);l||(e=Ze(e),l=o.call(n,e));const s=r.call(n,e);return n.set(e,t),l?W(t,s)&&ie(n,"set",e,t):ie(n,"add",e,t),this}function Fe(e){const t=Ze(this),{has:n,get:o}=we(t);let r=n.call(t,e);r||(e=Ze(e),r=n.call(t,e)),o&&o.call(t,e);const l=t.delete(e);return r&&ie(t,"delete",e,void 0),l}function je(){const e=Ze(this),t=0!==e.size,n=e.clear();return t&&ie(e,"clear",void 0,void 0),n}function Pe(e,t){return function(n,o){const r=this,l=r.__v_raw,s=Ze(l),i=e?ke:t?xe:_e;return!e&&se(s,0,X),l.forEach(((e,t)=>n.call(o,i(e),i(t),r)))}}function Te(e,t,n){return function(...o){const r=this.__v_raw,l=Ze(r),s=C(l),i="entries"===e||e===Symbol.iterator&&s,c="keys"===e&&s,a=r[e](...o),u=t?ke:n?xe:_e;return!t&&se(l,0,c?Z:X),{next(){const{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:i?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function Ae(e){return function(...t){return"delete"!==e&&this}}const Le={get(e){return Ee(this,e)},get size(){return Ce(this)},has:Se,add:Oe,set:Re,delete:Fe,clear:je,forEach:Pe(!1,!1)},Me={get(e){return Ee(this,e,!1,!0)},get size(){return Ce(this)},has:Se,add:Oe,set:Re,delete:Fe,clear:je,forEach:Pe(!1,!0)},Ie={get(e){return Ee(this,e,!0)},get size(){return Ce(this,!0)},has(e){return Se.call(this,e,!0)},add:Ae("add"),set:Ae("set"),delete:Ae("delete"),clear:Ae("clear"),forEach:Pe(!0,!1)};function $e(e,t){const n=t?Me:e?Ie:Le;return(t,o,r)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(E(n,o)&&o in t?n:t,o,r)}["keys","values","entries",Symbol.iterator].forEach((e=>{Le[e]=Te(e,!1,!1),Ie[e]=Te(e,!0,!1),Me[e]=Te(e,!1,!0)}));const Ue={get:$e(!1,!1)},De={get:$e(!1,!0)},Ne={get:$e(!0,!1)},Ve=new WeakMap,Be=new WeakMap;function We(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>A(e).slice(8,-1))(e))}function ze(e){return e&&e.__v_isReadonly?e:Ke(e,!1,be,Ue)}function qe(e){return Ke(e,!1,ye,De)}function He(e){return Ke(e,!0,ge,Ne)}function Ke(e,t,n,o){if(!j(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const r=t?Be:Ve,l=r.get(e);if(l)return l;const s=We(e);if(0===s)return e;const i=new Proxy(e,2===s?o:n);return r.set(e,i),i}function Je(e){return Ge(e)?Je(e.__v_raw):!(!e||!e.__v_isReactive)}function Ge(e){return!(!e||!e.__v_isReadonly)}function Xe(e){return Je(e)||Ge(e)}function Ze(e){return e&&Ze(e.__v_raw)||e}const Qe=e=>j(e)?ze(e):e;function Ye(e){return Boolean(e&&!0===e.__v_isRef)}function et(e){return function(e,t=!1){if(Ye(e))return e;return new tt(e,t)}(e)}class tt{constructor(e,t=!1){this._rawValue=e,this._shallow=t,this.__v_isRef=!0,this._value=t?e:Qe(e)}get value(){return se(Ze(this),0,"value"),this._value}set value(e){W(Ze(e),this._rawValue)&&(this._rawValue=e,this._value=this._shallow?e:Qe(e),ie(Ze(this),"set","value",e))}}const nt={get:(e,t,n)=>{return Ye(o=Reflect.get(e,t,n))?o.value:o;var o},set:(e,t,n,o)=>{const r=e[t];return Ye(r)&&!Ye(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function ot(e){return Je(e)?e:new Proxy(e,nt)}class rt{constructor(e,t){this._object=e,this._key=t,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(e){this._object[this._key]=e}}class lt{constructor(e,t,n){this._setter=t,this._dirty=!0,this.__v_isRef=!0,this.effect=Q(e,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,ie(Ze(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),se(Ze(this),0,"value"),this._value}set value(e){this._setter(e)}}function st(e,t,n,o){let r;try{r=o?e(...o):e()}catch(l){ct(l,t,n)}return r}function it(e,t,n,o){if(O(e)){const r=st(e,t,n,o);return r&&P(r)&&r.catch((e=>{ct(e,t,n)})),r}const r=[];for(let l=0;l>>1;Rt(dt[e])-1?dt.splice(t,0,e):dt.push(e),Et()}}function Et(){at||ut||(ut=!0,_t=yt.then(Ft))}function St(e,t,n,o){S(e)?n.push(...e):t&&t.includes(e,e.allowRecurse?o+1:o)||n.push(e),Et()}function Ct(e,t=null){if(pt.length){for(kt=t,ht=[...new Set(pt)],pt.length=0,vt=0;vtRt(e)-Rt(t))),gt=0;gtnull==e.id?1/0:e.id;function Ft(e){ut=!1,at=!0,Ct(e),dt.sort(((e,t)=>Rt(e)-Rt(t)));try{for(ft=0;fte.trim())):t&&(r=n.map(H))}let i=B(U(t)),c=o[i];!c&&l&&(i=B(N(t)),c=o[i]),c&&it(c,e,6,r);const a=o[i+"Once"];if(a){if(e.emitted){if(e.emitted[i])return}else(e.emitted={})[i]=!0;it(a,e,6,r)}}function Pt(e,t,n=!1){if(!t.deopt&&void 0!==e.__emits)return e.__emits;const o=e.emits;let r={},l=!1;if(!O(e)){const o=e=>{l=!0,k(r,Pt(e,t,!0))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return o||l?(S(o)?o.forEach((e=>r[e]=null)):k(r,o),e.__emits=r):e.__emits=null}function Tt(e,t){return!(!e||!y(t))&&(t=t.slice(2).replace(/Once$/,""),E(e,t[0].toLowerCase()+t.slice(1))||E(e,N(t))||E(e,t))}let At=null;function Lt(e){At=e}function Mt(e){const{type:t,vnode:n,proxy:o,withProxy:r,props:l,propsOptions:[s],slots:i,attrs:c,emit:a,render:u,renderCache:d,data:f,setupState:p,ctx:h}=e;let v;At=e;try{let e;if(4&n.shapeFlag){const t=r||o;v=Qn(u.call(t,t,d,l,p,f,h)),e=c}else{const n=t;0,v=Qn(n.length>1?n(l,{attrs:c,slots:i,emit:a}):n(l,null)),e=t.props?c:$t(c)}let m=v;if(!1!==t.inheritAttrs&&e){const t=Object.keys(e),{shapeFlag:n}=m;t.length&&(1&n||6&n)&&(s&&t.some(_)&&(e=Ut(e,s)),m=Xn(m,e))}n.dirs&&(m.dirs=m.dirs?m.dirs.concat(n.dirs):n.dirs),n.transition&&(m.transition=n.transition),v=m}catch(m){ct(m,e,1),v=Gn(Nn)}return At=null,v}function It(e){let t;for(let n=0;n{let t;for(const n in e)("class"===n||"style"===n||y(n))&&((t||(t={}))[n]=e[n]);return t},Ut=(e,t)=>{const n={};for(const o in e)_(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function Dt(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;rVt+=e;function Wt(e,t=At){if(!t)return e;const n=(...n)=>{Vt||function(e=!1){Bn.push(Wn=e?null:[])}(!0);const o=At;Lt(t);const r=e(...n);return Lt(o),Vt||(Bn.pop(),Wn=Bn[Bn.length-1]||null),r};return n._c=!0,n}function zt(e,t,n,o){const[r,l]=e.propsOptions;if(t)for(const s in t){const l=t[s];if(M(s))continue;let i;r&&E(r,i=U(s))?n[i]=l:Tt(e.emitsOptions,s)||(o[s]=l)}if(l){const t=Ze(n);for(let o=0;o{s=!0;const[n,o]=Ht(e,t,!0);k(r,n),o&&l.push(...o)};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}if(!o&&!s)return e.__props=v;if(S(o))for(let i=0;i-1,n[1]=o<0||t-1||E(n,"default"))&&l.push(e)}}}return e.__props=[r,l]}function Kt(e){return"$"!==e[0]}function Jt(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function Gt(e,t){return Jt(e)===Jt(t)}function Xt(e,t){if(S(t)){for(let n=0,o=t.length;n{if(n.isUnmounted)return;re(),ko(n);const r=it(t,n,e,o);return ko(null),le(),r});return o?r.unshift(l):r.push(l),l}}const Qt=e=>(t,n=_o)=>!wo&&Zt(e,t,n),Yt=Qt("bm"),en=Qt("m"),tn=Qt("bu"),nn=Qt("u"),on=Qt("bum"),rn=Qt("um"),ln=Qt("rtg"),sn=Qt("rtc"),cn={};function an(e,t,n){return un(e,t,n)}function un(e,t,{immediate:n,deep:o,flush:r,onTrack:l,onTrigger:s}=h,i=_o){let c,a,u=!1;if(Ye(e)?(c=()=>e.value,u=!!e._shallow):Je(e)?(c=()=>e,o=!0):c=S(e)?()=>e.map((e=>Ye(e)?e.value:Je(e)?fn(e):O(e)?st(e,i,2,[i&&i.proxy]):void 0)):O(e)?t?()=>st(e,i,2,[i&&i.proxy]):()=>{if(!i||!i.isUnmounted)return a&&a(),st(e,i,3,[d])}:m,t&&o){const e=c;c=()=>fn(e())}const d=e=>{a=b.options.onStop=()=>{st(e,i,4)}};let f=S(e)?[]:cn;const p=()=>{if(b.active)if(t){const e=b();(o||u||W(e,f))&&(a&&a(),it(t,i,3,[e,f===cn?void 0:f,d]),f=e)}else b()};let v;p.allowRecurse=!!t,v="sync"===r?p:"post"===r?()=>Fn(p,i&&i.suspense):()=>{!i||i.isMounted?function(e){St(e,ht,pt,vt)}(p):p()};const b=Q(c,{lazy:!0,onTrack:l,onTrigger:s,scheduler:v});return Co(b,i),t?n?p():f=b():"post"===r?Fn(b,i&&i.suspense):b(),()=>{Y(b),i&&x(i.effects,b)}}function dn(e,t,n){const o=this.proxy;return un(R(e)?()=>o[e]:e.bind(o),t.bind(o),n,this)}function fn(e,t=new Set){if(!j(e)||t.has(e))return e;if(t.add(e),Ye(e))fn(e.value,t);else if(S(e))for(let n=0;n{fn(e,t)}));else for(const n in e)fn(e[n],t);return e}const pn=e=>e.type.__isKeepAlive;function hn(e,t,n=_o){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}e()});if(Zt(t,o,n),n){let e=n.parent;for(;e&&e.parent;)pn(e.parent.vnode)&&vn(o,t,n,e),e=e.parent}}function vn(e,t,n,o){const r=Zt(t,e,o,!0);rn((()=>{x(o[t],r)}),n)}const mn=e=>"_"===e[0]||"$stable"===e,bn=e=>S(e)?e.map(Qn):[Qn(e)],gn=(e,t,n)=>Wt((e=>bn(t(e))),n),yn=(e,t)=>{const n=e._ctx;for(const o in e){if(mn(o))continue;const r=e[o];if(O(r))t[o]=gn(0,r,n);else if(null!=r){const e=bn(r);t[o]=()=>e}}},_n=(e,t)=>{const n=bn(t);e.slots.default=()=>n};function kn(e,t,n,o){const r=e.dirs,l=t&&t.dirs;for(let s=0;s(l.has(e)||(e&&O(e.install)?(l.add(e),e.install(i,...t)):O(e)&&(l.add(e),e(i,...t))),i),mixin:e=>(r.mixins.includes(e)||(r.mixins.push(e),(e.props||e.emits)&&(r.deopt=!0)),i),component:(e,t)=>t?(r.components[e]=t,i):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,i):r.directives[e],mount(l,c){if(!s){const a=Gn(n,o);return a.appContext=r,c&&t?t(a,l):e(a,l),s=!0,i._container=l,l.__vue_app__=i,a.component.proxy}},unmount(){s&&(e(null,i._container),delete i._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,i)};return i}}function Sn(e){return O(e)?{setup:e,name:e.name}:e}function Cn(e){O(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:r=200,timeout:l,suspensible:s=!0,onError:i}=e;let c,a=null,u=0;const d=()=>{let e;return a||(e=a=t().catch((e=>{if(e=e instanceof Error?e:new Error(String(e)),i)return new Promise(((t,n)=>{i(e,(()=>t((u++,a=null,d()))),(()=>n(e)),u+1)}));throw e})).then((t=>e!==a&&a?a:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),c=t,t))))};return Sn({__asyncLoader:d,name:"AsyncComponentWrapper",setup(){const e=_o;if(c)return()=>On(c,e);const t=t=>{a=null,ct(t,e,13,!o)};if(s&&e.suspense)return d().then((t=>()=>On(t,e))).catch((e=>(t(e),()=>o?Gn(o,{error:e}):null)));const i=et(!1),u=et(),f=et(!!r);return r&&setTimeout((()=>{f.value=!1}),r),null!=l&&setTimeout((()=>{if(!i.value&&!u.value){const e=new Error(`Async component timed out after ${l}ms.`);t(e),u.value=e}}),l),d().then((()=>{i.value=!0})).catch((e=>{t(e),u.value=e})),()=>i.value&&c?On(c,e):u.value&&o?Gn(o,{error:u.value}):n&&!f.value?Gn(n):void 0}})}function On(e,{vnode:{ref:t,props:n,children:o}}){const r=Gn(e,n,o);return r.ref=t,r}const Rn={scheduler:wt,allowRecurse:!0},Fn=function(e,t){t&&t.pendingBranch?S(e)?t.effects.push(...e):t.effects.push(e):St(e,bt,mt,gt)},jn=(e,t,n,o)=>{if(S(e))return void e.forEach(((e,r)=>jn(e,t&&(S(t)?t[r]:t),n,o)));let r;r=!o||(e=>!!e.type.__asyncLoader)(o)?null:4&o.shapeFlag?o.component.exposed||o.component.proxy:o.el;const{i:l,r:s}=e,i=t&&t.r,c=l.refs===h?l.refs={}:l.refs,a=l.setupState;if(null!=i&&i!==s&&(R(i)?(c[i]=null,E(a,i)&&(a[i]=null)):Ye(i)&&(i.value=null)),R(s)){const e=()=>{c[s]=r,E(a,s)&&(a[s]=r)};r?(e.id=-1,Fn(e,n)):e()}else if(Ye(s)){const e=()=>{s.value=r};r?(e.id=-1,Fn(e,n)):e()}else O(s)&&st(s,l,12,[r,c])};function Pn(e){return function(e,t){const{insert:n,remove:o,patchProp:r,forcePatchProp:l,createElement:s,createText:i,createComment:c,setText:a,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=m,cloneNode:b,insertStaticContent:g}=e,y=(e,t,n,o=null,r=null,l=null,s=!1,i=!1)=>{e&&!qn(e,t)&&(o=oe(e),X(e,r,l,!0),e=null),-2===t.patchFlag&&(i=!1,t.dynamicChildren=null);const{type:c,ref:a,shapeFlag:u}=t;switch(c){case Dn:_(e,t,n,o);break;case Nn:x(e,t,n,o);break;case Vn:null==e&&w(t,n,o,s);break;case Un:I(e,t,n,o,r,l,s,i);break;default:1&u?O(e,t,n,o,r,l,s,i):6&u?$(e,t,n,o,r,l,s,i):(64&u||128&u)&&c.process(e,t,n,o,r,l,s,i,ce)}null!=a&&r&&jn(a,e&&e.ref,l,t)},_=(e,t,o,r)=>{if(null==e)n(t.el=i(t.children),o,r);else{const n=t.el=e.el;t.children!==e.children&&a(n,t.children)}},x=(e,t,o,r)=>{null==e?n(t.el=c(t.children||""),o,r):t.el=e.el},w=(e,t,n,o)=>{[e.el,e.anchor]=g(e.children,t,n,o)},S=({el:e,anchor:t},o,r)=>{let l;for(;e&&e!==t;)l=f(e),n(e,o,r),e=l;n(t,o,r)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),o(e),e=n;o(t)},O=(e,t,n,o,r,l,s,i)=>{s=s||"svg"===t.type,null==e?R(t,n,o,r,l,s,i):T(e,t,r,l,s,i)},R=(e,t,o,l,i,c,a)=>{let d,f;const{type:p,props:h,shapeFlag:v,transition:m,scopeId:g,patchFlag:y,dirs:_}=e;if(e.el&&void 0!==b&&-1===y)d=e.el=b(e.el);else{if(d=e.el=s(e.type,c,h&&h.is),8&v?u(d,e.children):16&v&&j(e.children,d,null,l,i,c&&"foreignObject"!==p,a||!!e.dynamicChildren),_&&kn(e,null,l,"created"),h){for(const t in h)M(t)||r(d,t,null,h[t],c,e.children,l,i,ne);(f=h.onVnodeBeforeMount)&&Tn(f,l,e)}F(d,g,e,l)}_&&kn(e,null,l,"beforeMount");const k=(!i||i&&!i.pendingBranch)&&m&&!m.persisted;k&&m.beforeEnter(d),n(d,t,o),((f=h&&h.onVnodeMounted)||k||_)&&Fn((()=>{f&&Tn(f,l,e),k&&m.enter(d),_&&kn(e,null,l,"mounted")}),i)},F=(e,t,n,o)=>{if(t&&p(e,t),o){const r=o.type.__scopeId;r&&r!==t&&p(e,r+"-s"),n===o.subTree&&F(e,o.vnode.scopeId,o.vnode,o.parent)}},j=(e,t,n,o,r,l,s,i=0)=>{for(let c=i;c{const c=t.el=e.el;let{patchFlag:a,dynamicChildren:d,dirs:f}=t;a|=16&e.patchFlag;const p=e.props||h,v=t.props||h;let m;if((m=v.onVnodeBeforeUpdate)&&Tn(m,n,t,e),f&&kn(t,e,n,"beforeUpdate"),a>0){if(16&a)L(c,t,p,v,n,o,s);else if(2&a&&p.class!==v.class&&r(c,"class",null,v.class,s),4&a&&r(c,"style",p.style,v.style,s),8&a){const i=t.dynamicProps;for(let t=0;t{m&&Tn(m,n,t,e),f&&kn(t,e,n,"updated")}),o)},A=(e,t,n,o,r,l)=>{for(let s=0;s{if(n!==o){for(const a in o){if(M(a))continue;const u=o[a],d=n[a];(u!==d||l&&l(e,a))&&r(e,a,d,u,c,t.children,s,i,ne)}if(n!==h)for(const l in n)M(l)||l in o||r(e,l,n[l],null,c,t.children,s,i,ne)}},I=(e,t,o,r,l,s,c,a)=>{const u=t.el=e?e.el:i(""),d=t.anchor=e?e.anchor:i("");let{patchFlag:f,dynamicChildren:p}=t;f>0&&(a=!0),null==e?(n(u,o,r),n(d,o,r),j(t.children,o,d,l,s,c,a)):f>0&&64&f&&p&&e.dynamicChildren?(A(e.dynamicChildren,p,o,l,s,c),(null!=t.key||l&&t===l.subTree)&&An(e,t,!0)):H(e,t,o,d,l,s,c,a)},$=(e,t,n,o,r,l,s,i)=>{null==e?512&t.shapeFlag?r.ctx.activate(t,n,o,s,i):D(t,n,o,r,l,s,i):V(e,t,i)},D=(e,t,n,o,r,l,s)=>{const i=e.component=function(e,t,n){const o=e.type,r=(t?t.appContext:e.appContext)||go,l={uid:yo++,vnode:e,type:o,parent:t,appContext:r,root:null,next:null,subTree:null,update:null,render:null,proxy:null,exposed:null,withProxy:null,effects:null,provides:t?t.provides:Object.create(r.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ht(o,r),emitsOptions:Pt(o,r),emit:null,emitted:null,ctx:h,data:h,props:h,attrs:h,slots:h,refs:h,setupState:h,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null};return l.ctx={_:l},l.root=t?t.root:l,l.emit=jt.bind(null,l),l}(e,o,r);if(pn(e)&&(i.ctx.renderer=ce),function(e,t=!1){wo=t;const{props:n,children:o}=e.vnode,r=xo(e);(function(e,t,n,o=!1){const r={},l={};q(l,Hn,1),zt(e,t,r,l),n?e.props=o?r:qe(r):e.type.props?e.props=r:e.props=l,e.attrs=l})(e,n,r,t),((e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=t,q(t,"_",n)):yn(t,e.slots={})}else e.slots={},t&&_n(e,t);q(e.slots,Hn,1)})(e,o);const l=r?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,mo);const{setup:o}=n;if(o){const n=e.setupContext=o.length>1?function(e){const t=t=>{e.exposed=ot(t)};return{attrs:e.attrs,slots:e.slots,emit:e.emit,expose:t}}(e):null;_o=e,re();const r=st(o,e,0,[e.props,n]);if(le(),_o=null,P(r)){if(t)return r.then((t=>{Eo(e,t)}));e.asyncDep=r}else Eo(e,r)}else So(e)}(e,t):void 0;wo=!1}(i),i.asyncDep){if(r&&r.registerDep(i,B),!e.el){const e=i.subTree=Gn(Nn);x(null,e,t,n)}}else B(i,e,t,n,r,l,s)},V=(e,t,n)=>{const o=t.component=e.component;if(function(e,t,n){const{props:o,children:r,component:l}=e,{props:s,children:i,patchFlag:c}=t,a=l.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&c>=0))return!(!r&&!i||i&&i.$stable)||o!==s&&(o?!s||Dt(o,s,a):!!s);if(1024&c)return!0;if(16&c)return o?Dt(o,s,a):!!s;if(8&c){const e=t.dynamicProps;for(let t=0;t-1&&dt.splice(t,1)}(o.update),o.update()}else t.component=e.component,t.el=e.el,o.vnode=t},B=(e,t,n,o,r,l,s)=>{e.update=Q((function(){if(e.isMounted){let t,{next:n,bu:o,u:i,parent:c,vnode:a}=e,u=n;n?(n.el=a.el,W(e,n,s)):n=a,o&&z(o),(t=n.props&&n.props.onVnodeBeforeUpdate)&&Tn(t,c,n,a);const f=Mt(e),p=e.subTree;e.subTree=f,y(p,f,d(p.el),oe(p),e,r,l),n.el=f.el,null===u&&function({vnode:e,parent:t},n){for(;t&&t.subTree===e;)(e=t.vnode).el=n,t=t.parent}(e,f.el),i&&Fn(i,r),(t=n.props&&n.props.onVnodeUpdated)&&Fn((()=>{Tn(t,c,n,a)}),r)}else{let s;const{el:i,props:c}=t,{bm:a,m:u,parent:d}=e;a&&z(a),(s=c&&c.onVnodeBeforeMount)&&Tn(s,d,t);const f=e.subTree=Mt(e);if(i&&ue?ue(t.el,f,e,r):(y(null,f,n,o,e,r,l),t.el=f.el),u&&Fn(u,r),s=c&&c.onVnodeMounted){const e=t;Fn((()=>{Tn(s,d,e)}),r)}const{a:p}=e;p&&256&t.shapeFlag&&Fn(p,r),e.isMounted=!0,t=n=o=null}}),Rn)},W=(e,t,n)=>{t.component=e;const o=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,o){const{props:r,attrs:l,vnode:{patchFlag:s}}=e,i=Ze(r),[c]=e.propsOptions;if(!(o||s>0)||16&s){let o;zt(e,t,r,l);for(const l in i)t&&(E(t,l)||(o=N(l))!==l&&E(t,o))||(c?!n||void 0===n[l]&&void 0===n[o]||(r[l]=qt(c,t||h,l,void 0,e)):delete r[l]);if(l!==i)for(const e in l)t&&E(t,e)||delete l[e]}else if(8&s){const n=e.vnode.dynamicProps;for(let o=0;o{const{vnode:n,slots:o}=e;let r=!0,l=h;if(32&n.shapeFlag){const e=t._;e?1===e?r=!1:k(o,t):(r=!t.$stable,yn(t,o)),l=t}else t&&(_n(e,t),l={default:1});if(r)for(const s in o)mn(s)||s in l||delete o[s]})(e,t.children),Ct(void 0,e.update)},H=(e,t,n,o,r,l,s,i=!1)=>{const c=e&&e.children,a=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:p}=t;if(f>0){if(128&f)return void J(c,d,n,o,r,l,s,i);if(256&f)return void K(c,d,n,o,r,l,s,i)}8&p?(16&a&&ne(c,r,l),d!==c&&u(n,d)):16&a?16&p?J(c,d,n,o,r,l,s,i):ne(c,r,l,!0):(8&a&&u(n,""),16&p&&j(d,n,o,r,l,s,i))},K=(e,t,n,o,r,l,s,i)=>{t=t||v;const c=(e=e||v).length,a=t.length,u=Math.min(c,a);let d;for(d=0;da?ne(e,r,l,!0,!1,u):j(t,n,o,r,l,s,i,u)},J=(e,t,n,o,r,l,s,i)=>{let c=0;const a=t.length;let u=e.length-1,d=a-1;for(;c<=u&&c<=d;){const o=e[c],a=t[c]=i?Yn(t[c]):Qn(t[c]);if(!qn(o,a))break;y(o,a,n,null,r,l,s,i),c++}for(;c<=u&&c<=d;){const o=e[u],c=t[d]=i?Yn(t[d]):Qn(t[d]);if(!qn(o,c))break;y(o,c,n,null,r,l,s,i),u--,d--}if(c>u){if(c<=d){const e=d+1,u=ed)for(;c<=u;)X(e[c],r,l,!0),c++;else{const f=c,p=c,h=new Map;for(c=p;c<=d;c++){const e=t[c]=i?Yn(t[c]):Qn(t[c]);null!=e.key&&h.set(e.key,c)}let m,b=0;const g=d-p+1;let _=!1,k=0;const x=new Array(g);for(c=0;c=g){X(o,r,l,!0);continue}let a;if(null!=o.key)a=h.get(o.key);else for(m=p;m<=d;m++)if(0===x[m-p]&&qn(o,t[m])){a=m;break}void 0===a?X(o,r,l,!0):(x[a-p]=c+1,a>=k?k=a:_=!0,y(o,t[a],n,null,r,l,s,i),b++)}const w=_?function(e){const t=e.slice(),n=[0];let o,r,l,s,i;const c=e.length;for(o=0;o0&&(t[o]=n[l-1]),n[l]=o)}}l=n.length,s=n[l-1];for(;l-- >0;)n[l]=s,s=t[s];return n}(x):v;for(m=w.length-1,c=g-1;c>=0;c--){const e=p+c,i=t[e],u=e+1{const{el:s,type:i,transition:c,children:a,shapeFlag:u}=e;if(6&u)return void G(e.component.subTree,t,o,r);if(128&u)return void e.suspense.move(t,o,r);if(64&u)return void i.move(e,t,o,ce);if(i===Un){n(s,t,o);for(let e=0;ec.enter(s)),l);else{const{leave:e,delayLeave:r,afterLeave:l}=c,i=()=>n(s,t,o),a=()=>{e(s,(()=>{i(),l&&l()}))};r?r(s,i,a):a()}else n(s,t,o)},X=(e,t,n,o=!1,r=!1)=>{const{type:l,props:s,ref:i,children:c,dynamicChildren:a,shapeFlag:u,patchFlag:d,dirs:f}=e;if(null!=i&&jn(i,null,n,null),256&u)return void t.ctx.deactivate(e);const p=1&u&&f;let h;if((h=s&&s.onVnodeBeforeUnmount)&&Tn(h,t,e),6&u)te(e.component,n,o);else{if(128&u)return void e.suspense.unmount(n,o);p&&kn(e,null,t,"beforeUnmount"),a&&(l!==Un||d>0&&64&d)?ne(a,t,n,!1,!0):(l===Un&&(128&d||256&d)||!r&&16&u)&&ne(c,t,n),64&u&&(o||!Ln(e.props))&&e.type.remove(e,ce),o&&Z(e)}((h=s&&s.onVnodeUnmounted)||p)&&Fn((()=>{h&&Tn(h,t,e),p&&kn(e,null,t,"unmounted")}),n)},Z=e=>{const{type:t,el:n,anchor:r,transition:l}=e;if(t===Un)return void ee(n,r);if(t===Vn)return void C(e);const s=()=>{o(n),l&&!l.persisted&&l.afterLeave&&l.afterLeave()};if(1&e.shapeFlag&&l&&!l.persisted){const{leave:t,delayLeave:o}=l,r=()=>t(n,s);o?o(e.el,s,r):r()}else s()},ee=(e,t)=>{let n;for(;e!==t;)n=f(e),o(e),e=n;o(t)},te=(e,t,n)=>{const{bum:o,effects:r,update:l,subTree:s,um:i}=e;if(o&&z(o),r)for(let c=0;c{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},ne=(e,t,n,o=!1,r=!1,l=0)=>{for(let s=l;s6&e.shapeFlag?oe(e.component.subTree):128&e.shapeFlag?e.suspense.next():f(e.anchor||e.el),se=(e,t)=>{null==e?t._vnode&&X(t._vnode,null,null,!0):y(t._vnode||null,e,t),Ot(),t._vnode=e},ce={p:y,um:X,m:G,r:Z,mt:D,mc:j,pc:H,pbc:A,n:oe,o:e};let ae,ue;t&&([ae,ue]=t(ce));return{render:se,hydrate:ae,createApp:En(se,ae)}}(e)}function Tn(e,t,n,o=null){it(e,t,7,[n,o])}function An(e,t,n=!1){const o=e.children,r=t.children;if(S(o)&&S(r))for(let l=0;le&&(e.disabled||""===e.disabled),Mn=Symbol();function In(e){return function(e,t,n=!0){const o=At||_o;if(o){const n=o.type;if("components"===e){if("_self"===t)return n;const e=Oo(n);if(e&&(e===t||e===U(t)||e===V(U(t))))return n}return $n(o[e]||n[e],t)||$n(o.appContext[e],t)}}("directives",e)}function $n(e,t){return e&&(e[t]||e[U(t)]||e[V(U(t))])}const Un=Symbol(void 0),Dn=Symbol(void 0),Nn=Symbol(void 0),Vn=Symbol(void 0),Bn=[];let Wn=null;function zn(e){return!!e&&!0===e.__v_isVNode}function qn(e,t){return e.type===t.type&&e.key===t.key}const Hn="__vInternal",Kn=({key:e})=>null!=e?e:null,Jn=({ref:e})=>null!=e?R(e)||Ye(e)||O(e)?{i:At,r:e}:e:null,Gn=function(e,t=null,n=null,o=0,r=null,l=!1){e&&e!==Mn||(e=Nn);if(zn(e)){const o=Xn(e,t,!0);return n&&eo(o,n),o}s=e,O(s)&&"__vccOpts"in s&&(e=e.__vccOpts);var s;if(t){(Xe(t)||Hn in t)&&(t=k({},t));let{class:e,style:n}=t;e&&!R(e)&&(t.class=p(e)),j(n)&&(Xe(n)&&!S(n)&&(n=k({},n)),t.style=a(n))}const i=R(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:j(e)?4:O(e)?2:0,c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Kn(t),ref:t&&Jn(t),scopeId:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null};if(eo(c,n),128&i){const{content:e,fallback:t}=function(e){const{shapeFlag:t,children:n}=e;let o,r;return 32&t?(o=Nt(n.default),r=Nt(n.fallback)):(o=Nt(n),r=Qn(null)),{content:o,fallback:r}}(c);c.ssContent=e,c.ssFallback=t}!l&&Wn&&(o>0||6&i)&&32!==o&&Wn.push(c);return c};function Xn(e,t,n=!1){const{props:o,ref:r,patchFlag:l,children:s}=e,i=t?to(o||{},t):o;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:i,key:i&&Kn(i),ref:t&&t.ref?n&&r?S(r)?r.concat(Jn(t)):[r,Jn(t)]:Jn(t):r,scopeId:e.scopeId,children:s,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Un?-1===l?16:16|l:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Xn(e.ssContent),ssFallback:e.ssFallback&&Xn(e.ssFallback),el:e.el,anchor:e.anchor}}function Zn(e=" ",t=0){return Gn(Dn,null,e,t)}function Qn(e){return null==e||"boolean"==typeof e?Gn(Nn):S(e)?Gn(Un,null,e):"object"==typeof e?null===e.el?e:Xn(e):Gn(Dn,null,String(e))}function Yn(e){return null===e.el?e:Xn(e)}function eo(e,t){let n=0;const{shapeFlag:o}=e;if(null==t)t=null;else if(S(t))n=16;else if("object"==typeof t){if(1&o||64&o){const n=t.default;return void(n&&(n._c&&Bt(1),eo(e,n()),n._c&&Bt(-1)))}{n=32;const o=t._;o||Hn in t?3===o&&At&&(1024&At.vnode.patchFlag?(t._=2,e.patchFlag|=1024):t._=1):t._ctx=At}}else O(t)?(t={default:t,_ctx:At},n=32):(t=String(t),64&o?(n=16,t=[Zn(t)]):n=8);e.children=t,e.shapeFlag|=n}function to(...e){const t=k({},e[0]);for(let n=1;n1)return n&&O(t)?t():t}}let ro=!1;function lo(e,t,n=[],o=[],r=[],l=!1){const{mixins:s,extends:i,data:c,computed:a,methods:u,watch:d,provide:f,inject:p,components:v,directives:b,beforeMount:g,mounted:y,beforeUpdate:_,updated:x,activated:w,deactivated:E,beforeDestroy:C,beforeUnmount:R,destroyed:F,unmounted:P,render:T,renderTracked:A,renderTriggered:L,errorCaptured:M,expose:I}=t,$=e.proxy,U=e.ctx,D=e.appContext.mixins;if(l&&T&&e.render===m&&(e.render=T),l||(ro=!0,so("beforeCreate","bc",t,e,D),ro=!1,ao(e,D,n,o,r)),i&&lo(e,i,n,o,r,!0),s&&ao(e,s,n,o,r),p)if(S(p))for(let h=0;huo(e,t,$))),c&&uo(e,c,$)),a)for(const h in a){const e=a[h],t=Ro({get:O(e)?e.bind($,$):O(e.get)?e.get.bind($,$):m,set:!O(e)&&O(e.set)?e.set.bind($):m});Object.defineProperty(U,h,{enumerable:!0,configurable:!0,get:()=>t.value,set:e=>t.value=e})}var N;if(d&&o.push(d),!l&&o.length&&o.forEach((e=>{for(const t in e)fo(e[t],U,$,t)})),f&&r.push(f),!l&&r.length&&r.forEach((e=>{const t=O(e)?e.call($):e;Reflect.ownKeys(t).forEach((e=>{no(e,t[e])}))})),l&&(v&&k(e.components||(e.components=k({},e.type.components)),v),b&&k(e.directives||(e.directives=k({},e.type.directives)),b)),l||so("created","c",t,e,D),g&&Yt(g.bind($)),y&&en(y.bind($)),_&&tn(_.bind($)),x&&nn(x.bind($)),w&&hn(w.bind($),"a",N),E&&function(e,t){hn(e,"da",t)}(E.bind($)),M&&((e,t=_o)=>{Zt("ec",e,t)})(M.bind($)),A&&sn(A.bind($)),L&&ln(L.bind($)),R&&on(R.bind($)),P&&rn(P.bind($)),S(I)&&!l)if(I.length){const t=e.exposed||(e.exposed=ot({}));I.forEach((e=>{t[e]=function(e,t){return Ye(e[t])?e[t]:new rt(e,t)}($,e)}))}else e.exposed||(e.exposed=h)}function so(e,t,n,o,r){co(e,t,r,o);const{extends:l,mixins:s}=n;l&&io(e,t,l,o),s&&co(e,t,s,o);const i=n[e];i&&it(i.bind(o.proxy),o,t)}function io(e,t,n,o){n.extends&&io(e,t,n.extends,o);const r=n[e];r&&it(r.bind(o.proxy),o,t)}function co(e,t,n,o){for(let r=0;r{let t=e;for(let e=0;en[o];if(R(e)){const n=t[e];O(n)&&an(r,n)}else if(O(e))an(r,e.bind(n));else if(j(e))if(S(e))e.forEach((e=>fo(e,t,n,o)));else{const o=O(e.handler)?e.handler.bind(n):t[e.handler];O(o)&&an(r,o,e)}}function po(e,t,n){const o=n.appContext.config.optionMergeStrategies,{mixins:r,extends:l}=t;l&&po(e,l,n),r&&r.forEach((t=>po(e,t,n)));for(const s in t)o&&E(o,s)?e[s]=o[s](e[s],t[s],n.proxy,s):e[s]=t[s]}const ho=e=>e?xo(e)?e.exposed?e.exposed:e.proxy:ho(e.parent):null,vo=k(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ho(e.parent),$root:e=>ho(e.root),$emit:e=>e.emit,$options:e=>function(e){const t=e.type,{__merged:n,mixins:o,extends:r}=t;if(n)return n;const l=e.appContext.mixins;if(!l.length&&!o&&!r)return t;const s={};return l.forEach((t=>po(s,t,e))),po(s,t,e),t.__merged=s}(e),$forceUpdate:e=>()=>wt(e.update),$nextTick:e=>xt.bind(e.proxy),$watch:e=>dn.bind(e)}),mo={get({_:e},t){const{ctx:n,setupState:o,data:r,props:l,accessCache:s,type:i,appContext:c}=e;if("__v_skip"===t)return!0;let a;if("$"!==t[0]){const i=s[t];if(void 0!==i)switch(i){case 0:return o[t];case 1:return r[t];case 3:return n[t];case 2:return l[t]}else{if(o!==h&&E(o,t))return s[t]=0,o[t];if(r!==h&&E(r,t))return s[t]=1,r[t];if((a=e.propsOptions[0])&&E(a,t))return s[t]=2,l[t];if(n!==h&&E(n,t))return s[t]=3,n[t];ro||(s[t]=4)}}const u=vo[t];let d,f;return u?("$attrs"===t&&se(e,0,t),u(e)):(d=i.__cssModules)&&(d=d[t])?d:n!==h&&E(n,t)?(s[t]=3,n[t]):(f=c.config.globalProperties,E(f,t)?f[t]:void 0)},set({_:e},t,n){const{data:o,setupState:r,ctx:l}=e;if(r!==h&&E(r,t))r[t]=n;else if(o!==h&&E(o,t))o[t]=n;else if(E(e.props,t))return!1;return("$"!==t[0]||!(t.slice(1)in e))&&(l[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:r,propsOptions:l}},s){let i;return void 0!==n[s]||e!==h&&E(e,s)||t!==h&&E(t,s)||(i=l[0])&&E(i,s)||E(o,s)||E(vo,s)||E(r.config.globalProperties,s)}},bo=k({},mo,{get(e,t){if(t!==Symbol.unscopables)return mo.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!i(t)}),go=xn();let yo=0;let _o=null;const ko=e=>{_o=e};function xo(e){return 4&e.vnode.shapeFlag}let wo=!1;function Eo(e,t,n){O(t)?e.render=t:j(t)&&(e.setupState=ot(t)),So(e)}function So(e,t){const n=e.type;e.render||(e.render=n.render||m,e.render._rc&&(e.withProxy=new Proxy(e.ctx,bo))),_o=e,re(),lo(e,n),le(),_o=null}function Co(e,t=_o){t&&(t.effects||(t.effects=[])).push(e)}function Oo(e){return O(e)&&e.displayName||e.name}function Ro(e){const t=function(e){let t,n;return O(e)?(t=e,n=m):(t=e.get,n=e.set),new lt(t,n,O(e)||!e.set)}(e);return Co(t.effect),t}function Fo(e,t,n){const o=arguments.length;return 2===o?j(t)&&!S(t)?zn(t)?Gn(e,null,[t]):Gn(e,t):Gn(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&zn(n)&&(n=[n]),Gn(e,t,n))}const jo="3.0.7",Po="http://www.w3.org/2000/svg",To="undefined"!=typeof document?document:null;let Ao,Lo;const Mo={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n)=>t?To.createElementNS(Po,e):To.createElement(e,n?{is:n}:void 0),createText:e=>To.createTextNode(e),createComment:e=>To.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>To.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode:e=>e.cloneNode(!0),insertStaticContent(e,t,n,o){const r=o?Lo||(Lo=To.createElementNS(Po,"svg")):Ao||(Ao=To.createElement("div"));r.innerHTML=e;const l=r.firstChild;let s=l,i=s;for(;s;)i=s,Mo.insert(s,t,n),s=r.firstChild;return[l,i]}};const Io=/\s*!important$/;function $o(e,t,n){if(S(n))n.forEach((n=>$o(e,t,n)));else if(t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=Do[t];if(n)return n;let o=U(t);if("filter"!==o&&o in e)return Do[t]=o;o=V(o);for(let r=0;rdocument.createEvent("Event").timeStamp&&(Vo=()=>performance.now());let Bo=0;const Wo=Promise.resolve(),zo=()=>{Bo=0};function qo(e,t,n,o,r=null){const l=e._vei||(e._vei={}),s=l[t];if(o&&s)s.value=o;else{const[n,i]=function(e){let t;if(Ho.test(e)){let n;for(t={};n=e.match(Ho);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[N(e.slice(2)),t]}(t);if(o){!function(e,t,n,o){e.addEventListener(t,n,o)}(e,n,l[t]=function(e,t){const n=e=>{(e.timeStamp||Vo())>=n.attached-1&&it(function(e,t){if(S(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=(()=>Bo||(Wo.then(zo),Bo=Vo()))(),n}(o,r),i)}else s&&(!function(e,t,n,o){e.removeEventListener(t,n,o)}(e,n,s,i),l[t]=void 0)}}const Ho=/(?:Once|Passive|Capture)$/;const Ko=/^on[a-z]/;const Jo=k({patchProp:(e,t,n,o,r=!1,l,s,i,a)=>{switch(t){case"class":!function(e,t,n){if(null==t&&(t=""),n)e.setAttribute("class",t);else{const n=e._vtc;n&&(t=(t?[t,...n]:[...n]).join(" ")),e.className=t}}(e,o,r);break;case"style":!function(e,t,n){const o=e.style;if(n)if(R(n)){if(t!==n){const t=o.display;o.cssText=n,"_vod"in e&&(o.display=t)}}else{for(const e in n)$o(o,e,n[e]);if(t&&!R(t))for(const e in t)null==n[e]&&$o(o,e,"")}else e.removeAttribute("style")}(e,n,o);break;default:y(t)?_(t)||qo(e,t,0,o,s):function(e,t,n,o){if(o)return"innerHTML"===t||!!(t in e&&Ko.test(t)&&O(n));if("spellcheck"===t||"draggable"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if(Ko.test(t)&&R(n))return!1;return t in e}(e,t,o,r)?function(e,t,n,o,r,l,s){if("innerHTML"===t||"textContent"===t)return o&&s(o,r,l),void(e[t]=null==n?"":n);if("value"!==t||"PROGRESS"===e.tagName){if(""===n||null==n){const o=typeof e[t];if(""===n&&"boolean"===o)return void(e[t]=!0);if(null==n&&"string"===o)return e[t]="",void e.removeAttribute(t);if("number"===o)return e[t]=0,void e.removeAttribute(t)}try{e[t]=n}catch(i){}}else{e._value=n;const t=null==n?"":n;e.value!==t&&(e.value=t)}}(e,t,o,l,s,i,a):("true-value"===t?e._trueValue=o:"false-value"===t&&(e._falseValue=o),function(e,t,n,o){if(o&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(No,t.slice(6,t.length)):e.setAttributeNS(No,t,n);else{const o=c(t);null==n||o&&!1===n?e.removeAttribute(t):e.setAttribute(t,o?"":n)}}(e,t,o,r))}},forcePatchProp:(e,t)=>"value"===t},Mo);let Go;var Xo,Zo;(Zo=Xo||(Xo={})).Edit="edit",Zo.Display="display";const Qo=Symbol("Schlechtenburg mode");var Yo,er=new Uint8Array(16);function tr(){if(!Yo&&!(Yo="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Yo(er)}var nr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function or(e){return"string"==typeof e&&nr.test(e)}for(var rr=[],lr=0;lr<256;++lr)rr.push((lr+256).toString(16).substr(1));const sr=function(e,t,n){var o=(e=e||{}).random||(e.rng||tr)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=o[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(rr[e[t+0]]+rr[e[t+1]]+rr[e[t+2]]+rr[e[t+3]]+"-"+rr[e[t+4]]+rr[e[t+5]]+"-"+rr[e[t+6]]+rr[e[t+7]]+"-"+rr[e[t+8]]+rr[e[t+9]]+"-"+rr[e[t+10]]+rr[e[t+11]]+rr[e[t+12]]+rr[e[t+13]]+rr[e[t+14]]+rr[e[t+15]]).toLowerCase();if(!or(n))throw TypeError("Stringified UUID is invalid");return n}(o)},ir={prop:"block",event:"update"},cr={blockId:{type:String,default:sr}},ar=Symbol("Schlechtenburg active block");function ur(e=null){const t=oo(ar,et(null)),n=Ro((()=>t.value===e)),o=(n=e)=>{t.value===n&&(t.value=null)},r=e=>o();on((()=>{document.removeEventListener("click",r)}));const l=(n=e)=>{document.addEventListener("click",r,{once:!0}),t.value=n};return{activeBlockId:t,isActive:n,activate:l,deactivate:o,requestActivation:()=>{t.value||l()}}}const dr=Symbol("Schlechtenburg block library");function fr(){const e=oo(Qo,et(Xo.Edit)),t=oo(dr,ze({}));return{mode:e,customBlocks:t,getBlock:e=>t[e]}}const pr=Symbol("Schlechtenburg block dimensions"),hr=Symbol("Schlechtenburg editor dimensions");function vr(e,t){const n=et(null);no(t,n);const o=()=>{if(!e.value)return;const t=e.value.getBoundingClientRect();n.value={width:t.width,height:t.height,left:e.value.offsetLeft,top:e.value.offsetTop}},r=new ResizeObserver(o),l=new MutationObserver(o);return an(e,(()=>{e.value&&(r.observe(e.value),l.observe(e.value,{attributes:!0,childList:!1,subtree:!1}))})),{triggerSizeCalculation:o,dimensions:n}}function mr(){return{editorDimensions:oo(hr,et(null)),blockDimensions:oo(pr,et(null))}}const br=Symbol("Schlechtenburg block tree"),gr=Symbol("Schlechtenburg block tree register"),yr=Symbol("Schlechtenburg block tree unregister");function _r(){const e=oo(br,et(null)),t=oo(gr,(e=>{})),n=oo(yr,(e=>{})),o=ze({id:"",name:"",icon:"",children:[]});no(gr,(e=>{o.children.find((t=>t.id===e.id))||(o.children=[...o.children,e])})),no(yr,(({id:e})=>{o.children=o.children.filter((t=>t.id!==e))}));return rn((()=>{o.id&&n(o)})),{blockTree:e,register:e=>{if(!e.id)throw new Error(`Cannot register a block without an id: ${JSON.stringify(e)}`);o.id=e.id,o.name=e.name,t(o)}}}const kr=Sn({name:"sb-button",inheritAttrs:!1,setup:(e,t)=>()=>{var e,n;return Gn("button",l(l({},t.attrs),{class:(t.attrs.class||"")+" sb-button"}),[null==(n=(e=t.slots).default)?void 0:n.call(e)])}});const xr=Sn({name:"sb-context-menu",props:{onClose:{type:Function,default:()=>{}},onOpen:{type:Function,default:()=>{}}},setup(e,t){const n=et(!1),o=()=>{n.value=!0},r=()=>{n.value=!1},l=e=>{"Escape"===e.key&&r()},s=()=>{n.value?r():o()};return an(n,((t,n)=>{t!==n&&(t?setTimeout((()=>{document.body.addEventListener("click",r),document.body.addEventListener("keypress",l),e.onOpen()})):(document.body.removeEventListener("click",r),document.body.removeEventListener("keypress",l),e.onClose()))})),()=>{var e,l,i,c;return Gn("div",{class:"sb-context"},[(null==(l=(e=t.slots).context)?void 0:l.call(e,{opened:n,toggle:s,close:r,open:o}))||Gn(kr,{onClick:s},{default:()=>[Zn("Menu")]}),Gn("dialog",to({class:"sb-context-menu",open:!!n.value||void 0,onClick:e=>{e.stopPropagation()}},{onClose:r}),[(null==(c=(i=t.slots).default)?void 0:c.call(i,{opened:n,toggle:s,close:r,open:o}))||null])])}}});const wr=Sn({name:"sb-main-menu",setup(){const{blockTree:e}=_r(),{activate:t,activeBlockId:n}=ur(),o=(e,r)=>{var l,s;return Gn("li",{class:{"sb-tree-block-select__block":!0,"sb-tree-block-select__block_active":n.value===e.id}},[Gn("button",{class:"sb-tree-block-select__block-name",onClick:()=>{t(e.id),r()},onMouseenter:()=>t(e.id)},[e.name]),(null==(l=e.children)?void 0:l.length)?Gn("ul",{class:"sb-tree-block-select__list"},[null==(s=e.children)?void 0:s.map((e=>o(e,r)))]):null])};return()=>e.value?Gn(xr,{class:"sb-tree-block-select"},{context:({toggle:e})=>Gn(kr,{onClick:e},{default:()=>[Zn("Tree")]}),default:({close:t})=>Gn("ul",{class:"sb-tree-block-select__list sb-tree-block-select__list_base"},[o(e.value,t)])}):""}});const Er=Sn({name:"sb-main-menu",props:{block:{type:null,required:!0}},setup:()=>()=>Gn("div",{class:"sb-main-menu"},[Gn(wr,null,null)])});const Sr=Sn({name:"sb-block-toolbar",setup:()=>()=>Gn("div",{class:"sb-block-toolbar"},null)});const Cr=(e,t=[])=>{const n=e.parentElement;return n?n.classList.contains("sb-hover-cover")?Cr(n,[...t,n]):Cr(n,t):t},Or=new WeakMap,Rr=e=>{const t=Or.get(e.target);for(const n of t)n.classList.add("sb-hover-cover_child-hovered")},Fr=e=>{const t=Or.get(e.target);t&&t.length&&t[0].classList.remove("sb-hover-cover_child-hovered")};var jr={updated(e){e.classList.add("sb-hover-cover")},beforeMount(e){e.classList.add("sb-hover-cover")},mounted(e){e.classList.add("sb-hover-cover");const t=Cr(e);Or.set(e,t),console.log("got parents",e,t),e.addEventListener("mouseenter",Rr),e.addEventListener("mouseleave",Fr)},unmounted(e){e.removeEventListener("mouseenter",Rr),e.removeEventListener("mouseleave",Fr)}};let Pr;const Tr={},Ar=function(e,t){if(!t)return e();if(void 0===Pr){const e=document.createElement("link").relList;Pr=e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(t.map((e=>{if(e in Tr)return;Tr[e]=!0;const t=e.endsWith(".css"),n=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${n}`))return;const o=document.createElement("link");return o.rel=t?"stylesheet":Pr,t||(o.as="script",o.crossOrigin=""),o.href=e,document.head.appendChild(o),t?new Promise(((e,t)=>{o.addEventListener("load",e),o.addEventListener("error",t)})):void 0}))).then((()=>e()))};var Lr={name:"sb-missing-block",edit:Cn((()=>Ar((()=>__import__("./display.3df7ba9d.js")),["./assets/display.3df7ba9d.js","./assets/display.08a50fb3.css"]))),display:Cn((()=>Ar((()=>__import__("./display.3df7ba9d.js")),["./assets/display.3df7ba9d.js","./assets/display.08a50fb3.css"])))};const Mr=Sn({name:"sb-block",directives:{hoverCover:jr},props:{block:{type:null,required:!0},sortable:{type:String,default:null},onUpdate:{type:Function,default:()=>{}},onPrependBlock:{type:Function,default:()=>{}},onAppendBlock:{type:Function,default:()=>{}},onRemoveSelf:{type:Function,default:()=>{}},onActivatePrevious:{type:Function,default:()=>{}},onActivateNext:{type:Function,default:()=>{}}},setup(e,t){const n=et(null),{mode:o,getBlock:r}=fr(),{isActive:s,activate:i}=ur(e.block.id),c=Ro((()=>({"sb-block":!0,"sb-block_active":s.value}))),{triggerSizeCalculation:a}=vr(n,pr);an((()=>e.block.data),a);const{register:u}=_r();u(e.block),an(e.block,(()=>{u(e.block)}));const d=t=>{e.onUpdate(l(l({},e.block),{data:l(l({},e.block.data),t)}))};return()=>{var s;const a=null==(s=r(e.block.name))?void 0:s[o.value];if(!a){const t=Lr[o.value];return Gn(t,{name:e.block.name,blockId:e.block.id},null)}return o.value===Xo.Display?Gn(a,{data:e.block.data,blockId:e.block.id},null):function(e,t){if(null===At)return e;const n=At.proxy,o=e.dirs||(e.dirs=[]);for(let r=0;r{e.stopPropagation(),i()}},t.attrs)),null)]),[[In("hover-cover")]])}}});const Ir=Sn({name:"sb-main",model:ir,props:{customBlocks:{type:Array,default:()=>[]},block:{type:Object,required:!0},onUpdate:{type:Function,default:()=>{}},mode:{type:String,validator:e=>Object.values(Xo).includes(e),default:Xo.Edit}},setup(e){const t=et(null);vr(t,hr);const n=et(e.mode);no(Qo,n);const o=et(null);no(ar,o);const r=et(null);no(br,r),no(gr,(e=>{r.value=e})),no(yr,(()=>{r.value=null}));const s=qe(l({},e.customBlocks.reduce(((e,t)=>l(l({},e),{[t.name]:t})),{})));return no(dr,s),()=>Gn("div",{class:"sb-main",ref:t},[n.value===Xo.Edit?Gn(Un,null,[Gn(Er,{block:e.block},null),Gn(Sr,null,null)]):null,Gn(Mr,{block:e.block,onUpdate:e.onUpdate},null)])}});const $r=Sn({name:"sb-block-picker",props:{onPickedBlock:{type:Function,default:()=>{}}},setup(e,t){const n=et(!1),{customBlocks:o}=fr(),r=Ro((()=>Object.keys(o).map((e=>o[e]))));return()=>Gn("div",{class:"sb-block-picker"},[Gn(xr,{class:"sb-tree-block-select"},{context:e=>t.slots.context?t.slots.context(e):Gn(kr,{onClick:e.toggle},{default:()=>[Zn("Insert a block")]}),default:({close:t})=>r.value.map((o=>Gn(kr,{type:"button",onClick:()=>{(t=>{n.value=!1,e.onPickedBlock({name:t.name,id:""+ +new Date,data:t.getDefaultData()})})(o),t()}},{default:()=>[o.name]})))})])}});var Ur="object"==typeof global&&global&&global.Object===Object&&global,Dr="object"==typeof self&&self&&self.Object===Object&&self,Nr=Ur||Dr||Function("return this")(),Vr=Nr.Symbol,Br=Object.prototype,Wr=Br.hasOwnProperty,zr=Br.toString,qr=Vr?Vr.toStringTag:void 0;var Hr=Object.prototype.toString;var Kr=Vr?Vr.toStringTag:void 0;function Jr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kr&&Kr in Object(e)?function(e){var t=Wr.call(e,qr),n=e[qr];try{e[qr]=void 0;var o=!0}catch(l){}var r=zr.call(e);return o&&(t?e[qr]=n:delete e[qr]),r}(e):function(e){return Hr.call(e)}(e)}var Gr=/\s/;var Xr=/^\s+/;function Zr(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Gr.test(e.charAt(t)););return t}(e)+1).replace(Xr,""):e}function Qr(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var Yr=/^[-+]0x[0-9a-f]+$/i,el=/^0b[01]+$/i,tl=/^0o[0-7]+$/i,nl=parseInt;function ol(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==Jr(e)}(e))return NaN;if(Qr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Zr(e);var n=el.test(e);return n||tl.test(e)?nl(e.slice(2),n?2:8):Yr.test(e)?NaN:+e}var rl=function(){return Nr.Date.now()},ll=Math.max,sl=Math.min;function il(e,t,n){var o,r,l,s,i,c,a=0,u=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=o,l=r;return o=r=void 0,a=t,s=e.apply(l,n)}function h(e){return a=e,i=setTimeout(m,t),u?p(e):s}function v(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-a>=l}function m(){var e=rl();if(v(e))return b(e);i=setTimeout(m,function(e){var n=t-(e-c);return d?sl(n,l-(e-a)):n}(e))}function b(e){return i=void 0,f&&o?p(e):(o=r=void 0,s)}function g(){var e=rl(),n=v(e);if(o=arguments,r=this,c=e,n){if(void 0===i)return h(c);if(d)return clearTimeout(i),i=setTimeout(m,t),p(c)}return void 0===i&&(i=setTimeout(m,t)),s}return t=ol(t)||0,Qr(n)&&(u=!!n.leading,l=(d="maxWait"in n)?ll(ol(n.maxWait)||0,t):l,f="trailing"in n?!!n.trailing:f),g.cancel=function(){void 0!==i&&clearTimeout(i),a=0,o=c=r=i=void 0},g.flush=function(){return void 0===i?s:b(rl())},g}const cl=Sn({name:"sb-block-ordering",props:{orientation:{type:String,default:null},onRemove:{type:Function,default:()=>{}},onMoveBackward:{type:Function,default:()=>{}},onMoveForward:{type:Function,default:()=>{}}},setup(e){const t=ze({top:"",right:""}),n=Ro((()=>({"sb-block-ordering":!0,[`sb-block-ordering_${e.orientation}`]:!!e.orientation}))),{editorDimensions:o,blockDimensions:r}=mr(),l=il((()=>{if(!o.value||!r.value)return;const e=o.value.width-r.value.left;t.top=`${r.value.top}px`,t.right=`${e}px`}));return an(o,l),an(r,l),an((()=>e.orientation),l),()=>Gn("div",{class:n.value,style:t,onClick:e=>e.stopPropagation()},[Gn(kr,{onClick:e.onMoveBackward},{default:()=>["vertical"===e.orientation?"↑":"←"]}),Gn(kr,{onClick:e.onRemove},{default:()=>[Zn("x")]}),Gn(kr,{onClick:e.onMoveForward},{default:()=>["vertical"===e.orientation?"↓":"→"]})])}});const al=Sn({name:"sb-block-placeholder",props:{onInsertBlock:{type:Function,default:()=>{}}},setup:e=>()=>Gn("div",{class:"sb-block-placeholder"},[Gn($r,{onPickedBlock:t=>e.onInsertBlock(t)},null)])});const ul=Sn({name:"sb-toolbar",setup(e,t){const n=ze({bottom:"",left:"",maxWidth:""}),{editorDimensions:o,blockDimensions:r}=mr(),l=il((()=>{if(!o.value||!r.value)return;const e=o.value.height-r.value.top;n.bottom=`${e}px`,n.left=`${r.value.left}px`,n.maxWidth=`${r.value.width}px`}));return an(o,l),an(r,l),()=>{var e,o;return Gn("div",{class:"sb-toolbar",style:n,onClick:e=>e.stopPropagation()},[null==(o=null==(e=t.slots)?void 0:e.default)?void 0:o.call(e)])}}});const dl=Sn({name:"sb-select",inheritAttrs:!1,setup:(e,t)=>()=>{var e,n;return Gn("div",{class:"sb-select"},[Gn("select",to({class:"sb-select__input"},t.attrs),[null==(n=(e=t.slots).default)?void 0:n.call(e)])])}}),fl=()=>({orientation:"vertical",children:[]});var pl={name:"sb-layout",getDefaultData:fl,edit:Cn((()=>Ar((()=>__import__("./edit.0e6928af.js")),["./assets/edit.0e6928af.js","./assets/style.b876754e.css"]))),display:Cn((()=>Ar((()=>__import__("./display.53aa9250.js")),["./assets/display.53aa9250.js","./assets/style.b876754e.css"])))};const hl=()=>({value:"",align:"left",level:1});var vl={name:"sb-heading",getDefaultData:hl,edit:Cn((()=>Ar((()=>__import__("./edit.146d9acf.js")),["./assets/edit.146d9acf.js","./assets/style.79535ad9.css"]))),display:Cn((()=>Ar((()=>__import__("./display.f1bc6040.js")),["./assets/display.f1bc6040.js","./assets/style.79535ad9.css"])))};const ml=()=>({value:"",align:"left"});var bl={name:"sb-paragraph",getDefaultData:ml,edit:Cn((()=>Ar((()=>__import__("./edit.e32652b3.js")),["./assets/edit.e32652b3.js","./assets/style.3e24e605.css"]))),display:Cn((()=>Ar((()=>__import__("./display.9143f05a.js")),["./assets/display.9143f05a.js","./assets/style.3e24e605.css"])))};const gl=()=>({src:"",alt:"",description:{id:sr(),name:"sb-paragraph",data:{value:"",align:"left"}}});var yl={name:"sb-image",getDefaultData:gl,edit:Cn((()=>Ar((()=>__import__("./edit.849203b1.js")),["./assets/edit.849203b1.js","./assets/style.d3f26b5f.css"]))),display:Cn((()=>Ar((()=>__import__("./display.b625d393.js")),["./assets/display.b625d393.js","./assets/style.d3f26b5f.css"])))};((...e)=>{const t=(Go||(Go=Pn(Jo))).createApp(...e),{mount:n}=t;return t.mount=e=>{const o=function(e){if(R(e)){return document.querySelector(e)}return e}(e);if(!o)return;const r=t._component;O(r)||r.render||r.template||(r.template=o.innerHTML),o.innerHTML="";const l=n(o);return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),l},t})(Sn({name:"App",setup(){const e=et("edit"),t=ze({name:"none",id:"0",data:null});Yt((async()=>{const e=await fetch("./initial-data.json"),n=await e.json();t.name=n.name,t.id=n.id,t.data=n.data}));const n=Ro((()=>{switch(e.value){case Xo.Edit:return Gn(Ir,{block:t,onUpdate:e=>{t.data=e.data},customBlocks:[pl,vl,yl,bl],key:"edit",mode:Xo.Edit},null);case Xo.Display:return Gn(Ir,{block:t,customBlocks:[pl,vl,yl,bl],key:"display",mode:Xo.Display},null);case"data":return Gn("pre",null,[Gn("code",null,[JSON.stringify(t,null,2)])])}}));return()=>Gn("div",{class:"app",id:"app"},[Gn("select",{class:"app--mode",value:e.value,onChange:t=>{e.value=t.target.value}},[Gn("option",null,[Zn("edit")]),Gn("option",null,[Zn("display")]),Gn("option",null,[Zn("data")])]),n.value])}})).mount("#app");export{Un as F,ul as S,Gn as a,kr as b,Ro as c,Sn as d,Mr as e,to as f,fl as g,cl as h,al as i,hl as j,et as k,dl as l,ir as m,Zn as n,en as o,ml as p,Fo as q,ze as r,gl as s,cr as t,ur as u,an as w}; +//# sourceMappingURL=index.2f19b693.js.map diff --git a/packages/docs/docs/assets/index.2f19b693.js.map b/packages/docs/docs/assets/index.2f19b693.js.map new file mode 100644 index 0000000..dcd57e6 --- /dev/null +++ b/packages/docs/docs/assets/index.2f19b693.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.2f19b693.js","sources":["../../node_modules/@vue/shared/dist/shared.esm-bundler.js","../../vite/dynamic-import-polyfill","../../node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js","../../node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js","../../node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js","../../../core/lib/mode.ts","../../../core/node_modules/uuid/dist/esm-browser/rng.js","../../../core/node_modules/uuid/dist/esm-browser/regex.js","../../../core/node_modules/uuid/dist/esm-browser/validate.js","../../../core/node_modules/uuid/dist/esm-browser/stringify.js","../../../core/lib/block-helpers.ts","../../../core/node_modules/uuid/dist/esm-browser/v4.js","../../../core/lib/use-activation.ts","../../../core/lib/use-dynamic-blocks.ts","../../../core/lib/use-resize-observer.ts","../../../core/lib/use-block-tree.ts","../../../core/lib/components/Button.tsx","../../../core/lib/components/ContextMenu.tsx","../../../core/lib/components/TreeBlockSelect.tsx","../../../core/lib/components/MainMenu.tsx","../../../core/lib/components/BlockToolbar.tsx","../../../core/lib/directives/hover-cover.ts","../../vite/preload-helper","../../../core/lib/components/MissingBlock/index.ts","../../../core/lib/components/Block.tsx","../../../core/lib/components/Schlechtenburg.tsx","../../../core/lib/components/BlockPicker.tsx","../../../core/node_modules/lodash-es/_freeGlobal.js","../../../core/node_modules/lodash-es/_root.js","../../../core/node_modules/lodash-es/_Symbol.js","../../../core/node_modules/lodash-es/_getRawTag.js","../../../core/node_modules/lodash-es/_objectToString.js","../../../core/node_modules/lodash-es/_baseGetTag.js","../../../core/node_modules/lodash-es/_trimmedEndIndex.js","../../../core/node_modules/lodash-es/_baseTrim.js","../../../core/node_modules/lodash-es/isObject.js","../../../core/node_modules/lodash-es/toNumber.js","../../../core/node_modules/lodash-es/isSymbol.js","../../../core/node_modules/lodash-es/isObjectLike.js","../../../core/node_modules/lodash-es/now.js","../../../core/node_modules/lodash-es/debounce.js","../../../core/lib/components/BlockOrdering.tsx","../../../core/lib/components/BlockPlaceholder.tsx","../../../core/lib/components/Toolbar.tsx","../../../core/lib/components/Select.tsx","../../../layout/lib/util.ts","../../../layout/lib/index.ts","../../../heading/lib/util.ts","../../../heading/lib/index.ts","../../../paragraph/lib/util.ts","../../../paragraph/lib/index.ts","../../../image/lib/util.ts","../../../image/lib/index.ts","../../lib/main.ts","../../lib/App.tsx"],"sourcesContent":["/**\r\n * Make a map and return a function for checking if a key\r\n * is in that map.\r\n * IMPORTANT: all calls of this function must be prefixed with\r\n * \\/\\*#\\_\\_PURE\\_\\_\\*\\/\r\n * So that rollup can tree-shake them if necessary.\r\n */\r\nfunction makeMap(str, expectsLowerCase) {\r\n const map = Object.create(null);\r\n const list = str.split(',');\r\n for (let i = 0; i < list.length; i++) {\r\n map[list[i]] = true;\r\n }\r\n return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];\r\n}\n\n/**\r\n * dev only flag -> name mapping\r\n */\r\nconst PatchFlagNames = {\r\n [1 /* TEXT */]: `TEXT`,\r\n [2 /* CLASS */]: `CLASS`,\r\n [4 /* STYLE */]: `STYLE`,\r\n [8 /* PROPS */]: `PROPS`,\r\n [16 /* FULL_PROPS */]: `FULL_PROPS`,\r\n [32 /* HYDRATE_EVENTS */]: `HYDRATE_EVENTS`,\r\n [64 /* STABLE_FRAGMENT */]: `STABLE_FRAGMENT`,\r\n [128 /* KEYED_FRAGMENT */]: `KEYED_FRAGMENT`,\r\n [256 /* UNKEYED_FRAGMENT */]: `UNKEYED_FRAGMENT`,\r\n [512 /* NEED_PATCH */]: `NEED_PATCH`,\r\n [1024 /* DYNAMIC_SLOTS */]: `DYNAMIC_SLOTS`,\r\n [2048 /* DEV_ROOT_FRAGMENT */]: `DEV_ROOT_FRAGMENT`,\r\n [-1 /* HOISTED */]: `HOISTED`,\r\n [-2 /* BAIL */]: `BAIL`\r\n};\n\n/**\r\n * Dev only\r\n */\r\nconst slotFlagsText = {\r\n [1 /* STABLE */]: 'STABLE',\r\n [2 /* DYNAMIC */]: 'DYNAMIC',\r\n [3 /* FORWARDED */]: 'FORWARDED'\r\n};\n\nconst GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +\r\n 'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +\r\n 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';\r\nconst isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);\n\nconst range = 2;\r\nfunction generateCodeFrame(source, start = 0, end = source.length) {\r\n const lines = source.split(/\\r?\\n/);\r\n let count = 0;\r\n const res = [];\r\n for (let i = 0; i < lines.length; i++) {\r\n count += lines[i].length + 1;\r\n if (count >= start) {\r\n for (let j = i - range; j <= i + range || end > count; j++) {\r\n if (j < 0 || j >= lines.length)\r\n continue;\r\n const line = j + 1;\r\n res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);\r\n const lineLength = lines[j].length;\r\n if (j === i) {\r\n // push underline\r\n const pad = start - (count - lineLength) + 1;\r\n const length = Math.max(1, end > count ? lineLength - pad : end - start);\r\n res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));\r\n }\r\n else if (j > i) {\r\n if (end > count) {\r\n const length = Math.max(Math.min(end - count, lineLength), 1);\r\n res.push(` | ` + '^'.repeat(length));\r\n }\r\n count += lineLength + 1;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n return res.join('\\n');\r\n}\n\n/**\r\n * On the client we only need to offer special cases for boolean attributes that\r\n * have different names from their corresponding dom properties:\r\n * - itemscope -> N/A\r\n * - allowfullscreen -> allowFullscreen\r\n * - formnovalidate -> formNoValidate\r\n * - ismap -> isMap\r\n * - nomodule -> noModule\r\n * - novalidate -> noValidate\r\n * - readonly -> readOnly\r\n */\r\nconst specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\r\nconst isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);\r\n/**\r\n * The full list is needed during SSR to produce the correct initial markup.\r\n */\r\nconst isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +\r\n `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +\r\n `loop,open,required,reversed,scoped,seamless,` +\r\n `checked,muted,multiple,selected`);\r\nconst unsafeAttrCharRE = /[>/=\"'\\u0009\\u000a\\u000c\\u0020]/;\r\nconst attrValidationCache = {};\r\nfunction isSSRSafeAttrName(name) {\r\n if (attrValidationCache.hasOwnProperty(name)) {\r\n return attrValidationCache[name];\r\n }\r\n const isUnsafe = unsafeAttrCharRE.test(name);\r\n if (isUnsafe) {\r\n console.error(`unsafe attribute name: ${name}`);\r\n }\r\n return (attrValidationCache[name] = !isUnsafe);\r\n}\r\nconst propsToAttrMap = {\r\n acceptCharset: 'accept-charset',\r\n className: 'class',\r\n htmlFor: 'for',\r\n httpEquiv: 'http-equiv'\r\n};\r\n/**\r\n * CSS properties that accept plain numbers\r\n */\r\nconst isNoUnitNumericStyleProp = /*#__PURE__*/ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,` +\r\n `border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,` +\r\n `columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,` +\r\n `grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,` +\r\n `grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,` +\r\n `line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,` +\r\n // SVG\r\n `fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,` +\r\n `stroke-miterlimit,stroke-opacity,stroke-width`);\r\n/**\r\n * Known attributes, this is used for stringification of runtime static nodes\r\n * so that we don't stringify bindings that cannot be set from HTML.\r\n * Don't also forget to allow `data-*` and `aria-*`!\r\n * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes\r\n */\r\nconst isKnownAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +\r\n `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +\r\n `border,buffered,capture,challenge,charset,checked,cite,class,code,` +\r\n `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +\r\n `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +\r\n `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +\r\n `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +\r\n `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +\r\n `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +\r\n `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +\r\n `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +\r\n `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +\r\n `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +\r\n `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +\r\n `value,width,wrap`);\n\nfunction normalizeStyle(value) {\r\n if (isArray(value)) {\r\n const res = {};\r\n for (let i = 0; i < value.length; i++) {\r\n const item = value[i];\r\n const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item);\r\n if (normalized) {\r\n for (const key in normalized) {\r\n res[key] = normalized[key];\r\n }\r\n }\r\n }\r\n return res;\r\n }\r\n else if (isObject(value)) {\r\n return value;\r\n }\r\n}\r\nconst listDelimiterRE = /;(?![^(]*\\))/g;\r\nconst propertyDelimiterRE = /:(.+)/;\r\nfunction parseStringStyle(cssText) {\r\n const ret = {};\r\n cssText.split(listDelimiterRE).forEach(item => {\r\n if (item) {\r\n const tmp = item.split(propertyDelimiterRE);\r\n tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\r\n }\r\n });\r\n return ret;\r\n}\r\nfunction stringifyStyle(styles) {\r\n let ret = '';\r\n if (!styles) {\r\n return ret;\r\n }\r\n for (const key in styles) {\r\n const value = styles[key];\r\n const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);\r\n if (isString(value) ||\r\n (typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) {\r\n // only render valid values\r\n ret += `${normalizedKey}:${value};`;\r\n }\r\n }\r\n return ret;\r\n}\r\nfunction normalizeClass(value) {\r\n let res = '';\r\n if (isString(value)) {\r\n res = value;\r\n }\r\n else if (isArray(value)) {\r\n for (let i = 0; i < value.length; i++) {\r\n const normalized = normalizeClass(value[i]);\r\n if (normalized) {\r\n res += normalized + ' ';\r\n }\r\n }\r\n }\r\n else if (isObject(value)) {\r\n for (const name in value) {\r\n if (value[name]) {\r\n res += name + ' ';\r\n }\r\n }\r\n }\r\n return res.trim();\r\n}\n\n// These tag configs are shared between compiler-dom and runtime-dom, so they\r\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Element\r\nconst HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +\r\n 'header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,' +\r\n 'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +\r\n 'data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,' +\r\n 'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +\r\n 'canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,' +\r\n 'th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,' +\r\n 'option,output,progress,select,textarea,details,dialog,menu,' +\r\n 'summary,template,blockquote,iframe,tfoot';\r\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Element\r\nconst SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +\r\n 'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +\r\n 'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +\r\n 'feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +\r\n 'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +\r\n 'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +\r\n 'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +\r\n 'mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,' +\r\n 'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +\r\n 'text,textPath,title,tspan,unknown,use,view';\r\nconst VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';\r\nconst isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);\r\nconst isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);\r\nconst isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);\n\nconst escapeRE = /[\"'&<>]/;\r\nfunction escapeHtml(string) {\r\n const str = '' + string;\r\n const match = escapeRE.exec(str);\r\n if (!match) {\r\n return str;\r\n }\r\n let html = '';\r\n let escaped;\r\n let index;\r\n let lastIndex = 0;\r\n for (index = match.index; index < str.length; index++) {\r\n switch (str.charCodeAt(index)) {\r\n case 34: // \"\r\n escaped = '"';\r\n break;\r\n case 38: // &\r\n escaped = '&';\r\n break;\r\n case 39: // '\r\n escaped = ''';\r\n break;\r\n case 60: // <\r\n escaped = '<';\r\n break;\r\n case 62: // >\r\n escaped = '>';\r\n break;\r\n default:\r\n continue;\r\n }\r\n if (lastIndex !== index) {\r\n html += str.substring(lastIndex, index);\r\n }\r\n lastIndex = index + 1;\r\n html += escaped;\r\n }\r\n return lastIndex !== index ? html + str.substring(lastIndex, index) : html;\r\n}\r\n// https://www.w3.org/TR/html52/syntax.html#comments\r\nconst commentStripRE = /^-?>||--!>| looseEqual(item, val));\r\n}\n\n/**\r\n * For converting {{ interpolation }} values to displayed strings.\r\n * @private\r\n */\r\nconst toDisplayString = (val) => {\r\n return val == null\r\n ? ''\r\n : isObject(val)\r\n ? JSON.stringify(val, replacer, 2)\r\n : String(val);\r\n};\r\nconst replacer = (_key, val) => {\r\n if (isMap(val)) {\r\n return {\r\n [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val]) => {\r\n entries[`${key} =>`] = val;\r\n return entries;\r\n }, {})\r\n };\r\n }\r\n else if (isSet(val)) {\r\n return {\r\n [`Set(${val.size})`]: [...val.values()]\r\n };\r\n }\r\n else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {\r\n return String(val);\r\n }\r\n return val;\r\n};\n\n/**\r\n * List of @babel/parser plugins that are used for template expression\r\n * transforms and SFC script transforms. By default we enable proposals slated\r\n * for ES2020. This will need to be updated as the spec moves forward.\r\n * Full list at https://babeljs.io/docs/en/next/babel-parser#plugins\r\n */\r\nconst babelParserDefaultPlugins = [\r\n 'bigInt',\r\n 'optionalChaining',\r\n 'nullishCoalescingOperator'\r\n];\r\nconst EMPTY_OBJ = (process.env.NODE_ENV !== 'production')\r\n ? Object.freeze({})\r\n : {};\r\nconst EMPTY_ARR = (process.env.NODE_ENV !== 'production') ? Object.freeze([]) : [];\r\nconst NOOP = () => { };\r\n/**\r\n * Always return false.\r\n */\r\nconst NO = () => false;\r\nconst onRE = /^on[^a-z]/;\r\nconst isOn = (key) => onRE.test(key);\r\nconst isModelListener = (key) => key.startsWith('onUpdate:');\r\nconst extend = Object.assign;\r\nconst remove = (arr, el) => {\r\n const i = arr.indexOf(el);\r\n if (i > -1) {\r\n arr.splice(i, 1);\r\n }\r\n};\r\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\r\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key);\r\nconst isArray = Array.isArray;\r\nconst isMap = (val) => toTypeString(val) === '[object Map]';\r\nconst isSet = (val) => toTypeString(val) === '[object Set]';\r\nconst isDate = (val) => val instanceof Date;\r\nconst isFunction = (val) => typeof val === 'function';\r\nconst isString = (val) => typeof val === 'string';\r\nconst isSymbol = (val) => typeof val === 'symbol';\r\nconst isObject = (val) => val !== null && typeof val === 'object';\r\nconst isPromise = (val) => {\r\n return isObject(val) && isFunction(val.then) && isFunction(val.catch);\r\n};\r\nconst objectToString = Object.prototype.toString;\r\nconst toTypeString = (value) => objectToString.call(value);\r\nconst toRawType = (value) => {\r\n // extract \"RawType\" from strings like \"[object RawType]\"\r\n return toTypeString(value).slice(8, -1);\r\n};\r\nconst isPlainObject = (val) => toTypeString(val) === '[object Object]';\r\nconst isIntegerKey = (key) => isString(key) &&\r\n key !== 'NaN' &&\r\n key[0] !== '-' &&\r\n '' + parseInt(key, 10) === key;\r\nconst isReservedProp = /*#__PURE__*/ makeMap(\r\n// the leading comma is intentional so empty string \"\" is also included\r\n',key,ref,' +\r\n 'onVnodeBeforeMount,onVnodeMounted,' +\r\n 'onVnodeBeforeUpdate,onVnodeUpdated,' +\r\n 'onVnodeBeforeUnmount,onVnodeUnmounted');\r\nconst cacheStringFunction = (fn) => {\r\n const cache = Object.create(null);\r\n return ((str) => {\r\n const hit = cache[str];\r\n return hit || (cache[str] = fn(str));\r\n });\r\n};\r\nconst camelizeRE = /-(\\w)/g;\r\n/**\r\n * @private\r\n */\r\nconst camelize = cacheStringFunction((str) => {\r\n return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));\r\n});\r\nconst hyphenateRE = /\\B([A-Z])/g;\r\n/**\r\n * @private\r\n */\r\nconst hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase());\r\n/**\r\n * @private\r\n */\r\nconst capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));\r\n/**\r\n * @private\r\n */\r\nconst toHandlerKey = cacheStringFunction((str) => (str ? `on${capitalize(str)}` : ``));\r\n// compare whether a value has changed, accounting for NaN.\r\nconst hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);\r\nconst invokeArrayFns = (fns, arg) => {\r\n for (let i = 0; i < fns.length; i++) {\r\n fns[i](arg);\r\n }\r\n};\r\nconst def = (obj, key, value) => {\r\n Object.defineProperty(obj, key, {\r\n configurable: true,\r\n enumerable: false,\r\n value\r\n });\r\n};\r\nconst toNumber = (val) => {\r\n const n = parseFloat(val);\r\n return isNaN(n) ? val : n;\r\n};\r\nlet _globalThis;\r\nconst getGlobalThis = () => {\r\n return (_globalThis ||\r\n (_globalThis =\r\n typeof globalThis !== 'undefined'\r\n ? globalThis\r\n : typeof self !== 'undefined'\r\n ? self\r\n : typeof window !== 'undefined'\r\n ? window\r\n : typeof global !== 'undefined'\r\n ? global\r\n : {}));\r\n};\n\nexport { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, babelParserDefaultPlugins, camelize, capitalize, def, escapeHtml, escapeHtmlComment, extend, generateCodeFrame, getGlobalThis, hasChanged, hasOwn, hyphenate, invokeArrayFns, isArray, isBooleanAttr, isDate, isFunction, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownAttr, isMap, isModelListener, isNoUnitNumericStyleProp, isObject, isOn, isPlainObject, isPromise, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, makeMap, normalizeClass, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };\n","const p = function polyfill(modulePath = '.', importFunctionName = '__import__') {\n try {\n self[importFunctionName] = new Function('u', `return import(u)`);\n }\n catch (error) {\n const baseURL = new URL(modulePath, location);\n const cleanup = (script) => {\n URL.revokeObjectURL(script.src);\n script.remove();\n };\n self[importFunctionName] = (url) => new Promise((resolve, reject) => {\n const absURL = new URL(url, baseURL);\n // If the module has already been imported, resolve immediately.\n if (self[importFunctionName].moduleMap[absURL]) {\n return resolve(self[importFunctionName].moduleMap[absURL]);\n }\n const moduleBlob = new Blob([\n `import * as m from '${absURL}';`,\n `${importFunctionName}.moduleMap['${absURL}']=m;`\n ], { type: 'text/javascript' });\n const script = Object.assign(document.createElement('script'), {\n type: 'module',\n src: URL.createObjectURL(moduleBlob),\n onerror() {\n reject(new Error(`Failed to import: ${url}`));\n cleanup(script);\n },\n onload() {\n resolve(self[importFunctionName].moduleMap[absURL]);\n cleanup(script);\n }\n });\n document.head.appendChild(script);\n });\n self[importFunctionName].moduleMap = {};\n }\n};__VITE_IS_MODERN__&&p(\"assets/\");","import { EMPTY_OBJ, isArray, isMap, isIntegerKey, isSymbol, extend, hasOwn, isObject, hasChanged, makeMap, capitalize, toRawType, def, isFunction, NOOP } from '@vue/shared';\n\nconst targetMap = new WeakMap();\r\nconst effectStack = [];\r\nlet activeEffect;\r\nconst ITERATE_KEY = Symbol((process.env.NODE_ENV !== 'production') ? 'iterate' : '');\r\nconst MAP_KEY_ITERATE_KEY = Symbol((process.env.NODE_ENV !== 'production') ? 'Map key iterate' : '');\r\nfunction isEffect(fn) {\r\n return fn && fn._isEffect === true;\r\n}\r\nfunction effect(fn, options = EMPTY_OBJ) {\r\n if (isEffect(fn)) {\r\n fn = fn.raw;\r\n }\r\n const effect = createReactiveEffect(fn, options);\r\n if (!options.lazy) {\r\n effect();\r\n }\r\n return effect;\r\n}\r\nfunction stop(effect) {\r\n if (effect.active) {\r\n cleanup(effect);\r\n if (effect.options.onStop) {\r\n effect.options.onStop();\r\n }\r\n effect.active = false;\r\n }\r\n}\r\nlet uid = 0;\r\nfunction createReactiveEffect(fn, options) {\r\n const effect = function reactiveEffect() {\r\n if (!effect.active) {\r\n return options.scheduler ? undefined : fn();\r\n }\r\n if (!effectStack.includes(effect)) {\r\n cleanup(effect);\r\n try {\r\n enableTracking();\r\n effectStack.push(effect);\r\n activeEffect = effect;\r\n return fn();\r\n }\r\n finally {\r\n effectStack.pop();\r\n resetTracking();\r\n activeEffect = effectStack[effectStack.length - 1];\r\n }\r\n }\r\n };\r\n effect.id = uid++;\r\n effect.allowRecurse = !!options.allowRecurse;\r\n effect._isEffect = true;\r\n effect.active = true;\r\n effect.raw = fn;\r\n effect.deps = [];\r\n effect.options = options;\r\n return effect;\r\n}\r\nfunction cleanup(effect) {\r\n const { deps } = effect;\r\n if (deps.length) {\r\n for (let i = 0; i < deps.length; i++) {\r\n deps[i].delete(effect);\r\n }\r\n deps.length = 0;\r\n }\r\n}\r\nlet shouldTrack = true;\r\nconst trackStack = [];\r\nfunction pauseTracking() {\r\n trackStack.push(shouldTrack);\r\n shouldTrack = false;\r\n}\r\nfunction enableTracking() {\r\n trackStack.push(shouldTrack);\r\n shouldTrack = true;\r\n}\r\nfunction resetTracking() {\r\n const last = trackStack.pop();\r\n shouldTrack = last === undefined ? true : last;\r\n}\r\nfunction track(target, type, key) {\r\n if (!shouldTrack || activeEffect === undefined) {\r\n return;\r\n }\r\n let depsMap = targetMap.get(target);\r\n if (!depsMap) {\r\n targetMap.set(target, (depsMap = new Map()));\r\n }\r\n let dep = depsMap.get(key);\r\n if (!dep) {\r\n depsMap.set(key, (dep = new Set()));\r\n }\r\n if (!dep.has(activeEffect)) {\r\n dep.add(activeEffect);\r\n activeEffect.deps.push(dep);\r\n if ((process.env.NODE_ENV !== 'production') && activeEffect.options.onTrack) {\r\n activeEffect.options.onTrack({\r\n effect: activeEffect,\r\n target,\r\n type,\r\n key\r\n });\r\n }\r\n }\r\n}\r\nfunction trigger(target, type, key, newValue, oldValue, oldTarget) {\r\n const depsMap = targetMap.get(target);\r\n if (!depsMap) {\r\n // never been tracked\r\n return;\r\n }\r\n const effects = new Set();\r\n const add = (effectsToAdd) => {\r\n if (effectsToAdd) {\r\n effectsToAdd.forEach(effect => {\r\n if (effect !== activeEffect || effect.allowRecurse) {\r\n effects.add(effect);\r\n }\r\n });\r\n }\r\n };\r\n if (type === \"clear\" /* CLEAR */) {\r\n // collection being cleared\r\n // trigger all effects for target\r\n depsMap.forEach(add);\r\n }\r\n else if (key === 'length' && isArray(target)) {\r\n depsMap.forEach((dep, key) => {\r\n if (key === 'length' || key >= newValue) {\r\n add(dep);\r\n }\r\n });\r\n }\r\n else {\r\n // schedule runs for SET | ADD | DELETE\r\n if (key !== void 0) {\r\n add(depsMap.get(key));\r\n }\r\n // also run for iteration key on ADD | DELETE | Map.SET\r\n switch (type) {\r\n case \"add\" /* ADD */:\r\n if (!isArray(target)) {\r\n add(depsMap.get(ITERATE_KEY));\r\n if (isMap(target)) {\r\n add(depsMap.get(MAP_KEY_ITERATE_KEY));\r\n }\r\n }\r\n else if (isIntegerKey(key)) {\r\n // new index added to array -> length changes\r\n add(depsMap.get('length'));\r\n }\r\n break;\r\n case \"delete\" /* DELETE */:\r\n if (!isArray(target)) {\r\n add(depsMap.get(ITERATE_KEY));\r\n if (isMap(target)) {\r\n add(depsMap.get(MAP_KEY_ITERATE_KEY));\r\n }\r\n }\r\n break;\r\n case \"set\" /* SET */:\r\n if (isMap(target)) {\r\n add(depsMap.get(ITERATE_KEY));\r\n }\r\n break;\r\n }\r\n }\r\n const run = (effect) => {\r\n if ((process.env.NODE_ENV !== 'production') && effect.options.onTrigger) {\r\n effect.options.onTrigger({\r\n effect,\r\n target,\r\n key,\r\n type,\r\n newValue,\r\n oldValue,\r\n oldTarget\r\n });\r\n }\r\n if (effect.options.scheduler) {\r\n effect.options.scheduler(effect);\r\n }\r\n else {\r\n effect();\r\n }\r\n };\r\n effects.forEach(run);\r\n}\n\nconst isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);\r\nconst builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol)\r\n .map(key => Symbol[key])\r\n .filter(isSymbol));\r\nconst get = /*#__PURE__*/ createGetter();\r\nconst shallowGet = /*#__PURE__*/ createGetter(false, true);\r\nconst readonlyGet = /*#__PURE__*/ createGetter(true);\r\nconst shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);\r\nconst arrayInstrumentations = {};\r\n['includes', 'indexOf', 'lastIndexOf'].forEach(key => {\r\n const method = Array.prototype[key];\r\n arrayInstrumentations[key] = function (...args) {\r\n const arr = toRaw(this);\r\n for (let i = 0, l = this.length; i < l; i++) {\r\n track(arr, \"get\" /* GET */, i + '');\r\n }\r\n // we run the method using the original args first (which may be reactive)\r\n const res = method.apply(arr, args);\r\n if (res === -1 || res === false) {\r\n // if that didn't work, run it again using raw values.\r\n return method.apply(arr, args.map(toRaw));\r\n }\r\n else {\r\n return res;\r\n }\r\n };\r\n});\r\n['push', 'pop', 'shift', 'unshift', 'splice'].forEach(key => {\r\n const method = Array.prototype[key];\r\n arrayInstrumentations[key] = function (...args) {\r\n pauseTracking();\r\n const res = method.apply(this, args);\r\n resetTracking();\r\n return res;\r\n };\r\n});\r\nfunction createGetter(isReadonly = false, shallow = false) {\r\n return function get(target, key, receiver) {\r\n if (key === \"__v_isReactive\" /* IS_REACTIVE */) {\r\n return !isReadonly;\r\n }\r\n else if (key === \"__v_isReadonly\" /* IS_READONLY */) {\r\n return isReadonly;\r\n }\r\n else if (key === \"__v_raw\" /* RAW */ &&\r\n receiver === (isReadonly ? readonlyMap : reactiveMap).get(target)) {\r\n return target;\r\n }\r\n const targetIsArray = isArray(target);\r\n if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) {\r\n return Reflect.get(arrayInstrumentations, key, receiver);\r\n }\r\n const res = Reflect.get(target, key, receiver);\r\n if (isSymbol(key)\r\n ? builtInSymbols.has(key)\r\n : isNonTrackableKeys(key)) {\r\n return res;\r\n }\r\n if (!isReadonly) {\r\n track(target, \"get\" /* GET */, key);\r\n }\r\n if (shallow) {\r\n return res;\r\n }\r\n if (isRef(res)) {\r\n // ref unwrapping - does not apply for Array + integer key.\r\n const shouldUnwrap = !targetIsArray || !isIntegerKey(key);\r\n return shouldUnwrap ? res.value : res;\r\n }\r\n if (isObject(res)) {\r\n // Convert returned value into a proxy as well. we do the isObject check\r\n // here to avoid invalid value warning. Also need to lazy access readonly\r\n // and reactive here to avoid circular dependency.\r\n return isReadonly ? readonly(res) : reactive(res);\r\n }\r\n return res;\r\n };\r\n}\r\nconst set = /*#__PURE__*/ createSetter();\r\nconst shallowSet = /*#__PURE__*/ createSetter(true);\r\nfunction createSetter(shallow = false) {\r\n return function set(target, key, value, receiver) {\r\n const oldValue = target[key];\r\n if (!shallow) {\r\n value = toRaw(value);\r\n if (!isArray(target) && isRef(oldValue) && !isRef(value)) {\r\n oldValue.value = value;\r\n return true;\r\n }\r\n }\r\n const hadKey = isArray(target) && isIntegerKey(key)\r\n ? Number(key) < target.length\r\n : hasOwn(target, key);\r\n const result = Reflect.set(target, key, value, receiver);\r\n // don't trigger if target is something up in the prototype chain of original\r\n if (target === toRaw(receiver)) {\r\n if (!hadKey) {\r\n trigger(target, \"add\" /* ADD */, key, value);\r\n }\r\n else if (hasChanged(value, oldValue)) {\r\n trigger(target, \"set\" /* SET */, key, value, oldValue);\r\n }\r\n }\r\n return result;\r\n };\r\n}\r\nfunction deleteProperty(target, key) {\r\n const hadKey = hasOwn(target, key);\r\n const oldValue = target[key];\r\n const result = Reflect.deleteProperty(target, key);\r\n if (result && hadKey) {\r\n trigger(target, \"delete\" /* DELETE */, key, undefined, oldValue);\r\n }\r\n return result;\r\n}\r\nfunction has(target, key) {\r\n const result = Reflect.has(target, key);\r\n if (!isSymbol(key) || !builtInSymbols.has(key)) {\r\n track(target, \"has\" /* HAS */, key);\r\n }\r\n return result;\r\n}\r\nfunction ownKeys(target) {\r\n track(target, \"iterate\" /* ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);\r\n return Reflect.ownKeys(target);\r\n}\r\nconst mutableHandlers = {\r\n get,\r\n set,\r\n deleteProperty,\r\n has,\r\n ownKeys\r\n};\r\nconst readonlyHandlers = {\r\n get: readonlyGet,\r\n set(target, key) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n console.warn(`Set operation on key \"${String(key)}\" failed: target is readonly.`, target);\r\n }\r\n return true;\r\n },\r\n deleteProperty(target, key) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n console.warn(`Delete operation on key \"${String(key)}\" failed: target is readonly.`, target);\r\n }\r\n return true;\r\n }\r\n};\r\nconst shallowReactiveHandlers = extend({}, mutableHandlers, {\r\n get: shallowGet,\r\n set: shallowSet\r\n});\r\n// Props handlers are special in the sense that it should not unwrap top-level\r\n// refs (in order to allow refs to be explicitly passed down), but should\r\n// retain the reactivity of the normal readonly object.\r\nconst shallowReadonlyHandlers = extend({}, readonlyHandlers, {\r\n get: shallowReadonlyGet\r\n});\n\nconst toReactive = (value) => isObject(value) ? reactive(value) : value;\r\nconst toReadonly = (value) => isObject(value) ? readonly(value) : value;\r\nconst toShallow = (value) => value;\r\nconst getProto = (v) => Reflect.getPrototypeOf(v);\r\nfunction get$1(target, key, isReadonly = false, isShallow = false) {\r\n // #1772: readonly(reactive(Map)) should return readonly + reactive version\r\n // of the value\r\n target = target[\"__v_raw\" /* RAW */];\r\n const rawTarget = toRaw(target);\r\n const rawKey = toRaw(key);\r\n if (key !== rawKey) {\r\n !isReadonly && track(rawTarget, \"get\" /* GET */, key);\r\n }\r\n !isReadonly && track(rawTarget, \"get\" /* GET */, rawKey);\r\n const { has } = getProto(rawTarget);\r\n const wrap = isReadonly ? toReadonly : isShallow ? toShallow : toReactive;\r\n if (has.call(rawTarget, key)) {\r\n return wrap(target.get(key));\r\n }\r\n else if (has.call(rawTarget, rawKey)) {\r\n return wrap(target.get(rawKey));\r\n }\r\n}\r\nfunction has$1(key, isReadonly = false) {\r\n const target = this[\"__v_raw\" /* RAW */];\r\n const rawTarget = toRaw(target);\r\n const rawKey = toRaw(key);\r\n if (key !== rawKey) {\r\n !isReadonly && track(rawTarget, \"has\" /* HAS */, key);\r\n }\r\n !isReadonly && track(rawTarget, \"has\" /* HAS */, rawKey);\r\n return key === rawKey\r\n ? target.has(key)\r\n : target.has(key) || target.has(rawKey);\r\n}\r\nfunction size(target, isReadonly = false) {\r\n target = target[\"__v_raw\" /* RAW */];\r\n !isReadonly && track(toRaw(target), \"iterate\" /* ITERATE */, ITERATE_KEY);\r\n return Reflect.get(target, 'size', target);\r\n}\r\nfunction add(value) {\r\n value = toRaw(value);\r\n const target = toRaw(this);\r\n const proto = getProto(target);\r\n const hadKey = proto.has.call(target, value);\r\n if (!hadKey) {\r\n target.add(value);\r\n trigger(target, \"add\" /* ADD */, value, value);\r\n }\r\n return this;\r\n}\r\nfunction set$1(key, value) {\r\n value = toRaw(value);\r\n const target = toRaw(this);\r\n const { has, get } = getProto(target);\r\n let hadKey = has.call(target, key);\r\n if (!hadKey) {\r\n key = toRaw(key);\r\n hadKey = has.call(target, key);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n checkIdentityKeys(target, has, key);\r\n }\r\n const oldValue = get.call(target, key);\r\n target.set(key, value);\r\n if (!hadKey) {\r\n trigger(target, \"add\" /* ADD */, key, value);\r\n }\r\n else if (hasChanged(value, oldValue)) {\r\n trigger(target, \"set\" /* SET */, key, value, oldValue);\r\n }\r\n return this;\r\n}\r\nfunction deleteEntry(key) {\r\n const target = toRaw(this);\r\n const { has, get } = getProto(target);\r\n let hadKey = has.call(target, key);\r\n if (!hadKey) {\r\n key = toRaw(key);\r\n hadKey = has.call(target, key);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n checkIdentityKeys(target, has, key);\r\n }\r\n const oldValue = get ? get.call(target, key) : undefined;\r\n // forward the operation before queueing reactions\r\n const result = target.delete(key);\r\n if (hadKey) {\r\n trigger(target, \"delete\" /* DELETE */, key, undefined, oldValue);\r\n }\r\n return result;\r\n}\r\nfunction clear() {\r\n const target = toRaw(this);\r\n const hadItems = target.size !== 0;\r\n const oldTarget = (process.env.NODE_ENV !== 'production')\r\n ? isMap(target)\r\n ? new Map(target)\r\n : new Set(target)\r\n : undefined;\r\n // forward the operation before queueing reactions\r\n const result = target.clear();\r\n if (hadItems) {\r\n trigger(target, \"clear\" /* CLEAR */, undefined, undefined, oldTarget);\r\n }\r\n return result;\r\n}\r\nfunction createForEach(isReadonly, isShallow) {\r\n return function forEach(callback, thisArg) {\r\n const observed = this;\r\n const target = observed[\"__v_raw\" /* RAW */];\r\n const rawTarget = toRaw(target);\r\n const wrap = isReadonly ? toReadonly : isShallow ? toShallow : toReactive;\r\n !isReadonly && track(rawTarget, \"iterate\" /* ITERATE */, ITERATE_KEY);\r\n return target.forEach((value, key) => {\r\n // important: make sure the callback is\r\n // 1. invoked with the reactive map as `this` and 3rd arg\r\n // 2. the value received should be a corresponding reactive/readonly.\r\n return callback.call(thisArg, wrap(value), wrap(key), observed);\r\n });\r\n };\r\n}\r\nfunction createIterableMethod(method, isReadonly, isShallow) {\r\n return function (...args) {\r\n const target = this[\"__v_raw\" /* RAW */];\r\n const rawTarget = toRaw(target);\r\n const targetIsMap = isMap(rawTarget);\r\n const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);\r\n const isKeyOnly = method === 'keys' && targetIsMap;\r\n const innerIterator = target[method](...args);\r\n const wrap = isReadonly ? toReadonly : isShallow ? toShallow : toReactive;\r\n !isReadonly &&\r\n track(rawTarget, \"iterate\" /* ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);\r\n // return a wrapped iterator which returns observed versions of the\r\n // values emitted from the real iterator\r\n return {\r\n // iterator protocol\r\n next() {\r\n const { value, done } = innerIterator.next();\r\n return done\r\n ? { value, done }\r\n : {\r\n value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),\r\n done\r\n };\r\n },\r\n // iterable protocol\r\n [Symbol.iterator]() {\r\n return this;\r\n }\r\n };\r\n };\r\n}\r\nfunction createReadonlyMethod(type) {\r\n return function (...args) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n const key = args[0] ? `on key \"${args[0]}\" ` : ``;\r\n console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));\r\n }\r\n return type === \"delete\" /* DELETE */ ? false : this;\r\n };\r\n}\r\nconst mutableInstrumentations = {\r\n get(key) {\r\n return get$1(this, key);\r\n },\r\n get size() {\r\n return size(this);\r\n },\r\n has: has$1,\r\n add,\r\n set: set$1,\r\n delete: deleteEntry,\r\n clear,\r\n forEach: createForEach(false, false)\r\n};\r\nconst shallowInstrumentations = {\r\n get(key) {\r\n return get$1(this, key, false, true);\r\n },\r\n get size() {\r\n return size(this);\r\n },\r\n has: has$1,\r\n add,\r\n set: set$1,\r\n delete: deleteEntry,\r\n clear,\r\n forEach: createForEach(false, true)\r\n};\r\nconst readonlyInstrumentations = {\r\n get(key) {\r\n return get$1(this, key, true);\r\n },\r\n get size() {\r\n return size(this, true);\r\n },\r\n has(key) {\r\n return has$1.call(this, key, true);\r\n },\r\n add: createReadonlyMethod(\"add\" /* ADD */),\r\n set: createReadonlyMethod(\"set\" /* SET */),\r\n delete: createReadonlyMethod(\"delete\" /* DELETE */),\r\n clear: createReadonlyMethod(\"clear\" /* CLEAR */),\r\n forEach: createForEach(true, false)\r\n};\r\nconst iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator];\r\niteratorMethods.forEach(method => {\r\n mutableInstrumentations[method] = createIterableMethod(method, false, false);\r\n readonlyInstrumentations[method] = createIterableMethod(method, true, false);\r\n shallowInstrumentations[method] = createIterableMethod(method, false, true);\r\n});\r\nfunction createInstrumentationGetter(isReadonly, shallow) {\r\n const instrumentations = shallow\r\n ? shallowInstrumentations\r\n : isReadonly\r\n ? readonlyInstrumentations\r\n : mutableInstrumentations;\r\n return (target, key, receiver) => {\r\n if (key === \"__v_isReactive\" /* IS_REACTIVE */) {\r\n return !isReadonly;\r\n }\r\n else if (key === \"__v_isReadonly\" /* IS_READONLY */) {\r\n return isReadonly;\r\n }\r\n else if (key === \"__v_raw\" /* RAW */) {\r\n return target;\r\n }\r\n return Reflect.get(hasOwn(instrumentations, key) && key in target\r\n ? instrumentations\r\n : target, key, receiver);\r\n };\r\n}\r\nconst mutableCollectionHandlers = {\r\n get: createInstrumentationGetter(false, false)\r\n};\r\nconst shallowCollectionHandlers = {\r\n get: createInstrumentationGetter(false, true)\r\n};\r\nconst readonlyCollectionHandlers = {\r\n get: createInstrumentationGetter(true, false)\r\n};\r\nfunction checkIdentityKeys(target, has, key) {\r\n const rawKey = toRaw(key);\r\n if (rawKey !== key && has.call(target, rawKey)) {\r\n const type = toRawType(target);\r\n console.warn(`Reactive ${type} contains both the raw and reactive ` +\r\n `versions of the same object${type === `Map` ? ` as keys` : ``}, ` +\r\n `which can lead to inconsistencies. ` +\r\n `Avoid differentiating between the raw and reactive versions ` +\r\n `of an object and only use the reactive version if possible.`);\r\n }\r\n}\n\nconst reactiveMap = new WeakMap();\r\nconst readonlyMap = new WeakMap();\r\nfunction targetTypeMap(rawType) {\r\n switch (rawType) {\r\n case 'Object':\r\n case 'Array':\r\n return 1 /* COMMON */;\r\n case 'Map':\r\n case 'Set':\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n return 2 /* COLLECTION */;\r\n default:\r\n return 0 /* INVALID */;\r\n }\r\n}\r\nfunction getTargetType(value) {\r\n return value[\"__v_skip\" /* SKIP */] || !Object.isExtensible(value)\r\n ? 0 /* INVALID */\r\n : targetTypeMap(toRawType(value));\r\n}\r\nfunction reactive(target) {\r\n // if trying to observe a readonly proxy, return the readonly version.\r\n if (target && target[\"__v_isReadonly\" /* IS_READONLY */]) {\r\n return target;\r\n }\r\n return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers);\r\n}\r\n/**\r\n * Return a shallowly-reactive copy of the original object, where only the root\r\n * level properties are reactive. It also does not auto-unwrap refs (even at the\r\n * root level).\r\n */\r\nfunction shallowReactive(target) {\r\n return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers);\r\n}\r\n/**\r\n * Creates a readonly copy of the original object. Note the returned copy is not\r\n * made reactive, but `readonly` can be called on an already reactive object.\r\n */\r\nfunction readonly(target) {\r\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers);\r\n}\r\n/**\r\n * Returns a reactive-copy of the original object, where only the root level\r\n * properties are readonly, and does NOT unwrap refs nor recursively convert\r\n * returned properties.\r\n * This is used for creating the props proxy object for stateful components.\r\n */\r\nfunction shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, readonlyCollectionHandlers);\r\n}\r\nfunction createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers) {\r\n if (!isObject(target)) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n console.warn(`value cannot be made reactive: ${String(target)}`);\r\n }\r\n return target;\r\n }\r\n // target is already a Proxy, return it.\r\n // exception: calling readonly() on a reactive object\r\n if (target[\"__v_raw\" /* RAW */] &&\r\n !(isReadonly && target[\"__v_isReactive\" /* IS_REACTIVE */])) {\r\n return target;\r\n }\r\n // target already has corresponding Proxy\r\n const proxyMap = isReadonly ? readonlyMap : reactiveMap;\r\n const existingProxy = proxyMap.get(target);\r\n if (existingProxy) {\r\n return existingProxy;\r\n }\r\n // only a whitelist of value types can be observed.\r\n const targetType = getTargetType(target);\r\n if (targetType === 0 /* INVALID */) {\r\n return target;\r\n }\r\n const proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers);\r\n proxyMap.set(target, proxy);\r\n return proxy;\r\n}\r\nfunction isReactive(value) {\r\n if (isReadonly(value)) {\r\n return isReactive(value[\"__v_raw\" /* RAW */]);\r\n }\r\n return !!(value && value[\"__v_isReactive\" /* IS_REACTIVE */]);\r\n}\r\nfunction isReadonly(value) {\r\n return !!(value && value[\"__v_isReadonly\" /* IS_READONLY */]);\r\n}\r\nfunction isProxy(value) {\r\n return isReactive(value) || isReadonly(value);\r\n}\r\nfunction toRaw(observed) {\r\n return ((observed && toRaw(observed[\"__v_raw\" /* RAW */])) || observed);\r\n}\r\nfunction markRaw(value) {\r\n def(value, \"__v_skip\" /* SKIP */, true);\r\n return value;\r\n}\n\nconst convert = (val) => isObject(val) ? reactive(val) : val;\r\nfunction isRef(r) {\r\n return Boolean(r && r.__v_isRef === true);\r\n}\r\nfunction ref(value) {\r\n return createRef(value);\r\n}\r\nfunction shallowRef(value) {\r\n return createRef(value, true);\r\n}\r\nclass RefImpl {\r\n constructor(_rawValue, _shallow = false) {\r\n this._rawValue = _rawValue;\r\n this._shallow = _shallow;\r\n this.__v_isRef = true;\r\n this._value = _shallow ? _rawValue : convert(_rawValue);\r\n }\r\n get value() {\r\n track(toRaw(this), \"get\" /* GET */, 'value');\r\n return this._value;\r\n }\r\n set value(newVal) {\r\n if (hasChanged(toRaw(newVal), this._rawValue)) {\r\n this._rawValue = newVal;\r\n this._value = this._shallow ? newVal : convert(newVal);\r\n trigger(toRaw(this), \"set\" /* SET */, 'value', newVal);\r\n }\r\n }\r\n}\r\nfunction createRef(rawValue, shallow = false) {\r\n if (isRef(rawValue)) {\r\n return rawValue;\r\n }\r\n return new RefImpl(rawValue, shallow);\r\n}\r\nfunction triggerRef(ref) {\r\n trigger(toRaw(ref), \"set\" /* SET */, 'value', (process.env.NODE_ENV !== 'production') ? ref.value : void 0);\r\n}\r\nfunction unref(ref) {\r\n return isRef(ref) ? ref.value : ref;\r\n}\r\nconst shallowUnwrapHandlers = {\r\n get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),\r\n set: (target, key, value, receiver) => {\r\n const oldValue = target[key];\r\n if (isRef(oldValue) && !isRef(value)) {\r\n oldValue.value = value;\r\n return true;\r\n }\r\n else {\r\n return Reflect.set(target, key, value, receiver);\r\n }\r\n }\r\n};\r\nfunction proxyRefs(objectWithRefs) {\r\n return isReactive(objectWithRefs)\r\n ? objectWithRefs\r\n : new Proxy(objectWithRefs, shallowUnwrapHandlers);\r\n}\r\nclass CustomRefImpl {\r\n constructor(factory) {\r\n this.__v_isRef = true;\r\n const { get, set } = factory(() => track(this, \"get\" /* GET */, 'value'), () => trigger(this, \"set\" /* SET */, 'value'));\r\n this._get = get;\r\n this._set = set;\r\n }\r\n get value() {\r\n return this._get();\r\n }\r\n set value(newVal) {\r\n this._set(newVal);\r\n }\r\n}\r\nfunction customRef(factory) {\r\n return new CustomRefImpl(factory);\r\n}\r\nfunction toRefs(object) {\r\n if ((process.env.NODE_ENV !== 'production') && !isProxy(object)) {\r\n console.warn(`toRefs() expects a reactive object but received a plain one.`);\r\n }\r\n const ret = isArray(object) ? new Array(object.length) : {};\r\n for (const key in object) {\r\n ret[key] = toRef(object, key);\r\n }\r\n return ret;\r\n}\r\nclass ObjectRefImpl {\r\n constructor(_object, _key) {\r\n this._object = _object;\r\n this._key = _key;\r\n this.__v_isRef = true;\r\n }\r\n get value() {\r\n return this._object[this._key];\r\n }\r\n set value(newVal) {\r\n this._object[this._key] = newVal;\r\n }\r\n}\r\nfunction toRef(object, key) {\r\n return isRef(object[key])\r\n ? object[key]\r\n : new ObjectRefImpl(object, key);\r\n}\n\nclass ComputedRefImpl {\r\n constructor(getter, _setter, isReadonly) {\r\n this._setter = _setter;\r\n this._dirty = true;\r\n this.__v_isRef = true;\r\n this.effect = effect(getter, {\r\n lazy: true,\r\n scheduler: () => {\r\n if (!this._dirty) {\r\n this._dirty = true;\r\n trigger(toRaw(this), \"set\" /* SET */, 'value');\r\n }\r\n }\r\n });\r\n this[\"__v_isReadonly\" /* IS_READONLY */] = isReadonly;\r\n }\r\n get value() {\r\n if (this._dirty) {\r\n this._value = this.effect();\r\n this._dirty = false;\r\n }\r\n track(toRaw(this), \"get\" /* GET */, 'value');\r\n return this._value;\r\n }\r\n set value(newValue) {\r\n this._setter(newValue);\r\n }\r\n}\r\nfunction computed(getterOrOptions) {\r\n let getter;\r\n let setter;\r\n if (isFunction(getterOrOptions)) {\r\n getter = getterOrOptions;\r\n setter = (process.env.NODE_ENV !== 'production')\r\n ? () => {\r\n console.warn('Write operation failed: computed value is readonly');\r\n }\r\n : NOOP;\r\n }\r\n else {\r\n getter = getterOrOptions.get;\r\n setter = getterOrOptions.set;\r\n }\r\n return new ComputedRefImpl(getter, setter, isFunction(getterOrOptions) || !getterOrOptions.set);\r\n}\n\nexport { ITERATE_KEY, computed, customRef, effect, enableTracking, isProxy, isReactive, isReadonly, isRef, markRaw, pauseTracking, proxyRefs, reactive, readonly, ref, resetTracking, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, track, trigger, triggerRef, unref };\n","import { pauseTracking, resetTracking, isRef, toRaw, shallowReactive, trigger, isReactive, effect, stop, ref, isProxy, proxyRefs, toRef, reactive, shallowReadonly, track, computed as computed$1, isReadonly } from '@vue/reactivity';\nexport { customRef, isProxy, isReactive, isReadonly, isRef, markRaw, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity';\nimport { isString, isFunction, isPromise, isArray, extend, EMPTY_OBJ, toHandlerKey, toNumber, hyphenate, camelize, isOn, hasOwn, isModelListener, def, isReservedProp, EMPTY_ARR, isObject, capitalize, toRawType, makeMap, remove, NOOP, hasChanged, isSet, isMap, invokeArrayFns, NO, getGlobalThis, normalizeClass, normalizeStyle, isGloballyWhitelisted } from '@vue/shared';\nexport { camelize, capitalize, toDisplayString, toHandlerKey } from '@vue/shared';\n\nconst stack = [];\r\nfunction pushWarningContext(vnode) {\r\n stack.push(vnode);\r\n}\r\nfunction popWarningContext() {\r\n stack.pop();\r\n}\r\nfunction warn(msg, ...args) {\r\n // avoid props formatting or warn handler tracking deps that might be mutated\r\n // during patch, leading to infinite recursion.\r\n pauseTracking();\r\n const instance = stack.length ? stack[stack.length - 1].component : null;\r\n const appWarnHandler = instance && instance.appContext.config.warnHandler;\r\n const trace = getComponentTrace();\r\n if (appWarnHandler) {\r\n callWithErrorHandling(appWarnHandler, instance, 11 /* APP_WARN_HANDLER */, [\r\n msg + args.join(''),\r\n instance && instance.proxy,\r\n trace\r\n .map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`)\r\n .join('\\n'),\r\n trace\r\n ]);\r\n }\r\n else {\r\n const warnArgs = [`[Vue warn]: ${msg}`, ...args];\r\n /* istanbul ignore if */\r\n if (trace.length &&\r\n // avoid spamming console during tests\r\n !false) {\r\n warnArgs.push(`\\n`, ...formatTrace(trace));\r\n }\r\n console.warn(...warnArgs);\r\n }\r\n resetTracking();\r\n}\r\nfunction getComponentTrace() {\r\n let currentVNode = stack[stack.length - 1];\r\n if (!currentVNode) {\r\n return [];\r\n }\r\n // we can't just use the stack because it will be incomplete during updates\r\n // that did not start from the root. Re-construct the parent chain using\r\n // instance parent pointers.\r\n const normalizedStack = [];\r\n while (currentVNode) {\r\n const last = normalizedStack[0];\r\n if (last && last.vnode === currentVNode) {\r\n last.recurseCount++;\r\n }\r\n else {\r\n normalizedStack.push({\r\n vnode: currentVNode,\r\n recurseCount: 0\r\n });\r\n }\r\n const parentInstance = currentVNode.component && currentVNode.component.parent;\r\n currentVNode = parentInstance && parentInstance.vnode;\r\n }\r\n return normalizedStack;\r\n}\r\n/* istanbul ignore next */\r\nfunction formatTrace(trace) {\r\n const logs = [];\r\n trace.forEach((entry, i) => {\r\n logs.push(...(i === 0 ? [] : [`\\n`]), ...formatTraceEntry(entry));\r\n });\r\n return logs;\r\n}\r\nfunction formatTraceEntry({ vnode, recurseCount }) {\r\n const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;\r\n const isRoot = vnode.component ? vnode.component.parent == null : false;\r\n const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;\r\n const close = `>` + postfix;\r\n return vnode.props\r\n ? [open, ...formatProps(vnode.props), close]\r\n : [open + close];\r\n}\r\n/* istanbul ignore next */\r\nfunction formatProps(props) {\r\n const res = [];\r\n const keys = Object.keys(props);\r\n keys.slice(0, 3).forEach(key => {\r\n res.push(...formatProp(key, props[key]));\r\n });\r\n if (keys.length > 3) {\r\n res.push(` ...`);\r\n }\r\n return res;\r\n}\r\n/* istanbul ignore next */\r\nfunction formatProp(key, value, raw) {\r\n if (isString(value)) {\r\n value = JSON.stringify(value);\r\n return raw ? value : [`${key}=${value}`];\r\n }\r\n else if (typeof value === 'number' ||\r\n typeof value === 'boolean' ||\r\n value == null) {\r\n return raw ? value : [`${key}=${value}`];\r\n }\r\n else if (isRef(value)) {\r\n value = formatProp(key, toRaw(value.value), true);\r\n return raw ? value : [`${key}=Ref<`, value, `>`];\r\n }\r\n else if (isFunction(value)) {\r\n return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];\r\n }\r\n else {\r\n value = toRaw(value);\r\n return raw ? value : [`${key}=`, value];\r\n }\r\n}\n\nconst ErrorTypeStrings = {\r\n [\"bc\" /* BEFORE_CREATE */]: 'beforeCreate hook',\r\n [\"c\" /* CREATED */]: 'created hook',\r\n [\"bm\" /* BEFORE_MOUNT */]: 'beforeMount hook',\r\n [\"m\" /* MOUNTED */]: 'mounted hook',\r\n [\"bu\" /* BEFORE_UPDATE */]: 'beforeUpdate hook',\r\n [\"u\" /* UPDATED */]: 'updated',\r\n [\"bum\" /* BEFORE_UNMOUNT */]: 'beforeUnmount hook',\r\n [\"um\" /* UNMOUNTED */]: 'unmounted hook',\r\n [\"a\" /* ACTIVATED */]: 'activated hook',\r\n [\"da\" /* DEACTIVATED */]: 'deactivated hook',\r\n [\"ec\" /* ERROR_CAPTURED */]: 'errorCaptured hook',\r\n [\"rtc\" /* RENDER_TRACKED */]: 'renderTracked hook',\r\n [\"rtg\" /* RENDER_TRIGGERED */]: 'renderTriggered hook',\r\n [0 /* SETUP_FUNCTION */]: 'setup function',\r\n [1 /* RENDER_FUNCTION */]: 'render function',\r\n [2 /* WATCH_GETTER */]: 'watcher getter',\r\n [3 /* WATCH_CALLBACK */]: 'watcher callback',\r\n [4 /* WATCH_CLEANUP */]: 'watcher cleanup function',\r\n [5 /* NATIVE_EVENT_HANDLER */]: 'native event handler',\r\n [6 /* COMPONENT_EVENT_HANDLER */]: 'component event handler',\r\n [7 /* VNODE_HOOK */]: 'vnode hook',\r\n [8 /* DIRECTIVE_HOOK */]: 'directive hook',\r\n [9 /* TRANSITION_HOOK */]: 'transition hook',\r\n [10 /* APP_ERROR_HANDLER */]: 'app errorHandler',\r\n [11 /* APP_WARN_HANDLER */]: 'app warnHandler',\r\n [12 /* FUNCTION_REF */]: 'ref function',\r\n [13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',\r\n [14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +\r\n 'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next'\r\n};\r\nfunction callWithErrorHandling(fn, instance, type, args) {\r\n let res;\r\n try {\r\n res = args ? fn(...args) : fn();\r\n }\r\n catch (err) {\r\n handleError(err, instance, type);\r\n }\r\n return res;\r\n}\r\nfunction callWithAsyncErrorHandling(fn, instance, type, args) {\r\n if (isFunction(fn)) {\r\n const res = callWithErrorHandling(fn, instance, type, args);\r\n if (res && isPromise(res)) {\r\n res.catch(err => {\r\n handleError(err, instance, type);\r\n });\r\n }\r\n return res;\r\n }\r\n const values = [];\r\n for (let i = 0; i < fn.length; i++) {\r\n values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));\r\n }\r\n return values;\r\n}\r\nfunction handleError(err, instance, type, throwInDev = true) {\r\n const contextVNode = instance ? instance.vnode : null;\r\n if (instance) {\r\n let cur = instance.parent;\r\n // the exposed instance is the render proxy to keep it consistent with 2.x\r\n const exposedInstance = instance.proxy;\r\n // in production the hook receives only the error code\r\n const errorInfo = (process.env.NODE_ENV !== 'production') ? ErrorTypeStrings[type] : type;\r\n while (cur) {\r\n const errorCapturedHooks = cur.ec;\r\n if (errorCapturedHooks) {\r\n for (let i = 0; i < errorCapturedHooks.length; i++) {\r\n if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {\r\n return;\r\n }\r\n }\r\n }\r\n cur = cur.parent;\r\n }\r\n // app-level handling\r\n const appErrorHandler = instance.appContext.config.errorHandler;\r\n if (appErrorHandler) {\r\n callWithErrorHandling(appErrorHandler, null, 10 /* APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);\r\n return;\r\n }\r\n }\r\n logError(err, type, contextVNode, throwInDev);\r\n}\r\nfunction logError(err, type, contextVNode, throwInDev = true) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n const info = ErrorTypeStrings[type];\r\n if (contextVNode) {\r\n pushWarningContext(contextVNode);\r\n }\r\n warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);\r\n if (contextVNode) {\r\n popWarningContext();\r\n }\r\n // crash in dev by default so it's more noticeable\r\n if (throwInDev) {\r\n throw err;\r\n }\r\n else {\r\n console.error(err);\r\n }\r\n }\r\n else {\r\n // recover in prod to reduce the impact on end-user\r\n console.error(err);\r\n }\r\n}\n\nlet isFlushing = false;\r\nlet isFlushPending = false;\r\nconst queue = [];\r\nlet flushIndex = 0;\r\nconst pendingPreFlushCbs = [];\r\nlet activePreFlushCbs = null;\r\nlet preFlushIndex = 0;\r\nconst pendingPostFlushCbs = [];\r\nlet activePostFlushCbs = null;\r\nlet postFlushIndex = 0;\r\nconst resolvedPromise = Promise.resolve();\r\nlet currentFlushPromise = null;\r\nlet currentPreFlushParentJob = null;\r\nconst RECURSION_LIMIT = 100;\r\nfunction nextTick(fn) {\r\n const p = currentFlushPromise || resolvedPromise;\r\n return fn ? p.then(this ? fn.bind(this) : fn) : p;\r\n}\r\n// #2768\r\n// Use binary-search to find a suitable position in the queue,\r\n// so that the queue maintains the increasing order of job's id,\r\n// which can prevent the job from being skipped and also can avoid repeated patching.\r\nfunction findInsertionIndex(job) {\r\n // the start index should be `flushIndex + 1`\r\n let start = flushIndex + 1;\r\n let end = queue.length;\r\n const jobId = getId(job);\r\n while (start < end) {\r\n const middle = (start + end) >>> 1;\r\n const middleJobId = getId(queue[middle]);\r\n middleJobId < jobId ? (start = middle + 1) : (end = middle);\r\n }\r\n return start;\r\n}\r\nfunction queueJob(job) {\r\n // the dedupe search uses the startIndex argument of Array.includes()\r\n // by default the search index includes the current job that is being run\r\n // so it cannot recursively trigger itself again.\r\n // if the job is a watch() callback, the search will start with a +1 index to\r\n // allow it recursively trigger itself - it is the user's responsibility to\r\n // ensure it doesn't end up in an infinite loop.\r\n if ((!queue.length ||\r\n !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) &&\r\n job !== currentPreFlushParentJob) {\r\n const pos = findInsertionIndex(job);\r\n if (pos > -1) {\r\n queue.splice(pos, 0, job);\r\n }\r\n else {\r\n queue.push(job);\r\n }\r\n queueFlush();\r\n }\r\n}\r\nfunction queueFlush() {\r\n if (!isFlushing && !isFlushPending) {\r\n isFlushPending = true;\r\n currentFlushPromise = resolvedPromise.then(flushJobs);\r\n }\r\n}\r\nfunction invalidateJob(job) {\r\n const i = queue.indexOf(job);\r\n if (i > -1) {\r\n queue.splice(i, 1);\r\n }\r\n}\r\nfunction queueCb(cb, activeQueue, pendingQueue, index) {\r\n if (!isArray(cb)) {\r\n if (!activeQueue ||\r\n !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {\r\n pendingQueue.push(cb);\r\n }\r\n }\r\n else {\r\n // if cb is an array, it is a component lifecycle hook which can only be\r\n // triggered by a job, which is already deduped in the main queue, so\r\n // we can skip duplicate check here to improve perf\r\n pendingQueue.push(...cb);\r\n }\r\n queueFlush();\r\n}\r\nfunction queuePreFlushCb(cb) {\r\n queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);\r\n}\r\nfunction queuePostFlushCb(cb) {\r\n queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);\r\n}\r\nfunction flushPreFlushCbs(seen, parentJob = null) {\r\n if (pendingPreFlushCbs.length) {\r\n currentPreFlushParentJob = parentJob;\r\n activePreFlushCbs = [...new Set(pendingPreFlushCbs)];\r\n pendingPreFlushCbs.length = 0;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n seen = seen || new Map();\r\n }\r\n for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n checkRecursiveUpdates(seen, activePreFlushCbs[preFlushIndex]);\r\n }\r\n activePreFlushCbs[preFlushIndex]();\r\n }\r\n activePreFlushCbs = null;\r\n preFlushIndex = 0;\r\n currentPreFlushParentJob = null;\r\n // recursively flush until it drains\r\n flushPreFlushCbs(seen, parentJob);\r\n }\r\n}\r\nfunction flushPostFlushCbs(seen) {\r\n if (pendingPostFlushCbs.length) {\r\n const deduped = [...new Set(pendingPostFlushCbs)];\r\n pendingPostFlushCbs.length = 0;\r\n // #1947 already has active queue, nested flushPostFlushCbs call\r\n if (activePostFlushCbs) {\r\n activePostFlushCbs.push(...deduped);\r\n return;\r\n }\r\n activePostFlushCbs = deduped;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n seen = seen || new Map();\r\n }\r\n activePostFlushCbs.sort((a, b) => getId(a) - getId(b));\r\n for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex]);\r\n }\r\n activePostFlushCbs[postFlushIndex]();\r\n }\r\n activePostFlushCbs = null;\r\n postFlushIndex = 0;\r\n }\r\n}\r\nconst getId = (job) => job.id == null ? Infinity : job.id;\r\nfunction flushJobs(seen) {\r\n isFlushPending = false;\r\n isFlushing = true;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n seen = seen || new Map();\r\n }\r\n flushPreFlushCbs(seen);\r\n // Sort queue before flush.\r\n // This ensures that:\r\n // 1. Components are updated from parent to child. (because parent is always\r\n // created before the child so its render effect will have smaller\r\n // priority number)\r\n // 2. If a component is unmounted during a parent component's update,\r\n // its update can be skipped.\r\n queue.sort((a, b) => getId(a) - getId(b));\r\n try {\r\n for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {\r\n const job = queue[flushIndex];\r\n if (job) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n checkRecursiveUpdates(seen, job);\r\n }\r\n callWithErrorHandling(job, null, 14 /* SCHEDULER */);\r\n }\r\n }\r\n }\r\n finally {\r\n flushIndex = 0;\r\n queue.length = 0;\r\n flushPostFlushCbs(seen);\r\n isFlushing = false;\r\n currentFlushPromise = null;\r\n // some postFlushCb queued jobs!\r\n // keep flushing until it drains.\r\n if (queue.length || pendingPostFlushCbs.length) {\r\n flushJobs(seen);\r\n }\r\n }\r\n}\r\nfunction checkRecursiveUpdates(seen, fn) {\r\n if (!seen.has(fn)) {\r\n seen.set(fn, 1);\r\n }\r\n else {\r\n const count = seen.get(fn);\r\n if (count > RECURSION_LIMIT) {\r\n throw new Error(`Maximum recursive updates exceeded. ` +\r\n `This means you have a reactive effect that is mutating its own ` +\r\n `dependencies and thus recursively triggering itself. Possible sources ` +\r\n `include component template, render function, updated hook or ` +\r\n `watcher source function.`);\r\n }\r\n else {\r\n seen.set(fn, count + 1);\r\n }\r\n }\r\n}\n\n/* eslint-disable no-restricted-globals */\r\nlet isHmrUpdating = false;\r\nconst hmrDirtyComponents = new Set();\r\n// Expose the HMR runtime on the global object\r\n// This makes it entirely tree-shakable without polluting the exports and makes\r\n// it easier to be used in toolings like vue-loader\r\n// Note: for a component to be eligible for HMR it also needs the __hmrId option\r\n// to be set so that its instances can be registered / removed.\r\nif ((process.env.NODE_ENV !== 'production')) {\r\n const globalObject = typeof global !== 'undefined'\r\n ? global\r\n : typeof self !== 'undefined'\r\n ? self\r\n : typeof window !== 'undefined'\r\n ? window\r\n : {};\r\n globalObject.__VUE_HMR_RUNTIME__ = {\r\n createRecord: tryWrap(createRecord),\r\n rerender: tryWrap(rerender),\r\n reload: tryWrap(reload)\r\n };\r\n}\r\nconst map = new Map();\r\nfunction registerHMR(instance) {\r\n const id = instance.type.__hmrId;\r\n let record = map.get(id);\r\n if (!record) {\r\n createRecord(id, instance.type);\r\n record = map.get(id);\r\n }\r\n record.instances.add(instance);\r\n}\r\nfunction unregisterHMR(instance) {\r\n map.get(instance.type.__hmrId).instances.delete(instance);\r\n}\r\nfunction createRecord(id, component) {\r\n if (!component) {\r\n warn(`HMR API usage is out of date.\\n` +\r\n `Please upgrade vue-loader/vite/rollup-plugin-vue or other relevant ` +\r\n `dependency that handles Vue SFC compilation.`);\r\n component = {};\r\n }\r\n if (map.has(id)) {\r\n return false;\r\n }\r\n map.set(id, {\r\n component: isClassComponent(component) ? component.__vccOpts : component,\r\n instances: new Set()\r\n });\r\n return true;\r\n}\r\nfunction rerender(id, newRender) {\r\n const record = map.get(id);\r\n if (!record)\r\n return;\r\n if (newRender)\r\n record.component.render = newRender;\r\n // Array.from creates a snapshot which avoids the set being mutated during\r\n // updates\r\n Array.from(record.instances).forEach(instance => {\r\n if (newRender) {\r\n instance.render = newRender;\r\n }\r\n instance.renderCache = [];\r\n // this flag forces child components with slot content to update\r\n isHmrUpdating = true;\r\n instance.update();\r\n isHmrUpdating = false;\r\n });\r\n}\r\nfunction reload(id, newComp) {\r\n const record = map.get(id);\r\n if (!record)\r\n return;\r\n // Array.from creates a snapshot which avoids the set being mutated during\r\n // updates\r\n const { component, instances } = record;\r\n if (!hmrDirtyComponents.has(component)) {\r\n // 1. Update existing comp definition to match new one\r\n newComp = isClassComponent(newComp) ? newComp.__vccOpts : newComp;\r\n extend(component, newComp);\r\n for (const key in component) {\r\n if (!(key in newComp)) {\r\n delete component[key];\r\n }\r\n }\r\n // 2. Mark component dirty. This forces the renderer to replace the component\r\n // on patch.\r\n hmrDirtyComponents.add(component);\r\n // 3. Make sure to unmark the component after the reload.\r\n queuePostFlushCb(() => {\r\n hmrDirtyComponents.delete(component);\r\n });\r\n }\r\n Array.from(instances).forEach(instance => {\r\n if (instance.parent) {\r\n // 4. Force the parent instance to re-render. This will cause all updated\r\n // components to be unmounted and re-mounted. Queue the update so that we\r\n // don't end up forcing the same parent to re-render multiple times.\r\n queueJob(instance.parent.update);\r\n }\r\n else if (instance.appContext.reload) {\r\n // root instance mounted via createApp() has a reload method\r\n instance.appContext.reload();\r\n }\r\n else if (typeof window !== 'undefined') {\r\n // root instance inside tree created via raw render(). Force reload.\r\n window.location.reload();\r\n }\r\n else {\r\n console.warn('[HMR] Root or manually mounted instance modified. Full reload required.');\r\n }\r\n });\r\n}\r\nfunction tryWrap(fn) {\r\n return (id, arg) => {\r\n try {\r\n return fn(id, arg);\r\n }\r\n catch (e) {\r\n console.error(e);\r\n console.warn(`[HMR] Something went wrong during Vue component hot-reload. ` +\r\n `Full reload required.`);\r\n }\r\n };\r\n}\n\nlet devtools;\r\nfunction setDevtoolsHook(hook) {\r\n devtools = hook;\r\n}\r\nfunction devtoolsInitApp(app, version) {\r\n // TODO queue if devtools is undefined\r\n if (!devtools)\r\n return;\r\n devtools.emit(\"app:init\" /* APP_INIT */, app, version, {\r\n Fragment,\r\n Text,\r\n Comment,\r\n Static\r\n });\r\n}\r\nfunction devtoolsUnmountApp(app) {\r\n if (!devtools)\r\n return;\r\n devtools.emit(\"app:unmount\" /* APP_UNMOUNT */, app);\r\n}\r\nconst devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook(\"component:added\" /* COMPONENT_ADDED */);\r\nconst devtoolsComponentUpdated = /*#__PURE__*/ createDevtoolsComponentHook(\"component:updated\" /* COMPONENT_UPDATED */);\r\nconst devtoolsComponentRemoved = /*#__PURE__*/ createDevtoolsComponentHook(\"component:removed\" /* COMPONENT_REMOVED */);\r\nfunction createDevtoolsComponentHook(hook) {\r\n return (component) => {\r\n if (!devtools)\r\n return;\r\n devtools.emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);\r\n };\r\n}\r\nfunction devtoolsComponentEmit(component, event, params) {\r\n if (!devtools)\r\n return;\r\n devtools.emit(\"component:emit\" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);\r\n}\n\nfunction emit(instance, event, ...rawArgs) {\r\n const props = instance.vnode.props || EMPTY_OBJ;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n const { emitsOptions, propsOptions: [propsOptions] } = instance;\r\n if (emitsOptions) {\r\n if (!(event in emitsOptions)) {\r\n if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {\r\n warn(`Component emitted event \"${event}\" but it is neither declared in ` +\r\n `the emits option nor as an \"${toHandlerKey(event)}\" prop.`);\r\n }\r\n }\r\n else {\r\n const validator = emitsOptions[event];\r\n if (isFunction(validator)) {\r\n const isValid = validator(...rawArgs);\r\n if (!isValid) {\r\n warn(`Invalid event arguments: event validation failed for event \"${event}\".`);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n let args = rawArgs;\r\n const isModelListener = event.startsWith('update:');\r\n // for v-model update:xxx events, apply modifiers on args\r\n const modelArg = isModelListener && event.slice(7);\r\n if (modelArg && modelArg in props) {\r\n const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`;\r\n const { number, trim } = props[modifiersKey] || EMPTY_OBJ;\r\n if (trim) {\r\n args = rawArgs.map(a => a.trim());\r\n }\r\n else if (number) {\r\n args = rawArgs.map(toNumber);\r\n }\r\n }\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n devtoolsComponentEmit(instance, event, args);\r\n }\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n const lowerCaseEvent = event.toLowerCase();\r\n if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {\r\n warn(`Event \"${lowerCaseEvent}\" is emitted in component ` +\r\n `${formatComponentName(instance, instance.type)} but the handler is registered for \"${event}\". ` +\r\n `Note that HTML attributes are case-insensitive and you cannot use ` +\r\n `v-on to listen to camelCase events when using in-DOM templates. ` +\r\n `You should probably use \"${hyphenate(event)}\" instead of \"${event}\".`);\r\n }\r\n }\r\n // convert handler name to camelCase. See issue #2249\r\n let handlerName = toHandlerKey(camelize(event));\r\n let handler = props[handlerName];\r\n // for v-model update:xxx events, also trigger kebab-case equivalent\r\n // for props passed via kebab-case\r\n if (!handler && isModelListener) {\r\n handlerName = toHandlerKey(hyphenate(event));\r\n handler = props[handlerName];\r\n }\r\n if (handler) {\r\n callWithAsyncErrorHandling(handler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);\r\n }\r\n const onceHandler = props[handlerName + `Once`];\r\n if (onceHandler) {\r\n if (!instance.emitted) {\r\n (instance.emitted = {})[handlerName] = true;\r\n }\r\n else if (instance.emitted[handlerName]) {\r\n return;\r\n }\r\n callWithAsyncErrorHandling(onceHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);\r\n }\r\n}\r\nfunction normalizeEmitsOptions(comp, appContext, asMixin = false) {\r\n if (!appContext.deopt && comp.__emits !== undefined) {\r\n return comp.__emits;\r\n }\r\n const raw = comp.emits;\r\n let normalized = {};\r\n // apply mixin/extends props\r\n let hasExtends = false;\r\n if (__VUE_OPTIONS_API__ && !isFunction(comp)) {\r\n const extendEmits = (raw) => {\r\n hasExtends = true;\r\n extend(normalized, normalizeEmitsOptions(raw, appContext, true));\r\n };\r\n if (!asMixin && appContext.mixins.length) {\r\n appContext.mixins.forEach(extendEmits);\r\n }\r\n if (comp.extends) {\r\n extendEmits(comp.extends);\r\n }\r\n if (comp.mixins) {\r\n comp.mixins.forEach(extendEmits);\r\n }\r\n }\r\n if (!raw && !hasExtends) {\r\n return (comp.__emits = null);\r\n }\r\n if (isArray(raw)) {\r\n raw.forEach(key => (normalized[key] = null));\r\n }\r\n else {\r\n extend(normalized, raw);\r\n }\r\n return (comp.__emits = normalized);\r\n}\r\n// Check if an incoming prop key is a declared emit event listener.\r\n// e.g. With `emits: { click: null }`, props named `onClick` and `onclick` are\r\n// both considered matched listeners.\r\nfunction isEmitListener(options, key) {\r\n if (!options || !isOn(key)) {\r\n return false;\r\n }\r\n key = key.slice(2).replace(/Once$/, '');\r\n return (hasOwn(options, key[0].toLowerCase() + key.slice(1)) ||\r\n hasOwn(options, hyphenate(key)) ||\r\n hasOwn(options, key));\r\n}\n\n/**\r\n * mark the current rendering instance for asset resolution (e.g.\r\n * resolveComponent, resolveDirective) during render\r\n */\r\nlet currentRenderingInstance = null;\r\nfunction setCurrentRenderingInstance(instance) {\r\n currentRenderingInstance = instance;\r\n}\r\n/**\r\n * dev only flag to track whether $attrs was used during render.\r\n * If $attrs was used during render then the warning for failed attrs\r\n * fallthrough can be suppressed.\r\n */\r\nlet accessedAttrs = false;\r\nfunction markAttrsAccessed() {\r\n accessedAttrs = true;\r\n}\r\nfunction renderComponentRoot(instance) {\r\n const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx } = instance;\r\n let result;\r\n currentRenderingInstance = instance;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n accessedAttrs = false;\r\n }\r\n try {\r\n let fallthroughAttrs;\r\n if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {\r\n // withProxy is a proxy with a different `has` trap only for\r\n // runtime-compiled render functions using `with` block.\r\n const proxyToUse = withProxy || proxy;\r\n result = normalizeVNode(render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx));\r\n fallthroughAttrs = attrs;\r\n }\r\n else {\r\n // functional\r\n const render = Component;\r\n // in dev, mark attrs accessed if optional props (attrs === props)\r\n if ((process.env.NODE_ENV !== 'production') && attrs === props) {\r\n markAttrsAccessed();\r\n }\r\n result = normalizeVNode(render.length > 1\r\n ? render(props, (process.env.NODE_ENV !== 'production')\r\n ? {\r\n get attrs() {\r\n markAttrsAccessed();\r\n return attrs;\r\n },\r\n slots,\r\n emit\r\n }\r\n : { attrs, slots, emit })\r\n : render(props, null /* we know it doesn't need it */));\r\n fallthroughAttrs = Component.props\r\n ? attrs\r\n : getFunctionalFallthrough(attrs);\r\n }\r\n // attr merging\r\n // in dev mode, comments are preserved, and it's possible for a template\r\n // to have comments along side the root element which makes it a fragment\r\n let root = result;\r\n let setRoot = undefined;\r\n if ((process.env.NODE_ENV !== 'production') &&\r\n result.patchFlag > 0 &&\r\n result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {\r\n ;\r\n [root, setRoot] = getChildRoot(result);\r\n }\r\n if (Component.inheritAttrs !== false && fallthroughAttrs) {\r\n const keys = Object.keys(fallthroughAttrs);\r\n const { shapeFlag } = root;\r\n if (keys.length) {\r\n if (shapeFlag & 1 /* ELEMENT */ ||\r\n shapeFlag & 6 /* COMPONENT */) {\r\n if (propsOptions && keys.some(isModelListener)) {\r\n // If a v-model listener (onUpdate:xxx) has a corresponding declared\r\n // prop, it indicates this component expects to handle v-model and\r\n // it should not fallthrough.\r\n // related: #1543, #1643, #1989\r\n fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);\r\n }\r\n root = cloneVNode(root, fallthroughAttrs);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production') && !accessedAttrs && root.type !== Comment) {\r\n const allAttrs = Object.keys(attrs);\r\n const eventAttrs = [];\r\n const extraAttrs = [];\r\n for (let i = 0, l = allAttrs.length; i < l; i++) {\r\n const key = allAttrs[i];\r\n if (isOn(key)) {\r\n // ignore v-model handlers when they fail to fallthrough\r\n if (!isModelListener(key)) {\r\n // remove `on`, lowercase first letter to reflect event casing\r\n // accurately\r\n eventAttrs.push(key[2].toLowerCase() + key.slice(3));\r\n }\r\n }\r\n else {\r\n extraAttrs.push(key);\r\n }\r\n }\r\n if (extraAttrs.length) {\r\n warn(`Extraneous non-props attributes (` +\r\n `${extraAttrs.join(', ')}) ` +\r\n `were passed to component but could not be automatically inherited ` +\r\n `because component renders fragment or text root nodes.`);\r\n }\r\n if (eventAttrs.length) {\r\n warn(`Extraneous non-emits event listeners (` +\r\n `${eventAttrs.join(', ')}) ` +\r\n `were passed to component but could not be automatically inherited ` +\r\n `because component renders fragment or text root nodes. ` +\r\n `If the listener is intended to be a component custom event listener only, ` +\r\n `declare it using the \"emits\" option.`);\r\n }\r\n }\r\n }\r\n }\r\n // inherit directives\r\n if (vnode.dirs) {\r\n if ((process.env.NODE_ENV !== 'production') && !isElementRoot(root)) {\r\n warn(`Runtime directive used on component with non-element root node. ` +\r\n `The directives will not function as intended.`);\r\n }\r\n root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;\r\n }\r\n // inherit transition data\r\n if (vnode.transition) {\r\n if ((process.env.NODE_ENV !== 'production') && !isElementRoot(root)) {\r\n warn(`Component inside renders non-element root node ` +\r\n `that cannot be animated.`);\r\n }\r\n root.transition = vnode.transition;\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && setRoot) {\r\n setRoot(root);\r\n }\r\n else {\r\n result = root;\r\n }\r\n }\r\n catch (err) {\r\n handleError(err, instance, 1 /* RENDER_FUNCTION */);\r\n result = createVNode(Comment);\r\n }\r\n currentRenderingInstance = null;\r\n return result;\r\n}\r\n/**\r\n * dev only\r\n * In dev mode, template root level comments are rendered, which turns the\r\n * template into a fragment root, but we need to locate the single element\r\n * root for attrs and scope id processing.\r\n */\r\nconst getChildRoot = (vnode) => {\r\n const rawChildren = vnode.children;\r\n const dynamicChildren = vnode.dynamicChildren;\r\n const childRoot = filterSingleRoot(rawChildren);\r\n if (!childRoot) {\r\n return [vnode, undefined];\r\n }\r\n const index = rawChildren.indexOf(childRoot);\r\n const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;\r\n const setRoot = (updatedRoot) => {\r\n rawChildren[index] = updatedRoot;\r\n if (dynamicChildren) {\r\n if (dynamicIndex > -1) {\r\n dynamicChildren[dynamicIndex] = updatedRoot;\r\n }\r\n else if (updatedRoot.patchFlag > 0) {\r\n vnode.dynamicChildren = [...dynamicChildren, updatedRoot];\r\n }\r\n }\r\n };\r\n return [normalizeVNode(childRoot), setRoot];\r\n};\r\nfunction filterSingleRoot(children) {\r\n let singleRoot;\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n if (isVNode(child)) {\r\n // ignore user comment\r\n if (child.type !== Comment || child.children === 'v-if') {\r\n if (singleRoot) {\r\n // has more than 1 non-comment child, return now\r\n return;\r\n }\r\n else {\r\n singleRoot = child;\r\n }\r\n }\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n return singleRoot;\r\n}\r\nconst getFunctionalFallthrough = (attrs) => {\r\n let res;\r\n for (const key in attrs) {\r\n if (key === 'class' || key === 'style' || isOn(key)) {\r\n (res || (res = {}))[key] = attrs[key];\r\n }\r\n }\r\n return res;\r\n};\r\nconst filterModelListeners = (attrs, props) => {\r\n const res = {};\r\n for (const key in attrs) {\r\n if (!isModelListener(key) || !(key.slice(9) in props)) {\r\n res[key] = attrs[key];\r\n }\r\n }\r\n return res;\r\n};\r\nconst isElementRoot = (vnode) => {\r\n return (vnode.shapeFlag & 6 /* COMPONENT */ ||\r\n vnode.shapeFlag & 1 /* ELEMENT */ ||\r\n vnode.type === Comment // potential v-if branch switch\r\n );\r\n};\r\nfunction shouldUpdateComponent(prevVNode, nextVNode, optimized) {\r\n const { props: prevProps, children: prevChildren, component } = prevVNode;\r\n const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;\r\n const emits = component.emitsOptions;\r\n // Parent component's render function was hot-updated. Since this may have\r\n // caused the child component's slots content to have changed, we need to\r\n // force the child to update as well.\r\n if ((process.env.NODE_ENV !== 'production') && (prevChildren || nextChildren) && isHmrUpdating) {\r\n return true;\r\n }\r\n // force child update for runtime directive or transition on component vnode.\r\n if (nextVNode.dirs || nextVNode.transition) {\r\n return true;\r\n }\r\n if (optimized && patchFlag >= 0) {\r\n if (patchFlag & 1024 /* DYNAMIC_SLOTS */) {\r\n // slot content that references values that might have changed,\r\n // e.g. in a v-for\r\n return true;\r\n }\r\n if (patchFlag & 16 /* FULL_PROPS */) {\r\n if (!prevProps) {\r\n return !!nextProps;\r\n }\r\n // presence of this flag indicates props are always non-null\r\n return hasPropsChanged(prevProps, nextProps, emits);\r\n }\r\n else if (patchFlag & 8 /* PROPS */) {\r\n const dynamicProps = nextVNode.dynamicProps;\r\n for (let i = 0; i < dynamicProps.length; i++) {\r\n const key = dynamicProps[i];\r\n if (nextProps[key] !== prevProps[key] &&\r\n !isEmitListener(emits, key)) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // this path is only taken by manually written render functions\r\n // so presence of any children leads to a forced update\r\n if (prevChildren || nextChildren) {\r\n if (!nextChildren || !nextChildren.$stable) {\r\n return true;\r\n }\r\n }\r\n if (prevProps === nextProps) {\r\n return false;\r\n }\r\n if (!prevProps) {\r\n return !!nextProps;\r\n }\r\n if (!nextProps) {\r\n return true;\r\n }\r\n return hasPropsChanged(prevProps, nextProps, emits);\r\n }\r\n return false;\r\n}\r\nfunction hasPropsChanged(prevProps, nextProps, emitsOptions) {\r\n const nextKeys = Object.keys(nextProps);\r\n if (nextKeys.length !== Object.keys(prevProps).length) {\r\n return true;\r\n }\r\n for (let i = 0; i < nextKeys.length; i++) {\r\n const key = nextKeys[i];\r\n if (nextProps[key] !== prevProps[key] &&\r\n !isEmitListener(emitsOptions, key)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction updateHOCHostEl({ vnode, parent }, el // HostNode\r\n) {\r\n while (parent && parent.subTree === vnode) {\r\n (vnode = parent.vnode).el = el;\r\n parent = parent.parent;\r\n }\r\n}\n\nconst isSuspense = (type) => type.__isSuspense;\r\n// Suspense exposes a component-like API, and is treated like a component\r\n// in the compiler, but internally it's a special built-in type that hooks\r\n// directly into the renderer.\r\nconst SuspenseImpl = {\r\n // In order to make Suspense tree-shakable, we need to avoid importing it\r\n // directly in the renderer. The renderer checks for the __isSuspense flag\r\n // on a vnode's type and calls the `process` method, passing in renderer\r\n // internals.\r\n __isSuspense: true,\r\n process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized, \r\n // platform-specific impl passed from renderer\r\n rendererInternals) {\r\n if (n1 == null) {\r\n mountSuspense(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized, rendererInternals);\r\n }\r\n else {\r\n patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, rendererInternals);\r\n }\r\n },\r\n hydrate: hydrateSuspense,\r\n create: createSuspenseBoundary\r\n};\r\n// Force-casted public typing for h and TSX props inference\r\nconst Suspense = (SuspenseImpl\r\n );\r\nfunction mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, optimized, rendererInternals) {\r\n const { p: patch, o: { createElement } } = rendererInternals;\r\n const hiddenContainer = createElement('div');\r\n const suspense = (vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, optimized, rendererInternals));\r\n // start mounting the content subtree in an off-dom container\r\n patch(null, (suspense.pendingBranch = vnode.ssContent), hiddenContainer, null, parentComponent, suspense, isSVG);\r\n // now check if we have encountered any async deps\r\n if (suspense.deps > 0) {\r\n // has async\r\n // mount the fallback tree\r\n patch(null, vnode.ssFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context\r\n isSVG);\r\n setActiveBranch(suspense, vnode.ssFallback);\r\n }\r\n else {\r\n // Suspense has no async deps. Just resolve.\r\n suspense.resolve();\r\n }\r\n}\r\nfunction patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, { p: patch, um: unmount, o: { createElement } }) {\r\n const suspense = (n2.suspense = n1.suspense);\r\n suspense.vnode = n2;\r\n n2.el = n1.el;\r\n const newBranch = n2.ssContent;\r\n const newFallback = n2.ssFallback;\r\n const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;\r\n if (pendingBranch) {\r\n suspense.pendingBranch = newBranch;\r\n if (isSameVNodeType(newBranch, pendingBranch)) {\r\n // same root type but content may have changed.\r\n patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG);\r\n if (suspense.deps <= 0) {\r\n suspense.resolve();\r\n }\r\n else if (isInFallback) {\r\n patch(activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context\r\n isSVG);\r\n setActiveBranch(suspense, newFallback);\r\n }\r\n }\r\n else {\r\n // toggled before pending tree is resolved\r\n suspense.pendingId++;\r\n if (isHydrating) {\r\n // if toggled before hydration is finished, the current DOM tree is\r\n // no longer valid. set it as the active branch so it will be unmounted\r\n // when resolved\r\n suspense.isHydrating = false;\r\n suspense.activeBranch = pendingBranch;\r\n }\r\n else {\r\n unmount(pendingBranch, parentComponent, suspense);\r\n }\r\n // increment pending ID. this is used to invalidate async callbacks\r\n // reset suspense state\r\n suspense.deps = 0;\r\n // discard effects from pending branch\r\n suspense.effects.length = 0;\r\n // discard previous container\r\n suspense.hiddenContainer = createElement('div');\r\n if (isInFallback) {\r\n // already in fallback state\r\n patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG);\r\n if (suspense.deps <= 0) {\r\n suspense.resolve();\r\n }\r\n else {\r\n patch(activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context\r\n isSVG);\r\n setActiveBranch(suspense, newFallback);\r\n }\r\n }\r\n else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {\r\n // toggled \"back\" to current active branch\r\n patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, isSVG);\r\n // force resolve\r\n suspense.resolve(true);\r\n }\r\n else {\r\n // switched to a 3rd branch\r\n patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG);\r\n if (suspense.deps <= 0) {\r\n suspense.resolve();\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {\r\n // root did not change, just normal patch\r\n patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, isSVG);\r\n setActiveBranch(suspense, newBranch);\r\n }\r\n else {\r\n // root node toggled\r\n // invoke @pending event\r\n const onPending = n2.props && n2.props.onPending;\r\n if (isFunction(onPending)) {\r\n onPending();\r\n }\r\n // mount pending branch in off-dom container\r\n suspense.pendingBranch = newBranch;\r\n suspense.pendingId++;\r\n patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG);\r\n if (suspense.deps <= 0) {\r\n // incoming branch has no async deps, resolve now.\r\n suspense.resolve();\r\n }\r\n else {\r\n const { timeout, pendingId } = suspense;\r\n if (timeout > 0) {\r\n setTimeout(() => {\r\n if (suspense.pendingId === pendingId) {\r\n suspense.fallback(newFallback);\r\n }\r\n }, timeout);\r\n }\r\n else if (timeout === 0) {\r\n suspense.fallback(newFallback);\r\n }\r\n }\r\n }\r\n }\r\n}\r\nlet hasWarned = false;\r\nfunction createSuspenseBoundary(vnode, parent, parentComponent, container, hiddenContainer, anchor, isSVG, optimized, rendererInternals, isHydrating = false) {\r\n /* istanbul ignore if */\r\n if ((process.env.NODE_ENV !== 'production') && !false && !hasWarned) {\r\n hasWarned = true;\r\n // @ts-ignore `console.info` cannot be null error\r\n console[console.info ? 'info' : 'log'](` is an experimental feature and its API will likely change.`);\r\n }\r\n const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;\r\n const timeout = toNumber(vnode.props && vnode.props.timeout);\r\n const suspense = {\r\n vnode,\r\n parent,\r\n parentComponent,\r\n isSVG,\r\n container,\r\n hiddenContainer,\r\n anchor,\r\n deps: 0,\r\n pendingId: 0,\r\n timeout: typeof timeout === 'number' ? timeout : -1,\r\n activeBranch: null,\r\n pendingBranch: null,\r\n isInFallback: true,\r\n isHydrating,\r\n isUnmounted: false,\r\n effects: [],\r\n resolve(resume = false) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n if (!resume && !suspense.pendingBranch) {\r\n throw new Error(`suspense.resolve() is called without a pending branch.`);\r\n }\r\n if (suspense.isUnmounted) {\r\n throw new Error(`suspense.resolve() is called on an already unmounted suspense boundary.`);\r\n }\r\n }\r\n const { vnode, activeBranch, pendingBranch, pendingId, effects, parentComponent, container } = suspense;\r\n if (suspense.isHydrating) {\r\n suspense.isHydrating = false;\r\n }\r\n else if (!resume) {\r\n const delayEnter = activeBranch &&\r\n pendingBranch.transition &&\r\n pendingBranch.transition.mode === 'out-in';\r\n if (delayEnter) {\r\n activeBranch.transition.afterLeave = () => {\r\n if (pendingId === suspense.pendingId) {\r\n move(pendingBranch, container, anchor, 0 /* ENTER */);\r\n }\r\n };\r\n }\r\n // this is initial anchor on mount\r\n let { anchor } = suspense;\r\n // unmount current active tree\r\n if (activeBranch) {\r\n // if the fallback tree was mounted, it may have been moved\r\n // as part of a parent suspense. get the latest anchor for insertion\r\n anchor = next(activeBranch);\r\n unmount(activeBranch, parentComponent, suspense, true);\r\n }\r\n if (!delayEnter) {\r\n // move content from off-dom container to actual container\r\n move(pendingBranch, container, anchor, 0 /* ENTER */);\r\n }\r\n }\r\n setActiveBranch(suspense, pendingBranch);\r\n suspense.pendingBranch = null;\r\n suspense.isInFallback = false;\r\n // flush buffered effects\r\n // check if there is a pending parent suspense\r\n let parent = suspense.parent;\r\n let hasUnresolvedAncestor = false;\r\n while (parent) {\r\n if (parent.pendingBranch) {\r\n // found a pending parent suspense, merge buffered post jobs\r\n // into that parent\r\n parent.effects.push(...effects);\r\n hasUnresolvedAncestor = true;\r\n break;\r\n }\r\n parent = parent.parent;\r\n }\r\n // no pending parent suspense, flush all jobs\r\n if (!hasUnresolvedAncestor) {\r\n queuePostFlushCb(effects);\r\n }\r\n suspense.effects = [];\r\n // invoke @resolve event\r\n const onResolve = vnode.props && vnode.props.onResolve;\r\n if (isFunction(onResolve)) {\r\n onResolve();\r\n }\r\n },\r\n fallback(fallbackVNode) {\r\n if (!suspense.pendingBranch) {\r\n return;\r\n }\r\n const { vnode, activeBranch, parentComponent, container, isSVG } = suspense;\r\n // invoke @fallback event\r\n const onFallback = vnode.props && vnode.props.onFallback;\r\n if (isFunction(onFallback)) {\r\n onFallback();\r\n }\r\n const anchor = next(activeBranch);\r\n const mountFallback = () => {\r\n if (!suspense.isInFallback) {\r\n return;\r\n }\r\n // mount the fallback tree\r\n patch(null, fallbackVNode, container, anchor, parentComponent, null, // fallback tree will not have suspense context\r\n isSVG);\r\n setActiveBranch(suspense, fallbackVNode);\r\n };\r\n const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === 'out-in';\r\n if (delayEnter) {\r\n activeBranch.transition.afterLeave = mountFallback;\r\n }\r\n // unmount current active branch\r\n unmount(activeBranch, parentComponent, null, // no suspense so unmount hooks fire now\r\n true // shouldRemove\r\n );\r\n suspense.isInFallback = true;\r\n if (!delayEnter) {\r\n mountFallback();\r\n }\r\n },\r\n move(container, anchor, type) {\r\n suspense.activeBranch &&\r\n move(suspense.activeBranch, container, anchor, type);\r\n suspense.container = container;\r\n },\r\n next() {\r\n return suspense.activeBranch && next(suspense.activeBranch);\r\n },\r\n registerDep(instance, setupRenderEffect) {\r\n const isInPendingSuspense = !!suspense.pendingBranch;\r\n if (isInPendingSuspense) {\r\n suspense.deps++;\r\n }\r\n const hydratedEl = instance.vnode.el;\r\n instance\r\n .asyncDep.catch(err => {\r\n handleError(err, instance, 0 /* SETUP_FUNCTION */);\r\n })\r\n .then(asyncSetupResult => {\r\n // retry when the setup() promise resolves.\r\n // component may have been unmounted before resolve.\r\n if (instance.isUnmounted ||\r\n suspense.isUnmounted ||\r\n suspense.pendingId !== instance.suspenseId) {\r\n return;\r\n }\r\n // retry from this component\r\n instance.asyncResolved = true;\r\n const { vnode } = instance;\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n pushWarningContext(vnode);\r\n }\r\n handleSetupResult(instance, asyncSetupResult);\r\n if (hydratedEl) {\r\n // vnode may have been replaced if an update happened before the\r\n // async dep is resolved.\r\n vnode.el = hydratedEl;\r\n }\r\n const placeholder = !hydratedEl && instance.subTree.el;\r\n setupRenderEffect(instance, vnode, \r\n // component may have been moved before resolve.\r\n // if this is not a hydration, instance.subTree will be the comment\r\n // placeholder.\r\n parentNode(hydratedEl || instance.subTree.el), \r\n // anchor will not be used if this is hydration, so only need to\r\n // consider the comment placeholder case.\r\n hydratedEl ? null : next(instance.subTree), suspense, isSVG, optimized);\r\n if (placeholder) {\r\n remove(placeholder);\r\n }\r\n updateHOCHostEl(instance, vnode.el);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n popWarningContext();\r\n }\r\n // only decrease deps count if suspense is not already resolved\r\n if (isInPendingSuspense && --suspense.deps === 0) {\r\n suspense.resolve();\r\n }\r\n });\r\n },\r\n unmount(parentSuspense, doRemove) {\r\n suspense.isUnmounted = true;\r\n if (suspense.activeBranch) {\r\n unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);\r\n }\r\n if (suspense.pendingBranch) {\r\n unmount(suspense.pendingBranch, parentComponent, parentSuspense, doRemove);\r\n }\r\n }\r\n };\r\n return suspense;\r\n}\r\nfunction hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, optimized, rendererInternals, hydrateNode) {\r\n /* eslint-disable no-restricted-globals */\r\n const suspense = (vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, node.parentNode, document.createElement('div'), null, isSVG, optimized, rendererInternals, true /* hydrating */));\r\n // there are two possible scenarios for server-rendered suspense:\r\n // - success: ssr content should be fully resolved\r\n // - failure: ssr content should be the fallback branch.\r\n // however, on the client we don't really know if it has failed or not\r\n // attempt to hydrate the DOM assuming it has succeeded, but we still\r\n // need to construct a suspense boundary first\r\n const result = hydrateNode(node, (suspense.pendingBranch = vnode.ssContent), parentComponent, suspense, optimized);\r\n if (suspense.deps === 0) {\r\n suspense.resolve();\r\n }\r\n return result;\r\n /* eslint-enable no-restricted-globals */\r\n}\r\nfunction normalizeSuspenseChildren(vnode) {\r\n const { shapeFlag, children } = vnode;\r\n let content;\r\n let fallback;\r\n if (shapeFlag & 32 /* SLOTS_CHILDREN */) {\r\n content = normalizeSuspenseSlot(children.default);\r\n fallback = normalizeSuspenseSlot(children.fallback);\r\n }\r\n else {\r\n content = normalizeSuspenseSlot(children);\r\n fallback = normalizeVNode(null);\r\n }\r\n return {\r\n content,\r\n fallback\r\n };\r\n}\r\nfunction normalizeSuspenseSlot(s) {\r\n if (isFunction(s)) {\r\n s = s();\r\n }\r\n if (isArray(s)) {\r\n const singleChild = filterSingleRoot(s);\r\n if ((process.env.NODE_ENV !== 'production') && !singleChild) {\r\n warn(` slots expect a single root node.`);\r\n }\r\n s = singleChild;\r\n }\r\n return normalizeVNode(s);\r\n}\r\nfunction queueEffectWithSuspense(fn, suspense) {\r\n if (suspense && suspense.pendingBranch) {\r\n if (isArray(fn)) {\r\n suspense.effects.push(...fn);\r\n }\r\n else {\r\n suspense.effects.push(fn);\r\n }\r\n }\r\n else {\r\n queuePostFlushCb(fn);\r\n }\r\n}\r\nfunction setActiveBranch(suspense, branch) {\r\n suspense.activeBranch = branch;\r\n const { vnode, parentComponent } = suspense;\r\n const el = (vnode.el = branch.el);\r\n // in case suspense is the root node of a component,\r\n // recursively update the HOC el\r\n if (parentComponent && parentComponent.subTree === vnode) {\r\n parentComponent.vnode.el = el;\r\n updateHOCHostEl(parentComponent, el);\r\n }\r\n}\n\nlet isRenderingCompiledSlot = 0;\r\nconst setCompiledSlotRendering = (n) => (isRenderingCompiledSlot += n);\r\n/**\r\n * Compiler runtime helper for rendering ``\r\n * @private\r\n */\r\nfunction renderSlot(slots, name, props = {}, \r\n// this is not a user-facing function, so the fallback is always generated by\r\n// the compiler and guaranteed to be a function returning an array\r\nfallback) {\r\n let slot = slots[name];\r\n if ((process.env.NODE_ENV !== 'production') && slot && slot.length > 1) {\r\n warn(`SSR-optimized slot function detected in a non-SSR-optimized render ` +\r\n `function. You need to mark this component with $dynamic-slots in the ` +\r\n `parent template.`);\r\n slot = () => [];\r\n }\r\n // a compiled slot disables block tracking by default to avoid manual\r\n // invocation interfering with template-based block tracking, but in\r\n // `renderSlot` we can be sure that it's template-based so we can force\r\n // enable it.\r\n isRenderingCompiledSlot++;\r\n openBlock();\r\n const validSlotContent = slot && ensureValidVNode(slot(props));\r\n const rendered = createBlock(Fragment, { key: props.key || `_${name}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* STABLE */\r\n ? 64 /* STABLE_FRAGMENT */\r\n : -2 /* BAIL */);\r\n isRenderingCompiledSlot--;\r\n return rendered;\r\n}\r\nfunction ensureValidVNode(vnodes) {\r\n return vnodes.some(child => {\r\n if (!isVNode(child))\r\n return true;\r\n if (child.type === Comment)\r\n return false;\r\n if (child.type === Fragment &&\r\n !ensureValidVNode(child.children))\r\n return false;\r\n return true;\r\n })\r\n ? vnodes\r\n : null;\r\n}\n\n/**\r\n * Wrap a slot function to memoize current rendering instance\r\n * @private\r\n */\r\nfunction withCtx(fn, ctx = currentRenderingInstance) {\r\n if (!ctx)\r\n return fn;\r\n const renderFnWithContext = (...args) => {\r\n // If a user calls a compiled slot inside a template expression (#1745), it\r\n // can mess up block tracking, so by default we need to push a null block to\r\n // avoid that. This isn't necessary if rendering a compiled ``.\r\n if (!isRenderingCompiledSlot) {\r\n openBlock(true /* null block that disables tracking */);\r\n }\r\n const owner = currentRenderingInstance;\r\n setCurrentRenderingInstance(ctx);\r\n const res = fn(...args);\r\n setCurrentRenderingInstance(owner);\r\n if (!isRenderingCompiledSlot) {\r\n closeBlock();\r\n }\r\n return res;\r\n };\r\n renderFnWithContext._c = true;\r\n return renderFnWithContext;\r\n}\n\n// SFC scoped style ID management.\r\nlet currentScopeId = null;\r\nconst scopeIdStack = [];\r\n/**\r\n * @private\r\n */\r\nfunction pushScopeId(id) {\r\n scopeIdStack.push((currentScopeId = id));\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction popScopeId() {\r\n scopeIdStack.pop();\r\n currentScopeId = scopeIdStack[scopeIdStack.length - 1] || null;\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction withScopeId(id) {\r\n return ((fn) => withCtx(function () {\r\n pushScopeId(id);\r\n const res = fn.apply(this, arguments);\r\n popScopeId();\r\n return res;\r\n }));\r\n}\n\nfunction initProps(instance, rawProps, isStateful, // result of bitwise flag comparison\r\nisSSR = false) {\r\n const props = {};\r\n const attrs = {};\r\n def(attrs, InternalObjectKey, 1);\r\n setFullProps(instance, rawProps, props, attrs);\r\n // validation\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n validateProps(props, instance);\r\n }\r\n if (isStateful) {\r\n // stateful\r\n instance.props = isSSR ? props : shallowReactive(props);\r\n }\r\n else {\r\n if (!instance.type.props) {\r\n // functional w/ optional props, props === attrs\r\n instance.props = attrs;\r\n }\r\n else {\r\n // functional w/ declared props\r\n instance.props = props;\r\n }\r\n }\r\n instance.attrs = attrs;\r\n}\r\nfunction updateProps(instance, rawProps, rawPrevProps, optimized) {\r\n const { props, attrs, vnode: { patchFlag } } = instance;\r\n const rawCurrentProps = toRaw(props);\r\n const [options] = instance.propsOptions;\r\n if (\r\n // always force full diff in dev\r\n // - #1942 if hmr is enabled with sfc component\r\n // - vite#872 non-sfc component used by sfc component\r\n !((process.env.NODE_ENV !== 'production') &&\r\n (instance.type.__hmrId ||\r\n (instance.parent && instance.parent.type.__hmrId))) &&\r\n (optimized || patchFlag > 0) &&\r\n !(patchFlag & 16 /* FULL_PROPS */)) {\r\n if (patchFlag & 8 /* PROPS */) {\r\n // Compiler-generated props & no keys change, just set the updated\r\n // the props.\r\n const propsToUpdate = instance.vnode.dynamicProps;\r\n for (let i = 0; i < propsToUpdate.length; i++) {\r\n const key = propsToUpdate[i];\r\n // PROPS flag guarantees rawProps to be non-null\r\n const value = rawProps[key];\r\n if (options) {\r\n // attr / props separation was done on init and will be consistent\r\n // in this code path, so just check if attrs have it.\r\n if (hasOwn(attrs, key)) {\r\n attrs[key] = value;\r\n }\r\n else {\r\n const camelizedKey = camelize(key);\r\n props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance);\r\n }\r\n }\r\n else {\r\n attrs[key] = value;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // full props update.\r\n setFullProps(instance, rawProps, props, attrs);\r\n // in case of dynamic props, check if we need to delete keys from\r\n // the props object\r\n let kebabKey;\r\n for (const key in rawCurrentProps) {\r\n if (!rawProps ||\r\n // for camelCase\r\n (!hasOwn(rawProps, key) &&\r\n // it's possible the original props was passed in as kebab-case\r\n // and converted to camelCase (#955)\r\n ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey)))) {\r\n if (options) {\r\n if (rawPrevProps &&\r\n // for camelCase\r\n (rawPrevProps[key] !== undefined ||\r\n // for kebab-case\r\n rawPrevProps[kebabKey] !== undefined)) {\r\n props[key] = resolvePropValue(options, rawProps || EMPTY_OBJ, key, undefined, instance);\r\n }\r\n }\r\n else {\r\n delete props[key];\r\n }\r\n }\r\n }\r\n // in the case of functional component w/o props declaration, props and\r\n // attrs point to the same object so it should already have been updated.\r\n if (attrs !== rawCurrentProps) {\r\n for (const key in attrs) {\r\n if (!rawProps || !hasOwn(rawProps, key)) {\r\n delete attrs[key];\r\n }\r\n }\r\n }\r\n }\r\n // trigger updates for $attrs in case it's used in component slots\r\n trigger(instance, \"set\" /* SET */, '$attrs');\r\n if ((process.env.NODE_ENV !== 'production') && rawProps) {\r\n validateProps(props, instance);\r\n }\r\n}\r\nfunction setFullProps(instance, rawProps, props, attrs) {\r\n const [options, needCastKeys] = instance.propsOptions;\r\n if (rawProps) {\r\n for (const key in rawProps) {\r\n const value = rawProps[key];\r\n // key, ref are reserved and never passed down\r\n if (isReservedProp(key)) {\r\n continue;\r\n }\r\n // prop option names are camelized during normalization, so to support\r\n // kebab -> camel conversion here we need to camelize the key.\r\n let camelKey;\r\n if (options && hasOwn(options, (camelKey = camelize(key)))) {\r\n props[camelKey] = value;\r\n }\r\n else if (!isEmitListener(instance.emitsOptions, key)) {\r\n // Any non-declared (either as a prop or an emitted event) props are put\r\n // into a separate `attrs` object for spreading. Make sure to preserve\r\n // original key casing\r\n attrs[key] = value;\r\n }\r\n }\r\n }\r\n if (needCastKeys) {\r\n const rawCurrentProps = toRaw(props);\r\n for (let i = 0; i < needCastKeys.length; i++) {\r\n const key = needCastKeys[i];\r\n props[key] = resolvePropValue(options, rawCurrentProps, key, rawCurrentProps[key], instance);\r\n }\r\n }\r\n}\r\nfunction resolvePropValue(options, props, key, value, instance) {\r\n const opt = options[key];\r\n if (opt != null) {\r\n const hasDefault = hasOwn(opt, 'default');\r\n // default values\r\n if (hasDefault && value === undefined) {\r\n const defaultValue = opt.default;\r\n if (opt.type !== Function && isFunction(defaultValue)) {\r\n setCurrentInstance(instance);\r\n value = defaultValue(props);\r\n setCurrentInstance(null);\r\n }\r\n else {\r\n value = defaultValue;\r\n }\r\n }\r\n // boolean casting\r\n if (opt[0 /* shouldCast */]) {\r\n if (!hasOwn(props, key) && !hasDefault) {\r\n value = false;\r\n }\r\n else if (opt[1 /* shouldCastTrue */] &&\r\n (value === '' || value === hyphenate(key))) {\r\n value = true;\r\n }\r\n }\r\n }\r\n return value;\r\n}\r\nfunction normalizePropsOptions(comp, appContext, asMixin = false) {\r\n if (!appContext.deopt && comp.__props) {\r\n return comp.__props;\r\n }\r\n const raw = comp.props;\r\n const normalized = {};\r\n const needCastKeys = [];\r\n // apply mixin/extends props\r\n let hasExtends = false;\r\n if (__VUE_OPTIONS_API__ && !isFunction(comp)) {\r\n const extendProps = (raw) => {\r\n hasExtends = true;\r\n const [props, keys] = normalizePropsOptions(raw, appContext, true);\r\n extend(normalized, props);\r\n if (keys)\r\n needCastKeys.push(...keys);\r\n };\r\n if (!asMixin && appContext.mixins.length) {\r\n appContext.mixins.forEach(extendProps);\r\n }\r\n if (comp.extends) {\r\n extendProps(comp.extends);\r\n }\r\n if (comp.mixins) {\r\n comp.mixins.forEach(extendProps);\r\n }\r\n }\r\n if (!raw && !hasExtends) {\r\n return (comp.__props = EMPTY_ARR);\r\n }\r\n if (isArray(raw)) {\r\n for (let i = 0; i < raw.length; i++) {\r\n if ((process.env.NODE_ENV !== 'production') && !isString(raw[i])) {\r\n warn(`props must be strings when using array syntax.`, raw[i]);\r\n }\r\n const normalizedKey = camelize(raw[i]);\r\n if (validatePropName(normalizedKey)) {\r\n normalized[normalizedKey] = EMPTY_OBJ;\r\n }\r\n }\r\n }\r\n else if (raw) {\r\n if ((process.env.NODE_ENV !== 'production') && !isObject(raw)) {\r\n warn(`invalid props options`, raw);\r\n }\r\n for (const key in raw) {\r\n const normalizedKey = camelize(key);\r\n if (validatePropName(normalizedKey)) {\r\n const opt = raw[key];\r\n const prop = (normalized[normalizedKey] =\r\n isArray(opt) || isFunction(opt) ? { type: opt } : opt);\r\n if (prop) {\r\n const booleanIndex = getTypeIndex(Boolean, prop.type);\r\n const stringIndex = getTypeIndex(String, prop.type);\r\n prop[0 /* shouldCast */] = booleanIndex > -1;\r\n prop[1 /* shouldCastTrue */] =\r\n stringIndex < 0 || booleanIndex < stringIndex;\r\n // if the prop needs boolean casting or default value\r\n if (booleanIndex > -1 || hasOwn(prop, 'default')) {\r\n needCastKeys.push(normalizedKey);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return (comp.__props = [normalized, needCastKeys]);\r\n}\r\nfunction validatePropName(key) {\r\n if (key[0] !== '$') {\r\n return true;\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`Invalid prop name: \"${key}\" is a reserved property.`);\r\n }\r\n return false;\r\n}\r\n// use function string name to check type constructors\r\n// so that it works across vms / iframes.\r\nfunction getType(ctor) {\r\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\r\n return match ? match[1] : '';\r\n}\r\nfunction isSameType(a, b) {\r\n return getType(a) === getType(b);\r\n}\r\nfunction getTypeIndex(type, expectedTypes) {\r\n if (isArray(expectedTypes)) {\r\n for (let i = 0, len = expectedTypes.length; i < len; i++) {\r\n if (isSameType(expectedTypes[i], type)) {\r\n return i;\r\n }\r\n }\r\n }\r\n else if (isFunction(expectedTypes)) {\r\n return isSameType(expectedTypes, type) ? 0 : -1;\r\n }\r\n return -1;\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction validateProps(props, instance) {\r\n const rawValues = toRaw(props);\r\n const options = instance.propsOptions[0];\r\n for (const key in options) {\r\n let opt = options[key];\r\n if (opt == null)\r\n continue;\r\n validateProp(key, rawValues[key], opt, !hasOwn(rawValues, key));\r\n }\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction validateProp(name, value, prop, isAbsent) {\r\n const { type, required, validator } = prop;\r\n // required!\r\n if (required && isAbsent) {\r\n warn('Missing required prop: \"' + name + '\"');\r\n return;\r\n }\r\n // missing but optional\r\n if (value == null && !prop.required) {\r\n return;\r\n }\r\n // type check\r\n if (type != null && type !== true) {\r\n let isValid = false;\r\n const types = isArray(type) ? type : [type];\r\n const expectedTypes = [];\r\n // value is valid as long as one of the specified types match\r\n for (let i = 0; i < types.length && !isValid; i++) {\r\n const { valid, expectedType } = assertType(value, types[i]);\r\n expectedTypes.push(expectedType || '');\r\n isValid = valid;\r\n }\r\n if (!isValid) {\r\n warn(getInvalidTypeMessage(name, value, expectedTypes));\r\n return;\r\n }\r\n }\r\n // custom validator\r\n if (validator && !validator(value)) {\r\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".');\r\n }\r\n}\r\nconst isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol,BigInt');\r\n/**\r\n * dev only\r\n */\r\nfunction assertType(value, type) {\r\n let valid;\r\n const expectedType = getType(type);\r\n if (isSimpleType(expectedType)) {\r\n const t = typeof value;\r\n valid = t === expectedType.toLowerCase();\r\n // for primitive wrapper objects\r\n if (!valid && t === 'object') {\r\n valid = value instanceof type;\r\n }\r\n }\r\n else if (expectedType === 'Object') {\r\n valid = isObject(value);\r\n }\r\n else if (expectedType === 'Array') {\r\n valid = isArray(value);\r\n }\r\n else {\r\n valid = value instanceof type;\r\n }\r\n return {\r\n valid,\r\n expectedType\r\n };\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction getInvalidTypeMessage(name, value, expectedTypes) {\r\n let message = `Invalid prop: type check failed for prop \"${name}\".` +\r\n ` Expected ${expectedTypes.map(capitalize).join(', ')}`;\r\n const expectedType = expectedTypes[0];\r\n const receivedType = toRawType(value);\r\n const expectedValue = styleValue(value, expectedType);\r\n const receivedValue = styleValue(value, receivedType);\r\n // check if we need to specify expected value\r\n if (expectedTypes.length === 1 &&\r\n isExplicable(expectedType) &&\r\n !isBoolean(expectedType, receivedType)) {\r\n message += ` with value ${expectedValue}`;\r\n }\r\n message += `, got ${receivedType} `;\r\n // check if we need to specify received value\r\n if (isExplicable(receivedType)) {\r\n message += `with value ${receivedValue}.`;\r\n }\r\n return message;\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction styleValue(value, type) {\r\n if (type === 'String') {\r\n return `\"${value}\"`;\r\n }\r\n else if (type === 'Number') {\r\n return `${Number(value)}`;\r\n }\r\n else {\r\n return `${value}`;\r\n }\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction isExplicable(type) {\r\n const explicitTypes = ['string', 'number', 'boolean'];\r\n return explicitTypes.some(elem => type.toLowerCase() === elem);\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction isBoolean(...args) {\r\n return args.some(elem => elem.toLowerCase() === 'boolean');\r\n}\n\nfunction injectHook(type, hook, target = currentInstance, prepend = false) {\r\n if (target) {\r\n const hooks = target[type] || (target[type] = []);\r\n // cache the error handling wrapper for injected hooks so the same hook\r\n // can be properly deduped by the scheduler. \"__weh\" stands for \"with error\r\n // handling\".\r\n const wrappedHook = hook.__weh ||\r\n (hook.__weh = (...args) => {\r\n if (target.isUnmounted) {\r\n return;\r\n }\r\n // disable tracking inside all lifecycle hooks\r\n // since they can potentially be called inside effects.\r\n pauseTracking();\r\n // Set currentInstance during hook invocation.\r\n // This assumes the hook does not synchronously trigger other hooks, which\r\n // can only be false when the user does something really funky.\r\n setCurrentInstance(target);\r\n const res = callWithAsyncErrorHandling(hook, target, type, args);\r\n setCurrentInstance(null);\r\n resetTracking();\r\n return res;\r\n });\r\n if (prepend) {\r\n hooks.unshift(wrappedHook);\r\n }\r\n else {\r\n hooks.push(wrappedHook);\r\n }\r\n return wrappedHook;\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ''));\r\n warn(`${apiName} is called when there is no active component instance to be ` +\r\n `associated with. ` +\r\n `Lifecycle injection APIs can only be used during execution of setup().` +\r\n (` If you are using async setup(), make sure to register lifecycle ` +\r\n `hooks before the first await statement.`\r\n ));\r\n }\r\n}\r\nconst createHook = (lifecycle) => (hook, target = currentInstance) => \r\n// post-create lifecycle registrations are noops during SSR\r\n!isInSSRComponentSetup && injectHook(lifecycle, hook, target);\r\nconst onBeforeMount = createHook(\"bm\" /* BEFORE_MOUNT */);\r\nconst onMounted = createHook(\"m\" /* MOUNTED */);\r\nconst onBeforeUpdate = createHook(\"bu\" /* BEFORE_UPDATE */);\r\nconst onUpdated = createHook(\"u\" /* UPDATED */);\r\nconst onBeforeUnmount = createHook(\"bum\" /* BEFORE_UNMOUNT */);\r\nconst onUnmounted = createHook(\"um\" /* UNMOUNTED */);\r\nconst onRenderTriggered = createHook(\"rtg\" /* RENDER_TRIGGERED */);\r\nconst onRenderTracked = createHook(\"rtc\" /* RENDER_TRACKED */);\r\nconst onErrorCaptured = (hook, target = currentInstance) => {\r\n injectHook(\"ec\" /* ERROR_CAPTURED */, hook, target);\r\n};\n\n// Simple effect.\r\nfunction watchEffect(effect, options) {\r\n return doWatch(effect, null, options);\r\n}\r\n// initial value for watchers to trigger on undefined initial values\r\nconst INITIAL_WATCHER_VALUE = {};\r\n// implementation\r\nfunction watch(source, cb, options) {\r\n if ((process.env.NODE_ENV !== 'production') && !isFunction(cb)) {\r\n warn(`\\`watch(fn, options?)\\` signature has been moved to a separate API. ` +\r\n `Use \\`watchEffect(fn, options?)\\` instead. \\`watch\\` now only ` +\r\n `supports \\`watch(source, cb, options?) signature.`);\r\n }\r\n return doWatch(source, cb, options);\r\n}\r\nfunction doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ, instance = currentInstance) {\r\n if ((process.env.NODE_ENV !== 'production') && !cb) {\r\n if (immediate !== undefined) {\r\n warn(`watch() \"immediate\" option is only respected when using the ` +\r\n `watch(source, callback, options?) signature.`);\r\n }\r\n if (deep !== undefined) {\r\n warn(`watch() \"deep\" option is only respected when using the ` +\r\n `watch(source, callback, options?) signature.`);\r\n }\r\n }\r\n const warnInvalidSource = (s) => {\r\n warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +\r\n `a reactive object, or an array of these types.`);\r\n };\r\n let getter;\r\n let forceTrigger = false;\r\n if (isRef(source)) {\r\n getter = () => source.value;\r\n forceTrigger = !!source._shallow;\r\n }\r\n else if (isReactive(source)) {\r\n getter = () => source;\r\n deep = true;\r\n }\r\n else if (isArray(source)) {\r\n getter = () => source.map(s => {\r\n if (isRef(s)) {\r\n return s.value;\r\n }\r\n else if (isReactive(s)) {\r\n return traverse(s);\r\n }\r\n else if (isFunction(s)) {\r\n return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */, [\r\n instance && instance.proxy\r\n ]);\r\n }\r\n else {\r\n (process.env.NODE_ENV !== 'production') && warnInvalidSource(s);\r\n }\r\n });\r\n }\r\n else if (isFunction(source)) {\r\n if (cb) {\r\n // getter with cb\r\n getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */, [\r\n instance && instance.proxy\r\n ]);\r\n }\r\n else {\r\n // no cb -> simple effect\r\n getter = () => {\r\n if (instance && instance.isUnmounted) {\r\n return;\r\n }\r\n if (cleanup) {\r\n cleanup();\r\n }\r\n return callWithErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onInvalidate]);\r\n };\r\n }\r\n }\r\n else {\r\n getter = NOOP;\r\n (process.env.NODE_ENV !== 'production') && warnInvalidSource(source);\r\n }\r\n if (cb && deep) {\r\n const baseGetter = getter;\r\n getter = () => traverse(baseGetter());\r\n }\r\n let cleanup;\r\n const onInvalidate = (fn) => {\r\n cleanup = runner.options.onStop = () => {\r\n callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);\r\n };\r\n };\r\n let oldValue = isArray(source) ? [] : INITIAL_WATCHER_VALUE;\r\n const job = () => {\r\n if (!runner.active) {\r\n return;\r\n }\r\n if (cb) {\r\n // watch(source, cb)\r\n const newValue = runner();\r\n if (deep || forceTrigger || hasChanged(newValue, oldValue)) {\r\n // cleanup before running cb again\r\n if (cleanup) {\r\n cleanup();\r\n }\r\n callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [\r\n newValue,\r\n // pass undefined as the old value when it's changed for the first time\r\n oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,\r\n onInvalidate\r\n ]);\r\n oldValue = newValue;\r\n }\r\n }\r\n else {\r\n // watchEffect\r\n runner();\r\n }\r\n };\r\n // important: mark the job as a watcher callback so that scheduler knows\r\n // it is allowed to self-trigger (#1727)\r\n job.allowRecurse = !!cb;\r\n let scheduler;\r\n if (flush === 'sync') {\r\n scheduler = job;\r\n }\r\n else if (flush === 'post') {\r\n scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);\r\n }\r\n else {\r\n // default: 'pre'\r\n scheduler = () => {\r\n if (!instance || instance.isMounted) {\r\n queuePreFlushCb(job);\r\n }\r\n else {\r\n // with 'pre' option, the first call must happen before\r\n // the component is mounted so it is called synchronously.\r\n job();\r\n }\r\n };\r\n }\r\n const runner = effect(getter, {\r\n lazy: true,\r\n onTrack,\r\n onTrigger,\r\n scheduler\r\n });\r\n recordInstanceBoundEffect(runner, instance);\r\n // initial run\r\n if (cb) {\r\n if (immediate) {\r\n job();\r\n }\r\n else {\r\n oldValue = runner();\r\n }\r\n }\r\n else if (flush === 'post') {\r\n queuePostRenderEffect(runner, instance && instance.suspense);\r\n }\r\n else {\r\n runner();\r\n }\r\n return () => {\r\n stop(runner);\r\n if (instance) {\r\n remove(instance.effects, runner);\r\n }\r\n };\r\n}\r\n// this.$watch\r\nfunction instanceWatch(source, cb, options) {\r\n const publicThis = this.proxy;\r\n const getter = isString(source)\r\n ? () => publicThis[source]\r\n : source.bind(publicThis);\r\n return doWatch(getter, cb.bind(publicThis), options, this);\r\n}\r\nfunction traverse(value, seen = new Set()) {\r\n if (!isObject(value) || seen.has(value)) {\r\n return value;\r\n }\r\n seen.add(value);\r\n if (isRef(value)) {\r\n traverse(value.value, seen);\r\n }\r\n else if (isArray(value)) {\r\n for (let i = 0; i < value.length; i++) {\r\n traverse(value[i], seen);\r\n }\r\n }\r\n else if (isSet(value) || isMap(value)) {\r\n value.forEach((v) => {\r\n traverse(v, seen);\r\n });\r\n }\r\n else {\r\n for (const key in value) {\r\n traverse(value[key], seen);\r\n }\r\n }\r\n return value;\r\n}\n\nfunction useTransitionState() {\r\n const state = {\r\n isMounted: false,\r\n isLeaving: false,\r\n isUnmounting: false,\r\n leavingVNodes: new Map()\r\n };\r\n onMounted(() => {\r\n state.isMounted = true;\r\n });\r\n onBeforeUnmount(() => {\r\n state.isUnmounting = true;\r\n });\r\n return state;\r\n}\r\nconst TransitionHookValidator = [Function, Array];\r\nconst BaseTransitionImpl = {\r\n name: `BaseTransition`,\r\n props: {\r\n mode: String,\r\n appear: Boolean,\r\n persisted: Boolean,\r\n // enter\r\n onBeforeEnter: TransitionHookValidator,\r\n onEnter: TransitionHookValidator,\r\n onAfterEnter: TransitionHookValidator,\r\n onEnterCancelled: TransitionHookValidator,\r\n // leave\r\n onBeforeLeave: TransitionHookValidator,\r\n onLeave: TransitionHookValidator,\r\n onAfterLeave: TransitionHookValidator,\r\n onLeaveCancelled: TransitionHookValidator,\r\n // appear\r\n onBeforeAppear: TransitionHookValidator,\r\n onAppear: TransitionHookValidator,\r\n onAfterAppear: TransitionHookValidator,\r\n onAppearCancelled: TransitionHookValidator\r\n },\r\n setup(props, { slots }) {\r\n const instance = getCurrentInstance();\r\n const state = useTransitionState();\r\n let prevTransitionKey;\r\n return () => {\r\n const children = slots.default && getTransitionRawChildren(slots.default(), true);\r\n if (!children || !children.length) {\r\n return;\r\n }\r\n // warn multiple elements\r\n if ((process.env.NODE_ENV !== 'production') && children.length > 1) {\r\n warn(' can only be used on a single element or component. Use ' +\r\n ' for lists.');\r\n }\r\n // there's no need to track reactivity for these props so use the raw\r\n // props for a bit better perf\r\n const rawProps = toRaw(props);\r\n const { mode } = rawProps;\r\n // check mode\r\n if ((process.env.NODE_ENV !== 'production') && mode && !['in-out', 'out-in', 'default'].includes(mode)) {\r\n warn(`invalid mode: ${mode}`);\r\n }\r\n // at this point children has a guaranteed length of 1.\r\n const child = children[0];\r\n if (state.isLeaving) {\r\n return emptyPlaceholder(child);\r\n }\r\n // in the case of , we need to\r\n // compare the type of the kept-alive children.\r\n const innerChild = getKeepAliveChild(child);\r\n if (!innerChild) {\r\n return emptyPlaceholder(child);\r\n }\r\n const enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance);\r\n setTransitionHooks(innerChild, enterHooks);\r\n const oldChild = instance.subTree;\r\n const oldInnerChild = oldChild && getKeepAliveChild(oldChild);\r\n let transitionKeyChanged = false;\r\n const { getTransitionKey } = innerChild.type;\r\n if (getTransitionKey) {\r\n const key = getTransitionKey();\r\n if (prevTransitionKey === undefined) {\r\n prevTransitionKey = key;\r\n }\r\n else if (key !== prevTransitionKey) {\r\n prevTransitionKey = key;\r\n transitionKeyChanged = true;\r\n }\r\n }\r\n // handle mode\r\n if (oldInnerChild &&\r\n oldInnerChild.type !== Comment &&\r\n (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {\r\n const leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);\r\n // update old tree's hooks in case of dynamic transition\r\n setTransitionHooks(oldInnerChild, leavingHooks);\r\n // switching between different views\r\n if (mode === 'out-in') {\r\n state.isLeaving = true;\r\n // return placeholder node and queue update when leave finishes\r\n leavingHooks.afterLeave = () => {\r\n state.isLeaving = false;\r\n instance.update();\r\n };\r\n return emptyPlaceholder(child);\r\n }\r\n else if (mode === 'in-out') {\r\n leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {\r\n const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);\r\n leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;\r\n // early removal callback\r\n el._leaveCb = () => {\r\n earlyRemove();\r\n el._leaveCb = undefined;\r\n delete enterHooks.delayedLeave;\r\n };\r\n enterHooks.delayedLeave = delayedLeave;\r\n };\r\n }\r\n }\r\n return child;\r\n };\r\n }\r\n};\r\n// export the public type for h/tsx inference\r\n// also to avoid inline import() in generated d.ts files\r\nconst BaseTransition = BaseTransitionImpl;\r\nfunction getLeavingNodesForType(state, vnode) {\r\n const { leavingVNodes } = state;\r\n let leavingVNodesCache = leavingVNodes.get(vnode.type);\r\n if (!leavingVNodesCache) {\r\n leavingVNodesCache = Object.create(null);\r\n leavingVNodes.set(vnode.type, leavingVNodesCache);\r\n }\r\n return leavingVNodesCache;\r\n}\r\n// The transition hooks are attached to the vnode as vnode.transition\r\n// and will be called at appropriate timing in the renderer.\r\nfunction resolveTransitionHooks(vnode, props, state, instance) {\r\n const { appear, mode, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled } = props;\r\n const key = String(vnode.key);\r\n const leavingVNodesCache = getLeavingNodesForType(state, vnode);\r\n const callHook = (hook, args) => {\r\n hook &&\r\n callWithAsyncErrorHandling(hook, instance, 9 /* TRANSITION_HOOK */, args);\r\n };\r\n const hooks = {\r\n mode,\r\n persisted,\r\n beforeEnter(el) {\r\n let hook = onBeforeEnter;\r\n if (!state.isMounted) {\r\n if (appear) {\r\n hook = onBeforeAppear || onBeforeEnter;\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n // for same element (v-show)\r\n if (el._leaveCb) {\r\n el._leaveCb(true /* cancelled */);\r\n }\r\n // for toggled element with same key (v-if)\r\n const leavingVNode = leavingVNodesCache[key];\r\n if (leavingVNode &&\r\n isSameVNodeType(vnode, leavingVNode) &&\r\n leavingVNode.el._leaveCb) {\r\n // force early removal (not cancelled)\r\n leavingVNode.el._leaveCb();\r\n }\r\n callHook(hook, [el]);\r\n },\r\n enter(el) {\r\n let hook = onEnter;\r\n let afterHook = onAfterEnter;\r\n let cancelHook = onEnterCancelled;\r\n if (!state.isMounted) {\r\n if (appear) {\r\n hook = onAppear || onEnter;\r\n afterHook = onAfterAppear || onAfterEnter;\r\n cancelHook = onAppearCancelled || onEnterCancelled;\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n let called = false;\r\n const done = (el._enterCb = (cancelled) => {\r\n if (called)\r\n return;\r\n called = true;\r\n if (cancelled) {\r\n callHook(cancelHook, [el]);\r\n }\r\n else {\r\n callHook(afterHook, [el]);\r\n }\r\n if (hooks.delayedLeave) {\r\n hooks.delayedLeave();\r\n }\r\n el._enterCb = undefined;\r\n });\r\n if (hook) {\r\n hook(el, done);\r\n if (hook.length <= 1) {\r\n done();\r\n }\r\n }\r\n else {\r\n done();\r\n }\r\n },\r\n leave(el, remove) {\r\n const key = String(vnode.key);\r\n if (el._enterCb) {\r\n el._enterCb(true /* cancelled */);\r\n }\r\n if (state.isUnmounting) {\r\n return remove();\r\n }\r\n callHook(onBeforeLeave, [el]);\r\n let called = false;\r\n const done = (el._leaveCb = (cancelled) => {\r\n if (called)\r\n return;\r\n called = true;\r\n remove();\r\n if (cancelled) {\r\n callHook(onLeaveCancelled, [el]);\r\n }\r\n else {\r\n callHook(onAfterLeave, [el]);\r\n }\r\n el._leaveCb = undefined;\r\n if (leavingVNodesCache[key] === vnode) {\r\n delete leavingVNodesCache[key];\r\n }\r\n });\r\n leavingVNodesCache[key] = vnode;\r\n if (onLeave) {\r\n onLeave(el, done);\r\n if (onLeave.length <= 1) {\r\n done();\r\n }\r\n }\r\n else {\r\n done();\r\n }\r\n },\r\n clone(vnode) {\r\n return resolveTransitionHooks(vnode, props, state, instance);\r\n }\r\n };\r\n return hooks;\r\n}\r\n// the placeholder really only handles one special case: KeepAlive\r\n// in the case of a KeepAlive in a leave phase we need to return a KeepAlive\r\n// placeholder with empty content to avoid the KeepAlive instance from being\r\n// unmounted.\r\nfunction emptyPlaceholder(vnode) {\r\n if (isKeepAlive(vnode)) {\r\n vnode = cloneVNode(vnode);\r\n vnode.children = null;\r\n return vnode;\r\n }\r\n}\r\nfunction getKeepAliveChild(vnode) {\r\n return isKeepAlive(vnode)\r\n ? vnode.children\r\n ? vnode.children[0]\r\n : undefined\r\n : vnode;\r\n}\r\nfunction setTransitionHooks(vnode, hooks) {\r\n if (vnode.shapeFlag & 6 /* COMPONENT */ && vnode.component) {\r\n setTransitionHooks(vnode.component.subTree, hooks);\r\n }\r\n else if (vnode.shapeFlag & 128 /* SUSPENSE */) {\r\n vnode.ssContent.transition = hooks.clone(vnode.ssContent);\r\n vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);\r\n }\r\n else {\r\n vnode.transition = hooks;\r\n }\r\n}\r\nfunction getTransitionRawChildren(children, keepComment = false) {\r\n let ret = [];\r\n let keyedFragmentCount = 0;\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n // handle fragment children case, e.g. v-for\r\n if (child.type === Fragment) {\r\n if (child.patchFlag & 128 /* KEYED_FRAGMENT */)\r\n keyedFragmentCount++;\r\n ret = ret.concat(getTransitionRawChildren(child.children, keepComment));\r\n }\r\n // comment placeholders should be skipped, e.g. v-if\r\n else if (keepComment || child.type !== Comment) {\r\n ret.push(child);\r\n }\r\n }\r\n // #1126 if a transition children list contains multiple sub fragments, these\r\n // fragments will be merged into a flat children array. Since each v-for\r\n // fragment may contain different static bindings inside, we need to de-op\r\n // these children to force full diffs to ensure correct behavior.\r\n if (keyedFragmentCount > 1) {\r\n for (let i = 0; i < ret.length; i++) {\r\n ret[i].patchFlag = -2 /* BAIL */;\r\n }\r\n }\r\n return ret;\r\n}\n\nconst isKeepAlive = (vnode) => vnode.type.__isKeepAlive;\r\nconst KeepAliveImpl = {\r\n name: `KeepAlive`,\r\n // Marker for special handling inside the renderer. We are not using a ===\r\n // check directly on KeepAlive in the renderer, because importing it directly\r\n // would prevent it from being tree-shaken.\r\n __isKeepAlive: true,\r\n props: {\r\n include: [String, RegExp, Array],\r\n exclude: [String, RegExp, Array],\r\n max: [String, Number]\r\n },\r\n setup(props, { slots }) {\r\n const cache = new Map();\r\n const keys = new Set();\r\n let current = null;\r\n const instance = getCurrentInstance();\r\n const parentSuspense = instance.suspense;\r\n // KeepAlive communicates with the instantiated renderer via the\r\n // ctx where the renderer passes in its internals,\r\n // and the KeepAlive instance exposes activate/deactivate implementations.\r\n // The whole point of this is to avoid importing KeepAlive directly in the\r\n // renderer to facilitate tree-shaking.\r\n const sharedContext = instance.ctx;\r\n const { renderer: { p: patch, m: move, um: _unmount, o: { createElement } } } = sharedContext;\r\n const storageContainer = createElement('div');\r\n sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {\r\n const instance = vnode.component;\r\n move(vnode, container, anchor, 0 /* ENTER */, parentSuspense);\r\n // in case props have changed\r\n patch(instance.vnode, vnode, container, anchor, instance, parentSuspense, isSVG, optimized);\r\n queuePostRenderEffect(() => {\r\n instance.isDeactivated = false;\r\n if (instance.a) {\r\n invokeArrayFns(instance.a);\r\n }\r\n const vnodeHook = vnode.props && vnode.props.onVnodeMounted;\r\n if (vnodeHook) {\r\n invokeVNodeHook(vnodeHook, instance.parent, vnode);\r\n }\r\n }, parentSuspense);\r\n };\r\n sharedContext.deactivate = (vnode) => {\r\n const instance = vnode.component;\r\n move(vnode, storageContainer, null, 1 /* LEAVE */, parentSuspense);\r\n queuePostRenderEffect(() => {\r\n if (instance.da) {\r\n invokeArrayFns(instance.da);\r\n }\r\n const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;\r\n if (vnodeHook) {\r\n invokeVNodeHook(vnodeHook, instance.parent, vnode);\r\n }\r\n instance.isDeactivated = true;\r\n }, parentSuspense);\r\n };\r\n function unmount(vnode) {\r\n // reset the shapeFlag so it can be properly unmounted\r\n resetShapeFlag(vnode);\r\n _unmount(vnode, instance, parentSuspense);\r\n }\r\n function pruneCache(filter) {\r\n cache.forEach((vnode, key) => {\r\n const name = getComponentName(vnode.type);\r\n if (name && (!filter || !filter(name))) {\r\n pruneCacheEntry(key);\r\n }\r\n });\r\n }\r\n function pruneCacheEntry(key) {\r\n const cached = cache.get(key);\r\n if (!current || cached.type !== current.type) {\r\n unmount(cached);\r\n }\r\n else if (current) {\r\n // current active instance should no longer be kept-alive.\r\n // we can't unmount it now but it might be later, so reset its flag now.\r\n resetShapeFlag(current);\r\n }\r\n cache.delete(key);\r\n keys.delete(key);\r\n }\r\n // prune cache on include/exclude prop change\r\n watch(() => [props.include, props.exclude], ([include, exclude]) => {\r\n include && pruneCache(name => matches(include, name));\r\n exclude && pruneCache(name => !matches(exclude, name));\r\n }, \r\n // prune post-render after `current` has been updated\r\n { flush: 'post', deep: true });\r\n // cache sub tree after render\r\n let pendingCacheKey = null;\r\n const cacheSubtree = () => {\r\n // fix #1621, the pendingCacheKey could be 0\r\n if (pendingCacheKey != null) {\r\n cache.set(pendingCacheKey, getInnerChild(instance.subTree));\r\n }\r\n };\r\n onMounted(cacheSubtree);\r\n onUpdated(cacheSubtree);\r\n onBeforeUnmount(() => {\r\n cache.forEach(cached => {\r\n const { subTree, suspense } = instance;\r\n const vnode = getInnerChild(subTree);\r\n if (cached.type === vnode.type) {\r\n // current instance will be unmounted as part of keep-alive's unmount\r\n resetShapeFlag(vnode);\r\n // but invoke its deactivated hook here\r\n const da = vnode.component.da;\r\n da && queuePostRenderEffect(da, suspense);\r\n return;\r\n }\r\n unmount(cached);\r\n });\r\n });\r\n return () => {\r\n pendingCacheKey = null;\r\n if (!slots.default) {\r\n return null;\r\n }\r\n const children = slots.default();\r\n const rawVNode = children[0];\r\n if (children.length > 1) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`KeepAlive should contain exactly one component child.`);\r\n }\r\n current = null;\r\n return children;\r\n }\r\n else if (!isVNode(rawVNode) ||\r\n (!(rawVNode.shapeFlag & 4 /* STATEFUL_COMPONENT */) &&\r\n !(rawVNode.shapeFlag & 128 /* SUSPENSE */))) {\r\n current = null;\r\n return rawVNode;\r\n }\r\n let vnode = getInnerChild(rawVNode);\r\n const comp = vnode.type;\r\n const name = getComponentName(comp);\r\n const { include, exclude, max } = props;\r\n if ((include && (!name || !matches(include, name))) ||\r\n (exclude && name && matches(exclude, name))) {\r\n current = vnode;\r\n return rawVNode;\r\n }\r\n const key = vnode.key == null ? comp : vnode.key;\r\n const cachedVNode = cache.get(key);\r\n // clone vnode if it's reused because we are going to mutate it\r\n if (vnode.el) {\r\n vnode = cloneVNode(vnode);\r\n if (rawVNode.shapeFlag & 128 /* SUSPENSE */) {\r\n rawVNode.ssContent = vnode;\r\n }\r\n }\r\n // #1513 it's possible for the returned vnode to be cloned due to attr\r\n // fallthrough or scopeId, so the vnode here may not be the final vnode\r\n // that is mounted. Instead of caching it directly, we store the pending\r\n // key and cache `instance.subTree` (the normalized vnode) in\r\n // beforeMount/beforeUpdate hooks.\r\n pendingCacheKey = key;\r\n if (cachedVNode) {\r\n // copy over mounted state\r\n vnode.el = cachedVNode.el;\r\n vnode.component = cachedVNode.component;\r\n if (vnode.transition) {\r\n // recursively update transition hooks on subTree\r\n setTransitionHooks(vnode, vnode.transition);\r\n }\r\n // avoid vnode being mounted as fresh\r\n vnode.shapeFlag |= 512 /* COMPONENT_KEPT_ALIVE */;\r\n // make this key the freshest\r\n keys.delete(key);\r\n keys.add(key);\r\n }\r\n else {\r\n keys.add(key);\r\n // prune oldest entry\r\n if (max && keys.size > parseInt(max, 10)) {\r\n pruneCacheEntry(keys.values().next().value);\r\n }\r\n }\r\n // avoid vnode being unmounted\r\n vnode.shapeFlag |= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;\r\n current = vnode;\r\n return rawVNode;\r\n };\r\n }\r\n};\r\n// export the public type for h/tsx inference\r\n// also to avoid inline import() in generated d.ts files\r\nconst KeepAlive = KeepAliveImpl;\r\nfunction matches(pattern, name) {\r\n if (isArray(pattern)) {\r\n return pattern.some((p) => matches(p, name));\r\n }\r\n else if (isString(pattern)) {\r\n return pattern.split(',').indexOf(name) > -1;\r\n }\r\n else if (pattern.test) {\r\n return pattern.test(name);\r\n }\r\n /* istanbul ignore next */\r\n return false;\r\n}\r\nfunction onActivated(hook, target) {\r\n registerKeepAliveHook(hook, \"a\" /* ACTIVATED */, target);\r\n}\r\nfunction onDeactivated(hook, target) {\r\n registerKeepAliveHook(hook, \"da\" /* DEACTIVATED */, target);\r\n}\r\nfunction registerKeepAliveHook(hook, type, target = currentInstance) {\r\n // cache the deactivate branch check wrapper for injected hooks so the same\r\n // hook can be properly deduped by the scheduler. \"__wdc\" stands for \"with\r\n // deactivation check\".\r\n const wrappedHook = hook.__wdc ||\r\n (hook.__wdc = () => {\r\n // only fire the hook if the target instance is NOT in a deactivated branch.\r\n let current = target;\r\n while (current) {\r\n if (current.isDeactivated) {\r\n return;\r\n }\r\n current = current.parent;\r\n }\r\n hook();\r\n });\r\n injectHook(type, wrappedHook, target);\r\n // In addition to registering it on the target instance, we walk up the parent\r\n // chain and register it on all ancestor instances that are keep-alive roots.\r\n // This avoids the need to walk the entire component tree when invoking these\r\n // hooks, and more importantly, avoids the need to track child components in\r\n // arrays.\r\n if (target) {\r\n let current = target.parent;\r\n while (current && current.parent) {\r\n if (isKeepAlive(current.parent.vnode)) {\r\n injectToKeepAliveRoot(wrappedHook, type, target, current);\r\n }\r\n current = current.parent;\r\n }\r\n }\r\n}\r\nfunction injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {\r\n // injectHook wraps the original for error handling, so make sure to remove\r\n // the wrapped version.\r\n const injected = injectHook(type, hook, keepAliveRoot, true /* prepend */);\r\n onUnmounted(() => {\r\n remove(keepAliveRoot[type], injected);\r\n }, target);\r\n}\r\nfunction resetShapeFlag(vnode) {\r\n let shapeFlag = vnode.shapeFlag;\r\n if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\r\n shapeFlag -= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;\r\n }\r\n if (shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {\r\n shapeFlag -= 512 /* COMPONENT_KEPT_ALIVE */;\r\n }\r\n vnode.shapeFlag = shapeFlag;\r\n}\r\nfunction getInnerChild(vnode) {\r\n return vnode.shapeFlag & 128 /* SUSPENSE */ ? vnode.ssContent : vnode;\r\n}\n\nconst isInternalKey = (key) => key[0] === '_' || key === '$stable';\r\nconst normalizeSlotValue = (value) => isArray(value)\r\n ? value.map(normalizeVNode)\r\n : [normalizeVNode(value)];\r\nconst normalizeSlot = (key, rawSlot, ctx) => withCtx((props) => {\r\n if ((process.env.NODE_ENV !== 'production') && currentInstance) {\r\n warn(`Slot \"${key}\" invoked outside of the render function: ` +\r\n `this will not track dependencies used in the slot. ` +\r\n `Invoke the slot function inside the render function instead.`);\r\n }\r\n return normalizeSlotValue(rawSlot(props));\r\n}, ctx);\r\nconst normalizeObjectSlots = (rawSlots, slots) => {\r\n const ctx = rawSlots._ctx;\r\n for (const key in rawSlots) {\r\n if (isInternalKey(key))\r\n continue;\r\n const value = rawSlots[key];\r\n if (isFunction(value)) {\r\n slots[key] = normalizeSlot(key, value, ctx);\r\n }\r\n else if (value != null) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`Non-function value encountered for slot \"${key}\". ` +\r\n `Prefer function slots for better performance.`);\r\n }\r\n const normalized = normalizeSlotValue(value);\r\n slots[key] = () => normalized;\r\n }\r\n }\r\n};\r\nconst normalizeVNodeSlots = (instance, children) => {\r\n if ((process.env.NODE_ENV !== 'production') && !isKeepAlive(instance.vnode)) {\r\n warn(`Non-function value encountered for default slot. ` +\r\n `Prefer function slots for better performance.`);\r\n }\r\n const normalized = normalizeSlotValue(children);\r\n instance.slots.default = () => normalized;\r\n};\r\nconst initSlots = (instance, children) => {\r\n if (instance.vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {\r\n const type = children._;\r\n if (type) {\r\n instance.slots = children;\r\n // make compiler marker non-enumerable\r\n def(children, '_', type);\r\n }\r\n else {\r\n normalizeObjectSlots(children, (instance.slots = {}));\r\n }\r\n }\r\n else {\r\n instance.slots = {};\r\n if (children) {\r\n normalizeVNodeSlots(instance, children);\r\n }\r\n }\r\n def(instance.slots, InternalObjectKey, 1);\r\n};\r\nconst updateSlots = (instance, children) => {\r\n const { vnode, slots } = instance;\r\n let needDeletionCheck = true;\r\n let deletionComparisonTarget = EMPTY_OBJ;\r\n if (vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {\r\n const type = children._;\r\n if (type) {\r\n // compiled slots.\r\n if ((process.env.NODE_ENV !== 'production') && isHmrUpdating) {\r\n // Parent was HMR updated so slot content may have changed.\r\n // force update slots and mark instance for hmr as well\r\n extend(slots, children);\r\n }\r\n else if (type === 1 /* STABLE */) {\r\n // compiled AND stable.\r\n // no need to update, and skip stale slots removal.\r\n needDeletionCheck = false;\r\n }\r\n else {\r\n // compiled but dynamic (v-if/v-for on slots) - update slots, but skip\r\n // normalization.\r\n extend(slots, children);\r\n }\r\n }\r\n else {\r\n needDeletionCheck = !children.$stable;\r\n normalizeObjectSlots(children, slots);\r\n }\r\n deletionComparisonTarget = children;\r\n }\r\n else if (children) {\r\n // non slot object children (direct value) passed to a component\r\n normalizeVNodeSlots(instance, children);\r\n deletionComparisonTarget = { default: 1 };\r\n }\r\n // delete stale slots\r\n if (needDeletionCheck) {\r\n for (const key in slots) {\r\n if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {\r\n delete slots[key];\r\n }\r\n }\r\n }\r\n};\n\n/**\r\nRuntime helper for applying directives to a vnode. Example usage:\r\n\nconst comp = resolveComponent('comp')\r\nconst foo = resolveDirective('foo')\r\nconst bar = resolveDirective('bar')\r\n\nreturn withDirectives(h(comp), [\r\n [foo, this.x],\r\n [bar, this.y]\r\n])\r\n*/\r\nconst isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text');\r\nfunction validateDirectiveName(name) {\r\n if (isBuiltInDirective(name)) {\r\n warn('Do not use built-in directive ids as custom directive id: ' + name);\r\n }\r\n}\r\n/**\r\n * Adds directives to a VNode.\r\n */\r\nfunction withDirectives(vnode, directives) {\r\n const internalInstance = currentRenderingInstance;\r\n if (internalInstance === null) {\r\n (process.env.NODE_ENV !== 'production') && warn(`withDirectives can only be used inside render functions.`);\r\n return vnode;\r\n }\r\n const instance = internalInstance.proxy;\r\n const bindings = vnode.dirs || (vnode.dirs = []);\r\n for (let i = 0; i < directives.length; i++) {\r\n let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];\r\n if (isFunction(dir)) {\r\n dir = {\r\n mounted: dir,\r\n updated: dir\r\n };\r\n }\r\n bindings.push({\r\n dir,\r\n instance,\r\n value,\r\n oldValue: void 0,\r\n arg,\r\n modifiers\r\n });\r\n }\r\n return vnode;\r\n}\r\nfunction invokeDirectiveHook(vnode, prevVNode, instance, name) {\r\n const bindings = vnode.dirs;\r\n const oldBindings = prevVNode && prevVNode.dirs;\r\n for (let i = 0; i < bindings.length; i++) {\r\n const binding = bindings[i];\r\n if (oldBindings) {\r\n binding.oldValue = oldBindings[i].value;\r\n }\r\n const hook = binding.dir[name];\r\n if (hook) {\r\n callWithAsyncErrorHandling(hook, instance, 8 /* DIRECTIVE_HOOK */, [\r\n vnode.el,\r\n binding,\r\n vnode,\r\n prevVNode\r\n ]);\r\n }\r\n }\r\n}\n\nfunction createAppContext() {\r\n return {\r\n app: null,\r\n config: {\r\n isNativeTag: NO,\r\n performance: false,\r\n globalProperties: {},\r\n optionMergeStrategies: {},\r\n isCustomElement: NO,\r\n errorHandler: undefined,\r\n warnHandler: undefined\r\n },\r\n mixins: [],\r\n components: {},\r\n directives: {},\r\n provides: Object.create(null)\r\n };\r\n}\r\nlet uid = 0;\r\nfunction createAppAPI(render, hydrate) {\r\n return function createApp(rootComponent, rootProps = null) {\r\n if (rootProps != null && !isObject(rootProps)) {\r\n (process.env.NODE_ENV !== 'production') && warn(`root props passed to app.mount() must be an object.`);\r\n rootProps = null;\r\n }\r\n const context = createAppContext();\r\n const installedPlugins = new Set();\r\n let isMounted = false;\r\n const app = (context.app = {\r\n _uid: uid++,\r\n _component: rootComponent,\r\n _props: rootProps,\r\n _container: null,\r\n _context: context,\r\n version,\r\n get config() {\r\n return context.config;\r\n },\r\n set config(v) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`app.config cannot be replaced. Modify individual options instead.`);\r\n }\r\n },\r\n use(plugin, ...options) {\r\n if (installedPlugins.has(plugin)) {\r\n (process.env.NODE_ENV !== 'production') && warn(`Plugin has already been applied to target app.`);\r\n }\r\n else if (plugin && isFunction(plugin.install)) {\r\n installedPlugins.add(plugin);\r\n plugin.install(app, ...options);\r\n }\r\n else if (isFunction(plugin)) {\r\n installedPlugins.add(plugin);\r\n plugin(app, ...options);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`A plugin must either be a function or an object with an \"install\" ` +\r\n `function.`);\r\n }\r\n return app;\r\n },\r\n mixin(mixin) {\r\n if (__VUE_OPTIONS_API__) {\r\n if (!context.mixins.includes(mixin)) {\r\n context.mixins.push(mixin);\r\n // global mixin with props/emits de-optimizes props/emits\r\n // normalization caching.\r\n if (mixin.props || mixin.emits) {\r\n context.deopt = true;\r\n }\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn('Mixin has already been applied to target app' +\r\n (mixin.name ? `: ${mixin.name}` : ''));\r\n }\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn('Mixins are only available in builds supporting Options API');\r\n }\r\n return app;\r\n },\r\n component(name, component) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n validateComponentName(name, context.config);\r\n }\r\n if (!component) {\r\n return context.components[name];\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && context.components[name]) {\r\n warn(`Component \"${name}\" has already been registered in target app.`);\r\n }\r\n context.components[name] = component;\r\n return app;\r\n },\r\n directive(name, directive) {\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n validateDirectiveName(name);\r\n }\r\n if (!directive) {\r\n return context.directives[name];\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && context.directives[name]) {\r\n warn(`Directive \"${name}\" has already been registered in target app.`);\r\n }\r\n context.directives[name] = directive;\r\n return app;\r\n },\r\n mount(rootContainer, isHydrate) {\r\n if (!isMounted) {\r\n const vnode = createVNode(rootComponent, rootProps);\r\n // store app context on the root VNode.\r\n // this will be set on the root instance on initial mount.\r\n vnode.appContext = context;\r\n // HMR root reload\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n context.reload = () => {\r\n render(cloneVNode(vnode), rootContainer);\r\n };\r\n }\r\n if (isHydrate && hydrate) {\r\n hydrate(vnode, rootContainer);\r\n }\r\n else {\r\n render(vnode, rootContainer);\r\n }\r\n isMounted = true;\r\n app._container = rootContainer;\r\n rootContainer.__vue_app__ = app;\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n devtoolsInitApp(app, version);\r\n }\r\n return vnode.component.proxy;\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`App has already been mounted.\\n` +\r\n `If you want to remount the same app, move your app creation logic ` +\r\n `into a factory function and create fresh app instances for each ` +\r\n `mount - e.g. \\`const createMyApp = () => createApp(App)\\``);\r\n }\r\n },\r\n unmount() {\r\n if (isMounted) {\r\n render(null, app._container);\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n devtoolsUnmountApp(app);\r\n }\r\n delete app._container.__vue_app__;\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn(`Cannot unmount an app that is not mounted.`);\r\n }\r\n },\r\n provide(key, value) {\r\n if ((process.env.NODE_ENV !== 'production') && key in context.provides) {\r\n warn(`App already provides property with key \"${String(key)}\". ` +\r\n `It will be overwritten with the new value.`);\r\n }\r\n // TypeScript doesn't allow symbols as index type\r\n // https://github.com/Microsoft/TypeScript/issues/24587\r\n context.provides[key] = value;\r\n return app;\r\n }\r\n });\r\n return app;\r\n };\r\n}\n\nlet hasMismatch = false;\r\nconst isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';\r\nconst isComment = (node) => node.nodeType === 8 /* COMMENT */;\r\n// Note: hydration is DOM-specific\r\n// But we have to place it in core due to tight coupling with core - splitting\r\n// it out creates a ton of unnecessary complexity.\r\n// Hydration also depends on some renderer internal logic which needs to be\r\n// passed in via arguments.\r\nfunction createHydrationFunctions(rendererInternals) {\r\n const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;\r\n const hydrate = (vnode, container) => {\r\n if ((process.env.NODE_ENV !== 'production') && !container.hasChildNodes()) {\r\n warn(`Attempting to hydrate existing markup but container is empty. ` +\r\n `Performing full mount instead.`);\r\n patch(null, vnode, container);\r\n return;\r\n }\r\n hasMismatch = false;\r\n hydrateNode(container.firstChild, vnode, null, null);\r\n flushPostFlushCbs();\r\n if (hasMismatch && !false) {\r\n // this error should show up in production\r\n console.error(`Hydration completed but contains mismatches.`);\r\n }\r\n };\r\n const hydrateNode = (node, vnode, parentComponent, parentSuspense, optimized = false) => {\r\n const isFragmentStart = isComment(node) && node.data === '[';\r\n const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, isFragmentStart);\r\n const { type, ref, shapeFlag } = vnode;\r\n const domType = node.nodeType;\r\n vnode.el = node;\r\n let nextNode = null;\r\n switch (type) {\r\n case Text:\r\n if (domType !== 3 /* TEXT */) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n if (node.data !== vnode.children) {\r\n hasMismatch = true;\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`Hydration text mismatch:` +\r\n `\\n- Client: ${JSON.stringify(node.data)}` +\r\n `\\n- Server: ${JSON.stringify(vnode.children)}`);\r\n node.data = vnode.children;\r\n }\r\n nextNode = nextSibling(node);\r\n }\r\n break;\r\n case Comment:\r\n if (domType !== 8 /* COMMENT */ || isFragmentStart) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = nextSibling(node);\r\n }\r\n break;\r\n case Static:\r\n if (domType !== 1 /* ELEMENT */) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n // determine anchor, adopt content\r\n nextNode = node;\r\n // if the static vnode has its content stripped during build,\r\n // adopt it from the server-rendered HTML.\r\n const needToAdoptContent = !vnode.children.length;\r\n for (let i = 0; i < vnode.staticCount; i++) {\r\n if (needToAdoptContent)\r\n vnode.children += nextNode.outerHTML;\r\n if (i === vnode.staticCount - 1) {\r\n vnode.anchor = nextNode;\r\n }\r\n nextNode = nextSibling(nextNode);\r\n }\r\n return nextNode;\r\n }\r\n break;\r\n case Fragment:\r\n if (!isFragmentStart) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, optimized);\r\n }\r\n break;\r\n default:\r\n if (shapeFlag & 1 /* ELEMENT */) {\r\n if (domType !== 1 /* ELEMENT */ ||\r\n vnode.type !== node.tagName.toLowerCase()) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, optimized);\r\n }\r\n }\r\n else if (shapeFlag & 6 /* COMPONENT */) {\r\n // when setting up the render effect, if the initial vnode already\r\n // has .el set, the component will perform hydration instead of mount\r\n // on its sub-tree.\r\n const container = parentNode(node);\r\n const hydrateComponent = () => {\r\n mountComponent(vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), optimized);\r\n };\r\n // async component\r\n const loadAsync = vnode.type.__asyncLoader;\r\n if (loadAsync) {\r\n loadAsync().then(hydrateComponent);\r\n }\r\n else {\r\n hydrateComponent();\r\n }\r\n // component may be async, so in the case of fragments we cannot rely\r\n // on component's rendered output to determine the end of the fragment\r\n // instead, we do a lookahead to find the end anchor node.\r\n nextNode = isFragmentStart\r\n ? locateClosingAsyncAnchor(node)\r\n : nextSibling(node);\r\n }\r\n else if (shapeFlag & 64 /* TELEPORT */) {\r\n if (domType !== 8 /* COMMENT */) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, optimized, rendererInternals, hydrateChildren);\r\n }\r\n }\r\n else if (shapeFlag & 128 /* SUSPENSE */) {\r\n nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), optimized, rendererInternals, hydrateNode);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn('Invalid HostVNode type:', type, `(${typeof type})`);\r\n }\r\n }\r\n if (ref != null) {\r\n setRef(ref, null, parentSuspense, vnode);\r\n }\r\n return nextNode;\r\n };\r\n const hydrateElement = (el, vnode, parentComponent, parentSuspense, optimized) => {\r\n optimized = optimized || !!vnode.dynamicChildren;\r\n const { props, patchFlag, shapeFlag, dirs } = vnode;\r\n // skip props & children if this is hoisted static nodes\r\n if (patchFlag !== -1 /* HOISTED */) {\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'created');\r\n }\r\n // props\r\n if (props) {\r\n if (!optimized ||\r\n (patchFlag & 16 /* FULL_PROPS */ ||\r\n patchFlag & 32 /* HYDRATE_EVENTS */)) {\r\n for (const key in props) {\r\n if (!isReservedProp(key) && isOn(key)) {\r\n patchProp(el, key, null, props[key]);\r\n }\r\n }\r\n }\r\n else if (props.onClick) {\r\n // Fast path for click listeners (which is most often) to avoid\r\n // iterating through props.\r\n patchProp(el, 'onClick', null, props.onClick);\r\n }\r\n }\r\n // vnode / directive hooks\r\n let vnodeHooks;\r\n if ((vnodeHooks = props && props.onVnodeBeforeMount)) {\r\n invokeVNodeHook(vnodeHooks, parentComponent, vnode);\r\n }\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount');\r\n }\r\n if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {\r\n queueEffectWithSuspense(() => {\r\n vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);\r\n dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted');\r\n }, parentSuspense);\r\n }\r\n // children\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */ &&\r\n // skip if element has innerHTML / textContent\r\n !(props && (props.innerHTML || props.textContent))) {\r\n let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, optimized);\r\n let hasWarned = false;\r\n while (next) {\r\n hasMismatch = true;\r\n if ((process.env.NODE_ENV !== 'production') && !hasWarned) {\r\n warn(`Hydration children mismatch in <${vnode.type}>: ` +\r\n `server rendered element contains more child nodes than client vdom.`);\r\n hasWarned = true;\r\n }\r\n // The SSRed DOM contains more nodes than it should. Remove them.\r\n const cur = next;\r\n next = next.nextSibling;\r\n remove(cur);\r\n }\r\n }\r\n else if (shapeFlag & 8 /* TEXT_CHILDREN */) {\r\n if (el.textContent !== vnode.children) {\r\n hasMismatch = true;\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`Hydration text content mismatch in <${vnode.type}>:\\n` +\r\n `- Client: ${el.textContent}\\n` +\r\n `- Server: ${vnode.children}`);\r\n el.textContent = vnode.children;\r\n }\r\n }\r\n }\r\n return el.nextSibling;\r\n };\r\n const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, optimized) => {\r\n optimized = optimized || !!parentVNode.dynamicChildren;\r\n const children = parentVNode.children;\r\n const l = children.length;\r\n let hasWarned = false;\r\n for (let i = 0; i < l; i++) {\r\n const vnode = optimized\r\n ? children[i]\r\n : (children[i] = normalizeVNode(children[i]));\r\n if (node) {\r\n node = hydrateNode(node, vnode, parentComponent, parentSuspense, optimized);\r\n }\r\n else {\r\n hasMismatch = true;\r\n if ((process.env.NODE_ENV !== 'production') && !hasWarned) {\r\n warn(`Hydration children mismatch in <${container.tagName.toLowerCase()}>: ` +\r\n `server rendered element contains fewer child nodes than client vdom.`);\r\n hasWarned = true;\r\n }\r\n // the SSRed DOM didn't contain enough nodes. Mount the missing ones.\r\n patch(null, vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container));\r\n }\r\n }\r\n return node;\r\n };\r\n const hydrateFragment = (node, vnode, parentComponent, parentSuspense, optimized) => {\r\n const container = parentNode(node);\r\n const next = hydrateChildren(nextSibling(node), vnode, container, parentComponent, parentSuspense, optimized);\r\n if (next && isComment(next) && next.data === ']') {\r\n return nextSibling((vnode.anchor = next));\r\n }\r\n else {\r\n // fragment didn't hydrate successfully, since we didn't get a end anchor\r\n // back. This should have led to node/children mismatch warnings.\r\n hasMismatch = true;\r\n // since the anchor is missing, we need to create one and insert it\r\n insert((vnode.anchor = createComment(`]`)), container, next);\r\n return next;\r\n }\r\n };\r\n const handleMismatch = (node, vnode, parentComponent, parentSuspense, isFragment) => {\r\n hasMismatch = true;\r\n (process.env.NODE_ENV !== 'production') &&\r\n warn(`Hydration node mismatch:\\n- Client vnode:`, vnode.type, `\\n- Server rendered DOM:`, node, node.nodeType === 3 /* TEXT */\r\n ? `(text)`\r\n : isComment(node) && node.data === '['\r\n ? `(start of fragment)`\r\n : ``);\r\n vnode.el = null;\r\n if (isFragment) {\r\n // remove excessive fragment nodes\r\n const end = locateClosingAsyncAnchor(node);\r\n while (true) {\r\n const next = nextSibling(node);\r\n if (next && next !== end) {\r\n remove(next);\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n }\r\n const next = nextSibling(node);\r\n const container = parentNode(node);\r\n remove(node);\r\n patch(null, vnode, container, next, parentComponent, parentSuspense, isSVGContainer(container));\r\n return next;\r\n };\r\n const locateClosingAsyncAnchor = (node) => {\r\n let match = 0;\r\n while (node) {\r\n node = nextSibling(node);\r\n if (node && isComment(node)) {\r\n if (node.data === '[')\r\n match++;\r\n if (node.data === ']') {\r\n if (match === 0) {\r\n return nextSibling(node);\r\n }\r\n else {\r\n match--;\r\n }\r\n }\r\n }\r\n }\r\n return node;\r\n };\r\n return [hydrate, hydrateNode];\r\n}\n\nlet supported;\r\nlet perf;\r\nfunction startMeasure(instance, type) {\r\n if (instance.appContext.config.performance && isSupported()) {\r\n perf.mark(`vue-${type}-${instance.uid}`);\r\n }\r\n}\r\nfunction endMeasure(instance, type) {\r\n if (instance.appContext.config.performance && isSupported()) {\r\n const startTag = `vue-${type}-${instance.uid}`;\r\n const endTag = startTag + `:end`;\r\n perf.mark(endTag);\r\n perf.measure(`<${formatComponentName(instance, instance.type)}> ${type}`, startTag, endTag);\r\n perf.clearMarks(startTag);\r\n perf.clearMarks(endTag);\r\n }\r\n}\r\nfunction isSupported() {\r\n if (supported !== undefined) {\r\n return supported;\r\n }\r\n /* eslint-disable no-restricted-globals */\r\n if (typeof window !== 'undefined' && window.performance) {\r\n supported = true;\r\n perf = window.performance;\r\n }\r\n else {\r\n supported = false;\r\n }\r\n /* eslint-enable no-restricted-globals */\r\n return supported;\r\n}\n\n/**\r\n * This is only called in esm-bundler builds.\r\n * It is called when a renderer is created, in `baseCreateRenderer` so that\r\n * importing runtime-core is side-effects free.\r\n *\r\n * istanbul-ignore-next\r\n */\r\nfunction initFeatureFlags() {\r\n let needWarn = false;\r\n if (typeof __VUE_OPTIONS_API__ !== 'boolean') {\r\n needWarn = true;\r\n getGlobalThis().__VUE_OPTIONS_API__ = true;\r\n }\r\n if (typeof __VUE_PROD_DEVTOOLS__ !== 'boolean') {\r\n needWarn = true;\r\n getGlobalThis().__VUE_PROD_DEVTOOLS__ = false;\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && needWarn) {\r\n console.warn(`You are running the esm-bundler build of Vue. It is recommended to ` +\r\n `configure your bundler to explicitly replace feature flag globals ` +\r\n `with boolean literals to get proper tree-shaking in the final bundle. ` +\r\n `See http://link.vuejs.org/feature-flags for more details.`);\r\n }\r\n}\n\n// implementation, close to no-op\r\nfunction defineComponent(options) {\r\n return isFunction(options) ? { setup: options, name: options.name } : options;\r\n}\n\nconst isAsyncWrapper = (i) => !!i.type.__asyncLoader;\r\nfunction defineAsyncComponent(source) {\r\n if (isFunction(source)) {\r\n source = { loader: source };\r\n }\r\n const { loader, loadingComponent, errorComponent, delay = 200, timeout, // undefined = never times out\r\n suspensible = true, onError: userOnError } = source;\r\n let pendingRequest = null;\r\n let resolvedComp;\r\n let retries = 0;\r\n const retry = () => {\r\n retries++;\r\n pendingRequest = null;\r\n return load();\r\n };\r\n const load = () => {\r\n let thisRequest;\r\n return (pendingRequest ||\r\n (thisRequest = pendingRequest = loader()\r\n .catch(err => {\r\n err = err instanceof Error ? err : new Error(String(err));\r\n if (userOnError) {\r\n return new Promise((resolve, reject) => {\r\n const userRetry = () => resolve(retry());\r\n const userFail = () => reject(err);\r\n userOnError(err, userRetry, userFail, retries + 1);\r\n });\r\n }\r\n else {\r\n throw err;\r\n }\r\n })\r\n .then((comp) => {\r\n if (thisRequest !== pendingRequest && pendingRequest) {\r\n return pendingRequest;\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && !comp) {\r\n warn(`Async component loader resolved to undefined. ` +\r\n `If you are using retry(), make sure to return its return value.`);\r\n }\r\n // interop module default\r\n if (comp &&\r\n (comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {\r\n comp = comp.default;\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && comp && !isObject(comp) && !isFunction(comp)) {\r\n throw new Error(`Invalid async component load result: ${comp}`);\r\n }\r\n resolvedComp = comp;\r\n return comp;\r\n })));\r\n };\r\n return defineComponent({\r\n __asyncLoader: load,\r\n name: 'AsyncComponentWrapper',\r\n setup() {\r\n const instance = currentInstance;\r\n // already resolved\r\n if (resolvedComp) {\r\n return () => createInnerComp(resolvedComp, instance);\r\n }\r\n const onError = (err) => {\r\n pendingRequest = null;\r\n handleError(err, instance, 13 /* ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);\r\n };\r\n // suspense-controlled or SSR.\r\n if ((suspensible && instance.suspense) ||\r\n (false )) {\r\n return load()\r\n .then(comp => {\r\n return () => createInnerComp(comp, instance);\r\n })\r\n .catch(err => {\r\n onError(err);\r\n return () => errorComponent\r\n ? createVNode(errorComponent, {\r\n error: err\r\n })\r\n : null;\r\n });\r\n }\r\n const loaded = ref(false);\r\n const error = ref();\r\n const delayed = ref(!!delay);\r\n if (delay) {\r\n setTimeout(() => {\r\n delayed.value = false;\r\n }, delay);\r\n }\r\n if (timeout != null) {\r\n setTimeout(() => {\r\n if (!loaded.value && !error.value) {\r\n const err = new Error(`Async component timed out after ${timeout}ms.`);\r\n onError(err);\r\n error.value = err;\r\n }\r\n }, timeout);\r\n }\r\n load()\r\n .then(() => {\r\n loaded.value = true;\r\n })\r\n .catch(err => {\r\n onError(err);\r\n error.value = err;\r\n });\r\n return () => {\r\n if (loaded.value && resolvedComp) {\r\n return createInnerComp(resolvedComp, instance);\r\n }\r\n else if (error.value && errorComponent) {\r\n return createVNode(errorComponent, {\r\n error: error.value\r\n });\r\n }\r\n else if (loadingComponent && !delayed.value) {\r\n return createVNode(loadingComponent);\r\n }\r\n };\r\n }\r\n });\r\n}\r\nfunction createInnerComp(comp, { vnode: { ref, props, children } }) {\r\n const vnode = createVNode(comp, props, children);\r\n // ensure inner component inherits the async wrapper's ref owner\r\n vnode.ref = ref;\r\n return vnode;\r\n}\n\nconst prodEffectOptions = {\r\n scheduler: queueJob,\r\n // #1801, #2043 component render effects should allow recursive updates\r\n allowRecurse: true\r\n};\r\nfunction createDevEffectOptions(instance) {\r\n return {\r\n scheduler: queueJob,\r\n allowRecurse: true,\r\n onTrack: instance.rtc ? e => invokeArrayFns(instance.rtc, e) : void 0,\r\n onTrigger: instance.rtg ? e => invokeArrayFns(instance.rtg, e) : void 0\r\n };\r\n}\r\nconst queuePostRenderEffect = queueEffectWithSuspense\r\n ;\r\nconst setRef = (rawRef, oldRawRef, parentSuspense, vnode) => {\r\n if (isArray(rawRef)) {\r\n rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode));\r\n return;\r\n }\r\n let value;\r\n if (!vnode || isAsyncWrapper(vnode)) {\r\n value = null;\r\n }\r\n else {\r\n if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {\r\n value = vnode.component.exposed || vnode.component.proxy;\r\n }\r\n else {\r\n value = vnode.el;\r\n }\r\n }\r\n const { i: owner, r: ref } = rawRef;\r\n if ((process.env.NODE_ENV !== 'production') && !owner) {\r\n warn(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +\r\n `A vnode with ref must be created inside the render function.`);\r\n return;\r\n }\r\n const oldRef = oldRawRef && oldRawRef.r;\r\n const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;\r\n const setupState = owner.setupState;\r\n // unset old ref\r\n if (oldRef != null && oldRef !== ref) {\r\n if (isString(oldRef)) {\r\n refs[oldRef] = null;\r\n if (hasOwn(setupState, oldRef)) {\r\n setupState[oldRef] = null;\r\n }\r\n }\r\n else if (isRef(oldRef)) {\r\n oldRef.value = null;\r\n }\r\n }\r\n if (isString(ref)) {\r\n const doSet = () => {\r\n refs[ref] = value;\r\n if (hasOwn(setupState, ref)) {\r\n setupState[ref] = value;\r\n }\r\n };\r\n // #1789: for non-null values, set them after render\r\n // null values means this is unmount and it should not overwrite another\r\n // ref with the same key\r\n if (value) {\r\n doSet.id = -1;\r\n queuePostRenderEffect(doSet, parentSuspense);\r\n }\r\n else {\r\n doSet();\r\n }\r\n }\r\n else if (isRef(ref)) {\r\n const doSet = () => {\r\n ref.value = value;\r\n };\r\n if (value) {\r\n doSet.id = -1;\r\n queuePostRenderEffect(doSet, parentSuspense);\r\n }\r\n else {\r\n doSet();\r\n }\r\n }\r\n else if (isFunction(ref)) {\r\n callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn('Invalid template ref type:', value, `(${typeof value})`);\r\n }\r\n};\r\n/**\r\n * The createRenderer function accepts two generic arguments:\r\n * HostNode and HostElement, corresponding to Node and Element types in the\r\n * host environment. For example, for runtime-dom, HostNode would be the DOM\r\n * `Node` interface and HostElement would be the DOM `Element` interface.\r\n *\r\n * Custom renderers can pass in the platform specific types like this:\r\n *\r\n * ``` js\r\n * const { render, createApp } = createRenderer({\r\n * patchProp,\r\n * ...nodeOps\r\n * })\r\n * ```\r\n */\r\nfunction createRenderer(options) {\r\n return baseCreateRenderer(options);\r\n}\r\n// Separate API for creating hydration-enabled renderer.\r\n// Hydration logic is only used when calling this function, making it\r\n// tree-shakable.\r\nfunction createHydrationRenderer(options) {\r\n return baseCreateRenderer(options, createHydrationFunctions);\r\n}\r\n// implementation\r\nfunction baseCreateRenderer(options, createHydrationFns) {\r\n // compile-time feature flags check\r\n {\r\n initFeatureFlags();\r\n }\r\n if ((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) {\r\n const target = getGlobalThis();\r\n target.__VUE__ = true;\r\n setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__);\r\n }\r\n const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, forcePatchProp: hostForcePatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;\r\n // Note: functions inside this closure should use `const xxx = () => {}`\r\n // style in order to prevent being inlined by minifiers.\r\n const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, optimized = false) => {\r\n // patching & not same type, unmount old tree\r\n if (n1 && !isSameVNodeType(n1, n2)) {\r\n anchor = getNextHostNode(n1);\r\n unmount(n1, parentComponent, parentSuspense, true);\r\n n1 = null;\r\n }\r\n if (n2.patchFlag === -2 /* BAIL */) {\r\n optimized = false;\r\n n2.dynamicChildren = null;\r\n }\r\n const { type, ref, shapeFlag } = n2;\r\n switch (type) {\r\n case Text:\r\n processText(n1, n2, container, anchor);\r\n break;\r\n case Comment:\r\n processCommentNode(n1, n2, container, anchor);\r\n break;\r\n case Static:\r\n if (n1 == null) {\r\n mountStaticNode(n2, container, anchor, isSVG);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n patchStaticNode(n1, n2, container, isSVG);\r\n }\r\n break;\r\n case Fragment:\r\n processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);\r\n break;\r\n default:\r\n if (shapeFlag & 1 /* ELEMENT */) {\r\n processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);\r\n }\r\n else if (shapeFlag & 6 /* COMPONENT */) {\r\n processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);\r\n }\r\n else if (shapeFlag & 64 /* TELEPORT */) {\r\n type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized, internals);\r\n }\r\n else if (shapeFlag & 128 /* SUSPENSE */) {\r\n type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized, internals);\r\n }\r\n else if ((process.env.NODE_ENV !== 'production')) {\r\n warn('Invalid VNode type:', type, `(${typeof type})`);\r\n }\r\n }\r\n // set ref\r\n if (ref != null && parentComponent) {\r\n setRef(ref, n1 && n1.ref, parentSuspense, n2);\r\n }\r\n };\r\n const processText = (n1, n2, container, anchor) => {\r\n if (n1 == null) {\r\n hostInsert((n2.el = hostCreateText(n2.children)), container, anchor);\r\n }\r\n else {\r\n const el = (n2.el = n1.el);\r\n if (n2.children !== n1.children) {\r\n hostSetText(el, n2.children);\r\n }\r\n }\r\n };\r\n const processCommentNode = (n1, n2, container, anchor) => {\r\n if (n1 == null) {\r\n hostInsert((n2.el = hostCreateComment(n2.children || '')), container, anchor);\r\n }\r\n else {\r\n // there's no support for dynamic comments\r\n n2.el = n1.el;\r\n }\r\n };\r\n const mountStaticNode = (n2, container, anchor, isSVG) => {\r\n [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);\r\n };\r\n /**\r\n * Dev / HMR only\r\n */\r\n const patchStaticNode = (n1, n2, container, isSVG) => {\r\n // static nodes are only patched during dev for HMR\r\n if (n2.children !== n1.children) {\r\n const anchor = hostNextSibling(n1.anchor);\r\n // remove existing\r\n removeStaticNode(n1);\r\n [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);\r\n }\r\n else {\r\n n2.el = n1.el;\r\n n2.anchor = n1.anchor;\r\n }\r\n };\r\n const moveStaticNode = ({ el, anchor }, container, nextSibling) => {\r\n let next;\r\n while (el && el !== anchor) {\r\n next = hostNextSibling(el);\r\n hostInsert(el, container, nextSibling);\r\n el = next;\r\n }\r\n hostInsert(anchor, container, nextSibling);\r\n };\r\n const removeStaticNode = ({ el, anchor }) => {\r\n let next;\r\n while (el && el !== anchor) {\r\n next = hostNextSibling(el);\r\n hostRemove(el);\r\n el = next;\r\n }\r\n hostRemove(anchor);\r\n };\r\n const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {\r\n isSVG = isSVG || n2.type === 'svg';\r\n if (n1 == null) {\r\n mountElement(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);\r\n }\r\n else {\r\n patchElement(n1, n2, parentComponent, parentSuspense, isSVG, optimized);\r\n }\r\n };\r\n const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {\r\n let el;\r\n let vnodeHook;\r\n const { type, props, shapeFlag, transition, scopeId, patchFlag, dirs } = vnode;\r\n if (!(process.env.NODE_ENV !== 'production') &&\r\n vnode.el &&\r\n hostCloneNode !== undefined &&\r\n patchFlag === -1 /* HOISTED */) {\r\n // If a vnode has non-null el, it means it's being reused.\r\n // Only static vnodes can be reused, so its mounted DOM nodes should be\r\n // exactly the same, and we can simply do a clone here.\r\n // only do this in production since cloned trees cannot be HMR updated.\r\n el = vnode.el = hostCloneNode(vnode.el);\r\n }\r\n else {\r\n el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is);\r\n // mount children first, since some props may rely on child content\r\n // being already rendered, e.g. `