if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/gallery-sm-editor-base/gallery-sm-editor-base.js']) {
__coverage__['build/gallery-sm-editor-base/gallery-sm-editor-base.js'] = {"path":"build/gallery-sm-editor-base/gallery-sm-editor-base.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0,0,0,0],"38":[0,0],"39":[0,0,0],"40":[0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":53}}},"2":{"name":"(anonymous_2)","line":125,"loc":{"start":{"line":125,"column":17},"end":{"line":125,"column":29}}},"3":{"name":"(anonymous_3)","line":131,"loc":{"start":{"line":131,"column":39},"end":{"line":131,"column":60}}},"4":{"name":"(anonymous_4)","line":138,"loc":{"start":{"line":138,"column":16},"end":{"line":138,"column":28}}},"5":{"name":"(anonymous_5)","line":152,"loc":{"start":{"line":152,"column":10},"end":{"line":152,"column":22}}},"6":{"name":"(anonymous_6)","line":175,"loc":{"start":{"line":175,"column":13},"end":{"line":175,"column":29}}},"7":{"name":"(anonymous_7)","line":213,"loc":{"start":{"line":213,"column":11},"end":{"line":213,"column":23}}},"8":{"name":"(anonymous_8)","line":231,"loc":{"start":{"line":231,"column":11},"end":{"line":231,"column":27}}},"9":{"name":"(anonymous_9)","line":262,"loc":{"start":{"line":262,"column":12},"end":{"line":262,"column":24}}},"10":{"name":"(anonymous_10)","line":302,"loc":{"start":{"line":302,"column":19},"end":{"line":302,"column":31}}},"11":{"name":"(anonymous_11)","line":326,"loc":{"start":{"line":326,"column":19},"end":{"line":326,"column":31}}},"12":{"name":"(anonymous_12)","line":342,"loc":{"start":{"line":342,"column":18},"end":{"line":342,"column":41}}},"13":{"name":"(anonymous_13)","line":358,"loc":{"start":{"line":358,"column":14},"end":{"line":358,"column":31}}},"14":{"name":"(anonymous_14)","line":372,"loc":{"start":{"line":372,"column":15},"end":{"line":372,"column":42}}},"15":{"name":"(anonymous_15)","line":406,"loc":{"start":{"line":406,"column":23},"end":{"line":406,"column":39}}},"16":{"name":"(anonymous_16)","line":423,"loc":{"start":{"line":423,"column":14},"end":{"line":423,"column":31}}},"17":{"name":"(anonymous_17)","line":437,"loc":{"start":{"line":437,"column":17},"end":{"line":437,"column":33}}},"18":{"name":"(anonymous_18)","line":466,"loc":{"start":{"line":466,"column":16},"end":{"line":466,"column":28}}},"19":{"name":"(anonymous_19)","line":479,"loc":{"start":{"line":479,"column":17},"end":{"line":479,"column":33}}},"20":{"name":"(anonymous_20)","line":500,"loc":{"start":{"line":500,"column":16},"end":{"line":500,"column":28}}},"21":{"name":"(anonymous_21)","line":513,"loc":{"start":{"line":513,"column":24},"end":{"line":513,"column":40}}},"22":{"name":"(anonymous_22)","line":525,"loc":{"start":{"line":525,"column":14},"end":{"line":525,"column":31}}},"23":{"name":"(anonymous_23)","line":541,"loc":{"start":{"line":541,"column":14},"end":{"line":541,"column":31}}},"24":{"name":"(anonymous_24)","line":562,"loc":{"start":{"line":562,"column":23},"end":{"line":562,"column":42}}},"25":{"name":"(anonymous_25)","line":600,"loc":{"start":{"line":600,"column":13},"end":{"line":600,"column":25}}},"26":{"name":"(anonymous_26)","line":617,"loc":{"start":{"line":617,"column":13},"end":{"line":617,"column":26}}},"27":{"name":"(anonymous_27)","line":640,"loc":{"start":{"line":640,"column":12},"end":{"line":640,"column":25}}},"28":{"name":"(anonymous_28)","line":669,"loc":{"start":{"line":669,"column":17},"end":{"line":669,"column":28}}},"29":{"name":"(anonymous_29)","line":681,"loc":{"start":{"line":681,"column":14},"end":{"line":681,"column":26}}},"30":{"name":"(anonymous_30)","line":705,"loc":{"start":{"line":705,"column":45},"end":{"line":705,"column":57}}},"31":{"name":"(anonymous_31)","line":719,"loc":{"start":{"line":719,"column":14},"end":{"line":719,"column":27}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":793,"column":3}},"2":{"start":{"line":5,"column":0},"end":{"line":5,"column":28}},"3":{"start":{"line":28,"column":0},"end":{"line":31,"column":32}},"4":{"start":{"line":38,"column":0},"end":{"line":38,"column":22}},"5":{"start":{"line":45,"column":0},"end":{"line":45,"column":24}},"6":{"start":{"line":52,"column":0},"end":{"line":52,"column":26}},"7":{"start":{"line":64,"column":0},"end":{"line":64,"column":45}},"8":{"start":{"line":66,"column":0},"end":{"line":776,"column":3}},"9":{"start":{"line":126,"column":8},"end":{"line":126,"column":44}},"10":{"start":{"line":127,"column":8},"end":{"line":127,"column":29}},"11":{"start":{"line":129,"column":8},"end":{"line":129,"column":82}},"12":{"start":{"line":131,"column":8},"end":{"line":133,"column":17}},"13":{"start":{"line":132,"column":12},"end":{"line":132,"column":45}},"14":{"start":{"line":135,"column":8},"end":{"line":135,"column":29}},"15":{"start":{"line":139,"column":8},"end":{"line":139,"column":29}},"16":{"start":{"line":141,"column":8},"end":{"line":141,"column":30}},"17":{"start":{"line":153,"column":8},"end":{"line":155,"column":9}},"18":{"start":{"line":154,"column":12},"end":{"line":154,"column":35}},"19":{"start":{"line":157,"column":8},"end":{"line":157,"column":20}},"20":{"start":{"line":176,"column":8},"end":{"line":178,"column":47}},"21":{"start":{"line":180,"column":8},"end":{"line":194,"column":9}},"22":{"start":{"line":181,"column":12},"end":{"line":181,"column":40}},"23":{"start":{"line":183,"column":12},"end":{"line":189,"column":13}},"24":{"start":{"line":184,"column":16},"end":{"line":184,"column":39}},"25":{"start":{"line":186,"column":16},"end":{"line":188,"column":17}},"26":{"start":{"line":187,"column":20},"end":{"line":187,"column":39}},"27":{"start":{"line":191,"column":12},"end":{"line":193,"column":13}},"28":{"start":{"line":192,"column":16},"end":{"line":192,"column":30}},"29":{"start":{"line":196,"column":8},"end":{"line":196,"column":21}},"30":{"start":{"line":198,"column":8},"end":{"line":202,"column":9}},"31":{"start":{"line":199,"column":12},"end":{"line":199,"column":39}},"32":{"start":{"line":201,"column":12},"end":{"line":201,"column":49}},"33":{"start":{"line":204,"column":8},"end":{"line":204,"column":39}},"34":{"start":{"line":214,"column":8},"end":{"line":216,"column":9}},"35":{"start":{"line":215,"column":12},"end":{"line":215,"column":36}},"36":{"start":{"line":218,"column":8},"end":{"line":218,"column":20}},"37":{"start":{"line":232,"column":8},"end":{"line":234,"column":47}},"38":{"start":{"line":236,"column":8},"end":{"line":244,"column":9}},"39":{"start":{"line":237,"column":12},"end":{"line":237,"column":40}},"40":{"start":{"line":239,"column":12},"end":{"line":241,"column":13}},"41":{"start":{"line":240,"column":16},"end":{"line":240,"column":37}},"42":{"start":{"line":243,"column":12},"end":{"line":243,"column":26}},"43":{"start":{"line":246,"column":8},"end":{"line":246,"column":21}},"44":{"start":{"line":248,"column":8},"end":{"line":250,"column":9}},"45":{"start":{"line":249,"column":12},"end":{"line":249,"column":39}},"46":{"start":{"line":252,"column":8},"end":{"line":252,"column":19}},"47":{"start":{"line":263,"column":8},"end":{"line":264,"column":61}},"48":{"start":{"line":266,"column":8},"end":{"line":266,"column":51}},"49":{"start":{"line":268,"column":8},"end":{"line":271,"column":9}},"50":{"start":{"line":269,"column":12},"end":{"line":270,"column":66}},"51":{"start":{"line":273,"column":8},"end":{"line":274,"column":36}},"52":{"start":{"line":276,"column":8},"end":{"line":282,"column":9}},"53":{"start":{"line":277,"column":12},"end":{"line":277,"column":36}},"54":{"start":{"line":278,"column":15},"end":{"line":282,"column":9}},"55":{"start":{"line":279,"column":12},"end":{"line":279,"column":40}},"56":{"start":{"line":281,"column":12},"end":{"line":281,"column":45}},"57":{"start":{"line":284,"column":8},"end":{"line":284,"column":47}},"58":{"start":{"line":286,"column":8},"end":{"line":286,"column":36}},"59":{"start":{"line":287,"column":8},"end":{"line":287,"column":31}},"60":{"start":{"line":289,"column":8},"end":{"line":289,"column":30}},"61":{"start":{"line":291,"column":8},"end":{"line":291,"column":20}},"62":{"start":{"line":303,"column":8},"end":{"line":305,"column":9}},"63":{"start":{"line":304,"column":12},"end":{"line":304,"column":19}},"64":{"start":{"line":307,"column":8},"end":{"line":308,"column":39}},"65":{"start":{"line":310,"column":8},"end":{"line":317,"column":10}},"66":{"start":{"line":327,"column":8},"end":{"line":330,"column":9}},"67":{"start":{"line":328,"column":12},"end":{"line":328,"column":53}},"68":{"start":{"line":329,"column":12},"end":{"line":329,"column":32}},"69":{"start":{"line":343,"column":8},"end":{"line":345,"column":9}},"70":{"start":{"line":344,"column":12},"end":{"line":344,"column":19}},"71":{"start":{"line":347,"column":8},"end":{"line":347,"column":44}},"72":{"start":{"line":359,"column":8},"end":{"line":359,"column":66}},"73":{"start":{"line":373,"column":8},"end":{"line":374,"column":33}},"74":{"start":{"line":376,"column":8},"end":{"line":376,"column":39}},"75":{"start":{"line":378,"column":8},"end":{"line":378,"column":38}},"76":{"start":{"line":379,"column":8},"end":{"line":379,"column":42}},"77":{"start":{"line":381,"column":8},"end":{"line":396,"column":9}},"78":{"start":{"line":382,"column":12},"end":{"line":382,"column":57}},"79":{"start":{"line":384,"column":12},"end":{"line":391,"column":13}},"80":{"start":{"line":388,"column":16},"end":{"line":388,"column":60}},"81":{"start":{"line":390,"column":16},"end":{"line":390,"column":37}},"82":{"start":{"line":395,"column":12},"end":{"line":395,"column":51}},"83":{"start":{"line":398,"column":8},"end":{"line":404,"column":9}},"84":{"start":{"line":399,"column":12},"end":{"line":401,"column":13}},"85":{"start":{"line":400,"column":16},"end":{"line":400,"column":37}},"86":{"start":{"line":403,"column":12},"end":{"line":403,"column":50}},"87":{"start":{"line":406,"column":8},"end":{"line":410,"column":11}},"88":{"start":{"line":407,"column":11},"end":{"line":409,"column":12}},"89":{"start":{"line":408,"column":15},"end":{"line":408,"column":32}},"90":{"start":{"line":412,"column":8},"end":{"line":412,"column":28}},"91":{"start":{"line":424,"column":8},"end":{"line":424,"column":68}},"92":{"start":{"line":438,"column":8},"end":{"line":440,"column":42}},"93":{"start":{"line":442,"column":8},"end":{"line":444,"column":9}},"94":{"start":{"line":443,"column":12},"end":{"line":443,"column":19}},"95":{"start":{"line":448,"column":8},"end":{"line":448,"column":48}},"96":{"start":{"line":450,"column":8},"end":{"line":450,"column":55}},"97":{"start":{"line":452,"column":8},"end":{"line":452,"column":25}},"98":{"start":{"line":454,"column":8},"end":{"line":454,"column":32}},"99":{"start":{"line":456,"column":8},"end":{"line":456,"column":20}},"100":{"start":{"line":467,"column":8},"end":{"line":467,"column":69}},"101":{"start":{"line":484,"column":8},"end":{"line":484,"column":41}},"102":{"start":{"line":486,"column":8},"end":{"line":486,"column":58}},"103":{"start":{"line":514,"column":8},"end":{"line":514,"column":84}},"104":{"start":{"line":526,"column":8},"end":{"line":528,"column":9}},"105":{"start":{"line":527,"column":12},"end":{"line":527,"column":43}},"106":{"start":{"line":530,"column":8},"end":{"line":530,"column":21}},"107":{"start":{"line":542,"column":8},"end":{"line":544,"column":9}},"108":{"start":{"line":543,"column":12},"end":{"line":543,"column":47}},"109":{"start":{"line":546,"column":8},"end":{"line":546,"column":21}},"110":{"start":{"line":563,"column":8},"end":{"line":566,"column":50}},"111":{"start":{"line":568,"column":8},"end":{"line":577,"column":9}},"112":{"start":{"line":576,"column":12},"end":{"line":576,"column":19}},"113":{"start":{"line":579,"column":8},"end":{"line":579,"column":39}},"114":{"start":{"line":583,"column":8},"end":{"line":589,"column":9}},"115":{"start":{"line":584,"column":12},"end":{"line":588,"column":15}},"116":{"start":{"line":601,"column":8},"end":{"line":603,"column":9}},"117":{"start":{"line":602,"column":12},"end":{"line":602,"column":19}},"118":{"start":{"line":605,"column":8},"end":{"line":605,"column":46}},"119":{"start":{"line":607,"column":8},"end":{"line":607,"column":28}},"120":{"start":{"line":618,"column":8},"end":{"line":620,"column":55}},"121":{"start":{"line":622,"column":8},"end":{"line":622,"column":27}},"122":{"start":{"line":624,"column":8},"end":{"line":630,"column":9}},"123":{"start":{"line":626,"column":12},"end":{"line":626,"column":53}},"124":{"start":{"line":627,"column":12},"end":{"line":627,"column":54}},"125":{"start":{"line":629,"column":12},"end":{"line":629,"column":48}},"126":{"start":{"line":641,"column":8},"end":{"line":643,"column":21}},"127":{"start":{"line":647,"column":8},"end":{"line":647,"column":48}},"128":{"start":{"line":648,"column":8},"end":{"line":648,"column":53}},"129":{"start":{"line":650,"column":8},"end":{"line":650,"column":27}},"130":{"start":{"line":652,"column":8},"end":{"line":652,"column":37}},"131":{"start":{"line":654,"column":8},"end":{"line":660,"column":9}},"132":{"start":{"line":656,"column":12},"end":{"line":656,"column":53}},"133":{"start":{"line":657,"column":12},"end":{"line":657,"column":54}},"134":{"start":{"line":659,"column":12},"end":{"line":659,"column":48}},"135":{"start":{"line":670,"column":8},"end":{"line":670,"column":43}},"136":{"start":{"line":672,"column":8},"end":{"line":672,"column":58}},"137":{"start":{"line":682,"column":8},"end":{"line":684,"column":18}},"138":{"start":{"line":686,"column":8},"end":{"line":688,"column":9}},"139":{"start":{"line":687,"column":12},"end":{"line":687,"column":19}},"140":{"start":{"line":691,"column":8},"end":{"line":697,"column":9}},"141":{"start":{"line":692,"column":12},"end":{"line":692,"column":76}},"142":{"start":{"line":694,"column":12},"end":{"line":694,"column":34}},"143":{"start":{"line":695,"column":12},"end":{"line":695,"column":43}},"144":{"start":{"line":696,"column":12},"end":{"line":696,"column":44}},"145":{"start":{"line":699,"column":8},"end":{"line":699,"column":32}},"146":{"start":{"line":701,"column":8},"end":{"line":701,"column":32}},"147":{"start":{"line":703,"column":8},"end":{"line":703,"column":46}},"148":{"start":{"line":705,"column":8},"end":{"line":707,"column":16}},"149":{"start":{"line":706,"column":12},"end":{"line":706,"column":36}},"150":{"start":{"line":709,"column":8},"end":{"line":709,"column":29}},"151":{"start":{"line":720,"column":8},"end":{"line":721,"column":49}},"152":{"start":{"line":723,"column":8},"end":{"line":723,"column":27}},"153":{"start":{"line":728,"column":8},"end":{"line":728,"column":55}},"154":{"start":{"line":730,"column":8},"end":{"line":730,"column":45}},"155":{"start":{"line":778,"column":0},"end":{"line":778,"column":40}}},"branchMap":{"1":{"line":153,"type":"if","locations":[{"start":{"line":153,"column":8},"end":{"line":153,"column":8}},{"start":{"line":153,"column":8},"end":{"line":153,"column":8}}]},"2":{"line":180,"type":"if","locations":[{"start":{"line":180,"column":8},"end":{"line":180,"column":8}},{"start":{"line":180,"column":8},"end":{"line":180,"column":8}}]},"3":{"line":183,"type":"if","locations":[{"start":{"line":183,"column":12},"end":{"line":183,"column":12}},{"start":{"line":183,"column":12},"end":{"line":183,"column":12}}]},"4":{"line":186,"type":"if","locations":[{"start":{"line":186,"column":16},"end":{"line":186,"column":16}},{"start":{"line":186,"column":16},"end":{"line":186,"column":16}}]},"5":{"line":191,"type":"if","locations":[{"start":{"line":191,"column":12},"end":{"line":191,"column":12}},{"start":{"line":191,"column":12},"end":{"line":191,"column":12}}]},"6":{"line":198,"type":"if","locations":[{"start":{"line":198,"column":8},"end":{"line":198,"column":8}},{"start":{"line":198,"column":8},"end":{"line":198,"column":8}}]},"7":{"line":204,"type":"binary-expr","locations":[{"start":{"line":204,"column":15},"end":{"line":204,"column":18}},{"start":{"line":204,"column":22},"end":{"line":204,"column":38}}]},"8":{"line":214,"type":"if","locations":[{"start":{"line":214,"column":8},"end":{"line":214,"column":8}},{"start":{"line":214,"column":8},"end":{"line":214,"column":8}}]},"9":{"line":236,"type":"if","locations":[{"start":{"line":236,"column":8},"end":{"line":236,"column":8}},{"start":{"line":236,"column":8},"end":{"line":236,"column":8}}]},"10":{"line":239,"type":"if","locations":[{"start":{"line":239,"column":12},"end":{"line":239,"column":12}},{"start":{"line":239,"column":12},"end":{"line":239,"column":12}}]},"11":{"line":248,"type":"if","locations":[{"start":{"line":248,"column":8},"end":{"line":248,"column":8}},{"start":{"line":248,"column":8},"end":{"line":248,"column":8}}]},"12":{"line":268,"type":"if","locations":[{"start":{"line":268,"column":8},"end":{"line":268,"column":8}},{"start":{"line":268,"column":8},"end":{"line":268,"column":8}}]},"13":{"line":276,"type":"if","locations":[{"start":{"line":276,"column":8},"end":{"line":276,"column":8}},{"start":{"line":276,"column":8},"end":{"line":276,"column":8}}]},"14":{"line":278,"type":"if","locations":[{"start":{"line":278,"column":15},"end":{"line":278,"column":15}},{"start":{"line":278,"column":15},"end":{"line":278,"column":15}}]},"15":{"line":303,"type":"if","locations":[{"start":{"line":303,"column":8},"end":{"line":303,"column":8}},{"start":{"line":303,"column":8},"end":{"line":303,"column":8}}]},"16":{"line":327,"type":"if","locations":[{"start":{"line":327,"column":8},"end":{"line":327,"column":8}},{"start":{"line":327,"column":8},"end":{"line":327,"column":8}}]},"17":{"line":343,"type":"if","locations":[{"start":{"line":343,"column":8},"end":{"line":343,"column":8}},{"start":{"line":343,"column":8},"end":{"line":343,"column":8}}]},"18":{"line":343,"type":"binary-expr","locations":[{"start":{"line":343,"column":12},"end":{"line":343,"column":44}},{"start":{"line":343,"column":48},"end":{"line":343,"column":78}}]},"19":{"line":359,"type":"cond-expr","locations":[{"start":{"line":359,"column":32},"end":{"line":359,"column":57}},{"start":{"line":359,"column":60},"end":{"line":359,"column":65}}]},"20":{"line":381,"type":"if","locations":[{"start":{"line":381,"column":8},"end":{"line":381,"column":8}},{"start":{"line":381,"column":8},"end":{"line":381,"column":8}}]},"21":{"line":384,"type":"if","locations":[{"start":{"line":384,"column":12},"end":{"line":384,"column":12}},{"start":{"line":384,"column":12},"end":{"line":384,"column":12}}]},"22":{"line":384,"type":"binary-expr","locations":[{"start":{"line":384,"column":16},"end":{"line":384,"column":43}},{"start":{"line":384,"column":47},"end":{"line":384,"column":79}}]},"23":{"line":398,"type":"binary-expr","locations":[{"start":{"line":398,"column":15},"end":{"line":398,"column":23}},{"start":{"line":398,"column":27},"end":{"line":398,"column":55}},{"start":{"line":398,"column":59},"end":{"line":398,"column":93}}]},"24":{"line":399,"type":"if","locations":[{"start":{"line":399,"column":12},"end":{"line":399,"column":12}},{"start":{"line":399,"column":12},"end":{"line":399,"column":12}}]},"25":{"line":407,"type":"if","locations":[{"start":{"line":407,"column":11},"end":{"line":407,"column":11}},{"start":{"line":407,"column":11},"end":{"line":407,"column":11}}]},"26":{"line":424,"type":"cond-expr","locations":[{"start":{"line":424,"column":32},"end":{"line":424,"column":59}},{"start":{"line":424,"column":62},"end":{"line":424,"column":67}}]},"27":{"line":438,"type":"cond-expr","locations":[{"start":{"line":438,"column":51},"end":{"line":438,"column":70}},{"start":{"line":438,"column":73},"end":{"line":438,"column":77}}]},"28":{"line":442,"type":"if","locations":[{"start":{"line":442,"column":8},"end":{"line":442,"column":8}},{"start":{"line":442,"column":8},"end":{"line":442,"column":8}}]},"29":{"line":514,"type":"cond-expr","locations":[{"start":{"line":514,"column":49},"end":{"line":514,"column":76}},{"start":{"line":514,"column":79},"end":{"line":514,"column":83}}]},"30":{"line":526,"type":"if","locations":[{"start":{"line":526,"column":8},"end":{"line":526,"column":8}},{"start":{"line":526,"column":8},"end":{"line":526,"column":8}}]},"31":{"line":542,"type":"if","locations":[{"start":{"line":542,"column":8},"end":{"line":542,"column":8}},{"start":{"line":542,"column":8},"end":{"line":542,"column":8}}]},"32":{"line":563,"type":"binary-expr","locations":[{"start":{"line":563,"column":24},"end":{"line":563,"column":43}},{"start":{"line":563,"column":47},"end":{"line":563,"column":51}}]},"33":{"line":564,"type":"binary-expr","locations":[{"start":{"line":564,"column":24},"end":{"line":564,"column":46}},{"start":{"line":564,"column":50},"end":{"line":564,"column":54}}]},"34":{"line":565,"type":"binary-expr","locations":[{"start":{"line":565,"column":24},"end":{"line":565,"column":31}},{"start":{"line":565,"column":35},"end":{"line":565,"column":48}}]},"35":{"line":566,"type":"binary-expr","locations":[{"start":{"line":566,"column":24},"end":{"line":566,"column":31}},{"start":{"line":566,"column":35},"end":{"line":566,"column":49}}]},"36":{"line":568,"type":"if","locations":[{"start":{"line":568,"column":8},"end":{"line":568,"column":8}},{"start":{"line":568,"column":8},"end":{"line":568,"column":8}}]},"37":{"line":568,"type":"binary-expr","locations":[{"start":{"line":568,"column":12},"end":{"line":568,"column":18}},{"start":{"line":569,"column":16},"end":{"line":569,"column":38}},{"start":{"line":570,"column":20},"end":{"line":570,"column":29}},{"start":{"line":571,"column":20},"end":{"line":571,"column":52}},{"start":{"line":572,"column":20},"end":{"line":572,"column":60}}]},"38":{"line":583,"type":"if","locations":[{"start":{"line":583,"column":8},"end":{"line":583,"column":8}},{"start":{"line":583,"column":8},"end":{"line":583,"column":8}}]},"39":{"line":583,"type":"binary-expr","locations":[{"start":{"line":583,"column":12},"end":{"line":583,"column":19}},{"start":{"line":583,"column":24},"end":{"line":583,"column":33}},{"start":{"line":583,"column":37},"end":{"line":583,"column":75}}]},"40":{"line":601,"type":"if","locations":[{"start":{"line":601,"column":8},"end":{"line":601,"column":8}},{"start":{"line":601,"column":8},"end":{"line":601,"column":8}}]},"41":{"line":618,"type":"binary-expr","locations":[{"start":{"line":618,"column":24},"end":{"line":618,"column":46}},{"start":{"line":618,"column":50},"end":{"line":618,"column":67}}]},"42":{"line":641,"type":"binary-expr","locations":[{"start":{"line":641,"column":24},"end":{"line":641,"column":46}},{"start":{"line":641,"column":50},"end":{"line":641,"column":67}}]},"43":{"line":686,"type":"if","locations":[{"start":{"line":686,"column":8},"end":{"line":686,"column":8}},{"start":{"line":686,"column":8},"end":{"line":686,"column":8}}]},"44":{"line":691,"type":"if","locations":[{"start":{"line":691,"column":8},"end":{"line":691,"column":8}},{"start":{"line":691,"column":8},"end":{"line":691,"column":8}}]},"45":{"line":692,"type":"binary-expr","locations":[{"start":{"line":692,"column":23},"end":{"line":692,"column":56}},{"start":{"line":692,"column":60},"end":{"line":692,"column":75}}]},"46":{"line":720,"type":"binary-expr","locations":[{"start":{"line":720,"column":24},"end":{"line":720,"column":46}},{"start":{"line":720,"column":50},"end":{"line":720,"column":67}}]}},"code":["(function () { YUI.add('gallery-sm-editor-base', function (Y, NAME) {","","/*jshint expr:true, onevar:false */","","Y.Node.DOM_EVENTS.paste = 1;","","/**","Provides `Y.Editor.Base`, the core implementation of the SmugMug editor.","","@module gallery-sm-editor","@submodule gallery-sm-editor-base","**/","","/**","Base implementation of the SmugMug editor. Provides core editor functionality,","but no undo stack, keyboard shortcuts, etc.","","Provides support for the following commands:","","- insertHTML","- insertText","","@class Editor.Base","@constructor","@extends View","**/","","var doc = Y.config.doc,"," win = Y.config.win,"," getClassName = Y.ClassNameManager.getClassName,"," EDOM = Y.Editor.DOM;","","/**","Fired after this editor loses focus.","","@event blur","**/","var EVT_BLUR = 'blur';","","/**","Fired after this editor receives focus.","","@event focus","**/","var EVT_FOCUS = 'focus';","","/**","Fired after this editor is rendered.","","@event render","**/","var EVT_RENDER = 'render';","","/**","Fired when this editor's selection changes.","","@event selectionChange","@param {Range} prevRange Range that was previously selected, or `null` if there"," was no previous selection.","@param {Range} range Range that's now selected, or `null` if the current"," selection is empty or outside the editor.","@param {Selection} selection Reference to this editor's Selection instance.","**/","var EVT_SELECTION_CHANGE = 'selectionChange';","","var EditorBase = Y.Base.create('editorBase', Y.View, [], {"," // -- Public Properties ----------------------------------------------------",""," /**"," CSS class names used by this editor.",""," @property {Object} classNames"," @param {String} cursor Class name used for a placeholder node that"," represents the cursor position."," @param {String} editor Class name used for the editor's container."," @param {String} input Class name used for the WYSIWYG YUI Editor frame that"," will receive user input."," **/"," classNames: {"," cursor: getClassName('sm-editor-cursor', true),"," editor: getClassName('sm-editor', true),"," input : getClassName('sm-editor-input', true)"," },",""," /**"," `Y.Selection` instance representing the current document selection.",""," The selection object's state always reflects the current selection, so it"," will update when the selection changes. If you need to retain the state of a"," past selection, hold onto a Range instance representing that selection.",""," Also, beware: this selection object reflects the current selection in the"," entire browser document, not just within this editor.",""," @property {Selection} selection"," **/",""," /**"," Hash of commands supported by this editor.",""," Names should correspond with valid `execCommand()` command names. Values"," are properties in the following format:",""," @property {Object} commands"," @param {Function|String} commandFn"," @param {Function|String} [queryFn]"," **/"," commands: {"," insertHTML: {"," commandFn: '_insertHTML'"," },",""," insertText: {"," commandFn: '_insertText'"," }"," },","",""," supportedTags: 'a, br, div, p, span',",""," // -- Protected Properties -------------------------------------------------",""," // -- Lifecycle ------------------------------------------------------------",""," initializer: function () {"," this.selection = new Y.Selection();"," this.selectors = {};",""," this._cursorHTML = '';",""," Y.Object.each(this.classNames, function (name, key) {"," this.selectors[key] = '.' + name;"," }, this);",""," this._attachEvents();"," },",""," destructor: function () {"," this._detachEvents();",""," this.selection = null;"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Removes focus from this editor.",""," @method blur"," @chainable"," **/"," blur: function () {"," if (this._rendered) {"," this._inputNode.blur();"," }",""," return this;"," },",""," /**"," Executes a given editor command.",""," By default, the only supported commands are:",""," - insertHTML"," - insertText",""," See individual editor extensions for additionally supported commands",""," @method command"," @param {String|Function} name Command name or function to execute."," @param {Any} [args]* 0..n arguments to pass to the command"," @return {Any} Value of the specified command."," **/"," command: function (name) {"," var command, ret,"," fn = name,"," args = Y.Array(arguments, 1, true);",""," if ('string' === typeof fn) {"," command = this.commands[fn];",""," if (command) {"," fn = command.commandFn;",""," if (command.style) {"," args.unshift(name);"," }"," }",""," if ('string' === typeof fn) {"," fn = this[fn];"," }"," }",""," this.focus();",""," if ('function' === typeof fn) {"," ret = fn.apply(this, args);",""," this._updateSelection({force: true});"," }",""," return ret || this.query(name);"," },",""," /**"," Focuses this editor.",""," @method focus"," @chainable"," **/"," focus: function () {"," if (this._rendered) {"," this._inputNode.focus();"," }",""," return this;"," },",""," /**"," Gets the value of a specified editor command.",""," See "," for a list of possible commands.",""," @method query"," @param {String} name Command name."," @return {Boolean|String} Value of the specified command."," **/"," query: function (name) {"," var command, ret,"," fn = name,"," args = Y.Array(arguments, 0, true);",""," if ('string' === typeof fn) {"," command = this.commands[fn];",""," if (command) {"," fn = command.queryFn;"," }",""," fn = this[fn];"," }",""," this.focus();",""," if ('function' === typeof fn) {"," ret = fn.apply(this, args);"," }",""," return ret;"," },",""," /**"," Renders this editor into its container and appends the container to the"," document if necessary.",""," @method render"," @chainable"," **/"," render: function () {"," var container = this.get('container'),"," inputNode = container.one(this.selectors.input);",""," container.addClass(this.classNames.editor);",""," if (!inputNode) {"," inputNode = container.appendChild('')"," .addClass(this.classNames.input);"," }",""," var html = this.get('html'),"," text = this.get('text');",""," if (html) {"," inputNode.setHTML(html);"," } else if (text) {"," inputNode.set('text', text);"," } else {"," inputNode.setHTML('
');"," }",""," inputNode.set('contentEditable', true);",""," this._inputNode = inputNode;"," this._rendered = true;",""," this.fire(EVT_RENDER);",""," return this;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Attaches editor events.",""," @method _attachEvents"," @protected"," **/"," _attachEvents: function () {"," if (this._events) {"," return;"," }",""," var container = this.get('container'),"," selectors = this.selectors;",""," this._events = ["," container.delegate('blur', this._onBlur, selectors.input, this),"," container.delegate('copy', this._onCopy, selectors.input, this),"," container.delegate('cut', this._onCut, selectors.input, this),"," container.delegate('dblclick', this._onDblClick, selectors.input, this),"," container.delegate('focus', this._onFocus, selectors.input, this),"," container.delegate('paste', this._onPaste, selectors.input, this)"," ];"," },",""," /**"," Detaches editor events.",""," @method _detachEvents"," @protected"," **/"," _detachEvents: function () {"," if (this._events) {"," new Y.EventHandle(this._events).detach();"," this._events = null;"," }"," },",""," /**"," Wrapper for native the native `execCommand()` that verifies that the command"," is valid in the current state",""," @method _execCommand"," @param {String} name Command name."," @param {Boolean|String} value Command value."," @protected"," **/"," _execCommand: function (name, value) {"," if (!doc.queryCommandSupported(name) || !doc.queryCommandEnabled(name)) {"," return;"," }",""," doc.execCommand(name, false, value);"," },",""," /**"," Getter for the `html` attribute.",""," @method _getHTML"," @param {HTML} value Internal value."," @return {HTML} HTML."," @protected"," **/"," _getHTML: function (value) {"," return this._rendered ? this._inputNode.getHTML() : value;"," },",""," /**"," Returns nodes containing any part of the given `range` matching the"," given `selector`",""," @method _getNodes"," @param {Range} range"," @param {String} selector"," @return {NodeList}"," @protected"," **/"," _getNodes: function (range, selector) {"," var startNode, startOffset,"," testNode, nodes = [];",""," range = range.clone().shrink();",""," startNode = range.startNode();"," startOffset = range.startOffset();",""," if (range.isCollapsed()) {"," var childNodes = startNode.get('childNodes');",""," if (!EDOM.isTextNode(startNode) && childNodes.item(startOffset - 1)) {"," // the range is collapsed so it will never get traversed. grab"," // the exact node referenced by startNode/startOffset and work"," // backwards from there"," testNode = childNodes.item(startOffset - 1);"," } else {"," testNode = startNode;"," }"," } else {"," // traversal will include the startNode, so start off with the"," // startNodes parent"," testNode = startNode.get('parentNode');"," }",""," while (testNode && testNode !== this._inputNode && this._inputNode.contains(testNode)) {"," if (testNode.test(selector)) {"," nodes.push(testNode);"," }",""," testNode = testNode.get('parentNode');"," }",""," range.traverse(function (node) {"," if (node.test(selector)) {"," nodes.push(node);"," }"," });",""," return Y.all(nodes);"," },",""," /**"," Getter for the `text` attribute.",""," @method _getText"," @param {String} value Internal value."," @return {String} Text."," @protected"," **/"," _getText: function (value) {"," return this._rendered ? this._inputNode.get('text') : value;"," },",""," /**"," Inserts the specified _html_ at the current selection point, deleting the"," current selection if there is one.",""," @method _insertHTML"," @param {HTML|HTMLElement|Node} html HTML to insert, in the form of an HTML"," string, HTMLElement, or Node instance."," @return {Node} Node instance representing the inserted HTML."," @protected"," **/"," _insertHTML: function (html) {"," var node = typeof html === 'string' ? Y.Node.create(html) : html,"," selection = this.selection,"," range = selection.range();",""," if (!range) {"," return;"," }",""," // expanding the range before deleting contents makes sure"," // the entire node is deleted, if possible."," range.expand({stopAt: this._inputNode});",""," node = range.deleteContents().insertNode(node);",""," range.collapse();",""," selection.select(range);",""," return node;"," },",""," /**"," Inserts a `` at the current selection point containing a preformatted"," tab character.",""," @method _insertTab"," @protected"," **/"," _insertTab: function () {"," this._insertHTML('\\t');"," },",""," /**"," Inserts the specified plain _text_ at the current selection point, deleting"," the current selection if there is one.",""," @method _insertText"," @param {String} text Text to insert."," @return {Node} Node instance representing the inserted text node."," @protected"," **/"," _insertText: function (text) {"," // replace any newlines with spaces. browsers will convert"," // back to back newlines into paragraphs in the `formatBlock` command"," // which could cause nesting issues depending on where the text is"," // being inserted"," text = text.replace(/\\n+/g, ' ');",""," return this._insertHTML(doc.createTextNode(text));"," },","",""," /**"," No-op function for allowing default browser implementations.",""," Use as the `commandFn` in a command config when the default browser"," behavior is desired. Allows for the command stack to execute and"," selection to be updated",""," @method _noCommand"," @protected"," **/"," _noCommand: function () {"," // no-op"," },","",""," /**"," Wrapper for the native `queryCommandValue()` method",""," @method _queryCommandValue"," @param {String} name Command name."," @return {Boolean|String} Command value."," @protected"," **/"," _queryCommandValue: function (name) {"," return doc.queryCommandSupported(name) ? doc.queryCommandValue(name) : null;"," },",""," /**"," Setter for the `html` attribute.",""," @method _setHTML"," @param {HTML} value HTML."," @return {HTML} HTML."," @protected"," **/"," _setHTML: function (value) {"," if (this._rendered) {"," this._inputNode.setHTML(value);"," }",""," return value;"," },",""," /**"," Setter for the `text` attribute.",""," @method _setText"," @param {String} value Text."," @return {String} Text."," @protected"," **/"," _setText: function (value) {"," if (this._rendered) {"," this._inputNode.set('text', value);"," }",""," return value;"," },",""," /**"," Refreshes the editor's internal knowledge of the current document selection"," state and fires a `selectionChange` event if the selection has changed since"," it was last refreshed.",""," @method _updateSelection"," @param {Object} [options] Options."," @param {Boolean} [options.force=false] If `true`, the internal selection"," state will be updated regardless of if the selection changed."," @param {Boolean} [options.silent=false] If `true`, the `selectionChange`"," event will be suppressed."," @protected"," **/"," _updateSelection: function (options) {"," var prevRange = this._selectedRange || null,"," newRange = this.selection.range() || null,"," force = options && options.force,"," silent = options && options.silent;",""," if (!force && ("," newRange === prevRange || ("," prevRange &&"," prevRange.isEquivalent(newRange) &&"," prevRange.toHTML() === newRange.toHTML()"," )"," )"," ) {"," return;"," }",""," this._selectedRange = newRange;",""," // Only fire an event if options.silent is falsy and the new range is"," // either null or is entirely inside this editor."," if (!silent && (!newRange || newRange.isInsideNode(this._inputNode))) {"," this.fire(EVT_SELECTION_CHANGE, {"," prevRange: prevRange,"," range : newRange,"," selection: this.selection"," });"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `blur` events on the editor.",""," @method _onBlur"," @protected"," **/"," _onBlur: function () {"," if (!this._rendered) {"," return;"," }",""," clearInterval(this._selectionMonitor);",""," this.fire(EVT_BLUR);"," },",""," /**"," Handles `copy` events on the editor.",""," @method _onCopy"," @param {EventFacade} e"," @protected"," **/"," _onCopy: function (e) {"," var clipboard = e._event.clipboardData || win.clipboardData,"," range = this.selection.range(),"," contents = range.cloneContents().getHTML();",""," e.preventDefault();",""," try {"," // IE doesn't support mime types"," clipboard.setData('text/html', contents);"," clipboard.setData('text/plain', contents);"," } catch (err) {"," clipboard.setData('text', contents);"," }"," },",""," /**"," Handles `cut` events on the editor.",""," @method _onCut"," @param {EventFacade} e"," @protected"," **/"," _onCut: function (e) {"," var clipboard = e._event.clipboardData || win.clipboardData,"," range = this.selection.range(),"," contents;",""," // expand the range to prevent any empty nodes"," // being left after `extractContents()`"," range.expand({stopAt: this._inputNode});"," contents = range.extractContents().getHTML();",""," e.preventDefault();",""," this.selection.select(range);",""," try {"," // IE doesn't support mime types"," clipboard.setData('text/html', contents);"," clipboard.setData('text/plain', contents);"," } catch (err) {"," clipboard.setData('text', contents);"," }"," },",""," /**"," Handles `dblclick` events on the editor.",""," @method _onDblClick"," @protected"," **/"," _onDblClick: function() {"," var range = this.selection.range();",""," this.selection.select(range.shrink({trim: true}));"," },",""," /**"," Handles `focus` events on the editor.",""," @method _onFocus"," @protected"," **/"," _onFocus: function () {"," var self = this,"," selection = this.selection,"," range;",""," if (!this._rendered) {"," return;"," }",""," // restore the previously selected range, or create a new range"," if (!(range = this._selectedRange)) {"," var node = this._inputNode.get('firstChild') || this._inputNode;",""," range = new Y.Range();"," range.selectNodeContents(node);"," range.collapse({toStart: true});"," }",""," selection.select(range);",""," this._updateSelection();",""," clearInterval(this._selectionMonitor);",""," this._selectionMonitor = setInterval(function () {"," self._updateSelection();"," }, 200);",""," this.fire(EVT_FOCUS);"," },",""," /**"," Handles `paste` events on the editor.",""," @method _onPaste"," @param {EventFacade} e"," @protected"," **/"," _onPaste: function (e) {"," var clipboard = e._event.clipboardData || win.clipboardData,"," contents = clipboard.getData('text');",""," e.preventDefault();",""," // create a document-fragment with the pasted contents"," // then get the text content of the fragment. effectively"," // strips tags."," contents = Y.Node.create(contents).get('text');",""," this.command('insertText', contents);"," }","}, {"," ATTRS: {"," /**"," HTML content of this editor.",""," @attribute {HTML} html"," @default ''"," **/"," html: {"," getter: '_getHTML',"," setter: '_setHTML',"," value : ''"," },",""," /**"," Form field name to use for the hidden `