package SGN::View::Mason::Commands;
use strict;
use vars qw($m $c);
HTML::Mason::Component::FileBased->new(
'code' => sub {
use utf8; local $SGN::View::Mason::Commands::m = $HTML::Mason::Commands::m;
HTML::Mason::Exception::Params->throw
    ( error =>
      "Odd number of parameters passed to component expecting name/value pairs"
    ) if @_ % 2;
my ( $stock_id );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

    foreach my $arg ( qw( stock_id ) )
    {
        HTML::Mason::Exception::Params->throw
            ( error => "no value sent for required parameter '$arg'" )
                unless exists $pos{$arg};
    }
#line 3 "/home/production/cxgn/sgn/mason/pedigree/stock_pedigree_string.mas"
    $stock_id = $_[ $pos{'stock_id'} ];
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 1 "/home/production/cxgn/sgn/mason/pedigree/stock_pedigree_string.mas"
$m->print( '
' );
#line 5 "/home/production/cxgn/sgn/mason/pedigree/stock_pedigree_string.mas"
$m->print( '
' );
#line 6 "/home/production/cxgn/sgn/mason/pedigree/stock_pedigree_string.mas"
$m->comp( { content => sub {
#line 6 "/home/production/cxgn/sgn/mason/pedigree/stock_pedigree_string.mas"
$m->print( '
  <select id="pedigree_level_select">
    <option value="Parents">Parents</option>
    <option value="Grandparents">Grandparents</option>
    <option value="Great-Grandparents">Great-Grandparents</option>
  </select>

  <span id="pedigree_string">[loading...]</span>

  <br /><br />
' );
#line 16 "/home/production/cxgn/sgn/mason/pedigree/stock_pedigree_string.mas"
} }, '/page/info_section.mas', title=>'Pedigree string'
 );
#line 16 "/home/production/cxgn/sgn/mason/pedigree/stock_pedigree_string.mas"
$m->print( '

<script>

jQuery(document).ready(function($) {

  get_pedigree_string(' );
#line 22 "/home/production/cxgn/sgn/mason/pedigree/stock_pedigree_string.mas"
$m->print(  $stock_id  );
#line 22 "/home/production/cxgn/sgn/mason/pedigree/stock_pedigree_string.mas"
$m->print( ');
  jQuery(\'#pedigree_level_select\').change( function() {
    jQuery(\'#pedigree_string\').html(\'[loading...]\');
    get_pedigree_string(' );
#line 25 "/home/production/cxgn/sgn/mason/pedigree/stock_pedigree_string.mas"
$m->print(  $stock_id  );
#line 25 "/home/production/cxgn/sgn/mason/pedigree/stock_pedigree_string.mas"
$m->print( ');
  });
});

function get_pedigree_string(stock_id) {
    jQuery.ajax( {
      url : \'/stock/\'+ stock_id +\'/pedigreestring\',
      data : { \'level\' : jQuery(\'#pedigree_level_select\').val() },
      error : function(response) {
         alert("an error occurred");
      },
      success: function(response) {
         jQuery(\'#pedigree_string\').html(response.pedigree_string);
      }
    });
}

</script>
' );
;return;
},
'declared_args' => {
  '$stock_id' => { default => undef }
},
'load_time' => 1763448495,

)
;