/*! Group - v1.1.0 - 2013-10-29 * https://github.com/rbarros/group.js * Copyright (c) 2013 Ramon Barros; Licensed MIT */ !function(a,b){"use strict";var c=function(a,c){return this.version="1.0",this.groups=[],this.divide=c||!1,a===b?this:(this.string=a.toString(),this.setGroup(this.string),this.groups)};c.prototype.setGroup=function(a){var c,d,e;for(c=0;a.length>c;c+=1)e=a[c],e!==b&&(d=this.arrHasDupes(e),d===!1&&this.groups.push({caracter:e,position:this.checkIndex(e)}));this.checkGroups()},c.prototype.arrHasDupes=function(a){var b;for(b=0;this.groups.length>b;b+=1)if(this.groups[b].caracter===a)return!0;return!1},c.prototype.checkIndex=function(a){for(var b=[],c=0;c<=this.string.length-1;)a===this.string[c]&&-1!==this.string[c].indexOf(a)&&b.push(c),c+=1;return b},c.prototype.checkGroups=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m=[],n=[],o=[],p=[],q=this.groups;for(a=0;a1&&o.push(q[a].position);if(n=n.join(",").split(",").sort(),o=o.join(",").split(",").sort(),(0===n.length||""===n[0])&&q.length>1){for(o.reverse(),l="",g=0,e=0,d=0,a=0;ae&&(e=Math.floor(this.string.length/d)),0===l.length%e&&(m[g]?m[g]+=l.split("").reverse().join(""):m[g]=l.split("").reverse().join(""),l="",this.divide===!0&&(g+=1)),k=!1)}for(d=0,l="",a=0;a0&&""!==n[0]){for(a=0;d>a;a+=1)if(parseInt(n[a],10)===parseInt(b,10))b+=1;else if(parseInt(n[a],10)!==parseInt(b,10))for(n.push(String(a)),n.sort(),c=0;c