-
-
Notifications
You must be signed in to change notification settings - Fork 152
/
bundle.js.map
39 lines (39 loc) · 44.6 KB
/
bundle.js.map
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
"version": 3,
"sources": [
"..\\..\\node_modules\\browser-pack\\_prelude.js",
"..\\..\\node_modules\\ono\\lib\\ono.js",
"..\\..\\node_modules\\ono\\node_modules\\format-util\\format.js",
"..\\..\\node_modules\\querystring-es3\\decode.js",
"..\\..\\node_modules\\querystring-es3\\encode.js",
"..\\..\\node_modules\\querystring-es3\\index.js",
"src\\analytics.js",
"src\\dropdowns.js",
"src\\editors.js",
"src\\form.js",
"src\\index.js",
"src\\parser.js",
"src\\querystring.js",
"src\\samples.js"
],
"names": [],
"mappings": ";;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",
"file": "generated.js",
"sourceRoot": "",
"sourcesContent": [
"(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()",
"'use strict';\n\nvar format = require('format-util');\nvar slice = Array.prototype.slice;\nvar protectedProperties = ['name', 'message', 'stack'];\nvar errorPrototypeProperties = [\n 'name', 'message', 'description', 'number', 'code', 'fileName', 'lineNumber', 'columnNumber',\n 'sourceURL', 'line', 'column', 'stack'\n];\n\nmodule.exports = create(Error);\nmodule.exports.error = create(Error);\nmodule.exports.eval = create(EvalError);\nmodule.exports.range = create(RangeError);\nmodule.exports.reference = create(ReferenceError);\nmodule.exports.syntax = create(SyntaxError);\nmodule.exports.type = create(TypeError);\nmodule.exports.uri = create(URIError);\nmodule.exports.formatter = format;\n\n/**\n * Creates a new {@link ono} function that creates the given Error class.\n *\n * @param {Class} Klass - The Error subclass to create\n * @returns {ono}\n */\nfunction create (Klass) {\n /**\n * @param {Error} [err] - The original error, if any\n * @param {object} [props] - An object whose properties will be added to the error object\n * @param {string} [message] - The error message. May contain {@link util#format} placeholders\n * @param {...*} [params] - Parameters that map to the `message` placeholders\n * @returns {Error}\n */\n return function onoFactory (err, props, message, params) { // eslint-disable-line no-unused-vars\n var formatArgs = [];\n var formattedMessage = '';\n\n // Determine which arguments were actually specified\n if (typeof err === 'string') {\n formatArgs = slice.call(arguments);\n err = props = undefined;\n }\n else if (typeof props === 'string') {\n formatArgs = slice.call(arguments, 1);\n props = undefined;\n }\n else if (typeof message === 'string') {\n formatArgs = slice.call(arguments, 2);\n }\n\n // If there are any format arguments, then format the error message\n if (formatArgs.length > 0) {\n formattedMessage = module.exports.formatter.apply(null, formatArgs);\n }\n\n if (err && err.message) {\n // The inner-error's message will be added to the new message\n formattedMessage += (formattedMessage ? ' \\n' : '') + err.message;\n }\n\n // Create the new error\n // NOTE: DON'T move this to a separate function! We don't want to pollute the stack trace\n var newError = new Klass(formattedMessage);\n\n // Extend the new error with the additional properties\n extendError(newError, err); // Copy properties of the original error\n extendToJSON(newError); // Replace the original toJSON method\n extend(newError, props); // Copy custom properties, possibly including a custom toJSON method\n\n return newError;\n };\n}\n\n/**\n * Extends the targetError with the properties of the source error.\n *\n * @param {Error} targetError - The error object to extend\n * @param {?Error} sourceError - The source error object, if any\n */\nfunction extendError (targetError, sourceError) {\n extendStack(targetError, sourceError);\n extend(targetError, sourceError);\n}\n\n/**\n * JavaScript engines differ in how errors are serialized to JSON - especially when it comes\n * to custom error properties and stack traces. So we add our own toJSON method that ALWAYS\n * outputs every property of the error.\n */\nfunction extendToJSON (error) {\n error.toJSON = errorToJSON;\n\n // Also add an inspect() method, for compatibility with Node.js' `util.inspect()` method\n error.inspect = errorToString;\n}\n\n/**\n * Extends the target object with the properties of the source object.\n *\n * @param {object} target - The object to extend\n * @param {?source} source - The object whose properties are copied\n */\nfunction extend (target, source) {\n if (source && typeof source === 'object') {\n var keys = Object.keys(source);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n // Don't copy \"protected\" properties, since they have special meaning/behavior\n // and are set by the onoFactory function\n if (protectedProperties.indexOf(key) >= 0) {\n continue;\n }\n\n try {\n target[key] = source[key];\n }\n catch (e) {\n // This property is read-only, so it can't be copied\n }\n }\n }\n}\n\n/**\n * Custom JSON serializer for Error objects.\n * Returns all built-in error properties, as well as extended properties.\n *\n * @returns {object}\n */\nfunction errorToJSON () {\n var json = {};\n\n // Get all the properties of this error\n var keys = Object.keys(this);\n\n // Also include properties from the Error prototype\n keys = keys.concat(errorPrototypeProperties);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = this[key];\n var type = typeof value;\n if (type !== 'undefined' && type !== 'function') {\n json[key] = value;\n }\n }\n\n return json;\n}\n\n/**\n * Serializes Error objects as human-readable JSON strings for debugging/logging purposes.\n *\n * @returns {string}\n */\nfunction errorToString () {\n return JSON.stringify(this, null, 2).replace(/\\\\n/g, '\\n');\n}\n\n/**\n * Extend the error stack to include its cause\n *\n * @param {Error} targetError\n * @param {Error} sourceError\n */\nfunction extendStack (targetError, sourceError) {\n if (hasLazyStack(targetError)) {\n if (sourceError) {\n lazyJoinStacks(targetError, sourceError);\n }\n else {\n lazyPopStack(targetError);\n }\n }\n else {\n if (sourceError) {\n targetError.stack = joinStacks(targetError.stack, sourceError.stack);\n }\n else {\n targetError.stack = popStack(targetError.stack);\n }\n }\n}\n\n/**\n * Appends the original {@link Error#stack} property to the new Error's stack.\n *\n * @param {string} newStack\n * @param {string} originalStack\n * @returns {string}\n */\nfunction joinStacks (newStack, originalStack) {\n newStack = popStack(newStack);\n\n if (newStack && originalStack) {\n return newStack + '\\n\\n' + originalStack;\n }\n else {\n return newStack || originalStack;\n }\n}\n\n/**\n * Removes Ono from the stack, so that the stack starts at the original error location\n *\n * @param {string} stack\n * @returns {string}\n */\nfunction popStack (stack) {\n if (stack) {\n var lines = stack.split('\\n');\n\n if (lines.length < 2) {\n // The stack only has one line, so there's nothing we can remove\n return stack;\n }\n\n // Find the `onoFactory` call in the stack, and remove it\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n if (line.indexOf('onoFactory') >= 0) {\n lines.splice(i, 1);\n return lines.join('\\n');\n }\n }\n\n // If we get here, then the stack doesn't contain a call to `onoFactory`.\n // This may be due to minification or some optimization of the JS engine.\n // So just return the stack as-is.\n return stack;\n }\n}\n\n/**\n * Does a one-time determination of whether this JavaScript engine\n * supports lazy `Error.stack` properties.\n */\nvar supportsLazyStack = (function () {\n return !!(\n // ES5 property descriptors must be supported\n Object.getOwnPropertyDescriptor && Object.defineProperty &&\n\n // Chrome on Android doesn't support lazy stacks :(\n (typeof navigator === 'undefined' || !/Android/.test(navigator.userAgent))\n );\n}());\n\n/**\n * Does this error have a lazy stack property?\n *\n * @param {Error} err\n * @returns {boolean}\n */\nfunction hasLazyStack (err) {\n if (!supportsLazyStack) {\n return false;\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(err, 'stack');\n if (!descriptor) {\n return false;\n }\n return typeof descriptor.get === 'function';\n}\n\n/**\n * Calls {@link joinStacks} lazily, when the {@link Error#stack} property is accessed.\n *\n * @param {Error} targetError\n * @param {Error} sourceError\n */\nfunction lazyJoinStacks (targetError, sourceError) {\n var targetStack = Object.getOwnPropertyDescriptor(targetError, 'stack');\n\n Object.defineProperty(targetError, 'stack', {\n get: function () {\n return joinStacks(targetStack.get.apply(targetError), sourceError.stack);\n },\n enumerable: false,\n configurable: true\n });\n}\n\n/**\n * Calls {@link popStack} lazily, when the {@link Error#stack} property is accessed.\n *\n * @param {Error} error\n */\nfunction lazyPopStack (error) {\n var targetStack = Object.getOwnPropertyDescriptor(error, 'stack');\n\n Object.defineProperty(error, 'stack', {\n get: function () {\n return popStack(targetStack.get.apply(error));\n },\n enumerable: false,\n configurable: true\n });\n}\n",
"function format(fmt) {\n var re = /(%?)(%([jds]))/g\n , args = Array.prototype.slice.call(arguments, 1);\n if(args.length) {\n fmt = fmt.replace(re, function(match, escaped, ptn, flag) {\n var arg = args.shift();\n switch(flag) {\n case 's':\n arg = '' + arg;\n break;\n case 'd':\n arg = Number(arg);\n break;\n case 'j':\n arg = JSON.stringify(arg);\n break;\n }\n if(!escaped) {\n return arg; \n }\n args.unshift(arg);\n return match;\n })\n }\n\n // arguments remain after formatting\n if(args.length) {\n fmt += ' ' + args.join(' ');\n }\n\n // update escaped %% values\n fmt = fmt.replace(/%{2,2}/g, '%');\n\n return '' + fmt;\n}\n\nmodule.exports = format;\n",
"// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n",
"// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n",
"'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n",
"'use strict';\n\nvar debug = location.hostname === 'localhost';\n\nmodule.exports = analytics;\n\n/**\n * Initializes Google Analytics and sends a \"pageview\" hit\n */\nfunction analytics () {\n if (!debug) {\n ga('create', 'UA-68102273-1', 'auto');\n ga('send', 'pageview');\n }\n}\n\n/**\n * Tracks an event in Google Analytics\n *\n * @param {string} category - the object type (e.g. \"button\", \"menu\", \"link\", etc.)\n * @param {string} action - the action (e.g. \"click\", \"show\", \"hide\", etc.)\n * @param {string} [label] - label for categorization\n * @param {number} [value] - numeric value, such as a counter\n */\nanalytics.trackEvent = function (category, action, label, value) {\n if (debug) {\n console.log('Reporting an event to Google Analytics: ', category, action, label, value);\n }\n else {\n ga('send', 'event', category, action, label, value);\n }\n};\n\n/**\n * Tracks an error in Google Analytics\n *\n * @param {Error} err\n */\nanalytics.trackError = function (err) {\n if (debug) {\n console.error('Reporting an error to Google Analytics: ', err);\n }\n else {\n ga('send', 'exception', { exDescription: err.message });\n }\n};\n",
"'use strict';\n\nvar form = require('./form'),\n analytics = require('./analytics');\n\nmodule.exports = dropdowns;\n\n/**\n * Adds all the drop-down menu functionality\n */\nfunction dropdowns () {\n // Set the initial method name (in case it was set by the querystring module)\n setSelectedMethod(form.method.button.val());\n\n // Update each dropdown's label when its value(s) change\n onChange(form.allow.menu, setAllowLabel);\n onChange(form.refs.menu, setRefsLabel);\n onChange(form.validate.menu, setValidateLabel);\n\n // Track option changes\n trackCheckbox(form.allow.json);\n trackCheckbox(form.allow.yaml);\n trackCheckbox(form.allow.text);\n trackCheckbox(form.allow.empty);\n trackCheckbox(form.allow.unknown);\n trackCheckbox(form.refs.external);\n trackCheckbox(form.refs.circular);\n trackCheckbox(form.validate.schema);\n trackCheckbox(form.validate.spec);\n\n // Change the button text whenever a new method is selected\n form.method.menu.find('a').on('click', function (event) {\n form.method.menu.dropdown('toggle');\n event.stopPropagation();\n var methodName = $(this).data('value');\n setSelectedMethod(methodName);\n trackButtonLabel(methodName);\n });\n}\n\n/**\n * Calls the given function whenever the user selects (or deselects)\n * a value in the given drop-down menu.\n *\n * @param {jQuery} menu\n * @param {function} setLabel\n */\nfunction onChange (menu, setLabel) {\n var dropdown = menu.parent('.dropdown');\n\n // Don't auto-close the menu when items are clicked\n menu.find('a').on('click', function (event) {\n event.stopPropagation();\n });\n\n // Set the label immediately, and again whenever the menu is closed\n setLabel();\n dropdown.on('hidden.bs.dropdown', setLabel);\n\n // Track when a dropdown menu is shown\n dropdown.on('shown.bs.dropdown', function () {\n analytics.trackEvent('options', 'shown', menu.attr('id'));\n });\n}\n\n/**\n * Sets the \"allow\" label, based on which options are selected\n */\nfunction setAllowLabel () {\n var values = getCheckedAndUnchecked(\n form.allow.json, form.allow.yaml, form.allow.text, form.allow.empty, form.allow.unknown);\n\n switch (values.checked.length) {\n case 0:\n form.allow.label.text('No file types allowed');\n break;\n case 1:\n form.allow.label.text('Only allow ' + values.checked[0] + ' files');\n break;\n case 2:\n form.allow.label.text('Only allow ' + values.checked[0] + ' and ' + values.checked[1]);\n break;\n case 3:\n form.allow.label.text('Don\\'t allow ' + values.unchecked[0] + ' or ' + values.unchecked[1]);\n break;\n case 4:\n form.allow.label.text('Don\\'t allow ' + values.unchecked[0] + ' files');\n break;\n case 5:\n form.allow.label.text('Allow all file types');\n }\n}\n\n/**\n * Sets the \"refs\" label, based on which options are selected\n */\nfunction setRefsLabel () {\n var values = getCheckedAndUnchecked(form.refs.external, form.refs.circular);\n\n switch (values.checked.length) {\n case 0:\n form.refs.label.text('Only follow internal $refs');\n break;\n case 1:\n form.refs.label.text('Don\\'t follow ' + values.unchecked[0] + ' $refs');\n break;\n case 2:\n form.refs.label.text('Follow all $refs');\n }\n}\n\n/**\n * Sets the \"validate\" label, based on which options are selected\n */\nfunction setValidateLabel () {\n var values = getCheckedAndUnchecked(form.validate.schema, form.validate.spec);\n\n switch (values.checked.length) {\n case 0:\n form.validate.label.text('Don\\'t validate anything');\n break;\n case 1:\n form.validate.label.text('Don\\'t validate Swagger ' + values.unchecked[0]);\n break;\n case 2:\n form.validate.label.text('Validate everything');\n }\n}\n\n/**\n * Updates the UI to match the specified method name\n *\n * @param {string} methodName - The method name (e.g. \"validate\", \"dereference\", etc.)\n */\nfunction setSelectedMethod (methodName) {\n form.method.button.val(methodName.toLowerCase());\n\n methodName = methodName[0].toUpperCase() + methodName.substr(1);\n form.method.button.text(methodName + ' it!');\n form.tabs.url.text(methodName + ' a URL');\n form.tabs.text.text(methodName + ' Text');\n}\n\n/**\n * Tracks changes to a checkbox option\n *\n * @param {jQuery} checkbox\n */\nfunction trackCheckbox (checkbox) {\n checkbox.on('change', function () {\n var value = checkbox.is(':checked') ? 1 : 0;\n analytics.trackEvent('options', 'changed', checkbox.attr('name'), value);\n });\n}\n\n/**\n * Tracks changes to the \"Validate!\" button\n *\n * @param {string} methodName - The method name (e.g. \"validate\", \"dereference\", etc.)\n */\nfunction trackButtonLabel (methodName) {\n var value = ['', 'parse', 'resolve', 'bundle', 'dereference', 'validate'].indexOf(methodName);\n analytics.trackEvent('options', 'changed', 'method', value);\n}\n\n/**\n * Examines the given checkboxes, and returns arrays of checked and unchecked values.\n *\n * @param {...jQuery} checkboxes\n * @returns {{checked: string[], unchecked: string[]}}\n */\nfunction getCheckedAndUnchecked (checkboxes) {\n var checked = [], unchecked = [];\n for (var i = 0; i < arguments.length; i++) {\n var checkbox = arguments[i];\n if (checkbox.is(':checked')) {\n checked.push(checkbox.data('value'));\n }\n else {\n unchecked.push(checkbox.data('value'));\n }\n }\n return { checked: checked, unchecked: unchecked };\n}\n",
"'use strict';\n\nvar form = require('./form'),\n ono = require('ono'),\n ACE_THEME = 'ace/theme/terminal';\n\nmodule.exports = editors;\n\n/**\n * Initializes the ACE text editors\n */\nfunction editors () {\n editors.textBox = form.textBox = ace.edit('text-box');\n form.textBox.setTheme(ACE_THEME);\n var session = form.textBox.getSession();\n session.setMode('ace/mode/yaml');\n session.setTabSize(2);\n\n editors.results = $('#results');\n editors.tabs = editors.results.find('.nav-tabs');\n editors.panes = editors.results.find('.tab-content');\n}\n\n/**\n * Removes all results tabs and editors\n */\neditors.clearResults = function () {\n editors.results.removeClass('error animated').addClass('hidden');\n editors.tabs.children().remove();\n editors.panes.children().remove();\n};\n\n/**\n * Displays a successful result\n *\n * @param {string} title - The title of the tab\n * @param {object|string} content - An object that will be displayed as JSON in the editor\n */\neditors.showResult = function (title, content) {\n editors.results.removeClass('hidden');\n editors.addResult(title || 'Sample API', content);\n showResults();\n};\n\n/**\n * Displays an error result\n *\n * @param {Error} err\n */\neditors.showError = function (err) {\n editors.results.removeClass('hidden').addClass('error');\n editors.addResult('Error!', err);\n showResults();\n};\n\n/**\n * Adds a results tab with an Ace Editor containing the given content\n *\n * @param {string} title - The title of the tab\n * @param {object|string} content - An object that will be displayed as JSON in the editor\n */\neditors.addResult = function (title, content) {\n var index = editors.tabs.children().length;\n var titleId = 'results-tab-' + index + '-title';\n var editorId = 'results-' + index;\n var active = index === 0 ? 'active' : '';\n\n // Add a tab and pane\n editors.tabs.append(\n '<li id=\"results-tab-' + index + '\" class=\"' + active + '\" role=\"presentation\">' +\n ' <a id=\"' + titleId + '\" href=\"#results-pane-' + index + '\" role=\"tab\" aria-controls=\"results-pane-' + index + '\" data-toggle=\"tab\"></a>' +\n '</li>'\n );\n editors.panes.append(\n '<div id=\"results-pane-' + index + '\" class=\"tab-pane ' + active + '\" role=\"tabpanel\">' +\n ' <pre id=\"' + editorId + '\" class=\"editor\"></pre>' +\n '</div>'\n );\n\n // Set the tab title\n var shortTitle = getShortTitle(title);\n editors.tabs.find('#' + titleId).text(shortTitle).attr('title', title);\n\n // Set the <pre> content\n content = toText(content);\n editors.panes.find('#' + editorId).text(content.text);\n\n // Turn the <pre> into an Ace Editor\n var editor = ace.edit(editorId);\n editor.setTheme(ACE_THEME);\n editor.session.setOption('useWorker', false);\n content.isJSON && editor.getSession().setMode('ace/mode/json');\n editor.setReadOnly(true);\n};\n\n/**\n * Returns a short version of the given title text, to better fit in a tab\n *\n * @param {string} title\n * @returns {string}\n */\nfunction getShortTitle (title) {\n // Get just the file name\n var lastSlash = title.lastIndexOf('/');\n if (lastSlash !== -1) {\n title = title.substr(lastSlash + 1);\n }\n\n if (title.length > 15) {\n // It's still too long, so, just return the first 10 characters\n title = title.substr(0, 10) + '...';\n }\n\n return title;\n}\n\n/**\n * Ensures that the results are visible, and plays an animation to get the user's attention.\n */\nfunction showResults () {\n var results = editors.results;\n\n setTimeout(function () {\n results[0].scrollIntoView();\n results.addClass('animated')\n .one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {\n // Remove the \"animated\" class when the animation ends,\n // so we can replay the animation again next time\n results.removeClass('animated');\n });\n });\n}\n\n/**\n * Converts the given object to text.\n * If possible, it is converted to JSON; otherwise, plain text.\n *\n * @param {object} obj\n * @returns {object}\n */\nfunction toText (obj) {\n if (obj instanceof Error) {\n return {\n isJSON: false,\n text: obj.message + '\\n\\n' + obj.stack\n };\n }\n else {\n try {\n return {\n isJSON: true,\n text: JSON.stringify(obj, null, 2)\n };\n }\n catch (e) {\n return {\n isJSON: false,\n text: 'This API is valid, but it cannot be shown because it contains circular references\\n\\n' + e.stack\n };\n }\n }\n}\n",
"'use strict';\n\nmodule.exports = form;\n\n/**\n * Finds all form fields and exposes them as properties.\n */\nfunction form () {\n form.form = $('#swagger-parser-form');\n\n form.allow = {\n label: form.form.find('#allow-label'),\n menu: form.form.find('#allow-menu'),\n json: form.form.find('input[name=allow-json]'),\n yaml: form.form.find('input[name=allow-yaml]'),\n text: form.form.find('input[name=allow-text]'),\n empty: form.form.find('input[name=allow-empty]'),\n unknown: form.form.find('input[name=allow-unknown]')\n };\n\n form.refs = {\n label: form.form.find('#refs-label'),\n menu: form.form.find('#refs-menu'),\n external: form.form.find('input[name=refs-external]'),\n circular: form.form.find('input[name=refs-circular]')\n };\n\n form.validate = {\n label: form.form.find('#validate-label'),\n menu: form.form.find('#validate-menu'),\n schema: form.form.find('input[name=validate-schema]'),\n spec: form.form.find('input[name=validate-spec]')\n };\n\n form.tabs = {\n url: form.form.find('#url-tab'),\n text: form.form.find('#text-tab')\n };\n\n form.method = {\n button: form.form.find('button[name=method]'),\n menu: form.form.find('#method-menu')\n };\n\n form.samples = {\n url: {\n container: form.form.find('#url-sample'),\n link: form.form.find('#url-sample-link'),\n },\n text: {\n container: form.form.find('#text-sample'),\n link: form.form.find('#text-sample-link'),\n }\n };\n\n form.url = form.form.find('input[name=url]');\n form.textBox = null; // This is set in editors.js\n form.bookmark = form.form.find('#bookmark');\n}\n\n/**\n * Returns a Swagger Parser options object,\n * set to the current values of all the form fields.\n */\nform.getOptions = function () {\n return {\n parse: {\n json: form.allow.json.is(':checked') ? {\n allowEmpty: form.allow.empty.is(':checked'),\n } : false,\n yaml: form.allow.yaml.is(':checked') ? {\n allowEmpty: form.allow.empty.is(':checked'),\n } : false,\n text: form.allow.text.is(':checked') ? {\n allowEmpty: form.allow.empty.is(':checked'),\n } : false,\n binary: form.allow.unknown.is(':checked') ? {\n allowEmpty: form.allow.empty.is(':checked'),\n } : false,\n },\n resolve: {\n external: form.refs.external.is(':checked'),\n },\n dereference: {\n circular: form.refs.circular.is(':checked'),\n },\n validate: {\n schema: form.validate.schema.is(':checked'),\n spec: form.validate.spec.is(':checked'),\n },\n };\n};\n\n/**\n * Returns the Swagger API or URL, depending on the current form fields.\n */\nform.getAPI = function () {\n // Determine which tab is selected\n if (form.tabs.url.parent().attr('class').indexOf('active') >= 0) {\n var url = form.url.val();\n if (url) {\n return url;\n }\n else {\n throw new URIError('Please specify the URL of your Swagger/OpenAPI definition');\n }\n }\n else {\n var text = form.textBox.getValue();\n if (form.allow.yaml.is(':checked')) {\n return SwaggerParser.YAML.parse(text);\n }\n else if (form.allow.json.is(':checked')) {\n return JSON.parse(text);\n }\n else {\n throw new SyntaxError('Unable to parse the API. Neither YAML nor JSON are allowed.');\n }\n }\n};\n",
"'use strict';\n\nvar form = require('./form'),\n querystring = require('./querystring'),\n dropdowns = require('./dropdowns'),\n editors = require('./editors'),\n samples = require('./samples'),\n parser = require('./parser'),\n analytics = require('./analytics');\n\n$(function () {\n form();\n querystring();\n dropdowns();\n editors();\n samples();\n parser();\n analytics();\n});\n",
"'use strict';\n\nvar form = require('./form'),\n editors = require('./editors'),\n analytics = require('./analytics'),\n ono = require('ono'),\n swaggerParser = null,\n counters = { parse: 0, resolve: 0, bundle: 0, dereference: 0, validate: 0 };\n\nmodule.exports = parser;\n\n/**\n * Adds event handlers to trigger Swagger Parser methods\n */\nfunction parser () {\n // When the form is submitted, parse the Swagger API\n form.form.on('submit', function (event) {\n event.preventDefault();\n parseSwagger();\n });\n\n // When the \"x\" button is clicked, discard the results\n $('#clear').on('click', function () {\n swaggerParser = null;\n editors.clearResults();\n analytics.trackEvent('results', 'clear');\n });\n}\n\n/**\n * This function is called when the \"Validate it!\" button is clicked.\n * It calls Swagger Parser, passing it all the options selected on the form.\n */\nfunction parseSwagger () {\n try {\n // Clear any previous results\n editors.clearResults();\n\n // Get all the parameters\n swaggerParser = swaggerParser || new SwaggerParser();\n var options = form.getOptions();\n var method = form.method.button.val();\n var api = form.getAPI();\n\n // Call Swagger Parser\n swaggerParser[method](api, options)\n .then(function () {\n // Show the results\n var results = swaggerParser.$refs.values();\n Object.keys(results).forEach(function (key) {\n editors.showResult(key, results[key]);\n });\n })\n .catch(function (err) {\n editors.showError(ono(err));\n analytics.trackError(err);\n });\n\n // Track the operation\n counters[method]++;\n analytics.trackEvent('button', 'click', method, counters[method]);\n }\n catch (err) {\n editors.showError(ono(err));\n analytics.trackError(err);\n }\n}\n",
"'use strict';\n\nvar qs = require('querystring'),\n form = require('./form');\n\nmodule.exports = querystring;\n\n/**\n * Initializes the UI, based on the query-string in the URL\n */\nfunction querystring () {\n setFormFields();\n setBookmarkURL();\n form.bookmark.on('click focus mouseenter', setBookmarkURL);\n}\n\n/**\n * Populates all form fields based on the query-string in the URL\n */\nfunction setFormFields () {\n var query = qs.parse(window.location.search.substr(1));\n\n setCheckbox(form.allow.json, query['allow-json']);\n setCheckbox(form.allow.yaml, query['allow-yaml']);\n setCheckbox(form.allow.text, query['allow-text']);\n setCheckbox(form.allow.empty, query['allow-empty']);\n setCheckbox(form.allow.unknown, query['allow-unknown']);\n setCheckbox(form.refs.external, query['refs-external']);\n setCheckbox(form.refs.circular, query['refs-circular']);\n setCheckbox(form.validate.schema, query['validate-schema']);\n setCheckbox(form.validate.spec, query['validate-spec']);\n\n // If a custom URL is specified, then show the \"Your API\" tab\n if (query.url) {\n form.url.val(query.url);\n }\n\n // If a method is specified, then change the \"Validate!\" button\n if (query.method) {\n query.method = query.method.toLowerCase();\n if (['parse', 'resolve', 'bundle', 'dereference', 'validate'].indexOf(query.method) !== -1) {\n form.method.button.val(query.method);\n }\n }\n}\n\n/**\n * Checks or unchecks the given checkbox, based on the given value.\n *\n * @param {jQuery} input\n * @param {*} value\n */\nfunction setCheckbox (input, value) {\n if (!value || value === 'true' || value === 'on') {\n value = 'yes';\n }\n input.val([value]);\n}\n\n/**\n * Sets the href of the bookmark link, based on the values of each form field\n */\nfunction setBookmarkURL () {\n var query = {};\n var options = form.getOptions();\n options.parse.json || (query['allow-json'] = 'no');\n options.parse.yaml || (query['allow-yaml'] = 'no');\n options.parse.text || (query['allow-text'] = 'no');\n options.parse.json.allowEmpty || (query['allow-empty'] = 'no');\n options.parse.binary || (query['allow-unknown'] = 'no');\n options.resolve.external || (query['refs-external'] = 'no');\n options.dereference.circular || (query['refs-circular'] = 'no');\n options.validate.schema || (query['validate-schema'] = 'no');\n options.validate.spec || (query['validate-spec'] = 'no');\n\n var method = form.method.button.val();\n method === 'validate' || (query.method = method);\n\n var url = form.url.val();\n url === '' || (query.url = url);\n\n var bookmark = '?' + qs.stringify(query);\n form.bookmark.attr('href', bookmark);\n}\n",
"'use strict';\n\nvar form = require('./form');\n\nmodule.exports = samples;\n\n/**\n * Allows the user to use a sample URL or sample API text\n */\nfunction samples () {\n form.samples.url.link.on('click', function (event) {\n event.preventDefault();\n form.url.val(samples.url);\n });\n\n form.samples.text.link.on('click', function (event) {\n event.preventDefault();\n form.textBox.setValue(samples.text, -1);\n form.samples.text.container.hide();\n form.textBox.focus();\n });\n\n form.textBox.on('input', function () {\n if (form.textBox.session.getValue().length === 0) {\n form.samples.text.container.show();\n }\n else {\n form.samples.text.container.hide();\n }\n });\n}\n\nsamples.url = 'https://bigstickcarpet.com/swagger-parser/www/swagger.yaml';\n\nsamples.text =\n 'swagger: \"2.0\"\\n' +\n 'info:\\n' +\n ' version: 1.0.0\\n' +\n ' title: Swagger Petstore\\n' +\n ' description: >\\n' +\n ' A sample API that uses a petstore as an example\\n' +\n ' to demonstrate features in the swagger-2.0 specification\\n' +\n 'consumes:\\n' +\n ' - application/json\\n' +\n 'produces:\\n' +\n ' - application/json\\n' +\n 'paths:\\n' +\n ' /pets:\\n' +\n ' get:\\n' +\n ' description: Returns all pets from the petstore\\n' +\n ' responses:\\n' +\n ' \"200\":\\n' +\n ' description: pet response\\n' +\n ' schema:\\n' +\n ' type: array\\n' +\n ' items:\\n' +\n ' $ref: \"#/definitions/pet\"\\n' +\n ' default:\\n' +\n ' description: unexpected error\\n' +\n ' schema:\\n' +\n ' $ref: \"#/definitions/errorModel\"\\n' +\n ' post:\\n' +\n ' description: Creates a new pet in the store\\n' +\n ' parameters:\\n' +\n ' - name: pet\\n' +\n ' in: body\\n' +\n ' description: Pet to add to the store\\n' +\n ' required: true\\n' +\n ' schema:\\n' +\n ' $ref: \"#/definitions/pet\"\\n' +\n ' responses:\\n' +\n ' \"200\":\\n' +\n ' description: pet response\\n' +\n ' schema:\\n' +\n ' $ref: \"#/definitions/pet\"\\n' +\n ' default:\\n' +\n ' description: unexpected error\\n' +\n ' schema:\\n' +\n ' $ref: \"#/definitions/errorModel\"\\n' +\n ' \"/pets/{name}\":\\n' +\n ' get:\\n' +\n ' description: Returns a single pet by name\\n' +\n ' parameters:\\n' +\n ' - name: name\\n' +\n ' in: path\\n' +\n ' description: Name of the pet to fetch\\n' +\n ' required: true\\n' +\n ' type: string\\n' +\n ' responses:\\n' +\n ' \"200\":\\n' +\n ' description: pet response\\n' +\n ' schema:\\n' +\n ' $ref: \"#/definitions/pet\"\\n' +\n ' default:\\n' +\n ' description: unexpected error\\n' +\n ' schema:\\n' +\n ' $ref: \"#/definitions/errorModel\"\\n' +\n 'definitions:\\n' +\n ' pet:\\n' +\n ' $ref: pet.yaml\\n' +\n ' pet-owner:\\n' +\n ' $ref: pet-owner.yaml\\n' +\n ' errorModel:\\n' +\n ' $ref: error.json\\n';\n"
]
}