/*
 * 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/
 */
function _find(members,a,index,context){var member,props,pos,c,data,i,j;member=a[index];for(i=0;i<members.length;i++){if(members[i].name==="properties"){props=members[i];break}}if(props&&props.value&&props.value.members){props=props.value.members;for(j=0;j<props.length;j++){if(props[j].name===member){if(index+1>=a.length){pos=props[j].pos;data=context.data;c=data.charAt(pos.index);if(c==="\""||c==="'")pos.index++;return pos}else{return _find(props[j].value.members,a,index+1,context)}}}}for(j=0;j<members.length;j++){if(members[j].name===member){return members[j].pos}}context.utils.msgLib.assert("helper 'json-prop-pos' failure for '"+a.join(".")+"'  <- "+context.filepath)};module.exports=function(context,propName){if(context.suppData.msg){return{line:0,col:0,index:0}}var members,a,ret;var ast=context.suppData.ast;members=ast.members;if(members){var a=propName.split(".");a.forEach(function(v,index){a[index]=a[index].trim()});ret=_find(members,a,0,context)}if(!ret){ret={row:0,col:0,index:0}}return ret};