<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/*
 *   Copyright (c) 2022 Esri
 *   All rights reserved.

 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at

 *   http://www.apache.org/licenses/LICENSE-2.0

 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
var __decorate = (this &amp;&amp; this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c &lt; 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" &amp;&amp; typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i &gt;= 0; i--) if (d = decorators[i]) r = (c &lt; 3 ? d(r) : c &gt; 3 ? d(target, key, r) : d(target, key)) || r;
    return c &gt; 3 &amp;&amp; r &amp;&amp; Object.defineProperty(target, key, r), r;
};
var __importDefault = (this &amp;&amp; this.__importDefault) || function (mod) {
    return (mod &amp;&amp; mod.__esModule) ? mod : { "default": mod };
};
define(["require", "exports", "esri/core/accessorSupport/decorators", "esri/widgets/support/widget", "esri/widgets/Widget", "ArcGISHTMLSanitizer", "TemplatesCommonLib/functionality/securityUtils", "TemplatesCommonLib/functionality/token"], function (require, exports, decorators_1, widget_1, Widget_1, ArcGISHTMLSanitizer_1, securityUtils_1, token_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    Widget_1 = __importDefault(Widget_1);
    ArcGISHTMLSanitizer_1 = __importDefault(ArcGISHTMLSanitizer_1);
    const CSS = {
        base: "sidebar-splash-panel",
        content: "sidebar-splash-panel__content"
    };
    let Splash = class Splash extends Widget_1.default {
        constructor(props) {
            super(props);
            this.defaultDescription = null;
            this.defaultTitle = null;
            this.i18n = null;
            this.rootNode = null;
            this._sanitizer = (0, securityUtils_1.createSanitizerInstance)(ArcGISHTMLSanitizer_1.default);
        }
        initialize() {
            const webmap = this.view.map;
            if (webmap.portalItem) {
                this.defaultDescription = webmap.portalItem.description || webmap.portalItem.snippet;
                this.defaultTitle = webmap.portalItem.title;
            }
        }
        render() {
            const { splashTitle, splashContent, splashButtonText, appid, theme } = this.config;
            const content = splashContent ? this._getContent(splashContent) : this.defaultDescription;
            const title = splashTitle ? splashTitle : this.defaultTitle;
            const primaryButtonText = splashButtonText ? splashButtonText : this?.i18n?.enter;
            return ((0, widget_1.tsx)("instant-apps-splash", { titleText: title, class: this.classes(CSS.base, `calcite-mode-${theme}`), localStorageKey: `sidebar-splash-${appid}`, key: "sidebar-splash", content: this._sanitizer.sanitize(content), primaryButtonText: primaryButtonText }));
        }
        _getContent(content) {
            const token = this?.config?.base?.portal?.credential?.token;
            const tokenizedContent = token ? (0, token_1.applyImgTokens)(content, token) : content;
            return this._sanitizer.sanitize(tokenizedContent);
        }
    };
    __decorate([
        (0, decorators_1.property)()
    ], Splash.prototype, "config", void 0);
    __decorate([
        (0, decorators_1.property)()
    ], Splash.prototype, "view", void 0);
    __decorate([
        (0, decorators_1.property)()
    ], Splash.prototype, "defaultDescription", void 0);
    __decorate([
        (0, decorators_1.property)()
    ], Splash.prototype, "defaultTitle", void 0);
    __decorate([
        (0, decorators_1.property)(),
        (0, widget_1.messageBundle)("instant/../t9n/common")
    ], Splash.prototype, "i18n", void 0);
    Splash = __decorate([
        (0, decorators_1.subclass)("InfoPanel")
    ], Splash);
    exports.default = Splash;
});
</pre></body></html>