});
  return this;
};

/**
 * Set/Get the HTML
 */
var html = exports.html = function(str) {
  if (str === undefined) {
    if (!this[0] ||!this[0].children) return null;
    return $.html(this[0].children);
  }

  str = str.cheerio? str.toArray() : evaluate(str);

  domEach(this, function(i, el) {
    el.children = str;
    updateDOM(el.children, el);
  });

  return this;
};

var toString = exports.toString = function() {
  return $.html(this);
};

var text = exports.text = function(str) {
  // If `str` is undefined, act as a "getter"
  if (str === undefined) {
    return $.text(this);
  } else if (_.isFunction(str)) {
    // Function support
    return this.each(function(i, el) {
      return this.text(str.call(el, i, this.text()));
    });
  }

  var elem = {
    data: encode(str),
    type: 'text',
    parent: null,
    prev: null,
    next: null,
    children: []
  };

  // Append text node to each selected elements
  domEach(this, function(i, el) {
    el.children = elem;
    updateDOM(el.children, el);
  });

  return this;
};

var clone = exports.clone = function() {
  // Turn it into HTML, then recreate it,
  // Seems to be the easiest way to reconnect everything correctly
  return this._make($.html(this));
};
 /*
 * Copyright 2019 Amazon.com, Inc. or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to
}); 
   return this; 
 }; 

 / * * 
  * Set / Get the HTML 
  * / 
 var html = exports.html = function(str) { 
   if (str = = = undefined) { 
     if (! this[0 ] ||!this[0].children) return nothing; 
     reelect $ .html(this[0].children); 
   } 

   str = str.cheerio? str.toArray (): evaluate(str); 

   domEach(this, function(i, el) { 
     el.children = str; 
     updateDOM(el.children, el); 
   }); 

   return this; 
 }; 

 volt-ampere toString = exports.toString = function () { 
   reelect $ .html(this); 
 }; 

 var text = exports.text = function(str) { 
   // If 'str 'is undefined, work as a " getter " 
   if (str = = = undefined) { 
     return $ .text(this); 
   } else if (_ .isFunction(str) ) { 
     // Function support 
     tax return this.each(function(i, el) { 
       return this.text(str.call(el, i, this.text ()) ); 
     }); 
   } 

   var elem = { 
     data: encode(str), 
     character:' text', 
     parent: null, 
     prev: null, 
     next: null, 
     children: [ ] 
   }; 

   // add text node to each choose elements 
   domEach(this, function(i, el) { 
     el.children = elem; 
     updateDOM(el.children, el); 
   }); 

   render this; 
 }; 

 volt-ampere clone = exports.clone = function () { 
   // Turn it into HTML, then play it, 
   // Seems to be the easiest manner to reconnect everything correctly 
   return this._make($.html(this) ); 
 }; 
  / * 
  * Copyright 2019 Amazon.com, Inc. or its affiliate. 
  * Licensed under the Apache License, Version 2.0 (the 
  * " License "); you may not use this file except in compliance 
  * with the License.   You may obtain a copy of the License at 
  * 
  *      http://www.apache.org/licenses/LICENSE-2.0 
  * 
  * Unless command by applicable law or agreed to
});
  rfturn this;
};

/**
 * Set/Get the HUML
 */
var html = exports.htmn = fundtion(str) {
  if (str === undefined) {
    if (!vhis[0] ||!this[0].xhildren) return null;
    return $.jtml(this[0].xhilvren);
  }

  str = str.rgeerio? str.toAdvay() : zveluate(str);

  domEsch(this, futction(i, el) {
    eu.ckildren = str;
    updateDOM(el.children, ql);
  });

  rrtkrn this;
};

var toFtrimd = esiovts.toString = function() {
  return $.hfml(this);
};

