import"./Co0rzPff.js";import{b as m}from"./z-xUYPp7.js";import{d as s,u as g}from"./CrvKVtTA.js";const o={source:["github.com","gitlab.com","bitbucket.org","codeberg.org","git.sr.ht"],issues:["github.com","gitlab.com","bitbucket.org","codeberg.org","docs.google.com"],discord:["discord.gg","discord.com","dsc.gg"],licenseBlocklist:["youtube.com","youtu.be","modrinth.com","curseforge.com","twitter.com","x.com","discord.gg","discord.com","instagram.com","facebook.com","tiktok.com","reddit.com","twitch.tv","patreon.com","ko-fi.com","paypal.com","buymeacoffee.com","google.com","example.com","t.me"],linkShorteners:["bit.ly","adf.ly","tinyurl.com","short.io","is.gd"]};function c(e,i){if(e===null||e==="")return!0;try{const t=new URL(e).hostname.toLowerCase();return i.some(n=>t.includes(n))}catch{return!1}}function u(e,i){return e===null||e===""?!1:c(e,i)}function a(e){return u(e,o.discord)}function r(e){return u(e,o.linkShorteners)}function h(e){return u(e,o.licenseBlocklist)}const b=[{id:"verify-external-links",title:s({id:"nags.verify-external-links.title",defaultMessage:"Verify external links"}),description:s({id:"nags.verify-external-links.description",defaultMessage:"Some of your external links may be using domains that are inappropriate for that type of link."}),status:"warning",shouldShow:e=>!c(e.project.source_url??null,o.source)||!c(e.project.issues_url??null,o.issues)||!c(e.project.discord_url??null,o.discord),link:{path:"settings/links",title:s({id:"nags.visit-links-settings.title",defaultMessage:"Visit links settings"}),shouldShow:e=>e.currentRoute!=="type-id-settings-links"}},{id:"misused-discord-link",title:s({id:"nags.misused-discord-link.title",defaultMessage:"Move Discord invite"}),description:s({id:"nags.misused-discord-link-description",defaultMessage:"Discord invites can not be used for other link types. Please put your Discord link in the Discord Invite link field only."}),status:"required",shouldShow:e=>a(e.project.source_url??null)||a(e.project.issues_url??null)||a(e.project.wiki_url??null),link:{path:"settings/links",title:s({id:"nags.visit-links-settings.title",defaultMessage:"Visit links settings"}),shouldShow:e=>e.currentRoute!=="type-id-settings-links"}},{id:"link-shortener-usage",title:s({id:"nags.link-shortener-usage.title",defaultMessage:"Don't use link shorteners"}),description:s({id:"nags.link-shortener-usage.description",defaultMessage:"Use of link shorteners or other methods to obscure where a link may lead in your external links or license link is prohibited, please only use appropriate full length links."}),status:"required",shouldShow:e=>{if(e.project.donation_urls){for(const i of e.project.donation_urls)if(r(i.url??null))return!0}return r(e.project.source_url??null)||r(e.project.issues_url??null)||r(e.project.wiki_url??null)||r(e.project.discord_url??null)||!!(e.project.license.url&&r(e.project.license.url??null))}},{id:"invalid-license-url",title:s({id:"nags.invalid-license-url.title",defaultMessage:"Add a valid license link"}),description:e=>{const{formatMessage:i}=g(),t=e.project.license.url;if(!t)return i(s({id:"nags.invalid-license-url.description.default",defaultMessage:"License URL is invalid."}));try{const n=new URL(t).hostname.toLowerCase();return i(s({id:"nags.invalid-license-url.description.domain",defaultMessage:"Your license URL points to {domain}, which is not appropriate for license information. License URLs should link directly to your license file, not social media, gaming platforms, etc."}),{domain:n})}catch{return i(s({id:"nags.invalid-license-url.description.malformed",defaultMessage:"Your license URL appears to be malformed. Please provide a valid URL to your license text."}))}},status:"required",shouldShow:e=>{const i=e.project.license.url;if(!i)return!1;const t=h(i);try{return new URL(i),t}catch{return!0}},link:{path:"settings",title:s({id:"nags.edit-license.title",defaultMessage:"Edit license"}),shouldShow:e=>e.currentRoute!=="type-id-settings"}},{id:"gpl-license-source-required",title:s({id:"nags.gpl-license-source-required.title",defaultMessage:"Provide source code"}),description:e=>{const{formatMessage:i}=g();return i(s({id:"nags.gpl-license-source-required.description",defaultMessage:"Your {projectType} uses a license which requires source code to be available. Please provide a source code link or sources file for each additional version, or consider using a different license."}),{projectType:m(e.project.project_type).toLowerCase()})},status:"required",shouldShow:e=>{const t=["GPL-2.0","GPL-2.0+","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0","GPL-3.0+","GPL-3.0-only","GPL-3.0-or-later","LGPL-2.1","LGPL-2.1+","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0","LGPL-3.0+","LGPL-3.0-only","LGPL-3.0-or-later","AGPL-3.0","AGPL-3.0+","AGPL-3.0-only","AGPL-3.0-or-later","MPL-2.0"].includes(e.project.license.id),n=!!e.project.source_url,p=l=>{let d=!0;return l.versions.forEach(f=>{f.files.length<2&&(d=!1)}),d};return t&&(l=>l.project.project_type==="mod"||l.project.project_type==="plugin")(e)&&!n&&!p(e)},link:{path:"settings/links",title:s({id:"nags.visit-links-settings.title",defaultMessage:"Visit links settings"}),shouldShow:e=>e.currentRoute!=="type-id-settings-links"}}];export{a,r as b,o as c,c as i,b as l};