<commit_before>// domoCarton.js 0.0.1

// (c) 2013 <NAME>
// cartonFactory.js is distributed under the MIT license.
// For more details, see http://cssCarton.com
 
 ! function  () {
   
    // Determine the global object.
    
    var global = Function("return this")()
    
    typeof module == "object"
      ? module.exports = function ( Domo, Factory, Shim ) {  
          if ( ! Domo ) throw new Error( 'No domo provided.' )
          domo = Domo//.global( false );
          factory = Factory;
          document = Shim;
          return Carton.call( this, document );
      } 
      : window.carton = function ( Domo, Factory ) {
          if ( ! Domo ) throw new Error( 'No domo provided.' )
          domo = Domo.global( false );
          factory = initFactory( Factory ); 
          return new Carton( global.document ).global( true );
        };
        
    // obj is an array ?
    
    var isArray = function ( obj ) { return obj instanceof Array; }
    
    // extend b into a
  
    var extend = function ( a, b ) { 
      var toStr = Object.prototype.toString;
      var astr = "[object Array]";
      var i;
      
      for ( i in b ) { 
        if ( b.hasOwnProperty( i )  ) {
          if ( typeof b[ i ] === 'object' && ! b[ i ].nodeType ) { 
            
            if ( ! a[ i ] || toStr.call( b[ i ] ) !== toStr.call( a[ i ] ) ) { 
              a[ i ] = ( toStr.call( b[ i ] ) === astr ) ? [] : {};
            }
            
            extend( a[ i ] , b[ i ] );
          }
          else {
            a[ i ] = b[ i ];
          }
        }
      }
    
      return a;
    }
    
    // Cache select Array/Object methods
    
    var shift = Array.prototype.shift;
    var concat = Array.prototype.concat;
    
    // store factory obj
    
    var factory;
    
    // store domo obj
    
    var domo;
    
    // cssCarton tags
    
    var cartonTags = [ 'CELL', 'STRETCH', 'SLIM','CHOPPED', 'STICKER', 'FIXED', 'FIT' ];
    
    // html tags
    
    var tags = [
      'A', 'ABBR', 'ACRONYM', 'ADDRESS', 'AREA', 'ARTICLE', 'ASIDE', 'AUDIO',
      'B', 'BDI', 'BDO', 'BIG', 'BLOCKQUOTE', 'BODY', 'BR', 'BUTTON',
      'CANVAS', 'CAPTION', 'CITE', 'CODE', 'COL', 'COLGROUP', 'COMMAND',
      'DATALIST', 'DD', 'DEL', 'DETAILS', 'DFN', 'DIV', 'DL', 'DT', 'EM',
      'EMBED', 'FIELDSET', 'FIGCAPTION', 'FIGURE', 'FOOTER', 'FORM', 'FRAME',
      'FRAMESET', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HEAD', 'HEADER',
      'HGROUP', 'HR', 'HTML', 'I', 'IFRAME', 'IMG', 'INPUT', 'INS', 'KBD',
      'KEYGEN', 'LABEL', 'LEGEND', 'LI', 'LINK', 'MAP', 'MARK', 'META',
      'METER', 'NAV', 'NOSCRIPT', 'OBJECT', 'OL', 'OPTGROUP', 'OPTION',
      'OUTPUT', 'P', 'PARAM', 'PRE', 'PROGRESS', 'Q', 'RP', 'RT', 'RUBY',
      'SAMP', 'SCRIPT', 'SECTION', 'SELECT', 'SMALL', 'SOURCE', 'SPAN',
      'SPLIT', 'STRONG', 'STYLE', 'SUB', 'SUMMARY', 'SUP', 'TABLE', 'TBODY',
      'TD', 'TEXTAREA', 'TFOOT', 'TH', 'THEAD', 'TIME', 'TITLE', 'TR',
      'TRACK', 'TT', 'UL', 'VAR', 'VIDEO', 'WBR'
    ];
    
    // create factory if nessesary
    
    function initFactory ( F ) {
      var settings = { selector: '#' };
      var key; 
      
      if ( ! F || ! F.index ){ 
        if ( ! cartonFactory ) throw new Error( 'No cartonFactory provided.' )
        if ( F ) extend( settings, F );
        F = cartonFactory( settings )
      }
      
      if ( settings.extend ) {
        for ( key in settings.extend ) if ( cartonTags.indexOf( key ) === -1 ) cartonTags.push( key.toUpperCase() ); 
      }      
      return F;
    }
    
    // filter factory properties
    
    function isKey ( key ) { 
      return 'styles,query,type,align,show'.indexOf( key ) > -1 
    }
    
    // manage settings in array form SLIM( [ ... ], ... ) 
    
    /////////////////////////// 
    
    function shortArray ( key ) {
      var styles = {}
      var args = []
      var prefix = []
      var nodeName = ''
      var align = ''
      var show;
      
      // find sytles objects
      
      ! function ( A ) {
          var l = A.length;
          var setting;
          var i = 1;
          var type;
          
          for ( i; i < l; i++ ) {
            setting = A[ i ];
            type = ( typeof setting );
            
            // styles
            if ( type === 'object' ) extend( styles, setting ); 
            
            // show
            else if ( type === 'boolean' ) show = setting;
            
            else if ( type === 'string' ) {
              
              // nodeName
              if ( tags.indexOf( setting.toUpperCase()) > -1 ) nodeName = setting
              
              // alignment
              else if ( 'left,right,center'.indexOf( setting  ) > -1 ) align = setting
              
              // prefix
              else if ( 'min,max'.indexOf( setting ) > -1) prefix.push( setting )
            
              else args.push( setting );
            }
            
            else args.push( setting );
          }
        
        } ( concat.apply( [], arguments ) )
        ;
      
      // transform to styles
      
      function transform ( loop, specials ) {
        var l = loop.length;
        var i = 0;
        
        for ( i; i < l; i++ ) styles[ loop[ i ] ] = specials[ i ] ;
        return { styles:  styles, nodeName: nodeName, align: align, show: show };
      }
      
      // combines values from array with an key
      
      this.cell = function () { 
        var args   = concat.apply( [], arguments );
        var height = ( prefix.length ? prefix.pop() +'-' : '' ) + 'height' ;
        var width  = ( prefix.length ? prefix.pop() +'-' : '' ) + 'width';
        var keys   = [ width, height ]
        return transform( keys, args);
      } 
      
      this.sticker = function () { 
        var l = arguments.length; 
        var keys = ( l === 2 ) ? [ 'top', 'left' ] : [ 'top', 'right', 'bottom', 'left' ];
        return transform( keys, arguments); 
      }
      
      this.fixed = this.sticker;
      
      // if element has only an styles object
      
      if ( ! this[ key ] ) {
        return transform( [], args );
      }
      
      // if key exist 
      return this[ key ].apply( null, args );
    } 
    
    ///////////////////////////
    
    function factorify ( obj ) { 
      
      function filterAttr () {
        var filter = { length: 1, keys:{}, attr: {}, nodeName: '' }
        var pseudos
        var i;
      
        for ( i in obj ) {  
          if ( i === 'nodeName') filter.nodeName = obj[ i ];
          else if ( isKey( i ) ) { 
            
            filter.keys[ i ] = obj[ i ];
            filter.length = ( obj[ i ].length > filter.length ) && isArray( obj[ i ] ) ?  obj[ i ].length : filter.length;
          } 
          else {
            filter.attr[ i ] = obj[ i ];
          } 
        }
        return filter;    
      }
      
      function create () {
        var filter = filterAttr();
        var keys = filter.keys;
        var l = filter.length;
        var args = [];
        var p = 0;
        var i;
      
      
        for ( p; p < l; p++ ) { 
         
         args[ p ] = {};
          
          for ( i in keys ) {
            
            if ( ! isArray( keys[ i ] ) ) { 
      
              args[ p ][ i ] = keys[ i ];
            }
            else { 
      
              args[ p ][ i ] = keys[ i ][ p ];    
            }
          }
        }
        
        return { factory: args, attributes: filter.attr, nodeName: filter.nodeName };
      
      } 
      
      return create();
    }
    
    ///////////////////////////
      
    function hasPseudoClass ( factories ) {
      var list = [];
      
      function lookForPseudo ( factory ) {
        var styles = factory.styles;
        var pseudoList = [];
        var pSelectors = {}
        var selector;
        var i;
        
        for ( i in styles ) {
          if ( i[ 0 ] === '_' ) {
            selector = i.slice(1) 
            pSelectors[ selector  ] = extend( {}, styles[ i ] );
            delete styles[ i ];
          }
        }
        
        for ( i in pSelectors ) {
          pseudoList.push( { pseudo: i, styles: pSelectors[ i ], query: factory.query } );
        }
        
        return pseudoList;
      }
      
      for (var i in factories ) {
         
         list = lookForPseudo( factories[ i ] );  
         if ( list.length ) factories = factories.concat( list )
      }
        
      return factories;
    }
    
    /////////////////////////// 
 
    function makeQuery ( carton, type ) {
      carton[ type ] = 
        carton[ type.toLowerCase() ] =
          function () {
            var query = [ 'DIV', { styles: {} } ];
            var childNodes = extend( [], arguments ); 
            var specials = childNodes[ 0 ]; 
            var attributes; 
           
            if ( cartonTags.indexOf( type ) === -1 ) query[ 0 ] = type.toUpperCase();
            else  query[ 1 ].type = type.toLowerCase();
            
            if ( isArray( specials )  ) {
              
              var specials = shortArray( type.toLowerCase(), specials );
            
              if ( specials.nodeName.length ) query[ 0 ] = specials.nodeName;
              if ( specials.align ) query[ 1 ].align = specials.align;
              if ( typeof specials.show === 'boolean'  )  query[ 1 ].show = specials.show;
              extend( query[ 1 ].styles, specials.styles );
              
              childNodes.shift();
              attributes = childNodes[ 0 ];
            } <commit_msg>added min- max- height & width to cell shortcut<commit_after>// domoCarton.js 0.0.1

// (c) 2013 <NAME>
// cartonFactory.js is distributed under the MIT license.
// For more details, see http://cssCarton.com
 
 ! function  () {
   
    // Determine the global object.
    
    var global = Function("return this")()
    
    typeof module == "object"
      ? module.exports = function ( Domo, Factory, Shim ) {  
          if ( ! Domo ) throw new Error( 'No domo provided.' )
          domo = Domo//.global( false );
          factory = Factory;
          document = Shim;
          return Carton.call( this, document );
      } 
      : window.carton = function ( Domo, Factory ) {
          if ( ! Domo ) throw new Error( 'No domo provided.' )
          domo = Domo.global( false );
          factory = initFactory( Factory ); 
          return new Carton( global.document ).global( true );
        };
        
    // obj is an array ?
    
    var isArray = function ( obj ) { return obj instanceof Array; }
    
    // extend b into a
  
    var extend = function ( a, b ) { 
      var toStr = Object.prototype.toString;
      var astr = "[object Array]";
      var i;
      
      for ( i in b ) { 
        if ( b.hasOwnProperty( i )  ) {
          if ( typeof b[ i ] === 'object' && ! b[ i ].nodeType ) { 
            
            if ( ! a[ i ] || toStr.call( b[ i ] ) !== toStr.call( a[ i ] ) ) { 
              a[ i ] = ( toStr.call( b[ i ] ) === astr ) ? [] : {};
            }
            
            extend( a[ i ] , b[ i ] );
          }
          else {
            a[ i ] = b[ i ];
          }
        }
      }
    
      return a;
    }
    
    // Cache select Array/Object methods
    
    var shift = Array.prototype.shift;
    var concat = Array.prototype.concat;
    
    // store factory obj
    
    var factory;
    
    // store domo obj
    
    var domo;
    
    // cssCarton tags
    
    var cartonTags = [ 'CELL', 'STRETCH', 'SLIM','CHOPPED', 'STICKER', 'FIXED', 'FIT' ];
    
    // html tags
    
    var tags = [
      'A', 'ABBR', 'ACRONYM', 'ADDRESS', 'AREA', 'ARTICLE', 'ASIDE', 'AUDIO',
      'B', 'BDI', 'BDO', 'BIG', 'BLOCKQUOTE', 'BODY', 'BR', 'BUTTON',
      'CANVAS', 'CAPTION', 'CITE', 'CODE', 'COL', 'COLGROUP', 'COMMAND',
      'DATALIST', 'DD', 'DEL', 'DETAILS', 'DFN', 'DIV', 'DL', 'DT', 'EM',
      'EMBED', 'FIELDSET', 'FIGCAPTION', 'FIGURE', 'FOOTER', 'FORM', 'FRAME',
      'FRAMESET', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HEAD', 'HEADER',
      'HGROUP', 'HR', 'HTML', 'I', 'IFRAME', 'IMG', 'INPUT', 'INS', 'KBD',
      'KEYGEN', 'LABEL', 'LEGEND', 'LI', 'LINK', 'MAP', 'MARK', 'META',
      'METER', 'NAV', 'NOSCRIPT', 'OBJECT', 'OL', 'OPTGROUP', 'OPTION',
      'OUTPUT', 'P', 'PARAM', 'PRE', 'PROGRESS', 'Q', 'RP', 'RT', 'RUBY',
      'SAMP', 'SCRIPT', 'SECTION', 'SELECT', 'SMALL', 'SOURCE', 'SPAN',
      'SPLIT', 'STRONG', 'STYLE', 'SUB', 'SUMMARY', 'SUP', 'TABLE', 'TBODY',
      'TD', 'TEXTAREA', 'TFOOT', 'TH', 'THEAD', 'TIME', 'TITLE', 'TR',
      'TRACK', 'TT', 'UL', 'VAR', 'VIDEO', 'WBR'
    ];
    
    // create factory if nessesary
    
    function initFactory ( F ) {
      var settings = { selector: '#' };
      var key; 
      
      if ( ! F || ! F.index ){ 
        if ( ! cartonFactory ) throw new Error( 'No cartonFactory provided.' )
        if ( F ) extend( settings, F );
        F = cartonFactory( settings )
      }
      
      if ( settings.extend ) {
        for ( key in settings.extend ) if ( cartonTags.indexOf( key ) === -1 ) cartonTags.push( key.toUpperCase() ); 
      }      
      return F;
    }
    
    // filter factory properties
    
    function isKey ( key ) { 
      return 'styles,query,type,align,show'.indexOf( key ) > -1 
    }
    
    // manage settings in array form SLIM( [ ... ], ... ) 
    
    /////////////////////////// 
    
    function shortcut ( key ) {
      var styles = {}
      var args = []
      var prefix = []
      var nodeName = ''
      var align = ''
      var show;
      
      // find sytles objects
      
      ! function ( A ) {
          var l = A.length;
          var setting;
          var i = 1;
          var type;
          
          for ( i; i < l; i++ ) {
            setting = A[ i ];
            type = ( typeof setting );
            
            // styles
            if ( type === 'object' ) extend( styles, setting ); 
            
            // show
            else if ( type === 'boolean' ) show = setting;
            
            else if ( type === 'string' ) {
              
              // nodeName
              if ( tags.indexOf( setting.toUpperCase()) > -1 ) nodeName = setting
              
              // alignment
              else if ( 'left,right,center'.indexOf( setting  ) > -1 ) align = setting
              
              else args.push( setting );
            }
            
            else args.push( setting );
          }
        
        } ( concat.apply( [], arguments ) )
        ;
      
      // transform to styles
      
      function transform ( loop, specials ) {
        var l = specials.length;
        var i = 0;
        
        for ( i; i < l; i++ ) {
          styles[ loop[ i ] ] = specials[ i ] ;
        }
        return { styles:  styles, nodeName: nodeName, align: align, show: show };
      }
      
      // combines values from array with an key
      
      this.cell = function () { 
        var args   = concat.apply( [], arguments );
        var keys = [ 'width', 'height', 'max-width', 'max-height', 'min-width', 'min-height' ]
        return transform( keys, args);
      } 
      
      this.sticker = function () { 
        var l = arguments.length; 
        var keys = ( l === 2 ) ? [ 'top', 'left' ] : [ 'top', 'right', 'bottom', 'left' ];
        return transform( keys, arguments); 
      }
      
      this.fixed = this.sticker;
      
      // if element has only an styles object
      
      if ( ! this[ key ] ) {
        return transform( [], args );
      }
      
      // if key exist 
      return this[ key ].apply( null, args );
    } 
    
    ///////////////////////////
    
    function factorify ( obj ) { 
      
      function filterAttr () {
        var filter = { length: 1, keys:{}, attr: {}, nodeName: '' }
        var pseudos
        var i;
      
        for ( i in obj ) {  
          if ( i === 'nodeName') filter.nodeName = obj[ i ];
          else if ( isKey( i ) ) { 
            
            filter.keys[ i ] = obj[ i ];
            filter.length = ( obj[ i ].length > filter.length ) && isArray( obj[ i ] ) ?  obj[ i ].length : filter.length;
          } 
          else {
            filter.attr[ i ] = obj[ i ];
          } 
        }
        return filter;    
      }
      
      function create () {
        var filter = filterAttr();
        var keys = filter.keys;
        var l = filter.length;
        var args = [];
        var p = 0;
        var i;
      
      
        for ( p; p < l; p++ ) { 
         
         args[ p ] = {};
          
          for ( i in keys ) {
            
            if ( ! isArray( keys[ i ] ) ) { 
      
              args[ p ][ i ] = keys[ i ];
            }
            else { 
      
              args[ p ][ i ] = keys[ i ][ p ];    
            }
          }
        }
        
        return { factory: args, attributes: filter.attr, nodeName: filter.nodeName };
      
      } 
      
      return create();
    }
    
    ///////////////////////////
      
    function hasPseudoClass ( factories ) {
      var list = [];
      
      function lookForPseudo ( factory ) {
        var styles = factory.styles;
        var pseudoList = [];
        var pSelectors = {}
        var selector;
        var i;
        
        for ( i in styles ) {
          if ( i[ 0 ] === '_' ) {
            selector = i.slice(1) 
            pSelectors[ selector  ] = extend( {}, styles[ i ] );
            delete styles[ i ];
          }
        }
        
        for ( i in pSelectors ) {
          pseudoList.push( { pseudo: i, styles: pSelectors[ i ], query: factory.query } );
        }
        
        return pseudoList;
      }
      
      for (var i in factories ) {
         
         list = lookForPseudo( factories[ i ] );  
         if ( list.length ) factories = factories.concat( list )
      }
        
      return factories;
    }
    
    /////////////////////////// 
 
    function makeQuery ( carton, type ) {
      carton[ type ] = 
        carton[ type.toLowerCase() ] =
          function () {
            var query = [ 'DIV', { styles: {} } ];
            var childNodes = extend( [], arguments ); 
            var specials = childNodes[ 0 ]; 
            var attributes; 
           
            if ( cartonTags.indexOf( type ) === -1 ) query[ 0 ] = type.toUpperCase();
            else  query[ 1 ].type = type.toLowerCase();
            
            if ( isArray( specials )  ) {
              
              var specials = shortcut( type.toLowerCase(), specials );
            
              if ( specials.nodeName.length ) query[ 0 ] = specials.nodeName;
              if ( specials.align ) query[ 1 ].align = specials.align;
              if ( typeof specials.show === 'boolean'  )  query[ 1 ].show = specials.show;
              extend( query[ 1 ].styles, specials.styles );
              
              childNodes.shift();
              attributes = childNodes[ 0 ];
            } 
{'fraction_non_alphanumeric': 0.15730929411144498, 'fraction_numerical': 0.003532078654647056, 'mean_word_length': 1.3010674429888405, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4573725', 'n_tokens_mistral': 5846, 'n_tokens_neox': 5706, 'n_words': 1583}