@spectrum-web-components/checkbox 0.13.2 → 0.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/checkbox",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -44,10 +44,10 @@
44
44
  "lit-html"
45
45
  ],
46
46
  "dependencies": {
47
- "@spectrum-web-components/base": "^0.5.6",
48
- "@spectrum-web-components/icon": "^0.11.8",
49
- "@spectrum-web-components/icons-ui": "^0.8.8",
50
- "@spectrum-web-components/shared": "^0.14.1",
47
+ "@spectrum-web-components/base": "^0.5.7",
48
+ "@spectrum-web-components/icon": "^0.11.9",
49
+ "@spectrum-web-components/icons-ui": "^0.8.9",
50
+ "@spectrum-web-components/shared": "^0.14.2",
51
51
  "tslib": "^2.0.0"
52
52
  },
53
53
  "devDependencies": {
@@ -58,5 +58,5 @@
58
58
  "sideEffects": [
59
59
  "./sp-*.js"
60
60
  ],
61
- "gitHead": "8f5ea3556e160b6e30815edb2414dc5a5999a925"
61
+ "gitHead": "275ee61b152ac3eed0cd1603d8eab2aec90876a0"
62
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["Checkbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAGH,IAAI,EAEJ,UAAU,GAEb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,gEAAgE,CAAC;AACxE,OAAO,iEAAiE,CAAC;AACzE,OAAO,iEAAiE,CAAC;AACzE,OAAO,iEAAiE,CAAC;AACzE,OAAO,2DAA2D,CAAC;AACnE,OAAO,4DAA4D,CAAC;AACpE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,cAAc,EAAE,MAAM,CAAC,CAAC;aAC1D;iBAAM;gBACH,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;aACrD;SACJ;QACD,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;YAC9B,IAAI,IAAI,CAAC,aAAa,EAAE;gBACpB,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;aAC3D;iBAAM;gBACH,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;aACrD;SACJ;IACL,CAAC;CACJ;AAxCG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACd;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCACpB;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CACjB","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n DefaultElementSize,\n html,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { CheckboxBase } from './CheckboxBase.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark300.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash300.js';\nimport checkboxStyles from './checkbox.css.js';\nimport checkmarkSmallStyles from '@spectrum-web-components/icon/src/spectrum-icon-checkmark.css.js';\nimport dashSmallStyles from '@spectrum-web-components/icon/src/spectrum-icon-dash.css.js';\n\nconst checkmarkIcon = {\n s: html`\n <sp-icon-checkmark75\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark75\"\n ></sp-icon-checkmark75>\n `,\n m: html`\n <sp-icon-checkmark100\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark100\"\n ></sp-icon-checkmark100>\n `,\n l: html`\n <sp-icon-checkmark200\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark200\"\n ></sp-icon-checkmark200>\n `,\n xl: html`\n <sp-icon-checkmark300\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark300\"\n ></sp-icon-checkmark300>\n `,\n};\n\nconst dashIcon = {\n s: html`\n <sp-icon-dash75\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash75\"\n ></sp-icon-dash75>\n `,\n m: html`\n <sp-icon-dash100\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash100\"\n ></sp-icon-dash100>\n `,\n l: html`\n <sp-icon-dash200\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash200\"\n ></sp-icon-dash200>\n `,\n xl: html`\n <sp-icon-dash300\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash300\"\n ></sp-icon-dash300>\n `,\n};\n\n/**\n * @element sp-checkbox\n * @slot - content to display as the label for the Checkbox\n */\nexport class Checkbox extends SizedMixin(CheckboxBase) {\n @property({ type: Boolean, reflect: true })\n public indeterminate = false;\n\n @property({ type: Boolean, reflect: true })\n public invalid = false;\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n public static get styles(): CSSResultArray {\n return [checkboxStyles, checkmarkSmallStyles, dashSmallStyles];\n }\n\n protected render(): TemplateResult {\n return html`\n ${super.render()}\n <span id=\"box\">\n ${checkmarkIcon[this.size as DefaultElementSize]}\n ${dashIcon[this.size as DefaultElementSize]}\n </span>\n <label id=\"label\"><slot></slot></label>\n `;\n }\n\n protected updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('invalid')) {\n if (this.invalid) {\n this.inputElement.setAttribute('aria-invalid', 'true');\n } else {\n this.inputElement.removeAttribute('aria-invalid');\n }\n }\n if (changes.has('indeterminate')) {\n if (this.indeterminate) {\n this.inputElement.setAttribute('aria-checked', 'mixed');\n } else {\n this.inputElement.removeAttribute('aria-checked');\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["Checkbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAGH,IAAI,EAEJ,UAAU,GAEb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,gEAAgE,CAAC;AACxE,OAAO,iEAAiE,CAAC;AACzE,OAAO,iEAAiE,CAAC;AACzE,OAAO,iEAAiE,CAAC;AACzE,OAAO,2DAA2D,CAAC;AACnE,OAAO,4DAA4D,CAAC;AACpE,OAAO,4DAA4D,CAAC;AACpE,OAAO,4DAA4D,CAAC;AACpE,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,oBAAoB,MAAM,kEAAkE,CAAC;AACpG,OAAO,eAAe,MAAM,6DAA6D,CAAC;AAE1F,MAAM,aAAa,GAAG;IAClB,CAAC,EAAE,IAAI,CAAA;;;;;KA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AAC,YAAY,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;aAC3D;iBAAM;gBACH,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;aACrD;SACJ;IACL,CAAC;CACJ;AAxCG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACd;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCACpB;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CACjB","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n DefaultElementSize,\n html,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { CheckboxBase } from './CheckboxBase.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark300.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-dash300.js';\nimport checkboxStyles from './checkbox.css.js';\nimport checkmarkSmallStyles from '@spectrum-web-components/icon/src/spectrum-icon-checkmark.css.js';\nimport dashSmallStyles from '@spectrum-web-components/icon/src/spectrum-icon-dash.css.js';\n\nconst checkmarkIcon = {\n s: html`\n <sp-icon-checkmark75\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark75\"\n ></sp-icon-checkmark75>\n `,\n m: html`\n <sp-icon-checkmark100\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark100\"\n ></sp-icon-checkmark100>\n `,\n l: html`\n <sp-icon-checkmark200\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark200\"\n ></sp-icon-checkmark200>\n `,\n xl: html`\n <sp-icon-checkmark300\n id=\"checkmark\"\n class=\"spectrum-UIIcon-Checkmark300\"\n ></sp-icon-checkmark300>\n `,\n};\n\nconst dashIcon = {\n s: html`\n <sp-icon-dash75\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash75\"\n ></sp-icon-dash75>\n `,\n m: html`\n <sp-icon-dash100\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash100\"\n ></sp-icon-dash100>\n `,\n l: html`\n <sp-icon-dash200\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash200\"\n ></sp-icon-dash200>\n `,\n xl: html`\n <sp-icon-dash300\n id=\"partialCheckmark\"\n class=\"spectrum-UIIcon-Dash300\"\n ></sp-icon-dash300>\n `,\n};\n\n/**\n * @element sp-checkbox\n * @slot - content to display as the label for the Checkbox\n */\nexport class Checkbox extends SizedMixin(CheckboxBase) {\n @property({ type: Boolean, reflect: true })\n public indeterminate = false;\n\n @property({ type: Boolean, reflect: true })\n public invalid = false;\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n public static override get styles(): CSSResultArray {\n return [checkboxStyles, checkmarkSmallStyles, dashSmallStyles];\n }\n\n protected override render(): TemplateResult {\n return html`\n ${super.render()}\n <span id=\"box\">\n ${checkmarkIcon[this.size as DefaultElementSize]}\n ${dashIcon[this.size as DefaultElementSize]}\n </span>\n <label id=\"label\"><slot></slot></label>\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('invalid')) {\n if (this.invalid) {\n this.inputElement.setAttribute('aria-invalid', 'true');\n } else {\n this.inputElement.removeAttribute('aria-invalid');\n }\n }\n if (changes.has('indeterminate')) {\n if (this.indeterminate) {\n this.inputElement.setAttribute('aria-checked', 'mixed');\n } else {\n this.inputElement.removeAttribute('aria-checked');\n }\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxBase.js","sourceRoot":"","sources":["CheckboxBase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AACrE,OAAO,EACH,QAAQ,EACR,KAAK,GACR,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,kDAAkD,CAAC;AAE7E,MAAM,OAAO,YAAa,SAAQ,SAAS;IAA3C;;QAEW,YAAO,GAAG,KAAK,CAAC;QAGhB,aAAQ,GAAG,KAAK,CAAC;IAuC5B,CAAC;IAlCG,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAEM,YAAY,CAAC,KAAY;QAC5B,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,IAAI,CAAC,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YACzC,OAAO;SACV;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;QAEzC,6DAA6D;QAC7D,uBAAuB;QACvB,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,QAAQ,EAAE;YAC1C,MAAM,EAAE;gBACJ,WAAW,EAAE,KAAK;aACrB;YACD,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,UAAU,EAAE,KAAK,CAAC,UAAU;SAC/B,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC;IAES,MAAM;QACZ,OAAO,IAAI,CAAA;;;;;2BAKQ,IAAI,CAAC,OAAO;0BACb,IAAI,CAAC,YAAY;;SAElC,CAAC;IACN,CAAC;CACJ;AA1CG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACpB;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CACnB;AAGxB;IADC,KAAK,CAAC,QAAQ,CAAC;kDAC0B","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\n\nexport class CheckboxBase extends Focusable {\n @property({ type: Boolean, reflect: true })\n public checked = false;\n\n @property({ type: Boolean, reflect: true })\n public readonly = false;\n\n @query('#input')\n protected inputElement!: HTMLInputElement;\n\n public get focusElement(): HTMLElement {\n return this.inputElement;\n }\n\n public handleChange(event: Event): void {\n if (this.readonly) {\n this.inputElement.checked = this.checked;\n return;\n }\n this.checked = this.inputElement.checked;\n\n // Change events from the shadow DOM are not transmitted into\n // the parent light DOM\n const changeEvent = new CustomEvent('change', {\n detail: {\n sourceEvent: event,\n },\n bubbles: event.bubbles,\n cancelable: event.cancelable,\n });\n this.dispatchEvent(changeEvent);\n }\n\n protected render(): TemplateResult {\n return html`\n <input\n id=\"input\"\n aria-labelledby=\"label\"\n type=\"checkbox\"\n .checked=${this.checked}\n @change=${this.handleChange}\n />\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"CheckboxBase.js","sourceRoot":"","sources":["CheckboxBase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AACrE,OAAO,EACH,QAAQ,EACR,KAAK,GACR,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,kDAAkD,CAAC;AAE7E,MAAM,OAAO,YAAa,SAAQ,SAAS;IAA3C;;QAEW,YAAO,GAAG,KAAK,CAAC;QAGhB,aAAQ,GAAG,KAAK,CAAC;IAuC5B,CAAC;IAlCG,IAAoB,YAAY;QAC5B,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAEM,YAAY,CAAC,KAAY;QAC5B,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,IAAI,CAAC,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YACzC,OAAO;SACV;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;QAEzC,6DAA6D;QAC7D,uBAAuB;QACvB,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,QAAQ,EAAE;YAC1C,MAAM,EAAE;gBACJ,WAAW,EAAE,KAAK;aACrB;YACD,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,UAAU,EAAE,KAAK,CAAC,UAAU;SAC/B,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC;IAEkB,MAAM;QACrB,OAAO,IAAI,CAAA;;;;;2BAKQ,IAAI,CAAC,OAAO;0BACb,IAAI,CAAC,YAAY;;SAElC,CAAC;IACN,CAAC;CACJ;AA1CG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACpB;AAGvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CACnB;AAGxB;IADC,KAAK,CAAC,QAAQ,CAAC;kDAC0B","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\n\nexport class CheckboxBase extends Focusable {\n @property({ type: Boolean, reflect: true })\n public checked = false;\n\n @property({ type: Boolean, reflect: true })\n public readonly = false;\n\n @query('#input')\n protected inputElement!: HTMLInputElement;\n\n public override get focusElement(): HTMLElement {\n return this.inputElement;\n }\n\n public handleChange(event: Event): void {\n if (this.readonly) {\n this.inputElement.checked = this.checked;\n return;\n }\n this.checked = this.inputElement.checked;\n\n // Change events from the shadow DOM are not transmitted into\n // the parent light DOM\n const changeEvent = new CustomEvent('change', {\n detail: {\n sourceEvent: event,\n },\n bubbles: event.bubbles,\n cancelable: event.cancelable,\n });\n this.dispatchEvent(changeEvent);\n }\n\n protected override render(): TemplateResult {\n return html`\n <input\n id=\"input\"\n aria-labelledby=\"label\"\n type=\"checkbox\"\n .checked=${this.checked}\n @change=${this.handleChange}\n />\n `;\n }\n}\n"]}