• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the 'License');
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an 'AS IS' BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16var __decorate = (this && this.__decorate) || function (o29, p29, q29, r29) {
17  var s29 = arguments.length, t29 = s29 < 3 ? p29 : r29 === null ? r29 = Object.getOwnPropertyDescriptor(p29, q29) : r29, u29;
18  if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
19    t29 = Reflect.decorate(o29, p29, q29, r29);
20  else
21    for (var v29 = o29.length - 1; v29 >= 0; v29--)
22      if (u29 = o29[v29])
23        t29 = (s29 < 3 ? u29(t29) : s29 > 3 ? u29(p29, q29, t29) : u29(p29, q29)) || t29;
24  return s29 > 3 && t29 && Object.defineProperty(p29, q29, t29), t29;
25};
26if (!("finalizeConstruction" in ViewPU.prototype)) {
27  Reflect.set(ViewPU.prototype, "finalizeConstruction", () => { });
28}
29const display = requireNapi('display');
30const hilog = requireNapi('hilog');
31const measure = requireNapi('measure');
32const resourceManager = requireNapi('resourceManager');
33const LengthMetrics = requireNapi('arkui.node').LengthMetrics;
34const LengthUnit = requireNapi('arkui.node').LengthUnit;
35const accessibility = requireNapi('accessibility');
36const KeyCode = requireNapi('multimodalInput.keyCode').KeyCode;
37const i18n = requireNapi('i18n');
38const TITLE_MAX_LINES = 2;
39const HORIZON_BUTTON_MAX_COUNT = 2;
40const VERTICAL_BUTTON_MAX_COUNT = 4;
41const BUTTON_LAYOUT_WEIGHT = 1;
42const CHECKBOX_CONTAINER_HEIGHT = 48;
43const CONTENT_MAX_LINES = 2;
44const LOADING_PROGRESS_WIDTH = 40;
45const LOADING_PROGRESS_HEIGHT = 40;
46const LOADING_MAX_LINES = 10;
47const LOADING_MAX_LINES_BIG_FONT = 4;
48const LOADING_TEXT_LAYOUT_WEIGHT = 1;
49const LOADING_TEXT_MARGIN_LEFT = 12;
50const LOADING_MIN_HEIGHT = 48;
51const LIST_MIN_HEIGHT = 48;
52const CHECKBOX_CONTAINER_LENGTH = 20;
53const TEXT_MIN_HEIGHT = 48;
54const DEFAULT_IMAGE_SIZE = 64;
55const MIN_CONTENT_HEIGHT = 100;
56const MAX_CONTENT_HEIGHT = 30000;
57const KEYCODE_UP = 2012;
58const KEYCODE_DOWN = 2013;
59const IGNORE_KEY_EVENT_TYPE = 1;
60const FIRST_ITEM_INDEX = 0;
61const VERSION_TWELVE = 50000012;
62const BUTTON_MIN_FONT_SIZE = 9;
63const MAX_FONT_SCALE = 2;
64const MAX_DIALOG_WIDTH = getNumberByResourceId(125831042, 400);
65const BUTTON_HORIZONTAL_MARGIN = getNumberByResourceId(125831054, 16);
66const BUTTON_HORIZONTAL_PADDING = getNumberByResourceId(125830927, 16);
67const CHECK_BOX_MARGIN_END = getNumberByResourceId(125830923, 8);
68const BUTTON_HORIZONTAL_SPACE = getNumberByResourceId(125831051, 8);
69const BODY_L = getNumberByResourceId(125830970, 16);
70const BODY_M = getNumberByResourceId(125830971, 14);
71const BODY_S = getNumberByResourceId(125830972, 12);
72const TITLE_S = getNumberByResourceId(125830966, 20);
73const SUBTITLE_S = getNumberByResourceId(125830969, 14);
74const PADDING_LEVEL_8 = getNumberByResourceId(125830927, 16);
75const DIALOG_DIVIDER_SHOW = getNumberByResourceId(125831202, 1, true);
76const ALERT_BUTTON_STYLE = getNumberByResourceId(125831085, 2, true);
77const ALERT_TITLE_ALIGNMENT = getEnumNumberByResourceId(125831126, 1);
78const SCROLL_BAR_OFFSET = 20;
79let AdvancedDialogV2Button = class AdvancedDialogV2Button {
80  constructor(n29) {
81    this.content = '';
82    this.content = n29.content;
83    this.action = n29.action;
84    this.background = n29.background;
85    this.fontColor = n29.fontColor;
86    this.buttonStyle = n29.buttonStyle;
87    this.role = n29.role;
88    this.defaultFocus = n29.defaultFocus;
89    this.enabled = n29.enabled;
90  }
91  ;
92};
93__decorate([
94  Trace
95], AdvancedDialogV2Button.prototype, "content", void 0);
96__decorate([
97  Trace
98], AdvancedDialogV2Button.prototype, "action", void 0);
99__decorate([
100  Trace
101], AdvancedDialogV2Button.prototype, "background", void 0);
102__decorate([
103  Trace
104], AdvancedDialogV2Button.prototype, "fontColor", void 0);
105__decorate([
106  Trace
107], AdvancedDialogV2Button.prototype, "buttonStyle", void 0);
108__decorate([
109  Trace
110], AdvancedDialogV2Button.prototype, "role", void 0);
111__decorate([
112  Trace
113], AdvancedDialogV2Button.prototype, "defaultFocus", void 0);
114__decorate([
115  Trace
116], AdvancedDialogV2Button.prototype, "enabled", void 0);
117AdvancedDialogV2Button = __decorate([
118  ObservedV2
119], AdvancedDialogV2Button);
120export { AdvancedDialogV2Button };
121export class TipsDialogV2 extends ViewV2 {
122  constructor(h29, i29, j29, k29 = -1, l29, m29) {
123    super(h29, k29, m29);
124    this.initParam("imageRes", (i29 && "imageRes" in i29) ? i29.imageRes : undefined);
125    this.initParam("imageSize", (i29 && "imageSize" in i29) ? i29.imageSize : { width: DEFAULT_IMAGE_SIZE, height: DEFAULT_IMAGE_SIZE });
126    this.initParam("imageBorderColor", (i29 && "imageBorderColor" in i29) ? i29.imageBorderColor : undefined);
127    this.initParam("imageBorderWidth", (i29 && "imageBorderWidth" in i29) ? i29.imageBorderWidth : undefined);
128    this.initParam("title", (i29 && "title" in i29) ? i29.title : null);
129    this.initParam("content", (i29 && "content" in i29) ? i29.content : null);
130    this.initParam("onCheckedChange", (i29 && "onCheckedChange" in i29) ? i29.onCheckedChange : undefined);
131    this.initParam("checkTips", (i29 && "checkTips" in i29) ? i29.checkTips : null);
132    this.initParam("checked", (i29 && "checked" in i29) ? i29.checked : false);
133    this.checkedInner = false;
134    this.initParam("primaryButton", (i29 && "primaryButton" in i29) ? i29.primaryButton : null);
135    this.initParam("secondaryButton", (i29 && "secondaryButton" in i29) ? i29.secondaryButton : null);
136    this.marginOffset = 0 - PADDING_LEVEL_8;
137    this.contentScroller = new Scroller();
138    this.fontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_primary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
139    this.fontSizeScale = 1;
140    this.minContentHeight = 160;
141    this.imageIndex = 0;
142    this.textIndex = 1;
143    this.checkBoxIndex = 2;
144    this.appMaxFontScale = 3.2;
145    this.finalizeConstruction();
146  }
147  resetStateVarsOnReuse(g29) {
148    this.resetParam("imageRes", (g29 && "imageRes" in g29) ? g29.imageRes : undefined);
149    this.resetParam("imageSize", (g29 && "imageSize" in g29) ? g29.imageSize : { width: DEFAULT_IMAGE_SIZE, height: DEFAULT_IMAGE_SIZE });
150    this.resetParam("imageBorderColor", (g29 && "imageBorderColor" in g29) ? g29.imageBorderColor : undefined);
151    this.resetParam("imageBorderWidth", (g29 && "imageBorderWidth" in g29) ? g29.imageBorderWidth : undefined);
152    this.resetParam("title", (g29 && "title" in g29) ? g29.title : null);
153    this.resetParam("content", (g29 && "content" in g29) ? g29.content : null);
154    this.resetParam("onCheckedChange", (g29 && "onCheckedChange" in g29) ? g29.onCheckedChange : undefined);
155    this.resetParam("checkTips", (g29 && "checkTips" in g29) ? g29.checkTips : null);
156    this.resetParam("checked", (g29 && "checked" in g29) ? g29.checked : false);
157    this.checkedInner = false;
158    this.resetComputed("buttons");
159    this.resetParam("primaryButton", (g29 && "primaryButton" in g29) ? g29.primaryButton : null);
160    this.resetParam("secondaryButton", (g29 && "secondaryButton" in g29) ? g29.secondaryButton : null);
161    this.fontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_primary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
162    this.fontSizeScale = 1;
163    this.minContentHeight = 160;
164    this.resetMonitorsOnReuse();
165  }
166  checkedChangeMonitor(f29) {
167    this.checkedInner = f29.value('checked')?.now;
168  }
169  get buttons() {
170    if (!this.primaryButton && !this.secondaryButton) {
171      return undefined;
172    }
173    let e29 = [];
174    if (this.primaryButton) {
175      e29.push(this.primaryButton);
176    }
177    if (this.secondaryButton) {
178      e29.push(this.secondaryButton);
179    }
180    return e29;
181  }
182  onWillApplyTheme(d29) {
183    this.fontColorWithTheme = d29.colors.fontPrimary;
184  }
185  initialRender() {
186    this.observeComponentCreation2((b29, c29) => {
187      __Common__.create();
188      __Common__.constraintSize({ maxHeight: '100%' });
189    }, __Common__);
190    {
191      this.observeComponentCreation2((v28, w28) => {
192        if (w28) {
193          let x28 = new CustomDialogContentComponent(this, {
194            contentBuilder: () => {
195              this.contentBuilder();
196            },
197            buttons: this.buttons,
198            minContentHeight: this.minContentHeight,
199            $minContentHeight: u1 => { this.minContentHeight = u1; }
200          }, undefined, v28, () => { }, { page: "library/src/main/ets/components/dialog.ets", line: 180, col: 5 });
201          ViewV2.create(x28);
202          let y = () => {
203            return {
204              contentBuilder: () => {
205                this.contentBuilder();
206              },
207              buttons: this.buttons,
208              minContentHeight: this.minContentHeight
209            };
210          };
211          x28.paramsGenerator_ = y;
212        }
213        else {
214          this.updateStateVarsOfChildByElmtId(v28, {
215            buttons: this.buttons,
216            minContentHeight: this.minContentHeight
217          });
218        }
219      }, { name: "CustomDialogContentComponent" });
220    }
221    __Common__.pop();
222  }
223  contentBuilder(x27 = null) {
224    {
225      this.observeComponentCreation2((y27, z27) => {
226        if (z27) {
227          let a28 = new TipsDialogContentLayout(this, {
228            title: this.title,
229            content: this.content,
230            checkTips: this.checkTips,
231            minContentHeight: this.minContentHeight,
232            dialogBuilder: () => {
233              this.observeComponentCreation2((m28, n28) => {
234                ForEach.create();
235                const x = p28 => {
236                  const q28 = p28;
237                  this.observeComponentCreation2((r28, s28) => {
238                    If.create();
239                    if (q28 === this.imageIndex) {
240                      this.ifElseBranchUpdateFunction(0, () => {
241                        this.imagePart.bind(this)();
242                      });
243                    }
244                    else if (q28 === this.textIndex) {
245                      this.ifElseBranchUpdateFunction(1, () => {
246                        this.observeComponentCreation2((t28, u28) => {
247                          Column.create();
248                          Column.padding({ top: { "id": -1, "type": 10002, params: ['sys.float.padding_level8'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } });
249                        }, Column);
250                        this.textPart.bind(this)();
251                        Column.pop();
252                      });
253                    }
254                    else {
255                      this.ifElseBranchUpdateFunction(2, () => {
256                        this.checkBoxPart.bind(this)();
257                      });
258                    }
259                  }, If);
260                  If.pop();
261                };
262                this.forEachUpdateFunction(m28, [this.imageIndex, this.textIndex, this.checkBoxIndex], x);
263              }, ForEach);
264              ForEach.pop();
265            },
266            $minContentHeight: l28 => { this.minContentHeight = l28; }
267          }, undefined, y27, () => { }, { page: "library/src/main/ets/components/dialog.ets", line: 191, col: 5 });
268          ViewV2.create(a28);
269          let u = () => {
270            return {
271              title: this.title,
272              content: this.content,
273              checkTips: this.checkTips,
274              minContentHeight: this.minContentHeight,
275              dialogBuilder: () => {
276                this.observeComponentCreation2((c28, d28) => {
277                  ForEach.create();
278                  const v = f28 => {
279                    const g28 = f28;
280                    this.observeComponentCreation2((h28, i28) => {
281                      If.create();
282                      if (g28 === this.imageIndex) {
283                        this.ifElseBranchUpdateFunction(0, () => {
284                          this.imagePart.bind(this)();
285                        });
286                      }
287                      else if (g28 === this.textIndex) {
288                        this.ifElseBranchUpdateFunction(1, () => {
289                          this.observeComponentCreation2((j28, k28) => {
290                            Column.create();
291                            Column.padding({ top: { "id": -1, "type": 10002, params: ['sys.float.padding_level8'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } });
292                          }, Column);
293                          this.textPart.bind(this)();
294                          Column.pop();
295                        });
296                      }
297                      else {
298                        this.ifElseBranchUpdateFunction(2, () => {
299                          this.checkBoxPart.bind(this)();
300                        });
301                      }
302                    }, If);
303                    If.pop();
304                  };
305                  this.forEachUpdateFunction(c28, [this.imageIndex, this.textIndex, this.checkBoxIndex], v);
306                }, ForEach);
307                ForEach.pop();
308              }
309            };
310          };
311          a28.paramsGenerator_ = u;
312        }
313        else {
314          this.updateStateVarsOfChildByElmtId(y27, {
315            title: this.title,
316            content: this.content,
317            checkTips: this.checkTips,
318            minContentHeight: this.minContentHeight
319          });
320        }
321      }, { name: "TipsDialogContentLayout" });
322    }
323  }
324  checkBoxPart(j27 = null) {
325    this.observeComponentCreation2((r27, s27) => {
326      Row.create();
327      Row.accessibilityGroup(true);
328      Row.accessibilityText(getCheckTipsAccessibilityText(this.checkTips, this.checkedInner));
329      Row.accessibilityDescription(this.checkedInner ? { "id": -1, "type": 10003, params: ['sys.string.advanced_dialog_accessibility_cancel_checked_desc'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } : { "id": -1, "type": 10003, params: ['sys.string.slider_accessibility_unselectedDesc'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
330      Row.onClick(() => {
331        this.checkedInner = !this.checkedInner;
332        try {
333          let w27 = ({
334            type: 'announceForAccessibility',
335            bundleName: getContext()?.abilityInfo?.bundleName,
336            triggerAction: 'common',
337            textAnnouncedForAccessibility: this.checkedInner ? getContext().resourceManager.getStringSync(125833934) :
338            getContext().resourceManager.getStringSync(125833935)
339          });
340          accessibility.sendAccessibilityEvent(w27);
341        }
342        catch (t27) {
343          let u27 = t27.code;
344          let v27 = t27.message;
345          hilog.error(0x3900, 'Ace', `Faild to send event, cause, code: ${u27}, message: ${v27}`);
346        }
347      });
348      Row.padding({ top: 8, bottom: 8 });
349      Row.constraintSize({ minHeight: CHECKBOX_CONTAINER_HEIGHT });
350      Row.width('100%');
351    }, Row);
352    this.observeComponentCreation2((k27, l27) => {
353      If.create();
354      if (this.checkTips !== null && this.checkTips !== undefined) {
355        this.ifElseBranchUpdateFunction(0, () => {
356          this.observeComponentCreation2((o27, p27) => {
357            Checkbox.create({ name: '', group: 'checkboxGroup' });
358            Checkbox.select(this.checkedInner);
359            Checkbox.onChange((q27) => {
360              this.checkedInner = q27;
361              this.onCheckedChange?.(q27);
362            });
363            Checkbox.margin({ start: LengthMetrics.vp(0), end: LengthMetrics.vp(CHECK_BOX_MARGIN_END) });
364          }, Checkbox);
365          Checkbox.pop();
366          this.observeComponentCreation2((m27, n27) => {
367            Text.create(this.checkTips);
368            Text.fontSize(`${BODY_L}fp`);
369            Text.fontWeight(FontWeight.Regular);
370            Text.fontColor(this.fontColorWithTheme);
371            Text.maxLines(CONTENT_MAX_LINES);
372            Text.layoutWeight(1);
373            Text.focusable(false);
374            Text.textOverflow({ overflow: TextOverflow.Ellipsis });
375          }, Text);
376          Text.pop();
377        });
378      }
379      else {
380        this.ifElseBranchUpdateFunction(1, () => {
381        });
382      }
383    }, If);
384    If.pop();
385    Row.pop();
386  }
387  imagePart(e27 = null) {
388    this.observeComponentCreation2((h27, i27) => {
389      Column.create();
390      Column.width('100%');
391    }, Column);
392    this.observeComponentCreation2((f27, g27) => {
393      Image.create(this.imageRes);
394      Image.objectFit(ImageFit.Contain);
395      Image.borderRadius({ "id": -1, "type": 10002, params: ['sys.float.corner_radius_level6'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
396      Image.constraintSize({
397        maxWidth: this.imageSize?.width ?? DEFAULT_IMAGE_SIZE,
398        maxHeight: this.imageSize?.height ?? DEFAULT_IMAGE_SIZE
399      });
400      Image.outline({
401        width: `${lengthMetricsToPX(this.imageBorderWidth)}px`,
402        radius: `${lengthMetricsToPX(LengthMetrics.resource({ "id": -1, "type": 10002, params: ['sys.float.corner_radius_level6'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" })) +
403        lengthMetricsToPX(this.imageBorderWidth)}px`,
404        color: this.imageBorderColor?.color
405      });
406    }, Image);
407    Column.pop();
408  }
409  textPart(m26 = null) {
410    this.observeComponentCreation2((c27, d27) => {
411      Scroll.create(this.contentScroller);
412      Scroll.nestedScroll({ scrollForward: NestedScrollMode.PARALLEL, scrollBackward: NestedScrollMode.PARALLEL });
413      Scroll.margin({ end: LengthMetrics.vp(this.marginOffset) });
414    }, Scroll);
415    this.observeComponentCreation2((a27, b27) => {
416      Column.create();
417      Column.margin({ end: LengthMetrics.resource({ "id": -1, "type": 10002, params: ['sys.float.padding_level8'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }) });
418    }, Column);
419    this.observeComponentCreation2((u26, v26) => {
420      If.create();
421      if (this.title !== null) {
422        this.ifElseBranchUpdateFunction(0, () => {
423          this.observeComponentCreation2((y26, z26) => {
424            Row.create();
425            Row.padding({ bottom: { "id": -1, "type": 10002, params: ['sys.float.padding_level8'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } });
426          }, Row);
427          this.observeComponentCreation2((w26, x26) => {
428            Text.create(this.title);
429            Text.fontSize(`${TITLE_S}fp`);
430            Text.maxFontScale(Math.min(this.appMaxFontScale, MAX_FONT_SCALE));
431            Text.fontWeight(FontWeight.Bold);
432            Text.fontColor(this.fontColorWithTheme);
433            Text.textAlign(TextAlign.Center);
434            Text.maxLines(CONTENT_MAX_LINES);
435            Text.textOverflow({ overflow: TextOverflow.Ellipsis });
436            Text.width('100%');
437          }, Text);
438          Text.pop();
439          Row.pop();
440        });
441      }
442      else {
443        this.ifElseBranchUpdateFunction(1, () => {
444        });
445      }
446    }, If);
447    If.pop();
448    this.observeComponentCreation2((n26, o26) => {
449      If.create();
450      if (this.content !== null) {
451        this.ifElseBranchUpdateFunction(0, () => {
452          this.observeComponentCreation2((s26, t26) => {
453            Row.create();
454          }, Row);
455          this.observeComponentCreation2((p26, q26) => {
456            Text.create(this.content);
457            Text.focusable(true);
458            Text.defaultFocus(!(this.primaryButton || this.secondaryButton));
459            Text.focusBox({
460              strokeWidth: LengthMetrics.px(0)
461            });
462            Text.fontSize(this.getContentFontSize());
463            Text.fontWeight(FontWeight.Medium);
464            Text.fontColor(this.fontColorWithTheme);
465            Text.textAlign(TextAlign.Center);
466            Text.width('100%');
467            Text.onKeyEvent((r26) => {
468              if (r26) {
469                resolveKeyEvent(r26, this.contentScroller);
470              }
471            });
472          }, Text);
473          Text.pop();
474          Row.pop();
475        });
476      }
477      else {
478        this.ifElseBranchUpdateFunction(1, () => {
479        });
480      }
481    }, If);
482    If.pop();
483    Column.pop();
484    Scroll.pop();
485  }
486  aboutToAppear() {
487    let l26 = this.getUIContext();
488    this.appMaxFontScale = l26.getMaxFontScale();
489    this.checkedInner = this.checked;
490  }
491  getContentFontSize() {
492    return BODY_L + 'fp';
493  }
494  updateStateVars(k26) {
495    if (k26 === undefined) {
496      return;
497    }
498    if ("imageRes" in k26) {
499      this.updateParam("imageRes", k26.imageRes);
500    }
501    if ("imageSize" in k26) {
502      this.updateParam("imageSize", k26.imageSize);
503    }
504    if ("imageBorderColor" in k26) {
505      this.updateParam("imageBorderColor", k26.imageBorderColor);
506    }
507    if ("imageBorderWidth" in k26) {
508      this.updateParam("imageBorderWidth", k26.imageBorderWidth);
509    }
510    if ("title" in k26) {
511      this.updateParam("title", k26.title);
512    }
513    if ("content" in k26) {
514      this.updateParam("content", k26.content);
515    }
516    if ("onCheckedChange" in k26) {
517      this.updateParam("onCheckedChange", k26.onCheckedChange);
518    }
519    if ("checkTips" in k26) {
520      this.updateParam("checkTips", k26.checkTips);
521    }
522    if ("checked" in k26) {
523      this.updateParam("checked", k26.checked);
524    }
525    if ("primaryButton" in k26) {
526      this.updateParam("primaryButton", k26.primaryButton);
527    }
528    if ("secondaryButton" in k26) {
529      this.updateParam("secondaryButton", k26.secondaryButton);
530    }
531  }
532  rerender() {
533    this.updateDirtyElements();
534  }
535}
536__decorate([
537  Param
538], TipsDialogV2.prototype, "imageRes", void 0);
539__decorate([
540  Param
541], TipsDialogV2.prototype, "imageSize", void 0);
542__decorate([
543  Param
544], TipsDialogV2.prototype, "imageBorderColor", void 0);
545__decorate([
546  Param
547], TipsDialogV2.prototype, "imageBorderWidth", void 0);
548__decorate([
549  Param
550], TipsDialogV2.prototype, "title", void 0);
551__decorate([
552  Param
553], TipsDialogV2.prototype, "content", void 0);
554__decorate([
555  Param
556], TipsDialogV2.prototype, "onCheckedChange", void 0);
557__decorate([
558  Param
559], TipsDialogV2.prototype, "checkTips", void 0);
560__decorate([
561  Param
562], TipsDialogV2.prototype, "checked", void 0);
563__decorate([
564  Local
565], TipsDialogV2.prototype, "checkedInner", void 0);
566__decorate([
567  Monitor('checked')
568], TipsDialogV2.prototype, "checkedChangeMonitor", null);
569__decorate([
570  Computed
571], TipsDialogV2.prototype, "buttons", null);
572__decorate([
573  Param
574], TipsDialogV2.prototype, "primaryButton", void 0);
575__decorate([
576  Param
577], TipsDialogV2.prototype, "secondaryButton", void 0);
578__decorate([
579  Local
580], TipsDialogV2.prototype, "fontColorWithTheme", void 0);
581__decorate([
582  Provider()
583], TipsDialogV2.prototype, "fontSizeScale", void 0);
584__decorate([
585  Local
586], TipsDialogV2.prototype, "minContentHeight", void 0);
587class TipsDialogContentLayout extends ViewV2 {
588  constructor(e26, f26, g26, h26 = -1, i26, j26) {
589    super(e26, h26, j26);
590    this.initParam("title", (f26 && "title" in f26) ? f26.title : null);
591    this.initParam("content", (f26 && "content" in f26) ? f26.content : null);
592    this.initParam("checkTips", (f26 && "checkTips" in f26) ? f26.checkTips : null);
593    this.initParam("minContentHeight", (f26 && "minContentHeight" in f26) ? f26.minContentHeight : 0);
594    this.$minContentHeight = "$minContentHeight" in f26 ? f26.$minContentHeight : undefined;
595    this.dialogBuilder = "dialogBuilder" in f26 ? f26.dialogBuilder : this.doNothingBuilder;
596    this.imageIndex = 0;
597    this.textIndex = 1;
598    this.checkBoxIndex = 2;
599    this.childrenSize = 3;
600    this.finalizeConstruction();
601  }
602  resetStateVarsOnReuse(d26) {
603    this.resetParam("title", (d26 && "title" in d26) ? d26.title : null);
604    this.resetParam("content", (d26 && "content" in d26) ? d26.content : null);
605    this.resetParam("checkTips", (d26 && "checkTips" in d26) ? d26.checkTips : null);
606    this.resetParam("minContentHeight", (d26 && "minContentHeight" in d26) ? d26.minContentHeight : 0);
607    this.$minContentHeight = "$minContentHeight" in d26 ? d26.$minContentHeight : undefined;
608    this.dialogBuilder = "dialogBuilder" in d26 ? d26.dialogBuilder : this.doNothingBuilder;
609  }
610  doNothingBuilder(c26 = null) {
611  }
612  ;
613  onPlaceChildren(v25, w25, x25) {
614    let y25 = 0;
615    let z25 = 0;
616    for (let a26 = 0; a26 < w25.length; a26++) {
617      let b26 = w25[a26];
618      b26.layout({ x: y25, y: z25 });
619      z25 += b26.measureResult.height;
620    }
621  }
622  onMeasureSize(d25, e25, f25) {
623    let g25 = { width: Number(f25.maxWidth), height: 0 };
624    if (e25.length < this.childrenSize) {
625      return g25;
626    }
627    let h25 = 0;
628    let i25 = 0;
629    if (this.checkTips !== null && this.checkTips !== undefined) {
630      let s25 = e25[this.checkBoxIndex];
631      let t25 = {
632        maxWidth: f25.maxWidth,
633        minHeight: CHECKBOX_CONTAINER_HEIGHT,
634        maxHeight: f25.maxHeight
635      };
636      let u25 = s25.measure(t25);
637      i25 = u25.height;
638      h25 += i25;
639    }
640    let j25 = e25[this.imageIndex];
641    let k25 = 0;
642    if (this.title !== null || this.content !== null) {
643      k25 = TEXT_MIN_HEIGHT + PADDING_LEVEL_8;
644    }
645    let l25 = Number(f25.maxHeight) - i25 - k25;
646    let m25 = {
647      maxWidth: f25.maxWidth,
648      maxHeight: l25
649    };
650    let n25 = j25.measure(m25);
651    h25 += n25.height;
652    if (this.title !== null || this.content !== null) {
653      let o25 = e25[this.textIndex];
654      let p25 = Number(f25.maxHeight) - n25.height - i25;
655      let q25 = {
656        maxWidth: f25.maxWidth,
657        maxHeight: Math.max(p25, TEXT_MIN_HEIGHT)
658      };
659      let r25 = o25.measure(q25);
660      h25 += r25.height;
661    }
662    g25.height = h25;
663    this.$minContentHeight?.(Math.max(i25 + n25.height + k25, MIN_CONTENT_HEIGHT));
664    return g25;
665  }
666  initialRender() {
667    this.dialogBuilder.bind(this)();
668  }
669  updateStateVars(c25) {
670    if (c25 === undefined) {
671      return;
672    }
673    if ("title" in c25) {
674      this.updateParam("title", c25.title);
675    }
676    if ("content" in c25) {
677      this.updateParam("content", c25.content);
678    }
679    if ("checkTips" in c25) {
680      this.updateParam("checkTips", c25.checkTips);
681    }
682    if ("minContentHeight" in c25) {
683      this.updateParam("minContentHeight", c25.minContentHeight);
684    }
685  }
686  rerender() {
687    this.updateDirtyElements();
688  }
689}
690__decorate([
691  Param
692], TipsDialogContentLayout.prototype, "title", void 0);
693__decorate([
694  Param
695], TipsDialogContentLayout.prototype, "content", void 0);
696__decorate([
697  Param
698], TipsDialogContentLayout.prototype, "checkTips", void 0);
699__decorate([
700  Param
701], TipsDialogContentLayout.prototype, "minContentHeight", void 0);
702__decorate([
703  Event
704], TipsDialogContentLayout.prototype, "$minContentHeight", void 0);
705export class SelectDialogV2 extends ViewV2 {
706  constructor(w24, x24, y24, z24 = -1, a25, b25) {
707    super(w24, z24, b25);
708    this.initParam("title", (x24 && "title" in x24) ? x24.title : '');
709    this.initParam("content", (x24 && "content" in x24) ? x24.content : '');
710    this.initParam("confirm", (x24 && "confirm" in x24) ? x24.confirm : null);
711    this.initParam("radioContent", (x24 && "radioContent" in x24) ? x24.radioContent : []);
712    this.initParam("selectedIndex", (x24 && "selectedIndex" in x24) ? x24.selectedIndex : -1);
713    this.selectedIndexInner = -1;
714    this.isFocus = false;
715    this.currentFocusIndex = -1;
716    this.radioHeight = 0;
717    this.itemHeight = 0;
718    this.contentBuilder = "contentBuilder" in x24 ? x24.contentBuilder : this.buildContent;
719    this.fontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_primary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
720    this.dividerColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.comp_divider'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
721    this.contentScroller = new Scroller();
722    this.fontSizeScale = 1;
723    this.minContentHeight = MIN_CONTENT_HEIGHT;
724    this.finalizeConstruction();
725  }
726  resetStateVarsOnReuse(v24) {
727    this.resetParam("title", (v24 && "title" in v24) ? v24.title : '');
728    this.resetParam("content", (v24 && "content" in v24) ? v24.content : '');
729    this.resetParam("confirm", (v24 && "confirm" in v24) ? v24.confirm : null);
730    this.resetParam("radioContent", (v24 && "radioContent" in v24) ? v24.radioContent : []);
731    this.resetParam("selectedIndex", (v24 && "selectedIndex" in v24) ? v24.selectedIndex : -1);
732    this.selectedIndexInner = -1;
733    this.isFocus = false;
734    this.currentFocusIndex = -1;
735    this.radioHeight = 0;
736    this.itemHeight = 0;
737    this.contentBuilder = "contentBuilder" in v24 ? v24.contentBuilder : this.buildContent;
738    this.fontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_primary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
739    this.dividerColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.comp_divider'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
740    this.fontSizeScale = 1;
741    this.minContentHeight = MIN_CONTENT_HEIGHT;
742    this.resetComputed("buttons");
743    this.resetComputed("contentPadding");
744    this.resetMonitorsOnReuse();
745  }
746  selectedIndexMonitor(u24) {
747    this.selectedIndexInner = u24.value('selectedIndex')?.now;
748  }
749  get buttons() {
750    let t24 = [];
751    if (this.confirm) {
752      t24.push(this.confirm);
753    }
754    return t24;
755  }
756  get contentPadding() {
757    if (!this.title && !this.confirm) {
758      return {
759        top: { "id": -1, "type": 10002, params: ['sys.float.padding_level12'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
760        bottom: { "id": -1, "type": 10002, params: ['sys.float.padding_level12'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }
761      };
762    }
763    if (!this.title) {
764      return {
765        top: { "id": -1, "type": 10002, params: ['sys.float.padding_level12'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }
766      };
767    }
768    else if (!this.confirm) {
769      return {
770        bottom: { "id": -1, "type": 10002, params: ['sys.float.padding_level12'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }
771      };
772    }
773    return {
774      left: { "id": -1, "type": 10002, params: ['sys.float.padding_level0'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
775      right: { "id": -1, "type": 10002, params: ['sys.float.padding_level0'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }
776    };
777  }
778  buildContent(w22 = null) {
779    this.observeComponentCreation2((o24, p24) => {
780      Scroll.create(this.contentScroller);
781      Scroll.scrollBar(BarState.Auto);
782      Scroll.nestedScroll({ scrollForward: NestedScrollMode.PARALLEL, scrollBackward: NestedScrollMode.PARALLEL });
783      Scroll.onDidScroll((q24, r24) => {
784        let s24 = (this.itemHeight - this.radioHeight) / 2;
785        if (this.isFocus) {
786          if (this.currentFocusIndex === this.radioContent.length - 1) {
787            this.contentScroller.scrollEdge(Edge.Bottom);
788            this.currentFocusIndex = -1;
789          }
790          else if (this.currentFocusIndex === FIRST_ITEM_INDEX) {
791            this.contentScroller.scrollEdge(Edge.Top);
792            this.currentFocusIndex = -1;
793          }
794          else {
795            if (r24 > 0) {
796              this.contentScroller.scrollBy(0, s24);
797            }
798            else if (r24 < 0) {
799              this.contentScroller.scrollBy(0, 0 - s24);
800            }
801          }
802          this.isFocus = false;
803        }
804      });
805    }, Scroll);
806    this.observeComponentCreation2((m24, n24) => {
807      Column.create();
808    }, Column);
809    this.observeComponentCreation2((g24, h24) => {
810      If.create();
811      if (this.content) {
812        this.ifElseBranchUpdateFunction(0, () => {
813          this.observeComponentCreation2((k24, l24) => {
814            Row.create();
815            Row.padding({
816              left: { "id": -1, "type": 10002, params: ['sys.float.padding_level12'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
817              right: { "id": -1, "type": 10002, params: ['sys.float.padding_level12'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
818              bottom: { "id": -1, "type": 10002, params: ['sys.float.padding_level4'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }
819            });
820            Row.width('100%');
821          }, Row);
822          this.observeComponentCreation2((i24, j24) => {
823            Text.create(this.content);
824            Text.fontSize(`${BODY_M}fp`);
825            Text.fontWeight(FontWeight.Regular);
826            Text.fontColor(this.fontColorWithTheme);
827            Text.textOverflow({ overflow: TextOverflow.Ellipsis });
828          }, Text);
829          Text.pop();
830          Row.pop();
831        });
832      }
833      else {
834        this.ifElseBranchUpdateFunction(1, () => {
835        });
836      }
837    }, If);
838    If.pop();
839    this.observeComponentCreation2((e24, f24) => {
840      List.create();
841      List.width('100%');
842      List.clip(false);
843      List.onFocus(() => {
844        if (!this.contentScroller.isAtEnd()) {
845          this.contentScroller.scrollEdge(Edge.Top);
846          focusControl.requestFocus(String(FIRST_ITEM_INDEX));
847        }
848      });
849      List.defaultFocus(this.buttons?.length === 0 ? true : false);
850    }, List);
851    this.observeComponentCreation2((x22, y22) => {
852      ForEach.create();
853      const q = (a23, b23) => {
854        const c23 = a23;
855        {
856          const r = (c24, d24) => {
857            ViewStackProcessor.StartGetAccessRecordingFor(c24);
858            s(c24, d24);
859            if (!d24) {
860              ListItem.pop();
861            }
862            ViewStackProcessor.StopGetAccessRecording();
863          };
864          const s = (y23, z23) => {
865            ListItem.create(t, true);
866            ListItem.padding({
867              left: { "id": -1, "type": 10002, params: ['sys.float.padding_level6'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
868              right: { "id": -1, "type": 10002, params: ['sys.float.padding_level6'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }
869            });
870            ListItem.onSizeChange((a24, b24) => {
871              this.itemHeight = Number(b24.height);
872            });
873          };
874          const t = (g23, h23) => {
875            r(g23, h23);
876            this.observeComponentCreation2((w23, x23) => {
877              Column.create();
878              Column.borderRadius({ "id": -1, "type": 10002, params: ['sys.float.corner_radius_level8'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
879              Column.focusBox({
880                margin: { value: -2, unit: LengthUnit.VP }
881              });
882              Column.accessibilityText(getAccessibilityText(c23.title, this.selectedIndexInner === b23));
883              Column.onClick(() => {
884                this.selectedIndexInner = b23;
885                c23.action && c23.action();
886                this.getDialogController()?.close();
887              });
888            }, Column);
889            this.observeComponentCreation2((u23, v23) => {
890              Button.createWithChild();
891              Button.type(ButtonType.Normal);
892              Button.borderRadius({ "id": -1, "type": 10002, params: ['sys.float.corner_radius_level8'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
893              Button.buttonStyle(ButtonStyleMode.TEXTUAL);
894              Button.padding({
895                left: { "id": -1, "type": 10002, params: ['sys.float.padding_level6'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
896                right: { "id": -1, "type": 10002, params: ['sys.float.padding_level6'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }
897              });
898            }, Button);
899            this.observeComponentCreation2((s23, t23) => {
900              Row.create();
901              Row.constraintSize({ minHeight: LIST_MIN_HEIGHT });
902              Row.clip(false);
903              Row.padding({ top: { "id": -1, "type": 10002, params: ['sys.float.padding_level4'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }, bottom: { "id": -1, "type": 10002, params: ['sys.float.padding_level4'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } });
904            }, Row);
905            this.observeComponentCreation2((q23, r23) => {
906              Text.create(c23.title);
907              Text.fontSize(`${BODY_L}fp`);
908              Text.fontWeight(FontWeight.Medium);
909              Text.fontColor(this.fontColorWithTheme);
910              Text.layoutWeight(1);
911              Text.direction(i18n.isRTL(i18n.System.getSystemLanguage()) ? Direction.Rtl : Direction.Ltr);
912            }, Text);
913            Text.pop();
914            this.observeComponentCreation2((m23, n23) => {
915              Radio.create({ value: 'item.title', group: 'radioGroup' });
916              Radio.size({ width: CHECKBOX_CONTAINER_LENGTH, height: CHECKBOX_CONTAINER_LENGTH });
917              Radio.checked(this.selectedIndexInner === b23);
918              Radio.hitTestBehavior(HitTestMode.None);
919              Radio.id(String(b23));
920              Radio.focusable(false);
921              Radio.accessibilityLevel('no');
922              Radio.visibility(this.selectedIndex === b23 ? Visibility.Visible : Visibility.Hidden);
923              Radio.radioStyle({ uncheckedBorderColor: Color.Transparent });
924              Radio.onFocus(() => {
925                this.isFocus = true;
926                this.currentFocusIndex = b23;
927                if (b23 === FIRST_ITEM_INDEX) {
928                  this.contentScroller.scrollEdge(Edge.Top);
929                }
930                else if (b23 === this.radioContent.length - 1) {
931                  this.contentScroller.scrollEdge(Edge.Bottom);
932                }
933              });
934              Radio.onSizeChange((o23, p23) => {
935                this.radioHeight = Number(p23.height);
936              });
937            }, Radio);
938            Row.pop();
939            Button.pop();
940            this.observeComponentCreation2((i23, j23) => {
941              If.create();
942              if (b23 < this.radioContent.length - 1) {
943                this.ifElseBranchUpdateFunction(0, () => {
944                  this.observeComponentCreation2((k23, l23) => {
945                    Divider.create();
946                    Divider.color(this.dividerColorWithTheme);
947                    Divider.padding({
948                      left: { "id": -1, "type": 10002, params: ['sys.float.padding_level6'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
949                      right: { "id": -1, "type": 10002, params: ['sys.float.padding_level6'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }
950                    });
951                  }, Divider);
952                });
953              }
954              else {
955                this.ifElseBranchUpdateFunction(1, () => {
956                });
957              }
958            }, If);
959            If.pop();
960            Column.pop();
961            ListItem.pop();
962          };
963          this.observeComponentCreation2(s, ListItem);
964          ListItem.pop();
965        }
966      };
967      this.forEachUpdateFunction(x22, this.radioContent, q, undefined, true, false);
968    }, ForEach);
969    ForEach.pop();
970    List.pop();
971    Column.pop();
972    Scroll.pop();
973  }
974  initialRender() {
975    this.observeComponentCreation2((u22, v22) => {
976      __Common__.create();
977      __Common__.constraintSize({ maxHeight: '100%' });
978    }, __Common__);
979    {
980      this.observeComponentCreation2((o22, p22) => {
981        if (p22) {
982          let q22 = new CustomDialogContentComponent(this, {
983            primaryTitle: this.title,
984            contentBuilder: () => {
985              this.contentBuilder();
986            },
987            buttons: this.buttons,
988            contentAreaPadding: this.contentPadding,
989            minContentHeight: this.minContentHeight,
990            $minContentHeight: k1 => { this.minContentHeight = k1; }
991          }, undefined, o22, () => { }, { page: "library/src/main/ets/components/dialog.ets", line: 593, col: 5 });
992          ViewV2.create(q22);
993          let p = () => {
994            return {
995              primaryTitle: this.title,
996              contentBuilder: () => {
997                this.contentBuilder();
998              },
999              buttons: this.buttons,
1000              contentAreaPadding: this.contentPadding,
1001              minContentHeight: this.minContentHeight
1002            };
1003          };
1004          q22.paramsGenerator_ = p;
1005        }
1006        else {
1007          this.updateStateVarsOfChildByElmtId(o22, {
1008            primaryTitle: this.title,
1009            buttons: this.buttons,
1010            contentAreaPadding: this.contentPadding,
1011            minContentHeight: this.minContentHeight
1012          });
1013        }
1014      }, { name: "CustomDialogContentComponent" });
1015    }
1016    __Common__.pop();
1017  }
1018  onWillApplyTheme(n22) {
1019    this.fontColorWithTheme = n22.colors.fontPrimary;
1020    this.dividerColorWithTheme = n22.colors.compDivider;
1021  }
1022  aboutToAppear() {
1023    this.selectedIndexInner = this.selectedIndex;
1024  }
1025  updateStateVars(m22) {
1026    if (m22 === undefined) {
1027      return;
1028    }
1029    if ("title" in m22) {
1030      this.updateParam("title", m22.title);
1031    }
1032    if ("content" in m22) {
1033      this.updateParam("content", m22.content);
1034    }
1035    if ("confirm" in m22) {
1036      this.updateParam("confirm", m22.confirm);
1037    }
1038    if ("radioContent" in m22) {
1039      this.updateParam("radioContent", m22.radioContent);
1040    }
1041    if ("selectedIndex" in m22) {
1042      this.updateParam("selectedIndex", m22.selectedIndex);
1043    }
1044  }
1045  rerender() {
1046    this.updateDirtyElements();
1047  }
1048}
1049__decorate([
1050  Param
1051], SelectDialogV2.prototype, "title", void 0);
1052__decorate([
1053  Param
1054], SelectDialogV2.prototype, "content", void 0);
1055__decorate([
1056  Param
1057], SelectDialogV2.prototype, "confirm", void 0);
1058__decorate([
1059  Param
1060], SelectDialogV2.prototype, "radioContent", void 0);
1061__decorate([
1062  Param
1063], SelectDialogV2.prototype, "selectedIndex", void 0);
1064__decorate([
1065  Local
1066], SelectDialogV2.prototype, "selectedIndexInner", void 0);
1067__decorate([
1068  Monitor('selectedIndex')
1069], SelectDialogV2.prototype, "selectedIndexMonitor", null);
1070__decorate([
1071  Local
1072], SelectDialogV2.prototype, "isFocus", void 0);
1073__decorate([
1074  Local
1075], SelectDialogV2.prototype, "currentFocusIndex", void 0);
1076__decorate([
1077  Local
1078], SelectDialogV2.prototype, "radioHeight", void 0);
1079__decorate([
1080  Local
1081], SelectDialogV2.prototype, "itemHeight", void 0);
1082__decorate([
1083  Local
1084], SelectDialogV2.prototype, "fontColorWithTheme", void 0);
1085__decorate([
1086  Local
1087], SelectDialogV2.prototype, "dividerColorWithTheme", void 0);
1088__decorate([
1089  Provider()
1090], SelectDialogV2.prototype, "fontSizeScale", void 0);
1091__decorate([
1092  Local
1093], SelectDialogV2.prototype, "minContentHeight", void 0);
1094__decorate([
1095  Computed
1096], SelectDialogV2.prototype, "buttons", null);
1097__decorate([
1098  Computed
1099], SelectDialogV2.prototype, "contentPadding", null);
1100class ConfirmDialogContentLayout extends ViewV2 {
1101  constructor(g22, h22, i22, j22 = -1, k22, l22) {
1102    super(g22, j22, l22);
1103    this.textIndex = 0;
1104    this.checkboxIndex = 1;
1105    this.initParam("minContentHeight", (h22 && "minContentHeight" in h22) ? h22.minContentHeight : 0);
1106    this.$minContentHeight = "$minContentHeight" in h22 ? h22.$minContentHeight : undefined;
1107    this.dialogBuilder = "dialogBuilder" in h22 ? h22.dialogBuilder : this.doNothingBuilder;
1108    this.finalizeConstruction();
1109  }
1110  resetStateVarsOnReuse(f22) {
1111    this.resetParam("minContentHeight", (f22 && "minContentHeight" in f22) ? f22.minContentHeight : 0);
1112    this.$minContentHeight = "$minContentHeight" in f22 ? f22.$minContentHeight : undefined;
1113    this.dialogBuilder = "dialogBuilder" in f22 ? f22.dialogBuilder : this.doNothingBuilder;
1114  }
1115  doNothingBuilder(e22 = null) {
1116  }
1117  ;
1118  onPlaceChildren(x21, y21, z21) {
1119    let a22 = 0;
1120    let b22 = 0;
1121    for (let c22 = 0; c22 < y21.length; c22++) {
1122      let d22 = y21[c22];
1123      d22.layout({ x: a22, y: b22 });
1124      b22 += d22.measureResult.height;
1125    }
1126  }
1127  onMeasureSize(l21, m21, n21) {
1128    let o21 = { width: Number(n21.maxWidth), height: 0 };
1129    let p21 = 2;
1130    if (m21.length < p21) {
1131      return o21;
1132    }
1133    let q21 = 0;
1134    let r21 = m21[this.checkboxIndex];
1135    let s21 = {
1136      maxWidth: n21.maxWidth,
1137      minHeight: CHECKBOX_CONTAINER_HEIGHT,
1138      maxHeight: n21.maxHeight
1139    };
1140    let t21 = r21.measure(s21);
1141    q21 += t21.height;
1142    let u21 = m21[this.textIndex];
1143    let v21 = {
1144      maxWidth: n21.maxWidth,
1145      maxHeight: Number(n21.maxHeight) - q21
1146    };
1147    let w21 = u21.measure(v21);
1148    q21 += w21.height;
1149    o21.height = q21;
1150    this.$minContentHeight?.(Math.max(t21.height + TEXT_MIN_HEIGHT, MIN_CONTENT_HEIGHT));
1151    return o21;
1152  }
1153  initialRender() {
1154    this.dialogBuilder.bind(this)();
1155  }
1156  updateStateVars(k21) {
1157    if (k21 === undefined) {
1158      return;
1159    }
1160    if ("minContentHeight" in k21) {
1161      this.updateParam("minContentHeight", k21.minContentHeight);
1162    }
1163  }
1164  rerender() {
1165    this.updateDirtyElements();
1166  }
1167}
1168__decorate([
1169  Param
1170], ConfirmDialogContentLayout.prototype, "minContentHeight", void 0);
1171__decorate([
1172  Event
1173], ConfirmDialogContentLayout.prototype, "$minContentHeight", void 0);
1174export class ConfirmDialogV2 extends ViewV2 {
1175  constructor(e21, f21, g21, h21 = -1, i21, j21) {
1176    super(e21, h21, j21);
1177    this.initParam("title", (f21 && "title" in f21) ? f21.title : '');
1178    this.initParam("content", (f21 && "content" in f21) ? f21.content : '');
1179    this.initParam("checkTips", (f21 && "checkTips" in f21) ? f21.checkTips : '');
1180    this.initParam("checked", (f21 && "checked" in f21) ? f21.checked : false);
1181    this.checkedInner = this.checked;
1182    this.initParam("primaryButton", (f21 && "primaryButton" in f21) ? f21.primaryButton : new AdvancedDialogV2Button({ content: '' }));
1183    this.initParam("secondaryButton", (f21 && "secondaryButton" in f21) ? f21.secondaryButton : new AdvancedDialogV2Button({ content: '' }));
1184    this.fontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_primary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
1185    this.initParam("onCheckedChange", (f21 && "onCheckedChange" in f21) ? f21.onCheckedChange : undefined);
1186    this.contentScroller = new Scroller();
1187    this.marginOffset = 0 - PADDING_LEVEL_8;
1188    this.fontSizeScale = 1;
1189    this.minContentHeight = MIN_CONTENT_HEIGHT;
1190    this.textIndex = 0;
1191    this.checkboxIndex = 1;
1192    this.finalizeConstruction();
1193  }
1194  resetStateVarsOnReuse(d21) {
1195    this.resetParam("title", (d21 && "title" in d21) ? d21.title : '');
1196    this.resetParam("content", (d21 && "content" in d21) ? d21.content : '');
1197    this.resetParam("checkTips", (d21 && "checkTips" in d21) ? d21.checkTips : '');
1198    this.resetParam("checked", (d21 && "checked" in d21) ? d21.checked : false);
1199    this.checkedInner = this.checked;
1200    this.resetParam("primaryButton", (d21 && "primaryButton" in d21) ? d21.primaryButton : new AdvancedDialogV2Button({ content: '' }));
1201    this.resetParam("secondaryButton", (d21 && "secondaryButton" in d21) ? d21.secondaryButton : new AdvancedDialogV2Button({ content: '' }));
1202    this.fontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_primary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
1203    this.resetParam("onCheckedChange", (d21 && "onCheckedChange" in d21) ? d21.onCheckedChange : undefined);
1204    this.fontSizeScale = 1;
1205    this.minContentHeight = MIN_CONTENT_HEIGHT;
1206    this.resetComputed("buttons");
1207    this.resetMonitorsOnReuse();
1208  }
1209  checkedMonitor(c21) {
1210    this.checkedInner = c21.value('checked')?.now;
1211  }
1212  get buttons() {
1213    if (!this.primaryButton && !this.secondaryButton) {
1214      return undefined;
1215    }
1216    let b21 = [];
1217    if (this.primaryButton) {
1218      b21.push(this.primaryButton);
1219    }
1220    if (this.secondaryButton) {
1221      b21.push(this.secondaryButton);
1222    }
1223    return b21;
1224  }
1225  textBuilder(r20 = null) {
1226    this.observeComponentCreation2((z20, a21) => {
1227      Column.create();
1228    }, Column);
1229    this.observeComponentCreation2((x20, y20) => {
1230      Scroll.create(this.contentScroller);
1231      Scroll.nestedScroll({ scrollForward: NestedScrollMode.PARALLEL, scrollBackward: NestedScrollMode.PARALLEL });
1232      Scroll.margin({ end: LengthMetrics.vp(this.marginOffset) });
1233    }, Scroll);
1234    this.observeComponentCreation2((v20, w20) => {
1235      Column.create();
1236      Column.margin({ end: LengthMetrics.resource({ "id": -1, "type": 10002, params: ['sys.float.padding_level8'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }) });
1237    }, Column);
1238    this.observeComponentCreation2((s20, t20) => {
1239      Text.create(this.content);
1240      Text.focusable(true);
1241      Text.defaultFocus(!(this.primaryButton?.content || this.secondaryButton?.content));
1242      Text.focusBox({
1243        strokeWidth: LengthMetrics.px(0)
1244      });
1245      Text.fontSize(`${BODY_L}fp`);
1246      Text.fontWeight(FontWeight.Medium);
1247      Text.fontColor(this.fontColorWithTheme);
1248      Text.textAlign(TextAlign.Center);
1249      Text.onKeyEvent((u20) => {
1250        if (u20) {
1251          resolveKeyEvent(u20, this.contentScroller);
1252        }
1253      });
1254      Text.width('100%');
1255    }, Text);
1256    Text.pop();
1257    Column.pop();
1258    Scroll.pop();
1259    Column.pop();
1260  }
1261  checkBoxBuilder(f20 = null) {
1262    this.observeComponentCreation2((l20, m20) => {
1263      Row.create();
1264      Row.accessibilityGroup(true);
1265      Row.accessibilityText(getCheckTipsAccessibilityText(this.checkTips, this.checkedInner));
1266      Row.accessibilityDescription(this.checkedInner ? { "id": -1, "type": 10003, params: ['sys.string.advanced_dialog_accessibility_cancel_checked_desc'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } : { "id": -1, "type": 10003, params: ['sys.string.slider_accessibility_unselectedDesc'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
1267      Row.onClick(() => {
1268        this.checkedInner = !this.checkedInner;
1269        try {
1270          let q20 = ({
1271            type: 'announceForAccessibility',
1272            bundleName: getContext()?.abilityInfo?.bundleName,
1273            triggerAction: 'common',
1274            textAnnouncedForAccessibility: this.checkedInner ? getContext().resourceManager.getStringSync(125833934) :
1275            getContext().resourceManager.getStringSync(125833935)
1276          });
1277          accessibility.sendAccessibilityEvent(q20);
1278        }
1279        catch (n20) {
1280          let o20 = n20.code;
1281          let p20 = n20.message;
1282          hilog.error(0x3900, 'Ace', `Faild to send event, cause, code: ${o20}, message: ${p20}`);
1283        }
1284      });
1285      Row.width('100%');
1286      Row.padding({ top: 8, bottom: 8 });
1287    }, Row);
1288    this.observeComponentCreation2((i20, j20) => {
1289      Checkbox.create({ name: '', group: 'checkboxGroup' });
1290      Checkbox.select(this.checkedInner);
1291      Checkbox.onChange((k20) => {
1292        this.checkedInner = k20;
1293        if (this.onCheckedChange) {
1294          this.onCheckedChange(this.checkedInner);
1295        }
1296      });
1297      Checkbox.hitTestBehavior(HitTestMode.Block);
1298      Checkbox.margin({ start: LengthMetrics.vp(0), end: LengthMetrics.vp(CHECK_BOX_MARGIN_END) });
1299    }, Checkbox);
1300    Checkbox.pop();
1301    this.observeComponentCreation2((g20, h20) => {
1302      Text.create(this.checkTips);
1303      Text.fontSize(`${BODY_M}fp`);
1304      Text.fontWeight(FontWeight.Medium);
1305      Text.fontColor(this.fontColorWithTheme);
1306      Text.maxLines(CONTENT_MAX_LINES);
1307      Text.focusable(false);
1308      Text.layoutWeight(1);
1309      Text.textOverflow({ overflow: TextOverflow.Ellipsis });
1310    }, Text);
1311    Text.pop();
1312    Row.pop();
1313  }
1314  buildContent(l19 = null) {
1315    {
1316      this.observeComponentCreation2((m19, n19) => {
1317        if (n19) {
1318          let o19 = new ConfirmDialogContentLayout(this, {
1319            minContentHeight: this.minContentHeight,
1320            dialogBuilder: () => {
1321              this.observeComponentCreation2((y19, z19) => {
1322                ForEach.create();
1323                const o = b20 => {
1324                  const c20 = b20;
1325                  this.observeComponentCreation2((d20, e20) => {
1326                    If.create();
1327                    if (c20 === this.textIndex) {
1328                      this.ifElseBranchUpdateFunction(0, () => {
1329                        this.textBuilder.bind(this)();
1330                      });
1331                    }
1332                    else if (c20 === this.checkboxIndex) {
1333                      this.ifElseBranchUpdateFunction(1, () => {
1334                        this.checkBoxBuilder.bind(this)();
1335                      });
1336                    }
1337                    else {
1338                      this.ifElseBranchUpdateFunction(2, () => {
1339                      });
1340                    }
1341                  }, If);
1342                  If.pop();
1343                };
1344                this.forEachUpdateFunction(y19, [this.textIndex, this.checkboxIndex], o);
1345              }, ForEach);
1346              ForEach.pop();
1347            },
1348            $minContentHeight: x19 => { this.minContentHeight = x19; }
1349          }, undefined, m19, () => { }, { page: "library/src/main/ets/components/dialog.ets", line: 790, col: 5 });
1350          ViewV2.create(o19);
1351          let m = () => {
1352            return {
1353              minContentHeight: this.minContentHeight,
1354              dialogBuilder: () => {
1355                this.observeComponentCreation2((q19, r19) => {
1356                  ForEach.create();
1357                  const n = t19 => {
1358                    const u19 = t19;
1359                    this.observeComponentCreation2((v19, w19) => {
1360                      If.create();
1361                      if (u19 === this.textIndex) {
1362                        this.ifElseBranchUpdateFunction(0, () => {
1363                          this.textBuilder.bind(this)();
1364                        });
1365                      }
1366                      else if (u19 === this.checkboxIndex) {
1367                        this.ifElseBranchUpdateFunction(1, () => {
1368                          this.checkBoxBuilder.bind(this)();
1369                        });
1370                      }
1371                      else {
1372                        this.ifElseBranchUpdateFunction(2, () => {
1373                        });
1374                      }
1375                    }, If);
1376                    If.pop();
1377                  };
1378                  this.forEachUpdateFunction(q19, [this.textIndex, this.checkboxIndex], n);
1379                }, ForEach);
1380                ForEach.pop();
1381              }
1382            };
1383          };
1384          o19.paramsGenerator_ = m;
1385        }
1386        else {
1387          this.updateStateVarsOfChildByElmtId(m19, {
1388            minContentHeight: this.minContentHeight
1389          });
1390        }
1391      }, { name: "ConfirmDialogContentLayout" });
1392    }
1393  }
1394  initialRender() {
1395    this.observeComponentCreation2((j19, k19) => {
1396      __Common__.create();
1397      __Common__.constraintSize({ maxHeight: '100%' });
1398    }, __Common__);
1399    {
1400      this.observeComponentCreation2((d19, e19) => {
1401        if (e19) {
1402          let f19 = new CustomDialogContentComponent(this, {
1403            primaryTitle: this.title,
1404            contentBuilder: () => {
1405              this.buildContent();
1406            },
1407            minContentHeight: this.minContentHeight,
1408            buttons: this.buttons,
1409            $minContentHeight: d1 => { this.minContentHeight = d1; }
1410          }, undefined, d19, () => { }, { page: "library/src/main/ets/components/dialog.ets", line: 802, col: 5 });
1411          ViewV2.create(f19);
1412          let l = () => {
1413            return {
1414              primaryTitle: this.title,
1415              contentBuilder: () => {
1416                this.buildContent();
1417              },
1418              minContentHeight: this.minContentHeight,
1419              buttons: this.buttons
1420            };
1421          };
1422          f19.paramsGenerator_ = l;
1423        }
1424        else {
1425          this.updateStateVarsOfChildByElmtId(d19, {
1426            primaryTitle: this.title,
1427            minContentHeight: this.minContentHeight,
1428            buttons: this.buttons
1429          });
1430        }
1431      }, { name: "CustomDialogContentComponent" });
1432    }
1433    __Common__.pop();
1434  }
1435  onWillApplyTheme(c19) {
1436    this.fontColorWithTheme = c19.colors.fontPrimary;
1437  }
1438  updateStateVars(b19) {
1439    if (b19 === undefined) {
1440      return;
1441    }
1442    if ("title" in b19) {
1443      this.updateParam("title", b19.title);
1444    }
1445    if ("content" in b19) {
1446      this.updateParam("content", b19.content);
1447    }
1448    if ("checkTips" in b19) {
1449      this.updateParam("checkTips", b19.checkTips);
1450    }
1451    if ("checked" in b19) {
1452      this.updateParam("checked", b19.checked);
1453    }
1454    if ("primaryButton" in b19) {
1455      this.updateParam("primaryButton", b19.primaryButton);
1456    }
1457    if ("secondaryButton" in b19) {
1458      this.updateParam("secondaryButton", b19.secondaryButton);
1459    }
1460    if ("onCheckedChange" in b19) {
1461      this.updateParam("onCheckedChange", b19.onCheckedChange);
1462    }
1463  }
1464  rerender() {
1465    this.updateDirtyElements();
1466  }
1467}
1468__decorate([
1469  Param
1470], ConfirmDialogV2.prototype, "title", void 0);
1471__decorate([
1472  Param
1473], ConfirmDialogV2.prototype, "content", void 0);
1474__decorate([
1475  Param
1476], ConfirmDialogV2.prototype, "checkTips", void 0);
1477__decorate([
1478  Param
1479], ConfirmDialogV2.prototype, "checked", void 0);
1480__decorate([
1481  Local
1482], ConfirmDialogV2.prototype, "checkedInner", void 0);
1483__decorate([
1484  Monitor('checked')
1485], ConfirmDialogV2.prototype, "checkedMonitor", null);
1486__decorate([
1487  Param
1488], ConfirmDialogV2.prototype, "primaryButton", void 0);
1489__decorate([
1490  Param
1491], ConfirmDialogV2.prototype, "secondaryButton", void 0);
1492__decorate([
1493  Local
1494], ConfirmDialogV2.prototype, "fontColorWithTheme", void 0);
1495__decorate([
1496  Param
1497], ConfirmDialogV2.prototype, "onCheckedChange", void 0);
1498__decorate([
1499  Provider()
1500], ConfirmDialogV2.prototype, "fontSizeScale", void 0);
1501__decorate([
1502  Local
1503], ConfirmDialogV2.prototype, "minContentHeight", void 0);
1504__decorate([
1505  Computed
1506], ConfirmDialogV2.prototype, "buttons", null);
1507export class AlertDialogV2 extends ViewV2 {
1508  constructor(v18, w18, x18, y18 = -1, z18, a19) {
1509    super(v18, y18, a19);
1510    this.initParam("primaryTitle", (w18 && "primaryTitle" in w18) ? w18.primaryTitle : undefined);
1511    this.initParam("secondaryTitle", (w18 && "secondaryTitle" in w18) ? w18.secondaryTitle : undefined);
1512    this.initParam("content", (w18 && "content" in w18) ? w18.content : '');
1513    this.initParam("primaryButton", (w18 && "primaryButton" in w18) ? w18.primaryButton : null);
1514    this.initParam("secondaryButton", (w18 && "secondaryButton" in w18) ? w18.secondaryButton : null);
1515    this.textAlign = TextAlign.Center;
1516    this.contentScroller = new Scroller();
1517    this.fontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_primary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
1518    this.fontSizeScale = 1;
1519    this.minContentHeight = MIN_CONTENT_HEIGHT;
1520    this.finalizeConstruction();
1521  }
1522  resetStateVarsOnReuse(u18) {
1523    this.resetParam("primaryTitle", (u18 && "primaryTitle" in u18) ? u18.primaryTitle : undefined);
1524    this.resetParam("secondaryTitle", (u18 && "secondaryTitle" in u18) ? u18.secondaryTitle : undefined);
1525    this.resetParam("content", (u18 && "content" in u18) ? u18.content : '');
1526    this.resetParam("primaryButton", (u18 && "primaryButton" in u18) ? u18.primaryButton : null);
1527    this.resetParam("secondaryButton", (u18 && "secondaryButton" in u18) ? u18.secondaryButton : null);
1528    this.fontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_primary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
1529    this.fontSizeScale = 1;
1530    this.minContentHeight = MIN_CONTENT_HEIGHT;
1531    this.resetComputed("buttons");
1532  }
1533  get buttons() {
1534    if (!this.primaryButton && !this.secondaryButton) {
1535      return undefined;
1536    }
1537    let t18 = [];
1538    if (this.primaryButton) {
1539      t18.push(this.primaryButton);
1540    }
1541    if (this.secondaryButton) {
1542      t18.push(this.secondaryButton);
1543    }
1544    return t18;
1545  }
1546  initialRender() {
1547    this.observeComponentCreation2((r18, s18) => {
1548      __Common__.create();
1549      __Common__.constraintSize({ maxHeight: '100%' });
1550    }, __Common__);
1551    {
1552      this.observeComponentCreation2((l18, m18) => {
1553        if (m18) {
1554          let n18 = new CustomDialogContentComponent(this, {
1555            primaryTitle: this.primaryTitle,
1556            secondaryTitle: this.secondaryTitle,
1557            contentBuilder: () => {
1558              this.AlertDialogContentBuilder();
1559            },
1560            buttons: this.buttons,
1561            minContentHeight: this.minContentHeight,
1562            $minContentHeight: a1 => { this.minContentHeight = a1; }
1563          }, undefined, l18, () => { }, { page: "library/src/main/ets/components/dialog.ets", line: 847, col: 5 });
1564          ViewV2.create(n18);
1565          let k = () => {
1566            return {
1567              primaryTitle: this.primaryTitle,
1568              secondaryTitle: this.secondaryTitle,
1569              contentBuilder: () => {
1570                this.AlertDialogContentBuilder();
1571              },
1572              buttons: this.buttons,
1573              minContentHeight: this.minContentHeight
1574            };
1575          };
1576          n18.paramsGenerator_ = k;
1577        }
1578        else {
1579          this.updateStateVarsOfChildByElmtId(l18, {
1580            primaryTitle: this.primaryTitle,
1581            secondaryTitle: this.secondaryTitle,
1582            buttons: this.buttons,
1583            minContentHeight: this.minContentHeight
1584          });
1585        }
1586      }, { name: "CustomDialogContentComponent" });
1587    }
1588    __Common__.pop();
1589  }
1590  AlertDialogContentBuilder(d18 = null) {
1591    this.observeComponentCreation2((j18, k18) => {
1592      Column.create();
1593      Column.margin({ end: LengthMetrics.vp(0 - SCROLL_BAR_OFFSET) });
1594    }, Column);
1595    this.observeComponentCreation2((h18, i18) => {
1596      Scroll.create(this.contentScroller);
1597      Scroll.nestedScroll({ scrollForward: NestedScrollMode.PARALLEL, scrollBackward: NestedScrollMode.PARALLEL });
1598      Scroll.width('100%');
1599    }, Scroll);
1600    this.observeComponentCreation2((e18, f18) => {
1601      Text.create(this.content);
1602      Text.focusable(true);
1603      Text.defaultFocus(!(this.primaryButton || this.secondaryButton));
1604      Text.focusBox({
1605        strokeWidth: LengthMetrics.px(0)
1606      });
1607      Text.fontSize(`${BODY_L}fp`);
1608      Text.fontWeight(this.getFontWeight());
1609      Text.fontColor(this.fontColorWithTheme);
1610      Text.margin({ end: LengthMetrics.vp(SCROLL_BAR_OFFSET) });
1611      Text.width(`calc(100% - ${SCROLL_BAR_OFFSET}vp)`);
1612      Text.textAlign(this.textAlign);
1613      Text.onKeyEvent((g18) => {
1614        if (g18) {
1615          resolveKeyEvent(g18, this.contentScroller);
1616        }
1617      });
1618    }, Text);
1619    Text.pop();
1620    Scroll.pop();
1621    Column.pop();
1622  }
1623  onWillApplyTheme(c18) {
1624    this.fontColorWithTheme = c18.colors.fontPrimary;
1625  }
1626  getFontWeight() {
1627    if (this.primaryTitle || this.secondaryTitle) {
1628      return FontWeight.Regular;
1629    }
1630    return FontWeight.Medium;
1631  }
1632  updateStateVars(b18) {
1633    if (b18 === undefined) {
1634      return;
1635    }
1636    if ("primaryTitle" in b18) {
1637      this.updateParam("primaryTitle", b18.primaryTitle);
1638    }
1639    if ("secondaryTitle" in b18) {
1640      this.updateParam("secondaryTitle", b18.secondaryTitle);
1641    }
1642    if ("content" in b18) {
1643      this.updateParam("content", b18.content);
1644    }
1645    if ("primaryButton" in b18) {
1646      this.updateParam("primaryButton", b18.primaryButton);
1647    }
1648    if ("secondaryButton" in b18) {
1649      this.updateParam("secondaryButton", b18.secondaryButton);
1650    }
1651  }
1652  rerender() {
1653    this.updateDirtyElements();
1654  }
1655}
1656__decorate([
1657  Param
1658], AlertDialogV2.prototype, "primaryTitle", void 0);
1659__decorate([
1660  Param
1661], AlertDialogV2.prototype, "secondaryTitle", void 0);
1662__decorate([
1663  Param
1664], AlertDialogV2.prototype, "content", void 0);
1665__decorate([
1666  Param
1667], AlertDialogV2.prototype, "primaryButton", void 0);
1668__decorate([
1669  Param
1670], AlertDialogV2.prototype, "secondaryButton", void 0);
1671__decorate([
1672  Local
1673], AlertDialogV2.prototype, "fontColorWithTheme", void 0);
1674__decorate([
1675  Provider()
1676], AlertDialogV2.prototype, "fontSizeScale", void 0);
1677__decorate([
1678  Local
1679], AlertDialogV2.prototype, "minContentHeight", void 0);
1680__decorate([
1681  Computed
1682], AlertDialogV2.prototype, "buttons", null);
1683export class CustomContentDialogV2 extends ViewV2 {
1684  constructor(v17, w17, x17, y17 = -1, z17, a18) {
1685    super(v17, y17, a18);
1686    this.initParam("primaryTitle", (w17 && "primaryTitle" in w17) ? w17.primaryTitle : undefined);
1687    this.initParam("secondaryTitle", (w17 && "secondaryTitle" in w17) ? w17.secondaryTitle : undefined);
1688    this.contentBuilder = "contentBuilder" in w17 ? w17.contentBuilder : undefined;
1689    this.initParam("contentAreaPadding", (w17 && "contentAreaPadding" in w17) ? w17.contentAreaPadding : undefined);
1690    this.initParam("buttons", (w17 && "buttons" in w17) ? w17.buttons : undefined);
1691    this.fontSizeScale = 1;
1692    this.minContentHeight = MIN_CONTENT_HEIGHT;
1693    this.finalizeConstruction();
1694  }
1695  resetStateVarsOnReuse(u17) {
1696    this.resetParam("primaryTitle", (u17 && "primaryTitle" in u17) ? u17.primaryTitle : undefined);
1697    this.resetParam("secondaryTitle", (u17 && "secondaryTitle" in u17) ? u17.secondaryTitle : undefined);
1698    this.contentBuilder = "contentBuilder" in u17 ? u17.contentBuilder : undefined;
1699    this.resetParam("contentAreaPadding", (u17 && "contentAreaPadding" in u17) ? u17.contentAreaPadding : undefined);
1700    this.resetParam("buttons", (u17 && "buttons" in u17) ? u17.buttons : undefined);
1701    this.fontSizeScale = 1;
1702    this.minContentHeight = MIN_CONTENT_HEIGHT;
1703  }
1704  initialRender() {
1705    this.observeComponentCreation2((s17, t17) => {
1706      __Common__.create();
1707      __Common__.constraintSize({ maxHeight: '100%' });
1708    }, __Common__);
1709    {
1710      this.observeComponentCreation2((m17, n17) => {
1711        if (n17) {
1712          let o17 = new CustomDialogContentComponent(this, {
1713            primaryTitle: this.primaryTitle,
1714            secondaryTitle: this.secondaryTitle,
1715            contentBuilder: () => {
1716              if (typeof this.contentBuilder === 'function') {
1717                this.contentBuilder();
1718              }
1719            },
1720            contentAreaPadding: this.contentAreaPadding,
1721            buttons: this.buttons,
1722            minContentHeight: this.minContentHeight,
1723            $minContentHeight: w => { this.minContentHeight = w; }
1724          }, undefined, m17, () => { }, { page: "library/src/main/ets/components/dialog.ets", line: 909, col: 5 });
1725          ViewV2.create(o17);
1726          let j = () => {
1727            return {
1728              primaryTitle: this.primaryTitle,
1729              secondaryTitle: this.secondaryTitle,
1730              contentBuilder: () => {
1731                if (typeof this.contentBuilder === 'function') {
1732                  this.contentBuilder();
1733                }
1734              },
1735              contentAreaPadding: this.contentAreaPadding,
1736              buttons: this.buttons,
1737              minContentHeight: this.minContentHeight
1738            };
1739          };
1740          o17.paramsGenerator_ = j;
1741        }
1742        else {
1743          this.updateStateVarsOfChildByElmtId(m17, {
1744            primaryTitle: this.primaryTitle,
1745            secondaryTitle: this.secondaryTitle,
1746            contentAreaPadding: this.contentAreaPadding,
1747            buttons: this.buttons,
1748            minContentHeight: this.minContentHeight
1749          });
1750        }
1751      }, { name: "CustomDialogContentComponent" });
1752    }
1753    __Common__.pop();
1754  }
1755  updateStateVars(l17) {
1756    if (l17 === undefined) {
1757      return;
1758    }
1759    if ("primaryTitle" in l17) {
1760      this.updateParam("primaryTitle", l17.primaryTitle);
1761    }
1762    if ("secondaryTitle" in l17) {
1763      this.updateParam("secondaryTitle", l17.secondaryTitle);
1764    }
1765    if ("contentAreaPadding" in l17) {
1766      this.updateParam("contentAreaPadding", l17.contentAreaPadding);
1767    }
1768    if ("buttons" in l17) {
1769      this.updateParam("buttons", l17.buttons);
1770    }
1771  }
1772  rerender() {
1773    this.updateDirtyElements();
1774  }
1775}
1776__decorate([
1777  Param
1778], CustomContentDialogV2.prototype, "primaryTitle", void 0);
1779__decorate([
1780  Param
1781], CustomContentDialogV2.prototype, "secondaryTitle", void 0);
1782__decorate([
1783  Param
1784], CustomContentDialogV2.prototype, "contentAreaPadding", void 0);
1785__decorate([
1786  Param
1787], CustomContentDialogV2.prototype, "buttons", void 0);
1788__decorate([
1789  Provider()
1790], CustomContentDialogV2.prototype, "fontSizeScale", void 0);
1791__decorate([
1792  Local
1793], CustomContentDialogV2.prototype, "minContentHeight", void 0);
1794class CustomDialogLayout extends ViewV2 {
1795  constructor(f17, g17, h17, i17 = -1, j17, k17) {
1796    super(f17, i17, k17);
1797    this.initParam("titleHeight", (g17 && "titleHeight" in g17) ? g17.titleHeight : 0);
1798    this.$titleHeight = "$titleHeight" in g17 ? g17.$titleHeight : undefined;
1799    this.initParam("buttonHeight", (g17 && "buttonHeight" in g17) ? g17.buttonHeight : 0);
1800    this.$buttonHeight = "$buttonHeight" in g17 ? g17.$buttonHeight : undefined;
1801    this.initParam("titleMinHeight", (g17 && "titleMinHeight" in g17) ? g17.titleMinHeight : 0);
1802    this.dialogBuilder = "dialogBuilder" in g17 ? g17.dialogBuilder : this.doNothingBuilder;
1803    this.titleIndex = 0;
1804    this.contentIndex = 1;
1805    this.buttonIndex = 2;
1806    this.finalizeConstruction();
1807  }
1808  resetStateVarsOnReuse(e17) {
1809    this.resetParam("titleHeight", (e17 && "titleHeight" in e17) ? e17.titleHeight : 0);
1810    this.$titleHeight = "$titleHeight" in e17 ? e17.$titleHeight : undefined;
1811    this.resetParam("buttonHeight", (e17 && "buttonHeight" in e17) ? e17.buttonHeight : 0);
1812    this.$buttonHeight = "$buttonHeight" in e17 ? e17.$buttonHeight : undefined;
1813    this.resetParam("titleMinHeight", (e17 && "titleMinHeight" in e17) ? e17.titleMinHeight : 0);
1814    this.dialogBuilder = "dialogBuilder" in e17 ? e17.dialogBuilder : this.doNothingBuilder;
1815  }
1816  doNothingBuilder(d17 = null) {
1817  }
1818  ;
1819  onPlaceChildren(w16, x16, y16) {
1820    let z16 = 0;
1821    let a17 = 0;
1822    for (let b17 = 0; b17 < x16.length; b17++) {
1823      let c17 = x16[b17];
1824      c17.layout({ x: z16, y: a17 });
1825      a17 += c17.measureResult.height;
1826    }
1827  }
1828  onMeasureSize(i16, j16, k16) {
1829    let l16 = { width: Number(k16.maxWidth), height: 0 };
1830    let m16 = 3;
1831    if (j16.length < m16) {
1832      return l16;
1833    }
1834    let n16 = 0;
1835    let o16 = j16[this.titleIndex];
1836    let p16 = {
1837      maxWidth: k16.maxWidth,
1838      minHeight: this.titleMinHeight,
1839      maxHeight: k16.maxHeight
1840    };
1841    let q16 = o16.measure(p16);
1842    this.$titleHeight?.(q16.height);
1843    n16 += q16.height;
1844    let r16 = j16[this.buttonIndex];
1845    let s16 = r16.measure(k16);
1846    this.$buttonHeight?.(s16.height);
1847    n16 += s16.height;
1848    let t16 = j16[this.contentIndex];
1849    let u16 = {
1850      maxWidth: k16.maxWidth,
1851      maxHeight: Number(k16.maxHeight) - n16
1852    };
1853    let v16 = t16.measure(u16);
1854    n16 += v16.height;
1855    l16.height = n16;
1856    return l16;
1857  }
1858  initialRender() {
1859    this.dialogBuilder.bind(this)();
1860  }
1861  updateStateVars(h16) {
1862    if (h16 === undefined) {
1863      return;
1864    }
1865    if ("titleHeight" in h16) {
1866      this.updateParam("titleHeight", h16.titleHeight);
1867    }
1868    if ("buttonHeight" in h16) {
1869      this.updateParam("buttonHeight", h16.buttonHeight);
1870    }
1871    if ("titleMinHeight" in h16) {
1872      this.updateParam("titleMinHeight", h16.titleMinHeight);
1873    }
1874  }
1875  rerender() {
1876    this.updateDirtyElements();
1877  }
1878}
1879__decorate([
1880  Param
1881], CustomDialogLayout.prototype, "titleHeight", void 0);
1882__decorate([
1883  Event
1884], CustomDialogLayout.prototype, "$titleHeight", void 0);
1885__decorate([
1886  Param
1887], CustomDialogLayout.prototype, "buttonHeight", void 0);
1888__decorate([
1889  Event
1890], CustomDialogLayout.prototype, "$buttonHeight", void 0);
1891__decorate([
1892  Param
1893], CustomDialogLayout.prototype, "titleMinHeight", void 0);
1894class CustomDialogContentComponent extends ViewV2 {
1895  constructor(b16, c16, d16, e16 = -1, f16, g16) {
1896    super(b16, e16, g16);
1897    this.initParam("primaryTitle", (c16 && "primaryTitle" in c16) ? c16.primaryTitle : undefined);
1898    this.initParam("secondaryTitle", (c16 && "secondaryTitle" in c16) ? c16.secondaryTitle : undefined);
1899    this.contentBuilder = "contentBuilder" in c16 ? c16.contentBuilder : this.defaultContentBuilder;
1900    this.initParam("buttons", (c16 && "buttons" in c16) ? c16.buttons : undefined);
1901    this.initParam("contentAreaPadding", (c16 && "contentAreaPadding" in c16) ? c16.contentAreaPadding : undefined);
1902    this.initParam("minContentHeight", (c16 && "minContentHeight" in c16) ? c16.minContentHeight : undefined);
1903    this.$minContentHeight = "$minContentHeight" in c16 ? c16.$minContentHeight : undefined;
1904    this.keyIndex = 0;
1905    this.titleHeight = 0;
1906    this.buttonHeight = 0;
1907    this.contentMaxHeight = '100%';
1908    this.fontSizeScale = -1;
1909    this.customStyle = undefined;
1910    this.buttonMaxFontSize = `${BODY_L}fp`;
1911    this.buttonMinFontSize = 9;
1912    this.primaryTitleFontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_primary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
1913    this.secondaryTitleFontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_secondary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
1914    this.titleTextAlign = TextAlign.Center;
1915    this.isButtonVertical = false;
1916    this.isFollowingSystemFontScale = false;
1917    this.appMaxFontScale = 3.2;
1918    this.titleIndex = 0;
1919    this.contentIndex = 1;
1920    this.buttonIndex = 2;
1921    this.primaryTitleMaxFontSize = `${TITLE_S}fp`;
1922    this.primaryTitleMinFontSize = `${BODY_L}fp`;
1923    this.secondaryTitleMaxFontSize = `${SUBTITLE_S}fp`;
1924    this.secondaryTitleMinFontSize = `${BODY_S}fp`;
1925    this.finalizeConstruction();
1926  }
1927  resetStateVarsOnReuse(a16) {
1928    this.resetParam("primaryTitle", (a16 && "primaryTitle" in a16) ? a16.primaryTitle : undefined);
1929    this.resetParam("secondaryTitle", (a16 && "secondaryTitle" in a16) ? a16.secondaryTitle : undefined);
1930    this.contentBuilder = "contentBuilder" in a16 ? a16.contentBuilder : this.defaultContentBuilder;
1931    this.resetParam("buttons", (a16 && "buttons" in a16) ? a16.buttons : undefined);
1932    this.resetParam("contentAreaPadding", (a16 && "contentAreaPadding" in a16) ? a16.contentAreaPadding : undefined);
1933    this.resetParam("minContentHeight", (a16 && "minContentHeight" in a16) ? a16.minContentHeight : undefined);
1934    this.$minContentHeight = "$minContentHeight" in a16 ? a16.$minContentHeight : undefined;
1935    this.titleHeight = 0;
1936    this.buttonHeight = 0;
1937    this.contentMaxHeight = '100%';
1938    this.resetConsumer("fontSizeScale", -1);
1939    this.customStyle = undefined;
1940    this.buttonMaxFontSize = `${BODY_L}fp`;
1941    this.buttonMinFontSize = 9;
1942    this.primaryTitleFontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_primary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
1943    this.secondaryTitleFontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_secondary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
1944    this.titleTextAlign = TextAlign.Center;
1945    this.isButtonVertical = false;
1946  }
1947  defaultContentBuilder(z15 = null) {
1948  }
1949  initialRender() {
1950    this.observeComponentCreation2((x15, y15) => {
1951      Scroll.create();
1952      Scroll.backgroundColor(Color.Transparent);
1953    }, Scroll);
1954    this.observeComponentCreation2((v15, w15) => {
1955      Column.create();
1956      Column.constraintSize({ maxHeight: this.contentMaxHeight });
1957      Column.backgroundBlurStyle(this.customStyle ? BlurStyle.Thick : BlurStyle.NONE);
1958      Column.borderRadius(this.customStyle ? { "id": -1, "type": 10002, params: ['sys.float.ohos_id_corner_radius_dialog'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } : 0);
1959      Column.margin(this.customStyle ? {
1960        start: LengthMetrics.resource({ "id": -1, "type": 10002, params: ['sys.float.ohos_id_dialog_margin_start'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }),
1961        end: LengthMetrics.resource({ "id": -1, "type": 10002, params: ['sys.float.ohos_id_dialog_margin_end'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }),
1962        bottom: LengthMetrics.resource({ "id": -1, "type": 10002, params: ['sys.float.ohos_id_dialog_margin_bottom'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }),
1963      } : { left: 0, right: 0, bottom: 0 });
1964      Column.backgroundColor(this.customStyle ? { "id": -1, "type": 10001, params: ['sys.color.ohos_id_color_dialog_bg'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } : Color.Transparent);
1965    }, Column);
1966    {
1967      this.observeComponentCreation2((x14, y14) => {
1968        if (y14) {
1969          let z14 = new CustomDialogLayout(this, {
1970            buttonHeight: this.buttonHeight,
1971            titleHeight: this.titleHeight,
1972            titleMinHeight: this.getTitleAreaMinHeight(),
1973            dialogBuilder: () => {
1974              this.observeComponentCreation2((m15, n15) => {
1975                ForEach.create();
1976                const i = p15 => {
1977                  const q15 = p15;
1978                  this.observeComponentCreation2((r15, s15) => {
1979                    If.create();
1980                    if (q15 === this.titleIndex) {
1981                      this.ifElseBranchUpdateFunction(0, () => {
1982                        this.titleBuilder.bind(this)();
1983                      });
1984                    }
1985                    else if (q15 === this.contentIndex) {
1986                      this.ifElseBranchUpdateFunction(1, () => {
1987                        this.observeComponentCreation2((t15, u15) => {
1988                          Column.create();
1989                          Column.padding(this.getContentPadding());
1990                        }, Column);
1991                        this.contentBuilder.bind(this)();
1992                        Column.pop();
1993                      });
1994                    }
1995                    else {
1996                      this.ifElseBranchUpdateFunction(2, () => {
1997                        this.ButtonBuilder.bind(this)();
1998                      });
1999                    }
2000                  }, If);
2001                  If.pop();
2002                };
2003                this.forEachUpdateFunction(m15, [this.titleIndex, this.contentIndex, this.buttonIndex], i);
2004              }, ForEach);
2005              ForEach.pop();
2006            },
2007            $buttonHeight: l15 => { this.buttonHeight = l15; },
2008            $titleHeight: k15 => { this.titleHeight = k15; }
2009          }, undefined, x14, () => { }, { page: "library/src/main/ets/components/dialog.ets", line: 1044, col: 9 });
2010          ViewV2.create(z14);
2011          let f = () => {
2012            return {
2013              buttonHeight: this.buttonHeight,
2014              titleHeight: this.titleHeight,
2015              titleMinHeight: this.getTitleAreaMinHeight(),
2016              dialogBuilder: () => {
2017                this.observeComponentCreation2((b15, c15) => {
2018                  ForEach.create();
2019                  const g = e15 => {
2020                    const f15 = e15;
2021                    this.observeComponentCreation2((g15, h15) => {
2022                      If.create();
2023                      if (f15 === this.titleIndex) {
2024                        this.ifElseBranchUpdateFunction(0, () => {
2025                          this.titleBuilder.bind(this)();
2026                        });
2027                      }
2028                      else if (f15 === this.contentIndex) {
2029                        this.ifElseBranchUpdateFunction(1, () => {
2030                          this.observeComponentCreation2((i15, j15) => {
2031                            Column.create();
2032                            Column.padding(this.getContentPadding());
2033                          }, Column);
2034                          this.contentBuilder.bind(this)();
2035                          Column.pop();
2036                        });
2037                      }
2038                      else {
2039                        this.ifElseBranchUpdateFunction(2, () => {
2040                          this.ButtonBuilder.bind(this)();
2041                        });
2042                      }
2043                    }, If);
2044                    If.pop();
2045                  };
2046                  this.forEachUpdateFunction(b15, [this.titleIndex, this.contentIndex, this.buttonIndex], g);
2047                }, ForEach);
2048                ForEach.pop();
2049              }
2050            };
2051          };
2052          z14.paramsGenerator_ = f;
2053        }
2054        else {
2055          this.updateStateVarsOfChildByElmtId(x14, {
2056            buttonHeight: this.buttonHeight,
2057            titleHeight: this.titleHeight,
2058            titleMinHeight: this.getTitleAreaMinHeight()
2059          });
2060        }
2061      }, { name: "CustomDialogLayout" });
2062    }
2063    Column.pop();
2064    Scroll.pop();
2065  }
2066  onMeasureSize(o14, p14, q14) {
2067    let r14 = { width: o14.width, height: o14.height };
2068    let s14 = Number(q14.maxWidth);
2069    let t14 = Number(q14.maxHeight);
2070    this.fontSizeScale = this.updateFontScale();
2071    this.updateFontSize();
2072    this.isButtonVertical = this.isVerticalAlignButton(s14 - BUTTON_HORIZONTAL_MARGIN * 2);
2073    let u14 = 0;
2074    p14.forEach((v14) => {
2075      this.contentMaxHeight = '100%';
2076      let w14 = v14.measure(q14);
2077      if (t14 - this.buttonHeight - this.titleHeight < this.minContentHeight) {
2078        this.contentMaxHeight = MAX_CONTENT_HEIGHT;
2079        w14 = v14.measure(q14);
2080      }
2081      u14 += w14.height;
2082    });
2083    r14.height = u14;
2084    r14.width = s14;
2085    return r14;
2086  }
2087  onWillApplyTheme(n14) {
2088    this.primaryTitleFontColorWithTheme = n14.colors.fontPrimary;
2089    this.secondaryTitleFontColorWithTheme = n14.colors.fontSecondary;
2090  }
2091  aboutToAppear() {
2092    let m14 = this.getUIContext();
2093    this.isFollowingSystemFontScale = m14.isFollowingSystemFontScale();
2094    this.appMaxFontScale = m14.getMaxFontScale();
2095    this.fontSizeScale = this.updateFontScale();
2096    this.initTitleTextAlign();
2097  }
2098  updateFontSize() {
2099    if (this.fontSizeScale > MAX_FONT_SCALE) {
2100      this.buttonMaxFontSize = BODY_L * MAX_FONT_SCALE + 'vp';
2101      this.buttonMinFontSize = BUTTON_MIN_FONT_SIZE * MAX_FONT_SCALE + 'vp';
2102    }
2103    else {
2104      this.buttonMaxFontSize = BODY_L + 'fp';
2105      this.buttonMinFontSize = BUTTON_MIN_FONT_SIZE + 'fp';
2106    }
2107  }
2108  updateFontScale() {
2109    try {
2110      let k14 = this.getUIContext();
2111      let l14 = k14.getHostContext()?.config?.fontSizeScale ?? 1;
2112      if (!this.isFollowingSystemFontScale) {
2113        return 1;
2114      }
2115      return Math.min(l14, this.appMaxFontScale);
2116    }
2117    catch (h14) {
2118      let i14 = h14.code;
2119      let j14 = h14.message;
2120      hilog.error(0x3900, 'Ace', `Faild to init fontsizescale info,cause, code: ${i14}, message: ${j14}`);
2121      return 1;
2122    }
2123  }
2124  getContentPadding() {
2125    if (this.contentAreaPadding) {
2126      return this.contentAreaPadding;
2127    }
2128    if ((this.primaryTitle || this.secondaryTitle) && this.buttons && this.buttons.length > 0) {
2129      return {
2130        top: 0,
2131        right: { "id": -1, "type": 10002, params: ['sys.float.alert_content_default_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2132        bottom: 0,
2133        left: { "id": -1, "type": 10002, params: ['sys.float.alert_content_default_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2134      };
2135    }
2136    else if (this.primaryTitle || this.secondaryTitle) {
2137      return {
2138        top: 0,
2139        right: { "id": -1, "type": 10002, params: ['sys.float.alert_content_default_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2140        bottom: { "id": -1, "type": 10002, params: ['sys.float.alert_content_default_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2141        left: { "id": -1, "type": 10002, params: ['sys.float.alert_content_default_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2142      };
2143    }
2144    else if (this.buttons && this.buttons.length > 0) {
2145      return {
2146        top: { "id": -1, "type": 10002, params: ['sys.float.alert_content_default_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2147        right: { "id": -1, "type": 10002, params: ['sys.float.alert_content_default_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2148        bottom: 0,
2149        left: { "id": -1, "type": 10002, params: ['sys.float.alert_content_default_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2150      };
2151    }
2152    else {
2153      return {
2154        top: { "id": -1, "type": 10002, params: ['sys.float.alert_content_default_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2155        right: { "id": -1, "type": 10002, params: ['sys.float.alert_content_default_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2156        bottom: { "id": -1, "type": 10002, params: ['sys.float.alert_content_default_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2157        left: { "id": -1, "type": 10002, params: ['sys.float.alert_content_default_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2158      };
2159    }
2160  }
2161  titleBuilder(s13 = null) {
2162    this.observeComponentCreation2((f14, g14) => {
2163      Column.create();
2164      Column.justifyContent(FlexAlign.Center);
2165      Column.width('100%');
2166      Column.padding(this.getTitleAreaPadding());
2167    }, Column);
2168    this.observeComponentCreation2((d14, e14) => {
2169      Row.create();
2170      Row.width('100%');
2171    }, Row);
2172    this.observeComponentCreation2((b14, c14) => {
2173      Text.create(this.primaryTitle);
2174      Text.fontWeight(FontWeight.Bold);
2175      Text.fontColor(this.primaryTitleFontColorWithTheme);
2176      Text.textAlign(this.titleTextAlign);
2177      Text.maxFontSize(this.primaryTitleMaxFontSize);
2178      Text.minFontSize(this.primaryTitleMinFontSize);
2179      Text.maxFontScale(Math.min(this.appMaxFontScale, MAX_FONT_SCALE));
2180      Text.maxLines(TITLE_MAX_LINES);
2181      Text.heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST);
2182      Text.textOverflow({ overflow: TextOverflow.Ellipsis });
2183      Text.width('100%');
2184    }, Text);
2185    Text.pop();
2186    Row.pop();
2187    this.observeComponentCreation2((x13, y13) => {
2188      If.create();
2189      if (this.primaryTitle && this.secondaryTitle) {
2190        this.ifElseBranchUpdateFunction(0, () => {
2191          this.observeComponentCreation2((z13, a14) => {
2192            Row.create();
2193            Row.height({ "id": -1, "type": 10002, params: ['sys.float.padding_level1'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
2194          }, Row);
2195          Row.pop();
2196        });
2197      }
2198      else {
2199        this.ifElseBranchUpdateFunction(1, () => {
2200        });
2201      }
2202    }, If);
2203    If.pop();
2204    this.observeComponentCreation2((v13, w13) => {
2205      Row.create();
2206      Row.width('100%');
2207    }, Row);
2208    this.observeComponentCreation2((t13, u13) => {
2209      Text.create(this.secondaryTitle);
2210      Text.fontWeight(FontWeight.Regular);
2211      Text.fontColor(this.secondaryTitleFontColorWithTheme);
2212      Text.textAlign(this.titleTextAlign);
2213      Text.maxFontSize(this.secondaryTitleMaxFontSize);
2214      Text.minFontSize(this.secondaryTitleMinFontSize);
2215      Text.maxFontScale(Math.min(this.appMaxFontScale, MAX_FONT_SCALE));
2216      Text.maxLines(TITLE_MAX_LINES);
2217      Text.heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST);
2218      Text.textOverflow({ overflow: TextOverflow.Ellipsis });
2219      Text.width('100%');
2220    }, Text);
2221    Text.pop();
2222    Row.pop();
2223    Column.pop();
2224  }
2225  getTitleAreaPadding() {
2226    if (this.primaryTitle || this.secondaryTitle) {
2227      return {
2228        top: { "id": -1, "type": 10002, params: ['sys.float.alert_title_padding_top'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2229        right: { "id": -1, "type": 10002, params: ['sys.float.alert_title_padding_right'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2230        left: { "id": -1, "type": 10002, params: ['sys.float.alert_title_padding_left'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2231        bottom: { "id": -1, "type": 10002, params: ['sys.float.alert_title_padding_bottom'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2232      };
2233    }
2234    return {
2235      top: 0,
2236      right: { "id": -1, "type": 10002, params: ['sys.float.alert_title_padding_right'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2237      left: { "id": -1, "type": 10002, params: ['sys.float.alert_title_padding_left'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2238      bottom: 0,
2239    };
2240  }
2241  initTitleTextAlign() {
2242    let r13 = ALERT_TITLE_ALIGNMENT;
2243    if (r13 === TextAlign.Start) {
2244      this.titleTextAlign = TextAlign.Start;
2245    }
2246    else if (r13 === TextAlign.Center) {
2247      this.titleTextAlign = TextAlign.Center;
2248    }
2249    else if (r13 === TextAlign.End) {
2250      this.titleTextAlign = TextAlign.End;
2251    }
2252    else if (r13 === TextAlign.JUSTIFY) {
2253      this.titleTextAlign = TextAlign.JUSTIFY;
2254    }
2255    else {
2256      this.titleTextAlign = TextAlign.Center;
2257    }
2258  }
2259  getTitleAreaMinHeight() {
2260    if (this.secondaryTitle) {
2261      return { "id": -1, "type": 10002, params: ['sys.float.alert_title_secondary_height'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
2262    }
2263    else if (this.primaryTitle) {
2264      return { "id": -1, "type": 10002, params: ['sys.float.alert_title_primary_height'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
2265    }
2266    else {
2267      return 0;
2268    }
2269  }
2270  ButtonBuilder(k13 = null) {
2271    this.observeComponentCreation2((p13, q13) => {
2272      Column.create();
2273      Column.width('100%');
2274      Column.padding(this.getOperationAreaPadding());
2275    }, Column);
2276    this.observeComponentCreation2((l13, m13) => {
2277      If.create();
2278      if (this.buttons && this.buttons.length > 0) {
2279        this.ifElseBranchUpdateFunction(0, () => {
2280          this.observeComponentCreation2((n13, o13) => {
2281            If.create();
2282            if (this.isButtonVertical) {
2283              this.ifElseBranchUpdateFunction(0, () => {
2284                this.buildVerticalAlignButtons.bind(this)();
2285              });
2286            }
2287            else {
2288              this.ifElseBranchUpdateFunction(1, () => {
2289                this.buildHorizontalAlignButtons.bind(this)();
2290              });
2291            }
2292          }, If);
2293          If.pop();
2294        });
2295      }
2296      else {
2297        this.ifElseBranchUpdateFunction(1, () => {
2298        });
2299      }
2300    }, If);
2301    If.pop();
2302    Column.pop();
2303  }
2304  getOperationAreaPadding() {
2305    if (this.isButtonVertical) {
2306      return {
2307        top: { "id": -1, "type": 10002, params: ['sys.float.alert_button_top_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2308        right: { "id": -1, "type": 10002, params: ['sys.float.alert_right_padding_vertical'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2309        left: { "id": -1, "type": 10002, params: ['sys.float.alert_left_padding_vertical'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2310        bottom: { "id": -1, "type": 10002, params: ['sys.float.alert_button_bottom_padding_vertical'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2311      };
2312    }
2313    return {
2314      top: { "id": -1, "type": 10002, params: ['sys.float.alert_button_top_padding'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2315      right: { "id": -1, "type": 10002, params: ['sys.float.alert_right_padding_horizontal'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2316      left: { "id": -1, "type": 10002, params: ['sys.float.alert_left_padding_horizontal'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2317      bottom: { "id": -1, "type": 10002, params: ['sys.float.alert_button_bottom_padding_horizontal'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2318    };
2319  }
2320  buildSingleButton(y12, z12 = null) {
2321    this.observeComponentCreation2((a13, b13) => {
2322      If.create();
2323      if (this.isNewPropertiesHighPriority(y12)) {
2324        this.ifElseBranchUpdateFunction(0, () => {
2325          this.observeComponentCreation2((i13, j13) => {
2326            Button.createWithLabel(this.buttons?.[y12].content);
2327            __Button__setButtonProperties(this.buttons?.[y12], this.buttons, this.getDialogController());
2328            Button.role(this.buttons?.[y12].role ?? ButtonRole.NORMAL);
2329            Button.key(`advanced_dialog_button_${this.keyIndex++}`);
2330            Button.labelStyle({ maxLines: 1, maxFontSize: this.buttonMaxFontSize, minFontSize: this.buttonMinFontSize });
2331          }, Button);
2332          Button.pop();
2333        });
2334      }
2335      else if (this.buttons?.[y12].background !== undefined && this.buttons?.[y12].fontColor !== undefined) {
2336        this.ifElseBranchUpdateFunction(1, () => {
2337          this.observeComponentCreation2((g13, h13) => {
2338            Button.createWithLabel(this.buttons?.[y12].content);
2339            __Button__setButtonProperties(this.buttons?.[y12], this.buttons, this.getDialogController());
2340            Button.backgroundColor(this.buttons?.[y12].background?.color);
2341            Button.fontColor(this.buttons?.[y12].fontColor?.color);
2342            Button.key(`advanced_dialog_button_${this.keyIndex++}`);
2343            Button.labelStyle({ maxLines: 1, maxFontSize: this.buttonMaxFontSize, minFontSize: this.buttonMinFontSize });
2344          }, Button);
2345          Button.pop();
2346        });
2347      }
2348      else if (this.buttons?.[y12].background !== undefined) {
2349        this.ifElseBranchUpdateFunction(2, () => {
2350          this.observeComponentCreation2((e13, f13) => {
2351            Button.createWithLabel(this.buttons?.[y12].content);
2352            __Button__setButtonProperties(this.buttons?.[y12], this.buttons, this.getDialogController());
2353            Button.backgroundColor(this.buttons?.[y12].background?.color);
2354            Button.key(`advanced_dialog_button_${this.keyIndex++}`);
2355            Button.labelStyle({ maxLines: 1, maxFontSize: this.buttonMaxFontSize, minFontSize: this.buttonMinFontSize });
2356          }, Button);
2357          Button.pop();
2358        });
2359      }
2360      else {
2361        this.ifElseBranchUpdateFunction(3, () => {
2362          this.observeComponentCreation2((c13, d13) => {
2363            Button.createWithLabel(this.buttons?.[y12].content);
2364            __Button__setButtonProperties(this.buttons?.[y12], this.buttons, this.getDialogController());
2365            Button.fontColor(this.buttons?.[y12]?.fontColor?.color);
2366            Button.key(`advanced_dialog_button_${this.keyIndex++}`);
2367            Button.labelStyle({ maxLines: 1, maxFontSize: this.buttonMaxFontSize, minFontSize: this.buttonMinFontSize });
2368          }, Button);
2369          Button.pop();
2370        });
2371      }
2372    }, If);
2373    If.pop();
2374  }
2375  buildHorizontalAlignButtons(n12 = null) {
2376    this.observeComponentCreation2((o12, p12) => {
2377      If.create();
2378      if (this.buttons && this.buttons.length > 0) {
2379        this.ifElseBranchUpdateFunction(0, () => {
2380          this.observeComponentCreation2((w12, x12) => {
2381            Row.create();
2382          }, Row);
2383          this.buildSingleButton.bind(this)(0);
2384          this.observeComponentCreation2((q12, r12) => {
2385            If.create();
2386            if (this.buttons.length === HORIZON_BUTTON_MAX_COUNT) {
2387              this.ifElseBranchUpdateFunction(0, () => {
2388                this.observeComponentCreation2((u12, v12) => {
2389                  Row.create();
2390                  Row.width(BUTTON_HORIZONTAL_SPACE * 2);
2391                  Row.justifyContent(FlexAlign.Center);
2392                }, Row);
2393                this.observeComponentCreation2((s12, t12) => {
2394                  Divider.create();
2395                  Divider.width({ "id": -1, "type": 10002, params: ['sys.float.alert_divider_width'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
2396                  Divider.height({ "id": -1, "type": 10002, params: ['sys.float.alert_divider_height'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
2397                  Divider.color(this.getDividerColor());
2398                  Divider.vertical(true);
2399                }, Divider);
2400                Row.pop();
2401                this.buildSingleButton.bind(this)(HORIZON_BUTTON_MAX_COUNT - 1);
2402              });
2403            }
2404            else {
2405              this.ifElseBranchUpdateFunction(1, () => {
2406              });
2407            }
2408          }, If);
2409          If.pop();
2410          Row.pop();
2411        });
2412      }
2413      else {
2414        this.ifElseBranchUpdateFunction(1, () => {
2415        });
2416      }
2417    }, If);
2418    If.pop();
2419  }
2420  buildVerticalAlignButtons(b12 = null) {
2421    this.observeComponentCreation2((c12, d12) => {
2422      If.create();
2423      if (this.buttons) {
2424        this.ifElseBranchUpdateFunction(0, () => {
2425          this.observeComponentCreation2((l12, m12) => {
2426            Column.create();
2427          }, Column);
2428          this.observeComponentCreation2((e12, f12) => {
2429            ForEach.create();
2430            const e = (i12, j12) => {
2431              const k12 = i12;
2432              this.buildButtonWithDivider.bind(this)(this.buttons?.length === HORIZON_BUTTON_MAX_COUNT ?
2433                HORIZON_BUTTON_MAX_COUNT - j12 - 1 : j12);
2434            };
2435            this.forEachUpdateFunction(e12, this.buttons.slice(0, VERTICAL_BUTTON_MAX_COUNT), e, (h12) => h12.content.toString(), true, false);
2436          }, ForEach);
2437          ForEach.pop();
2438          Column.pop();
2439        });
2440      }
2441      else {
2442        this.ifElseBranchUpdateFunction(1, () => {
2443        });
2444      }
2445    }, If);
2446    If.pop();
2447  }
2448  getDividerColor() {
2449    if (!this.buttons || this.buttons.length === 0 || !DIALOG_DIVIDER_SHOW) {
2450      return Color.Transparent;
2451    }
2452    if (this.buttons[0].buttonStyle === ButtonStyleMode.TEXTUAL || this.buttons[0].buttonStyle === undefined) {
2453      if (this.buttons[HORIZON_BUTTON_MAX_COUNT - 1].buttonStyle === ButtonStyleMode.TEXTUAL ||
2454        this.buttons[HORIZON_BUTTON_MAX_COUNT - 1].buttonStyle === undefined) {
2455        return { "id": -1, "type": 10001, params: ['sys.color.alert_divider_color'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
2456      }
2457    }
2458    return Color.Transparent;
2459  }
2460  isNewPropertiesHighPriority(a12) {
2461    if (this.buttons?.[a12].role === ButtonRole.ERROR) {
2462      return true;
2463    }
2464    if (this.buttons?.[a12].buttonStyle !== undefined &&
2465      this.buttons?.[a12].buttonStyle !== ALERT_BUTTON_STYLE) {
2466      return true;
2467    }
2468    if (this.buttons?.[a12].background === undefined && this.buttons?.[a12].fontColor === undefined) {
2469      return true;
2470    }
2471    return false;
2472  }
2473  buildButtonWithDivider(q11, r11 = null) {
2474    this.observeComponentCreation2((s11, t11) => {
2475      If.create();
2476      if (this.buttons && this.buttons[q11]) {
2477        this.ifElseBranchUpdateFunction(0, () => {
2478          this.observeComponentCreation2((y11, z11) => {
2479            Row.create();
2480          }, Row);
2481          this.buildSingleButton.bind(this)(q11);
2482          Row.pop();
2483          this.observeComponentCreation2((u11, v11) => {
2484            If.create();
2485            if ((this.buttons.length === HORIZON_BUTTON_MAX_COUNT ? HORIZON_BUTTON_MAX_COUNT - q11 - 1 : q11) <
2486              Math.min(this.buttons.length, VERTICAL_BUTTON_MAX_COUNT) - 1) {
2487              this.ifElseBranchUpdateFunction(0, () => {
2488                this.observeComponentCreation2((w11, x11) => {
2489                  Row.create();
2490                  Row.height({ "id": -1, "type": 10002, params: ['sys.float.alert_button_vertical_space'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
2491                }, Row);
2492                Row.pop();
2493              });
2494            }
2495            else {
2496              this.ifElseBranchUpdateFunction(1, () => {
2497              });
2498            }
2499          }, If);
2500          If.pop();
2501        });
2502      }
2503      else {
2504        this.ifElseBranchUpdateFunction(1, () => {
2505        });
2506      }
2507    }, If);
2508    If.pop();
2509  }
2510  isVerticalAlignButton(l11) {
2511    if (this.buttons) {
2512      if (this.buttons.length === 1) {
2513        return false;
2514      }
2515      if (this.buttons.length !== HORIZON_BUTTON_MAX_COUNT) {
2516        return true;
2517      }
2518      let m11 = false;
2519      let n11 = vp2px(l11 / HORIZON_BUTTON_MAX_COUNT - BUTTON_HORIZONTAL_MARGIN -
2520        BUTTON_HORIZONTAL_SPACE - 2 * BUTTON_HORIZONTAL_PADDING);
2521      this.buttons.forEach((o11) => {
2522        let p11 = measure.measureTextSize({
2523          textContent: o11.content,
2524          fontSize: this.buttonMaxFontSize
2525        });
2526        if (Number(p11.width) > n11) {
2527          m11 = true;
2528        }
2529      });
2530      return m11;
2531    }
2532    return false;
2533  }
2534  updateStateVars(k11) {
2535    if (k11 === undefined) {
2536      return;
2537    }
2538    if ("primaryTitle" in k11) {
2539      this.updateParam("primaryTitle", k11.primaryTitle);
2540    }
2541    if ("secondaryTitle" in k11) {
2542      this.updateParam("secondaryTitle", k11.secondaryTitle);
2543    }
2544    if ("buttons" in k11) {
2545      this.updateParam("buttons", k11.buttons);
2546    }
2547    if ("contentAreaPadding" in k11) {
2548      this.updateParam("contentAreaPadding", k11.contentAreaPadding);
2549    }
2550    if ("minContentHeight" in k11) {
2551      this.updateParam("minContentHeight", k11.minContentHeight);
2552    }
2553  }
2554  rerender() {
2555    this.updateDirtyElements();
2556  }
2557}
2558__decorate([
2559  Param
2560], CustomDialogContentComponent.prototype, "primaryTitle", void 0);
2561__decorate([
2562  Param
2563], CustomDialogContentComponent.prototype, "secondaryTitle", void 0);
2564__decorate([
2565  Param
2566], CustomDialogContentComponent.prototype, "buttons", void 0);
2567__decorate([
2568  Param
2569], CustomDialogContentComponent.prototype, "contentAreaPadding", void 0);
2570__decorate([
2571  Param
2572], CustomDialogContentComponent.prototype, "minContentHeight", void 0);
2573__decorate([
2574  Event
2575], CustomDialogContentComponent.prototype, "$minContentHeight", void 0);
2576__decorate([
2577  Local
2578], CustomDialogContentComponent.prototype, "titleHeight", void 0);
2579__decorate([
2580  Local
2581], CustomDialogContentComponent.prototype, "buttonHeight", void 0);
2582__decorate([
2583  Local
2584], CustomDialogContentComponent.prototype, "contentMaxHeight", void 0);
2585__decorate([
2586  Consumer()
2587], CustomDialogContentComponent.prototype, "fontSizeScale", void 0);
2588__decorate([
2589  Local
2590], CustomDialogContentComponent.prototype, "customStyle", void 0);
2591__decorate([
2592  Local
2593], CustomDialogContentComponent.prototype, "buttonMaxFontSize", void 0);
2594__decorate([
2595  Local
2596], CustomDialogContentComponent.prototype, "buttonMinFontSize", void 0);
2597__decorate([
2598  Local
2599], CustomDialogContentComponent.prototype, "primaryTitleFontColorWithTheme", void 0);
2600__decorate([
2601  Local
2602], CustomDialogContentComponent.prototype, "secondaryTitleFontColorWithTheme", void 0);
2603__decorate([
2604  Local
2605], CustomDialogContentComponent.prototype, "titleTextAlign", void 0);
2606__decorate([
2607  Local
2608], CustomDialogContentComponent.prototype, "isButtonVertical", void 0);
2609function __Button__setButtonProperties(g11, h11, i11) {
2610  Button.onKeyEvent((j11) => {
2611    if (!j11) {
2612      return;
2613    }
2614    if ((j11.keyCode === KeyCode.KEYCODE_SPACE || j11.keyCode === KeyCode.KEYCODE_ENTER) &&
2615      j11.type === KeyType.Down) {
2616      if (g11?.action) {
2617        g11.action();
2618      }
2619      i11?.close();
2620      j11.stopPropagation();
2621    }
2622  });
2623  Button.onClick(() => {
2624    if (g11?.action) {
2625      g11.action();
2626    }
2627    i11?.close();
2628  });
2629  Button.defaultFocus(g11?.defaultFocus ? true : isHasDefaultFocus(h11) ? false : true);
2630  Button.buttonStyle(g11?.buttonStyle ?? ALERT_BUTTON_STYLE);
2631  Button.layoutWeight(BUTTON_LAYOUT_WEIGHT);
2632  Button.type(ButtonType.ROUNDED_RECTANGLE);
2633  Button.enabled(g11?.enabled ?? true);
2634}
2635function isHasDefaultFocus(a11) {
2636  try {
2637    let e11 = false;
2638    a11?.forEach((f11) => {
2639      if (f11.defaultFocus) {
2640        e11 = true;
2641      }
2642    });
2643    return e11;
2644  }
2645  catch (b11) {
2646    let c11 = b11.code;
2647    let d11 = b11.message;
2648    hilog.error(0x3900, 'Ace', `get defaultFocus exist error, code: ${c11}, message: ${d11}`);
2649    return false;
2650  }
2651}
2652function getNumberByResourceId(t10, u10, v10) {
2653  try {
2654    let z10 = resourceManager.getSystemResourceManager().getNumber(t10);
2655    if (z10 > 0 || v10) {
2656      return z10;
2657    }
2658    else {
2659      return u10;
2660    }
2661  }
2662  catch (w10) {
2663    let x10 = w10.code;
2664    let y10 = w10.message;
2665    hilog.error(0x3900, 'Ace', `CustomContentDialog getNumberByResourceId error, code: ${x10}, message: ${y10}`);
2666    return u10;
2667  }
2668}
2669function getEnumNumberByResourceId(n10, o10) {
2670  try {
2671    let s10 = getContext().resourceManager.getNumber(n10);
2672    if (s10 > 0) {
2673      return s10;
2674    }
2675    else {
2676      return o10;
2677    }
2678  }
2679  catch (p10) {
2680    let q10 = p10.code;
2681    let r10 = p10.message;
2682    hilog.error(0x3900, 'Ace', `getEnumNumberByResourceId error, code: ${q10}, message: ${r10}`);
2683    return o10;
2684  }
2685}
2686function getAccessibilityText(g10, h10) {
2687  try {
2688    let l10 = getContext().resourceManager.getStringSync(125833934);
2689    let m10 = '';
2690    if (typeof g10 === 'string') {
2691      m10 = g10;
2692    }
2693    else {
2694      m10 = getContext().resourceManager.getStringSync(g10);
2695    }
2696    return h10 ? `${l10},${m10}` : m10;
2697  }
2698  catch (i10) {
2699    let j10 = i10.code;
2700    let k10 = i10.message;
2701    hilog.error(0x3900, 'Ace', `getAccessibilityText error, code: ${j10}, message: ${k10}`);
2702    return '';
2703  }
2704}
2705function resolveKeyEvent(e10, f10) {
2706  if (e10.type === IGNORE_KEY_EVENT_TYPE) {
2707    return;
2708  }
2709  if (e10.keyCode === KEYCODE_UP) {
2710    f10.scrollPage({ next: false });
2711    e10.stopPropagation();
2712  }
2713  else if (e10.keyCode === KEYCODE_DOWN) {
2714    if (f10.isAtEnd()) {
2715      return;
2716    }
2717    else {
2718      f10.scrollPage({ next: true });
2719      e10.stopPropagation();
2720    }
2721  }
2722}
2723function getCheckTipsAccessibilityText(v9, w9) {
2724  try {
2725    let a10 = getContext().resourceManager.getStringSync(125833934);
2726    let b10 = getContext().resourceManager.getStringSync(125833935);
2727    let c10 = getContext().resourceManager.getStringSync(125834354);
2728    let d10 = '';
2729    if (typeof v9 === 'string') {
2730      d10 = v9;
2731    }
2732    else {
2733      d10 = getContext().resourceManager.getStringSync(v9);
2734    }
2735    return w9 ? `${a10},${d10},${c10}` :
2736      `${b10},${d10},${c10}`;
2737  }
2738  catch (x9) {
2739    let y9 = x9.code;
2740    let z9 = x9.message;
2741    hilog.error(0x3900, 'Ace', `getCheckTipsAccessibilityText error, code: ${y9}, message: ${z9}`);
2742    return '';
2743  }
2744}
2745export class LoadingDialogV2 extends ViewV2 {
2746  constructor(p9, q9, r9, s9 = -1, t9, u9) {
2747    super(p9, s9, u9);
2748    this.initParam("content", (q9 && "content" in q9) ? q9.content : '');
2749    this.fontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_primary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
2750    this.loadingProgressIconColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.icon_secondary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
2751    this.fontSizeScale = 1;
2752    this.minContentHeight = MIN_CONTENT_HEIGHT;
2753    this.finalizeConstruction();
2754  }
2755  resetStateVarsOnReuse(o9) {
2756    this.resetParam("content", (o9 && "content" in o9) ? o9.content : '');
2757    this.fontColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.font_primary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
2758    this.loadingProgressIconColorWithTheme = { "id": -1, "type": 10001, params: ['sys.color.icon_secondary'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" };
2759    this.fontSizeScale = 1;
2760    this.minContentHeight = MIN_CONTENT_HEIGHT;
2761  }
2762  initialRender() {
2763    this.observeComponentCreation2((m9, n9) => {
2764      Column.create();
2765    }, Column);
2766    this.observeComponentCreation2((k9, l9) => {
2767      __Common__.create();
2768      __Common__.constraintSize({ maxHeight: '100%' });
2769    }, __Common__);
2770    {
2771      this.observeComponentCreation2((e9, f9) => {
2772        if (f9) {
2773          let g9 = new CustomDialogContentComponent(this, {
2774            contentBuilder: () => {
2775              this.contentBuilder();
2776            },
2777            minContentHeight: this.minContentHeight,
2778            $minContentHeight: h => { this.minContentHeight = h; }
2779          }, undefined, e9, () => { }, { page: "library/src/main/ets/components/dialog.ets", line: 1651, col: 7 });
2780          ViewV2.create(g9);
2781          let d = () => {
2782            return {
2783              contentBuilder: () => {
2784                this.contentBuilder();
2785              },
2786              minContentHeight: this.minContentHeight
2787            };
2788          };
2789          g9.paramsGenerator_ = d;
2790        }
2791        else {
2792          this.updateStateVarsOfChildByElmtId(e9, {
2793            minContentHeight: this.minContentHeight
2794          });
2795        }
2796      }, { name: "CustomDialogContentComponent" });
2797    }
2798    __Common__.pop();
2799    Column.pop();
2800  }
2801  contentBuilder(v8 = null) {
2802    this.observeComponentCreation2((c9, d9) => {
2803      Column.create();
2804    }, Column);
2805    this.observeComponentCreation2((a9, b9) => {
2806      Row.create();
2807      Row.constraintSize({ minHeight: LOADING_MIN_HEIGHT });
2808    }, Row);
2809    this.observeComponentCreation2((y8, z8) => {
2810      Text.create(this.content);
2811      Text.fontSize(`${BODY_L}fp`);
2812      Text.fontWeight(FontWeight.Regular);
2813      Text.fontColor(this.fontColorWithTheme);
2814      Text.layoutWeight(LOADING_TEXT_LAYOUT_WEIGHT);
2815      Text.maxLines(this.fontSizeScale > MAX_FONT_SCALE ? LOADING_MAX_LINES_BIG_FONT : LOADING_MAX_LINES);
2816      Text.focusable(true);
2817      Text.defaultFocus(true);
2818      Text.focusBox({
2819        strokeWidth: LengthMetrics.px(0)
2820      });
2821      Text.textOverflow({ overflow: TextOverflow.Ellipsis });
2822    }, Text);
2823    Text.pop();
2824    this.observeComponentCreation2((w8, x8) => {
2825      LoadingProgress.create();
2826      LoadingProgress.color(this.loadingProgressIconColorWithTheme);
2827      LoadingProgress.width(LOADING_PROGRESS_WIDTH);
2828      LoadingProgress.height(LOADING_PROGRESS_HEIGHT);
2829      LoadingProgress.margin({ start: LengthMetrics.vp(LOADING_TEXT_MARGIN_LEFT) });
2830    }, LoadingProgress);
2831    Row.pop();
2832    Column.pop();
2833  }
2834  onWillApplyTheme(u8) {
2835    this.fontColorWithTheme = u8.colors.fontPrimary;
2836    this.loadingProgressIconColorWithTheme = u8.colors.iconSecondary;
2837  }
2838  updateStateVars(t8) {
2839    if (t8 === undefined) {
2840      return;
2841    }
2842    if ("content" in t8) {
2843      this.updateParam("content", t8.content);
2844    }
2845  }
2846  rerender() {
2847    this.updateDirtyElements();
2848  }
2849}
2850__decorate([
2851  Param
2852], LoadingDialogV2.prototype, "content", void 0);
2853__decorate([
2854  Local
2855], LoadingDialogV2.prototype, "fontColorWithTheme", void 0);
2856__decorate([
2857  Local
2858], LoadingDialogV2.prototype, "loadingProgressIconColorWithTheme", void 0);
2859__decorate([
2860  Provider()
2861], LoadingDialogV2.prototype, "fontSizeScale", void 0);
2862__decorate([
2863  Local
2864], LoadingDialogV2.prototype, "minContentHeight", void 0);
2865export class PopoverDialogV2 extends ViewV2 {
2866  constructor(n8, o8, p8, q8 = -1, r8, s8) {
2867    super(n8, q8, s8);
2868    this.initParam("visible", (o8 && "visible" in o8) ? o8.visible : false);
2869    this.$visible = "$visible" in o8 ? o8.$visible : () => { };
2870    this.initParam("popover", (o8 && "popover" in o8) ? o8.popover : {
2871      builder: undefined
2872    });
2873    this.targetBuilder = "targetBuilder" in o8 ? o8.targetBuilder : undefined;
2874    this.dialogWidth = this.popover?.width;
2875    this.finalizeConstruction();
2876  }
2877  resetStateVarsOnReuse(m8) {
2878    this.resetParam("visible", (m8 && "visible" in m8) ? m8.visible : false);
2879    this.$visible = "$visible" in m8 ? m8.$visible : () => { };
2880    this.resetParam("popover", (m8 && "popover" in m8) ? m8.popover : {
2881      builder: undefined
2882    });
2883    this.targetBuilder = "targetBuilder" in m8 ? m8.targetBuilder : undefined;
2884    this.dialogWidth = this.popover?.width;
2885  }
2886  emptyBuilder(l8 = null) {
2887  }
2888  aboutToAppear() {
2889    if (this.targetBuilder === undefined || this.targetBuilder === null) {
2890      this.targetBuilder = this.emptyBuilder;
2891    }
2892  }
2893  initialRender() {
2894    this.observeComponentCreation2((d8, e8) => {
2895      Column.create();
2896      Column.onClick(() => {
2897        try {
2898          let j8 = display.getDefaultDisplaySync();
2899          let k8 = px2vp(j8.width);
2900          if (k8 - BUTTON_HORIZONTAL_MARGIN - BUTTON_HORIZONTAL_MARGIN > MAX_DIALOG_WIDTH) {
2901            this.popover.width = this.popover?.width ?? MAX_DIALOG_WIDTH;
2902          }
2903          else {
2904            this.popover.width = this.dialogWidth;
2905          }
2906          this.$visible?.(!this.visible);
2907        }
2908        catch (g8) {
2909          let h8 = g8.code;
2910          let i8 = g8.message;
2911          hilog.error(0x3900, 'Ace', `dialog popup error, code: ${h8}, message: ${i8}`);
2912        }
2913      });
2914      Column.bindPopup(this.visible, {
2915        builder: this.popover?.builder,
2916        placement: this.popover?.placement ?? Placement.Bottom,
2917        popupColor: this.popover?.popupColor,
2918        enableArrow: this.popover?.enableArrow ?? true,
2919        autoCancel: this.popover?.autoCancel,
2920        onStateChange: this.popover?.onStateChange ?? ((f8) => {
2921          if (!f8.isVisible) {
2922            this.$visible?.(false);
2923          }
2924        }),
2925        arrowOffset: this.popover?.arrowOffset,
2926        showInSubWindow: this.popover?.showInSubWindow,
2927        mask: this.popover?.mask,
2928        targetSpace: this.popover?.targetSpace,
2929        offset: this.popover?.offset,
2930        width: this.popover?.width,
2931        arrowPointPosition: this.popover?.arrowPointPosition,
2932        arrowWidth: this.popover?.arrowWidth,
2933        arrowHeight: this.popover?.arrowHeight,
2934        radius: this.popover?.radius ?? { "id": -1, "type": 10002, params: ['sys.float.corner_radius_level16'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
2935        shadow: this.popover?.shadow ?? ShadowStyle.OUTER_DEFAULT_MD,
2936        backgroundBlurStyle: this.popover?.backgroundBlurStyle ?? BlurStyle.COMPONENT_ULTRA_THICK,
2937        focusable: this.popover?.focusable,
2938        transition: this.popover?.transition,
2939        onWillDismiss: this.popover?.onWillDismiss
2940      });
2941    }, Column);
2942    this.targetBuilder.bind(this)();
2943    Column.pop();
2944  }
2945  updateStateVars(c8) {
2946    if (c8 === undefined) {
2947      return;
2948    }
2949    if ("visible" in c8) {
2950      this.updateParam("visible", c8.visible);
2951    }
2952    if ("popover" in c8) {
2953      this.updateParam("popover", c8.popover);
2954    }
2955  }
2956  rerender() {
2957    this.updateDirtyElements();
2958  }
2959}
2960__decorate([
2961  Param
2962], PopoverDialogV2.prototype, "visible", void 0);
2963__decorate([
2964  Event
2965], PopoverDialogV2.prototype, "$visible", void 0);
2966__decorate([
2967  Param
2968], PopoverDialogV2.prototype, "popover", void 0);
2969__decorate([
2970  Local
2971], PopoverDialogV2.prototype, "dialogWidth", void 0);
2972function toLengthString(a) {
2973  if (!a) {
2974    return undefined;
2975  }
2976  const b = a.value;
2977  let c = '';
2978  switch (a.unit) {
2979    case LengthUnit.PX:
2980      c = `${b}px`;
2981      break;
2982    case LengthUnit.FP:
2983      c = `${b}fp`;
2984      break;
2985    case LengthUnit.LPX:
2986      c = `${b}lpx`;
2987      break;
2988    case LengthUnit.PERCENT:
2989      c = `${b * 100}%`;
2990      break;
2991    case LengthUnit.VP:
2992      c = `${b}vp`;
2993      break;
2994    default:
2995      c = `${b}vp`;
2996      break;
2997  }
2998  return c;
2999}
3000function lengthMetricsToPX(value) {
3001  if (!value) {
3002    return 0;
3003  }
3004  const length = value.value;
3005  switch (value.unit) {
3006    case LengthUnit.PX:
3007      return length;
3008    case LengthUnit.FP:
3009      return fp2px(length);
3010    case LengthUnit.LPX:
3011      return lpx2px(length);
3012    case LengthUnit.VP:
3013      return vp2px(length);
3014    default:
3015      return 0;
3016  }
3017}
3018export default { TipsDialogV2, ConfirmDialogV2, SelectDialogV2, AlertDialogV2, LoadingDialogV2, CustomContentDialogV2, PopoverDialogV2, AdvancedDialogV2Button };