import{u as r}from"./fields-wnm5Jtc6.js";import{w as s}from"./index-pmrLY__j.js";const n=["attachment","attachment_id","author","author_name","calendar","cat","category","category__and","category__in","category__not_in","category_name","comments_per_page","comments_popup","custom","customize_messenger_channel","customized","cpage","day","debug","embed","error","exact","feed","fields","hour","link_category","m","minute","monthnum","more","name","nav_menu","nonce","nopaging","offset","order","orderby","p","page","page_id","paged","pagename","pb","perm","post","post__in","post__not_in","post_format","post_mime_type","post_status","post_tag","post_type","posts","posts_per_archive_page","posts_per_page","preview","robots","s","search","second","sentence","showposts","static","status","subpost","subpost_id","tag","tag__and","tag__in","tag__not_in","tag_id","tag_slug__and","tag_slug__in","taxonomy","tb","term","terms","theme","title","type","types","w","withcomments","withoutcomments","year"],l=e=>e.match(/^[0-9a-zA-Z_-]+$/g)===null?"Only alphanumeric characters allowed":!0,u=e=>{const t=e.length;if(t>20)return"Max post type name length is 20";const a=e.match(/[a-z0-9_-]/g);return a===null||t!==a.length?"Allowed characters: [Lowercase alphanumeric characters, dashes, and underscores]":!0},m=async e=>{const t=e.length;if(t>20)return"Max post type name length is 20";const a=e.match(/[a-z0-9_-]/g);return a===null||t!==a.length?"Allowed characters: [Lowercase alphanumeric characters, dashes, and underscores]":(await s("checkPostTypeNameAction",{postType:e})).exists===!0?e+" post type already exists.":!0},h=async e=>{const t=e.length;if(t>32)return"Max post type name length is 32";if(n.includes(e))return'Slug must not collide with any reserved term. Please see the <a href="https://developer.wordpress.org/reference/functions/register_taxonomy/#reserved-terms" target="_blank">official docs</a> for more info';const a=e.match(/[a-z0-9_-]/g);return a===null||t!==a.length?"Allowed characters: [Lowercase alphanumeric characters, dashes, and underscores]":!0},p=async e=>{const t=e.length;if(t>32)return"Max post type name length is 32";if(n.includes(e))return'Slug must not collide with any reserved term. Please see the <a href="https://developer.wordpress.org/reference/functions/register_taxonomy/#reserved-terms" target="_blank">official docs</a> for more info';const a=e.match(/[a-z0-9_-]/g);return a===null||t!==a.length?"Allowed characters: [Lowercase alphanumeric characters, dashes, and underscores]":(await s("checkTaxonomySlugAction",{slug:e})).exists===!0?e+" taxonomy already exists.":!0},d=e=>{if(e.match(/^[a-z]/)===null)return"The string needs to start with a letter.";if(e.match(/^[0-9a-zA-Z]+$/)===null)return"The string needs to be alphanumeric (camelcase)."},g=e=>typeof e>"u"||e===null||e===""||e.length===0?!0:e.length!==39?r("Key length must be 39."):new RegExp("^[A-Za-z0-9-_]+$").test(e)?!0:r("Not valid format.");export{l as a,m as b,h as c,p as d,g as e,u as i,d as v};
