marko 6.0.86 → 6.0.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,7 +112,7 @@ var attrs_default = {
112
112
  };
113
113
 
114
114
  // src/translator/core/await.ts
115
- var import_compiler35 = require("@marko/compiler");
115
+ var import_compiler36 = require("@marko/compiler");
116
116
  var import_babel_utils26 = require("@marko/compiler/babel-utils");
117
117
 
118
118
  // src/common/accessor.debug.ts
@@ -235,7 +235,7 @@ function isNullableExpr(expr) {
235
235
  }
236
236
 
237
237
  // src/translator/util/references.ts
238
- var import_compiler34 = require("@marko/compiler");
238
+ var import_compiler35 = require("@marko/compiler");
239
239
  var import_babel_utils25 = require("@marko/compiler/babel-utils");
240
240
 
241
241
  // src/html/serializer.ts
@@ -690,16 +690,9 @@ function getMarkoRoot(path5) {
690
690
  }
691
691
  function getExprRoot(path5) {
692
692
  let curPath = path5;
693
- let assignmentPath;
694
693
  while (!isMarko(curPath.parentPath)) {
695
- if (curPath.isAssignmentPattern()) {
696
- assignmentPath = curPath;
697
- }
698
694
  curPath = curPath.parentPath;
699
695
  }
700
- if (assignmentPath && curPath.parentPath.isMarkoTag() && (curPath.key === "var" || curPath.listKey === "params")) {
701
- return assignmentPath;
702
- }
703
696
  return curPath;
704
697
  }
