/*
 * Copyright (c) 2018, 2026, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 */
const RULENAME="oj-html-wctag-supersedes";const DESCRIPTION="A notification that the component has 'supersedes' status. This indicates "+"that the component is the current focus of new related work, and will supersede one or "+"more (currently) fully supported components that will be deprecated in a future release.";const SHORT_DESCRIPTION="The component is in 'supersedes' status and will replace one or more components that will be deprecated in a future release.";const MSG="<%c> has 'supersedes' status%s.%d";const SUPERSEDES="supersedes";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{ojtag:this._onTag}}_onTag(ruleCtx,tag){var stats,status;if((stats=this._metaLib.getTagStatus(tag,SUPERSEDES))&&stats.length){let msg=MSG.replace("%c",tag);;status=stats[0];if(status.since){msg=msg.replace("%s",` (since ${status.since})`)}if(status.description){msg=msg.replace("%d",` ${status.description}`);if(!msg.endsWith(".")){msg+="."}}else{msg=msg.replace("%d","")}if(status.value?.length){let targ=`<${status.value.join(">, <")}>`;msg+=` Supersedes ${targ}.`}let issue=new ruleCtx.Issue(msg);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;