// Copyright (c) 2009-2026 SAP SE, All Rights Reserved

/**
 * @fileOverview The EndUserFeedback service.
 * @deprecated since 1.93. Deprecated without successor.
 */
sap.ui.define([
    "sap/ui/thirdparty/URI",
    "sap/ushell/utils/DeprecationLog"
], (
    URI,
    DeprecationLog
) => {
    "use strict";

    /**
     * @alias sap.ushell.services.EndUserFeedback
     * @class
     * @classdesc The Unified Shell's end user feedback service. This service is deprecated and does nothing.
     * End user feedback functionality is not part of the ushell library.
     *
     * <b>Note:</b> To retrieve a valid instance of this service, it is necessary to call {@link sap.ushell.Container#getServiceAsync}.
     * <pre>
     *   sap.ui.require(["sap/ushell/Container"], async function (Container) {
     *     const EndUserFeedback = await Container.getServiceAsync("EndUserFeedback");
     *     // do something with the EndUserFeedback service
     *   });
     * </pre>
     *
     * @augments sap.ushell.services.Service
     * @hideconstructor
     *
     * @see sap.ushell.Container#getServiceAsync
     * @since 1.25.1
     * @public
     * @deprecated since 1.93. Deprecated without successor.
     */
    function EndUserFeedback () {
        DeprecationLog.logModuleDeprecation({
            module: "sap.ushell.services.EndUserFeedback",
            since: "1.93",
            reason: "Deprecated without successor."
        });

        /**
         * Sends a feedback.
         * @returns {Promise} Empty promise
         *
         * @since 1.25.1
         * @public
         * @deprecated since 1.93. Deprecated without successor.
         */
        this.sendFeedback = function () {
            DeprecationLog.logApiDeprecation({
                api: "sap.ushell.services.EndUserFeedback#sendFeedback",
                since: "1.93",
                reason: "Deprecated without successor."
            });
            return Promise.resolve();
        };

        /**
         * @returns {string} Empty string
         *
         * @since 1.25.1
         * @public
         * @deprecated since 1.93. Deprecated without successor.
         */
        this.getLegalText = function () {
            DeprecationLog.logApiDeprecation({
                api: "sap.ushell.services.EndUserFeedback#getLegalText",
                since: "1.93",
                reason: "Deprecated without successor."
            });
            return "";
        };

        /**
         * The service is deprecated. The function always returns a negative answer.
         *
         * @returns {Promise} Rejected promise.
         *
         * @since 1.25.1
         * @public
         * @deprecated since 1.93. Deprecated without successor.
         */
        this.isEnabled = async function () {
            DeprecationLog.logApiDeprecation({
                api: "sap.ushell.services.EndUserFeedback#isEnabled",
                since: "1.93",
                reason: "Deprecated without successor."
            });
            throw new Error("EndUserFeedback service is deprecated and therefore always disabled.");
        };

        /**
         * @param {string} sURL sURL
         * @returns {string} Path of the given URL (based on URI-API)
         * @private
         * @since 1.30.0
         * @deprecated since 1.93. Deprecated without successor.
         */
        this.getPathOfURL = function (sURL) {
            const oURI = new URI(sURL);
            return oURI.pathname();
        };
    }

    EndUserFeedback.hasNoAdapter = true;
    return EndUserFeedback;
}, true /* bExport */);
