dh_ackergaul
2026-06-03 a25433795ec239654db2ef31af6d3f4e84b3b8dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import './accordion.component.js';
import { AccordionItemComponent } from './accordion-item.component.js';
import { AccordionLayerComponent } from './accordion-layer.component.js';
import { n } from './base.component-813fc7cf.js';
import './query-assigned-elements-fea1f631.js';
import { StyleHelper } from './style.helper.js';
import './custom-element-30fc6381.js';
import '@dh-software/furnview-icons';
import './query-1c86d710.js';
import './class-map-a0fb5d87.js';
import './event.handler.model.js';
import './image.service.js';
 
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result)
    __defProp(target, key, result);
  return result;
};
var __async = (__this, __arguments, generator) => {
  return new Promise((resolve, reject) => {
    var fulfilled = (value) => {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    };
    var rejected = (value) => {
      try {
        step(generator.throw(value));
      } catch (e) {
        reject(e);
      }
    };
    var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
    step((generator = generator.apply(__this, __arguments)).next());
  });
};
const _PPLayerComponent = class extends AccordionLayerComponent {
  constructor() {
    super(...arguments);
    this.ignoredAttributes = ["image"];
    this.preventEmpty = false;
    this.layerId = -1;
  }
  get PPContainer() {
    return this.parentAccordion.parentNode.host;
  }
  connectedCallback() {
    this.layerId = _PPLayerComponent._globalLayerId++;
    super.connectedCallback();
  }
  disconnectedCallback() {
    _PPLayerComponent._globalLayerId--;
    this.layerId = -1;
    super.disconnectedCallback();
  }
  firstUpdated(_changedProperties) {
    var __superGet = (key) => super[key];
    return __async(this, null, function* () {
      __superGet("firstUpdated").call(this, _changedProperties);
      yield this.refreshPropertyPanel();
      EventFactoryService.RefreshPropertyPanel.register(() => __async(this, null, function* () {
        yield this.refreshPropertyPanel();
      }));
      window.addEventListener("onUpdated", (ev) => {
        this.refreshPropertyPanel();
      });
    });
  }
  refreshPropertyPanel() {
    return __async(this, null, function* () {
      if (this.refreshPromise) {
        yield this.refreshPromise;
      }
      this.refreshPromise = new Promise((resolve) => __async(this, null, function* () {
        if (this.parentAccordion) {
          const newItems = yield this.getAccordionItems();
          yield StyleHelper.requestAnimationFrame();
          const isEmpty = Array.isArray(newItems) && newItems.length === 0;
          if (this.preventEmpty && isEmpty) {
            return resolve(false);
          }
          this.replaceChildren(...newItems);
        }
        return resolve(true);
      }));
      return this.refreshPromise;
    });
  }
  requestUpdate(name, oldValue) {
    var _a;
    !!(name && ((_a = this.ignoredAttributes) == null ? void 0 : _a.includes(name)));
    this.requestHeightUpdate(false);
    super.requestUpdate(name, oldValue);
  }
  getAccordionItems() {
    return __async(this, null, function* () {
      return [];
    });
  }
  getCacheKey(key) {
    return `${this.layerId}_${key}`;
  }
  isEmpty() {
    return this.children.length === 0;
  }
  requestHeightUpdate(force = true) {
    this.childNodes.forEach((node) => {
      node instanceof AccordionItemComponent && node.requestHeightUpdate(force);
    });
  }
};
let PPLayerComponent = _PPLayerComponent;
PPLayerComponent._globalLayerId = 0;
__decorateClass([
  n({ type: Number, state: false })
], PPLayerComponent.prototype, "layerId", 2);
 
export { PPLayerComponent };