<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Type; use Illuminate\Support\Str; use ModStart\Core\Input\Request; use ModStart\Core\Input\Response; use ModStart\Core\Util\ConstantUtil; use ModStart\Core\Util\SerializeUtil; class TypeUtil { public static function dumpJsFile($o99g9) { goto UkCLf; uYAvy: $gP2DQ = array(); goto zRVsQ; vuYov: return Response::raw(join('
', $gP2DQ), array('Content-Type' => 'text/plain')); goto zJfLw; hAxpo: foreach ($NUGR3 as $glP3G => $fgYNs) { $gP2DQ[] = "export const {$glP3G} = " . SerializeUtil::jsonEncodePretty($fgYNs) . ';'; } goto vuYov; UkCLf: $NUGR3 = array(); goto h1657; zRVsQ: $gP2DQ[] = '// This file is created by ' . Request::currentPageUrl() . '
'; goto hAxpo; h1657: foreach ($o99g9 as $BYzWI) { $NUGR3[class_basename($BYzWI)] = TypeUtil::dump($BYzWI); } goto uYAvy; zJfLw: } public static function name($xc6uF, $cBDsM) { goto nnnAe; nnnAe: $xOkS0 = $xc6uF::getList(); goto geZI4; geZI4: foreach ($xOkS0 as $lxIPA => $knQyJ) { if ($lxIPA == $cBDsM) { return $knQyJ; } } goto hL4xL; hL4xL: return null; goto dC3_l; dC3_l: } public static function filter($xc6uF, $aJd3g) { goto XIp3E; UY9QO: return $DMbpM; goto KqnsO; wjvnv: foreach ($xOkS0 as $lxIPA => $knQyJ) { if (in_array($lxIPA, $aJd3g)) { $DMbpM[$lxIPA] = $knQyJ; } } goto UY9QO; XIp3E: $xOkS0 = $xc6uF::getList(); goto agl__; agl__: $DMbpM = array(); goto wjvnv; KqnsO: } public static function dump($cxdWJ) { goto dSbHd; dSbHd: $y9Lyp = ConstantUtil::dump($cxdWJ); goto LYWU5; x17Ew: return $aJd3g; goto OBIqS; LYWU5: $NRcb0 = $cxdWJ::getList(); goto TrCAF; TrCAF: foreach ($y9Lyp as $oMJcb => $cBDsM) { goto iquhF; JB07M: $aJd3g[$oMJcb]['name'] = isset($NRcb0[$cBDsM]) ? $NRcb0[$cBDsM] : null; goto ob7md; iquhF: $aJd3g[$oMJcb]['key'] = $oMJcb; goto d3naQ; d3naQ: $aJd3g[$oMJcb]['value'] = $cBDsM; goto JB07M; ob7md: } goto x17Ew; OBIqS: } public static function colorGuessMap($xxTNd) { goto P7kf5; oeqh_: $Sio1J[$xxTNd] = $NRcb0; goto N9hPW; qgpCU: $NRcb0 = array(); goto iJAFx; SO_AE: foreach (ConstantUtil::dump($xxTNd) as $lxIPA => $knQyJ) { $lxIPA = strtolower($lxIPA); foreach ($guCZw as $l0SVQ => $SiIEa) { if (Str::contains($lxIPA, $l0SVQ)) { $NRcb0[$knQyJ] = $SiIEa; break; } } } goto oeqh_; vi7nm: if (isset($Sio1J[$xxTNd])) { return $Sio1J[$xxTNd]; } goto qgpCU; iJAFx: $guCZw = array('fail' => 'danger', 'error' => 'danger', 'wait_verify' => 'danger', 'wait_pay' => 'warning', 'danger' => 'warning', 'running' => 'warning', 'refund' => 'warning', 'success' => 'success', 'verified' => 'success', 'pass' => 'success', 'reject' => 'danger', 'wait' => 'muted', 'canceled' => 'muted', 'disabled' => 'muted', 'completed' => 'success', 'finish' => 'success', 'converting' => 'warning', 'sending' => 'warning', 'ignore' => 'muted', 'expired' => 'muted', 'info' => 'primary', 'unread' => 'danger', 'read' => 'muted', 'processed' => 'success', 'verifying' => 'warning', 'online' => 'success', 'payed' => 'success', 'wait_process' => 'warning', 'deleted' => 'muted', 'invalid' => 'warning', 'valid' => 'success'); goto SO_AE; N9hPW: return $NRcb0; goto oXJa8; P7kf5: static $Sio1J = array(); goto vi7nm; oXJa8: } }