"use strict";const t=require("./runtime/wxs-polyfill.js");function n(t){return Array.isArray(t)}function r(t){const n=typeof t;return null!==t&&("object"===n||"function"===n)}const e={addUnit:function(n){const r=t.getRegExp("^-?\\d+(.\\d+)?$");if(null!=n)return r.test(`${n}`)?`${n}px`:n},isString:function(t){return"string"==typeof t},isArray:n,isObject:r,isBoolean:function(t){return"boolean"==typeof t},isNoEmptyObj:function(t){return r(t)&&"{}"!==JSON.stringify(t)},includes:function(t,r){if(!t||!n(t))return!1;let e=0;const o=t.length;for(;e<o;e++)if(t[e]===r)return!0;return!1},cls:function(t,n){const r=[t];let e=0;for(let o=n.length;e<o;e++){const o=n[e];if(o&&Array.isArray(o)){const o=n[e][0];n[e][1]&&r.push(`${t}--${o}`)}else"string"!=typeof o&&"number"!=typeof o||o&&r.push(`${t}--${o}`)}return r.join(" ")},getBadgeAriaLabel:function(t){const n=t.maxCount||99;if(t.dot)return"有新的消息";if("..."===t.count)return"有很多消息";if(isNaN(t.count))return t.count;const r=`有${n}+条消息`,e=`有${t.count}条消息`;return Number(t.count)>n?r:e},_style:function e(o){return n(o)?o.filter((t=>null!=t&&""!==t)).map((t=>{return n(t)||r(t)?e(t):(i=";",(o=t).slice(-i.length)===i?o:o+i);var o,i})).join(" "):r(o)?(i=o,JSON.stringify(i).replace(t.getRegExp('{|}|"',"g"),"").split(",").map((t=>t.split(":")[0]))).filter((t=>null!=o[t]&&""!==o[t])).map((n=>{return[(r=n,r.replace(t.getRegExp("[A-Z]","g"),(t=>`-${t}`)).toLowerCase()),[o[n]]].join(":");var r})).join(";"):o;var i},isValidIconName:function(n){return t.getRegExp("^[A-Za-z0-9-_]+$").test(n)}};exports.tools=e;
