@paperless/core 1.64.0 → 1.64.2

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{paperless/p-7d396ed7.entry.js → build/p-01adf065.entry.js} +2 -2
  3. package/dist/{paperless/p-7d396ed7.entry.js.map → build/p-01adf065.entry.js.map} +1 -1
  4. package/dist/build/{p-5fa3061e.entry.js → p-0b0c43cc.entry.js} +2 -2
  5. package/dist/build/p-0b0c43cc.entry.js.map +1 -0
  6. package/dist/build/paperless.esm.js +1 -1
  7. package/dist/cjs/p-floating-menu-container_8.cjs.entry.js +1 -1
  8. package/dist/cjs/p-floating-menu-container_8.cjs.entry.js.map +1 -1
  9. package/dist/cjs/p-stepper.cjs.entry.js +5 -7
  10. package/dist/cjs/p-stepper.cjs.entry.js.map +1 -1
  11. package/dist/collection/components/molecules/stepper/stepper.component.js +5 -7
  12. package/dist/collection/components/molecules/stepper/stepper.component.js.map +1 -1
  13. package/dist/collection/components/molecules/table-row/table-row.component.css +1 -1
  14. package/dist/components/p-stepper.js +5 -7
  15. package/dist/components/p-stepper.js.map +1 -1
  16. package/dist/components/table-row.component.js +1 -1
  17. package/dist/components/table-row.component.js.map +1 -1
  18. package/dist/esm/p-floating-menu-container_8.entry.js +1 -1
  19. package/dist/esm/p-floating-menu-container_8.entry.js.map +1 -1
  20. package/dist/esm/p-stepper.entry.js +5 -7
  21. package/dist/esm/p-stepper.entry.js.map +1 -1
  22. package/dist/index.html +1 -1
  23. package/dist/{build/p-7d396ed7.entry.js → paperless/p-01adf065.entry.js} +2 -2
  24. package/dist/{build/p-7d396ed7.entry.js.map → paperless/p-01adf065.entry.js.map} +1 -1
  25. package/dist/paperless/{p-5fa3061e.entry.js → p-0b0c43cc.entry.js} +2 -2
  26. package/dist/paperless/p-0b0c43cc.entry.js.map +1 -0
  27. package/dist/paperless/paperless.esm.js +1 -1
  28. package/dist/sw.js +1 -1
  29. package/dist/sw.js.map +1 -1
  30. package/hydrate/index.js +6 -8
  31. package/package.json +1 -1
  32. package/dist/build/p-5fa3061e.entry.js.map +0 -1
  33. package/dist/paperless/p-5fa3061e.entry.js.map +0 -1
