localget_args=require('Модуль:Arguments').getArgslocalmHatnote=require('Модуль:Hatnote')localp={}functionp.main(frame)localargs=get_args(frame)localprefixes=mw.loadData('Модуль:Другие значения/префиксы')localremove_precision=mHatnote.remove_precisionlocaldisambig_type=args.typeorargs['тип']or'default'localtracking_categories={red_link='Другие значения: указана несуществующая страница',no_links='Другие значения: не найдена страница значений',bad_type='Другие значения: указан несуществующий тип',deprecated_param='Википедия:Страницы с шаблоном Другие значения с устаревшим параметром'}localcategories=mHatnote.define_categories(tracking_categories)localprefix=prefixes[disambig_type]ifnotprefixthenprefix=prefixes.defaultcategories:add('bad_type')elseiftype(prefix)=='table'thenprefix=prefix.singularendlocalhatnote_args={prefix=prefix,hide_disambig=true,dot=true,preview_error=true}ifargs[2]thencategories:add('deprecated_param')endlocaldisambig_page=args[1]orargs[2]ifnotdisambig_pagethenlocalwithout=remove_precision{mw.title.getCurrentTitle().prefixedText}localwith=without..' (значения)'ifdisambig_page~=withandmw.title.new(with).existsthendisambig_page=withelseifdisambig_page~=withoutandmw.title.new(without).existsthendisambig_page=withoutelsedisambig_page=withendelseifnotmw.title.new(disambig_page).existsthenlocalwithout=remove_precision{disambig_page}localwith=without..' (значения)'ifdisambig_page~=withandmw.title.new(with).existsthendisambig_page=withelseifdisambig_page~=withoutandmw.title.new(without).existsthendisambig_page=withoutendendhatnote_args[1]=disambig_pagehatnote_args['l1']=args['l1']ordisambig_pagereturnmHatnote.main(hatnote_args,tracking_categories)..categoriesendreturnp