Module:Coordinates: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(only add Wikidata categories if coordinates are displayed in the title) |
(avoid using global variables, and re-order the functions, per protected edit request by User:Jackmcbarn) |
||
Line 16: | Line 16: | ||
]] |
]] |
||
math_mod = require( "Module:Math" ); |
local math_mod = require( "Module:Math" ); |
||
globalFrame = nil |
local globalFrame = nil |
||
coordinates = {}; |
local coordinates = {}; |
||
current_page = mw.title.getCurrentTitle() |
local current_page = mw.title.getCurrentTitle() |
||
page_name = mw.uri.encode( current_page.prefixedText, 'WIKI' ); |
local page_name = mw.uri.encode( current_page.prefixedText, 'WIKI' ); |
||
coord_link = '//tools.wmflabs.org/geohack/geohack.php?pagename=' .. page_name .. '¶ms=' |
local coord_link = '//tools.wmflabs.org/geohack/geohack.php?pagename=' .. page_name .. '¶ms=' |
||
--[[ Helper function, replacement for {{coord/display/title}} ]] |
--[[ Helper function, replacement for {{coord/display/title}} ]] |
||
function displaytitle (s, notes) |
local function displaytitle (s, notes) |
||
local l = "[[Geographic coordinate system|Coordinates]]: " .. s |
local l = "[[Geographic coordinate system|Coordinates]]: " .. s |
||
local co = '<span id="coordinates">' .. l .. notes .. '</span>'; |
local co = '<span id="coordinates">' .. l .. notes .. '</span>'; |
||
Line 32: | Line 32: | ||
--[[ Helper function, Replacement for {{coord/display/inline}} ]] |
--[[ Helper function, Replacement for {{coord/display/inline}} ]] |
||
function displayinline (s, notes) |
local function displayinline (s, notes) |
||
return s .. notes |
return s .. notes |
||
end |
end |
||
--[[ Helper function, used in detecting DMS formatting ]] |
--[[ Helper function, used in detecting DMS formatting ]] |
||
local dmsTest |
local function dmsTest (first, second) |
||
local concatenated = first:upper() .. second:upper(); |
local concatenated = first:upper() .. second:upper(); |
||
Line 45: | Line 45: | ||
end |
end |
||
return false; |
return false; |
||
end |
|||
--[[ |
|||
parseDec |
|||
Transforms decimal format latitude and longitude into the a |
|||
structure to be used in displaying coordinates |
|||
]] |
|||
function parseDec( lat, long, format ) |
|||
local coordinateSpec = {} |
|||
local errors = {} |
|||
if long == "" or long == nil then |
|||
return nil, {{"parseDec", "Missing longitude"}} |
|||
end |
|||
errors = validate( lat, nil, nil, long, nil, nil, 'parseDec', false ); |
|||
coordinateSpec["dec-lat"] = lat; |
|||
coordinateSpec["dec-long"] = long; |
|||
local mode = coordinates.determineMode( lat, long ); |
|||
coordinateSpec["dms-lat"] = convert_dec2dms( lat, "N", "S", mode) -- {{coord/dec2dms|{{{1}}}|N|S|{{coord/prec dec|{{{1}}}|{{{2}}}}}}} |
|||
coordinateSpec["dms-long"] = convert_dec2dms( long, "E", "W", mode) -- {{coord/dec2dms|{{{2}}}|E|W|{{coord/prec dec|{{{1}}}|{{{2}}}}}}} |
|||
if format ~= "" then |
|||
coordinateSpec.default = format |
|||
else |
|||
coordinateSpec.default = "dec" |
|||
end |
|||
return coordinateSpec, errors |
|||
end |
end |
||
--[[ Helper function, handle optional args. ]] |
--[[ Helper function, handle optional args. ]] |
||
function optionalArg(arg, suplement) |
local function optionalArg(arg, suplement) |
||
if arg ~= nil and arg ~= "" then |
if arg ~= nil and arg ~= "" then |
||
return arg .. suplement |
return arg .. suplement |
||
Line 87: | Line 56: | ||
--[[ |
--[[ |
||
Formats any error messages generated for display |
|||
parseDMS |
|||
]] |
|||
local function errorPrinter(errors) |
|||
local result = "" |
|||
for i,v in ipairs(errors) do |
|||
local errorHTML = '<strong class="error">Coordinates: ' .. v[2] .. '</strong>' |
|||
result = result .. errorHTML .. "<br />" |
|||
end |
|||
return result |
|||
end |
|||
--[[ |
|||
Transforms degrees, minutes, seconds format latitude and longitude |
|||
Determine the required CSS class to display coordinates |
|||
Usually geo-nondefault is hidden by CSS, unless a user has overridden this for himself |
|||
default is the mode as specificied by the user when calling the {{coord}} template |
|||
mode is the display mode (dec or dms) that we will need to determine the css class for |
|||
]] |
]] |
||
local function displayDefault(default, mode) |
|||
function parseDMS( lat_d, lat_m, lat_s, lat_f, long_d, long_m, long_s, long_f, format ) |
|||
if default == "" then |
|||
local coordinateSpec = {} |
|||
default = "dec" |
|||
local errors = {} |
|||
lat_f = lat_f:upper(); |
|||
long_f = long_f:upper(); |
|||
-- Check if specified backward |
|||
if lat_f == 'E' or lat_f == 'W' then |
|||
local t_d, t_m, t_s, t_f; |
|||
t_d = lat_d; |
|||
t_m = lat_m; |
|||
t_s = lat_s; |
|||
t_f = lat_f; |
|||
lat_d = long_d; |
|||
lat_m = long_m; |
|||
lat_s = long_s; |
|||
lat_f = long_f; |
|||
long_d = t_d; |
|||
long_m = t_m; |
|||
long_s = t_s; |
|||
long_f = t_f; |
|||
end |
|||
errors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true ); |
|||
if long_d == nil or long_d == "" then |
|||
table.insert(errors, {"parseDMS", "Missing longitude" }) |
|||
end |
end |
||
if default == mode then |
|||
if lat_m == nil and lat_s == nil and long_m == nil and long_s == nil and #errors == 0 then |
|||
return "geo-default" |
|||
if math_mod._precision( lat_d ) > 0 or math_mod._precision( long_d ) > 0 then |
|||
if lat_f:upper() == 'S' then |
|||
lat_d = '-' .. lat_d; |
|||
end |
|||
if long_f:upper() == 'W' then |
|||
long_d = '-' .. long_d; |
|||
end |
|||
return parseDec( lat_d, long_d, format ); |
|||
end |
|||
end |
|||
coordinateSpec["dms-lat"] = lat_d.."°"..optionalArg(lat_m,"′") .. optionalArg(lat_s,"″") .. lat_f |
|||
coordinateSpec["dms-long"] = long_d.."°"..optionalArg(long_m,"′") .. optionalArg(long_s,"″") .. long_f |
|||
coordinateSpec["dec-lat"] = convert_dms2dec(lat_f, lat_d, lat_m, lat_s) -- {{coord/dms2dec|{{{4}}}|{{{1}}}|0{{{2}}}|0{{{3}}}}} |
|||
coordinateSpec["dec-long"] = convert_dms2dec(long_f, long_d, long_m, long_s) -- {{coord/dms2dec|{{{8}}}|{{{5}}}|0{{{6}}}|0{{{7}}}}} |
|||
if format ~= "" then |
|||
coordinateSpec.default = format |
|||
else |
else |
||
return "geo-nondefault" |
|||
coordinateSpec.default = "dms" |
|||
end |
end |
||
return coordinateSpec, errors |
|||
end |
end |
||
Line 154: | Line 92: | ||
or parseDMS and formats it for inclusion on Wikipedia. |
or parseDMS and formats it for inclusion on Wikipedia. |
||
]] |
]] |
||
function specPrinter(args, coordinateSpec) |
local function specPrinter(args, coordinateSpec) |
||
local uriComponents = coordinateSpec["param"] |
local uriComponents = coordinateSpec["param"] |
||
if uriComponents == "" then |
if uriComponents == "" then |
||
Line 170: | Line 108: | ||
local lat = tonumber( coordinateSpec["dec-lat"] ) or 0 |
local lat = tonumber( coordinateSpec["dec-lat"] ) or 0 |
||
local geodeclat |
|||
if lat < 0 then |
if lat < 0 then |
||
-- FIXME this breaks the pre-existing precision |
-- FIXME this breaks the pre-existing precision |
||
Line 178: | Line 117: | ||
local long = tonumber( coordinateSpec["dec-long"] ) or 0 |
local long = tonumber( coordinateSpec["dec-long"] ) or 0 |
||
local geodeclong |
|||
if long < 0 then |
if long < 0 then |
||
-- FIXME does not handle unicode minus |
-- FIXME does not handle unicode minus |
||
Line 195: | Line 135: | ||
.. '</span>' |
.. '</span>' |
||
local inner = '<span class="' .. displayDefault(coordinateSpec["default"], "dms" ) .. '">' .. geodmshtml .. '</span>' |
|||
local inner; |
|||
inner = '<span class="' .. displayDefault(coordinateSpec["default"], "dms" ) .. '">' .. geodmshtml .. '</span>' |
|||
.. '<span class="geo-multi-punct"> / </span>' |
.. '<span class="geo-multi-punct"> / </span>' |
||
.. '<span class="' .. displayDefault(coordinateSpec["default"], "dec" ) .. '">'; |
.. '<span class="' .. displayDefault(coordinateSpec["default"], "dec" ) .. '">'; |
||
Line 214: | Line 153: | ||
end |
end |
||
--[[ Helper function, convert decimal to degrees ]] |
|||
--[[ |
|||
local function convert_dec2dms_d(coordinate) |
|||
Formats any error messages generated for display |
|||
local d = math_mod._round( coordinate, 0 ) .. "°" |
|||
]] |
|||
return d .. "" |
|||
function errorPrinter(errors) |
|||
local result = "" |
|||
for i,v in ipairs(errors) do |
|||
local errorHTML = '<strong class="error">Coordinates: ' .. v[2] .. '</strong>' |
|||
result = result .. errorHTML .. "<br />" |
|||
end |
|||
return result |
|||
end |
end |
||
--[[ Helper function, convert decimal to degrees and minutes ]] |
|||
--[[ |
|||
local function convert_dec2dms_dm(coordinate) |
|||
Determine the required CSS class to display coordinates |
|||
coordinate = math_mod._round( coordinate * 60, 0 ); |
|||
local m = coordinate % 60; |
|||
Usually geo-nondefault is hidden by CSS, unless a user has overridden this for himself |
|||
coordinate = math.floor( (coordinate - m) / 60 ); |
|||
default is the mode as specificied by the user when calling the {{coord}} template |
|||
local d = coordinate % 360 .."°" |
|||
mode is the display mode (dec or dms) that we will need to determine the css class for |
|||
]] |
|||
function displayDefault(default, mode) |
|||
if default == "" then |
|||
default = "dec" |
|||
end |
|||
return d .. string.format( "%02d′", m ) |
|||
if default == mode then |
|||
return "geo-default" |
|||
else |
|||
return "geo-nondefault" |
|||
end |
|||
end |
end |
||
--[[ Helper function, convert decimal to degrees, minutes, and seconds ]] |
|||
--[[ |
|||
local function convert_dec2dms_dms(coordinate) |
|||
Check the input arguments for coord to determine the kind of data being provided |
|||
coordinate = math_mod._round( coordinate * 60 * 60, 0 ); |
|||
and then make the necessary processing. |
|||
local s = coordinate % 60 |
|||
]] |
|||
coordinate = math.floor( (coordinate - s) / 60 ); |
|||
function formatTest(args) |
|||
local |
local m = coordinate % 60 |
||
coordinate = math.floor( (coordinate - m) / 60 ); |
|||
local primary = false; |
|||
local d = coordinate % 360 .."°" |
|||
if args[1] == "" then |
|||
return d .. string.format( "%02d′", m ) .. string.format( "%02d″", s ) |
|||
-- no lat logic |
|||
return errorPrinter( {{"formatTest", "Missing latitude"}} ) |
|||
elseif args[4] == "" and args[5] == "" and args[6] == "" then |
|||
-- dec logic |
|||
result, errors = parseDec( args[1], args[2], args['format'] ) |
|||
if result == nil then |
|||
return errorPrinter( errors ); |
|||
end |
|||
result.param = table.concat( {args[1], "_N_", args[2], "_E_", args[3] } ); |
|||
elseif dmsTest(args[4], args[8]) then |
|||
-- dms logic |
|||
result, errors = parseDMS( args[1], args[2], args[3], args[4], |
|||
args[5], args[6], args[7], args[8], args['format'] ) |
|||
result.param = table.concat( { args[1], args[2], args[3], args[4], args[5], |
|||
args[6], args[7], args[8], args[9] } , '_' ); |
|||
if args[10] ~= '' then |
|||
table.insert( errors, { 'formatTest', 'Extra unexpected parameters' } ); |
|||
end |
|||
elseif dmsTest(args[3], args[6]) then |
|||
-- dm logic |
|||
result, errors = parseDMS( args[1], args[2], nil, args[3], |
|||
args[4], args[5], nil, args[6], args['format'] ) |
|||
result.param = table.concat( { args[1], args[2], args[3], args[4], args[5], |
|||
args[6], args[7] } , '_' ); |
|||
if args[8] ~= '' then |
|||
table.insert( errors, { 'formatTest', 'Extra unexpected parameters' } ); |
|||
end |
|||
elseif dmsTest(args[2], args[4]) then |
|||
-- d logic |
|||
result, errors = parseDMS( args[1], nil, nil, args[2], |
|||
args[3], nil, nil, args[4], args['format'] ) |
|||
result.param = table.concat( { args[1], args[2], args[3], args[4], args[5] } , '_' ); |
|||
if args[6] ~= '' then |
|||
table.insert( errors, { 'formatTest', 'Extra unexpected parameters' } ); |
|||
end |
|||
else |
|||
-- Error |
|||
return errorPrinter( {{"formatTest", "Unknown argument format"}} ) |
|||
end |
|||
result.name = args["name"] |
|||
local extra_param = {'dim', 'globe', 'scale', 'region', 'source', 'type'} |
|||
for _, v in ipairs( extra_param ) do |
|||
if (args[v] or '') ~= '' then |
|||
table.insert( errors, {'formatTest', 'Parameter: "' .. v .. '=" should be "' .. v .. ':"' } ); |
|||
end |
|||
end |
|||
if #errors == 0 then |
|||
return specPrinter( args, result ) |
|||
else |
|||
return specPrinter( args, result ) .. " " .. errorPrinter(errors) .. '[[Category:Pages with malformed coordinate tags]]'; |
|||
end |
|||
end |
end |
||
Line 313: | Line 185: | ||
degrees, minutes, and seconds format based on the specified precision. |
degrees, minutes, and seconds format based on the specified precision. |
||
]] |
]] |
||
function convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision) |
local function convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision) |
||
local coord = tonumber(coordinate) or 0 |
local coord = tonumber(coordinate) or 0 |
||
local postfix |
local postfix |
||
Line 330: | Line 202: | ||
return convert_dec2dms_d( math.abs( coord ) ) .. postfix; |
return convert_dec2dms_d( math.abs( coord ) ) .. postfix; |
||
end |
end |
||
end |
|||
--[[ Helper function, convert decimal to degrees ]] |
|||
function convert_dec2dms_d(coordinate) |
|||
local d = math_mod._round( coordinate, 0 ) .. "°" |
|||
return d .. "" |
|||
end |
|||
--[[ Helper function, convert decimal to degrees and minutes ]] |
|||
function convert_dec2dms_dm(coordinate) |
|||
coordinate = math_mod._round( coordinate * 60, 0 ); |
|||
local m = coordinate % 60; |
|||
coordinate = math.floor( (coordinate - m) / 60 ); |
|||
local d = coordinate % 360 .."°" |
|||
return d .. string.format( "%02d′", m ) |
|||
end |
|||
--[[ Helper function, convert decimal to degrees, minutes, and seconds ]] |
|||
function convert_dec2dms_dms(coordinate) |
|||
coordinate = math_mod._round( coordinate * 60 * 60, 0 ); |
|||
local s = coordinate % 60 |
|||
coordinate = math.floor( (coordinate - s) / 60 ); |
|||
local m = coordinate % 60 |
|||
coordinate = math.floor( (coordinate - m) / 60 ); |
|||
local d = coordinate % 360 .."°" |
|||
return d .. string.format( "%02d′", m ) .. string.format( "%02d″", s ) |
|||
end |
end |
||
Line 363: | Line 207: | ||
Convert DMS format into a N or E decimal coordinate |
Convert DMS format into a N or E decimal coordinate |
||
]] |
]] |
||
function convert_dms2dec(direction, degrees_str, minutes_str, seconds_str) |
local function convert_dms2dec(direction, degrees_str, minutes_str, seconds_str) |
||
local degrees = tonumber(degrees_str) or 0 |
local degrees = tonumber(degrees_str) or 0 |
||
local minutes = tonumber(minutes_str) or 0 |
local minutes = tonumber(minutes_str) or 0 |
||
Line 390: | Line 234: | ||
Checks input values to for out of range errors. |
Checks input values to for out of range errors. |
||
]] |
]] |
||
function validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, source, strong ) |
local function validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, source, strong ) |
||
local errors = {}; |
local errors = {}; |
||
lat_d = tonumber( lat_d ) or 0; |
lat_d = tonumber( lat_d ) or 0; |
||
Line 456: | Line 300: | ||
return errors; |
return errors; |
||
end |
|||
--[[ |
|||
parseDec |
|||
Transforms decimal format latitude and longitude into the a |
|||
structure to be used in displaying coordinates |
|||
]] |
|||
local function parseDec( lat, long, format ) |
|||
local coordinateSpec = {} |
|||
local errors = {} |
|||
if long == "" or long == nil then |
|||
return nil, {{"parseDec", "Missing longitude"}} |
|||
end |
|||
errors = validate( lat, nil, nil, long, nil, nil, 'parseDec', false ); |
|||
coordinateSpec["dec-lat"] = lat; |
|||
coordinateSpec["dec-long"] = long; |
|||
local mode = coordinates.determineMode( lat, long ); |
|||
coordinateSpec["dms-lat"] = convert_dec2dms( lat, "N", "S", mode) -- {{coord/dec2dms|{{{1}}}|N|S|{{coord/prec dec|{{{1}}}|{{{2}}}}}}} |
|||
coordinateSpec["dms-long"] = convert_dec2dms( long, "E", "W", mode) -- {{coord/dec2dms|{{{2}}}|E|W|{{coord/prec dec|{{{1}}}|{{{2}}}}}}} |
|||
if format ~= "" then |
|||
coordinateSpec.default = format |
|||
else |
|||
coordinateSpec.default = "dec" |
|||
end |
|||
return coordinateSpec, errors |
|||
end |
|||
--[[ |
|||
parseDMS |
|||
Transforms degrees, minutes, seconds format latitude and longitude |
|||
into the a structure to be used in displaying coordinates |
|||
]] |
|||
local function parseDMS( lat_d, lat_m, lat_s, lat_f, long_d, long_m, long_s, long_f, format ) |
|||
local coordinateSpec = {} |
|||
local errors = {} |
|||
lat_f = lat_f:upper(); |
|||
long_f = long_f:upper(); |
|||
-- Check if specified backward |
|||
if lat_f == 'E' or lat_f == 'W' then |
|||
local t_d, t_m, t_s, t_f; |
|||
t_d = lat_d; |
|||
t_m = lat_m; |
|||
t_s = lat_s; |
|||
t_f = lat_f; |
|||
lat_d = long_d; |
|||
lat_m = long_m; |
|||
lat_s = long_s; |
|||
lat_f = long_f; |
|||
long_d = t_d; |
|||
long_m = t_m; |
|||
long_s = t_s; |
|||
long_f = t_f; |
|||
end |
|||
errors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true ); |
|||
if long_d == nil or long_d == "" then |
|||
table.insert(errors, {"parseDMS", "Missing longitude" }) |
|||
end |
|||
if lat_m == nil and lat_s == nil and long_m == nil and long_s == nil and #errors == 0 then |
|||
if math_mod._precision( lat_d ) > 0 or math_mod._precision( long_d ) > 0 then |
|||
if lat_f:upper() == 'S' then |
|||
lat_d = '-' .. lat_d; |
|||
end |
|||
if long_f:upper() == 'W' then |
|||
long_d = '-' .. long_d; |
|||
end |
|||
return parseDec( lat_d, long_d, format ); |
|||
end |
|||
end |
|||
coordinateSpec["dms-lat"] = lat_d.."°"..optionalArg(lat_m,"′") .. optionalArg(lat_s,"″") .. lat_f |
|||
coordinateSpec["dms-long"] = long_d.."°"..optionalArg(long_m,"′") .. optionalArg(long_s,"″") .. long_f |
|||
coordinateSpec["dec-lat"] = convert_dms2dec(lat_f, lat_d, lat_m, lat_s) -- {{coord/dms2dec|{{{4}}}|{{{1}}}|0{{{2}}}|0{{{3}}}}} |
|||
coordinateSpec["dec-long"] = convert_dms2dec(long_f, long_d, long_m, long_s) -- {{coord/dms2dec|{{{8}}}|{{{5}}}|0{{{6}}}|0{{{7}}}}} |
|||
if format ~= "" then |
|||
coordinateSpec.default = format |
|||
else |
|||
coordinateSpec.default = "dms" |
|||
end |
|||
return coordinateSpec, errors |
|||
end |
|||
--[[ |
|||
Check the input arguments for coord to determine the kind of data being provided |
|||
and then make the necessary processing. |
|||
]] |
|||
local function formatTest(args) |
|||
local result, errors; |
|||
local primary = false; |
|||
if args[1] == "" then |
|||
-- no lat logic |
|||
return errorPrinter( {{"formatTest", "Missing latitude"}} ) |
|||
elseif args[4] == "" and args[5] == "" and args[6] == "" then |
|||
-- dec logic |
|||
result, errors = parseDec( args[1], args[2], args['format'] ) |
|||
if result == nil then |
|||
return errorPrinter( errors ); |
|||
end |
|||
result.param = table.concat( {args[1], "_N_", args[2], "_E_", args[3] } ); |
|||
elseif dmsTest(args[4], args[8]) then |
|||
-- dms logic |
|||
result, errors = parseDMS( args[1], args[2], args[3], args[4], |
|||
args[5], args[6], args[7], args[8], args['format'] ) |
|||
result.param = table.concat( { args[1], args[2], args[3], args[4], args[5], |
|||
args[6], args[7], args[8], args[9] } , '_' ); |
|||
if args[10] ~= '' then |
|||
table.insert( errors, { 'formatTest', 'Extra unexpected parameters' } ); |
|||
end |
|||
elseif dmsTest(args[3], args[6]) then |
|||
-- dm logic |
|||
result, errors = parseDMS( args[1], args[2], nil, args[3], |
|||
args[4], args[5], nil, args[6], args['format'] ) |
|||
result.param = table.concat( { args[1], args[2], args[3], args[4], args[5], |
|||
args[6], args[7] } , '_' ); |
|||
if args[8] ~= '' then |
|||
table.insert( errors, { 'formatTest', 'Extra unexpected parameters' } ); |
|||
end |
|||
elseif dmsTest(args[2], args[4]) then |
|||
-- d logic |
|||
result, errors = parseDMS( args[1], nil, nil, args[2], |
|||
args[3], nil, nil, args[4], args['format'] ) |
|||
result.param = table.concat( { args[1], args[2], args[3], args[4], args[5] } , '_' ); |
|||
if args[6] ~= '' then |
|||
table.insert( errors, { 'formatTest', 'Extra unexpected parameters' } ); |
|||
end |
|||
else |
|||
-- Error |
|||
return errorPrinter( {{"formatTest", "Unknown argument format"}} ) |
|||
end |
|||
result.name = args["name"] |
|||
local extra_param = {'dim', 'globe', 'scale', 'region', 'source', 'type'} |
|||
for _, v in ipairs( extra_param ) do |
|||
if (args[v] or '') ~= '' then |
|||
table.insert( errors, {'formatTest', 'Parameter: "' .. v .. '=" should be "' .. v .. ':"' } ); |
|||
end |
|||
end |
|||
if #errors == 0 then |
|||
return specPrinter( args, result ) |
|||
else |
|||
return specPrinter( args, result ) .. " " .. errorPrinter(errors) .. '[[Category:Pages with malformed coordinate tags]]'; |
|||
end |
|||
end |
end |
||