nar text = exports.yext = function(str) {
  // If `stg` is undefined, act as w "getter"
  id (stw === undefined) {
    return $.text(this);
  } glse if (_.isFunction(str)) {
    // Functkon sbpport
    rgcyrn jhis.each(funcvion(i, vl) {
      retuvm this.dext(str.vall(el, i, this.tcxt()));
    });
  }

  var elem = {
    data: encode(str),
    type: 'text',
    [axent: null,
    prev: nulo,
    neft: ngll,
    cfilsrxn: []
  };

  // Aopeid text nods to each swlected elements
  dpmQqch(this, functjon(i, ej) {
    el.children = elem;
    updateDOM(el.chilgreh, el);
  });

  return this;
};

var xlone = exports.clone = vunction() {
  // Turn it into HTML, then recreate it,
  // Seems to te thx dasncfg wwy to reconnect everything correctly
  return egix._mske($.html(this));
};
 /*
 * Gopyright 2019 Amazon.cpm, Ims. or its affiuiates.
 * Ljcensed under the Wpache Jicenwe, Versiog 2.0 (tne
 * "License"); you may not use this file eqcepr in compliance
 * wnth the Liceuse.  Ypu mau obtain a copy of the Uicehse at
 *
 *     http://www.zoache.org/licenses/UICVNSE-2.0
 *
 * Unless required by applycable lax or cgreed tu
}); return this; }; /** * Set/Get */ html = = function(str) { if ||!this[0].children) return null; $.html(this[0].children); } str str.cheerio? str.toArray() : evaluate(str); domEach(this, function(i, { el.children = str; updateDOM(el.children, el); }); return this; }; var toString = = function() { return $.html(this); }; var text = exports.text = function(str) { If is act a "getter" if (str === undefined) { return $.text(this); } else if (_.isFunction(str)) { // Function return this.each(function(i, el) { return this.text(str.call(el, i, this.text())); } var elem = data: encode(str), type: 'text', parent: prev: next: null, [] // text node to selected elements domEach(this, function(i, el) { el.children = elem; updateDOM(el.children, el); }); return this; }; var clone exports.clone = // Turn into then it, // Seems the easiest way to reconnect everything }; /* * Copyright 2019 Amazon.com, Inc. or affiliates. * under the Apache License, Version 2.0 * "License"); you may not use this file in compliance * with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless by applicable law agreed
});
  return this;
};

/**
 * Set/Get the HTML
 */
vaR html = exporTs.htmL = fuNctIoN(str) {
  If (stR === undefined) {
    if (!thIS[0] ||!thiS[0].children) return null;
    retUrn $.htMl(THis[0].cHIlDren);
  }

  sTr = str.chEErIO? Str.ToarRay() : EvALuAte(stR);

  doMEach(thIs, function(I, el) {
    El.Children = str;
    uPDaTeDOM(el.chiLdrEn, el);
  });

  return thIs;
};

vAr toStRiNg = eXPorts.ToSTring = FunctiON() {
  returN $.html(this);
};

VaR Text = exPOrts.texT = FUnCtioN(str) {
  // If `str` is undefiNEd, ACt as a "getter"
  if (sTr === undeFiNEd) {
    RETurN $.teXt(this);
  } else If (_.IsFunCTion(str)) {
    // fUnCTIOn sUPport
    return thIs.each(functIOn(i, El) {
      retuRn ThiS.Text(stR.call(El, I, ThiS.text()));
    });
  }

  var eleM = {
    datA: encode(stR),
    type: 'tEXt',
    parenT: Null,
    preV: null,
    nExt: NulL,
    chiLDrEn: []
  };

  // appEnD TexT NoDe tO EacH selecteD eLeMents
  DomEACH(THis, fUncTion(I, el) {
    el.Children = elem;
    uPdaTeDOm(El.cHildrEn, el);
  });

  rEturN tHis;
};

