package SGN::View::Mason::Commands;
use strict;
use vars qw($m $c);
my %_method =
(
'step' => HTML::Mason::Component::Subcomponent->new(
'code' => sub {
HTML::Mason::Request->instance->call_dynamic( 'method_step', @_ )
},
'declared_args' => {
  '$title' => { default => ' ""' }
},

)
,
'pending' => HTML::Mason::Component::Subcomponent->new(
'code' => sub {
HTML::Mason::Request->instance->call_dynamic( 'method_pending', @_ )
},

)
,
'complete' => HTML::Mason::Component::Subcomponent->new(
'code' => sub {
HTML::Mason::Request->instance->call_dynamic( 'method_complete', @_ )
},

)
,

);
HTML::Mason::Component::FileBased->new(
'code' => sub {
HTML::Mason::Request->instance->call_dynamic( 'main', @_ )
},
'declared_args' => {
  '$id' => { default => undef }
},
'dynamic_subs_init' => sub {
local $SGN::View::Mason::Commands::m = $HTML::Mason::Commands::m;
#line 7 "/home/production/cxgn/sgn/mason/util/workflow.mas"

  my $loadstyle = 1;  
  my @titles = ();
  my @contents = ();
  my $pending = "";
  my $complete = "Complete!";
return {
'main' => 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 ( $id );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

    foreach my $arg ( qw( 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/util/workflow.mas"
    $id = $_[ $pos{'id'} ];
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 16 "/home/production/cxgn/sgn/mason/util/workflow.mas"

  @titles = ();
  @contents = ();
  $pending = "";
  $complete = "Complete!";
#line 1 "/home/production/cxgn/sgn/mason/util/workflow.mas"
# Generates a workflow component
$m->print( '
' );
#line 6 "/home/production/cxgn/sgn/mason/util/workflow.mas"
# Initializes shared variables.
$m->print( '
' );
#line 15 "/home/production/cxgn/sgn/mason/util/workflow.mas"
# Clears shared variables from previous uses.
$m->print( '
' );
#line 23 "/home/production/cxgn/sgn/mason/util/workflow.mas"
# Adds a new step to the workflow
$m->print( '
' );
#line 34 "/home/production/cxgn/sgn/mason/util/workflow.mas"
# Shown when all steps are completed but one or more is pending.
$m->print( '
' );
#line 41 "/home/production/cxgn/sgn/mason/util/workflow.mas"
# Shown when all steps are completed and none are pending.
$m->print( '

' );
#line 49 "/home/production/cxgn/sgn/mason/util/workflow.mas"
# loads css, but only once (even if used multiple time in one request)
 if ($loadstyle) {
 $loadstyle = 0;
$m->print( '<style media="screen">
  ol.workflow-prog{
    display: table;
    table-layout: fixed;
    list-style-type: none;
    text-align: center;
    margin: 0 0 1em 0;
    padding: 0;
    width: 100%;
    counter-reset: step;
    font-size: 16px;
  }
  
  ol.workflow-prog>li{
    display: table-cell;
    text-align: center;
    color: black;
    position: relative;
    font-size: 11px;
  }
  
  ol.workflow-prog>li>div.workflow-title{
    display: inline-block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  ol.workflow-prog>li::after{
    font-size: 14px;
    width: 30px;
    height: 30px;
    content: counter(step);
    counter-increment: step;
    line-height: 1em;
    padding-top: 0.3em;
    border: 4px solid;
    display: block;
    text-align: center;
    position: relative;
    border-radius: 50%;
    margin: 0 auto 0 auto;
    background: white;
    border-color: #bbb;
    color: #bbb;
  }
  
  ol.workflow-prog>li.workflow-complete::after{
    border-color: #5fba7d;
    color: white;
    background: #5fba7d;
  }
  
  @keyframes pend_blink {
    0% {}
    50% {
      border-color: white;
    }
    100% {}
  }
  
  ol.workflow-prog>li.workflow-pending::after{
    animation: pend_blink 2s linear infinite;
  }
  
  ol.workflow-prog>li.workflow-skipped::after{
    border-color: #eeb700;
    background: #eeb700;
    color: white;
  }
  
  ol.workflow-prog>li.workflow-focus::after{
    border-color: #5fba7d;
    background: white;
    color: #5fba7d;
  }
  
  
  ol.workflow-prog>li::before {
    width: 100%;
    height: 2px;
    content: \'\';
    display: block;
    position: relative;
    top: 34px;
    margin-left: 50%;
    background-color: #bbb;
  }
  
  ol.workflow-prog>li:last-of-type::before {
    width: 0%;
  }
  
  ol.workflow-prog>li.workflow-complete::before{
    background: #5fba7d;
  }
  
  ol.workflow-content{
    display: block;
    table-layout: fixed;
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  
  ol.workflow-content>li{
    width: 100%;
    position: relative;
    display: none;
  }
  
  ol.workflow-content>li.workflow-focus{
    display: block;
  }  
  
  div.workflow-pending-message{
    display: none;
  }
  div.workflow-complete-message{
    display: none;
  }
  div.workflow-message-show{
    display: block;
  }
  
</style>
' );
#line 180 "/home/production/cxgn/sgn/mason/util/workflow.mas"
 }
$m->print( '
' );
#line 182 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->comp(   '/util/import_javascript.mas', classes => ['workflow']   
); #line 182 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print( '
' );
#line 183 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print(  $m->content  );
#line 183 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print( '
<div id="' );
#line 184 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print(  $id  );
#line 184 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print( '" class="workflow">
  <ol class="workflow-prog">
' );
#line 186 "/home/production/cxgn/sgn/mason/util/workflow.mas"
   foreach my $title (@titles) {
$m->print( '      <li><div class="workflow-title">' );
#line 187 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print(  $title  );
#line 187 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print( '</div></li>
' );
#line 188 "/home/production/cxgn/sgn/mason/util/workflow.mas"
    }
$m->print( '  </ol>
  <div class="panel panel-default">
    <div class="panel-body">
      <ol class="workflow-content">
' );
#line 193 "/home/production/cxgn/sgn/mason/util/workflow.mas"
       foreach my $content (@contents) {
$m->print( '          <li>' );
#line 194 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print(  $content  );
#line 194 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print( '</li>
' );
#line 195 "/home/production/cxgn/sgn/mason/util/workflow.mas"
       }
$m->print( '      </ol>
      <div class="workflow-pending-message">' );
#line 197 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print(  $pending || $complete  );
#line 197 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print( '</div>
      <div class="workflow-complete-message">' );
#line 198 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print(  $complete  );
#line 198 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print( '</div>
    </div>
  </div>
</div>
<script type="text/javascript">
  Workflow.init("#' );
#line 203 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print(  $id  );
#line 203 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print( '");
</script>
' );
;return;
},
'method_complete' => sub {
use utf8; local $SGN::View::Mason::Commands::m = $HTML::Mason::Commands::m;
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 43 "/home/production/cxgn/sgn/mason/util/workflow.mas"

    $complete = $m->content;
  #line 42 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print( '
  ' );
;return;
},
'method_pending' => sub {
use utf8; local $SGN::View::Mason::Commands::m = $HTML::Mason::Commands::m;
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 36 "/home/production/cxgn/sgn/mason/util/workflow.mas"

    $pending = $m->content;
  #line 35 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print( '
  ' );
;return;
},
'method_step' => 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 ( $title );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }
#line 26 "/home/production/cxgn/sgn/mason/util/workflow.mas"
     $title = exists $pos{'title'} ? $_[ $pos{'title'} ] :  "";
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 28 "/home/production/cxgn/sgn/mason/util/workflow.mas"

    push @contents, $m->content;
    push @titles, $title;
  #line 24 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print( '
  ' );
#line 28 "/home/production/cxgn/sgn/mason/util/workflow.mas"
$m->print( '  ' );
;return;
},

}
},
'load_time' => 1763079527,
'methods' => \%_method,

)
;