package/hydrate/index.js CHANGED
@@ -21734,7 +21734,7 @@ class Stepper {
21734
21734
  registerInstance(this, hostRef);
21735
21735
  this._loaded = false;
21736
21736
  // private _steps: Array<HTMLPStepperItemElement>;
21737
- this._delay = (amount) => new Promise((resolve) => setTimeout(resolve, amount));
21737
+ this._delay = (amount) => new Promise(resolve => setTimeout(resolve, amount));
21738
21738
  this._onSlotChange = async (_e) => this._generateSteps();
21739
21739
  this._generateSteps = async (firstLoad = false) => {
21740
21740
  if (!firstLoad && (!this._el || this._rendering || !this._loaded)) {
@@ -21768,8 +21768,7 @@ class Stepper {
21768
21768
  item.contentPosition = this.contentPosition;
21769
21769
  if (i < items.length - 1) {
21770
21770
  const nextItem = item.nextElementSibling;
21771
- if (nextItem &&
21772
- nextItem.tagName.toLowerCase() === 'p-stepper-item') {
21771
+ if (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {
21773
21772
  // super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight
21774
21773
  // otherwise we always get the initial "16"
21775
21774
  if (directionChanged) {
@@ -21780,7 +21779,7 @@ class Stepper {
21780
21779
  : item.clientHeight) / 2;
21781
21780
  const stepperLine = document.createElement('p-stepper-line');
21782
21781
  stepperLine.direction = this.direction;
21783
- stepperLine.active = i <= activeStep;
21782
+ stepperLine.active = i < activeStep;
21784
21783
  if (heightDiff > 0 && this.direction === 'vertical') {
21785
21784
  stepperLine.style.marginTop = `-${heightDiff / 16}rem`;
21786
21785
  stepperLine.style.marginBottom = `-${heightDiff / 16}rem`;
@@ -21788,8 +21787,7 @@ class Stepper {
21788
21787
  }
21789
21788
  this._el.insertBefore(stepperLine, nextItem);
21790
21789
  const previous = stepperLine.previousElementSibling;
21791
- if (previous &&
21792
- previous.tagName.toLowerCase() === 'p-stepper-line') {
21790
+ if (previous && previous.tagName.toLowerCase() === 'p-stepper-line') {
21793
21791
  previous.remove();
21794
21792
  }
21795
21793
  continue;
@@ -21820,7 +21818,7 @@ class Stepper {
21820
21818
  this._generateSteps(true);
21821
21819
  }
21822
21820
  render() {
21823
- return (hAsync(Host, { class: "p-stepper" }, hAsync("slot", { onSlotchange: this._onSlotChange })));
21821
+ return (hAsync(Host, { class: 'p-stepper' }, hAsync("slot", { onSlotchange: this._onSlotChange })));
21824
21822
  }
21825
21823
  _onActiveStepChange() {
21826
21824
  this._generateSteps();
@@ -23794,7 +23792,7 @@ class TableHeader {
23794
23792
  }; }
23795
23793
  }
23796
23794
 
23797
- const tableRowComponentCss = "/*!@.flex*/.flex.sc-p-table-row{display:flex!important}/*!@.min-h-0*/.min-h-0.sc-p-table-row{min-height:0!important}/*!@.min-h-\\[3\\.875rem\\]*/.min-h-\\[3\\.875rem\\].sc-p-table-row{min-height:3.875rem!important}/*!@.w-full*/.w-full.sc-p-table-row{width:100%!important}/*!@.cursor-pointer*/.cursor-pointer.sc-p-table-row{cursor:pointer!important}/*!@.flex-nowrap*/.flex-nowrap.sc-p-table-row{flex-wrap:nowrap!important}/*!@.items-center*/.items-center.sc-p-table-row{align-items:center!important}/*!@.justify-between*/.justify-between.sc-p-table-row{justify-content:space-between!important}/*!@.border-x-0*/.border-x-0.sc-p-table-row{border-left-width:0!important;border-right-width:0!important}/*!@.border-y*/.border-y.sc-p-table-row{border-bottom-width:1px!important;border-top-width:1px!important}/*!@.border-solid*/.border-solid.sc-p-table-row{border-style:solid!important}/*!@.border-y-mystic-dark*/.border-y-mystic-dark.sc-p-table-row{--tw-border-opacity:1!important;border-bottom-color:rgb(218 230 240/var(--tw-border-opacity))!important;border-top-color:rgb(218 230 240/var(--tw-border-opacity))!important}/*!@.py-2*/.py-2.sc-p-table-row{padding-bottom:.5rem!important;padding-top:.5rem!important}/*!@.text-sm*/.text-sm.sc-p-table-row{font-size:.875rem!important;line-height:1.25rem!important}/*!@.text-xs*/.text-xs.sc-p-table-row{font-size:.75rem!important;line-height:1rem!important}/*!@.font-semibold*/.font-semibold.sc-p-table-row{font-weight:600!important}/*!@.uppercase*/.uppercase.sc-p-table-row{text-transform:uppercase!important}/*!@**/*.sc-p-table-row{box-sizing:border-box}/*!@:host*/.sc-p-table-row-h{--tw-text-opacity:1;color:rgb(128 130 158/var(--tw-text-opacity));display:flex;flex-direction:column;font-size:.875rem;line-height:1.25rem;padding-left:1.5rem;padding-right:1.5rem;width:100%}/*!@:host .content*/.sc-p-table-row-h .content.sc-p-table-row{align-items:center;display:flex;flex-wrap:nowrap;justify-content:space-between;min-height:3.875rem;padding-bottom:.5rem;padding-top:.5rem;width:100%}@media (min-width:40rem){/*!@:host .content*/.sc-p-table-row-h .content.sc-p-table-row{height:4.5rem;padding-bottom:1.5rem;padding-top:1.5rem}}/*!@:host(.variant-header)*/.variant-header.sc-p-table-row-h{--tw-bg-opacity:1;--tw-text-opacity:1;--tw-border-opacity:1!important;background-color:rgb(252 253 254/var(--tw-bg-opacity));border-bottom:1px solid rgb(218 230 240/var(--tw-border-opacity))!important;border-left-style:solid!important;border-left-width:0!important;border-right-style:solid!important;border-right-width:0!important;border-top:1px solid rgb(218 230 240/var(--tw-border-opacity))!important;color:rgb(152 154 183/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;text-transform:uppercase}/*!@:host(.variant-header) .content*/.variant-header.sc-p-table-row-h .content.sc-p-table-row{min-height:0;padding-bottom:.5rem;padding-top:.5rem}@media (min-width:40rem){/*!@:host(.variant-header) .content*/.variant-header.sc-p-table-row-h .content.sc-p-table-row{height:auto}}/*!@:host(.enable-hover:hover)*/.enable-hover.sc-p-table-row-h:hover{--tw-bg-opacity:1;background-color:rgb(241 246 255/var(--tw-bg-opacity));cursor:pointer}@media (min-width:40rem){/*!@.tablet\\:h-18*/.tablet\\:h-18.sc-p-table-row{height:4.5rem!important}}/*!@.static*/.static.sc-p-table-row{position:static!important}/*!@.m-0*/.m-0.sc-p-table-row{margin:0!important}/*!@.table-row*/.table-row.sc-p-table-row{display:table-row!important}";
23795
+ const tableRowComponentCss = "/*!@.relative*/.relative.sc-p-table-row{position:relative!important}/*!@.flex*/.flex.sc-p-table-row{display:flex!important}/*!@.min-h-0*/.min-h-0.sc-p-table-row{min-height:0!important}/*!@.min-h-\\[3\\.875rem\\]*/.min-h-\\[3\\.875rem\\].sc-p-table-row{min-height:3.875rem!important}/*!@.w-full*/.w-full.sc-p-table-row{width:100%!important}/*!@.cursor-pointer*/.cursor-pointer.sc-p-table-row{cursor:pointer!important}/*!@.flex-nowrap*/.flex-nowrap.sc-p-table-row{flex-wrap:nowrap!important}/*!@.items-center*/.items-center.sc-p-table-row{align-items:center!important}/*!@.justify-between*/.justify-between.sc-p-table-row{justify-content:space-between!important}/*!@.border-x-0*/.border-x-0.sc-p-table-row{border-left-width:0!important;border-right-width:0!important}/*!@.border-y*/.border-y.sc-p-table-row{border-bottom-width:1px!important;border-top-width:1px!important}/*!@.border-solid*/.border-solid.sc-p-table-row{border-style:solid!important}/*!@.border-y-mystic-dark*/.border-y-mystic-dark.sc-p-table-row{--tw-border-opacity:1!important;border-bottom-color:rgb(218 230 240/var(--tw-border-opacity))!important;border-top-color:rgb(218 230 240/var(--tw-border-opacity))!important}/*!@.py-2*/.py-2.sc-p-table-row{padding-bottom:.5rem!important;padding-top:.5rem!important}/*!@.text-sm*/.text-sm.sc-p-table-row{font-size:.875rem!important;line-height:1.25rem!important}/*!@.text-xs*/.text-xs.sc-p-table-row{font-size:.75rem!important;line-height:1rem!important}/*!@.font-semibold*/.font-semibold.sc-p-table-row{font-weight:600!important}/*!@.uppercase*/.uppercase.sc-p-table-row{text-transform:uppercase!important}/*!@**/*.sc-p-table-row{box-sizing:border-box}/*!@:host*/.sc-p-table-row-h{--tw-text-opacity:1;color:rgb(128 130 158/var(--tw-text-opacity));display:flex;flex-direction:column;font-size:.875rem;line-height:1.25rem;padding-left:1.5rem;padding-right:1.5rem;width:100%}/*!@:host .content*/.sc-p-table-row-h .content.sc-p-table-row{align-items:center;display:flex;flex-wrap:nowrap;justify-content:space-between;min-height:3.875rem;padding-bottom:.5rem;padding-top:.5rem;position:relative;width:100%}@media (min-width:40rem){/*!@:host .content*/.sc-p-table-row-h .content.sc-p-table-row{height:4.5rem;padding-bottom:1.5rem;padding-top:1.5rem}}/*!@:host(.variant-header)*/.variant-header.sc-p-table-row-h{--tw-bg-opacity:1;--tw-text-opacity:1;--tw-border-opacity:1!important;background-color:rgb(252 253 254/var(--tw-bg-opacity));border-bottom:1px solid rgb(218 230 240/var(--tw-border-opacity))!important;border-left-style:solid!important;border-left-width:0!important;border-right-style:solid!important;border-right-width:0!important;border-top:1px solid rgb(218 230 240/var(--tw-border-opacity))!important;color:rgb(152 154 183/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;text-transform:uppercase}/*!@:host(.variant-header) .content*/.variant-header.sc-p-table-row-h .content.sc-p-table-row{min-height:0;padding-bottom:.5rem;padding-top:.5rem}@media (min-width:40rem){/*!@:host(.variant-header) .content*/.variant-header.sc-p-table-row-h .content.sc-p-table-row{height:auto}}/*!@:host(.enable-hover:hover)*/.enable-hover.sc-p-table-row-h:hover{--tw-bg-opacity:1;background-color:rgb(241 246 255/var(--tw-bg-opacity));cursor:pointer}@media (min-width:40rem){/*!@.tablet\\:h-18*/.tablet\\:h-18.sc-p-table-row{height:4.5rem!important}}/*!@.static*/.static.sc-p-table-row{position:static!important}/*!@.m-0*/.m-0.sc-p-table-row{margin:0!important}/*!@.table-row*/.table-row.sc-p-table-row{display:table-row!important}";
23798
23796
 
23799
23797
  class TableRow {
23800
23798
  constructor(hostRef) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paperless/core",
3
- "version": "1.64.0",
3
+ "version": "1.64.2",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- {"version":3,"names":["stepperComponentCss","Stepper","this","_loaded","_delay","amount","Promise","resolve","setTimeout","_onSlotChange","async","_e","_generateSteps","firstLoad","_el","_rendering","activeStep","items","querySelectorAll","i","length","item","active","finished","directionChanged","direction","align","contentPosition","nextItem","nextElementSibling","tagName","toLowerCase","heightDiff","clientHeight","stepperLine","document","createElement","style","marginTop","marginBottom","minHeight","insertBefore","previous","previousElementSibling","remove","previousItem","lines","j","line","componentDidLoad","render","h","Host","class","onSlotchange","_onActiveStepChange"],"sources":["src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n\t@apply flex-col flex-wrap items-start;\n\t@apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply items-end;\n}\n","import { Component, Element, h, Host, Prop, State, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _rendering = false;\n\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tprivate _delay = (amount: number) =>\n\t\tnew Promise((resolve) => setTimeout(resolve, amount));\n\n\tprivate _onSlotChange = async (_e: Event) => this._generateSteps();\n\n\tprivate _generateSteps = async (firstLoad = false) => {\n\t\tif (!firstLoad && (!this._el || this._rendering || !this._loaded)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._rendering = true;\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\t\tconst item = items.item(i) as any;\n\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tlet directionChanged = false;\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\titem.active = i === activeStep;\n\t\t\titem.finished = i < activeStep;\n\n\t\t\tif (item.direction !== this.direction) {\n\t\t\t\tdirectionChanged = true;\n\t\t\t}\n\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\ti === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tconst nextItem = item.nextElementSibling;\n\n\t\t\t\tif (\n\t\t\t\t\tnextItem &&\n\t\t\t\t\tnextItem.tagName.toLowerCase() === 'p-stepper-item'\n\t\t\t\t) {\n\t\t\t\t\t// super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight\n\t\t\t\t\t// otherwise we always get the initial \"16\"\n\t\t\t\t\tif (directionChanged) {\n\t\t\t\t\t\tawait this._delay(10);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst heightDiff =\n\t\t\t\t\t\t(item.clientHeight > 16\n\t\t\t\t\t\t\t? item.clientHeight - 16\n\t\t\t\t\t\t\t: item.clientHeight) / 2;\n\n\t\t\t\t\tconst stepperLine =\n\t\t\t\t\t\tdocument.createElement('p-stepper-line');\n\n\t\t\t\t\tstepperLine.direction = this.direction;\n\t\t\t\t\tstepperLine.active = i <= activeStep;\n\n\t\t\t\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\t\t\theightDiff / 16\n\t\t\t\t\t\t}rem`;\n\t\t\t\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t\t\t\t(heightDiff * 2) / 16\n\t\t\t\t\t\t}rem)`;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (\n\t\t\t\t\t\tprevious &&\n\t\t\t\t\t\tprevious.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t\t) {\n\t\t\t\t\t\tprevious.remove();\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\tpreviousItem.direction = this.direction;\n\t\t\t\t\tpreviousItem.active = item.active || item.finished;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst lines = this._el.querySelectorAll(\n\t\t\t'p-stepper-line:not(:has(+ p-stepper-item)), p-stepper-line:first-child'\n\t\t);\n\t\tfor (let j = lines.length - 1; j >= 0; j--) {\n\t\t\tconst line = lines.item(j);\n\t\t\tline.remove();\n\t\t}\n\n\t\tsetTimeout(() => (this._rendering = false), 100);\n\t};\n\n\tcomponentDidLoad() {\n\t\tthis._loaded = true;\n\t\tthis._generateSteps(true);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper\">\n\t\t\t\t<slot onSlotchange={this._onSlotChange} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\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3,"names":["stepperComponentCss","Stepper","this","_loaded","_delay","amount","Promise","resolve","setTimeout","_onSlotChange","async","_e","_generateSteps","firstLoad","_el","_rendering","activeStep","items","querySelectorAll","i","length","item","active","finished","directionChanged","direction","align","contentPosition","nextItem","nextElementSibling","tagName","toLowerCase","heightDiff","clientHeight","stepperLine","document","createElement","style","marginTop","marginBottom","minHeight","insertBefore","previous","previousElementSibling","remove","previousItem","lines","j","line","componentDidLoad","render","h","Host","class","onSlotchange","_onActiveStepChange"],"sources":["src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n\t@apply flex-col flex-wrap items-start;\n\t@apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply items-end;\n}\n","import { Component, Element, h, Host, Prop, State, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' =\n\t\t'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _rendering = false;\n\n\tprivate _loaded = false;\n\n\t// private _steps: Array<HTMLPStepperItemElement>;\n\n\tprivate _delay = (amount: number) =>\n\t\tnew Promise((resolve) => setTimeout(resolve, amount));\n\n\tprivate _onSlotChange = async (_e: Event) => this._generateSteps();\n\n\tprivate _generateSteps = async (firstLoad = false) => {\n\t\tif (!firstLoad && (!this._el || this._rendering || !this._loaded)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._rendering = true;\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\t\tconst item = items.item(i) as any;\n\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tlet directionChanged = false;\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\titem.active = i === activeStep;\n\t\t\titem.finished = i < activeStep;\n\n\t\t\tif (item.direction !== this.direction) {\n\t\t\t\tdirectionChanged = true;\n\t\t\t}\n\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\ti === 0 ? 'start' : i === items?.length - 1 ? 'end' : 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tconst nextItem = item.nextElementSibling;\n\n\t\t\t\tif (\n\t\t\t\t\tnextItem &&\n\t\t\t\t\tnextItem.tagName.toLowerCase() === 'p-stepper-item'\n\t\t\t\t) {\n\t\t\t\t\t// super hacky, but we want to wait for the css of the `item.direction` change to be applied before querying for the item.clientHeight\n\t\t\t\t\t// otherwise we always get the initial \"16\"\n\t\t\t\t\tif (directionChanged) {\n\t\t\t\t\t\tawait this._delay(10);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst heightDiff =\n\t\t\t\t\t\t(item.clientHeight > 16\n\t\t\t\t\t\t\t? item.clientHeight - 16\n\t\t\t\t\t\t\t: item.clientHeight) / 2;\n\n\t\t\t\t\tconst stepperLine =\n\t\t\t\t\t\tdocument.createElement('p-stepper-line');\n\n\t\t\t\t\tstepperLine.direction = this.direction;\n\t\t\t\t\tstepperLine.active = i <= activeStep;\n\n\t\t\t\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\t\t\tstepperLine.style.marginBottom = `-${\n\t\t\t\t\t\t\theightDiff / 16\n\t\t\t\t\t\t}rem`;\n\t\t\t\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t\t\t\t(heightDiff * 2) / 16\n\t\t\t\t\t\t}rem)`;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (\n\t\t\t\t\t\tprevious &&\n\t\t\t\t\t\tprevious.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t\t) {\n\t\t\t\t\t\tprevious.remove();\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (previousItem.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\tpreviousItem.direction = this.direction;\n\t\t\t\t\tpreviousItem.active = item.active || item.finished;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst lines = this._el.querySelectorAll(\n\t\t\t'p-stepper-line:not(:has(+ p-stepper-item)), p-stepper-line:first-child'\n\t\t);\n\t\tfor (let j = lines.length - 1; j >= 0; j--) {\n\t\t\tconst line = lines.item(j);\n\t\t\tline.remove();\n\t\t}\n\n\t\tsetTimeout(() => (this._rendering = false), 100);\n\t};\n\n\tcomponentDidLoad() {\n\t\tthis._loaded = true;\n\t\tthis._generateSteps(true);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-stepper\">\n\t\t\t\t<slot onSlotchange={this._onSlotChange} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t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