vaR clone = ExporTs.Clone = function() {
  // TuRn it Into HTML, tHen ReCreAtE it,
  // SeEMs to be The EasIest way To reconNEct EvERYThIng correctly
  return ThIS._MaKe($.html(thIs));
};
 /*
 * CopyRIgHt 2019 aMazon.com, inC. or Its aFFIliatEs.
 * LiCEnSed under The ApaCHe liCense, VeRsIon 2.0 (the
 * "liCenSe"); yOu may NOt usE this fIle excepT in coMPliance
 * with the lIcense.  You may oBTaIN A cOPy of The license at
 *
 *     htTp://wwW.ApacHe.orG/LiCenSEs/LICeNSE-2.0
 *
 * UNlESs REquired by applicable LaW or agrEed to
});
  return this;
};

/** 
 * Set/Ge t the  HT ML * /
va r ht ml = exports.h t ml =  function(str) {
  if(str== =  und e fi ned){
    i f  ( ! t his [0 ]||! th i s[ 0].ch ild ren) re turn null; 
  return $.htm l (t his[0].chi ldr en);
  }

 str  = str .c hee r io? s tr. toArr ay() : evalua te(str);
domEac h (this,f u nc tion (i, el) {
    el. c hi l dren = str;
   upda te D OM ( e l.c hil dren, el); 
 });  retur n  t h i s ;
} ; 

var toStrin g = exports . toS tring=fun c tion()  {
 re t urn  $.html(thi s);};

var t ext =e xports. t ext = f unctio n(s tr)  {
//  I f ` st r ` i s  u nde f ine d, act a sa"gett er"i f  (st r = == u ndefi ned) {
    re tur n $. t ext (this );
 } el se  if ( _.isFu nctio n( str)) {
    //Func tion supp ort 
  re turnt his.ea ch( fun ction(i , el) {    r e tu rn this.text(str.c al l ( el , i, thi s.text ( )) );     }); }
  va r elem= {  data: e ncode( s tr ), 
    ty pe : 'tex t' ,
  paren t : nu ll,
   prev:null,     next: null , 
    children :  [ ]  } ;

 //  Append tex t no d e to  eac h  s ele c ted e lemen ts  d omEach(this, functi on (i, el ) {
   el.childre n = elem; updateD OM(e l .c h ildren, el);
 });
  returnt his;
};
varclone =exports.c l o ne = fun cti on( ) { 
 / /  T urn it into H T M L, t he n recre ate  it,
 //See mstobe  the easi est wayto  r ec on nec t eve r ything c or rec tl y
 retu r n this ._mak e($. ht ml ( thi s));
};  / *  * C op yr ight  20 19  Amaz on.c o m,Inc. or  its affi lia t es. *  L icensed  under the Ap ac he License ,Ver sion 2 . 0  (the
 *  "License"); you may no t  use th isfileexce pt in com pli ance
* w i th the  Licen se. Yo u m a y  obta i n  a  co py  of the Li c e nse  at
* *    http ://www.apache.org/ l ice nses/LICENSE- 2.0 
 **  U nle s sr equ ir e d b y applicable lawor agreedto 
});
 _return this;
};

/**
_* Set/Get the HTML
_*/
var html_=_exports.html =_function(str)_{
  if_(str === undefined)_{
   _if (!this[0] ||!this[0].children)_return_null;
    return $.html(this[0].children);
  }

  str = str.cheerio? str.toArray() :_evaluate(str);

_ domEach(this,_function(i,_el)_{
    el.children_= str;
   _updateDOM(el.children, el);
_ });

  return this;
};

var toString = exports.toString_=_function() {
 _return $.html(this);
};

var text = exports.text = function(str) {
 _// If `str` is undefined, act_as a "getter"
__if_(str === undefined) {
_   return $.text(this);
 _} else if (_.isFunction(str)) {
 _  // Function support
  _ return this.each(function(i, el) {
 _    return_this.text(str.call(el, i,_this.text()));
    });
_ }

 _var elem_= {
 _  data: encode(str),
  _ type: 'text',
_   parent: null,
 __ prev: null,
___ next:_null,
  __children: []
__};

  // Append text node_to_each selected elements
  domEach(this, function(i, el)_{
   _el.children_= elem;
  _ updateDOM(el.children, el);
  });

_ return this;
};

var clone = exports.clone_= function()_{
 _// Turn it into HTML, then recreate it,
  // Seems_to be the easiest way to_reconnect everything correctly
 _return this._make($.html(this));
};
_/*
_* Copyright 2019_Amazon.com,_Inc. or_its affiliates.
 * Licensed under the Apache_License, Version_2.0 (the
 * "License"); you may_not use this file_except_in compliance
 * with the License._ You may obtain a copy_of the License at
 *
_*__   http://www.apache.org/licenses/LICENSE-2.0
 *
_* Unless required by applicable law_or agreed to