/*
 * 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 RULE="oj-tsx-aria-ojselector-labelledby";const LONG="As of JET 13.0.0, <oj-selector> no longer generates a default aria-labelledby attribute for a screen reader. "+"Applications must specify an aria-labelledby or aria-label attribute explicitly.";const SHORT="As of JET 13.0.0, applications must specify an aria-labelledby/aria-label attribute explicitly on <oj-selector.";const ARIA_LABELLEDBY="aria-labelledby";const ARIA_LABEL="aria-label";const JSX_SPREAD_ATTRIBUTE="JSXSpreadAttribute";class Rule{getName(){return RULE}getDescription(){return LONG}getShortDescription(){return SHORT}register(regCtx){this._tsxUtils=regCtx.utils.tsxUtils;return{"Tsx<oj-selector>":this._onSelector}}_onSelector(ruleCtx,tsxComp){var props,tsxProp;if(props=tsxComp.properties){let propName,i;for(i=0;i<props.length;i++){tsxProp=props[i];if(tsxProp.node.type===JSX_SPREAD_ATTRIBUTE){continue}propName=tsxProp.name;if(!propName||propName===ARIA_LABELLEDBY||propName===ARIA_LABEL){return}}let issue=new ruleCtx.Issue("Missing 'aria-labelledby' or 'aria-label' attribute on <oj-selector>");this._tsxUtils.setIssuePosition(issue,tsxComp);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;