<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../xsltforms/xsltforms.xsl"?><?xml-model href="http://www.oxygenxml.com/1999/xhtml/xhtml-xforms.nvdl" schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" jap="" xml:lang="en-GB">

<meta:meta xmlns:meta="http://www.xsmiles.org/2002/metadata" name="XForms Main UI" description="Main UI for JAP"></meta:meta>

<head>
        <title id="title-empty">Portal</title>
        <link type="text/css" rel="stylesheet" href="resources/css/default/colors.css" />
        <link type="text/css" rel="stylesheet" href="resources/css/default/values.css" />
        <link type="text/css" rel="stylesheet" href="resources/css/default/ui.css" />
        <link type="text/css" rel="stylesheet" href="resources/css/default/login.css" />
        <link type="text/css" rel="stylesheet" href="resources/css/ineos/values.css" />
        <link type="text/css" rel="stylesheet" href="resources/css/ineos/ui.css" />
        <link type="text/css" rel="stylesheet" href="resources/css/ineos/login.css" />
        <link rel="icon" href="resources/assets/images/IneosSiteLogo.svg" />
        <script type="application/javascript" src="./resources/js/jquery-3.6.1.js"></script>
        <script type="application/javascript" src="./resources/js/main.js"></script>
        <script type="application/javascript" src="./resources/js/xforms-util.js"></script>
        <script type="application/javascript" src="./resources/js/login.js"></script>

  <!-- Customer-specific title added by UI config file -->
  

  <xf:model id="main">
    <!-- translation strings to be used in XSLTForms -->
    <xf:instance id="strings">
      <data xmlns="">
        <login-success id="login-success">Redirecting...</login-success>
        <login-failed id="login-failed">Wrong username/password</login-failed>
      </data>
    </xf:instance>
    <!-- login form data -->
    <xf:instance id="login-form">
      <data xmlns="">
        <username></username>
        <password></password>
        <result></result>
        <saml-redirect></saml-redirect>
      </data>
    </xf:instance>

    <xf:instance id="login-response">
      <data xmlns="">
        <error></error>
        <logged>false</logged>
      </data>
    </xf:instance>

    <xf:load resource="javascript:formReady()" ev:event="xforms-ready"></xf:load>
    <xf:load resource="javascript:initLogin()" ev:event="xforms-ready"></xf:load>
  </xf:model>
</head>


<body>
  <div id="app-body">
    <img id="mainLogo" src="resources/assets/images/Ineos-Automotive-logo.png" />
    <h2 id="login-title">Login</h2>
    <div class="form">
      <xf:group ref=".[not(instance('login-form')/saml-redirect = '')]">
        <div class="actions">
          <a href="{instance('login-form')/saml-redirect}" class="button">
            <span id="login-sso">Sign in with SSO</span>
          </a>
          <div class="separator">
            <span id="login-or">Or</span>
          </div>
        </div>
      </xf:group>
      <xf:input ref="instance('login-form')/username">
        <xf:label id="login-username">Username</xf:label>
      </xf:input>
      <xf:secret ref="instance('login-form')/password">
        <xf:label id="login-password">Password</xf:label>
      </xf:secret>
      <xf:group ref=".[instance('login-form')/result = 'error']">
        <div class="message error">
          <xf:output value="instance('strings')/login-failed"></xf:output>
        </div>
      </xf:group>
      <xf:group ref=".[instance('login-form')/result = 'success']">
        <div class="message success">
          <xf:output value="instance('strings')/login-success"></xf:output>
        </div>
      </xf:group>
      <div class="actions last">
        <xf:trigger>
          <xf:label id="login-title">Login</xf:label>
          <xf:load resource="javascript:login()" ev:event="DOMActivate"></xf:load>
        </xf:trigger>
      </div>
    </div>
  </div>

</body>


</html>