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FG;QADC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC;gEACgB;IAEpC;QADC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC;mEAC2B;IAE/C;QADC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;0EACgC;IAElD;QADC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;2EACiC;IATlC,wBAAwB;QAF5C,OAAO;QACP,gCAAO,CAAC,+CAAwB,EAAE,gCAAgC,CAAC;OAC/C,wBAAwB,CAuF5C;IAAD,+BAAC;KAAA;kBAvFoB,wBAAwB","file":"","sourceRoot":"/","sourcesContent":["import { DummyLayout, DummyPrefab, DummyNode, DummySprite } from \"../../../../../common/CCDummyObjects\";\nimport { SentenceSelectContent, SentenceType } from \"../../../../../avg/model/PlotModel\";\nimport { richNodesToCocosString } from \"../../../../../avg/utils/RichTextUtils\";\nimport { DeepReadonly } from \"simba-utils\";\nimport { RegView } from \"../../../PresenterCCViewFactory\";\nimport { SentenceSelectorViewType, SentenceSelectorViewProps, SentenceSelectorView } from \"../../type/SentenceSelectorView\";\nimport { CCPureView, CCView } from \"../../../../../common/classbase/CCViewBase\";\nimport { ResUtils } from \"../../../../../common/utils/ResUtils\";\n\nconst { ccclass, property } = cc._decorator;\n\n@ccclass\n@RegView(SentenceSelectorViewType, \"prefab/ui/SentenceSelectorView\")\nexport default class SentenceSelectorViewImpl extends CCPureView<SentenceSelectorViewProps> implements SentenceSelectorView {\n //#region \n @property(cc.Sprite)\n background: cc.Sprite = DummySprite;\n @property(cc.Layout)\n private contentLayout: cc.Layout = DummyLayout;\n @property(cc.Node)\n private selectButtonTemplate: cc.Node = DummyNode;\n @property(cc.Node)\n private selectButtonTemplate1: cc.Node = DummyNode;\n //#endregion\n\n onButtonClick = (index: number) => {\n return () => {\n this._props.onSelectIndexCallback(index);\n }\n }\n\n setContent = (content: DeepReadonly<SentenceSelectContent>) => {\n this.contentLayout.node.removeAllChildren();\n for (let i = 0; i < content.value.length; i++) {\n let option = content.value[i];\n let node = cc.instantiate(this._props.optionStyle1 ? this.selectButtonTemplate1 : this.selectButtonTemplate);\n node.parent = this.contentLayout.node;\n node.active = true;\n let label = node.getChildByName(\"Label\").getComponent(cc.RichText);\n if (option.content && option.content.type === SentenceType.TEXT && !option.summary) {\n label.string = richNodesToCocosString(option.content.value);\n } else {\n label.string = option.summary;\n }\n node.on(\"click\", this.onButtonClick(i));\n }\n }\n\n open(parent: CCView) {\n super.open(parent);\n this.background.node.opacity = 0;\n }\n\n onPropsReceive() {\n super.onPropsReceive();\n this.background.node.opacity = 255;\n }\n\n onLoad() {\n this.bindProp(\"sentence\", async (value) => {\n if (value != null)\n this.setContent(value);\n });\n\n\n this.bindProp(\"backgroundpath\", async (value) => {\n if (value != \"\") {\n this.background.spriteFrame = await ResUtils.loadRes<cc.SpriteFrame>(value, cc.SpriteFrame);\n } else {\n this.background.spriteFrame = undefined as any;\n }\n });\n\n this.bindProp(\"y\", (v) => {\n if (v === undefined) {\n this.background.getComponent(cc.Widget).enabled = true;\n this.background.node.y = -this.node.height / 2;\n } else {\n this.background.getComponent(cc.Widget).enabled = false;\n this.background.node.y = v;\n }\n });\n }\n\n onPropsLoad(props: Readonly<SentenceSelectorViewProps>) {\n super.onPropsLoad(props);\n if (this._props.clickcausehide) {\n this.node.on(cc.Node.EventType.TOUCH_END, this.onCloseHandleClick, this);\n } else {\n this.node.off(cc.Node.EventType.TOUCH_END);\n }\n }\n\n onCloseHandleClick(event) {\n this.close();\n }\n\n onPropChange(key: Extract<keyof SentenceSelectorViewProps, string>) {\n super.onPropChange(key);\n }\n}"]}