705
698
  function getFnRoot(path5) {
@@ -1627,17 +1620,17 @@ function startSection(path5) {
1627
1620
  const extra = path5.node.extra ??= {};
1628
1621
  let section = extra.section;
1629
1622
  if (!section && (path5.type === "Program" || path5.get("body").length)) {
1623
+ const parentTag = path5.parentPath?.isMarkoTag() ? path5.parentPath : void 0;
1630
1624
  const parentSection = path5.parentPath ? getOrCreateSection(path5.parentPath) : void 0;
1631
- const sectionNamePath = path5.parentPath?.get(
1632
- "name"
1633
- );
1634
- const sectionName = path5.isProgram() ? "" : generateUid(sectionNamePath.toString() + "_content");
1625
+ const sectionName = parentTag ? generateUid(
1626
+ (isCoreTagName(parentTag, "define") && import_compiler7.types.isIdentifier(parentTag.node.var) ? parentTag.node.var.name : parentTag.get("name").toString()) + "_content"
1627
+ ) : "";
1635
1628
  const programExtra = path5.hub.file.path.node.extra ??= {};
1636
1629
  const sections = programExtra.sections ??= [];
1637
1630
  section = extra.section = {
1638
1631
  id: sections.length,
1639
1632
  name: sectionName,
1640
- loc: sectionNamePath?.node.loc || void 0,
1633
+ loc: parentTag?.node.name.loc || void 0,
1641
1634
  depth: parentSection ? parentSection.depth + 1 : 0,
1642
1635
  parent: parentSection,
1643
1636
  sectionAccessor: void 0,
@@ -2113,11 +2106,11 @@ function isEventOrChangeHandler(prop) {
2113
2106
  }
2114
2107
 
2115
2108
  // src/translator/util/known-tag.ts
2116
- var import_compiler33 = require("@marko/compiler");
2109
+ var import_compiler34 = require("@marko/compiler");
2117
2110
  var import_babel_utils24 = require("@marko/compiler/babel-utils");
2118
2111
 
2119
2112
  // src/translator/visitors/program/index.ts
2120
- var import_compiler25 = require("@marko/compiler");
2113
+ var import_compiler26 = require("@marko/compiler");
2121
2114
  var import_babel_utils17 = require("@marko/compiler/babel-utils");
2122
2115
  var import_path2 = __toESM(require("path"));
2123
2116
 
@@ -4659,6 +4652,288 @@ function getRegisteredFnExpression2(node) {
4659
4652
  }
4660
4653
  }
4661
4654
 
4655
+ // src/translator/visitors/program/pre-analyze.ts
4656
+ var import_compiler25 = require("@marko/compiler");
4657
+
4658
+ // src/translator/util/with-previous-location.ts
4659
+ function withPreviousLocation(newNode, originalNode) {
4660
+ newNode.start = originalNode.start;
4661
+ newNode.loc = originalNode.loc;
4662
+ newNode.end = originalNode.end;
4663
+ return newNode;
4664
+ }
4665
+
4666
+ // src/translator/visitors/program/pre-analyze.ts
4667
+ var TAG_NAME_IDENTIFIER_REG = /^[A-Z][a-zA-Z0-9_$]*$/;
4668
+ var BINDING_CHANGE_HANDLER = /* @__PURE__ */ new WeakMap();
4669
+ function preAnalyze(program) {
4670
+ const state = { crawl: false };
4671
+ normalizeBody(state, program.get("body"));
4672
+ if (state.crawl) {
4673
+ program.scope.crawl();
4674
+ }
4675
+ }
4676
+ function normalizeBody(state, body) {
4677
+ if (body?.length) {
4678
+ for (const child of body) {
4679
+ if (child.isMarkoTag()) {
4680
+ normalizeTag(state, child);
4681
+ }
4682
+ }
4683
+ }
4684
+ }
4685
+ function normalizeTag(state, tag) {
4686
+ const { node } = tag;
4687
+ const { name: name2, attributes } = node;
4688
+ normalizeBody(state, tag.get("body").get("body"));
4689
+ normalizeBody(state, tag.get("attributeTags"));
4690
+ if (node.var) {
4691
+ const insertions = getAssignmentInsertions(node.var);
4692
+ if (insertions) {
4693
+ state.crawl = true;
4694
+ tag.insertAfter(insertions);
4695
+ }
4696
+ }
4697
+ if (node.body.params.length) {
4698
+ let insertions;
4699
+ for (const param of node.body.params) {
4700
+ insertions = getAssignmentInsertions(param, insertions);
4701
+ }
4702
+ if (insertions) {
4703
+ state.crawl = true;
4704
+ node.body.body = [...insertions, ...node.body.body];
4705
+ }
4706
+ }
4707
+ if (name2.type === "StringLiteral") {
4708
+ const tagName = name2.value;
4709
+ if (tag.scope.getBinding(tagName) && TAG_NAME_IDENTIFIER_REG.test(tagName)) {
4710
+ state.crawl = true;
4711
+ node.name = withPreviousLocation(import_compiler25.types.identifier(tagName), name2);
4712
+ }
4713
+ }
4714
+ for (let i = 0; i < attributes.length; i++) {
4715
+ const attr = attributes[i];
4716
+ if (import_compiler25.types.isMarkoAttribute(attr) && attr.bound) {
4717
+ state.crawl = true;
4718
+ attr.bound = false;
4719
+ attributes.splice(++i, 0, getChangeHandler(tag, attr));
4720
+ }
4721
+ }
4722
+ }
4723
+ function getChangeHandler(tag, attr) {
4724
+ const attrName = attr.name;
4725
+ const changeAttrName = attrName + "Change";
4726
+ if (import_compiler25.types.isIdentifier(attr.value)) {
4727
+ const binding = tag.scope.getBinding(attr.value.name);
4728
+ if (!binding)
4729
+ return import_compiler25.types.markoAttribute(
4730
+ changeAttrName,
4731
+ buildChangeHandlerFunction(attr.value)
4732
+ );
4733
+ const existingChangedAttr = BINDING_CHANGE_HANDLER.get(binding.identifier);
4734
+ if (!existingChangedAttr) {
4735
+ const bindingIdentifierPath = binding.path.getOuterBindingIdentifierPaths()[binding.identifier.name];
4736
+ const changeAttrExpr = bindingIdentifierPath ? bindingIdentifierPath.parentPath === binding.path ? buildChangeHandlerFunction(attr.value) : bindingIdentifierPath.parentPath.isObjectProperty() ? getChangeHandlerFromObjectPattern(
4737
+ bindingIdentifierPath.parentPath
4738
+ ) : void 0 : void 0;
4739
+ if (!changeAttrExpr) {
4740
+ throw tag.hub.buildError(attr.value, "Unable to bind to value.");
4741
+ }
4742
+ const changeHandlerAttr = import_compiler25.types.markoAttribute(
4743
+ changeAttrName,
4744
+ changeAttrExpr
4745
+ );
4746
+ BINDING_CHANGE_HANDLER.set(binding.identifier, changeHandlerAttr);
4747
+ return changeHandlerAttr;
4748
+ }
4749
+ if (existingChangedAttr.type === "Identifier") {
4750
+ return import_compiler25.types.markoAttribute(
4751
+ changeAttrName,
4752
+ withPreviousLocation(
4753
+ import_compiler25.types.identifier(existingChangedAttr.name),
4754
+ attr.value
4755
+ )
4756
+ );
4757
+ }
4758
+ const markoRoot = isMarko(binding.path) ? binding.path : getMarkoRoot(binding.path);
4759
+ if (!(markoRoot?.isMarkoTag() || markoRoot?.isMarkoTagBody())) {
4760
+ throw tag.hub.buildError(attr.value, "Unable to bind to value.");
4761
+ }
4762
+ const changeHandlerId = generateUid(changeAttrName);
4763
+ const changeHandlerConst = import_compiler25.types.markoTag(
4764
+ import_compiler25.types.stringLiteral("const"),
4765
+ [import_compiler25.types.markoAttribute("value", existingChangedAttr.value, null, null, true)],
4766
+ import_compiler25.types.markoTagBody([]),
4767
+ null,
4768
+ import_compiler25.types.identifier(changeHandlerId)
4769
+ );
4770
+ BINDING_CHANGE_HANDLER.set(
4771
+ binding.identifier,
4772
+ existingChangedAttr.value = import_compiler25.types.identifier(changeHandlerId)
4773
+ );
4774
+ if (markoRoot.isMarkoTag()) {
4775
+ markoRoot.insertAfter(changeHandlerConst);
4776
+ } else {
4777
+ markoRoot.unshiftContainer("body", changeHandlerConst);
4778
+ }
4779
+ markoRoot.scope.crawl();
4780
+ return import_compiler25.types.markoAttribute(
4781
+ changeAttrName,
4782
+ withPreviousLocation(import_compiler25.types.identifier(changeHandlerId), attr.value)
4783
+ );
4784
+ } else if (import_compiler25.types.isMemberExpression(attr.value)) {
4785
+ const prop = attr.value.property;
4786
+ if (!import_compiler25.types.isPrivateName(attr.value.property)) {
4787
+ return import_compiler25.types.markoAttribute(
4788
+ changeAttrName,
4789
+ import_compiler25.types.memberExpression(
4790
+ import_compiler25.types.cloneNode(attr.value.object),
4791
+ prop.type === "Identifier" ? withPreviousLocation(import_compiler25.types.identifier(prop.name + "Change"), prop) : import_compiler25.types.binaryExpression(
4792
+ "+",
4793
+ import_compiler25.types.cloneNode(prop),
4794
+ import_compiler25.types.stringLiteral("Change")
4795
+ ),
4796
+ prop.type !== "Identifier"
4797
+ )
4798
+ );
4799
+ }
4800
+ }
4801
+ throw tag.hub.buildError(
4802
+ attr.value,
4803
+ "Attributes may only be bound to identifiers or member expressions"
4804
+ );
4805
+ }
4806
+ function buildChangeHandlerFunction(id) {
4807
+ const newId = "_new_" + id.name;
4808
+ return import_compiler25.types.arrowFunctionExpression(
4809
+ [withPreviousLocation(import_compiler25.types.identifier(newId), id)],
4810
+ import_compiler25.types.blockStatement([
4811
+ import_compiler25.types.expressionStatement(
4812
+ import_compiler25.types.assignmentExpression(
4813
+ "=",
4814
+ withPreviousLocation(import_compiler25.types.identifier(id.name), id),
4815
+ withPreviousLocation(import_compiler25.types.identifier(newId), id)
4816
+ )
4817
+ )
4818
+ ])
4819
+ );
4820
+ }
4821
+ function getChangeHandlerFromObjectPattern(parent) {
4822
+ let changeKey;
4823
+ const pattern = parent.parentPath;
4824
+ if (parent.node.computed) {
4825
+ changeKey = generateUidIdentifier("dynamicChange");
4826
+ pattern.pushContainer(
4827
+ "properties",
4828
+ import_compiler25.types.objectProperty(
4829
+ import_compiler25.types.binaryExpression(
4830
+ "+",
4831
+ parent.get("key").node,
4832
+ import_compiler25.types.stringLiteral("Change")
4833
+ ),
4834
+ changeKey,
4835
+ true
4836
+ )
4837
+ );
4838
+ } else {
4839
+ const key = parent.get("key");
4840
+ const searchKey = `${getStringOrIdentifierValue(key)}Change`;
4841
+ for (const prop of pattern.get("properties")) {
4842
+ if (prop.isObjectProperty()) {
4843
+ const propKey = prop.get("key");
4844
+ const propValue = prop.get("value");
4845
+ if (!prop.node.computed && getStringOrIdentifierValue(propKey) === searchKey && propValue.isIdentifier()) {
4846
+ changeKey = propValue.node;
4847
+ break;
4848
+ }
4849
+ }
4850
+ }
4851
+ if (!changeKey) {
4852
+ pattern.unshiftContainer(
4853
+ "properties",
4854
+ import_compiler25.types.objectProperty(
4855
+ import_compiler25.types.stringLiteral(searchKey),
4856
+ changeKey = generateUidIdentifier(searchKey)
4857
+ )
4858
+ );
4859
+ }
4860
+ }
4861
+ return changeKey;
4862
+ }
4863
+ function getStringOrIdentifierValue(path5) {
4864
+ return getLiteralName(path5.node);
4865
+ }
4866
+ function getLiteralName(node) {
4867
+ switch (node.type) {
4868
+ case "Identifier":
4869
+ return node.name;
4870
+ case "StringLiteral":
4871
+ return node.value;
4872
+ }
4873
+ }
4874
+ function getAssignmentInsertions(node, insertions) {
4875
+ switch (node.type) {
4876
+ case "ObjectPattern":
4877
+ for (const prop of node.properties) {
4878
+ if (prop.type === "ObjectProperty") {
4879
+ if (prop.value.type === "AssignmentPattern") {
4880
+ const { left, right } = prop.value;
4881
+ const sourceName = generateUid(
4882
+ getLiteralName(left) || getLiteralName(prop.key) || "pattern"
4883
+ );
4884
+ prop.shorthand = false;
4885
+ prop.value = import_compiler25.types.identifier(sourceName);
4886
+ (insertions ||= []).push(
4887
+ toConstTag(left, toFallbackExpr(sourceName, right))
4888
+ );
4889
+ getAssignmentInsertions(left, insertions);
4890
+ } else {
4891
+ insertions = getAssignmentInsertions(prop.value, insertions);
4892
+ }
4893
+ }
4894
+ }
4895
+ break;
4896
+ case "ArrayPattern":
4897
+ for (let i = 0, len = node.elements.length; i < len; i++) {
4898
+ const el = node.elements[i];
4899
+ if (el != null) {
4900
+ if (el.type === "AssignmentPattern") {
4901
+ const { left, right } = el;
4902
+ const sourceName = generateUid(getLiteralName(left) || "pattern");
4903
+ node.elements[i] = import_compiler25.types.identifier(sourceName);
4904
+ (insertions ||= []).push(
4905
+ toConstTag(left, toFallbackExpr(sourceName, right))
4906
+ );
4907
+ getAssignmentInsertions(left, insertions);
4908
+ } else {
4909
+ insertions = getAssignmentInsertions(el, insertions);
4910
+ }
4911
+ }
4912
+ }
4913
+ break;
4914
+ }
4915
+ return insertions;
4916
+ }
4917
+ function toFallbackExpr(id, fallback) {
4918
+ return import_compiler25.types.conditionalExpression(
4919
+ import_compiler25.types.binaryExpression("!==", buildUndefined(), import_compiler25.types.identifier(id)),
4920
+ import_compiler25.types.identifier(id),
4921
+ fallback
4922
+ );
4923
+ }
4924
+ function toConstTag(id, expr) {
4925
+ return import_compiler25.types.markoTag(
4926
+ import_compiler25.types.stringLiteral("const"),
4927
+ [import_compiler25.types.markoAttribute("value", expr, null, null, true)],
4928
+ import_compiler25.types.markoTagBody(),
4929
+ null,
4930
+ id
4931
+ );
4932
+ }
4933
+ function buildUndefined() {
4934
+ return import_compiler25.types.unaryExpression("void", import_compiler25.types.numericLiteral(0));
4935
+ }
4936
+
4662
4937
  // src/translator/visitors/program/index.ts
4663
4938
  var cleanIdentifier;
4664
4939
  var scopeIdentifier;
@@ -4668,12 +4943,15 @@ function isScopeIdentifier(node) {
4668
4943
  var program_default = {
4669
4944
  migrate: {
4670
4945
  enter(program) {
4671
- program.node.params = [import_compiler25.types.identifier("input")];
4946
+ program.node.params = [import_compiler26.types.identifier("input")];
4672
4947
  },
4673
4948
  exit(program) {
4674
4949
  program.scope.crawl();
4675
4950
  }
4676
4951
  },
4952
+ transform: {
4953
+ exit: preAnalyze
4954
+ },
4677
4955
  analyze: {
4678
4956
  enter(program) {
4679
4957
  startSection(program);
@@ -4751,7 +5029,7 @@ var program_default = {
4751
5029
  body.push(child);
4752
5030
  }
4753
5031
  }
4754
- body[0] ??= import_compiler25.types.importDeclaration([], import_compiler25.types.stringLiteral(compatFile));
5032
+ body[0] ??= import_compiler26.types.importDeclaration([], import_compiler26.types.stringLiteral(compatFile));
4755
5033
  program.node.body = body;
4756
5034
  }
4757
5035
  }
@@ -4765,7 +5043,7 @@ function resolveRelativeToEntry(entryFile, file, req) {
4765
5043
  }
4766
5044
 
4767
5045
  // src/translator/util/nested-attribute-tags.ts
4768
- var import_compiler26 = require("@marko/compiler");
5046
+ var import_compiler27 = require("@marko/compiler");
4769
5047
  var import_babel_utils18 = require("@marko/compiler/babel-utils");
4770
5048
  var attrTagToIdentifierLookup = /* @__PURE__ */ new WeakMap();
4771
5049
  function getAttrTagIdentifier(meta) {
@@ -4774,7 +5052,7 @@ function getAttrTagIdentifier(meta) {
4774
5052
  name2 = generateUid(meta.name);
4775
5053
  attrTagToIdentifierLookup.set(meta, name2);
4776
5054
  }
4777
- return import_compiler26.types.identifier(name2);
5055
+ return import_compiler27.types.identifier(name2);
4778
5056
  }
4779
5057
  function analyzeAttributeTags(tag) {
4780
5058
  if (tag.node.extra?.attributeTags) return tag.node.extra.attributeTags;
@@ -4887,7 +5165,7 @@ function getConditionRoot(tag) {
4887
5165
  }
4888
5166
 
4889
5167
  // src/translator/util/set-tag-sections-downstream.ts
4890
- var import_compiler27 = require("@marko/compiler");
5168
+ var import_compiler28 = require("@marko/compiler");
4891
5169
  var import_babel_utils19 = require("@marko/compiler/babel-utils");
4892
5170
  var [getTagDownstreams] = createSectionState(
4893
5171
  "tag-downstreams",
@@ -4934,23 +5212,23 @@ function crawlSectionsAndSetBinding(tag, binding, tree, skip2) {
4934
5212
  }
4935
5213
 
4936
5214
  // src/translator/util/translate-attrs.ts
4937
- var import_compiler32 = require("@marko/compiler");
5215
+ var import_compiler33 = require("@marko/compiler");
4938
5216
  var import_babel_utils23 = require("@marko/compiler/babel-utils");
4939
5217
 
4940
5218
  // src/translator/core/for.ts
4941
- var import_compiler31 = require("@marko/compiler");
5219
+ var import_compiler32 = require("@marko/compiler");
4942
5220
  var import_babel_utils22 = require("@marko/compiler/babel-utils");
4943
5221
 
4944
5222
  // src/translator/util/is-only-child-in-parent.ts
4945
- var import_compiler30 = require("@marko/compiler");
5223
+ var import_compiler31 = require("@marko/compiler");
4946
5224
  var import_babel_utils21 = require("@marko/compiler/babel-utils");
4947
5225
 
4948
5226
  // src/translator/visitors/tag/native-tag.ts
4949
- var import_compiler29 = require("@marko/compiler");
5227
+ var import_compiler30 = require("@marko/compiler");
4950
5228
  var import_babel_utils20 = require("@marko/compiler/babel-utils");
4951
5229
 
4952
5230
  // src/translator/util/translate-var.ts
4953
- var import_compiler28 = require("@marko/compiler");
5231
+ var import_compiler29 = require("@marko/compiler");
4954
5232
  function translateVar(tag, initialValue, kind = "const") {
4955
5233
  const {
4956
5234
  node: { var: tagVar }
@@ -4968,15 +5246,15 @@ function translateVar(tag, initialValue, kind = "const") {
4968
5246
  if (changeBinding && changeName !== changeBinding.name) {
4969
5247
  getDestructurePattern(id)?.pushContainer(
4970
5248
  "properties",
4971
- import_compiler28.types.objectProperty(
4972
- import_compiler28.types.identifier(changeName),
4973
- import_compiler28.types.identifier(changeBinding.name)
5249
+ import_compiler29.types.objectProperty(
5250
+ import_compiler29.types.identifier(changeName),
5251
+ import_compiler29.types.identifier(changeBinding.name)
4974
5252
  )
4975
5253
  );
4976
5254
  }
4977
5255
  });
4978
5256
  tag.insertBefore(
4979
- import_compiler28.types.variableDeclaration(kind, [import_compiler28.types.variableDeclarator(tagVar, initialValue)])
5257
+ import_compiler29.types.variableDeclaration(kind, [import_compiler29.types.variableDeclarator(tagVar, initialValue)])
4980
5258
  );
4981
5259
  }
4982
5260
  function getDestructurePattern(id) {
@@ -4996,39 +5274,13 @@ var kGetterId = Symbol("node getter id");
4996
5274
  var kTagContentAttr = Symbol("tag could have dynamic content attribute");
4997
5275
  var htmlSelectArgs = /* @__PURE__ */ new WeakMap();
4998
5276
  var native_tag_default = {
4999
- transform: {
5000
- enter(tag) {
5001
- const tagName = getTagName(tag);
5002
- if (tagName === "textarea" && tag.node.body.body.length) {
5003
- const parts = [];
5004
- for (const child of tag.node.body.body) {
5005
- if (child.type === "MarkoText" || child.type === "MarkoPlaceholder" && child.escape) {
5006
- parts.push(child.value);
5007
- } else {
5008
- throw tag.hub.file.hub.buildError(
5009
- child,
5010
- "Unexpected content in textarea, only text and placeholders are supported.",
5011
- SyntaxError
5012
- );
5013
- }
5014
- }
5015
- tag.node.attributes.push(
5016
- import_compiler29.types.markoAttribute(
5017
- "value",
5018
- normalizeStringExpression(parts) || buildUndefined()
5019
- )
5020
- );
5021
- tag.node.body.body = [];
5022
- }
5023
- }
5024
- },
5025
5277
  analyze: {
5026
5278
  enter(tag) {
5027
5279
  (0, import_babel_utils20.assertNoArgs)(tag);
5028
5280
  (0, import_babel_utils20.assertNoParams)(tag);
5029
5281
  (0, import_babel_utils20.assertNoAttributeTags)(tag);
5030
5282
  const { node } = tag;
5031
- if (node.var && !import_compiler29.types.isIdentifier(node.var)) {
5283
+ if (node.var && !import_compiler30.types.isIdentifier(node.var)) {
5032
5284
  throw tag.get("var").buildCodeFrameError(
5033
5285
  "Tag variables on [native tags](https://markojs.com/docs/reference/native-tag) cannot be destructured."
5034
5286
  );
@@ -5044,7 +5296,7 @@ var native_tag_default = {
5044
5296
  for (let i = attributes.length; i--; ) {
5045
5297
  const attr = attributes[i];
5046
5298
  const valueExtra = attr.value.extra ??= {};
5047
- if (import_compiler29.types.isMarkoAttribute(attr)) {
5299
+ if (import_compiler30.types.isMarkoAttribute(attr)) {
5048
5300
  if (seen[attr.name]) {
5049
5301
  dropReferences(attr.value);
5050
5302
  continue;
@@ -5056,14 +5308,14 @@ var native_tag_default = {
5056
5308
  } else if (!evaluate(attr.value).confident) {
5057
5309
  hasDynamicAttributes = true;
5058
5310
  }
5059
- } else if (import_compiler29.types.isMarkoSpreadAttribute(attr)) {
5311
+ } else if (import_compiler30.types.isMarkoSpreadAttribute(attr)) {
5060
5312
  valueExtra.isEffect = true;
5061
5313
  hasEventHandlers = true;
5062
5314
  hasDynamicAttributes = true;
5063
5315
  }
5064
5316
  if (spreadReferenceNodes) {
5065
5317
  spreadReferenceNodes.push(attr.value);
5066
- } else if (import_compiler29.types.isMarkoSpreadAttribute(attr)) {
5318
+ } else if (import_compiler30.types.isMarkoSpreadAttribute(attr)) {
5067
5319
  spreadReferenceNodes = [attr.value];
5068
5320
  relatedControllable = getRelatedControllable(tagName, seen);
5069
5321
  } else {
@@ -5075,7 +5327,7 @@ var native_tag_default = {
5075
5327
  const tagExtra = node.extra ??= {};
5076
5328
  const tagSection = getOrCreateSection(tag);
5077
5329
  const nodeBinding = tagExtra[kNativeTagBinding] = createBinding(
5078
- "#" + (node.name.type === "StringLiteral" ? node.name.value : import_compiler29.types.toIdentifier(tag.get("name"))),
5330
+ "#" + (node.name.type === "StringLiteral" ? node.name.value : import_compiler30.types.toIdentifier(tag.get("name"))),
5079
5331
  0 /* dom */,
5080
5332
  tagSection
5081
5333
  );
@@ -5154,7 +5406,7 @@ var native_tag_default = {
5154
5406
  callRuntime(
5155
5407
  "_el",
5156
5408
  getterId && getScopeIdIdentifier(tagSection),
5157
- getterId && import_compiler29.types.stringLiteral(getterId)
5409
+ getterId && import_compiler30.types.stringLiteral(getterId)
5158
5410
  )
5159
5411
  );
5160
5412
  }
@@ -5180,24 +5432,24 @@ var native_tag_default = {
5180
5432
  if (tagName === "select") {
5181
5433
  if (staticControllable) {
5182
5434
  htmlSelectArgs.set(tag.node, {
5183
- value: staticControllable.attrs[0]?.value || buildUndefined(),
5184
- valueChange: staticControllable.attrs[1]?.value || buildUndefined()
5435
+ value: staticControllable.attrs[0]?.value || buildUndefined2(),
5436
+ valueChange: staticControllable.attrs[1]?.value || buildUndefined2()
5185
5437
  });
5186
5438
  } else if (spreadExpression) {
5187
5439
  const spreadIdentifier = generateUidIdentifier("select_input");
5188
5440
  tag.insertBefore(
5189
- import_compiler29.types.variableDeclaration("const", [
5190
- import_compiler29.types.variableDeclarator(spreadIdentifier, spreadExpression)
5441
+ import_compiler30.types.variableDeclaration("const", [
5442
+ import_compiler30.types.variableDeclarator(spreadIdentifier, spreadExpression)
5191
5443
  ])
5192
5444
  );
5193
5445
  htmlSelectArgs.set(tag.node, {
5194
- value: import_compiler29.types.memberExpression(
5446
+ value: import_compiler30.types.memberExpression(
5195
5447
  spreadIdentifier,
5196
- import_compiler29.types.identifier("value")
5448
+ import_compiler30.types.identifier("value")
5197
5449
  ),
5198
- valueChange: import_compiler29.types.memberExpression(
5450
+ valueChange: import_compiler30.types.memberExpression(
5199
5451
  spreadIdentifier,
5200
- import_compiler29.types.identifier("valueChange")
5452
+ import_compiler30.types.identifier("valueChange")
5201
5453
  )
5202
5454
  });
5203
5455
  spreadExpression = spreadIdentifier;
@@ -5211,14 +5463,14 @@ var native_tag_default = {
5211
5463
  } else if (spreadExpression) {
5212
5464
  const spreadIdentifier = generateUidIdentifier("textarea_input");
5213
5465
  tag.insertBefore(
5214
- import_compiler29.types.variableDeclaration("const", [
5215
- import_compiler29.types.variableDeclarator(spreadIdentifier, spreadExpression)
5466
+ import_compiler30.types.variableDeclaration("const", [
5467
+ import_compiler30.types.variableDeclarator(spreadIdentifier, spreadExpression)
5216
5468
  ])
5217
5469
  );
5218
- value = import_compiler29.types.memberExpression(spreadIdentifier, import_compiler29.types.identifier("value"));
5219
- valueChange = import_compiler29.types.memberExpression(
5470
+ value = import_compiler30.types.memberExpression(spreadIdentifier, import_compiler30.types.identifier("value"));
5471
+ valueChange = import_compiler30.types.memberExpression(
5220
5472
  spreadIdentifier,
5221
- import_compiler29.types.identifier("valueChange")
5473
+ import_compiler30.types.identifier("valueChange")
5222
5474
  );
5223
5475
  spreadExpression = spreadIdentifier;
5224
5476
  }
@@ -5259,7 +5511,7 @@ var native_tag_default = {
5259
5511
  } else if (isEventHandler(name2)) {
5260
5512
  addHTMLEffectCall(tagSection, valueReferences);
5261
5513
  } else {
5262
- write`${callRuntime("_attr", import_compiler29.types.stringLiteral(name2), value)}`;
5514
+ write`${callRuntime("_attr", import_compiler30.types.stringLiteral(name2), value)}`;
5263
5515
  }
5264
5516
  break;
5265
5517
  }
@@ -5291,7 +5543,7 @@ var native_tag_default = {
5291
5543
  write`>`;
5292
5544
  tagExtra[kTagContentAttr] = true;
5293
5545
  tag.node.body.body = [
5294
- import_compiler29.types.expressionStatement(
5546
+ import_compiler30.types.expressionStatement(
5295
5547
  callRuntime(
5296
5548
  "_attr_content",
5297
5549
  visitAccessor,
@@ -5313,7 +5565,7 @@ var native_tag_default = {
5313
5565
  );
5314
5566
  tagExtra[kTagContentAttr] = true;
5315
5567
  tag.node.body.body = [
5316
- skipExpression ? import_compiler29.types.expressionStatement(
5568
+ skipExpression ? import_compiler30.types.expressionStatement(
5317
5569
  callRuntime(
5318
5570
  "_attrs_partial_content",
5319
5571
  spreadExpression,
@@ -5323,7 +5575,7 @@ var native_tag_default = {
5323
5575
  tag.node.name,
5324
5576
  serializeReason
5325
5577
  )
5326
- ) : import_compiler29.types.expressionStatement(
5578
+ ) : import_compiler30.types.expressionStatement(
5327
5579
  callRuntime(
5328
5580
  "_attrs_content",
5329
5581
  spreadExpression,
@@ -5340,7 +5592,7 @@ var native_tag_default = {
5340
5592
  }
5341
5593
  if (tagExtra.tagNameNullable) {
5342
5594
  tag.insertBefore(
5343
- import_compiler29.types.ifStatement(tag.node.name, consumeHTML(tag))
5595
+ import_compiler30.types.ifStatement(tag.node.name, consumeHTML(tag))
5344
5596
  )[0].skip();
5345
5597
  }
5346
5598
  if (writeAtStartOfBody) {
@@ -5366,16 +5618,16 @@ var native_tag_default = {
5366
5618
  }
5367
5619
  flushInto(tag);
5368
5620
  tag.insertBefore(
5369
- import_compiler29.types.expressionStatement(
5621
+ import_compiler30.types.expressionStatement(
5370
5622
  callRuntime(
5371
5623
  "_attr_select_value",
5372
5624
  getScopeIdIdentifier(getSection(tag)),
5373
5625
  nodeBinding && getScopeAccessorLiteral(nodeBinding),
5374
5626
  selectArgs.value,
5375
5627
  selectArgs.valueChange,
5376
- import_compiler29.types.arrowFunctionExpression(
5628
+ import_compiler30.types.arrowFunctionExpression(
5377
5629
  [],
5378
- import_compiler29.types.blockStatement(tag.node.body.body)
5630
+ import_compiler30.types.blockStatement(tag.node.body.body)
5379
5631
  )
5380
5632
  )
5381
5633
  )
@@ -5392,7 +5644,7 @@ var native_tag_default = {
5392
5644
  }
5393
5645
  if (tagExtra.tagNameNullable) {
5394
5646
  tag.insertBefore(
5395
- import_compiler29.types.ifStatement(tag.node.name, consumeHTML(tag))
5647
+ import_compiler30.types.ifStatement(tag.node.name, consumeHTML(tag))
5396
5648
  )[0].skip();
5397
5649
  }
5398
5650
  if (markerSerializeReason) {
@@ -5417,13 +5669,13 @@ var native_tag_default = {
5417
5669
  if (getterId) {
5418
5670
  getterFnIdentifier = generateUidIdentifier(`get_${varName}`);
5419
5671
  (0, import_babel_utils20.getProgram)().node.body.push(
5420
- import_compiler29.types.variableDeclaration("const", [
5421
- import_compiler29.types.variableDeclarator(
5672
+ import_compiler30.types.variableDeclaration("const", [
5673
+ import_compiler30.types.variableDeclarator(
5422
5674
  getterFnIdentifier,
5423
5675
  callRuntime(
5424
5676
  "_el",
5425
- import_compiler29.types.stringLiteral(getterId),
5426
- import_compiler29.types.stringLiteral(
5677
+ import_compiler30.types.stringLiteral(getterId),
5678
+ import_compiler30.types.stringLiteral(
5427
5679
  getAccessorPrefix().Getter + getScopeAccessorLiteral(nodeBinding).value
5428
5680
  )
5429
5681
  )
@@ -5436,22 +5688,22 @@ var native_tag_default = {
5436
5688
  if (isSameOrChildSection(tagSection, referenceSection)) {
5437
5689
  if (isInvokedFunction(reference)) {
5438
5690
  reference.parentPath.replaceWith(
5439
- import_compiler29.types.expressionStatement(
5691
+ import_compiler30.types.expressionStatement(
5440
5692
  createScopeReadExpression(referenceSection, nodeBinding)
5441
5693
  )
5442
5694
  );
5443
5695
  } else if (getterFnIdentifier) {
5444
5696
  reference.replaceWith(
5445
- import_compiler29.types.callExpression(getterFnIdentifier, [
5697
+ import_compiler30.types.callExpression(getterFnIdentifier, [
5446
5698
  getScopeExpression(referenceSection, getSection(tag))
5447
5699
  ])
5448
5700
  );
5449
5701
  } else {
5450
5702
  reference.replaceWith(
5451
- import_compiler29.types.expressionStatement(
5452
- import_compiler29.types.memberExpression(
5703
+ import_compiler30.types.expressionStatement(
5704
+ import_compiler30.types.memberExpression(
5453
5705
  getScopeExpression(tagSection, referenceSection),
5454
- import_compiler29.types.stringLiteral(
5706
+ import_compiler30.types.stringLiteral(
5455
5707
  getAccessorPrefix().Getter + getScopeAccessorLiteral(nodeBinding).value
5456
5708
  ),
5457
5709
  true
@@ -5481,7 +5733,7 @@ var native_tag_default = {
5481
5733
  "render",
5482
5734
  tagSection,
5483
5735
  referencedBindings,
5484
- import_compiler29.types.expressionStatement(
5736
+ import_compiler30.types.expressionStatement(
5485
5737
  callRuntime(helper, scopeIdentifier, visitAccessor, ...values)
5486
5738
  )
5487
5739
  );
@@ -5490,7 +5742,7 @@ var native_tag_default = {
5490
5742
  "effect",
5491
5743
  tagSection,
5492
5744
  void 0,
5493
- import_compiler29.types.expressionStatement(
5745
+ import_compiler30.types.expressionStatement(
5494
5746
  callRuntime(`${helper}_script`, scopeIdentifier, visitAccessor)
5495
5747
  )
5496
5748
  );
@@ -5507,7 +5759,7 @@ var native_tag_default = {
5507
5759
  if (confident) {
5508
5760
  write`${getHTMLRuntime()[helper](computed)}`;
5509
5761
  } else {
5510
- const nodeExpr = import_compiler29.types.memberExpression(
5762
+ const nodeExpr = import_compiler30.types.memberExpression(
5511
5763
  scopeIdentifier,
5512
5764
  visitAccessor,
5513
5765
  true
@@ -5520,7 +5772,7 @@ var native_tag_default = {
5520
5772
  let stmt;
5521
5773
  trackDelimitedAttrValue(value, meta);
5522
5774
  if (meta.dynamicItems) {
5523
- stmt = import_compiler29.types.expressionStatement(
5775
+ stmt = import_compiler30.types.expressionStatement(
5524
5776
  callRuntime(helper, nodeExpr, value)
5525
5777
  );
5526
5778
  } else {
@@ -5532,11 +5784,11 @@ var native_tag_default = {
5532
5784
  if (keys.length === 1) {
5533
5785
  const [key] = keys;
5534
5786
  const value2 = meta.dynamicValues[key];
5535
- stmt = import_compiler29.types.expressionStatement(
5787
+ stmt = import_compiler30.types.expressionStatement(
5536
5788
  callRuntime(
5537
5789
  `_attr_${name2}_item`,
5538
5790
  nodeExpr,
5539
- import_compiler29.types.stringLiteral(key),
5791
+ import_compiler30.types.stringLiteral(key),
5540
5792
  value2
5541
5793
  )
5542
5794
  );
@@ -5545,14 +5797,14 @@ var native_tag_default = {
5545
5797
  for (const key of keys) {
5546
5798
  const value2 = meta.dynamicValues[key];
5547
5799
  props.push(
5548
- import_compiler29.types.objectProperty(toPropertyName(key), value2)
5800
+ import_compiler30.types.objectProperty(toPropertyName(key), value2)
5549
5801
  );
5550
5802
  }
5551
- stmt = import_compiler29.types.expressionStatement(
5803
+ stmt = import_compiler30.types.expressionStatement(
5552
5804
  callRuntime(
5553
5805
  `_attr_${name2}_items`,
5554
5806
  nodeExpr,
5555
- import_compiler29.types.objectExpression(props)
5807
+ import_compiler30.types.objectExpression(props)
5556
5808
  )
5557
5809
  );
5558
5810
  }
@@ -5572,11 +5824,11 @@ var native_tag_default = {
5572
5824
  "effect",
5573
5825
  tagSection,
5574
5826
  valueReferences,
5575
- import_compiler29.types.expressionStatement(
5827
+ import_compiler30.types.expressionStatement(
5576
5828
  callRuntime(
5577
5829
  "_on",
5578
- import_compiler29.types.memberExpression(scopeIdentifier, visitAccessor, true),
5579
- import_compiler29.types.stringLiteral(getEventHandlerName(name2)),
5830
+ import_compiler30.types.memberExpression(scopeIdentifier, visitAccessor, true),
5831
+ import_compiler30.types.stringLiteral(getEventHandlerName(name2)),
5580
5832
  value
5581
5833
  )
5582
5834
  )
@@ -5586,11 +5838,11 @@ var native_tag_default = {
5586
5838
  "render",
5587
5839
  tagSection,
5588
5840
  valueReferences,
5589
- import_compiler29.types.expressionStatement(
5841
+ import_compiler30.types.expressionStatement(
5590
5842
  callRuntime(
5591
5843
  "_attr",
5592
- import_compiler29.types.memberExpression(scopeIdentifier, visitAccessor, true),
5593
- import_compiler29.types.stringLiteral(name2),
5844
+ import_compiler30.types.memberExpression(scopeIdentifier, visitAccessor, true),
5845
+ import_compiler30.types.stringLiteral(name2),
5594
5846
  value
5595
5847
  )
5596
5848
  )
@@ -5606,7 +5858,7 @@ var native_tag_default = {
5606
5858
  "render",
5607
5859
  tagSection,
5608
5860
  tagExtra.referencedBindings,
5609
- import_compiler29.types.expressionStatement(
5861
+ import_compiler30.types.expressionStatement(
5610
5862
  callRuntime(
5611
5863
  canHaveAttrContent ? "_attrs_partial_content" : "_attrs_partial",
5612
5864
  scopeIdentifier,
@@ -5621,7 +5873,7 @@ var native_tag_default = {
5621
5873
  "render",
5622
5874
  tagSection,
5623
5875
  tagExtra.referencedBindings,
5624
- import_compiler29.types.expressionStatement(
5876
+ import_compiler30.types.expressionStatement(
5625
5877
  callRuntime(
5626
5878
  canHaveAttrContent ? "_attrs_content" : "_attrs",
5627
5879
  scopeIdentifier,
@@ -5635,7 +5887,7 @@ var native_tag_default = {
5635
5887
  "effect",
5636
5888
  tagSection,
5637
5889
  tagExtra.referencedBindings,
5638
- import_compiler29.types.expressionStatement(
5890
+ import_compiler30.types.expressionStatement(
5639
5891
  callRuntime("_attrs_script", scopeIdentifier, visitAccessor)
5640
5892
  ),
5641
5893
  false
@@ -5647,7 +5899,7 @@ var native_tag_default = {
5647
5899
  "render",
5648
5900
  tagSection,
5649
5901
  contentAttrValue.extra?.referencedBindings,
5650
- import_compiler29.types.expressionStatement(
5902
+ import_compiler30.types.expressionStatement(
5651
5903
  callRuntime(
5652
5904
  "_attr_content",
5653
5905
  scopeIdentifier,
@@ -5765,7 +6017,7 @@ function getUsedAttrs(tagName, tag) {
5765
6017
  for (let i = attributes.length; i--; ) {
5766
6018
  const attr = attributes[i];
5767
6019
  const { value } = attr;
5768
- if (import_compiler29.types.isMarkoSpreadAttribute(attr)) {
6020
+ if (import_compiler30.types.isMarkoSpreadAttribute(attr)) {
5769
6021
  if (!spreadProps) {
5770
6022
  spreadProps = [];
5771
6023
  staticControllable = getRelatedControllable(tagName, seen);
@@ -5779,7 +6031,7 @@ function getUsedAttrs(tagName, tag) {
5779
6031
  staticControllable = void 0;
5780
6032
  }
5781
6033
  }
5782
- spreadProps.push(import_compiler29.types.spreadElement(value));
6034
+ spreadProps.push(import_compiler30.types.spreadElement(value));
5783
6035
  } else if (!seen[attr.name] || !(attr.name === "content" && tag.body.body.length)) {
5784
6036
  seen[attr.name] = attr;
5785
6037
  if (spreadProps) {
@@ -5811,18 +6063,18 @@ function getUsedAttrs(tagName, tag) {
5811
6063
  for (const attr of staticControllable.attrs) {
5812
6064
  if (attr) {
5813
6065
  (skipProps ||= []).push(
5814
- toObjectProperty(attr.name, import_compiler29.types.numericLiteral(1))
6066
+ toObjectProperty(attr.name, import_compiler30.types.numericLiteral(1))
5815
6067
  );
5816
6068
  }
5817
6069
  }
5818
6070
  }
5819
6071
  for (const { name: name2 } of staticAttrs) {
5820
- (skipProps ||= []).push(toObjectProperty(name2, import_compiler29.types.numericLiteral(1)));
6072
+ (skipProps ||= []).push(toObjectProperty(name2, import_compiler30.types.numericLiteral(1)));
5821
6073
  }
5822
6074
  spreadExpression = propsToExpression(spreadProps);
5823
6075
  }
5824
6076
  if (skipProps) {
5825
- skipExpression = import_compiler29.types.objectExpression(skipProps);
6077
+ skipExpression = import_compiler30.types.objectExpression(skipProps);
5826
6078
  }
5827
6079
  return {
5828
6080
  staticAttrs,
@@ -5909,14 +6161,14 @@ function trackDelimitedAttrObjectProperties(obj, meta) {
5909
6161
  (meta.staticItems ||= []).push(staticProps);
5910
6162
  }
5911
6163
  if (dynamicProps) {
5912
- (meta.dynamicItems ||= []).push(import_compiler29.types.objectExpression(dynamicProps));
6164
+ (meta.dynamicItems ||= []).push(import_compiler30.types.objectExpression(dynamicProps));
5913
6165
  }
5914
6166
  }
5915
6167
  function isNativeTagChangeHandler(propName) {
5916
6168
  return /^(?:value|checked(?:Value)?|open)Change$/.test(propName);
5917
6169
  }
5918
- function buildUndefined() {
5919
- return import_compiler29.types.unaryExpression("void", import_compiler29.types.numericLiteral(0));
6170
+ function buildUndefined2() {
6171
+ return import_compiler30.types.unaryExpression("void", import_compiler30.types.numericLiteral(0));
5920
6172
  }
5921
6173
 
5922
6174
  // src/translator/util/is-only-child-in-parent.ts
@@ -6052,7 +6304,7 @@ var for_default = {
6052
6304
  const forTagArgs = getBaseArgsInForTag(forType, forAttrs);
6053
6305
  const forTagHTMLRuntime = branchSerializeReason ? forTypeToHTMLResumeRuntime(forType) : forTypeToRuntime(forType);
6054
6306
  forTagArgs.push(
6055
- import_compiler31.types.arrowFunctionExpression(params, import_compiler31.types.blockStatement(bodyStatements))
6307
+ import_compiler32.types.arrowFunctionExpression(params, import_compiler32.types.blockStatement(bodyStatements))
6056
6308
  );
6057
6309
  if (branchSerializeReason) {
6058
6310
  const skipParentEnd = onlyChildParentTagName && markerSerializeReason;
@@ -6067,7 +6319,7 @@ var for_default = {
6067
6319
  !statefulSerializeArg
6068
6320
  );
6069
6321
  forTagArgs.push(
6070
- forAttrs.by || import_compiler31.types.numericLiteral(0),
6322
+ forAttrs.by || import_compiler32.types.numericLiteral(0),
6071
6323
  getScopeIdIdentifier(tagSection),
6072
6324
  getScopeAccessorLiteral(nodeBinding),
6073
6325
  getSerializeGuard(
@@ -6080,17 +6332,17 @@ var for_default = {
6080
6332
  );
6081
6333
  if (skipParentEnd) {
6082
6334
  getParentTag(tag).node.extra[kSkipEndTag] = true;
6083
- forTagArgs.push(import_compiler31.types.stringLiteral(`</${onlyChildParentTagName}>`));
6335
+ forTagArgs.push(import_compiler32.types.stringLiteral(`</${onlyChildParentTagName}>`));
6084
6336
  }
6085
6337
  if (singleNodeOptimization) {
6086
6338
  if (!skipParentEnd) {
6087
- forTagArgs.push(import_compiler31.types.numericLiteral(0));
6339
+ forTagArgs.push(import_compiler32.types.numericLiteral(0));
6088
6340
  }
6089
- forTagArgs.push(import_compiler31.types.numericLiteral(1));
6341
+ forTagArgs.push(import_compiler32.types.numericLiteral(1));
6090
6342
  }
6091
6343
  }
6092
6344
  statements.push(
6093
- import_compiler31.types.expressionStatement(callRuntime(forTagHTMLRuntime, ...forTagArgs))
6345
+ import_compiler32.types.expressionStatement(callRuntime(forTagHTMLRuntime, ...forTagArgs))
6094
6346
  );
6095
6347
  for (const replacement of tag.replaceWithMultiple(statements)) {
6096
6348
  replacement.skip();
@@ -6135,7 +6387,7 @@ var for_default = {
6135
6387
  return callRuntime(
6136
6388
  forTypeToDOMRuntime(forType),
6137
6389
  getScopeAccessorLiteral(nodeRef),
6138
- import_compiler31.types.identifier(bodySection.name)
6390
+ import_compiler32.types.identifier(bodySection.name)
6139
6391
  );
6140
6392
  };
6141
6393
  const forAttrs = getKnownAttrValues(node);
@@ -6147,7 +6399,7 @@ var for_default = {
6147
6399
  tagSection,
6148
6400
  referencedBindings,
6149
6401
  signal,
6150
- import_compiler31.types.arrayExpression(loopArgs)
6402
+ import_compiler32.types.arrayExpression(loopArgs)
6151
6403
  );
6152
6404
  tag.remove();
6153
6405
  }
@@ -6225,11 +6477,11 @@ var for_default = {
6225
6477
  ]
6226
6478
  };
6227
6479
  function buildForRuntimeCall(type, attrs, params, statements) {
6228
- return import_compiler31.types.expressionStatement(
6480
+ return import_compiler32.types.expressionStatement(
6229
6481
  callRuntime(
6230
6482
  forTypeToRuntime(type),
6231
6483
  ...getBaseArgsInForTag(type, attrs),
6232
- import_compiler31.types.arrowFunctionExpression(params, import_compiler31.types.blockStatement(statements))
6484
+ import_compiler32.types.arrowFunctionExpression(params, import_compiler32.types.blockStatement(statements))
6233
6485
  )
6234
6486
  );
6235
6487
  }
@@ -6291,14 +6543,14 @@ function getBaseArgsInForTag(type, attrs) {
6291
6543
  case "to":
6292
6544
  return [
6293
6545
  attrs.to,
6294
- attrs.from || import_compiler31.types.numericLiteral(0),
6295
- attrs.step || import_compiler31.types.numericLiteral(1)
6546
+ attrs.from || import_compiler32.types.numericLiteral(0),
6547
+ attrs.step || import_compiler32.types.numericLiteral(1)
6296
6548
  ];
6297
6549
  case "until":
6298
6550
  return [
6299
6551
  attrs.until,
6300
- attrs.from || import_compiler31.types.numericLiteral(0),
6301
- attrs.step || import_compiler31.types.numericLiteral(1)
6552
+ attrs.from || import_compiler32.types.numericLiteral(0),
6553
+ attrs.step || import_compiler32.types.numericLiteral(1)
6302
6554
  ];
6303
6555
  }
6304
6556
  }
@@ -6316,8 +6568,8 @@ function translateAttrs(tag, templateExports, statements = [], contentKey = "con
6316
6568
  seen.add(attrTagMeta.name);
6317
6569
  if (attrTagMeta.dynamic) {
6318
6570
  statements.push(
6319
- import_compiler32.types.variableDeclaration("let", [
6320
- import_compiler32.types.variableDeclarator(getAttrTagIdentifier(attrTagMeta))
6571
+ import_compiler33.types.variableDeclaration("let", [
6572
+ import_compiler33.types.variableDeclarator(getAttrTagIdentifier(attrTagMeta))
6321
6573
  ])
6322
6574
  );
6323
6575
  properties.push(
@@ -6398,8 +6650,8 @@ function translateAttrs(tag, templateExports, statements = [], contentKey = "con
6398
6650
  if (!seen.has(contentKey) && usesExport(templateExports, contentKey)) {
6399
6651
  const contentExpression = buildContent(tag.get("body"));
6400
6652
  if (contentExpression) {
6401
- const contentProp = import_compiler32.types.objectProperty(
6402
- import_compiler32.types.identifier(contentKey),
6653
+ const contentProp = import_compiler33.types.objectProperty(
6654
+ import_compiler33.types.identifier(contentKey),
6403
6655
  contentExpression
6404
6656
  );
6405
6657
  seen.add(contentKey);
@@ -6411,8 +6663,8 @@ function translateAttrs(tag, templateExports, statements = [], contentKey = "con
6411
6663
  for (let i = attributes.length; i--; ) {
6412
6664
  const attr = attributes[i];
6413
6665
  const { value } = attr;
6414
- if (import_compiler32.types.isMarkoSpreadAttribute(attr)) {
6415
- properties.push(import_compiler32.types.spreadElement(value));
6666
+ if (import_compiler33.types.isMarkoSpreadAttribute(attr)) {
6667
+ properties.push(import_compiler33.types.spreadElement(value));
6416
6668
  } else if (!seen.has(attr.name) && usesExport(templateExports, attr.name)) {
6417
6669
  seen.add(attr.name);
6418
6670
  properties.push(toObjectProperty(attr.name, value));
@@ -6442,8 +6694,8 @@ function addDynamicAttrTagStatements(attrTags2, index, attrTagLookup, statements
6442
6694
  );
6443
6695
  if (attrTagMeta.repeated) {
6444
6696
  statements.push(
6445
- import_compiler32.types.expressionStatement(
6446
- import_compiler32.types.assignmentExpression(
6697
+ import_compiler33.types.expressionStatement(
6698
+ import_compiler33.types.assignmentExpression(
6447
6699
  "=",
6448
6700
  getAttrTagIdentifier(attrTagMeta),
6449
6701
  callRuntime(
@@ -6456,8 +6708,8 @@ function addDynamicAttrTagStatements(attrTags2, index, attrTagLookup, statements
6456
6708
  );
6457
6709
  } else {
6458
6710
  statements.push(
6459
- import_compiler32.types.expressionStatement(
6460
- import_compiler32.types.assignmentExpression(
6711
+ import_compiler33.types.expressionStatement(
6712
+ import_compiler33.types.assignmentExpression(
6461
6713
  "=",
6462
6714
  getAttrTagIdentifier(attrTagMeta),
6463
6715
  callRuntime(
@@ -6496,7 +6748,7 @@ function addDynamicAttrTagStatements(attrTags2, index, attrTagLookup, statements
6496
6748
  return index;
6497
6749
  }
6498
6750
  function propsToExpression(props) {
6499
- return props.length === 1 && import_compiler32.types.isSpreadElement(props[0]) ? props[0].argument : import_compiler32.types.objectExpression(props);
6751
+ return props.length === 1 && import_compiler33.types.isSpreadElement(props[0]) ? props[0].argument : import_compiler33.types.objectExpression(props);
6500
6752
  }
6501
6753
  function translateForAttrTag(attrTags2, index, attrTagLookup, statements, templateExports, contentKey) {
6502
6754
  const forTag = attrTags2[index];
@@ -6521,9 +6773,9 @@ function translateForAttrTag(attrTags2, index, attrTagLookup, statements, templa
6521
6773
  function translateIfAttrTag(attrTags2, index, attrTagLookup, statements, templateExports, contentKey) {
6522
6774
  const ifTag = attrTags2[index];
6523
6775
  const consequentStatements = [];
6524
- let ifStatement = import_compiler32.types.ifStatement(
6776
+ let ifStatement = import_compiler33.types.ifStatement(
6525
6777
  getConditionTestValue(ifTag),
6526
- import_compiler32.types.blockStatement(consequentStatements)
6778
+ import_compiler33.types.blockStatement(consequentStatements)
6527
6779
  );
6528
6780
  statements.push(ifStatement);
6529
6781
  addAllAttrTagsAsDynamic(
@@ -6550,14 +6802,14 @@ function translateIfAttrTag(attrTags2, index, attrTagLookup, statements, templat
6550
6802
  contentKey
6551
6803
  );
6552
6804
  if (testValue) {
6553
- ifStatement.alternate = ifStatement = import_compiler32.types.ifStatement(
6805
+ ifStatement.alternate = ifStatement = import_compiler33.types.ifStatement(
6554
6806
  testValue,
6555
- import_compiler32.types.blockStatement(alternateStatements)
6807
+ import_compiler33.types.blockStatement(alternateStatements)
6556
6808
  );
6557
6809
  nextIndex++;
6558
6810
  continue;
6559
6811
  } else {
6560
- ifStatement.alternate = import_compiler32.types.blockStatement(alternateStatements);
6812
+ ifStatement.alternate = import_compiler33.types.blockStatement(alternateStatements);
6561
6813
  break;
6562
6814
  }
6563
6815
  }
@@ -6623,9 +6875,9 @@ function buildContent(body) {
6623
6875
  }
6624
6876
  if (dynamicSerializeReason) {
6625
6877
  body.node.body.unshift(
6626
- import_compiler32.types.variableDeclaration("const", [
6627
- import_compiler32.types.variableDeclarator(
6628
- import_compiler32.types.identifier(
6878
+ import_compiler33.types.variableDeclaration("const", [
6879
+ import_compiler33.types.variableDeclarator(
6880
+ import_compiler33.types.identifier(
6629
6881
  getSharedUid(`scope${bodySection.id}_reason`, bodySection)
6630
6882
  ),
6631
6883
  callRuntime("_scope_reason")
@@ -6635,10 +6887,10 @@ function buildContent(body) {
6635
6887
  }
6636
6888
  return callRuntime(
6637
6889
  serialized ? "_content_resume" : "_content",
6638
- import_compiler32.types.stringLiteral(getResumeRegisterId(bodySection, "content")),
6639
- import_compiler32.types.arrowFunctionExpression(
6890
+ import_compiler33.types.stringLiteral(getResumeRegisterId(bodySection, "content")),
6891
+ import_compiler33.types.arrowFunctionExpression(
6640
6892
  body.node.params,
6641
- import_compiler32.types.blockStatement(body.node.body)
6893
+ import_compiler33.types.blockStatement(body.node.body)
6642
6894
  ),
6643
6895
  serialized ? getScopeIdIdentifier(
6644
6896
  getSection(
@@ -6649,17 +6901,17 @@ function buildContent(body) {
6649
6901
  ) : void 0
6650
6902
  );
6651
6903
  } else {
6652
- return import_compiler32.types.callExpression(
6653
- import_compiler32.types.identifier(bodySection.name),
6904
+ return import_compiler33.types.callExpression(
6905
+ import_compiler33.types.identifier(bodySection.name),
6654
6906
  bodySection.referencedLocalClosures ? [
6655
6907
  scopeIdentifier,
6656
- import_compiler32.types.objectExpression(
6908
+ import_compiler33.types.objectExpression(
6657
6909
  toArray(bodySection.referencedLocalClosures, (ref) => {
6658
6910
  const accessor = getScopeAccessor(ref);
6659
6911
  const isShorthand = accessor === ref.name;
6660
- return import_compiler32.types.objectProperty(
6912
+ return import_compiler33.types.objectProperty(
6661
6913
  toPropertyName(accessor),
6662
- import_compiler32.types.identifier(ref.name),
6914
+ import_compiler33.types.identifier(ref.name),
6663
6915
  false,
6664
6916
  isShorthand
6665
6917
  );
@@ -6744,8 +6996,8 @@ function knownTagTranslateHTML(tag, tagIdentifier, contentSection, propTree) {
6744
6996
  if (childScopeSerializeReason) {
6745
6997
  const peekScopeId = generateUidIdentifier(childScopeBinding?.name);
6746
6998
  tag.insertBefore(
6747
- import_compiler33.types.variableDeclaration("const", [
6748
- import_compiler33.types.variableDeclarator(peekScopeId, callRuntime("_peek_scope_id"))
6999
+ import_compiler34.types.variableDeclaration("const", [
7000
+ import_compiler34.types.variableDeclarator(peekScopeId, callRuntime("_peek_scope_id"))
6749
7001
  ])
6750
7002
  );
6751
7003
  setBindingSerializedValue(
@@ -6755,13 +7007,13 @@ function knownTagTranslateHTML(tag, tagIdentifier, contentSection, propTree) {
6755
7007
  );
6756
7008
  if (tagVar) {
6757
7009
  statements.push(
6758
- import_compiler33.types.expressionStatement(
7010
+ import_compiler34.types.expressionStatement(
6759
7011
  callRuntime(
6760
7012
  "_var",
6761
7013
  getScopeIdIdentifier(section),
6762
7014
  getScopeAccessorLiteral(tag.node.extra[kChildOffsetScopeBinding]),
6763
7015
  peekScopeId,
6764
- import_compiler33.types.stringLiteral(
7016
+ import_compiler34.types.stringLiteral(
6765
7017
  getResumeRegisterId(
6766
7018
  section,
6767
7019
  node.var.extra?.binding,
@@ -6790,9 +7042,9 @@ function knownTagTranslateHTML(tag, tagIdentifier, contentSection, propTree) {
6790
7042
  if (reason) {
6791
7043
  hasDynamicReasons ||= reason !== true && !reason.state;
6792
7044
  props.push(
6793
- import_compiler33.types.objectProperty(
7045
+ import_compiler34.types.objectProperty(
6794
7046
  withLeadingComment(
6795
- import_compiler33.types.numericLiteral(i),
7047
+ import_compiler34.types.numericLiteral(i),
6796
7048
  getDebugNames(group.reason)
6797
7049
  ),
6798
7050
  getSerializeGuard(section, reason, false)
@@ -6803,12 +7055,12 @@ function knownTagTranslateHTML(tag, tagIdentifier, contentSection, propTree) {
6803
7055
  }
6804
7056
  }
6805
7057
  if (props.length) {
6806
- childSerializeReasonExpr = hasDynamicReasons || hasSkippedReasons ? import_compiler33.types.objectExpression(props) : import_compiler33.types.numericLiteral(1);
7058
+ childSerializeReasonExpr = hasDynamicReasons || hasSkippedReasons ? import_compiler34.types.objectExpression(props) : import_compiler34.types.numericLiteral(1);
6807
7059
  }
6808
7060
  }
6809
7061
  if (childSerializeReasonExpr) {
6810
7062
  tag.insertBefore(
6811
- import_compiler33.types.expressionStatement(
7063
+ import_compiler34.types.expressionStatement(
6812
7064
  callRuntime("_set_serialize_reason", childSerializeReasonExpr)
6813
7065
  )
6814
7066
  );
@@ -6831,8 +7083,8 @@ function knownTagTranslateHTML(tag, tagIdentifier, contentSection, propTree) {
6831
7083
  const contentExpression = contentProp.value;
6832
7084
  contentProp.value = contentId = generateUidIdentifier("content");
6833
7085
  const [contentPath] = tag.insertBefore(
6834
- import_compiler33.types.variableDeclaration("const", [
6835
- import_compiler33.types.variableDeclarator(
7086
+ import_compiler34.types.variableDeclaration("const", [
7087
+ import_compiler34.types.variableDeclarator(
6836
7088
  contentId,
6837
7089
  // TODO: only register if needed (child template analysis)
6838
7090
  contentExpression
@@ -6846,13 +7098,13 @@ function knownTagTranslateHTML(tag, tagIdentifier, contentSection, propTree) {
6846
7098
  ...getArgs()
6847
7099
  );
6848
7100
  if (tagVar) {
6849
- translateVar(tag, import_compiler33.types.unaryExpression("void", import_compiler33.types.numericLiteral(0)), "let");
6850
- renderTagExpr = import_compiler33.types.assignmentExpression("=", tagVar, renderTagExpr);
7101
+ translateVar(tag, import_compiler34.types.unaryExpression("void", import_compiler34.types.numericLiteral(0)), "let");
7102
+ renderTagExpr = import_compiler34.types.assignmentExpression("=", tagVar, renderTagExpr);
6851
7103
  }
6852
7104
  statements.push(
6853
- import_compiler33.types.ifStatement(
7105
+ import_compiler34.types.ifStatement(
6854
7106
  tagIdentifier,
6855
- import_compiler33.types.expressionStatement(renderTagExpr),
7107
+ import_compiler34.types.expressionStatement(renderTagExpr),
6856
7108
  contentId && callStatement(contentId)
6857
7109
  )
6858
7110
  );
@@ -6883,15 +7135,15 @@ function knownTagTranslateDOM(tag, propTree, getBindingIdentifier, callSetup) {
6883
7135
  value
6884
7136
  ];
6885
7137
  if (!isOptimize()) {
6886
- changeArgs.push(import_compiler33.types.stringLiteral(varBinding.name));
7138
+ changeArgs.push(import_compiler34.types.stringLiteral(varBinding.name));
6887
7139
  }
6888
- return import_compiler33.types.callExpression(importRuntime("_var_change"), changeArgs);
7140
+ return import_compiler34.types.callExpression(importRuntime("_var_change"), changeArgs);
6889
7141
  };
6890
7142
  addStatement(
6891
7143
  "render",
6892
7144
  tagSection,
6893
7145
  void 0,
6894
- import_compiler33.types.expressionStatement(
7146
+ import_compiler34.types.expressionStatement(
6895
7147
  callRuntime(
6896
7148
  "_var",
6897
7149
  scopeIdentifier,
@@ -6936,7 +7188,7 @@ function analyzeParams(rootTagExtra, section, tag, propTree, rootAttrExprs) {
6936
7188
  dropReferences(getAllTagReferenceNodes(tag.node));
6937
7189
  return inputExpr;
6938
7190
  }
6939
- if (!propTree.props || tag.node.arguments?.some((node) => import_compiler33.types.isSpreadElement(node))) {
7191
+ if (!propTree.props || tag.node.arguments?.some((node) => import_compiler34.types.isSpreadElement(node))) {
6940
7192
  const extra = inputExpr.value = mergeReferences(
6941
7193
  section,
6942
7194
  tag.node,
@@ -7086,7 +7338,7 @@ function analyzeAttrs(rootTagExtra, section, tag, propTree, rootAttrExprs) {
7086
7338
  let spreadReferenceNodes;
7087
7339
  for (let i = attributes.length; i--; ) {
7088
7340
  const attr = attributes[i];
7089
- if (import_compiler33.types.isMarkoAttribute(attr)) {
7341
+ if (import_compiler34.types.isMarkoAttribute(attr)) {
7090
7342
  const templateExportAttr = propTree.props[attr.name];
7091
7343
  if (!templateExportAttr || seen.has(attr.name)) {
7092
7344
  dropReferences(attr.value);
@@ -7100,7 +7352,7 @@ function analyzeAttrs(rootTagExtra, section, tag, propTree, rootAttrExprs) {
7100
7352
  }
7101
7353
  if (spreadReferenceNodes) {
7102
7354
  spreadReferenceNodes.push(attr.value);
7103
- } else if (import_compiler33.types.isMarkoSpreadAttribute(attr)) {
7355
+ } else if (import_compiler34.types.isMarkoSpreadAttribute(attr)) {
7104
7356
  spreadReferenceNodes = [attr.value];
7105
7357
  } else {
7106
7358
  const attrValueExtra = attr.value.extra ??= {};
@@ -7132,7 +7384,7 @@ function analyzeAttrs(rootTagExtra, section, tag, propTree, rootAttrExprs) {
7132
7384
  return inputExpr;
7133
7385
  }
7134
7386
  function writeParamsToSignals(tag, propTree, importAlias, info) {
7135
- if (!propTree.props || tag.node.arguments?.some((node) => import_compiler33.types.isSpreadElement(node))) {
7387
+ if (!propTree.props || tag.node.arguments?.some((node) => import_compiler34.types.isSpreadElement(node))) {
7136
7388
  const referencedBindings = tag.node.extra?.referencedBindings;
7137
7389
  const tagInputIdentifier = info.getBindingIdentifier(
7138
7390
  propTree.binding,
@@ -7160,8 +7412,8 @@ function writeParamsToSignals(tag, propTree, importAlias, info) {
7160
7412
  "render",
7161
7413
  info.tagSection,
7162
7414
  referencedBindings,
7163
- import_compiler33.types.expressionStatement(
7164
- import_compiler33.types.callExpression(tagInputIdentifier, [import_compiler33.types.arrayExpression(renderArgs)])
7415
+ import_compiler34.types.expressionStatement(
7416
+ import_compiler34.types.callExpression(tagInputIdentifier, [import_compiler34.types.arrayExpression(renderArgs)])
7165
7417
  )
7166
7418
  );
7167
7419
  return;
@@ -7180,8 +7432,8 @@ function writeParamsToSignals(tag, propTree, importAlias, info) {
7180
7432
  info.tagSection,
7181
7433
  arg.extra?.referencedBindings,
7182
7434
  // TODO: pretty sure content needs to have the reference group of it's param defaults.
7183
- import_compiler33.types.expressionStatement(
7184
- import_compiler33.types.callExpression(argExportIdentifier, [
7435
+ import_compiler34.types.expressionStatement(
7436
+ import_compiler34.types.callExpression(argExportIdentifier, [
7185
7437
  createScopeReadExpression(
7186
7438
  info.tagSection,
7187
7439
  info.childScopeBinding
@@ -7241,7 +7493,7 @@ function writeAttrsToSignals(tag, propTree, importAlias, info) {
7241
7493
  } else {
7242
7494
  attrTagCallsForTag.set(
7243
7495
  attrTagName,
7244
- translatedProps = import_compiler33.types.parenthesizedExpression(
7496
+ translatedProps = import_compiler34.types.parenthesizedExpression(
7245
7497
  callRuntime("attrTag", translatedProps)
7246
7498
  )
7247
7499
  );
@@ -7254,8 +7506,8 @@ function writeAttrsToSignals(tag, propTree, importAlias, info) {
7254
7506
  "render",
7255
7507
  info.tagSection,
7256
7508
  referencedBindings,
7257
- import_compiler33.types.expressionStatement(
7258
- import_compiler33.types.callExpression(tagInputIdentifier, [
7509
+ import_compiler34.types.expressionStatement(
7510
+ import_compiler34.types.callExpression(tagInputIdentifier, [
7259
7511
  createScopeReadExpression(info.tagSection, info.childScopeBinding),
7260
7512
  translatedProps
7261
7513
  ])
@@ -7328,17 +7580,17 @@ function writeAttrsToSignals(tag, propTree, importAlias, info) {
7328
7580
  childAttrExports.binding,
7329
7581
  `${importAlias}_${attrTagMeta.name}`
7330
7582
  );
7331
- decls.push(import_compiler33.types.variableDeclarator(getAttrTagIdentifier(attrTagMeta)));
7583
+ decls.push(import_compiler34.types.variableDeclarator(getAttrTagIdentifier(attrTagMeta)));
7332
7584
  addStatement("render", info.tagSection, referencedBindings, [
7333
- import_compiler33.types.variableDeclaration("let", decls),
7585
+ import_compiler34.types.variableDeclaration("let", decls),
7334
7586
  ...statements
7335
7587
  ]);
7336
7588
  addStatement(
7337
7589
  "render",
7338
7590
  info.tagSection,
7339
7591
  referencedBindings,
7340
- import_compiler33.types.expressionStatement(
7341
- import_compiler33.types.callExpression(attrExportIdentifier, [
7592
+ import_compiler34.types.expressionStatement(
7593
+ import_compiler34.types.callExpression(attrExportIdentifier, [
7342
7594
  createScopeReadExpression(
7343
7595
  info.tagSection,
7344
7596
  info.childScopeBinding
@@ -7363,10 +7615,10 @@ function writeAttrsToSignals(tag, propTree, importAlias, info) {
7363
7615
  info.tagSection,
7364
7616
  void 0,
7365
7617
  // TODO: pretty sure content needs to have the reference group of it's param defaults.
7366
- import_compiler33.types.expressionStatement(
7367
- import_compiler33.types.callExpression(contentExportIdentifier, [
7618
+ import_compiler34.types.expressionStatement(
7619
+ import_compiler34.types.callExpression(contentExportIdentifier, [
7368
7620
  createScopeReadExpression(info.tagSection, info.childScopeBinding),
7369
- import_compiler33.types.callExpression(import_compiler33.types.identifier(bodySection.name), [scopeIdentifier])
7621
+ import_compiler34.types.callExpression(import_compiler34.types.identifier(bodySection.name), [scopeIdentifier])
7370
7622
  ])
7371
7623
  )
7372
7624
  );
@@ -7377,7 +7629,7 @@ function writeAttrsToSignals(tag, propTree, importAlias, info) {
7377
7629
  let spreadProps;
7378
7630
  for (let i = attributes.length; i--; ) {
7379
7631
  const attr = attributes[i];
7380
- if (import_compiler33.types.isMarkoAttribute(attr)) {
7632
+ if (import_compiler34.types.isMarkoAttribute(attr)) {
7381
7633
  const childAttrExports = propTree.props[attr.name];
7382
7634
  if (!childAttrExports || seen.has(attr.name)) continue;
7383
7635
  seen.add(attr.name);
@@ -7387,9 +7639,9 @@ function writeAttrsToSignals(tag, propTree, importAlias, info) {
7387
7639
  }
7388
7640
  staticAttrs.push(attr);
7389
7641
  } else if (spreadProps) {
7390
- spreadProps.push(import_compiler33.types.spreadElement(attr.value));
7642
+ spreadProps.push(import_compiler34.types.spreadElement(attr.value));
7391
7643
  } else {
7392
- spreadProps = [import_compiler33.types.spreadElement(attr.value)];
7644
+ spreadProps = [import_compiler34.types.spreadElement(attr.value)];
7393
7645
  }
7394
7646
  }
7395
7647
  for (const attr of staticAttrs.reverse()) {
@@ -7402,8 +7654,8 @@ function writeAttrsToSignals(tag, propTree, importAlias, info) {
7402
7654
  "render",
7403
7655
  info.tagSection,
7404
7656
  attr.value.extra?.referencedBindings,
7405
- import_compiler33.types.expressionStatement(
7406
- import_compiler33.types.callExpression(attrExportIdentifier, [
7657
+ import_compiler34.types.expressionStatement(
7658
+ import_compiler34.types.callExpression(attrExportIdentifier, [
7407
7659
  createScopeReadExpression(info.tagSection, info.childScopeBinding),
7408
7660
  attr.value
7409
7661
  ])
@@ -7414,14 +7666,14 @@ function writeAttrsToSignals(tag, propTree, importAlias, info) {
7414
7666
  for (const name2 of seen) missing.delete(name2);
7415
7667
  if (missing.size) {
7416
7668
  const referencedBindings = tag.node.extra?.referencedBindings;
7417
- let getMissingPropValue = buildUndefined2;
7669
+ let getMissingPropValue = buildUndefined3;
7418
7670
  if (spreadProps) {
7419
7671
  const spreadId = generateUidIdentifier(`${importAlias}_spread`);
7420
7672
  spreadProps.reverse();
7421
7673
  getMissingPropValue = (name2) => toMemberExpression(spreadId, name2);
7422
7674
  addStatement("render", info.tagSection, referencedBindings, [
7423
- import_compiler33.types.variableDeclaration("const", [
7424
- import_compiler33.types.variableDeclarator(spreadId, propsToExpression(spreadProps))
7675
+ import_compiler34.types.variableDeclaration("const", [
7676
+ import_compiler34.types.variableDeclarator(spreadId, propsToExpression(spreadProps))
7425
7677
  ])
7426
7678
  ]);
7427
7679
  }
@@ -7435,8 +7687,8 @@ function writeAttrsToSignals(tag, propTree, importAlias, info) {
7435
7687
  "render",
7436
7688
  info.tagSection,
7437
7689
  referencedBindings,
7438
- import_compiler33.types.expressionStatement(
7439
- import_compiler33.types.callExpression(attrExportIdentifier, [
7690
+ import_compiler34.types.expressionStatement(
7691
+ import_compiler34.types.callExpression(attrExportIdentifier, [
7440
7692
  createScopeReadExpression(info.tagSection, info.childScopeBinding),
7441
7693
  getMissingPropValue(name2)
7442
7694
  ])
@@ -7472,21 +7724,13 @@ function mapParamReasonToExpr(exprs, reason) {
7472
7724
  }
7473
7725
  }
7474
7726
  function callStatement(id, ...args) {
7475
- return import_compiler33.types.expressionStatement(callExpression(id, ...args));
7727
+ return import_compiler34.types.expressionStatement(callExpression(id, ...args));
7476
7728
  }
7477
7729
  function callExpression(id, ...args) {
7478
- return import_compiler33.types.callExpression(id, args.filter(Boolean));
7479
- }
7480
- function buildUndefined2() {
7481
- return import_compiler33.types.unaryExpression("void", import_compiler33.types.numericLiteral(0));
7730
+ return import_compiler34.types.callExpression(id, args.filter(Boolean));
7482
7731
  }
7483
-
7484
- // src/translator/util/with-previous-location.ts
7485
- function withPreviousLocation(newNode, originalNode) {
7486
- newNode.start = originalNode.start;
7487
- newNode.loc = originalNode.loc;
7488
- newNode.end = originalNode.end;
7489
- return newNode;
7732
+ function buildUndefined3() {
7733
+ return import_compiler34.types.unaryExpression("void", import_compiler34.types.numericLiteral(0));
7490
7734
  }
7491
7735
 
7492
7736
  // src/translator/util/references.ts
@@ -7599,7 +7843,7 @@ function trackParamsReferences(body, type, upstreamAlias) {
7599
7843
  void 0,
7600
7844
  i > 0 ? addNumericPropertiesUntil(void 0, i - 1) : void 0
7601
7845
  );
7602
- } else if (import_compiler34.types.isLVal(param)) {
7846
+ } else if (import_compiler35.types.isLVal(param)) {
7603
7847
  createBindingsAndTrackReferences(
7604
7848
  param,
7605
7849
  type,
@@ -7770,7 +8014,7 @@ function createBindingsAndTrackReferences(lVal, type, scope, section, upstreamAl
7770
8014
  if (hasRest) {
7771
8015
  excludeProperties = propsUtil.add(excludeProperties, key);
7772
8016
  }
7773
- if (import_compiler34.types.isLVal(prop.value)) {
8017
+ if (import_compiler35.types.isLVal(prop.value)) {
7774
8018
  createBindingsAndTrackReferences(
7775
8019
  prop.value,
7776
8020
  type,
@@ -7810,7 +8054,7 @@ function createBindingsAndTrackReferences(lVal, type, scope, section, upstreamAl
7810
8054
  property,
7811
8055
  excludeProperties
7812
8056
  );
7813
- } else if (import_compiler34.types.isLVal(element)) {
8057
+ } else if (import_compiler35.types.isLVal(element)) {
7814
8058
  createBindingsAndTrackReferences(
7815
8059
  element,
7816
8060
  type,
@@ -7825,23 +8069,6 @@ function createBindingsAndTrackReferences(lVal, type, scope, section, upstreamAl
7825
8069
  }
7826
8070
  break;
7827
8071
  }
7828
- case "AssignmentPattern":
7829
- createBindingsAndTrackReferences(
7830
- lVal.left,
7831
- type,
7832
- scope,
7833
- section,
7834
- upstreamAlias,
7835
- property,
7836
- void 0
7837
- );
7838
- if (lVal.left.extra?.binding) {
7839
- setBindingDownstream(
7840
- lVal.left.extra.binding,
7841
- lVal.right.extra ??= {}
7842
- );
7843
- }
7844
- break;
7845
8072
  }
7846
8073
  }
7847
8074
  function trackReference(referencePath, binding) {
@@ -7850,7 +8077,7 @@ function trackReference(referencePath, binding) {
7850
8077
  let propPath = binding.name;
7851
8078
  while (true) {
7852
8079
  const { parent } = root;
7853
- if (!import_compiler34.types.isMemberExpression(parent)) break;
8080
+ if (!import_compiler35.types.isMemberExpression(parent)) break;
7854
8081
  const prop = getMemberExpressionPropString(parent);
7855
8082
  if (prop === void 0) break;
7856
8083
  if (reference.upstreamAlias && reference.excludeProperties !== void 0 && !propsUtil.has(reference.excludeProperties, prop)) {
@@ -8381,9 +8608,9 @@ function getAllTagReferenceNodes(tag, referenceNodes = []) {
8381
8608
  function getScopeAccessorLiteral(binding, includeId) {
8382
8609
  const canonicalBinding = getCanonicalBinding(binding);
8383
8610
  if (isOptimize()) {
8384
- return import_compiler34.types.numericLiteral(canonicalBinding.id);
8611
+ return import_compiler35.types.numericLiteral(canonicalBinding.id);
8385
8612
  }
8386
- return import_compiler34.types.stringLiteral(
8613
+ return import_compiler35.types.stringLiteral(
8387
8614
  canonicalBinding.name + (includeId || canonicalBinding.type === 0 /* dom */ ? `/${canonicalBinding.id}` : "")
8388
8615
  );
8389
8616
  }
@@ -8431,7 +8658,7 @@ function getSectionInstancesAccessor(section) {
8431
8658
  }
8432
8659
  function getSectionInstancesAccessorLiteral(section) {
8433
8660
  const accessor = getSectionInstancesAccessor(section);
8434
- return accessor ? typeof accessor === "number" ? import_compiler34.types.numericLiteral(accessor) : import_compiler34.types.stringLiteral(accessor) : void 0;
8661
+ return accessor ? typeof accessor === "number" ? import_compiler35.types.numericLiteral(accessor) : import_compiler35.types.stringLiteral(accessor) : void 0;
8435
8662
  }
8436
8663
  function getReadReplacement(node) {
8437
8664
  const { extra } = node;
@@ -8449,18 +8676,18 @@ function getReadReplacement(node) {
8449
8676
  if (binding) {
8450
8677
  if (node.type === "Identifier") {
8451
8678
  if (binding.type === 6 /* hoist */) {
8452
- replacement = node.extra?.[kIsInvoked] ? import_compiler34.types.callExpression(getHoistFunctionIdentifier(binding), [
8679
+ replacement = node.extra?.[kIsInvoked] ? import_compiler35.types.callExpression(getHoistFunctionIdentifier(binding), [
8453
8680
  getScopeExpression(node.extra.section, binding.section)
8454
- ]) : import_compiler34.types.identifier(binding.name);
8681
+ ]) : import_compiler35.types.identifier(binding.name);
8455
8682
  } else if (binding.name !== node.name) {
8456
8683
  node.name = binding.name;
8457
8684
  }
8458
8685
  } else {
8459
- replacement = import_compiler34.types.identifier(binding.name);
8686
+ replacement = import_compiler35.types.identifier(binding.name);
8460
8687
  }
8461
8688
  } else if (read) {
8462
8689
  replacement = toMemberExpression(
8463
- import_compiler34.types.identifier(read.binding.name),
8690
+ import_compiler35.types.identifier(read.binding.name),
8464
8691
  Array.isArray(read.props) ? read.props[0] : read.props
8465
8692
  );
8466
8693
  if (Array.isArray(read.props)) {
@@ -8673,7 +8900,7 @@ var await_default = {
8673
8900
  "The [`<await>` tag](https://markojs.com/docs/reference/core-tag#await) requires a [`value=` attribute](https://markojs.com/docs/reference/language#shorthand-value)."
8674
8901
  );
8675
8902
  }
8676
- if (node.attributes.length > 1 || !import_compiler35.types.isMarkoAttribute(valueAttr) || valueAttr.name !== "value") {
8903
+ if (node.attributes.length > 1 || !import_compiler36.types.isMarkoAttribute(valueAttr) || valueAttr.name !== "value") {
8677
8904
  throw tag.get("name").buildCodeFrameError(
8678
8905
  "The [`<await>` tag](https://markojs.com/docs/reference/core-tag#await) only supports the [`value=` attribute](https://markojs.com/docs/reference/language#shorthand-value)."
8679
8906
  );
@@ -8683,7 +8910,7 @@ var await_default = {
8683
8910
  "The [`<await>` tag](https://markojs.com/docs/reference/core-tag#await) requires [content](https://markojs.com/docs/reference/language#tag-content)."
8684
8911
  );
8685
8912
  }
8686
- if (node.body.params.length && (node.body.params.length > 1 || import_compiler35.types.isSpreadElement(node.body.params[0]))) {
8913
+ if (node.body.params.length && (node.body.params.length > 1 || import_compiler36.types.isSpreadElement(node.body.params[0]))) {
8687
8914
  throw tag.get("name").buildCodeFrameError(
8688
8915
  "The [`<await>` tag](https://markojs.com/docs/reference/core-tag#await) only supports a single parameter."
8689
8916
  );
@@ -8720,13 +8947,13 @@ var await_default = {
8720
8947
  flushInto(tag);
8721
8948
  writeHTMLResumeStatements(tagBody);
8722
8949
  tag.replaceWith(
8723
- import_compiler35.types.expressionStatement(
8950
+ import_compiler36.types.expressionStatement(
8724
8951
  callRuntime(
8725
8952
  "_await",
8726
8953
  getScopeIdIdentifier(section),
8727
8954
  getScopeAccessorLiteral(nodeRef),
8728
8955
  valueAttr.value,
8729
- import_compiler35.types.arrowFunctionExpression(
8956
+ import_compiler36.types.arrowFunctionExpression(
8730
8957
  node.body.params,
8731
8958
  toFirstExpressionOrBlock(node.body.body)
8732
8959
  ),
@@ -8760,7 +8987,7 @@ var await_default = {
8760
8987
  return callRuntime(
8761
8988
  "_await",
8762
8989
  getScopeAccessorLiteral(nodeRef),
8763
- import_compiler35.types.identifier(bodySection.name)
8990
+ import_compiler36.types.identifier(bodySection.name)
8764
8991
  );
8765
8992
  };
8766
8993
  addValue(
@@ -8784,7 +9011,7 @@ var await_default = {
8784
9011
  };
8785
9012
 
8786
9013
  // src/translator/core/client.ts
8787
- var import_compiler36 = require("@marko/compiler");
9014
+ var import_compiler37 = require("@marko/compiler");
8788
9015
  var import_babel_utils27 = require("@marko/compiler/babel-utils");
8789
9016
  var client_default = {
8790
9017
  parse(tag) {
@@ -8796,10 +9023,10 @@ var client_default = {
8796
9023
  const code = rawValue.replace(/^client\s*/, "");
8797
9024
  const start = node.start + (rawValue.length - code.length);
8798
9025
  let body = (0, import_babel_utils27.parseStatements)(file, code, start, start + code.length);
8799
- if (body.length === 1 && import_compiler36.types.isBlockStatement(body[0])) {
9026
+ if (body.length === 1 && import_compiler37.types.isBlockStatement(body[0])) {
8800
9027
  body = body[0].body;
8801
9028
  }
8802
- tag.replaceWith(import_compiler36.types.markoScriptlet(body, true, "client"));
9029
+ tag.replaceWith(import_compiler37.types.markoScriptlet(body, true, "client"));
8803
9030
  },
8804
9031
  parseOptions: {
8805
9032
  statement: true,
@@ -8815,7 +9042,7 @@ var client_default = {
8815
9042
  };
8816
9043
 
8817
9044
  // src/translator/core/const.ts
8818
- var import_compiler37 = require("@marko/compiler");
9045
+ var import_compiler38 = require("@marko/compiler");
8819
9046
  var import_babel_utils28 = require("@marko/compiler/babel-utils");
8820
9047
  var const_default = {
8821
9048
  analyze(tag) {
@@ -8834,13 +9061,13 @@ var const_default = {
8834
9061
  "The [`<const>` tag](https://markojs.com/docs/reference/core-tag#const) requires a [`value=` attribute](https://markojs.com/docs/reference/language#shorthand-value)."
8835
9062
  );
8836
9063
  }
8837
- if (node.attributes.length > 1 || !import_compiler37.types.isMarkoAttribute(valueAttr) || !valueAttr.default && valueAttr.name !== "value") {
9064
+ if (node.attributes.length > 1 || !import_compiler38.types.isMarkoAttribute(valueAttr) || !valueAttr.default && valueAttr.name !== "value") {
8838
9065
  throw tag.get("name").buildCodeFrameError(
8839
9066
  "The [`<const>` tag](https://markojs.com/docs/reference/core-tag#const) only supports the [`value=` attribute](https://markojs.com/docs/reference/language#shorthand-value)."
8840
9067
  );
8841
9068
  }
8842
9069
  const valueExtra = evaluate(valueAttr.value);
8843
- const upstreamAlias = import_compiler37.types.isIdentifier(valueAttr.value) ? tag.scope.getBinding(valueAttr.value.name)?.identifier.extra?.binding : void 0;
9070
+ const upstreamAlias = import_compiler38.types.isIdentifier(valueAttr.value) ? tag.scope.getBinding(valueAttr.value.name)?.identifier.extra?.binding : void 0;
8844
9071
  if (upstreamAlias) {
8845
9072
  valueExtra.pruned = true;
8846
9073
  }
@@ -8890,7 +9117,7 @@ var const_default = {
8890
9117
  };
8891
9118
 
8892
9119
  // src/translator/core/debug.ts
8893
- var import_compiler38 = require("@marko/compiler");
9120
+ var import_compiler39 = require("@marko/compiler");
8894
9121
  var import_babel_utils29 = require("@marko/compiler/babel-utils");
8895
9122
  var debug_default = {
8896
9123
  analyze(tag) {
@@ -8899,7 +9126,7 @@ var debug_default = {
8899
9126
  (0, import_babel_utils29.assertNoArgs)(tag);
8900
9127
  (0, import_babel_utils29.assertNoParams)(tag);
8901
9128
  assertNoBodyContent(tag);
8902
- if (tag.node.attributes.length > 1 || tag.node.attributes.length === 1 && (!import_compiler38.types.isMarkoAttribute(valueAttr) || !valueAttr.default && valueAttr.name !== "value")) {
9129
+ if (tag.node.attributes.length > 1 || tag.node.attributes.length === 1 && (!import_compiler39.types.isMarkoAttribute(valueAttr) || !valueAttr.default && valueAttr.name !== "value")) {
8903
9130
  throw tag.get("name").buildCodeFrameError(
8904
9131
  "The [`<debug>` tag](https://markojs.com/docs/reference/core-tag#debug) only supports the [`value=` attribute](https://markojs.com/docs/reference/language#shorthand-value)."
8905
9132
  );
@@ -8910,7 +9137,7 @@ var debug_default = {
8910
9137
  const section = getSection(tag);
8911
9138
  const [valueAttr] = tag.node.attributes;
8912
9139
  const referencedBindings = valueAttr?.value.extra?.referencedBindings;
8913
- const statement = withPreviousLocation(import_compiler38.types.debuggerStatement(), tag.node);
9140
+ const statement = withPreviousLocation(import_compiler39.types.debuggerStatement(), tag.node);
8914
9141
  if (isOutputHTML()) {
8915
9142
  tag.insertBefore(statement);
8916
9143
  } else {
@@ -8933,7 +9160,7 @@ var debug_default = {
8933
9160
  };
8934
9161
 
8935
9162
  // src/translator/core/define.ts
8936
- var import_compiler39 = require("@marko/compiler");
9163
+ var import_compiler40 = require("@marko/compiler");
8937
9164
  var import_babel_utils30 = require("@marko/compiler/babel-utils");
8938
9165
  var define_default = {
8939
9166
  analyze(tag) {
@@ -8953,7 +9180,7 @@ var define_default = {
8953
9180
  trackParamsReferences(tagBody, 3 /* param */);
8954
9181
  setTagDownstream(tag, varBinding);
8955
9182
  if (bodySection) {
8956
- if (import_compiler39.types.isIdentifier(tag.node.var)) {
9183
+ if (import_compiler40.types.isIdentifier(tag.node.var)) {
8957
9184
  const babelBinding = tag.scope.getBinding(tag.node.var.name);
8958
9185
  let allDirectReferences = true;
8959
9186
  for (const ref of babelBinding.referencePaths) {
@@ -8997,7 +9224,7 @@ var define_default = {
8997
9224
  tag.insertBefore(translatedAttrs.statements);
8998
9225
  translateVar(tag, propsToExpression(translatedAttrs.properties));
8999
9226
  } else {
9000
- if (import_compiler39.types.isIdentifier(node.var)) {
9227
+ if (import_compiler40.types.isIdentifier(node.var)) {
9001
9228
  const babelBinding = tag.scope.getBinding(node.var.name);
9002
9229
  let hasDirectReferences = false;
9003
9230
  let allDirectReferences = true;
@@ -9052,7 +9279,7 @@ var define_default = {
9052
9279
  };
9053
9280
 
9054
9281
  // src/translator/core/effect.ts
9055
- var import_compiler40 = require("@marko/compiler");
9282
+ var import_compiler41 = require("@marko/compiler");
9056
9283
  var import_babel_utils31 = require("@marko/compiler/babel-utils");
9057
9284
  var effect_default = {
9058
9285
  migrate: [
@@ -9068,8 +9295,8 @@ var effect_default = {
9068
9295
  fix() {
9069
9296
  const { node } = tag;
9070
9297
  tag.replaceWith(
9071
- import_compiler40.types.markoTag(
9072
- withPreviousLocation(import_compiler40.types.stringLiteral("script"), node.name),
9298
+ import_compiler41.types.markoTag(
9299
+ withPreviousLocation(import_compiler41.types.stringLiteral("script"), node.name),
9073
9300
  node.attributes,
9074
9301
  node.body,
9075
9302
  node.arguments,
@@ -9106,20 +9333,20 @@ var export_default = {
9106
9333
  };
9107
9334
 
9108
9335
  // src/translator/core/html-comment.ts
9109
- var import_compiler42 = require("@marko/compiler");
9336
+ var import_compiler43 = require("@marko/compiler");
9110
9337
  var import_babel_utils33 = require("@marko/compiler/babel-utils");
9111
9338
 
9112
9339
  // src/translator/util/body-to-text-literal.ts
9113
- var import_compiler41 = require("@marko/compiler");
9340
+ var import_compiler42 = require("@marko/compiler");
9114
9341
  function bodyToTextLiteral(body) {
9115
9342
  const templateQuasis = [];
9116
9343
  const templateExpressions = [];
9117
9344
  let currentQuasi = "";
9118
9345
  let placeholderExtra;
9119
9346
  for (const child of body.body) {
9120
- if (import_compiler41.types.isMarkoText(child)) {
9347
+ if (import_compiler42.types.isMarkoText(child)) {
9121
9348
  currentQuasi += child.value;
9122
- } else if (import_compiler41.types.isMarkoPlaceholder(child)) {
9349
+ } else if (import_compiler42.types.isMarkoPlaceholder(child)) {
9123
9350
  placeholderExtra ||= child.value.extra;
9124
9351
  templateQuasis.push(templateElement(currentQuasi, false));
9125
9352
  templateExpressions.push(child.value);
@@ -9128,14 +9355,14 @@ function bodyToTextLiteral(body) {
9128
9355
  }
9129
9356
  if (templateExpressions.length) {
9130
9357
  templateQuasis.push(templateElement(currentQuasi, true));
9131
- const literal = import_compiler41.types.templateLiteral(templateQuasis, templateExpressions);
9358
+ const literal = import_compiler42.types.templateLiteral(templateQuasis, templateExpressions);
9132
9359
  literal.extra = placeholderExtra;
9133
9360
  return literal;
9134
9361
  }
9135
- return import_compiler41.types.stringLiteral(currentQuasi);
9362
+ return import_compiler42.types.stringLiteral(currentQuasi);
9136
9363
  }
9137
9364
  function templateElement(value, tail) {
9138
- return import_compiler41.types.templateElement(
9365
+ return import_compiler42.types.templateElement(
9139
9366
  {
9140
9367
  raw: value.replace(/`/g, "\\`"),
9141
9368
  cooked: value
@@ -9156,7 +9383,7 @@ var html_comment_default = {
9156
9383
  let needsBinding = false;
9157
9384
  let needsGetter = false;
9158
9385
  if (tagVar) {
9159
- if (!import_compiler42.types.isIdentifier(tagVar)) {
9386
+ if (!import_compiler43.types.isIdentifier(tagVar)) {
9160
9387
  throw tag.get("var").buildCodeFrameError(
9161
9388
  "The [`<html-comment>` tag](https://markojs.com/docs/reference/core-tag#html-comment) tag variable cannot be destructured."
9162
9389
  );
@@ -9208,7 +9435,7 @@ var html_comment_default = {
9208
9435
  callRuntime(
9209
9436
  "_el",
9210
9437
  getterId && getScopeIdIdentifier(getSection(tag)),
9211
- getterId && import_compiler42.types.stringLiteral(getterId)
9438
+ getterId && import_compiler43.types.stringLiteral(getterId)
9212
9439
  )
9213
9440
  );
9214
9441
  } else {
@@ -9218,12 +9445,12 @@ var html_comment_default = {
9218
9445
  if (getterId) {
9219
9446
  getterFnIdentifier = generateUidIdentifier(`get_${varName}`);
9220
9447
  (0, import_babel_utils33.getProgram)().node.body.push(
9221
- import_compiler42.types.variableDeclaration("const", [
9222
- import_compiler42.types.variableDeclarator(
9448
+ import_compiler43.types.variableDeclaration("const", [
9449
+ import_compiler43.types.variableDeclarator(
9223
9450
  getterFnIdentifier,
9224
9451
  callRuntime(
9225
9452
  "_el",
9226
- import_compiler42.types.stringLiteral(getterId),
9453
+ import_compiler43.types.stringLiteral(getterId),
9227
9454
  getScopeAccessorLiteral(nodeBinding)
9228
9455
  )
9229
9456
  )
@@ -9234,13 +9461,13 @@ var html_comment_default = {
9234
9461
  const referenceSection = getSection(reference);
9235
9462
  if (isInvokedFunction(reference)) {
9236
9463
  reference.parentPath.replaceWith(
9237
- import_compiler42.types.expressionStatement(
9464
+ import_compiler43.types.expressionStatement(
9238
9465
  createScopeReadExpression(referenceSection, nodeBinding)
9239
9466
  )
9240
9467
  );
9241
9468
  } else if (getterFnIdentifier) {
9242
9469
  reference.replaceWith(
9243
- import_compiler42.types.callExpression(getterFnIdentifier, [
9470
+ import_compiler43.types.callExpression(getterFnIdentifier, [
9244
9471
  getScopeExpression(referenceSection, getSection(tag))
9245
9472
  ])
9246
9473
  );
@@ -9261,25 +9488,25 @@ var html_comment_default = {
9261
9488
  const write = writeTo(tag);
9262
9489
  if (isOutputHTML()) {
9263
9490
  for (const child of tag.node.body.body) {
9264
- if (import_compiler42.types.isMarkoText(child)) {
9491
+ if (import_compiler43.types.isMarkoText(child)) {
9265
9492
  write`${child.value}`;
9266
- } else if (import_compiler42.types.isMarkoPlaceholder(child)) {
9493
+ } else if (import_compiler43.types.isMarkoPlaceholder(child)) {
9267
9494
  write`${callRuntime("_escape", child.value)}`;
9268
9495
  }
9269
9496
  }
9270
9497
  } else {
9271
9498
  const textLiteral = bodyToTextLiteral(tag.node.body);
9272
- if (import_compiler42.types.isStringLiteral(textLiteral)) {
9499
+ if (import_compiler43.types.isStringLiteral(textLiteral)) {
9273
9500
  write`${textLiteral}`;
9274
9501
  } else {
9275
9502
  addStatement(
9276
9503
  "render",
9277
9504
  getSection(tag),
9278
9505
  tagExtra.referencedBindings,
9279
- import_compiler42.types.expressionStatement(
9506
+ import_compiler43.types.expressionStatement(
9280
9507
  callRuntime(
9281
9508
  "_text",
9282
- import_compiler42.types.memberExpression(
9509
+ import_compiler43.types.memberExpression(
9283
9510
  scopeIdentifier,
9284
9511
  getScopeAccessorLiteral(nodeBinding),
9285
9512
  true
@@ -9315,7 +9542,7 @@ var html_comment_default = {
9315
9542
  };
9316
9543
 
9317
9544
  // src/translator/core/html-script.ts
9318
- var import_compiler43 = require("@marko/compiler");
9545
+ var import_compiler44 = require("@marko/compiler");
9319
9546
  var import_babel_utils34 = require("@marko/compiler/babel-utils");
9320
9547
  var kNodeBinding2 = Symbol("script tag node binding");
9321
9548
  var kGetterId3 = Symbol("node getter id");
@@ -9324,7 +9551,7 @@ var html_script_default = {
9324
9551
  (0, import_babel_utils34.assertNoArgs)(tag);
9325
9552
  (0, import_babel_utils34.assertNoParams)(tag);
9326
9553
  const { node } = tag;
9327
- if (node.var && !import_compiler43.types.isIdentifier(node.var)) {
9554
+ if (node.var && !import_compiler44.types.isIdentifier(node.var)) {
9328
9555
  throw tag.get("var").buildCodeFrameError(
9329
9556
  "Tag variables on native elements cannot be destructured."
9330
9557
  );
@@ -9338,7 +9565,7 @@ var html_script_default = {
9338
9565
  for (let i = attributes.length; i--; ) {
9339
9566
  const attr = attributes[i];
9340
9567
  const valueExtra = attr.value.extra ??= {};
9341
- if (import_compiler43.types.isMarkoAttribute(attr)) {
9568
+ if (import_compiler44.types.isMarkoAttribute(attr)) {
9342
9569
  if (seen[attr.name]) {
9343
9570
  dropReferences(attr.value);
9344
9571
  continue;
@@ -9350,14 +9577,14 @@ var html_script_default = {
9350
9577
  } else if (!evaluate(attr.value).confident) {
9351
9578
  hasDynamicAttributes = true;
9352
9579
  }
9353
- } else if (import_compiler43.types.isMarkoSpreadAttribute(attr)) {
9580
+ } else if (import_compiler44.types.isMarkoSpreadAttribute(attr)) {
9354
9581
  valueExtra.isEffect = true;
9355
9582
  hasEventHandlers = true;
9356
9583
  hasDynamicAttributes = true;
9357
9584
  }
9358
9585
  if (spreadReferenceNodes) {
9359
9586
  spreadReferenceNodes.push(attr.value);
9360
- } else if (import_compiler43.types.isMarkoSpreadAttribute(attr)) {
9587
+ } else if (import_compiler44.types.isMarkoSpreadAttribute(attr)) {
9361
9588
  spreadReferenceNodes = [attr.value];
9362
9589
  } else {
9363
9590
  exprExtras = push(exprExtras, valueExtra);
@@ -9366,10 +9593,10 @@ var html_script_default = {
9366
9593
  const bodyPlaceholderNodes = [];
9367
9594
  let hasBodyPlaceholders = false;
9368
9595
  for (const child of tag.node.body.body) {
9369
- if (import_compiler43.types.isMarkoPlaceholder(child)) {
9596
+ if (import_compiler44.types.isMarkoPlaceholder(child)) {
9370
9597
  bodyPlaceholderNodes.push(child.value);
9371
9598
  hasBodyPlaceholders = true;
9372
- } else if (!import_compiler43.types.isMarkoText(child)) {
9599
+ } else if (!import_compiler44.types.isMarkoText(child)) {
9373
9600
  throw tag.hub.buildError(
9374
9601
  child,
9375
9602
  "Invalid child. Only text is allowed inside an html-script."
@@ -9438,7 +9665,7 @@ var html_script_default = {
9438
9665
  callRuntime(
9439
9666
  "_el",
9440
9667
  getterId && getScopeIdIdentifier(tagSection),
9441
- getterId && import_compiler43.types.stringLiteral(getterId)
9668
+ getterId && import_compiler44.types.stringLiteral(getterId)
9442
9669
  )
9443
9670
  );
9444
9671
  } else {
@@ -9448,12 +9675,12 @@ var html_script_default = {
9448
9675
  if (getterId) {
9449
9676
  getterFnIdentifier = generateUidIdentifier(`get_${varName}`);
9450
9677
  (0, import_babel_utils34.getProgram)().node.body.push(
9451
- import_compiler43.types.variableDeclaration("const", [
9452
- import_compiler43.types.variableDeclarator(
9678
+ import_compiler44.types.variableDeclaration("const", [
9679
+ import_compiler44.types.variableDeclarator(
9453
9680
  getterFnIdentifier,
9454
9681
  callRuntime(
9455
9682
  "_el",
9456
- import_compiler43.types.stringLiteral(getterId),
9683
+ import_compiler44.types.stringLiteral(getterId),
9457
9684
  getScopeAccessorLiteral(nodeBinding)
9458
9685
  )
9459
9686
  )
@@ -9464,13 +9691,13 @@ var html_script_default = {
9464
9691
  const referenceSection = getSection(reference);
9465
9692
  if (isInvokedFunction(reference)) {
9466
9693
  reference.parentPath.replaceWith(
9467
- import_compiler43.types.expressionStatement(
9694
+ import_compiler44.types.expressionStatement(
9468
9695
  createScopeReadExpression(referenceSection, nodeBinding)
9469
9696
  )
9470
9697
  );
9471
9698
  } else if (getterFnIdentifier) {
9472
9699
  reference.replaceWith(
9473
- import_compiler43.types.callExpression(getterFnIdentifier, [
9700
+ import_compiler44.types.callExpression(getterFnIdentifier, [
9474
9701
  getScopeExpression(referenceSection, getSection(tag))
9475
9702
  ])
9476
9703
  );
@@ -9502,10 +9729,10 @@ var html_script_default = {
9502
9729
  "render",
9503
9730
  tagSection,
9504
9731
  valueReferences,
9505
- import_compiler43.types.expressionStatement(
9732
+ import_compiler44.types.expressionStatement(
9506
9733
  callRuntime(
9507
9734
  helper,
9508
- import_compiler43.types.memberExpression(scopeIdentifier, visitAccessor, true),
9735
+ import_compiler44.types.memberExpression(scopeIdentifier, visitAccessor, true),
9509
9736
  value
9510
9737
  )
9511
9738
  )
@@ -9520,18 +9747,18 @@ var html_script_default = {
9520
9747
  if (isEventHandler(name2)) {
9521
9748
  addHTMLEffectCall(tagSection, valueReferences);
9522
9749
  } else {
9523
- write`${callRuntime("_attr", import_compiler43.types.stringLiteral(name2), value)}`;
9750
+ write`${callRuntime("_attr", import_compiler44.types.stringLiteral(name2), value)}`;
9524
9751
  }
9525
9752
  } else if (isEventHandler(name2)) {
9526
9753
  addStatement(
9527
9754
  "effect",
9528
9755
  tagSection,
9529
9756
  valueReferences,
9530
- import_compiler43.types.expressionStatement(
9757
+ import_compiler44.types.expressionStatement(
9531
9758
  callRuntime(
9532
9759
  "_on",
9533
- import_compiler43.types.memberExpression(scopeIdentifier, visitAccessor, true),
9534
- import_compiler43.types.stringLiteral(getEventHandlerName(name2)),
9760
+ import_compiler44.types.memberExpression(scopeIdentifier, visitAccessor, true),
9761
+ import_compiler44.types.stringLiteral(getEventHandlerName(name2)),
9535
9762
  value
9536
9763
  )
9537
9764
  )
@@ -9541,11 +9768,11 @@ var html_script_default = {
9541
9768
  "render",
9542
9769
  tagSection,
9543
9770
  valueReferences,
9544
- import_compiler43.types.expressionStatement(
9771
+ import_compiler44.types.expressionStatement(
9545
9772
  callRuntime(
9546
9773
  "_attr",
9547
- import_compiler43.types.memberExpression(scopeIdentifier, visitAccessor, true),
9548
- import_compiler43.types.stringLiteral(name2),
9774
+ import_compiler44.types.memberExpression(scopeIdentifier, visitAccessor, true),
9775
+ import_compiler44.types.stringLiteral(name2),
9549
9776
  value
9550
9777
  )
9551
9778
  )
@@ -9558,9 +9785,9 @@ var html_script_default = {
9558
9785
  if (isHTML) {
9559
9786
  addHTMLEffectCall(tagSection, tagExtra.referencedBindings);
9560
9787
  if (skipExpression) {
9561
- write`${callRuntime("_attrs_partial", spreadExpression, skipExpression, visitAccessor, getScopeIdIdentifier(tagSection), import_compiler43.types.stringLiteral("script"))}`;
9788
+ write`${callRuntime("_attrs_partial", spreadExpression, skipExpression, visitAccessor, getScopeIdIdentifier(tagSection), import_compiler44.types.stringLiteral("script"))}`;
9562
9789
  } else {
9563
- write`${callRuntime("_attrs", spreadExpression, visitAccessor, getScopeIdIdentifier(tagSection), import_compiler43.types.stringLiteral("script"))}`;
9790
+ write`${callRuntime("_attrs", spreadExpression, visitAccessor, getScopeIdIdentifier(tagSection), import_compiler44.types.stringLiteral("script"))}`;
9564
9791
  }
9565
9792
  } else {
9566
9793
  if (skipExpression) {
@@ -9568,7 +9795,7 @@ var html_script_default = {
9568
9795
  "render",
9569
9796
  tagSection,
9570
9797
  tagExtra.referencedBindings,
9571
- import_compiler43.types.expressionStatement(
9798
+ import_compiler44.types.expressionStatement(
9572
9799
  callRuntime(
9573
9800
  "_attrs_partial",
9574
9801
  scopeIdentifier,
@@ -9583,7 +9810,7 @@ var html_script_default = {
9583
9810
  "render",
9584
9811
  tagSection,
9585
9812
  tagExtra.referencedBindings,
9586
- import_compiler43.types.expressionStatement(
9813
+ import_compiler44.types.expressionStatement(
9587
9814
  callRuntime(
9588
9815
  "_attrs",
9589
9816
  scopeIdentifier,
@@ -9597,7 +9824,7 @@ var html_script_default = {
9597
9824
  "effect",
9598
9825
  tagSection,
9599
9826
  tagExtra.referencedBindings,
9600
- import_compiler43.types.expressionStatement(
9827
+ import_compiler44.types.expressionStatement(
9601
9828
  callRuntime("_attrs_script", scopeIdentifier, visitAccessor)
9602
9829
  ),
9603
9830
  false
@@ -9614,25 +9841,25 @@ var html_script_default = {
9614
9841
  const write = writeTo(tag);
9615
9842
  if (isOutputHTML()) {
9616
9843
  for (const child of tag.node.body.body) {
9617
- if (import_compiler43.types.isMarkoText(child)) {
9844
+ if (import_compiler44.types.isMarkoText(child)) {
9618
9845
  write`${child.value}`;
9619
- } else if (import_compiler43.types.isMarkoPlaceholder(child)) {
9846
+ } else if (import_compiler44.types.isMarkoPlaceholder(child)) {
9620
9847
  write`${callRuntime("_escape_script", child.value)}`;
9621
9848
  }
9622
9849
  }
9623
9850
  } else {
9624
9851
  const textLiteral = bodyToTextLiteral(tag.node.body);
9625
- if (import_compiler43.types.isStringLiteral(textLiteral)) {
9852
+ if (import_compiler44.types.isStringLiteral(textLiteral)) {
9626
9853
  write`${textLiteral.value}`;
9627
9854
  } else {
9628
9855
  addStatement(
9629
9856
  "render",
9630
9857
  getSection(tag),
9631
9858
  textLiteral.extra?.referencedBindings,
9632
- import_compiler43.types.expressionStatement(
9859
+ import_compiler44.types.expressionStatement(
9633
9860
  callRuntime(
9634
9861
  "_text_content",
9635
- import_compiler43.types.memberExpression(
9862
+ import_compiler44.types.memberExpression(
9636
9863
  scopeIdentifier,
9637
9864
  getScopeAccessorLiteral(nodeBinding),
9638
9865
  true
@@ -9687,11 +9914,11 @@ function getUsedAttrs2(tag) {
9687
9914
  for (let i = attributes.length; i--; ) {
9688
9915
  const attr = attributes[i];
9689
9916
  const { value } = attr;
9690
- if (import_compiler43.types.isMarkoSpreadAttribute(attr)) {
9917
+ if (import_compiler44.types.isMarkoSpreadAttribute(attr)) {
9691
9918
  if (!spreadProps) {
9692
9919
  spreadProps = [];
9693
9920
  }
9694
- spreadProps.push(import_compiler43.types.spreadElement(value));
9921
+ spreadProps.push(import_compiler44.types.spreadElement(value));
9695
9922
  } else if (!seen[attr.name]) {
9696
9923
  seen[attr.name] = attr;
9697
9924
  if (spreadProps) {
@@ -9705,10 +9932,10 @@ function getUsedAttrs2(tag) {
9705
9932
  if (spreadProps) {
9706
9933
  spreadProps.reverse();
9707
9934
  for (const { name: name2 } of staticAttrs) {
9708
- (skipProps ||= []).push(toObjectProperty(name2, import_compiler43.types.numericLiteral(1)));
9935
+ (skipProps ||= []).push(toObjectProperty(name2, import_compiler44.types.numericLiteral(1)));
9709
9936
  }
9710
9937
  if (skipProps) {
9711
- skipExpression = import_compiler43.types.objectExpression(skipProps);
9938
+ skipExpression = import_compiler44.types.objectExpression(skipProps);
9712
9939
  }
9713
9940
  spreadExpression = propsToExpression(spreadProps);
9714
9941
  }
@@ -9720,7 +9947,7 @@ function getUsedAttrs2(tag) {
9720
9947
  }
9721
9948
 
9722
9949
  // src/translator/core/html-style.ts
9723
- var import_compiler44 = require("@marko/compiler");
9950
+ var import_compiler45 = require("@marko/compiler");
9724
9951
  var import_babel_utils35 = require("@marko/compiler/babel-utils");
9725
9952
  var kNodeBinding3 = Symbol("style tag node binding");
9726
9953
  var kGetterId4 = Symbol("node getter id");
@@ -9729,7 +9956,7 @@ var html_style_default = {
9729
9956
  (0, import_babel_utils35.assertNoArgs)(tag);
9730
9957
  (0, import_babel_utils35.assertNoParams)(tag);
9731
9958
  const { node } = tag;
9732
- if (node.var && !import_compiler44.types.isIdentifier(node.var)) {
9959
+ if (node.var && !import_compiler45.types.isIdentifier(node.var)) {
9733
9960
  throw tag.get("var").buildCodeFrameError(
9734
9961
  "Tag variables on native elements cannot be destructured."
9735
9962
  );
@@ -9743,7 +9970,7 @@ var html_style_default = {
9743
9970
  for (let i = attributes.length; i--; ) {
9744
9971
  const attr = attributes[i];
9745
9972
  const valueExtra = attr.value.extra ??= {};
9746
- if (import_compiler44.types.isMarkoAttribute(attr)) {
9973
+ if (import_compiler45.types.isMarkoAttribute(attr)) {
9747
9974
  if (seen[attr.name]) {
9748
9975
  dropReferences(attr.value);
9749
9976
  continue;
@@ -9755,14 +9982,14 @@ var html_style_default = {
9755
9982
  } else if (!evaluate(attr.value).confident) {
9756
9983
  hasDynamicAttributes = true;
9757
9984
  }
9758
- } else if (import_compiler44.types.isMarkoSpreadAttribute(attr)) {
9985
+ } else if (import_compiler45.types.isMarkoSpreadAttribute(attr)) {
9759
9986
  valueExtra.isEffect = true;
9760
9987
  hasEventHandlers = true;
9761
9988
  hasDynamicAttributes = true;
9762
9989
  }
9763
9990
  if (spreadReferenceNodes) {
9764
9991
  spreadReferenceNodes.push(attr.value);
9765
- } else if (import_compiler44.types.isMarkoSpreadAttribute(attr)) {
9992
+ } else if (import_compiler45.types.isMarkoSpreadAttribute(attr)) {
9766
9993
  spreadReferenceNodes = [attr.value];
9767
9994
  } else {
9768
9995
  exprExtras = push(exprExtras, valueExtra);
@@ -9771,10 +9998,10 @@ var html_style_default = {
9771
9998
  const bodyPlaceholderNodes = [];
9772
9999
  let hasBodyPlaceholders = false;
9773
10000
  for (const child of tag.node.body.body) {
9774
- if (import_compiler44.types.isMarkoPlaceholder(child)) {
10001
+ if (import_compiler45.types.isMarkoPlaceholder(child)) {
9775
10002
  bodyPlaceholderNodes.push(child.value);
9776
10003
  hasBodyPlaceholders = true;
9777
- } else if (!import_compiler44.types.isMarkoText(child)) {
10004
+ } else if (!import_compiler45.types.isMarkoText(child)) {
9778
10005
  throw tag.hub.buildError(
9779
10006
  child,
9780
10007
  "Invalid child. Only text is allowed inside an html-style."
@@ -9843,7 +10070,7 @@ var html_style_default = {
9843
10070
  callRuntime(
9844
10071
  "_el",
9845
10072
  getterId && getScopeIdIdentifier(tagSection),
9846
- getterId && import_compiler44.types.stringLiteral(getterId)
10073
+ getterId && import_compiler45.types.stringLiteral(getterId)
9847
10074
  )
9848
10075
  );
9849
10076
  } else {
@@ -9853,12 +10080,12 @@ var html_style_default = {
9853
10080
  if (getterId) {
9854
10081
  getterFnIdentifier = generateUidIdentifier(`get_${varName}`);
9855
10082
  (0, import_babel_utils35.getProgram)().node.body.push(
9856
- import_compiler44.types.variableDeclaration("const", [
9857
- import_compiler44.types.variableDeclarator(
10083
+ import_compiler45.types.variableDeclaration("const", [
10084
+ import_compiler45.types.variableDeclarator(
9858
10085
  getterFnIdentifier,
9859
10086
  callRuntime(
9860
10087
  "_el",
9861
- import_compiler44.types.stringLiteral(getterId),
10088
+ import_compiler45.types.stringLiteral(getterId),
9862
10089
  getScopeAccessorLiteral(nodeBinding)
9863
10090
  )
9864
10091
  )
@@ -9869,13 +10096,13 @@ var html_style_default = {
9869
10096
  const referenceSection = getSection(reference);
9870
10097
  if (isInvokedFunction(reference)) {
9871
10098
  reference.parentPath.replaceWith(
9872
- import_compiler44.types.expressionStatement(
10099
+ import_compiler45.types.expressionStatement(
9873
10100
  createScopeReadExpression(referenceSection, nodeBinding)
9874
10101
  )
9875
10102
  );
9876
10103
  } else if (getterFnIdentifier) {
9877
10104
  reference.replaceWith(
9878
- import_compiler44.types.callExpression(getterFnIdentifier, [
10105
+ import_compiler45.types.callExpression(getterFnIdentifier, [
9879
10106
  getScopeExpression(referenceSection, getSection(tag))
9880
10107
  ])
9881
10108
  );
@@ -9907,10 +10134,10 @@ var html_style_default = {
9907
10134
  "render",
9908
10135
  tagSection,
9909
10136
  valueReferences,
9910
- import_compiler44.types.expressionStatement(
10137
+ import_compiler45.types.expressionStatement(
9911
10138
  callRuntime(
9912
10139
  helper,
9913
- import_compiler44.types.memberExpression(scopeIdentifier, visitAccessor, true),
10140
+ import_compiler45.types.memberExpression(scopeIdentifier, visitAccessor, true),
9914
10141
  value
9915
10142
  )
9916
10143
  )
@@ -9925,18 +10152,18 @@ var html_style_default = {
9925
10152
  if (isEventHandler(name2)) {
9926
10153
  addHTMLEffectCall(tagSection, valueReferences);
9927
10154
  } else {
9928
- write`${callRuntime("_attr", import_compiler44.types.stringLiteral(name2), value)}`;
10155
+ write`${callRuntime("_attr", import_compiler45.types.stringLiteral(name2), value)}`;
9929
10156
  }
9930
10157
  } else if (isEventHandler(name2)) {
9931
10158
  addStatement(
9932
10159
  "effect",
9933
10160
  tagSection,
9934
10161
  valueReferences,
9935
- import_compiler44.types.expressionStatement(
10162
+ import_compiler45.types.expressionStatement(
9936
10163
  callRuntime(
9937
10164
  "_on",
9938
- import_compiler44.types.memberExpression(scopeIdentifier, visitAccessor, true),
9939
- import_compiler44.types.stringLiteral(getEventHandlerName(name2)),
10165
+ import_compiler45.types.memberExpression(scopeIdentifier, visitAccessor, true),
10166
+ import_compiler45.types.stringLiteral(getEventHandlerName(name2)),
9940
10167
  value
9941
10168
  )
9942
10169
  )
@@ -9946,11 +10173,11 @@ var html_style_default = {
9946
10173
  "render",
9947
10174
  tagSection,
9948
10175
  valueReferences,
9949
- import_compiler44.types.expressionStatement(
10176
+ import_compiler45.types.expressionStatement(
9950
10177
  callRuntime(
9951
10178
  "_attr",
9952
- import_compiler44.types.memberExpression(scopeIdentifier, visitAccessor, true),
9953
- import_compiler44.types.stringLiteral(name2),
10179
+ import_compiler45.types.memberExpression(scopeIdentifier, visitAccessor, true),
10180
+ import_compiler45.types.stringLiteral(name2),
9954
10181
  value
9955
10182
  )
9956
10183
  )
@@ -9963,9 +10190,9 @@ var html_style_default = {
9963
10190
  if (isHTML) {
9964
10191
  addHTMLEffectCall(tagSection, tagExtra.referencedBindings);
9965
10192
  if (skipExpression) {
9966
- write`${callRuntime("_attrs_partial", spreadExpression, skipExpression, visitAccessor, getScopeIdIdentifier(tagSection), import_compiler44.types.stringLiteral("style"))}`;
10193
+ write`${callRuntime("_attrs_partial", spreadExpression, skipExpression, visitAccessor, getScopeIdIdentifier(tagSection), import_compiler45.types.stringLiteral("style"))}`;
9967
10194
  } else {
9968
- write`${callRuntime("_attrs", spreadExpression, visitAccessor, getScopeIdIdentifier(tagSection), import_compiler44.types.stringLiteral("style"))}`;
10195
+ write`${callRuntime("_attrs", spreadExpression, visitAccessor, getScopeIdIdentifier(tagSection), import_compiler45.types.stringLiteral("style"))}`;
9969
10196
  }
9970
10197
  } else {
9971
10198
  if (skipExpression) {
@@ -9973,7 +10200,7 @@ var html_style_default = {
9973
10200
  "render",
9974
10201
  tagSection,
9975
10202
  tagExtra.referencedBindings,
9976
- import_compiler44.types.expressionStatement(
10203
+ import_compiler45.types.expressionStatement(
9977
10204
  callRuntime(
9978
10205
  "_attrs_partial",
9979
10206
  scopeIdentifier,
@@ -9988,7 +10215,7 @@ var html_style_default = {
9988
10215
  "render",
9989
10216
  tagSection,
9990
10217
  tagExtra.referencedBindings,
9991
- import_compiler44.types.expressionStatement(
10218
+ import_compiler45.types.expressionStatement(
9992
10219
  callRuntime(
9993
10220
  "_attrs",
9994
10221
  scopeIdentifier,
@@ -10002,7 +10229,7 @@ var html_style_default = {
10002
10229
  "effect",
10003
10230
  tagSection,
10004
10231
  tagExtra.referencedBindings,
10005
- import_compiler44.types.expressionStatement(
10232
+ import_compiler45.types.expressionStatement(
10006
10233
  callRuntime("_attrs_script", scopeIdentifier, visitAccessor)
10007
10234
  ),
10008
10235
  false
@@ -10019,25 +10246,25 @@ var html_style_default = {
10019
10246
  const write = writeTo(tag);
10020
10247
  if (isOutputHTML()) {
10021
10248
  for (const child of tag.node.body.body) {
10022
- if (import_compiler44.types.isMarkoText(child)) {
10249
+ if (import_compiler45.types.isMarkoText(child)) {
10023
10250
  write`${child.value}`;
10024
- } else if (import_compiler44.types.isMarkoPlaceholder(child)) {
10251
+ } else if (import_compiler45.types.isMarkoPlaceholder(child)) {
10025
10252
  write`${callRuntime("_escape_style", child.value)}`;
10026
10253
  }
10027
10254
  }
10028
10255
  } else {
10029
10256
  const textLiteral = bodyToTextLiteral(tag.node.body);
10030
- if (import_compiler44.types.isStringLiteral(textLiteral)) {
10257
+ if (import_compiler45.types.isStringLiteral(textLiteral)) {
10031
10258
  write`${textLiteral}`;
10032
10259
  } else {
10033
10260
  addStatement(
10034
10261
  "render",
10035
10262
  getSection(tag),
10036
10263
  textLiteral.extra?.referencedBindings,
10037
- import_compiler44.types.expressionStatement(
10264
+ import_compiler45.types.expressionStatement(
10038
10265
  callRuntime(
10039
10266
  "_text_content",
10040
- import_compiler44.types.memberExpression(
10267
+ import_compiler45.types.memberExpression(
10041
10268
  scopeIdentifier,
10042
10269
  getScopeAccessorLiteral(nodeBinding),
10043
10270
  true
@@ -10087,11 +10314,11 @@ function getUsedAttrs3(tag) {
10087
10314
  for (let i = attributes.length; i--; ) {
10088
10315
  const attr = attributes[i];
10089
10316
  const { value } = attr;
10090
- if (import_compiler44.types.isMarkoSpreadAttribute(attr)) {
10317
+ if (import_compiler45.types.isMarkoSpreadAttribute(attr)) {
10091
10318
  if (!spreadProps) {
10092
10319
  spreadProps = [];
10093
10320
  }
10094
- spreadProps.push(import_compiler44.types.spreadElement(value));
10321
+ spreadProps.push(import_compiler45.types.spreadElement(value));
10095
10322
  } else if (!seen[attr.name]) {
10096
10323
  seen[attr.name] = attr;
10097
10324
  if (spreadProps) {
@@ -10105,10 +10332,10 @@ function getUsedAttrs3(tag) {
10105
10332
  if (spreadProps) {
10106
10333
  spreadProps.reverse();
10107
10334
  for (const { name: name2 } of staticAttrs) {
10108
- (skipProps ||= []).push(toObjectProperty(name2, import_compiler44.types.numericLiteral(1)));
10335
+ (skipProps ||= []).push(toObjectProperty(name2, import_compiler45.types.numericLiteral(1)));
10109
10336
  }
10110
10337
  if (skipProps) {
10111
- skipExpression = import_compiler44.types.objectExpression(skipProps);
10338
+ skipExpression = import_compiler45.types.objectExpression(skipProps);
10112
10339
  }
10113
10340
  spreadExpression = propsToExpression(spreadProps);
10114
10341
  }
@@ -10120,7 +10347,7 @@ function getUsedAttrs3(tag) {
10120
10347
  }
10121
10348
 
10122
10349
  // src/translator/core/id.ts
10123
- var import_compiler45 = require("@marko/compiler");
10350
+ var import_compiler46 = require("@marko/compiler");
10124
10351
  var import_babel_utils36 = require("@marko/compiler/babel-utils");
10125
10352
  var id_default = {
10126
10353
  analyze(tag) {
@@ -10135,12 +10362,12 @@ var id_default = {
10135
10362
  "The [`<id>` tag](https://markojs.com/docs/reference/core-tag#id) requires a [tag variable](https://markojs.com/docs/reference/language#tag-variables)."
10136
10363
  );
10137
10364
  }
10138
- if (!import_compiler45.types.isIdentifier(node.var)) {
10365
+ if (!import_compiler46.types.isIdentifier(node.var)) {
10139
10366
  throw tag.get("var").buildCodeFrameError(
10140
10367
  "The [`<id>` tag](https://markojs.com/docs/reference/core-tag#id) cannot be destructured."
10141
10368
  );
10142
10369
  }
10143
- if (tag.node.attributes.length > 1 || tag.node.attributes.length === 1 && (!import_compiler45.types.isMarkoAttribute(valueAttr) || !valueAttr.default && valueAttr.name !== "value")) {
10370
+ if (tag.node.attributes.length > 1 || tag.node.attributes.length === 1 && (!import_compiler46.types.isMarkoAttribute(valueAttr) || !valueAttr.default && valueAttr.name !== "value")) {
10144
10371
  throw tag.get("name").buildCodeFrameError(
10145
10372
  "The [`<id>` tag](https://markojs.com/docs/reference/core-tag#id) only supports the [`value=` attribute](https://markojs.com/docs/reference/language#shorthand-value)."
10146
10373
  );
@@ -10157,10 +10384,10 @@ var id_default = {
10157
10384
  const [valueAttr] = tag.node.attributes;
10158
10385
  if (isOutputHTML()) {
10159
10386
  tag.replaceWith(
10160
- import_compiler45.types.variableDeclaration("const", [
10161
- import_compiler45.types.variableDeclarator(
10387
+ import_compiler46.types.variableDeclaration("const", [
10388
+ import_compiler46.types.variableDeclarator(
10162
10389
  node.var,
10163
- valueAttr ? import_compiler45.types.logicalExpression("||", valueAttr.value, id) : id
10390
+ valueAttr ? import_compiler46.types.logicalExpression("||", valueAttr.value, id) : id
10164
10391
  )
10165
10392
  ])
10166
10393
  );
@@ -10173,7 +10400,7 @@ var id_default = {
10173
10400
  section,
10174
10401
  value.extra?.referencedBindings,
10175
10402
  source,
10176
- import_compiler45.types.logicalExpression("||", value, id)
10403
+ import_compiler46.types.logicalExpression("||", value, id)
10177
10404
  );
10178
10405
  } else {
10179
10406
  addValue(section, void 0, source, id);
@@ -10198,17 +10425,17 @@ var id_default = {
10198
10425
  };
10199
10426
 
10200
10427
  // src/translator/core/if.ts
10201
- var import_compiler47 = require("@marko/compiler");
10428
+ var import_compiler48 = require("@marko/compiler");
10202
10429
  var import_babel_utils37 = require("@marko/compiler/babel-utils");
10203
10430
 
10204
10431
  // src/translator/util/to-first-statement-or-block.ts
10205
- var import_compiler46 = require("@marko/compiler");
10432
+ var import_compiler47 = require("@marko/compiler");
10206
10433
  function toFirstStatementOrBlock(body) {
10207
10434
  if (Array.isArray(body)) {
10208
10435
  if (body.length === 1) {
10209
10436
  return body[0];
10210
10437
  }
10211
- return import_compiler46.types.blockStatement(body);
10438
+ return import_compiler47.types.blockStatement(body);
10212
10439
  }
10213
10440
  return body;
10214
10441
  }
@@ -10316,14 +10543,14 @@ var IfTag = {
10316
10543
  }
10317
10544
  }
10318
10545
  bodyStatements.push(
10319
- import_compiler47.types.returnStatement(import_compiler47.types.numericLiteral(i))
10546
+ import_compiler48.types.returnStatement(import_compiler48.types.numericLiteral(i))
10320
10547
  );
10321
10548
  }
10322
10549
  }
10323
10550
  const [testAttr] = branchTag.node.attributes;
10324
10551
  const curStatement = toFirstStatementOrBlock(bodyStatements);
10325
10552
  if (testAttr) {
10326
- statement = import_compiler47.types.ifStatement(
10553
+ statement = import_compiler48.types.ifStatement(
10327
10554
  testAttr.value,
10328
10555
  curStatement,
10329
10556
  statement
@@ -10348,11 +10575,11 @@ var IfTag = {
10348
10575
  markerSerializeReason,
10349
10576
  !statefulSerializeArg
10350
10577
  );
10351
- const cbNode = import_compiler47.types.arrowFunctionExpression(
10578
+ const cbNode = import_compiler48.types.arrowFunctionExpression(
10352
10579
  [],
10353
- import_compiler47.types.blockStatement([statement])
10580
+ import_compiler48.types.blockStatement([statement])
10354
10581
  );
10355
- statement = import_compiler47.types.expressionStatement(
10582
+ statement = import_compiler48.types.expressionStatement(
10356
10583
  callRuntime(
10357
10584
  "_if",
10358
10585
  cbNode,
@@ -10365,8 +10592,8 @@ var IfTag = {
10365
10592
  ),
10366
10593
  markerSerializeArg,
10367
10594
  statefulSerializeArg,
10368
- skipParentEnd ? import_compiler47.types.stringLiteral(`</${onlyChildParentTagName}>`) : singleNodeOptimization ? import_compiler47.types.numericLiteral(0) : void 0,
10369
- singleNodeOptimization ? import_compiler47.types.numericLiteral(1) : void 0
10595
+ skipParentEnd ? import_compiler48.types.stringLiteral(`</${onlyChildParentTagName}>`) : singleNodeOptimization ? import_compiler48.types.numericLiteral(0) : void 0,
10596
+ singleNodeOptimization ? import_compiler48.types.numericLiteral(1) : void 0
10370
10597
  )
10371
10598
  );
10372
10599
  }
@@ -10396,25 +10623,25 @@ var IfTag = {
10396
10623
  const ifTagExtra = branches[0][0].node.extra;
10397
10624
  const nodeRef = getOptimizedOnlyChildNodeBinding(ifTag, ifTagSection);
10398
10625
  const rendererIdentifiers = [];
10399
- let expr = import_compiler47.types.numericLiteral(branches.length);
10626
+ let expr = import_compiler48.types.numericLiteral(branches.length);
10400
10627
  for (let i = branches.length; i--; ) {
10401
10628
  const [branchTag, branchBodySection] = branches[i];
10402
10629
  const [testAttr] = branchTag.node.attributes;
10403
- const consequent = import_compiler47.types.numericLiteral(branchBodySection ? i : -1);
10630
+ const consequent = import_compiler48.types.numericLiteral(branchBodySection ? i : -1);
10404
10631
  if (branchBodySection) {
10405
- rendererIdentifiers.push(import_compiler47.types.identifier(branchBodySection.name));
10632
+ rendererIdentifiers.push(import_compiler48.types.identifier(branchBodySection.name));
10406
10633
  setClosureSignalBuilder(branchTag, (closure, render) => {
10407
10634
  return callRuntime(
10408
10635
  "_if_closure",
10409
10636
  getScopeAccessorLiteral(closure),
10410
10637
  getScopeAccessorLiteral(nodeRef),
10411
- import_compiler47.types.numericLiteral(i),
10638
+ import_compiler48.types.numericLiteral(i),
10412
10639
  render
10413
10640
  );
10414
10641
  });
10415
10642
  }
10416
10643
  branchTag.remove();
10417
- expr = testAttr ? import_compiler47.types.conditionalExpression(testAttr.value, consequent, expr) : consequent;
10644
+ expr = testAttr ? import_compiler48.types.conditionalExpression(testAttr.value, consequent, expr) : consequent;
10418
10645
  }
10419
10646
  const signal = getSignal(ifTagSection, nodeRef, "if");
10420
10647
  signal.build = () => {
@@ -10496,7 +10723,7 @@ function assertHasBody(tag) {
10496
10723
  function assertHasValueAttribute(tag) {
10497
10724
  const { node } = tag;
10498
10725
  const [valueAttr] = node.attributes;
10499
- if (!import_compiler47.types.isMarkoAttribute(valueAttr) || !valueAttr.default) {
10726
+ if (!import_compiler48.types.isMarkoAttribute(valueAttr) || !valueAttr.default) {
10500
10727
  throw tag.get("name").buildCodeFrameError(
10501
10728
  `The [\`${getTagName(tag)}\` tag](https://markojs.com/docs/reference/core-tag#if--else) requires a [\`value=\` attribute](https://markojs.com/docs/reference/language#shorthand-value).`
10502
10729
  );
@@ -10582,7 +10809,7 @@ var import_default = {
10582
10809
  };
10583
10810
 
10584
10811
  // src/translator/core/let.ts
10585
- var import_compiler48 = require("@marko/compiler");
10812
+ var import_compiler49 = require("@marko/compiler");
10586
10813
  var import_babel_utils39 = require("@marko/compiler/babel-utils");
10587
10814
  var let_default = {
10588
10815
  analyze(tag) {
@@ -10591,7 +10818,7 @@ var let_default = {
10591
10818
  let valueAttr;
10592
10819
  let valueChangeAttr;
10593
10820
  for (const attr of node.attributes) {
10594
- if (import_compiler48.types.isMarkoAttribute(attr)) {
10821
+ if (import_compiler49.types.isMarkoAttribute(attr)) {
10595
10822
  if (attr.name === "value") {
10596
10823
  valueAttr = attr;
10597
10824
  } else if (attr.name === "valueChange") {
@@ -10621,7 +10848,7 @@ var let_default = {
10621
10848
  "The [`<let>` tag](https://markojs.com/docs/reference/core-tag#let) requires a [tag variable](https://markojs.com/docs/reference/language#tag-variables)."
10622
10849
  );
10623
10850
  }
10624
- if (!import_compiler48.types.isIdentifier(tagVar)) {
10851
+ if (!import_compiler49.types.isIdentifier(tagVar)) {
10625
10852
  throw tag.get("var").buildCodeFrameError(
10626
10853
  "The [`<let>` tag](https://markojs.com/docs/reference/core-tag#let) variable cannot be destructured."
10627
10854
  );
@@ -10651,10 +10878,10 @@ var let_default = {
10651
10878
  const { node } = tag;
10652
10879
  const tagVar = node.var;
10653
10880
  const valueAttr = node.attributes.find(
10654
- (attr) => import_compiler48.types.isMarkoAttribute(attr) && (attr.default || attr.name === "value")
10655
- ) ?? import_compiler48.types.markoAttribute("value", import_compiler48.types.identifier("undefined"));
10881
+ (attr) => import_compiler49.types.isMarkoAttribute(attr) && (attr.default || attr.name === "value")
10882
+ ) ?? import_compiler49.types.markoAttribute("value", import_compiler49.types.identifier("undefined"));
10656
10883
  const valueChangeAttr = node.attributes.find(
10657
- (attr) => import_compiler48.types.isMarkoAttribute(attr) && attr.name === "valueChange"
10884
+ (attr) => import_compiler49.types.isMarkoAttribute(attr) && attr.name === "valueChange"
10658
10885
  );
10659
10886
  const section = getSection(tag);
10660
10887
  const binding = tagVar.extra.binding;
@@ -10667,7 +10894,7 @@ var let_default = {
10667
10894
  }
10668
10895
  signal.buildAssignment = (valueSection, value) => {
10669
10896
  if (valueChangeAttr || signalHasStatements(signal)) {
10670
- return import_compiler48.types.callExpression(signal.identifier, [
10897
+ return import_compiler49.types.callExpression(signal.identifier, [
10671
10898
  getScopeExpression(valueSection, signal.section),
10672
10899
  value
10673
10900
  ]);
@@ -10679,10 +10906,10 @@ var let_default = {
10679
10906
  setBindingSerializedValue(
10680
10907
  section,
10681
10908
  binding,
10682
- import_compiler48.types.logicalExpression(
10909
+ import_compiler49.types.logicalExpression(
10683
10910
  "||",
10684
10911
  valueChangeAttr.value,
10685
- import_compiler48.types.unaryExpression("void", import_compiler48.types.numericLiteral(0))
10912
+ import_compiler49.types.unaryExpression("void", import_compiler49.types.numericLiteral(0))
10686
10913
  ),
10687
10914
  getAccessorPrefix().TagVariableChange
10688
10915
  );
@@ -10705,7 +10932,7 @@ var let_default = {
10705
10932
  };
10706
10933
 
10707
10934
  // src/translator/core/lifecycle.ts
10708
- var import_compiler49 = require("@marko/compiler");
10935
+ var import_compiler50 = require("@marko/compiler");
10709
10936
  var import_babel_utils40 = require("@marko/compiler/babel-utils");
10710
10937
  var kRef = Symbol("lifecycle attrs reference");
10711
10938
  var lifecycle_default = {
@@ -10733,7 +10960,7 @@ var lifecycle_default = {
10733
10960
  );
10734
10961
  }
10735
10962
  for (const attr of node.attributes) {
10736
- if (import_compiler49.types.isMarkoSpreadAttribute(attr)) {
10963
+ if (import_compiler50.types.isMarkoSpreadAttribute(attr)) {
10737
10964
  throw tag.get("name").buildCodeFrameError(
10738
10965
  "The [`<lifecycle>` tag](https://markojs.com/docs/reference/core-tag#lifecycle) does not support [`...spread` attributes](https://markojs.com/docs/reference/language#spread-attributes)."
10739
10966
  );
@@ -10752,7 +10979,7 @@ var lifecycle_default = {
10752
10979
  if (isOutputDOM()) {
10753
10980
  const translatedAttrs = translateAttrs(tag);
10754
10981
  translatedAttrs.statements.push(
10755
- import_compiler49.types.expressionStatement(
10982
+ import_compiler50.types.expressionStatement(
10756
10983
  callRuntime(
10757
10984
  "_lifecycle",
10758
10985
  scopeIdentifier,
@@ -10787,7 +11014,7 @@ var lifecycle_default = {
10787
11014
  };
10788
11015
 
10789
11016
  // src/translator/core/log.ts
10790
- var import_compiler50 = require("@marko/compiler");
11017
+ var import_compiler51 = require("@marko/compiler");
10791
11018
  var import_babel_utils41 = require("@marko/compiler/babel-utils");
10792
11019
  var log_default = {
10793
11020
  analyze(tag) {
@@ -10801,7 +11028,7 @@ var log_default = {
10801
11028
  "The [`<log>` tag](https://markojs.com/docs/reference/core-tag#log) requires a [`value=` attribute](https://markojs.com/docs/reference/language#shorthand-value)."
10802
11029
  );
10803
11030
  }
10804
- if (tag.node.attributes.length > 1 || !import_compiler50.types.isMarkoAttribute(valueAttr) || !valueAttr.default && valueAttr.name !== "value") {
11031
+ if (tag.node.attributes.length > 1 || !import_compiler51.types.isMarkoAttribute(valueAttr) || !valueAttr.default && valueAttr.name !== "value") {
10805
11032
  throw tag.get("name").buildCodeFrameError(
10806
11033
  "The [`<log>` tag](https://markojs.com/docs/reference/core-tag#log) only supports the [`value=` attribute](https://markojs.com/docs/reference/language#shorthand-value)."
10807
11034
  );
@@ -10813,9 +11040,9 @@ var log_default = {
10813
11040
  const [valueAttr] = tag.node.attributes;
10814
11041
  const { value } = valueAttr;
10815
11042
  const referencedBindings = value.extra?.referencedBindings;
10816
- const statement = import_compiler50.types.expressionStatement(
10817
- import_compiler50.types.callExpression(
10818
- import_compiler50.types.memberExpression(import_compiler50.types.identifier("console"), import_compiler50.types.identifier("log")),
11043
+ const statement = import_compiler51.types.expressionStatement(
11044
+ import_compiler51.types.callExpression(
11045
+ import_compiler51.types.memberExpression(import_compiler51.types.identifier("console"), import_compiler51.types.identifier("log")),
10819
11046
  [value]
10820
11047
  )
10821
11048
  );
@@ -10841,7 +11068,7 @@ var log_default = {
10841
11068
  };
10842
11069
 
10843
11070
  // src/translator/core/script.ts
10844
- var import_compiler51 = require("@marko/compiler");
11071
+ var import_compiler52 = require("@marko/compiler");
10845
11072
  var import_babel_utils42 = require("@marko/compiler/babel-utils");
10846
11073
  var htmlScriptTagAlternateMsg = " For a native html [`<script>` tag](https://markojs.com/docs/reference/core-tag#script) use the `html-script` core tag instead.";
10847
11074
  var script_default = {
@@ -10864,12 +11091,12 @@ var script_default = {
10864
11091
  const end = body[body.length - 1]?.end;
10865
11092
  const bodyStatements = (0, import_babel_utils42.parseStatements)(tag.hub.file, code, start, end);
10866
11093
  if (bodyStatements.length) {
10867
- const valueFn = import_compiler51.types.arrowFunctionExpression(
11094
+ const valueFn = import_compiler52.types.arrowFunctionExpression(
10868
11095
  [],
10869
- import_compiler51.types.blockStatement(bodyStatements),
11096
+ import_compiler52.types.blockStatement(bodyStatements),
10870
11097
  traverseContains(bodyStatements, isAwaitExpression)
10871
11098
  );
10872
- node.attributes.push(import_compiler51.types.markoAttribute("value", valueFn));
11099
+ node.attributes.push(import_compiler52.types.markoAttribute("value", valueFn));
10873
11100
  }
10874
11101
  node.body.body = [];
10875
11102
  }
@@ -10919,28 +11146,28 @@ var script_default = {
10919
11146
  const referencedBindings = value.extra?.referencedBindings;
10920
11147
  if (isOutputDOM()) {
10921
11148
  const { value: value2 } = valueAttr;
10922
- const isFunction2 = import_compiler51.types.isFunctionExpression(value2) || import_compiler51.types.isArrowFunctionExpression(value2);
11149
+ const isFunction2 = import_compiler52.types.isFunctionExpression(value2) || import_compiler52.types.isArrowFunctionExpression(value2);
10923
11150
  let inlineBody = null;
10924
11151
  if (isFunction2 && !(value2.async || value2.generator)) {
10925
- if (import_compiler51.types.isBlockStatement(value2.body)) {
11152
+ if (import_compiler52.types.isBlockStatement(value2.body)) {
10926
11153
  let hasDeclaration = false;
10927
11154
  for (const child of value2.body.body) {
10928
- if (import_compiler51.types.isDeclaration(child)) {
11155
+ if (import_compiler52.types.isDeclaration(child)) {
10929
11156
  hasDeclaration = true;
10930
11157
  break;
10931
11158
  }
10932
11159
  }
10933
11160
  inlineBody = hasDeclaration ? value2.body : value2.body.body;
10934
11161
  } else {
10935
- inlineBody = import_compiler51.types.expressionStatement(value2.body);
11162
+ inlineBody = import_compiler52.types.expressionStatement(value2.body);
10936
11163
  }
10937
11164
  }
10938
11165
  addStatement(
10939
11166
  "effect",
10940
11167
  section,
10941
11168
  referencedBindings,
10942
- inlineBody || import_compiler51.types.expressionStatement(
10943
- import_compiler51.types.callExpression(value2, isFunction2 ? [] : [scopeIdentifier])
11169
+ inlineBody || import_compiler52.types.expressionStatement(
11170
+ import_compiler52.types.callExpression(value2, isFunction2 ? [] : [scopeIdentifier])
10944
11171
  )
10945
11172
  );
10946
11173
  } else {
@@ -10981,7 +11208,7 @@ function isAwaitExpression(node) {
10981
11208
  }
10982
11209
 
10983
11210
  // src/translator/core/server.ts
10984
- var import_compiler52 = require("@marko/compiler");
11211
+ var import_compiler53 = require("@marko/compiler");
10985
11212
  var import_babel_utils43 = require("@marko/compiler/babel-utils");
10986
11213
  var server_default = {
10987
11214
  parse(tag) {
@@ -10993,10 +11220,10 @@ var server_default = {
10993
11220
  const code = rawValue.replace(/^server\s*/, "");
10994
11221
  const start = node.start + (rawValue.length - code.length);
10995
11222
  let body = (0, import_babel_utils43.parseStatements)(file, code, start, start + code.length);
10996
- if (body.length === 1 && import_compiler52.types.isBlockStatement(body[0])) {
11223
+ if (body.length === 1 && import_compiler53.types.isBlockStatement(body[0])) {
10997
11224
  body = body[0].body;
10998
11225
  }
10999
- tag.replaceWith(import_compiler52.types.markoScriptlet(body, true, "server"));
11226
+ tag.replaceWith(import_compiler53.types.markoScriptlet(body, true, "server"));
11000
11227
  },
11001
11228
  parseOptions: {
11002
11229
  statement: true,
@@ -11012,7 +11239,7 @@ var server_default = {
11012
11239
  };
11013
11240
 
11014
11241
  // src/translator/core/static.ts
11015
- var import_compiler53 = require("@marko/compiler");
11242
+ var import_compiler54 = require("@marko/compiler");
11016
11243
  var import_babel_utils44 = require("@marko/compiler/babel-utils");
11017
11244
  var static_default = {
11018
11245
  parse(tag) {
@@ -11024,10 +11251,10 @@ var static_default = {
11024
11251
  const code = rawValue.replace(/^static\s*/, "");
11025
11252
  const start = node.start + (rawValue.length - code.length);
11026
11253
  let body = (0, import_babel_utils44.parseStatements)(file, code, start, start + code.length);
11027
- if (body.length === 1 && import_compiler53.types.isBlockStatement(body[0])) {
11254
+ if (body.length === 1 && import_compiler54.types.isBlockStatement(body[0])) {
11028
11255
  body = body[0].body;
11029
11256
  }
11030
- tag.replaceWith(import_compiler53.types.markoScriptlet(body, true));
11257
+ tag.replaceWith(import_compiler54.types.markoScriptlet(body, true));
11031
11258
  },
11032
11259
  parseOptions: {
11033
11260
  statement: true,
@@ -11043,7 +11270,7 @@ var static_default = {
11043
11270
  };
11044
11271
 
11045
11272
  // src/translator/core/style.ts
11046
- var import_compiler54 = require("@marko/compiler");
11273
+ var import_compiler55 = require("@marko/compiler");
11047
11274
  var import_babel_utils45 = require("@marko/compiler/babel-utils");
11048
11275
  var import_magic_string = __toESM(require("magic-string"));
11049
11276
  var import_path3 = __toESM(require("path"));
@@ -11120,21 +11347,21 @@ var style_default = {
11120
11347
  if (importPath) {
11121
11348
  if (!node.var) {
11122
11349
  (0, import_babel_utils45.getProgram)().node.body.push(
11123
- import_compiler54.types.importDeclaration([], import_compiler54.types.stringLiteral(importPath))
11350
+ import_compiler55.types.importDeclaration([], import_compiler55.types.stringLiteral(importPath))
11124
11351
  );
11125
- } else if (import_compiler54.types.isIdentifier(node.var)) {
11352
+ } else if (import_compiler55.types.isIdentifier(node.var)) {
11126
11353
  (0, import_babel_utils45.getProgram)().node.body.push(
11127
- import_compiler54.types.importDeclaration(
11128
- [import_compiler54.types.importNamespaceSpecifier(node.var)],
11129
- import_compiler54.types.stringLiteral(importPath)
11354
+ import_compiler55.types.importDeclaration(
11355
+ [import_compiler55.types.importNamespaceSpecifier(node.var)],
11356
+ import_compiler55.types.stringLiteral(importPath)
11130
11357
  )
11131
11358
  );
11132
11359
  } else {
11133
- const varDecl = import_compiler54.types.variableDeclaration("const", [
11134
- import_compiler54.types.variableDeclarator(node.var, (0, import_babel_utils45.importStar)(file, importPath, "style"))
11360
+ const varDecl = import_compiler55.types.variableDeclaration("const", [
11361
+ import_compiler55.types.variableDeclarator(node.var, (0, import_babel_utils45.importStar)(file, importPath, "style"))
11135
11362
  ]);
11136
11363
  (0, import_babel_utils45.getProgram)().node.body.push(
11137
- isOutputDOM() ? varDecl : import_compiler54.types.markoScriptlet([varDecl], true)
11364
+ isOutputDOM() ? varDecl : import_compiler55.types.markoScriptlet([varDecl], true)
11138
11365
  );
11139
11366
  }
11140
11367
  }
@@ -11149,8 +11376,43 @@ var style_default = {
11149
11376
  attributes: {}
11150
11377
  };
11151
11378
 
11379
+ // src/translator/core/textarea.ts
11380
+ var import_compiler56 = require("@marko/compiler");
11381
+ var textarea_default = {
11382
+ parse(tag) {
11383
+ if (tag.node.body.body.length) {
11384
+ const parts = [];
11385
+ for (const child of tag.node.body.body) {
11386
+ if (child.type === "MarkoText" || child.type === "MarkoPlaceholder" && child.escape) {
11387
+ parts.push(child.value);
11388
+ } else {
11389
+ throw tag.hub.file.hub.buildError(
11390
+ child,
11391
+ "Unexpected content in textarea, only text and placeholders are supported.",
11392
+ SyntaxError
11393
+ );
11394
+ }
11395
+ }
11396
+ tag.node.attributes.push(
11397
+ import_compiler56.types.markoAttribute(
11398
+ "value",
11399
+ normalizeStringExpression(parts) || buildUndefined4()
11400
+ )
11401
+ );
11402
+ tag.node.body.body = [];
11403
+ }
11404
+ },
11405
+ parseOptions: {
11406
+ text: true,
11407
+ preserveWhitespace: true
11408
+ }
11409
+ };
11410
+ function buildUndefined4() {
11411
+ return import_compiler56.types.unaryExpression("void", import_compiler56.types.numericLiteral(0));
11412
+ }
11413
+
11152
11414
  // src/translator/core/try.ts
11153
- var import_compiler55 = require("@marko/compiler");
11415
+ var import_compiler57 = require("@marko/compiler");
11154
11416
  var import_babel_utils46 = require("@marko/compiler/babel-utils");
11155
11417
  var kDOMBinding2 = Symbol("try tag dom binding");
11156
11418
  var try_default = {
@@ -11210,7 +11472,7 @@ var try_default = {
11210
11472
  writeHTMLResumeStatements(tagBody);
11211
11473
  tag.insertBefore(translatedAttrs.statements);
11212
11474
  tag.replaceWith(
11213
- import_compiler55.types.expressionStatement(
11475
+ import_compiler57.types.expressionStatement(
11214
11476
  callRuntime(
11215
11477
  "_try",
11216
11478
  getScopeIdIdentifier(section),
@@ -11252,7 +11514,7 @@ var try_default = {
11252
11514
  return callRuntime(
11253
11515
  "_try",
11254
11516
  getScopeAccessorLiteral(nodeRef),
11255
- import_compiler55.types.identifier(bodySection.name)
11517
+ import_compiler57.types.identifier(bodySection.name)
11256
11518
  );
11257
11519
  };
11258
11520
  if (translatedAttrs.statements.length) {
@@ -11264,7 +11526,7 @@ var try_default = {
11264
11526
  );
11265
11527
  }
11266
11528
  (0, import_babel_utils46.getProgram)().node.body.push(
11267
- import_compiler55.types.expressionStatement(callRuntime("_enable_catch"))
11529
+ import_compiler57.types.expressionStatement(callRuntime("_enable_catch"))
11268
11530
  );
11269
11531
  addValue(
11270
11532
  section,
@@ -11314,6 +11576,7 @@ var core_default = {
11314
11576
  "<server>": server_default,
11315
11577
  "<static>": static_default,
11316
11578
  "<style>": style_default,
11579
+ "<textarea>": textarea_default,
11317
11580
  "<try>": try_default
11318
11581
  };
11319
11582
 
@@ -11390,10 +11653,10 @@ var import_declaration_default = {
11390
11653
  };
11391
11654
 
11392
11655
  // src/translator/visitors/placeholder.ts
11393
- var import_compiler57 = require("@marko/compiler");
11656
+ var import_compiler59 = require("@marko/compiler");
11394
11657
 
11395
11658
  // src/translator/util/is-non-html-text.ts
11396
- var import_compiler56 = require("@marko/compiler");
11659
+ var import_compiler58 = require("@marko/compiler");
11397
11660
  function isNonHTMLText(placeholder) {
11398
11661
  const parentTag = placeholder.parentPath.isMarkoTagBody() && placeholder.parentPath.parentPath;
11399
11662
  if (parentTag && isCoreTag(parentTag)) {
@@ -11483,10 +11746,10 @@ var placeholder_default = {
11483
11746
  "render",
11484
11747
  getSection(placeholder),
11485
11748
  valueExtra.referencedBindings,
11486
- import_compiler57.types.expressionStatement(
11749
+ import_compiler59.types.expressionStatement(
11487
11750
  method === "_text" ? callRuntime(
11488
11751
  "_text",
11489
- import_compiler57.types.memberExpression(
11752
+ import_compiler59.types.memberExpression(
11490
11753
  scopeIdentifier,
11491
11754
  getScopeAccessorLiteral(nodeBinding),
11492
11755
  true
@@ -11525,7 +11788,7 @@ function analyzeSiblingText(placeholder) {
11525
11788
  break;
11526
11789
  }
11527
11790
  }
11528
- if (!prev.node && import_compiler57.types.isProgram(placeholder.parentPath)) {
11791
+ if (!prev.node && import_compiler59.types.isProgram(placeholder.parentPath)) {
11529
11792
  return placeholderExtra[kSiblingText] = 1 /* Before */;
11530
11793
  }
11531
11794
  let next = placeholder.getNextSibling();
@@ -11542,7 +11805,7 @@ function analyzeSiblingText(placeholder) {
11542
11805
  break;
11543
11806
  }
11544
11807
  }
11545
- if (!next.node && import_compiler57.types.isProgram(placeholder.parentPath)) {
11808
+ if (!next.node && import_compiler59.types.isProgram(placeholder.parentPath)) {
11546
11809
  return placeholderExtra[kSiblingText] = 2 /* After */;
11547
11810
  }
11548
11811
  return placeholderExtra[kSiblingText] = 0 /* None */;
@@ -11584,7 +11847,7 @@ function isEmptyPlaceholder(placeholder) {
11584
11847
  }
11585
11848
 
11586
11849
  // src/translator/visitors/referenced-identifier.ts
11587
- var import_compiler58 = require("@marko/compiler");
11850
+ var import_compiler60 = require("@marko/compiler");
11588
11851
  var abortIdsByExpressionForSection = /* @__PURE__ */ new WeakMap();
11589
11852
  var referenced_identifier_default = {
11590
11853
  migrate(identifier) {
@@ -11592,8 +11855,8 @@ var referenced_identifier_default = {
11592
11855
  if (identifier.scope.hasBinding(name2)) return;
11593
11856
  switch (name2) {
11594
11857
  case "out":
11595
- if (import_compiler58.types.isMemberExpression(identifier.parent) && import_compiler58.types.isIdentifier(identifier.parent.property) && identifier.parent.property.name === "global") {
11596
- identifier.parentPath.replaceWith(import_compiler58.types.identifier("$global"));
11858
+ if (import_compiler60.types.isMemberExpression(identifier.parent) && import_compiler60.types.isIdentifier(identifier.parent.property) && identifier.parent.property.name === "global") {
11859
+ identifier.parentPath.replaceWith(import_compiler60.types.identifier("$global"));
11597
11860
  } else {
11598
11861
  throw identifier.buildCodeFrameError(
11599
11862
  "Only `out.global` is supported for compatibility."
@@ -11620,24 +11883,24 @@ var referenced_identifier_default = {
11620
11883
  case "$global":
11621
11884
  if (isOutputHTML()) {
11622
11885
  identifier.replaceWith(
11623
- import_compiler58.types.callExpression(importRuntime("$global"), [])
11886
+ import_compiler60.types.callExpression(importRuntime("$global"), [])
11624
11887
  );
11625
11888
  } else {
11626
11889
  identifier.replaceWith(
11627
- import_compiler58.types.memberExpression(scopeIdentifier, import_compiler58.types.identifier("$global"))
11890
+ import_compiler60.types.memberExpression(scopeIdentifier, import_compiler60.types.identifier("$global"))
11628
11891
  );
11629
11892
  }
11630
11893
  break;
11631
11894
  case "$signal":
11632
11895
  if (isOutputHTML()) {
11633
11896
  identifier.replaceWith(
11634
- import_compiler58.types.callExpression(
11635
- import_compiler58.types.arrowFunctionExpression(
11897
+ import_compiler60.types.callExpression(
11898
+ import_compiler60.types.arrowFunctionExpression(
11636
11899
  [],
11637
- import_compiler58.types.blockStatement([
11638
- import_compiler58.types.throwStatement(
11639
- import_compiler58.types.newExpression(import_compiler58.types.identifier("Error"), [
11640
- import_compiler58.types.stringLiteral("Cannot use $signal in a server render.")
11900
+ import_compiler60.types.blockStatement([
11901
+ import_compiler60.types.throwStatement(
11902
+ import_compiler60.types.newExpression(import_compiler60.types.identifier("Error"), [
11903
+ import_compiler60.types.stringLiteral("Cannot use $signal in a server render.")
11641
11904
  ])
11642
11905
  )
11643
11906
  ])
@@ -11663,19 +11926,19 @@ var referenced_identifier_default = {
11663
11926
  "render",
11664
11927
  section,
11665
11928
  exprRoot.node.extra?.referencedBindings,
11666
- import_compiler58.types.expressionStatement(
11667
- import_compiler58.types.callExpression(importRuntime("$signalReset"), [
11929
+ import_compiler60.types.expressionStatement(
11930
+ import_compiler60.types.callExpression(importRuntime("$signalReset"), [
11668
11931
  scopeIdentifier,
11669
- import_compiler58.types.numericLiteral(exprId)
11932
+ import_compiler60.types.numericLiteral(exprId)
11670
11933
  ])
11671
11934
  ),
11672
11935
  false
11673
11936
  );
11674
11937
  }
11675
11938
  identifier.replaceWith(
11676
- import_compiler58.types.callExpression(importRuntime("$signal"), [
11939
+ import_compiler60.types.callExpression(importRuntime("$signal"), [
11677
11940
  scopeIdentifier,
11678
- import_compiler58.types.numericLiteral(exprId)
11941
+ import_compiler60.types.numericLiteral(exprId)
11679
11942
  ])
11680
11943
  );
11681
11944
  }
@@ -11719,11 +11982,11 @@ var scriptlet_default = {
11719
11982
  };
11720
11983
 
11721
11984
  // src/translator/visitors/tag/index.ts
11722
- var import_compiler62 = require("@marko/compiler");
11985
+ var import_compiler64 = require("@marko/compiler");
11723
11986
  var import_babel_utils52 = require("@marko/compiler/babel-utils");
11724
11987
 
11725
11988
  // src/translator/visitors/tag/attribute-tag.ts
11726
- var import_compiler59 = require("@marko/compiler");
11989
+ var import_compiler61 = require("@marko/compiler");
11727
11990
  var import_babel_utils49 = require("@marko/compiler/babel-utils");
11728
11991
  var attribute_tag_default = {
11729
11992
  analyze: {
@@ -11756,7 +12019,7 @@ var attribute_tag_default = {
11756
12019
  };
11757
12020
 
11758
12021
  // src/translator/visitors/tag/custom-tag.ts
11759
- var import_compiler60 = require("@marko/compiler");
12022
+ var import_compiler62 = require("@marko/compiler");
11760
12023
  var import_babel_utils50 = require("@marko/compiler/babel-utils");
11761
12024
  var import_path4 = __toESM(require("path"));
11762
12025
  var custom_tag_default = {
@@ -11810,9 +12073,9 @@ function translateHTML(tag) {
11810
12073
  const childProgram = (0, import_babel_utils50.loadFileForTag)(tag).ast.program;
11811
12074
  const childExtra = childProgram.extra;
11812
12075
  let tagIdentifier;
11813
- if (import_compiler60.types.isStringLiteral(node.name)) {
12076
+ if (import_compiler62.types.isStringLiteral(node.name)) {
11814
12077
  const relativePath = getTagRelativePath(tag);
11815
- tagIdentifier = isCircularRequest(tag.hub.file, relativePath) ? import_compiler60.types.identifier(getTemplateContentName()) : (0, import_babel_utils50.importDefault)(tag.hub.file, relativePath, getTagName(tag));
12078
+ tagIdentifier = isCircularRequest(tag.hub.file, relativePath) ? import_compiler62.types.identifier(getTemplateContentName()) : (0, import_babel_utils50.importDefault)(tag.hub.file, relativePath, getTagName(tag));
11816
12079
  } else {
11817
12080
  tagIdentifier = node.name;
11818
12081
  }
@@ -11833,7 +12096,7 @@ function translateDOM(tag) {
11833
12096
  const childExtra = childFile.ast.program.extra;
11834
12097
  const childExports = childExtra.domExports;
11835
12098
  const childSection = childExtra.section;
11836
- const tagName = import_compiler60.types.isIdentifier(node.name) ? node.name.name : import_compiler60.types.isStringLiteral(node.name) ? node.name.value : "tag";
12099
+ const tagName = import_compiler62.types.isIdentifier(node.name) ? node.name.name : import_compiler62.types.isStringLiteral(node.name) ? node.name.value : "tag";
11837
12100
  if (programSection === childSection) {
11838
12101
  knownTagTranslateDOM(
11839
12102
  tag,
@@ -11844,16 +12107,16 @@ function translateDOM(tag) {
11844
12107
  "render",
11845
12108
  section,
11846
12109
  void 0,
11847
- import_compiler60.types.expressionStatement(
11848
- import_compiler60.types.callExpression(import_compiler60.types.identifier(childExports.setup), [
12110
+ import_compiler62.types.expressionStatement(
12111
+ import_compiler62.types.callExpression(import_compiler62.types.identifier(childExports.setup), [
11849
12112
  createScopeReadExpression(section, childBinding)
11850
12113
  ])
11851
12114
  )
11852
12115
  );
11853
12116
  }
11854
12117
  );
11855
- write`${import_compiler60.types.identifier(childExports.template)}`;
11856
- injectWalks(tag, import_compiler60.types.identifier(childExports.walks));
12118
+ write`${import_compiler62.types.identifier(childExports.template)}`;
12119
+ injectWalks(tag, import_compiler62.types.identifier(childExports.walks));
11857
12120
  } else {
11858
12121
  knownTagTranslateDOM(
11859
12122
  tag,
@@ -11869,8 +12132,8 @@ function translateDOM(tag) {
11869
12132
  "render",
11870
12133
  section,
11871
12134
  void 0,
11872
- import_compiler60.types.expressionStatement(
11873
- import_compiler60.types.callExpression(
12135
+ import_compiler62.types.expressionStatement(
12136
+ import_compiler62.types.callExpression(
11874
12137
  importOrSelfReferenceName(
11875
12138
  file,
11876
12139
  relativePath,
@@ -11897,7 +12160,7 @@ function getTagRelativePath(tag) {
11897
12160
  hub: { file }
11898
12161
  } = tag;
11899
12162
  let relativePath;
11900
- if (import_compiler60.types.isStringLiteral(node.name)) {
12163
+ if (import_compiler62.types.isStringLiteral(node.name)) {
11901
12164
  const template = (0, import_babel_utils50.getTagTemplate)(tag);
11902
12165
  relativePath = template && (0, import_babel_utils50.resolveRelativePath)(file, template);
11903
12166
  } else if (node.extra?.tagNameImported) {
@@ -11918,7 +12181,7 @@ function getTagRelativePath(tag) {
11918
12181
  }
11919
12182
  function importOrSelfReferenceName(file, request, name2, nameHint) {
11920
12183
  if (isCircularRequest(file, request)) {
11921
- return import_compiler60.types.identifier(name2);
12184
+ return import_compiler62.types.identifier(name2);
11922
12185
  }
11923
12186
  return (0, import_babel_utils50.importNamed)(file, request, name2, nameHint);
11924
12187
  }
@@ -11928,7 +12191,7 @@ function isCircularRequest(file, request) {
11928
12191
  }
11929
12192
 
11930
12193
  // src/translator/visitors/tag/dynamic-tag.ts
11931
- var import_compiler61 = require("@marko/compiler");
12194
+ var import_compiler63 = require("@marko/compiler");
11932
12195
  var import_babel_utils51 = require("@marko/compiler/babel-utils");
11933
12196
  var kDOMBinding3 = Symbol("dynamic tag dom binding");
11934
12197
  var kChildOffsetScopeBinding2 = Symbol("custom tag scope offset");
@@ -11960,7 +12223,7 @@ var dynamic_tag_default = {
11960
12223
  tagSection
11961
12224
  );
11962
12225
  if (hasVar || tag.node.attributes.some(
11963
- (attr) => import_compiler61.types.isMarkoSpreadAttribute(attr) || isEventOrChangeHandler(attr.name)
12226
+ (attr) => import_compiler63.types.isMarkoSpreadAttribute(attr) || isEventOrChangeHandler(attr.name)
11964
12227
  )) {
11965
12228
  (0, import_babel_utils51.getProgram)().node.extra.isInteractive = true;
11966
12229
  }
@@ -12000,7 +12263,7 @@ var dynamic_tag_default = {
12000
12263
  if (isOutputHTML()) {
12001
12264
  knownTagTranslateHTML(
12002
12265
  tag,
12003
- import_compiler61.types.memberExpression(tag.node.name, import_compiler61.types.identifier("content")),
12266
+ import_compiler63.types.memberExpression(tag.node.name, import_compiler63.types.identifier("content")),
12004
12267
  definedBodySection,
12005
12268
  propTree
12006
12269
  );
@@ -12017,9 +12280,9 @@ var dynamic_tag_default = {
12017
12280
  "render",
12018
12281
  section,
12019
12282
  void 0,
12020
- import_compiler61.types.expressionStatement(
12021
- import_compiler61.types.callExpression(
12022
- import_compiler61.types.memberExpression(signal.identifier, import_compiler61.types.identifier("_")),
12283
+ import_compiler63.types.expressionStatement(
12284
+ import_compiler63.types.callExpression(
12285
+ import_compiler63.types.memberExpression(signal.identifier, import_compiler63.types.identifier("_")),
12023
12286
  [
12024
12287
  createScopeReadExpression(section, childBinding),
12025
12288
  getScopeExpression(section, definedBodySection.parent)
@@ -12043,7 +12306,7 @@ var dynamic_tag_default = {
12043
12306
  const nodeBinding = tagExtra[kDOMBinding3];
12044
12307
  const isClassAPI = tagExtra.featureType === "class";
12045
12308
  let tagExpression = node.name;
12046
- if (import_compiler61.types.isStringLiteral(tagExpression)) {
12309
+ if (import_compiler63.types.isStringLiteral(tagExpression)) {
12047
12310
  tagExpression = (0, import_babel_utils51.importDefault)(
12048
12311
  tag.hub.file,
12049
12312
  getTagRelativePath(tag),
@@ -12053,14 +12316,14 @@ var dynamic_tag_default = {
12053
12316
  if (isClassAPI) {
12054
12317
  if (isOutputHTML()) {
12055
12318
  (0, import_babel_utils51.getProgram)().node.body.push(
12056
- import_compiler61.types.markoScriptlet(
12319
+ import_compiler63.types.markoScriptlet(
12057
12320
  [
12058
- import_compiler61.types.expressionStatement(
12059
- import_compiler61.types.callExpression(
12321
+ import_compiler63.types.expressionStatement(
12322
+ import_compiler63.types.callExpression(
12060
12323
  (0, import_babel_utils51.importNamed)(tag.hub.file, getCompatRuntimeFile(), "s"),
12061
12324
  [
12062
- import_compiler61.types.identifier(tagExpression.name),
12063
- import_compiler61.types.stringLiteral((0, import_babel_utils51.loadFileForTag)(tag).metadata.marko.id)
12325
+ import_compiler63.types.identifier(tagExpression.name),
12326
+ import_compiler63.types.stringLiteral((0, import_babel_utils51.loadFileForTag)(tag).metadata.marko.id)
12064
12327
  ]
12065
12328
  )
12066
12329
  )
@@ -12070,11 +12333,11 @@ var dynamic_tag_default = {
12070
12333
  );
12071
12334
  } else {
12072
12335
  (0, import_babel_utils51.getProgram)().node.body.push(
12073
- import_compiler61.types.expressionStatement(
12336
+ import_compiler63.types.expressionStatement(
12074
12337
  callRuntime(
12075
12338
  "_resume",
12076
- import_compiler61.types.stringLiteral((0, import_babel_utils51.loadFileForTag)(tag).metadata.marko.id),
12077
- import_compiler61.types.identifier(tagExpression.name)
12339
+ import_compiler63.types.stringLiteral((0, import_babel_utils51.loadFileForTag)(tag).metadata.marko.id),
12340
+ import_compiler63.types.identifier(tagExpression.name)
12078
12341
  )
12079
12342
  )
12080
12343
  );
@@ -12116,9 +12379,9 @@ var dynamic_tag_default = {
12116
12379
  getScopeIdIdentifier(tagSection),
12117
12380
  getScopeAccessorLiteral(nodeBinding),
12118
12381
  tagExpression,
12119
- import_compiler61.types.arrayExpression(args),
12120
- import_compiler61.types.numericLiteral(0),
12121
- import_compiler61.types.numericLiteral(1),
12382
+ import_compiler63.types.arrayExpression(args),
12383
+ import_compiler63.types.numericLiteral(0),
12384
+ import_compiler63.types.numericLiteral(1),
12122
12385
  serializeArg
12123
12386
  ) : callRuntime(
12124
12387
  "_dynamic_tag",
@@ -12126,8 +12389,8 @@ var dynamic_tag_default = {
12126
12389
  getScopeAccessorLiteral(nodeBinding),
12127
12390
  tagExpression,
12128
12391
  args[0],
12129
- args[1] || (serializeArg ? import_compiler61.types.numericLiteral(0) : void 0),
12130
- serializeArg ? import_compiler61.types.numericLiteral(0) : void 0,
12392
+ args[1] || (serializeArg ? import_compiler63.types.numericLiteral(0) : void 0),
12393
+ serializeArg ? import_compiler63.types.numericLiteral(0) : void 0,
12131
12394
  serializeArg
12132
12395
  );
12133
12396
  if (node.var) {
@@ -12135,18 +12398,18 @@ var dynamic_tag_default = {
12135
12398
  tag.get("name").toString() + "_scope"
12136
12399
  );
12137
12400
  statements.push(
12138
- import_compiler61.types.variableDeclaration("const", [
12139
- import_compiler61.types.variableDeclarator(
12401
+ import_compiler63.types.variableDeclaration("const", [
12402
+ import_compiler63.types.variableDeclarator(
12140
12403
  dynamicScopeIdentifier,
12141
12404
  callRuntime("_peek_scope_id")
12142
12405
  )
12143
12406
  ])
12144
12407
  );
12145
12408
  statements.push(
12146
- import_compiler61.types.variableDeclaration("let", [
12147
- import_compiler61.types.variableDeclarator(node.var, dynamicTagExpr)
12409
+ import_compiler63.types.variableDeclaration("let", [
12410
+ import_compiler63.types.variableDeclarator(node.var, dynamicTagExpr)
12148
12411
  ]),
12149
- import_compiler61.types.expressionStatement(
12412
+ import_compiler63.types.expressionStatement(
12150
12413
  callRuntime(
12151
12414
  "_var",
12152
12415
  getScopeIdIdentifier(tagSection),
@@ -12154,7 +12417,7 @@ var dynamic_tag_default = {
12154
12417
  tag.node.extra[kChildOffsetScopeBinding2]
12155
12418
  ),
12156
12419
  dynamicScopeIdentifier,
12157
- import_compiler61.types.stringLiteral(
12420
+ import_compiler63.types.stringLiteral(
12158
12421
  getResumeRegisterId(
12159
12422
  tagSection,
12160
12423
  node.var.extra?.binding,
@@ -12166,7 +12429,7 @@ var dynamic_tag_default = {
12166
12429
  )
12167
12430
  );
12168
12431
  } else {
12169
- statements.push(import_compiler61.types.expressionStatement(dynamicTagExpr));
12432
+ statements.push(import_compiler63.types.expressionStatement(dynamicTagExpr));
12170
12433
  }
12171
12434
  for (const replacement of tag.replaceWithMultiple(statements)) {
12172
12435
  replacement.skip();
@@ -12185,9 +12448,9 @@ var dynamic_tag_default = {
12185
12448
  tagVarSignal.register = true;
12186
12449
  tagVarSignal.buildAssignment = (valueSection, value) => {
12187
12450
  const changeArgs = [
12188
- import_compiler61.types.memberExpression(
12451
+ import_compiler63.types.memberExpression(
12189
12452
  getScopeExpression(tagVarSignal.section, valueSection),
12190
- import_compiler61.types.stringLiteral(
12453
+ import_compiler63.types.stringLiteral(
12191
12454
  getAccessorPrefix().ConditionalScope + getScopeAccessor(nodeBinding)
12192
12455
  ),
12193
12456
  true
@@ -12195,28 +12458,28 @@ var dynamic_tag_default = {
12195
12458
  value
12196
12459
  ];
12197
12460
  if (!isOptimize()) {
12198
- changeArgs.push(import_compiler61.types.stringLiteral(varBinding.name));
12461
+ changeArgs.push(import_compiler63.types.stringLiteral(varBinding.name));
12199
12462
  }
12200
- return import_compiler61.types.callExpression(importRuntime("_var_change"), changeArgs);
12463
+ return import_compiler63.types.callExpression(importRuntime("_var_change"), changeArgs);
12201
12464
  };
12202
12465
  }
12203
12466
  signal.build = () => {
12204
12467
  return callRuntime(
12205
12468
  "_dynamic_tag",
12206
12469
  getScopeAccessorLiteral(nodeBinding),
12207
- bodySection && import_compiler61.types.identifier(bodySection.name),
12208
- tagVarSignal ? import_compiler61.types.arrowFunctionExpression([], tagVarSignal.identifier) : void 0,
12209
- hasTagArgs && import_compiler61.types.numericLiteral(1)
12470
+ bodySection && import_compiler63.types.identifier(bodySection.name),
12471
+ tagVarSignal ? import_compiler63.types.arrowFunctionExpression([], tagVarSignal.identifier) : void 0,
12472
+ hasTagArgs && import_compiler63.types.numericLiteral(1)
12210
12473
  );
12211
12474
  };
12212
12475
  if (args.length) {
12213
- const argsOrInput = hasTagArgs ? import_compiler61.types.arrayExpression(args) : args[0];
12214
- if (!import_compiler61.types.isObjectExpression(argsOrInput) || argsOrInput.properties.length) {
12476
+ const argsOrInput = hasTagArgs ? import_compiler63.types.arrayExpression(args) : args[0];
12477
+ if (!import_compiler63.types.isObjectExpression(argsOrInput) || argsOrInput.properties.length) {
12215
12478
  signal.extraArgs = [
12216
- import_compiler61.types.arrowFunctionExpression(
12479
+ import_compiler63.types.arrowFunctionExpression(
12217
12480
  [],
12218
- statements.length ? import_compiler61.types.blockStatement(
12219
- statements.concat(import_compiler61.types.returnStatement(argsOrInput))
12481
+ statements.length ? import_compiler63.types.blockStatement(
12482
+ statements.concat(import_compiler63.types.returnStatement(argsOrInput))
12220
12483
  ) : argsOrInput
12221
12484
  )
12222
12485
  ];
@@ -12230,34 +12493,7 @@ var dynamic_tag_default = {
12230
12493
  };
12231
12494
 
12232
12495
  // src/translator/visitors/tag/index.ts
12233
- var TAG_NAME_IDENTIFIER_REG = /^[A-Z][a-zA-Z0-9_$]*$/;
12234
- var BINDING_CHANGE_HANDLER = /* @__PURE__ */ new WeakMap();
12235
12496
  var tag_default = {
12236
- transform: {
12237
- enter(tag) {
12238
- const { node } = tag;
12239
- const { name: name2, attributes } = tag.node;
12240
- let crawl = false;
12241
- if (import_compiler62.types.isStringLiteral(name2)) {
12242
- const tagName = name2.value;
12243
- if (tag.scope.getBinding(tagName) && TAG_NAME_IDENTIFIER_REG.test(tagName)) {
12244
- node.name = withPreviousLocation(import_compiler62.types.identifier(tagName), name2);
12245
- crawl = true;
12246
- }
12247
- }
12248
- for (let i = 0; i < attributes.length; i++) {
12249
- const attr = attributes[i];
12250
- if (import_compiler62.types.isMarkoAttribute(attr) && attr.bound) {
12251
- attr.bound = false;
12252
- attributes.splice(++i, 0, getChangeHandler(tag, attr));
12253
- crawl = true;
12254
- }
12255
- }
12256
- if (crawl) {
12257
- tag.scope.crawl();
12258
- }
12259
- }
12260
- },
12261
12497
  analyze: {
12262
12498
  enter(tag) {
12263
12499
  const tagDef = (0, import_babel_utils52.getTagDef)(tag);
@@ -12323,8 +12559,8 @@ var tag_default = {
12323
12559
  if (extra.tagNameDynamic && extra.tagNameNullable && !tag.get("name").isIdentifier() && isOutputHTML()) {
12324
12560
  const tagNameId = generateUidIdentifier("tagName");
12325
12561
  const [tagNameVarPath] = tag.insertBefore(
12326
- import_compiler62.types.variableDeclaration("const", [
12327
- import_compiler62.types.variableDeclarator(tagNameId, tag.node.name)
12562
+ import_compiler64.types.variableDeclaration("const", [
12563
+ import_compiler64.types.variableDeclarator(tagNameId, tag.node.name)
12328
12564
  ])
12329
12565
  );
12330
12566
  tagNameVarPath.skip();
@@ -12368,152 +12604,9 @@ var tag_default = {
12368
12604
  }
12369
12605
  }
12370
12606
  };
12371
- function getChangeHandler(tag, attr) {
12372
- const attrName = attr.name;
12373
- const changeAttrName = attrName + "Change";
12374
- if (import_compiler62.types.isIdentifier(attr.value)) {
12375
- const binding = tag.scope.getBinding(attr.value.name);
12376
- if (!binding)
12377
- return import_compiler62.types.markoAttribute(
12378
- changeAttrName,
12379
- buildChangeHandlerFunction(attr.value)
12380
- );
12381
- const existingChangedAttr = BINDING_CHANGE_HANDLER.get(binding.identifier);
12382
- if (!existingChangedAttr) {
12383
- const bindingIdentifierPath = binding.path.getOuterBindingIdentifierPaths()[binding.identifier.name];
12384
- const changeAttrExpr = bindingIdentifierPath ? bindingIdentifierPath.parentPath === binding.path ? buildChangeHandlerFunction(attr.value) : bindingIdentifierPath.parentPath.isObjectProperty() ? getChangeHandlerFromObjectPattern(
12385
- bindingIdentifierPath.parentPath
12386
- ) : void 0 : void 0;
12387
- if (!changeAttrExpr) {
12388
- throw tag.hub.buildError(attr.value, "Unable to bind to value.");
12389
- }
12390
- const changeHandlerAttr = import_compiler62.types.markoAttribute(
12391
- changeAttrName,
12392
- changeAttrExpr
12393
- );
12394
- BINDING_CHANGE_HANDLER.set(binding.identifier, changeHandlerAttr);
12395
- return changeHandlerAttr;
12396
- }
12397
- if (existingChangedAttr.type === "Identifier") {
12398
- return import_compiler62.types.markoAttribute(
12399
- changeAttrName,
12400
- withPreviousLocation(
12401
- import_compiler62.types.identifier(existingChangedAttr.name),
12402
- attr.value
12403
- )
12404
- );
12405
- }
12406
- const markoRoot = isMarko(binding.path) ? binding.path : getMarkoRoot(binding.path);
12407
- if (!(markoRoot?.isMarkoTag() || markoRoot?.isMarkoTagBody())) {
12408
- throw tag.hub.buildError(attr.value, "Unable to bind to value.");
12409
- }
12410
- const changeHandlerId = generateUid(changeAttrName);
12411
- const changeHandlerConst = import_compiler62.types.markoTag(
12412
- import_compiler62.types.stringLiteral("const"),
12413
- [import_compiler62.types.markoAttribute("value", existingChangedAttr.value, null, null, true)],
12414
- import_compiler62.types.markoTagBody([]),
12415
- null,
12416
- import_compiler62.types.identifier(changeHandlerId)
12417
- );
12418
- BINDING_CHANGE_HANDLER.set(
12419
- binding.identifier,
12420
- existingChangedAttr.value = import_compiler62.types.identifier(changeHandlerId)
12421
- );
12422
- if (markoRoot.isMarkoTag()) {
12423
- markoRoot.insertAfter(changeHandlerConst);
12424
- } else {
12425
- markoRoot.unshiftContainer("body", changeHandlerConst);
12426
- }
12427
- markoRoot.scope.crawl();
12428
- return import_compiler62.types.markoAttribute(
12429
- changeAttrName,
12430
- withPreviousLocation(import_compiler62.types.identifier(changeHandlerId), attr.value)
12431
- );
12432
- } else if (import_compiler62.types.isMemberExpression(attr.value)) {
12433
- const prop = attr.value.property;
12434
- if (!import_compiler62.types.isPrivateName(attr.value.property)) {
12435
- return import_compiler62.types.markoAttribute(
12436
- changeAttrName,
12437
- import_compiler62.types.memberExpression(
12438
- import_compiler62.types.cloneNode(attr.value.object),
12439
- prop.type === "Identifier" ? withPreviousLocation(import_compiler62.types.identifier(prop.name + "Change"), prop) : import_compiler62.types.binaryExpression(
12440
- "+",
12441
- import_compiler62.types.cloneNode(prop),
12442
- import_compiler62.types.stringLiteral("Change")
12443
- ),
12444
- prop.type !== "Identifier"
12445
- )
12446
- );
12447
- }
12448
- }
12449
- throw tag.hub.buildError(
12450
- attr.value,
12451
- "Attributes may only be bound to identifiers or member expressions"
12452
- );
12453
- }
12454
- function buildChangeHandlerFunction(id) {
12455
- const newId = "_new_" + id.name;
12456
- return import_compiler62.types.arrowFunctionExpression(
12457
- [withPreviousLocation(import_compiler62.types.identifier(newId), id)],
12458
- import_compiler62.types.blockStatement([
12459
- import_compiler62.types.expressionStatement(
12460
- import_compiler62.types.assignmentExpression(
12461
- "=",
12462
- withPreviousLocation(import_compiler62.types.identifier(id.name), id),
12463
- withPreviousLocation(import_compiler62.types.identifier(newId), id)
12464
- )
12465
- )
12466
- ])
12467
- );
12468
- }
12469
- function getChangeHandlerFromObjectPattern(parent) {
12470
- let changeKey;
12471
- const pattern = parent.parentPath;
12472
- if (parent.node.computed) {
12473
- changeKey = generateUidIdentifier(`dynamicChange`);
12474
- pattern.pushContainer(
12475
- "properties",
12476
- import_compiler62.types.objectProperty(
12477
- import_compiler62.types.binaryExpression(
12478
- "+",
12479
- parent.get("key").node,
12480
- import_compiler62.types.stringLiteral("Change")
12481
- ),
12482
- changeKey,
12483
- true
12484
- )
12485
- );
12486
- } else {
12487
- const key = parent.get("key");
12488
- const searchKey = `${getStringOrIdentifierValue(key)}Change`;
12489
- for (const prop of pattern.get("properties")) {
12490
- if (prop.isObjectProperty()) {
12491
- const propKey = prop.get("key");
12492
- const propValue = prop.get("value");
12493
- if (!prop.node.computed && getStringOrIdentifierValue(propKey) === searchKey && propValue.isIdentifier()) {
12494
- changeKey = propValue.node;
12495
- break;
12496
- }
12497
- }
12498
- }
12499
- if (!changeKey) {
12500
- pattern.unshiftContainer(
12501
- "properties",
12502
- import_compiler62.types.objectProperty(
12503
- import_compiler62.types.stringLiteral(searchKey),
12504
- changeKey = generateUidIdentifier(searchKey)
12505
- )
12506
- );
12507
- }
12508
- }
12509
- return changeKey;
12510
- }
12511
- function getStringOrIdentifierValue(path5) {
12512
- return path5.isStringLiteral() ? path5.node.value : path5.node.name;
12513
- }
12514
12607
 
12515
12608
  // src/translator/visitors/text.ts
12516
- var import_compiler63 = require("@marko/compiler");
12609
+ var import_compiler65 = require("@marko/compiler");
12517
12610
  var text_default = {
12518
12611
  translate: {
12519
12612
  exit(text) {