"use strict";var y=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var E=(e,o)=>{for(var n in o)y(e,n,{get:o[n],enumerable:!0})},F=(e,o,n,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of I(o))!C.call(e,i)&&i!==n&&y(e,i,{get:()=>o[i],enumerable:!(m=D(o,i))||m.enumerable});return e};var L=e=>F(y({},"__esModule",{value:!0}),e);var W={};E(W,{default:()=>U});module.exports=L(W);var h=require("@typescript-eslint/utils"),t=require("ramda");var d=require("fs"),u=require("path"),s=require("ramda"),q=(0,s.startsWith)("@"),g=e=>(0,s.flow)(e,[(0,s.split)("/"),(0,s.take)(q(e)?2:1),(0,s.join)("/")]),O=e=>JSON.parse((0,d.readFileSync)((0,u.join)(e,"package.json"),"utf8"));var c=require("ramda"),M={oneOf:[{type:"boolean"},{type:"string",enum:["typeOnly"]}]},R=(0,c.fromPairs)((0,c.xprod)(["production","optionalPeers","requiredPeers"],[M])),S={type:"object",properties:{packageDir:{type:"string"},typeOnly:{type:"array",items:{type:"string"}},ignore:{type:"array",items:{type:"string",format:"regex"}},...R},additionalProperties:!1};var V={prohibited:"Importing {{name}} is not allowed.",typeOnly:"Only 'import type' syntax is allowed for {{name}}."},T={production:!0,requiredPeers:!0,optionalPeers:"typeOnly"},x=h.ESLintUtils.RuleCreator.withoutDocs({meta:{messages:V,type:"problem",schema:[S]},defaultOptions:[T],create:(e,[{packageDir:o=e.cwd,typeOnly:n=[],ignore:m=["^\\.","^node:"],...i}])=>{let l=O(o),P=r=>m.some(p=>new RegExp(p).test(r)),b=(0,t.flip)(t.path)(l),j=r=>b(["peerDependenciesMeta",r,"optional"]),[k,N]=(0,t.partition)(j,Object.keys(l.peerDependencies||{})),w={production:Object.keys(l.dependencies||{}),requiredPeers:N,optionalPeers:k},J=r=>(0,t.flatten)((0,t.values)((0,t.mapObjIndexed)((p,a)=>p===r?w[a]:[],i))),[v,f]=[!0,"typeOnly"].map(J);return f.push(...n),{ImportDeclaration:({source:r,importKind:p})=>{if(!P(r.value)){let a=g(r.value);v.includes(a)||p!=="type"&&e.report({node:r,data:{name:a},messageId:f.includes(a)?"typeOnly":"prohibited"})}}}}});var U={rules:{dependencies:x}};