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AAM,OACf,EAAE,KAAK,OAGN,MAAK,SAAS,GACb,IAAI,EAAW,EAGf,SAAS,IACP,OAAO,EAAE,MAAM,KACZ,MAAK,WACJ,IAAI,EAAQ,EAAE,QAYd,OAXmB,MAAb,EACJ,OAAO,IAAI,MAAM,4CAEjB,EAAI,SAAS,WAAW,SAAS,GAAW,SAAS,GAC/C,MAAM,QAAQ,GAChB,EAAM,SAAQ,GAEd,EAAM,QAAQ,IAElB,IAEK,EAAM,OACf,GACJ,CAGA,OAAO,EAAE,SAAQ,SAAS,EAAS,GACjC,IAAK,MAAM,SAAS,IAClB,OAAO,IACJ,MAAK,WACJ,EAAQ,EACV,KACqB,IAAd,EACT,EAAQ,GAER,EAAO,IAAI,MAAM,sBAErB,GACF,IAGC,KAAK,SAAS,GACb,OAAO,QAAQ,OAAO,OAAO,EAAY,SAAU,KAAK,IAAI,KAC3D,MAAK,SAAS,GACb,EAAO,aAAa,CAClB,YAAa,SAAS,EAAK,GACzB,OAAO,QAAQ,KAAK,gBAAgB,EACtC,IAIF,IACI,EAAW,QAAQ,UAAU,QAAQ,GACzC,OAAO,EAAO,KAFH,CAAC,uCAEa,KAAM,EAAU,2BAC3C,GACF,EAAE,KAAK,OAGN,MAAM,SAAS,GACd,EAAK,EACP,EAAE,KAAK,OACN,KAAK,WACJ,GACF,EAAE,KAAK,MACT,CACF","file":"/npm/generator-vca-element@0.1.10/app/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/generator-vca-element@0.1.10/app/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\nvar yeoman = require('yeoman-generator');\nvar chalk = require('chalk');\nvar yosay = require('yosay');\nvar process = require('process');\nvar path = require('path');\nvar nodegit = require('nodegit');\nvar gitlab = require('gitlab');\nvar q = require('q');\nvar fs = require('fs');\nvar git = {\n  ssh: /^git@[A-Za-z.]+$/,\n  https:  /^https:\\/\\/@[A-Za-z.]+$/\n}\n\nmodule.exports = yeoman.generators.Base.extend({\n  initializing: function () {\n    this.pkg = require('../package.json');\n    var date = new Date();\n    this.date = {\n      day: date.getDate(),\n      month: date.getMonth() + 1,\n      year: date.getFullYear()\n    };\n    this._.json = function(object, indent) {\n      var spacing = indent ? this._.repeat(' ', indent) : '';\n      if (object === null) {\n        return 'null';\n      } else if (this._.isArray(object)) {\n        if (object.length === 0) {\n          return '[]';\n        }\n        var string = '[\\n  ';\n        var comma = '';\n        var value;\n        object.forEach(function(element) {\n          string += comma + spacing + this._.json(element, indent + 2);\n          comma = ',\\n  ';\n        }, this);\n        return string + '\\n' + spacing + ']';\n      } else if (this._.isObject(object)) {\n        if (this._.keys(object).length === 0) {\n          return '{}';\n        }\n        var string = '{\\n  ';\n        var comma = '';\n        var value;\n        for (var attr in object) {\n          value = object[attr];\n          attr = attr.match(/[^A-Za-z0-9_-]/) ? this._.quote(attr, '\\'') : attr;\n          string += comma + spacing + attr + ': ' + this._.json(value, indent + 2);\n          comma = ',';\n        }\n        return string + '\\n' + spacing + '}';\n      } else if (this._.isString(object)) {\n        return this._.quote(object, '\\'');\n      } else {\n        return object;\n      }\n    };\n    this._.wordwrap = function wordwrap(str, width, brk, cut) {\n      brk = brk || '\\n';\n      width = width || 120;\n      cut = cut || false;\n      if (!str) {\n        return str;\n      }\n      var regex = '.{1,' + width + '}(\\\\s|$)' + (cut ? '|.{' + width + '}|.+$' : '|\\\\S+?(\\\\s|$)');\n      return str.match(RegExp(regex, 'g')).map(this._.clean).join(brk);\n    }\n    this._.comment = function(comment, indent) {\n      indent = indent ? this._.repeat(' ', indent) : '';\n      return this._.wordwrap(comment, 107 - indent, '\\n' + indent + ' * ');\n    };\n  },\n\n  askFor: function () {\n    var done = this.async();\n\n    // Have Yeoman greet the user.\n    this.log(yosay(\n      'Welcome to the astonishing ' + chalk.red('VCA Element') + ' generator!'\n    ));\n\n    function urlValidate(value) {\n      var pass = true;\n      if (pass) {\n        return true;\n      } else {\n        return 'Please enter a valid URL';\n      }\n    }\n\n    var prompts = [\n      {\n        type: 'input',\n        name: 'name',\n        message: 'What is the name of the element?',\n        required: true,\n        default: path.basename(process.cwd()),\n        validate: function(value) {\n          var pass = value.match(/^vca(-[a-z]+)+$/)\n          if (pass) {\n            return true;\n          } else {\n            return 'Please enter a valid `vca-element-name`';\n          }\n        }\n      },\n      {\n        type: 'input',\n        name: 'description',\n        message: 'Describe the functionality of the element?',\n        required: true,\n        validate: function(value) {\n          if (value) {\n            return true;\n          } else {\n            return 'Please provide a description';\n          }\n        }\n      },\n      {\n        type: 'input',\n        name: 'repo',\n        message: 'What is the base repository of the VCA element?',\n        required: true,\n        default: 'git@dev.vcatechnology.com',\n        store: true,\n        validate: function(value) {\n          var pass = value.match(git.ssh) || value.match(git.https)\n          if (pass) {\n            return true;\n          } else {\n            return 'Please enter a valid base repository location';\n          }\n        },\n        filter: function(value) {\n          return value.toLowerCase();\n        }\n      },\n      {\n        type: 'input',\n        name: 'group',\n        message: 'What is the repository group of the VCA element?',\n        required: true,\n        default: 'web',\n        store: true,\n        validate: function(value) {\n          var pass = value.match(/^[A-Za-z-_]+$/);\n          if (pass) {\n            return true;\n          } else {\n            return 'Please enter a valid group name';\n          }\n        },\n        filter: function(value) {\n          return value.toLowerCase();\n        }\n      },\n      {\n        type: 'input',\n        name: 'baseUrl',\n        message: 'What is the location of the online repository service?',\n        required: true,\n        default: function(answers) {\n          return 'https://dev.vcatechnology.com/gitlab';\n        },\n        store: true,\n        validate: urlValidate,\n        filter: function(value) {\n          return value.toLowerCase();\n        }\n      },\n      {\n        type: 'input',\n        name: 'homepage',\n        message: 'What is the homepage of the element?',\n        required: true,\n        default: function(answers) {\n          return answers.baseUrl + '/' + answers.group + '/' + answers.name;\n        },\n        store: true,\n        validate: urlValidate,\n        filter: function(value) {\n          return value.toLowerCase();\n        }\n      },\n      {\n        type: 'input',\n        name: 'source',\n        message: 'Where is the source of the element located?',\n        required: true,\n        default: function(answers) {\n          return answers.homepage + '/tree/master';\n        },\n        store: true,\n        validate: urlValidate,\n        filter: function(value) {\n          return value.toLowerCase();\n        }\n      },\n      {\n        type: 'input',\n        name: 'issues',\n        message: 'What is the URL to view issues for the element?',\n        required: true,\n        default: function(answers) {\n          return answers.homepage + '/issues';\n        },\n        store: true,\n        validate: urlValidate,\n        filter: function(value) {\n          return value.toLowerCase();\n        }\n      },\n      {\n        type: 'input',\n        name: 'createIssue',\n        message: 'What is the URL to create new issues for the element?',\n        required: true,\n        default: function(answers) {\n          return answers.issues + '/new?issue';\n        },\n        store: true,\n        validate: urlValidate,\n        filter: function(value) {\n          return value.toLowerCase();\n        }\n      },\n      {\n        type: 'confirm',\n        name: 'repoCreate',\n        message: 'Would you like to create the repository?',\n        required: true,\n        default: true\n      },\n      {\n        type: 'input',\n        name: 'apiToken',\n        message: 'What is the API token to use for creating the repository?',\n        required: true,\n        store: true,\n        when: function(answers) {\n          return answers.repoCreate;\n        },\n        validate: function(value) {\n          var pass = value.match(/^[A-Za-z0-9]{20}$/);\n          if (pass) {\n            return true;\n          } else {\n            return 'Please provide a valid API token';\n          }\n        }\n      },\n      {\n        type: 'list',\n        name: 'visibility',\n        message: 'What should the visibility of the project be?',\n        required: true,\n        choices: ['Public', 'Internal', 'Private'],\n        default: 1,\n        when: function(answers) {\n          return answers.repoCreate;\n        },\n        filter: function(value) {\n          return value.toLowerCase();\n        }\n      },\n      {\n        type: 'checkbox',\n        name: 'callbacks',\n        message: 'Which lifecycle callbacks would you like?',\n        required: true,\n        choices: [\n          {\n            name: \"Created\",\n            checked: true\n          },\n          {\n            name: \"Ready\"\n          },\n          {\n            name: \"DOM Ready\"\n          },\n          {\n            name: \"Attached\"\n          },\n          {\n            name: \"Detached\"\n          },\n          {\n            name: \"Attribute Changed\"\n          },\n          {\n            name: \"Cancel Event\"\n          },\n          {\n            name: \"Tracking\"\n          },\n          {\n            name: \"Transistion End\",\n            checked: true\n          },\n        ],\n        filter: function(value) {\n          var object = {};\n          value.forEach(function(choice) {\n            var words = choice.toLowerCase().split(' ');\n            var attr = words[0];\n            words.splice(1).forEach(function(word) {\n              attr += word.charAt(0).toUpperCase() + word.slice(1);\n            });\n            object[attr] = true;\n          });\n          return object;\n        }\n      },\n      {\n        type: 'input',\n        name: 'dependencies',\n        message: 'What dependencies does this element have?',\n        filter: function(value) {\n          return !value ? [] : value.split(' ');\n        },\n        validate: function(value) {\n          var pass = !value || value.split(' ').every(function(dependency) {\n            return dependency.match(/^[A-Za-z-_]+$/);\n          });\n          if (pass) {\n            return true;\n          } else {\n            return 'Please provide a space separated list of attribute names';\n          }\n        }\n      },\n      {\n        type: 'confirm',\n        name: 'resize',\n        message: 'Will the element change it\\'s layout on resize?',\n        required: true,\n        default: false\n      },\n      {\n        type: 'confirm',\n        name: 'style',\n        message: 'Would you like to have custom style colours?',\n        required: true,\n        default: false\n      },\n      {\n        type: 'confirm',\n        name: 'attributes',\n        message: 'Do you want to enter any attributes?',\n        required: true,\n        default: true\n      }\n    ];\n\n    // We need to recursively ask about attributes\n    var attributes = [];\n\n    var attributeQuestions = [\n      {\n        type: 'input',\n        name: 'name',\n        message: function(answers) {\n          var msg = 'What is the attribute name';\n          if (attributes.length) {\n            msg += ' (press enter to finish)'\n          }\n          return msg + '?';\n        },\n        validate: function(value) {\n          var pass = !value || value.match(/^[a-z]+([A-Z][a-z]+)*$/);\n          if (pass) {\n            return true;\n          } else {\n            return 'Please provide a valid camelCase attribute name';\n          }\n        }\n      },\n      {\n        type: 'input',\n        name: 'description',\n        required: true,\n        message: 'What is the attribute description?',\n        when: function(answers) {\n          return answers.name;\n        },\n        validate: function(value) {\n          if (value) {\n            return true;\n          } else {\n            return 'Please provide a description';\n          }\n        }\n      },\n      {\n        type: 'input',\n        name: 'default',\n        required: true,\n        message: 'What is the attribute default value?',\n        when: function(answers) {\n          return answers.name;\n        },\n        validate: function(value) {\n          try {\n            JSON.parse(value);\n            return true;\n          } catch (error) {\n            return 'Please provide a valid JSON representation';\n          }\n        }\n      },\n      {\n        type: 'list',\n        name: 'type',\n        message: 'What is the type of the attribute?',\n        required: true,\n        choices: ['Array', 'Object', 'String', 'Number', 'Boolean'],\n        default: 2,\n        when: function(answers) {\n          return answers.name && (answers.default === 'null');\n        },\n        filter: function(value) {\n          return value.toLowerCase();\n        }\n      },\n      {\n        type: 'confirm',\n        name: 'reflect',\n        required: true,\n        default: false,\n        message: 'Should the attribute be reflected back to the DOM?',\n        when: function(answers) {\n          if (!answers.name) {\n            return false;\n          }\n          var value = JSON.parse(answers.default);\n          return (typeof(value) !== 'object') || (value === null);\n        },\n      },\n      {\n        type: 'confirm',\n        name: 'watch',\n        required: true,\n        default: false,\n        message: 'Do you want a changed callback to be added?',\n        when: function(answers) {\n          return answers.name;\n        },\n      },\n      {\n        type: 'confirm',\n        name: 'priv',\n        required: true,\n        default: false,\n        message: 'Should the attribute be private?',\n        when: function(answers) {\n          return !answers.reflect && answers.name;\n        },\n      }\n    ];\n\n    function finished(answers) {\n      answers.dependencies.push('vca-style');\n      if (answers.resize) {\n        answers.dependencies.push('vca-element-resize');\n        attributes.push({\n          name: 'wide',\n          description: 'Applied when the element has become greater than a certain number of `em`s',\n          type: 'Boolean',\n          default: false,\n          reflect: true,\n          watch: false,\n          priv: false\n        });\n        attributes.push({\n          name: 'dimensions',\n          description: 'Defines the dimension limits of the component in `em`s. If the limits match then the ' +\n            'attribute is applied to the element for styling. When adding a new attribute to the dimensions, make ' +\n            'sure to add it to the published reflected attributes so that it correctly gets applied to the element.',\n          type: 'Object',\n          default: {\n            wide: {\n              width: {\n                min: 40\n              }\n            }\n          },\n          reflect: false,\n          watch: false,\n          priv: true\n        });\n      }\n      attributes = attributes.sort(function(lhs, rhs) {\n        return (lhs > rhs) - (lhs < rhs);\n      });\n      this.component = {\n        name: answers.name,\n        variable: answers.name.split('-').splice(1).join('.'),\n        description: answers.description,\n        resize: answers.resize,\n        style: answers.style,\n        attributes: attributes,\n        callbacks: answers.callbacks,\n        dependencies: answers.dependencies.sort(),\n      }\n      this.component.callbacks.created = this.component.callbacks.created ||\n        this.component.resize ||\n        this.component.attributes.some(function(attr) {\n          return attr.type === 'Object' || attr.type === 'Array';\n        });\n\n      this.git = {\n        repo: answers.repo,\n        api: answers.baseUrl,\n        group: answers.group,\n        create: answers.repoCreate,\n        visibility: answers.visibility,\n        token: answers.apiToken,\n      };\n      if (this.git.repo.match(git.ssh)) {\n        this.git.type = 'ssh';\n        this.git.base = this.git.repo + ':' + this.git.group + '/';\n      } else if (this.git.repo.match(git.https)) {\n        this.git.type = 'https';\n        this.git.base = this.git.repo + '/' + this.git.group + '/';\n      }\n      this.git.url = this.git.base + this.component.name + '.git';\n\n      this.url = {\n        repo: this.git.url,\n        homepage: answers.homepage,\n        source: answers.source,\n        issues: {\n          view: answers.issues,\n          create: answers.createIssue,\n        }\n      };\n\n      done();\n    }\n\n    function attribute(answers) {\n      this.prompt(attributeQuestions, function(attr) {\n        if (attr.name) {\n          attr.default = JSON.parse(attr.default);\n          if (!attr.type) {\n            attr.type = this._.isArray(attr.default) ? 'array' : typeof(attr.default);\n          }\n          attr.type = attr.type.charAt(0).toUpperCase() + attr.type.slice(1);\n          attributes.push(attr);\n          attribute.bind(this)(answers);\n        } else {\n          finished.bind(this)(answers);\n        }\n      }.bind(this));\n    }\n\n    this.prompt(prompts, function (answers) {\n      if (answers.attributes) {\n        attribute.bind(this)(answers);\n      } else {\n        finished.bind(this)(answers);\n      }\n    }.bind(this));\n  },\n\n  files: function() {\n    this.copy('editorconfig', '.editorconfig');\n    this.copy('gitignore', '.gitignore');\n    this.copy('gitattributes', '.gitattributes');\n    this.copy('jshintrc', '.jshintrc');\n    this.copy('_AUTHORS', 'AUTHORS');\n    this.copy('_bower.json', 'bower.json');\n    this.copy('_component.html', this.component.name + '.html');\n    this.copy('_CONTRIBUTE.md', 'CONTRIBUTE.md');\n    this.copy('_demo.css', 'demo.css');\n    this.copy('_demo.html', 'demo.html');\n    this.copy('_gruntfile.js', 'gruntfile.js');\n    this.copy('_karma.conf.js', 'karma.conf.js');\n    this.copy('_LICENSE', 'LICENSE');\n    this.copy('_package.json', 'package.json');\n    this.copy('_README.md', 'README.md');\n    this.copy('_server.js', 'server.js');\n    this.copy('test/_attributes.js', 'test/attributes.js');\n    this.copy('test/_layout.js', 'test/layout.js');\n  },\n\n  install: function () {\n    this.installDependencies({\n      skipInstall: this.options['skip-install']\n    });\n\n    if (this.git.create) {\n      var path = this.destinationPath('.');\n      var repository;\n      var index;\n      var api;\n      var done = this.async();\n\n      // Initalize the repository\n      nodegit.Repository.init(path, 0)\n\n      // Open the index\n      .then(function(repo) {\n        repository = repo;\n        return repository.openIndex();\n      }.bind(this))\n\n      // Read the git index\n      .then(function(idx) {\n        index = idx;\n        return index.read(1);\n      })\n\n      // Add the files\n      .then(function() {\n        return q.all([\n          index.addByPath('.editorconfig'),\n          index.addByPath('.gitignore'),\n          index.addByPath('.gitattributes'),\n          index.addByPath('.jshintrc'),\n          index.addByPath('AUTHORS'),\n          index.addByPath('bower.json'),\n          index.addByPath(this.component.name + '.html'),\n          index.addByPath('CONTRIBUTE.md'),\n          index.addByPath('demo.css'),\n          index.addByPath('demo.html'),\n          index.addByPath('gruntfile.js'),\n          index.addByPath('karma.conf.js'),\n          index.addByPath('LICENSE'),\n          index.addByPath('package.json'),\n          index.addByPath('README.md'),\n          index.addByPath('server.js'),\n          index.addByPath('test/attributes.js'),\n          index.addByPath('test/layout.js'),\n        ]);\n      }.bind(this))\n\n      // Write the index\n      .then(function() {\n        return index.write();\n      }.bind(this))\n      .then(function() {\n        return index.writeTree();\n      })\n\n      // Commit\n      .then(function(oid) {\n        var author = nodegit.Signature.default(repository);\n        var committer = nodegit.Signature.default(repository);\n        return repository.createCommit(\"HEAD\", author, committer, \"Hello, world!\", oid, []);\n      })\n\n      // Set up the API session\n      .then(function(oid) {\n        api = new gitlab({\n          url: this.git.api,\n          token: this.git.token\n        });\n      }.bind(this))\n\n      // Get the group namespace id\n      .then(function() {\n        var defer = q.defer();\n        api.groups.all(function(groups) {\n          if ((groups === null) || !this._.isArray(groups)) {\n            defer.reject(new Error('Failed to retrieve groups from the API'));\n            return;\n          }\n          for (var i = 0, len = groups.length, group = this.git.group; i < len; ++i) {\n            if (groups[i].path === group) {\n              defer.resolve(groups[i].id);\n              return;\n            }\n          }\n          defer.reject(new Error('Failed to find group namespace ID'));\n        }.bind(this));\n        return defer.promise;\n      }.bind(this))\n\n      // Create the project\n      .then(function(namespaceId) {\n        var visibility = 0;\n        if (this.git.visibility === 'public') {\n          visibility = 20;\n        } else if (this.git.visibility === 'internal') {\n          visibility = 10;\n        } else if (this.git.visibility === 'private') {\n          visibility = 0;\n        }\n        var defer = q.defer();\n        api.projects.create(\n          {\n            name: this.component.name,\n            namespace_id: namespaceId,\n            wiki_enabled: 0,\n            visibility_level: visibility,\n            description: this.component.description\n          },\n          function(projects) {\n            if (!isNaN(parseInt(projects.id))) {\n              defer.resolve(projects.id);\n            } else if (projects === true) {\n              defer.resolve(projects);\n            } else {\n              defer.reject(new Error('Failed to create the project'));\n            }\n          }\n        );\n        return defer.promise;\n      }.bind(this))\n\n      // We have to make sure the repository exists in GitLab before we push\n      .then(function(projectId) {\n        var attempts = 0;\n\n        // Query until the repository is created in GitLab\n        function query() {\n          return q.delay(200)\n            .then(function() {\n              var defer = q.defer();\n              if (++attempts === 10) {\n                reject(new Error('Failed to check for repository creation'));\n              } else {\n                api.projects.repository.listTags(projectId, function(tags) {\n                  if (Array.isArray(tags)) {\n                    defer.resolve(true);\n                  } else {\n                    defer.resolve(query());\n                  }\n                });\n              }\n              return defer.promise;\n            });\n        }\n\n        // Do the requests if needed\n        return q.promise(function(resolve, reject) {\n          if (!isNaN(parseInt(projectId))) {\n            return query()\n              .then(function() {\n                resolve(projectId);\n              });\n          } else if (projectId === true) {\n            resolve(projectId);\n          } else {\n            reject(new Error('Invalid project ID'));\n          }\n        });\n      })\n\n      // Add the remote\n      .then(function(projectId) {\n        return nodegit.Remote.create(repository, 'origin', this.git.url)\n        .then(function(remote) {\n          remote.setCallbacks({\n            credentials: function(url, userName) {\n              return nodegit.Cred.sshKeyFromAgent(userName);\n            }\n          });\n\n          // Do the push\n          var refs = ['refs/heads/master:refs/heads/master'];\n          var identity = nodegit.Signature.default(repository);\n          return remote.push(refs, null, identity, 'Pushed element to remote');\n        });\n      }.bind(this))\n\n      // Complete\n      .catch(function(err) {\n        done(err);\n      }.bind(this))\n      .done(function() {\n        done();\n      }.bind(this));\n    }\n  }\n});\n"]}