(()=>{function t(t,n,e,c,i){var o=this;function s(t){n.accept(t.id).then(o.onReload).then(function(){e.success(c("Subscription accepted."))})}function a(t){n.discard(t.id).then(o.onReload).then(function(){e.success(c("Subscription discarded."))})}function r(t){return _.get(t,"status.value")===o.NEW_DEVICE_REQUEST_STATUS.WAITING_FOR_CONNECTION.value}function u(t){return _.get(t,"status.value")===o.NEW_DEVICE_REQUEST_STATUS.PENDING_ACCEPTANCE.value}function E(t){return _.get(t,"status.value")===o.NEW_DEVICE_REQUEST_STATUS.ACCEPTED.value}function d(t){return i.getString("{{status | translate}} using code {{code}}",{status:t.status.label,code:S(t)})}function S(t){return t.connectorName||t.id}_.assign(o,{$onInit:function(){_.assign(o,{acceptSubscription:t.onAccept?o.onAccept:s,discardSubscription:t.onDiscard?o.onDiscard:a,NEW_DEVICE_REQUEST_STATUS:n.NEW_DEVICE_REQUEST_STATUS,isWaitingForConnection:r,isPendingAcceptance:u,isAccepted:E,getStatusText:d,getCode:S})}})}t.$inject=["$attrs","c8yDataBrokerSubscriptionsService","c8yAlert","gettext","gettextCatalog"],angular.module("c8y.dataBroker").component("c8yDataBrokerPendingSubscription",{controller:t,controllerAs:"vm",templateUrl:":::PLUGIN_PATH:::/subscriptions/pendingSubscription.html",bindings:{pendingSubscription:"<",onReload:"&",onAccept:"&?",onDiscard:"&?"}})})();