function parseSrcset(e){function r(e){return" "===e||"\t"===e||"\n"===e||"\f"===e||"\r"===e}function n(r){var n,t=r.exec(e.substring(w));if(t)return n=t[0],w+=n.length,n}function t(){for(n(p),f="",c="in descriptor";;){if(u=e.charAt(w),"in descriptor"===c)if(r(u))f&&(o.push(f),f="",c="after descriptor");else{if(","===u)return w+=1,f&&o.push(f),void i();if("("===u)f+=u,c="in parens";else{if(""===u)return f&&o.push(f),void i();f+=u}}else if("in parens"===c)if(")"===u)f+=u,c="in descriptor";else{if(""===u)return o.push(f),void i();f+=u}else if("after descriptor"===c)if(r(u));else{if(""===u)return void i();c="in descriptor",w-=1}w+=1}}function i(){var r,n,t,i,f,c,u,l,p,d=!1,a={};for(i=0;i<o.length;i++)f=o[i],c=f[f.length-1],u=f.substring(0,f.length-1),l=parseInt(u,10),p=parseFloat(u),g.test(u)&&"w"===c?((r||n)&&(d=!0),0===l?d=!0:r=l):v.test(u)&&"x"===c?((r||n||t)&&(d=!0),p<0?d=!0:n=p):g.test(u)&&"h"===c?((t||n)&&(d=!0),0===l?d=!0:t=l):d=!0;d?window&&window.console&&console.log&&console.log("Invalid srcset descriptor found in '"+e+"' at '"+f+"'."):(a.url=s,r&&(a.w=r),n&&(a.d=n),t&&(a.h=t),$.push(a))}for(var s,o,f,c,u,l=e.length,p=/^[ \t\n\r\u000c]+/,d=/^[, \t\n\r\u000c]+/,a=/^[^ \t\n\r\u000c]+/,h=/[,]+$/,g=/^\d+$/,v=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,w=0,$=[];;){if(n(d),w>=l)return $;s=n(a),o=[],","===s.slice(-1)?(s=s.replace(h,""),i()):t()}}