{"version":3,"file":"rockPage.js","sources":["../../../Framework/Templates/rockBlock.partial.ts","../../../Framework/Templates/rockPage.ts"],"sourcesContent":["// \r\n// Copyright by the Spark Development Network\r\n//\r\n// Licensed under the Rock Community License (the \"License\");\r\n// you may not use this file except in compliance with the License.\r\n// You may obtain a copy of the License at\r\n//\r\n// http://www.rockrms.com/license\r\n//\r\n// Unless required by applicable law or agreed to in writing, software\r\n// distributed under the License is distributed on an \"AS IS\" BASIS,\r\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n// See the License for the specific language governing permissions and\r\n// limitations under the License.\r\n// \r\n//\r\n\r\nimport { Guid } from \"@Obsidian/Types\";\r\nimport { doApiCall, provideHttp } from \"@Obsidian/Utility/http\";\r\nimport { Component, computed, defineComponent, nextTick, onErrorCaptured, onMounted, PropType, provide, ref, watch } from \"vue\";\r\nimport { useStore } from \"@Obsidian/PageState\";\r\nimport { RockDateTime } from \"@Obsidian/Utility/rockDateTime\";\r\nimport { HttpBodyData, HttpMethod, HttpResult, HttpUrlParams } from \"@Obsidian/Types/Utility/http\";\r\nimport { InvokeBlockActionFunc } from \"@Obsidian/Types/Utility/block\";\r\nimport { provideBlockGuid, provideConfigurationValuesChanged, provideReloadBlock } from \"@Obsidian/Utility/block\";\r\nimport { areEqual, emptyGuid } from \"@Obsidian/Utility/guid\";\r\nimport { PanelAction } from \"@Obsidian/Types/Controls/panelAction\";\r\nimport { ObsidianBlockConfigBag } from \"@Obsidian/ViewModels/Cms/obsidianBlockConfigBag\";\r\n\r\nconst store = useStore();\r\n\r\n// Can be removed once WebForms is no longer in use.\r\n// eslint-disable-next-line @typescript-eslint/naming-convention,@typescript-eslint/no-explicit-any\r\ndeclare const Sys: any;\r\n\r\n/**\r\n * Handles the logic to detect when the standard block settings modal has closed\r\n * via a Save click for the specified block.\r\n * \r\n * @param blockId The unique identifier of the block to be watched.\r\n * @param callback The callback to be invoked when the block settings have been saved.\r\n */\r\nfunction addBlockChangedEventListener(blockId: Guid, callback: (() => void)): void {\r\n function onTriggerClick(): void {\r\n const dataElement = document.querySelector(\"#rock-config-trigger-data\") as HTMLInputElement;\r\n if (dataElement.value.toLowerCase().startsWith(\"block_updated:\")) {\r\n const dataSegments = dataElement.value.toLowerCase().split(\":\");\r\n\r\n if (dataSegments.length >= 3 && areEqual(dataSegments[2], blockId)) {\r\n callback();\r\n }\r\n }\r\n }\r\n\r\n document.querySelector(\"#rock-config-trigger\")?.addEventListener(\"click\", onTriggerClick, true);\r\n\r\n // This code can be removed once WebForms is no longer in use.\r\n if (Sys) {\r\n Sys.Application.add_load(() => {\r\n document.querySelector(\"#rock-config-trigger\")?.addEventListener(\"click\", onTriggerClick, true);\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Update the custom actions in the configuration bar to match those provided.\r\n * \r\n * @param blockContainerElement The element that contains the block component.\r\n * @param actions The array of actions to put in the configuration bar.\r\n */\r\nfunction updateConfigurationBarActions(blockContainerElement: HTMLElement, actions: PanelAction[]): void {\r\n // Find the configuration bar. We don't want to use querySelector at the\r\n // blockContent level because that would include the block content which\r\n // might have matching class names and cause issues.\r\n const blockContent = blockContainerElement.closest(\".block-content\");\r\n const blockConfiguration = Array.from(blockContent?.children ?? [])\r\n .find(el => el.classList.contains(\"block-configuration\"));\r\n const configurationBar = blockConfiguration?.querySelector(\".block-configuration-bar\") as HTMLElement | undefined;\r\n\r\n if (!configurationBar) {\r\n return;\r\n }\r\n\r\n // Find the name element, which is what we will use as our insertion point.\r\n const nameElement = Array.from(configurationBar.children).find(el => el.tagName == \"SPAN\");\r\n if (!nameElement) {\r\n return;\r\n }\r\n\r\n // Find and remove any existing custom actions.\r\n Array.from(configurationBar.querySelectorAll(\"a\"))\r\n .filter(el => el.dataset[\"customAction\"] === \"true\")\r\n .forEach(el => el.remove());\r\n\r\n // Add new custom actions.\r\n actions.forEach(action => {\r\n const hyperlinkElement = document.createElement(\"a\");\r\n hyperlinkElement.href = \"#\";\r\n hyperlinkElement.title = action.title ?? \"\";\r\n hyperlinkElement.dataset[\"customAction\"] = \"true\";\r\n hyperlinkElement.addEventListener(\"click\", e => {\r\n e.preventDefault();\r\n if (action.handler) {\r\n action.handler(e);\r\n }\r\n });\r\n\r\n const iconElement = document.createElement(\"i\");\r\n iconElement.className = action.iconCssClass ?? \"fa fa-question\";\r\n\r\n hyperlinkElement.appendChild(iconElement);\r\n\r\n nameElement.after(hyperlinkElement);\r\n });\r\n}\r\n\r\nexport default defineComponent({\r\n name: \"RockBlock\",\r\n\r\n props: {\r\n config: {\r\n type: Object as PropType,\r\n required: true\r\n },\r\n blockComponent: {\r\n type: Object as PropType,\r\n default: null\r\n },\r\n startTimeMs: {\r\n type: Number as PropType,\r\n required: true\r\n }\r\n },\r\n\r\n setup(props) {\r\n const error = ref(\"\");\r\n const finishTimeMs = ref(null);\r\n const blockContainerElement = ref(null);\r\n const configurationValues = ref(props.config.configurationValues);\r\n const configCustomActions = ref(props.config.customConfigurationActions);\r\n const customActionComponent = ref(null);\r\n const currentBlockComponent = ref(props.blockComponent);\r\n\r\n // #region Computed Values\r\n\r\n // The current config bar actions that should be included in the block's\r\n // administrative configuration bar.\r\n const configBarActions = computed((): PanelAction[] => {\r\n const customActions: PanelAction[] = [];\r\n\r\n if (configCustomActions.value) {\r\n for (const cca of configCustomActions.value) {\r\n if (cca.iconCssClass && cca.tooltip && cca.componentFileUrl) {\r\n customActions.push({\r\n type: \"default\",\r\n title: cca.tooltip,\r\n iconCssClass: cca.iconCssClass,\r\n handler: async () => {\r\n try {\r\n const module = await import(cca.componentFileUrl ?? \"\");\r\n customActionComponent.value = module?.default ?? module ?? null;\r\n }\r\n catch (e) {\r\n // Log the error, but continue setting up the app so the UI will show the user an error\r\n console.error(e);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n return customActions;\r\n });\r\n\r\n // #endregion\r\n\r\n // #region Functions\r\n\r\n const httpCall = async (method: HttpMethod, url: string, params: HttpUrlParams = undefined, data: HttpBodyData = undefined): Promise> => {\r\n return await doApiCall(method, url, params, data);\r\n };\r\n\r\n const get = async (url: string, params: HttpUrlParams = undefined): Promise> => {\r\n return await httpCall(\"GET\", url, params);\r\n };\r\n\r\n const post = async (url: string, params: HttpUrlParams = undefined, data: HttpBodyData = undefined): Promise> => {\r\n return await httpCall(\"POST\", url, params, data);\r\n };\r\n\r\n const invokeBlockAction: InvokeBlockActionFunc = async (actionName: string, data: HttpBodyData = undefined) => {\r\n return await post(`/api/v2/BlockActions/${store.state.pageGuid}/${props.config.blockGuid}/${actionName}`, undefined, {\r\n __context: {\r\n pageParameters: store.state.pageParameters\r\n },\r\n ...data\r\n });\r\n };\r\n\r\n /**\r\n * Reload the block by requesting the new initialization data and then\r\n * remove the block component and re-add it.\r\n */\r\n const reloadBlock = async (): Promise => {\r\n const result = await invokeBlockAction(\"RefreshObsidianBlockInitialization\");\r\n\r\n if (result.isSuccess && result.data) {\r\n currentBlockComponent.value = null;\r\n\r\n // Waiting for the next tick forces Vue to remove the component\r\n // so that we can re-add it causing a full initialization again.\r\n nextTick(() => {\r\n configurationValuesChanged.reset();\r\n configurationValues.value = result.data?.configurationValues;\r\n configCustomActions.value = result.data?.customConfigurationActions;\r\n currentBlockComponent.value = props.blockComponent;\r\n });\r\n }\r\n else {\r\n console.error(\"Failed to reload block:\", result.errorMessage || \"Unknown error\");\r\n }\r\n };\r\n\r\n // #endregion\r\n\r\n // #region Event Handlers\r\n\r\n /**\r\n * Event handler for when a close event is emitted by a custom action\r\n * component.\r\n */\r\n const onCustomActionClose = (): void => {\r\n customActionComponent.value = null;\r\n };\r\n\r\n // #endregion\r\n\r\n // Watch for changes in our config bar actions and make sure the UI\r\n // is also updated to match.\r\n watch(configBarActions, () => {\r\n if (blockContainerElement.value) {\r\n updateConfigurationBarActions(blockContainerElement.value, configBarActions.value);\r\n }\r\n });\r\n\r\n // Called when an error in a child component has been captured.\r\n onErrorCaptured(err => {\r\n const defaultMessage = \"An unknown error was caught from the block.\";\r\n\r\n if (err instanceof Error) {\r\n error.value = err.message || defaultMessage;\r\n }\r\n else if (err) {\r\n error.value = JSON.stringify(err) || defaultMessage;\r\n }\r\n else {\r\n error.value = defaultMessage;\r\n }\r\n });\r\n\r\n // Called when the component has mounted and is presented on the UI.\r\n onMounted(() => {\r\n finishTimeMs.value = RockDateTime.now().toMilliseconds();\r\n const componentName = props.blockComponent?.name || \"\";\r\n const nameParts = componentName.split(\".\");\r\n let subtitle = nameParts[0] || \"\";\r\n\r\n if (subtitle && subtitle.indexOf(\"(\") !== 0) {\r\n subtitle = `(${subtitle})`;\r\n }\r\n\r\n if (nameParts.length) {\r\n store.addPageDebugTiming({\r\n title: nameParts[1] || \"\",\r\n subtitle: subtitle,\r\n startTimeMs: props.startTimeMs,\r\n finishTimeMs: finishTimeMs.value\r\n });\r\n }\r\n\r\n\r\n // If we have any custom configuration actions then populate the\r\n // custom buttons in the configuration bar.\r\n if (blockContainerElement.value) {\r\n updateConfigurationBarActions(blockContainerElement.value, configBarActions.value);\r\n }\r\n });\r\n\r\n provideHttp({\r\n doApiCall,\r\n get,\r\n post\r\n });\r\n\r\n provide(\"invokeBlockAction\", invokeBlockAction);\r\n provide(\"configurationValues\", configurationValues);\r\n provideReloadBlock(reloadBlock);\r\n const configurationValuesChanged = provideConfigurationValuesChanged();\r\n\r\n if (props.config.blockGuid) {\r\n provideBlockGuid(props.config.blockGuid);\r\n }\r\n\r\n // If we have a block guid, then add an event listener for configuration\r\n // changes to the block.\r\n if (props.config.blockGuid) {\r\n addBlockChangedEventListener(props.config.blockGuid, () => {\r\n configurationValuesChanged.invoke();\r\n });\r\n }\r\n\r\n return {\r\n blockContainerElement,\r\n blockFileUrl: props.config.blockFileUrl,\r\n blockGuid: props.config.blockGuid ?? emptyGuid,\r\n currentBlockComponent,\r\n customActionComponent,\r\n onCustomActionClose,\r\n error\r\n };\r\n },\r\n\r\n // Note: We are using a custom alert so there is no dependency on the\r\n // Controls package.\r\n template: `\r\n
\r\n
\r\n Not Found\r\n Could not find block component: \"{{blockFileUrl}}\"\r\n
\r\n\r\n
\r\n Uncaught Error\r\n {{error}}\r\n
\r\n\r\n \r\n\r\n
\r\n \r\n
\r\n
`\r\n});\r\n","// \r\n// Copyright by the Spark Development Network\r\n//\r\n// Licensed under the Rock Community License (the \"License\");\r\n// you may not use this file except in compliance with the License.\r\n// You may obtain a copy of the License at\r\n//\r\n// http://www.rockrms.com/license\r\n//\r\n// Unless required by applicable law or agreed to in writing, software\r\n// distributed under the License is distributed on an \"AS IS\" BASIS,\r\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n// See the License for the specific language governing permissions and\r\n// limitations under the License.\r\n// \r\n//\r\nimport { App, Component, createApp, defineComponent, h, markRaw, onMounted, VNode } from \"vue\";\r\nimport RockBlock from \"./rockBlock.partial\";\r\nimport { useStore } from \"@Obsidian/PageState\";\r\nimport \"@Obsidian/ValidationRules\";\r\nimport \"@Obsidian/FieldTypes/index\";\r\nimport { DebugTiming } from \"@Obsidian/ViewModels/Utility/debugTiming\";\r\nimport { ObsidianBlockConfigBag } from \"@Obsidian/ViewModels/Cms/obsidianBlockConfigBag\";\r\nimport { PageConfig } from \"@Obsidian/Utility/page\";\r\nimport { RockDateTime } from \"@Obsidian/Utility/rockDateTime\";\r\nimport { BasicSuspenseProvider, provideSuspense } from \"@Obsidian/Utility/suspense\";\r\n\r\ntype DebugTimingConfig = {\r\n elementId: string;\r\n debugTimingViewModels: DebugTiming[];\r\n};\r\n\r\nconst store = useStore();\r\n\r\n/**\r\n * This is a special use component that allows developers to include style\r\n * tags inside a string-literal component (i.e. not an SFC). It should only\r\n * be used temporarily until the styling team can move the styles into the\r\n * LESS and CSS files.\r\n */\r\nconst developerStyle = defineComponent({\r\n render(): VNode {\r\n return h(\"style\", {}, this.$slots.default ? this.$slots.default() : undefined);\r\n }\r\n});\r\n\r\n\r\n/**\r\n* This should be called once per block on the page. The config contains configuration provided by the block's server side logic\r\n* counterpart. This adds the block to the page and allows it to begin initializing.\r\n* @param config\r\n* @param blockComponent\r\n*/\r\nexport async function initializeBlock(config: ObsidianBlockConfigBag): Promise {\r\n const blockPath = `${config.blockFileUrl}.js`;\r\n let blockComponent: Component | null = null;\r\n let errorMessage = \"\";\r\n\r\n if (!config || !config.blockFileUrl || !config.blockGuid || !config.rootElementId) {\r\n console.error(\"Invalid block configuration:\", config);\r\n throw \"Could not initialize Obsidian block because the configuration is invalid.\";\r\n }\r\n\r\n const rootElement = document.getElementById(config.rootElementId);\r\n\r\n if (!rootElement) {\r\n throw \"Could not initialize Obsidian block because the root element was not found.\";\r\n }\r\n\r\n try {\r\n const blockComponentModule = await import(blockPath);\r\n blockComponent = blockComponentModule ?\r\n (blockComponentModule.default || blockComponentModule) :\r\n null;\r\n }\r\n catch (e) {\r\n // Log the error, but continue setting up the app so the UI will show the user an error\r\n console.error(e);\r\n errorMessage = `${e}`;\r\n }\r\n\r\n const name = `Root${config.blockFileUrl.replace(/\\//g, \".\")}`;\r\n const startTimeMs = RockDateTime.now().toMilliseconds();\r\n\r\n const app = createApp({\r\n name,\r\n components: {\r\n RockBlock\r\n },\r\n setup() {\r\n let isLoaded = false;\r\n\r\n // Create a suspense provider so we can monitor any asynchronous load\r\n // operations that should delay the display of the page.\r\n const suspense = new BasicSuspenseProvider(undefined);\r\n provideSuspense(suspense);\r\n\r\n /** Called to note on the body element that this block is loading. */\r\n const startLoading = (): void => {\r\n let pendingCount = parseInt(document.body.getAttribute(\"data-obsidian-pending-blocks\") ?? \"0\");\r\n pendingCount++;\r\n document.body.setAttribute(\"data-obsidian-pending-blocks\", pendingCount.toString());\r\n };\r\n\r\n /** Called to note when this block has finished loading. */\r\n const finishedLoading = (): void => {\r\n if (isLoaded) {\r\n return;\r\n }\r\n\r\n isLoaded = true;\r\n\r\n // Get the number of pending blocks. If this is the last one\r\n // then signal the page that all blocks are loaded and ready.\r\n let pendingCount = parseInt(document.body.getAttribute(\"data-obsidian-pending-blocks\") ?? \"0\");\r\n if (pendingCount > 0) {\r\n pendingCount--;\r\n document.body.setAttribute(\"data-obsidian-pending-blocks\", pendingCount.toString());\r\n if (pendingCount === 0) {\r\n document.body.classList.remove(\"obsidian-loading\");\r\n }\r\n }\r\n };\r\n\r\n // Start loading and wait for up to 5 seconds for the block to finish.\r\n startLoading();\r\n setTimeout(finishedLoading, 5000);\r\n\r\n // Called when all our child components have initialized.\r\n onMounted(() => {\r\n if (!suspense.hasPendingOperations()) {\r\n finishedLoading();\r\n }\r\n else {\r\n suspense.addFinishedHandler(() => {\r\n finishedLoading();\r\n });\r\n }\r\n });\r\n\r\n return {\r\n config: config,\r\n blockComponent: blockComponent ? markRaw(blockComponent) : null,\r\n startTimeMs,\r\n errorMessage\r\n };\r\n },\r\n\r\n // Note: We are using a custom alert so there is not a dependency on\r\n // the Controls package.\r\n template: `\r\n
\r\n Error Initializing Block\r\n
\r\n {{errorMessage}}\r\n
\r\n`\r\n });\r\n\r\n app.component(\"v-style\", developerStyle);\r\n app.mount(rootElement);\r\n\r\n return app;\r\n}\r\n\r\n/**\r\n* This should be called once per page with data from the server that pertains to the entire page. This includes things like\r\n* page parameters and context entities.\r\n* @param {object} pageData\r\n*/\r\nexport async function initializePage(pageConfig: PageConfig): Promise {\r\n await store.initialize(pageConfig);\r\n}\r\n\r\n/**\r\n * Shows the Obsidian debug timings\r\n * @param debugTimingConfig\r\n */\r\nexport async function initializePageTimings(config: DebugTimingConfig): Promise {\r\n const rootElement = document.getElementById(config.elementId);\r\n\r\n if (!rootElement) {\r\n console.error(\"Could not show Obsidian debug timings because the HTML element did not resolve.\");\r\n return;\r\n }\r\n\r\n const pageDebugTimings = (await import(\"@Obsidian/Controls/pageDebugTimings\")).default;\r\n\r\n const app = createApp({\r\n name: \"PageDebugTimingsRoot\",\r\n components: {\r\n PageDebugTimings: pageDebugTimings\r\n },\r\n data() {\r\n return {\r\n viewModels: config.debugTimingViewModels\r\n };\r\n },\r\n template: ``\r\n });\r\n app.mount(rootElement);\r\n}\r\n"],"names":["store","useStore","addBlockChangedEventListener","blockId","callback","_document$querySelect","onTriggerClick","dataElement","document","querySelector","value","toLowerCase","startsWith","dataSegments","split","length","areEqual","addEventListener","Sys","Application","add_load","_document$querySelect2","updateConfigurationBarActions","blockContainerElement","actions","_blockContent$childre","blockContent","closest","blockConfiguration","Array","from","children","find","el","classList","contains","configurationBar","nameElement","tagName","querySelectorAll","filter","dataset","forEach","remove","action","_action$title","_action$iconCssClass","hyperlinkElement","createElement","href","title","e","preventDefault","handler","iconElement","className","iconCssClass","appendChild","after","defineComponent","name","props","config","type","Object","required","blockComponent","default","startTimeMs","Number","setup","_props$config$blockGu","error","ref","finishTimeMs","configurationValues","configCustomActions","customConfigurationActions","customActionComponent","currentBlockComponent","configBarActions","computed","customActions","_iterator","_createForOfIteratorHelper","_step","_loop","cca","tooltip","componentFileUrl","push","_handler","_asyncToGenerator","_cca$componentFileUrl","_ref","_module$default","module","console","apply","arguments","s","n","done","err","f","httpCall","_ref2","method","url","params","undefined","data","doApiCall","_x","_x2","get","_ref3","_x3","post","_ref4","_x4","invokeBlockAction","_ref5","actionName","concat","state","pageGuid","blockGuid","_objectSpread","__context","pageParameters","_x5","reloadBlock","_ref6","result","isSuccess","nextTick","_result$data","_result$data2","configurationValuesChanged","reset","errorMessage","onCustomActionClose","watch","onErrorCaptured","defaultMessage","Error","message","JSON","stringify","onMounted","_props$blockComponent","RockDateTime","now","toMilliseconds","componentName","nameParts","subtitle","indexOf","addPageDebugTiming","provideHttp","provide","provideReloadBlock","provideConfigurationValuesChanged","provideBlockGuid","invoke","blockFileUrl","emptyGuid","template","developerStyle","render","h","$slots","initializeBlock","_initializeBlock","blockPath","rootElementId","rootElement","getElementById","blockComponentModule","replace","app","createApp","components","RockBlock","isLoaded","suspense","BasicSuspenseProvider","provideSuspense","startLoading","_document$body$getAtt","pendingCount","parseInt","body","getAttribute","setAttribute","toString","finishedLoading","_document$body$getAtt2","setTimeout","hasPendingOperations","addFinishedHandler","markRaw","component","mount","initializePage","_initializePage","pageConfig","initialize","initializePageTimings","_initializePageTimings","elementId","pageDebugTimings","PageDebugTimings","viewModels","debugTimingViewModels"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6BA,IAAMA,OAAK,GAAGC,QAAQ,EAAE,CAAA;MAaxB,SAASC,4BAA4BA,CAACC,OAAa,EAAEC,QAAsB,EAAQ;MAAA,EAAA,IAAAC,qBAAA,CAAA;QAC/E,SAASC,cAAcA,GAAS;MAC5B,IAAA,IAAMC,WAAW,GAAGC,QAAQ,CAACC,aAAa,CAAC,2BAA2B,CAAqB,CAAA;UAC3F,IAAIF,WAAW,CAACG,KAAK,CAACC,WAAW,EAAE,CAACC,UAAU,CAAC,gBAAgB,CAAC,EAAE;MAC9D,MAAA,IAAMC,YAAY,GAAGN,WAAW,CAACG,KAAK,CAACC,WAAW,EAAE,CAACG,KAAK,CAAC,GAAG,CAAC,CAAA;MAE/D,MAAA,IAAID,YAAY,CAACE,MAAM,IAAI,CAAC,IAAIC,QAAQ,CAACH,YAAY,CAAC,CAAC,CAAC,EAAEV,OAAO,CAAC,EAAE;MAChEC,QAAAA,QAAQ,EAAE,CAAA;MACd,OAAA;MACJ,KAAA;MACJ,GAAA;QAEA,CAAAC,qBAAA,GAAAG,QAAQ,CAACC,aAAa,CAAC,sBAAsB,CAAC,MAAAJ,IAAAA,IAAAA,qBAAA,uBAA9CA,qBAAA,CAAgDY,gBAAgB,CAAC,OAAO,EAAEX,cAAc,EAAE,IAAI,CAAC,CAAA;MAG/F,EAAA,IAAIY,GAAG,EAAE;MACLA,IAAAA,GAAG,CAACC,WAAW,CAACC,QAAQ,CAAC,MAAM;MAAA,MAAA,IAAAC,sBAAA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