// Code generated by go-bindata.
// sources:
// templates/index.html
// DO NOT EDIT!

package polygen

import (
	"bytes"
	"compress/gzip"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"time"
)

func bindataRead(data []byte, name string) ([]byte, error) {
	gz, err := gzip.NewReader(bytes.NewBuffer(data))
	if err != nil {
		return nil, fmt.Errorf("Read %q: %v", name, err)
	}

	var buf bytes.Buffer
	_, err = io.Copy(&buf, gz)
	clErr := gz.Close()

	if err != nil {
		return nil, fmt.Errorf("Read %q: %v", name, err)
	}
	if clErr != nil {
		return nil, err
	}

	return buf.Bytes(), nil
}

type asset struct {
	bytes []byte
	info  os.FileInfo
}

type bindataFileInfo struct {
	name    string
	size    int64
	mode    os.FileMode
	modTime time.Time
}

func (fi bindataFileInfo) Name() string {
	return fi.name
}
func (fi bindataFileInfo) Size() int64 {
	return fi.size
}
func (fi bindataFileInfo) Mode() os.FileMode {
	return fi.mode
}
func (fi bindataFileInfo) ModTime() time.Time {
	return fi.modTime
}
func (fi bindataFileInfo) IsDir() bool {
	return false
}
func (fi bindataFileInfo) Sys() interface{} {
	return nil
}

var _templatesIndexHtml = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x9c\x55\x5d\x6f\xb3\x36\x14\xbe\xe7\x57\x9c\xd7\xaa\x14\x92\x05\x93\xbc\xef\x3e\x3a\x15\x32\x55\x6d\x37\xed\xaa\xbd\xe8\xa4\x4d\xd3\x34\x39\x70\x02\x8e\x8c\x4d\x6d\x93\x34\x9a\xfa\xdf\x77\x80\xb0\xb0\xb5\x17\x13\x5c\x04\xfb\xf8\x79\x9e\xf3\x91\xe3\x43\xf2\xe9\xfe\xf1\xee\xf9\xb7\xa7\x07\x28\x7d\xa5\x36\x41\xd2\xbe\x40\x09\x5d\xa4\x0c\x35\x6b\x0d\x28\xf2\x4d\x00\xf4\x24\x15\x7a\x01\x59\x29\xac\x43\x9f\xb2\xc6\xef\xa2\x6b\x36\x3e\x2a\xbd\xaf\x23\x7c\x69\xe4\x21\x65\xbf\x46\xbf\xdc\x46\x77\xa6\xaa\x85\x97\x5b\x85\x0c\x32\xa3\x3d\x6a\xe2\xfd\xfc\x90\x62\x5e\xe0\xbf\x98\x5a\x54\x98\xb2\x83\xc4\x63\x6d\xac\x1f\x81\x8f\x32\xf7\x65\x9a\xe3\x41\x66\x18\x75\x9b\x25\x48\x2d\xbd\x14\x2a\x72\x99\x50\x98\xae\x07\xa1\x4f\x51\x04\xcf\x25\x82\xd8\x9a\x03\xc2\x17\xe8\x84\xbd\x28\x1c\x2c\xaa\xc6\xf9\x05\x89\x56\x08\x3b\x69\x9d\x27\x09\xf0\x04\x6d\x73\xbb\x01\xa1\x4f\x60\x68\x6b\xbb\xfd\xe0\x1b\x5a\x52\xcf\x59\x88\x9d\x47\xbb\x68\x29\x0e\x7b\xc9\x28\x7a\x1f\x7e\x8e\x2e\xb3\xb2\xf6\xd2\xe8\x51\x06\x4f\x46\x9d\x0a\xd4\xd0\x38\x74\x20\x80\x96\xe8\x65\x06\x42\x15\xc6\x4a\x5f\x56\xe0\x0d\x88\xba\xb6\xe6\x55\x56\xc2\x53\xf8\x1a\x68\x51\x20\x1c\xe9\x94\x08\xae\x12\x4a\x81\x6e\xaa\x2d\x05\x68\x76\x50\xb7\x7a\x46\x3b\xfe\x41\x01\x45\xe3\x4b\x63\x47\xce\x7f\x42\x63\x49\xea\xd6\x56\xa5\x51\xf9\xc0\xe8\xc3\x04\x67\xb3\x94\xc5\xb1\xd8\x8b\x57\x5e\x18\x53\x28\x14\xb5\x74\x9c\x52\xee\x6c\xb1\x92\x5b\x17\xef\x5f\x1a\xb4\xa7\x78\xcd\xd7\x6b\xfe\xf9\xbc\xe3\x95\xd4\x7c\xef\xd8\x26\x89\x7b\xa9\xb3\xae\x97\x5e\xe1\xe6\x9c\x70\x12\xf7\xdb\x20\x89\xfb\x16\x0a\x92\xad\xc9\x4f\xed\xbb\x5c\x5f\x40\xb4\x0e\xc8\x24\xab\x02\x64\x9e\x32\x8b\xbb\x3f\xbb\xf4\xd9\x39\x3c\x32\xb0\xcd\x19\x90\x29\xe1\x5c\xca\x6a\x8b\x6d\xa7\x10\xae\x18\x50\x1d\x25\x5e\xfd\x90\x89\xac\xc4\x2d\xfd\x71\xe9\x8f\x8f\x8f\x6d\xf7\xfe\x1f\xda\x7a\x1a\xed\xf3\x34\xda\x97\x69\xb4\xaf\xa7\xd1\xbe\x99\x46\xfb\x76\x1a\xed\xbb\x69\xb4\xeb\x69\xb4\xef\xdf\xd1\x82\xa1\xb5\xfd\xa9\x6e\xaf\x43\x5d\x2b\x99\x89\xf6\x42\xc6\x7b\x71\x10\xfd\xe1\xf9\x16\xec\x1a\x9d\xb5\x27\x90\x1b\x6a\x46\x15\xce\xff\xea\xcc\xed\x73\x10\x16\x72\x48\x41\xe3\x11\xee\xe9\x4e\x86\x73\x5e\xa0\x7f\x96\x15\xad\x6e\x82\x7f\x60\x57\xe1\x8c\x62\xfa\xfd\x83\x30\xff\x98\xcd\x39\x52\x6c\xe1\xe0\x24\x94\x3a\xc7\xd7\xa5\xf4\x58\x8d\xfc\x0c\xbe\x28\x29\xf2\x76\x15\x76\xc7\x5c\x78\x6f\xc3\x19\xd9\x66\xe4\x6c\x0c\xed\x61\xf4\xcb\x2d\xd6\x4a\x64\x18\xc6\x97\x02\xf0\xc5\x55\x5c\xc8\x25\xb0\x8b\x89\xc1\x57\x90\xff\x47\xe3\xbd\x93\x65\xab\x38\x42\xbd\x8d\x53\x74\x7d\xda\xa6\xf1\x61\x5f\xa6\x25\xac\x57\xab\xd5\x08\x4e\xa3\xc6\x19\x85\x5c\x99\x22\x64\x4d\x9d\x53\xb9\xf2\x7e\x80\x71\xce\xd9\xbc\xc3\xbd\xf5\x82\x43\xa1\x6f\x82\xcb\xdc\x48\xe2\x7e\x28\xd0\x20\xe8\xbe\x3f\x7f\x07\x00\x00\xff\xff\xc7\xbf\x2b\x59\x90\x06\x00\x00")

