text: !function(e,n){"function"==typeof define&&define.amd?define([],n):"object"==typeof module&&module.exports?module.exports=n():e.returnExports=n()}("undefined"!=typeof self?self:this,function(){var e=this,n=this.JsonPointer;function r(e,n,r){for(var t=e.toString(),i="",o=t,u=0,f=-1;(f=o.indexOf(n))>-1;)i+=t.substring(u,u+f)+r,o=o.substring(f+n.length,o.length),u+=f+n.length;return o.length>0&&(i+=t.substring(t.length-o.length,t.length)),i}function t(e){if("string"!=typeof e)throw new TypeError("Invalid type: JSON Pointers are represented as strings.");if(0===e.length)return[];if("/"!==e[0])throw new ReferenceError("Invalid JSON Pointer syntax. Non-empty pointer must begin with a solidus `/`.");return function(e){for(var n=-1,t=e.length,i=new Array(t);++n<t;)i[n]=r(r(e[n],"~1","/"),"~0","~");return i}(e.substring(1).split("/"))}function i(e){if(e&&!Array.isArray(e))throw new TypeError("Invalid type: path must be an array of segments.");return 0===e.length?"":"/".concat(function(e){for(var n=-1,t=e.length,i=new Array(t);++n<t;)"string"==typeof e[n]?i[n]=r(r(e[n],"~","~0"),"/","~1"):i[n]=e[n];return i}(e).join("/"))}function o(e){if("string"!=typeof e)throw new TypeError("Invalid type: JSON Pointers are represented as strings.");if(0===e.length||"#"!==e[0])throw new ReferenceError("Invalid JSON Pointer syntax; URI fragment idetifiers must begin with a hash.");if(1===e.length)return[];if("/"!==e[1])throw new ReferenceError("Invalid JSON Pointer syntax.");return function(e){for(var n=-1,t=e.length,i=new Array(t);++n<t;)i[n]=r(r(decodeURIComponent(""+e[n]),"~1","/"),"~0","~");return i}(e.substring(2).split("/"))}function u(e){if(e&&!Array.isArray(e))throw new TypeError("Invalid type: path must be an array of segments.");return 0===e.length?"#":"#/".concat(function(e){for(var n=-1,t=e.length,i=new Array(t);++n<t;)"string"==typeof e[n]?i[n]=encodeURIComponent(r(r(e[n],"~","~0"),"/","~1")):i[n]=e[n];return i}(e).join("/"))}function f(e,n){var r=n.length,t=0;if(1===r&&"-"===n[0])return Array.isArray(e)?e.length:0;if(0===r||r>1&&"0"===n[0]||!isFinite(n))return-1;for(;++t<r;)if(n[t]<"0"||n[t]>"9")return-1;return parseInt(n,10)}function a(e,n,r,t){var i,o,u,a,s,l,c,g;if(0===r.length)throw new Error("Cannot set the root object; assign it directly.");if(void 0===e)throw new TypeError("Cannot set values on undefined");if(i=e,o=r.length,u=r.length-1,a=-1,o)for(;++a<o;)if(s=r[a],Array.isArray(i)){if(l=f(i,s),i.length>l){if(a===u)return c=i[l],i[l]=n,c;i=i[l]}else if(i.length===l){if(a===u)return i.push(n),g;t&&(i=i[l]={})}}else{if(void 0===i[s]){if(t){if(a===u)return i[s]=n,g;if(-1!==f(i[s],r[a+1])){i=i[s]=[];continue}i=i[s]={};continue}return g}if(a===u)return c=i[s],i[s]=n,c;i=i[s]}return i}function s(e){return(n=e)&&n.length&&"#"===n[0]?o:t;var n}function l(e){var n,t,o,f,l=Array.isArray(e)?e.slice(0):e=s(e)(e),c=Array.isArray(e)?i(l):e,g=(f="if (typeof(obj) !== 'undefined'",0===(o=l).length?function(e){return e}:(f=o.reduce(function(e,n,t){return e+" && \n\ttypeof((obj = obj['"+r(o[t],"\\","\\\\")+"'])) !== 'undefined'"},"if (typeof(obj) !== 'undefined'"),f+=") {\n\treturn obj;\n }",new Function(["obj"],f)));Object.defineProperties(this,{get:{enumerable:!0,value:g},set:{enumerable:!0,value:function(e,n,r){return a(e,n,l,r)}},has:{enumerable:!0,value:function(e){return void 0!==g(e)}},path:{enumerable:!0,get:function(){return l.slice(0)}},pointer:{enumerable:!0,get:function(){return n||(n=i(l)),n}},uriFragmentIdentifier:{enumerable:!0,get:function(){return t||(t=u(l)),t}},toString:{enumerable:!0,configurable:!0,writable:!0,value:function(){return c}}})}function c(e){var n="string"==typeof e||Array.isArray(e)?new l(e):e;Object.defineProperties(this,{$ref:{enumerable:!0,value:n.uriFragmentIdentifier},resolve:{enumerable:!0,value:function(e){return n.get(e)}},toString:{enumerable:!0,writable:!0,configurable:!0,value:function(){return n.uriFragmentIdentifier}}})}function g(e,n,r){var t,o,f,a,s,g,h,y,d,p=[],b=0;for(p.push({obj:e,path:[]}),r&&(d=Object.create(null)),n(i([]),e);b<p.length;)if("object"===typeof(y=p[b++]).obj&&null!==y.obj)if(Array.isArray(y.obj))for(a=-1,s=y.obj.length;++a<s;){if(g=y.obj[a],h=y.path.concat(a),"object"==typeof g&&null!==g){if(r&&d[g]){n(i(h),new c(d[g]));continue}p.push({obj:g,path:h}),r&&(d[g]=new l(u(h)))}n(i(h),g)}else for(f=(t=Object.keys(y.obj)).length,o=-1;++o<f;){if(g=y.obj[t[o]],h=y.path.concat(t[o]),"object"==typeof g&&null!==g){if(r&&d[g]){n(i(h),new c(d[g]));continue}p.push({obj:g,path:h}),r&&(d[g]=new l(u(h)))}n(i(h),g)}}return c.isReference=function(e){return e&&e instanceof c||"string"==typeof e.$ref&&"function"==typeof e.resolve},l.create=function(e){return new l(e)},l.has=function(e,n){return function(e,n){var r,t,i,o,u;if(void 0!==e){if(r=e,i=-1,t=n.length)for(;++i<t&&r;)if(o=n[i],Array.isArray(r)){if(isNaN(o)||!isFinite(o))break;if(u=f(r,o),!(r.length>u))break;r=r[u]}else r=r[o];return i===t&&void 0!==r}return!1}(e,s(n)(n))},l.get=function(e,n){return function(e,n){var r,t,i,o,u,a;if(void 0!==e){if(r=e,i=-1,t=n.length)for(;++i<t&&r;)if(o=n[i],Array.isArray(r)){if(isNaN(o)||!isFinite(o))return a;if(u=f(r,o),!(r.length>u))return a;r=r[u]}else r=r[o];return r}return a}(e,s(n)(n))},l.set=function(e,n,r,t){return a(e,r,s(n)(n),t)},l.list=function(e,n){var r=[];return g(e,n?function(e,n){r.push({fragmentId:u(t(e)),value:n})}:function(e,n){r.push({pointer:e,value:n})}),r},l.flatten=function(e,n){var r={};return g(e,n?function(e,n){r[u(t(e))]=n}:function(e,n){r[e]=n}),r},l.map=function(e,n){var r=[];return g(e,n?function(e,n){r.push({key:u(t(e)),value:n})}:r.set.bind(r)),r},l.visit=g,l.decode=function(e){return s(e)(e)},l.decodePointer=t,l.encodePointer=i,l.decodeUriFragmentIdentifier=o,l.encodeUriFragmentIdentifier=u,l.JsonPointer=l,l.JsonReference=c,l.isReference=c.isReference,l.noConflict=function(){return e.JsonPointer=n,l},e.JsonPointer=l,l});