func templatesIndexHtmlBytes() ([]byte, error) {
	return bindataRead(
		_templatesIndexHtml,
		"templates/index.html",
	)
}

func templatesIndexHtml() (*asset, error) {
	bytes, err := templatesIndexHtmlBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "templates/index.html", size: 1680, mode: os.FileMode(420), modTime: time.Unix(1460808963, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func Asset(name string) ([]byte, error) {
	cannonicalName := strings.Replace(name, "\\", "/", -1)
	if f, ok := _bindata[cannonicalName]; ok {
		a, err := f()
		if err != nil {
			return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
		}
		return a.bytes, nil
	}
	return nil, fmt.Errorf("Asset %s not found", name)
}

// MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables.
func MustAsset(name string) []byte {
	a, err := Asset(name)
	if err != nil {
		panic("asset: Asset(" + name + "): " + err.Error())
	}

	return a
}

// AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) {
	cannonicalName := strings.Replace(name, "\\", "/", -1)
	if f, ok := _bindata[cannonicalName]; ok {
		a, err := f()
		if err != nil {
			return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
		}
		return a.info, nil
	}
	return nil, fmt.Errorf("AssetInfo %s not found", name)
}

// AssetNames returns the names of the assets.
func AssetNames() []string {
	names := make([]string, 0, len(_bindata))
	for name := range _bindata {
		names = append(names, name)
	}
	return names
}

// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
	"templates/index.html": templatesIndexHtml,
}

// AssetDir returns the file names below a certain
// directory embedded in the file by go-bindata.
// For example if you run go-bindata on data/... and data contains the
// following hierarchy:
//     data/
//       foo.txt
//       img/
//         a.png
//         b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) {
	node := _bintree
	if len(name) != 0 {
		cannonicalName := strings.Replace(name, "\\", "/", -1)
		pathList := strings.Split(cannonicalName, "/")
		for _, p := range pathList {
			node = node.Children[p]
			if node == nil {
				return nil, fmt.Errorf("Asset %s not found", name)
			}
		}
	}
	if node.Func != nil {
		return nil, fmt.Errorf("Asset %s not found", name)
	}
	rv := make([]string, 0, len(node.Children))
	for childName := range node.Children {
		rv = append(rv, childName)
	}
	return rv, nil
}

type bintree struct {
	Func     func() (*asset, error)
	Children map[string]*bintree
}

var _bintree = &bintree{nil, map[string]*bintree{
	"templates": &bintree{nil, map[string]*bintree{
		"index.html": &bintree{templatesIndexHtml, map[string]*bintree{}},
	}},
}}

// RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error {
	data, err := Asset(name)
	if err != nil {
		return err
	}
	info, err := AssetInfo(name)
	if err != nil {
		return err
	}
	err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
	if err != nil {
		return err
	}
	err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
	if err != nil {
		return err
	}
	err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
	if err != nil {
		return err
	}
	return nil
}

// RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error {
	children, err := AssetDir(name)
	// File
	if err != nil {
		return RestoreAsset(dir, name)
	}
	// Dir
	for _, child := range children {
		err = RestoreAssets(dir, filepath.Join(name, child))
		if err != nil {
			return err
		}
	}
	return nil
}

func _filePath(dir, name string) string {
	cannonicalName := strings.Replace(name, "\\", "/", -1)
	return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}
