smalruby-editor 0.2.4-x86-mingw32 → 0.2.5-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of smalruby-editor might be problematic. Click here for more details.

Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -0
  3. data/Guardfile +8 -1
  4. data/app/assets/javascripts/blocks/hardware.js.coffee.erb +11 -152
  5. data/app/assets/javascripts/msg/en_us.js +5 -5
  6. data/app/assets/javascripts/msg/ja.js +5 -5
  7. data/app/assets/javascripts/views/signin_modal_view.js.coffee.erb +0 -0
  8. data/app/controllers/sessions_controller.rb +0 -0
  9. data/app/helpers/sessions_helper.rb +4 -0
  10. data/app/models/concerns/ruby_to_block/block/hardware_operation.rb +11 -0
  11. data/app/models/concerns/ruby_to_block/block/{hardware_smalrubot_s1_led_turn_on_or_off.rb → hardware_smalrubot_action.rb} +8 -5
  12. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_action_with_sec.rb +25 -0
  13. data/app/models/concerns/ruby_to_block/block/{hardware_smalrubot_v3_motor_speed.rb → hardware_smalrubot_dc_motor_power_ratio.rb} +8 -5
  14. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_dc_motor_set_power_ratio.rb +23 -0
  15. data/app/models/concerns/ruby_to_block/block/{hardware_smalrubot_v3_led_turn_on_or_off.rb → hardware_smalrubot_led_turn_on_or_off.rb} +8 -5
  16. data/app/models/concerns/ruby_to_block/block/{hardware_smalrubot_s1_ir_photoreflector_value.rb → hardware_smalrubot_sensor_value.rb} +8 -6
  17. data/app/views/editor/_toolbox_default.html.haml +4 -7
  18. data/app/views/editor/index.html.haml +7 -18
  19. data/bin/spring +0 -0
  20. data/config/application.rb +1 -0
  21. data/lib/smalruby_editor/version.rb +1 -1
  22. data/public/assets/{application-eece3e01e35f8f689e2e282a168f6059.js → application-e64da116c4adad30e499acda9d657fb5.js} +9 -9
  23. data/public/assets/application-e64da116c4adad30e499acda9d657fb5.js.gz +0 -0
  24. data/public/assets/{manifest-93f591b19a2a69655db7b53fa00d6b17.json → manifest-beef6aec1f5553cda5a2fe11ef0774ea.json} +1 -1
  25. data/public/assets/msg/{en_us-3eb2f104a6bad9c60226ff7475013874.js → en_us-a3f6b99f4b54cfaeed42452de11ab02e.js} +1 -1
  26. data/public/assets/msg/en_us-a3f6b99f4b54cfaeed42452de11ab02e.js.gz +0 -0
  27. data/public/assets/msg/ja-9323664964a9b8ede99ae16c43db5827.js +1 -0
  28. data/public/assets/msg/ja-9323664964a9b8ede99ae16c43db5827.js.gz +0 -0
  29. data/smalruby-editor.gemspec +1 -1
  30. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_s1_led_turn_on_or_off.feature +8 -8
  31. data/spec/acceptance/block_mode/blocks/hardware/{smalrubot_v3_motor_speed.feature → smalrubot_v3_dc_motor_power_ratio.feature} +12 -12
  32. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_led_turn_on_or_off.feature +8 -8
  33. data/spec/acceptance/block_mode/blocks/hardware/{smalrubot_s1_ir_photoreflector_value.feature → smalrubot_v3_sensor_value.feature} +7 -7
  34. data/spec/models/concerns/ruby_to_block/block/{hardware__smalrubot_s1_spec.rb → hardware__smalrubot_spec.rb} +88 -84
  35. data/spec/spec_helper.rb +0 -0
  36. data/spec/steps/base_steps.rb +0 -0
  37. data/spec/steps/text_editor_steps.rb +0 -0
  38. metadata +23 -36
  39. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_s1_action.rb +0 -13
  40. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_s1_action_with_sec.rb +0 -14
  41. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_s1_dc_motor_power_ratio.rb +0 -26
  42. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_s1_dc_motor_set_power_ratio.rb +0 -21
  43. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_v3_action.rb +0 -22
  44. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_v3_action_with_sec.rb +0 -24
  45. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_v3_light_sensor_value.rb +0 -28
  46. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_v3_motor_set_speed.rb +0 -21
  47. data/app/models/concerns/ruby_to_block/block/hardware_smalrubot_v3_touch_sensor_pressed_or_released.rb +0 -29
  48. data/public/assets/application-eece3e01e35f8f689e2e282a168f6059.js.gz +0 -0
  49. data/public/assets/msg/en_us-3eb2f104a6bad9c60226ff7475013874.js.gz +0 -0
  50. data/public/assets/msg/ja-8450d011b1f093dc4b6b7c467e5bcae4.js +0 -1
  51. data/public/assets/msg/ja-8450d011b1f093dc4b6b7c467e5bcae4.js.gz +0 -0
  52. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_light_sensor_value.feature +0 -92
  53. data/spec/acceptance/block_mode/blocks/hardware/smalrubot_v3_touch_sensor_pressed_or_released.feature +0 -108
  54. data/spec/models/concerns/ruby_to_block/block/hardware__smalrubot_v3_spec.rb +0 -433
@@ -1,19 +1,22 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module RubyToBlock
3
3
  module Block
4
- class HardwareSmalrubotV3LedTurnOnOrOff < CharacterMethodCall
4
+ class HardwareSmalrubotLedTurnOnOrOff < CharacterMethodCall
5
5
  include HardwareOperation
6
6
 
7
7
  # rubocop:disable LineLength
8
- blocknize '^\s*' + CHAR_RE +
9
- 'smalrubot_v3\.(red|green)_led.(turn_on|turn_off)' +
10
- '\s*$',
8
+ blocknize ['^\s*',
9
+ CHAR_RE,
10
+ SMALRUBOT_RE, '\.',
11
+ ON_OFF_RE, '_', LOR_RE, '_led',
12
+ '\s*$'].join(''),
11
13
  statement: true, inline: true
12
14
  # rubocop:enable LineLength
13
15
 
14
16
  def self.process_match_data(md, context)
15
17
  md2 = regexp.match(md[type])
16
- block = new(fields: { COLOUR: md2[2], OOO: md2[3] })
18
+ block = new(fields: { LOR: md2[4], OOO: md2[3] })
19
+ block.smalrubot_name = md2[2]
17
20
  add_character_method_call_block(context, md2[1], block)
18
21
  true
19
22
  end
@@ -1,14 +1,15 @@
1
1
  module RubyToBlock
2
2
  module Block
3
- class HardwareSmalrubotS1IrPhotoreflectorValue < Value
3
+ class HardwareSmalrubotSensorValue < Value
4
4
  include CharacterOperation
5
5
  include HardwareOperation
6
6
 
7
7
  # rubocop:disable LineLength
8
- blocknize '^\s*' + CHAR_RE +
9
- 'smalrubot_s1\.' +
10
- LOR_RE + '_ir_photoreflector_value' +
11
- '\s*$',
8
+ blocknize ['^\s*',
9
+ CHAR_RE,
10
+ SMALRUBOT_RE, '.',
11
+ LOR_RE, '_sensor_value',
12
+ '\s*$'].join(''),
12
13
  value: true
13
14
  # rubocop:enable LineLength
14
15
 
@@ -18,7 +19,8 @@ module RubyToBlock
18
19
  character = get_character(context, md2[1])
19
20
  return false if context.receiver && context.receiver != character
20
21
 
21
- block = new(fields: { LOR: md2[2] })
22
+ block = new(fields: { LOR: md2[3] })
23
+ block.smalrubot_name = md2[2]
22
24
  context.add_value(block)
23
25
  block.character = character
24
26
 
@@ -146,7 +146,7 @@
146
146
  forward
147
147
  = toolbox_number_value('SEC', 0.5)
148
148
 
149
- %block{type: "#{category}_#{subcategory}_motor_set_speed"}
149
+ %block{type: "#{category}_#{subcategory}_dc_motor_set_power_ratio"}
150
150
  = toolbox_number_value('SPEED', 100)
151
151
 
152
152
  - if SmalrubyEditor::Config.enabled?('enabled_smalrubot_s1_blocks_on_default')
@@ -240,8 +240,6 @@
240
240
  - if SmalrubyEditor::Config.enabled?('enabled_smalrubot_v3_blocks_on_default')
241
241
  - subcategory = 'smalrubot_v3'
242
242
  %block{type: "#{category}_#{subcategory}_led_turn_on_or_off"}
243
- %field{name: 'COLOUR'}<
244
- red
245
243
  %field{name: 'OOO'}<
246
244
  turn_on
247
245
 
@@ -395,14 +393,13 @@
395
393
 
396
394
  - if SmalrubyEditor::Config.enabled?('enabled_smalrubot_v3_blocks_on_default')
397
395
  - subcategory = 'smalrubot_v3'
398
- %block{type: "#{category}_#{subcategory}_touch_sensor_pressed_or_released"}
399
- %block{type: "#{category}_#{subcategory}_light_sensor_value"}
400
- %block{type: "#{category}_#{subcategory}_motor_speed"}
396
+ %block{type: "#{category}_#{subcategory}_sensor_value"}
397
+ %block{type: "#{category}_#{subcategory}_dc_motor_power_ratio"}
401
398
 
402
399
  - if SmalrubyEditor::Config.enabled?('enabled_smalrubot_s1_blocks_on_default')
403
400
  - category = 'hardware'
404
401
  - subcategory = 'smalrubot_s1'
405
- %block{type: "#{category}_#{subcategory}_ir_photoreflector_value"}
402
+ %block{type: "#{category}_#{subcategory}_sensor_value"}
406
403
  %block{type: "#{category}_#{subcategory}_dc_motor_power_ratio"}
407
404
 
408
405
  - category = 'operators'
@@ -43,14 +43,9 @@
43
43
  %i.icon-off
44
44
  = t('.reset')
45
45
  - if standalone?
46
- - if session[:username]
47
- %button#signout-button.btn{class: "btn-primary"}<
48
- %i.icon-eject
49
- = t('.logout')
50
- - else
51
- %button#signout-button.btn{class: "btn-primary", style: "display: none"}<
52
- %i.icon-eject
53
- = t('.logout')
46
+ %button#signout-button.btn{class: "btn-primary", style: "display: #{signed_in? ? '' : 'none'}"}<
47
+ %i.icon-eject
48
+ = t('.logout')
54
49
 
55
50
  - else
56
51
  .btn-group
@@ -84,16 +79,10 @@
84
79
  = t('.reset')
85
80
  - if standalone?
86
81
  %li
87
- - if session[:username]
88
- %a#signout-button
89
- %h4
90
- %i.icon-eject
91
- = t('.logout')
92
- - else
93
- %a#signout-button{style: "display: none"}
94
- %h4
95
- %i.icon-eject
96
- = t('.logout')
82
+ %a#signout-button{style: "display: #{signed_in? ? '' : 'none'}"}
83
+ %h4
84
+ %i.icon-eject
85
+ = t('.logout')
97
86
 
98
87
  - if standalone?
99
88
  - if session[:username]
data/bin/spring CHANGED
File without changes
@@ -10,6 +10,7 @@ Bundler.require(:default, Rails.env) unless Rails.env == 'standalone'
10
10
  module SmalrubyEditor
11
11
  class Application < Rails::Application
12
12
  config.time_zone = 'Tokyo'
13
+ I18n.enforce_available_locales = true
13
14
  config.i18n.default_locale = :ja
14
15
  config.colorize_logging = false
15
16
  config.filter_parameters += [:data]
@@ -1,3 +1,3 @@
1
1
  module SmalrubyEditor
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
@@ -1,10 +1,10 @@
1
- !function(e,t){function o(e){var t=pt[e]={};return Z.each(e.split(tt),function(e,o){t[o]=!0}),t}function n(e,o,n){if(n===t&&1===e.nodeType){var i="data-"+o.replace(mt,"-$1").toLowerCase();if(n=e.getAttribute(i),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:ft.test(n)?Z.parseJSON(n):n}catch(r){}Z.data(e,o,n)}else n=t}return n}function i(e){var t;for(t in e)if(("data"!==t||!Z.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function r(){return!1}function s(){return!0}function l(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function a(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function c(e,t,o){if(t=t||0,Z.isFunction(t))return Z.grep(e,function(e,n){var i=!!t.call(e,n,e);return i===o});if(t.nodeType)return Z.grep(e,function(e){return e===t===o});if("string"==typeof t){var n=Z.grep(e,function(e){return 1===e.nodeType});if(Mt.test(t))return Z.filter(t,n,!o);t=Z.filter(t,n)}return Z.grep(e,function(e){return Z.inArray(e,t)>=0===o})}function g(e){var t=Ht.split("|"),o=e.createDocumentFragment();if(o.createElement)for(;t.length;)o.createElement(t.pop());return o}function u(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e,t){if(1===t.nodeType&&Z.hasData(e)){var o,n,i,r=Z._data(e),s=Z._data(t,r),l=r.events;if(l){delete s.handle,s.events={};for(o in l)for(n=0,i=l[o].length;i>n;n++)Z.event.add(t,o,l[o][n])}s.data&&(s.data=Z.extend({},s.data))}}function d(e,t){var o;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),o=t.nodeName.toLowerCase(),"object"===o?(t.parentNode&&(t.outerHTML=e.outerHTML),Z.support.html5Clone&&e.innerHTML&&!Z.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===o&&Xt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===o?t.selected=e.defaultSelected:"input"===o||"textarea"===o?t.defaultValue=e.defaultValue:"script"===o&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(Z.expando))}function p(e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName("*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll("*"):[]}function f(e){Xt.test(e.type)&&(e.defaultChecked=e.checked)}function m(e,t){if(t in e)return t;for(var o=t.charAt(0).toUpperCase()+t.slice(1),n=t,i=_o.length;i--;)if(t=_o[i]+o,t in e)return t;return n}function y(e,t){return e=t||e,"none"===Z.css(e,"display")||!Z.contains(e.ownerDocument,e)}function _(e,t){for(var o,n,i=[],r=0,s=e.length;s>r;r++)o=e[r],o.style&&(i[r]=Z._data(o,"olddisplay"),t?(!i[r]&&"none"===o.style.display&&(o.style.display=""),""===o.style.display&&y(o)&&(i[r]=Z._data(o,"olddisplay",B(o.nodeName)))):(n=oo(o,"display"),!i[r]&&"none"!==n&&Z._data(o,"olddisplay",n)));for(r=0;s>r;r++)o=e[r],o.style&&(t&&"none"!==o.style.display&&""!==o.style.display||(o.style.display=t?i[r]||"":"none"));return e}function E(e,t,o){var n=go.exec(t);return n?Math.max(0,n[1]-(o||0))+(n[2]||"px"):t}function v(e,t,o,n){for(var i=o===(n?"border":"content")?4:"width"===t?1:0,r=0;4>i;i+=2)"margin"===o&&(r+=Z.css(e,o+yo[i],!0)),n?("content"===o&&(r-=parseFloat(oo(e,"padding"+yo[i]))||0),"margin"!==o&&(r-=parseFloat(oo(e,"border"+yo[i]+"Width"))||0)):(r+=parseFloat(oo(e,"padding"+yo[i]))||0,"padding"!==o&&(r+=parseFloat(oo(e,"border"+yo[i]+"Width"))||0));return r}function C(e,t,o){var n="width"===t?e.offsetWidth:e.offsetHeight,i=!0,r=Z.support.boxSizing&&"border-box"===Z.css(e,"boxSizing");if(0>=n||null==n){if(n=oo(e,t),(0>n||null==n)&&(n=e.style[t]),uo.test(n))return n;i=r&&(Z.support.boxSizingReliable||n===e.style[t]),n=parseFloat(n)||0}return n+v(e,t,o||(r?"border":"content"),i)+"px"}function B(e){if(po[e])return po[e];var t=Z("<"+e+">").appendTo($.body),o=t.css("display");return t.remove(),("none"===o||""===o)&&(no=$.body.appendChild(no||Z.extend($.createElement("iframe"),{frameBorder:0,width:0,height:0})),io&&no.createElement||(io=(no.contentWindow||no.contentDocument).document,io.write("<!doctype html><html><body>"),io.close()),t=io.body.appendChild(io.createElement(e)),o=oo(t,"display"),$.body.removeChild(no)),po[e]=o,o}function k(e,t,o,n){var i;if(Z.isArray(t))Z.each(t,function(t,i){o||Co.test(e)?n(e,i):k(e+"["+("object"==typeof i?t:"")+"]",i,o,n)});else if(o||"object"!==Z.type(t))n(e,t);else for(i in t)k(e+"["+i+"]",t[i],o,n)}function b(e){return function(t,o){"string"!=typeof t&&(o=t,t="*");var n,i,r,s=t.toLowerCase().split(tt),l=0,a=s.length;if(Z.isFunction(o))for(;a>l;l++)n=s[l],r=/^\+/.test(n),r&&(n=n.substr(1)||"*"),i=e[n]=e[n]||[],i[r?"unshift":"push"](o)}}function A(e,o,n,i,r,s){r=r||o.dataTypes[0],s=s||{},s[r]=!0;for(var l,a=e[r],c=0,g=a?a.length:0,u=e===xo;g>c&&(u||!l);c++)l=a[c](o,n,i),"string"==typeof l&&(!u||s[l]?l=t:(o.dataTypes.unshift(l),l=A(e,o,n,i,l,s)));return(u||!l)&&!s["*"]&&(l=A(e,o,n,i,"*",s)),l}function T(e,o){var n,i,r=Z.ajaxSettings.flatOptions||{};for(n in o)o[n]!==t&&((r[n]?e:i||(i={}))[n]=o[n]);i&&Z.extend(!0,e,i)}function S(e,o,n){var i,r,s,l,a=e.contents,c=e.dataTypes,g=e.responseFields;for(r in g)r in n&&(o[g[r]]=n[r]);for(;"*"===c[0];)c.shift(),i===t&&(i=e.mimeType||o.getResponseHeader("content-type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){c.unshift(r);break}if(c[0]in n)s=c[0];else{for(r in n){if(!c[0]||e.converters[r+" "+c[0]]){s=r;break}l||(l=r)}s=s||l}return s?(s!==c[0]&&c.unshift(s),n[s]):void 0}function R(e,t){var o,n,i,r,s=e.dataTypes.slice(),l=s[0],a={},c=0;if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),s[1])for(o in e.converters)a[o.toLowerCase()]=e.converters[o];for(;i=s[++c];)if("*"!==i){if("*"!==l&&l!==i){if(o=a[l+" "+i]||a["* "+i],!o)for(n in a)if(r=n.split(" "),r[1]===i&&(o=a[l+" "+r[0]]||a["* "+r[0]])){o===!0?o=a[n]:a[n]!==!0&&(i=r[0],s.splice(c--,0,i));break}if(o!==!0)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(g){return{state:"parsererror",error:o?g:"No conversion from "+l+" to "+i}}}l=i}return{state:"success",data:t}}function I(){try{return new e.XMLHttpRequest}catch(t){}}function D(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function w(){return setTimeout(function(){Yo=t},0),Yo=Z.now()}function L(e,t){Z.each(t,function(t,o){for(var n=(en[t]||[]).concat(en["*"]),i=0,r=n.length;r>i;i++)if(n[i].call(e,t,o))return})}function F(e,t,o){var n,i=0,r=Jo.length,s=Z.Deferred().always(function(){delete l.elem}),l=function(){for(var t=Yo||w(),o=Math.max(0,a.startTime+a.duration-t),n=1-(o/a.duration||0),i=0,r=a.tweens.length;r>i;i++)a.tweens[i].run(n);return s.notifyWith(e,[a,n,o]),1>n&&r?o:(s.resolveWith(e,[a]),!1)},a=s.promise({elem:e,props:Z.extend({},t),opts:Z.extend(!0,{specialEasing:{}},o),originalProperties:t,originalOptions:o,startTime:Yo||w(),duration:o.duration,tweens:[],createTween:function(t,o){var n=Z.Tween(e,a.opts,t,o,a.opts.specialEasing[t]||a.opts.easing);return a.tweens.push(n),n},stop:function(t){for(var o=0,n=t?a.tweens.length:0;n>o;o++)a.tweens[o].run(1);return t?s.resolveWith(e,[a,t]):s.rejectWith(e,[a,t]),this}}),c=a.props;for(O(c,a.opts.specialEasing);r>i;i++)if(n=Jo[i].call(a,e,c,a.opts))return n;return L(a,c),Z.isFunction(a.opts.start)&&a.opts.start.call(e,a),Z.fx.timer(Z.extend(l,{anim:a,queue:a.opts.queue,elem:e})),a.progress(a.opts.progress).done(a.opts.done,a.opts.complete).fail(a.opts.fail).always(a.opts.always)}function O(e,t){var o,n,i,r,s;for(o in e)if(n=Z.camelCase(o),i=t[n],r=e[o],Z.isArray(r)&&(i=r[1],r=e[o]=r[0]),o!==n&&(e[n]=r,delete e[o]),s=Z.cssHooks[n],s&&"expand"in s){r=s.expand(r),delete e[n];for(o in r)o in e||(e[o]=r[o],t[o]=i)}else t[n]=i}function N(e,t,o){var n,i,r,s,l,a,c,g,u=this,h=e.style,d={},p=[],f=e.nodeType&&y(e);o.queue||(c=Z._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,g=c.empty.fire,c.empty.fire=function(){c.unqueued||g()}),c.unqueued++,u.always(function(){u.always(function(){c.unqueued--,Z.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(o.overflow=[h.overflow,h.overflowX,h.overflowY],"inline"===Z.css(e,"display")&&"none"===Z.css(e,"float")&&(Z.support.inlineBlockNeedsLayout&&"inline"!==B(e.nodeName)?h.zoom=1:h.display="inline-block")),o.overflow&&(h.overflow="hidden",Z.support.shrinkWrapBlocks||u.done(function(){h.overflow=o.overflow[0],h.overflowX=o.overflow[1],h.overflowY=o.overflow[2]}));for(n in t)if(r=t[n],qo.exec(r)){if(delete t[n],r===(f?"hide":"show"))continue;p.push(n)}if(s=p.length)for(l=Z._data(e,"fxshow")||Z._data(e,"fxshow",{}),f?Z(e).show():u.done(function(){Z(e).hide()}),u.done(function(){var t;Z.removeData(e,"fxshow",!0);for(t in d)Z.style(e,t,d[t])}),n=0;s>n;n++)i=p[n],a=u.createTween(i,f?l[i]:0),d[i]=l[i]||Z.style(e,i),i in l||(l[i]=a.start,f&&(a.end=a.start,a.start="width"===i||"height"===i?1:0))}function M(e,t,o,n,i){return new M.prototype.init(e,t,o,n,i)}function x(e,t){var o,n={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)o=yo[i],n["margin"+o]=n["padding"+o]=e;return t&&(n.opacity=n.width=e),n}function P(e){return Z.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var H,U,$=e.document,W=e.location,G=e.navigator,V=e.jQuery,K=e.$,j=Array.prototype.push,z=Array.prototype.slice,Y=Array.prototype.indexOf,X=Object.prototype.toString,q=Object.prototype.hasOwnProperty,Q=String.prototype.trim,Z=function(e,t){return new Z.fn.init(e,t,H)},J=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,et=/\S/,tt=/\s+/,ot=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,nt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,it=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,rt=/^[\],:{}\s]*$/,st=/(?:^|:|,)(?:\s*\[)+/g,lt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,at=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,ct=/^-ms-/,gt=/-([\da-z])/gi,ut=function(e,t){return(t+"").toUpperCase()},ht=function(){$.addEventListener?($.removeEventListener("DOMContentLoaded",ht,!1),Z.ready()):"complete"===$.readyState&&($.detachEvent("onreadystatechange",ht),Z.ready())},dt={};Z.fn=Z.prototype={constructor:Z,init:function(e,o,n){var i,r,s;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:nt.exec(e),i&&(i[1]||!o)){if(i[1])return o=o instanceof Z?o[0]:o,s=o&&o.nodeType?o.ownerDocument||o:$,e=Z.parseHTML(i[1],s,!0),it.test(i[1])&&Z.isPlainObject(o)&&this.attr.call(e,o,!0),Z.merge(this,e);if(r=$.getElementById(i[2]),r&&r.parentNode){if(r.id!==i[2])return n.find(e);this.length=1,this[0]=r}return this.context=$,this.selector=e,this}return!o||o.jquery?(o||n).find(e):this.constructor(o).find(e)}return Z.isFunction(e)?n.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),Z.makeArray(e,this))},selector:"",jquery:"1.8.1",length:0,size:function(){return this.length},toArray:function(){return z.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e,t,o){var n=Z.merge(this.constructor(),e);return n.prevObject=this,n.context=this.context,"find"===t?n.selector=this.selector+(this.selector?" ":"")+o:t&&(n.selector=this.selector+"."+t+"("+o+")"),n},each:function(e,t){return Z.each(this,e,t)},ready:function(e){return Z.ready.promise().done(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(z.apply(this,arguments),"slice",z.call(arguments).join(","))},map:function(e){return this.pushStack(Z.map(this,function(t,o){return e.call(t,o,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},Z.fn.init.prototype=Z.fn,Z.extend=Z.fn.extend=function(){var e,o,n,i,r,s,l=arguments[0]||{},a=1,c=arguments.length,g=!1;for("boolean"==typeof l&&(g=l,l=arguments[1]||{},a=2),"object"!=typeof l&&!Z.isFunction(l)&&(l={}),c===a&&(l=this,--a);c>a;a++)if(null!=(e=arguments[a]))for(o in e)n=l[o],i=e[o],l!==i&&(g&&i&&(Z.isPlainObject(i)||(r=Z.isArray(i)))?(r?(r=!1,s=n&&Z.isArray(n)?n:[]):s=n&&Z.isPlainObject(n)?n:{},l[o]=Z.extend(g,s,i)):i!==t&&(l[o]=i));return l},Z.extend({noConflict:function(t){return e.$===Z&&(e.$=K),t&&e.jQuery===Z&&(e.jQuery=V),Z},isReady:!1,readyWait:1,holdReady:function(e){e?Z.readyWait++:Z.ready(!0)},ready:function(e){if(e===!0?!--Z.readyWait:!Z.isReady){if(!$.body)return setTimeout(Z.ready,1);Z.isReady=!0,e!==!0&&--Z.readyWait>0||(U.resolveWith($,[Z]),Z.fn.trigger&&Z($).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===Z.type(e)},isArray:Array.isArray||function(e){return"array"===Z.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?String(e):dt[X.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==Z.type(e)||e.nodeType||Z.isWindow(e))return!1;try{if(e.constructor&&!q.call(e,"constructor")&&!q.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(o){return!1}var n;for(n in e);return n===t||q.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,o){var n;return e&&"string"==typeof e?("boolean"==typeof t&&(o=t,t=0),t=t||$,(n=it.exec(e))?[t.createElement(n[1])]:(n=Z.buildFragment([e],t,o?null:[]),Z.merge([],(n.cacheable?Z.clone(n.fragment):n.fragment).childNodes))):null},parseJSON:function(t){return t&&"string"==typeof t?(t=Z.trim(t),e.JSON&&e.JSON.parse?e.JSON.parse(t):rt.test(t.replace(lt,"@").replace(at,"]").replace(st,""))?new Function("return "+t)():(Z.error("Invalid JSON: "+t),void 0)):null},parseXML:function(o){var n,i;if(!o||"string"!=typeof o)return null;try{e.DOMParser?(i=new DOMParser,n=i.parseFromString(o,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(o))}catch(r){n=t}return(!n||!n.documentElement||n.getElementsByTagName("parsererror").length)&&Z.error("Invalid XML: "+o),n},noop:function(){},globalEval:function(t){t&&et.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ct,"ms-").replace(gt,ut)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,o,n){var i,r=0,s=e.length,l=s===t||Z.isFunction(e);if(n)if(l){for(i in e)if(o.apply(e[i],n)===!1)break}else for(;s>r&&o.apply(e[r++],n)!==!1;);else if(l){for(i in e)if(o.call(e[i],i,e[i])===!1)break}else for(;s>r&&o.call(e[r],r,e[r++])!==!1;);return e},trim:Q&&!Q.call(" ")?function(e){return null==e?"":Q.call(e)}:function(e){return null==e?"":e.toString().replace(ot,"")},makeArray:function(e,t){var o,n=t||[];return null!=e&&(o=Z.type(e),null==e.length||"string"===o||"function"===o||"regexp"===o||Z.isWindow(e)?j.call(n,e):Z.merge(n,e)),n},inArray:function(e,t,o){var n;if(t){if(Y)return Y.call(t,e,o);for(n=t.length,o=o?0>o?Math.max(0,n+o):o:0;n>o;o++)if(o in t&&t[o]===e)return o}return-1},merge:function(e,o){var n=o.length,i=e.length,r=0;if("number"==typeof n)for(;n>r;r++)e[i++]=o[r];else for(;o[r]!==t;)e[i++]=o[r++];return e.length=i,e},grep:function(e,t,o){var n,i=[],r=0,s=e.length;for(o=!!o;s>r;r++)n=!!t(e[r],r),o!==n&&i.push(e[r]);return i},map:function(e,o,n){var i,r,s=[],l=0,a=e.length,c=e instanceof Z||a!==t&&"number"==typeof a&&(a>0&&e[0]&&e[a-1]||0===a||Z.isArray(e));if(c)for(;a>l;l++)i=o(e[l],l,n),null!=i&&(s[s.length]=i);else for(r in e)i=o(e[r],r,n),null!=i&&(s[s.length]=i);return s.concat.apply([],s)},guid:1,proxy:function(e,o){var n,i,r;return"string"==typeof o&&(n=e[o],o=e,e=n),Z.isFunction(e)?(i=z.call(arguments,2),r=function(){return e.apply(o,i.concat(z.call(arguments)))},r.guid=e.guid=e.guid||r.guid||Z.guid++,r):t},access:function(e,o,n,i,r,s,l){var a,c=null==n,g=0,u=e.length;if(n&&"object"==typeof n){for(g in n)Z.access(e,o,g,n[g],1,s,i);r=1}else if(i!==t){if(a=l===t&&Z.isFunction(i),c&&(a?(a=o,o=function(e,t,o){return a.call(Z(e),o)}):(o.call(e,i),o=null)),o)for(;u>g;g++)o(e[g],n,a?i.call(e[g],g,o(e[g],n)):i,l);r=1}return r?e:c?o.call(e):u?o(e[0],n):s},now:function(){return(new Date).getTime()}}),Z.ready.promise=function(t){if(!U)if(U=Z.Deferred(),"complete"===$.readyState)setTimeout(Z.ready,1);else if($.addEventListener)$.addEventListener("DOMContentLoaded",ht,!1),e.addEventListener("load",Z.ready,!1);else{$.attachEvent("onreadystatechange",ht),e.attachEvent("onload",Z.ready);var o=!1;try{o=null==e.frameElement&&$.documentElement}catch(n){}o&&o.doScroll&&function i(){if(!Z.isReady){try{o.doScroll("left")}catch(e){return setTimeout(i,50)}Z.ready()}}()}return U.promise(t)},Z.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){dt["[object "+t+"]"]=t.toLowerCase()}),H=Z($);var pt={};Z.Callbacks=function(e){e="string"==typeof e?pt[e]||o(e):Z.extend({},e);var n,i,r,s,l,a,c=[],g=!e.once&&[],u=function(t){for(n=e.memory&&t,i=!0,a=s||0,s=0,l=c.length,r=!0;c&&l>a;a++)if(c[a].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}r=!1,c&&(g?g.length&&u(g.shift()):n?c=[]:h.disable())},h={add:function(){if(c){var t=c.length;!function o(t){Z.each(t,function(t,n){var i=Z.type(n);"function"!==i||e.unique&&h.has(n)?n&&n.length&&"string"!==i&&o(n):c.push(n)})}(arguments),r?l=c.length:n&&(s=t,u(n))}return this},remove:function(){return c&&Z.each(arguments,function(e,t){for(var o;(o=Z.inArray(t,c,o))>-1;)c.splice(o,1),r&&(l>=o&&l--,a>=o&&a--)}),this},has:function(e){return Z.inArray(e,c)>-1},empty:function(){return c=[],this},disable:function(){return c=g=n=t,this},disabled:function(){return!c},lock:function(){return g=t,n||h.disable(),this},locked:function(){return!g},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],c&&(!i||g)&&(r?g.push(t):u(t)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!i}};return h},Z.extend({Deferred:function(e){var t=[["resolve","done",Z.Callbacks("once memory"),"resolved"],["reject","fail",Z.Callbacks("once memory"),"rejected"],["notify","progress",Z.Callbacks("memory")]],o="pending",n={state:function(){return o},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Z.Deferred(function(o){Z.each(t,function(t,n){var r=n[0],s=e[t];i[n[1]](Z.isFunction(s)?function(){var e=s.apply(this,arguments);e&&Z.isFunction(e.promise)?e.promise().done(o.resolve).fail(o.reject).progress(o.notify):o[r+"With"](this===i?o:this,[e])}:o[r])}),e=null}).promise()},promise:function(e){return"object"==typeof e?Z.extend(e,n):n}},i={};return n.pipe=n.then,Z.each(t,function(e,r){var s=r[2],l=r[3];n[r[1]]=s.add,l&&s.add(function(){o=l},t[1^e][2].disable,t[2][2].lock),i[r[0]]=s.fire,i[r[0]+"With"]=s.fireWith}),n.promise(i),e&&e.call(i,i),i},when:function(e){var t,o,n,i=0,r=z.call(arguments),s=r.length,l=1!==s||e&&Z.isFunction(e.promise)?s:0,a=1===l?e:Z.Deferred(),c=function(e,o,n){return function(i){o[e]=this,n[e]=arguments.length>1?z.call(arguments):i,n===t?a.notifyWith(o,n):--l||a.resolveWith(o,n)}};if(s>1)for(t=new Array(s),o=new Array(s),n=new Array(s);s>i;i++)r[i]&&Z.isFunction(r[i].promise)?r[i].promise().done(c(i,n,r)).fail(a.reject).progress(c(i,o,t)):--l;return l||a.resolveWith(n,r),a.promise()}}),Z.support=function(){var t,o,n,i,r,s,l,a,c,g,u,h=$.createElement("div");if(h.setAttribute("className","t"),h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",o=h.getElementsByTagName("*"),n=h.getElementsByTagName("a")[0],n.style.cssText="top:1px;float:left;opacity:.5",!o||!o.length||!n)return{};i=$.createElement("select"),r=i.appendChild($.createElement("option")),s=h.getElementsByTagName("input")[0],t={leadingWhitespace:3===h.firstChild.nodeType,tbody:!h.getElementsByTagName("tbody").length,htmlSerialize:!!h.getElementsByTagName("link").length,style:/top/.test(n.getAttribute("style")),hrefNormalized:"/a"===n.getAttribute("href"),opacity:/^0.5/.test(n.style.opacity),cssFloat:!!n.style.cssFloat,checkOn:"on"===s.value,optSelected:r.selected,getSetAttribute:"t"!==h.className,enctype:!!$.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==$.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===$.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,t.noCloneChecked=s.cloneNode(!0).checked,i.disabled=!0,t.optDisabled=!r.disabled;try{delete h.test}catch(d){t.deleteExpando=!1}if(!h.addEventListener&&h.attachEvent&&h.fireEvent&&(h.attachEvent("onclick",u=function(){t.noCloneEvent=!1}),h.cloneNode(!0).fireEvent("onclick"),h.detachEvent("onclick",u)),s=$.createElement("input"),s.value="t",s.setAttribute("type","radio"),t.radioValue="t"===s.value,s.setAttribute("checked","checked"),s.setAttribute("name","t"),h.appendChild(s),l=$.createDocumentFragment(),l.appendChild(h.lastChild),t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=s.checked,l.removeChild(s),l.appendChild(h),h.attachEvent)for(c in{submit:!0,change:!0,focusin:!0})a="on"+c,g=a in h,g||(h.setAttribute(a,"return;"),g="function"==typeof h[a]),t[c+"Bubbles"]=g;return Z(function(){var o,n,i,r,s="padding:0;margin:0;border:0;display:block;overflow:hidden;",l=$.getElementsByTagName("body")[0];l&&(o=$.createElement("div"),o.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",l.insertBefore(o,l.firstChild),n=$.createElement("div"),o.appendChild(n),n.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=n.getElementsByTagName("td"),i[0].style.cssText="padding:0;margin:0;border:0;display:none",g=0===i[0].offsetHeight,i[0].style.display="",i[1].style.display="none",t.reliableHiddenOffsets=g&&0===i[0].offsetHeight,n.innerHTML="",n.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===n.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==l.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(n,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(n,null)||{width:"4px"}).width,r=$.createElement("div"),r.style.cssText=n.style.cssText=s,r.style.marginRight=r.style.width="0",n.style.width="1px",n.appendChild(r),t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),"undefined"!=typeof n.style.zoom&&(n.innerHTML="",n.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===n.offsetWidth,n.style.display="block",n.style.overflow="visible",n.innerHTML="<div></div>",n.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==n.offsetWidth,o.style.zoom=1),l.removeChild(o),o=n=i=r=null)}),l.removeChild(h),o=n=i=r=s=l=h=null,t}();var ft=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,mt=/([A-Z])/g;Z.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(Z.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?Z.cache[e[Z.expando]]:e[Z.expando],!!e&&!i(e)},data:function(e,o,n,i){if(Z.acceptData(e)){var r,s,l=Z.expando,a="string"==typeof o,c=e.nodeType,g=c?Z.cache:e,u=c?e[l]:e[l]&&l;if(u&&g[u]&&(i||g[u].data)||!a||n!==t)return u||(c?e[l]=u=Z.deletedIds.pop()||++Z.uuid:u=l),g[u]||(g[u]={},c||(g[u].toJSON=Z.noop)),("object"==typeof o||"function"==typeof o)&&(i?g[u]=Z.extend(g[u],o):g[u].data=Z.extend(g[u].data,o)),r=g[u],i||(r.data||(r.data={}),r=r.data),n!==t&&(r[Z.camelCase(o)]=n),a?(s=r[o],null==s&&(s=r[Z.camelCase(o)])):s=r,s}},removeData:function(e,t,o){if(Z.acceptData(e)){var n,r,s,l=e.nodeType,a=l?Z.cache:e,c=l?e[Z.expando]:Z.expando;if(a[c]){if(t&&(n=o?a[c]:a[c].data)){Z.isArray(t)||(t in n?t=[t]:(t=Z.camelCase(t),t=t in n?[t]:t.split(" ")));for(r=0,s=t.length;s>r;r++)delete n[t[r]];if(!(o?i:Z.isEmptyObject)(n))return}(o||(delete a[c].data,i(a[c])))&&(l?Z.cleanData([e],!0):Z.support.deleteExpando||a!=a.window?delete a[c]:a[c]=null)}}},_data:function(e,t,o){return Z.data(e,t,o,!0)},acceptData:function(e){var t=e.nodeName&&Z.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),Z.fn.extend({data:function(e,o){var i,r,s,l,a,c=this[0],g=0,u=null;if(e===t){if(this.length&&(u=Z.data(c),1===c.nodeType&&!Z._data(c,"parsedAttrs"))){for(s=c.attributes,a=s.length;a>g;g++)l=s[g].name,0===l.indexOf("data-")&&(l=Z.camelCase(l.substring(5)),n(c,l,u[l]));Z._data(c,"parsedAttrs",!0)}return u}return"object"==typeof e?this.each(function(){Z.data(this,e)}):(i=e.split(".",2),i[1]=i[1]?"."+i[1]:"",r=i[1]+"!",Z.access(this,function(o){return o===t?(u=this.triggerHandler("getData"+r,[i[0]]),u===t&&c&&(u=Z.data(c,e),u=n(c,e,u)),u===t&&i[1]?this.data(i[0]):u):(i[1]=o,this.each(function(){var t=Z(this);t.triggerHandler("setData"+r,i),Z.data(this,e,o),t.triggerHandler("changeData"+r,i)}),void 0)},null,o,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){Z.removeData(this,e)})}}),Z.extend({queue:function(e,t,o){var n;return e?(t=(t||"fx")+"queue",n=Z._data(e,t),o&&(!n||Z.isArray(o)?n=Z._data(e,t,Z.makeArray(o)):n.push(o)),n||[]):void 0},dequeue:function(e,t){t=t||"fx";var o=Z.queue(e,t),n=o.length,i=o.shift(),r=Z._queueHooks(e,t),s=function(){Z.dequeue(e,t)};"inprogress"===i&&(i=o.shift(),n--),i&&("fx"===t&&o.unshift("inprogress"),delete r.stop,i.call(e,s,r)),!n&&r&&r.empty.fire()},_queueHooks:function(e,t){var o=t+"queueHooks";return Z._data(e,o)||Z._data(e,o,{empty:Z.Callbacks("once memory").add(function(){Z.removeData(e,t+"queue",!0),Z.removeData(e,o,!0)})})}}),Z.fn.extend({queue:function(e,o){var n=2;return"string"!=typeof e&&(o=e,e="fx",n--),arguments.length<n?Z.queue(this[0],e):o===t?this:this.each(function(){var t=Z.queue(this,e,o);Z._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&Z.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Z.dequeue(this,e)})},delay:function(e,t){return e=Z.fx?Z.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,o){var n=setTimeout(t,e);o.stop=function(){clearTimeout(n)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,o){var n,i=1,r=Z.Deferred(),s=this,l=this.length,a=function(){--i||r.resolveWith(s,[s])};for("string"!=typeof e&&(o=e,e=t),e=e||"fx";l--;)n=Z._data(s[l],e+"queueHooks"),n&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(o)}});var yt,_t,Et,vt=/[\t\r\n]/g,Ct=/\r/g,Bt=/^(?:button|input)$/i,kt=/^(?:button|input|object|select|textarea)$/i,bt=/^a(?:rea|)$/i,At=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,Tt=Z.support.getSetAttribute;Z.fn.extend({attr:function(e,t){return Z.access(this,Z.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Z.removeAttr(this,e)})},prop:function(e,t){return Z.access(this,Z.prop,e,t,arguments.length>1)},removeProp:function(e){return e=Z.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(o){}})},addClass:function(e){var t,o,n,i,r,s,l;if(Z.isFunction(e))return this.each(function(t){Z(this).addClass(e.call(this,t,this.className))});if(e&&"string"==typeof e)for(t=e.split(tt),o=0,n=this.length;n>o;o++)if(i=this[o],1===i.nodeType)if(i.className||1!==t.length){for(r=" "+i.className+" ",s=0,l=t.length;l>s;s++)~r.indexOf(" "+t[s]+" ")||(r+=t[s]+" ");i.className=Z.trim(r)}else i.className=e;return this},removeClass:function(e){var o,n,i,r,s,l,a;if(Z.isFunction(e))return this.each(function(t){Z(this).removeClass(e.call(this,t,this.className))});if(e&&"string"==typeof e||e===t)for(o=(e||"").split(tt),l=0,a=this.length;a>l;l++)if(i=this[l],1===i.nodeType&&i.className){for(n=(" "+i.className+" ").replace(vt," "),r=0,s=o.length;s>r;r++)for(;n.indexOf(" "+o[r]+" ")>-1;)n=n.replace(" "+o[r]+" "," ");i.className=e?Z.trim(n):""}return this},toggleClass:function(e,t){var o=typeof e,n="boolean"==typeof t;return Z.isFunction(e)?this.each(function(o){Z(this).toggleClass(e.call(this,o,this.className,t),t)}):this.each(function(){if("string"===o)for(var i,r=0,s=Z(this),l=t,a=e.split(tt);i=a[r++];)l=n?l:!s.hasClass(i),s[l?"addClass":"removeClass"](i);else("undefined"===o||"boolean"===o)&&(this.className&&Z._data(this,"__className__",this.className),this.className=this.className||e===!1?"":Z._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",o=0,n=this.length;n>o;o++)if(1===this[o].nodeType&&(" "+this[o].className+" ").replace(vt," ").indexOf(t)>-1)return!0;return!1},val:function(e){var o,n,i,r=this[0];{if(arguments.length)return i=Z.isFunction(e),this.each(function(n){var r,s=Z(this);1===this.nodeType&&(r=i?e.call(this,n,s.val()):e,null==r?r="":"number"==typeof r?r+="":Z.isArray(r)&&(r=Z.map(r,function(e){return null==e?"":e+""})),o=Z.valHooks[this.type]||Z.valHooks[this.nodeName.toLowerCase()],o&&"set"in o&&o.set(this,r,"value")!==t||(this.value=r))});if(r)return o=Z.valHooks[r.type]||Z.valHooks[r.nodeName.toLowerCase()],o&&"get"in o&&(n=o.get(r,"value"))!==t?n:(n=r.value,"string"==typeof n?n.replace(Ct,""):null==n?"":n)}}}),Z.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,o,n,i,r=e.selectedIndex,s=[],l=e.options,a="select-one"===e.type;if(0>r)return null;for(o=a?r:0,n=a?r+1:l.length;n>o;o++)if(i=l[o],!(!i.selected||(Z.support.optDisabled?i.disabled:null!==i.getAttribute("disabled"))||i.parentNode.disabled&&Z.nodeName(i.parentNode,"optgroup"))){if(t=Z(i).val(),a)return t;s.push(t)}return a&&!s.length&&l.length?Z(l[r]).val():s},set:function(e,t){var o=Z.makeArray(t);return Z(e).find("option").each(function(){this.selected=Z.inArray(Z(this).val(),o)>=0}),o.length||(e.selectedIndex=-1),o}}},attrFn:{},attr:function(e,o,n,i){var r,s,l,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return i&&Z.isFunction(Z.fn[o])?Z(e)[o](n):"undefined"==typeof e.getAttribute?Z.prop(e,o,n):(l=1!==a||!Z.isXMLDoc(e),l&&(o=o.toLowerCase(),s=Z.attrHooks[o]||(At.test(o)?_t:yt)),n!==t?null===n?(Z.removeAttr(e,o),void 0):s&&"set"in s&&l&&(r=s.set(e,n,o))!==t?r:(e.setAttribute(o,""+n),n):s&&"get"in s&&l&&null!==(r=s.get(e,o))?r:(r=e.getAttribute(o),null===r?t:r))},removeAttr:function(e,t){var o,n,i,r,s=0;if(t&&1===e.nodeType)for(n=t.split(tt);s<n.length;s++)i=n[s],i&&(o=Z.propFix[i]||i,r=At.test(i),r||Z.attr(e,i,""),e.removeAttribute(Tt?i:o),r&&o in e&&(e[o]=!1))},attrHooks:{type:{set:function(e,t){if(Bt.test(e.nodeName)&&e.parentNode)Z.error("type property can't be changed");else if(!Z.support.radioValue&&"radio"===t&&Z.nodeName(e,"input")){var o=e.value;return e.setAttribute("type",t),o&&(e.value=o),t}}},value:{get:function(e,t){return yt&&Z.nodeName(e,"button")?yt.get(e,t):t in e?e.value:null},set:function(e,t,o){return yt&&Z.nodeName(e,"button")?yt.set(e,t,o):(e.value=t,void 0)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,o,n){var i,r,s,l=e.nodeType;if(e&&3!==l&&8!==l&&2!==l)return s=1!==l||!Z.isXMLDoc(e),s&&(o=Z.propFix[o]||o,r=Z.propHooks[o]),n!==t?r&&"set"in r&&(i=r.set(e,n,o))!==t?i:e[o]=n:r&&"get"in r&&null!==(i=r.get(e,o))?i:e[o]},propHooks:{tabIndex:{get:function(e){var o=e.getAttributeNode("tabindex");return o&&o.specified?parseInt(o.value,10):kt.test(e.nodeName)||bt.test(e.nodeName)&&e.href?0:t}}}}),_t={get:function(e,o){var n,i=Z.prop(e,o);return i===!0||"boolean"!=typeof i&&(n=e.getAttributeNode(o))&&n.nodeValue!==!1?o.toLowerCase():t},set:function(e,t,o){var n;return t===!1?Z.removeAttr(e,o):(n=Z.propFix[o]||o,n in e&&(e[n]=!0),e.setAttribute(o,o.toLowerCase())),o}},Tt||(Et={name:!0,id:!0,coords:!0},yt=Z.valHooks.button={get:function(e,o){var n;return n=e.getAttributeNode(o),n&&(Et[o]?""!==n.value:n.specified)?n.value:t},set:function(e,t,o){var n=e.getAttributeNode(o);return n||(n=$.createAttribute(o),e.setAttributeNode(n)),n.value=t+""}},Z.each(["width","height"],function(e,t){Z.attrHooks[t]=Z.extend(Z.attrHooks[t],{set:function(e,o){return""===o?(e.setAttribute(t,"auto"),o):void 0}})}),Z.attrHooks.contenteditable={get:yt.get,set:function(e,t,o){""===t&&(t="false"),yt.set(e,t,o)}}),Z.support.hrefNormalized||Z.each(["href","src","width","height"],function(e,o){Z.attrHooks[o]=Z.extend(Z.attrHooks[o],{get:function(e){var n=e.getAttribute(o,2);return null===n?t:n}})}),Z.support.style||(Z.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=""+t}}),Z.support.optSelected||(Z.propHooks.selected=Z.extend(Z.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),Z.support.enctype||(Z.propFix.enctype="encoding"),Z.support.checkOn||Z.each(["radio","checkbox"],function(){Z.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value
2
- }}}),Z.each(["radio","checkbox"],function(){Z.valHooks[this]=Z.extend(Z.valHooks[this],{set:function(e,t){return Z.isArray(t)?e.checked=Z.inArray(Z(e).val(),t)>=0:void 0}})});var St=/^(?:textarea|input|select)$/i,Rt=/^([^\.]*|)(?:\.(.+)|)$/,It=/(?:^|\s)hover(\.\S+|)\b/,Dt=/^key/,wt=/^(?:mouse|contextmenu)|click/,Lt=/^(?:focusinfocus|focusoutblur)$/,Ft=function(e){return Z.event.special.hover?e:e.replace(It,"mouseenter$1 mouseleave$1")};Z.event={add:function(e,o,n,i,r){var s,l,a,c,g,u,h,d,p,f,m;if(3!==e.nodeType&&8!==e.nodeType&&o&&n&&(s=Z._data(e))){for(n.handler&&(p=n,n=p.handler,r=p.selector),n.guid||(n.guid=Z.guid++),a=s.events,a||(s.events=a={}),l=s.handle,l||(s.handle=l=function(e){return"undefined"==typeof Z||e&&Z.event.triggered===e.type?t:Z.event.dispatch.apply(l.elem,arguments)},l.elem=e),o=Z.trim(Ft(o)).split(" "),c=0;c<o.length;c++)g=Rt.exec(o[c])||[],u=g[1],h=(g[2]||"").split(".").sort(),m=Z.event.special[u]||{},u=(r?m.delegateType:m.bindType)||u,m=Z.event.special[u]||{},d=Z.extend({type:u,origType:g[1],data:i,handler:n,guid:n.guid,selector:r,namespace:h.join(".")},p),f=a[u],f||(f=a[u]=[],f.delegateCount=0,m.setup&&m.setup.call(e,i,h,l)!==!1||(e.addEventListener?e.addEventListener(u,l,!1):e.attachEvent&&e.attachEvent("on"+u,l))),m.add&&(m.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),r?f.splice(f.delegateCount++,0,d):f.push(d),Z.event.global[u]=!0;e=null}},global:{},remove:function(e,t,o,n,i){var r,s,l,a,c,g,u,h,d,p,f,m=Z.hasData(e)&&Z._data(e);if(m&&(h=m.events)){for(t=Z.trim(Ft(t||"")).split(" "),r=0;r<t.length;r++)if(s=Rt.exec(t[r])||[],l=a=s[1],c=s[2],l){for(d=Z.event.special[l]||{},l=(n?d.delegateType:d.bindType)||l,p=h[l]||[],g=p.length,c=c?new RegExp("(^|\\.)"+c.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,u=0;u<p.length;u++)f=p[u],!(!i&&a!==f.origType||o&&o.guid!==f.guid||c&&!c.test(f.namespace)||n&&n!==f.selector&&("**"!==n||!f.selector)||(p.splice(u--,1),f.selector&&p.delegateCount--,!d.remove||!d.remove.call(e,f)));0===p.length&&g!==p.length&&((!d.teardown||d.teardown.call(e,c,m.handle)===!1)&&Z.removeEvent(e,l,m.handle),delete h[l])}else for(l in h)Z.event.remove(e,l+t[r],o,n,!0);Z.isEmptyObject(h)&&(delete m.handle,Z.removeData(e,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(o,n,i,r){if(!i||3!==i.nodeType&&8!==i.nodeType){var s,l,a,c,g,u,h,d,p,f,m=o.type||o,y=[];if(Lt.test(m+Z.event.triggered))return;if(m.indexOf("!")>=0&&(m=m.slice(0,-1),l=!0),m.indexOf(".")>=0&&(y=m.split("."),m=y.shift(),y.sort()),(!i||Z.event.customEvent[m])&&!Z.event.global[m])return;if(o="object"==typeof o?o[Z.expando]?o:new Z.Event(m,o):new Z.Event(m),o.type=m,o.isTrigger=!0,o.exclusive=l,o.namespace=y.join("."),o.namespace_re=o.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,u=m.indexOf(":")<0?"on"+m:"",!i){s=Z.cache;for(a in s)s[a].events&&s[a].events[m]&&Z.event.trigger(o,n,s[a].handle.elem,!0);return}if(o.result=t,o.target||(o.target=i),n=null!=n?Z.makeArray(n):[],n.unshift(o),h=Z.event.special[m]||{},h.trigger&&h.trigger.apply(i,n)===!1)return;if(p=[[i,h.bindType||m]],!r&&!h.noBubble&&!Z.isWindow(i)){for(f=h.delegateType||m,c=Lt.test(f+m)?i:i.parentNode,g=i;c;c=c.parentNode)p.push([c,f]),g=c;g===(i.ownerDocument||$)&&p.push([g.defaultView||g.parentWindow||e,f])}for(a=0;a<p.length&&!o.isPropagationStopped();a++)c=p[a][0],o.type=p[a][1],d=(Z._data(c,"events")||{})[o.type]&&Z._data(c,"handle"),d&&d.apply(c,n),d=u&&c[u],d&&Z.acceptData(c)&&d.apply(c,n)===!1&&o.preventDefault();return o.type=m,!(r||o.isDefaultPrevented()||h._default&&h._default.apply(i.ownerDocument,n)!==!1||"click"===m&&Z.nodeName(i,"a")||!Z.acceptData(i)||!u||!i[m]||("focus"===m||"blur"===m)&&0===o.target.offsetWidth||Z.isWindow(i)||(g=i[u],g&&(i[u]=null),Z.event.triggered=m,i[m](),Z.event.triggered=t,!g||!(i[u]=g))),o.result}},dispatch:function(o){o=Z.event.fix(o||e.event);var n,i,r,s,l,a,c,g,u,h=(Z._data(this,"events")||{})[o.type]||[],d=h.delegateCount,p=[].slice.call(arguments),f=!o.exclusive&&!o.namespace,m=Z.event.special[o.type]||{},y=[];if(p[0]=o,o.delegateTarget=this,!m.preDispatch||m.preDispatch.call(this,o)!==!1){if(d&&(!o.button||"click"!==o.type))for(r=o.target;r!=this;r=r.parentNode||this)if(r.disabled!==!0||"click"!==o.type){for(l={},c=[],n=0;d>n;n++)g=h[n],u=g.selector,l[u]===t&&(l[u]=Z(u,this).index(r)>=0),l[u]&&c.push(g);c.length&&y.push({elem:r,matches:c})}for(h.length>d&&y.push({elem:this,matches:h.slice(d)}),n=0;n<y.length&&!o.isPropagationStopped();n++)for(a=y[n],o.currentTarget=a.elem,i=0;i<a.matches.length&&!o.isImmediatePropagationStopped();i++)g=a.matches[i],(f||!o.namespace&&!g.namespace||o.namespace_re&&o.namespace_re.test(g.namespace))&&(o.data=g.data,o.handleObj=g,s=((Z.event.special[g.origType]||{}).handle||g.handler).apply(a.elem,p),s!==t&&(o.result=s,s===!1&&(o.preventDefault(),o.stopPropagation())));return m.postDispatch&&m.postDispatch.call(this,o),o.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,o){var n,i,r,s=o.button,l=o.fromElement;return null==e.pageX&&null!=o.clientX&&(n=e.target.ownerDocument||$,i=n.documentElement,r=n.body,e.pageX=o.clientX+(i&&i.scrollLeft||r&&r.scrollLeft||0)-(i&&i.clientLeft||r&&r.clientLeft||0),e.pageY=o.clientY+(i&&i.scrollTop||r&&r.scrollTop||0)-(i&&i.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?o.toElement:l),!e.which&&s!==t&&(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[Z.expando])return e;var t,o,n=e,i=Z.event.fixHooks[e.type]||{},r=i.props?this.props.concat(i.props):this.props;for(e=Z.Event(n),t=r.length;t;)o=r[--t],e[o]=n[o];return e.target||(e.target=n.srcElement||$),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,i.filter?i.filter(e,n):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,o){Z.isWindow(this)&&(this.onbeforeunload=o)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,o,n){var i=Z.extend(new Z.Event,o,{type:e,isSimulated:!0,originalEvent:{}});n?Z.event.trigger(i,null,t):Z.event.dispatch.call(t,i),i.isDefaultPrevented()&&o.preventDefault()}},Z.event.handle=Z.event.dispatch,Z.removeEvent=$.removeEventListener?function(e,t,o){e.removeEventListener&&e.removeEventListener(t,o,!1)}:function(e,t,o){var n="on"+t;e.detachEvent&&("undefined"==typeof e[n]&&(e[n]=null),e.detachEvent(n,o))},Z.Event=function(e,t){return this instanceof Z.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?s:r):this.type=e,t&&Z.extend(this,t),this.timeStamp=e&&e.timeStamp||Z.now(),this[Z.expando]=!0,void 0):new Z.Event(e,t)},Z.Event.prototype={preventDefault:function(){this.isDefaultPrevented=s;var e=this.originalEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=s;var e=this.originalEvent;e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=s,this.stopPropagation()},isDefaultPrevented:r,isPropagationStopped:r,isImmediatePropagationStopped:r},Z.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){Z.event.special[e]={delegateType:t,bindType:t,handle:function(e){{var o,n=this,i=e.relatedTarget,r=e.handleObj;r.selector}return(!i||i!==n&&!Z.contains(n,i))&&(e.type=r.origType,o=r.handler.apply(this,arguments),e.type=t),o}}}),Z.support.submitBubbles||(Z.event.special.submit={setup:function(){return Z.nodeName(this,"form")?!1:(Z.event.add(this,"click._submit keypress._submit",function(e){var o=e.target,n=Z.nodeName(o,"input")||Z.nodeName(o,"button")?o.form:t;n&&!Z._data(n,"_submit_attached")&&(Z.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),Z._data(n,"_submit_attached",!0))}),void 0)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&Z.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return Z.nodeName(this,"form")?!1:(Z.event.remove(this,"._submit"),void 0)}}),Z.support.changeBubbles||(Z.event.special.change={setup:function(){return St.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(Z.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),Z.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),Z.event.simulate("change",this,e,!0)})),!1):(Z.event.add(this,"beforeactivate._change",function(e){var t=e.target;St.test(t.nodeName)&&!Z._data(t,"_change_attached")&&(Z.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&Z.event.simulate("change",this.parentNode,e,!0)}),Z._data(t,"_change_attached",!0))}),void 0)},handle:function(e){var t=e.target;return this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type?e.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return Z.event.remove(this,"._change"),!St.test(this.nodeName)}}),Z.support.focusinBubbles||Z.each({focus:"focusin",blur:"focusout"},function(e,t){var o=0,n=function(e){Z.event.simulate(t,e.target,Z.event.fix(e),!0)};Z.event.special[t]={setup:function(){0===o++&&$.addEventListener(e,n,!0)},teardown:function(){0===--o&&$.removeEventListener(e,n,!0)}}}),Z.fn.extend({on:function(e,o,n,i,s){var l,a;if("object"==typeof e){"string"!=typeof o&&(n=n||o,o=t);for(a in e)this.on(a,o,n,e[a],s);return this}if(null==n&&null==i?(i=o,n=o=t):null==i&&("string"==typeof o?(i=n,n=t):(i=n,n=o,o=t)),i===!1)i=r;else if(!i)return this;return 1===s&&(l=i,i=function(e){return Z().off(e),l.apply(this,arguments)},i.guid=l.guid||(l.guid=Z.guid++)),this.each(function(){Z.event.add(this,e,i,n,o)})},one:function(e,t,o,n){return this.on(e,t,o,n,1)},off:function(e,o,n){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,Z(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(s in e)this.off(s,o,e[s]);return this}return(o===!1||"function"==typeof o)&&(n=o,o=t),n===!1&&(n=r),this.each(function(){Z.event.remove(this,e,n,o)})},bind:function(e,t,o){return this.on(e,null,t,o)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,o){return Z(this.context).on(e,this.selector,t,o),this},die:function(e,t){return Z(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,o,n){return this.on(t,e,o,n)},undelegate:function(e,t,o){return 1==arguments.length?this.off(e,"**"):this.off(t,e||"**",o)},trigger:function(e,t){return this.each(function(){Z.event.trigger(e,t,this)})},triggerHandler:function(e,t){return this[0]?Z.event.trigger(e,t,this[0],!0):void 0},toggle:function(e){var t=arguments,o=e.guid||Z.guid++,n=0,i=function(o){var i=(Z._data(this,"lastToggle"+e.guid)||0)%n;return Z._data(this,"lastToggle"+e.guid,i+1),o.preventDefault(),t[i].apply(this,arguments)||!1};for(i.guid=o;n<t.length;)t[n++].guid=o;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),Z.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){Z.fn[t]=function(e,o){return null==o&&(o=e,e=null),arguments.length>0?this.on(t,null,e,o):this.trigger(t)},Dt.test(t)&&(Z.event.fixHooks[t]=Z.event.keyHooks),wt.test(t)&&(Z.event.fixHooks[t]=Z.event.mouseHooks)}),function(e,t){function o(e,t,o,n){o=o||[],t=t||R;var i,r,s,l,a=t.nodeType;if(1!==a&&9!==a)return[];if(!e||"string"!=typeof e)return o;if(s=v(t),!s&&!n&&(i=X.exec(e)))if(l=i[1]){if(9===a){if(r=t.getElementById(l),!r||!r.parentNode)return o;if(r.id===l)return o.push(r),o}else if(t.ownerDocument&&(r=t.ownerDocument.getElementById(l))&&C(t,r)&&r.id===l)return o.push(r),o}else{if(i[2])return L.apply(o,w.call(t.getElementsByTagName(e),0)),o;if((l=i[3])&&lt&&t.getElementsByClassName)return L.apply(o,w.call(t.getElementsByClassName(l),0)),o}return p(e,t,o,n,s)}function n(e){return function(t){var o=t.nodeName.toLowerCase();return"input"===o&&t.type===e}}function i(e){return function(t){var o=t.nodeName.toLowerCase();return("input"===o||"button"===o)&&t.type===e}}function r(e,t,o){if(e===t)return o;for(var n=e.nextSibling;n;){if(n===t)return-1;n=n.nextSibling}return 1}function s(e,t,n,i){var r,s,l,a,c,g,u,h,d,p,f=!n&&t!==R,m=(f?"<s>":"")+e.replace(K,"$1<s>"),y=M[S][m];if(y)return i?0:w.call(y,0);for(c=e,g=[],h=0,d=_.preFilter,p=_.filter;c;){(!r||(s=j.exec(c)))&&(s&&(c=c.slice(s[0].length),l.selector=u),g.push(l=[]),u="",f&&(c=" "+c)),r=!1,(s=z.exec(c))&&(u+=s[0],c=c.slice(s[0].length),r=l.push({part:s.pop().replace(K," "),string:s[0],captures:s}));for(a in p)(s=ot[a].exec(c))&&(!d[a]||(s=d[a](s,t,n)))&&(u+=s[0],c=c.slice(s[0].length),r=l.push({part:a,string:s.shift(),captures:s}));if(!r)break}return u&&(l.selector=u),i?c.length:c?o.error(e):w.call(M(m,g),0)}function l(e,t,o,n){var i=t.dir,r=D++;return e||(e=function(e){return e===o}),t.first?function(t){for(;t=t[i];)if(1===t.nodeType)return e(t)&&t}:n?function(t){for(;t=t[i];)if(1===t.nodeType&&e(t))return t}:function(t){for(var o,n=r+"."+f,s=n+"."+m;t=t[i];)if(1===t.nodeType){if((o=t[S])===s)return t.sizset;if("string"==typeof o&&0===o.indexOf(n)){if(t.sizset)return t}else{if(t[S]=s,e(t))return t.sizset=!0,t;t.sizset=!1}}}}function a(e,t){return e?function(o){var n=t(o);return n&&e(n===!0?o:n)}:t}function c(e,t,o){for(var n,i,r=0;n=e[r];r++)i=_.relative[n.part]?l(i,_.relative[n.part],t,o):a(i,_.filter[n.part].apply(null,n.captures.concat(t,o)));return i}function g(e){return function(t){for(var o,n=0;o=e[n];n++)if(o(t))return!0;return!1}}function u(e,t,n,i){for(var r=0,s=t.length;s>r;r++)o(e,t[r],n,i)}function h(e,t,n,i,r,s){var l,a=_.setFilters[t.toLowerCase()];return a||o.error(t),(e||!(l=r))&&u(e||"*",i,l=[],r),l.length>0?a(l,n,s):[]}function d(e,n,i,r){for(var s,l,a,c,g,d,p,f,m,y,_,E,v,C=0,B=e.length,k=ot.POS,b=new RegExp("^"+k.source+"(?!"+P+")","i"),A=function(){for(var e=1,o=arguments.length-2;o>e;e++)arguments[e]===t&&(m[e]=t)};B>C;C++){for(s=e[C],l="",f=r,a=0,c=s.length;c>a;a++){if(g=s[a],d=g.string,"PSEUDO"===g.part)for(k.exec(""),p=0;m=k.exec(d);)y=!0,_=k.lastIndex=m.index+m[0].length,_>p&&(l+=d.slice(p,m.index),p=_,E=[n],z.test(l)&&(f&&(E=f),f=r),(v=Q.test(l))&&(l=l.slice(0,-5).replace(z,"$&*"),p++),m.length>1&&m[0].replace(b,A),f=h(l,m[1],m[2],E,f,v)),l="";y||(l+=d),y=!1}l?z.test(l)?u(l,f||[n],i,r):o(l,n,i,r?r.concat(f):f):L.apply(i,f)}return 1===B?i:o.uniqueSort(i)}function p(e,t,o,n,i){e=e.replace(K,"$1");var r,l,a,c,g,u,h,p,y,E=s(e,t,i),v=t.nodeType;if(ot.POS.test(e))return d(E,t,o,n);if(n)r=w.call(n,0);else if(1===E.length){if((g=w.call(E[0],0)).length>2&&"ID"===(u=g[0]).part&&9===v&&!i&&_.relative[g[1].part]){if(t=_.find.ID(u.captures[0].replace(tt,""),t,i)[0],!t)return o;e=e.slice(g.shift().string.length)}for(p=(E=q.exec(g[0].string))&&!E.index&&t.parentNode||t,h="",c=g.length-1;c>=0&&(u=g[c],y=u.part,h=u.string+h,!_.relative[y]);c--)if(_.order.test(y)){if(r=_.find[y](u.captures[0].replace(tt,""),p,i),null==r)continue;e=e.slice(0,e.length-h.length)+h.replace(ot[y],""),e||L.apply(o,w.call(r,0));break}}if(e)for(l=B(e,t,i),f=l.dirruns++,null==r&&(r=_.find.TAG("*",q.test(e)&&t.parentNode||t)),c=0;a=r[c];c++)m=l.runs++,l(a)&&o.push(a);return o}var f,m,y,_,E,v,C,B,k,b,A=!0,T="undefined",S=("sizcache"+Math.random()).replace(".",""),R=e.document,I=R.documentElement,D=0,w=[].slice,L=[].push,F=function(e,t){return e[S]=t||!0,e},O=function(){var e={},t=[];return F(function(o,n){return t.push(o)>_.cacheLength&&delete e[t.shift()],e[o]=n},e)},N=O(),M=O(),x=O(),P="[\\x20\\t\\r\\n\\f]",H="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",U=H.replace("w","w#"),$="([*^$|!~]?=)",W="\\["+P+"*("+H+")"+P+"*(?:"+$+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+U+")|)|)"+P+"*\\]",G=":("+H+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+W+")|[^:]|\\\\.)*|.*))\\)|)",V=":(nth|eq|gt|lt|first|last|even|odd)(?:\\(((?:-\\d)?\\d*)\\)|)(?=[^-]|$)",K=new RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),j=new RegExp("^"+P+"*,"+P+"*"),z=new RegExp("^"+P+"*([\\x20\\t\\r\\n\\f>+~])"+P+"*"),Y=new RegExp(G),X=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,q=/[\x20\t\r\n\f]*[+~]/,Q=/:not\($/,J=/h\d/i,et=/input|select|textarea|button/i,tt=/\\(?!\\)/g,ot={ID:new RegExp("^#("+H+")"),CLASS:new RegExp("^\\.("+H+")"),NAME:new RegExp("^\\[name=['\"]?("+H+")['\"]?\\]"),TAG:new RegExp("^("+H.replace("w","w*")+")"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+G),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),POS:new RegExp(V,"ig"),needsContext:new RegExp("^"+P+"*[>+~]|"+V,"i")},nt=function(e){var t=R.createElement("div");try{return e(t)}catch(o){return!1}finally{t=null}},it=nt(function(e){return e.appendChild(R.createComment("")),!e.getElementsByTagName("*").length}),rt=nt(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==T&&"#"===e.firstChild.getAttribute("href")}),st=nt(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),lt=nt(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),at=nt(function(e){e.id=S+0,e.innerHTML="<a name='"+S+"'></a><div name='"+S+"'></div>",I.insertBefore(e,I.firstChild);var t=R.getElementsByName&&R.getElementsByName(S).length===2+R.getElementsByName(S+0).length;return y=!R.getElementById(S),I.removeChild(e),t});try{w.call(I.childNodes,0)[0].nodeType}catch(ct){w=function(e){for(var t,o=[];t=this[e];e++)o.push(t);return o}}o.matches=function(e,t){return o(e,null,null,t)},o.matchesSelector=function(e,t){return o(t,null,null,[e]).length>0},E=o.getText=function(e){var t,o="",n=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)o+=E(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[n];n++)o+=E(t);return o},v=o.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},C=o.contains=I.contains?function(e,t){var o=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!!(n&&1===n.nodeType&&o.contains&&o.contains(n))}:I.compareDocumentPosition?function(e,t){return t&&!!(16&e.compareDocumentPosition(t))}:function(e,t){for(;t=t.parentNode;)if(t===e)return!0;return!1},o.attr=function(e,t){var o,n=v(e);return n||(t=t.toLowerCase()),_.attrHandle[t]?_.attrHandle[t](e):st||n?e.getAttribute(t):(o=e.getAttributeNode(t),o?"boolean"==typeof e[t]?e[t]?t:null:o.specified?o.value:null:null)},_=o.selectors={cacheLength:50,createPseudo:F,match:ot,order:new RegExp("ID|TAG"+(at?"|NAME":"")+(lt?"|CLASS":"")),attrHandle:rt?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:y?function(e,t,o){if(typeof t.getElementById!==T&&!o){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}}:function(e,o,n){if(typeof o.getElementById!==T&&!n){var i=o.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==T&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:it?function(e,t){return typeof t.getElementsByTagName!==T?t.getElementsByTagName(e):void 0}:function(e,t){var o=t.getElementsByTagName(e);if("*"===e){for(var n,i=[],r=0;n=o[r];r++)1===n.nodeType&&i.push(n);return i}return o},NAME:function(e,t){return typeof t.getElementsByName!==T?t.getElementsByName(name):void 0},CLASS:function(e,t,o){return typeof t.getElementsByClassName===T||o?void 0:t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(tt,""),e[3]=(e[4]||e[5]||"").replace(tt,""),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1]?(e[2]||o.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*("even"===e[2]||"odd"===e[2])),e[4]=+(e[6]+e[7]||"odd"===e[2])):e[2]&&o.error(e[0]),e},PSEUDO:function(e,t,o){var n,i;return ot.CHILD.test(e[0])?null:(e[3]?e[2]=e[3]:(n=e[4])&&(Y.test(n)&&(i=s(n,t,o,!0))&&(i=n.indexOf(")",n.length-i)-n.length)&&(n=n.slice(0,i),e[0]=e[0].slice(0,i)),e[2]=n),e.slice(0,3))}},filter:{ID:y?function(e){return e=e.replace(tt,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(tt,""),function(t){var o=typeof t.getAttributeNode!==T&&t.getAttributeNode("id");return o&&o.value===e}},TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(tt,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=N[S][e];return t||(t=N(e,new RegExp("(^|"+P+")"+e+"("+P+"|$)"))),function(e){return t.test(e.className||typeof e.getAttribute!==T&&e.getAttribute("class")||"")}},ATTR:function(e,t,n){return t?function(i){var r=o.attr(i,e),s=r+"";if(null==r)return"!="===t;switch(t){case"=":return s===n;case"!=":return s!==n;case"^=":return n&&0===s.indexOf(n);case"*=":return n&&s.indexOf(n)>-1;case"$=":return n&&s.substr(s.length-n.length)===n;case"~=":return(" "+s+" ").indexOf(n)>-1;case"|=":return s===n||s.substr(0,n.length+1)===n+"-"}}:function(t){return null!=o.attr(t,e)}},CHILD:function(e,t,o,n){if("nth"===e){var i=D++;return function(e){var t,r,s=0,l=e;if(1===o&&0===n)return!0;if(t=e.parentNode,t&&(t[S]!==i||!e.sizset)){for(l=t.firstChild;l&&(1!==l.nodeType||(l.sizset=++s,l!==e));l=l.nextSibling);t[S]=i}return r=e.sizset-n,0===o?0===r:r%o===0&&r/o>=0}}return function(t){var o=t;switch(e){case"only":case"first":for(;o=o.previousSibling;)if(1===o.nodeType)return!1;if("first"===e)return!0;o=t;case"last":for(;o=o.nextSibling;)if(1===o.nodeType)return!1;return!0}}},PSEUDO:function(e,t,n,i){var r,s=_.pseudos[e]||_.pseudos[e.toLowerCase()];return s||o.error("unsupported pseudo: "+e),s[S]?s(t,n,i):s.length>1?(r=[e,e,"",t],function(e){return s(e,0,r)}):s}},pseudos:{not:F(function(e,t,o){var n=B(e.replace(K,"$1"),t,o);return function(e){return!n(e)}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!_.pseudos.empty(e)},empty:function(e){var t;for(e=e.firstChild;e;){if(e.nodeName>"@"||3===(t=e.nodeType)||4===t)return!1;e=e.nextSibling}return!0},contains:F(function(e){return function(t){return(t.textContent||t.innerText||E(t)).indexOf(e)>-1}}),has:F(function(e){return function(t){return o(e,t).length>0}}),header:function(e){return J.test(e.nodeName)},text:function(e){var t,o;return"input"===e.nodeName.toLowerCase()&&"text"===(t=e.type)&&(null==(o=e.getAttribute("type"))||o.toLowerCase()===t)},radio:n("radio"),checkbox:n("checkbox"),file:n("file"),password:n("password"),image:n("image"),submit:i("submit"),reset:i("reset"),button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return et.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return!(e!==t.activeElement||t.hasFocus&&!t.hasFocus()||!e.type&&!e.href)},active:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(e,t,o){return o?e.slice(1):[e[0]]},last:function(e,t,o){var n=e.pop();return o?e:[n]},even:function(e,t,o){for(var n=[],i=o?1:0,r=e.length;r>i;i+=2)n.push(e[i]);return n},odd:function(e,t,o){for(var n=[],i=o?0:1,r=e.length;r>i;i+=2)n.push(e[i]);return n},lt:function(e,t,o){return o?e.slice(+t):e.slice(0,+t)},gt:function(e,t,o){return o?e.slice(0,+t+1):e.slice(+t+1)},eq:function(e,t,o){var n=e.splice(+t,1);return o?e:n}}},k=I.compareDocumentPosition?function(e,t){return e===t?(b=!0,0):(e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t):e.compareDocumentPosition)?-1:1}:function(e,t){if(e===t)return b=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var o,n,i=[],s=[],l=e.parentNode,a=t.parentNode,c=l;if(l===a)return r(e,t);if(!l)return-1;if(!a)return 1;for(;c;)i.unshift(c),c=c.parentNode;for(c=a;c;)s.unshift(c),c=c.parentNode;o=i.length,n=s.length;for(var g=0;o>g&&n>g;g++)if(i[g]!==s[g])return r(i[g],s[g]);return g===o?r(e,s[g],-1):r(i[g],t,1)},[0,0].sort(k),A=!b,o.uniqueSort=function(e){var t,o=1;if(b=A,e.sort(k),b)for(;t=e[o];o++)t===e[o-1]&&e.splice(o--,1);return e},o.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},B=o.compile=function(e,t,o){var n,i,r,l=x[S][e];if(l&&l.context===t)return l;for(n=s(e,t,o),i=0,r=n.length;r>i;i++)n[i]=c(n[i],t,o);return l=x(e,g(n)),l.context=t,l.runs=l.dirruns=0,l},R.querySelectorAll&&function(){var e,t=p,n=/'|\\/g,i=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,r=[],l=[":active"],a=I.matchesSelector||I.mozMatchesSelector||I.webkitMatchesSelector||I.oMatchesSelector||I.msMatchesSelector;nt(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||r.push("\\["+P+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||r.push(":checked")}),nt(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&r.push("[*^$]="+P+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||r.push(":enabled",":disabled")}),r=r.length&&new RegExp(r.join("|")),p=function(e,o,i,l,a){if(!(l||a||r&&r.test(e)))if(9===o.nodeType)try{return L.apply(i,w.call(o.querySelectorAll(e),0)),i}catch(c){}else if(1===o.nodeType&&"object"!==o.nodeName.toLowerCase()){var g,u,h,d=o.getAttribute("id"),p=d||S,f=q.test(e)&&o.parentNode||o;for(d?p=p.replace(n,"\\$&"):o.setAttribute("id",p),g=s(e,o,a),p="[id='"+p+"']",u=0,h=g.length;h>u;u++)g[u]=p+g[u].selector;try{return L.apply(i,w.call(f.querySelectorAll(g.join(",")),0)),i}catch(c){}finally{d||o.removeAttribute("id")}}return t(e,o,i,l,a)},a&&(nt(function(t){e=a.call(t,"div");try{a.call(t,"[test!='']:sizzle"),l.push(ot.PSEUDO.source,ot.POS.source,"!=")}catch(o){}}),l=new RegExp(l.join("|")),o.matchesSelector=function(t,n){if(n=n.replace(i,"='$1']"),!(v(t)||l.test(n)||r&&r.test(n)))try{var s=a.call(t,n);if(s||e||t.document&&11!==t.document.nodeType)return s}catch(c){}return o(n,null,null,[t]).length>0})}(),_.setFilters.nth=_.setFilters.eq,_.filters=_.pseudos,o.attr=Z.attr,Z.find=o,Z.expr=o.selectors,Z.expr[":"]=Z.expr.pseudos,Z.unique=o.uniqueSort,Z.text=o.getText,Z.isXMLDoc=o.isXML,Z.contains=o.contains}(e);var Ot=/Until$/,Nt=/^(?:parents|prev(?:Until|All))/,Mt=/^.[^:#\[\.,]*$/,xt=Z.expr.match.needsContext,Pt={children:!0,contents:!0,next:!0,prev:!0};Z.fn.extend({find:function(e){var t,o,n,i,r,s,l=this;if("string"!=typeof e)return Z(e).filter(function(){for(t=0,o=l.length;o>t;t++)if(Z.contains(l[t],this))return!0});for(s=this.pushStack("","find",e),t=0,o=this.length;o>t;t++)if(n=s.length,Z.find(e,this[t],s),t>0)for(i=n;i<s.length;i++)for(r=0;n>r;r++)if(s[r]===s[i]){s.splice(i--,1);break}return s},has:function(e){var t,o=Z(e,this),n=o.length;return this.filter(function(){for(t=0;n>t;t++)if(Z.contains(this,o[t]))return!0})},not:function(e){return this.pushStack(c(this,e,!1),"not",e)},filter:function(e){return this.pushStack(c(this,e,!0),"filter",e)},is:function(e){return!!e&&("string"==typeof e?xt.test(e)?Z(e,this.context).index(this[0])>=0:Z.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var o,n=0,i=this.length,r=[],s=xt.test(e)||"string"!=typeof e?Z(e,t||this.context):0;i>n;n++)for(o=this[n];o&&o.ownerDocument&&o!==t&&11!==o.nodeType;){if(s?s.index(o)>-1:Z.find.matchesSelector(o,e)){r.push(o);break}o=o.parentNode}return r=r.length>1?Z.unique(r):r,this.pushStack(r,"closest",e)},index:function(e){return e?"string"==typeof e?Z.inArray(this[0],Z(e)):Z.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var o="string"==typeof e?Z(e,t):Z.makeArray(e&&e.nodeType?[e]:e),n=Z.merge(this.get(),o);return this.pushStack(l(o[0])||l(n[0])?n:Z.unique(n))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Z.fn.andSelf=Z.fn.addBack,Z.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Z.dir(e,"parentNode")},parentsUntil:function(e,t,o){return Z.dir(e,"parentNode",o)},next:function(e){return a(e,"nextSibling")},prev:function(e){return a(e,"previousSibling")},nextAll:function(e){return Z.dir(e,"nextSibling")},prevAll:function(e){return Z.dir(e,"previousSibling")},nextUntil:function(e,t,o){return Z.dir(e,"nextSibling",o)},prevUntil:function(e,t,o){return Z.dir(e,"previousSibling",o)},siblings:function(e){return Z.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Z.sibling(e.firstChild)},contents:function(e){return Z.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:Z.merge([],e.childNodes)}},function(e,t){Z.fn[e]=function(o,n){var i=Z.map(this,t,o);return Ot.test(e)||(n=o),n&&"string"==typeof n&&(i=Z.filter(n,i)),i=this.length>1&&!Pt[e]?Z.unique(i):i,this.length>1&&Nt.test(e)&&(i=i.reverse()),this.pushStack(i,e,z.call(arguments).join(","))}}),Z.extend({filter:function(e,t,o){return o&&(e=":not("+e+")"),1===t.length?Z.find.matchesSelector(t[0],e)?[t[0]]:[]:Z.find.matches(e,t)},dir:function(e,o,n){for(var i=[],r=e[o];r&&9!==r.nodeType&&(n===t||1!==r.nodeType||!Z(r).is(n));)1===r.nodeType&&i.push(r),r=r[o];return i},sibling:function(e,t){for(var o=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&o.push(e);return o}});var Ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Ut=/ jQuery\d+="(?:null|\d+)"/g,$t=/^\s+/,Wt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Gt=/<([\w:]+)/,Vt=/<tbody/i,Kt=/<|&#?\w+;/,jt=/<(?:script|style|link)/i,zt=/<(?:script|object|embed|option|style)/i,Yt=new RegExp("<(?:"+Ht+")[\\s/>]","i"),Xt=/^(?:checkbox|radio)$/,qt=/checked\s*(?:[^=]|=\s*.checked.)/i,Qt=/\/(java|ecma)script/i,Zt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Jt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},eo=g($),to=eo.appendChild($.createElement("div"));Jt.optgroup=Jt.option,Jt.tbody=Jt.tfoot=Jt.colgroup=Jt.caption=Jt.thead,Jt.th=Jt.td,Z.support.htmlSerialize||(Jt._default=[1,"X<div>","</div>"]),Z.fn.extend({text:function(e){return Z.access(this,function(e){return e===t?Z.text(this):this.empty().append((this[0]&&this[0].ownerDocument||$).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(Z.isFunction(e))return this.each(function(t){Z(this).wrapAll(e.call(this,t))});if(this[0]){var t=Z(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return Z.isFunction(e)?this.each(function(t){Z(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Z(this),o=t.contents();o.length?o.wrapAll(e):t.append(e)})},wrap:function(e){var t=Z.isFunction(e);return this.each(function(o){Z(this).wrapAll(t?e.call(this,o):e)})},unwrap:function(){return this.parent().each(function(){Z.nodeName(this,"body")||Z(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!l(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)
3
- });if(arguments.length){var e=Z.clean(arguments);return this.pushStack(Z.merge(e,this),"before",this.selector)}},after:function(){if(!l(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=Z.clean(arguments);return this.pushStack(Z.merge(this,e),"after",this.selector)}},remove:function(e,t){for(var o,n=0;null!=(o=this[n]);n++)(!e||Z.filter(e,[o]).length)&&(!t&&1===o.nodeType&&(Z.cleanData(o.getElementsByTagName("*")),Z.cleanData([o])),o.parentNode&&o.parentNode.removeChild(o));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&Z.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return Z.clone(this,e,t)})},html:function(e){return Z.access(this,function(e){var o=this[0]||{},n=0,i=this.length;if(e===t)return 1===o.nodeType?o.innerHTML.replace(Ut,""):t;if(!("string"!=typeof e||jt.test(e)||!Z.support.htmlSerialize&&Yt.test(e)||!Z.support.leadingWhitespace&&$t.test(e)||Jt[(Gt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Wt,"<$1></$2>");try{for(;i>n;n++)o=this[n]||{},1===o.nodeType&&(Z.cleanData(o.getElementsByTagName("*")),o.innerHTML=e);o=0}catch(r){}}o&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return l(this[0])?this.length?this.pushStack(Z(Z.isFunction(e)?e():e),"replaceWith",e):this:Z.isFunction(e)?this.each(function(t){var o=Z(this),n=o.html();o.replaceWith(e.call(this,t,n))}):("string"!=typeof e&&(e=Z(e).detach()),this.each(function(){var t=this.nextSibling,o=this.parentNode;Z(this).remove(),t?Z(t).before(e):Z(o).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,o,n){e=[].concat.apply([],e);var i,r,s,l,a=0,c=e[0],g=[],h=this.length;if(!Z.support.checkClone&&h>1&&"string"==typeof c&&qt.test(c))return this.each(function(){Z(this).domManip(e,o,n)});if(Z.isFunction(c))return this.each(function(i){var r=Z(this);e[0]=c.call(this,i,o?r.html():t),r.domManip(e,o,n)});if(this[0]){if(i=Z.buildFragment(e,this,g),s=i.fragment,r=s.firstChild,1===s.childNodes.length&&(s=r),r)for(o=o&&Z.nodeName(r,"tr"),l=i.cacheable||h-1;h>a;a++)n.call(o&&Z.nodeName(this[a],"table")?u(this[a],"tbody"):this[a],a===l?s:Z.clone(s,!0,!0));s=r=null,g.length&&Z.each(g,function(e,t){t.src?Z.ajax?Z.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):Z.error("no ajax"):Z.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Zt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),Z.buildFragment=function(e,o,n){var i,r,s,l=e[0];return o=o||$,o=!o.nodeType&&o[0]||o,o=o.ownerDocument||o,1===e.length&&"string"==typeof l&&l.length<512&&o===$&&"<"===l.charAt(0)&&!zt.test(l)&&(Z.support.checkClone||!qt.test(l))&&(Z.support.html5Clone||!Yt.test(l))&&(r=!0,i=Z.fragments[l],s=i!==t),i||(i=o.createDocumentFragment(),Z.clean(e,o,i,n),r&&(Z.fragments[l]=s&&i)),{fragment:i,cacheable:r}},Z.fragments={},Z.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Z.fn[e]=function(o){var n,i=0,r=[],s=Z(o),l=s.length,a=1===this.length&&this[0].parentNode;if((null==a||a&&11===a.nodeType&&1===a.childNodes.length)&&1===l)return s[t](this[0]),this;for(;l>i;i++)n=(i>0?this.clone(!0):this).get(),Z(s[i])[t](n),r=r.concat(n);return this.pushStack(r,e,s.selector)}}),Z.extend({clone:function(e,t,o){var n,i,r,s;if(Z.support.html5Clone||Z.isXMLDoc(e)||!Yt.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(to.innerHTML=e.outerHTML,to.removeChild(s=to.firstChild)),!(Z.support.noCloneEvent&&Z.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Z.isXMLDoc(e)))for(d(e,s),n=p(e),i=p(s),r=0;n[r];++r)i[r]&&d(n[r],i[r]);if(t&&(h(e,s),o))for(n=p(e),i=p(s),r=0;n[r];++r)h(n[r],i[r]);return n=i=null,s},clean:function(e,t,o,n){var i,r,s,l,a,c,u,h,d,p,m,y=t===$&&eo,_=[];for(t&&"undefined"!=typeof t.createDocumentFragment||(t=$),i=0;null!=(s=e[i]);i++)if("number"==typeof s&&(s+=""),s){if("string"==typeof s)if(Kt.test(s)){for(y=y||g(t),u=t.createElement("div"),y.appendChild(u),s=s.replace(Wt,"<$1></$2>"),l=(Gt.exec(s)||["",""])[1].toLowerCase(),a=Jt[l]||Jt._default,c=a[0],u.innerHTML=a[1]+s+a[2];c--;)u=u.lastChild;if(!Z.support.tbody)for(h=Vt.test(s),d="table"!==l||h?"<table>"!==a[1]||h?[]:u.childNodes:u.firstChild&&u.firstChild.childNodes,r=d.length-1;r>=0;--r)Z.nodeName(d[r],"tbody")&&!d[r].childNodes.length&&d[r].parentNode.removeChild(d[r]);!Z.support.leadingWhitespace&&$t.test(s)&&u.insertBefore(t.createTextNode($t.exec(s)[0]),u.firstChild),s=u.childNodes,u.parentNode.removeChild(u)}else s=t.createTextNode(s);s.nodeType?_.push(s):Z.merge(_,s)}if(u&&(s=u=y=null),!Z.support.appendChecked)for(i=0;null!=(s=_[i]);i++)Z.nodeName(s,"input")?f(s):"undefined"!=typeof s.getElementsByTagName&&Z.grep(s.getElementsByTagName("input"),f);if(o)for(p=function(e){return!e.type||Qt.test(e.type)?n?n.push(e.parentNode?e.parentNode.removeChild(e):e):o.appendChild(e):void 0},i=0;null!=(s=_[i]);i++)Z.nodeName(s,"script")&&p(s)||(o.appendChild(s),"undefined"!=typeof s.getElementsByTagName&&(m=Z.grep(Z.merge([],s.getElementsByTagName("script")),p),_.splice.apply(_,[i+1,0].concat(m)),i+=m.length));return _},cleanData:function(e,t){for(var o,n,i,r,s=0,l=Z.expando,a=Z.cache,c=Z.support.deleteExpando,g=Z.event.special;null!=(i=e[s]);s++)if((t||Z.acceptData(i))&&(n=i[l],o=n&&a[n])){if(o.events)for(r in o.events)g[r]?Z.event.remove(i,r):Z.removeEvent(i,r,o.handle);a[n]&&(delete a[n],c?delete i[l]:i.removeAttribute?i.removeAttribute(l):i[l]=null,Z.deletedIds.push(n))}}}),function(){var e,t;Z.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=Z.uaMatch(G.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),Z.browser=t,Z.sub=function(){function e(t,o){return new e.fn.init(t,o)}Z.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function o(o,n){return n&&n instanceof Z&&!(n instanceof e)&&(n=e(n)),Z.fn.init.call(this,o,n,t)},e.fn.init.prototype=e.fn;var t=e($);return e}}();var oo,no,io,ro=/alpha\([^)]*\)/i,so=/opacity=([^)]*)/,lo=/^(top|right|bottom|left)$/,ao=/^(none|table(?!-c[ea]).+)/,co=/^margin/,go=new RegExp("^("+J+")(.*)$","i"),uo=new RegExp("^("+J+")(?!px)[a-z%]+$","i"),ho=new RegExp("^([-+])=("+J+")","i"),po={},fo={position:"absolute",visibility:"hidden",display:"block"},mo={letterSpacing:0,fontWeight:400},yo=["Top","Right","Bottom","Left"],_o=["Webkit","O","Moz","ms"],Eo=Z.fn.toggle;Z.fn.extend({css:function(e,o){return Z.access(this,function(e,o,n){return n!==t?Z.style(e,o,n):Z.css(e,o)},e,o,arguments.length>1)},show:function(){return _(this,!0)},hide:function(){return _(this)},toggle:function(e,t){var o="boolean"==typeof e;return Z.isFunction(e)&&Z.isFunction(t)?Eo.apply(this,arguments):this.each(function(){(o?e:y(this))?Z(this).show():Z(this).hide()})}}),Z.extend({cssHooks:{opacity:{get:function(e,t){if(t){var o=oo(e,"opacity");return""===o?"1":o}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":Z.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,o,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,s,l,a=Z.camelCase(o),c=e.style;if(o=Z.cssProps[a]||(Z.cssProps[a]=m(c,a)),l=Z.cssHooks[o]||Z.cssHooks[a],n===t)return l&&"get"in l&&(r=l.get(e,!1,i))!==t?r:c[o];if(s=typeof n,"string"===s&&(r=ho.exec(n))&&(n=(r[1]+1)*r[2]+parseFloat(Z.css(e,o)),s="number"),!(null==n||"number"===s&&isNaN(n)||("number"===s&&!Z.cssNumber[a]&&(n+="px"),l&&"set"in l&&(n=l.set(e,n,i))===t)))try{c[o]=n}catch(g){}}},css:function(e,o,n,i){var r,s,l,a=Z.camelCase(o);return o=Z.cssProps[a]||(Z.cssProps[a]=m(e.style,a)),l=Z.cssHooks[o]||Z.cssHooks[a],l&&"get"in l&&(r=l.get(e,!0,i)),r===t&&(r=oo(e,o)),"normal"===r&&o in mo&&(r=mo[o]),n||i!==t?(s=parseFloat(r),n||Z.isNumeric(s)?s||0:r):r},swap:function(e,t,o){var n,i,r={};for(i in t)r[i]=e.style[i],e.style[i]=t[i];n=o.call(e);for(i in t)e.style[i]=r[i];return n}}),e.getComputedStyle?oo=function(t,o){var n,i,r,s,l=e.getComputedStyle(t,null),a=t.style;return l&&(n=l[o],""===n&&!Z.contains(t.ownerDocument,t)&&(n=Z.style(t,o)),uo.test(n)&&co.test(o)&&(i=a.width,r=a.minWidth,s=a.maxWidth,a.minWidth=a.maxWidth=a.width=n,n=l.width,a.width=i,a.minWidth=r,a.maxWidth=s)),n}:$.documentElement.currentStyle&&(oo=function(e,t){var o,n,i=e.currentStyle&&e.currentStyle[t],r=e.style;return null==i&&r&&r[t]&&(i=r[t]),uo.test(i)&&!lo.test(t)&&(o=r.left,n=e.runtimeStyle&&e.runtimeStyle.left,n&&(e.runtimeStyle.left=e.currentStyle.left),r.left="fontSize"===t?"1em":i,i=r.pixelLeft+"px",r.left=o,n&&(e.runtimeStyle.left=n)),""===i?"auto":i}),Z.each(["height","width"],function(e,t){Z.cssHooks[t]={get:function(e,o,n){return o?0===e.offsetWidth&&ao.test(oo(e,"display"))?Z.swap(e,fo,function(){return C(e,t,n)}):C(e,t,n):void 0},set:function(e,o,n){return E(e,o,n?v(e,t,n,Z.support.boxSizing&&"border-box"===Z.css(e,"boxSizing")):0)}}}),Z.support.opacity||(Z.cssHooks.opacity={get:function(e,t){return so.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var o=e.style,n=e.currentStyle,i=Z.isNumeric(t)?"alpha(opacity="+100*t+")":"",r=n&&n.filter||o.filter||"";o.zoom=1,t>=1&&""===Z.trim(r.replace(ro,""))&&o.removeAttribute&&(o.removeAttribute("filter"),n&&!n.filter)||(o.filter=ro.test(r)?r.replace(ro,i):r+" "+i)}}),Z(function(){Z.support.reliableMarginRight||(Z.cssHooks.marginRight={get:function(e,t){return Z.swap(e,{display:"inline-block"},function(){return t?oo(e,"marginRight"):void 0})}}),!Z.support.pixelPosition&&Z.fn.position&&Z.each(["top","left"],function(e,t){Z.cssHooks[t]={get:function(e,o){if(o){var n=oo(e,t);return uo.test(n)?Z(e).position()[t]+"px":n}}}})}),Z.expr&&Z.expr.filters&&(Z.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!Z.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||oo(e,"display"))},Z.expr.filters.visible=function(e){return!Z.expr.filters.hidden(e)}),Z.each({margin:"",padding:"",border:"Width"},function(e,t){Z.cssHooks[e+t]={expand:function(o){var n,i="string"==typeof o?o.split(" "):[o],r={};for(n=0;4>n;n++)r[e+yo[n]+t]=i[n]||i[n-2]||i[0];return r}},co.test(e)||(Z.cssHooks[e+t].set=E)});var vo=/%20/g,Co=/\[\]$/,Bo=/\r?\n/g,ko=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bo=/^(?:select|textarea)/i;Z.fn.extend({serialize:function(){return Z.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?Z.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bo.test(this.nodeName)||ko.test(this.type))}).map(function(e,t){var o=Z(this).val();return null==o?null:Z.isArray(o)?Z.map(o,function(e){return{name:t.name,value:e.replace(Bo,"\r\n")}}):{name:t.name,value:o.replace(Bo,"\r\n")}}).get()}}),Z.param=function(e,o){var n,i=[],r=function(e,t){t=Z.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(o===t&&(o=Z.ajaxSettings&&Z.ajaxSettings.traditional),Z.isArray(e)||e.jquery&&!Z.isPlainObject(e))Z.each(e,function(){r(this.name,this.value)});else for(n in e)k(n,e[n],o,r);return i.join("&").replace(vo,"+")};var Ao,To,So=/#.*$/,Ro=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Io=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Do=/^(?:GET|HEAD)$/,wo=/^\/\//,Lo=/\?/,Fo=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,Oo=/([?&])_=[^&]*/,No=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Mo=Z.fn.load,xo={},Po={},Ho=["*/"]+["*"];try{Ao=W.href}catch(Uo){Ao=$.createElement("a"),Ao.href="",Ao=Ao.href}To=No.exec(Ao.toLowerCase())||[],Z.fn.load=function(e,o,n){if("string"!=typeof e&&Mo)return Mo.apply(this,arguments);if(!this.length)return this;var i,r,s,l=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),Z.isFunction(o)?(n=o,o=t):o&&"object"==typeof o&&(r="POST"),Z.ajax({url:e,type:r,dataType:"html",data:o,complete:function(e,t){n&&l.each(n,s||[e.responseText,t,e])}}).done(function(e){s=arguments,l.html(i?Z("<div>").append(e.replace(Fo,"")).find(i):e)}),this},Z.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){Z.fn[t]=function(e){return this.on(t,e)}}),Z.each(["get","post"],function(e,o){Z[o]=function(e,n,i,r){return Z.isFunction(n)&&(r=r||i,i=n,n=t),Z.ajax({type:o,url:e,data:n,success:i,dataType:r})}}),Z.extend({getScript:function(e,o){return Z.get(e,t,o,"script")},getJSON:function(e,t,o){return Z.get(e,t,o,"json")},ajaxSetup:function(e,t){return t?T(e,Z.ajaxSettings):(t=e,e=Z.ajaxSettings),T(e,t),e},ajaxSettings:{url:Ao,isLocal:Io.test(To[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Ho},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":Z.parseJSON,"text xml":Z.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:b(xo),ajaxTransport:b(Po),ajax:function(e,o){function n(e,o,n,s){var c,u,_,E,C,k=o;2!==v&&(v=2,a&&clearTimeout(a),l=t,r=s||"",B.readyState=e>0?4:0,n&&(E=S(h,B,n)),e>=200&&300>e||304===e?(h.ifModified&&(C=B.getResponseHeader("Last-Modified"),C&&(Z.lastModified[i]=C),C=B.getResponseHeader("Etag"),C&&(Z.etag[i]=C)),304===e?(k="notmodified",c=!0):(c=R(h,E),k=c.state,u=c.data,_=c.error,c=!_)):(_=k,(!k||e)&&(k="error",0>e&&(e=0))),B.status=e,B.statusText=""+(o||k),c?f.resolveWith(d,[u,k,B]):f.rejectWith(d,[B,k,_]),B.statusCode(y),y=t,g&&p.trigger("ajax"+(c?"Success":"Error"),[B,h,c?u:_]),m.fireWith(d,[B,k]),g&&(p.trigger("ajaxComplete",[B,h]),--Z.active||Z.event.trigger("ajaxStop")))}"object"==typeof e&&(o=e,e=t),o=o||{};var i,r,s,l,a,c,g,u,h=Z.ajaxSetup({},o),d=h.context||h,p=d!==h&&(d.nodeType||d instanceof Z)?Z(d):Z.event,f=Z.Deferred(),m=Z.Callbacks("once memory"),y=h.statusCode||{},_={},E={},v=0,C="canceled",B={readyState:0,setRequestHeader:function(e,t){if(!v){var o=e.toLowerCase();e=E[o]=E[o]||e,_[e]=t}return this},getAllResponseHeaders:function(){return 2===v?r:null},getResponseHeader:function(e){var o;if(2===v){if(!s)for(s={};o=Ro.exec(r);)s[o[1].toLowerCase()]=o[2];o=s[e.toLowerCase()]}return o===t?null:o},overrideMimeType:function(e){return v||(h.mimeType=e),this},abort:function(e){return e=e||C,l&&l.abort(e),n(0,e),this}};if(f.promise(B),B.success=B.done,B.error=B.fail,B.complete=m.add,B.statusCode=function(e){if(e){var t;if(2>v)for(t in e)y[t]=[y[t],e[t]];else t=e[B.status],B.always(t)}return this},h.url=((e||h.url)+"").replace(So,"").replace(wo,To[1]+"//"),h.dataTypes=Z.trim(h.dataType||"*").toLowerCase().split(tt),null==h.crossDomain&&(c=No.exec(h.url.toLowerCase()),h.crossDomain=!(!c||c[1]==To[1]&&c[2]==To[2]&&(c[3]||("http:"===c[1]?80:443))==(To[3]||("http:"===To[1]?80:443)))),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=Z.param(h.data,h.traditional)),A(xo,h,o,B),2===v)return B;if(g=h.global,h.type=h.type.toUpperCase(),h.hasContent=!Do.test(h.type),g&&0===Z.active++&&Z.event.trigger("ajaxStart"),!h.hasContent&&(h.data&&(h.url+=(Lo.test(h.url)?"&":"?")+h.data,delete h.data),i=h.url,h.cache===!1)){var k=Z.now(),b=h.url.replace(Oo,"$1_="+k);h.url=b+(b===h.url?(Lo.test(h.url)?"&":"?")+"_="+k:"")}(h.data&&h.hasContent&&h.contentType!==!1||o.contentType)&&B.setRequestHeader("Content-Type",h.contentType),h.ifModified&&(i=i||h.url,Z.lastModified[i]&&B.setRequestHeader("If-Modified-Since",Z.lastModified[i]),Z.etag[i]&&B.setRequestHeader("If-None-Match",Z.etag[i])),B.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Ho+"; q=0.01":""):h.accepts["*"]);for(u in h.headers)B.setRequestHeader(u,h.headers[u]);if(!h.beforeSend||h.beforeSend.call(d,B,h)!==!1&&2!==v){C="abort";for(u in{success:1,error:1,complete:1})B[u](h[u]);if(l=A(Po,h,o,B)){B.readyState=1,g&&p.trigger("ajaxSend",[B,h]),h.async&&h.timeout>0&&(a=setTimeout(function(){B.abort("timeout")},h.timeout));try{v=1,l.send(_,n)}catch(T){if(!(2>v))throw T;n(-1,T)}}else n(-1,"No Transport");return B}return B.abort()},active:0,lastModified:{},etag:{}});var $o=[],Wo=/\?/,Go=/(=)\?(?=&|$)|\?\?/,Vo=Z.now();Z.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=$o.pop()||Z.expando+"_"+Vo++;return this[e]=!0,e}}),Z.ajaxPrefilter("json jsonp",function(o,n,i){var r,s,l,a=o.data,c=o.url,g=o.jsonp!==!1,u=g&&Go.test(c),h=g&&!u&&"string"==typeof a&&!(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&Go.test(a);return"jsonp"===o.dataTypes[0]||u||h?(r=o.jsonpCallback=Z.isFunction(o.jsonpCallback)?o.jsonpCallback():o.jsonpCallback,s=e[r],u?o.url=c.replace(Go,"$1"+r):h?o.data=a.replace(Go,"$1"+r):g&&(o.url+=(Wo.test(c)?"&":"?")+o.jsonp+"="+r),o.converters["script json"]=function(){return l||Z.error(r+" was not called"),l[0]},o.dataTypes[0]="json",e[r]=function(){l=arguments},i.always(function(){e[r]=s,o[r]&&(o.jsonpCallback=n.jsonpCallback,$o.push(r)),l&&Z.isFunction(s)&&s(l[0]),l=s=t}),"script"):void 0}),Z.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return Z.globalEval(e),e}}}),Z.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),Z.ajaxTransport("script",function(e){if(e.crossDomain){var o,n=$.head||$.getElementsByTagName("head")[0]||$.documentElement;return{send:function(i,r){o=$.createElement("script"),o.async="async",e.scriptCharset&&(o.charset=e.scriptCharset),o.src=e.url,o.onload=o.onreadystatechange=function(e,i){(i||!o.readyState||/loaded|complete/.test(o.readyState))&&(o.onload=o.onreadystatechange=null,n&&o.parentNode&&n.removeChild(o),o=t,i||r(200,"success"))},n.insertBefore(o,n.firstChild)},abort:function(){o&&o.onload(0,1)}}}});var Ko,jo=e.ActiveXObject?function(){for(var e in Ko)Ko[e](0,1)}:!1,zo=0;Z.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&I()||D()}:I,function(e){Z.extend(Z.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(Z.ajaxSettings.xhr()),Z.support.ajax&&Z.ajaxTransport(function(o){if(!o.crossDomain||Z.support.cors){var n;return{send:function(i,r){var s,l,a=o.xhr();if(o.username?a.open(o.type,o.url,o.async,o.username,o.password):a.open(o.type,o.url,o.async),o.xhrFields)for(l in o.xhrFields)a[l]=o.xhrFields[l];o.mimeType&&a.overrideMimeType&&a.overrideMimeType(o.mimeType),!o.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(l in i)a.setRequestHeader(l,i[l])}catch(c){}a.send(o.hasContent&&o.data||null),n=function(e,i){var l,c,g,u,h;try{if(n&&(i||4===a.readyState))if(n=t,s&&(a.onreadystatechange=Z.noop,jo&&delete Ko[s]),i)4!==a.readyState&&a.abort();else{l=a.status,g=a.getAllResponseHeaders(),u={},h=a.responseXML,h&&h.documentElement&&(u.xml=h);try{u.text=a.responseText}catch(e){}try{c=a.statusText}catch(d){c=""}l||!o.isLocal||o.crossDomain?1223===l&&(l=204):l=u.text?200:404}}catch(p){i||r(-1,p)}u&&r(l,c,u,g)},o.async?4===a.readyState?setTimeout(n,0):(s=++zo,jo&&(Ko||(Ko={},Z(e).unload(jo)),Ko[s]=n),a.onreadystatechange=n):n()},abort:function(){n&&n(0,1)}}}});var Yo,Xo,qo=/^(?:toggle|show|hide)$/,Qo=new RegExp("^(?:([-+])=|)("+J+")([a-z%]*)$","i"),Zo=/queueHooks$/,Jo=[N],en={"*":[function(e,t){var o,n,i,r=this.createTween(e,t),s=Qo.exec(t),l=r.cur(),a=+l||0,c=1;if(s){if(o=+s[2],n=s[3]||(Z.cssNumber[e]?"":"px"),"px"!==n&&a){a=Z.css(r.elem,e,!0)||o||1;do i=c=c||".5",a/=c,Z.style(r.elem,e,a+n),c=r.cur()/l;while(1!==c&&c!==i)}r.unit=n,r.start=a,r.end=s[1]?a+(s[1]+1)*o:o}return r}]};Z.Animation=Z.extend(F,{tweener:function(e,t){Z.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var o,n=0,i=e.length;i>n;n++)o=e[n],en[o]=en[o]||[],en[o].unshift(t)},prefilter:function(e,t){t?Jo.unshift(e):Jo.push(e)}}),Z.Tween=M,M.prototype={constructor:M,init:function(e,t,o,n,i,r){this.elem=e,this.prop=o,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=r||(Z.cssNumber[o]?"":"px")},cur:function(){var e=M.propHooks[this.prop];return e&&e.get?e.get(this):M.propHooks._default.get(this)},run:function(e){var t,o=M.propHooks[this.prop];return this.pos=t=this.options.duration?Z.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),o&&o.set?o.set(this):M.propHooks._default.set(this),this}},M.prototype.init.prototype=M.prototype,M.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=Z.css(e.elem,e.prop,!1,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){Z.fx.step[e.prop]?Z.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[Z.cssProps[e.prop]]||Z.cssHooks[e.prop])?Z.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},M.propHooks.scrollTop=M.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Z.each(["toggle","show","hide"],function(e,t){var o=Z.fn[t];Z.fn[t]=function(n,i,r){return null==n||"boolean"==typeof n||!e&&Z.isFunction(n)&&Z.isFunction(i)?o.apply(this,arguments):this.animate(x(t,!0),n,i,r)}}),Z.fn.extend({fadeTo:function(e,t,o,n){return this.filter(y).css("opacity",0).show().end().animate({opacity:t},e,o,n)},animate:function(e,t,o,n){var i=Z.isEmptyObject(e),r=Z.speed(t,o,n),s=function(){var t=F(this,Z.extend({},e),r);i&&t.stop(!0)};return i||r.queue===!1?this.each(s):this.queue(r.queue,s)},stop:function(e,o,n){var i=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=o,o=e,e=t),o&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,o=null!=e&&e+"queueHooks",r=Z.timers,s=Z._data(this);if(o)s[o]&&s[o].stop&&i(s[o]);else for(o in s)s[o]&&s[o].stop&&Zo.test(o)&&i(s[o]);for(o=r.length;o--;)r[o].elem===this&&(null==e||r[o].queue===e)&&(r[o].anim.stop(n),t=!1,r.splice(o,1));(t||!n)&&Z.dequeue(this,e)})}}),Z.each({slideDown:x("show"),slideUp:x("hide"),slideToggle:x("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Z.fn[e]=function(e,o,n){return this.animate(t,e,o,n)}}),Z.speed=function(e,t,o){var n=e&&"object"==typeof e?Z.extend({},e):{complete:o||!o&&t||Z.isFunction(e)&&e,duration:e,easing:o&&t||t&&!Z.isFunction(t)&&t};return n.duration=Z.fx.off?0:"number"==typeof n.duration?n.duration:n.duration in Z.fx.speeds?Z.fx.speeds[n.duration]:Z.fx.speeds._default,(null==n.queue||n.queue===!0)&&(n.queue="fx"),n.old=n.complete,n.complete=function(){Z.isFunction(n.old)&&n.old.call(this),n.queue&&Z.dequeue(this,n.queue)},n},Z.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},Z.timers=[],Z.fx=M.prototype.init,Z.fx.tick=function(){for(var e,t=Z.timers,o=0;o<t.length;o++)e=t[o],!e()&&t[o]===e&&t.splice(o--,1);t.length||Z.fx.stop()},Z.fx.timer=function(e){e()&&Z.timers.push(e)&&!Xo&&(Xo=setInterval(Z.fx.tick,Z.fx.interval))},Z.fx.interval=13,Z.fx.stop=function(){clearInterval(Xo),Xo=null},Z.fx.speeds={slow:600,fast:200,_default:400},Z.fx.step={},Z.expr&&Z.expr.filters&&(Z.expr.filters.animated=function(e){return Z.grep(Z.timers,function(t){return e===t.elem}).length});var tn=/^(?:body|html)$/i;Z.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){Z.offset.setOffset(this,e,t)});var o,n,i,r,s,l,a,c,g,u,h=this[0],d=h&&h.ownerDocument;if(d)return(i=d.body)===h?Z.offset.bodyOffset(h):(n=d.documentElement,Z.contains(n,h)?(o=h.getBoundingClientRect(),r=P(d),s=n.clientTop||i.clientTop||0,l=n.clientLeft||i.clientLeft||0,a=r.pageYOffset||n.scrollTop,c=r.pageXOffset||n.scrollLeft,g=o.top+a-s,u=o.left+c-l,{top:g,left:u}):{top:0,left:0})},Z.offset={bodyOffset:function(e){var t=e.offsetTop,o=e.offsetLeft;return Z.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(Z.css(e,"marginTop"))||0,o+=parseFloat(Z.css(e,"marginLeft"))||0),{top:t,left:o}},setOffset:function(e,t,o){var n=Z.css(e,"position");"static"===n&&(e.style.position="relative");var i,r,s=Z(e),l=s.offset(),a=Z.css(e,"top"),c=Z.css(e,"left"),g=("absolute"===n||"fixed"===n)&&Z.inArray("auto",[a,c])>-1,u={},h={};g?(h=s.position(),i=h.top,r=h.left):(i=parseFloat(a)||0,r=parseFloat(c)||0),Z.isFunction(t)&&(t=t.call(e,o,l)),null!=t.top&&(u.top=t.top-l.top+i),null!=t.left&&(u.left=t.left-l.left+r),"using"in t?t.using.call(e,u):s.css(u)}},Z.fn.extend({position:function(){if(this[0]){var e=this[0],t=this.offsetParent(),o=this.offset(),n=tn.test(t[0].nodeName)?{top:0,left:0}:t.offset();return o.top-=parseFloat(Z.css(e,"marginTop"))||0,o.left-=parseFloat(Z.css(e,"marginLeft"))||0,n.top+=parseFloat(Z.css(t[0],"borderTopWidth"))||0,n.left+=parseFloat(Z.css(t[0],"borderLeftWidth"))||0,{top:o.top-n.top,left:o.left-n.left}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||$.body;e&&!tn.test(e.nodeName)&&"static"===Z.css(e,"position");)e=e.offsetParent;return e||$.body})}}),Z.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,o){var n=/Y/.test(o);Z.fn[e]=function(i){return Z.access(this,function(e,i,r){var s=P(e);return r===t?s?o in s?s[o]:s.document.documentElement[i]:e[i]:(s?s.scrollTo(n?Z(s).scrollLeft():r,n?r:Z(s).scrollTop()):e[i]=r,void 0)},e,i,arguments.length,null)}}),Z.each({Height:"height",Width:"width"},function(e,o){Z.each({padding:"inner"+e,content:o,"":"outer"+e},function(n,i){Z.fn[i]=function(i,r){var s=arguments.length&&(n||"boolean"!=typeof i),l=n||(i===!0||r===!0?"margin":"border");return Z.access(this,function(o,n,i){var r;return Z.isWindow(o)?o.document.documentElement["client"+e]:9===o.nodeType?(r=o.documentElement,Math.max(o.body["scroll"+e],r["scroll"+e],o.body["offset"+e],r["offset"+e],r["client"+e])):i===t?Z.css(o,n,i,l):Z.style(o,n,i,l)},o,s?i:t,s,null)}})}),e.jQuery=e.$=Z,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return Z})}(window),function(e,t){e.rails!==t&&e.error("jquery-ujs has already been loaded!");var o,n=e(document);e.rails=o={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]",buttonClickSelector:"button[data-remote]",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input[type=file]",linkDisableSelector:"a[data-disable-with]",CSRFProtection:function(t){var o=e('meta[name="csrf-token"]').attr("content");o&&t.setRequestHeader("X-CSRF-Token",o)},fire:function(t,o,n){var i=e.Event(o);return t.trigger(i,n),i.result!==!1},confirm:function(e){return confirm(e)},ajax:function(t){return e.ajax(t)},href:function(e){return e.attr("href")},handleRemote:function(n){var i,r,s,l,a,c,g,u;if(o.fire(n,"ajax:before")){if(l=n.data("cross-domain"),a=l===t?null:l,c=n.data("with-credentials")||null,g=n.data("type")||e.ajaxSettings&&e.ajaxSettings.dataType,n.is("form")){i=n.attr("method"),r=n.attr("action"),s=n.serializeArray();var h=n.data("ujs:submit-button");h&&(s.push(h),n.data("ujs:submit-button",null))}else n.is(o.inputChangeSelector)?(i=n.data("method"),r=n.data("url"),s=n.serialize(),n.data("params")&&(s=s+"&"+n.data("params"))):n.is(o.buttonClickSelector)?(i=n.data("method")||"get",r=n.data("url"),s=n.serialize(),n.data("params")&&(s=s+"&"+n.data("params"))):(i=n.data("method"),r=o.href(n),s=n.data("params")||null);u={type:i||"GET",data:s,dataType:g,beforeSend:function(e,i){return i.dataType===t&&e.setRequestHeader("accept","*/*;q=0.5, "+i.accepts.script),o.fire(n,"ajax:beforeSend",[e,i])},success:function(e,t,o){n.trigger("ajax:success",[e,t,o])},complete:function(e,t){n.trigger("ajax:complete",[e,t])},error:function(e,t,o){n.trigger("ajax:error",[e,t,o])},crossDomain:a},c&&(u.xhrFields={withCredentials:c}),r&&(u.url=r);var d=o.ajax(u);return n.trigger("ajax:send",d),d}return!1},handleMethod:function(n){var i=o.href(n),r=n.data("method"),s=n.attr("target"),l=e("meta[name=csrf-token]").attr("content"),a=e("meta[name=csrf-param]").attr("content"),c=e('<form method="post" action="'+i+'"></form>'),g='<input name="_method" value="'+r+'" type="hidden" />';a!==t&&l!==t&&(g+='<input name="'+a+'" value="'+l+'" type="hidden" />'),s&&c.attr("target",s),c.hide().append(g).appendTo("body"),c.submit()},disableFormElements:function(t){t.find(o.disableSelector).each(function(){var t=e(this),o=t.is("button")?"html":"val";t.data("ujs:enable-with",t[o]()),t[o](t.data("disable-with")),t.prop("disabled",!0)})},enableFormElements:function(t){t.find(o.enableSelector).each(function(){var t=e(this),o=t.is("button")?"html":"val";t.data("ujs:enable-with")&&t[o](t.data("ujs:enable-with")),t.prop("disabled",!1)})},allowAction:function(e){var t,n=e.data("confirm"),i=!1;return n?(o.fire(e,"confirm")&&(i=o.confirm(n),t=o.fire(e,"confirm:complete",[i])),i&&t):!0},blankInputs:function(t,o,n){var i,r,s=e(),l=o||"input,textarea",a=t.find(l);return a.each(function(){if(i=e(this),r=i.is("input[type=checkbox],input[type=radio]")?i.is(":checked"):i.val(),!r==!n){if(i.is("input[type=radio]")&&a.filter('input[type=radio]:checked[name="'+i.attr("name")+'"]').length)return!0;s=s.add(i)}}),s.length?s:!1},nonBlankInputs:function(e,t){return o.blankInputs(e,t,!0)},stopEverything:function(t){return e(t.target).trigger("ujs:everythingStopped"),t.stopImmediatePropagation(),!1},disableElement:function(e){e.data("ujs:enable-with",e.html()),e.html(e.data("disable-with")),e.bind("click.railsDisable",function(e){return o.stopEverything(e)})},enableElement:function(e){e.data("ujs:enable-with")!==t&&(e.html(e.data("ujs:enable-with")),e.removeData("ujs:enable-with")),e.unbind("click.railsDisable")}},o.fire(n,"rails:attachBindings")&&(e.ajaxPrefilter(function(e,t,n){e.crossDomain||o.CSRFProtection(n)}),n.delegate(o.linkDisableSelector,"ajax:complete",function(){o.enableElement(e(this))}),n.delegate(o.linkClickSelector,"click.rails",function(n){var i=e(this),r=i.data("method"),s=i.data("params");if(!o.allowAction(i))return o.stopEverything(n);if(i.is(o.linkDisableSelector)&&o.disableElement(i),i.data("remote")!==t){if(!(!n.metaKey&&!n.ctrlKey||r&&"GET"!==r||s))return!0;var l=o.handleRemote(i);return l===!1?o.enableElement(i):l.error(function(){o.enableElement(i)}),!1}return i.data("method")?(o.handleMethod(i),!1):void 0}),n.delegate(o.buttonClickSelector,"click.rails",function(t){var n=e(this);return o.allowAction(n)?(o.handleRemote(n),!1):o.stopEverything(t)}),n.delegate(o.inputChangeSelector,"change.rails",function(t){var n=e(this);return o.allowAction(n)?(o.handleRemote(n),!1):o.stopEverything(t)}),n.delegate(o.formSubmitSelector,"submit.rails",function(n){var i=e(this),r=i.data("remote")!==t,s=o.blankInputs(i,o.requiredInputSelector),l=o.nonBlankInputs(i,o.fileInputSelector);if(!o.allowAction(i))return o.stopEverything(n);if(s&&i.attr("novalidate")==t&&o.fire(i,"ajax:aborted:required",[s]))return o.stopEverything(n);if(r){if(l){setTimeout(function(){o.disableFormElements(i)},13);var a=o.fire(i,"ajax:aborted:file",[l]);return a||setTimeout(function(){o.enableFormElements(i)},13),a}return o.handleRemote(i),!1}setTimeout(function(){o.disableFormElements(i)},13)}),n.delegate(o.formInputClickSelector,"click.rails",function(t){var n=e(this);if(!o.allowAction(n))return o.stopEverything(t);var i=n.attr("name"),r=i?{name:i,value:n.val()}:null;n.closest("form").data("ujs:submit-button",r)}),n.delegate(o.formSubmitSelector,"ajax:beforeSend.rails",function(t){this==t.target&&o.disableFormElements(e(this))}),n.delegate(o.formSubmitSelector,"ajax:complete.rails",function(t){this==t.target&&o.enableFormElements(e(this))}),e(function(){var t=e("meta[name=csrf-token]").attr("content"),o=e("meta[name=csrf-param]").attr("content");e('form input[name="'+o+'"]').val(t)}))
1
+ !function(e,t){function o(e){var t=pt[e]={};return Z.each(e.split(tt),function(e,o){t[o]=!0}),t}function n(e,o,n){if(n===t&&1===e.nodeType){var i="data-"+o.replace(mt,"-$1").toLowerCase();if(n=e.getAttribute(i),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:ft.test(n)?Z.parseJSON(n):n}catch(r){}Z.data(e,o,n)}else n=t}return n}function i(e){var t;for(t in e)if(("data"!==t||!Z.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function r(){return!1}function s(){return!0}function l(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function a(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function c(e,t,o){if(t=t||0,Z.isFunction(t))return Z.grep(e,function(e,n){var i=!!t.call(e,n,e);return i===o});if(t.nodeType)return Z.grep(e,function(e){return e===t===o});if("string"==typeof t){var n=Z.grep(e,function(e){return 1===e.nodeType});if(Mt.test(t))return Z.filter(t,n,!o);t=Z.filter(t,n)}return Z.grep(e,function(e){return Z.inArray(e,t)>=0===o})}function g(e){var t=Ht.split("|"),o=e.createDocumentFragment();if(o.createElement)for(;t.length;)o.createElement(t.pop());return o}function u(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e,t){if(1===t.nodeType&&Z.hasData(e)){var o,n,i,r=Z._data(e),s=Z._data(t,r),l=r.events;if(l){delete s.handle,s.events={};for(o in l)for(n=0,i=l[o].length;i>n;n++)Z.event.add(t,o,l[o][n])}s.data&&(s.data=Z.extend({},s.data))}}function d(e,t){var o;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),o=t.nodeName.toLowerCase(),"object"===o?(t.parentNode&&(t.outerHTML=e.outerHTML),Z.support.html5Clone&&e.innerHTML&&!Z.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===o&&Xt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===o?t.selected=e.defaultSelected:"input"===o||"textarea"===o?t.defaultValue=e.defaultValue:"script"===o&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(Z.expando))}function p(e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName("*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll("*"):[]}function f(e){Xt.test(e.type)&&(e.defaultChecked=e.checked)}function m(e,t){if(t in e)return t;for(var o=t.charAt(0).toUpperCase()+t.slice(1),n=t,i=_o.length;i--;)if(t=_o[i]+o,t in e)return t;return n}function y(e,t){return e=t||e,"none"===Z.css(e,"display")||!Z.contains(e.ownerDocument,e)}function _(e,t){for(var o,n,i=[],r=0,s=e.length;s>r;r++)o=e[r],o.style&&(i[r]=Z._data(o,"olddisplay"),t?(!i[r]&&"none"===o.style.display&&(o.style.display=""),""===o.style.display&&y(o)&&(i[r]=Z._data(o,"olddisplay",B(o.nodeName)))):(n=oo(o,"display"),!i[r]&&"none"!==n&&Z._data(o,"olddisplay",n)));for(r=0;s>r;r++)o=e[r],o.style&&(t&&"none"!==o.style.display&&""!==o.style.display||(o.style.display=t?i[r]||"":"none"));return e}function E(e,t,o){var n=go.exec(t);return n?Math.max(0,n[1]-(o||0))+(n[2]||"px"):t}function v(e,t,o,n){for(var i=o===(n?"border":"content")?4:"width"===t?1:0,r=0;4>i;i+=2)"margin"===o&&(r+=Z.css(e,o+yo[i],!0)),n?("content"===o&&(r-=parseFloat(oo(e,"padding"+yo[i]))||0),"margin"!==o&&(r-=parseFloat(oo(e,"border"+yo[i]+"Width"))||0)):(r+=parseFloat(oo(e,"padding"+yo[i]))||0,"padding"!==o&&(r+=parseFloat(oo(e,"border"+yo[i]+"Width"))||0));return r}function C(e,t,o){var n="width"===t?e.offsetWidth:e.offsetHeight,i=!0,r=Z.support.boxSizing&&"border-box"===Z.css(e,"boxSizing");if(0>=n||null==n){if(n=oo(e,t),(0>n||null==n)&&(n=e.style[t]),uo.test(n))return n;i=r&&(Z.support.boxSizingReliable||n===e.style[t]),n=parseFloat(n)||0}return n+v(e,t,o||(r?"border":"content"),i)+"px"}function B(e){if(po[e])return po[e];var t=Z("<"+e+">").appendTo($.body),o=t.css("display");return t.remove(),("none"===o||""===o)&&(no=$.body.appendChild(no||Z.extend($.createElement("iframe"),{frameBorder:0,width:0,height:0})),io&&no.createElement||(io=(no.contentWindow||no.contentDocument).document,io.write("<!doctype html><html><body>"),io.close()),t=io.body.appendChild(io.createElement(e)),o=oo(t,"display"),$.body.removeChild(no)),po[e]=o,o}function k(e,t,o,n){var i;if(Z.isArray(t))Z.each(t,function(t,i){o||Co.test(e)?n(e,i):k(e+"["+("object"==typeof i?t:"")+"]",i,o,n)});else if(o||"object"!==Z.type(t))n(e,t);else for(i in t)k(e+"["+i+"]",t[i],o,n)}function b(e){return function(t,o){"string"!=typeof t&&(o=t,t="*");var n,i,r,s=t.toLowerCase().split(tt),l=0,a=s.length;if(Z.isFunction(o))for(;a>l;l++)n=s[l],r=/^\+/.test(n),r&&(n=n.substr(1)||"*"),i=e[n]=e[n]||[],i[r?"unshift":"push"](o)}}function A(e,o,n,i,r,s){r=r||o.dataTypes[0],s=s||{},s[r]=!0;for(var l,a=e[r],c=0,g=a?a.length:0,u=e===xo;g>c&&(u||!l);c++)l=a[c](o,n,i),"string"==typeof l&&(!u||s[l]?l=t:(o.dataTypes.unshift(l),l=A(e,o,n,i,l,s)));return(u||!l)&&!s["*"]&&(l=A(e,o,n,i,"*",s)),l}function T(e,o){var n,i,r=Z.ajaxSettings.flatOptions||{};for(n in o)o[n]!==t&&((r[n]?e:i||(i={}))[n]=o[n]);i&&Z.extend(!0,e,i)}function S(e,o,n){var i,r,s,l,a=e.contents,c=e.dataTypes,g=e.responseFields;for(r in g)r in n&&(o[g[r]]=n[r]);for(;"*"===c[0];)c.shift(),i===t&&(i=e.mimeType||o.getResponseHeader("content-type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){c.unshift(r);break}if(c[0]in n)s=c[0];else{for(r in n){if(!c[0]||e.converters[r+" "+c[0]]){s=r;break}l||(l=r)}s=s||l}return s?(s!==c[0]&&c.unshift(s),n[s]):void 0}function R(e,t){var o,n,i,r,s=e.dataTypes.slice(),l=s[0],a={},c=0;if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),s[1])for(o in e.converters)a[o.toLowerCase()]=e.converters[o];for(;i=s[++c];)if("*"!==i){if("*"!==l&&l!==i){if(o=a[l+" "+i]||a["* "+i],!o)for(n in a)if(r=n.split(" "),r[1]===i&&(o=a[l+" "+r[0]]||a["* "+r[0]])){o===!0?o=a[n]:a[n]!==!0&&(i=r[0],s.splice(c--,0,i));break}if(o!==!0)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(g){return{state:"parsererror",error:o?g:"No conversion from "+l+" to "+i}}}l=i}return{state:"success",data:t}}function I(){try{return new e.XMLHttpRequest}catch(t){}}function D(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function w(){return setTimeout(function(){Yo=t},0),Yo=Z.now()}function L(e,t){Z.each(t,function(t,o){for(var n=(en[t]||[]).concat(en["*"]),i=0,r=n.length;r>i;i++)if(n[i].call(e,t,o))return})}function F(e,t,o){var n,i=0,r=Jo.length,s=Z.Deferred().always(function(){delete l.elem}),l=function(){for(var t=Yo||w(),o=Math.max(0,a.startTime+a.duration-t),n=1-(o/a.duration||0),i=0,r=a.tweens.length;r>i;i++)a.tweens[i].run(n);return s.notifyWith(e,[a,n,o]),1>n&&r?o:(s.resolveWith(e,[a]),!1)},a=s.promise({elem:e,props:Z.extend({},t),opts:Z.extend(!0,{specialEasing:{}},o),originalProperties:t,originalOptions:o,startTime:Yo||w(),duration:o.duration,tweens:[],createTween:function(t,o){var n=Z.Tween(e,a.opts,t,o,a.opts.specialEasing[t]||a.opts.easing);return a.tweens.push(n),n},stop:function(t){for(var o=0,n=t?a.tweens.length:0;n>o;o++)a.tweens[o].run(1);return t?s.resolveWith(e,[a,t]):s.rejectWith(e,[a,t]),this}}),c=a.props;for(N(c,a.opts.specialEasing);r>i;i++)if(n=Jo[i].call(a,e,c,a.opts))return n;return L(a,c),Z.isFunction(a.opts.start)&&a.opts.start.call(e,a),Z.fx.timer(Z.extend(l,{anim:a,queue:a.opts.queue,elem:e})),a.progress(a.opts.progress).done(a.opts.done,a.opts.complete).fail(a.opts.fail).always(a.opts.always)}function N(e,t){var o,n,i,r,s;for(o in e)if(n=Z.camelCase(o),i=t[n],r=e[o],Z.isArray(r)&&(i=r[1],r=e[o]=r[0]),o!==n&&(e[n]=r,delete e[o]),s=Z.cssHooks[n],s&&"expand"in s){r=s.expand(r),delete e[n];for(o in r)o in e||(e[o]=r[o],t[o]=i)}else t[n]=i}function O(e,t,o){var n,i,r,s,l,a,c,g,u=this,h=e.style,d={},p=[],f=e.nodeType&&y(e);o.queue||(c=Z._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,g=c.empty.fire,c.empty.fire=function(){c.unqueued||g()}),c.unqueued++,u.always(function(){u.always(function(){c.unqueued--,Z.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(o.overflow=[h.overflow,h.overflowX,h.overflowY],"inline"===Z.css(e,"display")&&"none"===Z.css(e,"float")&&(Z.support.inlineBlockNeedsLayout&&"inline"!==B(e.nodeName)?h.zoom=1:h.display="inline-block")),o.overflow&&(h.overflow="hidden",Z.support.shrinkWrapBlocks||u.done(function(){h.overflow=o.overflow[0],h.overflowX=o.overflow[1],h.overflowY=o.overflow[2]}));for(n in t)if(r=t[n],qo.exec(r)){if(delete t[n],r===(f?"hide":"show"))continue;p.push(n)}if(s=p.length)for(l=Z._data(e,"fxshow")||Z._data(e,"fxshow",{}),f?Z(e).show():u.done(function(){Z(e).hide()}),u.done(function(){var t;Z.removeData(e,"fxshow",!0);for(t in d)Z.style(e,t,d[t])}),n=0;s>n;n++)i=p[n],a=u.createTween(i,f?l[i]:0),d[i]=l[i]||Z.style(e,i),i in l||(l[i]=a.start,f&&(a.end=a.start,a.start="width"===i||"height"===i?1:0))}function M(e,t,o,n,i){return new M.prototype.init(e,t,o,n,i)}function x(e,t){var o,n={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)o=yo[i],n["margin"+o]=n["padding"+o]=e;return t&&(n.opacity=n.width=e),n}function P(e){return Z.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var H,U,$=e.document,W=e.location,G=e.navigator,V=e.jQuery,K=e.$,j=Array.prototype.push,z=Array.prototype.slice,Y=Array.prototype.indexOf,X=Object.prototype.toString,q=Object.prototype.hasOwnProperty,Q=String.prototype.trim,Z=function(e,t){return new Z.fn.init(e,t,H)},J=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,et=/\S/,tt=/\s+/,ot=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,nt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,it=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,rt=/^[\],:{}\s]*$/,st=/(?:^|:|,)(?:\s*\[)+/g,lt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,at=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,ct=/^-ms-/,gt=/-([\da-z])/gi,ut=function(e,t){return(t+"").toUpperCase()},ht=function(){$.addEventListener?($.removeEventListener("DOMContentLoaded",ht,!1),Z.ready()):"complete"===$.readyState&&($.detachEvent("onreadystatechange",ht),Z.ready())},dt={};Z.fn=Z.prototype={constructor:Z,init:function(e,o,n){var i,r,s;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:nt.exec(e),i&&(i[1]||!o)){if(i[1])return o=o instanceof Z?o[0]:o,s=o&&o.nodeType?o.ownerDocument||o:$,e=Z.parseHTML(i[1],s,!0),it.test(i[1])&&Z.isPlainObject(o)&&this.attr.call(e,o,!0),Z.merge(this,e);if(r=$.getElementById(i[2]),r&&r.parentNode){if(r.id!==i[2])return n.find(e);this.length=1,this[0]=r}return this.context=$,this.selector=e,this}return!o||o.jquery?(o||n).find(e):this.constructor(o).find(e)}return Z.isFunction(e)?n.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),Z.makeArray(e,this))},selector:"",jquery:"1.8.1",length:0,size:function(){return this.length},toArray:function(){return z.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e,t,o){var n=Z.merge(this.constructor(),e);return n.prevObject=this,n.context=this.context,"find"===t?n.selector=this.selector+(this.selector?" ":"")+o:t&&(n.selector=this.selector+"."+t+"("+o+")"),n},each:function(e,t){return Z.each(this,e,t)},ready:function(e){return Z.ready.promise().done(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(z.apply(this,arguments),"slice",z.call(arguments).join(","))},map:function(e){return this.pushStack(Z.map(this,function(t,o){return e.call(t,o,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},Z.fn.init.prototype=Z.fn,Z.extend=Z.fn.extend=function(){var e,o,n,i,r,s,l=arguments[0]||{},a=1,c=arguments.length,g=!1;for("boolean"==typeof l&&(g=l,l=arguments[1]||{},a=2),"object"!=typeof l&&!Z.isFunction(l)&&(l={}),c===a&&(l=this,--a);c>a;a++)if(null!=(e=arguments[a]))for(o in e)n=l[o],i=e[o],l!==i&&(g&&i&&(Z.isPlainObject(i)||(r=Z.isArray(i)))?(r?(r=!1,s=n&&Z.isArray(n)?n:[]):s=n&&Z.isPlainObject(n)?n:{},l[o]=Z.extend(g,s,i)):i!==t&&(l[o]=i));return l},Z.extend({noConflict:function(t){return e.$===Z&&(e.$=K),t&&e.jQuery===Z&&(e.jQuery=V),Z},isReady:!1,readyWait:1,holdReady:function(e){e?Z.readyWait++:Z.ready(!0)},ready:function(e){if(e===!0?!--Z.readyWait:!Z.isReady){if(!$.body)return setTimeout(Z.ready,1);Z.isReady=!0,e!==!0&&--Z.readyWait>0||(U.resolveWith($,[Z]),Z.fn.trigger&&Z($).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===Z.type(e)},isArray:Array.isArray||function(e){return"array"===Z.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?String(e):dt[X.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==Z.type(e)||e.nodeType||Z.isWindow(e))return!1;try{if(e.constructor&&!q.call(e,"constructor")&&!q.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(o){return!1}var n;for(n in e);return n===t||q.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,o){var n;return e&&"string"==typeof e?("boolean"==typeof t&&(o=t,t=0),t=t||$,(n=it.exec(e))?[t.createElement(n[1])]:(n=Z.buildFragment([e],t,o?null:[]),Z.merge([],(n.cacheable?Z.clone(n.fragment):n.fragment).childNodes))):null},parseJSON:function(t){return t&&"string"==typeof t?(t=Z.trim(t),e.JSON&&e.JSON.parse?e.JSON.parse(t):rt.test(t.replace(lt,"@").replace(at,"]").replace(st,""))?new Function("return "+t)():(Z.error("Invalid JSON: "+t),void 0)):null},parseXML:function(o){var n,i;if(!o||"string"!=typeof o)return null;try{e.DOMParser?(i=new DOMParser,n=i.parseFromString(o,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(o))}catch(r){n=t}return(!n||!n.documentElement||n.getElementsByTagName("parsererror").length)&&Z.error("Invalid XML: "+o),n},noop:function(){},globalEval:function(t){t&&et.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ct,"ms-").replace(gt,ut)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,o,n){var i,r=0,s=e.length,l=s===t||Z.isFunction(e);if(n)if(l){for(i in e)if(o.apply(e[i],n)===!1)break}else for(;s>r&&o.apply(e[r++],n)!==!1;);else if(l){for(i in e)if(o.call(e[i],i,e[i])===!1)break}else for(;s>r&&o.call(e[r],r,e[r++])!==!1;);return e},trim:Q&&!Q.call(" ")?function(e){return null==e?"":Q.call(e)}:function(e){return null==e?"":e.toString().replace(ot,"")},makeArray:function(e,t){var o,n=t||[];return null!=e&&(o=Z.type(e),null==e.length||"string"===o||"function"===o||"regexp"===o||Z.isWindow(e)?j.call(n,e):Z.merge(n,e)),n},inArray:function(e,t,o){var n;if(t){if(Y)return Y.call(t,e,o);for(n=t.length,o=o?0>o?Math.max(0,n+o):o:0;n>o;o++)if(o in t&&t[o]===e)return o}return-1},merge:function(e,o){var n=o.length,i=e.length,r=0;if("number"==typeof n)for(;n>r;r++)e[i++]=o[r];else for(;o[r]!==t;)e[i++]=o[r++];return e.length=i,e},grep:function(e,t,o){var n,i=[],r=0,s=e.length;for(o=!!o;s>r;r++)n=!!t(e[r],r),o!==n&&i.push(e[r]);return i},map:function(e,o,n){var i,r,s=[],l=0,a=e.length,c=e instanceof Z||a!==t&&"number"==typeof a&&(a>0&&e[0]&&e[a-1]||0===a||Z.isArray(e));if(c)for(;a>l;l++)i=o(e[l],l,n),null!=i&&(s[s.length]=i);else for(r in e)i=o(e[r],r,n),null!=i&&(s[s.length]=i);return s.concat.apply([],s)},guid:1,proxy:function(e,o){var n,i,r;return"string"==typeof o&&(n=e[o],o=e,e=n),Z.isFunction(e)?(i=z.call(arguments,2),r=function(){return e.apply(o,i.concat(z.call(arguments)))},r.guid=e.guid=e.guid||r.guid||Z.guid++,r):t},access:function(e,o,n,i,r,s,l){var a,c=null==n,g=0,u=e.length;if(n&&"object"==typeof n){for(g in n)Z.access(e,o,g,n[g],1,s,i);r=1}else if(i!==t){if(a=l===t&&Z.isFunction(i),c&&(a?(a=o,o=function(e,t,o){return a.call(Z(e),o)}):(o.call(e,i),o=null)),o)for(;u>g;g++)o(e[g],n,a?i.call(e[g],g,o(e[g],n)):i,l);r=1}return r?e:c?o.call(e):u?o(e[0],n):s},now:function(){return(new Date).getTime()}}),Z.ready.promise=function(t){if(!U)if(U=Z.Deferred(),"complete"===$.readyState)setTimeout(Z.ready,1);else if($.addEventListener)$.addEventListener("DOMContentLoaded",ht,!1),e.addEventListener("load",Z.ready,!1);else{$.attachEvent("onreadystatechange",ht),e.attachEvent("onload",Z.ready);var o=!1;try{o=null==e.frameElement&&$.documentElement}catch(n){}o&&o.doScroll&&function i(){if(!Z.isReady){try{o.doScroll("left")}catch(e){return setTimeout(i,50)}Z.ready()}}()}return U.promise(t)},Z.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){dt["[object "+t+"]"]=t.toLowerCase()}),H=Z($);var pt={};Z.Callbacks=function(e){e="string"==typeof e?pt[e]||o(e):Z.extend({},e);var n,i,r,s,l,a,c=[],g=!e.once&&[],u=function(t){for(n=e.memory&&t,i=!0,a=s||0,s=0,l=c.length,r=!0;c&&l>a;a++)if(c[a].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}r=!1,c&&(g?g.length&&u(g.shift()):n?c=[]:h.disable())},h={add:function(){if(c){var t=c.length;!function o(t){Z.each(t,function(t,n){var i=Z.type(n);"function"!==i||e.unique&&h.has(n)?n&&n.length&&"string"!==i&&o(n):c.push(n)})}(arguments),r?l=c.length:n&&(s=t,u(n))}return this},remove:function(){return c&&Z.each(arguments,function(e,t){for(var o;(o=Z.inArray(t,c,o))>-1;)c.splice(o,1),r&&(l>=o&&l--,a>=o&&a--)}),this},has:function(e){return Z.inArray(e,c)>-1},empty:function(){return c=[],this},disable:function(){return c=g=n=t,this},disabled:function(){return!c},lock:function(){return g=t,n||h.disable(),this},locked:function(){return!g},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],c&&(!i||g)&&(r?g.push(t):u(t)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!i}};return h},Z.extend({Deferred:function(e){var t=[["resolve","done",Z.Callbacks("once memory"),"resolved"],["reject","fail",Z.Callbacks("once memory"),"rejected"],["notify","progress",Z.Callbacks("memory")]],o="pending",n={state:function(){return o},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Z.Deferred(function(o){Z.each(t,function(t,n){var r=n[0],s=e[t];i[n[1]](Z.isFunction(s)?function(){var e=s.apply(this,arguments);e&&Z.isFunction(e.promise)?e.promise().done(o.resolve).fail(o.reject).progress(o.notify):o[r+"With"](this===i?o:this,[e])}:o[r])}),e=null}).promise()},promise:function(e){return"object"==typeof e?Z.extend(e,n):n}},i={};return n.pipe=n.then,Z.each(t,function(e,r){var s=r[2],l=r[3];n[r[1]]=s.add,l&&s.add(function(){o=l},t[1^e][2].disable,t[2][2].lock),i[r[0]]=s.fire,i[r[0]+"With"]=s.fireWith}),n.promise(i),e&&e.call(i,i),i},when:function(e){var t,o,n,i=0,r=z.call(arguments),s=r.length,l=1!==s||e&&Z.isFunction(e.promise)?s:0,a=1===l?e:Z.Deferred(),c=function(e,o,n){return function(i){o[e]=this,n[e]=arguments.length>1?z.call(arguments):i,n===t?a.notifyWith(o,n):--l||a.resolveWith(o,n)}};if(s>1)for(t=new Array(s),o=new Array(s),n=new Array(s);s>i;i++)r[i]&&Z.isFunction(r[i].promise)?r[i].promise().done(c(i,n,r)).fail(a.reject).progress(c(i,o,t)):--l;return l||a.resolveWith(n,r),a.promise()}}),Z.support=function(){var t,o,n,i,r,s,l,a,c,g,u,h=$.createElement("div");if(h.setAttribute("className","t"),h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",o=h.getElementsByTagName("*"),n=h.getElementsByTagName("a")[0],n.style.cssText="top:1px;float:left;opacity:.5",!o||!o.length||!n)return{};i=$.createElement("select"),r=i.appendChild($.createElement("option")),s=h.getElementsByTagName("input")[0],t={leadingWhitespace:3===h.firstChild.nodeType,tbody:!h.getElementsByTagName("tbody").length,htmlSerialize:!!h.getElementsByTagName("link").length,style:/top/.test(n.getAttribute("style")),hrefNormalized:"/a"===n.getAttribute("href"),opacity:/^0.5/.test(n.style.opacity),cssFloat:!!n.style.cssFloat,checkOn:"on"===s.value,optSelected:r.selected,getSetAttribute:"t"!==h.className,enctype:!!$.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==$.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===$.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,t.noCloneChecked=s.cloneNode(!0).checked,i.disabled=!0,t.optDisabled=!r.disabled;try{delete h.test}catch(d){t.deleteExpando=!1}if(!h.addEventListener&&h.attachEvent&&h.fireEvent&&(h.attachEvent("onclick",u=function(){t.noCloneEvent=!1}),h.cloneNode(!0).fireEvent("onclick"),h.detachEvent("onclick",u)),s=$.createElement("input"),s.value="t",s.setAttribute("type","radio"),t.radioValue="t"===s.value,s.setAttribute("checked","checked"),s.setAttribute("name","t"),h.appendChild(s),l=$.createDocumentFragment(),l.appendChild(h.lastChild),t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=s.checked,l.removeChild(s),l.appendChild(h),h.attachEvent)for(c in{submit:!0,change:!0,focusin:!0})a="on"+c,g=a in h,g||(h.setAttribute(a,"return;"),g="function"==typeof h[a]),t[c+"Bubbles"]=g;return Z(function(){var o,n,i,r,s="padding:0;margin:0;border:0;display:block;overflow:hidden;",l=$.getElementsByTagName("body")[0];l&&(o=$.createElement("div"),o.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",l.insertBefore(o,l.firstChild),n=$.createElement("div"),o.appendChild(n),n.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=n.getElementsByTagName("td"),i[0].style.cssText="padding:0;margin:0;border:0;display:none",g=0===i[0].offsetHeight,i[0].style.display="",i[1].style.display="none",t.reliableHiddenOffsets=g&&0===i[0].offsetHeight,n.innerHTML="",n.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===n.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==l.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(n,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(n,null)||{width:"4px"}).width,r=$.createElement("div"),r.style.cssText=n.style.cssText=s,r.style.marginRight=r.style.width="0",n.style.width="1px",n.appendChild(r),t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),"undefined"!=typeof n.style.zoom&&(n.innerHTML="",n.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===n.offsetWidth,n.style.display="block",n.style.overflow="visible",n.innerHTML="<div></div>",n.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==n.offsetWidth,o.style.zoom=1),l.removeChild(o),o=n=i=r=null)}),l.removeChild(h),o=n=i=r=s=l=h=null,t}();var ft=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,mt=/([A-Z])/g;Z.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(Z.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?Z.cache[e[Z.expando]]:e[Z.expando],!!e&&!i(e)},data:function(e,o,n,i){if(Z.acceptData(e)){var r,s,l=Z.expando,a="string"==typeof o,c=e.nodeType,g=c?Z.cache:e,u=c?e[l]:e[l]&&l;if(u&&g[u]&&(i||g[u].data)||!a||n!==t)return u||(c?e[l]=u=Z.deletedIds.pop()||++Z.uuid:u=l),g[u]||(g[u]={},c||(g[u].toJSON=Z.noop)),("object"==typeof o||"function"==typeof o)&&(i?g[u]=Z.extend(g[u],o):g[u].data=Z.extend(g[u].data,o)),r=g[u],i||(r.data||(r.data={}),r=r.data),n!==t&&(r[Z.camelCase(o)]=n),a?(s=r[o],null==s&&(s=r[Z.camelCase(o)])):s=r,s}},removeData:function(e,t,o){if(Z.acceptData(e)){var n,r,s,l=e.nodeType,a=l?Z.cache:e,c=l?e[Z.expando]:Z.expando;if(a[c]){if(t&&(n=o?a[c]:a[c].data)){Z.isArray(t)||(t in n?t=[t]:(t=Z.camelCase(t),t=t in n?[t]:t.split(" ")));for(r=0,s=t.length;s>r;r++)delete n[t[r]];if(!(o?i:Z.isEmptyObject)(n))return}(o||(delete a[c].data,i(a[c])))&&(l?Z.cleanData([e],!0):Z.support.deleteExpando||a!=a.window?delete a[c]:a[c]=null)}}},_data:function(e,t,o){return Z.data(e,t,o,!0)},acceptData:function(e){var t=e.nodeName&&Z.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),Z.fn.extend({data:function(e,o){var i,r,s,l,a,c=this[0],g=0,u=null;if(e===t){if(this.length&&(u=Z.data(c),1===c.nodeType&&!Z._data(c,"parsedAttrs"))){for(s=c.attributes,a=s.length;a>g;g++)l=s[g].name,0===l.indexOf("data-")&&(l=Z.camelCase(l.substring(5)),n(c,l,u[l]));Z._data(c,"parsedAttrs",!0)}return u}return"object"==typeof e?this.each(function(){Z.data(this,e)}):(i=e.split(".",2),i[1]=i[1]?"."+i[1]:"",r=i[1]+"!",Z.access(this,function(o){return o===t?(u=this.triggerHandler("getData"+r,[i[0]]),u===t&&c&&(u=Z.data(c,e),u=n(c,e,u)),u===t&&i[1]?this.data(i[0]):u):(i[1]=o,this.each(function(){var t=Z(this);t.triggerHandler("setData"+r,i),Z.data(this,e,o),t.triggerHandler("changeData"+r,i)}),void 0)},null,o,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){Z.removeData(this,e)})}}),Z.extend({queue:function(e,t,o){var n;return e?(t=(t||"fx")+"queue",n=Z._data(e,t),o&&(!n||Z.isArray(o)?n=Z._data(e,t,Z.makeArray(o)):n.push(o)),n||[]):void 0},dequeue:function(e,t){t=t||"fx";var o=Z.queue(e,t),n=o.length,i=o.shift(),r=Z._queueHooks(e,t),s=function(){Z.dequeue(e,t)};"inprogress"===i&&(i=o.shift(),n--),i&&("fx"===t&&o.unshift("inprogress"),delete r.stop,i.call(e,s,r)),!n&&r&&r.empty.fire()},_queueHooks:function(e,t){var o=t+"queueHooks";return Z._data(e,o)||Z._data(e,o,{empty:Z.Callbacks("once memory").add(function(){Z.removeData(e,t+"queue",!0),Z.removeData(e,o,!0)})})}}),Z.fn.extend({queue:function(e,o){var n=2;return"string"!=typeof e&&(o=e,e="fx",n--),arguments.length<n?Z.queue(this[0],e):o===t?this:this.each(function(){var t=Z.queue(this,e,o);Z._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&Z.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Z.dequeue(this,e)})},delay:function(e,t){return e=Z.fx?Z.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,o){var n=setTimeout(t,e);o.stop=function(){clearTimeout(n)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,o){var n,i=1,r=Z.Deferred(),s=this,l=this.length,a=function(){--i||r.resolveWith(s,[s])};for("string"!=typeof e&&(o=e,e=t),e=e||"fx";l--;)n=Z._data(s[l],e+"queueHooks"),n&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(o)}});var yt,_t,Et,vt=/[\t\r\n]/g,Ct=/\r/g,Bt=/^(?:button|input)$/i,kt=/^(?:button|input|object|select|textarea)$/i,bt=/^a(?:rea|)$/i,At=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,Tt=Z.support.getSetAttribute;Z.fn.extend({attr:function(e,t){return Z.access(this,Z.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Z.removeAttr(this,e)})},prop:function(e,t){return Z.access(this,Z.prop,e,t,arguments.length>1)},removeProp:function(e){return e=Z.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(o){}})},addClass:function(e){var t,o,n,i,r,s,l;if(Z.isFunction(e))return this.each(function(t){Z(this).addClass(e.call(this,t,this.className))});if(e&&"string"==typeof e)for(t=e.split(tt),o=0,n=this.length;n>o;o++)if(i=this[o],1===i.nodeType)if(i.className||1!==t.length){for(r=" "+i.className+" ",s=0,l=t.length;l>s;s++)~r.indexOf(" "+t[s]+" ")||(r+=t[s]+" ");i.className=Z.trim(r)}else i.className=e;return this},removeClass:function(e){var o,n,i,r,s,l,a;if(Z.isFunction(e))return this.each(function(t){Z(this).removeClass(e.call(this,t,this.className))});if(e&&"string"==typeof e||e===t)for(o=(e||"").split(tt),l=0,a=this.length;a>l;l++)if(i=this[l],1===i.nodeType&&i.className){for(n=(" "+i.className+" ").replace(vt," "),r=0,s=o.length;s>r;r++)for(;n.indexOf(" "+o[r]+" ")>-1;)n=n.replace(" "+o[r]+" "," ");i.className=e?Z.trim(n):""}return this},toggleClass:function(e,t){var o=typeof e,n="boolean"==typeof t;return Z.isFunction(e)?this.each(function(o){Z(this).toggleClass(e.call(this,o,this.className,t),t)}):this.each(function(){if("string"===o)for(var i,r=0,s=Z(this),l=t,a=e.split(tt);i=a[r++];)l=n?l:!s.hasClass(i),s[l?"addClass":"removeClass"](i);else("undefined"===o||"boolean"===o)&&(this.className&&Z._data(this,"__className__",this.className),this.className=this.className||e===!1?"":Z._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",o=0,n=this.length;n>o;o++)if(1===this[o].nodeType&&(" "+this[o].className+" ").replace(vt," ").indexOf(t)>-1)return!0;return!1},val:function(e){var o,n,i,r=this[0];{if(arguments.length)return i=Z.isFunction(e),this.each(function(n){var r,s=Z(this);1===this.nodeType&&(r=i?e.call(this,n,s.val()):e,null==r?r="":"number"==typeof r?r+="":Z.isArray(r)&&(r=Z.map(r,function(e){return null==e?"":e+""})),o=Z.valHooks[this.type]||Z.valHooks[this.nodeName.toLowerCase()],o&&"set"in o&&o.set(this,r,"value")!==t||(this.value=r))});if(r)return o=Z.valHooks[r.type]||Z.valHooks[r.nodeName.toLowerCase()],o&&"get"in o&&(n=o.get(r,"value"))!==t?n:(n=r.value,"string"==typeof n?n.replace(Ct,""):null==n?"":n)}}}),Z.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,o,n,i,r=e.selectedIndex,s=[],l=e.options,a="select-one"===e.type;if(0>r)return null;for(o=a?r:0,n=a?r+1:l.length;n>o;o++)if(i=l[o],!(!i.selected||(Z.support.optDisabled?i.disabled:null!==i.getAttribute("disabled"))||i.parentNode.disabled&&Z.nodeName(i.parentNode,"optgroup"))){if(t=Z(i).val(),a)return t;s.push(t)}return a&&!s.length&&l.length?Z(l[r]).val():s},set:function(e,t){var o=Z.makeArray(t);return Z(e).find("option").each(function(){this.selected=Z.inArray(Z(this).val(),o)>=0}),o.length||(e.selectedIndex=-1),o}}},attrFn:{},attr:function(e,o,n,i){var r,s,l,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return i&&Z.isFunction(Z.fn[o])?Z(e)[o](n):"undefined"==typeof e.getAttribute?Z.prop(e,o,n):(l=1!==a||!Z.isXMLDoc(e),l&&(o=o.toLowerCase(),s=Z.attrHooks[o]||(At.test(o)?_t:yt)),n!==t?null===n?(Z.removeAttr(e,o),void 0):s&&"set"in s&&l&&(r=s.set(e,n,o))!==t?r:(e.setAttribute(o,""+n),n):s&&"get"in s&&l&&null!==(r=s.get(e,o))?r:(r=e.getAttribute(o),null===r?t:r))},removeAttr:function(e,t){var o,n,i,r,s=0;if(t&&1===e.nodeType)for(n=t.split(tt);s<n.length;s++)i=n[s],i&&(o=Z.propFix[i]||i,r=At.test(i),r||Z.attr(e,i,""),e.removeAttribute(Tt?i:o),r&&o in e&&(e[o]=!1))},attrHooks:{type:{set:function(e,t){if(Bt.test(e.nodeName)&&e.parentNode)Z.error("type property can't be changed");else if(!Z.support.radioValue&&"radio"===t&&Z.nodeName(e,"input")){var o=e.value;return e.setAttribute("type",t),o&&(e.value=o),t}}},value:{get:function(e,t){return yt&&Z.nodeName(e,"button")?yt.get(e,t):t in e?e.value:null},set:function(e,t,o){return yt&&Z.nodeName(e,"button")?yt.set(e,t,o):(e.value=t,void 0)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,o,n){var i,r,s,l=e.nodeType;if(e&&3!==l&&8!==l&&2!==l)return s=1!==l||!Z.isXMLDoc(e),s&&(o=Z.propFix[o]||o,r=Z.propHooks[o]),n!==t?r&&"set"in r&&(i=r.set(e,n,o))!==t?i:e[o]=n:r&&"get"in r&&null!==(i=r.get(e,o))?i:e[o]},propHooks:{tabIndex:{get:function(e){var o=e.getAttributeNode("tabindex");return o&&o.specified?parseInt(o.value,10):kt.test(e.nodeName)||bt.test(e.nodeName)&&e.href?0:t}}}}),_t={get:function(e,o){var n,i=Z.prop(e,o);return i===!0||"boolean"!=typeof i&&(n=e.getAttributeNode(o))&&n.nodeValue!==!1?o.toLowerCase():t},set:function(e,t,o){var n;return t===!1?Z.removeAttr(e,o):(n=Z.propFix[o]||o,n in e&&(e[n]=!0),e.setAttribute(o,o.toLowerCase())),o}},Tt||(Et={name:!0,id:!0,coords:!0},yt=Z.valHooks.button={get:function(e,o){var n;return n=e.getAttributeNode(o),n&&(Et[o]?""!==n.value:n.specified)?n.value:t},set:function(e,t,o){var n=e.getAttributeNode(o);return n||(n=$.createAttribute(o),e.setAttributeNode(n)),n.value=t+""}},Z.each(["width","height"],function(e,t){Z.attrHooks[t]=Z.extend(Z.attrHooks[t],{set:function(e,o){return""===o?(e.setAttribute(t,"auto"),o):void 0}})}),Z.attrHooks.contenteditable={get:yt.get,set:function(e,t,o){""===t&&(t="false"),yt.set(e,t,o)}}),Z.support.hrefNormalized||Z.each(["href","src","width","height"],function(e,o){Z.attrHooks[o]=Z.extend(Z.attrHooks[o],{get:function(e){var n=e.getAttribute(o,2);return null===n?t:n}})}),Z.support.style||(Z.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=""+t}}),Z.support.optSelected||(Z.propHooks.selected=Z.extend(Z.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),Z.support.enctype||(Z.propFix.enctype="encoding"),Z.support.checkOn||Z.each(["radio","checkbox"],function(){Z.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value
2
+ }}}),Z.each(["radio","checkbox"],function(){Z.valHooks[this]=Z.extend(Z.valHooks[this],{set:function(e,t){return Z.isArray(t)?e.checked=Z.inArray(Z(e).val(),t)>=0:void 0}})});var St=/^(?:textarea|input|select)$/i,Rt=/^([^\.]*|)(?:\.(.+)|)$/,It=/(?:^|\s)hover(\.\S+|)\b/,Dt=/^key/,wt=/^(?:mouse|contextmenu)|click/,Lt=/^(?:focusinfocus|focusoutblur)$/,Ft=function(e){return Z.event.special.hover?e:e.replace(It,"mouseenter$1 mouseleave$1")};Z.event={add:function(e,o,n,i,r){var s,l,a,c,g,u,h,d,p,f,m;if(3!==e.nodeType&&8!==e.nodeType&&o&&n&&(s=Z._data(e))){for(n.handler&&(p=n,n=p.handler,r=p.selector),n.guid||(n.guid=Z.guid++),a=s.events,a||(s.events=a={}),l=s.handle,l||(s.handle=l=function(e){return"undefined"==typeof Z||e&&Z.event.triggered===e.type?t:Z.event.dispatch.apply(l.elem,arguments)},l.elem=e),o=Z.trim(Ft(o)).split(" "),c=0;c<o.length;c++)g=Rt.exec(o[c])||[],u=g[1],h=(g[2]||"").split(".").sort(),m=Z.event.special[u]||{},u=(r?m.delegateType:m.bindType)||u,m=Z.event.special[u]||{},d=Z.extend({type:u,origType:g[1],data:i,handler:n,guid:n.guid,selector:r,namespace:h.join(".")},p),f=a[u],f||(f=a[u]=[],f.delegateCount=0,m.setup&&m.setup.call(e,i,h,l)!==!1||(e.addEventListener?e.addEventListener(u,l,!1):e.attachEvent&&e.attachEvent("on"+u,l))),m.add&&(m.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),r?f.splice(f.delegateCount++,0,d):f.push(d),Z.event.global[u]=!0;e=null}},global:{},remove:function(e,t,o,n,i){var r,s,l,a,c,g,u,h,d,p,f,m=Z.hasData(e)&&Z._data(e);if(m&&(h=m.events)){for(t=Z.trim(Ft(t||"")).split(" "),r=0;r<t.length;r++)if(s=Rt.exec(t[r])||[],l=a=s[1],c=s[2],l){for(d=Z.event.special[l]||{},l=(n?d.delegateType:d.bindType)||l,p=h[l]||[],g=p.length,c=c?new RegExp("(^|\\.)"+c.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,u=0;u<p.length;u++)f=p[u],!(!i&&a!==f.origType||o&&o.guid!==f.guid||c&&!c.test(f.namespace)||n&&n!==f.selector&&("**"!==n||!f.selector)||(p.splice(u--,1),f.selector&&p.delegateCount--,!d.remove||!d.remove.call(e,f)));0===p.length&&g!==p.length&&((!d.teardown||d.teardown.call(e,c,m.handle)===!1)&&Z.removeEvent(e,l,m.handle),delete h[l])}else for(l in h)Z.event.remove(e,l+t[r],o,n,!0);Z.isEmptyObject(h)&&(delete m.handle,Z.removeData(e,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(o,n,i,r){if(!i||3!==i.nodeType&&8!==i.nodeType){var s,l,a,c,g,u,h,d,p,f,m=o.type||o,y=[];if(Lt.test(m+Z.event.triggered))return;if(m.indexOf("!")>=0&&(m=m.slice(0,-1),l=!0),m.indexOf(".")>=0&&(y=m.split("."),m=y.shift(),y.sort()),(!i||Z.event.customEvent[m])&&!Z.event.global[m])return;if(o="object"==typeof o?o[Z.expando]?o:new Z.Event(m,o):new Z.Event(m),o.type=m,o.isTrigger=!0,o.exclusive=l,o.namespace=y.join("."),o.namespace_re=o.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,u=m.indexOf(":")<0?"on"+m:"",!i){s=Z.cache;for(a in s)s[a].events&&s[a].events[m]&&Z.event.trigger(o,n,s[a].handle.elem,!0);return}if(o.result=t,o.target||(o.target=i),n=null!=n?Z.makeArray(n):[],n.unshift(o),h=Z.event.special[m]||{},h.trigger&&h.trigger.apply(i,n)===!1)return;if(p=[[i,h.bindType||m]],!r&&!h.noBubble&&!Z.isWindow(i)){for(f=h.delegateType||m,c=Lt.test(f+m)?i:i.parentNode,g=i;c;c=c.parentNode)p.push([c,f]),g=c;g===(i.ownerDocument||$)&&p.push([g.defaultView||g.parentWindow||e,f])}for(a=0;a<p.length&&!o.isPropagationStopped();a++)c=p[a][0],o.type=p[a][1],d=(Z._data(c,"events")||{})[o.type]&&Z._data(c,"handle"),d&&d.apply(c,n),d=u&&c[u],d&&Z.acceptData(c)&&d.apply(c,n)===!1&&o.preventDefault();return o.type=m,!(r||o.isDefaultPrevented()||h._default&&h._default.apply(i.ownerDocument,n)!==!1||"click"===m&&Z.nodeName(i,"a")||!Z.acceptData(i)||!u||!i[m]||("focus"===m||"blur"===m)&&0===o.target.offsetWidth||Z.isWindow(i)||(g=i[u],g&&(i[u]=null),Z.event.triggered=m,i[m](),Z.event.triggered=t,!g||!(i[u]=g))),o.result}},dispatch:function(o){o=Z.event.fix(o||e.event);var n,i,r,s,l,a,c,g,u,h=(Z._data(this,"events")||{})[o.type]||[],d=h.delegateCount,p=[].slice.call(arguments),f=!o.exclusive&&!o.namespace,m=Z.event.special[o.type]||{},y=[];if(p[0]=o,o.delegateTarget=this,!m.preDispatch||m.preDispatch.call(this,o)!==!1){if(d&&(!o.button||"click"!==o.type))for(r=o.target;r!=this;r=r.parentNode||this)if(r.disabled!==!0||"click"!==o.type){for(l={},c=[],n=0;d>n;n++)g=h[n],u=g.selector,l[u]===t&&(l[u]=Z(u,this).index(r)>=0),l[u]&&c.push(g);c.length&&y.push({elem:r,matches:c})}for(h.length>d&&y.push({elem:this,matches:h.slice(d)}),n=0;n<y.length&&!o.isPropagationStopped();n++)for(a=y[n],o.currentTarget=a.elem,i=0;i<a.matches.length&&!o.isImmediatePropagationStopped();i++)g=a.matches[i],(f||!o.namespace&&!g.namespace||o.namespace_re&&o.namespace_re.test(g.namespace))&&(o.data=g.data,o.handleObj=g,s=((Z.event.special[g.origType]||{}).handle||g.handler).apply(a.elem,p),s!==t&&(o.result=s,s===!1&&(o.preventDefault(),o.stopPropagation())));return m.postDispatch&&m.postDispatch.call(this,o),o.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,o){var n,i,r,s=o.button,l=o.fromElement;return null==e.pageX&&null!=o.clientX&&(n=e.target.ownerDocument||$,i=n.documentElement,r=n.body,e.pageX=o.clientX+(i&&i.scrollLeft||r&&r.scrollLeft||0)-(i&&i.clientLeft||r&&r.clientLeft||0),e.pageY=o.clientY+(i&&i.scrollTop||r&&r.scrollTop||0)-(i&&i.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?o.toElement:l),!e.which&&s!==t&&(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[Z.expando])return e;var t,o,n=e,i=Z.event.fixHooks[e.type]||{},r=i.props?this.props.concat(i.props):this.props;for(e=Z.Event(n),t=r.length;t;)o=r[--t],e[o]=n[o];return e.target||(e.target=n.srcElement||$),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,i.filter?i.filter(e,n):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,o){Z.isWindow(this)&&(this.onbeforeunload=o)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,o,n){var i=Z.extend(new Z.Event,o,{type:e,isSimulated:!0,originalEvent:{}});n?Z.event.trigger(i,null,t):Z.event.dispatch.call(t,i),i.isDefaultPrevented()&&o.preventDefault()}},Z.event.handle=Z.event.dispatch,Z.removeEvent=$.removeEventListener?function(e,t,o){e.removeEventListener&&e.removeEventListener(t,o,!1)}:function(e,t,o){var n="on"+t;e.detachEvent&&("undefined"==typeof e[n]&&(e[n]=null),e.detachEvent(n,o))},Z.Event=function(e,t){return this instanceof Z.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?s:r):this.type=e,t&&Z.extend(this,t),this.timeStamp=e&&e.timeStamp||Z.now(),this[Z.expando]=!0,void 0):new Z.Event(e,t)},Z.Event.prototype={preventDefault:function(){this.isDefaultPrevented=s;var e=this.originalEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=s;var e=this.originalEvent;e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=s,this.stopPropagation()},isDefaultPrevented:r,isPropagationStopped:r,isImmediatePropagationStopped:r},Z.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){Z.event.special[e]={delegateType:t,bindType:t,handle:function(e){{var o,n=this,i=e.relatedTarget,r=e.handleObj;r.selector}return(!i||i!==n&&!Z.contains(n,i))&&(e.type=r.origType,o=r.handler.apply(this,arguments),e.type=t),o}}}),Z.support.submitBubbles||(Z.event.special.submit={setup:function(){return Z.nodeName(this,"form")?!1:(Z.event.add(this,"click._submit keypress._submit",function(e){var o=e.target,n=Z.nodeName(o,"input")||Z.nodeName(o,"button")?o.form:t;n&&!Z._data(n,"_submit_attached")&&(Z.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),Z._data(n,"_submit_attached",!0))}),void 0)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&Z.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return Z.nodeName(this,"form")?!1:(Z.event.remove(this,"._submit"),void 0)}}),Z.support.changeBubbles||(Z.event.special.change={setup:function(){return St.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(Z.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),Z.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),Z.event.simulate("change",this,e,!0)})),!1):(Z.event.add(this,"beforeactivate._change",function(e){var t=e.target;St.test(t.nodeName)&&!Z._data(t,"_change_attached")&&(Z.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&Z.event.simulate("change",this.parentNode,e,!0)}),Z._data(t,"_change_attached",!0))}),void 0)},handle:function(e){var t=e.target;return this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type?e.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return Z.event.remove(this,"._change"),!St.test(this.nodeName)}}),Z.support.focusinBubbles||Z.each({focus:"focusin",blur:"focusout"},function(e,t){var o=0,n=function(e){Z.event.simulate(t,e.target,Z.event.fix(e),!0)};Z.event.special[t]={setup:function(){0===o++&&$.addEventListener(e,n,!0)},teardown:function(){0===--o&&$.removeEventListener(e,n,!0)}}}),Z.fn.extend({on:function(e,o,n,i,s){var l,a;if("object"==typeof e){"string"!=typeof o&&(n=n||o,o=t);for(a in e)this.on(a,o,n,e[a],s);return this}if(null==n&&null==i?(i=o,n=o=t):null==i&&("string"==typeof o?(i=n,n=t):(i=n,n=o,o=t)),i===!1)i=r;else if(!i)return this;return 1===s&&(l=i,i=function(e){return Z().off(e),l.apply(this,arguments)},i.guid=l.guid||(l.guid=Z.guid++)),this.each(function(){Z.event.add(this,e,i,n,o)})},one:function(e,t,o,n){return this.on(e,t,o,n,1)},off:function(e,o,n){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,Z(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(s in e)this.off(s,o,e[s]);return this}return(o===!1||"function"==typeof o)&&(n=o,o=t),n===!1&&(n=r),this.each(function(){Z.event.remove(this,e,n,o)})},bind:function(e,t,o){return this.on(e,null,t,o)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,o){return Z(this.context).on(e,this.selector,t,o),this},die:function(e,t){return Z(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,o,n){return this.on(t,e,o,n)},undelegate:function(e,t,o){return 1==arguments.length?this.off(e,"**"):this.off(t,e||"**",o)},trigger:function(e,t){return this.each(function(){Z.event.trigger(e,t,this)})},triggerHandler:function(e,t){return this[0]?Z.event.trigger(e,t,this[0],!0):void 0},toggle:function(e){var t=arguments,o=e.guid||Z.guid++,n=0,i=function(o){var i=(Z._data(this,"lastToggle"+e.guid)||0)%n;return Z._data(this,"lastToggle"+e.guid,i+1),o.preventDefault(),t[i].apply(this,arguments)||!1};for(i.guid=o;n<t.length;)t[n++].guid=o;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),Z.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){Z.fn[t]=function(e,o){return null==o&&(o=e,e=null),arguments.length>0?this.on(t,null,e,o):this.trigger(t)},Dt.test(t)&&(Z.event.fixHooks[t]=Z.event.keyHooks),wt.test(t)&&(Z.event.fixHooks[t]=Z.event.mouseHooks)}),function(e,t){function o(e,t,o,n){o=o||[],t=t||R;var i,r,s,l,a=t.nodeType;if(1!==a&&9!==a)return[];if(!e||"string"!=typeof e)return o;if(s=v(t),!s&&!n&&(i=X.exec(e)))if(l=i[1]){if(9===a){if(r=t.getElementById(l),!r||!r.parentNode)return o;if(r.id===l)return o.push(r),o}else if(t.ownerDocument&&(r=t.ownerDocument.getElementById(l))&&C(t,r)&&r.id===l)return o.push(r),o}else{if(i[2])return L.apply(o,w.call(t.getElementsByTagName(e),0)),o;if((l=i[3])&&lt&&t.getElementsByClassName)return L.apply(o,w.call(t.getElementsByClassName(l),0)),o}return p(e,t,o,n,s)}function n(e){return function(t){var o=t.nodeName.toLowerCase();return"input"===o&&t.type===e}}function i(e){return function(t){var o=t.nodeName.toLowerCase();return("input"===o||"button"===o)&&t.type===e}}function r(e,t,o){if(e===t)return o;for(var n=e.nextSibling;n;){if(n===t)return-1;n=n.nextSibling}return 1}function s(e,t,n,i){var r,s,l,a,c,g,u,h,d,p,f=!n&&t!==R,m=(f?"<s>":"")+e.replace(K,"$1<s>"),y=M[S][m];if(y)return i?0:w.call(y,0);for(c=e,g=[],h=0,d=_.preFilter,p=_.filter;c;){(!r||(s=j.exec(c)))&&(s&&(c=c.slice(s[0].length),l.selector=u),g.push(l=[]),u="",f&&(c=" "+c)),r=!1,(s=z.exec(c))&&(u+=s[0],c=c.slice(s[0].length),r=l.push({part:s.pop().replace(K," "),string:s[0],captures:s}));for(a in p)(s=ot[a].exec(c))&&(!d[a]||(s=d[a](s,t,n)))&&(u+=s[0],c=c.slice(s[0].length),r=l.push({part:a,string:s.shift(),captures:s}));if(!r)break}return u&&(l.selector=u),i?c.length:c?o.error(e):w.call(M(m,g),0)}function l(e,t,o,n){var i=t.dir,r=D++;return e||(e=function(e){return e===o}),t.first?function(t){for(;t=t[i];)if(1===t.nodeType)return e(t)&&t}:n?function(t){for(;t=t[i];)if(1===t.nodeType&&e(t))return t}:function(t){for(var o,n=r+"."+f,s=n+"."+m;t=t[i];)if(1===t.nodeType){if((o=t[S])===s)return t.sizset;if("string"==typeof o&&0===o.indexOf(n)){if(t.sizset)return t}else{if(t[S]=s,e(t))return t.sizset=!0,t;t.sizset=!1}}}}function a(e,t){return e?function(o){var n=t(o);return n&&e(n===!0?o:n)}:t}function c(e,t,o){for(var n,i,r=0;n=e[r];r++)i=_.relative[n.part]?l(i,_.relative[n.part],t,o):a(i,_.filter[n.part].apply(null,n.captures.concat(t,o)));return i}function g(e){return function(t){for(var o,n=0;o=e[n];n++)if(o(t))return!0;return!1}}function u(e,t,n,i){for(var r=0,s=t.length;s>r;r++)o(e,t[r],n,i)}function h(e,t,n,i,r,s){var l,a=_.setFilters[t.toLowerCase()];return a||o.error(t),(e||!(l=r))&&u(e||"*",i,l=[],r),l.length>0?a(l,n,s):[]}function d(e,n,i,r){for(var s,l,a,c,g,d,p,f,m,y,_,E,v,C=0,B=e.length,k=ot.POS,b=new RegExp("^"+k.source+"(?!"+P+")","i"),A=function(){for(var e=1,o=arguments.length-2;o>e;e++)arguments[e]===t&&(m[e]=t)};B>C;C++){for(s=e[C],l="",f=r,a=0,c=s.length;c>a;a++){if(g=s[a],d=g.string,"PSEUDO"===g.part)for(k.exec(""),p=0;m=k.exec(d);)y=!0,_=k.lastIndex=m.index+m[0].length,_>p&&(l+=d.slice(p,m.index),p=_,E=[n],z.test(l)&&(f&&(E=f),f=r),(v=Q.test(l))&&(l=l.slice(0,-5).replace(z,"$&*"),p++),m.length>1&&m[0].replace(b,A),f=h(l,m[1],m[2],E,f,v)),l="";y||(l+=d),y=!1}l?z.test(l)?u(l,f||[n],i,r):o(l,n,i,r?r.concat(f):f):L.apply(i,f)}return 1===B?i:o.uniqueSort(i)}function p(e,t,o,n,i){e=e.replace(K,"$1");var r,l,a,c,g,u,h,p,y,E=s(e,t,i),v=t.nodeType;if(ot.POS.test(e))return d(E,t,o,n);if(n)r=w.call(n,0);else if(1===E.length){if((g=w.call(E[0],0)).length>2&&"ID"===(u=g[0]).part&&9===v&&!i&&_.relative[g[1].part]){if(t=_.find.ID(u.captures[0].replace(tt,""),t,i)[0],!t)return o;e=e.slice(g.shift().string.length)}for(p=(E=q.exec(g[0].string))&&!E.index&&t.parentNode||t,h="",c=g.length-1;c>=0&&(u=g[c],y=u.part,h=u.string+h,!_.relative[y]);c--)if(_.order.test(y)){if(r=_.find[y](u.captures[0].replace(tt,""),p,i),null==r)continue;e=e.slice(0,e.length-h.length)+h.replace(ot[y],""),e||L.apply(o,w.call(r,0));break}}if(e)for(l=B(e,t,i),f=l.dirruns++,null==r&&(r=_.find.TAG("*",q.test(e)&&t.parentNode||t)),c=0;a=r[c];c++)m=l.runs++,l(a)&&o.push(a);return o}var f,m,y,_,E,v,C,B,k,b,A=!0,T="undefined",S=("sizcache"+Math.random()).replace(".",""),R=e.document,I=R.documentElement,D=0,w=[].slice,L=[].push,F=function(e,t){return e[S]=t||!0,e},N=function(){var e={},t=[];return F(function(o,n){return t.push(o)>_.cacheLength&&delete e[t.shift()],e[o]=n},e)},O=N(),M=N(),x=N(),P="[\\x20\\t\\r\\n\\f]",H="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",U=H.replace("w","w#"),$="([*^$|!~]?=)",W="\\["+P+"*("+H+")"+P+"*(?:"+$+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+U+")|)|)"+P+"*\\]",G=":("+H+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+W+")|[^:]|\\\\.)*|.*))\\)|)",V=":(nth|eq|gt|lt|first|last|even|odd)(?:\\(((?:-\\d)?\\d*)\\)|)(?=[^-]|$)",K=new RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),j=new RegExp("^"+P+"*,"+P+"*"),z=new RegExp("^"+P+"*([\\x20\\t\\r\\n\\f>+~])"+P+"*"),Y=new RegExp(G),X=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,q=/[\x20\t\r\n\f]*[+~]/,Q=/:not\($/,J=/h\d/i,et=/input|select|textarea|button/i,tt=/\\(?!\\)/g,ot={ID:new RegExp("^#("+H+")"),CLASS:new RegExp("^\\.("+H+")"),NAME:new RegExp("^\\[name=['\"]?("+H+")['\"]?\\]"),TAG:new RegExp("^("+H.replace("w","w*")+")"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+G),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),POS:new RegExp(V,"ig"),needsContext:new RegExp("^"+P+"*[>+~]|"+V,"i")},nt=function(e){var t=R.createElement("div");try{return e(t)}catch(o){return!1}finally{t=null}},it=nt(function(e){return e.appendChild(R.createComment("")),!e.getElementsByTagName("*").length}),rt=nt(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==T&&"#"===e.firstChild.getAttribute("href")}),st=nt(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),lt=nt(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),at=nt(function(e){e.id=S+0,e.innerHTML="<a name='"+S+"'></a><div name='"+S+"'></div>",I.insertBefore(e,I.firstChild);var t=R.getElementsByName&&R.getElementsByName(S).length===2+R.getElementsByName(S+0).length;return y=!R.getElementById(S),I.removeChild(e),t});try{w.call(I.childNodes,0)[0].nodeType}catch(ct){w=function(e){for(var t,o=[];t=this[e];e++)o.push(t);return o}}o.matches=function(e,t){return o(e,null,null,t)},o.matchesSelector=function(e,t){return o(t,null,null,[e]).length>0},E=o.getText=function(e){var t,o="",n=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)o+=E(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[n];n++)o+=E(t);return o},v=o.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},C=o.contains=I.contains?function(e,t){var o=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!!(n&&1===n.nodeType&&o.contains&&o.contains(n))}:I.compareDocumentPosition?function(e,t){return t&&!!(16&e.compareDocumentPosition(t))}:function(e,t){for(;t=t.parentNode;)if(t===e)return!0;return!1},o.attr=function(e,t){var o,n=v(e);return n||(t=t.toLowerCase()),_.attrHandle[t]?_.attrHandle[t](e):st||n?e.getAttribute(t):(o=e.getAttributeNode(t),o?"boolean"==typeof e[t]?e[t]?t:null:o.specified?o.value:null:null)},_=o.selectors={cacheLength:50,createPseudo:F,match:ot,order:new RegExp("ID|TAG"+(at?"|NAME":"")+(lt?"|CLASS":"")),attrHandle:rt?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:y?function(e,t,o){if(typeof t.getElementById!==T&&!o){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}}:function(e,o,n){if(typeof o.getElementById!==T&&!n){var i=o.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==T&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:it?function(e,t){return typeof t.getElementsByTagName!==T?t.getElementsByTagName(e):void 0}:function(e,t){var o=t.getElementsByTagName(e);if("*"===e){for(var n,i=[],r=0;n=o[r];r++)1===n.nodeType&&i.push(n);return i}return o},NAME:function(e,t){return typeof t.getElementsByName!==T?t.getElementsByName(name):void 0},CLASS:function(e,t,o){return typeof t.getElementsByClassName===T||o?void 0:t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(tt,""),e[3]=(e[4]||e[5]||"").replace(tt,""),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1]?(e[2]||o.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*("even"===e[2]||"odd"===e[2])),e[4]=+(e[6]+e[7]||"odd"===e[2])):e[2]&&o.error(e[0]),e},PSEUDO:function(e,t,o){var n,i;return ot.CHILD.test(e[0])?null:(e[3]?e[2]=e[3]:(n=e[4])&&(Y.test(n)&&(i=s(n,t,o,!0))&&(i=n.indexOf(")",n.length-i)-n.length)&&(n=n.slice(0,i),e[0]=e[0].slice(0,i)),e[2]=n),e.slice(0,3))}},filter:{ID:y?function(e){return e=e.replace(tt,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(tt,""),function(t){var o=typeof t.getAttributeNode!==T&&t.getAttributeNode("id");return o&&o.value===e}},TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(tt,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=O[S][e];return t||(t=O(e,new RegExp("(^|"+P+")"+e+"("+P+"|$)"))),function(e){return t.test(e.className||typeof e.getAttribute!==T&&e.getAttribute("class")||"")}},ATTR:function(e,t,n){return t?function(i){var r=o.attr(i,e),s=r+"";if(null==r)return"!="===t;switch(t){case"=":return s===n;case"!=":return s!==n;case"^=":return n&&0===s.indexOf(n);case"*=":return n&&s.indexOf(n)>-1;case"$=":return n&&s.substr(s.length-n.length)===n;case"~=":return(" "+s+" ").indexOf(n)>-1;case"|=":return s===n||s.substr(0,n.length+1)===n+"-"}}:function(t){return null!=o.attr(t,e)}},CHILD:function(e,t,o,n){if("nth"===e){var i=D++;return function(e){var t,r,s=0,l=e;if(1===o&&0===n)return!0;if(t=e.parentNode,t&&(t[S]!==i||!e.sizset)){for(l=t.firstChild;l&&(1!==l.nodeType||(l.sizset=++s,l!==e));l=l.nextSibling);t[S]=i}return r=e.sizset-n,0===o?0===r:r%o===0&&r/o>=0}}return function(t){var o=t;switch(e){case"only":case"first":for(;o=o.previousSibling;)if(1===o.nodeType)return!1;if("first"===e)return!0;o=t;case"last":for(;o=o.nextSibling;)if(1===o.nodeType)return!1;return!0}}},PSEUDO:function(e,t,n,i){var r,s=_.pseudos[e]||_.pseudos[e.toLowerCase()];return s||o.error("unsupported pseudo: "+e),s[S]?s(t,n,i):s.length>1?(r=[e,e,"",t],function(e){return s(e,0,r)}):s}},pseudos:{not:F(function(e,t,o){var n=B(e.replace(K,"$1"),t,o);return function(e){return!n(e)}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!_.pseudos.empty(e)},empty:function(e){var t;for(e=e.firstChild;e;){if(e.nodeName>"@"||3===(t=e.nodeType)||4===t)return!1;e=e.nextSibling}return!0},contains:F(function(e){return function(t){return(t.textContent||t.innerText||E(t)).indexOf(e)>-1}}),has:F(function(e){return function(t){return o(e,t).length>0}}),header:function(e){return J.test(e.nodeName)},text:function(e){var t,o;return"input"===e.nodeName.toLowerCase()&&"text"===(t=e.type)&&(null==(o=e.getAttribute("type"))||o.toLowerCase()===t)},radio:n("radio"),checkbox:n("checkbox"),file:n("file"),password:n("password"),image:n("image"),submit:i("submit"),reset:i("reset"),button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return et.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return!(e!==t.activeElement||t.hasFocus&&!t.hasFocus()||!e.type&&!e.href)},active:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(e,t,o){return o?e.slice(1):[e[0]]},last:function(e,t,o){var n=e.pop();return o?e:[n]},even:function(e,t,o){for(var n=[],i=o?1:0,r=e.length;r>i;i+=2)n.push(e[i]);return n},odd:function(e,t,o){for(var n=[],i=o?0:1,r=e.length;r>i;i+=2)n.push(e[i]);return n},lt:function(e,t,o){return o?e.slice(+t):e.slice(0,+t)},gt:function(e,t,o){return o?e.slice(0,+t+1):e.slice(+t+1)},eq:function(e,t,o){var n=e.splice(+t,1);return o?e:n}}},k=I.compareDocumentPosition?function(e,t){return e===t?(b=!0,0):(e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t):e.compareDocumentPosition)?-1:1}:function(e,t){if(e===t)return b=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var o,n,i=[],s=[],l=e.parentNode,a=t.parentNode,c=l;if(l===a)return r(e,t);if(!l)return-1;if(!a)return 1;for(;c;)i.unshift(c),c=c.parentNode;for(c=a;c;)s.unshift(c),c=c.parentNode;o=i.length,n=s.length;for(var g=0;o>g&&n>g;g++)if(i[g]!==s[g])return r(i[g],s[g]);return g===o?r(e,s[g],-1):r(i[g],t,1)},[0,0].sort(k),A=!b,o.uniqueSort=function(e){var t,o=1;if(b=A,e.sort(k),b)for(;t=e[o];o++)t===e[o-1]&&e.splice(o--,1);return e},o.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},B=o.compile=function(e,t,o){var n,i,r,l=x[S][e];if(l&&l.context===t)return l;for(n=s(e,t,o),i=0,r=n.length;r>i;i++)n[i]=c(n[i],t,o);return l=x(e,g(n)),l.context=t,l.runs=l.dirruns=0,l},R.querySelectorAll&&function(){var e,t=p,n=/'|\\/g,i=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,r=[],l=[":active"],a=I.matchesSelector||I.mozMatchesSelector||I.webkitMatchesSelector||I.oMatchesSelector||I.msMatchesSelector;nt(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||r.push("\\["+P+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||r.push(":checked")}),nt(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&r.push("[*^$]="+P+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||r.push(":enabled",":disabled")}),r=r.length&&new RegExp(r.join("|")),p=function(e,o,i,l,a){if(!(l||a||r&&r.test(e)))if(9===o.nodeType)try{return L.apply(i,w.call(o.querySelectorAll(e),0)),i}catch(c){}else if(1===o.nodeType&&"object"!==o.nodeName.toLowerCase()){var g,u,h,d=o.getAttribute("id"),p=d||S,f=q.test(e)&&o.parentNode||o;for(d?p=p.replace(n,"\\$&"):o.setAttribute("id",p),g=s(e,o,a),p="[id='"+p+"']",u=0,h=g.length;h>u;u++)g[u]=p+g[u].selector;try{return L.apply(i,w.call(f.querySelectorAll(g.join(",")),0)),i}catch(c){}finally{d||o.removeAttribute("id")}}return t(e,o,i,l,a)},a&&(nt(function(t){e=a.call(t,"div");try{a.call(t,"[test!='']:sizzle"),l.push(ot.PSEUDO.source,ot.POS.source,"!=")}catch(o){}}),l=new RegExp(l.join("|")),o.matchesSelector=function(t,n){if(n=n.replace(i,"='$1']"),!(v(t)||l.test(n)||r&&r.test(n)))try{var s=a.call(t,n);if(s||e||t.document&&11!==t.document.nodeType)return s}catch(c){}return o(n,null,null,[t]).length>0})}(),_.setFilters.nth=_.setFilters.eq,_.filters=_.pseudos,o.attr=Z.attr,Z.find=o,Z.expr=o.selectors,Z.expr[":"]=Z.expr.pseudos,Z.unique=o.uniqueSort,Z.text=o.getText,Z.isXMLDoc=o.isXML,Z.contains=o.contains}(e);var Nt=/Until$/,Ot=/^(?:parents|prev(?:Until|All))/,Mt=/^.[^:#\[\.,]*$/,xt=Z.expr.match.needsContext,Pt={children:!0,contents:!0,next:!0,prev:!0};Z.fn.extend({find:function(e){var t,o,n,i,r,s,l=this;if("string"!=typeof e)return Z(e).filter(function(){for(t=0,o=l.length;o>t;t++)if(Z.contains(l[t],this))return!0});for(s=this.pushStack("","find",e),t=0,o=this.length;o>t;t++)if(n=s.length,Z.find(e,this[t],s),t>0)for(i=n;i<s.length;i++)for(r=0;n>r;r++)if(s[r]===s[i]){s.splice(i--,1);break}return s},has:function(e){var t,o=Z(e,this),n=o.length;return this.filter(function(){for(t=0;n>t;t++)if(Z.contains(this,o[t]))return!0})},not:function(e){return this.pushStack(c(this,e,!1),"not",e)},filter:function(e){return this.pushStack(c(this,e,!0),"filter",e)},is:function(e){return!!e&&("string"==typeof e?xt.test(e)?Z(e,this.context).index(this[0])>=0:Z.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var o,n=0,i=this.length,r=[],s=xt.test(e)||"string"!=typeof e?Z(e,t||this.context):0;i>n;n++)for(o=this[n];o&&o.ownerDocument&&o!==t&&11!==o.nodeType;){if(s?s.index(o)>-1:Z.find.matchesSelector(o,e)){r.push(o);break}o=o.parentNode}return r=r.length>1?Z.unique(r):r,this.pushStack(r,"closest",e)},index:function(e){return e?"string"==typeof e?Z.inArray(this[0],Z(e)):Z.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var o="string"==typeof e?Z(e,t):Z.makeArray(e&&e.nodeType?[e]:e),n=Z.merge(this.get(),o);return this.pushStack(l(o[0])||l(n[0])?n:Z.unique(n))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Z.fn.andSelf=Z.fn.addBack,Z.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Z.dir(e,"parentNode")},parentsUntil:function(e,t,o){return Z.dir(e,"parentNode",o)},next:function(e){return a(e,"nextSibling")},prev:function(e){return a(e,"previousSibling")},nextAll:function(e){return Z.dir(e,"nextSibling")},prevAll:function(e){return Z.dir(e,"previousSibling")},nextUntil:function(e,t,o){return Z.dir(e,"nextSibling",o)},prevUntil:function(e,t,o){return Z.dir(e,"previousSibling",o)},siblings:function(e){return Z.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Z.sibling(e.firstChild)},contents:function(e){return Z.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:Z.merge([],e.childNodes)}},function(e,t){Z.fn[e]=function(o,n){var i=Z.map(this,t,o);return Nt.test(e)||(n=o),n&&"string"==typeof n&&(i=Z.filter(n,i)),i=this.length>1&&!Pt[e]?Z.unique(i):i,this.length>1&&Ot.test(e)&&(i=i.reverse()),this.pushStack(i,e,z.call(arguments).join(","))}}),Z.extend({filter:function(e,t,o){return o&&(e=":not("+e+")"),1===t.length?Z.find.matchesSelector(t[0],e)?[t[0]]:[]:Z.find.matches(e,t)},dir:function(e,o,n){for(var i=[],r=e[o];r&&9!==r.nodeType&&(n===t||1!==r.nodeType||!Z(r).is(n));)1===r.nodeType&&i.push(r),r=r[o];return i},sibling:function(e,t){for(var o=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&o.push(e);return o}});var Ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Ut=/ jQuery\d+="(?:null|\d+)"/g,$t=/^\s+/,Wt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Gt=/<([\w:]+)/,Vt=/<tbody/i,Kt=/<|&#?\w+;/,jt=/<(?:script|style|link)/i,zt=/<(?:script|object|embed|option|style)/i,Yt=new RegExp("<(?:"+Ht+")[\\s/>]","i"),Xt=/^(?:checkbox|radio)$/,qt=/checked\s*(?:[^=]|=\s*.checked.)/i,Qt=/\/(java|ecma)script/i,Zt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Jt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},eo=g($),to=eo.appendChild($.createElement("div"));Jt.optgroup=Jt.option,Jt.tbody=Jt.tfoot=Jt.colgroup=Jt.caption=Jt.thead,Jt.th=Jt.td,Z.support.htmlSerialize||(Jt._default=[1,"X<div>","</div>"]),Z.fn.extend({text:function(e){return Z.access(this,function(e){return e===t?Z.text(this):this.empty().append((this[0]&&this[0].ownerDocument||$).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(Z.isFunction(e))return this.each(function(t){Z(this).wrapAll(e.call(this,t))});if(this[0]){var t=Z(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return Z.isFunction(e)?this.each(function(t){Z(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Z(this),o=t.contents();o.length?o.wrapAll(e):t.append(e)})},wrap:function(e){var t=Z.isFunction(e);return this.each(function(o){Z(this).wrapAll(t?e.call(this,o):e)})},unwrap:function(){return this.parent().each(function(){Z.nodeName(this,"body")||Z(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!l(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)
3
+ });if(arguments.length){var e=Z.clean(arguments);return this.pushStack(Z.merge(e,this),"before",this.selector)}},after:function(){if(!l(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=Z.clean(arguments);return this.pushStack(Z.merge(this,e),"after",this.selector)}},remove:function(e,t){for(var o,n=0;null!=(o=this[n]);n++)(!e||Z.filter(e,[o]).length)&&(!t&&1===o.nodeType&&(Z.cleanData(o.getElementsByTagName("*")),Z.cleanData([o])),o.parentNode&&o.parentNode.removeChild(o));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&Z.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return Z.clone(this,e,t)})},html:function(e){return Z.access(this,function(e){var o=this[0]||{},n=0,i=this.length;if(e===t)return 1===o.nodeType?o.innerHTML.replace(Ut,""):t;if(!("string"!=typeof e||jt.test(e)||!Z.support.htmlSerialize&&Yt.test(e)||!Z.support.leadingWhitespace&&$t.test(e)||Jt[(Gt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Wt,"<$1></$2>");try{for(;i>n;n++)o=this[n]||{},1===o.nodeType&&(Z.cleanData(o.getElementsByTagName("*")),o.innerHTML=e);o=0}catch(r){}}o&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return l(this[0])?this.length?this.pushStack(Z(Z.isFunction(e)?e():e),"replaceWith",e):this:Z.isFunction(e)?this.each(function(t){var o=Z(this),n=o.html();o.replaceWith(e.call(this,t,n))}):("string"!=typeof e&&(e=Z(e).detach()),this.each(function(){var t=this.nextSibling,o=this.parentNode;Z(this).remove(),t?Z(t).before(e):Z(o).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,o,n){e=[].concat.apply([],e);var i,r,s,l,a=0,c=e[0],g=[],h=this.length;if(!Z.support.checkClone&&h>1&&"string"==typeof c&&qt.test(c))return this.each(function(){Z(this).domManip(e,o,n)});if(Z.isFunction(c))return this.each(function(i){var r=Z(this);e[0]=c.call(this,i,o?r.html():t),r.domManip(e,o,n)});if(this[0]){if(i=Z.buildFragment(e,this,g),s=i.fragment,r=s.firstChild,1===s.childNodes.length&&(s=r),r)for(o=o&&Z.nodeName(r,"tr"),l=i.cacheable||h-1;h>a;a++)n.call(o&&Z.nodeName(this[a],"table")?u(this[a],"tbody"):this[a],a===l?s:Z.clone(s,!0,!0));s=r=null,g.length&&Z.each(g,function(e,t){t.src?Z.ajax?Z.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):Z.error("no ajax"):Z.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Zt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),Z.buildFragment=function(e,o,n){var i,r,s,l=e[0];return o=o||$,o=!o.nodeType&&o[0]||o,o=o.ownerDocument||o,1===e.length&&"string"==typeof l&&l.length<512&&o===$&&"<"===l.charAt(0)&&!zt.test(l)&&(Z.support.checkClone||!qt.test(l))&&(Z.support.html5Clone||!Yt.test(l))&&(r=!0,i=Z.fragments[l],s=i!==t),i||(i=o.createDocumentFragment(),Z.clean(e,o,i,n),r&&(Z.fragments[l]=s&&i)),{fragment:i,cacheable:r}},Z.fragments={},Z.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Z.fn[e]=function(o){var n,i=0,r=[],s=Z(o),l=s.length,a=1===this.length&&this[0].parentNode;if((null==a||a&&11===a.nodeType&&1===a.childNodes.length)&&1===l)return s[t](this[0]),this;for(;l>i;i++)n=(i>0?this.clone(!0):this).get(),Z(s[i])[t](n),r=r.concat(n);return this.pushStack(r,e,s.selector)}}),Z.extend({clone:function(e,t,o){var n,i,r,s;if(Z.support.html5Clone||Z.isXMLDoc(e)||!Yt.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(to.innerHTML=e.outerHTML,to.removeChild(s=to.firstChild)),!(Z.support.noCloneEvent&&Z.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Z.isXMLDoc(e)))for(d(e,s),n=p(e),i=p(s),r=0;n[r];++r)i[r]&&d(n[r],i[r]);if(t&&(h(e,s),o))for(n=p(e),i=p(s),r=0;n[r];++r)h(n[r],i[r]);return n=i=null,s},clean:function(e,t,o,n){var i,r,s,l,a,c,u,h,d,p,m,y=t===$&&eo,_=[];for(t&&"undefined"!=typeof t.createDocumentFragment||(t=$),i=0;null!=(s=e[i]);i++)if("number"==typeof s&&(s+=""),s){if("string"==typeof s)if(Kt.test(s)){for(y=y||g(t),u=t.createElement("div"),y.appendChild(u),s=s.replace(Wt,"<$1></$2>"),l=(Gt.exec(s)||["",""])[1].toLowerCase(),a=Jt[l]||Jt._default,c=a[0],u.innerHTML=a[1]+s+a[2];c--;)u=u.lastChild;if(!Z.support.tbody)for(h=Vt.test(s),d="table"!==l||h?"<table>"!==a[1]||h?[]:u.childNodes:u.firstChild&&u.firstChild.childNodes,r=d.length-1;r>=0;--r)Z.nodeName(d[r],"tbody")&&!d[r].childNodes.length&&d[r].parentNode.removeChild(d[r]);!Z.support.leadingWhitespace&&$t.test(s)&&u.insertBefore(t.createTextNode($t.exec(s)[0]),u.firstChild),s=u.childNodes,u.parentNode.removeChild(u)}else s=t.createTextNode(s);s.nodeType?_.push(s):Z.merge(_,s)}if(u&&(s=u=y=null),!Z.support.appendChecked)for(i=0;null!=(s=_[i]);i++)Z.nodeName(s,"input")?f(s):"undefined"!=typeof s.getElementsByTagName&&Z.grep(s.getElementsByTagName("input"),f);if(o)for(p=function(e){return!e.type||Qt.test(e.type)?n?n.push(e.parentNode?e.parentNode.removeChild(e):e):o.appendChild(e):void 0},i=0;null!=(s=_[i]);i++)Z.nodeName(s,"script")&&p(s)||(o.appendChild(s),"undefined"!=typeof s.getElementsByTagName&&(m=Z.grep(Z.merge([],s.getElementsByTagName("script")),p),_.splice.apply(_,[i+1,0].concat(m)),i+=m.length));return _},cleanData:function(e,t){for(var o,n,i,r,s=0,l=Z.expando,a=Z.cache,c=Z.support.deleteExpando,g=Z.event.special;null!=(i=e[s]);s++)if((t||Z.acceptData(i))&&(n=i[l],o=n&&a[n])){if(o.events)for(r in o.events)g[r]?Z.event.remove(i,r):Z.removeEvent(i,r,o.handle);a[n]&&(delete a[n],c?delete i[l]:i.removeAttribute?i.removeAttribute(l):i[l]=null,Z.deletedIds.push(n))}}}),function(){var e,t;Z.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=Z.uaMatch(G.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),Z.browser=t,Z.sub=function(){function e(t,o){return new e.fn.init(t,o)}Z.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function o(o,n){return n&&n instanceof Z&&!(n instanceof e)&&(n=e(n)),Z.fn.init.call(this,o,n,t)},e.fn.init.prototype=e.fn;var t=e($);return e}}();var oo,no,io,ro=/alpha\([^)]*\)/i,so=/opacity=([^)]*)/,lo=/^(top|right|bottom|left)$/,ao=/^(none|table(?!-c[ea]).+)/,co=/^margin/,go=new RegExp("^("+J+")(.*)$","i"),uo=new RegExp("^("+J+")(?!px)[a-z%]+$","i"),ho=new RegExp("^([-+])=("+J+")","i"),po={},fo={position:"absolute",visibility:"hidden",display:"block"},mo={letterSpacing:0,fontWeight:400},yo=["Top","Right","Bottom","Left"],_o=["Webkit","O","Moz","ms"],Eo=Z.fn.toggle;Z.fn.extend({css:function(e,o){return Z.access(this,function(e,o,n){return n!==t?Z.style(e,o,n):Z.css(e,o)},e,o,arguments.length>1)},show:function(){return _(this,!0)},hide:function(){return _(this)},toggle:function(e,t){var o="boolean"==typeof e;return Z.isFunction(e)&&Z.isFunction(t)?Eo.apply(this,arguments):this.each(function(){(o?e:y(this))?Z(this).show():Z(this).hide()})}}),Z.extend({cssHooks:{opacity:{get:function(e,t){if(t){var o=oo(e,"opacity");return""===o?"1":o}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":Z.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,o,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,s,l,a=Z.camelCase(o),c=e.style;if(o=Z.cssProps[a]||(Z.cssProps[a]=m(c,a)),l=Z.cssHooks[o]||Z.cssHooks[a],n===t)return l&&"get"in l&&(r=l.get(e,!1,i))!==t?r:c[o];if(s=typeof n,"string"===s&&(r=ho.exec(n))&&(n=(r[1]+1)*r[2]+parseFloat(Z.css(e,o)),s="number"),!(null==n||"number"===s&&isNaN(n)||("number"===s&&!Z.cssNumber[a]&&(n+="px"),l&&"set"in l&&(n=l.set(e,n,i))===t)))try{c[o]=n}catch(g){}}},css:function(e,o,n,i){var r,s,l,a=Z.camelCase(o);return o=Z.cssProps[a]||(Z.cssProps[a]=m(e.style,a)),l=Z.cssHooks[o]||Z.cssHooks[a],l&&"get"in l&&(r=l.get(e,!0,i)),r===t&&(r=oo(e,o)),"normal"===r&&o in mo&&(r=mo[o]),n||i!==t?(s=parseFloat(r),n||Z.isNumeric(s)?s||0:r):r},swap:function(e,t,o){var n,i,r={};for(i in t)r[i]=e.style[i],e.style[i]=t[i];n=o.call(e);for(i in t)e.style[i]=r[i];return n}}),e.getComputedStyle?oo=function(t,o){var n,i,r,s,l=e.getComputedStyle(t,null),a=t.style;return l&&(n=l[o],""===n&&!Z.contains(t.ownerDocument,t)&&(n=Z.style(t,o)),uo.test(n)&&co.test(o)&&(i=a.width,r=a.minWidth,s=a.maxWidth,a.minWidth=a.maxWidth=a.width=n,n=l.width,a.width=i,a.minWidth=r,a.maxWidth=s)),n}:$.documentElement.currentStyle&&(oo=function(e,t){var o,n,i=e.currentStyle&&e.currentStyle[t],r=e.style;return null==i&&r&&r[t]&&(i=r[t]),uo.test(i)&&!lo.test(t)&&(o=r.left,n=e.runtimeStyle&&e.runtimeStyle.left,n&&(e.runtimeStyle.left=e.currentStyle.left),r.left="fontSize"===t?"1em":i,i=r.pixelLeft+"px",r.left=o,n&&(e.runtimeStyle.left=n)),""===i?"auto":i}),Z.each(["height","width"],function(e,t){Z.cssHooks[t]={get:function(e,o,n){return o?0===e.offsetWidth&&ao.test(oo(e,"display"))?Z.swap(e,fo,function(){return C(e,t,n)}):C(e,t,n):void 0},set:function(e,o,n){return E(e,o,n?v(e,t,n,Z.support.boxSizing&&"border-box"===Z.css(e,"boxSizing")):0)}}}),Z.support.opacity||(Z.cssHooks.opacity={get:function(e,t){return so.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var o=e.style,n=e.currentStyle,i=Z.isNumeric(t)?"alpha(opacity="+100*t+")":"",r=n&&n.filter||o.filter||"";o.zoom=1,t>=1&&""===Z.trim(r.replace(ro,""))&&o.removeAttribute&&(o.removeAttribute("filter"),n&&!n.filter)||(o.filter=ro.test(r)?r.replace(ro,i):r+" "+i)}}),Z(function(){Z.support.reliableMarginRight||(Z.cssHooks.marginRight={get:function(e,t){return Z.swap(e,{display:"inline-block"},function(){return t?oo(e,"marginRight"):void 0})}}),!Z.support.pixelPosition&&Z.fn.position&&Z.each(["top","left"],function(e,t){Z.cssHooks[t]={get:function(e,o){if(o){var n=oo(e,t);return uo.test(n)?Z(e).position()[t]+"px":n}}}})}),Z.expr&&Z.expr.filters&&(Z.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!Z.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||oo(e,"display"))},Z.expr.filters.visible=function(e){return!Z.expr.filters.hidden(e)}),Z.each({margin:"",padding:"",border:"Width"},function(e,t){Z.cssHooks[e+t]={expand:function(o){var n,i="string"==typeof o?o.split(" "):[o],r={};for(n=0;4>n;n++)r[e+yo[n]+t]=i[n]||i[n-2]||i[0];return r}},co.test(e)||(Z.cssHooks[e+t].set=E)});var vo=/%20/g,Co=/\[\]$/,Bo=/\r?\n/g,ko=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bo=/^(?:select|textarea)/i;Z.fn.extend({serialize:function(){return Z.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?Z.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bo.test(this.nodeName)||ko.test(this.type))}).map(function(e,t){var o=Z(this).val();return null==o?null:Z.isArray(o)?Z.map(o,function(e){return{name:t.name,value:e.replace(Bo,"\r\n")}}):{name:t.name,value:o.replace(Bo,"\r\n")}}).get()}}),Z.param=function(e,o){var n,i=[],r=function(e,t){t=Z.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(o===t&&(o=Z.ajaxSettings&&Z.ajaxSettings.traditional),Z.isArray(e)||e.jquery&&!Z.isPlainObject(e))Z.each(e,function(){r(this.name,this.value)});else for(n in e)k(n,e[n],o,r);return i.join("&").replace(vo,"+")};var Ao,To,So=/#.*$/,Ro=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Io=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Do=/^(?:GET|HEAD)$/,wo=/^\/\//,Lo=/\?/,Fo=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,No=/([?&])_=[^&]*/,Oo=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Mo=Z.fn.load,xo={},Po={},Ho=["*/"]+["*"];try{Ao=W.href}catch(Uo){Ao=$.createElement("a"),Ao.href="",Ao=Ao.href}To=Oo.exec(Ao.toLowerCase())||[],Z.fn.load=function(e,o,n){if("string"!=typeof e&&Mo)return Mo.apply(this,arguments);if(!this.length)return this;var i,r,s,l=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),Z.isFunction(o)?(n=o,o=t):o&&"object"==typeof o&&(r="POST"),Z.ajax({url:e,type:r,dataType:"html",data:o,complete:function(e,t){n&&l.each(n,s||[e.responseText,t,e])}}).done(function(e){s=arguments,l.html(i?Z("<div>").append(e.replace(Fo,"")).find(i):e)}),this},Z.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){Z.fn[t]=function(e){return this.on(t,e)}}),Z.each(["get","post"],function(e,o){Z[o]=function(e,n,i,r){return Z.isFunction(n)&&(r=r||i,i=n,n=t),Z.ajax({type:o,url:e,data:n,success:i,dataType:r})}}),Z.extend({getScript:function(e,o){return Z.get(e,t,o,"script")},getJSON:function(e,t,o){return Z.get(e,t,o,"json")},ajaxSetup:function(e,t){return t?T(e,Z.ajaxSettings):(t=e,e=Z.ajaxSettings),T(e,t),e},ajaxSettings:{url:Ao,isLocal:Io.test(To[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Ho},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":Z.parseJSON,"text xml":Z.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:b(xo),ajaxTransport:b(Po),ajax:function(e,o){function n(e,o,n,s){var c,u,_,E,C,k=o;2!==v&&(v=2,a&&clearTimeout(a),l=t,r=s||"",B.readyState=e>0?4:0,n&&(E=S(h,B,n)),e>=200&&300>e||304===e?(h.ifModified&&(C=B.getResponseHeader("Last-Modified"),C&&(Z.lastModified[i]=C),C=B.getResponseHeader("Etag"),C&&(Z.etag[i]=C)),304===e?(k="notmodified",c=!0):(c=R(h,E),k=c.state,u=c.data,_=c.error,c=!_)):(_=k,(!k||e)&&(k="error",0>e&&(e=0))),B.status=e,B.statusText=""+(o||k),c?f.resolveWith(d,[u,k,B]):f.rejectWith(d,[B,k,_]),B.statusCode(y),y=t,g&&p.trigger("ajax"+(c?"Success":"Error"),[B,h,c?u:_]),m.fireWith(d,[B,k]),g&&(p.trigger("ajaxComplete",[B,h]),--Z.active||Z.event.trigger("ajaxStop")))}"object"==typeof e&&(o=e,e=t),o=o||{};var i,r,s,l,a,c,g,u,h=Z.ajaxSetup({},o),d=h.context||h,p=d!==h&&(d.nodeType||d instanceof Z)?Z(d):Z.event,f=Z.Deferred(),m=Z.Callbacks("once memory"),y=h.statusCode||{},_={},E={},v=0,C="canceled",B={readyState:0,setRequestHeader:function(e,t){if(!v){var o=e.toLowerCase();e=E[o]=E[o]||e,_[e]=t}return this},getAllResponseHeaders:function(){return 2===v?r:null},getResponseHeader:function(e){var o;if(2===v){if(!s)for(s={};o=Ro.exec(r);)s[o[1].toLowerCase()]=o[2];o=s[e.toLowerCase()]}return o===t?null:o},overrideMimeType:function(e){return v||(h.mimeType=e),this},abort:function(e){return e=e||C,l&&l.abort(e),n(0,e),this}};if(f.promise(B),B.success=B.done,B.error=B.fail,B.complete=m.add,B.statusCode=function(e){if(e){var t;if(2>v)for(t in e)y[t]=[y[t],e[t]];else t=e[B.status],B.always(t)}return this},h.url=((e||h.url)+"").replace(So,"").replace(wo,To[1]+"//"),h.dataTypes=Z.trim(h.dataType||"*").toLowerCase().split(tt),null==h.crossDomain&&(c=Oo.exec(h.url.toLowerCase()),h.crossDomain=!(!c||c[1]==To[1]&&c[2]==To[2]&&(c[3]||("http:"===c[1]?80:443))==(To[3]||("http:"===To[1]?80:443)))),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=Z.param(h.data,h.traditional)),A(xo,h,o,B),2===v)return B;if(g=h.global,h.type=h.type.toUpperCase(),h.hasContent=!Do.test(h.type),g&&0===Z.active++&&Z.event.trigger("ajaxStart"),!h.hasContent&&(h.data&&(h.url+=(Lo.test(h.url)?"&":"?")+h.data,delete h.data),i=h.url,h.cache===!1)){var k=Z.now(),b=h.url.replace(No,"$1_="+k);h.url=b+(b===h.url?(Lo.test(h.url)?"&":"?")+"_="+k:"")}(h.data&&h.hasContent&&h.contentType!==!1||o.contentType)&&B.setRequestHeader("Content-Type",h.contentType),h.ifModified&&(i=i||h.url,Z.lastModified[i]&&B.setRequestHeader("If-Modified-Since",Z.lastModified[i]),Z.etag[i]&&B.setRequestHeader("If-None-Match",Z.etag[i])),B.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Ho+"; q=0.01":""):h.accepts["*"]);for(u in h.headers)B.setRequestHeader(u,h.headers[u]);if(!h.beforeSend||h.beforeSend.call(d,B,h)!==!1&&2!==v){C="abort";for(u in{success:1,error:1,complete:1})B[u](h[u]);if(l=A(Po,h,o,B)){B.readyState=1,g&&p.trigger("ajaxSend",[B,h]),h.async&&h.timeout>0&&(a=setTimeout(function(){B.abort("timeout")},h.timeout));try{v=1,l.send(_,n)}catch(T){if(!(2>v))throw T;n(-1,T)}}else n(-1,"No Transport");return B}return B.abort()},active:0,lastModified:{},etag:{}});var $o=[],Wo=/\?/,Go=/(=)\?(?=&|$)|\?\?/,Vo=Z.now();Z.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=$o.pop()||Z.expando+"_"+Vo++;return this[e]=!0,e}}),Z.ajaxPrefilter("json jsonp",function(o,n,i){var r,s,l,a=o.data,c=o.url,g=o.jsonp!==!1,u=g&&Go.test(c),h=g&&!u&&"string"==typeof a&&!(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&Go.test(a);return"jsonp"===o.dataTypes[0]||u||h?(r=o.jsonpCallback=Z.isFunction(o.jsonpCallback)?o.jsonpCallback():o.jsonpCallback,s=e[r],u?o.url=c.replace(Go,"$1"+r):h?o.data=a.replace(Go,"$1"+r):g&&(o.url+=(Wo.test(c)?"&":"?")+o.jsonp+"="+r),o.converters["script json"]=function(){return l||Z.error(r+" was not called"),l[0]},o.dataTypes[0]="json",e[r]=function(){l=arguments},i.always(function(){e[r]=s,o[r]&&(o.jsonpCallback=n.jsonpCallback,$o.push(r)),l&&Z.isFunction(s)&&s(l[0]),l=s=t}),"script"):void 0}),Z.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return Z.globalEval(e),e}}}),Z.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),Z.ajaxTransport("script",function(e){if(e.crossDomain){var o,n=$.head||$.getElementsByTagName("head")[0]||$.documentElement;return{send:function(i,r){o=$.createElement("script"),o.async="async",e.scriptCharset&&(o.charset=e.scriptCharset),o.src=e.url,o.onload=o.onreadystatechange=function(e,i){(i||!o.readyState||/loaded|complete/.test(o.readyState))&&(o.onload=o.onreadystatechange=null,n&&o.parentNode&&n.removeChild(o),o=t,i||r(200,"success"))},n.insertBefore(o,n.firstChild)},abort:function(){o&&o.onload(0,1)}}}});var Ko,jo=e.ActiveXObject?function(){for(var e in Ko)Ko[e](0,1)}:!1,zo=0;Z.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&I()||D()}:I,function(e){Z.extend(Z.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(Z.ajaxSettings.xhr()),Z.support.ajax&&Z.ajaxTransport(function(o){if(!o.crossDomain||Z.support.cors){var n;return{send:function(i,r){var s,l,a=o.xhr();if(o.username?a.open(o.type,o.url,o.async,o.username,o.password):a.open(o.type,o.url,o.async),o.xhrFields)for(l in o.xhrFields)a[l]=o.xhrFields[l];o.mimeType&&a.overrideMimeType&&a.overrideMimeType(o.mimeType),!o.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(l in i)a.setRequestHeader(l,i[l])}catch(c){}a.send(o.hasContent&&o.data||null),n=function(e,i){var l,c,g,u,h;try{if(n&&(i||4===a.readyState))if(n=t,s&&(a.onreadystatechange=Z.noop,jo&&delete Ko[s]),i)4!==a.readyState&&a.abort();else{l=a.status,g=a.getAllResponseHeaders(),u={},h=a.responseXML,h&&h.documentElement&&(u.xml=h);try{u.text=a.responseText}catch(e){}try{c=a.statusText}catch(d){c=""}l||!o.isLocal||o.crossDomain?1223===l&&(l=204):l=u.text?200:404}}catch(p){i||r(-1,p)}u&&r(l,c,u,g)},o.async?4===a.readyState?setTimeout(n,0):(s=++zo,jo&&(Ko||(Ko={},Z(e).unload(jo)),Ko[s]=n),a.onreadystatechange=n):n()},abort:function(){n&&n(0,1)}}}});var Yo,Xo,qo=/^(?:toggle|show|hide)$/,Qo=new RegExp("^(?:([-+])=|)("+J+")([a-z%]*)$","i"),Zo=/queueHooks$/,Jo=[O],en={"*":[function(e,t){var o,n,i,r=this.createTween(e,t),s=Qo.exec(t),l=r.cur(),a=+l||0,c=1;if(s){if(o=+s[2],n=s[3]||(Z.cssNumber[e]?"":"px"),"px"!==n&&a){a=Z.css(r.elem,e,!0)||o||1;do i=c=c||".5",a/=c,Z.style(r.elem,e,a+n),c=r.cur()/l;while(1!==c&&c!==i)}r.unit=n,r.start=a,r.end=s[1]?a+(s[1]+1)*o:o}return r}]};Z.Animation=Z.extend(F,{tweener:function(e,t){Z.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var o,n=0,i=e.length;i>n;n++)o=e[n],en[o]=en[o]||[],en[o].unshift(t)},prefilter:function(e,t){t?Jo.unshift(e):Jo.push(e)}}),Z.Tween=M,M.prototype={constructor:M,init:function(e,t,o,n,i,r){this.elem=e,this.prop=o,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=r||(Z.cssNumber[o]?"":"px")},cur:function(){var e=M.propHooks[this.prop];return e&&e.get?e.get(this):M.propHooks._default.get(this)},run:function(e){var t,o=M.propHooks[this.prop];return this.pos=t=this.options.duration?Z.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),o&&o.set?o.set(this):M.propHooks._default.set(this),this}},M.prototype.init.prototype=M.prototype,M.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=Z.css(e.elem,e.prop,!1,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){Z.fx.step[e.prop]?Z.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[Z.cssProps[e.prop]]||Z.cssHooks[e.prop])?Z.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},M.propHooks.scrollTop=M.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Z.each(["toggle","show","hide"],function(e,t){var o=Z.fn[t];Z.fn[t]=function(n,i,r){return null==n||"boolean"==typeof n||!e&&Z.isFunction(n)&&Z.isFunction(i)?o.apply(this,arguments):this.animate(x(t,!0),n,i,r)}}),Z.fn.extend({fadeTo:function(e,t,o,n){return this.filter(y).css("opacity",0).show().end().animate({opacity:t},e,o,n)},animate:function(e,t,o,n){var i=Z.isEmptyObject(e),r=Z.speed(t,o,n),s=function(){var t=F(this,Z.extend({},e),r);i&&t.stop(!0)};return i||r.queue===!1?this.each(s):this.queue(r.queue,s)},stop:function(e,o,n){var i=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=o,o=e,e=t),o&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,o=null!=e&&e+"queueHooks",r=Z.timers,s=Z._data(this);if(o)s[o]&&s[o].stop&&i(s[o]);else for(o in s)s[o]&&s[o].stop&&Zo.test(o)&&i(s[o]);for(o=r.length;o--;)r[o].elem===this&&(null==e||r[o].queue===e)&&(r[o].anim.stop(n),t=!1,r.splice(o,1));(t||!n)&&Z.dequeue(this,e)})}}),Z.each({slideDown:x("show"),slideUp:x("hide"),slideToggle:x("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Z.fn[e]=function(e,o,n){return this.animate(t,e,o,n)}}),Z.speed=function(e,t,o){var n=e&&"object"==typeof e?Z.extend({},e):{complete:o||!o&&t||Z.isFunction(e)&&e,duration:e,easing:o&&t||t&&!Z.isFunction(t)&&t};return n.duration=Z.fx.off?0:"number"==typeof n.duration?n.duration:n.duration in Z.fx.speeds?Z.fx.speeds[n.duration]:Z.fx.speeds._default,(null==n.queue||n.queue===!0)&&(n.queue="fx"),n.old=n.complete,n.complete=function(){Z.isFunction(n.old)&&n.old.call(this),n.queue&&Z.dequeue(this,n.queue)},n},Z.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},Z.timers=[],Z.fx=M.prototype.init,Z.fx.tick=function(){for(var e,t=Z.timers,o=0;o<t.length;o++)e=t[o],!e()&&t[o]===e&&t.splice(o--,1);t.length||Z.fx.stop()},Z.fx.timer=function(e){e()&&Z.timers.push(e)&&!Xo&&(Xo=setInterval(Z.fx.tick,Z.fx.interval))},Z.fx.interval=13,Z.fx.stop=function(){clearInterval(Xo),Xo=null},Z.fx.speeds={slow:600,fast:200,_default:400},Z.fx.step={},Z.expr&&Z.expr.filters&&(Z.expr.filters.animated=function(e){return Z.grep(Z.timers,function(t){return e===t.elem}).length});var tn=/^(?:body|html)$/i;Z.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){Z.offset.setOffset(this,e,t)});var o,n,i,r,s,l,a,c,g,u,h=this[0],d=h&&h.ownerDocument;if(d)return(i=d.body)===h?Z.offset.bodyOffset(h):(n=d.documentElement,Z.contains(n,h)?(o=h.getBoundingClientRect(),r=P(d),s=n.clientTop||i.clientTop||0,l=n.clientLeft||i.clientLeft||0,a=r.pageYOffset||n.scrollTop,c=r.pageXOffset||n.scrollLeft,g=o.top+a-s,u=o.left+c-l,{top:g,left:u}):{top:0,left:0})},Z.offset={bodyOffset:function(e){var t=e.offsetTop,o=e.offsetLeft;return Z.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(Z.css(e,"marginTop"))||0,o+=parseFloat(Z.css(e,"marginLeft"))||0),{top:t,left:o}},setOffset:function(e,t,o){var n=Z.css(e,"position");"static"===n&&(e.style.position="relative");var i,r,s=Z(e),l=s.offset(),a=Z.css(e,"top"),c=Z.css(e,"left"),g=("absolute"===n||"fixed"===n)&&Z.inArray("auto",[a,c])>-1,u={},h={};g?(h=s.position(),i=h.top,r=h.left):(i=parseFloat(a)||0,r=parseFloat(c)||0),Z.isFunction(t)&&(t=t.call(e,o,l)),null!=t.top&&(u.top=t.top-l.top+i),null!=t.left&&(u.left=t.left-l.left+r),"using"in t?t.using.call(e,u):s.css(u)}},Z.fn.extend({position:function(){if(this[0]){var e=this[0],t=this.offsetParent(),o=this.offset(),n=tn.test(t[0].nodeName)?{top:0,left:0}:t.offset();return o.top-=parseFloat(Z.css(e,"marginTop"))||0,o.left-=parseFloat(Z.css(e,"marginLeft"))||0,n.top+=parseFloat(Z.css(t[0],"borderTopWidth"))||0,n.left+=parseFloat(Z.css(t[0],"borderLeftWidth"))||0,{top:o.top-n.top,left:o.left-n.left}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||$.body;e&&!tn.test(e.nodeName)&&"static"===Z.css(e,"position");)e=e.offsetParent;return e||$.body})}}),Z.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,o){var n=/Y/.test(o);Z.fn[e]=function(i){return Z.access(this,function(e,i,r){var s=P(e);return r===t?s?o in s?s[o]:s.document.documentElement[i]:e[i]:(s?s.scrollTo(n?Z(s).scrollLeft():r,n?r:Z(s).scrollTop()):e[i]=r,void 0)},e,i,arguments.length,null)}}),Z.each({Height:"height",Width:"width"},function(e,o){Z.each({padding:"inner"+e,content:o,"":"outer"+e},function(n,i){Z.fn[i]=function(i,r){var s=arguments.length&&(n||"boolean"!=typeof i),l=n||(i===!0||r===!0?"margin":"border");return Z.access(this,function(o,n,i){var r;return Z.isWindow(o)?o.document.documentElement["client"+e]:9===o.nodeType?(r=o.documentElement,Math.max(o.body["scroll"+e],r["scroll"+e],o.body["offset"+e],r["offset"+e],r["client"+e])):i===t?Z.css(o,n,i,l):Z.style(o,n,i,l)},o,s?i:t,s,null)}})}),e.jQuery=e.$=Z,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return Z})}(window),function(e,t){e.rails!==t&&e.error("jquery-ujs has already been loaded!");var o,n=e(document);e.rails=o={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]",buttonClickSelector:"button[data-remote]",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input[type=file]",linkDisableSelector:"a[data-disable-with]",CSRFProtection:function(t){var o=e('meta[name="csrf-token"]').attr("content");o&&t.setRequestHeader("X-CSRF-Token",o)},fire:function(t,o,n){var i=e.Event(o);return t.trigger(i,n),i.result!==!1},confirm:function(e){return confirm(e)},ajax:function(t){return e.ajax(t)},href:function(e){return e.attr("href")},handleRemote:function(n){var i,r,s,l,a,c,g,u;if(o.fire(n,"ajax:before")){if(l=n.data("cross-domain"),a=l===t?null:l,c=n.data("with-credentials")||null,g=n.data("type")||e.ajaxSettings&&e.ajaxSettings.dataType,n.is("form")){i=n.attr("method"),r=n.attr("action"),s=n.serializeArray();var h=n.data("ujs:submit-button");h&&(s.push(h),n.data("ujs:submit-button",null))}else n.is(o.inputChangeSelector)?(i=n.data("method"),r=n.data("url"),s=n.serialize(),n.data("params")&&(s=s+"&"+n.data("params"))):n.is(o.buttonClickSelector)?(i=n.data("method")||"get",r=n.data("url"),s=n.serialize(),n.data("params")&&(s=s+"&"+n.data("params"))):(i=n.data("method"),r=o.href(n),s=n.data("params")||null);u={type:i||"GET",data:s,dataType:g,beforeSend:function(e,i){return i.dataType===t&&e.setRequestHeader("accept","*/*;q=0.5, "+i.accepts.script),o.fire(n,"ajax:beforeSend",[e,i])},success:function(e,t,o){n.trigger("ajax:success",[e,t,o])},complete:function(e,t){n.trigger("ajax:complete",[e,t])},error:function(e,t,o){n.trigger("ajax:error",[e,t,o])},crossDomain:a},c&&(u.xhrFields={withCredentials:c}),r&&(u.url=r);var d=o.ajax(u);return n.trigger("ajax:send",d),d}return!1},handleMethod:function(n){var i=o.href(n),r=n.data("method"),s=n.attr("target"),l=e("meta[name=csrf-token]").attr("content"),a=e("meta[name=csrf-param]").attr("content"),c=e('<form method="post" action="'+i+'"></form>'),g='<input name="_method" value="'+r+'" type="hidden" />';a!==t&&l!==t&&(g+='<input name="'+a+'" value="'+l+'" type="hidden" />'),s&&c.attr("target",s),c.hide().append(g).appendTo("body"),c.submit()},disableFormElements:function(t){t.find(o.disableSelector).each(function(){var t=e(this),o=t.is("button")?"html":"val";t.data("ujs:enable-with",t[o]()),t[o](t.data("disable-with")),t.prop("disabled",!0)})},enableFormElements:function(t){t.find(o.enableSelector).each(function(){var t=e(this),o=t.is("button")?"html":"val";t.data("ujs:enable-with")&&t[o](t.data("ujs:enable-with")),t.prop("disabled",!1)})},allowAction:function(e){var t,n=e.data("confirm"),i=!1;return n?(o.fire(e,"confirm")&&(i=o.confirm(n),t=o.fire(e,"confirm:complete",[i])),i&&t):!0},blankInputs:function(t,o,n){var i,r,s=e(),l=o||"input,textarea",a=t.find(l);return a.each(function(){if(i=e(this),r=i.is("input[type=checkbox],input[type=radio]")?i.is(":checked"):i.val(),!r==!n){if(i.is("input[type=radio]")&&a.filter('input[type=radio]:checked[name="'+i.attr("name")+'"]').length)return!0;s=s.add(i)}}),s.length?s:!1},nonBlankInputs:function(e,t){return o.blankInputs(e,t,!0)},stopEverything:function(t){return e(t.target).trigger("ujs:everythingStopped"),t.stopImmediatePropagation(),!1},disableElement:function(e){e.data("ujs:enable-with",e.html()),e.html(e.data("disable-with")),e.bind("click.railsDisable",function(e){return o.stopEverything(e)})},enableElement:function(e){e.data("ujs:enable-with")!==t&&(e.html(e.data("ujs:enable-with")),e.removeData("ujs:enable-with")),e.unbind("click.railsDisable")}},o.fire(n,"rails:attachBindings")&&(e.ajaxPrefilter(function(e,t,n){e.crossDomain||o.CSRFProtection(n)}),n.delegate(o.linkDisableSelector,"ajax:complete",function(){o.enableElement(e(this))}),n.delegate(o.linkClickSelector,"click.rails",function(n){var i=e(this),r=i.data("method"),s=i.data("params");if(!o.allowAction(i))return o.stopEverything(n);if(i.is(o.linkDisableSelector)&&o.disableElement(i),i.data("remote")!==t){if(!(!n.metaKey&&!n.ctrlKey||r&&"GET"!==r||s))return!0;var l=o.handleRemote(i);return l===!1?o.enableElement(i):l.error(function(){o.enableElement(i)}),!1}return i.data("method")?(o.handleMethod(i),!1):void 0}),n.delegate(o.buttonClickSelector,"click.rails",function(t){var n=e(this);return o.allowAction(n)?(o.handleRemote(n),!1):o.stopEverything(t)}),n.delegate(o.inputChangeSelector,"change.rails",function(t){var n=e(this);return o.allowAction(n)?(o.handleRemote(n),!1):o.stopEverything(t)}),n.delegate(o.formSubmitSelector,"submit.rails",function(n){var i=e(this),r=i.data("remote")!==t,s=o.blankInputs(i,o.requiredInputSelector),l=o.nonBlankInputs(i,o.fileInputSelector);if(!o.allowAction(i))return o.stopEverything(n);if(s&&i.attr("novalidate")==t&&o.fire(i,"ajax:aborted:required",[s]))return o.stopEverything(n);if(r){if(l){setTimeout(function(){o.disableFormElements(i)},13);var a=o.fire(i,"ajax:aborted:file",[l]);return a||setTimeout(function(){o.enableFormElements(i)},13),a}return o.handleRemote(i),!1}setTimeout(function(){o.disableFormElements(i)},13)}),n.delegate(o.formInputClickSelector,"click.rails",function(t){var n=e(this);if(!o.allowAction(n))return o.stopEverything(t);var i=n.attr("name"),r=i?{name:i,value:n.val()}:null;n.closest("form").data("ujs:submit-button",r)}),n.delegate(o.formSubmitSelector,"ajax:beforeSend.rails",function(t){this==t.target&&o.disableFormElements(e(this))}),n.delegate(o.formSubmitSelector,"ajax:complete.rails",function(t){this==t.target&&o.enableFormElements(e(this))}),e(function(){var t=e("meta[name=csrf-token]").attr("content"),o=e("meta[name=csrf-param]").attr("content");e('form input[name="'+o+'"]').val(t)}))
4
4
  }(jQuery),function(e,t){function o(t,o){var i,r,s,l=t.nodeName.toLowerCase();return"area"===l?(i=t.parentNode,r=i.name,t.href&&r&&"map"===i.nodeName.toLowerCase()?(s=e("img[usemap=#"+r+"]")[0],!!s&&n(s)):!1):(/input|select|textarea|button|object/.test(l)?!t.disabled:"a"===l?t.href||o:o)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var i=0,r=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(o,n){return"number"==typeof o?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},o)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(o){if(o!==t)return this.css("zIndex",o);if(this.length)for(var n,i,r=e(this[0]);r.length&&r[0]!==document;){if(n=r.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(i=parseInt(r.css("zIndex"),10),!isNaN(i)&&0!==i))return i;r=r.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++i)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(o){return!!e.data(o,t)}}):function(t,o,n){return!!e.data(t,n[3])},focusable:function(t){return o(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),i=isNaN(n);return(i||n>=0)&&o(t,!i)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(o,n){function i(t,o,n,i){return e.each(r,function(){o-=parseFloat(e.css(t,"padding"+this))||0,n&&(o-=parseFloat(e.css(t,"border"+this+"Width"))||0),i&&(o-=parseFloat(e.css(t,"margin"+this))||0)}),o}var r="Width"===n?["Left","Right"]:["Top","Bottom"],s=n.toLowerCase(),l={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(o){return o===t?l["inner"+n].call(this):this.each(function(){e(this).css(s,i(this,o)+"px")})},e.fn["outer"+n]=function(t,o){return"number"!=typeof t?l["outer"+n].call(this,t):this.each(function(){e(this).css(s,i(this,t,!0,o)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(o){return arguments.length?t.call(this,e.camelCase(o)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,o,n){var i,r=e.ui[t].prototype;for(i in n)r.plugins[i]=r.plugins[i]||[],r.plugins[i].push([o,n[i]])},call:function(e,t,o){var n,i=e.plugins[t];if(i&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;n<i.length;n++)e.options[i[n][0]]&&i[n][1].apply(e.element,o)}},hasScroll:function(t,o){if("hidden"===e(t).css("overflow"))return!1;var n=o&&"left"===o?"scrollLeft":"scrollTop",i=!1;return t[n]>0?!0:(t[n]=1,i=t[n]>0,t[n]=0,i)}})}(jQuery),function(e,t){var o=0,n=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var o,n=0;null!=(o=t[n]);n++)try{e(o).triggerHandler("remove")}catch(r){}i(t)},e.widget=function(t,o,n){var i,r,s,l,a={},c=t.split(".")[0];t=t.split(".")[1],i=c+"-"+t,n||(n=o,o=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[c]=e[c]||{},r=e[c][t],s=e[c][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new s(e,t)},e.extend(s,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),l=new o,l.options=e.widget.extend({},l.options),e.each(n,function(t,n){return e.isFunction(n)?(a[t]=function(){var e=function(){return o.prototype[t].apply(this,arguments)},i=function(e){return o.prototype[t].apply(this,e)};return function(){var t,o=this._super,r=this._superApply;return this._super=e,this._superApply=i,t=n.apply(this,arguments),this._super=o,this._superApply=r,t}}(),void 0):(a[t]=n,void 0)}),s.prototype=e.widget.extend(l,{widgetEventPrefix:r?l.widgetEventPrefix:t},a,{constructor:s,namespace:c,widgetName:t,widgetFullName:i}),r?(e.each(r._childConstructors,function(t,o){var n=o.prototype;e.widget(n.namespace+"."+n.widgetName,s,o._proto)}),delete r._childConstructors):o._childConstructors.push(s),e.widget.bridge(t,s)},e.widget.extend=function(o){for(var i,r,s=n.call(arguments,1),l=0,a=s.length;a>l;l++)for(i in s[l])r=s[l][i],s[l].hasOwnProperty(i)&&r!==t&&(o[i]=e.isPlainObject(r)?e.isPlainObject(o[i])?e.widget.extend({},o[i],r):e.widget.extend({},r):r);return o},e.widget.bridge=function(o,i){var r=i.prototype.widgetFullName||o;e.fn[o]=function(s){var l="string"==typeof s,a=n.call(arguments,1),c=this;return s=!l&&a.length?e.widget.extend.apply(null,[s].concat(a)):s,l?this.each(function(){var n,i=e.data(this,r);return i?e.isFunction(i[s])&&"_"!==s.charAt(0)?(n=i[s].apply(i,a),n!==i&&n!==t?(c=n&&n.jquery?c.pushStack(n.get()):n,!1):void 0):e.error("no such method '"+s+"' for "+o+" widget instance"):e.error("cannot call methods on "+o+" prior to initialization; attempted to call method '"+s+"'")}):this.each(function(){var t=e.data(this,r);t?t.option(s||{})._init():e.data(this,r,new i(s,this))}),c}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=o++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(o,n){var i,r,s,l=o;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof o)if(l={},i=o.split("."),o=i.shift(),i.length){for(r=l[o]=e.widget.extend({},this.options[o]),s=0;s<i.length-1;s++)r[i[s]]=r[i[s]]||{},r=r[i[s]];if(o=i.pop(),n===t)return r[o]===t?null:r[o];r[o]=n}else{if(n===t)return this.options[o]===t?null:this.options[o];l[o]=n}return this._setOptions(l),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,o,n){var i,r=this;"boolean"!=typeof t&&(n=o,o=t,t=!1),n?(o=i=e(o),this.bindings=this.bindings.add(o)):(n=o,o=this.element,i=this.widget()),e.each(n,function(n,s){function l(){return t||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof s?r[s]:s).apply(r,arguments):void 0}"string"!=typeof s&&(l.guid=s.guid=s.guid||l.guid||e.guid++);var a=n.match(/^(\w+)\s*(.*)$/),c=a[1]+r.eventNamespace,g=a[2];g?i.delegate(g,c,l):o.bind(c,l)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function o(){return("string"==typeof e?n[e]:e).apply(n,arguments)}var n=this;return setTimeout(o,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,o,n){var i,r,s=this.options[t];if(n=n||{},o=e.Event(o),o.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),o.target=this.element[0],r=o.originalEvent)for(i in r)i in o||(o[i]=r[i]);return this.element.trigger(o,n),!(e.isFunction(s)&&s.apply(this.element[0],[o].concat(n))===!1||o.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,o){e.Widget.prototype["_"+t]=function(n,i,r){"string"==typeof i&&(i={effect:i});var s,l=i?i===!0||"number"==typeof i?o:i.effect||o:t;i=i||{},"number"==typeof i&&(i={duration:i}),s=!e.isEmptyObject(i),i.complete=r,i.delay&&n.delay(i.delay),s&&e.effects&&e.effects.effect[l]?n[t](i):l!==t&&n[l]?n[l](i.duration,i.easing,r):n.queue(function(o){e(this)[t](),r&&r.call(n[0]),o()})}})}(jQuery),function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(o){return!0===e.data(o.target,t.widgetName+".preventClickEvent")?(e.removeData(o.target,t.widgetName+".preventClickEvent"),o.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(o){if(!t){this._mouseStarted&&this._mouseUp(o),this._mouseDownEvent=o;var n=this,i=1===o.which,r="string"==typeof this.options.cancel&&o.target.nodeName?e(o.target).closest(this.options.cancel).length:!1;return i&&!r&&this._mouseCapture(o)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(o)&&this._mouseDelayMet(o)&&(this._mouseStarted=this._mouseStart(o)!==!1,!this._mouseStarted)?(o.preventDefault(),!0):(!0===e.data(o.target,this.widgetName+".preventClickEvent")&&e.removeData(o.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return n._mouseMove(e)},this._mouseUpDelegate=function(e){return n._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),o.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var o=this.options;return this.helper||o.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(o.iframeFix===!0?"iframe":o.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var o=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,o){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!o){var n=this._uiHash();if(this._trigger("drag",t,n)===!1)return this._mouseUp({}),!1;this.position=n.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var o=this,n=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1),"original"!==this.options.helper||e.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!n||"valid"===this.options.revert&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){o._trigger("stop",t)!==!1&&o._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var o=this.options,n=e.isFunction(o.helper)?e(o.helper.apply(this.element[0],[t])):"clone"===o.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===o.appendTo?this.element[0].parentNode:o.appendTo),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,o,n,i=this.options;return i.containment?"window"===i.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===i.containment?(this.containment=[0,0,e(document).width()-this.helperProportions.width-this.margins.left,(e(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):i.containment.constructor===Array?(this.containment=i.containment,void 0):("parent"===i.containment&&(i.containment=this.helper[0].parentNode),o=e(i.containment),n=o[0],n&&(t="hidden"!==o.css("overflow"),this.containment=[(parseInt(o.css("borderLeftWidth"),10)||0)+(parseInt(o.css("paddingLeft"),10)||0),(parseInt(o.css("borderTopWidth"),10)||0)+(parseInt(o.css("paddingTop"),10)||0),(t?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(o.css("borderRightWidth"),10)||0)-(parseInt(o.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(o.css("borderBottomWidth"),10)||0)-(parseInt(o.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=o),void 0):(this.containment=null,void 0)},_convertPositionTo:function(t,o){o||(o=this.position);var n="absolute"===t?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:i.scrollTop(),left:i.scrollLeft()}),{top:o.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*n,left:o.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*n}},_generatePosition:function(t){var o,n,i,r,s=this.options,l="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=t.pageX,c=t.pageY;return this.offset.scroll||(this.offset.scroll={top:l.scrollTop(),left:l.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(n=this.relative_container.offset(),o=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]):o=this.containment,t.pageX-this.offset.click.left<o[0]&&(a=o[0]+this.offset.click.left),t.pageY-this.offset.click.top<o[1]&&(c=o[1]+this.offset.click.top),t.pageX-this.offset.click.left>o[2]&&(a=o[2]+this.offset.click.left),t.pageY-this.offset.click.top>o[3]&&(c=o[3]+this.offset.click.top)),s.grid&&(i=s.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,c=o?i-this.offset.click.top>=o[1]||i-this.offset.click.top>o[3]?i:i-this.offset.click.top>=o[1]?i-s.grid[1]:i+s.grid[1]:i,r=s.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,a=o?r-this.offset.click.left>=o[0]||r-this.offset.click.left>o[2]?r:r-this.offset.click.left>=o[0]?r-s.grid[0]:r+s.grid[0]:r)),{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,o,n){return n=n||this._uiHash(),e.ui.plugin.call(this,t,[o,n]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,o,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,o){var n=e(this).data("ui-draggable"),i=n.options,r=e.extend({},o,{item:n.element});n.sortables=[],e(i.connectToSortable).each(function(){var o=e.data(this,"ui-sortable");o&&!o.options.disabled&&(n.sortables.push({instance:o,shouldRevert:o.options.revert}),o.refreshPositions(),o._trigger("activate",t,r))})},stop:function(t,o){var n=e(this).data("ui-draggable"),i=e.extend({},o,{item:n.element});e.each(n.sortables,function(){this.instance.isOver?(this.instance.isOver=0,n.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===n.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,o){var n=e(this).data("ui-draggable"),i=this;e.each(n.sortables,function(){var r=!1,s=this;this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(r=!0,e.each(n.sortables,function(){return this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this!==s&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(s.instance.element[0],this.instance.element[0])&&(r=!1),r})),r?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return o.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=n.offset.click.top,this.instance.offset.click.left=n.offset.click.left,this.instance.offset.parent.left-=n.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=n.offset.parent.top-this.instance.offset.parent.top,n._trigger("toSortable",t),n.dropped=this.instance.element,n.currentItem=n.element,this.instance.fromOutside=n),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),n._trigger("fromSortable",t),n.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),o=e(this).data("ui-draggable").options;t.css("cursor")&&(o._cursor=t.css("cursor")),t.css("cursor",o.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,o){var n=e(o.helper),i=e(this).data("ui-draggable").options;n.css("opacity")&&(i._opacity=n.css("opacity")),n.css("opacity",i.opacity)},stop:function(t,o){var n=e(this).data("ui-draggable").options;n._opacity&&e(o.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var o=e(this).data("ui-draggable"),n=o.options,i=!1;o.scrollParent[0]!==document&&"HTML"!==o.scrollParent[0].tagName?(n.axis&&"x"===n.axis||(o.overflowOffset.top+o.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?o.scrollParent[0].scrollTop=i=o.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-o.overflowOffset.top<n.scrollSensitivity&&(o.scrollParent[0].scrollTop=i=o.scrollParent[0].scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(o.overflowOffset.left+o.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?o.scrollParent[0].scrollLeft=i=o.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-o.overflowOffset.left<n.scrollSensitivity&&(o.scrollParent[0].scrollLeft=i=o.scrollParent[0].scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(document).scrollTop()<n.scrollSensitivity?i=e(document).scrollTop(e(document).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<n.scrollSensitivity&&(i=e(document).scrollTop(e(document).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(document).scrollLeft()<n.scrollSensitivity?i=e(document).scrollLeft(e(document).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<n.scrollSensitivity&&(i=e(document).scrollLeft(e(document).scrollLeft()+n.scrollSpeed)))),i!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(o,t)}}),e.ui.plugin.add("draggable","snap",{start:function(){var t=e(this).data("ui-draggable"),o=t.options;t.snapElements=[],e(o.snap.constructor!==String?o.snap.items||":data(ui-draggable)":o.snap).each(function(){var o=e(this),n=o.offset();this!==t.element[0]&&t.snapElements.push({item:this,width:o.outerWidth(),height:o.outerHeight(),top:n.top,left:n.left})})},drag:function(t,o){var n,i,r,s,l,a,c,g,u,h,d=e(this).data("ui-draggable"),p=d.options,f=p.snapTolerance,m=o.offset.left,y=m+d.helperProportions.width,_=o.offset.top,E=_+d.helperProportions.height;for(u=d.snapElements.length-1;u>=0;u--)l=d.snapElements[u].left,a=l+d.snapElements[u].width,c=d.snapElements[u].top,g=c+d.snapElements[u].height,l-f>y||m>a+f||c-f>E||_>g+f||!e.contains(d.snapElements[u].item.ownerDocument,d.snapElements[u].item)?(d.snapElements[u].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,t,e.extend(d._uiHash(),{snapItem:d.snapElements[u].item})),d.snapElements[u].snapping=!1):("inner"!==p.snapMode&&(n=Math.abs(c-E)<=f,i=Math.abs(g-_)<=f,r=Math.abs(l-y)<=f,s=Math.abs(a-m)<=f,n&&(o.position.top=d._convertPositionTo("relative",{top:c-d.helperProportions.height,left:0}).top-d.margins.top),i&&(o.position.top=d._convertPositionTo("relative",{top:g,left:0}).top-d.margins.top),r&&(o.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(o.position.left=d._convertPositionTo("relative",{top:0,left:a}).left-d.margins.left)),h=n||i||r||s,"outer"!==p.snapMode&&(n=Math.abs(c-_)<=f,i=Math.abs(g-E)<=f,r=Math.abs(l-m)<=f,s=Math.abs(a-y)<=f,n&&(o.position.top=d._convertPositionTo("relative",{top:c,left:0}).top-d.margins.top),i&&(o.position.top=d._convertPositionTo("relative",{top:g-d.helperProportions.height,left:0}).top-d.margins.top),r&&(o.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(o.position.left=d._convertPositionTo("relative",{top:0,left:a-d.helperProportions.width}).left-d.margins.left)),!d.snapElements[u].snapping&&(n||i||r||s||h)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,t,e.extend(d._uiHash(),{snapItem:d.snapElements[u].item})),d.snapElements[u].snapping=n||i||r||s||h)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,o=this.data("ui-draggable").options,n=e.makeArray(e(o.stack)).sort(function(t,o){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(o).css("zIndex"),10)||0)});n.length&&(t=parseInt(e(n[0]).css("zIndex"),10)||0,e(n).each(function(o){e(this).css("zIndex",t+o)}),this.css("zIndex",t+n.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,o){var n=e(o.helper),i=e(this).data("ui-draggable").options;n.css("zIndex")&&(i._zIndex=n.css("zIndex")),n.css("zIndex",i.zIndex)},stop:function(t,o){var n=e(this).data("ui-draggable").options;n._zIndex&&e(o.helper).css("zIndex",n._zIndex)}})}(jQuery),function(e){function t(e,t,o){return e>t&&t+o>e}e.widget("ui.droppable",{version:"1.10.3",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t=this.options,o=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(o)?o:function(e){return e.is(o)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var t=0,o=e.ui.ddmanager.droppables[this.options.scope];t<o.length;t++)o[t]===this&&o.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,o){"accept"===t&&(this.accept=e.isFunction(o)?o:function(e){return e.is(o)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var o=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),o&&this._trigger("activate",t,this.ui(o))
5
- },_deactivate:function(t){var o=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),o&&this._trigger("deactivate",t,this.ui(o))},_over:function(t){var o=e.ui.ddmanager.current;o&&(o.currentItem||o.element)[0]!==this.element[0]&&this.accept.call(this.element[0],o.currentItem||o.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(o)))},_out:function(t){var o=e.ui.ddmanager.current;o&&(o.currentItem||o.element)[0]!==this.element[0]&&this.accept.call(this.element[0],o.currentItem||o.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(o)))},_drop:function(t,o){var n=o||e.ui.ddmanager.current,i=!1;return n&&(n.currentItem||n.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");return t.options.greedy&&!t.options.disabled&&t.options.scope===n.options.scope&&t.accept.call(t.element[0],n.currentItem||n.element)&&e.ui.intersect(n,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(i=!0,!1):void 0}),i?!1:this.accept.call(this.element[0],n.currentItem||n.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(n)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,o,n){if(!o.offset)return!1;var i,r,s=(e.positionAbs||e.position.absolute).left,l=s+e.helperProportions.width,a=(e.positionAbs||e.position.absolute).top,c=a+e.helperProportions.height,g=o.offset.left,u=g+o.proportions.width,h=o.offset.top,d=h+o.proportions.height;switch(n){case"fit":return s>=g&&u>=l&&a>=h&&d>=c;case"intersect":return g<s+e.helperProportions.width/2&&l-e.helperProportions.width/2<u&&h<a+e.helperProportions.height/2&&c-e.helperProportions.height/2<d;case"pointer":return i=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,r=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,t(r,h,o.proportions.height)&&t(i,g,o.proportions.width);case"touch":return(a>=h&&d>=a||c>=h&&d>=c||h>a&&c>d)&&(s>=g&&u>=s||l>=g&&u>=l||g>s&&l>u);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,o){var n,i,r=e.ui.ddmanager.droppables[t.options.scope]||[],s=o?o.type:null,l=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(n=0;n<r.length;n++)if(!(r[n].options.disabled||t&&!r[n].accept.call(r[n].element[0],t.currentItem||t.element))){for(i=0;i<l.length;i++)if(l[i]===r[n].element[0]){r[n].proportions.height=0;continue e}r[n].visible="none"!==r[n].element.css("display"),r[n].visible&&("mousedown"===s&&r[n]._activate.call(r[n],o),r[n].offset=r[n].element.offset(),r[n].proportions={width:r[n].element[0].offsetWidth,height:r[n].element[0].offsetHeight})}},drop:function(t,o){var n=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(n=this._drop.call(this,o)||n),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,o)))}),n},dragStart:function(t,o){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,o)})},drag:function(t,o){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,o),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var n,i,r,s=e.ui.intersect(t,this,this.options.tolerance),l=!s&&this.isover?"isout":s&&!this.isover?"isover":null;l&&(this.options.greedy&&(i=this.options.scope,r=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===i}),r.length&&(n=e.data(r[0],"ui-droppable"),n.greedyChild="isover"===l)),n&&"isover"===l&&(n.isover=!1,n.isout=!0,n._out.call(n,o)),this[l]=!0,this["isout"===l?"isover":"isout"]=!1,this["isover"===l?"_over":"_out"].call(this,o),n&&"isout"===l&&(n.isout=!1,n.isover=!0,n._over.call(n,o)))}})},dragStop:function(t,o){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,o)}}}(jQuery),function(){"use strict";function e(e){function t(t,n){var r,f,m=t==window,y=n&&void 0!==n.message?n.message:void 0;if(n=e.extend({},e.blockUI.defaults,n||{}),!n.ignoreIfBlocked||!e(t).data("blockUI.isBlocked")){if(n.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,n.overlayCSS||{}),r=e.extend({},e.blockUI.defaults.css,n.css||{}),n.onOverlayClick&&(n.overlayCSS.cursor="pointer"),f=e.extend({},e.blockUI.defaults.themedCSS,n.themedCSS||{}),y=void 0===y?n.message:y,m&&d&&o(window,{fadeOut:0}),y&&"string"!=typeof y&&(y.parentNode||y.jquery)){var _=y.jquery?y[0]:y,E={};e(t).data("blockUI.history",E),E.el=_,E.parent=_.parentNode,E.display=_.style.display,E.position=_.style.position,E.parent&&E.parent.removeChild(_)}e(t).data("blockUI.onUnblock",n.onUnblock);var v,C,B,k,b=n.baseZ;v=g||n.forceIframe?e('<iframe class="blockUI" style="z-index:'+b++ +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+n.iframeSrc+'"></iframe>'):e('<div class="blockUI" style="display:none"></div>'),C=n.theme?e('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+b++ +';display:none"></div>'):e('<div class="blockUI blockOverlay" style="z-index:'+b++ +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),n.theme&&m?(k='<div class="blockUI '+n.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(b+10)+';display:none;position:fixed">',n.title&&(k+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(n.title||"&nbsp;")+"</div>"),k+='<div class="ui-widget-content ui-dialog-content"></div>',k+="</div>"):n.theme?(k='<div class="blockUI '+n.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(b+10)+';display:none;position:absolute">',n.title&&(k+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(n.title||"&nbsp;")+"</div>"),k+='<div class="ui-widget-content ui-dialog-content"></div>',k+="</div>"):k=m?'<div class="blockUI '+n.blockMsgClass+' blockPage" style="z-index:'+(b+10)+';display:none;position:fixed"></div>':'<div class="blockUI '+n.blockMsgClass+' blockElement" style="z-index:'+(b+10)+';display:none;position:absolute"></div>',B=e(k),y&&(n.theme?(B.css(f),B.addClass("ui-widget-content")):B.css(r)),n.theme||C.css(n.overlayCSS),C.css("position",m?"fixed":"absolute"),(g||n.forceIframe)&&v.css("opacity",0);var A=[v,C,B],T=m?e("body"):e(t);e.each(A,function(){this.appendTo(T)}),n.theme&&n.draggable&&e.fn.draggable&&B.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var S=h&&(!e.support.boxModel||e("object,embed",m?null:t).length>0);if(u||S){if(m&&n.allowBodyStretch&&e.support.boxModel&&e("html,body").css("height","100%"),(u||!e.support.boxModel)&&!m)var R=a(t,"borderTopWidth"),I=a(t,"borderLeftWidth"),D=R?"(0 - "+R+")":0,w=I?"(0 - "+I+")":0;e.each(A,function(e,t){var o=t[0].style;if(o.position="absolute",2>e)m?o.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+n.quirksmodeOffsetHack+') + "px"'):o.setExpression("height",'this.parentNode.offsetHeight + "px"'),m?o.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):o.setExpression("width",'this.parentNode.offsetWidth + "px"'),w&&o.setExpression("left",w),D&&o.setExpression("top",D);else if(n.centerY)m&&o.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),o.marginTop=0;else if(!n.centerY&&m){var i=n.css&&n.css.top?parseInt(n.css.top,10):0,r="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+i+') + "px"';o.setExpression("top",r)}})}if(y&&(n.theme?B.find(".ui-widget-content").append(y):B.append(y),(y.jquery||y.nodeType)&&e(y).show()),(g||n.forceIframe)&&n.showOverlay&&v.show(),n.fadeIn){var L=n.onBlock?n.onBlock:c,F=n.showOverlay&&!y?L:c,O=y?L:c;n.showOverlay&&C._fadeIn(n.fadeIn,F),y&&B._fadeIn(n.fadeIn,O)}else n.showOverlay&&C.show(),y&&B.show(),n.onBlock&&n.onBlock();if(i(1,t,n),m?(d=B[0],p=e(n.focusableElements,d),n.focusInput&&setTimeout(s,20)):l(B[0],n.centerX,n.centerY),n.timeout){var N=setTimeout(function(){m?e.unblockUI(n):e(t).unblock(n)},n.timeout);e(t).data("blockUI.timeout",N)}}}function o(t,o){var r,s=t==window,l=e(t),a=l.data("blockUI.history"),c=l.data("blockUI.timeout");c&&(clearTimeout(c),l.removeData("blockUI.timeout")),o=e.extend({},e.blockUI.defaults,o||{}),i(0,t,o),null===o.onUnblock&&(o.onUnblock=l.data("blockUI.onUnblock"),l.removeData("blockUI.onUnblock"));var g;g=s?e("body").children().filter(".blockUI").add("body > .blockUI"):l.find(">.blockUI"),o.cursorReset&&(g.length>1&&(g[1].style.cursor=o.cursorReset),g.length>2&&(g[2].style.cursor=o.cursorReset)),s&&(d=p=null),o.fadeOut?(r=g.length,g.stop().fadeOut(o.fadeOut,function(){0===--r&&n(g,a,o,t)})):n(g,a,o,t)}function n(t,o,n,i){var r=e(i);if(!r.data("blockUI.isBlocked")){t.each(function(){this.parentNode&&this.parentNode.removeChild(this)}),o&&o.el&&(o.el.style.display=o.display,o.el.style.position=o.position,o.parent&&o.parent.appendChild(o.el),r.removeData("blockUI.history")),r.data("blockUI.static")&&r.css("position","static"),"function"==typeof n.onUnblock&&n.onUnblock(i,n);var s=e(document.body),l=s.width(),a=s[0].style.width;s.width(l-1).width(l),s[0].style.width=a}}function i(t,o,n){var i=o==window,s=e(o);if((t||(!i||d)&&(i||s.data("blockUI.isBlocked")))&&(s.data("blockUI.isBlocked",t),i&&n.bindEvents&&(!t||n.showOverlay))){var l="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";t?e(document).bind(l,n,r):e(document).unbind(l,r)}}function r(t){if("keydown"===t.type&&t.keyCode&&9==t.keyCode&&d&&t.data.constrainTabKey){var o=p,n=!t.shiftKey&&t.target===o[o.length-1],i=t.shiftKey&&t.target===o[0];if(n||i)return setTimeout(function(){s(i)},10),!1}var r=t.data,l=e(t.target);return l.hasClass("blockOverlay")&&r.onOverlayClick&&r.onOverlayClick(t),l.parents("div."+r.blockMsgClass).length>0?!0:0===l.parents().children().filter("div.blockUI").length}function s(e){if(p){var t=p[e===!0?p.length-1:0];t&&t.focus()}}function l(e,t,o){var n=e.parentNode,i=e.style,r=(n.offsetWidth-e.offsetWidth)/2-a(n,"borderLeftWidth"),s=(n.offsetHeight-e.offsetHeight)/2-a(n,"borderTopWidth");t&&(i.left=r>0?r+"px":"0"),o&&(i.top=s>0?s+"px":"0")}function a(t,o){return parseInt(e.css(t,o),10)||0}e.fn._fadeIn=e.fn.fadeIn;var c=e.noop||function(){},g=/MSIE/.test(navigator.userAgent),u=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),h=(document.documentMode||0,e.isFunction(document.createElement("div").style.setExpression));e.blockUI=function(e){t(window,e)},e.unblockUI=function(e){o(window,e)},e.growlUI=function(t,o,n,i){var r=e('<div class="growlUI"></div>');t&&r.append("<h1>"+t+"</h1>"),o&&r.append("<h2>"+o+"</h2>"),void 0===n&&(n=3e3);var s=function(t){t=t||{},e.blockUI({message:r,fadeIn:"undefined"!=typeof t.fadeIn?t.fadeIn:700,fadeOut:"undefined"!=typeof t.fadeOut?t.fadeOut:1e3,timeout:"undefined"!=typeof t.timeout?t.timeout:n,centerY:!1,showOverlay:!1,onUnblock:i,css:e.blockUI.defaults.growlCSS})};s();r.css("opacity");r.mouseover(function(){s({fadeIn:0,timeout:3e4});var t=e(".blockMsg");t.stop(),t.fadeTo(300,1)}).mouseout(function(){e(".blockMsg").fadeOut(1e3)})},e.fn.block=function(o){if(this[0]===window)return e.blockUI(o),this;var n=e.extend({},e.blockUI.defaults,o||{});return this.each(function(){var t=e(this);n.ignoreIfBlocked&&t.data("blockUI.isBlocked")||t.unblock({fadeOut:0})}),this.each(function(){"static"==e.css(this,"position")&&(this.style.position="relative",e(this).data("blockUI.static",!0)),this.style.zoom=1,t(this,o)})},e.fn.unblock=function(t){return this[0]===window?(e.unblockUI(t),this):this.each(function(){o(this,t)})},e.blockUI.version=2.66,e.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var d=null,p=[]}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)}(),function(){function e(e,o,n){return t(e,o,n)}function t(e,a,g,u){u=u||{},a&&!n(a)&&(g=a,a=void 0),a=a||new Date,g=g||c,g.formats=g.formats||{};var h=a.getTime(),d=u.timezone,p=typeof d;if((u.utc||"number"==p||"string"==p)&&(a=o(a)),d){if("string"==p)var f="-"==d[0]?-1:1,m=parseInt(d.slice(1,3),10),y=parseInt(d.slice(3,5),10),d=f*(60*m+y);p&&(a=new Date(a.getTime()+6e4*d))}return e.replace(/%([-_0]?.)/g,function(e,o){var n;if(2==o.length){if(n=o[0],"-"==n)n="";else if("_"==n)n=" ";else{if("0"!=n)return e;n="0"}o=o[1]}switch(o){case"A":return g.days[a.getDay()];case"a":return g.shortDays[a.getDay()];case"B":return g.months[a.getMonth()];case"b":return g.shortMonths[a.getMonth()];case"C":return i(Math.floor(a.getFullYear()/100),n);case"D":return t(g.formats.D||"%m/%d/%y",a,g);case"d":return i(a.getDate(),n);case"e":return i(a.getDate(),null==n?" ":n);case"F":return t(g.formats.F||"%Y-%m-%d",a,g);case"H":return i(a.getHours(),n);case"h":return g.shortMonths[a.getMonth()];case"I":return i(r(a),n);case"j":return n=new Date(a.getFullYear(),0,1),n=Math.ceil((a.getTime()-n.getTime())/864e5),i(n,3);case"k":return i(a.getHours(),null==n?" ":n);case"L":return i(Math.floor(h%1e3),3);case"l":return i(r(a),null==n?" ":n);case"M":return i(a.getMinutes(),n);case"m":return i(a.getMonth()+1,n);case"n":return"\n";case"o":return String(a.getDate())+s(a.getDate());case"P":return a.getHours()<12?g.am:g.pm;case"p":return a.getHours()<12?g.AM:g.PM;case"R":return t(g.formats.R||"%H:%M",a,g);case"r":return t(g.formats.r||"%I:%M:%S %p",a,g);case"S":return i(a.getSeconds(),n);case"s":return Math.floor(h/1e3);case"T":return t(g.formats.T||"%H:%M:%S",a,g);case"t":return" ";case"U":return i(l(a,"sunday"),n);case"u":return n=a.getDay(),0==n?7:n;case"v":return t(g.formats.v||"%e-%b-%Y",a,g);case"W":return i(l(a,"monday"),n);case"w":return a.getDay();case"Y":return a.getFullYear();case"y":return n=String(a.getFullYear()),n.slice(n.length-2);case"Z":return u.utc?"GMT":(n=a.toString().match(/\(([\w\s]+)\)/))&&n[1]||"";case"z":return u.utc?"+0000":(n="number"==typeof d?d:-a.getTimezoneOffset(),(0>n?"-":"+")+i(Math.floor(Math.abs(n)/60))+i(Math.abs(n)%60));default:return o}})}function o(e){var t=6e4*(e.getTimezoneOffset()||0);return new Date(e.getTime()+t)}function n(e){for(var t=0,o=g.length,t=0;o>t;++t)if("function"!=typeof e[g[t]])return!1;return!0}function i(e,t,o){if("number"==typeof t&&(o=t,t="0"),null==t&&(t="0"),o=o||2,e=String(e),t)for(;e.length<o;)e=t+e;return e}function r(e){return e=e.getHours(),0==e?e=12:e>12&&(e-=12),e}function s(e){var t=e%10;if(e%=100,e>=11&&13>=e||0===t||t>=4)return"th";switch(t){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function l(e,t){var t=t||"sunday",o=e.getDay();"monday"==t&&(0==o?o=6:o--);var n=new Date(e.getFullYear(),0,1);return Math.floor(((e-n)/864e5+7-o)/7)}var a;a="undefined"!=typeof module?module.exports=e:function(){return this||(0,eval)("this")}();var c={days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm"};a.strftime=e,a.strftimeTZ=e.strftimeTZ=function(e,o,n,i){return"number"!=typeof n&&"string"!=typeof n||null!=i||(i=n,n=void 0),t(e,o,n,{timezone:i})},a.strftimeUTC=e.strftimeUTC=function(e,o,n){return t(e,o,n,{utc:!0})},a.localizedStrftime=e.localizedStrftime=function(e){return function(o,n){return t(o,n,e)}};var g=["getTime","getTimezoneOffset","getDay","getDate","getMonth","getFullYear","getYear","getHours","getMinutes","getSeconds"]}(),function(){function e(e){var t=function(e,t){return i("",e,t)},r=o;e&&(o[e]||(o[e]={}),r=o[e]),r.define&&r.define.packaged||(n.original=r.define,r.define=n,r.define.packaged=!0),r.require&&r.require.packaged||(i.original=r.require,r.require=t,r.require.packaged=!0)}var t="",o=function(){return this}();if(t||"undefined"==typeof requirejs){var n=function(e,t,o){return"string"!=typeof e?(n.original?n.original.apply(window,arguments):(console.error("dropping module because define wasn't a string."),console.trace()),void 0):(2==arguments.length&&(o=t),n.modules||(n.modules={},n.payloads={}),n.payloads[e]=o,n.modules[e]=null,void 0)},i=function(e,t,o){if("[object Array]"===Object.prototype.toString.call(t)){for(var n=[],r=0,l=t.length;l>r;++r){var a=s(e,t[r]);if(!a&&i.original)return i.original.apply(window,arguments);n.push(a)}o&&o.apply(null,n)}else{if("string"==typeof t){var c=s(e,t);return!c&&i.original?i.original.apply(window,arguments):(o&&o(),c)}if(i.original)return i.original.apply(window,arguments)}},r=function(e,t){if(-1!==t.indexOf("!")){var o=t.split("!");return r(e,o[0])+"!"+r(e,o[1])}if("."==t.charAt(0)){var n=e.split("/").slice(0,-1).join("/");for(t=n+"/"+t;-1!==t.indexOf(".")&&i!=t;){var i=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},s=function(e,t){t=r(e,t);var o=n.modules[t];if(!o){if(o=n.payloads[t],"function"==typeof o){var s={},l={id:t,uri:"",exports:s,packaged:!0},a=function(e,o){return i(t,e,o)},c=o(a,s,l);s=c||l.exports,n.modules[t]=s,delete n.payloads[t]}o=n.modules[t]=s||o}return o};e(t)}}(),define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/multi_select","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/mode/folding/fold_mode","ace/theme/textmate","ace/config"],function(e,t){e("./lib/fixoldbrowsers");var o=e("./lib/dom"),n=e("./lib/event"),i=e("./editor").Editor,r=e("./edit_session").EditSession,s=e("./undomanager").UndoManager,l=e("./virtual_renderer").VirtualRenderer,a=e("./multi_select").MultiSelect;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./mode/folding/fold_mode"),e("./theme/textmate"),t.config=e("./config"),t.require=e,t.edit=function(e){if("string"==typeof e){var r=e,e=document.getElementById(r);if(!e)throw new Error("ace.edit can't find div #"+r)}if(e.env&&e.env.editor instanceof i)return e.env.editor;var s=t.createEditSession(o.getInnerText(e));e.innerHTML="";var c=new i(new l(e));new a(c),c.setSession(s);var g={document:s,editor:c,onResize:c.resize.bind(c,null)};return n.addListener(window,"resize",g.onResize),c.on("destroy",function(){n.removeListener(window,"resize",g.onResize)}),e.env=c.env=g,c},t.createEditSession=function(e,t){var o=new r(e,t);return o.setUndoManager(new s),o},t.EditSession=r,t.UndoManager=s}),define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e){e("./regexp"),e("./es5-shim")}),define("ace/lib/regexp",["require","exports","module"],function(){function e(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function t(e,t,o){if(Array.prototype.indexOf)return e.indexOf(t,o);for(var n=o||0;n<e.length;n++)if(e[n]===t)return n;return-1}var o={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},n=void 0===o.exec.call(/()??/,"")[1],i=function(){var e=/^/g;return o.test.call(e,""),!e.lastIndex}();i&&n||(RegExp.prototype.exec=function(r){var s,l,a=o.exec.apply(this,arguments);if("string"==typeof r&&a){if(!n&&a.length>1&&t(a,"")>-1&&(l=RegExp(this.source,o.replace.call(e(this),"g","")),o.replace.call(r.slice(a.index),l,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(a[e]=void 0)})),this._xregexp&&this._xregexp.captureNames)for(var c=1;c<a.length;c++)s=this._xregexp.captureNames[c-1],s&&(a[s]=a[c]);!i&&this.global&&!a[0].length&&this.lastIndex>a.index&&this.lastIndex--}return a},i||(RegExp.prototype.test=function(e){var t=o.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),define("ace/lib/es5-shim",["require","exports","module"],function(){function e(){}function t(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function o(e){return e=+e,e!==e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}Function.prototype.bind||(Function.prototype.bind=function(t){var o=this;if("function"!=typeof o)throw new TypeError("Function.prototype.bind called on incompatible "+o);var n=u.call(arguments,1),i=function(){if(this instanceof i){var e=o.apply(this,n.concat(u.call(arguments)));return Object(e)===e?e:this}return o.apply(t,n.concat(u.call(arguments)))};return o.prototype&&(e.prototype=o.prototype,i.prototype=new e,e.prototype=null),i});var n,i,r,s,l,a=Function.prototype.call,c=Array.prototype,g=Object.prototype,u=c.slice,h=a.bind(g.toString),d=a.bind(g.hasOwnProperty);if((l=d(g,"__defineGetter__"))&&(n=a.bind(g.__defineGetter__),i=a.bind(g.__defineSetter__),r=a.bind(g.__lookupGetter__),s=a.bind(g.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,o=[];return o.splice.apply(o,e(20)),o.splice.apply(o,e(26)),t=o.length,o.splice(5,0,"XXX"),t+1==o.length,t+1==o.length?!0:void 0}()){var p=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?p.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(u.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var o=this.length;e>0?e>o&&(e=o):void 0==e?e=0:0>e&&(e=Math.max(o+e,0)),o>e+t||(t=o-e);var n=this.slice(e,e+t),i=u.call(arguments,2),r=i.length;if(e===o)r&&this.push.apply(this,i);else{var s=Math.min(t,o-e),l=e+s,a=l+r-s,c=o-l,g=o-s;if(l>a)for(var h=0;c>h;++h)this[a+h]=this[l+h];else if(a>l)for(h=c;h--;)this[a+h]=this[l+h];if(r&&e===g)this.length=g,this.push.apply(this,i);else for(this.length=g+r,h=0;r>h;++h)this[e+h]=i[h]}return n};Array.isArray||(Array.isArray=function(e){return"[object Array]"==h(e)});var f=Object("a"),m="a"!=f[0]||!(0 in f);if(Array.prototype.forEach||(Array.prototype.forEach=function(e){var t=F(this),o=m&&"[object String]"==h(this)?this.split(""):t,n=arguments[1],i=-1,r=o.length>>>0;if("[object Function]"!=h(e))throw new TypeError;for(;++i<r;)i in o&&e.call(n,o[i],i,t)}),Array.prototype.map||(Array.prototype.map=function(e){var t=F(this),o=m&&"[object String]"==h(this)?this.split(""):t,n=o.length>>>0,i=Array(n),r=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var s=0;n>s;s++)s in o&&(i[s]=e.call(r,o[s],s,t));return i}),Array.prototype.filter||(Array.prototype.filter=function(e){var t,o=F(this),n=m&&"[object String]"==h(this)?this.split(""):o,i=n.length>>>0,r=[],s=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var l=0;i>l;l++)l in n&&(t=n[l],e.call(s,t,l,o)&&r.push(t));return r}),Array.prototype.every||(Array.prototype.every=function(e){var t=F(this),o=m&&"[object String]"==h(this)?this.split(""):t,n=o.length>>>0,i=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var r=0;n>r;r++)if(r in o&&!e.call(i,o[r],r,t))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(e){var t=F(this),o=m&&"[object String]"==h(this)?this.split(""):t,n=o.length>>>0,i=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var r=0;n>r;r++)if(r in o&&e.call(i,o[r],r,t))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=F(this),o=m&&"[object String]"==h(this)?this.split(""):t,n=o.length>>>0;if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");if(!n&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,r=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(r in o){i=o[r++];break}if(++r>=n)throw new TypeError("reduce of empty array with no initial value")}for(;n>r;r++)r in o&&(i=e.call(void 0,i,o[r],r,t));return i}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(e){var t=F(this),o=m&&"[object String]"==h(this)?this.split(""):t,n=o.length>>>0;if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");if(!n&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,r=n-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(r in o){i=o[r--];break}if(--r<0)throw new TypeError("reduceRight of empty array with no initial value")}do r in this&&(i=e.call(void 0,i,o[r],r,t));while(r--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=m&&"[object String]"==h(this)?this.split(""):F(this),n=t.length>>>0;if(!n)return-1;var i=0;for(arguments.length>1&&(i=o(arguments[1])),i=i>=0?i:Math.max(0,n+i);n>i;i++)if(i in t&&t[i]===e)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(e){var t=m&&"[object String]"==h(this)?this.split(""):F(this),n=t.length>>>0;if(!n)return-1;var i=n-1;for(arguments.length>1&&(i=Math.min(i,o(arguments[1]))),i=i>=0?i:n-Math.abs(i);i>=0;i--)if(i in t&&e===t[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:g)}),!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError(y+e);if(d(e,t)){var o,n,i;if(o={enumerable:!0,configurable:!0},l){var a=e.__proto__;e.__proto__=g;var n=r(e,t),i=s(e,t);if(e.__proto__=a,n||i)return n&&(o.get=n),i&&(o.set=i),o}return o.value=e[t],o}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),!Object.create){var _;_=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var o;if(null===e)o=_();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var n=function(){};n.prototype=e,o=new n,o.__proto__=e}return void 0!==t&&Object.defineProperties(o,t),o}}if(Object.defineProperty){var E=t({}),v="undefined"==typeof document||t(document.createElement("div"));if(!E||!v)var C=Object.defineProperty}if(!Object.defineProperty||C){var B="Property description must be an object: ",k="Object.defineProperty called on non-object: ",b="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(e,t,o){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError(k+e);if("object"!=typeof o&&"function"!=typeof o||null===o)throw new TypeError(B+o);if(C)try{return C.call(Object,e,t,o)}catch(a){}if(d(o,"value"))if(l&&(r(e,t)||s(e,t))){var c=e.__proto__;e.__proto__=g,delete e[t],e[t]=o.value,e.__proto__=c}else e[t]=o.value;else{if(!l)throw new TypeError(b);d(o,"get")&&n(e,t,o.get),d(o,"set")&&i(e,t,o.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var o in t)d(t,o)&&Object.defineProperty(e,o,t[o]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(A){Object.freeze=function(e){return function(t){return"function"==typeof t?t:e(t)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";d(e,t);)t+="?";e[t]=!0;var o=d(e,t);return delete e[t],o}),!Object.keys){var T=!0,S=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],R=S.length;for(var I in{toString:null})T=!1;Object.keys=function O(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var O=[];for(var t in e)d(e,t)&&O.push(t);if(T)for(var o=0,n=R;n>o;o++){var i=S[o];d(e,i)&&O.push(i)}return O}}Date.now||(Date.now=function(){return(new Date).getTime()});var D=" \n \f\r   ᠎              \u2028\u2029";if(!String.prototype.trim||D.trim()){D="["+D+"]";var w=new RegExp("^"+D+D+"*"),L=new RegExp(D+D+"*$");String.prototype.trim=function(){return String(this).replace(w,"").replace(L,"")}}var F=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),define("ace/lib/dom",["require","exports","module"],function(e,t){if("undefined"!=typeof document){var o="http://www.w3.org/1999/xhtml";t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||o,e):document.createElement(e)},t.hasCssClass=function(e,t){var o=e.className.split(/\s+/g);return-1!==o.indexOf(t)},t.addCssClass=function(e,o){t.hasCssClass(e,o)||(e.className+=" "+o)},t.removeCssClass=function(e,t){for(var o=e.className.split(/\s+/g);;){var n=o.indexOf(t);if(-1==n)break;o.splice(n,1)}e.className=o.join(" ")},t.toggleCssClass=function(e,t){for(var o=e.className.split(/\s+/g),n=!0;;){var i=o.indexOf(t);if(-1==i)break;n=!1,o.splice(i,1)}return n&&o.push(t),e.className=o.join(" "),n},t.setCssClass=function(e,o,n){n?t.addCssClass(e,o):t.removeCssClass(e,o)},t.hasCssString=function(e,t){var o,n=0;if(t=t||document,t.createStyleSheet&&(o=t.styleSheets)){for(;n<o.length;)if(o[n++].owningElement.id===e)return!0}else if(o=t.getElementsByTagName("style"))for(;n<o.length;)if(o[n++].id===e)return!0;return!1},t.importCssString=function(e,n,i){if(i=i||document,n&&t.hasCssString(n,i))return null;var r;i.createStyleSheet?(r=i.createStyleSheet(),r.cssText=e,n&&(r.owningElement.id=n)):(r=i.createElementNS?i.createElementNS(o,"style"):i.createElement("style"),r.appendChild(i.createTextNode(e)),n&&(r.id=n),t.getDocumentHead(i).appendChild(r))},t.importCssStylsheet=function(e,o){if(o.createStyleSheet)o.createStyleSheet(e);else{var n=t.createElement("link");n.rel="stylesheet",n.href=e,t.getDocumentHead(o).appendChild(n)}},t.getInnerWidth=function(e){return parseInt(t.computedStyle(e,"paddingLeft"),10)+parseInt(t.computedStyle(e,"paddingRight"),10)+e.clientWidth},t.getInnerHeight=function(e){return parseInt(t.computedStyle(e,"paddingTop"),10)+parseInt(t.computedStyle(e,"paddingBottom"),10)+e.clientHeight},void 0!==window.pageYOffset?(t.getPageScrollTop=function(){return window.pageYOffset},t.getPageScrollLeft=function(){return window.pageXOffset}):(t.getPageScrollTop=function(){return document.body.scrollTop},t.getPageScrollLeft=function(){return document.body.scrollLeft}),t.computedStyle=window.getComputedStyle?function(e,t){return t?(window.getComputedStyle(e,"")||{})[t]||"":window.getComputedStyle(e,"")||{}}:function(e,t){return t?e.currentStyle[t]:e.currentStyle
5
+ },_deactivate:function(t){var o=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),o&&this._trigger("deactivate",t,this.ui(o))},_over:function(t){var o=e.ui.ddmanager.current;o&&(o.currentItem||o.element)[0]!==this.element[0]&&this.accept.call(this.element[0],o.currentItem||o.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(o)))},_out:function(t){var o=e.ui.ddmanager.current;o&&(o.currentItem||o.element)[0]!==this.element[0]&&this.accept.call(this.element[0],o.currentItem||o.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(o)))},_drop:function(t,o){var n=o||e.ui.ddmanager.current,i=!1;return n&&(n.currentItem||n.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");return t.options.greedy&&!t.options.disabled&&t.options.scope===n.options.scope&&t.accept.call(t.element[0],n.currentItem||n.element)&&e.ui.intersect(n,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(i=!0,!1):void 0}),i?!1:this.accept.call(this.element[0],n.currentItem||n.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(n)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,o,n){if(!o.offset)return!1;var i,r,s=(e.positionAbs||e.position.absolute).left,l=s+e.helperProportions.width,a=(e.positionAbs||e.position.absolute).top,c=a+e.helperProportions.height,g=o.offset.left,u=g+o.proportions.width,h=o.offset.top,d=h+o.proportions.height;switch(n){case"fit":return s>=g&&u>=l&&a>=h&&d>=c;case"intersect":return g<s+e.helperProportions.width/2&&l-e.helperProportions.width/2<u&&h<a+e.helperProportions.height/2&&c-e.helperProportions.height/2<d;case"pointer":return i=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,r=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,t(r,h,o.proportions.height)&&t(i,g,o.proportions.width);case"touch":return(a>=h&&d>=a||c>=h&&d>=c||h>a&&c>d)&&(s>=g&&u>=s||l>=g&&u>=l||g>s&&l>u);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,o){var n,i,r=e.ui.ddmanager.droppables[t.options.scope]||[],s=o?o.type:null,l=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(n=0;n<r.length;n++)if(!(r[n].options.disabled||t&&!r[n].accept.call(r[n].element[0],t.currentItem||t.element))){for(i=0;i<l.length;i++)if(l[i]===r[n].element[0]){r[n].proportions.height=0;continue e}r[n].visible="none"!==r[n].element.css("display"),r[n].visible&&("mousedown"===s&&r[n]._activate.call(r[n],o),r[n].offset=r[n].element.offset(),r[n].proportions={width:r[n].element[0].offsetWidth,height:r[n].element[0].offsetHeight})}},drop:function(t,o){var n=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(n=this._drop.call(this,o)||n),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,o)))}),n},dragStart:function(t,o){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,o)})},drag:function(t,o){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,o),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var n,i,r,s=e.ui.intersect(t,this,this.options.tolerance),l=!s&&this.isover?"isout":s&&!this.isover?"isover":null;l&&(this.options.greedy&&(i=this.options.scope,r=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===i}),r.length&&(n=e.data(r[0],"ui-droppable"),n.greedyChild="isover"===l)),n&&"isover"===l&&(n.isover=!1,n.isout=!0,n._out.call(n,o)),this[l]=!0,this["isout"===l?"isover":"isout"]=!1,this["isover"===l?"_over":"_out"].call(this,o),n&&"isout"===l&&(n.isout=!1,n.isover=!0,n._over.call(n,o)))}})},dragStop:function(t,o){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,o)}}}(jQuery),function(){"use strict";function e(e){function t(t,n){var r,f,m=t==window,y=n&&void 0!==n.message?n.message:void 0;if(n=e.extend({},e.blockUI.defaults,n||{}),!n.ignoreIfBlocked||!e(t).data("blockUI.isBlocked")){if(n.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,n.overlayCSS||{}),r=e.extend({},e.blockUI.defaults.css,n.css||{}),n.onOverlayClick&&(n.overlayCSS.cursor="pointer"),f=e.extend({},e.blockUI.defaults.themedCSS,n.themedCSS||{}),y=void 0===y?n.message:y,m&&d&&o(window,{fadeOut:0}),y&&"string"!=typeof y&&(y.parentNode||y.jquery)){var _=y.jquery?y[0]:y,E={};e(t).data("blockUI.history",E),E.el=_,E.parent=_.parentNode,E.display=_.style.display,E.position=_.style.position,E.parent&&E.parent.removeChild(_)}e(t).data("blockUI.onUnblock",n.onUnblock);var v,C,B,k,b=n.baseZ;v=g||n.forceIframe?e('<iframe class="blockUI" style="z-index:'+b++ +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+n.iframeSrc+'"></iframe>'):e('<div class="blockUI" style="display:none"></div>'),C=n.theme?e('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+b++ +';display:none"></div>'):e('<div class="blockUI blockOverlay" style="z-index:'+b++ +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),n.theme&&m?(k='<div class="blockUI '+n.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(b+10)+';display:none;position:fixed">',n.title&&(k+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(n.title||"&nbsp;")+"</div>"),k+='<div class="ui-widget-content ui-dialog-content"></div>',k+="</div>"):n.theme?(k='<div class="blockUI '+n.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(b+10)+';display:none;position:absolute">',n.title&&(k+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(n.title||"&nbsp;")+"</div>"),k+='<div class="ui-widget-content ui-dialog-content"></div>',k+="</div>"):k=m?'<div class="blockUI '+n.blockMsgClass+' blockPage" style="z-index:'+(b+10)+';display:none;position:fixed"></div>':'<div class="blockUI '+n.blockMsgClass+' blockElement" style="z-index:'+(b+10)+';display:none;position:absolute"></div>',B=e(k),y&&(n.theme?(B.css(f),B.addClass("ui-widget-content")):B.css(r)),n.theme||C.css(n.overlayCSS),C.css("position",m?"fixed":"absolute"),(g||n.forceIframe)&&v.css("opacity",0);var A=[v,C,B],T=m?e("body"):e(t);e.each(A,function(){this.appendTo(T)}),n.theme&&n.draggable&&e.fn.draggable&&B.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var S=h&&(!e.support.boxModel||e("object,embed",m?null:t).length>0);if(u||S){if(m&&n.allowBodyStretch&&e.support.boxModel&&e("html,body").css("height","100%"),(u||!e.support.boxModel)&&!m)var R=a(t,"borderTopWidth"),I=a(t,"borderLeftWidth"),D=R?"(0 - "+R+")":0,w=I?"(0 - "+I+")":0;e.each(A,function(e,t){var o=t[0].style;if(o.position="absolute",2>e)m?o.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+n.quirksmodeOffsetHack+') + "px"'):o.setExpression("height",'this.parentNode.offsetHeight + "px"'),m?o.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):o.setExpression("width",'this.parentNode.offsetWidth + "px"'),w&&o.setExpression("left",w),D&&o.setExpression("top",D);else if(n.centerY)m&&o.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),o.marginTop=0;else if(!n.centerY&&m){var i=n.css&&n.css.top?parseInt(n.css.top,10):0,r="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+i+') + "px"';o.setExpression("top",r)}})}if(y&&(n.theme?B.find(".ui-widget-content").append(y):B.append(y),(y.jquery||y.nodeType)&&e(y).show()),(g||n.forceIframe)&&n.showOverlay&&v.show(),n.fadeIn){var L=n.onBlock?n.onBlock:c,F=n.showOverlay&&!y?L:c,N=y?L:c;n.showOverlay&&C._fadeIn(n.fadeIn,F),y&&B._fadeIn(n.fadeIn,N)}else n.showOverlay&&C.show(),y&&B.show(),n.onBlock&&n.onBlock();if(i(1,t,n),m?(d=B[0],p=e(n.focusableElements,d),n.focusInput&&setTimeout(s,20)):l(B[0],n.centerX,n.centerY),n.timeout){var O=setTimeout(function(){m?e.unblockUI(n):e(t).unblock(n)},n.timeout);e(t).data("blockUI.timeout",O)}}}function o(t,o){var r,s=t==window,l=e(t),a=l.data("blockUI.history"),c=l.data("blockUI.timeout");c&&(clearTimeout(c),l.removeData("blockUI.timeout")),o=e.extend({},e.blockUI.defaults,o||{}),i(0,t,o),null===o.onUnblock&&(o.onUnblock=l.data("blockUI.onUnblock"),l.removeData("blockUI.onUnblock"));var g;g=s?e("body").children().filter(".blockUI").add("body > .blockUI"):l.find(">.blockUI"),o.cursorReset&&(g.length>1&&(g[1].style.cursor=o.cursorReset),g.length>2&&(g[2].style.cursor=o.cursorReset)),s&&(d=p=null),o.fadeOut?(r=g.length,g.stop().fadeOut(o.fadeOut,function(){0===--r&&n(g,a,o,t)})):n(g,a,o,t)}function n(t,o,n,i){var r=e(i);if(!r.data("blockUI.isBlocked")){t.each(function(){this.parentNode&&this.parentNode.removeChild(this)}),o&&o.el&&(o.el.style.display=o.display,o.el.style.position=o.position,o.parent&&o.parent.appendChild(o.el),r.removeData("blockUI.history")),r.data("blockUI.static")&&r.css("position","static"),"function"==typeof n.onUnblock&&n.onUnblock(i,n);var s=e(document.body),l=s.width(),a=s[0].style.width;s.width(l-1).width(l),s[0].style.width=a}}function i(t,o,n){var i=o==window,s=e(o);if((t||(!i||d)&&(i||s.data("blockUI.isBlocked")))&&(s.data("blockUI.isBlocked",t),i&&n.bindEvents&&(!t||n.showOverlay))){var l="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";t?e(document).bind(l,n,r):e(document).unbind(l,r)}}function r(t){if("keydown"===t.type&&t.keyCode&&9==t.keyCode&&d&&t.data.constrainTabKey){var o=p,n=!t.shiftKey&&t.target===o[o.length-1],i=t.shiftKey&&t.target===o[0];if(n||i)return setTimeout(function(){s(i)},10),!1}var r=t.data,l=e(t.target);return l.hasClass("blockOverlay")&&r.onOverlayClick&&r.onOverlayClick(t),l.parents("div."+r.blockMsgClass).length>0?!0:0===l.parents().children().filter("div.blockUI").length}function s(e){if(p){var t=p[e===!0?p.length-1:0];t&&t.focus()}}function l(e,t,o){var n=e.parentNode,i=e.style,r=(n.offsetWidth-e.offsetWidth)/2-a(n,"borderLeftWidth"),s=(n.offsetHeight-e.offsetHeight)/2-a(n,"borderTopWidth");t&&(i.left=r>0?r+"px":"0"),o&&(i.top=s>0?s+"px":"0")}function a(t,o){return parseInt(e.css(t,o),10)||0}e.fn._fadeIn=e.fn.fadeIn;var c=e.noop||function(){},g=/MSIE/.test(navigator.userAgent),u=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),h=(document.documentMode||0,e.isFunction(document.createElement("div").style.setExpression));e.blockUI=function(e){t(window,e)},e.unblockUI=function(e){o(window,e)},e.growlUI=function(t,o,n,i){var r=e('<div class="growlUI"></div>');t&&r.append("<h1>"+t+"</h1>"),o&&r.append("<h2>"+o+"</h2>"),void 0===n&&(n=3e3);var s=function(t){t=t||{},e.blockUI({message:r,fadeIn:"undefined"!=typeof t.fadeIn?t.fadeIn:700,fadeOut:"undefined"!=typeof t.fadeOut?t.fadeOut:1e3,timeout:"undefined"!=typeof t.timeout?t.timeout:n,centerY:!1,showOverlay:!1,onUnblock:i,css:e.blockUI.defaults.growlCSS})};s();r.css("opacity");r.mouseover(function(){s({fadeIn:0,timeout:3e4});var t=e(".blockMsg");t.stop(),t.fadeTo(300,1)}).mouseout(function(){e(".blockMsg").fadeOut(1e3)})},e.fn.block=function(o){if(this[0]===window)return e.blockUI(o),this;var n=e.extend({},e.blockUI.defaults,o||{});return this.each(function(){var t=e(this);n.ignoreIfBlocked&&t.data("blockUI.isBlocked")||t.unblock({fadeOut:0})}),this.each(function(){"static"==e.css(this,"position")&&(this.style.position="relative",e(this).data("blockUI.static",!0)),this.style.zoom=1,t(this,o)})},e.fn.unblock=function(t){return this[0]===window?(e.unblockUI(t),this):this.each(function(){o(this,t)})},e.blockUI.version=2.66,e.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var d=null,p=[]}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)}(),function(){function e(e,o,n){return t(e,o,n)}function t(e,a,g,u){u=u||{},a&&!n(a)&&(g=a,a=void 0),a=a||new Date,g=g||c,g.formats=g.formats||{};var h=a.getTime(),d=u.timezone,p=typeof d;if((u.utc||"number"==p||"string"==p)&&(a=o(a)),d){if("string"==p)var f="-"==d[0]?-1:1,m=parseInt(d.slice(1,3),10),y=parseInt(d.slice(3,5),10),d=f*(60*m+y);p&&(a=new Date(a.getTime()+6e4*d))}return e.replace(/%([-_0]?.)/g,function(e,o){var n;if(2==o.length){if(n=o[0],"-"==n)n="";else if("_"==n)n=" ";else{if("0"!=n)return e;n="0"}o=o[1]}switch(o){case"A":return g.days[a.getDay()];case"a":return g.shortDays[a.getDay()];case"B":return g.months[a.getMonth()];case"b":return g.shortMonths[a.getMonth()];case"C":return i(Math.floor(a.getFullYear()/100),n);case"D":return t(g.formats.D||"%m/%d/%y",a,g);case"d":return i(a.getDate(),n);case"e":return i(a.getDate(),null==n?" ":n);case"F":return t(g.formats.F||"%Y-%m-%d",a,g);case"H":return i(a.getHours(),n);case"h":return g.shortMonths[a.getMonth()];case"I":return i(r(a),n);case"j":return n=new Date(a.getFullYear(),0,1),n=Math.ceil((a.getTime()-n.getTime())/864e5),i(n,3);case"k":return i(a.getHours(),null==n?" ":n);case"L":return i(Math.floor(h%1e3),3);case"l":return i(r(a),null==n?" ":n);case"M":return i(a.getMinutes(),n);case"m":return i(a.getMonth()+1,n);case"n":return"\n";case"o":return String(a.getDate())+s(a.getDate());case"P":return a.getHours()<12?g.am:g.pm;case"p":return a.getHours()<12?g.AM:g.PM;case"R":return t(g.formats.R||"%H:%M",a,g);case"r":return t(g.formats.r||"%I:%M:%S %p",a,g);case"S":return i(a.getSeconds(),n);case"s":return Math.floor(h/1e3);case"T":return t(g.formats.T||"%H:%M:%S",a,g);case"t":return" ";case"U":return i(l(a,"sunday"),n);case"u":return n=a.getDay(),0==n?7:n;case"v":return t(g.formats.v||"%e-%b-%Y",a,g);case"W":return i(l(a,"monday"),n);case"w":return a.getDay();case"Y":return a.getFullYear();case"y":return n=String(a.getFullYear()),n.slice(n.length-2);case"Z":return u.utc?"GMT":(n=a.toString().match(/\(([\w\s]+)\)/))&&n[1]||"";case"z":return u.utc?"+0000":(n="number"==typeof d?d:-a.getTimezoneOffset(),(0>n?"-":"+")+i(Math.floor(Math.abs(n)/60))+i(Math.abs(n)%60));default:return o}})}function o(e){var t=6e4*(e.getTimezoneOffset()||0);return new Date(e.getTime()+t)}function n(e){for(var t=0,o=g.length,t=0;o>t;++t)if("function"!=typeof e[g[t]])return!1;return!0}function i(e,t,o){if("number"==typeof t&&(o=t,t="0"),null==t&&(t="0"),o=o||2,e=String(e),t)for(;e.length<o;)e=t+e;return e}function r(e){return e=e.getHours(),0==e?e=12:e>12&&(e-=12),e}function s(e){var t=e%10;if(e%=100,e>=11&&13>=e||0===t||t>=4)return"th";switch(t){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function l(e,t){var t=t||"sunday",o=e.getDay();"monday"==t&&(0==o?o=6:o--);var n=new Date(e.getFullYear(),0,1);return Math.floor(((e-n)/864e5+7-o)/7)}var a;a="undefined"!=typeof module?module.exports=e:function(){return this||(0,eval)("this")}();var c={days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm"};a.strftime=e,a.strftimeTZ=e.strftimeTZ=function(e,o,n,i){return"number"!=typeof n&&"string"!=typeof n||null!=i||(i=n,n=void 0),t(e,o,n,{timezone:i})},a.strftimeUTC=e.strftimeUTC=function(e,o,n){return t(e,o,n,{utc:!0})},a.localizedStrftime=e.localizedStrftime=function(e){return function(o,n){return t(o,n,e)}};var g=["getTime","getTimezoneOffset","getDay","getDate","getMonth","getFullYear","getYear","getHours","getMinutes","getSeconds"]}(),function(){function e(e){var t=function(e,t){return i("",e,t)},r=o;e&&(o[e]||(o[e]={}),r=o[e]),r.define&&r.define.packaged||(n.original=r.define,r.define=n,r.define.packaged=!0),r.require&&r.require.packaged||(i.original=r.require,r.require=t,r.require.packaged=!0)}var t="",o=function(){return this}();if(t||"undefined"==typeof requirejs){var n=function(e,t,o){return"string"!=typeof e?(n.original?n.original.apply(window,arguments):(console.error("dropping module because define wasn't a string."),console.trace()),void 0):(2==arguments.length&&(o=t),n.modules||(n.modules={},n.payloads={}),n.payloads[e]=o,n.modules[e]=null,void 0)},i=function(e,t,o){if("[object Array]"===Object.prototype.toString.call(t)){for(var n=[],r=0,l=t.length;l>r;++r){var a=s(e,t[r]);if(!a&&i.original)return i.original.apply(window,arguments);n.push(a)}o&&o.apply(null,n)}else{if("string"==typeof t){var c=s(e,t);return!c&&i.original?i.original.apply(window,arguments):(o&&o(),c)}if(i.original)return i.original.apply(window,arguments)}},r=function(e,t){if(-1!==t.indexOf("!")){var o=t.split("!");return r(e,o[0])+"!"+r(e,o[1])}if("."==t.charAt(0)){var n=e.split("/").slice(0,-1).join("/");for(t=n+"/"+t;-1!==t.indexOf(".")&&i!=t;){var i=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},s=function(e,t){t=r(e,t);var o=n.modules[t];if(!o){if(o=n.payloads[t],"function"==typeof o){var s={},l={id:t,uri:"",exports:s,packaged:!0},a=function(e,o){return i(t,e,o)},c=o(a,s,l);s=c||l.exports,n.modules[t]=s,delete n.payloads[t]}o=n.modules[t]=s||o}return o};e(t)}}(),define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/multi_select","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/mode/folding/fold_mode","ace/theme/textmate","ace/config"],function(e,t){e("./lib/fixoldbrowsers");var o=e("./lib/dom"),n=e("./lib/event"),i=e("./editor").Editor,r=e("./edit_session").EditSession,s=e("./undomanager").UndoManager,l=e("./virtual_renderer").VirtualRenderer,a=e("./multi_select").MultiSelect;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./mode/folding/fold_mode"),e("./theme/textmate"),t.config=e("./config"),t.require=e,t.edit=function(e){if("string"==typeof e){var r=e,e=document.getElementById(r);if(!e)throw new Error("ace.edit can't find div #"+r)}if(e.env&&e.env.editor instanceof i)return e.env.editor;var s=t.createEditSession(o.getInnerText(e));e.innerHTML="";var c=new i(new l(e));new a(c),c.setSession(s);var g={document:s,editor:c,onResize:c.resize.bind(c,null)};return n.addListener(window,"resize",g.onResize),c.on("destroy",function(){n.removeListener(window,"resize",g.onResize)}),e.env=c.env=g,c},t.createEditSession=function(e,t){var o=new r(e,t);return o.setUndoManager(new s),o},t.EditSession=r,t.UndoManager=s}),define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e){e("./regexp"),e("./es5-shim")}),define("ace/lib/regexp",["require","exports","module"],function(){function e(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function t(e,t,o){if(Array.prototype.indexOf)return e.indexOf(t,o);for(var n=o||0;n<e.length;n++)if(e[n]===t)return n;return-1}var o={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},n=void 0===o.exec.call(/()??/,"")[1],i=function(){var e=/^/g;return o.test.call(e,""),!e.lastIndex}();i&&n||(RegExp.prototype.exec=function(r){var s,l,a=o.exec.apply(this,arguments);if("string"==typeof r&&a){if(!n&&a.length>1&&t(a,"")>-1&&(l=RegExp(this.source,o.replace.call(e(this),"g","")),o.replace.call(r.slice(a.index),l,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(a[e]=void 0)})),this._xregexp&&this._xregexp.captureNames)for(var c=1;c<a.length;c++)s=this._xregexp.captureNames[c-1],s&&(a[s]=a[c]);!i&&this.global&&!a[0].length&&this.lastIndex>a.index&&this.lastIndex--}return a},i||(RegExp.prototype.test=function(e){var t=o.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),define("ace/lib/es5-shim",["require","exports","module"],function(){function e(){}function t(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function o(e){return e=+e,e!==e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}Function.prototype.bind||(Function.prototype.bind=function(t){var o=this;if("function"!=typeof o)throw new TypeError("Function.prototype.bind called on incompatible "+o);var n=u.call(arguments,1),i=function(){if(this instanceof i){var e=o.apply(this,n.concat(u.call(arguments)));return Object(e)===e?e:this}return o.apply(t,n.concat(u.call(arguments)))};return o.prototype&&(e.prototype=o.prototype,i.prototype=new e,e.prototype=null),i});var n,i,r,s,l,a=Function.prototype.call,c=Array.prototype,g=Object.prototype,u=c.slice,h=a.bind(g.toString),d=a.bind(g.hasOwnProperty);if((l=d(g,"__defineGetter__"))&&(n=a.bind(g.__defineGetter__),i=a.bind(g.__defineSetter__),r=a.bind(g.__lookupGetter__),s=a.bind(g.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,o=[];return o.splice.apply(o,e(20)),o.splice.apply(o,e(26)),t=o.length,o.splice(5,0,"XXX"),t+1==o.length,t+1==o.length?!0:void 0}()){var p=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?p.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(u.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var o=this.length;e>0?e>o&&(e=o):void 0==e?e=0:0>e&&(e=Math.max(o+e,0)),o>e+t||(t=o-e);var n=this.slice(e,e+t),i=u.call(arguments,2),r=i.length;if(e===o)r&&this.push.apply(this,i);else{var s=Math.min(t,o-e),l=e+s,a=l+r-s,c=o-l,g=o-s;if(l>a)for(var h=0;c>h;++h)this[a+h]=this[l+h];else if(a>l)for(h=c;h--;)this[a+h]=this[l+h];if(r&&e===g)this.length=g,this.push.apply(this,i);else for(this.length=g+r,h=0;r>h;++h)this[e+h]=i[h]}return n};Array.isArray||(Array.isArray=function(e){return"[object Array]"==h(e)});var f=Object("a"),m="a"!=f[0]||!(0 in f);if(Array.prototype.forEach||(Array.prototype.forEach=function(e){var t=F(this),o=m&&"[object String]"==h(this)?this.split(""):t,n=arguments[1],i=-1,r=o.length>>>0;if("[object Function]"!=h(e))throw new TypeError;for(;++i<r;)i in o&&e.call(n,o[i],i,t)}),Array.prototype.map||(Array.prototype.map=function(e){var t=F(this),o=m&&"[object String]"==h(this)?this.split(""):t,n=o.length>>>0,i=Array(n),r=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var s=0;n>s;s++)s in o&&(i[s]=e.call(r,o[s],s,t));return i}),Array.prototype.filter||(Array.prototype.filter=function(e){var t,o=F(this),n=m&&"[object String]"==h(this)?this.split(""):o,i=n.length>>>0,r=[],s=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var l=0;i>l;l++)l in n&&(t=n[l],e.call(s,t,l,o)&&r.push(t));return r}),Array.prototype.every||(Array.prototype.every=function(e){var t=F(this),o=m&&"[object String]"==h(this)?this.split(""):t,n=o.length>>>0,i=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var r=0;n>r;r++)if(r in o&&!e.call(i,o[r],r,t))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(e){var t=F(this),o=m&&"[object String]"==h(this)?this.split(""):t,n=o.length>>>0,i=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var r=0;n>r;r++)if(r in o&&e.call(i,o[r],r,t))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=F(this),o=m&&"[object String]"==h(this)?this.split(""):t,n=o.length>>>0;if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");if(!n&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,r=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(r in o){i=o[r++];break}if(++r>=n)throw new TypeError("reduce of empty array with no initial value")}for(;n>r;r++)r in o&&(i=e.call(void 0,i,o[r],r,t));return i}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(e){var t=F(this),o=m&&"[object String]"==h(this)?this.split(""):t,n=o.length>>>0;if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");if(!n&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,r=n-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(r in o){i=o[r--];break}if(--r<0)throw new TypeError("reduceRight of empty array with no initial value")}do r in this&&(i=e.call(void 0,i,o[r],r,t));while(r--);return i}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=m&&"[object String]"==h(this)?this.split(""):F(this),n=t.length>>>0;if(!n)return-1;var i=0;for(arguments.length>1&&(i=o(arguments[1])),i=i>=0?i:Math.max(0,n+i);n>i;i++)if(i in t&&t[i]===e)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(e){var t=m&&"[object String]"==h(this)?this.split(""):F(this),n=t.length>>>0;if(!n)return-1;var i=n-1;for(arguments.length>1&&(i=Math.min(i,o(arguments[1]))),i=i>=0?i:n-Math.abs(i);i>=0;i--)if(i in t&&e===t[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:g)}),!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError(y+e);if(d(e,t)){var o,n,i;if(o={enumerable:!0,configurable:!0},l){var a=e.__proto__;e.__proto__=g;var n=r(e,t),i=s(e,t);if(e.__proto__=a,n||i)return n&&(o.get=n),i&&(o.set=i),o}return o.value=e[t],o}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),!Object.create){var _;_=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var o;if(null===e)o=_();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var n=function(){};n.prototype=e,o=new n,o.__proto__=e}return void 0!==t&&Object.defineProperties(o,t),o}}if(Object.defineProperty){var E=t({}),v="undefined"==typeof document||t(document.createElement("div"));if(!E||!v)var C=Object.defineProperty}if(!Object.defineProperty||C){var B="Property description must be an object: ",k="Object.defineProperty called on non-object: ",b="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(e,t,o){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError(k+e);if("object"!=typeof o&&"function"!=typeof o||null===o)throw new TypeError(B+o);if(C)try{return C.call(Object,e,t,o)}catch(a){}if(d(o,"value"))if(l&&(r(e,t)||s(e,t))){var c=e.__proto__;e.__proto__=g,delete e[t],e[t]=o.value,e.__proto__=c}else e[t]=o.value;else{if(!l)throw new TypeError(b);d(o,"get")&&n(e,t,o.get),d(o,"set")&&i(e,t,o.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var o in t)d(t,o)&&Object.defineProperty(e,o,t[o]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(A){Object.freeze=function(e){return function(t){return"function"==typeof t?t:e(t)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";d(e,t);)t+="?";e[t]=!0;var o=d(e,t);return delete e[t],o}),!Object.keys){var T=!0,S=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],R=S.length;for(var I in{toString:null})T=!1;Object.keys=function N(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var N=[];for(var t in e)d(e,t)&&N.push(t);if(T)for(var o=0,n=R;n>o;o++){var i=S[o];d(e,i)&&N.push(i)}return N}}Date.now||(Date.now=function(){return(new Date).getTime()});var D=" \n \f\r   ᠎              \u2028\u2029";if(!String.prototype.trim||D.trim()){D="["+D+"]";var w=new RegExp("^"+D+D+"*"),L=new RegExp(D+D+"*$");String.prototype.trim=function(){return String(this).replace(w,"").replace(L,"")}}var F=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),define("ace/lib/dom",["require","exports","module"],function(e,t){if("undefined"!=typeof document){var o="http://www.w3.org/1999/xhtml";t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||o,e):document.createElement(e)},t.hasCssClass=function(e,t){var o=e.className.split(/\s+/g);return-1!==o.indexOf(t)},t.addCssClass=function(e,o){t.hasCssClass(e,o)||(e.className+=" "+o)},t.removeCssClass=function(e,t){for(var o=e.className.split(/\s+/g);;){var n=o.indexOf(t);if(-1==n)break;o.splice(n,1)}e.className=o.join(" ")},t.toggleCssClass=function(e,t){for(var o=e.className.split(/\s+/g),n=!0;;){var i=o.indexOf(t);if(-1==i)break;n=!1,o.splice(i,1)}return n&&o.push(t),e.className=o.join(" "),n},t.setCssClass=function(e,o,n){n?t.addCssClass(e,o):t.removeCssClass(e,o)},t.hasCssString=function(e,t){var o,n=0;if(t=t||document,t.createStyleSheet&&(o=t.styleSheets)){for(;n<o.length;)if(o[n++].owningElement.id===e)return!0}else if(o=t.getElementsByTagName("style"))for(;n<o.length;)if(o[n++].id===e)return!0;return!1},t.importCssString=function(e,n,i){if(i=i||document,n&&t.hasCssString(n,i))return null;var r;i.createStyleSheet?(r=i.createStyleSheet(),r.cssText=e,n&&(r.owningElement.id=n)):(r=i.createElementNS?i.createElementNS(o,"style"):i.createElement("style"),r.appendChild(i.createTextNode(e)),n&&(r.id=n),t.getDocumentHead(i).appendChild(r))},t.importCssStylsheet=function(e,o){if(o.createStyleSheet)o.createStyleSheet(e);else{var n=t.createElement("link");n.rel="stylesheet",n.href=e,t.getDocumentHead(o).appendChild(n)}},t.getInnerWidth=function(e){return parseInt(t.computedStyle(e,"paddingLeft"),10)+parseInt(t.computedStyle(e,"paddingRight"),10)+e.clientWidth},t.getInnerHeight=function(e){return parseInt(t.computedStyle(e,"paddingTop"),10)+parseInt(t.computedStyle(e,"paddingBottom"),10)+e.clientHeight},void 0!==window.pageYOffset?(t.getPageScrollTop=function(){return window.pageYOffset},t.getPageScrollLeft=function(){return window.pageXOffset}):(t.getPageScrollTop=function(){return document.body.scrollTop},t.getPageScrollLeft=function(){return document.body.scrollLeft}),t.computedStyle=window.getComputedStyle?function(e,t){return t?(window.getComputedStyle(e,"")||{})[t]||"":window.getComputedStyle(e,"")||{}}:function(e,t){return t?e.currentStyle[t]:e.currentStyle
6
6
  },t.scrollbarWidth=function(e){var o=t.createElement("ace_inner");o.style.width="100%",o.style.minWidth="0px",o.style.height="200px",o.style.display="block";var n=t.createElement("ace_outer"),i=n.style;i.position="absolute",i.left="-10000px",i.overflow="hidden",i.width="200px",i.minWidth="0px",i.height="150px",i.display="block",n.appendChild(o);var r=e.documentElement;r.appendChild(n);var s=o.offsetWidth;i.overflow="scroll";var l=o.offsetWidth;return s==l&&(l=n.clientWidth),r.removeChild(n),s-l},t.setInnerHtml=function(e,t){var o=e.cloneNode(!1);return o.innerHTML=t,e.parentNode.replaceChild(o,e),o},"textContent"in document.documentElement?(t.setInnerText=function(e,t){e.textContent=t},t.getInnerText=function(e){return e.textContent}):(t.setInnerText=function(e,t){e.innerText=t},t.getInnerText=function(e){return e.innerText}),t.getParentWindow=function(e){return e.defaultView||e.parentWindow}}}),define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent","ace/lib/dom"],function(e,t){function o(e,t,o){var l=0;if(l=!i.isOpera||"KeyboardEvent"in window||!i.isMac?0|(t.ctrlKey?1:0)|(t.altKey?2:0)|(t.shiftKey?4:0)|(t.metaKey?8:0):0|(t.metaKey?1:0)|(t.altKey?2:0)|(t.shiftKey?4:0)|(t.ctrlKey?8:0),!i.isMac&&r){if((r[91]||r[92])&&(l|=8),r.altGr){if(3==(3&l))return;r.altGr=0}if(18===o||17===o){var a=t.location||t.keyLocation;if(17===o&&1===a)s=t.timeStamp;else if(18===o&&3===l&&2===a){var c=-s;s=t.timeStamp,c+=s,3>c&&(r.altGr=!0)}}}if(o in n.MODIFIER_KEYS){switch(n.MODIFIER_KEYS[o]){case"Alt":l=2;break;case"Shift":l=4;break;case"Ctrl":l=1;break;default:l=8}o=0}return 8&l&&(91===o||93===o)&&(o=0),l||13!==o||!t.location&&3!==t.keyLocation||(e(t,l,-o),!t.defaultPrevented)?l||o in n.FUNCTION_KEYS||o in n.PRINTABLE_KEYS?e(t,l,o):!1:void 0}{var n=e("./keys"),i=e("./useragent");e("./dom")}t.addListener=function(e,t,o){if(e.addEventListener)return e.addEventListener(t,o,!1);if(e.attachEvent){var n=function(){o.call(e,window.event)};o._wrapper=n,e.attachEvent("on"+t,n)}},t.removeListener=function(e,t,o){return e.removeEventListener?e.removeEventListener(t,o,!1):(e.detachEvent&&e.detachEvent("on"+t,o._wrapper||o),void 0)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||e.ctrlKey&&i.isMac?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,o,n){function i(e){o&&o(e),n&&n(e),t.removeListener(document,"mousemove",o,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}t.addListener(document,"mousemove",o,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0)},t.addMouseWheelListener=function(e,o){if("onmousewheel"in e){var n=8;t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/n,e.wheelY=-e.wheelDeltaY/n):(e.wheelX=0,e.wheelY=-e.wheelDelta/n),o(e)})}else"onwheel"in e?t.addListener(e,"wheel",function(e){e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0),o(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),o(e)})},t.addMultiMouseDownListener=function(e,o,n,r){var s,l,a,c=0,g={2:"dblclick",3:"tripleclick",4:"quadclick"};t.addListener(e,"mousedown",function(e){if(0!=t.getButton(e)?c=0:e.detail>1?(c++,c>4&&(c=1)):c=1,i.isIE){var o=Math.abs(e.clientX-s)>5||Math.abs(e.clientY-l)>5;o&&(c=1),1==c&&(s=e.clientX,l=e.clientY)}if(n[r]("mousedown",e),c>4)c=0;else if(c>1)return n[r](g[c],e)}),i.isOldIE&&t.addListener(e,"dblclick",function(e){c=2,a&&clearTimeout(a),a=setTimeout(function(){a=null},o[c-1]||600),n[r]("mousedown",e),n[r](g[c],e)})};var r=null,s=0;if(t.addCommandKeyListener=function(e,n){var s=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var l=null;s(e,"keydown",function(e){l=e.keyCode}),s(e,"keypress",function(e){return o(n,e,l)})}else{var a=null;s(e,"keydown",function(e){r[e.keyCode]=!0;var t=o(n,e,e.keyCode);return a=e.defaultPrevented,t}),s(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),s(e,"keyup",function(e){r[e.keyCode]=null}),r||(r=Object.create(null),s(window,"focus",function(){r=Object.create(null)}))}},window.postMessage&&!i.isOldIE){var l=1;t.nextTick=function(e,o){o=o||window;var n="zero-timeout-message-"+l;t.addListener(o,"message",function i(r){r.data==n&&(t.stopPropagation(r),t.removeListener(o,"message",i),e())}),o.postMessage(n,"*")}}t.nextFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame,t.nextFrame=t.nextFrame?t.nextFrame.bind(window):function(e){setTimeout(e,17)}}),define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t){var o=e("./oop"),n=function(){var e={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",188:",",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}};for(var t in e.FUNCTION_KEYS){var n=e.FUNCTION_KEYS[t].toLowerCase();e[n]=parseInt(t,10)}return o.mixin(e,e.MODIFIER_KEYS),o.mixin(e,e.PRINTABLE_KEYS),o.mixin(e,e.FUNCTION_KEYS),e.enter=e["return"],e.escape=e.esc,e.del=e["delete"],e[173]="-",e}();o.mixin(t,n),t.keyCodeToString=function(e){return(n[e]||String.fromCharCode(e)).toLowerCase()}}),define("ace/lib/oop",["require","exports","module"],function(e,t){t.inherits=function(){var e=function(){};return function(t,o){e.prototype=o.prototype,t.super_=o.prototype,t.prototype=new e,t.prototype.constructor=t}}(),t.mixin=function(e,t){for(var o in t)e[o]=t[o];return e},t.implement=function(e,o){t.mixin(e,o)}}),define("ace/lib/useragent",["require","exports","module"],function(e,t){if(t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS},"object"==typeof navigator){var o=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),n=navigator.userAgent;t.isWin="win"==o,t.isMac="mac"==o,t.isLinux="linux"==o,t.isIE=("Microsoft Internet Explorer"==navigator.appName||navigator.appName.indexOf("MSAppHost")>=0)&&parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=window.controllers&&"Gecko"===window.navigator.product,t.isOldGecko=t.isGecko&&parseInt((navigator.userAgent.match(/rv\:(\d+)/)||[])[1],10)<4,t.isOpera=window.opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(n.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(n.split(" Chrome/")[1])||void 0,t.isAIR=n.indexOf("AdobeAIR")>=0,t.isIPad=n.indexOf("iPad")>=0,t.isTouchPad=n.indexOf("TouchPad")>=0}}),define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config"],function(e,t){e("./lib/fixoldbrowsers");var o=e("./lib/oop"),n=e("./lib/dom"),i=e("./lib/lang"),r=e("./lib/useragent"),s=e("./keyboard/textinput").TextInput,l=e("./mouse/mouse_handler").MouseHandler,a=e("./mouse/fold_handler").FoldHandler,c=e("./keyboard/keybinding").KeyBinding,g=e("./edit_session").EditSession,u=e("./search").Search,h=e("./range").Range,d=e("./lib/event_emitter").EventEmitter,p=e("./commands/command_manager").CommandManager,f=e("./commands/default_commands").commands,m=e("./config"),y=function(e,t){var o=e.getContainerElement();this.container=o,this.renderer=e,this.commands=new p(r.isMac?"mac":"win",f),this.textInput=new s(e.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.keyBinding=new c(this),this.$mouseHandler=new l(this),new a(this),this.$blockScrolling=0,this.$search=(new u).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=i.delayedCall(function(){this._signal("input",{}),this.session.bgTokenizer&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(e,t){t._$emitInputEvent.schedule(31)}),this.setSession(t||new g("")),m.resetOptions(this),m._emit("editor",this)};(function(){o.implement(this,d),this.$initOperationListeners=function(){function e(e){return e[e.length-1]}this.selections=[],this.commands.on("exec",function(t){this.startOperation(t);var o=t.command;if("fileJump"==o.group){var n=this.prevOp;n&&"fileJump"==n.command.group||(this.lastFileJumpPos=e(this.selections))}else this.lastFileJumpPos=null}.bind(this),!0),this.commands.on("afterExec",function(e){var t=e.command;return"fileJump"==t.group&&this.lastFileJumpPos&&!this.curOp.selectionChanged?(this.selection.fromJSON(this.lastFileJumpPos),void 0):(this.endOperation(e),void 0)}.bind(this),!0),this.$opResetTimer=i.delayedCall(this.endOperation.bind(this)),this.on("change",function(){this.curOp||this.startOperation(),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||this.startOperation(),this.curOp.selectionChanged=!0}.bind(this),!0)},this.curOp=null,this.prevOp={},this.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp={command:e.command||{},args:e.args},this.selections.push(this.selection.toJSON())},this.endOperation=function(){this.curOp&&(this.prevOp=this.curOp,this.curOp=null)},this.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,o=["backspace","del","insertstring"],n=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var i=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else n=n&&-1!==o.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(n=!1),n?this.session.mergeUndoDeltas=!0:-1!==o.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(e){if(e)if("string"==typeof e){this.$keybindingId=e;var t=this;m.loadModule(["keybinding",e],function(o){t.$keybindingId==e&&t.keyBinding.setKeyboardHandler(o&&o.handler)})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e);else this.keyBinding.setKeyboardHandler(null)},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session!=e){if(this.session){var t=this.session;this.session.removeEventListener("change",this.$onDocumentChange),this.session.removeEventListener("changeMode",this.$onChangeMode),this.session.removeEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.session.removeEventListener("changeTabSize",this.$onChangeTabSize),this.session.removeEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.session.removeEventListener("changeWrapMode",this.$onChangeWrapMode),this.session.removeEventListener("onChangeFold",this.$onChangeFold),this.session.removeEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.session.removeEventListener("changeBackMarker",this.$onChangeBackMarker),this.session.removeEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.session.removeEventListener("changeAnnotation",this.$onChangeAnnotation),this.session.removeEventListener("changeOverwrite",this.$onCursorChange),this.session.removeEventListener("changeScrollTop",this.$onScrollTopChange),this.session.removeEventListener("changeScrollLeft",this.$onScrollLeftChange);var o=this.session.getSelection();o.removeEventListener("changeCursor",this.$onCursorChange),o.removeEventListener("changeSelection",this.$onSelectionChange)}this.session=e,this.$onDocumentChange=this.onDocumentChange.bind(this),e.addEventListener("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.addEventListener("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.addEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.addEventListener("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.addEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.addEventListener("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.addEventListener("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.addEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.addEventListener("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.addEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.addEventListener("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.addEventListener("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.addEventListener("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.addEventListener("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.$blockScrolling+=1,this.onCursorChange(),this.$blockScrolling-=1,this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull(),this._emit("changeSession",{session:e,oldSession:t})}},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e){this.renderer.setTheme(e)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||n.computedStyle(this.container,"fontSize")},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){if(this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null),!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session.findMatchingBracket(e.getCursorPosition());if(t)var o=new h(t.row,t.column,t.row,t.column+1);else if(e.session.$mode.getMatching)var o=e.session.$mode.getMatching(e.session);o&&(e.session.$bracketHighlight=e.session.addMarker(o,"ace_bracket","text"))},50)}},this.focus=function(){var e=this;setTimeout(function(){e.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus"))},this.onBlur=function(){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur"))},this.$cursorChange=function(){this.renderer.updateCursor()},this.onDocumentChange=function(e){var t,o=e.data,n=o.range;t=n.start.row==n.end.row&&"insertLines"!=o.action&&"removeLines"!=o.action?n.end.row:1/0,this.renderer.updateLines(n.start.row,t),this._emit("change",e),this.$cursorChange()},this.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this.$blockScrolling||this.renderer.scrollCursorIntoView(),this.$highlightBrackets(),this.$updateHighlightActiveLine(),this._emit("changeSelection")},this.$updateHighlightActiveLine=function(){var e,t=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.$maxLines&&1===this.session.getLength()&&(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var o=new h(e.row,e.column,e.row,1/0);o.id=t.addMarker(o,"ace_active-line","screenLine"),t.$highlightLineMarker=o}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._emit("changeBackMarker"))},this.onSelectionChange=function(){var e=this.session;if(e.$selectionMarker&&e.removeMarker(e.$selectionMarker),e.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var t=this.selection.getRange(),o=this.getSelectionStyle();e.$selectionMarker=e.addMarker(t,"ace_selection",o)}var n=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(n),this._emit("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var o=t.start.column-1,n=t.end.column+1,i=e.getLine(t.start.row),r=i.length,s=i.substring(Math.max(o,0),Math.min(n,r));if(!(o>=0&&/^[\w\d]/.test(s)||r>=n&&/[\w\d]$/.test(s))&&(s=i.substring(t.start.column,t.end.column),/^[\w\d]+$/.test(s))){var l=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:s});return l}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText();return this._signal("copy",e),e},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(e){this.$readOnly||(this._emit("paste",e),this.insert(e))},this.execCommand=function(e,t){this.commands.exec(e,this,t)},this.insert=function(e){var t=this.session,o=t.getMode(),n=this.getCursorPosition();if(this.getBehavioursEnabled()){var i=o.transformAction(t.getState(n.row),"insertion",this,t,e);i&&(e!==i.text&&(this.session.mergeUndoDeltas=!1,this.$mergeNextCommand=!1),e=i.text)}if(" "==e&&(e=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()){var r=new h.fromPoints(n,n);r.end.column+=e.length,this.session.remove(r)}}else{var r=this.getSelectionRange();n=this.session.remove(r),this.clearSelection()}if("\n"==e||"\r\n"==e){var s=t.getLine(n.row);if(n.column>s.search(/\S|$/)){var l=s.substr(n.column).search(/\S|$/);t.doc.removeInLine(n.row,n.column,n.column+l)}}this.clearSelection();{var a=n.column,c=t.getState(n.row),s=t.getLine(n.row),g=o.checkOutdent(c,s,e);t.insert(n,e)}if(i&&i.selection&&(2==i.selection.length?this.selection.setSelectionRange(new h(n.row,a+i.selection[0],n.row,a+i.selection[1])):this.selection.setSelectionRange(new h(n.row+i.selection[0],i.selection[1],n.row+i.selection[2],i.selection[3]))),t.getDocument().isNewLine(e)){var u=o.getNextLineIndent(c,s.slice(0,n.column),t.getTabString());t.insert({row:n.row+1,column:0},u)}g&&o.autoOutdent(c,t,n.row)},this.onTextInput=function(e){this.keyBinding.onTextInput(e)},this.onCommandKey=function(e,t,o){this.keyBinding.onCommandKey(e,t,o)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var o=this.session,n=o.getState(t.start.row),i=o.getMode().transformAction(n,"deletion",this,o,t);if(0==t.end.column){var r=o.getTextRange(t);if("\n"==r[r.length-1]){var s=o.getLine(t.end.row);/^\s+$/.test(s)&&(t.end.column=s.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var o,n,i=this.session.getLine(e.row);t<i.length?(o=i.charAt(t)+i.charAt(t-1),n=new h(e.row,t-1,e.row,t+1)):(o=i.charAt(t-1)+i.charAt(t-2),n=new h(e.row,t-2,e.row,t)),this.session.replace(n,o)}}},this.toLowerCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),o=this.session.getTextRange(t);this.session.replace(t,o.toLowerCase()),this.selection.setSelectionRange(e)},this.toUpperCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),o=this.session.getTextRange(t);this.session.replace(t,o.toUpperCase()),this.selection.setSelectionRange(e)},this.indent=function(){var e=this.session,t=this.getSelectionRange();if(t.start.row<t.end.row){var o=this.$getSelectedRows();return e.indentRows(o.first,o.last," "),void 0}if(t.start.column<t.end.column){var n=e.getTextRange(t);if(!/^\s+$/.test(n)){var o=this.$getSelectedRows();return e.indentRows(o.first,o.last," "),void 0}}var r=e.getLine(t.start.row),s=t.start,l=e.getTabSize(),a=e.documentToScreenColumn(s.row,s.column);if(this.session.getUseSoftTabs())var c=l-a%l,g=i.stringRepeat(" ",c);else{for(var c=a%l;" "==r[t.start.column]&&c;)t.start.column--,c--;this.selection.setSelectionRange(t),g=" "}return this.insert(g)},this.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last," ")},this.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},this.sortLines=function(){var e=this.$getSelectedRows(),t=this.session,o=[];for(i=e.first;i<=e.last;i++)o.push(t.getLine(i));o.sort(function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0});for(var n=new h(0,0,0,0),i=e.first;i<=e.last;i++){var r=t.getLine(i);n.start.row=i,n.end.row=i,n.end.column=r.length,t.replace(n,o[i-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),o=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,o,e)},this.getNumberAt=function(e,t){var o=/[\-]?[0-9]+(?:\.[0-9]+)?/g;o.lastIndex=0;for(var n=this.session.getLine(e);o.lastIndex<t;){var i=o.exec(n);if(i.index<=t&&i.index+i[0].length>=t){var r={value:i[0],start:i.index,end:i.index+i[0].length};return r}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,o=this.selection.getCursor().column,n=new h(t,o-1,t,o),i=this.session.getTextRange(n);if(!isNaN(parseFloat(i))&&isFinite(i)){var r=this.getNumberAt(t,o);if(r){var s=r.value.indexOf(".")>=0?r.start+r.value.indexOf(".")+1:r.end,l=r.start+r.value.length-s,a=parseFloat(r.value);a*=Math.pow(10,l),e*=s!==r.end&&s>o?Math.pow(10,r.end-o-1):Math.pow(10,r.end-o),a+=e,a/=Math.pow(10,l);var c=a.toFixed(l),g=new h(t,r.start,t,r.end);this.session.replace(g,c),this.moveCursorTo(t,Math.max(r.start+1,o+c.length-r.value.length))}}},this.removeLines=function(){var e,t=this.$getSelectedRows();e=0===t.first||t.last+1<this.session.getLength()?new h(t.first,0,t.last+1,0):new h(t.first-1,this.session.getLine(t.first-1).length,t.last,this.session.getLine(t.last).length),this.session.remove(e),this.clearSelection()},this.duplicateSelection=function(){var e=this.selection,t=this.session,o=e.getRange(),n=e.isBackwards();if(o.isEmpty()){var i=o.start.row;t.duplicateLines(i,i)}else{var r=n?o.start:o.end,s=t.insert(r,t.getTextRange(o),!1);o.start=r,o.end=s,e.setSelectionRange(o,n)}},this.moveLinesDown=function(){this.$moveLines(function(e,t){return this.session.moveLinesDown(e,t)})},this.moveLinesUp=function(){this.$moveLines(function(e,t){return this.session.moveLinesUp(e,t)})},this.moveText=function(e,t,o){return this.session.moveText(e,t,o)},this.copyLinesUp=function(){this.$moveLines(function(e,t){return this.session.duplicateLines(e,t),0})},this.copyLinesDown=function(){this.$moveLines(function(e,t){return this.session.duplicateLines(e,t)})},this.$moveLines=function(e){var t=this.selection;if(!t.inMultiSelectMode||this.inVirtualSelectionMode){var o=t.toOrientedRange(),n=this.$getSelectedRows(o),i=e.call(this,n.first,n.last);o.moveBy(i,0),t.fromOrientedRange(o)}else{var r=t.rangeList.ranges;t.rangeList.detach(this.session);for(var s=r.length;s--;){for(var l=s,n=r[s].collapseRows(),a=n.end.row,c=n.start.row;s--;){var n=r[s].collapseRows();if(!(c-n.end.row<=1))break;c=n.end.row}s++;for(var i=e.call(this,c,a);l>=s;)r[l].moveBy(i,0),l--}t.fromOrientedRange(t.ranges[0]),t.rangeList.attach(this.session)}},this.$getSelectedRows=function(){var e=this.getSelectionRange().collapseRows();return{first:e.start.row,last:e.end.row}},this.onCompositionStart=function(){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var o=this.renderer,n=this.renderer.layerConfig,i=e*Math.floor(n.height/n.lineHeight);this.$blockScrolling++,1==t?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):0==t&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection()),this.$blockScrolling--;var r=o.scrollTop;o.scrollBy(0,i*n.lineHeight),null!=t&&o.scrollCursorIntoView(null,.5),o.animateScrolling(r)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,o,n){this.renderer.scrollToLine(e,t,o,n)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())
7
- },this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e){var t=this.getCursorPosition(),o=this.session.getBracketRange(t);if(!o){if(o=this.find({needle:/[{}()\[\]]/g,preventScroll:!0,start:{row:t.row,column:t.column-1}}),!o)return;var n=o.start;n.row==t.row&&Math.abs(n.column-t.column)<2&&(o=this.session.getBracketRange(n))}n=o&&o.cursor||n,n&&(e?o&&o.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(n.row,n.column):(this.clearSelection(),this.moveCursorTo(n.row,n.column)))},this.gotoLine=function(e,t,o){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.$blockScrolling+=1,this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.$blockScrolling-=1,this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,o)},this.navigateTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.navigateUp=function(e){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),e=e||1,this.selection.moveCursorBy(-e,0)},this.navigateDown=function(e){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),e=e||1,this.selection.moveCursorBy(e,0)},this.navigateLeft=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateRight=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){var e=this.renderer.scrollTop;this.selection.moveCursorFileEnd(),this.clearSelection(),this.renderer.animateScrolling(e)},this.navigateFileStart=function(){var e=this.renderer.scrollTop;this.selection.moveCursorFileStart(),this.clearSelection(),this.renderer.animateScrolling(e)},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(e,t){t&&this.$search.set(t);var o=this.$search.find(this.session),n=0;return o?(this.$tryReplace(o,e)&&(n=1),null!==o&&(this.selection.setSelectionRange(o),this.renderer.scrollSelectionIntoView(o.start,o.end)),n):n},this.replaceAll=function(e,t){t&&this.$search.set(t);var o=this.$search.findAll(this.session),n=0;if(!o.length)return n;this.$blockScrolling+=1;var i=this.getSelectionRange();this.clearSelection(),this.selection.moveCursorTo(0,0);for(var r=o.length-1;r>=0;--r)this.$tryReplace(o[r],e)&&n++;return this.selection.setSelectionRange(i),this.$blockScrolling-=1,n},this.$tryReplace=function(e,t){var o=this.session.getTextRange(e);return t=this.$search.replace(o,t),null!==t?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&o.mixin(t,e);var i=this.selection.getRange();null==t.needle&&(e=this.session.getTextRange(i)||this.$search.$options.needle,e||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var r=this.$search.find(this.session);return t.preventScroll?r:r?(this.revealRange(r,n),r):(t.backwards?i.start=i.end:i.end=i.start,this.selection.setRange(i),void 0)},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.$blockScrolling+=1,this.session.unfold(e),this.selection.setSelectionRange(e),this.$blockScrolling-=1;var o=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),0!=t&&this.renderer.animateScrolling(o)},this.undo=function(){this.$blockScrolling++,this.session.getUndoManager().undo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.$blockScrolling++,this.session.getUndoManager().redo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._emit("destroy",this)},this.setAutoScrollEditorIntoView=function(e){if(e!==!1){var t,o=this,n=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var r=this.on("changeSelection",function(){n=!0}),s=this.renderer.on("beforeRender",function(){n&&(t=o.renderer.container.getBoundingClientRect())}),l=this.renderer.on("afterRender",function(){if(n&&t&&o.isFocused()){var e=o.renderer,r=e.$cursorLayer.$pixelPos,s=e.layerConfig,l=r.top-s.offset;n=r.top>=0&&l+t.top<0?!0:r.top<s.height&&r.top+t.top+s.lineHeight>window.innerHeight?!1:null,null!=n&&(i.style.top=l+"px",i.style.left=r.left+"px",i.style.height=s.lineHeight+"px",i.scrollIntoView(n)),n=t=null}});this.setAutoScrollEditorIntoView=function(e){e!==!0&&(delete this.setAutoScrollEditorIntoView,this.removeEventListener("changeSelection",r),this.renderer.removeEventListener("afterRender",l),this.renderer.removeEventListener("beforeRender",s))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking("smooth"==e),t.isBlinking=!this.$readOnly&&"wide"!=e)}}).call(y.prototype),m.defineOptions(y.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._emit("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},cursorStyle:{set:function(){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",showGutter:"renderer",displayIndentGuides:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimout:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",tabSize:"session",wrap:"session",foldStyle:"session"}),t.Editor=y}),define("ace/lib/lang",["require","exports","module"],function(e,t){t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var o="";t>0;)1&t&&(o+=e),(t>>=1)&&(e+=e);return o};var o=/^\s\s*/,n=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(o,"")},t.stringTrimRight=function(e){return e.replace(n,"")},t.copyObject=function(e){var t={};for(var o in e)t[o]=e[o];return t},t.copyArray=function(e){for(var t=[],o=0,n=e.length;n>o;o++)t[o]=e[o]&&"object"==typeof e[o]?this.copyObject(e[o]):e[o];return t},t.deepCopy=function(e){if("object"!=typeof e)return e;var t=e.constructor();for(var o in e)t[o]="object"==typeof e[o]?this.deepCopy(e[o]):e[o];return t},t.arrayToMap=function(e){for(var t={},o=0;o<e.length;o++)t[e[o]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var o in e)t[o]=e[o];return t},t.arrayRemove=function(e,t){for(var o=0;o<=e.length;o++)t===e[o]&&e.splice(o,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return e.replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var o=[];return e.replace(t,function(e){o.push({offset:arguments[arguments.length-2],length:e.length})}),o},t.deferredCall=function(e){var t=null,o=function(){t=null,e()},n=function(e){return n.cancel(),t=setTimeout(o,e||0),n};return n.schedule=n,n.call=function(){return this.cancel(),e(),n},n.cancel=function(){return clearTimeout(t),t=null,n},n},t.delayedCall=function(e,t){var o=null,n=function(){o=null,e()},i=function(e){o&&clearTimeout(o),o=setTimeout(n,e||t)};return i.delay=i,i.schedule=function(e){null==o&&(o=setTimeout(n,e||0))},i.call=function(){this.cancel(),e()},i.cancel=function(){o&&clearTimeout(o),o=null},i.isPending=function(){return o},i}}),define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang"],function(e,t){var o=e("../lib/event"),n=e("../lib/useragent"),i=e("../lib/dom"),r=e("../lib/lang"),s=n.isChrome<18,l=function(e,t){function l(e){if(!f){if(R)t=0,o=e?0:g.value.length-1;else var t=e?2:1,o=2;try{g.setSelectionRange(t,o)}catch(n){}}}function a(){f||(g.value=u,n.isWebKit&&C.schedule())}function c(){setTimeout(function(){m&&(g.style.cssText=m,m=""),null==t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=!0,t.renderer.$moveTextAreaToCursor())},0)}var g=i.createElement("textarea");g.className="ace_text-input",n.isTouchPad&&g.setAttribute("x-palm-disable-auto-cap",!0),g.wrap="off",g.autocorrect="off",g.autocapitalize="off",g.spellcheck=!1,g.style.opacity="0",e.insertBefore(g,e.firstChild);var u="",h=!1,d=!1,p=!1,f=!1,m="",y=!0;try{var _=document.activeElement===g}catch(E){}o.addListener(g,"blur",function(){t.onBlur(),_=!1}),o.addListener(g,"focus",function(){_=!0,t.onFocus(),l()}),this.focus=function(){g.focus()},this.blur=function(){g.blur()},this.isFocused=function(){return _};var v=r.delayedCall(function(){_&&l(y)}),C=r.delayedCall(function(){f||(g.value=u,_&&l())});n.isWebKit||t.addEventListener("changeSelection",function(){t.selection.isEmpty()!=y&&(y=!y,v.schedule())}),a(),_&&t.onFocus();var B=function(e){return 0===e.selectionStart&&e.selectionEnd===e.value.length};if(!g.setSelectionRange&&g.createTextRange&&(g.setSelectionRange=function(e,t){var o=this.createTextRange();o.collapse(!0),o.moveStart("character",e),o.moveEnd("character",t),o.select()},B=function(e){try{var t=e.ownerDocument.selection.createRange()}catch(o){}return t&&t.parentElement()==e?t.text==e.value:!1}),n.isOldIE){var k=!1,b=function(e){if(!k){var t=g.value;if(!f&&t&&t!=u)return e&&t==u[0]?A.schedule():(D(t),k=!0,a(),k=!1,void 0)}},A=r.delayedCall(b);o.addListener(g,"propertychange",b);var T={13:1,27:1};o.addListener(g,"keyup",function(e){return f&&(!g.value||T[e.keyCode])&&setTimeout(x,0),(g.value.charCodeAt(0)||0)<129?A.call():(f?M():N(),void 0)}),o.addListener(g,"keydown",function(){A.schedule(50)})}var S=function(){h?h=!1:d?d=!1:B(g)?(t.selectAll(),l()):R&&l(t.selection.isEmpty())},R=null;this.setInputHandler=function(e){R=e},this.getInputHandler=function(){return R};var I=!1,D=function(e){R&&(e=R(e),R=null),p?(l(),e&&t.onPaste(e),p=!1):e==u.charAt(0)?I&&t.execCommand("del",{source:"ace"}):(e.substring(0,2)==u?e=e.substr(2):e.charAt(0)==u.charAt(0)?e=e.substr(1):e.charAt(e.length-1)==u.charAt(0)&&(e=e.slice(0,-1)),e.charAt(e.length-1)==u.charAt(0)&&(e=e.slice(0,-1)),e&&t.onTextInput(e)),I&&(I=!1)},w=function(){if(!f){var e=g.value;D(e),a()}},L=function(e){var n=t.getCopyText();if(!n)return o.preventDefault(e),void 0;var i=e.clipboardData||window.clipboardData;if(i&&!s){var r=i.setData("Text",n);r&&(t.onCut(),o.preventDefault(e))}r||(h=!0,g.value=n,g.select(),setTimeout(function(){h=!1,a(),l(),t.onCut()}))},F=function(e){var n=t.getCopyText();if(!n)return o.preventDefault(e),void 0;var i=e.clipboardData||window.clipboardData;if(i&&!s){var r=i.setData("Text",n);r&&(t.onCopy(),o.preventDefault(e))}r||(d=!0,g.value=n,g.select(),setTimeout(function(){d=!1,a(),l(),t.onCopy()}))},O=function(e){var i=e.clipboardData||window.clipboardData;if(i){var r=i.getData("Text");r&&t.onPaste(r),n.isIE&&setTimeout(l),o.preventDefault(e)}else g.value="",p=!0};o.addCommandKeyListener(g,t.onCommandKey.bind(t)),o.addListener(g,"select",S),o.addListener(g,"input",w),o.addListener(g,"cut",L),o.addListener(g,"copy",F),o.addListener(g,"paste",O),!("oncut"in g&&"oncopy"in g&&"onpaste"in g||!o.addListener(e,"keydown",function(e){if((!n.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:F(e);break;case 86:O(e);break;case 88:L(e)}}));var N=function(){f||(f={},t.onCompositionStart(),setTimeout(M,0),t.on("mousedown",x),t.selection.isEmpty()||(t.insert(""),t.session.markUndoGroup(),t.selection.clearSelection()),t.session.markUndoGroup())},M=function(){if(f){var e=g.value.replace(/\x01/g,"");if(f.lastValue!==e&&(t.onCompositionUpdate(e),f.lastValue&&t.undo(),f.lastValue=e,f.lastValue)){var o=t.selection.getRange();t.insert(f.lastValue),t.session.markUndoGroup(),f.range=t.selection.getRange(),t.selection.setRange(o),t.selection.clearSelection()}}},x=function(e){var o=f;f=!1;var n=setTimeout(function(){n=null;var e=g.value.replace(/\x01/g,"");f||(e==o.lastValue?a():!o.lastValue&&e&&(a(),D(e)))});R=function(e){return n&&clearTimeout(n),e=e.replace(/\x01/g,""),e==o.lastValue?"":(o.lastValue&&n&&t.undo(),e)},t.onCompositionEnd(),t.removeListener("mousedown",x),"compositionend"==e.type&&o.range&&t.selection.setRange(o.range)},P=r.delayedCall(M,50);if(o.addListener(g,"compositionstart",N),n.isGecko?o.addListener(g,"text",function(){P.schedule()}):(o.addListener(g,"keyup",function(){P.schedule()}),o.addListener(g,"keydown",function(){P.schedule()})),o.addListener(g,"compositionend",x),this.getElement=function(){return g},this.setReadOnly=function(e){g.readOnly=e},this.onContextMenu=function(e){I=!0,m||(m=g.style.cssText),g.style.cssText="z-index:100000;"+(n.isIE?"opacity:0.1;":""),l(t.selection.isEmpty()),t._emit("nativecontextmenu",{target:t,domEvent:e});var r=t.container.getBoundingClientRect(),s=i.computedStyle(t.container),a=r.top+(parseInt(s.borderTopWidth)||0),u=r.left+(parseInt(r.borderLeftWidth)||0),h=r.bottom-a-g.clientHeight,d=function(e){g.style.left=e.clientX-u-2+"px",g.style.top=Math.min(e.clientY-a-2,h)+"px"};d(e),"mousedown"==e.type&&(t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=null),n.isWin&&o.capture(t.container,d,c))},this.onContextMenuClose=c,!n.isGecko||n.isMac){var H=function(e){t.textInput.onContextMenu(e),c()};o.addListener(t.renderer.scroller,"contextmenu",H),o.addListener(g,"contextmenu",H)}};t.TextInput=l}),define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/config"],function(e,t){var o=e("../lib/event"),n=e("../lib/useragent"),i=e("./default_handlers").DefaultHandlers,r=e("./default_gutter_handler").GutterHandler,s=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,a=e("../config"),c=function(e){this.editor=e,new i(this),new r(this),new l(this);var t=e.renderer.getMouseEventTarget();o.addListener(t,"click",this.onMouseEvent.bind(this,"click")),o.addListener(t,"mousemove",this.onMouseMove.bind(this,"mousemove")),o.addMultiMouseDownListener(t,[300,300,250],this,"onMouseEvent"),e.renderer.scrollBarV&&(o.addMultiMouseDownListener(e.renderer.scrollBarV.inner,[300,300,250],this,"onMouseEvent"),o.addMultiMouseDownListener(e.renderer.scrollBarH.inner,[300,300,250],this,"onMouseEvent")),o.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"));var n=e.renderer.$gutter;o.addListener(n,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),o.addListener(n,"click",this.onMouseEvent.bind(this,"gutterclick")),o.addListener(n,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),o.addListener(n,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),o.addListener(t,"mousedown",function(){e.focus()}),o.addListener(n,"mousedown",function(t){return e.focus(),o.preventDefault(t)})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new s(t,this.editor))},this.onMouseMove=function(e,t){var o=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;o&&o.length&&this.editor._emit(e,new s(t,this.editor))},this.onMouseWheel=function(e,t){var o=new s(t,this.editor);o.speed=2*this.$scrollSpeed,o.wheelX=t.wheelX,o.wheelY=t.wheelY,this.editor._emit(e,o)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var i=this.editor.renderer;i.$keepTextAreaAtCursor&&(i.$keepTextAreaAtCursor=null);var r=this,s=function(e){r.x=e.clientX,r.y=e.clientY,t&&t(e)},l=function(e){clearInterval(c),a(),r[r.state+"End"]&&r[r.state+"End"](e),r.$clickSelection=null,null==i.$keepTextAreaAtCursor&&(i.$keepTextAreaAtCursor=!0,i.$moveTextAreaToCursor()),r.isMousePressed=!1,r.onMouseEvent("mouseup",e)},a=function(){r[r.state]&&r[r.state]()};if(n.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout(function(){l(e)});o.capture(this.editor.container,s,l);var c=setInterval(a,20)}}).call(c.prototype),a.defineOptions(c.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:150},dragEnabled:{initialValue:!0},focusTimout:{initialValue:0}}),t.MouseHandler=c}),define("ace/mouse/default_handlers",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t){function o(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));var o=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];o.forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function n(e,t,o,n){return Math.sqrt(Math.pow(o-e,2)+Math.pow(n-t,2))}function i(e,t){if(e.start.row==e.end.row)var o=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)var o=2*t.row-e.start.row-e.end.row;else var o=t.column-4;return 0>o?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var r=(e("../lib/dom"),e("../lib/event"),e("../lib/useragent"),0);(function(){this.onMouseDown=function(e){var t=e.inSelection(),o=e.getDocumentPosition();this.mousedownEvent=e;var n=this.editor,i=e.getButton();if(0!==i){var r=n.getSelectionRange(),s=r.isEmpty();return s&&(n.moveCursorToPosition(o),n.selection.clearSelection()),n.textInput.onContextMenu(e.domEvent),void 0}return!t||n.isFocused()||(n.focus(),!this.$focusTimout||this.$clickSelection||n.inMultiSelectMode)?(!t||this.$clickSelection||e.getShiftKey()||n.inMultiSelectMode?this.startSelect(o):t&&(this.mousedownEvent.time=(new Date).getTime(),this.startSelect(o)),this.captureMouse(e),e.preventDefault()):(this.mousedownEvent.time=(new Date).getTime(),this.setState("focusWait"),this.captureMouse(e),void 0)},this.startSelect=function(e){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var t=this.editor;setTimeout(function(){this.mousedownEvent.getShiftKey()?t.selection.selectToPosition(e):this.$clickSelection||(t.moveCursorToPosition(e),t.selection.clearSelection())}.bind(this),0),t.renderer.scroller.setCapture&&t.renderer.scroller.setCapture(),t.setStyle("ace_selecting"),this.setState("select")},this.select=function(){var e,t=this.editor,o=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(o);if(-1==n)e=this.$clickSelection.end;else if(1==n)e=this.$clickSelection.start;else{var r=i(this.$clickSelection,o);o=r.cursor,e=r.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(o),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,o=this.editor,n=o.renderer.screenToTextCoordinates(this.x,this.y),r=o.selection[e](n.row,n.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(r.start),l=this.$clickSelection.comparePoint(r.end);if(-1==s&&0>=l)t=this.$clickSelection.end,(r.end.row!=n.row||r.end.column!=n.column)&&(n=r.start);else if(1==l&&s>=0)t=this.$clickSelection.start,(r.start.row!=n.row||r.start.column!=n.column)&&(n=r.end);else if(-1==s&&1==l)n=r.end,t=r.start;else{var a=i(this.$clickSelection,n);n=a.cursor,t=a.anchor}o.selection.setSelectionAnchor(t.row,t.column)}o.selection.selectToPosition(n),o.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=(new Date).getTime();(e>r||t-this.mousedownEvent.time>this.$focusTimout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),o=this.editor,n=o.session,i=n.getBracketRange(t);return i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.$clickSelection=i,this.setState("select"),void 0):(this.$clickSelection=o.selection.getWordRange(t.row,t.column),this.setState("selectByWords"),void 0)},this.onTripleClick=function(e){var t=e.getDocumentPosition(),o=this.editor;this.setState("selectByLines"),this.$clickSelection=o.selection.getLineRange(t.row)},this.onQuadClick=function(){var e=this.editor;e.selectAll(),this.$clickSelection=e.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getShiftKey()&&!e.getAccelKey()){var t=e.domEvent.timeStamp,o=t-(this.$lastScrollTime||0),n=this.editor,i=n.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed);return i||200>o?(this.$lastScrollTime=t,n.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(o.prototype),t.DefaultHandlers=o}),define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event"],function(e,t){function o(e){function t(){u=n.createElement("div"),u.className="ace_gutter-tooltip",u.style.display="none",l.container.appendChild(u)}function o(){u||t();var e=g.getDocumentPosition().row,o=a.$annotations[e];if(!o)return r();var n=l.session.getLength();if(e==n){var i=l.renderer.pixelToScreenCoordinates(0,g.y).row,c=g.$pos;if(i>l.session.documentToScreenRow(c.row,c.column))return r()}h!=o&&(h=o.text.join("<br/>"),u.style.display="block",u.innerHTML=h,l.on("mousewheel",r),s(g))}function r(){c&&(c=clearTimeout(c)),h&&(u.style.display="none",h=null,l.removeEventListener("mousewheel",r))}function s(e){var t=l.renderer.$gutter.getBoundingClientRect();if(u.style.left=e.x+15+"px",e.y+3*l.renderer.lineHeight+15<t.bottom)u.style.bottom="",u.style.top=e.y+15+"px";else{u.style.top="";var o=window.innerHeight||document.documentElement.clientHeight;u.style.bottom=o-e.y+5+"px"}}var l=e.editor,a=l.renderer.$gutterLayer;e.editor.setDefaultHandler("guttermousedown",function(t){if(l.isFocused()&&0==t.getButton()){var o=a.getRegion(t);if("foldWidgets"!=o){var n=t.getDocumentPosition().row,i=l.session.selection;if(t.getShiftKey())i.selectTo(n,0);else{if(2==t.domEvent.detail)return l.selectAll(),t.preventDefault();e.$clickSelection=l.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}});var c,g,u,h;e.editor.setDefaultHandler("guttermousemove",function(t){var i=t.domEvent.target||t.domEvent.srcElement;return n.hasCssClass(i,"ace_fold-widget")?r():(h&&s(t),g=t,c||(c=setTimeout(function(){c=null,g&&!e.isMousePressed?o():r()},50)),void 0)}),i.addListener(l.renderer.$gutter,"mouseout",function(){g=null,h&&!c&&(c=setTimeout(function(){c=null,r()},50))}),l.on("changeSession",r)}var n=e("../lib/dom"),i=e("../lib/event");t.GutterHandler=o}),define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t){var o=e("../lib/event"),n=e("../lib/useragent"),i=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){o.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){o.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var o=this.getDocumentPosition();this.$inSelection=t.contains(o.row,o.column)}return this.$inSelection},this.getButton=function(){return o.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=n.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(i.prototype)}),define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t){function o(e){function t(e,t){var o=(new Date).getTime(),i=!t||e.row!=t.row,r=!t||e.column!=t.column;if(!R||i||r)m.$blockScrolling+=1,m.moveCursorToPosition(e),m.$blockScrolling-=1,R=o,I={x:v,y:C};else{var s=n(I.x,I.y,v,C);s>c?R=null:o-R>=a&&(m.renderer.scrollCursorIntoView(),R=null)}}function o(e,t){var o=(new Date).getTime(),n=m.renderer.layerConfig.lineHeight,i=m.renderer.layerConfig.characterWidth,r=m.renderer.scroller.getBoundingClientRect(),s={x:{left:v-r.left,right:r.right-v},y:{top:C-r.top,bottom:r.bottom-C}},a=Math.min(s.x.left,s.x.right),c=Math.min(s.y.top,s.y.bottom),g={row:e.row,column:e.column};2>=a/i&&(g.column+=s.x.left<s.x.right?-3:2),1>=c/n&&(g.row+=s.y.top<s.y.bottom?-1:1);var u=e.row!=g.row,h=e.column!=g.column,d=!t||e.row!=t.row;u||h&&!d?S?o-S>=l&&m.renderer.scrollCursorIntoView(g):S=o:S=null}function g(){var e=b;b=m.renderer.screenToTextCoordinates(v,C),t(b,e),o(b,e)}function u(){k=m.selection.toOrientedRange(),E=m.session.addMarker(k,"ace_selection",m.getSelectionStyle()),m.clearSelection(),m.isFocused()&&m.renderer.$cursorLayer.setBlinking(!1),clearInterval(B),B=setInterval(g,20),w=0,r.addListener(document,"mousemove",d)}function h(){clearInterval(B),m.session.removeMarker(E),E=null,m.$blockScrolling+=1,m.selection.fromOrientedRange(k),m.$blockScrolling-=1,m.isFocused()&&!T&&m.renderer.$cursorLayer.setBlinking(!m.getReadOnly()),k=null,w=0,S=null,R=null,r.removeListener(document,"mousemove",d)}function d(){null==L&&(L=setTimeout(function(){null!=L&&E&&h()},20))}function p(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function f(e){var t=["copy","copymove","all","uninitialized"],o=["move","copymove","linkmove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,i="uninitialized";try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var r="none";return n&&t.indexOf(i)>=0?r="copy":o.indexOf(i)>=0?r="move":t.indexOf(i)>=0&&(r="copy"),r}var m=e.editor,y=i.createElement("img");y.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(y.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");var _=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];_.forEach(function(t){e[t]=this[t]},this),m.addEventListener("mousedown",this.onMouseDown.bind(e));var E,v,C,B,k,b,A,T,S,R,I,D=m.container,w=0;this.onDragStart=function(e){if(this.cancelDrag||!D.draggable){var t=this;return setTimeout(function(){t.startSelect(),t.captureMouse(e)},0),e.preventDefault()}k=m.getSelectionRange();var o=e.dataTransfer;o.effectAllowed=m.getReadOnly()?"copy":"copyMove",s.isOpera&&(m.container.appendChild(y),y._top=y.offsetTop),o.setDragImage&&o.setDragImage(y,0,0),s.isOpera&&m.container.removeChild(y),o.clearData(),o.setData("Text",m.session.getTextRange()),T=!0,this.setState("drag")},this.onDragEnd=function(e){if(D.draggable=!1,T=!1,this.setState(null),!m.getReadOnly()){var t=e.dataTransfer.dropEffect;!A&&"move"==t&&m.session.remove(m.getSelectionRange()),m.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging")},this.onDragEnter=function(e){return!m.getReadOnly()&&p(e.dataTransfer)?(E||u(),w++,e.dataTransfer.dropEffect=A=f(e),r.preventDefault(e)):void 0},this.onDragOver=function(e){return!m.getReadOnly()&&p(e.dataTransfer)?(E||(u(),w++),null!==L&&(L=null),v=e.clientX,C=e.clientY,e.dataTransfer.dropEffect=A=f(e),r.preventDefault(e)):void 0},this.onDragLeave=function(e){return w--,0>=w&&E?(h(),A=null,r.preventDefault(e)):void 0},this.onDrop=function(e){if(E){var t=e.dataTransfer;if(T)switch(A){case"move":k=k.contains(b.row,b.column)?{start:b,end:b}:m.moveText(k,b);break;case"copy":k=m.moveText(k,b,!0)}else{var o=t.getData("Text");k={start:b,end:m.session.insert(b,o)},m.focus(),A=null}return h(),r.preventDefault(e)}},r.addListener(D,"dragstart",this.onDragStart.bind(e)),r.addListener(D,"dragend",this.onDragEnd.bind(e)),r.addListener(D,"dragenter",this.onDragEnter.bind(e)),r.addListener(D,"dragover",this.onDragOver.bind(e)),r.addListener(D,"dragleave",this.onDragLeave.bind(e)),r.addListener(D,"drop",this.onDrop.bind(e));var L=null}function n(e,t,o,n){return Math.sqrt(Math.pow(o-e,2)+Math.pow(n-t,2))}var i=e("../lib/dom"),r=e("../lib/event"),s=e("../lib/useragent"),l=200,a=200,c=5;(function(){this.dragWait=function(){var e=(new Date).getTime()-this.mousedownEvent.time;e>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor.container;e.draggable=!0,this.editor.renderer.$cursorLayer.setBlinking(!1),this.editor.setStyle("ace_dragging"),this.setState("dragReady")},this.onMouseDrag=function(){var e=this.editor.container;if(s.isIE&&"dragReady"==this.state){var t=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);t>3&&e.dragDrop()}if("dragWait"===this.state){var t=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);t>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,o=e.inSelection(),n=e.getButton(),i=e.domEvent.detail||1;if(1===i&&0===n&&o){this.mousedownEvent.time=(new Date).getTime();var r=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in r&&(r.unselectable="on"),t.getDragDelay()){if(s.isWebKit){self.cancelDrag=!0;var l=t.container;l.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/event_emitter"],function(e,t,o){"no use strict";function n(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}var i=e("./lib/lang"),r=e("./lib/oop"),s=e("./lib/net"),l=e("./lib/event_emitter").EventEmitter,a=function(){return this}(),c={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{}};t.get=function(e){if(!c.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return c[e]},t.set=function(e,t){if(!c.hasOwnProperty(e))throw new Error("Unknown config key: "+e);
7
+ },this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e){var t=this.getCursorPosition(),o=this.session.getBracketRange(t);if(!o){if(o=this.find({needle:/[{}()\[\]]/g,preventScroll:!0,start:{row:t.row,column:t.column-1}}),!o)return;var n=o.start;n.row==t.row&&Math.abs(n.column-t.column)<2&&(o=this.session.getBracketRange(n))}n=o&&o.cursor||n,n&&(e?o&&o.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(n.row,n.column):(this.clearSelection(),this.moveCursorTo(n.row,n.column)))},this.gotoLine=function(e,t,o){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.$blockScrolling+=1,this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.$blockScrolling-=1,this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,o)},this.navigateTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.navigateUp=function(e){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),e=e||1,this.selection.moveCursorBy(-e,0)},this.navigateDown=function(e){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),e=e||1,this.selection.moveCursorBy(e,0)},this.navigateLeft=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateRight=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){var e=this.renderer.scrollTop;this.selection.moveCursorFileEnd(),this.clearSelection(),this.renderer.animateScrolling(e)},this.navigateFileStart=function(){var e=this.renderer.scrollTop;this.selection.moveCursorFileStart(),this.clearSelection(),this.renderer.animateScrolling(e)},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(e,t){t&&this.$search.set(t);var o=this.$search.find(this.session),n=0;return o?(this.$tryReplace(o,e)&&(n=1),null!==o&&(this.selection.setSelectionRange(o),this.renderer.scrollSelectionIntoView(o.start,o.end)),n):n},this.replaceAll=function(e,t){t&&this.$search.set(t);var o=this.$search.findAll(this.session),n=0;if(!o.length)return n;this.$blockScrolling+=1;var i=this.getSelectionRange();this.clearSelection(),this.selection.moveCursorTo(0,0);for(var r=o.length-1;r>=0;--r)this.$tryReplace(o[r],e)&&n++;return this.selection.setSelectionRange(i),this.$blockScrolling-=1,n},this.$tryReplace=function(e,t){var o=this.session.getTextRange(e);return t=this.$search.replace(o,t),null!==t?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&o.mixin(t,e);var i=this.selection.getRange();null==t.needle&&(e=this.session.getTextRange(i)||this.$search.$options.needle,e||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var r=this.$search.find(this.session);return t.preventScroll?r:r?(this.revealRange(r,n),r):(t.backwards?i.start=i.end:i.end=i.start,this.selection.setRange(i),void 0)},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.$blockScrolling+=1,this.session.unfold(e),this.selection.setSelectionRange(e),this.$blockScrolling-=1;var o=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),0!=t&&this.renderer.animateScrolling(o)},this.undo=function(){this.$blockScrolling++,this.session.getUndoManager().undo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.$blockScrolling++,this.session.getUndoManager().redo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._emit("destroy",this)},this.setAutoScrollEditorIntoView=function(e){if(e!==!1){var t,o=this,n=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var r=this.on("changeSelection",function(){n=!0}),s=this.renderer.on("beforeRender",function(){n&&(t=o.renderer.container.getBoundingClientRect())}),l=this.renderer.on("afterRender",function(){if(n&&t&&o.isFocused()){var e=o.renderer,r=e.$cursorLayer.$pixelPos,s=e.layerConfig,l=r.top-s.offset;n=r.top>=0&&l+t.top<0?!0:r.top<s.height&&r.top+t.top+s.lineHeight>window.innerHeight?!1:null,null!=n&&(i.style.top=l+"px",i.style.left=r.left+"px",i.style.height=s.lineHeight+"px",i.scrollIntoView(n)),n=t=null}});this.setAutoScrollEditorIntoView=function(e){e!==!0&&(delete this.setAutoScrollEditorIntoView,this.removeEventListener("changeSelection",r),this.renderer.removeEventListener("afterRender",l),this.renderer.removeEventListener("beforeRender",s))}}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking("smooth"==e),t.isBlinking=!this.$readOnly&&"wide"!=e)}}).call(y.prototype),m.defineOptions(y.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._emit("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},cursorStyle:{set:function(){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",showGutter:"renderer",displayIndentGuides:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimout:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",tabSize:"session",wrap:"session",foldStyle:"session"}),t.Editor=y}),define("ace/lib/lang",["require","exports","module"],function(e,t){t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var o="";t>0;)1&t&&(o+=e),(t>>=1)&&(e+=e);return o};var o=/^\s\s*/,n=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(o,"")},t.stringTrimRight=function(e){return e.replace(n,"")},t.copyObject=function(e){var t={};for(var o in e)t[o]=e[o];return t},t.copyArray=function(e){for(var t=[],o=0,n=e.length;n>o;o++)t[o]=e[o]&&"object"==typeof e[o]?this.copyObject(e[o]):e[o];return t},t.deepCopy=function(e){if("object"!=typeof e)return e;var t=e.constructor();for(var o in e)t[o]="object"==typeof e[o]?this.deepCopy(e[o]):e[o];return t},t.arrayToMap=function(e){for(var t={},o=0;o<e.length;o++)t[e[o]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var o in e)t[o]=e[o];return t},t.arrayRemove=function(e,t){for(var o=0;o<=e.length;o++)t===e[o]&&e.splice(o,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return e.replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var o=[];return e.replace(t,function(e){o.push({offset:arguments[arguments.length-2],length:e.length})}),o},t.deferredCall=function(e){var t=null,o=function(){t=null,e()},n=function(e){return n.cancel(),t=setTimeout(o,e||0),n};return n.schedule=n,n.call=function(){return this.cancel(),e(),n},n.cancel=function(){return clearTimeout(t),t=null,n},n},t.delayedCall=function(e,t){var o=null,n=function(){o=null,e()},i=function(e){o&&clearTimeout(o),o=setTimeout(n,e||t)};return i.delay=i,i.schedule=function(e){null==o&&(o=setTimeout(n,e||0))},i.call=function(){this.cancel(),e()},i.cancel=function(){o&&clearTimeout(o),o=null},i.isPending=function(){return o},i}}),define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang"],function(e,t){var o=e("../lib/event"),n=e("../lib/useragent"),i=e("../lib/dom"),r=e("../lib/lang"),s=n.isChrome<18,l=function(e,t){function l(e){if(!f){if(R)t=0,o=e?0:g.value.length-1;else var t=e?2:1,o=2;try{g.setSelectionRange(t,o)}catch(n){}}}function a(){f||(g.value=u,n.isWebKit&&C.schedule())}function c(){setTimeout(function(){m&&(g.style.cssText=m,m=""),null==t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=!0,t.renderer.$moveTextAreaToCursor())},0)}var g=i.createElement("textarea");g.className="ace_text-input",n.isTouchPad&&g.setAttribute("x-palm-disable-auto-cap",!0),g.wrap="off",g.autocorrect="off",g.autocapitalize="off",g.spellcheck=!1,g.style.opacity="0",e.insertBefore(g,e.firstChild);var u="",h=!1,d=!1,p=!1,f=!1,m="",y=!0;try{var _=document.activeElement===g}catch(E){}o.addListener(g,"blur",function(){t.onBlur(),_=!1}),o.addListener(g,"focus",function(){_=!0,t.onFocus(),l()}),this.focus=function(){g.focus()},this.blur=function(){g.blur()},this.isFocused=function(){return _};var v=r.delayedCall(function(){_&&l(y)}),C=r.delayedCall(function(){f||(g.value=u,_&&l())});n.isWebKit||t.addEventListener("changeSelection",function(){t.selection.isEmpty()!=y&&(y=!y,v.schedule())}),a(),_&&t.onFocus();var B=function(e){return 0===e.selectionStart&&e.selectionEnd===e.value.length};if(!g.setSelectionRange&&g.createTextRange&&(g.setSelectionRange=function(e,t){var o=this.createTextRange();o.collapse(!0),o.moveStart("character",e),o.moveEnd("character",t),o.select()},B=function(e){try{var t=e.ownerDocument.selection.createRange()}catch(o){}return t&&t.parentElement()==e?t.text==e.value:!1}),n.isOldIE){var k=!1,b=function(e){if(!k){var t=g.value;if(!f&&t&&t!=u)return e&&t==u[0]?A.schedule():(D(t),k=!0,a(),k=!1,void 0)}},A=r.delayedCall(b);o.addListener(g,"propertychange",b);var T={13:1,27:1};o.addListener(g,"keyup",function(e){return f&&(!g.value||T[e.keyCode])&&setTimeout(x,0),(g.value.charCodeAt(0)||0)<129?A.call():(f?M():O(),void 0)}),o.addListener(g,"keydown",function(){A.schedule(50)})}var S=function(){h?h=!1:d?d=!1:B(g)?(t.selectAll(),l()):R&&l(t.selection.isEmpty())},R=null;this.setInputHandler=function(e){R=e},this.getInputHandler=function(){return R};var I=!1,D=function(e){R&&(e=R(e),R=null),p?(l(),e&&t.onPaste(e),p=!1):e==u.charAt(0)?I&&t.execCommand("del",{source:"ace"}):(e.substring(0,2)==u?e=e.substr(2):e.charAt(0)==u.charAt(0)?e=e.substr(1):e.charAt(e.length-1)==u.charAt(0)&&(e=e.slice(0,-1)),e.charAt(e.length-1)==u.charAt(0)&&(e=e.slice(0,-1)),e&&t.onTextInput(e)),I&&(I=!1)},w=function(){if(!f){var e=g.value;D(e),a()}},L=function(e){var n=t.getCopyText();if(!n)return o.preventDefault(e),void 0;var i=e.clipboardData||window.clipboardData;if(i&&!s){var r=i.setData("Text",n);r&&(t.onCut(),o.preventDefault(e))}r||(h=!0,g.value=n,g.select(),setTimeout(function(){h=!1,a(),l(),t.onCut()}))},F=function(e){var n=t.getCopyText();if(!n)return o.preventDefault(e),void 0;var i=e.clipboardData||window.clipboardData;if(i&&!s){var r=i.setData("Text",n);r&&(t.onCopy(),o.preventDefault(e))}r||(d=!0,g.value=n,g.select(),setTimeout(function(){d=!1,a(),l(),t.onCopy()}))},N=function(e){var i=e.clipboardData||window.clipboardData;if(i){var r=i.getData("Text");r&&t.onPaste(r),n.isIE&&setTimeout(l),o.preventDefault(e)}else g.value="",p=!0};o.addCommandKeyListener(g,t.onCommandKey.bind(t)),o.addListener(g,"select",S),o.addListener(g,"input",w),o.addListener(g,"cut",L),o.addListener(g,"copy",F),o.addListener(g,"paste",N),!("oncut"in g&&"oncopy"in g&&"onpaste"in g||!o.addListener(e,"keydown",function(e){if((!n.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:F(e);break;case 86:N(e);break;case 88:L(e)}}));var O=function(){f||(f={},t.onCompositionStart(),setTimeout(M,0),t.on("mousedown",x),t.selection.isEmpty()||(t.insert(""),t.session.markUndoGroup(),t.selection.clearSelection()),t.session.markUndoGroup())},M=function(){if(f){var e=g.value.replace(/\x01/g,"");if(f.lastValue!==e&&(t.onCompositionUpdate(e),f.lastValue&&t.undo(),f.lastValue=e,f.lastValue)){var o=t.selection.getRange();t.insert(f.lastValue),t.session.markUndoGroup(),f.range=t.selection.getRange(),t.selection.setRange(o),t.selection.clearSelection()}}},x=function(e){var o=f;f=!1;var n=setTimeout(function(){n=null;var e=g.value.replace(/\x01/g,"");f||(e==o.lastValue?a():!o.lastValue&&e&&(a(),D(e)))});R=function(e){return n&&clearTimeout(n),e=e.replace(/\x01/g,""),e==o.lastValue?"":(o.lastValue&&n&&t.undo(),e)},t.onCompositionEnd(),t.removeListener("mousedown",x),"compositionend"==e.type&&o.range&&t.selection.setRange(o.range)},P=r.delayedCall(M,50);if(o.addListener(g,"compositionstart",O),n.isGecko?o.addListener(g,"text",function(){P.schedule()}):(o.addListener(g,"keyup",function(){P.schedule()}),o.addListener(g,"keydown",function(){P.schedule()})),o.addListener(g,"compositionend",x),this.getElement=function(){return g},this.setReadOnly=function(e){g.readOnly=e},this.onContextMenu=function(e){I=!0,m||(m=g.style.cssText),g.style.cssText="z-index:100000;"+(n.isIE?"opacity:0.1;":""),l(t.selection.isEmpty()),t._emit("nativecontextmenu",{target:t,domEvent:e});var r=t.container.getBoundingClientRect(),s=i.computedStyle(t.container),a=r.top+(parseInt(s.borderTopWidth)||0),u=r.left+(parseInt(r.borderLeftWidth)||0),h=r.bottom-a-g.clientHeight,d=function(e){g.style.left=e.clientX-u-2+"px",g.style.top=Math.min(e.clientY-a-2,h)+"px"};d(e),"mousedown"==e.type&&(t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=null),n.isWin&&o.capture(t.container,d,c))},this.onContextMenuClose=c,!n.isGecko||n.isMac){var H=function(e){t.textInput.onContextMenu(e),c()};o.addListener(t.renderer.scroller,"contextmenu",H),o.addListener(g,"contextmenu",H)}};t.TextInput=l}),define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/config"],function(e,t){var o=e("../lib/event"),n=e("../lib/useragent"),i=e("./default_handlers").DefaultHandlers,r=e("./default_gutter_handler").GutterHandler,s=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,a=e("../config"),c=function(e){this.editor=e,new i(this),new r(this),new l(this);var t=e.renderer.getMouseEventTarget();o.addListener(t,"click",this.onMouseEvent.bind(this,"click")),o.addListener(t,"mousemove",this.onMouseMove.bind(this,"mousemove")),o.addMultiMouseDownListener(t,[300,300,250],this,"onMouseEvent"),e.renderer.scrollBarV&&(o.addMultiMouseDownListener(e.renderer.scrollBarV.inner,[300,300,250],this,"onMouseEvent"),o.addMultiMouseDownListener(e.renderer.scrollBarH.inner,[300,300,250],this,"onMouseEvent")),o.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"));var n=e.renderer.$gutter;o.addListener(n,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),o.addListener(n,"click",this.onMouseEvent.bind(this,"gutterclick")),o.addListener(n,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),o.addListener(n,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),o.addListener(t,"mousedown",function(){e.focus()}),o.addListener(n,"mousedown",function(t){return e.focus(),o.preventDefault(t)})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new s(t,this.editor))},this.onMouseMove=function(e,t){var o=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;o&&o.length&&this.editor._emit(e,new s(t,this.editor))},this.onMouseWheel=function(e,t){var o=new s(t,this.editor);o.speed=2*this.$scrollSpeed,o.wheelX=t.wheelX,o.wheelY=t.wheelY,this.editor._emit(e,o)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var i=this.editor.renderer;i.$keepTextAreaAtCursor&&(i.$keepTextAreaAtCursor=null);var r=this,s=function(e){r.x=e.clientX,r.y=e.clientY,t&&t(e)},l=function(e){clearInterval(c),a(),r[r.state+"End"]&&r[r.state+"End"](e),r.$clickSelection=null,null==i.$keepTextAreaAtCursor&&(i.$keepTextAreaAtCursor=!0,i.$moveTextAreaToCursor()),r.isMousePressed=!1,r.onMouseEvent("mouseup",e)},a=function(){r[r.state]&&r[r.state]()};if(n.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout(function(){l(e)});o.capture(this.editor.container,s,l);var c=setInterval(a,20)}}).call(c.prototype),a.defineOptions(c.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:150},dragEnabled:{initialValue:!0},focusTimout:{initialValue:0}}),t.MouseHandler=c}),define("ace/mouse/default_handlers",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t){function o(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));var o=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];o.forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function n(e,t,o,n){return Math.sqrt(Math.pow(o-e,2)+Math.pow(n-t,2))}function i(e,t){if(e.start.row==e.end.row)var o=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)var o=2*t.row-e.start.row-e.end.row;else var o=t.column-4;return 0>o?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var r=(e("../lib/dom"),e("../lib/event"),e("../lib/useragent"),0);(function(){this.onMouseDown=function(e){var t=e.inSelection(),o=e.getDocumentPosition();this.mousedownEvent=e;var n=this.editor,i=e.getButton();if(0!==i){var r=n.getSelectionRange(),s=r.isEmpty();return s&&(n.moveCursorToPosition(o),n.selection.clearSelection()),n.textInput.onContextMenu(e.domEvent),void 0}return!t||n.isFocused()||(n.focus(),!this.$focusTimout||this.$clickSelection||n.inMultiSelectMode)?(!t||this.$clickSelection||e.getShiftKey()||n.inMultiSelectMode?this.startSelect(o):t&&(this.mousedownEvent.time=(new Date).getTime(),this.startSelect(o)),this.captureMouse(e),e.preventDefault()):(this.mousedownEvent.time=(new Date).getTime(),this.setState("focusWait"),this.captureMouse(e),void 0)},this.startSelect=function(e){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var t=this.editor;setTimeout(function(){this.mousedownEvent.getShiftKey()?t.selection.selectToPosition(e):this.$clickSelection||(t.moveCursorToPosition(e),t.selection.clearSelection())}.bind(this),0),t.renderer.scroller.setCapture&&t.renderer.scroller.setCapture(),t.setStyle("ace_selecting"),this.setState("select")},this.select=function(){var e,t=this.editor,o=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(o);if(-1==n)e=this.$clickSelection.end;else if(1==n)e=this.$clickSelection.start;else{var r=i(this.$clickSelection,o);o=r.cursor,e=r.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(o),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,o=this.editor,n=o.renderer.screenToTextCoordinates(this.x,this.y),r=o.selection[e](n.row,n.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(r.start),l=this.$clickSelection.comparePoint(r.end);if(-1==s&&0>=l)t=this.$clickSelection.end,(r.end.row!=n.row||r.end.column!=n.column)&&(n=r.start);else if(1==l&&s>=0)t=this.$clickSelection.start,(r.start.row!=n.row||r.start.column!=n.column)&&(n=r.end);else if(-1==s&&1==l)n=r.end,t=r.start;else{var a=i(this.$clickSelection,n);n=a.cursor,t=a.anchor}o.selection.setSelectionAnchor(t.row,t.column)}o.selection.selectToPosition(n),o.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=(new Date).getTime();(e>r||t-this.mousedownEvent.time>this.$focusTimout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),o=this.editor,n=o.session,i=n.getBracketRange(t);return i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.$clickSelection=i,this.setState("select"),void 0):(this.$clickSelection=o.selection.getWordRange(t.row,t.column),this.setState("selectByWords"),void 0)},this.onTripleClick=function(e){var t=e.getDocumentPosition(),o=this.editor;this.setState("selectByLines"),this.$clickSelection=o.selection.getLineRange(t.row)},this.onQuadClick=function(){var e=this.editor;e.selectAll(),this.$clickSelection=e.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getShiftKey()&&!e.getAccelKey()){var t=e.domEvent.timeStamp,o=t-(this.$lastScrollTime||0),n=this.editor,i=n.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed);return i||200>o?(this.$lastScrollTime=t,n.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(o.prototype),t.DefaultHandlers=o}),define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event"],function(e,t){function o(e){function t(){u=n.createElement("div"),u.className="ace_gutter-tooltip",u.style.display="none",l.container.appendChild(u)}function o(){u||t();var e=g.getDocumentPosition().row,o=a.$annotations[e];if(!o)return r();var n=l.session.getLength();if(e==n){var i=l.renderer.pixelToScreenCoordinates(0,g.y).row,c=g.$pos;if(i>l.session.documentToScreenRow(c.row,c.column))return r()}h!=o&&(h=o.text.join("<br/>"),u.style.display="block",u.innerHTML=h,l.on("mousewheel",r),s(g))}function r(){c&&(c=clearTimeout(c)),h&&(u.style.display="none",h=null,l.removeEventListener("mousewheel",r))}function s(e){var t=l.renderer.$gutter.getBoundingClientRect();if(u.style.left=e.x+15+"px",e.y+3*l.renderer.lineHeight+15<t.bottom)u.style.bottom="",u.style.top=e.y+15+"px";else{u.style.top="";var o=window.innerHeight||document.documentElement.clientHeight;u.style.bottom=o-e.y+5+"px"}}var l=e.editor,a=l.renderer.$gutterLayer;e.editor.setDefaultHandler("guttermousedown",function(t){if(l.isFocused()&&0==t.getButton()){var o=a.getRegion(t);if("foldWidgets"!=o){var n=t.getDocumentPosition().row,i=l.session.selection;if(t.getShiftKey())i.selectTo(n,0);else{if(2==t.domEvent.detail)return l.selectAll(),t.preventDefault();e.$clickSelection=l.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}});var c,g,u,h;e.editor.setDefaultHandler("guttermousemove",function(t){var i=t.domEvent.target||t.domEvent.srcElement;return n.hasCssClass(i,"ace_fold-widget")?r():(h&&s(t),g=t,c||(c=setTimeout(function(){c=null,g&&!e.isMousePressed?o():r()},50)),void 0)}),i.addListener(l.renderer.$gutter,"mouseout",function(){g=null,h&&!c&&(c=setTimeout(function(){c=null,r()},50))}),l.on("changeSession",r)}var n=e("../lib/dom"),i=e("../lib/event");t.GutterHandler=o}),define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t){var o=e("../lib/event"),n=e("../lib/useragent"),i=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){o.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){o.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var o=this.getDocumentPosition();this.$inSelection=t.contains(o.row,o.column)}return this.$inSelection},this.getButton=function(){return o.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=n.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(i.prototype)}),define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t){function o(e){function t(e,t){var o=(new Date).getTime(),i=!t||e.row!=t.row,r=!t||e.column!=t.column;if(!R||i||r)m.$blockScrolling+=1,m.moveCursorToPosition(e),m.$blockScrolling-=1,R=o,I={x:v,y:C};else{var s=n(I.x,I.y,v,C);s>c?R=null:o-R>=a&&(m.renderer.scrollCursorIntoView(),R=null)}}function o(e,t){var o=(new Date).getTime(),n=m.renderer.layerConfig.lineHeight,i=m.renderer.layerConfig.characterWidth,r=m.renderer.scroller.getBoundingClientRect(),s={x:{left:v-r.left,right:r.right-v},y:{top:C-r.top,bottom:r.bottom-C}},a=Math.min(s.x.left,s.x.right),c=Math.min(s.y.top,s.y.bottom),g={row:e.row,column:e.column};2>=a/i&&(g.column+=s.x.left<s.x.right?-3:2),1>=c/n&&(g.row+=s.y.top<s.y.bottom?-1:1);var u=e.row!=g.row,h=e.column!=g.column,d=!t||e.row!=t.row;u||h&&!d?S?o-S>=l&&m.renderer.scrollCursorIntoView(g):S=o:S=null}function g(){var e=b;b=m.renderer.screenToTextCoordinates(v,C),t(b,e),o(b,e)}function u(){k=m.selection.toOrientedRange(),E=m.session.addMarker(k,"ace_selection",m.getSelectionStyle()),m.clearSelection(),m.isFocused()&&m.renderer.$cursorLayer.setBlinking(!1),clearInterval(B),B=setInterval(g,20),w=0,r.addListener(document,"mousemove",d)}function h(){clearInterval(B),m.session.removeMarker(E),E=null,m.$blockScrolling+=1,m.selection.fromOrientedRange(k),m.$blockScrolling-=1,m.isFocused()&&!T&&m.renderer.$cursorLayer.setBlinking(!m.getReadOnly()),k=null,w=0,S=null,R=null,r.removeListener(document,"mousemove",d)}function d(){null==L&&(L=setTimeout(function(){null!=L&&E&&h()},20))}function p(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function f(e){var t=["copy","copymove","all","uninitialized"],o=["move","copymove","linkmove","all","uninitialized"],n=s.isMac?e.altKey:e.ctrlKey,i="uninitialized";try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var r="none";return n&&t.indexOf(i)>=0?r="copy":o.indexOf(i)>=0?r="move":t.indexOf(i)>=0&&(r="copy"),r}var m=e.editor,y=i.createElement("img");y.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(y.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");var _=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];_.forEach(function(t){e[t]=this[t]},this),m.addEventListener("mousedown",this.onMouseDown.bind(e));var E,v,C,B,k,b,A,T,S,R,I,D=m.container,w=0;this.onDragStart=function(e){if(this.cancelDrag||!D.draggable){var t=this;return setTimeout(function(){t.startSelect(),t.captureMouse(e)},0),e.preventDefault()}k=m.getSelectionRange();var o=e.dataTransfer;o.effectAllowed=m.getReadOnly()?"copy":"copyMove",s.isOpera&&(m.container.appendChild(y),y._top=y.offsetTop),o.setDragImage&&o.setDragImage(y,0,0),s.isOpera&&m.container.removeChild(y),o.clearData(),o.setData("Text",m.session.getTextRange()),T=!0,this.setState("drag")},this.onDragEnd=function(e){if(D.draggable=!1,T=!1,this.setState(null),!m.getReadOnly()){var t=e.dataTransfer.dropEffect;!A&&"move"==t&&m.session.remove(m.getSelectionRange()),m.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging")},this.onDragEnter=function(e){return!m.getReadOnly()&&p(e.dataTransfer)?(E||u(),w++,e.dataTransfer.dropEffect=A=f(e),r.preventDefault(e)):void 0},this.onDragOver=function(e){return!m.getReadOnly()&&p(e.dataTransfer)?(E||(u(),w++),null!==L&&(L=null),v=e.clientX,C=e.clientY,e.dataTransfer.dropEffect=A=f(e),r.preventDefault(e)):void 0},this.onDragLeave=function(e){return w--,0>=w&&E?(h(),A=null,r.preventDefault(e)):void 0},this.onDrop=function(e){if(E){var t=e.dataTransfer;if(T)switch(A){case"move":k=k.contains(b.row,b.column)?{start:b,end:b}:m.moveText(k,b);break;case"copy":k=m.moveText(k,b,!0)}else{var o=t.getData("Text");k={start:b,end:m.session.insert(b,o)},m.focus(),A=null}return h(),r.preventDefault(e)}},r.addListener(D,"dragstart",this.onDragStart.bind(e)),r.addListener(D,"dragend",this.onDragEnd.bind(e)),r.addListener(D,"dragenter",this.onDragEnter.bind(e)),r.addListener(D,"dragover",this.onDragOver.bind(e)),r.addListener(D,"dragleave",this.onDragLeave.bind(e)),r.addListener(D,"drop",this.onDrop.bind(e));var L=null}function n(e,t,o,n){return Math.sqrt(Math.pow(o-e,2)+Math.pow(n-t,2))}var i=e("../lib/dom"),r=e("../lib/event"),s=e("../lib/useragent"),l=200,a=200,c=5;(function(){this.dragWait=function(){var e=(new Date).getTime()-this.mousedownEvent.time;e>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor.container;e.draggable=!0,this.editor.renderer.$cursorLayer.setBlinking(!1),this.editor.setStyle("ace_dragging"),this.setState("dragReady")},this.onMouseDrag=function(){var e=this.editor.container;if(s.isIE&&"dragReady"==this.state){var t=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);t>3&&e.dragDrop()}if("dragWait"===this.state){var t=n(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);t>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,o=e.inSelection(),n=e.getButton(),i=e.domEvent.detail||1;if(1===i&&0===n&&o){this.mousedownEvent.time=(new Date).getTime();var r=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in r&&(r.unselectable="on"),t.getDragDelay()){if(s.isWebKit){self.cancelDrag=!0;var l=t.container;l.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(o.prototype),t.DragdropHandler=o}),define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/event_emitter"],function(e,t,o){"no use strict";function n(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}var i=e("./lib/lang"),r=e("./lib/oop"),s=e("./lib/net"),l=e("./lib/event_emitter").EventEmitter,a=function(){return this}(),c={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{}};t.get=function(e){if(!c.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return c[e]},t.set=function(e,t){if(!c.hasOwnProperty(e))throw new Error("Unknown config key: "+e);
8
8
  c[e]=t},t.all=function(){return i.copyObject(c)},r.implement(t,l),t.moduleUrl=function(e,t){if(c.$moduleUrls[e])return c.$moduleUrls[e];var o=e.split("/");t=t||o[o.length-2]||"";var n="snippets"==t?"/":"-",i=o[o.length-1];if("-"==n){var r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");i=i.replace(r,"")}(!i||i==t)&&o.length>1&&(i=o[o.length-2]);var s=c[t+"Path"];return null==s?s=c.basePath:"/"==n&&(t=n=""),s&&"/"!=s.slice(-1)&&(s+="/"),s+t+n+i+this.get("suffix")},t.setModuleUrl=function(e,t){return c.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(o,n){var i,r;Array.isArray(o)&&(r=o[0],o=o[1]);try{i=e(o)}catch(l){}if(i&&!t.$loading[o])return n&&n(i);if(t.$loading[o]||(t.$loading[o]=[]),t.$loading[o].push(n),!(t.$loading[o].length>1)){var a=function(){e([o],function(e){t._emit("load.module",{name:o,module:e});var n=t.$loading[o];t.$loading[o]=null,n.forEach(function(t){t&&t(e)})})};return t.get("packaged")?(s.loadScript(t.moduleUrl(o,r),a),void 0):a()}},t.init=function(){if(c.packaged=e.packaged||o.packaged||a.define&&define.packaged,!a.document)return"";for(var i={},r="",s=document.getElementsByTagName("script"),l=0;l<s.length;l++){var g=s[l],u=g.src||g.getAttribute("src");if(u){for(var h=g.attributes,d=0,p=h.length;p>d;d++){var f=h[d];0===f.name.indexOf("data-ace-")&&(i[n(f.name.replace(/^data-ace-/,""))]=f.value)}var m=u.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);m&&(r=m[1])}}r&&(i.base=i.base||r,i.packaged=!0),i.basePath=i.base,i.workerPath=i.workerPath||i.base,i.modePath=i.modePath||i.base,i.themePath=i.themePath||i.base,delete i.base;for(var y in i)"undefined"!=typeof i[y]&&t.set(y,i[y])};var g={setOptions:function(e){Object.keys(e).forEach(function(t){this.setOption(t,e[t])},this)},getOptions:function(e){var t={};return e?Array.isArray(e)||(t=e,e=Object.keys(t)):e=Object.keys(this.$options),e.forEach(function(e){t[e]=this.getOption(e)},this),t},setOption:function(e,t){if(this["$"+e]!==t){var o=this.$options[e];return o?o.forwardTo?this[o.forwardTo]&&this[o.forwardTo].setOption(e,t):(o.handlesSet||(this["$"+e]=t),o&&o.set&&o.set.call(this,t),void 0):("undefined"!=typeof console&&console.warn&&console.warn('misspelled option "'+e+'"'),void 0)}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:("undefined"!=typeof console&&console.warn&&console.warn('misspelled option "'+e+'"'),void 0)}},u={};t.defineOptions=function(e,t,o){return e.$options||(u[t]=e.$options={}),Object.keys(o).forEach(function(t){var n=o[t];"string"==typeof n&&(n={forwardTo:n}),n.name||(n.name=t),e.$options[n.name]=n,"initialValue"in n&&(e["$"+n.name]=n.initialValue)}),r.implement(e,g),this},t.resetOptions=function(e){Object.keys(e.$options).forEach(function(t){var o=e.$options[t];"value"in o&&e.setOption(t,o.value)})},t.setDefaultValue=function(e,o,n){var i=u[e]||(u[e]={});i[o]&&(i.forwardTo?t.setDefaultValue(i.forwardTo,o,n):i[o].value=n)},t.setDefaultValues=function(e,o){Object.keys(o).forEach(function(n){t.setDefaultValue(e,n,o[n])})}}),define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t){var o=e("./dom");t.get=function(e,t){var o=new XMLHttpRequest;o.open("GET",e,!0),o.onreadystatechange=function(){4===o.readyState&&t(o.responseText)},o.send(null)},t.loadScript=function(e,t){var n=o.getDocumentHead(),i=document.createElement("script");i.src=e,n.appendChild(i),i.onload=i.onreadystatechange=function(e,o){(o||!i.readyState||"loaded"==i.readyState||"complete"==i.readyState)&&(i=i.onload=i.onreadystatechange=null,o||t())}}}),define("ace/lib/event_emitter",["require","exports","module"],function(e,t){var o={},n=function(){this.propagationStopped=!0},i=function(){this.defaultPrevented=!0};o._emit=o._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var o=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(o.length||r){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=n),t.preventDefault||(t.preventDefault=i),o=o.slice();for(var s=0;s<o.length&&(o[s](t,this),!t.propagationStopped);s++);return r&&!t.defaultPrevented?r(t,this):void 0}},o._signal=function(e,t){var o=(this._eventRegistry||{})[e];if(o){o=o.slice();for(var n=0;n<o.length;n++)o[n](t,this)}},o.once=function(e,t){var o=this;t&&this.addEventListener(e,function n(){o.removeEventListener(e,n),t.apply(null,arguments)})},o.setDefaultHandler=function(e,t){var o=this._defaultHandlers;if(o||(o=this._defaultHandlers={_disabled_:{}}),o[e]){var n=o[e],i=o._disabled_[e];i||(o._disabled_[e]=i=[]),i.push(n);var r=i.indexOf(t);-1!=r&&i.splice(r,1)}o[e]=t},o.removeDefaultHandler=function(e,t){var o=this._defaultHandlers;if(o){var n=o._disabled_[e];if(o[e]==t){{o[e]}n&&this.setDefaultHandler(e,n.pop())}else if(n){var i=n.indexOf(t);-1!=i&&n.splice(i,1)}}},o.on=o.addEventListener=function(e,t,o){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];return n||(n=this._eventRegistry[e]=[]),-1==n.indexOf(t)&&n[o?"unshift":"push"](t),t},o.off=o.removeListener=o.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[e];if(o){var n=o.indexOf(t);-1!==n&&o.splice(n,1)}},o.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=o}),define("ace/mouse/fold_handler",["require","exports","module"],function(e,t){function o(e){e.on("click",function(t){var o=t.getDocumentPosition(),n=e.session,i=n.getFoldAt(o.row,o.column,1);i&&(t.getAccelKey()?n.removeFold(i):n.expandFold(i),t.stop())}),e.on("gutterclick",function(t){var o=e.renderer.$gutterLayer.getRegion(t);if("foldWidgets"==o){var n=t.getDocumentPosition().row,i=e.session;i.foldWidgets&&i.foldWidgets[n]&&e.session.onFoldWidgetClick(n,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){var o=e.renderer.$gutterLayer.getRegion(t);if("foldWidgets"==o){var n=t.getDocumentPosition().row,i=e.session,r=i.getParentFoldRangeData(n,!0),s=r.range||r.firstRange;if(s){var n=s.start.row,l=i.getFoldAt(n,i.getLine(n).length,1);l?i.removeFold(l):(i.addFold("...",s),e.renderer.scrollCursorIntoView({row:s.start.row,column:0}))}t.stop()}})}t.FoldHandler=o}),define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t){var o=e("../lib/keys"),n=e("../lib/event"),i=function(e){this.$editor=e,this.$data={},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0),this.$data={editor:this.$editor}},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},this.addKeyboardHandler=function(e,t){if(e){var o=this.$handlers.indexOf(e);-1!=o&&this.$handlers.splice(o,1),void 0==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==o&&e.attach&&e.attach(this.$editor)}},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1==t?!1:(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.$callKeyboardHandlers=function(e,t,o,i){for(var r,s=!1,l=this.$editor.commands,a=this.$handlers.length;a--&&(r=this.$handlers[a].handleKeyboard(this.$data,e,t,o,i),!(r&&r.command&&(s="null"==r.command?!0:l.exec(r.command,this.$editor,r.args,i),s&&i&&-1!=e&&1!=r.passEvent&&1!=r.command.passEvent&&n.stopEvent(i),s))););return s},this.onCommandKey=function(e,t,n){var i=o.keyCodeToString(n);this.$callKeyboardHandlers(t,i,n,e)},this.onTextInput=function(e){var t=this.$callKeyboardHandlers(-1,e);t||this.$editor.commands.exec("insertstring",this.$editor,e)}}).call(i.prototype),t.KeyBinding=i}),define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],function(e,t){var o=e("./lib/oop"),n=e("./lib/lang"),i=e("./config"),r=e("./lib/event_emitter").EventEmitter,s=e("./selection").Selection,l=e("./mode/text").Mode,a=e("./range").Range,c=e("./document").Document,g=e("./background_tokenizer").BackgroundTokenizer,u=e("./search_highlight").SearchHighlight,h=function(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.$foldData.toString=function(){return this.join("\n")},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new c(e)),this.setDocument(e),this.selection=new s(this),i.resetOptions(this),this.setMode(t),i._emit("session",this)};(function(){function t(e){return 4352>e?!1:e>=4352&&4447>=e||e>=4515&&4519>=e||e>=4602&&4607>=e||e>=9001&&9002>=e||e>=11904&&11929>=e||e>=11931&&12019>=e||e>=12032&&12245>=e||e>=12272&&12283>=e||e>=12288&&12350>=e||e>=12353&&12438>=e||e>=12441&&12543>=e||e>=12549&&12589>=e||e>=12593&&12686>=e||e>=12688&&12730>=e||e>=12736&&12771>=e||e>=12784&&12830>=e||e>=12832&&12871>=e||e>=12880&&13054>=e||e>=13056&&19903>=e||e>=19968&&42124>=e||e>=42128&&42182>=e||e>=43360&&43388>=e||e>=44032&&55203>=e||e>=55216&&55238>=e||e>=55243&&55291>=e||e>=63744&&64255>=e||e>=65040&&65049>=e||e>=65072&&65106>=e||e>=65108&&65126>=e||e>=65128&&65131>=e||e>=65281&&65376>=e||e>=65504&&65510>=e}o.implement(this,r),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),this.doc=e,e.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e)return this.$docRowCache=[],this.$screenRowCache=[],void 0;var t=this.$docRowCache.length,o=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>o&&(this.$docRowCache.splice(o,t),this.$screenRowCache.splice(o,t))},this.$getRowCacheIndex=function(e,t){for(var o=0,n=e.length-1;n>=o;){var i=o+n>>1,r=e[i];if(t>r)o=i+1;else{if(!(r>t))return i;n=i-1}}return o-1},this.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.bgTokenizer&&this.bgTokenizer.start(0)},this.onChangeFold=function(e){var t=e.data;this.$resetRowCache(t.start.row)},this.onChange=function(e){var t=e.data;this.$modified=!0,this.$resetRowCache(t.range.start.row);var o=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&!t.ignore&&(this.$deltasDoc.push(t),o&&0!=o.length&&this.$deltasFold.push({action:"removeFolds",folds:o}),this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(t),this._emit("change",e)},this.setValue=function(e){this.doc.setValue(e),this.selection.moveCursorTo(0,0),this.selection.clearSelection(),this.$resetRowCache(0),this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(e){return this.bgTokenizer.getState(e)},this.getTokens=function(e){return this.bgTokenizer.getTokens(e)},this.getTokenAt=function(e,t){var o,n=this.bgTokenizer.getTokens(e),i=0;if(null==t)r=n.length-1,i=this.getLine(e).length;else for(var r=0;r<n.length&&(i+=n[r].value.length,!(i>=t));r++);return o=n[r],o?(o.index=r,o.start=i-o.value.length,o):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.$deltasFold.length&&(t.$deltas.push({group:"fold",deltas:t.$deltasFold}),t.$deltasFold=[]),t.$deltasDoc.length&&(t.$deltas.push({group:"doc",deltas:t.$deltasDoc}),t.$deltasDoc=[]),t.$deltas.length>0&&e.execute({action:"aceupdate",args:[t.$deltas,t],merge:t.mergeUndoDeltas}),t.mergeUndoDeltas=!1,t.$deltas=[]},this.$informUndoManager=n.delayedCall(this.$syncInformUndoManager)}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?n.stringRepeat(" ",this.getTabSize()):" "},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._emit("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._emit("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]="ace_breakpoint";this._emit("changeBreakpoint",{})},this.clearBreakpoints=function(){this.$breakpoints=[],this._emit("changeBreakpoint",{})},this.setBreakpoint=function(e,t){void 0===t&&(t="ace_breakpoint"),t?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._emit("changeBreakpoint",{})},this.clearBreakpoint=function(e){delete this.$breakpoints[e],this._emit("changeBreakpoint",{})},this.addMarker=function(e,t,o,n){var i=this.$markerId++,r={range:e,type:o||"line",renderer:"function"==typeof o?o:null,clazz:t,inFront:!!n,id:i};return n?(this.$frontMarkers[i]=r,this._emit("changeFrontMarker")):(this.$backMarkers[i]=r,this._emit("changeBackMarker")),i},this.addDynamicMarker=function(e,t){if(e.update){var o=this.$markerId++;return e.id=o,e.inFront=!!t,t?(this.$frontMarkers[o]=e,this._emit("changeFrontMarker")):(this.$backMarkers[o]=e,this._emit("changeBackMarker")),e}},this.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];if(t){var o=t.inFront?this.$frontMarkers:this.$backMarkers;t&&(delete o[e],this._emit(t.inFront?"changeFrontMarker":"changeBackMarker"))}},this.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},this.highlight=function(e){if(!this.$searchHighlight){var t=new u(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)},this.highlightLines=function(e,t,o,n){"number"!=typeof t&&(o=t,t=e),o||(o="ace_step");var i=new a(e,0,t,1/0);return i.id=this.addMarker(i,o,"fullLine",n),i},this.setAnnotations=function(e){this.$annotations=e,this._emit("changeAnnotation",{})},this.getAnnotations=function(){return this.$annotations||[]},this.clearAnnotations=function(){this.setAnnotations([])},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r?\n)/m);this.$autoNewLine=t?t[1]:"\n"},this.getWordRange=function(e,t){var o=this.getLine(e),n=!1;if(t>0&&(n=!!o.charAt(t-1).match(this.tokenRe)),n||(n=!!o.charAt(t).match(this.tokenRe)),n)var i=this.tokenRe;else if(/^\s+$/.test(o.slice(t-1,t+1)))var i=/\s/;else var i=this.nonTokenRe;var r=t;if(r>0){do r--;while(r>=0&&o.charAt(r).match(i));r++}for(var s=t;s<o.length&&o.charAt(s).match(i);)s++;return new a(e,r,e,s)},this.getAWordRange=function(e,t){for(var o=this.getWordRange(e,t),n=this.getLine(o.end.row);n.charAt(o.end.column).match(/[ \t]/);)o.end.column+=1;return o},this.setNewLineMode=function(e){this.doc.setNewLineMode(e)},this.getNewLineMode=function(){return this.doc.getNewLineMode()},this.setUseWorker=function(e){this.setOption("useWorker",e)},this.getUseWorker=function(){return this.$useWorker},this.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._emit("tokenizerUpdate",e)},this.$modes={},this.$mode=null,this.$modeId=null,this.setMode=function(e,t){if(e&&"object"==typeof e){if(e.getTokenizer)return this.$onChangeMode(e);var o=e,n=o.path}else n=e||"ace/mode/text";return this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new l),this.$modes[n]&&!o?(this.$onChangeMode(this.$modes[n]),t&&t(),void 0):(this.$modeId=n,i.loadModule(["mode",n],function(e){return this.$modeId!==n?t&&t():this.$modes[n]&&!o?this.$onChangeMode(this.$modes[n]):(e&&e.Mode&&(e=new e.Mode(o),o||(this.$modes[n]=e,e.$id=n),this.$onChangeMode(e),t&&t()),void 0)}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0),void 0)},this.$onChangeMode=function(e,t){if(t||(this.$modeId=e.$id),this.$mode!==e){this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker();var o=e.getTokenizer();if(void 0!==o.addEventListener){var n=this.onReloadTokenizer.bind(this);o.addEventListener("update",n)}if(this.bgTokenizer)this.bgTokenizer.setTokenizer(o);else{this.bgTokenizer=new g(o);var i=this;this.bgTokenizer.addEventListener("update",function(e){i._emit("tokenizerUpdate",e)})}this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,this.$options.wrapMethod.set.call(this,this.$wrapMethod),t||(this.$setFolding(e.foldingRules),this._emit("changeMode"),this.bgTokenizer.start(0))}},this.$stopWorker=function(){this.$worker&&this.$worker.terminate(),this.$worker=null},this.$startWorker=function(){if("undefined"==typeof Worker||e.noWorker)this.$worker=null;else try{this.$worker=this.$mode.createWorker(this)}catch(t){console.log("Could not load worker"),console.log(t),this.$worker=null}},this.getMode=function(){return this.$mode},this.$scrollTop=0,this.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},this.getScrollTop=function(){return this.$scrollTop},this.$scrollLeft=0,this.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},this.getScrollLeft=function(){return this.$scrollLeft},this.getScreenWidth=function(){return this.$computeWidth(),this.screenWidth},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),o=this.$rowLengthCache,n=0,i=0,r=this.$foldData[i],s=r?r.start.row:1/0,l=t.length,a=0;l>a;a++){if(a>s){if(a=r.end.row+1,a>=l)break;r=this.$foldData[i++],s=r?r.start.row:1/0}null==o[a]&&(o[a]=this.$getStringScreenWidth(t[a])[0]),o[a]>n&&(n=o[a])}this.screenWidth=n}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var o=null,n=e.length-1;-1!=n;n--){var i=e[n];"doc"==i.group?(this.doc.revertDeltas(i.deltas),o=this.$getUndoSelection(i.deltas,!0,o)):i.deltas.forEach(function(e){this.addFolds(e.folds)},this)}return this.$fromUndo=!1,o&&this.$undoSelect&&!t&&this.selection.setSelectionRange(o),o}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var o=null,n=0;n<e.length;n++){var i=e[n];"doc"==i.group&&(this.doc.applyDeltas(i.deltas),o=this.$getUndoSelection(i.deltas,!1,o))}return this.$fromUndo=!1,o&&this.$undoSelect&&!t&&this.selection.setSelectionRange(o),o}},this.setUndoSelect=function(e){this.$undoSelect=e},this.$getUndoSelection=function(e,t,o){function n(e){var o="insertText"===e.action||"insertLines"===e.action;return t?!o:o}var i,r,s=e[0],l=!1;n(s)?(i=a.fromPoints(s.range.start,s.range.end),l=!0):(i=a.fromPoints(s.range.start,s.range.start),l=!1);for(var c=1;c<e.length;c++)s=e[c],n(s)?(r=s.range.start,-1==i.compare(r.row,r.column)&&i.setStart(s.range.start),r=s.range.end,1==i.compare(r.row,r.column)&&i.setEnd(s.range.end),l=!0):(r=s.range.start,-1==i.compare(r.row,r.column)&&(i=a.fromPoints(s.range.start,s.range.start)),l=!1);if(null!=o){0==a.comparePoints(o.start,i.start)&&(o.start.column+=i.end.column-i.start.column,o.end.column+=i.end.column-i.start.column);var g=o.compareRange(i);1==g?i.setStart(o.start):-1==g&&i.setEnd(o.end)}return i},this.replace=function(e,t){return this.doc.replace(e,t)},this.moveText=function(e,t,o){var n=this.getTextRange(e),i=this.getFoldsInRange(e),r=a.fromPoints(t,t);if(!o){this.remove(e);var s=e.start.row-e.end.row,l=s?-e.end.column:e.start.column-e.end.column;l&&(r.start.row==e.end.row&&r.start.column>e.end.column&&(r.start.column+=l),r.end.row==e.end.row&&r.end.column>e.end.column&&(r.end.column+=l)),s&&r.start.row>=e.end.row&&(r.start.row+=s,r.end.row+=s)}if(r.end=this.insert(r.start,n),i.length){var c=e.start,g=r.start,s=g.row-c.row,l=g.column-c.column;this.addFolds(i.map(function(e){return e=e.clone(),e.start.row==c.row&&(e.start.column+=l),e.end.row==c.row&&(e.end.column+=l),e.start.row+=s,e.end.row+=s,e}))}return r},this.indentRows=function(e,t,o){o=o.replace(/\t/g,this.getTabString());for(var n=e;t>=n;n++)this.insert({row:n,column:0},o)},this.outdentRows=function(e){for(var t=e.collapseRows(),o=new a(0,0,0,0),n=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var r=this.getLine(i);o.start.row=i,o.end.row=i;for(var s=0;n>s&&" "==r.charAt(s);++s);n>s&&" "==r.charAt(s)?(o.start.column=s,o.end.column=s+1):(o.start.column=0,o.end.column=s),this.remove(o)}},this.$moveLines=function(e,t,o){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),0>o){var n=this.getRowFoldStart(e+o);if(0>n)return 0;var i=n-e}else if(o>0){var n=this.getRowFoldEnd(t+o);if(n>this.doc.getLength()-1)return 0;var i=n-t}else{e=this.$clipRowToDocument(e),t=this.$clipRowToDocument(t);var i=t-e+1}var r=new a(e,0,t,Number.MAX_VALUE),s=this.getFoldsInRange(r).map(function(e){return e=e.clone(),e.start.row+=i,e.end.row+=i,e}),l=0==o?this.doc.getLines(e,t):this.doc.removeLines(e,t);return this.doc.insertLines(e+i,l),s.length&&this.addFolds(s),i},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return 0>t?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),0>e)e=0,t=0;else{var o=this.doc.getLength();e>=o?(e=o-1,t=this.doc.getLine(o-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=[];for(var o=0;t>o;o++)this.$wrapData.push([]);this.$updateWrapData(0,t-1)}this._emit("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){(this.$wrapLimitRange.min!==e||this.$wrapLimitRange.max!==t)&&(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this._emit("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var o=this.$wrapLimitRange;o.max<0&&(o={min:t,max:t});var n=this.$constrainWrapLimit(e,o.min,o.max);return n!=this.$wrapLimit&&n>1?(this.$wrapLimit=n,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._emit("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(e,t,o){return t&&(e=Math.max(t,e)),o&&(e=Math.min(o,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t,o=this.$useWrapMode,n=e.data.action,i=e.data.range.start.row,r=e.data.range.end.row,s=e.data.range.start,l=e.data.range.end,a=null;if(-1!=n.indexOf("Lines")?(r="insertLines"==n?i+e.data.lines.length:i,t=e.data.lines?e.data.lines.length:r-i):t=r-i,this.$updating=!0,0!=t)if(-1!=n.indexOf("remove")){this[o?"$wrapData":"$rowLengthCache"].splice(i,t);var c=this.$foldData;a=this.getFoldsInRange(e.data.range),this.removeFolds(a);var g=this.getFoldLine(l.row),u=0;if(g){g.addRemoveChars(l.row,l.column,s.column-l.column),g.shiftRow(-t);var h=this.getFoldLine(i);h&&h!==g&&(h.merge(g),g=h),u=c.indexOf(g)+1}for(u;u<c.length;u++){var g=c[u];g.start.row>=l.row&&g.shiftRow(-t)}r=i}else{var d;if(o){d=[i,0];for(var p=0;t>p;p++)d.push([]);this.$wrapData.splice.apply(this.$wrapData,d)}else d=Array(t),d.unshift(i,0),this.$rowLengthCache.splice.apply(this.$rowLengthCache,d);var c=this.$foldData,g=this.getFoldLine(i),u=0;if(g){var f=g.range.compareInside(s.row,s.column);0==f?(g=g.split(s.row,s.column),g.shiftRow(t),g.addRemoveChars(r,0,l.column-s.column)):-1==f&&(g.addRemoveChars(i,0,l.column-s.column),g.shiftRow(t)),u=c.indexOf(g)+1}for(u;u<c.length;u++){var g=c[u];g.start.row>=i&&g.shiftRow(t)}}else{t=Math.abs(e.data.range.start.column-e.data.range.end.column),-1!=n.indexOf("remove")&&(a=this.getFoldsInRange(e.data.range),this.removeFolds(a),t=-t);var g=this.getFoldLine(i);g&&g.addRemoveChars(i,s.column,t)}return o&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,o?this.$updateWrapData(i,r):this.$updateRowLengthCache(i,r),a},this.$updateRowLengthCache=function(e,t){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,t){var o,n,i=this.doc.getAllLines(),r=this.getTabSize(),s=this.$wrapData,l=this.$wrapLimit,a=e;for(t=Math.min(t,i.length-1);t>=a;)n=this.getFoldLine(a,n),n?(o=[],n.walk(function(e,t,n,r){var s;if(null!=e){s=this.$getDisplayTokens(e,o.length),s[0]=h;for(var l=1;l<s.length;l++)s[l]=d}else s=this.$getDisplayTokens(i[t].substring(r,n),o.length);o=o.concat(s)}.bind(this),n.end.row,i[n.end.row].length+1),s[n.start.row]=this.$computeWrapSplits(o,l,r),a=n.end.row+1):(o=this.$getDisplayTokens(i[a]),s[a]=this.$computeWrapSplits(o,l,r),a++)};var s=1,c=2,h=3,d=4,p=9,f=10,m=11,y=12;this.$computeWrapSplits=function(e,t){function o(t){var o=e.slice(r,t),i=o.length;o.join("").replace(/12/g,function(){i-=1}).replace(/2/g,function(){i-=1}),s+=i,n.push(s),r=t}if(0==e.length)return[];for(var n=[],i=e.length,r=0,s=0,l=this.$wrapAsCode;i-r>t;){var a=r+t;if(e[a-1]>=f&&e[a]>=f)o(a);else if(e[a]!=h&&e[a]!=d){for(var c=Math.max(a-(l?10:t-(t>>2)),r-1);a>c&&e[a]<h;)a--;if(l){for(;a>c&&e[a]<h;)a--;for(;a>c&&e[a]==p;)a--}else for(;a>c&&e[a]<f;)a--;a>c?o(++a):(a=r+t,o(a))}else{for(a;a!=r-1&&e[a]!=h;a--);if(a>r){o(a);continue}for(a=r+t;a<e.length&&e[a]==d;a++);if(a==e.length)break;o(a)}}return n},this.$getDisplayTokens=function(e,o){var n,i=[];o=o||0;for(var r=0;r<e.length;r++){var l=e.charCodeAt(r);if(9==l){n=this.getScreenTabSize(i.length+o),i.push(m);for(var a=1;n>a;a++)i.push(y)}else 32==l?i.push(f):l>39&&48>l||l>57&&64>l?i.push(p):l>=4352&&t(l)?i.push(s,c):i.push(s)}return i},this.$getStringScreenWidth=function(e,o,n){if(0==o)return[0,0];null==o&&(o=1/0),n=n||0;var i,r;for(r=0;r<e.length&&(i=e.charCodeAt(r),n+=9==i?this.getScreenTabSize(n):i>=4352&&t(i)?2:1,!(n>o));r++);return[n,r]},this.getRowLength=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getScreenLastRowColumn=function(e){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);return this.documentToScreenColumn(t.row,t.column)},this.getDocumentLastRowColumn=function(e,t){var o=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(o)},this.getDocumentLastRowColumnPosition=function(e,t){var o=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(o,Number.MAX_VALUE/10)},this.getRowSplitData=function(e){return this.$useWrapMode?this.$wrapData[e]:void 0},this.getScreenTabSize=function(e){return this.$tabSize-e%this.$tabSize},this.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},this.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},this.screenToDocumentPosition=function(e,t){if(0>e)return{row:0,column:0};var o,n,i=0,r=0,s=0,l=0,a=this.$screenRowCache,c=this.$getRowCacheIndex(a,e),g=a.length;if(g&&c>=0)var s=a[c],i=this.$docRowCache[c],u=e>a[g-1];else var u=!g;for(var h=this.getLength()-1,d=this.getNextFoldLine(i),p=d?d.start.row:1/0;e>=s&&(l=this.getRowLength(i),!(s+l-1>=e||i>=h));)s+=l,i++,i>p&&(i=d.end.row+1,d=this.getNextFoldLine(i,d),p=d?d.start.row:1/0),u&&(this.$docRowCache.push(i),this.$screenRowCache.push(s));if(d&&d.start.row<=i)o=this.getFoldDisplayLine(d),i=d.start.row;else{if(e>=s+l||i>h)return{row:h,column:this.getLine(h).length};o=this.getLine(i),d=null}if(this.$useWrapMode){var f=this.$wrapData[i];f&&(n=f[e-s],e>s&&f.length&&(r=f[e-s-1]||f[f.length-1],o=o.substring(r)))}return r+=this.$getStringScreenWidth(o,t)[1],this.$useWrapMode&&r>=n&&(r=n-1),d?d.idxToPosition(r):{row:i,column:r}},this.documentToScreenPosition=function(e,t){if("undefined"==typeof t)var o=this.$clipPositionToDocument(e.row,e.column);else o=this.$clipPositionToDocument(e,t);e=o.row,t=o.column;var n=0,i=null,r=null;r=this.getFoldAt(e,t,1),r&&(e=r.start.row,t=r.start.column);var s,l=0,a=this.$docRowCache,c=this.$getRowCacheIndex(a,e),g=a.length;if(g&&c>=0)var l=a[c],n=this.$screenRowCache[c],u=e>a[g-1];else var u=!g;for(var h=this.getNextFoldLine(l),d=h?h.start.row:1/0;e>l;){if(l>=d){if(s=h.end.row+1,s>e)break;h=this.getNextFoldLine(s,h),d=h?h.start.row:1/0}else s=l+1;n+=this.getRowLength(l),l=s,u&&(this.$docRowCache.push(l),this.$screenRowCache.push(n))}var p="";if(h&&l>=d?(p=this.getFoldDisplayLine(h,e,t),i=h.start.row):(p=this.getLine(e).substring(0,t),i=e),this.$useWrapMode){for(var f=this.$wrapData[i],m=0;p.length>=f[m];)n++,m++;p=p.substring(f[m-1]||0,p.length)}return{row:n,column:this.$getStringScreenWidth(p)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var o=this.$wrapData.length,n=0,i=0,t=this.$foldData[i++],r=t?t.start.row:1/0;o>n;)e+=this.$wrapData[n].length+1,n++,n>r&&(n=t.end.row+1,t=this.$foldData[i++],r=t?t.start.row:1/0);else{e=this.getLength();for(var s=this.$foldData,i=0;i<s.length;i++)t=s[i],e-=t.end.row-t.start.row}return e}}).call(h.prototype),e("./edit_session/folding").Folding.call(h.prototype),e("./edit_session/bracket_match").BracketMatch.call(h.prototype),i.defineOptions(h.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e){if(e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1);this.$wrap=e}},get:function(){return this.getUseWrapMode()?this.getWrapLimitRange().min||"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){this.$wrapAsCode="auto"==e?"text"!=this.$mode.type:"text"!=e},initialValue:"auto"},firstLineNumber:{set:function(){this._emit("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){isNaN(e)||this.$tabSize===e||(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._emit("changeTabSize"))},initialValue:4,handlesSet:!0},overwrite:{set:function(){this._emit("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0}}),t.EditSession=h}),define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t){var o=e("./lib/oop"),n=e("./lib/lang"),i=e("./lib/event_emitter").EventEmitter,r=e("./range").Range,s=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.lead=this.selectionLead=this.doc.createAnchor(0,0),this.anchor=this.selectionAnchor=this.doc.createAnchor(0,0);
9
9
  var t=this;this.lead.on("change",function(e){t._emit("changeCursor"),t.$isEmpty||t._emit("changeSelection"),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.selectionAnchor.on("change",function(){t.$isEmpty||t._emit("changeSelection")})};(function(){o.implement(this,i),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return this.isEmpty()?!1:this.getRange().isMultiLine()},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.anchor.setPosition(e,t),this.$isEmpty&&(this.$isEmpty=!1,this._emit("changeSelection"))},this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.shiftSelection=function(e){if(this.$isEmpty)return this.moveCursorTo(this.lead.row,this.lead.column+e),void 0;var t=this.getSelectionAnchor(),o=this.getSelectionLead(),n=this.isBackwards();(!n||0!==t.column)&&this.setSelectionAnchor(t.row,t.column+e),(n||0!==o.column)&&this.$moveSelection(function(){this.moveCursorTo(o.row,o.column+e)})},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.isEmpty()?r.fromPoints(t,t):this.isBackwards()?r.fromPoints(t,e):r.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var e=this.doc.getLength()-1;this.setSelectionAnchor(0,0),this.moveCursorTo(e,this.doc.getLine(e).length)},this.setRange=this.setSelectionRange=function(e,t){t?(this.setSelectionAnchor(e.end.row,e.end.column),this.selectTo(e.start.row,e.start.column)):(this.setSelectionAnchor(e.start.row,e.start.column),this.selectTo(e.end.row,e.end.column)),this.getRange().isEmpty()&&(this.$isEmpty=!0),this.$desiredColumn=null},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if("undefined"==typeof t){var o=e||this.lead;e=o.row,t=o.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var o,n="number"==typeof e?e:this.lead.row,i=this.session.getFoldLine(n);return i?(n=i.start.row,o=i.end.row):o=n,t===!0?new r(n,0,o,this.session.getLine(o).length):new r(n,0,o+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0==t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var o=this.session.getTabSize();this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(t.column-o,t.column).split(" ").length-1==o?this.moveCursorBy(0,-o):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var o=this.session.getTabSize(),t=this.lead;this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(t.column,t.column+o).split(" ").length-1==o?this.moveCursorBy(0,o):this.moveCursorBy(0,1)}},this.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,o=this.session.documentToScreenRow(e,t),n=this.session.screenToDocumentPosition(o,0),i=this.session.getDisplayLine(e,null,n.row,n.column),r=i.match(/^\s*/);r[0].length!=t&&!this.session.$useEmacsStyleLineStart&&(n.column+=r[0].length),this.moveCursorToPosition(n)},this.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var o=this.session.getLine(t.row);if(t.column==o.length){var n=o.search(/\s+$/);n>0&&(t.column=n)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e,t=this.lead.row,o=this.lead.column,n=this.doc.getLine(t),i=n.substring(o);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(t,o,1);return r?(this.moveCursorTo(r.end.row,r.end.column),void 0):((e=this.session.nonTokenRe.exec(i))&&(o+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=n.substring(o)),o>=n.length?(this.moveCursorTo(t,n.length),this.moveCursorRight(),t<this.doc.getLength()-1&&this.moveCursorWordRight(),void 0):((e=this.session.tokenRe.exec(i))&&(o+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,o),void 0))},this.moveCursorLongWordLeft=function(){var e,t=this.lead.row,o=this.lead.column;if(e=this.session.getFoldAt(t,o,-1))return this.moveCursorTo(e.start.row,e.start.column),void 0;var i=this.session.getFoldStringAt(t,o,-1);null==i&&(i=this.doc.getLine(t).substring(0,o));var r,s=n.stringReverse(i);return this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,(r=this.session.nonTokenRe.exec(s))&&(o-=this.session.nonTokenRe.lastIndex,s=s.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),0>=o?(this.moveCursorTo(t,0),this.moveCursorLeft(),t>0&&this.moveCursorWordLeft(),void 0):((r=this.session.tokenRe.exec(s))&&(o-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,o),void 0)},this.$shortWordEndIndex=function(e){var t,o,n=0,i=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,t=this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(o=e[n])&&i.test(o);)n++;if(1>n)for(r.lastIndex=0;(o=e[n])&&!r.test(o);)if(r.lastIndex=0,n++,i.test(o)){if(n>2){n--;break}for(;(o=e[n])&&i.test(o);)n++;if(n>2)break}}return r.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,o=this.doc.getLine(e),n=o.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==o.length){var r=this.doc.getLength();do e++,n=this.doc.getLine(e);while(r>e&&/^\s*$/.test(n));/^\s+/.test(n)||(n=""),t=0}var s=this.$shortWordEndIndex(n);this.moveCursorTo(e,t+s)},this.moveCursorShortWordLeft=function(){var e,t=this.lead.row,o=this.lead.column;if(e=this.session.getFoldAt(t,o,-1))return this.moveCursorTo(e.start.row,e.start.column);var i=this.session.getLine(t).substring(0,o);if(0==o){do t--,i=this.doc.getLine(t);while(t>0&&/^\s*$/.test(i));o=i.length,/\s+$/.test(i)||(i="")}var r=n.stringReverse(i),s=this.$shortWordEndIndex(r);return this.moveCursorTo(t,o-s)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var o=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(this.$desiredColumn?o.column=this.$desiredColumn:this.$desiredColumn=o.column);var n=this.session.screenToDocumentPosition(o.row+e,o.column);this.moveCursorTo(n.row,n.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,o){var n=this.session.getFoldAt(e,t,1);n&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0,this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,o||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,o){var n=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(n.row,n.column,o)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},this.fromJSON=function(e){if(void 0==e.start){if(this.rangeList){this.toSingleRange(e[0]);for(var t=e.length;t--;){var o=r.fromPoints(e[t].start,e[t].end);e.isBackwards&&(o.cursor=o.start),this.addRange(o,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(s.prototype),t.Selection=s}),define("ace/range",["require","exports","module"],function(e,t){var o=function(e,t){return e.row-t.row||e.column-t.column},n=function(e,t,o,n){this.start={row:e,column:t},this.end={row:o,column:n}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,o=e.end,n=e.start;return t=this.compare(o.row,o.column),1==t?(t=this.compare(n.row,n.column),1==t?2:0==t?1:0):-1==t?-2:(t=this.compare(n.row,n.column),-1==t?-1:1==t?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return 0==this.compare(e,t)?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return 0==this.compare(e,t)?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:t<this.start.column?-1:t>this.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var o={row:t+1,column:0};else if(this.end.row<e)var o={row:e,column:0};if(this.start.row>t)var i={row:t+1,column:0};else if(this.start.row<e)var i={row:e,column:0};return n.fromPoints(i||this.start,o||this.end)},this.extend=function(e,t){var o=this.compare(e,t);if(0==o)return this;if(-1==o)var i={row:e,column:t};else var r={row:e,column:t};return n.fromPoints(i||this.start,r||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return n.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new n(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new n(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),o=e.documentToScreenPosition(this.end);return new n(t.row,t.column,o.row,o.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(n.prototype),n.fromPoints=function(e,t){return new n(e.row,e.column,t.row,t.column)},n.comparePoints=o,n.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=n}),define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(e,t){var o=e("../tokenizer").Tokenizer,n=e("./text_highlight_rules").TextHighlightRules,i=e("./behaviour").Behaviour,r=e("../unicode"),s=e("../lib/lang"),l=e("../token_iterator").TokenIterator,a=e("../range").Range,c=function(){this.HighlightRules=n,this.$behaviour=new i};(function(){this.tokenRe=new RegExp("^["+r.packages.L+r.packages.Mn+r.packages.Mc+r.packages.Nd+r.packages.Pc+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+r.packages.L+r.packages.Mn+r.packages.Mc+r.packages.Nd+r.packages.Pc+"\\$_]|s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=new this.HighlightRules,this.$tokenizer=new o(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,o,n){function i(e){for(var t=o;n>=t;t++)e(r.getLine(t),t)}var r=t.doc,l=!0,a=!0,c=1/0,g=t.getTabSize(),u=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var h=this.lineCommentStart.map(s.escapeRegExp).join("|"),d=this.lineCommentStart[0];else var h=s.escapeRegExp(this.lineCommentStart),d=this.lineCommentStart;h=new RegExp("^(\\s*)(?:"+h+") ?"),u=t.getUseSoftTabs();var p=function(e,t){var o=e.match(h);if(o){var n=o[1].length,i=o[0].length;!_(e,n,i)&&" "==o[0][i-1]&&i--,r.removeInLine(t,n,i)}},f=d+" ",m=function(e,t){(!l||/\S/.test(e))&&(_(e,c,c)?r.insertInLine({row:t,column:c},f):r.insertInLine({row:t,column:c},d))},y=function(e){return h.test(e)},_=function(e,t,o){for(var n=0;t--&&" "==e.charAt(t);)n++;if(n%g!=0)return!1;for(var n=0;" "==e.charAt(o++);)n++;return g>2?n%g!=g-1:n%g==0}}else{if(!this.blockComment)return!1;var d=this.blockComment.start,E=this.blockComment.end,h=new RegExp("^(\\s*)(?:"+s.escapeRegExp(d)+")"),v=new RegExp("(?:"+s.escapeRegExp(E)+")\\s*$"),m=function(e,t){y(e,t)||(!l||/\S/.test(e))&&(r.insertInLine({row:t,column:e.length},E),r.insertInLine({row:t,column:c},d))},p=function(e,t){var o;(o=e.match(v))&&r.removeInLine(t,e.length-o[0].length,e.length),(o=e.match(h))&&r.removeInLine(t,o[1].length,o[0].length)},y=function(e,o){if(h.test(e))return!0;for(var n=t.getTokens(o),i=0;i<n.length;i++)if("comment"===n[i].type)return!0}}var C=1/0;i(function(e,t){var o=e.search(/\S/);-1!==o?(c>o&&(c=o),a&&!y(e,t)&&(a=!1)):C>e.length&&(C=e.length)}),1/0==c&&(c=C,l=!1,a=!1),u&&c%g!=0&&(c=Math.floor(c/g)*g),i(a?p:m)},this.toggleBlockComment=function(e,t,o,n){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var r,s,c=new l(t,n.row,n.column),g=c.getCurrentToken(),u=(t.selection,t.selection.toOrientedRange());if(g&&/comment/.test(g.type)){for(var h,d;g&&/comment/.test(g.type);){var p=g.value.indexOf(i.start);if(-1!=p){var f=c.getCurrentTokenRow(),m=c.getCurrentTokenColumn()+p;h=new a(f,m,f,m+i.start.length);break}g=c.stepBackward()}for(var c=new l(t,n.row,n.column),g=c.getCurrentToken();g&&/comment/.test(g.type);){var p=g.value.indexOf(i.end);if(-1!=p){var f=c.getCurrentTokenRow(),m=c.getCurrentTokenColumn()+p;d=new a(f,m,f,m+i.end.length);break}g=c.stepForward()}d&&t.remove(d),h&&(t.remove(h),r=h.start.row,s=-i.start.length)}else s=i.start.length,r=o.start.row,t.insert(o.end,i.end),t.insert(o.start,i.start);u.start.row==r&&(u.start.column+=s),u.end.row==r&&(u.end.column+=s),t.selection.fromOrientedRange(u)}},this.getNextLineIndent=function(e,t){return this.$getIndent(t)},this.checkOutdent=function(){return!1},this.autoOutdent=function(){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var t in e)e[t]&&(this.$embeds.push(t),this.$modes[t]=new e[t]);for(var o=["toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],t=0;t<o.length;t++)(function(e){var n=o[t],i=e[n];e[o[t]]=function(){return this.$delegator(n,arguments,i)}})(this)},this.$delegator=function(e,t,o){var n=t[0];"string"!=typeof n&&(n=n[0]);for(var i=0;i<this.$embeds.length;i++)if(this.$modes[this.$embeds[i]]){var r=n.split(this.$embeds[i]);if(!r[0]&&r[1]){t[0]=r[1];var s=this.$modes[this.$embeds[i]];return s[e].apply(s,t)}}var l=o.apply(this,t);return o?l:void 0},this.transformAction=function(e,t){if(this.$behaviour){var o=this.$behaviour.getBehaviours();for(var n in o)if(o[n][t]){var i=o[n][t].apply(this,arguments);if(i)return i}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,o=[];for(var n in t)for(var i=t[n],r=0,s=i.length;s>r;r++)if("string"==typeof i[r].token)/keyword|support|storage/.test(i[r].token)&&o.push(i[r].regex);else if("object"==typeof i[r].token)for(var l=0,a=i[r].token.length;a>l;l++)if(/keyword|support|storage/.test(i[r].token[l])){var n=i[r].regex.match(/\(.+?\)/g)[l];o.push(n.substr(1,n.length-2))}this.completionKeywords=o}return e?o.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(){var e=this.$keywordList||this.$createKeywordList();return e.map(function(e){return{name:e,value:e,score:0,meta:"keyword"}})}}).call(c.prototype),t.Mode=c}),define("ace/tokenizer",["require","exports","module"],function(e,t){var o=1e3,n=function(e){this.states=e,this.regExps={},this.matchMappings={};for(var t in this.states){for(var o=this.states[t],n=[],i=0,r=this.matchMappings[t]={defaultToken:"text"},s="g",l=[],a=0;a<o.length;a++){var c=o[a];if(c.defaultToken&&(r.defaultToken=c.defaultToken),c.caseInsensitive&&(s="gi"),null!=c.regex){c.regex instanceof RegExp&&(c.regex=c.regex.toString().slice(1,-1));var g=c.regex,u=new RegExp("(?:("+g+")|(.))").exec("a").length-2;if(Array.isArray(c.token))if(1==c.token.length||1==u)c.token=c.token[0];else{if(u-1!=c.token.length)throw new Error("number of classes and regexp groups in '"+c.token+"'\n'"+c.regex+"' doesn't match\n"+(u-1)+"!="+c.token.length);c.tokenArray=c.token,c.token=null,c.onMatch=this.$arrayTokens}else"function"==typeof c.token&&!c.onMatch&&(c.onMatch=u>1?this.$applyToken:c.token);u>1&&(/\\\d/.test(c.regex)?g=c.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(u=1,g=this.removeCapturingGroups(c.regex)),!c.splitRegex&&"string"!=typeof c.token&&l.push(c)),r[i]=a,i+=u,n.push(g),c.onMatch||(c.onMatch=null),c.__proto__=null}}l.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,s)},this),this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",s)}};(function(){this.$setMaxTokenCount=function(e){o=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),o=this.token.apply(this,t);if("string"==typeof o)return[{type:o,value:e}];for(var n=[],i=0,r=o.length;r>i;i++)t[i]&&(n[n.length]={type:o[i],value:t[i]});return n},this.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var o=[],n=this.tokenArray,i=0,r=n.length;r>i;i++)t[i+1]&&(o[o.length]={type:n[i],value:t[i+1]});return o},this.removeCapturingGroups=function(e){var t=e.replace(/\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g,function(e,t){return t?"(?:":e});return t},this.createSplitterRegexp=function(e,t){if(-1!=e.indexOf("(?=")){var o=0,n=!1,i={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,t,r,s,l,a){return n?n="]"!=l:l?n=!0:s?(o==i.stack&&(i.end=a+1,i.stack=-1),o--):r&&(o++,1!=r.length&&(i.stack=o,i.start=a)),e}),null!=i.end&&/^\)*$/.test(e.substr(i.end))&&(e=e.substring(0,i.start)+e.substr(i.end))}return new RegExp(e,(t||"").replace("g",""))},this.getLineTokens=function(e,t){if(t&&"string"!=typeof t){var n=t.slice(0);t=n[0]}else var n=[];var i=t||"start",r=this.states[i],s=this.matchMappings[i],l=this.regExps[i];l.lastIndex=0;for(var a,c=[],g=0,u={type:null,value:""};a=l.exec(e);){var h=s.defaultToken,d=null,p=a[0],f=l.lastIndex;if(f-p.length>g){var m=e.substring(g,f-p.length);u.type==h?u.value+=m:(u.type&&c.push(u),u={type:h,value:m})}for(var y=0;y<a.length-2;y++)if(void 0!==a[y+1]){d=r[s[y]],h=d.onMatch?d.onMatch(p,i,n):d.token,d.next&&(i="string"==typeof d.next?d.next:d.next(i,n),r=this.states[i],r||(window.console&&console.error&&console.error(i,"doesn't exist"),i="start",r=this.states[i]),s=this.matchMappings[i],g=f,l=this.regExps[i],l.lastIndex=f);break}if(p)if("string"==typeof h)d&&d.merge===!1||u.type!==h?(u.type&&c.push(u),u={type:h,value:p}):u.value+=p;else if(h){u.type&&c.push(u),u={type:null,value:""};for(var y=0;y<h.length;y++)c.push(h[y])}if(g==e.length)break;if(g=f,c.length>o){for(;g<e.length;)u.type&&c.push(u),u={value:e.substring(g,g+=2e3),type:"overflow"};i="start",n=[];break}}return u.type&&c.push(u),{tokens:c,state:n.length?n:i}}}).call(n.prototype),t.Tokenizer=n}),define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t){var o=e("../lib/lang"),n=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var o in e){for(var n=e[o],i=0;i<n.length;i++){var r=n[i];r.next&&("string"!=typeof r.next?r.nextState&&0!==r.nextState.indexOf(t)&&(r.nextState=t+r.nextState):0!==r.next.indexOf(t)&&(r.next=t+r.next))}this.$rules[t+o]=n}else for(var o in e)this.$rules[o]=e[o]},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,n,i,r){var s=(new e).getRules();if(i)for(var l=0;l<i.length;l++)i[l]=t+i[l];else{i=[];for(var a in s)i.push(t+a)}if(this.addRules(s,t),n)for(var c=Array.prototype[r?"push":"unshift"],l=0;l<i.length;l++)c.apply(this.$rules[i[l]],o.deepCopy(n));this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var e=function(e,t){return"start"!=e&&t.unshift(this.nextState,e),this.nextState},t=function(e,t){return t[0]!==e?"start":(t.shift(),t.shift())};this.normalizeRules=function(){function o(r){var s=i[r];s.processed=!0;for(var l=0;l<s.length;l++){var a=s[l];!a.regex&&a.start&&(a.regex=a.start,a.next||(a.next=[]),a.next.push({defaultToken:a.token},{token:a.token+".end",regex:a.end||a.start,next:"pop"}),a.token=a.token+".start",a.push=!0);var c=a.next||a.push;if(c&&Array.isArray(c)){var g=a.stateName;g||(g=a.token,"string"!=typeof g&&(g=g[0]||""),i[g]&&(g+=n++)),i[g]=c,a.next=g,o(g)}else"pop"==c&&(a.next=t);if(a.push&&(a.nextState=a.next||a.push,a.next=e,delete a.push),a.rules)for(var u in a.rules)i[u]?i[u].push&&i[u].push.apply(i[u],a.rules[u]):i[u]=a.rules[u];if(a.include||"string"==typeof a)var h=a.include||a,d=i[h];else Array.isArray(a)&&(d=a);if(d){var p=[l,1].concat(d);a.noEscape&&(p=p.filter(function(e){return!e.next})),s.splice.apply(s,p),l--,d=null}a.keywordMap&&(a.token=this.createKeywordMapper(a.keywordMap,a.defaultToken||"text",a.caseInsensitive),delete a.defaultToken)}}var n=0,i=this.$rules;Object.keys(i).forEach(o,this)},this.createKeywordMapper=function(e,t,o,n){var i=Object.create(null);return Object.keys(e).forEach(function(t){var r=e[t];o&&(r=r.toLowerCase());for(var s=r.split(n||"|"),l=s.length;l--;)i[s[l]]=t}),Object.getPrototypeOf(i)&&(i.__proto__=null),this.$keywordList=Object.keys(i),e=null,o?function(e){return i[e.toLowerCase()]||t}:function(e){return i[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(n.prototype),t.TextHighlightRules=n}),define("ace/mode/behaviour",["require","exports","module"],function(e,t){var o=function(){this.$behaviours={}};(function(){this.add=function(e,t,o){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=o},this.addBehaviours=function(e){for(var t in e)for(var o in e[t])this.add(t,o,e[t][o])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if("function"==typeof e)var o=(new e).getBehaviours(t);else var o=e.getBehaviours(t);this.addBehaviours(o)},this.getBehaviours=function(e){if(!e)return this.$behaviours;for(var t={},o=0;o<e.length;o++)this.$behaviours[e[o]]&&(t[e[o]]=this.$behaviours[e[o]]);return t}}).call(o.prototype),t.Behaviour=o}),define("ace/unicode",["require","exports","module"],function(e,t){function o(e){var o=/\w{4}/g;for(var n in e)t.packages[n]=e[n].replace(o,"\\u$&")}t.packages={},o({L:"0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",Ll:"0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A",Lu:"0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A",Lt:"01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",Lm:"02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F",Lo:"01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",M:"0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26",Mn:"0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26",Mc:"0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC",Me:"0488048906DE20DD-20E020E2-20E4A670-A672",N:"0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",Nd:"0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",Nl:"16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",No:"00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835",P:"0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65",Pd:"002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D",Ps:"0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",Pe:"0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",Pi:"00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",Pf:"00BB2019201D203A2E032E052E0A2E0D2E1D2E21",Pc:"005F203F20402054FE33FE34FE4D-FE4FFF3F",Po:"0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65",S:"0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD",Sm:"002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC",Sc:"002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6",Sk:"005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3",So:"00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD",Z:"002000A01680180E2000-200A20282029202F205F3000",Zs:"002000A01680180E2000-200A202F205F3000",Zl:"2028",Zp:"2029",C:"0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF",Cc:"0000-001F007F-009F",Cf:"00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",Co:"E000-F8FF",Cs:"D800-DFFF",Cn:"03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF"})
10
10
  }),define("ace/token_iterator",["require","exports","module"],function(e,t){var o=function(e,t,o){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var n=e.getTokenAt(t,o);this.$tokenIndex=n?n.index:-1};(function(){this.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},this.stepForward=function(){this.$tokenIndex+=1;for(var e;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,o=e[t].start;if(void 0!==o)return o;for(o=0;t>0;)t-=1,o+=e[t].value.length;return o}}).call(o.prototype),t.TokenIterator=o}),define("ace/document",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t){var o=e("./lib/oop"),n=e("./lib/event_emitter").EventEmitter,i=e("./range").Range,r=e("./anchor").Anchor,s=function(e){this.$lines=[],0==e.length?this.$lines=[""]:Array.isArray(e)?this._insertLines(0,e):this.insert({row:0,column:0},e)};(function(){o.implement(this,n),this.setValue=function(e){var t=this.getLength();this.remove(new i(0,0,t,this.getLine(t-1).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new r(this,e,t)},this.$split=0=="aaa".split(/a/).length?function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n"},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine}},this.$autoNewLine="\n",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e)},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){if(e.start.row==e.end.row)return this.getLine(e.start.row).substring(e.start.column,e.end.column);var t=this.getLines(e.start.row,e.end.row);t[0]=(t[0]||"").substring(e.start.column);var o=t.length-1;return e.end.row-e.start.row==o&&(t[o]=t[o].substring(0,e.end.column)),t.join(this.getNewLineCharacter())},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):e.row<0&&(e.row=0),e},this.insert=function(e,t){if(!t||0===t.length)return e;e=this.$clipPosition(e),this.getLength()<=1&&this.$detectNewLine(t);var o=this.$split(t),n=o.splice(0,1)[0],i=0==o.length?null:o.splice(o.length-1,1)[0];return e=this.insertInLine(e,n),null!==i&&(e=this.insertNewLine(e),e=this._insertLines(e.row,o),e=this.insertInLine(e,i||"")),e},this.insertLines=function(e,t){return e>=this.getLength()?this.insert({row:e,column:0},"\n"+t.join("\n")):this._insertLines(Math.max(e,0),t)},this._insertLines=function(e,t){if(0==t.length)return{row:e,column:0};if(t.length>65535){var o=this._insertLines(e,t.slice(65535));t=t.slice(0,65535)}var n=[e,0];n.push.apply(n,t),this.$lines.splice.apply(this.$lines,n);var r=new i(e,0,e+t.length,0),s={action:"insertLines",range:r,lines:t};return this._emit("change",{data:s}),o||r.end},this.insertNewLine=function(e){e=this.$clipPosition(e);var t=this.$lines[e.row]||"";this.$lines[e.row]=t.substring(0,e.column),this.$lines.splice(e.row+1,0,t.substring(e.column,t.length));var o={row:e.row+1,column:0},n={action:"insertText",range:i.fromPoints(e,o),text:this.getNewLineCharacter()};return this._emit("change",{data:n}),o},this.insertInLine=function(e,t){if(0==t.length)return e;var o=this.$lines[e.row]||"";this.$lines[e.row]=o.substring(0,e.column)+t+o.substring(e.column);var n={row:e.row,column:e.column+t.length},r={action:"insertText",range:i.fromPoints(e,n),text:t};return this._emit("change",{data:r}),n},this.remove=function(e){if(!e instanceof i&&(e=i.fromPoints(e.start,e.end)),e.start=this.$clipPosition(e.start),e.end=this.$clipPosition(e.end),e.isEmpty())return e.start;var t=e.start.row,o=e.end.row;if(e.isMultiLine()){var n=0==e.start.column?t:t+1,r=o-1;e.end.column>0&&this.removeInLine(o,0,e.end.column),r>=n&&this._removeLines(n,r),n!=t&&(this.removeInLine(t,e.start.column,this.getLine(t).length),this.removeNewLine(e.start.row))}else this.removeInLine(t,e.start.column,e.end.column);return e.start},this.removeInLine=function(e,t,o){if(t!=o){var n=new i(e,t,e,o),r=this.getLine(e),s=r.substring(t,o),l=r.substring(0,t)+r.substring(o,r.length);this.$lines.splice(e,1,l);var a={action:"removeText",range:n,text:s};return this._emit("change",{data:a}),n.start}},this.removeLines=function(e,t){return 0>e||t>=this.getLength()?this.remove(new i(e,0,t+1,0)):this._removeLines(e,t)},this._removeLines=function(e,t){var o=new i(e,0,t+1,0),n=this.$lines.splice(e,t-e+1),r={action:"removeLines",range:o,nl:this.getNewLineCharacter(),lines:n};return this._emit("change",{data:r}),n},this.removeNewLine=function(e){var t=this.getLine(e),o=this.getLine(e+1),n=new i(e,t.length,e+1,0),r=t+o;this.$lines.splice(e,2,r);var s={action:"removeText",range:n,text:this.getNewLineCharacter()};this._emit("change",{data:s})},this.replace=function(e,t){if(!e instanceof i&&(e=i.fromPoints(e.start,e.end)),0==t.length&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;if(this.remove(e),t)var o=this.insert(e.start,t);else o=e.start;return o},this.applyDeltas=function(e){for(var t=0;t<e.length;t++){var o=e[t],n=i.fromPoints(o.range.start,o.range.end);"insertLines"==o.action?this.insertLines(n.start.row,o.lines):"insertText"==o.action?this.insert(n.start,o.text):"removeLines"==o.action?this._removeLines(n.start.row,n.end.row-1):"removeText"==o.action&&this.remove(n)}},this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--){var o=e[t],n=i.fromPoints(o.range.start,o.range.end);"insertLines"==o.action?this._removeLines(n.start.row,n.end.row-1):"insertText"==o.action?this.remove(n):"removeLines"==o.action?this._insertLines(n.start.row,o.lines):"removeText"==o.action&&this.insert(n.start,o.text)}},this.indexToPosition=function(e,t){for(var o=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,i=t||0,r=o.length;r>i;i++)if(e-=o[i].length+n,0>e)return{row:i,column:e+o[i].length+n};return{row:r-1,column:o[r-1].length}},this.positionToIndex=function(e,t){for(var o=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,i=0,r=Math.min(e.row,o.length),s=t||0;r>s;++s)i+=o[s].length+n;return i+e.column}}).call(s.prototype),t.Document=s}),define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t){var o=e("./lib/oop"),n=e("./lib/event_emitter").EventEmitter,i=t.Anchor=function(e,t,o){this.$onChange=this.onChange.bind(this),this.attach(e),"undefined"==typeof o?this.setPosition(t.row,t.column):this.setPosition(t,o)};(function(){o.implement(this,n),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){var t=e.data,o=t.range;if((o.start.row!=o.end.row||o.start.row==this.row)&&!(o.start.row>this.row||o.start.row==this.row&&o.start.column>this.column)){var n=this.row,i=this.column,r=o.start,s=o.end;"insertText"===t.action?r.row===n&&r.column<=i?r.column===i&&this.$insertRight||(r.row===s.row?i+=s.column-r.column:(i-=r.column,n+=s.row-r.row)):r.row!==s.row&&r.row<n&&(n+=s.row-r.row):"insertLines"===t.action?r.row<=n&&(n+=s.row-r.row):"removeText"===t.action?r.row===n&&r.column<i?i=s.column>=i?r.column:Math.max(0,i-(s.column-r.column)):r.row!==s.row&&r.row<n?(s.row===n&&(i=Math.max(0,i-s.column)+r.column),n-=s.row-r.row):s.row===n&&(n-=s.row-r.row,i=Math.max(0,i-s.column)+r.column):"removeLines"==t.action&&r.row<=n&&(s.row<=n?n-=s.row-r.row:(n=r.row,i=0)),this.setPosition(n,i,!0)}},this.setPosition=function(e,t,o){var n;if(n=o?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=n.row||this.column!=n.column){var i={row:this.row,column:this.column};this.row=n.row,this.column=n.column,this._emit("change",{old:i,value:n})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var o={};return e>=this.document.getLength()?(o.row=Math.max(0,this.document.getLength()-1),o.column=this.document.getLine(o.row).length):0>e?(o.row=0,o.column=0):(o.row=e,o.column=Math.min(this.document.getLine(o.row).length,Math.max(0,t))),0>t&&(o.column=0),o}}).call(i.prototype)}),define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t){var o=e("./lib/oop"),n=e("./lib/event_emitter").EventEmitter,i=function(e){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var t=this;this.$worker=function(){if(t.running){for(var e=new Date,o=t.currentLine,n=-1,i=t.doc;t.lines[o];)o++;var r=o,s=i.getLength(),l=0;for(t.running=!1;s>o;){t.$tokenizeRow(o),n=o;do o++;while(t.lines[o]);if(l++,l%5==0&&new Date-e>20)return t.running=setTimeout(t.$worker,20),t.currentLine=o,void 0}t.currentLine=o,n>=r&&t.fireUpdateEvent(r,n)}}};(function(){o.implement(this,n),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var o={first:e,last:t};this._emit("update",{data:o})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.range,o=t.start.row,n=t.end.row-o;if(0===n)this.lines[o]=null;else if("removeText"==e.action||"removeLines"==e.action)this.lines.splice(o,n+1,null),this.states.splice(o,n+1,null);else{var i=Array(n+1);i.unshift(o,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(o,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),o=this.states[e-1],n=this.tokenizer.getLineTokens(t,o,e);return this.states[e]+""!=n.state+""?(this.states[e]=n.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=n.tokens}}).call(i.prototype),t.BackgroundTokenizer=i}),define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t){var o=e("./lib/lang"),n=(e("./lib/oop"),e("./range").Range),i=function(e,t,o){this.setRegexp(e),this.clazz=t,this.type=o||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,i,r){if(this.regExp)for(var s=r.firstRow,l=r.lastRow,a=s;l>=a;a++){var c=this.cache[a];null==c&&(c=o.getMatchOffsets(i.getLine(a),this.regExp),c.length>this.MAX_RANGES&&(c=c.slice(0,this.MAX_RANGES)),c=c.map(function(e){return new n(a,e.offset,a,e.offset+e.length)}),this.cache[a]=c.length?c:"");for(var g=c.length;g--;)t.drawSingleLineMarker(e,c[g].toScreenRange(i),this.clazz,r)}}}).call(i.prototype),t.SearchHighlight=i}),define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(e,t){function o(){this.getFoldAt=function(e,t,o){var n=this.getFoldLine(e);if(!n)return null;for(var i=n.folds,r=0;r<i.length;r++){var s=i[r];if(s.range.contains(e,t)){if(1==o&&s.range.isEnd(e,t))continue;if(-1==o&&s.range.isStart(e,t))continue;return s}}},this.getFoldsInRange=function(e){var t=e.start,o=e.end,n=this.$foldData,i=[];t.column+=1,o.column-=1;for(var r=0;r<n.length;r++){var s=n[r].range.compareRange(e);if(2!=s){if(-2==s)break;for(var l=n[r].folds,a=0;a<l.length;a++){var c=l[a];if(s=c.range.compareRange(e),-2==s)break;if(2!=s){if(42==s)break;i.push(c)}}}}return t.column-=1,o.column+=1,i},this.getAllFolds=function(){function e(e){t.push(e)}for(var t=[],o=this.$foldData,n=0;n<o.length;n++)for(var i=0;i<o[n].folds.length;i++)e(o[n].folds[i]);return t},this.getFoldStringAt=function(e,t,o,n){if(n=n||this.getFoldLine(e),!n)return null;for(var i,r,s={end:{column:0}},l=0;l<n.folds.length;l++){r=n.folds[l];var a=r.range.compareEnd(e,t);if(-1==a){i=this.getLine(r.start.row).substring(s.end.column,r.start.column);break}if(0===a)return null;s=r}return i||(i=this.getLine(r.start.row).substring(s.end.column)),-1==o?i.substring(0,t-s.end.column):1==o?i.substring(t-s.end.column):i},this.getFoldLine=function(e,t){var o=this.$foldData,n=0;for(t&&(n=o.indexOf(t)),-1==n&&(n=0),n;n<o.length;n++){var i=o[n];if(i.start.row<=e&&i.end.row>=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var o=this.$foldData,n=0;for(t&&(n=o.indexOf(t)),-1==n&&(n=0),n;n<o.length;n++){var i=o[n];if(i.end.row>=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var o=this.$foldData,n=t-e+1,i=0;i<o.length;i++){var r=o[i],s=r.end.row,l=r.start.row;if(s>=t){t>l&&(l>=e?n-=t-l:n=0);break}s>=e&&(n-=l>=e?s-l:s-e+1)}return n},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var o,n=this.$foldData,s=!1;e instanceof r?o=e:(o=new r(t,e),o.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(o.range);var l=o.start.row,a=o.start.column,c=o.end.row,g=o.end.column;if(c>l||l==c&&g-2>=a){var u=this.getFoldAt(l,a,1),h=this.getFoldAt(c,g,-1);if(u&&h==u)return u.addSubFold(o);if(u&&!u.range.isStart(l,a)||h&&!h.range.isEnd(c,g))throw new Error("A fold can't intersect already existing fold"+o.range+u.range);var d=this.getFoldsInRange(o.range);d.length>0&&(this.removeFolds(d),d.forEach(function(e){o.addSubFold(e)}));for(var p=0;p<n.length;p++){var f=n[p];if(c==f.start.row){f.addFold(o),s=!0;break}if(l==f.end.row){if(f.addFold(o),s=!0,!o.sameRow){var m=n[p+1];if(m&&m.start.row==c){f.merge(m);break}}break}if(c<=f.start.row)break}return s||(f=this.$addFoldLine(new i(this.$foldData,o))),this.$useWrapMode?this.$updateWrapData(f.start.row,f.start.row):this.$updateRowLengthCache(f.start.row,f.start.row),this.$modified=!0,this._emit("changeFold",{data:o,action:"add"}),o}throw new Error("The range has to be at least 2 characters width")},this.addFolds=function(e){e.forEach(function(e){this.addFold(e)},this)},this.removeFold=function(e){var t=e.foldLine,o=t.start.row,n=t.end.row,i=this.$foldData,r=t.folds;if(1==r.length)i.splice(i.indexOf(t),1);else if(t.range.isEnd(e.end.row,e.end.column))r.pop(),t.end.row=r[r.length-1].end.row,t.end.column=r[r.length-1].end.column;else if(t.range.isStart(e.start.row,e.start.column))r.shift(),t.start.row=r[0].start.row,t.start.column=r[0].start.column;else if(e.sameRow)r.splice(r.indexOf(e),1);else{var s=t.split(e.start.row,e.start.column);r=s.folds,r.shift(),s.start.row=r[0].start.row,s.start.column=r[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(o,n):this.$updateRowLengthCache(o,n)),this.$modified=!0,this._emit("changeFold",{data:e,action:"remove"})},this.removeFolds=function(e){for(var t=[],o=0;o<e.length;o++)t.push(e[o]);t.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(e){this.removeFold(e),e.subFolds.forEach(function(t){e.restoreRange(t),this.addFold(t)},this),e.collapseChildren>0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var o,i;if(null==e?(o=new n(0,0,this.getLength(),0),t=!0):o="number"==typeof e?new n(e,0,e,this.getLine(e).length):"row"in e?n.fromPoints(e,e):e,i=this.getFoldsInRange(o),t)this.removeFolds(i);else for(;i.length;)this.expandFolds(i),i=this.getFoldsInRange(o)},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var o=this.getFoldLine(e,t);return o?o.end.row:e},this.getRowFoldStart=function(e,t){var o=this.getFoldLine(e,t);return o?o.start.row:e},this.getFoldDisplayLine=function(e,t,o,n,i){null==n&&(n=e.start.row,i=0),null==t&&(t=e.end.row,o=this.getLine(t).length);var r=this.doc,s="";return e.walk(function(e,t,o,l){if(!(n>t)){if(t==n){if(i>o)return;l=Math.max(i,l)}s+=null!=e?e:r.getLine(t).substring(l,o)}},t,o),s},this.getDisplayLine=function(e,t,o,n){var i=this.getFoldLine(e);if(!i){var r;return r=this.doc.getLine(e),r.substring(n||0,t||r.length)}return this.getFoldDisplayLine(i,e,t,o,n)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map(function(t){var o=t.folds.map(function(e){return e.clone()});return new i(e,o)})},this.toggleFold=function(e){var t,o,n=this.selection,i=n.getRange();if(i.isEmpty()){var r=i.start;if(t=this.getFoldAt(r.row,r.column))return this.expandFold(t),void 0;(o=this.findMatchingBracket(r))?1==i.comparePoint(o)?i.end=o:(i.start=o,i.start.column++,i.end.column--):(o=this.findMatchingBracket({row:r.row,column:r.column+1}))?(1==i.comparePoint(o)?i.end=o:i.start=o,i.start.column++):i=this.getCommentFoldRange(r.row,r.column)||i}else{var s=this.getFoldsInRange(i);if(e&&s.length)return this.expandFolds(s),void 0;1==s.length&&(t=s[0])}if(t||(t=this.getFoldAt(i.start.row,i.start.column)),t&&t.range.toString()==i.toString())return this.expandFold(t),void 0;var l="...";if(!i.isMultiLine()){if(l=this.getTextRange(i),l.length<4)return;l=l.trim().substring(0,2)+".."}this.addFold(l,i)},this.getCommentFoldRange=function(e,t,o){var i=new s(this,e,t),r=i.getCurrentToken();if(r&&/^comment|string/.test(r.type)){var l=new n,a=new RegExp(r.type.replace(/\..*/,"\\."));if(1!=o){do r=i.stepBackward();while(r&&a.test(r.type));i.stepForward()}if(l.start.row=i.getCurrentTokenRow(),l.start.column=i.getCurrentTokenColumn()+2,i=new s(this,e,t),-1!=o){do r=i.stepForward();while(r&&a.test(r.type));r=i.stepBackward()}else r=i.getCurrentToken();return l.end.row=i.getCurrentTokenRow(),l.end.column=i.getCurrentTokenColumn()+r.value.length-2,l}},this.foldAll=function(e,t,o){void 0==o&&(o=1e5);var n=this.foldWidgets;t=t||this.getLength(),e=e||0;for(var i=e;t>i;i++)if(null==n[i]&&(n[i]=this.getFoldWidget(i)),"start"==n[i]){var r=this.getFoldWidgetRange(i),s=r.end.row;if(r&&r.isMultiLine()&&t>=s&&r.start.row>=e)try{var l=this.addFold("...",r);l.collapseChildren=o,i=s}catch(a){}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){return this.$foldMode!=e?(this.$foldMode=e,this.removeListener("change",this.$updateFoldWidgets),this._emit("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),void 0):(this.foldWidgets=null,void 0)):void 0},this.getParentFoldRangeData=function(e,t){var o=this.foldWidgets;if(!o||t&&o[e])return{};for(var n,i=e-1;i>=0;){var r=o[i];if(null==r&&(r=o[i]=this.getFoldWidget(i)),"start"==r){var s=this.getFoldWidgetRange(i);if(n||(n=s),s&&s.end.row>=e)break}i--}return{range:-1!==i&&s,firstRange:n}},this.onFoldWidgetClick=function(e,t){var o=this.getFoldWidget(e),n=this.getLine(e);t=t.domEvent;var i=t.shiftKey,r=t.ctrlKey||t.metaKey,s=t.altKey,l="end"===o?-1:1,a=this.getFoldAt(e,-1===l?0:n.length,l);if(a)return i||r?this.removeFold(a):this.expandFold(a),void 0;var c=this.getFoldWidgetRange(e);if(c&&!c.isMultiLine()&&(a=this.getFoldAt(c.start.row,c.start.column,1),a&&c.isEqual(a.range)))return this.removeFold(a),void 0;if(s){var g=this.getParentFoldRangeData(e);if(g.range)var u=g.range.start.row+1,h=g.range.end.row;this.foldAll(u,h,r?1e4:0)}else if(i){var h=c?c.end.row:this.getLength();this.foldAll(e+1,c.end.row,r?1e4:0)}else c&&(r&&(c.collapseChildren=1e4),this.addFold("...",c));c||((t.target||t.srcElement).className+=" ace_invalid")},this.updateFoldWidgets=function(e){var t=e.data,o=t.range,n=o.start.row,i=o.end.row-n;if(0===i)this.foldWidgets[n]=null;else if("removeText"==t.action||"removeLines"==t.action)this.foldWidgets.splice(n,i+1,null);else{var r=Array(i+1);r.unshift(n,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}}}var n=e("../range").Range,i=e("./fold_line").FoldLine,r=e("./fold").Fold,s=e("../token_iterator").TokenIterator;t.Folding=o}),define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t){function o(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var o=t[t.length-1];this.range=new n(t[0].start.row,t[0].start.column,o.end.row,o.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}var n=e("../range").Range;(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,o){var n,i,r,s=0,l=this.folds,a=!0;null==t&&(t=this.end.row,o=this.end.column);for(var c=0;c<l.length;c++){if(n=l[c],i=n.range.compareStart(t,o),-1==i)return e(null,t,o,s,a),void 0;if(r=e(null,n.start.row,n.start.column,s,a),r=!r&&e(n.placeholder,n.start.row,n.start.column,s),r||0==i)return;a=!n.sameRow,s=n.end.column}e(null,t,o,s,a)},this.getNextFoldTo=function(e,t){for(var o,n,i=0;i<this.folds.length;i++){if(o=this.folds[i],n=o.range.compareEnd(e,t),-1==n)return{fold:o,kind:"after"};if(0==n)return{fold:o,kind:"inside"}}return null},this.addRemoveChars=function(e,t,o){var n,i,r=this.getNextFoldTo(e,t);if(r)if(n=r.fold,"inside"==r.kind&&n.start.column!=t&&n.start.row!=e)window.console&&window.console.log(e,t,n);else if(n.start.row==e){i=this.folds;var s=i.indexOf(n);for(0==s&&(this.start.column+=o),s;s<i.length;s++){if(n=i[s],n.start.column+=o,!n.sameRow)return;n.end.column+=o}this.end.column+=o}},this.split=function(e,t){var n=this.getNextFoldTo(e,t).fold,i=this.folds,r=this.foldData;if(!n)return null;var s=i.indexOf(n),l=i[s-1];this.end.row=l.end.row,this.end.column=l.end.column,i=i.splice(s,i.length-s);var a=new o(r,i);return r.splice(r.indexOf(this)+1,0,a),a},this.merge=function(e){for(var t=e.folds,o=0;o<t.length;o++)this.addFold(t[o]);var n=this.foldData;n.splice(n.indexOf(e),1)},this.toString=function(){var e=[this.range.toString()+": ["];return this.folds.forEach(function(t){e.push(" "+t.toString())}),e.push("]"),e.join("\n")},this.idxToPosition=function(e){for(var t,o=0,n=0;n<this.folds.length;n++){var t=this.folds[n];if(e-=t.start.column-o,0>e)return{row:t.start.row,column:t.start.column+e};if(e-=t.placeholder.length,0>e)return t.start;o=t.end.column}return{row:this.end.row,column:this.end.column+e}}}).call(o.prototype),t.FoldLine=o}),define("ace/edit_session/fold",["require","exports","module","ace/range","ace/range_list","ace/lib/oop"],function(e,t){function o(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function n(e,t){o(e.start,t),o(e.end,t)}function i(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}function r(e,t){i(e.start,t),i(e.end,t)}var s=(e("../range").Range,e("../range_list").RangeList),l=e("../lib/oop"),a=t.Fold=function(e,t){this.foldLine=null,this.placeholder=t,this.range=e,this.start=e.start,this.end=e.end,this.sameRow=e.start.row==e.end.row,this.subFolds=this.ranges=[]};l.inherits(a,s),function(){this.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},this.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(t){t.setFoldLine(e)})},this.clone=function(){var e=this.range.clone(),t=new a(e,this.placeholder);return this.subFolds.forEach(function(e){t.subFolds.push(e.clone())}),t.collapseChildren=this.collapseChildren,t},this.addSubFold=function(e){if(!this.range.isEqual(e)){if(!this.range.containsRange(e))throw new Error("A fold can't intersect already existing fold"+e.range+this.range);n(e,this.start);for(var t=e.start.row,o=e.start.column,i=0,r=-1;i<this.subFolds.length&&(r=this.subFolds[i].range.compare(t,o),1==r);i++);var s=this.subFolds[i];if(0==r)return s.addSubFold(e);for(var t=e.range.end.row,o=e.range.end.column,l=i,r=-1;l<this.subFolds.length&&(r=this.subFolds[l].range.compare(t,o),1==r);l++);{this.subFolds[l]}if(0==r)throw new Error("A fold can't intersect already existing fold"+e.range+this.range);{this.subFolds.splice(i,l-i,e)}return e.setFoldLine(this.foldLine),e}},this.restoreRange=function(e){return r(e,this.start)}}.call(a.prototype)}),define("ace/range_list",["require","exports","module","ace/range"],function(e,t){var o=e("./range").Range,n=o.comparePoints,i=function(){this.ranges=[]};(function(){this.comparePoints=n,this.pointIndex=function(e,t,o){for(var i=this.ranges,r=o||0;r<i.length;r++){var s=i[r],l=n(e,s.end);if(!(l>0)){var a=n(e,s.start);return 0===l?t&&0!==a?-r-2:r:a>0||0===a&&!t?r:-r-1}}return-r-1},this.add=function(e){var t=!e.isEmpty(),o=this.pointIndex(e.start,t);0>o&&(o=-o-1);var n=this.pointIndex(e.end,t,o);return 0>n?n=-n-1:n++,this.ranges.splice(o,n-o,e)},this.addList=function(e){for(var t=[],o=e.length;o--;)t.push.call(t,this.add(e[o]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);return t>=0?this.ranges.splice(t,1):void 0},this.merge=function(){var e=[],t=this.ranges;t=t.sort(function(e,t){return n(e.start,t.start)});for(var o,i=t[0],r=1;r<t.length;r++){o=i,i=t[r];var s=n(o.end,i.start);0>s||(0!=s||o.isEmpty()||i.isEmpty())&&(n(o.end,i.end)<0&&(o.end.row=i.end.row,o.end.column=i.end.column),t.splice(r,1),e.push(i),i=o,r--)}return this.ranges=t,e},this.contains=function(e,t){return this.pointIndex({row:e,column:t})>=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);return t>=0?this.ranges[t]:void 0},this.clipRows=function(e,t){var o=this.ranges;if(o[0].start.row>t||o[o.length-1].start.row<e)return[];var n=this.pointIndex({row:e,column:0});0>n&&(n=-n-1);var i=this.pointIndex({row:t,column:0},n);0>i&&(i=-i-1);for(var r=[],s=n;i>s;s++)r.push(o[s]);return r},this.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},this.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},this.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},this.$onChange=function(e){var t=e.data.range;if("i"==e.data.action[0])var o=t.start,n=t.end;else var n=t.start,o=t.end;for(var i=o.row,r=n.row,s=r-i,l=-o.column+n.column,a=this.ranges,c=0,g=a.length;g>c;c++){var u=a[c];if(!(u.end.row<i)){if(u.start.row>i)break;if(u.start.row==i&&u.start.column>=o.column&&(u.start.column!=o.column||!this.$insertRight)&&(u.start.column+=l,u.start.row+=s),u.end.row==i&&u.end.column>=o.column){if(u.end.column==o.column&&this.$insertRight)continue;u.end.column==o.column&&l>0&&g-1>c&&u.end.column>u.start.column&&u.end.column==a[c+1].start.column&&(u.end.column-=l),u.end.column+=l,u.end.row+=s}}}if(0!=s&&g>c)for(;g>c;c++){var u=a[c];u.start.row+=s,u.end.row+=s}}}).call(i.prototype),t.RangeList=i}),define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t){function o(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var o=t||this.getLine(e.row).charAt(e.column-1);if(""==o)return null;var n=o.match(/([\(\[\{])|([\)\]\}])/);return n?n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e):null},this.getBracketRange=function(e){var t,o=this.getLine(e.row),n=!0,r=o.charAt(e.column-1),s=r&&r.match(/([\(\[\{])|([\)\]\}])/);if(s||(r=o.charAt(e.column),e={row:e.row,column:e.column+1},s=r&&r.match(/([\(\[\{])|([\)\]\}])/),n=!1),!s)return null;if(s[1]){var l=this.$findClosingBracket(s[1],e);if(!l)return null;t=i.fromPoints(e,l),n||(t.end.column++,t.start.column--),t.cursor=t.end}else{var l=this.$findOpeningBracket(s[2],e);if(!l)return null;t=i.fromPoints(l,e),n||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(e,t,o){var i=this.$brackets[e],r=1,s=new n(this,t.row,t.column),l=s.getCurrentToken();if(l||(l=s.stepForward()),l){o||(o=new RegExp("(\\.?"+l.type.replace(".","\\.").replace("rparen",".paren")+")+"));for(var a=t.column-s.getCurrentTokenColumn()-2,c=l.value;;){for(;a>=0;){var g=c.charAt(a);if(g==i){if(r-=1,0==r)return{row:s.getCurrentTokenRow(),column:a+s.getCurrentTokenColumn()}}else g==e&&(r+=1);a-=1}do l=s.stepBackward();while(l&&!o.test(l.type));if(null==l)break;c=l.value,a=c.length-1}return null}},this.$findClosingBracket=function(e,t,o){var i=this.$brackets[e],r=1,s=new n(this,t.row,t.column),l=s.getCurrentToken();if(l||(l=s.stepForward()),l){o||(o=new RegExp("(\\.?"+l.type.replace(".","\\.").replace("lparen",".paren")+")+"));for(var a=t.column-s.getCurrentTokenColumn();;){for(var c=l.value,g=c.length;g>a;){var u=c.charAt(a);if(u==i){if(r-=1,0==r)return{row:s.getCurrentTokenRow(),column:a+s.getCurrentTokenColumn()}}else u==e&&(r+=1);a+=1}do l=s.stepForward();while(l&&!o.test(l.type));if(null==l)break;a=0}return null}}}var n=e("../token_iterator").TokenIterator,i=e("../range").Range;t.BracketMatch=o}),define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t){var o=e("./lib/lang"),n=e("./lib/oop"),i=e("./range").Range,r=function(){this.$options={}};(function(){this.set=function(e){return n.mixin(this.$options,e),this},this.getOptions=function(){return o.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$matchIterator(e,this.$options);if(!t)return!1;var o=null;return t.forEach(function(e,t,n){if(e.start)o=e;else{var r=e.offset+(n||0);o=new i(t,r,t,r+e.length)}return!0}),o},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,r=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),s=[],l=t.re;if(t.$isMultiLine)for(var a=l.length,c=r.length-a,g=l.offset||0;c>=g;g++){for(var u=0;a>u&&-1!=r[g+u].search(l[u]);u++);var h=r[g],d=r[g+a-1],p=h.match(l[0])[0].length,f=d.match(l[a-1])[0].length;s.push(new i(g,h.length-p,g+a-1,f))}else for(var m=0;m<r.length;m++)for(var y=o.getMatchOffsets(r[m],l),u=0;u<y.length;u++){var _=y[u];s.push(new i(m,_.offset,m,_.offset+_.length))
@@ -32,8 +32,8 @@ break;case goog.events.KeyCodes.BACKSPACE:e=this.buffer_.length-1,t=!0,e>0?(this
32
32
  }}},Blockly.Flyout.prototype.wheel_=function(e){var t=e.deltaY||-e.wheelDeltaY;if(t){goog.userAgent.GECKO&&(t*=10);var o=this.getMetrics_(),t=o.viewTop+t,t=Math.min(t,o.contentHeight-o.viewHeight),t=Math.max(t,0);this.scrollbar_.set(t),e.preventDefault()}},Blockly.Flyout.prototype.isVisible=function(){return this.svgGroup_&&"block"==this.svgGroup_.style.display},Blockly.Flyout.prototype.hide=function(){if(this.isVisible()){this.svgGroup_.style.display="none";for(var e,t=0;e=this.listeners_[t];t++)Blockly.unbindEvent_(e);this.listeners_.length=0,this.reflowWrapper_&&(Blockly.unbindEvent_(this.reflowWrapper_),this.reflowWrapper_=null)}},Blockly.Flyout.prototype.show=function(e){this.hide();for(var t,o=this.workspace_.getTopBlocks(!1),n=0;t=o[n];n++)t.workspace==this.workspace_&&t.dispose(!1,!1);for(var i,n=0;i=this.buttons_[n];n++)goog.dom.removeNode(i);this.buttons_.length=0;var r=this.CORNER_RADIUS;this.svgGroup_.style.display="block";var o=[],s=[];if(e==Blockly.Variables.NAME_TYPE)Blockly.Variables.flyoutCategory(o,s,r,this.workspace_);else if(e==Blockly.Procedures.NAME_TYPE)Blockly.Procedures.flyoutCategory(o,s,r,this.workspace_);else for(var l=0;t=e[l];l++)t.tagName&&"BLOCK"==t.tagName.toUpperCase()&&(t=Blockly.Xml.domToBlock(this.workspace_,t),o.push(t),s.push(3*r));for(e=r,l=0;t=o[l];l++){n=t.getDescendants(),i=0;for(var a;a=n[i];i++)a.isInFlyout=!0,a.setCommentText(null);t.render(),a=t.getSvgRoot(),i=t.getHeightWidth(),n=Blockly.RTL?0:r+Blockly.BlockSvg.TAB_WIDTH,t.moveBy(n,e),e+=i.height+s[l],i=Blockly.createSvgElement("rect",{"fill-opacity":0},null),this.workspace_.getCanvas().insertBefore(i,t.getSvgRoot()),t.flyoutRect_=i,this.buttons_[l]=i,this.autoClose?this.listeners_.push(Blockly.bindEvent_(a,"mousedown",null,this.createBlockFunc_(t))):this.listeners_.push(Blockly.bindEvent_(a,"mousedown",null,this.blockMouseDown_(t))),this.listeners_.push(Blockly.bindEvent_(a,"mouseover",t,t.addSelect)),this.listeners_.push(Blockly.bindEvent_(a,"mouseout",t,t.removeSelect)),this.listeners_.push(Blockly.bindEvent_(i,"mousedown",null,this.createBlockFunc_(t))),this.listeners_.push(Blockly.bindEvent_(i,"mouseover",t,t.addSelect)),this.listeners_.push(Blockly.bindEvent_(i,"mouseout",t,t.removeSelect))}this.listeners_.push(Blockly.bindEvent_(this.svgBackground_,"mouseover",this,function(e){e=this.workspace_.getTopBlocks(!1);for(var t,o=0;t=e[o];o++)t.removeSelect()})),this.width_=0,this.reflow(),this.filterForCapacity_(),Blockly.fireUiEventNow(window,"resize"),this.reflowWrapper_=Blockly.bindEvent_(this.workspace_.getCanvas(),"blocklyWorkspaceChange",this,this.reflow),this.workspace_.fireChangeEvent()},Blockly.Flyout.prototype.reflow=function(){for(var e,t=0,o=this.CORNER_RADIUS,n=this.workspace_.getTopBlocks(!1),i=0;e=n[i];i++){e.getSvgRoot();var r=e.getHeightWidth(),t=Math.max(t,r.width)}if(t+=o+Blockly.BlockSvg.TAB_WIDTH+o/2+Blockly.Scrollbar.scrollbarThickness,this.width_!=t){for(i=0;e=n[i];i++){var r=e.getHeightWidth(),s=e.getRelativeToSurfaceXY();if(Blockly.RTL){var l=t-o-Blockly.BlockSvg.TAB_WIDTH-s.x;e.moveBy(l,0),s.x+=l}e.flyoutRect_&&(e.flyoutRect_.setAttribute("width",r.width),e.flyoutRect_.setAttribute("height",r.height),e.flyoutRect_.setAttribute("x",Blockly.RTL?s.x-r.width:s.x),e.flyoutRect_.setAttribute("y",s.y))}this.width_=t,Blockly.fireUiEvent(window,"resize")}},Blockly.Flyout.prototype.blockMouseDown_=function(e){var t=this;return function(o){Blockly.terminateDrag_(),Blockly.hideChaff(),Blockly.isRightButton(o)?e.showContextMenu_(o):(Blockly.removeAllRanges(),Blockly.Css.setCursor(Blockly.Css.Cursor.CLOSED),Blockly.Flyout.startDownEvent_=o,Blockly.Flyout.startBlock_=e,Blockly.Flyout.startFlyout_=t,Blockly.Flyout.onMouseUpWrapper_=Blockly.bindEvent_(document,"mouseup",this,Blockly.terminateDrag_),Blockly.Flyout.onMouseMoveBlockWrapper_=Blockly.bindEvent_(document,"mousemove",this,t.onMouseMoveBlock_)),o.stopPropagation()}},Blockly.Flyout.prototype.onMouseDown_=function(e){Blockly.isRightButton(e)||(Blockly.hideChaff(!0),Blockly.Flyout.terminateDrag_(),this.startDragMouseY_=e.clientY,Blockly.Flyout.onMouseMoveWrapper_=Blockly.bindEvent_(document,"mousemove",this,this.onMouseMove_),Blockly.Flyout.onMouseUpWrapper_=Blockly.bindEvent_(document,"mouseup",this,Blockly.Flyout.terminateDrag_),e.preventDefault(),e.stopPropagation())},Blockly.Flyout.prototype.onMouseMove_=function(e){var t=e.clientY-this.startDragMouseY_;this.startDragMouseY_=e.clientY,e=this.getMetrics_(),t=e.viewTop-t,t=Math.min(t,e.contentHeight-e.viewHeight),t=Math.max(t,0),this.scrollbar_.set(t)},Blockly.Flyout.prototype.onMouseMoveBlock_=function(e){if("mousemove"==e.type&&1>=e.clientX&&0==e.clientY&&0==e.button)e.stopPropagation();else{Blockly.removeAllRanges();var t=e.clientY-Blockly.Flyout.startDownEvent_.clientY;Math.sqrt(Math.pow(e.clientX-Blockly.Flyout.startDownEvent_.clientX,2)+Math.pow(t,2))>Blockly.DRAG_RADIUS&&Blockly.Flyout.startFlyout_.createBlockFunc_(Blockly.Flyout.startBlock_)(Blockly.Flyout.startDownEvent_)}},Blockly.Flyout.prototype.createBlockFunc_=function(e){var t=this;return function(o){if(!Blockly.isRightButton(o)&&!e.disabled){var n=Blockly.Xml.blockToDom_(e),n=Blockly.Xml.domToBlock(t.targetWorkspace_,n),i=e.getSvgRoot();if(!i)throw"originBlock is not rendered.";var i=Blockly.getSvgXY_(i),r=n.getSvgRoot();if(!r)throw"block is not rendered.";r=Blockly.getSvgXY_(r),n.moveBy(i.x-r.x,i.y-r.y),t.autoClose?t.hide():t.filterForCapacity_(),n.onMouseDown_(o)}}},Blockly.Flyout.prototype.filterForCapacity_=function(){for(var e,t=this.targetWorkspace_.remainingCapacity(),o=this.workspace_.getTopBlocks(!1),n=0;e=o[n];n++){var i=e.getDescendants().length>t;e.setDisabled(i)}},Blockly.Flyout.terminateDrag_=function(){Blockly.Flyout.onMouseUpWrapper_&&(Blockly.unbindEvent_(Blockly.Flyout.onMouseUpWrapper_),Blockly.Flyout.onMouseUpWrapper_=null),Blockly.Flyout.onMouseMoveBlockWrapper_&&(Blockly.unbindEvent_(Blockly.Flyout.onMouseMoveBlockWrapper_),Blockly.Flyout.onMouseMoveBlockWrapper_=null),Blockly.Flyout.onMouseMoveWrapper_&&(Blockly.unbindEvent_(Blockly.Flyout.onMouseMoveWrapper_),Blockly.Flyout.onMouseMoveWrapper_=null),Blockly.Flyout.onMouseUpWrapper_&&(Blockly.unbindEvent_(Blockly.Flyout.onMouseUpWrapper_),Blockly.Flyout.onMouseUpWrapper_=null),Blockly.Flyout.startDownEvent_=null,Blockly.Flyout.startBlock_=null,Blockly.Flyout.startFlyout_=null},Blockly.Flyout.prototype.getRect=function(){var e=Blockly.getSvgXY_(this.svgGroup_).x;return Blockly.RTL||(e-=1e7),new goog.math.Rect(e,-1e7,1e7+this.width_,this.height_+2e7)},Blockly.Toolbox=function(e,t){this.HtmlDiv=goog.dom.createDom("div","blocklyToolboxDiv"),this.HtmlDiv.setAttribute("dir",Blockly.RTL?"RTL":"LTR"),t.appendChild(this.HtmlDiv),this.flyout_=new Blockly.Flyout,e.appendChild(this.flyout_.createDom()),Blockly.bindEvent_(this.HtmlDiv,"mousedown",this,function(e){Blockly.isRightButton(e)||e.target==this.HtmlDiv?Blockly.hideChaff(!1):Blockly.hideChaff(!0)})},Blockly.Toolbox.prototype.width=0,Blockly.Toolbox.prototype.selectedOption_=null,Blockly.Toolbox.prototype.CONFIG_={indentWidth:19,cssRoot:"blocklyTreeRoot",cssHideRoot:"blocklyHidden",cssItem:"",cssTreeRow:"blocklyTreeRow",cssItemLabel:"blocklyTreeLabel",cssTreeIcon:"blocklyTreeIcon",cssExpandedFolderIcon:"blocklyTreeIconOpen",cssFileIcon:"blocklyTreeIconNone",cssSelectedRow:"blocklyTreeSelected"},Blockly.Toolbox.prototype.init=function(e){this.CONFIG_.cleardotPath=Blockly.pathToMedia+"1x1.gif",this.CONFIG_.cssCollapsedFolderIcon="blocklyTreeIconClosed"+(Blockly.RTL?"Rtl":"Ltr");var t=new Blockly.Toolbox.TreeControl(this,this.CONFIG_);this.tree_=t,t.setShowRootNode(!1),t.setShowLines(!1),t.setShowExpandIcons(!1),t.setSelectedItem(null),this.HtmlDiv.style.display="block",this.flyout_.init(e),this.populate_(),t.render(this.HtmlDiv);var o=this;goog.events.listen(window,goog.events.EventType.RESIZE,function(){o.position_()}),this.position_()},Blockly.Toolbox.prototype.position_=function(){var e=this.HtmlDiv,t=goog.style.getBorderBox(Blockly.svg),o=Blockly.svgSize();Blockly.RTL?(t=Blockly.convertCoordinates(0,0,!1),e.style.left=t.x+o.width-e.offsetWidth+"px"):e.style.marginLeft=t.left,e.style.height=o.height+1+"px",this.width=e.offsetWidth,Blockly.RTL||--this.width},Blockly.Toolbox.prototype.populate_=function(){function e(o,n){for(var i,r=0;i=o.childNodes[r];r++)if(i.tagName){var s=i.tagName.toUpperCase();if("CATEGORY"==s){s=t.createNode(i.getAttribute("name")),s.blocks=[],n.add(s);var l=i.getAttribute("custom");l?s.blocks=l:e(i,s)}else"HR"==s?console.warn("The <hr> separator tag in the toolbox XML needs to be changed to <sep></sep> (due to a bug in IE)."):"SEP"==s?n.add(new Blockly.Toolbox.TreeSeparator):"BLOCK"==s&&n.blocks.push(i)}}var t=this.tree_;if(t.removeChildren(),t.blocks=[],e(Blockly.languageTree,this.tree_),t.blocks.length)throw"Toolbox cannot have both blocks and categories in the root level.";Blockly.fireUiEvent(window,"resize")},Blockly.Toolbox.prototype.clearSelection=function(){this.tree_.setSelectedItem(null)},Blockly.Toolbox.prototype.getRect=function(){var e=Blockly.RTL?Blockly.svgSize().width-this.width:-1e7;return new goog.math.Rect(e,-1e7,1e7+this.width,2e7)},Blockly.Toolbox.TreeControl=function(e,t){this.toolbox_=e,goog.ui.tree.TreeControl.call(this,goog.html.SafeHtml.EMPTY,t)},goog.inherits(Blockly.Toolbox.TreeControl,goog.ui.tree.TreeControl),Blockly.Toolbox.TreeControl.prototype.enterDocument=function(){if(Blockly.Toolbox.TreeControl.superClass_.enterDocument.call(this),goog.events.BrowserFeature.TOUCH_ENABLED){var e=this.getElement();Blockly.bindEvent_(e,goog.events.EventType.TOUCHSTART,this,this.handleTouchEvent_)}},Blockly.Toolbox.TreeControl.prototype.handleTouchEvent_=function(e){e.preventDefault();var t=this.getNodeFromEvent_(e);t&&e.type===goog.events.EventType.TOUCHSTART&&setTimeout(function(){t.onMouseDown(e)},1)},Blockly.Toolbox.TreeControl.prototype.createNode=function(e){return new Blockly.Toolbox.TreeNode(this.toolbox_,e?goog.html.SafeHtml.htmlEscape(e):goog.html.SafeHtml.EMPTY,this.getConfig(),this.getDomHelper())},Blockly.Toolbox.TreeControl.prototype.setSelectedItem=function(e){this.selectedItem_!=e&&(goog.ui.tree.TreeControl.prototype.setSelectedItem.call(this,e),e&&e.blocks&&e.blocks.length?this.toolbox_.flyout_.show(e.blocks):this.toolbox_.flyout_.hide())},Blockly.Toolbox.TreeNode=function(e,t,o,n){goog.ui.tree.TreeNode.call(this,t,o,n),e&&(t=function(){Blockly.fireUiEvent(window,"resize")},goog.events.listen(e.tree_,goog.ui.tree.BaseNode.EventType.EXPAND,t),goog.events.listen(e.tree_,goog.ui.tree.BaseNode.EventType.COLLAPSE,t))},goog.inherits(Blockly.Toolbox.TreeNode,goog.ui.tree.TreeNode),goog.ui.tree.BaseNode.prototype.getExpandIconSafeHtml=function(){return goog.html.SafeHtml.create("span")},Blockly.Toolbox.TreeNode.prototype.onMouseDown=function(){this.hasChildren()&&this.isUserCollapsible_?(this.toggle(),this.select()):this.isSelected()?this.getTree().setSelectedItem(null):this.select(),this.updateRow()},Blockly.Toolbox.TreeNode.prototype.onDoubleClick_=function(){},Blockly.Toolbox.TreeSeparator=function(){Blockly.Toolbox.TreeNode.call(this,null,"",Blockly.Toolbox.TreeSeparator.CONFIG_)},goog.inherits(Blockly.Toolbox.TreeSeparator,Blockly.Toolbox.TreeNode),Blockly.Toolbox.TreeSeparator.CONFIG_={cssTreeRow:"blocklyTreeSeparator"},Blockly.Css={},Blockly.Css.Cursor={OPEN:"handopen",CLOSED:"handclosed",DELETE:"handdelete"},Blockly.Css.currentCursor_="",Blockly.Css.styleSheet_=null,Blockly.Css.mediaPath_="",Blockly.Css.inject=function(){var e=".blocklyDraggable {}\n";Blockly.hasCss&&(e+=Blockly.Css.CONTENT.join("\n")),Blockly.Css.mediaPath_=Blockly.pathToMedia.replace(/[\\\/]$/,""),e=e.replace(/<<<PATH>>>/g,Blockly.Css.mediaPath_),Blockly.Css.styleSheet_=goog.cssom.addCssText(e).sheet,Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN)},Blockly.Css.setCursor=function(e){if(!Blockly.readOnly&&Blockly.Css.currentCursor_!=e){Blockly.Css.currentCursor_=e;var t="url("+Blockly.Css.mediaPath_+"/"+e+".cur) "+(e==Blockly.Css.Cursor.OPEN?"8 5":"7 3")+", auto";goog.cssom.replaceCssRule("",".blocklyDraggable {\n cursor: "+t+";\n}\n",Blockly.Css.styleSheet_,0);for(var o,n=document.getElementsByClassName("blocklyToolboxDiv"),i=0;o=n[i];i++)o.style.cursor=e==Blockly.Css.Cursor.OPEN?"":t;Blockly.svg&&(Blockly.svg.style.cursor=e==Blockly.Css.Cursor.OPEN?"":t)}},Blockly.Css.CONTENT=[".blocklySvg {"," background-color: #fff;"," border: 1px solid #ddd;"," overflow: hidden;","}",".blocklyWidgetDiv {"," display: none;"," position: absolute;"," z-index: 999;","}",".blocklyResizeSE {"," cursor: se-resize;"," fill: #aaa;","}",".blocklyResizeSW {"," cursor: sw-resize;"," fill: #aaa;","}",".blocklyResizeLine {"," stroke: #888;"," stroke-width: 1;","}",".blocklyHighlightedConnectionPath {"," fill: none;"," stroke: #fc3;"," stroke-width: 4px;","}",".blocklyPathLight {"," fill: none;"," stroke-linecap: round;"," stroke-width: 2;","}",".blocklySelected>.blocklyPath {"," stroke: #fc3;"," stroke-width: 3px;","}",".blocklySelected>.blocklyPathLight {"," display: none;","}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {"," fill-opacity: .8;"," stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {"," display: none;","}",".blocklyDisabled>.blocklyPath {"," fill-opacity: .5;"," stroke-opacity: .5;","}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {"," display: none;","}",".blocklyText {"," cursor: default;"," fill: #fff;"," font-family: sans-serif;"," font-size: 11pt;","}",".blocklyNonEditableText>text {"," pointer-events: none;","}",".blocklyNonEditableText>rect,",".blocklyEditableText>rect {"," fill: #fff;"," fill-opacity: .6;","}",".blocklyNonEditableText>text,",".blocklyEditableText>text {"," fill: #000;","}",".blocklyEditableText:hover>rect {"," stroke: #fff;"," stroke-width: 2;","}",".blocklyBubbleText {"," fill: #000;","}",".blocklySvg text {"," user-select: none;"," -moz-user-select: none;"," -webkit-user-select: none;"," cursor: inherit;","}",".blocklyHidden {"," display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {"," display: block;","}",".blocklyTooltipBackground {"," fill: #ffffc7;"," stroke: #d8d8d8;"," stroke-width: 1px;","}",".blocklyTooltipShadow,",".blocklyDropdownMenuShadow {"," fill: #bbb;"," filter: url(#blocklyShadowFilter);","}",".blocklyTooltipText {"," fill: #000;"," font-family: sans-serif;"," font-size: 9pt;","}",".blocklyIconShield {"," cursor: default;"," fill: #00c;"," stroke: #ccc;"," stroke-width: 1px;","}",".blocklyIconGroup:hover>.blocklyIconShield {"," fill: #00f;"," stroke: #fff;","}",".blocklyIconGroup:hover>.blocklyIconMark {"," fill: #fff;","}",".blocklyIconMark {"," cursor: default !important;"," fill: #ccc;"," font-family: sans-serif;"," font-size: 9pt;"," font-weight: bold;"," text-anchor: middle;","}",".blocklyWarningBody {","}",".blocklyMinimalBody {"," margin: 0;"," padding: 0;","}",".blocklyCommentTextarea {"," background-color: #ffc;"," border: 0;"," margin: 0;"," padding: 2px;"," resize: none;","}",".blocklyHtmlInput {"," border: none;"," font-family: sans-serif;"," font-size: 11pt;"," outline: none;"," width: 100%","}",".blocklyMutatorBackground {"," fill: #fff;"," stroke: #ddd;"," stroke-width: 1;","}",".blocklyFlyoutBackground {"," fill: #ddd;"," fill-opacity: .8;","}",".blocklyColourBackground {"," fill: #666;","}",".blocklyScrollbarBackground {"," fill: #fff;"," stroke: #e4e4e4;"," stroke-width: 1;","}",".blocklyScrollbarKnob {"," fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarKnob,",".blocklyScrollbarKnob:hover {"," fill: #bbb;","}",".blocklyInvalidInput {"," background: #faa;","}",".blocklyAngleCircle {"," stroke: #444;"," stroke-width: 1;"," fill: #ddd;"," fill-opacity: .8;","}",".blocklyAngleMarks {"," stroke: #444;"," stroke-width: 1;","}",".blocklyAngleGauge {"," fill: #f88;"," fill-opacity: .8; ","}",".blocklyAngleLine {"," stroke: #f00;"," stroke-width: 2;"," stroke-linecap: round;","}",".blocklyContextMenu {"," border-radius: 4px;","}",".blocklyDropdownMenu {"," padding: 0 !important;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {"," background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px !important;","}",".blocklyToolboxDiv {"," background-color: #ddd;"," display: none;"," overflow-x: visible;"," overflow-y: auto;"," position: absolute;","}",".blocklyTreeRoot {"," padding: 4px 0;","}",".blocklyTreeRoot:focus {"," outline: none;","}",".blocklyTreeRow {"," line-height: 22px;"," height: 22px;"," padding-right: 1em;"," white-space: nowrap;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {'," padding-right: 0;"," padding-left: 1em !important;","}",".blocklyTreeRow:hover {"," background-color: #e4e4e4;","}",".blocklyTreeSeparator {"," border-bottom: solid #e5e5e5 1px;"," height: 0px;"," margin: 5px 0;","}",".blocklyTreeIcon {"," background-image: url(<<<PATH>>>/sprites.png);"," height: 16px;"," vertical-align: middle;"," width: 16px;","}",".blocklyTreeIconClosedLtr {"," background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {"," background-position: 0px -1px;","}",".blocklyTreeIconOpen {"," background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {"," background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {"," background-position: 0px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {"," background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {"," background-position: -48px -1px;","}",".blocklyTreeLabel {"," cursor: default;"," font-family: sans-serif;"," font-size: 16px;"," padding: 0 3px;"," vertical-align: middle;","}",".blocklyTreeSelected {"," background-color: #57e !important;","}",".blocklyTreeSelected .blocklyTreeLabel {"," color: #fff;","}",".blocklyWidgetDiv .goog-palette {"," outline: none;"," cursor: default;","}",".blocklyWidgetDiv .goog-palette-table {"," border: 1px solid #666;"," border-collapse: collapse;","}",".blocklyWidgetDiv .goog-palette-cell {"," height: 13px;"," width: 15px;"," margin: 0;"," border: 0;"," text-align: center;"," vertical-align: middle;"," border-right: 1px solid #666;"," font-size: 1px;","}",".blocklyWidgetDiv .goog-palette-colorswatch {"," position: relative;"," height: 13px;"," width: 15px;"," border: 1px solid #666;","}",".blocklyWidgetDiv .goog-palette-cell-hover .goog-palette-colorswatch {"," border: 1px solid #FFF;","}",".blocklyWidgetDiv .goog-palette-cell-selected .goog-palette-colorswatch {"," border: 1px solid #000;"," color: #fff;","}",".blocklyWidgetDiv .goog-menu {"," background: #fff;"," border-color: #ccc #666 #666 #ccc;"," border-style: solid;"," border-width: 1px;"," cursor: default;"," font: normal 13px Arial, sans-serif;"," margin: 0;"," outline: none;"," padding: 4px 0;"," position: absolute;"," z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem {"," color: #000;"," font: normal 13px Arial, sans-serif;"," list-style: none;"," margin: 0;"," padding: 4px 7em 4px 28px;"," white-space: nowrap;","}",".blocklyWidgetDiv .goog-menuitem.goog-menuitem-rtl {"," padding-left: 7em;"," padding-right: 28px;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem {"," padding-left: 12px;","}",".blocklyWidgetDiv .goog-menu-noaccel .goog-menuitem {"," padding-right: 20px;","}",".blocklyWidgetDiv .goog-menuitem-content {"," color: #000;"," font: normal 13px Arial, sans-serif;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-accel,",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content {"," color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon {"," opacity: 0.3;"," -moz-opacity: 0.3;"," filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight,",".blocklyWidgetDiv .goog-menuitem-hover {"," background-color: #d6e9f8;"," border-color: #d6e9f8;"," border-style: dotted;"," border-width: 1px 0;"," padding-bottom: 3px;"," padding-top: 3px;","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon {"," background-repeat: no-repeat;"," height: 16px;"," left: 6px;"," position: absolute;"," right: auto;"," vertical-align: middle;"," width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon {"," left: auto;"," right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {"," background: url(//ssl.gstatic.com/editor/editortoolbar.png) no-repeat -512px 0;","}",".blocklyWidgetDiv .goog-menuitem-accel {"," color: #999;"," direction: ltr;"," left: auto;"," padding: 0 6px;"," position: absolute;"," right: 0;"," text-align: right;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-accel {"," left: 0;"," right: auto;"," text-align: left;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-hint {"," text-decoration: underline;","}",".blocklyWidgetDiv .goog-menuitem-mnemonic-separator {"," color: #999;"," font-size: 12px;"," padding-left: 4px;","}",".blocklyWidgetDiv .goog-menuseparator {"," border-top: 1px solid #ccc;"," margin: 4px 0;"," padding: 0;","}",""],Blockly.WidgetDiv={},Blockly.WidgetDiv.DIV=null,Blockly.WidgetDiv.owner_=null,Blockly.WidgetDiv.dispose_=null,Blockly.WidgetDiv.show=function(e,t){Blockly.WidgetDiv.hide(),Blockly.WidgetDiv.owner_=e,Blockly.WidgetDiv.dispose_=t,Blockly.WidgetDiv.DIV.style.display="block"},Blockly.WidgetDiv.hide=function(){Blockly.WidgetDiv.owner_&&(Blockly.WidgetDiv.DIV.style.display="none",Blockly.WidgetDiv.dispose_&&Blockly.WidgetDiv.dispose_(),Blockly.WidgetDiv.owner_=null,Blockly.WidgetDiv.dispose_=null,goog.dom.removeChildren(Blockly.WidgetDiv.DIV))},Blockly.WidgetDiv.isVisible=function(){return!!Blockly.WidgetDiv.owner_},Blockly.WidgetDiv.hideIfOwner=function(e){Blockly.WidgetDiv.owner_==e&&Blockly.WidgetDiv.hide()},Blockly.WidgetDiv.position=function(e,t,o,n){t<n.y&&(t=n.y),Blockly.RTL?e>o.width+n.x&&(e=o.width+n.x):e<n.x&&(e=n.x),Blockly.WidgetDiv.DIV.style.left=e+"px",Blockly.WidgetDiv.DIV.style.top=t+"px"},Blockly.inject=function(e,t){if(!goog.dom.contains(document,e))throw"Error: container is not in current document.";t&&Blockly.parseOptions_(t);var o=function(){Blockly.createDom_(e),Blockly.init_()};if(Blockly.enableRealtime){var n=document.getElementById("realtime");n&&(n.style.display="block"),Blockly.Realtime.startRealtime(o,e,Blockly.realtimeOptions)}else o()},Blockly.parseToolboxTree_=function(e){return e?("string"!=typeof e&&"undefined"==typeof XSLTProcessor&&(e=e.outerHTML),"string"==typeof e&&(e=Blockly.Xml.textToDom(e))):e=null,e},Blockly.parseOptions_=function(e){var t=!!e.readOnly;if(t)var o=!1,n=!1,i=!1,r=!1,s=!1,l=null;else l=Blockly.parseToolboxTree_(e.toolbox),o=Boolean(l&&l.getElementsByTagName("category").length),n=e.trashcan,void 0===n&&(n=o),i=e.collapse,void 0===i&&(i=o),r=e.comments,void 0===r&&(r=o),s=e.disable,void 0===s&&(s=o);var a=e.scrollbars;void 0===a&&(a=o);var c=e.sounds;void 0===c&&(c=!0);var g=e.css;void 0===g&&(g=!0);var u=!!e.realtime,h=u?e.realtimeOptions:void 0;Blockly.RTL=!!e.rtl,Blockly.collapse=i,Blockly.comments=r,Blockly.disable=s,Blockly.readOnly=t,Blockly.maxBlocks=e.maxBlocks||1/0,e.media?Blockly.pathToMedia=e.media:e.path&&(Blockly.pathToMedia=e.path+"media/"),Blockly.hasCategories=o,Blockly.hasScrollbars=a,Blockly.hasTrashcan=n,Blockly.hasSounds=c,Blockly.hasCss=g,Blockly.languageTree=l,Blockly.enableRealtime=u,Blockly.realtimeOptions=h},Blockly.createDom_=function(e){e.setAttribute("dir","LTR"),goog.ui.Component.setDefaultRightToLeft(Blockly.RTL),Blockly.Css.inject();var t,o,n=Blockly.createSvgElement("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:html":"http://www.w3.org/1999/xhtml","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1","class":"blocklySvg"},null),i=Blockly.createSvgElement("defs",{},n);t=Blockly.createSvgElement("filter",{id:"blocklyEmboss"},i),Blockly.createSvgElement("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:1,result:"blur"},t),o=Blockly.createSvgElement("feSpecularLighting",{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},t),Blockly.createSvgElement("fePointLight",{x:-5e3,y:-1e4,z:2e4},o),Blockly.createSvgElement("feComposite",{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},t),Blockly.createSvgElement("feComposite",{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},t),t=Blockly.createSvgElement("filter",{id:"blocklyTrashcanShadowFilter"},i),Blockly.createSvgElement("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:2,result:"blur"},t),Blockly.createSvgElement("feOffset",{"in":"blur",dx:1,dy:1,result:"offsetBlur"},t),t=Blockly.createSvgElement("feMerge",{},t),Blockly.createSvgElement("feMergeNode",{"in":"offsetBlur"},t),Blockly.createSvgElement("feMergeNode",{"in":"SourceGraphic"},t),t=Blockly.createSvgElement("filter",{id:"blocklyShadowFilter"},i),Blockly.createSvgElement("feGaussianBlur",{stdDeviation:2},t),i=Blockly.createSvgElement("pattern",{id:"blocklyDisabledPattern",patternUnits:"userSpaceOnUse",width:10,height:10},i),Blockly.createSvgElement("rect",{width:10,height:10,fill:"#aaa"},i),Blockly.createSvgElement("path",{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},i),Blockly.mainWorkspace=new Blockly.WorkspaceSvg(Blockly.getMainWorkspaceMetrics_,Blockly.setMainWorkspaceMetrics_),n.appendChild(Blockly.mainWorkspace.createDom()),Blockly.mainWorkspace.maxBlocks=Blockly.maxBlocks,Blockly.readOnly||(Blockly.hasCategories?Blockly.mainWorkspace.toolbox_=new Blockly.Toolbox(n,e):Blockly.languageTree&&(Blockly.mainWorkspace.flyout_=new Blockly.Flyout,i=Blockly.mainWorkspace.flyout_,t=i.createDom(),i.autoClose=!1,goog.dom.insertSiblingBefore(t,Blockly.mainWorkspace.svgGroup_)),Blockly.hasScrollbars||Blockly.addChangeListener(function(){if(0==Blockly.dragMode_){var e=Blockly.mainWorkspace.getMetrics(),t=e.viewLeft+e.absoluteLeft,o=e.viewTop+e.absoluteTop;if(e.contentTop<o||e.contentTop+e.contentHeight>e.viewHeight+o||e.contentLeft<(Blockly.RTL?e.viewLeft:t)||e.contentLeft+e.contentWidth>(Blockly.RTL?e.viewWidth:e.viewWidth+t))for(var n,i=Blockly.mainWorkspace.getTopBlocks(!1),r=0;n=i[r];r++){var s=n.getRelativeToSurfaceXY(),l=n.getHeightWidth(),a=o+25-l.height-s.y;a>0&&n.moveBy(0,a),a=o+e.viewHeight-25-s.y,0>a&&n.moveBy(0,a),a=25+t-s.x-(Blockly.RTL?0:l.width),a>0&&n.moveBy(a,0),a=t+e.viewWidth-25-s.x+(Blockly.RTL?l.width:0),0>a&&n.moveBy(a,0)}}})),n.appendChild(Blockly.Tooltip.createDom()),e.appendChild(n),Blockly.svg=n,Blockly.svgResize(),Blockly.WidgetDiv.DIV=goog.dom.createDom("div","blocklyWidgetDiv"),Blockly.WidgetDiv.DIV.style.direction=Blockly.RTL?"rtl":"ltr",document.body.appendChild(Blockly.WidgetDiv.DIV)},Blockly.init_=function(){if(Blockly.bindEvent_(Blockly.svg,"mousedown",null,Blockly.onMouseDown_),Blockly.bindEvent_(Blockly.svg,"contextmenu",null,Blockly.onContextMenu_),Blockly.bindEvent_(Blockly.WidgetDiv.DIV,"contextmenu",null,Blockly.onContextMenu_),Blockly.documentEventsBound_||(Blockly.bindEvent_(window,"resize",document,Blockly.svgResize),Blockly.bindEvent_(document,"keydown",null,Blockly.onKeyDown_),document.addEventListener("mouseup",Blockly.onMouseUp_,!1),goog.userAgent.IPAD&&Blockly.bindEvent_(window,"orientationchange",document,function(){Blockly.fireUiEvent(window,"resize")}),Blockly.documentEventsBound_=!0),Blockly.languageTree)if(Blockly.mainWorkspace.toolbox_)Blockly.mainWorkspace.toolbox_.init(Blockly.mainWorkspace);else if(Blockly.mainWorkspace.flyout_){Blockly.mainWorkspace.flyout_.init(Blockly.mainWorkspace),Blockly.mainWorkspace.flyout_.show(Blockly.languageTree.childNodes),Blockly.mainWorkspace.scrollX=Blockly.mainWorkspace.flyout_.width_,Blockly.RTL&&(Blockly.mainWorkspace.scrollX*=-1);var e="translate("+Blockly.mainWorkspace.scrollX+", 0)";Blockly.mainWorkspace.getCanvas().setAttribute("transform",e),Blockly.mainWorkspace.getBubbleCanvas().setAttribute("transform",e)}if(Blockly.hasScrollbars&&(Blockly.mainWorkspace.scrollbar=new Blockly.ScrollbarPair(Blockly.mainWorkspace),Blockly.mainWorkspace.scrollbar.resize()),Blockly.mainWorkspace.addTrashcan(),Blockly.hasSounds){Blockly.loadAudio_([Blockly.pathToMedia+"click.mp3",Blockly.pathToMedia+"click.wav",Blockly.pathToMedia+"click.ogg"],"click"),Blockly.loadAudio_([Blockly.pathToMedia+"delete.mp3",Blockly.pathToMedia+"delete.ogg",Blockly.pathToMedia+"delete.wav"],"delete");var t=[],e=function(){for(;t.length;)Blockly.unbindEvent_(t.pop());Blockly.preloadAudio_()};t.push(Blockly.bindEvent_(document,"mousemove",null,e)),t.push(Blockly.bindEvent_(document,"touchstart",null,e))}},Blockly.updateToolbox=function(e){if(e=Blockly.parseToolboxTree_(e)){if(!Blockly.languageTree)throw"Existing toolbox is null. Can't create new toolbox.";if(e.getElementsByTagName("category").length){if(!Blockly.hasCategories)throw"Existing toolbox has no categories. Can't change mode.";Blockly.languageTree=e,Blockly.mainWorkspace.toolbox_.populate_()}else{if(Blockly.hasCategories)throw"Existing toolbox has categories. Can't change mode.";Blockly.languageTree=e,Blockly.mainWorkspace.flyout_.show(Blockly.languageTree.childNodes)}}else if(Blockly.languageTree)throw"Can't nullify an existing toolbox."},Blockly.utils={},Blockly.addClass_=function(e,t){var o=e.getAttribute("class")||"";-1==(" "+o+" ").indexOf(" "+t+" ")&&(o&&(o+=" "),e.setAttribute("class",o+t))},Blockly.removeClass_=function(e,t){var o=e.getAttribute("class");if(-1!=(" "+o+" ").indexOf(" "+t+" ")){for(var o=o.split(/\s+/),n=0;n<o.length;n++)o[n]&&o[n]!=t||(o.splice(n,1),n--);o.length?e.setAttribute("class",o.join(" ")):e.removeAttribute("class")}},Blockly.hasClass_=function(e,t){return-1!=(" "+e.getAttribute("class")+" ").indexOf(" "+t+" ")},Blockly.bindEvent_=function(e,t,o,n){var i=function(e){n.call(o,e)};e.addEventListener(t,i,!1);var r=[[e,t,i]];if(t in Blockly.bindEvent_.TOUCH_MAP)for(var s,i=function(e){if(1==e.changedTouches.length){var t=e.changedTouches[0];e.clientX=t.clientX,e.clientY=t.clientY}n.call(o,e),e.preventDefault()},l=0;s=Blockly.bindEvent_.TOUCH_MAP[t][l];l++)e.addEventListener(s,i,!1),r.push([e,s,i]);return r},Blockly.bindEvent_.TOUCH_MAP={},goog.events.BrowserFeature.TOUCH_ENABLED&&(Blockly.bindEvent_.TOUCH_MAP={mousedown:["touchstart"],mousemove:["touchmove"],mouseup:["touchend","touchcancel"]}),Blockly.unbindEvent_=function(e){for(;e.length;){var t=e.pop(),o=t[2];t[0].removeEventListener(t[1],o,!1)}return o},Blockly.fireUiEventNow=function(e,t){var o=Blockly.fireUiEvent.DB_[t];if(o){var n=o.indexOf(e);-1!=n&&o.splice(n,1)}if(document.createEvent)o=document.createEvent("UIEvents"),o.initEvent(t,!0,!0),e.dispatchEvent(o);else{if(!document.createEventObject)throw"FireEvent: No event creation mechanism.";o=document.createEventObject(),e.fireEvent("on"+t,o)}},Blockly.fireUiEvent=function(e,t){var o=Blockly.fireUiEvent.DB_[t];if(o){if(-1!=o.indexOf(e))return;o.push(e)}else Blockly.fireUiEvent.DB_[t]=[e];setTimeout(function(){Blockly.fireUiEventNow(e,t)},0)},Blockly.fireUiEvent.DB_={},Blockly.noEvent=function(e){e.preventDefault(),e.stopPropagation()},Blockly.getRelativeXY_=function(e){var t={x:0,y:0},o=e.getAttribute("x");return o&&(t.x=parseInt(o,10)),(o=e.getAttribute("y"))&&(t.y=parseInt(o,10)),(e=(e=e.getAttribute("transform"))&&e.match(/translate\(\s*([-\d.]+)([ ,]\s*([-\d.]+)\s*\))?/))&&(t.x+=parseInt(e[1],10),e[3]&&(t.y+=parseInt(e[3],10))),t},Blockly.getSvgXY_=function(e){var t=0,o=0;do{var n=Blockly.getRelativeXY_(e),t=t+n.x,o=o+n.y;e=e.parentNode}while(e&&e!=Blockly.svg);return{x:t,y:o}},Blockly.getAbsoluteXY_=function(e){return e=Blockly.getSvgXY_(e),Blockly.convertCoordinates(e.x,e.y,!1)},Blockly.createSvgElement=function(e,t,o){e=document.createElementNS(Blockly.SVG_NS,e);for(var n in t)e.setAttribute(n,t[n]);return document.body.runtimeStyle&&(e.runtimeStyle=e.currentStyle=e.style),o&&o.appendChild(e),e},Blockly.isRightButton=function(e){return 2==e.button||e.ctrlKey},Blockly.convertCoordinates=function(e,t,o){o&&(e-=window.scrollX||window.pageXOffset,t-=window.scrollY||window.pageYOffset);var n=Blockly.svg.createSVGPoint();return n.x=e,n.y=t,e=Blockly.svg.getScreenCTM(),o&&(e=e.inverse()),n=n.matrixTransform(e),o||(n.x+=window.scrollX||window.pageXOffset,n.y+=window.scrollY||window.pageYOffset),n},Blockly.mouseToSvg=function(e){return Blockly.convertCoordinates(e.clientX+(window.scrollX||window.pageXOffset),e.clientY+(window.scrollY||window.pageYOffset),!0)
33
33
  },Blockly.shortestStringLength=function(e){if(!e.length)return 0;for(var t=e[0].length,o=1;o<e.length;o++)t=Math.min(t,e[o].length);return t},Blockly.commonWordPrefix=function(e,t){if(!e.length)return 0;if(1==e.length)return e[0].length;for(var o=0,n=t||Blockly.shortestStringLength(e),i=0;n>i;i++){for(var r=e[0][i],s=1;s<e.length;s++)if(r!=e[s][i])return o;" "==r&&(o=i+1)}for(s=1;s<e.length;s++)if((r=e[s][i])&&" "!=r)return o;return n},Blockly.commonWordSuffix=function(e,t){if(!e.length)return 0;if(1==e.length)return e[0].length;for(var o=0,n=t||Blockly.shortestStringLength(e),i=0;n>i;i++){for(var r=e[0].substr(-i-1,1),s=1;s<e.length;s++)if(r!=e[s].substr(-i-1,1))return o;" "==r&&(o=i+1)}for(s=1;s<e.length;s++)if((r=e[s].charAt(e[s].length-i-1))&&" "!=r)return o;return n},Blockly.isNumber=function(e){return!!e.match(/^\s*-?\d+(\.\d+)?\s*$/)},Blockly.pathToMedia="https://blockly-demo.appspot.com/static/media/",Blockly.SVG_NS="http://www.w3.org/2000/svg",Blockly.HTML_NS="http://www.w3.org/1999/xhtml",Blockly.HSV_SATURATION=.45,Blockly.HSV_VALUE=.65,Blockly.SPRITE={width:64,height:92,url:"sprites.png"},Blockly.makeColour=function(e){return goog.color.hsvToHex(e,Blockly.HSV_SATURATION,255*Blockly.HSV_VALUE)},Blockly.INPUT_VALUE=1,Blockly.OUTPUT_VALUE=2,Blockly.NEXT_STATEMENT=3,Blockly.PREVIOUS_STATEMENT=4,Blockly.DUMMY_INPUT=5,Blockly.ALIGN_LEFT=-1,Blockly.ALIGN_CENTRE=0,Blockly.ALIGN_RIGHT=1,Blockly.OPPOSITE_TYPE=[],Blockly.OPPOSITE_TYPE[Blockly.INPUT_VALUE]=Blockly.OUTPUT_VALUE,Blockly.OPPOSITE_TYPE[Blockly.OUTPUT_VALUE]=Blockly.INPUT_VALUE,Blockly.OPPOSITE_TYPE[Blockly.NEXT_STATEMENT]=Blockly.PREVIOUS_STATEMENT,Blockly.OPPOSITE_TYPE[Blockly.PREVIOUS_STATEMENT]=Blockly.NEXT_STATEMENT,Blockly.SOUNDS_=Object.create(null),Blockly.selected=null,Blockly.readOnly=!1,Blockly.highlightedConnection_=null,Blockly.localConnection_=null,Blockly.DRAG_RADIUS=5,Blockly.SNAP_RADIUS=20,Blockly.BUMP_DELAY=250,Blockly.COLLAPSE_CHARS=30,Blockly.mainWorkspace=null,Blockly.clipboard_=null,Blockly.dragMode_=0,Blockly.onTouchUpWrapper_=null,Blockly.svgSize=function(){return{width:Blockly.svg.cachedWidth_,height:Blockly.svg.cachedHeight_}},Blockly.svgResize=function(){var e=Blockly.svg,t=e.parentNode,o=t.offsetWidth,t=t.offsetHeight;e.cachedWidth_!=o&&(e.setAttribute("width",o+"px"),e.cachedWidth_=o),e.cachedHeight_!=t&&(e.setAttribute("height",t+"px"),e.cachedHeight_=t),Blockly.mainWorkspace.scrollbar&&Blockly.mainWorkspace.scrollbar.resize()},Blockly.onMouseDown_=function(e){Blockly.svgResize(),Blockly.terminateDrag_(),Blockly.hideChaff();var t=e.target&&e.target.nodeName&&"svg"==e.target.nodeName.toLowerCase();!Blockly.readOnly&&Blockly.selected&&t&&Blockly.selected.unselect(),e.target==Blockly.svg&&Blockly.isRightButton(e)?Blockly.showContextMenu_(e):(Blockly.readOnly||t)&&Blockly.mainWorkspace.scrollbar&&(Blockly.mainWorkspace.dragMode=!0,Blockly.mainWorkspace.startDragMouseX=e.clientX,Blockly.mainWorkspace.startDragMouseY=e.clientY,Blockly.mainWorkspace.startDragMetrics=Blockly.mainWorkspace.getMetrics(),Blockly.mainWorkspace.startScrollX=Blockly.mainWorkspace.scrollX,Blockly.mainWorkspace.startScrollY=Blockly.mainWorkspace.scrollY,"mouseup"in Blockly.bindEvent_.TOUCH_MAP&&(Blockly.onTouchUpWrapper_=Blockly.bindEvent_(document,"mouseup",null,Blockly.onMouseUp_)),Blockly.onMouseMoveWrapper_=Blockly.bindEvent_(document,"mousemove",null,Blockly.onMouseMove_))},Blockly.onMouseUp_=function(){Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN),Blockly.mainWorkspace.dragMode=!1,Blockly.onTouchUpWrapper_&&(Blockly.unbindEvent_(Blockly.onTouchUpWrapper_),Blockly.onTouchUpWrapper_=null),Blockly.onMouseMoveWrapper_&&(Blockly.unbindEvent_(Blockly.onMouseMoveWrapper_),Blockly.onMouseMoveWrapper_=null)},Blockly.onMouseMove_=function(e){if(Blockly.mainWorkspace.dragMode){Blockly.removeAllRanges();var t=Blockly.mainWorkspace.startDragMetrics,o=Blockly.mainWorkspace.startScrollX+(e.clientX-Blockly.mainWorkspace.startDragMouseX),n=Blockly.mainWorkspace.startScrollY+(e.clientY-Blockly.mainWorkspace.startDragMouseY),o=Math.min(o,-t.contentLeft),n=Math.min(n,-t.contentTop),o=Math.max(o,t.viewWidth-t.contentLeft-t.contentWidth),n=Math.max(n,t.viewHeight-t.contentTop-t.contentHeight);Blockly.mainWorkspace.scrollbar.set(-o-t.contentLeft,-n-t.contentTop),e.stopPropagation()}},Blockly.onKeyDown_=function(e){if(!Blockly.isTargetInput_(e))if(27==e.keyCode)Blockly.hideChaff();else if(8==e.keyCode||46==e.keyCode)try{Blockly.selected&&Blockly.selected.isDeletable()&&(Blockly.hideChaff(),Blockly.selected.dispose(!0,!0))}finally{e.preventDefault()}else(e.altKey||e.ctrlKey||e.metaKey)&&(Blockly.selected&&Blockly.selected.isDeletable()&&Blockly.selected.isMovable()&&Blockly.selected.workspace==Blockly.mainWorkspace&&(Blockly.hideChaff(),67==e.keyCode?Blockly.copy_(Blockly.selected):88==e.keyCode&&(Blockly.copy_(Blockly.selected),Blockly.selected.dispose(!0,!0))),86==e.keyCode&&Blockly.clipboard_&&Blockly.mainWorkspace.paste(Blockly.clipboard_))},Blockly.terminateDrag_=function(){Blockly.BlockSvg.terminateDrag_(),Blockly.Flyout.terminateDrag_()},Blockly.copy_=function(e){var t=Blockly.Xml.blockToDom_(e);Blockly.Xml.deleteNext(t),e=e.getRelativeToSurfaceXY(),t.setAttribute("x",Blockly.RTL?-e.x:e.x),t.setAttribute("y",e.y),Blockly.clipboard_=t},Blockly.showContextMenu_=function(e){if(!Blockly.readOnly){var t=[];if(Blockly.collapse){for(var o=!1,n=!1,i=Blockly.mainWorkspace.getTopBlocks(!1),r=0;r<i.length;r++)for(var s=i[r];s;)s.isCollapsed()?o=!0:n=!0,s=s.getNextBlock();n={enabled:n},n.text=Blockly.Msg.COLLAPSE_ALL,n.callback=function(){for(var e=0,t=0;t<i.length;t++)for(var o=i[t];o;)setTimeout(o.setCollapsed.bind(o,!0),e),o=o.getNextBlock(),e+=10},t.push(n),o={enabled:o},o.text=Blockly.Msg.EXPAND_ALL,o.callback=function(){for(var e=0,t=0;t<i.length;t++)for(var o=i[t];o;)setTimeout(o.setCollapsed.bind(o,!1),e),o=o.getNextBlock(),e+=10},t.push(o)}Blockly.ContextMenu.show(e,t)}},Blockly.onContextMenu_=function(e){Blockly.isTargetInput_(e)||e.preventDefault()},Blockly.hideChaff=function(e){Blockly.Tooltip.hide(),Blockly.WidgetDiv.hide(),!e&&Blockly.mainWorkspace.toolbox_&&Blockly.mainWorkspace.toolbox_.flyout_&&Blockly.mainWorkspace.toolbox_.flyout_.autoClose&&Blockly.mainWorkspace.toolbox_.clearSelection()},Blockly.removeAllRanges=function(){if(window.getSelection){var e=window.getSelection();e&&e.removeAllRanges&&(e.removeAllRanges(),setTimeout(function(){try{window.getSelection().removeAllRanges()}catch(e){}},0))}},Blockly.isTargetInput_=function(e){return"textarea"==e.target.type||"text"==e.target.type},Blockly.loadAudio_=function(e,t){if(window.Audio&&e.length){for(var o,n=new window.Audio,i=0;i<e.length;i++){var r=e[i],s=r.match(/\.(\w+)$/);if(s&&n.canPlayType("audio/"+s[1])){o=new window.Audio(r);break}}o&&o.play&&(Blockly.SOUNDS_[t]=o)}},Blockly.preloadAudio_=function(){for(var e in Blockly.SOUNDS_){var t=Blockly.SOUNDS_[e];if(t.volume=.01,t.play(),t.pause(),goog.userAgent.IPAD||goog.userAgent.IPHONE)break}},Blockly.playAudio=function(e,t){var o=Blockly.SOUNDS_[e];o&&(o=goog.userAgent.DOCUMENT_MODE&&9===goog.userAgent.DOCUMENT_MODE||goog.userAgent.IPAD||goog.userAgent.ANDROID?o:o.cloneNode(),o.volume=void 0===t?1:t,o.play())},Blockly.getMainWorkspaceMetrics_=function(){var e=Blockly.svgSize();Blockly.mainWorkspace.toolbox_&&(e.width-=Blockly.mainWorkspace.toolbox_.width);var t=e.width-Blockly.Scrollbar.scrollbarThickness,o=e.height-Blockly.Scrollbar.scrollbarThickness;try{var n=Blockly.mainWorkspace.getCanvas().getBBox()}catch(i){return null}if(Blockly.mainWorkspace.scrollbar)var r=Math.min(n.x-t/2,n.x+n.width-t),t=Math.max(n.x+n.width+t/2,n.x+t),s=Math.min(n.y-o/2,n.y+n.height-o),o=Math.max(n.y+n.height+o/2,n.y+o);else r=n.x,t=r+n.width,s=n.y,o=s+n.height;return n=0,!Blockly.RTL&&Blockly.mainWorkspace.toolbox_&&(n=Blockly.mainWorkspace.toolbox_.width),{viewHeight:e.height,viewWidth:e.width,contentHeight:o-s,contentWidth:t-r,viewTop:-Blockly.mainWorkspace.scrollY,viewLeft:-Blockly.mainWorkspace.scrollX,contentTop:s,contentLeft:r,absoluteTop:0,absoluteLeft:n}},Blockly.setMainWorkspaceMetrics_=function(e){if(!Blockly.mainWorkspace.scrollbar)throw"Attempt to set main workspace scroll without scrollbars.";var t=Blockly.getMainWorkspaceMetrics_();goog.isNumber(e.x)&&(Blockly.mainWorkspace.scrollX=-t.contentWidth*e.x-t.contentLeft),goog.isNumber(e.y)&&(Blockly.mainWorkspace.scrollY=-t.contentHeight*e.y-t.contentTop),e="translate("+(Blockly.mainWorkspace.scrollX+t.absoluteLeft)+","+(Blockly.mainWorkspace.scrollY+t.absoluteTop)+")",Blockly.mainWorkspace.getCanvas().setAttribute("transform",e),Blockly.mainWorkspace.getBubbleCanvas().setAttribute("transform",e)},Blockly.doCommand=function(e){Blockly.Realtime.isEnabled?Blockly.Realtime.doCommand(e):e()},Blockly.addChangeListener=function(e){return Blockly.bindEvent_(Blockly.mainWorkspace.getCanvas(),"blocklyWorkspaceChange",null,e)},Blockly.removeChangeListener=function(e){Blockly.unbindEvent_(e)},Blockly.getMainWorkspace=function(){return Blockly.mainWorkspace},goog.global.Blockly||(goog.global.Blockly={}),goog.global.Blockly.getMainWorkspace=Blockly.getMainWorkspace,goog.global.Blockly.addChangeListener=Blockly.addChangeListener,goog.global.Blockly.removeChangeListener=Blockly.removeChangeListener,Blockly.Blocks.colour={},Blockly.Blocks.colour.HUE=20,Blockly.Blocks.colour_picker={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_PICKER_HELPURL),this.setColour(Blockly.Blocks.colour.HUE),this.appendDummyInput().appendField(new Blockly.FieldColour("#ff0000"),"COLOUR"),this.setOutput(!0,"Colour"),this.setTooltip(Blockly.Msg.COLOUR_PICKER_TOOLTIP)}},Blockly.Blocks.colour_random={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_RANDOM_HELPURL),this.setColour(Blockly.Blocks.colour.HUE),this.appendDummyInput().appendField(Blockly.Msg.COLOUR_RANDOM_TITLE),this.setOutput(!0,"Colour"),this.setTooltip(Blockly.Msg.COLOUR_RANDOM_TOOLTIP)}},Blockly.Blocks.colour_rgb={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_RGB_HELPURL),this.setColour(Blockly.Blocks.colour.HUE),this.appendValueInput("RED").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_TITLE).appendField(Blockly.Msg.COLOUR_RGB_RED),this.appendValueInput("GREEN").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_GREEN),this.appendValueInput("BLUE").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_RGB_BLUE),this.setOutput(!0,"Colour"),this.setTooltip(Blockly.Msg.COLOUR_RGB_TOOLTIP)}},Blockly.Blocks.colour_blend={init:function(){this.setHelpUrl(Blockly.Msg.COLOUR_BLEND_HELPURL),this.setColour(Blockly.Blocks.colour.HUE),this.appendValueInput("COLOUR1").setCheck("Colour").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_BLEND_TITLE).appendField(Blockly.Msg.COLOUR_BLEND_COLOUR1),this.appendValueInput("COLOUR2").setCheck("Colour").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_BLEND_COLOUR2),this.appendValueInput("RATIO").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.COLOUR_BLEND_RATIO),this.setOutput(!0,"Colour"),this.setTooltip(Blockly.Msg.COLOUR_BLEND_TOOLTIP)}},Blockly.Blocks.lists={},Blockly.Blocks.lists.HUE=260,Blockly.Blocks.lists_create_empty={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL),this.setColour(Blockly.Blocks.lists.HUE),this.setOutput(!0,"Array"),this.appendDummyInput().appendField(Blockly.Msg.LISTS_CREATE_EMPTY_TITLE),this.setTooltip(Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP)}},Blockly.Blocks.lists_create_with={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_CREATE_WITH_HELPURL),this.setColour(Blockly.Blocks.lists.HUE),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Array"),this.setMutator(new Blockly.Mutator(["lists_create_with_item"])),this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=Blockly.Block.obtain(e,"lists_create_with_container");t.initSvg();for(var o=t.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var i=Blockly.Block.obtain(e,"lists_create_with_item");i.initSvg(),o.connect(i.previousConnection),o=i.nextConnection}return t},compose:function(e){e=e.getInputTargetBlock("STACK");for(var t=[],o=0;e;)t[o]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),o++;for(this.itemCount_=o,this.updateShape_(),o=0;o<this.itemCount_;o++)t[o]&&this.getInput("ADD"+o).connection.connect(t[o])},saveConnections:function(e){e=e.getInputTargetBlock("STACK");for(var t=0;e;){var o=this.getInput("ADD"+t);e.valueConnection_=o&&o.connection.targetConnection,t++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(Blockly.Msg.LISTS_CREATE_EMPTY_TITLE);else for(e=0;e<this.itemCount_;e++){var t=this.appendValueInput("ADD"+e);0==e&&t.appendField(Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH)}}},Blockly.Blocks.lists_create_with_container={init:function(){this.setColour(Blockly.Blocks.lists.HUE),this.appendDummyInput().appendField(Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Blockly.Blocks.lists_create_with_item={init:function(){this.setColour(Blockly.Blocks.lists.HUE),this.appendDummyInput().appendField(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Blockly.Blocks.lists_repeat={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_REPEAT_HELPURL),this.setColour(Blockly.Blocks.lists.HUE),this.setOutput(!0,"Array"),this.interpolateMsg(Blockly.Msg.LISTS_REPEAT_TITLE,["ITEM",null,Blockly.ALIGN_RIGHT],["NUM","Number",Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setTooltip(Blockly.Msg.LISTS_REPEAT_TOOLTIP)}},Blockly.Blocks.lists_length={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_LENGTH_HELPURL),this.setColour(Blockly.Blocks.lists.HUE),this.interpolateMsg(Blockly.Msg.LISTS_LENGTH_TITLE,["VALUE",["Array","String"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip(Blockly.Msg.LISTS_LENGTH_TOOLTIP)}},Blockly.Blocks.lists_isEmpty={init:function(){this.setHelpUrl(Blockly.Msg.LISTS_IS_EMPTY_HELPURL),this.setColour(Blockly.Blocks.lists.HUE),this.interpolateMsg(Blockly.Msg.LISTS_IS_EMPTY_TITLE,["VALUE",["Array","String"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip(Blockly.Msg.LISTS_TOOLTIP)}},Blockly.Blocks.lists_indexOf={init:function(){var e=[[Blockly.Msg.LISTS_INDEX_OF_FIRST,"FIRST"],[Blockly.Msg.LISTS_INDEX_OF_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.LISTS_INDEX_OF_HELPURL),this.setColour(Blockly.Blocks.lists.HUE),this.setOutput(!0,"Number"),this.appendValueInput("VALUE").setCheck("Array").appendField(Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST),this.appendValueInput("FIND").appendField(new Blockly.FieldDropdown(e),"END"),this.setInputsInline(!0),this.setTooltip(Blockly.Msg.LISTS_INDEX_OF_TOOLTIP)}},Blockly.Blocks.lists_getIndex={init:function(){var e=[[Blockly.Msg.LISTS_GET_INDEX_GET,"GET"],[Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[Blockly.Msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[Blockly.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_INDEX_FIRST,"FIRST"],[Blockly.Msg.LISTS_GET_INDEX_LAST,"LAST"],[Blockly.Msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(Blockly.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Blockly.Blocks.lists.HUE),e=new Blockly.FieldDropdown(e,function(e){this.sourceBlock_.updateStatement_("REMOVE"==e)}),this.appendValueInput("VALUE").setCheck("Array").appendField(Blockly.Msg.LISTS_GET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(e,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),Blockly.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("MODE")+"_"+t.getFieldValue("WHERE");return Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_"+e]})},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var t=this.getInput("AT").type==Blockly.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){var t="true"==e.getAttribute("statement");this.updateStatement_(t),e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateStatement_:function(e){e!=!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");var t=new Blockly.FieldDropdown(this.WHERE_OPTIONS,function(t){var o="FROM_START"==t||"FROM_END"==t;if(o!=e){var n=this.sourceBlock_;return n.updateAt_(o),n.setFieldValue(t,"WHERE"),null}});this.getInput("AT").appendField(t,"WHERE"),Blockly.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},Blockly.Blocks.lists_setIndex={init:function(){var e=[[Blockly.Msg.LISTS_SET_INDEX_SET,"SET"],[Blockly.Msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[Blockly.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_INDEX_FIRST,"FIRST"],[Blockly.Msg.LISTS_GET_INDEX_LAST,"LAST"],[Blockly.Msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(Blockly.Msg.LISTS_SET_INDEX_HELPURL),this.setColour(Blockly.Blocks.lists.HUE),this.appendValueInput("LIST").setCheck("Array").appendField(Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(new Blockly.FieldDropdown(e),"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),this.appendValueInput("TO").appendField(Blockly.Msg.LISTS_SET_INDEX_INPUT_TO),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Blockly.Msg.LISTS_SET_INDEX_TOOLTIP),this.updateAt_(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("MODE")+"_"+t.getFieldValue("WHERE");return Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_"+e]})},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT").type==Blockly.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");var t=new Blockly.FieldDropdown(this.WHERE_OPTIONS,function(t){var o="FROM_START"==t||"FROM_END"==t;if(o!=e){var n=this.sourceBlock_;return n.updateAt_(o),n.setFieldValue(t,"WHERE"),null}});this.moveInputBefore("AT","TO"),this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO"),this.getInput("AT").appendField(t,"WHERE")}},Blockly.Blocks.lists_getSublist={init:function(){this.WHERE_OPTIONS_1=[[Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Blockly.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Blockly.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Blockly.Blocks.lists.HUE),this.appendValueInput("LIST").setCheck("Array").appendField(Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.LISTS_GET_SUBLIST_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==Blockly.INPUT_VALUE;return e.setAttribute("at1",t),t=this.getInput("AT2").type==Blockly.INPUT_VALUE,e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at1");e="true"==e.getAttribute("at2"),this.updateAt_(1,t),this.updateAt_(2,e)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+e).appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+e);var o=new Blockly.FieldDropdown(this["WHERE_OPTIONS_"+e],function(o){var n="FROM_START"==o||"FROM_END"==o;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(e,n),i.setFieldValue(o,"WHERE"+e),null}});this.getInput("AT"+e).appendField(o,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2")),Blockly.Msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}},Blockly.Blocks.lists_split={init:function(){var e=this,t=new Blockly.FieldDropdown([[Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]],function(t){"SPLIT"==t?(e.outputConnection.setCheck("Array"),e.getInput("INPUT").setCheck("String")):(e.outputConnection.setCheck("String"),e.getInput("INPUT").setCheck("Array"))});this.setHelpUrl(Blockly.Msg.LISTS_SPLIT_HELPURL),this.setColour(Blockly.Blocks.lists.HUE),this.appendValueInput("INPUT").setCheck("String").appendField(t,"MODE"),this.appendValueInput("DELIM").setCheck("String").appendField(Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.setTooltip(function(){var t=e.getFieldValue("MODE");if("SPLIT"==t)return Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT;if("JOIN"==t)return Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN;throw"Unknown mode: "+t})}},Blockly.Blocks.logic={},Blockly.Blocks.logic.HUE=210,Blockly.Blocks.controls_if={init:function(){this.setHelpUrl(Blockly.Msg.CONTROLS_IF_HELPURL),this.setColour(Blockly.Blocks.logic.HUE),this.appendValueInput("IF0").setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_IF),this.appendStatementInput("DO0").appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Blockly.Mutator(["controls_if_elseif","controls_if_else"]));var e=this;this.setTooltip(function(){return e.elseifCount_||e.elseCount_?!e.elseifCount_&&e.elseCount_?Blockly.Msg.CONTROLS_IF_TOOLTIP_2:e.elseifCount_&&!e.elseCount_?Blockly.Msg.CONTROLS_IF_TOOLTIP_3:e.elseifCount_&&e.elseCount_?Blockly.Msg.CONTROLS_IF_TOOLTIP_4:"":Blockly.Msg.CONTROLS_IF_TOOLTIP_1}),this.elseCount_=this.elseifCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){for(this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10),e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSE)},decompose:function(e){var t=Blockly.Block.obtain(e,"controls_if_if");t.initSvg();for(var o=t.getInput("STACK").connection,n=1;n<=this.elseifCount_;n++){var i=Blockly.Block.obtain(e,"controls_if_elseif");i.initSvg(),o.connect(i.previousConnection),o=i.nextConnection}return this.elseCount_&&(e=Blockly.Block.obtain(e,"controls_if_else"),e.initSvg(),o.connect(e.previousConnection)),t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);for(this.elseifCount_=0,e=e.getInputTargetBlock("STACK");e;){switch(e.type){case"controls_if_elseif":this.elseifCount_++;var t=this.appendValueInput("IF"+this.elseifCount_).setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSEIF),o=this.appendStatementInput("DO"+this.elseifCount_);o.appendField(Blockly.Msg.CONTROLS_IF_MSG_THEN),e.valueConnection_&&t.connection.connect(e.valueConnection_),e.statementConnection_&&o.connection.connect(e.statementConnection_);break;case"controls_if_else":this.elseCount_++,t=this.appendStatementInput("ELSE"),t.appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSE),e.statementConnection_&&t.connection.connect(e.statementConnection_);break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}},saveConnections:function(e){e=e.getInputTargetBlock("STACK");for(var t=1;e;){switch(e.type){case"controls_if_elseif":var o=this.getInput("IF"+t),n=this.getInput("DO"+t);e.valueConnection_=o&&o.connection.targetConnection,e.statementConnection_=n&&n.connection.targetConnection,t++;break;case"controls_if_else":n=this.getInput("ELSE"),e.statementConnection_=n&&n.connection.targetConnection;break;default:throw"Unknown block type."}e=e.nextConnection&&e.nextConnection.targetBlock()}}},Blockly.Blocks.controls_if_if={init:function(){this.setColour(Blockly.Blocks.logic.HUE),this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Blockly.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},Blockly.Blocks.controls_if_elseif={init:function(){this.setColour(Blockly.Blocks.logic.HUE),this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},Blockly.Blocks.controls_if_else={init:function(){this.setColour(Blockly.Blocks.logic.HUE),this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},Blockly.Blocks.logic_compare={init:function(){var e=Blockly.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setHelpUrl(Blockly.Msg.LOGIC_COMPARE_HELPURL),this.setColour(Blockly.Blocks.logic.HUE),this.setOutput(!0,"Boolean"),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Blockly.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{EQ:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[e]})},onchange:function(){if(this.workspace){var e=this.getInputTargetBlock("A"),t=this.getInputTargetBlock("B");e&&!t?this.blockAPriority_=!1:!e&&t?this.blockAPriority_=!0:e&&t&&!e.outputConnection.checkType_(t.outputConnection)&&(e=this.blockAPriority_?t:e,e.setParent(null),e.bumpNeighbours_())}}},Blockly.Blocks.logic_operation={init:function(){var e=[[Blockly.Msg.LOGIC_OPERATION_AND,"AND"],[Blockly.Msg.LOGIC_OPERATION_OR,"OR"]];this.setHelpUrl(Blockly.Msg.LOGIC_OPERATION_HELPURL),this.setColour(Blockly.Blocks.logic.HUE),this.setOutput(!0,"Boolean"),this.appendValueInput("A").setCheck("Boolean"),this.appendValueInput("B").setCheck("Boolean").appendField(new Blockly.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{AND:Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR}[e]})}},Blockly.Blocks.logic_negate={init:function(){this.setHelpUrl(Blockly.Msg.LOGIC_NEGATE_HELPURL),this.setColour(Blockly.Blocks.logic.HUE),this.setOutput(!0,"Boolean"),this.interpolateMsg(Blockly.Msg.LOGIC_NEGATE_TITLE,["BOOL","Boolean",Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setTooltip(Blockly.Msg.LOGIC_NEGATE_TOOLTIP)}},Blockly.Blocks.logic_boolean={init:function(){var e=[[Blockly.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Blockly.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setHelpUrl(Blockly.Msg.LOGIC_BOOLEAN_HELPURL),this.setColour(Blockly.Blocks.logic.HUE),this.setOutput(!0,"Boolean"),this.appendDummyInput().appendField(new Blockly.FieldDropdown(e),"BOOL"),this.setTooltip(Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP)}},Blockly.Blocks.logic_null={init:function(){this.setHelpUrl(Blockly.Msg.LOGIC_NULL_HELPURL),this.setColour(Blockly.Blocks.logic.HUE),this.setOutput(!0),this.appendDummyInput().appendField(Blockly.Msg.LOGIC_NULL),this.setTooltip(Blockly.Msg.LOGIC_NULL_TOOLTIP)}},Blockly.Blocks.logic_ternary={init:function(){this.setHelpUrl(Blockly.Msg.LOGIC_TERNARY_HELPURL),this.setColour(Blockly.Blocks.logic.HUE),this.appendValueInput("IF").setCheck("Boolean").appendField(Blockly.Msg.LOGIC_TERNARY_CONDITION),this.appendValueInput("THEN").appendField(Blockly.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("ELSE").appendField(Blockly.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setTooltip(Blockly.Msg.LOGIC_TERNARY_TOOLTIP)}},Blockly.Blocks.loops={},Blockly.Blocks.loops.HUE=120,Blockly.Blocks.controls_repeat={init:function(){this.setHelpUrl(Blockly.Msg.CONTROLS_REPEAT_HELPURL),this.setColour(Blockly.Blocks.loops.HUE),this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_REPEAT_TITLE_REPEAT).appendField(new Blockly.FieldTextInput("10",Blockly.FieldTextInput.nonnegativeIntegerValidator),"TIMES").appendField(Blockly.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Blockly.Msg.CONTROLS_REPEAT_TOOLTIP)}},Blockly.Blocks.controls_repeat_ext={init:function(){this.setHelpUrl(Blockly.Msg.CONTROLS_REPEAT_HELPURL),this.setColour(Blockly.Blocks.loops.HUE),this.interpolateMsg(Blockly.Msg.CONTROLS_REPEAT_TITLE,["TIMES","Number",Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_REPEAT_INPUT_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Blockly.Msg.CONTROLS_REPEAT_TOOLTIP)}},Blockly.Blocks.controls_whileUntil={init:function(){var e=[[Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]];this.setHelpUrl(Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL),this.setColour(Blockly.Blocks.loops.HUE),this.appendValueInput("BOOL").setCheck("Boolean").appendField(new Blockly.FieldDropdown(e),"MODE"),this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("MODE");return{WHILE:Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[e]})}},Blockly.Blocks.controls_for={init:function(){this.setHelpUrl(Blockly.Msg.CONTROLS_FOR_HELPURL),this.setColour(Blockly.Blocks.loops.HUE),this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_FOR_INPUT_WITH).appendField(new Blockly.FieldVariable(null),"VAR"),this.interpolateMsg(Blockly.Msg.CONTROLS_FOR_INPUT_FROM_TO_BY,["FROM","Number",Blockly.ALIGN_RIGHT],["TO","Number",Blockly.ALIGN_RIGHT],["BY","Number",Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_FOR_INPUT_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip(function(){return Blockly.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",e.getFieldValue("VAR"))})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Blockly.Names.equals(e,this.getFieldValue("VAR"))&&this.setFieldValue(t,"VAR")},customContextMenu:function(e){if(!this.isCollapsed()){var t={enabled:!0},o=this.getFieldValue("VAR");t.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",o),o=goog.dom.createDom("field",null,o),o.setAttribute("name","VAR"),o=goog.dom.createDom("block",null,o),o.setAttribute("type","variables_get"),t.callback=Blockly.ContextMenu.callbackFactory(this,o),e.push(t)
34
34
  }}},Blockly.Blocks.controls_forEach={init:function(){this.setHelpUrl(Blockly.Msg.CONTROLS_FOREACH_HELPURL),this.setColour(Blockly.Blocks.loops.HUE),this.appendValueInput("LIST").setCheck("Array").appendField(Blockly.Msg.CONTROLS_FOREACH_INPUT_ITEM).appendField(new Blockly.FieldVariable(null),"VAR").appendField(Blockly.Msg.CONTROLS_FOREACH_INPUT_INLIST),Blockly.Msg.CONTROLS_FOREACH_INPUT_INLIST_TAIL&&(this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_FOREACH_INPUT_INLIST_TAIL),this.setInputsInline(!0)),this.appendStatementInput("DO").appendField(Blockly.Msg.CONTROLS_FOREACH_INPUT_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){return Blockly.Msg.CONTROLS_FOREACH_TOOLTIP.replace("%1",e.getFieldValue("VAR"))})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Blockly.Names.equals(e,this.getFieldValue("VAR"))&&this.setFieldValue(t,"VAR")},customContextMenu:Blockly.Blocks.controls_for.customContextMenu},Blockly.Blocks.controls_flow_statements={init:function(){var e=[[Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];this.setHelpUrl(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL),this.setColour(Blockly.Blocks.loops.HUE),this.appendDummyInput().appendField(new Blockly.FieldDropdown(e),"FLOW"),this.setPreviousStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("FLOW");return{BREAK:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[e]})},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("controls_repeat"==t.type||"controls_repeat_ext"==t.type||"controls_forEach"==t.type||"controls_for"==t.type||"controls_whileUntil"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?this.setWarningText(null):this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING)}}},Blockly.Blocks.math={},Blockly.Blocks.math.HUE=230,Blockly.Blocks.math_number={init:function(){this.setHelpUrl(Blockly.Msg.MATH_NUMBER_HELPURL),this.setColour(Blockly.Blocks.math.HUE),this.appendDummyInput().appendField(new Blockly.FieldTextInput("0",Blockly.FieldTextInput.numberValidator),"NUM"),this.setOutput(!0,"Number"),this.setTooltip(Blockly.Msg.MATH_NUMBER_TOOLTIP)}},Blockly.Blocks.math_arithmetic={init:function(){var e=[[Blockly.Msg.MATH_ADDITION_SYMBOL,"ADD"],[Blockly.Msg.MATH_SUBTRACTION_SYMBOL,"MINUS"],[Blockly.Msg.MATH_MULTIPLICATION_SYMBOL,"MULTIPLY"],[Blockly.Msg.MATH_DIVISION_SYMBOL,"DIVIDE"],[Blockly.Msg.MATH_POWER_SYMBOL,"POWER"]];this.setHelpUrl(Blockly.Msg.MATH_ARITHMETIC_HELPURL),this.setColour(Blockly.Blocks.math.HUE),this.setOutput(!0,"Number"),this.appendValueInput("A").setCheck("Number"),this.appendValueInput("B").setCheck("Number").appendField(new Blockly.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{ADD:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[e]})}},Blockly.Blocks.math_single={init:function(){var e=[[Blockly.Msg.MATH_SINGLE_OP_ROOT,"ROOT"],[Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE,"ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]];this.setHelpUrl(Blockly.Msg.MATH_SINGLE_HELPURL),this.setColour(Blockly.Blocks.math.HUE),this.setOutput(!0,"Number"),this.interpolateMsg("%1 %2",["OP",new Blockly.FieldDropdown(e)],["NUM","Number",Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{ROOT:Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT,ABS:Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS,NEG:Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG,LN:Blockly.Msg.MATH_SINGLE_TOOLTIP_LN,LOG10:Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10,EXP:Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP,POW10:Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10}[e]})}},Blockly.Blocks.math_trig={init:function(){var e=[[Blockly.Msg.MATH_TRIG_SIN,"SIN"],[Blockly.Msg.MATH_TRIG_COS,"COS"],[Blockly.Msg.MATH_TRIG_TAN,"TAN"],[Blockly.Msg.MATH_TRIG_ASIN,"ASIN"],[Blockly.Msg.MATH_TRIG_ACOS,"ACOS"],[Blockly.Msg.MATH_TRIG_ATAN,"ATAN"]];this.setHelpUrl(Blockly.Msg.MATH_TRIG_HELPURL),this.setColour(Blockly.Blocks.math.HUE),this.setOutput(!0,"Number"),this.appendValueInput("NUM").setCheck("Number").appendField(new Blockly.FieldDropdown(e),"OP");var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{SIN:Blockly.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Blockly.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Blockly.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN}[e]})}},Blockly.Blocks.math_constant={init:function(){this.setHelpUrl(Blockly.Msg.MATH_CONSTANT_HELPURL),this.setColour(Blockly.Blocks.math.HUE),this.setOutput(!0,"Number"),this.appendDummyInput().appendField(new Blockly.FieldDropdown([["π","PI"],["e","E"],["φ","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(½)","SQRT1_2"],["∞","INFINITY"]]),"CONSTANT"),this.setTooltip(Blockly.Msg.MATH_CONSTANT_TOOLTIP)}},Blockly.Blocks.math_number_property={init:function(){var e=[[Blockly.Msg.MATH_IS_EVEN,"EVEN"],[Blockly.Msg.MATH_IS_ODD,"ODD"],[Blockly.Msg.MATH_IS_PRIME,"PRIME"],[Blockly.Msg.MATH_IS_WHOLE,"WHOLE"],[Blockly.Msg.MATH_IS_POSITIVE,"POSITIVE"],[Blockly.Msg.MATH_IS_NEGATIVE,"NEGATIVE"],[Blockly.Msg.MATH_IS_DIVISIBLE_BY,"DIVISIBLE_BY"]];this.setColour(Blockly.Blocks.math.HUE),this.appendValueInput("NUMBER_TO_CHECK").setCheck("Number"),e=new Blockly.FieldDropdown(e,function(e){this.sourceBlock_.updateShape_("DIVISIBLE_BY"==e)}),this.appendDummyInput().appendField(e,"PROPERTY"),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip(Blockly.Msg.MATH_IS_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t="DIVISIBLE_BY"==this.getFieldValue("PROPERTY");return e.setAttribute("divisor_input",t),e},domToMutation:function(e){e="true"==e.getAttribute("divisor_input"),this.updateShape_(e)},updateShape_:function(e){var t=this.getInput("DIVISOR");e?t||this.appendValueInput("DIVISOR").setCheck("Number"):t&&this.removeInput("DIVISOR")}},Blockly.Blocks.math_change={init:function(){this.setHelpUrl(Blockly.Msg.MATH_CHANGE_HELPURL),this.setColour(Blockly.Blocks.math.HUE),this.interpolateMsg(Blockly.Msg.MATH_CHANGE_TITLE_CHANGE+" %1 "+Blockly.Msg.MATH_CHANGE_INPUT_BY+" %2",["VAR",new Blockly.FieldVariable(Blockly.Msg.MATH_CHANGE_TITLE_ITEM)],["DELTA","Number",Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){return Blockly.Msg.MATH_CHANGE_TOOLTIP.replace("%1",e.getFieldValue("VAR"))})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Blockly.Names.equals(e,this.getFieldValue("VAR"))&&this.setFieldValue(t,"VAR")}},Blockly.Blocks.math_round={init:function(){var e=[[Blockly.Msg.MATH_ROUND_OPERATOR_ROUND,"ROUND"],[Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP,"ROUNDUP"],[Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN,"ROUNDDOWN"]];this.setHelpUrl(Blockly.Msg.MATH_ROUND_HELPURL),this.setColour(Blockly.Blocks.math.HUE),this.setOutput(!0,"Number"),this.appendValueInput("NUM").setCheck("Number").appendField(new Blockly.FieldDropdown(e),"OP"),this.setTooltip(Blockly.Msg.MATH_ROUND_TOOLTIP)}},Blockly.Blocks.math_on_list={init:function(){var e=[[Blockly.Msg.MATH_ONLIST_OPERATOR_SUM,"SUM"],[Blockly.Msg.MATH_ONLIST_OPERATOR_MIN,"MIN"],[Blockly.Msg.MATH_ONLIST_OPERATOR_MAX,"MAX"],[Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE,"AVERAGE"],[Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN,"MEDIAN"],[Blockly.Msg.MATH_ONLIST_OPERATOR_MODE,"MODE"],[Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV,"STD_DEV"],[Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM,"RANDOM"]],t=this;this.setHelpUrl(Blockly.Msg.MATH_ONLIST_HELPURL),this.setColour(Blockly.Blocks.math.HUE),this.setOutput(!0,"Number"),e=new Blockly.FieldDropdown(e,function(e){"MODE"==e?t.outputConnection.setCheck("Array"):t.outputConnection.setCheck("Number")}),this.appendValueInput("LIST").setCheck("Array").appendField(e,"OP"),this.setTooltip(function(){var e=t.getFieldValue("OP");return{SUM:Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM,MIN:Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN,MAX:Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX,AVERAGE:Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE,MEDIAN:Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN,MODE:Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE,STD_DEV:Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV,RANDOM:Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM}[e]})}},Blockly.Blocks.math_modulo={init:function(){this.setHelpUrl(Blockly.Msg.MATH_MODULO_HELPURL),this.setColour(Blockly.Blocks.math.HUE),this.setOutput(!0,"Number"),this.interpolateMsg(Blockly.Msg.MATH_MODULO_TITLE,["DIVIDEND","Number",Blockly.ALIGN_RIGHT],["DIVISOR","Number",Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setTooltip(Blockly.Msg.MATH_MODULO_TOOLTIP)}},Blockly.Blocks.math_constrain={init:function(){this.setHelpUrl(Blockly.Msg.MATH_CONSTRAIN_HELPURL),this.setColour(Blockly.Blocks.math.HUE),this.setOutput(!0,"Number"),this.interpolateMsg(Blockly.Msg.MATH_CONSTRAIN_TITLE,["VALUE","Number",Blockly.ALIGN_RIGHT],["LOW","Number",Blockly.ALIGN_RIGHT],["HIGH","Number",Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setTooltip(Blockly.Msg.MATH_CONSTRAIN_TOOLTIP)}},Blockly.Blocks.math_random_int={init:function(){this.setHelpUrl(Blockly.Msg.MATH_RANDOM_INT_HELPURL),this.setColour(Blockly.Blocks.math.HUE),this.setOutput(!0,"Number"),this.interpolateMsg(Blockly.Msg.MATH_RANDOM_INT_TITLE,["FROM","Number",Blockly.ALIGN_RIGHT],["TO","Number",Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setTooltip(Blockly.Msg.MATH_RANDOM_INT_TOOLTIP)}},Blockly.Blocks.math_random_float={init:function(){this.setHelpUrl(Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL),this.setColour(Blockly.Blocks.math.HUE),this.setOutput(!0,"Number"),this.appendDummyInput().appendField(Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM),this.setTooltip(Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP)}},Blockly.Blocks.procedures={},Blockly.Blocks.procedures.HUE=290,Blockly.Blocks.procedures_defnoreturn={init:function(){this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.setColour(Blockly.Blocks.procedures.HUE);var e=Blockly.Procedures.findLegalName(Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,this);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE).appendField(new Blockly.FieldTextInput(e,Blockly.Procedures.rename),"NAME").appendField("","PARAMS"),this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"])),this.setTooltip(Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.arguments_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(e){this.hasStatements_!==e&&(e?(this.appendStatementInput("STACK").appendField(Blockly.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=e)},updateParams_:function(){for(var e=!1,t={},o=0;o<this.arguments_.length;o++){if(t["arg_"+this.arguments_[o].toLowerCase()]){e=!0;break}t["arg_"+this.arguments_[o].toLowerCase()]=!0}e?this.setWarningText(Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING):this.setWarningText(null),e="",this.arguments_.length&&(e=Blockly.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),this.setFieldValue(e,"PARAMS")},mutationToDom:function(){for(var e=document.createElement("mutation"),t=0;t<this.arguments_.length;t++){var o=document.createElement("arg");o.setAttribute("name",this.arguments_[t]),e.appendChild(o)}return this.hasStatements_||e.setAttribute("statements","false"),e},domToMutation:function(e){this.arguments_=[];for(var t,o=0;t=e.childNodes[o];o++)"arg"==t.nodeName.toLowerCase()&&this.arguments_.push(t.getAttribute("name"));this.updateParams_(),this.setStatements_("false"!==e.getAttribute("statements"))},decompose:function(e){var t=Blockly.Block.obtain(e,"procedures_mutatorcontainer");t.initSvg(),this.getInput("RETURN")?t.setFieldValue(this.hasStatements_?"TRUE":"FALSE","STATEMENTS"):t.getInput("STATEMENT_INPUT").setVisible(!1);for(var o=t.getInput("STACK").connection,n=0;n<this.arguments_.length;n++){var i=Blockly.Block.obtain(e,"procedures_mutatorarg");i.initSvg(),i.setFieldValue(this.arguments_[n],"NAME"),i.oldLocation=n,o.connect(i.previousConnection),o=i.nextConnection}return Blockly.Procedures.mutateCallers(this.getFieldValue("NAME"),this.workspace,this.arguments_,null),t},compose:function(e){this.arguments_=[],this.paramIds_=[];for(var t=e.getInputTargetBlock("STACK");t;)this.arguments_.push(t.getFieldValue("NAME")),this.paramIds_.push(t.id),t=t.nextConnection&&t.nextConnection.targetBlock();this.updateParams_(),Blockly.Procedures.mutateCallers(this.getFieldValue("NAME"),this.workspace,this.arguments_,this.paramIds_),e=e.getFieldValue("STATEMENTS"),null!==e&&(e="TRUE"==e,this.hasStatements_!=e)&&(e?(this.setStatements_(!0),e=this.getInput("STACK").connection,e.targetConnection||!this.statementConnection_||this.statementConnection_.targetConnection||this.statementConnection_.sourceBlock_.workspace!=this.workspace?this.statementConnection_=null:e.connect(this.statementConnection_)):(e=this.getInput("STACK").connection,(this.statementConnection_=e.targetConnection)&&(e=e.targetBlock(),e.setParent(null),e.bumpNeighbours_()),this.setStatements_(!1)))},dispose:function(){var e=this.getFieldValue("NAME");Blockly.Procedures.disposeCallers(e,this.workspace),this.constructor.prototype.dispose.apply(this,arguments)},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},getVars:function(){return this.arguments_},renameVar:function(e,t){for(var o=!1,n=0;n<this.arguments_.length;n++)Blockly.Names.equals(e,this.arguments_[n])&&(this.arguments_[n]=t,o=!0);if(o&&(this.updateParams_(),this.mutator.isVisible_()))for(var i,o=this.mutator.workspace_.getAllBlocks(),n=0;i=o[n];n++)"procedures_mutatorarg"==i.type&&Blockly.Names.equals(e,i.getFieldValue("NAME"))&&i.setFieldValue(t,"NAME")},customContextMenu:function(e){var t={enabled:!0},o=this.getFieldValue("NAME");t.text=Blockly.Msg.PROCEDURES_CREATE_DO.replace("%1",o);var n=goog.dom.createDom("mutation");n.setAttribute("name",o);for(var i=0;i<this.arguments_.length;i++)o=goog.dom.createDom("arg"),o.setAttribute("name",this.arguments_[i]),n.appendChild(o);if(n=goog.dom.createDom("block",null,n),n.setAttribute("type",this.callType_),t.callback=Blockly.ContextMenu.callbackFactory(this,n),e.push(t),!this.isCollapsed())for(i=0;i<this.arguments_.length;i++)t={enabled:!0},o=this.arguments_[i],t.text=Blockly.Msg.VARIABLES_SET_CREATE_GET.replace("%1",o),n=goog.dom.createDom("field",null,o),n.setAttribute("name","VAR"),n=goog.dom.createDom("block",null,n),n.setAttribute("type","variables_get"),t.callback=Blockly.ContextMenu.callbackFactory(this,n),e.push(t)},callType_:"procedures_callnoreturn"},Blockly.Blocks.procedures_defreturn={init:function(){this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL),this.setColour(Blockly.Blocks.procedures.HUE);var e=Blockly.Procedures.findLegalName(Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE,this);this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_DEFRETURN_TITLE).appendField(new Blockly.FieldTextInput(e,Blockly.Procedures.rename),"NAME").appendField("","PARAMS"),this.appendValueInput("RETURN").setAlign(Blockly.ALIGN_RIGHT).appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN),this.setMutator(new Blockly.Mutator(["procedures_mutatorarg"])),this.setTooltip(Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP),this.arguments_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:Blockly.Blocks.procedures_defnoreturn.setStatements_,updateParams_:Blockly.Blocks.procedures_defnoreturn.updateParams_,mutationToDom:Blockly.Blocks.procedures_defnoreturn.mutationToDom,domToMutation:Blockly.Blocks.procedures_defnoreturn.domToMutation,decompose:Blockly.Blocks.procedures_defnoreturn.decompose,compose:Blockly.Blocks.procedures_defnoreturn.compose,dispose:Blockly.Blocks.procedures_defnoreturn.dispose,getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},getVars:Blockly.Blocks.procedures_defnoreturn.getVars,renameVar:Blockly.Blocks.procedures_defnoreturn.renameVar,customContextMenu:Blockly.Blocks.procedures_defnoreturn.customContextMenu,callType_:"procedures_callreturn"},Blockly.Blocks.procedures_mutatorcontainer={init:function(){this.setColour(Blockly.Blocks.procedures.HUE),this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.appendDummyInput("STATEMENT_INPUT").appendField(Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS).appendField(new Blockly.FieldCheckbox("TRUE"),"STATEMENTS"),this.setTooltip(Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP),this.contextMenu=!1}},Blockly.Blocks.procedures_mutatorarg={init:function(){this.setColour(Blockly.Blocks.procedures.HUE),this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_MUTATORARG_TITLE).appendField(new Blockly.FieldTextInput("x",this.validator_),"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP),this.contextMenu=!1},validator_:function(e){return(e=e.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,""))||null}},Blockly.Blocks.procedures_callnoreturn={init:function(){this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL),this.setColour(Blockly.Blocks.procedures.HUE),this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_CALLNORETURN_CALL).appendField("","NAME").appendField(Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.arguments_=[],this.quarkArguments_=this.quarkConnections_=null},getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(e,t){Blockly.Names.equals(e,this.getProcedureCall())&&(this.setFieldValue(t,"NAME"),this.setTooltip((this.outputConnection?Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP:Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",t)))},setProcedureParameters:function(e,t){if(t){if(t.length!=e.length)throw"Error: paramNames and paramIds must be the same length.";this.quarkArguments_||(this.quarkConnections_={},this.quarkArguments_=e.join("\n")==this.arguments_.join("\n")?t:[]);var o=this.rendered;this.rendered=!1;for(var n=this.arguments_.length-1;n>=0;n--){var i=this.getInput("ARG"+n);if(i){var r=i.connection.targetConnection;this.quarkConnections_[this.quarkArguments_[n]]=r,this.removeInput("ARG"+n)}}for(this.arguments_=[].concat(e),this.quarkArguments_=t,n=0;n<this.arguments_.length;n++)if(i=this.appendValueInput("ARG"+n).setAlign(Blockly.ALIGN_RIGHT).appendField(this.arguments_[n]),this.quarkArguments_){var s=this.quarkArguments_[n];s in this.quarkConnections_&&(r=this.quarkConnections_[s],!r||r.targetConnection||r.sourceBlock_.workspace!=this.workspace?delete this.quarkConnections_[s]:i.connection.connect(r))}(n=this.getField_("WITH"))&&n.setVisible(!!this.arguments_.length),(this.rendered=o)&&this.render()}else this.quarkConnections_={},this.quarkArguments_=null},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("name",this.getProcedureCall());for(var t=0;t<this.arguments_.length;t++){var o=document.createElement("arg");o.setAttribute("name",this.arguments_[t]),e.appendChild(o)}return e},domToMutation:function(e){var t=e.getAttribute("name");if(this.setFieldValue(t,"NAME"),this.setTooltip((this.outputConnection?Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP:Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",t)),(t=Blockly.Procedures.getDefinition(t,this.workspace))&&t.mutator.isVisible())this.setProcedureParameters(t.arguments_,t.paramIds_);else{this.arguments_=[];for(var o,t=0;o=e.childNodes[t];t++)"arg"==o.nodeName.toLowerCase()&&this.arguments_.push(o.getAttribute("name"));this.setProcedureParameters(this.arguments_,this.arguments_)}},renameVar:function(e,t){for(var o=0;o<this.arguments_.length;o++)Blockly.Names.equals(e,this.arguments_[o])&&(this.arguments_[o]=t,this.getInput("ARG"+o).fieldRow[0].setText(t))},customContextMenu:function(e){var t={enabled:!0};t.text=Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF;var o=this.getProcedureCall(),n=this.workspace;t.callback=function(){var e=Blockly.Procedures.getDefinition(o,n);e&&e.select()},e.push(t)}},Blockly.Blocks.procedures_callreturn={init:function(){this.setHelpUrl(Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL),this.setColour(Blockly.Blocks.procedures.HUE),this.appendDummyInput().appendField(Blockly.Msg.PROCEDURES_CALLRETURN_CALL).appendField("","NAME").appendField(Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),this.setOutput(!0),this.arguments_=[],this.quarkArguments_=this.quarkConnections_=null},getProcedureCall:Blockly.Blocks.procedures_callnoreturn.getProcedureCall,renameProcedure:Blockly.Blocks.procedures_callnoreturn.renameProcedure,setProcedureParameters:Blockly.Blocks.procedures_callnoreturn.setProcedureParameters,mutationToDom:Blockly.Blocks.procedures_callnoreturn.mutationToDom,domToMutation:Blockly.Blocks.procedures_callnoreturn.domToMutation,renameVar:Blockly.Blocks.procedures_callnoreturn.renameVar,customContextMenu:Blockly.Blocks.procedures_callnoreturn.customContextMenu},Blockly.Blocks.procedures_ifreturn={init:function(){this.setHelpUrl("http://c2.com/cgi/wiki?GuardClause"),this.setColour(Blockly.Blocks.procedures.HUE),this.appendValueInput("CONDITION").setCheck("Boolean").appendField(Blockly.Msg.CONTROLS_IF_MSG_IF),this.appendValueInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP),this.hasReturnValue_=!0},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("value",Number(this.hasReturnValue_)),e},domToMutation:function(e){this.hasReturnValue_=1==e.getAttribute("value"),this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("procedures_defnoreturn"==t.type||"procedures_defreturn"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?("procedures_defnoreturn"==t.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=t.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(Blockly.Msg.PROCEDURES_IFRETURN_WARNING)}}},Blockly.Blocks.texts={},Blockly.Blocks.texts.HUE=160,Blockly.Blocks.text={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_TEXT_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,"String"),this.setTooltip(Blockly.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(e){return new Blockly.FieldImage(Blockly.pathToMedia+(e==Blockly.RTL?"quote1.png":"quote0.png"),12,12,'"')}},Blockly.Blocks.text_join={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_JOIN_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),this.itemCount_=2,this.updateShape_(),this.setOutput(!0,"String"),this.setMutator(new Blockly.Mutator(["text_create_join_item"])),this.setTooltip(Blockly.Msg.TEXT_JOIN_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=Blockly.Block.obtain(e,"text_create_join_container");t.initSvg();for(var o=t.getInput("STACK").connection,n=0;n<this.itemCount_;n++){var i=Blockly.Block.obtain(e,"text_create_join_item");i.initSvg(),o.connect(i.previousConnection),o=i.nextConnection}return t},compose:function(e){e=e.getInputTargetBlock("STACK");for(var t=[],o=0;e;)t[o]=e.valueConnection_,e=e.nextConnection&&e.nextConnection.targetBlock(),o++;for(this.itemCount_=o,this.updateShape_(),o=0;o<this.itemCount_;o++)t[o]&&this.getInput("ADD"+o).connection.connect(t[o])},saveConnections:function(e){e=e.getInputTargetBlock("STACK");for(var t=0;e;){var o=this.getInput("ADD"+t);e.valueConnection_=o&&o.connection.targetConnection,t++,e=e.nextConnection&&e.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(new Blockly.FieldImage(Blockly.pathToMedia+"quote0.png",12,12,'"')).appendField(new Blockly.FieldImage(Blockly.pathToMedia+"quote1.png",12,12,'"'));else for(e=0;e<this.itemCount_;e++){var t=this.appendValueInput("ADD"+e);0==e&&t.appendField(Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH)}}},Blockly.Blocks.text_create_join_container={init:function(){this.setColour(Blockly.Blocks.texts.HUE),this.appendDummyInput().appendField(Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN),this.appendStatementInput("STACK"),this.setTooltip(Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP),this.contextMenu=!1}},Blockly.Blocks.text_create_join_item={init:function(){this.setColour(Blockly.Blocks.texts.HUE),this.appendDummyInput().appendField(Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP),this.contextMenu=!1}},Blockly.Blocks.text_append={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_APPEND_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),this.appendValueInput("TEXT").appendField(Blockly.Msg.TEXT_APPEND_TO).appendField(new Blockly.FieldVariable(Blockly.Msg.TEXT_APPEND_VARIABLE),"VAR").appendField(Blockly.Msg.TEXT_APPEND_APPENDTEXT),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){return Blockly.Msg.TEXT_APPEND_TOOLTIP.replace("%1",e.getFieldValue("VAR"))})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Blockly.Names.equals(e,this.getFieldValue("VAR"))&&this.setFieldValue(t,"VAR")}},Blockly.Blocks.text_length={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_LENGTH_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),this.interpolateMsg(Blockly.Msg.TEXT_LENGTH_TITLE,["VALUE",["String","Array"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip(Blockly.Msg.TEXT_LENGTH_TOOLTIP)}},Blockly.Blocks.text_isEmpty={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_ISEMPTY_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),this.interpolateMsg(Blockly.Msg.TEXT_ISEMPTY_TITLE,["VALUE",["String","Array"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Boolean"),this.setTooltip(Blockly.Msg.TEXT_ISEMPTY_TOOLTIP)}},Blockly.Blocks.text_indexOf={init:function(){var e=[[Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST,"FIRST"],[Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST,"LAST"]];this.setHelpUrl(Blockly.Msg.TEXT_INDEXOF_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),this.setOutput(!0,"Number"),this.appendValueInput("VALUE").setCheck("String").appendField(Blockly.Msg.TEXT_INDEXOF_INPUT_INTEXT),this.appendValueInput("FIND").setCheck("String").appendField(new Blockly.FieldDropdown(e),"END"),Blockly.Msg.TEXT_INDEXOF_TAIL&&this.appendDummyInput().appendField(Blockly.Msg.TEXT_INDEXOF_TAIL),this.setInputsInline(!0),this.setTooltip(Blockly.Msg.TEXT_INDEXOF_TOOLTIP)}},Blockly.Blocks.text_charAt={init:function(){this.WHERE_OPTIONS=[[Blockly.Msg.TEXT_CHARAT_FROM_START,"FROM_START"],[Blockly.Msg.TEXT_CHARAT_FROM_END,"FROM_END"],[Blockly.Msg.TEXT_CHARAT_FIRST,"FIRST"],[Blockly.Msg.TEXT_CHARAT_LAST,"LAST"],[Blockly.Msg.TEXT_CHARAT_RANDOM,"RANDOM"]],this.setHelpUrl(Blockly.Msg.TEXT_CHARAT_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),this.setOutput(!0,"String"),this.appendValueInput("VALUE").setCheck("String").appendField(Blockly.Msg.TEXT_CHARAT_INPUT_INTEXT),this.appendDummyInput("AT"),this.setInputsInline(!0),this.updateAt_(!0),this.setTooltip(Blockly.Msg.TEXT_CHARAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT").type==Blockly.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"),Blockly.Msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(Blockly.Msg.TEXT_CHARAT_TAIL));var t=new Blockly.FieldDropdown(this.WHERE_OPTIONS,function(t){var o="FROM_START"==t||"FROM_END"==t;if(o!=e){var n=this.sourceBlock_;return n.updateAt_(o),n.setFieldValue(t,"WHERE"),null}});this.getInput("AT").appendField(t,"WHERE")}},Blockly.Blocks.text_getSubstring={init:function(){this.WHERE_OPTIONS_1=[[Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],[Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END,"FROM_END"],[Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST,"LAST"]],this.setHelpUrl(Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),this.appendValueInput("STRING").setCheck("String").appendField(Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),Blockly.Msg.TEXT_GET_SUBSTRING_TAIL&&this.appendDummyInput("TAIL").appendField(Blockly.Msg.TEXT_GET_SUBSTRING_TAIL),this.setInputsInline(!0),this.setOutput(!0,"String"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==Blockly.INPUT_VALUE;return e.setAttribute("at1",t),t=this.getInput("AT2").type==Blockly.INPUT_VALUE,e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at1");e="true"==e.getAttribute("at2"),this.updateAt_(1,t),this.updateAt_(2,e)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck("Number"),Blockly.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+e).appendField(Blockly.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+e),2==e&&Blockly.Msg.TEXT_GET_SUBSTRING_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(Blockly.Msg.TEXT_GET_SUBSTRING_TAIL));var o=new Blockly.FieldDropdown(this["WHERE_OPTIONS_"+e],function(o){var n="FROM_START"==o||"FROM_END"==o;if(n!=t){var i=this.sourceBlock_;return i.updateAt_(e,n),i.setFieldValue(o,"WHERE"+e),null}});this.getInput("AT"+e).appendField(o,"WHERE"+e),1==e&&this.moveInputBefore("AT1","AT2")}},Blockly.Blocks.text_changeCase={init:function(){var e=[[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE,"UPPERCASE"],[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE,"LOWERCASE"],[Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE,"TITLECASE"]];this.setHelpUrl(Blockly.Msg.TEXT_CHANGECASE_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),this.appendValueInput("TEXT").setCheck("String").appendField(new Blockly.FieldDropdown(e),"CASE"),this.setOutput(!0,"String"),this.setTooltip(Blockly.Msg.TEXT_CHANGECASE_TOOLTIP)}},Blockly.Blocks.text_trim={init:function(){var e=[[Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH,"BOTH"],[Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT,"LEFT"],[Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT,"RIGHT"]];this.setHelpUrl(Blockly.Msg.TEXT_TRIM_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),this.appendValueInput("TEXT").setCheck("String").appendField(new Blockly.FieldDropdown(e),"MODE"),this.setOutput(!0,"String"),this.setTooltip(Blockly.Msg.TEXT_TRIM_TOOLTIP)}},Blockly.Blocks.text_print={init:function(){this.setHelpUrl(Blockly.Msg.TEXT_PRINT_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),this.interpolateMsg(Blockly.Msg.TEXT_PRINT_TITLE,["TEXT",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Blockly.Msg.TEXT_PRINT_TOOLTIP)}},Blockly.Blocks.text_prompt={init:function(){var e=[[Blockly.Msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]],t=this;this.setHelpUrl(Blockly.Msg.TEXT_PROMPT_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),e=new Blockly.FieldDropdown(e,function(e){"NUMBER"==e?t.changeOutput("Number"):t.changeOutput("String")
35
- }),this.appendDummyInput().appendField(e,"TYPE").appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,"String"),t=this,this.setTooltip(function(){return"TEXT"==t.getFieldValue("TYPE")?Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT:Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER})},newQuote_:Blockly.Blocks.text.newQuote_},Blockly.Blocks.text_prompt_ext={init:function(){var e=[[Blockly.Msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]],t=this;this.setHelpUrl(Blockly.Msg.TEXT_PROMPT_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),e=new Blockly.FieldDropdown(e,function(e){"NUMBER"==e?t.changeOutput("Number"):t.changeOutput("String")}),this.appendValueInput("TEXT").appendField(e,"TYPE"),this.setOutput(!0,"String"),t=this,this.setTooltip(function(){return"TEXT"==t.getFieldValue("TYPE")?Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT:Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER})}},Blockly.Blocks.variables={},Blockly.Blocks.variables.HUE=330,Blockly.Blocks.variables_get={init:function(){this.setHelpUrl(Blockly.Msg.VARIABLES_GET_HELPURL),this.setColour(Blockly.Blocks.variables.HUE),this.appendDummyInput().appendField(Blockly.Msg.VARIABLES_GET_TITLE).appendField(new Blockly.FieldVariable(Blockly.Msg.VARIABLES_GET_ITEM),"VAR").appendField(Blockly.Msg.VARIABLES_GET_TAIL),this.setOutput(!0),this.setTooltip(Blockly.Msg.VARIABLES_GET_TOOLTIP),this.contextMenuMsg_=Blockly.Msg.VARIABLES_GET_CREATE_SET,this.contextMenuType_="variables_set"},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Blockly.Names.equals(e,this.getFieldValue("VAR"))&&this.setFieldValue(t,"VAR")},customContextMenu:function(e){var t={enabled:!0},o=this.getFieldValue("VAR");t.text=this.contextMenuMsg_.replace("%1",o),o=goog.dom.createDom("field",null,o),o.setAttribute("name","VAR"),o=goog.dom.createDom("block",null,o),o.setAttribute("type",this.contextMenuType_),t.callback=Blockly.ContextMenu.callbackFactory(this,o),e.push(t)}},Blockly.Blocks.variables_set={init:function(){this.setHelpUrl(Blockly.Msg.VARIABLES_SET_HELPURL),this.setColour(Blockly.Blocks.variables.HUE),this.interpolateMsg(Blockly.Msg.VARIABLES_SET_TITLE+" %1 "+Blockly.Msg.VARIABLES_SET_TAIL+" %2",["VAR",new Blockly.FieldVariable(Blockly.Msg.VARIABLES_SET_ITEM)],["VALUE",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Blockly.Msg.VARIABLES_SET_TOOLTIP),this.contextMenuMsg_=Blockly.Msg.VARIABLES_SET_CREATE_GET,this.contextMenuType_="variables_get"},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Blockly.Names.equals(e,this.getFieldValue("VAR"))&&this.setFieldValue(t,"VAR")},customContextMenu:Blockly.Blocks.variables_get.customContextMenu},Blockly.Toolbox.TreeNode.prototype.onMouseDown=function(){this.hasChildren()&&this.isUserCollapsible_?(this.toggle(),this.select()):this.isSelected()||this.select(),this.updateRow()},Blockly.Blocks.math.HUE=100,Blockly.Blocks.texts.HUE=100,Blockly.FieldTextInput.prototype.showEditorOrig_=Blockly.FieldTextInput.prototype.showEditor_,Blockly.FieldTextInput.prototype.showEditor_=function(){Blockly.FieldTextInput.prototype.showEditorOrig_.apply(this,arguments);var e=Blockly.FieldTextInput.htmlInput_;e.onKeyDownWrapper_=Blockly.bindEvent_(e,"keydown",this,this.onHtmlInputChange2_)},Blockly.FieldTextInput.prototype.onHtmlInputChange_=function(e){var t=Blockly.FieldTextInput.htmlInput_;if(27!=e.keyCode){var o=t.value;o!==t.oldValue_?(t.oldValue_=o,this.setText(o),this.validate_()):goog.userAgent.WEBKIT&&this.sourceBlock_.render()}},Blockly.FieldTextInput.prototype.onHtmlInputChange2_=function(e){var t=Blockly.FieldTextInput.htmlInput_;13==e.keyCode?Blockly.WidgetDiv.hide():27==e.keyCode&&(this.setText(t.defaultValue),Blockly.WidgetDiv.hide())},Blockly.FieldTextInput.prototype.widgetDisposeOrig_=Blockly.FieldTextInput.prototype.widgetDispose_,Blockly.FieldTextInput.prototype.widgetDispose_=function(){var e=this;return function(){Blockly.FieldTextInput.prototype.widgetDisposeOrig_.call(e);var t=Blockly.FieldTextInput.htmlInput_;Blockly.unbindEvent_(t.onKeyDownWrapper_)}},Blockly.Names.prototype.safeName_=function(e){return e?(e=e.replace(/[ !"#$%&'()=\-~^\\|`@{\[+;*:}\]<>,.?\/]/g,"_"),-1!="0123456789".indexOf(e[0])&&(e="_"+e)):e="unnamed",e},function(){var e=this,t=e._,o={},n=Array.prototype,i=Object.prototype,r=Function.prototype,s=n.push,l=n.slice,a=n.concat,c=i.toString,g=i.hasOwnProperty,u=n.forEach,h=n.map,d=n.reduce,p=n.reduceRight,f=n.filter,m=n.every,y=n.some,_=n.indexOf,E=n.lastIndexOf,v=Array.isArray,C=Object.keys,B=r.bind,k=function(e){return e instanceof k?e:this instanceof k?(this._wrapped=e,void 0):new k(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports._=k):e._=k,k.VERSION="1.5.2";var b=k.each=k.forEach=function(e,t,n){if(null!=e)if(u&&e.forEach===u)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,r=e.length;r>i;i++)if(t.call(n,e[i],i,e)===o)return}else for(var s=k.keys(e),i=0,r=s.length;r>i;i++)if(t.call(n,e[s[i]],s[i],e)===o)return};k.map=k.collect=function(e,t,o){var n=[];return null==e?n:h&&e.map===h?e.map(t,o):(b(e,function(e,i,r){n.push(t.call(o,e,i,r))}),n)};var A="Reduce of empty array with no initial value";k.reduce=k.foldl=k.inject=function(e,t,o,n){var i=arguments.length>2;if(null==e&&(e=[]),d&&e.reduce===d)return n&&(t=k.bind(t,n)),i?e.reduce(t,o):e.reduce(t);if(b(e,function(e,r,s){i?o=t.call(n,o,e,r,s):(o=e,i=!0)}),!i)throw new TypeError(A);return o},k.reduceRight=k.foldr=function(e,t,o,n){var i=arguments.length>2;if(null==e&&(e=[]),p&&e.reduceRight===p)return n&&(t=k.bind(t,n)),i?e.reduceRight(t,o):e.reduceRight(t);var r=e.length;if(r!==+r){var s=k.keys(e);r=s.length}if(b(e,function(l,a,c){a=s?s[--r]:--r,i?o=t.call(n,o,e[a],a,c):(o=e[a],i=!0)}),!i)throw new TypeError(A);return o},k.find=k.detect=function(e,t,o){var n;return T(e,function(e,i,r){return t.call(o,e,i,r)?(n=e,!0):void 0}),n},k.filter=k.select=function(e,t,o){var n=[];return null==e?n:f&&e.filter===f?e.filter(t,o):(b(e,function(e,i,r){t.call(o,e,i,r)&&n.push(e)}),n)},k.reject=function(e,t,o){return k.filter(e,function(e,n,i){return!t.call(o,e,n,i)},o)},k.every=k.all=function(e,t,n){t||(t=k.identity);var i=!0;return null==e?i:m&&e.every===m?e.every(t,n):(b(e,function(e,r,s){return(i=i&&t.call(n,e,r,s))?void 0:o}),!!i)};var T=k.some=k.any=function(e,t,n){t||(t=k.identity);var i=!1;return null==e?i:y&&e.some===y?e.some(t,n):(b(e,function(e,r,s){return i||(i=t.call(n,e,r,s))?o:void 0}),!!i)};k.contains=k.include=function(e,t){return null==e?!1:_&&e.indexOf===_?-1!=e.indexOf(t):T(e,function(e){return e===t})},k.invoke=function(e,t){var o=l.call(arguments,2),n=k.isFunction(t);return k.map(e,function(e){return(n?t:e[t]).apply(e,o)})},k.pluck=function(e,t){return k.map(e,function(e){return e[t]})},k.where=function(e,t,o){return k.isEmpty(t)?o?void 0:[]:k[o?"find":"filter"](e,function(e){for(var o in t)if(t[o]!==e[o])return!1;return!0})},k.findWhere=function(e,t){return k.where(e,t,!0)},k.max=function(e,t,o){if(!t&&k.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&k.isEmpty(e))return-1/0;var n={computed:-1/0,value:-1/0};return b(e,function(e,i,r){var s=t?t.call(o,e,i,r):e;s>n.computed&&(n={value:e,computed:s})}),n.value},k.min=function(e,t,o){if(!t&&k.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&k.isEmpty(e))return 1/0;var n={computed:1/0,value:1/0};return b(e,function(e,i,r){var s=t?t.call(o,e,i,r):e;s<n.computed&&(n={value:e,computed:s})}),n.value},k.shuffle=function(e){var t,o=0,n=[];return b(e,function(e){t=k.random(o++),n[o-1]=n[t],n[t]=e}),n},k.sample=function(e,t,o){return arguments.length<2||o?e[k.random(e.length-1)]:k.shuffle(e).slice(0,Math.max(0,t))};var S=function(e){return k.isFunction(e)?e:function(t){return t[e]}};k.sortBy=function(e,t,o){var n=S(t);return k.pluck(k.map(e,function(e,t,i){return{value:e,index:t,criteria:n.call(o,e,t,i)}}).sort(function(e,t){var o=e.criteria,n=t.criteria;if(o!==n){if(o>n||void 0===o)return 1;if(n>o||void 0===n)return-1}return e.index-t.index}),"value")};var R=function(e){return function(t,o,n){var i={},r=null==o?k.identity:S(o);return b(t,function(o,s){var l=r.call(n,o,s,t);e(i,l,o)}),i}};k.groupBy=R(function(e,t,o){(k.has(e,t)?e[t]:e[t]=[]).push(o)}),k.indexBy=R(function(e,t,o){e[t]=o}),k.countBy=R(function(e,t){k.has(e,t)?e[t]++:e[t]=1}),k.sortedIndex=function(e,t,o,n){o=null==o?k.identity:S(o);for(var i=o.call(n,t),r=0,s=e.length;s>r;){var l=r+s>>>1;o.call(n,e[l])<i?r=l+1:s=l}return r},k.toArray=function(e){return e?k.isArray(e)?l.call(e):e.length===+e.length?k.map(e,k.identity):k.values(e):[]},k.size=function(e){return null==e?0:e.length===+e.length?e.length:k.keys(e).length},k.first=k.head=k.take=function(e,t,o){return null==e?void 0:null==t||o?e[0]:l.call(e,0,t)},k.initial=function(e,t,o){return l.call(e,0,e.length-(null==t||o?1:t))},k.last=function(e,t,o){return null==e?void 0:null==t||o?e[e.length-1]:l.call(e,Math.max(e.length-t,0))},k.rest=k.tail=k.drop=function(e,t,o){return l.call(e,null==t||o?1:t)},k.compact=function(e){return k.filter(e,k.identity)};var I=function(e,t,o){return t&&k.every(e,k.isArray)?a.apply(o,e):(b(e,function(e){k.isArray(e)||k.isArguments(e)?t?s.apply(o,e):I(e,t,o):o.push(e)}),o)};k.flatten=function(e,t){return I(e,t,[])},k.without=function(e){return k.difference(e,l.call(arguments,1))},k.uniq=k.unique=function(e,t,o,n){k.isFunction(t)&&(n=o,o=t,t=!1);var i=o?k.map(e,o,n):e,r=[],s=[];return b(i,function(o,n){(t?n&&s[s.length-1]===o:k.contains(s,o))||(s.push(o),r.push(e[n]))}),r},k.union=function(){return k.uniq(k.flatten(arguments,!0))},k.intersection=function(e){var t=l.call(arguments,1);return k.filter(k.uniq(e),function(e){return k.every(t,function(t){return k.indexOf(t,e)>=0})})},k.difference=function(e){var t=a.apply(n,l.call(arguments,1));return k.filter(e,function(e){return!k.contains(t,e)})},k.zip=function(){for(var e=k.max(k.pluck(arguments,"length").concat(0)),t=new Array(e),o=0;e>o;o++)t[o]=k.pluck(arguments,""+o);return t},k.object=function(e,t){if(null==e)return{};for(var o={},n=0,i=e.length;i>n;n++)t?o[e[n]]=t[n]:o[e[n][0]]=e[n][1];return o},k.indexOf=function(e,t,o){if(null==e)return-1;var n=0,i=e.length;if(o){if("number"!=typeof o)return n=k.sortedIndex(e,t),e[n]===t?n:-1;n=0>o?Math.max(0,i+o):o}if(_&&e.indexOf===_)return e.indexOf(t,o);for(;i>n;n++)if(e[n]===t)return n;return-1},k.lastIndexOf=function(e,t,o){if(null==e)return-1;var n=null!=o;if(E&&e.lastIndexOf===E)return n?e.lastIndexOf(t,o):e.lastIndexOf(t);for(var i=n?o:e.length;i--;)if(e[i]===t)return i;return-1},k.range=function(e,t,o){arguments.length<=1&&(t=e||0,e=0),o=arguments[2]||1;for(var n=Math.max(Math.ceil((t-e)/o),0),i=0,r=new Array(n);n>i;)r[i++]=e,e+=o;return r};var D=function(){};k.bind=function(e,t){var o,n;if(B&&e.bind===B)return B.apply(e,l.call(arguments,1));if(!k.isFunction(e))throw new TypeError;return o=l.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,o.concat(l.call(arguments)));D.prototype=e.prototype;var i=new D;D.prototype=null;var r=e.apply(i,o.concat(l.call(arguments)));return Object(r)===r?r:i}},k.partial=function(e){var t=l.call(arguments,1);return function(){return e.apply(this,t.concat(l.call(arguments)))}},k.bindAll=function(e){var t=l.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return b(t,function(t){e[t]=k.bind(e[t],e)}),e},k.memoize=function(e,t){var o={};return t||(t=k.identity),function(){var n=t.apply(this,arguments);return k.has(o,n)?o[n]:o[n]=e.apply(this,arguments)}},k.delay=function(e,t){var o=l.call(arguments,2);return setTimeout(function(){return e.apply(null,o)},t)},k.defer=function(e){return k.delay.apply(k,[e,1].concat(l.call(arguments,1)))},k.throttle=function(e,t,o){var n,i,r,s=null,l=0;o||(o={});var a=function(){l=o.leading===!1?0:new Date,s=null,r=e.apply(n,i)};return function(){var c=new Date;l||o.leading!==!1||(l=c);var g=t-(c-l);return n=this,i=arguments,0>=g?(clearTimeout(s),s=null,l=c,r=e.apply(n,i)):s||o.trailing===!1||(s=setTimeout(a,g)),r}},k.debounce=function(e,t,o){var n,i,r,s,l;return function(){r=this,i=arguments,s=new Date;var a=function(){var c=new Date-s;t>c?n=setTimeout(a,t-c):(n=null,o||(l=e.apply(r,i)))},c=o&&!n;return n||(n=setTimeout(a,t)),c&&(l=e.apply(r,i)),l}},k.once=function(e){var t,o=!1;return function(){return o?t:(o=!0,t=e.apply(this,arguments),e=null,t)}},k.wrap=function(e,t){return function(){var o=[e];return s.apply(o,arguments),t.apply(this,o)}},k.compose=function(){var e=arguments;return function(){for(var t=arguments,o=e.length-1;o>=0;o--)t=[e[o].apply(this,t)];return t[0]}},k.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},k.keys=C||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var o in e)k.has(e,o)&&t.push(o);return t},k.values=function(e){for(var t=k.keys(e),o=t.length,n=new Array(o),i=0;o>i;i++)n[i]=e[t[i]];return n},k.pairs=function(e){for(var t=k.keys(e),o=t.length,n=new Array(o),i=0;o>i;i++)n[i]=[t[i],e[t[i]]];return n},k.invert=function(e){for(var t={},o=k.keys(e),n=0,i=o.length;i>n;n++)t[e[o[n]]]=o[n];return t},k.functions=k.methods=function(e){var t=[];for(var o in e)k.isFunction(e[o])&&t.push(o);return t.sort()},k.extend=function(e){return b(l.call(arguments,1),function(t){if(t)for(var o in t)e[o]=t[o]}),e},k.pick=function(e){var t={},o=a.apply(n,l.call(arguments,1));return b(o,function(o){o in e&&(t[o]=e[o])}),t},k.omit=function(e){var t={},o=a.apply(n,l.call(arguments,1));for(var i in e)k.contains(o,i)||(t[i]=e[i]);return t},k.defaults=function(e){return b(l.call(arguments,1),function(t){if(t)for(var o in t)void 0===e[o]&&(e[o]=t[o])}),e},k.clone=function(e){return k.isObject(e)?k.isArray(e)?e.slice():k.extend({},e):e},k.tap=function(e,t){return t(e),e};var w=function(e,t,o,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof k&&(e=e._wrapped),t instanceof k&&(t=t._wrapped);var i=c.call(e);if(i!=c.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return!1;for(var r=o.length;r--;)if(o[r]==e)return n[r]==t;var s=e.constructor,l=t.constructor;if(s!==l&&!(k.isFunction(s)&&s instanceof s&&k.isFunction(l)&&l instanceof l))return!1;o.push(e),n.push(t);var a=0,g=!0;if("[object Array]"==i){if(a=e.length,g=a==t.length)for(;a--&&(g=w(e[a],t[a],o,n)););}else{for(var u in e)if(k.has(e,u)&&(a++,!(g=k.has(t,u)&&w(e[u],t[u],o,n))))break;if(g){for(u in t)if(k.has(t,u)&&!a--)break;g=!a}}return o.pop(),n.pop(),g};k.isEqual=function(e,t){return w(e,t,[],[])},k.isEmpty=function(e){if(null==e)return!0;if(k.isArray(e)||k.isString(e))return 0===e.length;for(var t in e)if(k.has(e,t))return!1;return!0},k.isElement=function(e){return!(!e||1!==e.nodeType)},k.isArray=v||function(e){return"[object Array]"==c.call(e)},k.isObject=function(e){return e===Object(e)},b(["Arguments","Function","String","Number","Date","RegExp"],function(e){k["is"+e]=function(t){return c.call(t)=="[object "+e+"]"}}),k.isArguments(arguments)||(k.isArguments=function(e){return!(!e||!k.has(e,"callee"))}),"function"!=typeof/./&&(k.isFunction=function(e){return"function"==typeof e}),k.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},k.isNaN=function(e){return k.isNumber(e)&&e!=+e},k.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"==c.call(e)},k.isNull=function(e){return null===e},k.isUndefined=function(e){return void 0===e},k.has=function(e,t){return g.call(e,t)},k.noConflict=function(){return e._=t,this},k.identity=function(e){return e},k.times=function(e,t,o){for(var n=Array(Math.max(0,e)),i=0;e>i;i++)n[i]=t.call(o,i);return n},k.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var L={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};L.unescape=k.invert(L.escape);var F={escape:new RegExp("["+k.keys(L.escape).join("")+"]","g"),unescape:new RegExp("("+k.keys(L.unescape).join("|")+")","g")};k.each(["escape","unescape"],function(e){k[e]=function(t){return null==t?"":(""+t).replace(F[e],function(t){return L[e][t]})}}),k.result=function(e,t){if(null==e)return void 0;var o=e[t];return k.isFunction(o)?o.call(e):o},k.mixin=function(e){b(k.functions(e),function(t){var o=k[t]=e[t];k.prototype[t]=function(){var e=[this._wrapped];return s.apply(e,arguments),P.call(this,o.apply(k,e))}})};var O=0;k.uniqueId=function(e){var t=++O+"";return e?e+t:t},k.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,M={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},x=/\\|'|\r|\n|\t|\u2028|\u2029/g;k.template=function(e,t,o){var n;o=k.defaults({},o,k.templateSettings);var i=new RegExp([(o.escape||N).source,(o.interpolate||N).source,(o.evaluate||N).source].join("|")+"|$","g"),r=0,s="__p+='";e.replace(i,function(t,o,n,i,l){return s+=e.slice(r,l).replace(x,function(e){return"\\"+M[e]}),o&&(s+="'+\n((__t=("+o+"))==null?'':_.escape(__t))+\n'"),n&&(s+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),i&&(s+="';\n"+i+"\n__p+='"),r=l+t.length,t}),s+="';\n",o.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{n=new Function(o.variable||"obj","_",s)}catch(l){throw l.source=s,l}if(t)return n(t,k);var a=function(e){return n.call(this,e,k)};return a.source="function("+(o.variable||"obj")+"){\n"+s+"}",a},k.chain=function(e){return k(e).chain()};var P=function(e){return this._chain?k(e).chain():e};k.mixin(k),b(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=n[e];k.prototype[e]=function(){var o=this._wrapped;return t.apply(o,arguments),"shift"!=e&&"splice"!=e||0!==o.length||delete o[0],P.call(this,o)}}),b(["concat","join","slice"],function(e){var t=n[e];k.prototype[e]=function(){return P.call(this,t.apply(this._wrapped,arguments))}}),k.extend(k.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),function(){{var e,t=this,o=t.Backbone,n=[],i=(n.push,n.slice);n.splice}e="undefined"!=typeof exports?exports:t.Backbone={},e.VERSION="1.1.0";var r=t._;r||"undefined"==typeof require||(r=require("underscore")),e.$=t.jQuery||t.Zepto||t.ender||t.$,e.noConflict=function(){return t.Backbone=o,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s=e.Events={on:function(e,t,o){if(!a(this,"on",e,[t,o])||!t)return this;this._events||(this._events={});var n=this._events[e]||(this._events[e]=[]);return n.push({callback:t,context:o,ctx:o||this}),this},once:function(e,t,o){if(!a(this,"once",e,[t,o])||!t)return this;var n=this,i=r.once(function(){n.off(e,i),t.apply(this,arguments)});return i._callback=t,this.on(e,i,o)},off:function(e,t,o){var n,i,s,l,c,g,u,h;if(!this._events||!a(this,"off",e,[t,o]))return this;if(!e&&!t&&!o)return this._events={},this;for(l=e?[e]:r.keys(this._events),c=0,g=l.length;g>c;c++)if(e=l[c],s=this._events[e]){if(this._events[e]=n=[],t||o)for(u=0,h=s.length;h>u;u++)i=s[u],(t&&t!==i.callback&&t!==i.callback._callback||o&&o!==i.context)&&n.push(i);n.length||delete this._events[e]}return this},trigger:function(e){if(!this._events)return this;var t=i.call(arguments,1);if(!a(this,"trigger",e,t))return this;var o=this._events[e],n=this._events.all;return o&&c(o,t),n&&c(n,arguments),this},stopListening:function(e,t,o){var n=this._listeningTo;if(!n)return this;var i=!t&&!o;o||"object"!=typeof t||(o=this),e&&((n={})[e._listenId]=e);for(var s in n)e=n[s],e.off(t,o,this),(i||r.isEmpty(e._events))&&delete this._listeningTo[s];return this}},l=/\s+/,a=function(e,t,o,n){if(!o)return!0;if("object"==typeof o){for(var i in o)e[t].apply(e,[i,o[i]].concat(n));return!1}if(l.test(o)){for(var r=o.split(l),s=0,a=r.length;a>s;s++)e[t].apply(e,[r[s]].concat(n));return!1}return!0},c=function(e,t){var o,n=-1,i=e.length,r=t[0],s=t[1],l=t[2];switch(t.length){case 0:for(;++n<i;)(o=e[n]).callback.call(o.ctx);return;case 1:for(;++n<i;)(o=e[n]).callback.call(o.ctx,r);return;case 2:for(;++n<i;)(o=e[n]).callback.call(o.ctx,r,s);return;case 3:for(;++n<i;)(o=e[n]).callback.call(o.ctx,r,s,l);return;default:for(;++n<i;)(o=e[n]).callback.apply(o.ctx,t)}},g={listenTo:"on",listenToOnce:"once"};r.each(g,function(e,t){s[t]=function(t,o,n){var i=this._listeningTo||(this._listeningTo={}),s=t._listenId||(t._listenId=r.uniqueId("l"));return i[s]=t,n||"object"!=typeof o||(n=this),t[e](o,n,this),this}}),s.bind=s.on,s.unbind=s.off,r.extend(e,s);var u=e.Model=function(e,t){var o=e||{};t||(t={}),this.cid=r.uniqueId("c"),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(o=this.parse(o,t)||{}),o=r.defaults({},o,r.result(this,"defaults")),this.set(o,t),this.changed={},this.initialize.apply(this,arguments)};r.extend(u.prototype,s,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(){return r.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return r.escape(this.get(e))},has:function(e){return null!=this.get(e)},set:function(e,t,o){var n,i,s,l,a,c,g,u;if(null==e)return this;if("object"==typeof e?(i=e,o=t):(i={})[e]=t,o||(o={}),!this._validate(i,o))return!1;s=o.unset,a=o.silent,l=[],c=this._changing,this._changing=!0,c||(this._previousAttributes=r.clone(this.attributes),this.changed={}),u=this.attributes,g=this._previousAttributes,this.idAttribute in i&&(this.id=i[this.idAttribute]);for(n in i)t=i[n],r.isEqual(u[n],t)||l.push(n),r.isEqual(g[n],t)?delete this.changed[n]:this.changed[n]=t,s?delete u[n]:u[n]=t;if(!a){l.length&&(this._pending=!0);for(var h=0,d=l.length;d>h;h++)this.trigger("change:"+l[h],this,u[l[h]],o)}if(c)return this;if(!a)for(;this._pending;)this._pending=!1,this.trigger("change",this,o);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,r.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var o in this.attributes)t[o]=void 0;return this.set(t,r.extend({},e,{unset:!0}))},hasChanged:function(e){return null==e?!r.isEmpty(this.changed):r.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?r.clone(this.changed):!1;var t,o=!1,n=this._changing?this._previousAttributes:this.attributes;for(var i in e)r.isEqual(n[i],t=e[i])||((o||(o={}))[i]=t);return o},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return r.clone(this._previousAttributes)},fetch:function(e){e=e?r.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=this,o=e.success;return e.success=function(n){return t.set(t.parse(n,e),e)?(o&&o(t,n,e),t.trigger("sync",t,n,e),void 0):!1},M(this,e),this.sync("read",this,e)},save:function(e,t,o){var n,i,s,l=this.attributes;if(null==e||"object"==typeof e?(n=e,o=t):(n={})[e]=t,o=r.extend({validate:!0},o),n&&!o.wait){if(!this.set(n,o))return!1}else if(!this._validate(n,o))return!1;n&&o.wait&&(this.attributes=r.extend({},l,n)),void 0===o.parse&&(o.parse=!0);var a=this,c=o.success;return o.success=function(e){a.attributes=l;var t=a.parse(e,o);return o.wait&&(t=r.extend(n||{},t)),r.isObject(t)&&!a.set(t,o)?!1:(c&&c(a,e,o),a.trigger("sync",a,e,o),void 0)},M(this,o),i=this.isNew()?"create":o.patch?"patch":"update","patch"===i&&(o.attrs=n),s=this.sync(i,this,o),n&&o.wait&&(this.attributes=l),s},destroy:function(e){e=e?r.clone(e):{};var t=this,o=e.success,n=function(){t.trigger("destroy",t,t.collection,e)};if(e.success=function(i){(e.wait||t.isNew())&&n(),o&&o(t,i,e),t.isNew()||t.trigger("sync",t,i,e)},this.isNew())return e.success(),!1;M(this,e);var i=this.sync("delete",this,e);return e.wait||n(),i},url:function(){var e=r.result(this,"urlRoot")||r.result(this.collection,"url")||N();return this.isNew()?e:e+("/"===e.charAt(e.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(e){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},isValid:function(e){return this._validate({},r.extend(e||{},{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=r.extend({},this.attributes,e);var o=this.validationError=this.validate(e,t)||null;return o?(this.trigger("invalid",this,o,r.extend(t,{validationError:o})),!1):!0}});var h=["keys","values","pairs","invert","pick","omit"];r.each(h,function(e){u.prototype[e]=function(){var t=i.call(arguments);return t.unshift(this.attributes),r[e].apply(r,t)}});var d=e.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,r.extend({silent:!0},t))},p={add:!0,remove:!0,merge:!0},f={add:!0,remove:!1};r.extend(d.prototype,s,{model:u,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return e.sync.apply(this,arguments)},add:function(e,t){return this.set(e,r.extend({merge:!1},t,f))},remove:function(e,t){var o=!r.isArray(e);e=o?[e]:r.clone(e),t||(t={});var n,i,s,l;for(n=0,i=e.length;i>n;n++)l=e[n]=this.get(e[n]),l&&(delete this._byId[l.id],delete this._byId[l.cid],s=this.indexOf(l),this.models.splice(s,1),this.length--,t.silent||(t.index=s,l.trigger("remove",l,this,t)),this._removeReference(l));return o?e[0]:e},set:function(e,t){t=r.defaults({},t,p),t.parse&&(e=this.parse(e,t));var o=!r.isArray(e);e=o?e?[e]:[]:r.clone(e);var n,i,s,l,a,c,g,h=t.at,d=this.model,f=this.comparator&&null==h&&t.sort!==!1,m=r.isString(this.comparator)?this.comparator:null,y=[],_=[],E={},v=t.add,C=t.merge,B=t.remove,k=!f&&v&&B?[]:!1;for(n=0,i=e.length;i>n;n++){if(a=e[n],s=a instanceof u?l=a:a[d.prototype.idAttribute],c=this.get(s))B&&(E[c.cid]=!0),C&&(a=a===l?l.attributes:a,t.parse&&(a=c.parse(a,t)),c.set(a,t),f&&!g&&c.hasChanged(m)&&(g=!0)),e[n]=c;else if(v){if(l=e[n]=this._prepareModel(a,t),!l)continue;y.push(l),l.on("all",this._onModelEvent,this),this._byId[l.cid]=l,null!=l.id&&(this._byId[l.id]=l)}k&&k.push(c||l)}if(B){for(n=0,i=this.length;i>n;++n)E[(l=this.models[n]).cid]||_.push(l);_.length&&this.remove(_,t)}if(y.length||k&&k.length)if(f&&(g=!0),this.length+=y.length,null!=h)for(n=0,i=y.length;i>n;n++)this.models.splice(h+n,0,y[n]);else{k&&(this.models.length=0);var b=k||y;for(n=0,i=b.length;i>n;n++)this.models.push(b[n])}if(g&&this.sort({silent:!0}),!t.silent){for(n=0,i=y.length;i>n;n++)(l=y[n]).trigger("add",l,this,t);(g||k&&k.length)&&this.trigger("sort",this,t)}return o?e[0]:e},reset:function(e,t){t||(t={});for(var o=0,n=this.models.length;n>o;o++)this._removeReference(this.models[o]);return t.previousModels=this.models,this._reset(),e=this.add(e,r.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,r.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e),t},unshift:function(e,t){return this.add(e,r.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e),t},slice:function(){return i.apply(this.models,arguments)},get:function(e){return null==e?void 0:this._byId[e.id]||this._byId[e.cid]||this._byId[e]},at:function(e){return this.models[e]},where:function(e,t){return r.isEmpty(e)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var o in e)if(e[o]!==t.get(o))return!1;return!0})},findWhere:function(e){return this.where(e,!0)},sort:function(e){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return e||(e={}),r.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(r.bind(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return r.invoke(this.models,"get",e)},fetch:function(e){e=e?r.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=e.success,o=this;return e.success=function(n){var i=e.reset?"reset":"set";o[i](n,e),t&&t(o,n,e),o.trigger("sync",o,n,e)},M(this,e),this.sync("read",this,e)},create:function(e,t){if(t=t?r.clone(t):{},!(e=this._prepareModel(e,t)))return!1;t.wait||this.add(e,t);var o=this,n=t.success;return t.success=function(e,t,i){i.wait&&o.add(e,i),n&&n(e,t,i)},e.save(null,t),e},parse:function(e){return e},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(e instanceof u)return e.collection||(e.collection=this),e;t=t?r.clone(t):{},t.collection=this;var o=new this.model(e,t);return o.validationError?(this.trigger("invalid",this,o.validationError,t),!1):o},_removeReference:function(e){this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,o,n){("add"!==e&&"remove"!==e||o===this)&&("destroy"===e&&this.remove(t,n),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],null!=t.id&&(this._byId[t.id]=t)),this.trigger.apply(this,arguments))}});var m=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain"];r.each(m,function(e){d.prototype[e]=function(){var t=i.call(arguments);return t.unshift(this.models),r[e].apply(r,t)}});var y=["groupBy","countBy","sortBy"];r.each(y,function(e){d.prototype[e]=function(t,o){var n=r.isFunction(t)?t:function(e){return e.get(t)};return r[e](this.models,n,o)}});var _=e.View=function(e){this.cid=r.uniqueId("view"),e||(e={}),r.extend(this,r.pick(e,v)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},E=/^(\S+)\s*(.*)$/,v=["model","collection","el","id","attributes","className","tagName","events"];r.extend(_.prototype,s,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(t,o){return this.$el&&this.undelegateEvents(),this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0],o!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=r.result(this,"events")))return this;this.undelegateEvents();for(var t in e){var o=e[t];if(r.isFunction(o)||(o=this[e[t]]),o){var n=t.match(E),i=n[1],s=n[2];o=r.bind(o,this),i+=".delegateEvents"+this.cid,""===s?this.$el.on(i,o):this.$el.on(i,s,o)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(this.el)this.setElement(r.result(this,"el"),!1);else{var t=r.extend({},r.result(this,"attributes"));this.id&&(t.id=r.result(this,"id")),this.className&&(t["class"]=r.result(this,"className"));var o=e.$("<"+r.result(this,"tagName")+">").attr(t);this.setElement(o,!1)}}}),e.sync=function(t,o,n){var i=B[t];r.defaults(n||(n={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var s={type:i,dataType:"json"};if(n.url||(s.url=r.result(o,"url")||N()),null!=n.data||!o||"create"!==t&&"update"!==t&&"patch"!==t||(s.contentType="application/json",s.data=JSON.stringify(n.attrs||o.toJSON(n))),n.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),n.emulateHTTP&&("PUT"===i||"DELETE"===i||"PATCH"===i)){s.type="POST",n.emulateJSON&&(s.data._method=i);var l=n.beforeSend;n.beforeSend=function(e){return e.setRequestHeader("X-HTTP-Method-Override",i),l?l.apply(this,arguments):void 0}}"GET"===s.type||n.emulateJSON||(s.processData=!1),"PATCH"===s.type&&C&&(s.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var a=n.xhr=e.ajax(r.extend(s,n));return o.trigger("request",o,a,n),a};var C=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),B={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var k=e.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},b=/\((.*?)\)/g,A=/(\(\?)?:\w+/g,T=/\*\w+/g,S=/[\-{}\[\]+?.,\\\^$|#\s]/g;r.extend(k.prototype,s,{initialize:function(){},route:function(t,o,n){r.isRegExp(t)||(t=this._routeToRegExp(t)),r.isFunction(o)&&(n=o,o=""),n||(n=this[o]);var i=this;
36
- return e.history.route(t,function(r){var s=i._extractParameters(t,r);n&&n.apply(i,s),i.trigger.apply(i,["route:"+o].concat(s)),i.trigger("route",o,s),e.history.trigger("route",i,o,s)}),this},navigate:function(t,o){return e.history.navigate(t,o),this},_bindRoutes:function(){if(this.routes){this.routes=r.result(this,"routes");for(var e,t=r.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e])}},_routeToRegExp:function(e){return e=e.replace(S,"\\$&").replace(b,"(?:$1)?").replace(A,function(e,t){return t?e:"([^/]+)"}).replace(T,"(.*?)"),new RegExp("^"+e+"$")},_extractParameters:function(e,t){var o=e.exec(t).slice(1);return r.map(o,function(e){return e?decodeURIComponent(e):null})}});var R=e.History=function(){this.handlers=[],r.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},I=/^[#\/]|\s+$/g,D=/^\/+|\/+$/g,w=/msie [\w.]+/,L=/\/$/,F=/[?#].*$/;R.started=!1,r.extend(R.prototype,s,{interval:50,getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(e,t){if(null==e)if(this._hasPushState||!this._wantsHashChange||t){e=this.location.pathname;var o=this.root.replace(L,"");e.indexOf(o)||(e=e.slice(o.length))}else e=this.getHash();return e.replace(I,"")},start:function(t){if(R.started)throw new Error("Backbone.history has already been started");R.started=!0,this.options=r.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var o=this.getFragment(),n=document.documentMode,i=w.exec(navigator.userAgent.toLowerCase())&&(!n||7>=n);this.root=("/"+this.root+"/").replace(D,"/"),i&&this._wantsHashChange&&(this.iframe=e.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(o)),this._hasPushState?e.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!i?e.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=o;var s=this.location,l=s.pathname.replace(/[^\/]$/,"$&/")===this.root;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!l)return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+this.location.search+"#"+this.fragment),!0;this._hasPushState&&l&&s.hash&&(this.fragment=this.getHash().replace(I,""),this.history.replaceState({},document.title,this.root+this.fragment+s.search))}return this.options.silent?void 0:this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),R.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(){var e=this.getFragment();return e===this.fragment&&this.iframe&&(e=this.getFragment(this.getHash(this.iframe))),e===this.fragment?!1:(this.iframe&&this.navigate(e),this.loadUrl(),void 0)},loadUrl:function(e){return e=this.fragment=this.getFragment(e),r.any(this.handlers,function(t){return t.route.test(e)?(t.callback(e),!0):void 0})},navigate:function(e,t){if(!R.started)return!1;t&&t!==!0||(t={trigger:!!t});var o=this.root+(e=this.getFragment(e||""));if(e=e.replace(F,""),this.fragment!==e){if(this.fragment=e,""===e&&"/"!==o&&(o=o.slice(0,-1)),this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,o);else{if(!this._wantsHashChange)return this.location.assign(o);this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,e,t.replace))}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,o){if(o){var n=e.href.replace(/(javascript:|#).*$/,"");e.replace(n+"#"+t)}else e.hash="#"+t}}),e.history=new R;var O=function(e,t){var o,n=this;o=e&&r.has(e,"constructor")?e.constructor:function(){return n.apply(this,arguments)},r.extend(o,n,t);var i=function(){this.constructor=o};return i.prototype=n.prototype,o.prototype=new i,e&&r.extend(o.prototype,e),o.__super__=n.prototype,o};u.extend=d.extend=k.extend=_.extend=R.extend=O;var N=function(){throw new Error('A "url" property or function must be specified')},M=function(e,t){var o=t.error;t.error=function(n){o&&o(e,n,t),e.trigger("error",e,n,t)}}}.call(this),function(){window.SmalrubyEditor={},window.changed=!1,window.textEditor=null,window.blockMode=!0,window.successMessage=function(e,t,o){var n;null==t&&(t=""),null==o&&(o="#messages"),n=$('<div class="alert alert-success" style="display: none">').append('<h4><i class="icon-star"></i>'+e+"</h4>").append(t),$(o).append(n),n.fadeIn("slow").delay(3e3).fadeOut("slow")},window.errorMessage=function(e,t){var o;null==t&&(t="#messages"),o=$('<div class="alert alert-error" style="display: none">').append('<button type="button" class="close" data-dismiss="alert">×</button>').append('<h4><i class="icon-exclamation-sign"></i>'+Smalruby.bm("COMMON_ERROR")+"</h4>").append(e),$(t).append(o),o.fadeIn("slow")},window.clearMessages=function(e){return null==e&&(e="#messages"),$(e).empty()},window.Smalruby={Models:{},Collections:{},Views:{},Routers:{},Features:[],username:null,initialize:function(){var e,t,o=this;return $.ajaxSetup({headers:{"X-CSRF-Token":$('meta[name="csrf-token"]').attr("content")}}),_.extend(_.templateSettings,{escape:/{{-([\s\S]+?)}}/,evaluate:/{{([\s\S]+?)}}/,interpolate:/{{=([\s\S]+?)}}/}),this.Collections.CharacterSet=new Smalruby.CharacterSet,this.Views.MainMenuView=new Smalruby.MainMenuView,this.Views.SigninModalView=new Smalruby.SigninModalView({el:$("#signin-modal")}),this.Views.CharacterSelectorView=new Smalruby.CharacterSelectorView({model:this.Collections.CharacterSet}),this.Views.CharacterModalView=new Smalruby.CharacterModalView({el:$("#character-modal")}),this.Views.LoadModalView=new Smalruby.LoadModalView({el:$("#load-modal")}),this.Views.ResetModalView=new Smalruby.ResetModalView({el:$("#reset-modal")}),Smalruby.downloading=!1,window.onbeforeunload=function(){return!Smalruby.downloading&&window.changed?Smalruby.bm("SMALRUBY_WILL_DISAPPER_YOUR_PROGRAM"):(Smalruby.downloading=!1,void 0)},Blockly.HSV_SATURATION=1,Blockly.HSV_VALUE=.8,Blockly.inject(document.getElementById("blockly-div"),{path:"/blockly/",toolbox:document.getElementById("toolbox"),trashcan:!0}),this.blocklyFirst=!0,this.blocklyLoading=!1,Blockly.addChangeListener(function(){return Smalruby.changedAfterTranslating=!0,o.blocklyFirst?(o.blocklyFirst=!1,void 0):o.blocklyLoading?(o.blocklyLoading=!1,void 0):window.changed=!0}),window.textEditor=t=ace.edit("text-editor"),t.setTheme("ace/theme/clouds"),t.setShowInvisibles(!0),t.gotoLine(0,0),t.setReadOnly(this.isEnabled("readonly_ruby_mode")),t.on("change",function(){return o.translating?void 0:(window.changed=!0,Smalruby.changedAfterTranslating=!0)}),e=t.getSession(),e.setMode("ace/mode/ruby"),e.setTabSize(2),e.setUseSoftTabs(!0),this.addCharacterFromBeginning()},loadXml:function(e,t){var o,n,i,r,s;for(null==t&&(t=Blockly.mainWorkspace),r=Blockly.Xml.textToDom(e),t.clear(),n=[],i=0;s=r.childNodes[i];)"character"===s.nodeName.toLowerCase()&&(o=new Smalruby.Character({name:s.getAttribute("name"),costumes:s.getAttribute("costumes").split(","),x:parseInt(s.getAttribute("x"),10),y:parseInt(s.getAttribute("y"),10),angle:parseInt(s.getAttribute("angle"),10),rotationStyle:s.getAttribute("rotation_style")||"free"}),n.push(o)),i++;return Smalruby.Collections.CharacterSet.reset(n),Blockly.Xml.domToWorkspace(t,r)},dumpXml:function(e,t){var o,n;return null==e&&(e=Blockly.mainWorkspace),null==t&&(t=Smalruby.Collections.CharacterSet),n=Blockly.Xml.workspaceToDom(e),o=n.firstChild,t.each(function(e){var t,i;return t=goog.dom.createDom("character"),t.setAttribute("x",e.get("x")),t.setAttribute("y",e.get("y")),t.setAttribute("name",e.get("name")),t.setAttribute("costumes",e.get("costumes").join(",")),t.setAttribute("angle",e.get("angle")),i=e.get("rotationStyle"),"free"!==i&&t.setAttribute("rotation_style",i),n.insertBefore(t,o)}),Blockly.Xml.domToPrettyText(n)},ignoreEnterKey:function(e){return e.find("input[type=text]").keypress(function(e){return e||(e=window.event),13===e.keyCode?!1:!0})},reset:function(){return this.blocklyLoading=!0,Blockly.mainWorkspace.clear(),this.Collections.CharacterSet.reset(),$("#filename").val(""),window.textEditor.getSession().getDocument().setValue(""),window.textEditor.moveCursorTo(0,0),this.addCharacterFromBeginning(),window.changed=!1},bm:function(e){var t;return t=Blockly.Msg[e],"string"==typeof t?t:e},addCharacterFromBeginning:function(){var e,t;return this.isEnabled("disabled_add_character_from_beginning")?void 0:(t="cat1.png",e=new Smalruby.Character({name:this.Collections.CharacterSet.uniqueName(t),costumes:[t],x:200,y:200}),this.Collections.CharacterSet.add(e),this.Views.CharacterSelectorView.prevBlock=null,this.Views.CharacterSelectorView.addBlock_(e),window.changed=!1)},isEnabled:function(e){return-1!==this.Features.indexOf(e)}},$(document).ready(function(){return Smalruby.initialize(),null===Smalruby.username&&Smalruby.isEnabled("must_signin")?Smalruby.Views.SigninModalView.render():void 0})}.call(this),function(){Smalruby.Character=Backbone.Model.extend({defaults:{name:null,costumes:[],costumeIndex:0,x:0,y:0,angle:0,rotationStyle:"free",visible:!0,using:!1},initialize:function(){return this.objects=[],0===this.get("costumes").length?this.set({costumes:[Smalruby.Character.PRESET_COSTUMES[0]]}):void 0},validate:function(e){var t,o;return t=[],o=e.name,(_.isUndefined(o)||_.isNull(o)||_.isString(o)&&0===o.length)&&t.push({attr:"name",message:"Name is required"}),_.isString(o)&&o.match(/^[0-9A-Z]|[!\"\#$%&\'()\-=^~\\|@`\[{;+:*\]},<.>/?]/)&&t.push({attr:"name",message:"Name is invalid"}),t.length>0?t:void 0},link:function(e){return this.objects.push(e),this.objects=_.uniq(this.objects),this.objects.length>0?this.set("using",!0):void 0},unlink:function(e){return this.objects=_.without(this.objects,e),0===this.objects.length?this.set("using",!1):void 0},namePrefix:function(){return Smalruby.Character.costumeToNamePrefix(this.get("name"))},costume:function(){return this.get("costumes")[this.get("costumeIndex")]},costumeUrl:function(e){var t;return null==e&&(e=this.get("costumeIndex")),t=this.get("costumes")[e],-1===_.indexOf(Smalruby.Character.PRESET_COSTUMES,t)?t:"/smalruby/assets/"+t},nextCostume:function(){var e;return e=this.get("costumeIndex")+1,e>=this.get("costumes").length&&(e=0),this.set({costumeIndex:e}),e},rotationStyleIconName:function(){switch(this.get("rotationStyle")){case"free":return"icon-repeat";case"left_right":return"icon-resize-horizontal";case"none":return"icon-arrow-right"}},rotateImage:function(e){var t,o;switch(t=this.get("angle"),this.get("rotationStyle")){case"free":o="rotate("+t+"deg) scaleX(1)";break;case"left_right":o=90>t||t>=270?"rotate(0deg) scaleX(1)":"rotate(0deg) scaleX(-1)";break;case"none":o="rotate(0deg) scaleX(1)"}return $(e).css({"-moz-transform":o,"-webkit-transform":o,transform:o})}},{PRESET_COSTUMES:["car1.png","car2.png","car3.png","car4.png","ball1.png","ball2.png","ball3.png","ball4.png","ball5.png","ball6.png","cat1.png","cat2.png","cat3.png","frog1.png","ryu1.png","ryu2.png","taichi1.png","taichi2.png"],costumeToNamePrefix:function(e){return e.substring(e.lastIndexOf("/")+1).replace(/\.[^.]*$/,"").replace(/[\d]*$/,"")}})}.call(this),function(){Smalruby.Scene=Backbone.Model.extend({defaults:{width:640,height:480,color:"black"}})}.call(this),Smalruby.SourceCode=Backbone.Model.extend({defaults:{filename:null,data:null},initialize:function(){if(!this.get("filename")){var e=Smalruby.Views.MainMenuView.getFilename();0==e.length&&(e=Smalruby.SourceCode.defaultFilename()),this.set("filename",e)}if(!this.get("data")){if(this.get("filename").match(/\.xml$/))var t=Smalruby.dumpXml();else if(window.blockMode)var t=Blockly.Ruby.workspaceToCode();else var t=window.textEditor.getSession().getDocument().getValue();this.set("data",t)}},getRbxmlFilename:function(){var e=this.get("filename");return e.match(/\.rb\.xml$/)?e:e.match(/\.rb$/)?e+".xml":e.match(/\.xml$/)?e.replace(/\.xml$/,".rb.xml"):e+".rb.xml"},run:function(){return this.post_("run")},check:function(){return this.post_("check")},save2:function(){return this.post_("")},write:function(e){null==e&&(e=!1);var t="write";return e&&(t+="?force=1"),this.delete_(t)},toBlocks:function(){return this.post_("to_blocks","html")},post_:function(e,t){return null==t&&(t="json"),dfr=$.Deferred(),$.ajax({url:"/source_codes/"+e,type:"POST",data:{source_code:{filename:this.get("filename"),data:this.get("data")}},dataType:t,success:function(e){return dfr.resolve(e)},error:dfr.reject}),dfr.promise()},delete_:function(e){return dfr=$.Deferred(),$.ajax({url:"/source_codes/"+e,type:"DELETE",dataType:"json",success:function(e){return dfr.resolve(e)},error:dfr.reject}),dfr.promise()}},{defaultFilename:function(e){return null==e&&(e=new Date),strftime("program_%y%m%d_%H%M%S.rb",e)}}),function(){Smalruby.CharacterSet=Backbone.Collection.extend({model:Smalruby.Character,uniqueName:function(e){var t,o,n;return null==e&&(e=Smalruby.Character.PRESET_COSTUMES[0]),o=e.substring(e.lastIndexOf("/")+1).replace(/\.[^.]*$/,"").replace(/[\d]*$/,""),t=0,n=new RegExp("^"+o+"(\\d+)$"),_.each(this.pluck("name"),function(e){return e.match(n)?t=_.max([t,parseInt(RegExp.$1)]):void 0}),""+o+(t+1)}})}.call(this),function(){Smalruby.CharacterModalView=Backbone.View.extend({model:new Smalruby.Character,events:{"click #character-modal-costume-selector a":"onSelectCostume","click #character_rotation_style_free":"onRotationStyleFree","click #character_rotation_style_left_right":"onRotationStyleLeftRight","click #character_rotation_style_none":"onRotationStyleNone","click #character-modal-ok-button":"onOk"},previewZoomLevel:.5,initialize:function(){var e,t,o,n=this;return this.target=null,$("#character-modal-costume-selector img").on("dragstart",function(e){return e.preventDefault()}),o=function(e){return n.model.set({x:parseInt(e.left/n.previewZoomLevel),y:parseInt(e.top/n.previewZoomLevel)})},$("#character-modal-character").draggable({containment:"#character-modal-preview",cursor:"move",drag:function(e,t){return o(t.position)}}),$("#character-modal-preview").droppable({drop:function(e,t){return o(t.draggable.position())}}),this.$el.find('input[name="character[name]"]').keypress(function(e){return e||(e=window.event),13===e.keyCode?!1:!0}),t=this,e=function(){return t.model.set({name:$(this).val()}),t.nameChanged=!0},this.$el.find('input[name="character[name]"]').change(e),this.$el.find('input[name="character[name]"]').keyup(e),this.$el.find('input[name="character[x]"]').change(function(){return t.model.set({x:$(this).val()})}),this.$el.find('input[name="character[y]"]').change(function(){return t.model.set({y:$(this).val()})}),this.$el.find('input[name="character[angle]"]').change(function(){return t.model.set({angle:$(this).val()})}),this.listenTo(this.model,"change:name",this.onChangeName),this.listenTo(this.model,"change:x",this.onChangeX),this.listenTo(this.model,"change:y",this.onChangeY),this.listenTo(this.model,"change:angle",this.onChangeAngle),this.listenTo(this.model,"change:costumes",this.onChangeCostumes),this.listenTo(this.model,"change:rotationStyle",this.onChangeRotationStyle),this.listenTo(this.model,"change",this.onChange),this.callAllOnChangeAttributes_()},render:function(){var e;return this.onChange(this.model),this.$el.modal({backdrop:"static"}),this.$el.modal("show"),e=function(){var t;return this.readImageSizeflag?(t=$("#character-modal-costume-selector .active img"),t.width()>0?($("#character-modal-character").css({width:""+t.width()/2+"px",height:""+t.height()/2+"px"}),this.readImageSizeflag=!1):setTimeout(_.bind(e,this),50)):void 0},this.readImageSizeflag?setTimeout(_.bind(e,this),1):void 0},callAllOnChangeAttributes_:function(){return this.onChangeName(this.model,this.model.get("name")),this.onChangeX(this.model,this.model.get("x")),this.onChangeY(this.model,this.model.get("y")),this.onChangeAngle(this.model,this.model.get("angle")),this.onChangeCostumes(this.model,this.model.get("costumes")),this.onChangeRotationStyle(this.model,this.model.get("rotationStyle"))},onChangeName:function(e,t){return this.$el.find('input[name="character[name]"]').val(t)},onChangeX:function(e,t){return this.$el.find('input[name="character[x]"]').val(t),$("#character_x_value").text(t),$("#character-modal-character").css("left",parseInt(t*this.previewZoomLevel))},onChangeY:function(e,t){return this.$el.find('input[name="character[y]"]').val(t),$("#character_y_value").text(t),$("#character-modal-character").css("top",parseInt(t*this.previewZoomLevel))},onChangeAngle:function(e,t){var o;return this.$el.find('input[name="character[angle]"]').val(t),$("#character_angle_value").text(""+t+"°"),o="rotate("+t+"deg)",$("#character_angle_vector").css({"-moz-transform":o,"-webkit-transform":o,transform:o}),this.model.rotateImage("#character-modal-character")},onChangeCostumes:function(e){var t,o;return t=$("<img>").attr({src:e.costumeUrl(),alt:e.costume()}),$("#character-modal-character img").replaceWith(t),this.$el.find("#character-modal-costume-selector a.thumbnail").removeClass("active"),o=this.$el.find('#character-modal-costume-selector img[alt="'+e.costume()+'"]'),o.parent().addClass("active"),o.width()>0?$("#character-modal-character").css({width:""+o.width()/2+"px",height:""+o.height()/2+"px"}):this.readImageSizeflag=!0},onChangeRotationStyle:function(e,t){return $("#character_rotation_style button.btn").removeClass("btn-primary"),$("#character_rotation_style_"+t).addClass("btn-primary"),this.onChangeAngle(this.model,this.model.get("angle"))},onChange:function(){var e;if(this.target)return this.$el.find('.control-group[for="character[name]"]').removeClass("error"),this.$el.find("#character-modal-ok-button").removeClass("disabled").removeAttr("disabled"),this.model.isValid()||(this.$el.find('.control-group[for="character[name]"]').addClass("error"),this.$el.find("#character-modal-ok-button").addClass("disabled").attr({disabled:"disabled"})),e=this.model.get("name"),this.target.get("name")!==e&&Smalruby.Collections.CharacterSet.findWhere({name:e})?(this.$el.find('.control-group[for="character[name]"]').addClass("error"),this.$el.find("#character-modal-ok-button").addClass("disabled").attr({disabled:"disabled"})):void 0},onSelectCostume:function(e){var t,o,n;return e.preventDefault(),o=$(e.target).attr("alt")||$(e.target).find("img").attr("alt"),t={costumes:[o]},this.nameChanged||(n=Smalruby.Character.costumeToNamePrefix(o),n!==this.model.namePrefix()&&(t.name=n===this.target.namePrefix()?this.target.get("name"):Smalruby.Collections.CharacterSet.uniqueName(o))),this.model.set(t)},onRotationStyleFree:function(){return this.model.set({rotationStyle:"free"})},onRotationStyleLeftRight:function(){return this.model.set({rotationStyle:"left_right"})},onRotationStyleNone:function(){return this.model.set({rotationStyle:"none"})},onOk:function(){return this.$el.modal("hide"),this.target?this.target.set(_.clone(this.model.attributes)):void 0},setCharacter:function(e){return this.target=e,this.model.set(_.clone(this.target.attributes)),this.nameChanged=!1,this}})}.call(this),function(){Smalruby.CharacterSelectorView=Backbone.View.extend({el:"#character-selector-tab",initialize:function(){var e,t,o,n;for(this.klass=Smalruby.CharacterSelectorView,n=["add","remove","reset","change"],t=0,o=n.length;o>t;t++)e=n[t],this.listenTo(this.model,e,this.onChange);return this.templateText=$("#character-selector-template").text(),$("#add-character-button").click(function(e){var t,o,n,i;return e.preventDefault(),n=Smalruby.Collections.CharacterSet,t=(i=_.last(n.models))?{name:n.uniqueName(i.costume()),costumes:_.clone(i.get("costumes"))}:{name:n.uniqueName()},o=new Smalruby.Character(t),n.add(o),Smalruby.Views.CharacterModalView.setCharacter(o).render()}),this.render()},render:function(){var e,t=this;return e=$("#character-selector-character-set"),e.children().remove(),this.model.each(function(o){var n,i,r;return n=$(_.template(t.templateText,o)),e.append(n),n.find("a.character").click(function(e){return e.preventDefault(),Smalruby.Views.CharacterModalView.setCharacter(o).render()}),n.find("a.add-block-button").click(function(e){return e.preventDefault(),t.addBlock_(o)}),r=n.find("a.remove-button"),r.click(function(e){return e.preventDefault(),t.removeCharacter_(o)}),(Smalruby.isEnabled("disabled_new_character")||o.get("using"))&&r.hide(),i=n.find("img"),o.rotateImage(i),i.on("dragstart",function(e){return e.preventDefault()})})},onChange:function(){return Smalruby.blocklyLoading||(Smalruby.changedAfterTranslating=!0,window.changed=!0),this.render()},addBlock_:function(e){var t,o;return t=Blockly.Block.obtain(Blockly.mainWorkspace,"character_new"),t.setCharacter(e),t.initSvg(),t.render(),this.moveByNewBlock_(t),t.select(),o=Blockly.Block.obtain(Blockly.mainWorkspace,"events_on_start"),o.initSvg(),o.render(),t.getInput("DO").connection.connect(o.previousConnection)},moveByNewBlock_:function(e){var t,o,n,i,r,s,l;return o=Blockly.mainWorkspace.getMetrics(),i={x:o.viewLeft+this.klass.NEW_BLOCK_MARGIN.LEFT,y:o.viewTop+this.klass.NEW_BLOCK_MARGIN.TOP},this.prevBlock&&(s=this.prevBlock.getRelativeToSurfaceXY(),t=this.prevBlock.getHeightWidth(),n=e.getHeightWidth(),s.x===this.prevXY.x&&s.y===this.prevXY.y?(r=s.x,l=s.y+t.height+this.klass.NEW_BLOCK_MARGIN.TOP,l+n.height>o.viewTop+o.viewHeight&&(r+=t.width+this.klass.NEW_BLOCK_MARGIN.LEFT,l=i.y)):(r=this.prevXY.x,l=this.prevXY.y),r>=o.viewLeft&&r+n.width<=o.viewLeft+o.viewWidth&&l>=o.viewTop&&l+n.height<=o.viewTop+o.viewHeight&&(i.x=r,i.y=l)),e.moveBy(i.x,i.y),this.prevBlock=e,this.prevXY=e.getRelativeToSurfaceXY()},removeCharacter_:function(e){return Smalruby.isEnabled("disabled_new_character")||e.get("using")?void 0:Smalruby.Collections.CharacterSet.remove(e)}},{NEW_BLOCK_MARGIN:{LEFT:20,TOP:20}})}.call(this),function(){Smalruby.LoadModalView=Backbone.View.extend({events:{"click #load-modal-ok-button":"onOk","click #load-modal-remix-button":"onRemix"},initialize:function(){var e=this;return this.$el.find("#load-modal-find-from-computer").click(function(t){return t.preventDefault(),e.onFindFromComputerClick.call(e,t)})},render:function(){var e,t,o,n,i=this;return this.type=null,this.program=null,this.setRemix(!1),this.unselect(),o=this.$el.find("#load-modal-local-programs"),o.empty(),t=this.$el.find("#load-modal-demo-programs"),t.empty(),this.$el.find(".modal-body").block({message:null}),n=function(){return i.$el.find(".modal-body").unblock(),null},this.$el.modal({backdrop:"static"}),this.$el.modal("show"),e=$.Deferred(),$.ajax({url:"/source_codes/",type:"GET",dataType:"json",success:function(t){return e.resolve(t)},error:e.reject}),e.promise().then(function(e){var n,r,s,l,a,c,g,u,h;for(g=e.localPrograms,r=function(e){var t;return t=i.programToHtml(e,i.onLocalProgramClick),o.append(t)},s=0,a=g.length;a>s;s++)n=g[s],r(n);for(u=e.demoPrograms,h=[],l=0,c=u.length;c>l;l++)n=u[l],h.push(function(e){var o;return o=i.programToHtml(e,i.onDemoProgramClick),t.append(o)}(n));return h}).then(n,n).fail(function(){return i.$el.modal("hide"),errorMessage(Smalruby.bm("VIEWS_LOAD_MODAL_VIEW_ERROR"))})},onOk:function(){switch(this.type){case"local":$.ajax({url:"/source_codes/load_local",type:"POST",data:{source_code:{filename:this.program.filename,remix:this.remix}},dataType:"json",success:function(e){return Smalruby.Views.MainMenuView.load(e.source_code)}});break;case"demo":$.ajax({url:"/source_codes/load_demo",type:"POST",data:{source_code:{filename:this.program.filename,remix:this.remix}},dataType:"json",success:function(e){return Smalruby.Views.MainMenuView.load(e.source_code)}});break;case"find-from-computer":$('input#load-file[name="source_code[file]"]').click()}return this.$el.modal("hide")},onRemix:function(){return this.setRemix(!this.remix)},setRemix:function(e){var t,o;return this.remix=e,o=$("#load-modal-remix-button"),t="btn-success",this.remix?o.addClass(t):o.removeClass(t)},onLocalProgramClick:function(e,t){return this.select(e.currentTarget,"local",t)},onDemoProgramClick:function(e,t){return this.select(e.currentTarget,"demo",t)},onFindFromComputerClick:function(e){return this.select(e.currentTarget,"find-from-computer")},select:function(e,t,o){return null==o&&(o=null),this.unselect(),$(e).addClass("active"),this.type=t,this.program=o},unselect:function(){return this.$el.find("a.thumbnail").removeClass("active")},programToHtml:function(e,t){var o,n,i=this;return n=e.imageUrl?'<img src="'+e.imageUrl+'">':'<h1 class="icon"><i class="icon-file" /></h1>',o='<li>\n <a class="thumbnail">\n '+n+"\n <blockquote>\n <p>\n "+e.title+"\n </p>\n <small>"+e.filename+"</small>\n </blockquote>\n </div>\n</li>",o=$(o),o.find("a.thumbnail").click(function(o){return o.preventDefault(),t.call(i,o,e)}),o}})}.call(this),function(){Smalruby.MainMenuView=Backbone.View.extend({el:"#main-menu",events:{"click #block-mode-button":"onBlockMode","click #ruby-mode-button":"onRubyMode","click #run-button":"onRun","click #download-button":"onDownload","click #load-local-button":"onLoadLocal","click #load-button":"onLoad","click #save-button":"onSave","click #check-button":"onCheck","click #reset-button":"onReset","click #signin-button":"onSignin","click #signout-button":"onSignout","click #username-button":"onUsername"},initialize:function(){var e=this;return $("#filename").keypress(function(e){return e||(e=window.event),13===e.keyCode?($("#save-button").click(),!1):!0}),$("#file-form").fileupload({dataType:"json",done:function(t,o){return e.load(o.result.source_code)}})},onBlockMode:function(e){var t;return e.preventDefault(),window.blockMode?void 0:Smalruby.changedAfterTranslating?(this.blockUI({title:'<i class="icon-filter"></i>\n'+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_BLOCKUI_TITLE"),message:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_BLOCKUI_MESSAGE")}),t=new Smalruby.SourceCode,t.toBlocks().then(function(e){return window.blockMode=!0,$('#tabs a[href="#block-tab"]').tab("show"),e.length>0?(Smalruby.blocklyLoading=!0,Smalruby.translating=!0,Smalruby.loadXml(e),Smalruby.translating=!1,Smalruby.changedAfterTranslating=!1):void 0}).then(this.unblockUI,this.unblockUI).fail(function(){return window.errorMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_ERROR"))})):(window.blockMode=!0,$('#tabs a[href="#block-tab"]').tab("show"),void 0)},onRubyMode:function(e){var t;return e.preventDefault(),window.blockMode&&(window.blockMode=!1,$('#tabs a[href="#ruby-tab"]').tab("show"),Smalruby.changedAfterTranslating)?(t=Blockly.Ruby.workspaceToCode(),Smalruby.translating=!0,window.textEditor.getSession().getDocument().setValue(t),Smalruby.translating=!1,Smalruby.changedAfterTranslating=!1,window.textEditor.moveCursorTo(0,0),window.textEditor.focus()):void 0},onRun:function(e){var t,o,n,i=this;return e.preventDefault(),o=this.getSourceCode(),n=new Smalruby.SourceCode({filename:o.getRbxmlFilename()}),clearMessages(),this.blockUI({title:'<i class="icon-play"></i>\n'+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_TITLE"),message:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_MESSAGE"),notice:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_NOTICE")}),t=Smalruby.bm("VIEWS_MAIN_MENU_VIEW_RUN_ERROR_CANT_RUN"),o.save2().then(function(){return o.write()}).then(function(e){return i.confirmOverwrite_.call(i,e,o,function(){return t=Smalruby.bm("VIEWS_MAIN_MENU_VIEW_RUN_ERROR_CANCEL_TO_RUN")})}).then(function(){return Smalruby.savedFilename=o.get("filename"),window.changed=!1,o.check()}).then(function(e){var t,o,n,i;if(e.length>0){for(o=function(e){var t;return t=""+e.row+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_LINES"),e.column>0&&(t+=""+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_COMMA")+e.column+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_LETTERS")),window.errorMessage(t+(": "+e.message))},n=0,i=e.length;i>n;n++)t=e[n],o(t);return $.Deferred().reject().promise()}}).then(function(){return n.save2()}).then(function(){return n.write(!0)}).then(function(){return o.run()}).then(function(e){var t,o,n,i;if(e.length>0){for(o=function(e){var t;return t=""+e.row+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_LINES"),e.column>0&&(t+=""+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_COMMA")+e.column+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_LETTERS")),errorMessage(t+(": "+e.message))},n=0,i=e.length;i>n;n++)t=e[n],o(t);return $.Deferred().reject().promise()}}).then(this.unblockUI,this.unblockUI).fail(function(){return errorMessage(t)})},onDownload:function(e){var t;return e.preventDefault(),t=this.getSourceCode(),clearMessages(),this.blockUI({title:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_DOWNLOAD_BLOCKUI_TITLE"),message:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_DOWNLOAD_BLOCKUI_MESSAGE")}),t.save2().then(function(){return window.changed=!1,window.successMessage(goog.getMsg(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_DOWNLOAD_SUCCEEDED"),{filename:t.get("filename")})),Smalruby.downloading=!0,$("#download-link").click()}).then(this.unblockUI,this.unblockUI).fail(function(){return window.errorMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_DOWNLOAD_ERROR"))})},onLoadLocal:function(e){return e.preventDefault(),!window.changed||confirm(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_LOAD_CONFIRM"))?Smalruby.Views.LoadModalView.render():void 0},onLoad:function(e){return e.preventDefault(),!window.changed||confirm(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_LOAD_CONFIRM"))?$('input#load-file[name="source_code[file]"]').click():void 0},onSave:function(e){var t,o,n,i=this;return e.preventDefault(),o=$.trim($("#filename").val()),o.length<=0?(window.errorMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_ERROR_NO_NAME")),$("#filename").focus(),void 0):(n=this.getSourceCode(),window.blockMode&&(n=new Smalruby.SourceCode({filename:n.getRbxmlFilename()})),clearMessages(),this.blockUI({title:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_TITLE"),message:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_MESSAGE"),notice:goog.getMsg(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_NOTICE"),{filename:n.get("filename")})}),t=Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_ERROR_MESSAGE"),n.save2().then(function(){return n.write()}).then(function(e){return i.confirmOverwrite_.call(i,e,n,function(){return t=Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_CANCELED")})}).then(this.unblockUI,this.unblockUI).done(function(){return Smalruby.savedFilename=n.get("filename"),window.changed=!1,window.successMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_SUCCEEDED"))}).fail(function(){return window.errorMessage(t)}))},onCheck:function(e){var t;return e.preventDefault(),clearMessages(),t=this.getSourceCode(),this.blockUI({title:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_TITLE"),message:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_MESSAGE"),notice:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_NOTICE")}),t.check().then(function(e){var t,o,n,i;if(0===e.length)return window.successMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_CHECK_SUCCEEDED"),Smalruby.bm("VIEWS_MAIN_MENU_VIEW_CHECK_SUCCEEDED_NOTICE"));for(i=[],o=0,n=e.length;n>o;o++)t=e[o],i.push(function(e){var t;return t=""+e.row+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_LINES"),e.column>0&&(t+=""+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_COMMA")+e.column+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_LETTERS")),window.errorMessage(t+(": "+e.message))}(t));return i}).then(this.unblockUI,this.unblockUI).fail(function(){return errorMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_CHECK_ERROR"))})},onReset:function(e){return e.preventDefault(),window.changed?Smalruby.Views.ResetModalView.render():Smalruby.reset(),!0},onSignin:function(e){return e.preventDefault(),Smalruby.Views.SigninModalView.render()},onSignout:function(e){return e.preventDefault(),$.ajax({url:"/signout",type:"DELETE"}).then(function(){return Smalruby.username=null,$("#signin-button").show(),$("#signout-button").hide(),$("#username-label").text(""),$("#username-button").hide(),successMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SIGNOUT_SUCCEEDED")),Smalruby.isEnabled("must_signin")?Smalruby.Views.SigninModalView.render():void 0},function(){return errorMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SIGNOUT_ERROR"))})},onUsername:function(e){return e.preventDefault()},getFilename:function(){return $.trim($("#filename").val())},getSourceCode:function(){var e;return e=new Smalruby.SourceCode,$("#filename").val(e.get("filename")),e},blockUI:function(e){var t,o;return t="",e.title&&(t+="<h3>\n "+e.title+"\n</h3>"),(e.message||e.notice)&&(o="",e.message&&(o+="<p>\n "+e.message+"\n</p>"),e.notice&&(o+="<small>\n "+e.notice+"\n</small>"),t+="<blockquote>\n "+o+"\n</blockquote>"),$.blockUI({message:t,css:{border:"none","text-align":"left","padding-left":"2em"}})
35
+ }),this.appendDummyInput().appendField(e,"TYPE").appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,"String"),t=this,this.setTooltip(function(){return"TEXT"==t.getFieldValue("TYPE")?Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT:Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER})},newQuote_:Blockly.Blocks.text.newQuote_},Blockly.Blocks.text_prompt_ext={init:function(){var e=[[Blockly.Msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]],t=this;this.setHelpUrl(Blockly.Msg.TEXT_PROMPT_HELPURL),this.setColour(Blockly.Blocks.texts.HUE),e=new Blockly.FieldDropdown(e,function(e){"NUMBER"==e?t.changeOutput("Number"):t.changeOutput("String")}),this.appendValueInput("TEXT").appendField(e,"TYPE"),this.setOutput(!0,"String"),t=this,this.setTooltip(function(){return"TEXT"==t.getFieldValue("TYPE")?Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT:Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER})}},Blockly.Blocks.variables={},Blockly.Blocks.variables.HUE=330,Blockly.Blocks.variables_get={init:function(){this.setHelpUrl(Blockly.Msg.VARIABLES_GET_HELPURL),this.setColour(Blockly.Blocks.variables.HUE),this.appendDummyInput().appendField(Blockly.Msg.VARIABLES_GET_TITLE).appendField(new Blockly.FieldVariable(Blockly.Msg.VARIABLES_GET_ITEM),"VAR").appendField(Blockly.Msg.VARIABLES_GET_TAIL),this.setOutput(!0),this.setTooltip(Blockly.Msg.VARIABLES_GET_TOOLTIP),this.contextMenuMsg_=Blockly.Msg.VARIABLES_GET_CREATE_SET,this.contextMenuType_="variables_set"},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Blockly.Names.equals(e,this.getFieldValue("VAR"))&&this.setFieldValue(t,"VAR")},customContextMenu:function(e){var t={enabled:!0},o=this.getFieldValue("VAR");t.text=this.contextMenuMsg_.replace("%1",o),o=goog.dom.createDom("field",null,o),o.setAttribute("name","VAR"),o=goog.dom.createDom("block",null,o),o.setAttribute("type",this.contextMenuType_),t.callback=Blockly.ContextMenu.callbackFactory(this,o),e.push(t)}},Blockly.Blocks.variables_set={init:function(){this.setHelpUrl(Blockly.Msg.VARIABLES_SET_HELPURL),this.setColour(Blockly.Blocks.variables.HUE),this.interpolateMsg(Blockly.Msg.VARIABLES_SET_TITLE+" %1 "+Blockly.Msg.VARIABLES_SET_TAIL+" %2",["VAR",new Blockly.FieldVariable(Blockly.Msg.VARIABLES_SET_ITEM)],["VALUE",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Blockly.Msg.VARIABLES_SET_TOOLTIP),this.contextMenuMsg_=Blockly.Msg.VARIABLES_SET_CREATE_GET,this.contextMenuType_="variables_get"},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Blockly.Names.equals(e,this.getFieldValue("VAR"))&&this.setFieldValue(t,"VAR")},customContextMenu:Blockly.Blocks.variables_get.customContextMenu},Blockly.Toolbox.TreeNode.prototype.onMouseDown=function(){this.hasChildren()&&this.isUserCollapsible_?(this.toggle(),this.select()):this.isSelected()||this.select(),this.updateRow()},Blockly.Blocks.math.HUE=100,Blockly.Blocks.texts.HUE=100,Blockly.FieldTextInput.prototype.showEditorOrig_=Blockly.FieldTextInput.prototype.showEditor_,Blockly.FieldTextInput.prototype.showEditor_=function(){Blockly.FieldTextInput.prototype.showEditorOrig_.apply(this,arguments);var e=Blockly.FieldTextInput.htmlInput_;e.onKeyDownWrapper_=Blockly.bindEvent_(e,"keydown",this,this.onHtmlInputChange2_)},Blockly.FieldTextInput.prototype.onHtmlInputChange_=function(e){var t=Blockly.FieldTextInput.htmlInput_;if(27!=e.keyCode){var o=t.value;o!==t.oldValue_?(t.oldValue_=o,this.setText(o),this.validate_()):goog.userAgent.WEBKIT&&this.sourceBlock_.render()}},Blockly.FieldTextInput.prototype.onHtmlInputChange2_=function(e){var t=Blockly.FieldTextInput.htmlInput_;13==e.keyCode?Blockly.WidgetDiv.hide():27==e.keyCode&&(this.setText(t.defaultValue),Blockly.WidgetDiv.hide())},Blockly.FieldTextInput.prototype.widgetDisposeOrig_=Blockly.FieldTextInput.prototype.widgetDispose_,Blockly.FieldTextInput.prototype.widgetDispose_=function(){var e=this;return function(){Blockly.FieldTextInput.prototype.widgetDisposeOrig_.call(e);var t=Blockly.FieldTextInput.htmlInput_;Blockly.unbindEvent_(t.onKeyDownWrapper_)}},Blockly.Names.prototype.safeName_=function(e){return e?(e=e.replace(/[ !"#$%&'()=\-~^\\|`@{\[+;*:}\]<>,.?\/]/g,"_"),-1!="0123456789".indexOf(e[0])&&(e="_"+e)):e="unnamed",e},function(){var e=this,t=e._,o={},n=Array.prototype,i=Object.prototype,r=Function.prototype,s=n.push,l=n.slice,a=n.concat,c=i.toString,g=i.hasOwnProperty,u=n.forEach,h=n.map,d=n.reduce,p=n.reduceRight,f=n.filter,m=n.every,y=n.some,_=n.indexOf,E=n.lastIndexOf,v=Array.isArray,C=Object.keys,B=r.bind,k=function(e){return e instanceof k?e:this instanceof k?(this._wrapped=e,void 0):new k(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports._=k):e._=k,k.VERSION="1.5.2";var b=k.each=k.forEach=function(e,t,n){if(null!=e)if(u&&e.forEach===u)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,r=e.length;r>i;i++)if(t.call(n,e[i],i,e)===o)return}else for(var s=k.keys(e),i=0,r=s.length;r>i;i++)if(t.call(n,e[s[i]],s[i],e)===o)return};k.map=k.collect=function(e,t,o){var n=[];return null==e?n:h&&e.map===h?e.map(t,o):(b(e,function(e,i,r){n.push(t.call(o,e,i,r))}),n)};var A="Reduce of empty array with no initial value";k.reduce=k.foldl=k.inject=function(e,t,o,n){var i=arguments.length>2;if(null==e&&(e=[]),d&&e.reduce===d)return n&&(t=k.bind(t,n)),i?e.reduce(t,o):e.reduce(t);if(b(e,function(e,r,s){i?o=t.call(n,o,e,r,s):(o=e,i=!0)}),!i)throw new TypeError(A);return o},k.reduceRight=k.foldr=function(e,t,o,n){var i=arguments.length>2;if(null==e&&(e=[]),p&&e.reduceRight===p)return n&&(t=k.bind(t,n)),i?e.reduceRight(t,o):e.reduceRight(t);var r=e.length;if(r!==+r){var s=k.keys(e);r=s.length}if(b(e,function(l,a,c){a=s?s[--r]:--r,i?o=t.call(n,o,e[a],a,c):(o=e[a],i=!0)}),!i)throw new TypeError(A);return o},k.find=k.detect=function(e,t,o){var n;return T(e,function(e,i,r){return t.call(o,e,i,r)?(n=e,!0):void 0}),n},k.filter=k.select=function(e,t,o){var n=[];return null==e?n:f&&e.filter===f?e.filter(t,o):(b(e,function(e,i,r){t.call(o,e,i,r)&&n.push(e)}),n)},k.reject=function(e,t,o){return k.filter(e,function(e,n,i){return!t.call(o,e,n,i)},o)},k.every=k.all=function(e,t,n){t||(t=k.identity);var i=!0;return null==e?i:m&&e.every===m?e.every(t,n):(b(e,function(e,r,s){return(i=i&&t.call(n,e,r,s))?void 0:o}),!!i)};var T=k.some=k.any=function(e,t,n){t||(t=k.identity);var i=!1;return null==e?i:y&&e.some===y?e.some(t,n):(b(e,function(e,r,s){return i||(i=t.call(n,e,r,s))?o:void 0}),!!i)};k.contains=k.include=function(e,t){return null==e?!1:_&&e.indexOf===_?-1!=e.indexOf(t):T(e,function(e){return e===t})},k.invoke=function(e,t){var o=l.call(arguments,2),n=k.isFunction(t);return k.map(e,function(e){return(n?t:e[t]).apply(e,o)})},k.pluck=function(e,t){return k.map(e,function(e){return e[t]})},k.where=function(e,t,o){return k.isEmpty(t)?o?void 0:[]:k[o?"find":"filter"](e,function(e){for(var o in t)if(t[o]!==e[o])return!1;return!0})},k.findWhere=function(e,t){return k.where(e,t,!0)},k.max=function(e,t,o){if(!t&&k.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&k.isEmpty(e))return-1/0;var n={computed:-1/0,value:-1/0};return b(e,function(e,i,r){var s=t?t.call(o,e,i,r):e;s>n.computed&&(n={value:e,computed:s})}),n.value},k.min=function(e,t,o){if(!t&&k.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&k.isEmpty(e))return 1/0;var n={computed:1/0,value:1/0};return b(e,function(e,i,r){var s=t?t.call(o,e,i,r):e;s<n.computed&&(n={value:e,computed:s})}),n.value},k.shuffle=function(e){var t,o=0,n=[];return b(e,function(e){t=k.random(o++),n[o-1]=n[t],n[t]=e}),n},k.sample=function(e,t,o){return arguments.length<2||o?e[k.random(e.length-1)]:k.shuffle(e).slice(0,Math.max(0,t))};var S=function(e){return k.isFunction(e)?e:function(t){return t[e]}};k.sortBy=function(e,t,o){var n=S(t);return k.pluck(k.map(e,function(e,t,i){return{value:e,index:t,criteria:n.call(o,e,t,i)}}).sort(function(e,t){var o=e.criteria,n=t.criteria;if(o!==n){if(o>n||void 0===o)return 1;if(n>o||void 0===n)return-1}return e.index-t.index}),"value")};var R=function(e){return function(t,o,n){var i={},r=null==o?k.identity:S(o);return b(t,function(o,s){var l=r.call(n,o,s,t);e(i,l,o)}),i}};k.groupBy=R(function(e,t,o){(k.has(e,t)?e[t]:e[t]=[]).push(o)}),k.indexBy=R(function(e,t,o){e[t]=o}),k.countBy=R(function(e,t){k.has(e,t)?e[t]++:e[t]=1}),k.sortedIndex=function(e,t,o,n){o=null==o?k.identity:S(o);for(var i=o.call(n,t),r=0,s=e.length;s>r;){var l=r+s>>>1;o.call(n,e[l])<i?r=l+1:s=l}return r},k.toArray=function(e){return e?k.isArray(e)?l.call(e):e.length===+e.length?k.map(e,k.identity):k.values(e):[]},k.size=function(e){return null==e?0:e.length===+e.length?e.length:k.keys(e).length},k.first=k.head=k.take=function(e,t,o){return null==e?void 0:null==t||o?e[0]:l.call(e,0,t)},k.initial=function(e,t,o){return l.call(e,0,e.length-(null==t||o?1:t))},k.last=function(e,t,o){return null==e?void 0:null==t||o?e[e.length-1]:l.call(e,Math.max(e.length-t,0))},k.rest=k.tail=k.drop=function(e,t,o){return l.call(e,null==t||o?1:t)},k.compact=function(e){return k.filter(e,k.identity)};var I=function(e,t,o){return t&&k.every(e,k.isArray)?a.apply(o,e):(b(e,function(e){k.isArray(e)||k.isArguments(e)?t?s.apply(o,e):I(e,t,o):o.push(e)}),o)};k.flatten=function(e,t){return I(e,t,[])},k.without=function(e){return k.difference(e,l.call(arguments,1))},k.uniq=k.unique=function(e,t,o,n){k.isFunction(t)&&(n=o,o=t,t=!1);var i=o?k.map(e,o,n):e,r=[],s=[];return b(i,function(o,n){(t?n&&s[s.length-1]===o:k.contains(s,o))||(s.push(o),r.push(e[n]))}),r},k.union=function(){return k.uniq(k.flatten(arguments,!0))},k.intersection=function(e){var t=l.call(arguments,1);return k.filter(k.uniq(e),function(e){return k.every(t,function(t){return k.indexOf(t,e)>=0})})},k.difference=function(e){var t=a.apply(n,l.call(arguments,1));return k.filter(e,function(e){return!k.contains(t,e)})},k.zip=function(){for(var e=k.max(k.pluck(arguments,"length").concat(0)),t=new Array(e),o=0;e>o;o++)t[o]=k.pluck(arguments,""+o);return t},k.object=function(e,t){if(null==e)return{};for(var o={},n=0,i=e.length;i>n;n++)t?o[e[n]]=t[n]:o[e[n][0]]=e[n][1];return o},k.indexOf=function(e,t,o){if(null==e)return-1;var n=0,i=e.length;if(o){if("number"!=typeof o)return n=k.sortedIndex(e,t),e[n]===t?n:-1;n=0>o?Math.max(0,i+o):o}if(_&&e.indexOf===_)return e.indexOf(t,o);for(;i>n;n++)if(e[n]===t)return n;return-1},k.lastIndexOf=function(e,t,o){if(null==e)return-1;var n=null!=o;if(E&&e.lastIndexOf===E)return n?e.lastIndexOf(t,o):e.lastIndexOf(t);for(var i=n?o:e.length;i--;)if(e[i]===t)return i;return-1},k.range=function(e,t,o){arguments.length<=1&&(t=e||0,e=0),o=arguments[2]||1;for(var n=Math.max(Math.ceil((t-e)/o),0),i=0,r=new Array(n);n>i;)r[i++]=e,e+=o;return r};var D=function(){};k.bind=function(e,t){var o,n;if(B&&e.bind===B)return B.apply(e,l.call(arguments,1));if(!k.isFunction(e))throw new TypeError;return o=l.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,o.concat(l.call(arguments)));D.prototype=e.prototype;var i=new D;D.prototype=null;var r=e.apply(i,o.concat(l.call(arguments)));return Object(r)===r?r:i}},k.partial=function(e){var t=l.call(arguments,1);return function(){return e.apply(this,t.concat(l.call(arguments)))}},k.bindAll=function(e){var t=l.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return b(t,function(t){e[t]=k.bind(e[t],e)}),e},k.memoize=function(e,t){var o={};return t||(t=k.identity),function(){var n=t.apply(this,arguments);return k.has(o,n)?o[n]:o[n]=e.apply(this,arguments)}},k.delay=function(e,t){var o=l.call(arguments,2);return setTimeout(function(){return e.apply(null,o)},t)},k.defer=function(e){return k.delay.apply(k,[e,1].concat(l.call(arguments,1)))},k.throttle=function(e,t,o){var n,i,r,s=null,l=0;o||(o={});var a=function(){l=o.leading===!1?0:new Date,s=null,r=e.apply(n,i)};return function(){var c=new Date;l||o.leading!==!1||(l=c);var g=t-(c-l);return n=this,i=arguments,0>=g?(clearTimeout(s),s=null,l=c,r=e.apply(n,i)):s||o.trailing===!1||(s=setTimeout(a,g)),r}},k.debounce=function(e,t,o){var n,i,r,s,l;return function(){r=this,i=arguments,s=new Date;var a=function(){var c=new Date-s;t>c?n=setTimeout(a,t-c):(n=null,o||(l=e.apply(r,i)))},c=o&&!n;return n||(n=setTimeout(a,t)),c&&(l=e.apply(r,i)),l}},k.once=function(e){var t,o=!1;return function(){return o?t:(o=!0,t=e.apply(this,arguments),e=null,t)}},k.wrap=function(e,t){return function(){var o=[e];return s.apply(o,arguments),t.apply(this,o)}},k.compose=function(){var e=arguments;return function(){for(var t=arguments,o=e.length-1;o>=0;o--)t=[e[o].apply(this,t)];return t[0]}},k.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},k.keys=C||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var o in e)k.has(e,o)&&t.push(o);return t},k.values=function(e){for(var t=k.keys(e),o=t.length,n=new Array(o),i=0;o>i;i++)n[i]=e[t[i]];return n},k.pairs=function(e){for(var t=k.keys(e),o=t.length,n=new Array(o),i=0;o>i;i++)n[i]=[t[i],e[t[i]]];return n},k.invert=function(e){for(var t={},o=k.keys(e),n=0,i=o.length;i>n;n++)t[e[o[n]]]=o[n];return t},k.functions=k.methods=function(e){var t=[];for(var o in e)k.isFunction(e[o])&&t.push(o);return t.sort()},k.extend=function(e){return b(l.call(arguments,1),function(t){if(t)for(var o in t)e[o]=t[o]}),e},k.pick=function(e){var t={},o=a.apply(n,l.call(arguments,1));return b(o,function(o){o in e&&(t[o]=e[o])}),t},k.omit=function(e){var t={},o=a.apply(n,l.call(arguments,1));for(var i in e)k.contains(o,i)||(t[i]=e[i]);return t},k.defaults=function(e){return b(l.call(arguments,1),function(t){if(t)for(var o in t)void 0===e[o]&&(e[o]=t[o])}),e},k.clone=function(e){return k.isObject(e)?k.isArray(e)?e.slice():k.extend({},e):e},k.tap=function(e,t){return t(e),e};var w=function(e,t,o,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof k&&(e=e._wrapped),t instanceof k&&(t=t._wrapped);var i=c.call(e);if(i!=c.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return!1;for(var r=o.length;r--;)if(o[r]==e)return n[r]==t;var s=e.constructor,l=t.constructor;if(s!==l&&!(k.isFunction(s)&&s instanceof s&&k.isFunction(l)&&l instanceof l))return!1;o.push(e),n.push(t);var a=0,g=!0;if("[object Array]"==i){if(a=e.length,g=a==t.length)for(;a--&&(g=w(e[a],t[a],o,n)););}else{for(var u in e)if(k.has(e,u)&&(a++,!(g=k.has(t,u)&&w(e[u],t[u],o,n))))break;if(g){for(u in t)if(k.has(t,u)&&!a--)break;g=!a}}return o.pop(),n.pop(),g};k.isEqual=function(e,t){return w(e,t,[],[])},k.isEmpty=function(e){if(null==e)return!0;if(k.isArray(e)||k.isString(e))return 0===e.length;for(var t in e)if(k.has(e,t))return!1;return!0},k.isElement=function(e){return!(!e||1!==e.nodeType)},k.isArray=v||function(e){return"[object Array]"==c.call(e)},k.isObject=function(e){return e===Object(e)},b(["Arguments","Function","String","Number","Date","RegExp"],function(e){k["is"+e]=function(t){return c.call(t)=="[object "+e+"]"}}),k.isArguments(arguments)||(k.isArguments=function(e){return!(!e||!k.has(e,"callee"))}),"function"!=typeof/./&&(k.isFunction=function(e){return"function"==typeof e}),k.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},k.isNaN=function(e){return k.isNumber(e)&&e!=+e},k.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"==c.call(e)},k.isNull=function(e){return null===e},k.isUndefined=function(e){return void 0===e},k.has=function(e,t){return g.call(e,t)},k.noConflict=function(){return e._=t,this},k.identity=function(e){return e},k.times=function(e,t,o){for(var n=Array(Math.max(0,e)),i=0;e>i;i++)n[i]=t.call(o,i);return n},k.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var L={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};L.unescape=k.invert(L.escape);var F={escape:new RegExp("["+k.keys(L.escape).join("")+"]","g"),unescape:new RegExp("("+k.keys(L.unescape).join("|")+")","g")};k.each(["escape","unescape"],function(e){k[e]=function(t){return null==t?"":(""+t).replace(F[e],function(t){return L[e][t]})}}),k.result=function(e,t){if(null==e)return void 0;var o=e[t];return k.isFunction(o)?o.call(e):o},k.mixin=function(e){b(k.functions(e),function(t){var o=k[t]=e[t];k.prototype[t]=function(){var e=[this._wrapped];return s.apply(e,arguments),P.call(this,o.apply(k,e))}})};var N=0;k.uniqueId=function(e){var t=++N+"";return e?e+t:t},k.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var O=/(.)^/,M={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},x=/\\|'|\r|\n|\t|\u2028|\u2029/g;k.template=function(e,t,o){var n;o=k.defaults({},o,k.templateSettings);var i=new RegExp([(o.escape||O).source,(o.interpolate||O).source,(o.evaluate||O).source].join("|")+"|$","g"),r=0,s="__p+='";e.replace(i,function(t,o,n,i,l){return s+=e.slice(r,l).replace(x,function(e){return"\\"+M[e]}),o&&(s+="'+\n((__t=("+o+"))==null?'':_.escape(__t))+\n'"),n&&(s+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),i&&(s+="';\n"+i+"\n__p+='"),r=l+t.length,t}),s+="';\n",o.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{n=new Function(o.variable||"obj","_",s)}catch(l){throw l.source=s,l}if(t)return n(t,k);var a=function(e){return n.call(this,e,k)};return a.source="function("+(o.variable||"obj")+"){\n"+s+"}",a},k.chain=function(e){return k(e).chain()};var P=function(e){return this._chain?k(e).chain():e};k.mixin(k),b(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=n[e];k.prototype[e]=function(){var o=this._wrapped;return t.apply(o,arguments),"shift"!=e&&"splice"!=e||0!==o.length||delete o[0],P.call(this,o)}}),b(["concat","join","slice"],function(e){var t=n[e];k.prototype[e]=function(){return P.call(this,t.apply(this._wrapped,arguments))}}),k.extend(k.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),function(){{var e,t=this,o=t.Backbone,n=[],i=(n.push,n.slice);n.splice}e="undefined"!=typeof exports?exports:t.Backbone={},e.VERSION="1.1.0";var r=t._;r||"undefined"==typeof require||(r=require("underscore")),e.$=t.jQuery||t.Zepto||t.ender||t.$,e.noConflict=function(){return t.Backbone=o,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s=e.Events={on:function(e,t,o){if(!a(this,"on",e,[t,o])||!t)return this;this._events||(this._events={});var n=this._events[e]||(this._events[e]=[]);return n.push({callback:t,context:o,ctx:o||this}),this},once:function(e,t,o){if(!a(this,"once",e,[t,o])||!t)return this;var n=this,i=r.once(function(){n.off(e,i),t.apply(this,arguments)});return i._callback=t,this.on(e,i,o)},off:function(e,t,o){var n,i,s,l,c,g,u,h;if(!this._events||!a(this,"off",e,[t,o]))return this;if(!e&&!t&&!o)return this._events={},this;for(l=e?[e]:r.keys(this._events),c=0,g=l.length;g>c;c++)if(e=l[c],s=this._events[e]){if(this._events[e]=n=[],t||o)for(u=0,h=s.length;h>u;u++)i=s[u],(t&&t!==i.callback&&t!==i.callback._callback||o&&o!==i.context)&&n.push(i);n.length||delete this._events[e]}return this},trigger:function(e){if(!this._events)return this;var t=i.call(arguments,1);if(!a(this,"trigger",e,t))return this;var o=this._events[e],n=this._events.all;return o&&c(o,t),n&&c(n,arguments),this},stopListening:function(e,t,o){var n=this._listeningTo;if(!n)return this;var i=!t&&!o;o||"object"!=typeof t||(o=this),e&&((n={})[e._listenId]=e);for(var s in n)e=n[s],e.off(t,o,this),(i||r.isEmpty(e._events))&&delete this._listeningTo[s];return this}},l=/\s+/,a=function(e,t,o,n){if(!o)return!0;if("object"==typeof o){for(var i in o)e[t].apply(e,[i,o[i]].concat(n));return!1}if(l.test(o)){for(var r=o.split(l),s=0,a=r.length;a>s;s++)e[t].apply(e,[r[s]].concat(n));return!1}return!0},c=function(e,t){var o,n=-1,i=e.length,r=t[0],s=t[1],l=t[2];switch(t.length){case 0:for(;++n<i;)(o=e[n]).callback.call(o.ctx);return;case 1:for(;++n<i;)(o=e[n]).callback.call(o.ctx,r);return;case 2:for(;++n<i;)(o=e[n]).callback.call(o.ctx,r,s);return;case 3:for(;++n<i;)(o=e[n]).callback.call(o.ctx,r,s,l);return;default:for(;++n<i;)(o=e[n]).callback.apply(o.ctx,t)}},g={listenTo:"on",listenToOnce:"once"};r.each(g,function(e,t){s[t]=function(t,o,n){var i=this._listeningTo||(this._listeningTo={}),s=t._listenId||(t._listenId=r.uniqueId("l"));return i[s]=t,n||"object"!=typeof o||(n=this),t[e](o,n,this),this}}),s.bind=s.on,s.unbind=s.off,r.extend(e,s);var u=e.Model=function(e,t){var o=e||{};t||(t={}),this.cid=r.uniqueId("c"),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(o=this.parse(o,t)||{}),o=r.defaults({},o,r.result(this,"defaults")),this.set(o,t),this.changed={},this.initialize.apply(this,arguments)};r.extend(u.prototype,s,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(){return r.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return r.escape(this.get(e))},has:function(e){return null!=this.get(e)},set:function(e,t,o){var n,i,s,l,a,c,g,u;if(null==e)return this;if("object"==typeof e?(i=e,o=t):(i={})[e]=t,o||(o={}),!this._validate(i,o))return!1;s=o.unset,a=o.silent,l=[],c=this._changing,this._changing=!0,c||(this._previousAttributes=r.clone(this.attributes),this.changed={}),u=this.attributes,g=this._previousAttributes,this.idAttribute in i&&(this.id=i[this.idAttribute]);for(n in i)t=i[n],r.isEqual(u[n],t)||l.push(n),r.isEqual(g[n],t)?delete this.changed[n]:this.changed[n]=t,s?delete u[n]:u[n]=t;if(!a){l.length&&(this._pending=!0);for(var h=0,d=l.length;d>h;h++)this.trigger("change:"+l[h],this,u[l[h]],o)}if(c)return this;if(!a)for(;this._pending;)this._pending=!1,this.trigger("change",this,o);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,r.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var o in this.attributes)t[o]=void 0;return this.set(t,r.extend({},e,{unset:!0}))},hasChanged:function(e){return null==e?!r.isEmpty(this.changed):r.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?r.clone(this.changed):!1;var t,o=!1,n=this._changing?this._previousAttributes:this.attributes;for(var i in e)r.isEqual(n[i],t=e[i])||((o||(o={}))[i]=t);return o},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return r.clone(this._previousAttributes)},fetch:function(e){e=e?r.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=this,o=e.success;return e.success=function(n){return t.set(t.parse(n,e),e)?(o&&o(t,n,e),t.trigger("sync",t,n,e),void 0):!1},M(this,e),this.sync("read",this,e)},save:function(e,t,o){var n,i,s,l=this.attributes;if(null==e||"object"==typeof e?(n=e,o=t):(n={})[e]=t,o=r.extend({validate:!0},o),n&&!o.wait){if(!this.set(n,o))return!1}else if(!this._validate(n,o))return!1;n&&o.wait&&(this.attributes=r.extend({},l,n)),void 0===o.parse&&(o.parse=!0);var a=this,c=o.success;return o.success=function(e){a.attributes=l;var t=a.parse(e,o);return o.wait&&(t=r.extend(n||{},t)),r.isObject(t)&&!a.set(t,o)?!1:(c&&c(a,e,o),a.trigger("sync",a,e,o),void 0)},M(this,o),i=this.isNew()?"create":o.patch?"patch":"update","patch"===i&&(o.attrs=n),s=this.sync(i,this,o),n&&o.wait&&(this.attributes=l),s},destroy:function(e){e=e?r.clone(e):{};var t=this,o=e.success,n=function(){t.trigger("destroy",t,t.collection,e)};if(e.success=function(i){(e.wait||t.isNew())&&n(),o&&o(t,i,e),t.isNew()||t.trigger("sync",t,i,e)},this.isNew())return e.success(),!1;M(this,e);var i=this.sync("delete",this,e);return e.wait||n(),i},url:function(){var e=r.result(this,"urlRoot")||r.result(this.collection,"url")||O();return this.isNew()?e:e+("/"===e.charAt(e.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(e){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},isValid:function(e){return this._validate({},r.extend(e||{},{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=r.extend({},this.attributes,e);var o=this.validationError=this.validate(e,t)||null;return o?(this.trigger("invalid",this,o,r.extend(t,{validationError:o})),!1):!0}});var h=["keys","values","pairs","invert","pick","omit"];r.each(h,function(e){u.prototype[e]=function(){var t=i.call(arguments);return t.unshift(this.attributes),r[e].apply(r,t)}});var d=e.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,r.extend({silent:!0},t))},p={add:!0,remove:!0,merge:!0},f={add:!0,remove:!1};r.extend(d.prototype,s,{model:u,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return e.sync.apply(this,arguments)},add:function(e,t){return this.set(e,r.extend({merge:!1},t,f))},remove:function(e,t){var o=!r.isArray(e);e=o?[e]:r.clone(e),t||(t={});var n,i,s,l;for(n=0,i=e.length;i>n;n++)l=e[n]=this.get(e[n]),l&&(delete this._byId[l.id],delete this._byId[l.cid],s=this.indexOf(l),this.models.splice(s,1),this.length--,t.silent||(t.index=s,l.trigger("remove",l,this,t)),this._removeReference(l));return o?e[0]:e},set:function(e,t){t=r.defaults({},t,p),t.parse&&(e=this.parse(e,t));var o=!r.isArray(e);e=o?e?[e]:[]:r.clone(e);var n,i,s,l,a,c,g,h=t.at,d=this.model,f=this.comparator&&null==h&&t.sort!==!1,m=r.isString(this.comparator)?this.comparator:null,y=[],_=[],E={},v=t.add,C=t.merge,B=t.remove,k=!f&&v&&B?[]:!1;for(n=0,i=e.length;i>n;n++){if(a=e[n],s=a instanceof u?l=a:a[d.prototype.idAttribute],c=this.get(s))B&&(E[c.cid]=!0),C&&(a=a===l?l.attributes:a,t.parse&&(a=c.parse(a,t)),c.set(a,t),f&&!g&&c.hasChanged(m)&&(g=!0)),e[n]=c;else if(v){if(l=e[n]=this._prepareModel(a,t),!l)continue;y.push(l),l.on("all",this._onModelEvent,this),this._byId[l.cid]=l,null!=l.id&&(this._byId[l.id]=l)}k&&k.push(c||l)}if(B){for(n=0,i=this.length;i>n;++n)E[(l=this.models[n]).cid]||_.push(l);_.length&&this.remove(_,t)}if(y.length||k&&k.length)if(f&&(g=!0),this.length+=y.length,null!=h)for(n=0,i=y.length;i>n;n++)this.models.splice(h+n,0,y[n]);else{k&&(this.models.length=0);var b=k||y;for(n=0,i=b.length;i>n;n++)this.models.push(b[n])}if(g&&this.sort({silent:!0}),!t.silent){for(n=0,i=y.length;i>n;n++)(l=y[n]).trigger("add",l,this,t);(g||k&&k.length)&&this.trigger("sort",this,t)}return o?e[0]:e},reset:function(e,t){t||(t={});for(var o=0,n=this.models.length;n>o;o++)this._removeReference(this.models[o]);return t.previousModels=this.models,this._reset(),e=this.add(e,r.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,r.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e),t},unshift:function(e,t){return this.add(e,r.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e),t},slice:function(){return i.apply(this.models,arguments)},get:function(e){return null==e?void 0:this._byId[e.id]||this._byId[e.cid]||this._byId[e]},at:function(e){return this.models[e]},where:function(e,t){return r.isEmpty(e)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var o in e)if(e[o]!==t.get(o))return!1;return!0})},findWhere:function(e){return this.where(e,!0)},sort:function(e){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return e||(e={}),r.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(r.bind(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return r.invoke(this.models,"get",e)},fetch:function(e){e=e?r.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=e.success,o=this;return e.success=function(n){var i=e.reset?"reset":"set";o[i](n,e),t&&t(o,n,e),o.trigger("sync",o,n,e)},M(this,e),this.sync("read",this,e)},create:function(e,t){if(t=t?r.clone(t):{},!(e=this._prepareModel(e,t)))return!1;t.wait||this.add(e,t);var o=this,n=t.success;return t.success=function(e,t,i){i.wait&&o.add(e,i),n&&n(e,t,i)},e.save(null,t),e},parse:function(e){return e},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(e instanceof u)return e.collection||(e.collection=this),e;t=t?r.clone(t):{},t.collection=this;var o=new this.model(e,t);return o.validationError?(this.trigger("invalid",this,o.validationError,t),!1):o},_removeReference:function(e){this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,o,n){("add"!==e&&"remove"!==e||o===this)&&("destroy"===e&&this.remove(t,n),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],null!=t.id&&(this._byId[t.id]=t)),this.trigger.apply(this,arguments))}});var m=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain"];r.each(m,function(e){d.prototype[e]=function(){var t=i.call(arguments);return t.unshift(this.models),r[e].apply(r,t)}});var y=["groupBy","countBy","sortBy"];r.each(y,function(e){d.prototype[e]=function(t,o){var n=r.isFunction(t)?t:function(e){return e.get(t)};return r[e](this.models,n,o)}});var _=e.View=function(e){this.cid=r.uniqueId("view"),e||(e={}),r.extend(this,r.pick(e,v)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},E=/^(\S+)\s*(.*)$/,v=["model","collection","el","id","attributes","className","tagName","events"];r.extend(_.prototype,s,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(t,o){return this.$el&&this.undelegateEvents(),this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0],o!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=r.result(this,"events")))return this;this.undelegateEvents();for(var t in e){var o=e[t];if(r.isFunction(o)||(o=this[e[t]]),o){var n=t.match(E),i=n[1],s=n[2];o=r.bind(o,this),i+=".delegateEvents"+this.cid,""===s?this.$el.on(i,o):this.$el.on(i,s,o)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(this.el)this.setElement(r.result(this,"el"),!1);else{var t=r.extend({},r.result(this,"attributes"));this.id&&(t.id=r.result(this,"id")),this.className&&(t["class"]=r.result(this,"className"));var o=e.$("<"+r.result(this,"tagName")+">").attr(t);this.setElement(o,!1)}}}),e.sync=function(t,o,n){var i=B[t];r.defaults(n||(n={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var s={type:i,dataType:"json"};if(n.url||(s.url=r.result(o,"url")||O()),null!=n.data||!o||"create"!==t&&"update"!==t&&"patch"!==t||(s.contentType="application/json",s.data=JSON.stringify(n.attrs||o.toJSON(n))),n.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),n.emulateHTTP&&("PUT"===i||"DELETE"===i||"PATCH"===i)){s.type="POST",n.emulateJSON&&(s.data._method=i);var l=n.beforeSend;n.beforeSend=function(e){return e.setRequestHeader("X-HTTP-Method-Override",i),l?l.apply(this,arguments):void 0}}"GET"===s.type||n.emulateJSON||(s.processData=!1),"PATCH"===s.type&&C&&(s.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var a=n.xhr=e.ajax(r.extend(s,n));return o.trigger("request",o,a,n),a};var C=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),B={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var k=e.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},b=/\((.*?)\)/g,A=/(\(\?)?:\w+/g,T=/\*\w+/g,S=/[\-{}\[\]+?.,\\\^$|#\s]/g;r.extend(k.prototype,s,{initialize:function(){},route:function(t,o,n){r.isRegExp(t)||(t=this._routeToRegExp(t)),r.isFunction(o)&&(n=o,o=""),n||(n=this[o]);var i=this;
36
+ return e.history.route(t,function(r){var s=i._extractParameters(t,r);n&&n.apply(i,s),i.trigger.apply(i,["route:"+o].concat(s)),i.trigger("route",o,s),e.history.trigger("route",i,o,s)}),this},navigate:function(t,o){return e.history.navigate(t,o),this},_bindRoutes:function(){if(this.routes){this.routes=r.result(this,"routes");for(var e,t=r.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e])}},_routeToRegExp:function(e){return e=e.replace(S,"\\$&").replace(b,"(?:$1)?").replace(A,function(e,t){return t?e:"([^/]+)"}).replace(T,"(.*?)"),new RegExp("^"+e+"$")},_extractParameters:function(e,t){var o=e.exec(t).slice(1);return r.map(o,function(e){return e?decodeURIComponent(e):null})}});var R=e.History=function(){this.handlers=[],r.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},I=/^[#\/]|\s+$/g,D=/^\/+|\/+$/g,w=/msie [\w.]+/,L=/\/$/,F=/[?#].*$/;R.started=!1,r.extend(R.prototype,s,{interval:50,getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(e,t){if(null==e)if(this._hasPushState||!this._wantsHashChange||t){e=this.location.pathname;var o=this.root.replace(L,"");e.indexOf(o)||(e=e.slice(o.length))}else e=this.getHash();return e.replace(I,"")},start:function(t){if(R.started)throw new Error("Backbone.history has already been started");R.started=!0,this.options=r.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var o=this.getFragment(),n=document.documentMode,i=w.exec(navigator.userAgent.toLowerCase())&&(!n||7>=n);this.root=("/"+this.root+"/").replace(D,"/"),i&&this._wantsHashChange&&(this.iframe=e.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(o)),this._hasPushState?e.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!i?e.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=o;var s=this.location,l=s.pathname.replace(/[^\/]$/,"$&/")===this.root;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!l)return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+this.location.search+"#"+this.fragment),!0;this._hasPushState&&l&&s.hash&&(this.fragment=this.getHash().replace(I,""),this.history.replaceState({},document.title,this.root+this.fragment+s.search))}return this.options.silent?void 0:this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),R.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(){var e=this.getFragment();return e===this.fragment&&this.iframe&&(e=this.getFragment(this.getHash(this.iframe))),e===this.fragment?!1:(this.iframe&&this.navigate(e),this.loadUrl(),void 0)},loadUrl:function(e){return e=this.fragment=this.getFragment(e),r.any(this.handlers,function(t){return t.route.test(e)?(t.callback(e),!0):void 0})},navigate:function(e,t){if(!R.started)return!1;t&&t!==!0||(t={trigger:!!t});var o=this.root+(e=this.getFragment(e||""));if(e=e.replace(F,""),this.fragment!==e){if(this.fragment=e,""===e&&"/"!==o&&(o=o.slice(0,-1)),this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,o);else{if(!this._wantsHashChange)return this.location.assign(o);this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,e,t.replace))}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,o){if(o){var n=e.href.replace(/(javascript:|#).*$/,"");e.replace(n+"#"+t)}else e.hash="#"+t}}),e.history=new R;var N=function(e,t){var o,n=this;o=e&&r.has(e,"constructor")?e.constructor:function(){return n.apply(this,arguments)},r.extend(o,n,t);var i=function(){this.constructor=o};return i.prototype=n.prototype,o.prototype=new i,e&&r.extend(o.prototype,e),o.__super__=n.prototype,o};u.extend=d.extend=k.extend=_.extend=R.extend=N;var O=function(){throw new Error('A "url" property or function must be specified')},M=function(e,t){var o=t.error;t.error=function(n){o&&o(e,n,t),e.trigger("error",e,n,t)}}}.call(this),function(){window.SmalrubyEditor={},window.changed=!1,window.textEditor=null,window.blockMode=!0,window.successMessage=function(e,t,o){var n;null==t&&(t=""),null==o&&(o="#messages"),n=$('<div class="alert alert-success" style="display: none">').append('<h4><i class="icon-star"></i>'+e+"</h4>").append(t),$(o).append(n),n.fadeIn("slow").delay(3e3).fadeOut("slow")},window.errorMessage=function(e,t){var o;null==t&&(t="#messages"),o=$('<div class="alert alert-error" style="display: none">').append('<button type="button" class="close" data-dismiss="alert">×</button>').append('<h4><i class="icon-exclamation-sign"></i>'+Smalruby.bm("COMMON_ERROR")+"</h4>").append(e),$(t).append(o),o.fadeIn("slow")},window.clearMessages=function(e){return null==e&&(e="#messages"),$(e).empty()},window.Smalruby={Models:{},Collections:{},Views:{},Routers:{},Features:[],username:null,initialize:function(){var e,t,o=this;return $.ajaxSetup({headers:{"X-CSRF-Token":$('meta[name="csrf-token"]').attr("content")}}),_.extend(_.templateSettings,{escape:/{{-([\s\S]+?)}}/,evaluate:/{{([\s\S]+?)}}/,interpolate:/{{=([\s\S]+?)}}/}),this.Collections.CharacterSet=new Smalruby.CharacterSet,this.Views.MainMenuView=new Smalruby.MainMenuView,this.Views.SigninModalView=new Smalruby.SigninModalView({el:$("#signin-modal")}),this.Views.CharacterSelectorView=new Smalruby.CharacterSelectorView({model:this.Collections.CharacterSet}),this.Views.CharacterModalView=new Smalruby.CharacterModalView({el:$("#character-modal")}),this.Views.LoadModalView=new Smalruby.LoadModalView({el:$("#load-modal")}),this.Views.ResetModalView=new Smalruby.ResetModalView({el:$("#reset-modal")}),Smalruby.downloading=!1,window.onbeforeunload=function(){return!Smalruby.downloading&&window.changed?Smalruby.bm("SMALRUBY_WILL_DISAPPER_YOUR_PROGRAM"):(Smalruby.downloading=!1,void 0)},Blockly.HSV_SATURATION=1,Blockly.HSV_VALUE=.8,Blockly.inject(document.getElementById("blockly-div"),{path:"/blockly/",toolbox:document.getElementById("toolbox"),trashcan:!0}),this.blocklyFirst=!0,this.blocklyLoading=!1,Blockly.addChangeListener(function(){return Smalruby.changedAfterTranslating=!0,o.blocklyFirst?(o.blocklyFirst=!1,void 0):o.blocklyLoading?(o.blocklyLoading=!1,void 0):window.changed=!0}),window.textEditor=t=ace.edit("text-editor"),t.setTheme("ace/theme/clouds"),t.setShowInvisibles(!0),t.gotoLine(0,0),t.setReadOnly(this.isEnabled("readonly_ruby_mode")),t.on("change",function(){return o.translating?void 0:(window.changed=!0,Smalruby.changedAfterTranslating=!0)}),e=t.getSession(),e.setMode("ace/mode/ruby"),e.setTabSize(2),e.setUseSoftTabs(!0),this.addCharacterFromBeginning()},loadXml:function(e,t){var o,n,i,r,s;for(null==t&&(t=Blockly.mainWorkspace),r=Blockly.Xml.textToDom(e),t.clear(),n=[],i=0;s=r.childNodes[i];)"character"===s.nodeName.toLowerCase()&&(o=new Smalruby.Character({name:s.getAttribute("name"),costumes:s.getAttribute("costumes").split(","),x:parseInt(s.getAttribute("x"),10),y:parseInt(s.getAttribute("y"),10),angle:parseInt(s.getAttribute("angle"),10),rotationStyle:s.getAttribute("rotation_style")||"free"}),n.push(o)),i++;return Smalruby.Collections.CharacterSet.reset(n),Blockly.Xml.domToWorkspace(t,r)},dumpXml:function(e,t){var o,n;return null==e&&(e=Blockly.mainWorkspace),null==t&&(t=Smalruby.Collections.CharacterSet),n=Blockly.Xml.workspaceToDom(e),o=n.firstChild,t.each(function(e){var t,i;return t=goog.dom.createDom("character"),t.setAttribute("x",e.get("x")),t.setAttribute("y",e.get("y")),t.setAttribute("name",e.get("name")),t.setAttribute("costumes",e.get("costumes").join(",")),t.setAttribute("angle",e.get("angle")),i=e.get("rotationStyle"),"free"!==i&&t.setAttribute("rotation_style",i),n.insertBefore(t,o)}),Blockly.Xml.domToPrettyText(n)},ignoreEnterKey:function(e){return e.find("input[type=text]").keypress(function(e){return e||(e=window.event),13===e.keyCode?!1:!0})},reset:function(){return this.blocklyLoading=!0,Blockly.mainWorkspace.clear(),this.Collections.CharacterSet.reset(),$("#filename").val(""),window.textEditor.getSession().getDocument().setValue(""),window.textEditor.moveCursorTo(0,0),this.addCharacterFromBeginning(),window.changed=!1},bm:function(e){var t;return t=Blockly.Msg[e],"string"==typeof t?t:e},addCharacterFromBeginning:function(){var e,t;return this.isEnabled("disabled_add_character_from_beginning")?void 0:(t="cat1.png",e=new Smalruby.Character({name:this.Collections.CharacterSet.uniqueName(t),costumes:[t],x:200,y:200}),this.Collections.CharacterSet.add(e),this.Views.CharacterSelectorView.prevBlock=null,this.Views.CharacterSelectorView.addBlock_(e),window.changed=!1)},isEnabled:function(e){return-1!==this.Features.indexOf(e)}},$(document).ready(function(){return Smalruby.initialize(),null===Smalruby.username&&Smalruby.isEnabled("must_signin")?Smalruby.Views.SigninModalView.render():void 0})}.call(this),function(){Smalruby.Character=Backbone.Model.extend({defaults:{name:null,costumes:[],costumeIndex:0,x:0,y:0,angle:0,rotationStyle:"free",visible:!0,using:!1},initialize:function(){return this.objects=[],0===this.get("costumes").length?this.set({costumes:[Smalruby.Character.PRESET_COSTUMES[0]]}):void 0},validate:function(e){var t,o;return t=[],o=e.name,(_.isUndefined(o)||_.isNull(o)||_.isString(o)&&0===o.length)&&t.push({attr:"name",message:"Name is required"}),_.isString(o)&&o.match(/^[0-9A-Z]|[!\"\#$%&\'()\-=^~\\|@`\[{;+:*\]},<.>/?]/)&&t.push({attr:"name",message:"Name is invalid"}),t.length>0?t:void 0},link:function(e){return this.objects.push(e),this.objects=_.uniq(this.objects),this.objects.length>0?this.set("using",!0):void 0},unlink:function(e){return this.objects=_.without(this.objects,e),0===this.objects.length?this.set("using",!1):void 0},namePrefix:function(){return Smalruby.Character.costumeToNamePrefix(this.get("name"))},costume:function(){return this.get("costumes")[this.get("costumeIndex")]},costumeUrl:function(e){var t;return null==e&&(e=this.get("costumeIndex")),t=this.get("costumes")[e],-1===_.indexOf(Smalruby.Character.PRESET_COSTUMES,t)?t:"/smalruby/assets/"+t},nextCostume:function(){var e;return e=this.get("costumeIndex")+1,e>=this.get("costumes").length&&(e=0),this.set({costumeIndex:e}),e},rotationStyleIconName:function(){switch(this.get("rotationStyle")){case"free":return"icon-repeat";case"left_right":return"icon-resize-horizontal";case"none":return"icon-arrow-right"}},rotateImage:function(e){var t,o;switch(t=this.get("angle"),this.get("rotationStyle")){case"free":o="rotate("+t+"deg) scaleX(1)";break;case"left_right":o=90>t||t>=270?"rotate(0deg) scaleX(1)":"rotate(0deg) scaleX(-1)";break;case"none":o="rotate(0deg) scaleX(1)"}return $(e).css({"-moz-transform":o,"-webkit-transform":o,transform:o})}},{PRESET_COSTUMES:["car1.png","car2.png","car3.png","car4.png","ball1.png","ball2.png","ball3.png","ball4.png","ball5.png","ball6.png","cat1.png","cat2.png","cat3.png","frog1.png","ryu1.png","ryu2.png","taichi1.png","taichi2.png"],costumeToNamePrefix:function(e){return e.substring(e.lastIndexOf("/")+1).replace(/\.[^.]*$/,"").replace(/[\d]*$/,"")}})}.call(this),function(){Smalruby.Scene=Backbone.Model.extend({defaults:{width:640,height:480,color:"black"}})}.call(this),Smalruby.SourceCode=Backbone.Model.extend({defaults:{filename:null,data:null},initialize:function(){if(!this.get("filename")){var e=Smalruby.Views.MainMenuView.getFilename();0==e.length&&(e=Smalruby.SourceCode.defaultFilename()),this.set("filename",e)}if(!this.get("data")){if(this.get("filename").match(/\.xml$/))var t=Smalruby.dumpXml();else if(window.blockMode)var t=Blockly.Ruby.workspaceToCode();else var t=window.textEditor.getSession().getDocument().getValue();this.set("data",t)}},getRbxmlFilename:function(){var e=this.get("filename");return e.match(/\.rb\.xml$/)?e:e.match(/\.rb$/)?e+".xml":e.match(/\.xml$/)?e.replace(/\.xml$/,".rb.xml"):e+".rb.xml"},run:function(){return this.post_("run")},check:function(){return this.post_("check")},save2:function(){return this.post_("")},write:function(e){null==e&&(e=!1);var t="write";return e&&(t+="?force=1"),this.delete_(t)},toBlocks:function(){return this.post_("to_blocks","html")},post_:function(e,t){return null==t&&(t="json"),dfr=$.Deferred(),$.ajax({url:"/source_codes/"+e,type:"POST",data:{source_code:{filename:this.get("filename"),data:this.get("data")}},dataType:t,success:function(e){return dfr.resolve(e)},error:dfr.reject}),dfr.promise()},delete_:function(e){return dfr=$.Deferred(),$.ajax({url:"/source_codes/"+e,type:"DELETE",dataType:"json",success:function(e){return dfr.resolve(e)},error:dfr.reject}),dfr.promise()}},{defaultFilename:function(e){return null==e&&(e=new Date),strftime("program_%y%m%d_%H%M%S.rb",e)}}),function(){Smalruby.CharacterSet=Backbone.Collection.extend({model:Smalruby.Character,uniqueName:function(e){var t,o,n;return null==e&&(e=Smalruby.Character.PRESET_COSTUMES[0]),o=e.substring(e.lastIndexOf("/")+1).replace(/\.[^.]*$/,"").replace(/[\d]*$/,""),t=0,n=new RegExp("^"+o+"(\\d+)$"),_.each(this.pluck("name"),function(e){return e.match(n)?t=_.max([t,parseInt(RegExp.$1)]):void 0}),""+o+(t+1)}})}.call(this),function(){Smalruby.CharacterModalView=Backbone.View.extend({model:new Smalruby.Character,events:{"click #character-modal-costume-selector a":"onSelectCostume","click #character_rotation_style_free":"onRotationStyleFree","click #character_rotation_style_left_right":"onRotationStyleLeftRight","click #character_rotation_style_none":"onRotationStyleNone","click #character-modal-ok-button":"onOk"},previewZoomLevel:.5,initialize:function(){var e,t,o,n=this;return this.target=null,$("#character-modal-costume-selector img").on("dragstart",function(e){return e.preventDefault()}),o=function(e){return n.model.set({x:parseInt(e.left/n.previewZoomLevel),y:parseInt(e.top/n.previewZoomLevel)})},$("#character-modal-character").draggable({containment:"#character-modal-preview",cursor:"move",drag:function(e,t){return o(t.position)}}),$("#character-modal-preview").droppable({drop:function(e,t){return o(t.draggable.position())}}),this.$el.find('input[name="character[name]"]').keypress(function(e){return e||(e=window.event),13===e.keyCode?!1:!0}),t=this,e=function(){return t.model.set({name:$(this).val()}),t.nameChanged=!0},this.$el.find('input[name="character[name]"]').change(e),this.$el.find('input[name="character[name]"]').keyup(e),this.$el.find('input[name="character[x]"]').change(function(){return t.model.set({x:$(this).val()})}),this.$el.find('input[name="character[y]"]').change(function(){return t.model.set({y:$(this).val()})}),this.$el.find('input[name="character[angle]"]').change(function(){return t.model.set({angle:$(this).val()})}),this.listenTo(this.model,"change:name",this.onChangeName),this.listenTo(this.model,"change:x",this.onChangeX),this.listenTo(this.model,"change:y",this.onChangeY),this.listenTo(this.model,"change:angle",this.onChangeAngle),this.listenTo(this.model,"change:costumes",this.onChangeCostumes),this.listenTo(this.model,"change:rotationStyle",this.onChangeRotationStyle),this.listenTo(this.model,"change",this.onChange),this.callAllOnChangeAttributes_()},render:function(){var e;return this.onChange(this.model),this.$el.modal({backdrop:"static"}),this.$el.modal("show"),e=function(){var t;return this.readImageSizeflag?(t=$("#character-modal-costume-selector .active img"),t.width()>0?($("#character-modal-character").css({width:""+t.width()/2+"px",height:""+t.height()/2+"px"}),this.readImageSizeflag=!1):setTimeout(_.bind(e,this),50)):void 0},this.readImageSizeflag?setTimeout(_.bind(e,this),1):void 0},callAllOnChangeAttributes_:function(){return this.onChangeName(this.model,this.model.get("name")),this.onChangeX(this.model,this.model.get("x")),this.onChangeY(this.model,this.model.get("y")),this.onChangeAngle(this.model,this.model.get("angle")),this.onChangeCostumes(this.model,this.model.get("costumes")),this.onChangeRotationStyle(this.model,this.model.get("rotationStyle"))},onChangeName:function(e,t){return this.$el.find('input[name="character[name]"]').val(t)},onChangeX:function(e,t){return this.$el.find('input[name="character[x]"]').val(t),$("#character_x_value").text(t),$("#character-modal-character").css("left",parseInt(t*this.previewZoomLevel))},onChangeY:function(e,t){return this.$el.find('input[name="character[y]"]').val(t),$("#character_y_value").text(t),$("#character-modal-character").css("top",parseInt(t*this.previewZoomLevel))},onChangeAngle:function(e,t){var o;return this.$el.find('input[name="character[angle]"]').val(t),$("#character_angle_value").text(""+t+"°"),o="rotate("+t+"deg)",$("#character_angle_vector").css({"-moz-transform":o,"-webkit-transform":o,transform:o}),this.model.rotateImage("#character-modal-character")},onChangeCostumes:function(e){var t,o;return t=$("<img>").attr({src:e.costumeUrl(),alt:e.costume()}),$("#character-modal-character img").replaceWith(t),this.$el.find("#character-modal-costume-selector a.thumbnail").removeClass("active"),o=this.$el.find('#character-modal-costume-selector img[alt="'+e.costume()+'"]'),o.parent().addClass("active"),o.width()>0?$("#character-modal-character").css({width:""+o.width()/2+"px",height:""+o.height()/2+"px"}):this.readImageSizeflag=!0},onChangeRotationStyle:function(e,t){return $("#character_rotation_style button.btn").removeClass("btn-primary"),$("#character_rotation_style_"+t).addClass("btn-primary"),this.onChangeAngle(this.model,this.model.get("angle"))},onChange:function(){var e;if(this.target)return this.$el.find('.control-group[for="character[name]"]').removeClass("error"),this.$el.find("#character-modal-ok-button").removeClass("disabled").removeAttr("disabled"),this.model.isValid()||(this.$el.find('.control-group[for="character[name]"]').addClass("error"),this.$el.find("#character-modal-ok-button").addClass("disabled").attr({disabled:"disabled"})),e=this.model.get("name"),this.target.get("name")!==e&&Smalruby.Collections.CharacterSet.findWhere({name:e})?(this.$el.find('.control-group[for="character[name]"]').addClass("error"),this.$el.find("#character-modal-ok-button").addClass("disabled").attr({disabled:"disabled"})):void 0},onSelectCostume:function(e){var t,o,n;return e.preventDefault(),o=$(e.target).attr("alt")||$(e.target).find("img").attr("alt"),t={costumes:[o]},this.nameChanged||(n=Smalruby.Character.costumeToNamePrefix(o),n!==this.model.namePrefix()&&(t.name=n===this.target.namePrefix()?this.target.get("name"):Smalruby.Collections.CharacterSet.uniqueName(o))),this.model.set(t)},onRotationStyleFree:function(){return this.model.set({rotationStyle:"free"})},onRotationStyleLeftRight:function(){return this.model.set({rotationStyle:"left_right"})},onRotationStyleNone:function(){return this.model.set({rotationStyle:"none"})},onOk:function(){return this.$el.modal("hide"),this.target?this.target.set(_.clone(this.model.attributes)):void 0},setCharacter:function(e){return this.target=e,this.model.set(_.clone(this.target.attributes)),this.nameChanged=!1,this}})}.call(this),function(){Smalruby.CharacterSelectorView=Backbone.View.extend({el:"#character-selector-tab",initialize:function(){var e,t,o,n;for(this.klass=Smalruby.CharacterSelectorView,n=["add","remove","reset","change"],t=0,o=n.length;o>t;t++)e=n[t],this.listenTo(this.model,e,this.onChange);return this.templateText=$("#character-selector-template").text(),$("#add-character-button").click(function(e){var t,o,n,i;return e.preventDefault(),n=Smalruby.Collections.CharacterSet,t=(i=_.last(n.models))?{name:n.uniqueName(i.costume()),costumes:_.clone(i.get("costumes"))}:{name:n.uniqueName()},o=new Smalruby.Character(t),n.add(o),Smalruby.Views.CharacterModalView.setCharacter(o).render()}),this.render()},render:function(){var e,t=this;return e=$("#character-selector-character-set"),e.children().remove(),this.model.each(function(o){var n,i,r;return n=$(_.template(t.templateText,o)),e.append(n),n.find("a.character").click(function(e){return e.preventDefault(),Smalruby.Views.CharacterModalView.setCharacter(o).render()}),n.find("a.add-block-button").click(function(e){return e.preventDefault(),t.addBlock_(o)}),r=n.find("a.remove-button"),r.click(function(e){return e.preventDefault(),t.removeCharacter_(o)}),(Smalruby.isEnabled("disabled_new_character")||o.get("using"))&&r.hide(),i=n.find("img"),o.rotateImage(i),i.on("dragstart",function(e){return e.preventDefault()})})},onChange:function(){return Smalruby.blocklyLoading||(Smalruby.changedAfterTranslating=!0,window.changed=!0),this.render()},addBlock_:function(e){var t,o;return t=Blockly.Block.obtain(Blockly.mainWorkspace,"character_new"),t.setCharacter(e),t.initSvg(),t.render(),this.moveByNewBlock_(t),t.select(),o=Blockly.Block.obtain(Blockly.mainWorkspace,"events_on_start"),o.initSvg(),o.render(),t.getInput("DO").connection.connect(o.previousConnection)},moveByNewBlock_:function(e){var t,o,n,i,r,s,l;return o=Blockly.mainWorkspace.getMetrics(),i={x:o.viewLeft+this.klass.NEW_BLOCK_MARGIN.LEFT,y:o.viewTop+this.klass.NEW_BLOCK_MARGIN.TOP},this.prevBlock&&(s=this.prevBlock.getRelativeToSurfaceXY(),t=this.prevBlock.getHeightWidth(),n=e.getHeightWidth(),s.x===this.prevXY.x&&s.y===this.prevXY.y?(r=s.x,l=s.y+t.height+this.klass.NEW_BLOCK_MARGIN.TOP,l+n.height>o.viewTop+o.viewHeight&&(r+=t.width+this.klass.NEW_BLOCK_MARGIN.LEFT,l=i.y)):(r=this.prevXY.x,l=this.prevXY.y),r>=o.viewLeft&&r+n.width<=o.viewLeft+o.viewWidth&&l>=o.viewTop&&l+n.height<=o.viewTop+o.viewHeight&&(i.x=r,i.y=l)),e.moveBy(i.x,i.y),this.prevBlock=e,this.prevXY=e.getRelativeToSurfaceXY()},removeCharacter_:function(e){return Smalruby.isEnabled("disabled_new_character")||e.get("using")?void 0:Smalruby.Collections.CharacterSet.remove(e)}},{NEW_BLOCK_MARGIN:{LEFT:20,TOP:20}})}.call(this),function(){Smalruby.LoadModalView=Backbone.View.extend({events:{"click #load-modal-ok-button":"onOk","click #load-modal-remix-button":"onRemix"},initialize:function(){var e=this;return this.$el.find("#load-modal-find-from-computer").click(function(t){return t.preventDefault(),e.onFindFromComputerClick.call(e,t)})},render:function(){var e,t,o,n,i=this;return this.type=null,this.program=null,this.setRemix(!1),this.unselect(),o=this.$el.find("#load-modal-local-programs"),o.empty(),t=this.$el.find("#load-modal-demo-programs"),t.empty(),this.$el.find(".modal-body").block({message:null}),n=function(){return i.$el.find(".modal-body").unblock(),null},this.$el.modal({backdrop:"static"}),this.$el.modal("show"),e=$.Deferred(),$.ajax({url:"/source_codes/",type:"GET",dataType:"json",success:function(t){return e.resolve(t)},error:e.reject}),e.promise().then(function(e){var n,r,s,l,a,c,g,u,h;for(g=e.localPrograms,r=function(e){var t;return t=i.programToHtml(e,i.onLocalProgramClick),o.append(t)},s=0,a=g.length;a>s;s++)n=g[s],r(n);for(u=e.demoPrograms,h=[],l=0,c=u.length;c>l;l++)n=u[l],h.push(function(e){var o;return o=i.programToHtml(e,i.onDemoProgramClick),t.append(o)}(n));return h}).then(n,n).fail(function(){return i.$el.modal("hide"),errorMessage(Smalruby.bm("VIEWS_LOAD_MODAL_VIEW_ERROR"))})},onOk:function(){switch(this.type){case"local":$.ajax({url:"/source_codes/load_local",type:"POST",data:{source_code:{filename:this.program.filename,remix:this.remix}},dataType:"json",success:function(e){return Smalruby.Views.MainMenuView.load(e.source_code)}});break;case"demo":$.ajax({url:"/source_codes/load_demo",type:"POST",data:{source_code:{filename:this.program.filename,remix:this.remix}},dataType:"json",success:function(e){return Smalruby.Views.MainMenuView.load(e.source_code)}});break;case"find-from-computer":$('input#load-file[name="source_code[file]"]').click()}return this.$el.modal("hide")},onRemix:function(){return this.setRemix(!this.remix)},setRemix:function(e){var t,o;return this.remix=e,o=$("#load-modal-remix-button"),t="btn-success",this.remix?o.addClass(t):o.removeClass(t)},onLocalProgramClick:function(e,t){return this.select(e.currentTarget,"local",t)},onDemoProgramClick:function(e,t){return this.select(e.currentTarget,"demo",t)},onFindFromComputerClick:function(e){return this.select(e.currentTarget,"find-from-computer")},select:function(e,t,o){return null==o&&(o=null),this.unselect(),$(e).addClass("active"),this.type=t,this.program=o},unselect:function(){return this.$el.find("a.thumbnail").removeClass("active")},programToHtml:function(e,t){var o,n,i=this;return n=e.imageUrl?'<img src="'+e.imageUrl+'">':'<h1 class="icon"><i class="icon-file" /></h1>',o='<li>\n <a class="thumbnail">\n '+n+"\n <blockquote>\n <p>\n "+e.title+"\n </p>\n <small>"+e.filename+"</small>\n </blockquote>\n </div>\n</li>",o=$(o),o.find("a.thumbnail").click(function(o){return o.preventDefault(),t.call(i,o,e)}),o}})}.call(this),function(){Smalruby.MainMenuView=Backbone.View.extend({el:"#main-menu",events:{"click #block-mode-button":"onBlockMode","click #ruby-mode-button":"onRubyMode","click #run-button":"onRun","click #download-button":"onDownload","click #load-local-button":"onLoadLocal","click #load-button":"onLoad","click #save-button":"onSave","click #check-button":"onCheck","click #reset-button":"onReset","click #signin-button":"onSignin","click #signout-button":"onSignout","click #username-button":"onUsername"},initialize:function(){var e=this;return $("#filename").keypress(function(e){return e||(e=window.event),13===e.keyCode?($("#save-button").click(),!1):!0}),$("#file-form").fileupload({dataType:"json",done:function(t,o){return e.load(o.result.source_code)}})},onBlockMode:function(e){var t;return e.preventDefault(),window.blockMode?void 0:Smalruby.changedAfterTranslating?(this.blockUI({title:'<i class="icon-filter"></i>\n'+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_BLOCKUI_TITLE"),message:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_BLOCKUI_MESSAGE")}),t=new Smalruby.SourceCode,t.toBlocks().then(function(e){return window.blockMode=!0,$('#tabs a[href="#block-tab"]').tab("show"),e.length>0?(Smalruby.blocklyLoading=!0,Smalruby.translating=!0,Smalruby.loadXml(e),Smalruby.translating=!1,Smalruby.changedAfterTranslating=!1):void 0}).then(this.unblockUI,this.unblockUI).fail(function(){return window.errorMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_ERROR"))})):(window.blockMode=!0,$('#tabs a[href="#block-tab"]').tab("show"),void 0)},onRubyMode:function(e){var t;return e.preventDefault(),window.blockMode&&(window.blockMode=!1,$('#tabs a[href="#ruby-tab"]').tab("show"),Smalruby.changedAfterTranslating)?(t=Blockly.Ruby.workspaceToCode(),Smalruby.translating=!0,window.textEditor.getSession().getDocument().setValue(t),Smalruby.translating=!1,Smalruby.changedAfterTranslating=!1,window.textEditor.moveCursorTo(0,0),window.textEditor.focus()):void 0},onRun:function(e){var t,o,n,i=this;return e.preventDefault(),o=this.getSourceCode(),n=new Smalruby.SourceCode({filename:o.getRbxmlFilename()}),clearMessages(),this.blockUI({title:'<i class="icon-play"></i>\n'+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_TITLE"),message:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_MESSAGE"),notice:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_NOTICE")}),t=Smalruby.bm("VIEWS_MAIN_MENU_VIEW_RUN_ERROR_CANT_RUN"),o.save2().then(function(){return o.write()}).then(function(e){return i.confirmOverwrite_.call(i,e,o,function(){return t=Smalruby.bm("VIEWS_MAIN_MENU_VIEW_RUN_ERROR_CANCEL_TO_RUN")})}).then(function(){return Smalruby.savedFilename=o.get("filename"),window.changed=!1,o.check()}).then(function(e){var t,o,n,i;if(e.length>0){for(o=function(e){var t;return t=""+e.row+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_LINES"),e.column>0&&(t+=""+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_COMMA")+e.column+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_LETTERS")),window.errorMessage(t+(": "+e.message))},n=0,i=e.length;i>n;n++)t=e[n],o(t);return $.Deferred().reject().promise()}}).then(function(){return n.save2()}).then(function(){return n.write(!0)}).then(function(){return o.run()}).then(function(e){var t,o,n,i;if(e.length>0){for(o=function(e){var t;return t=""+e.row+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_LINES"),e.column>0&&(t+=""+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_COMMA")+e.column+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_LETTERS")),errorMessage(t+(": "+e.message))},n=0,i=e.length;i>n;n++)t=e[n],o(t);return $.Deferred().reject().promise()}}).then(this.unblockUI,this.unblockUI).fail(function(){return errorMessage(t)})},onDownload:function(e){var t;return e.preventDefault(),t=this.getSourceCode(),clearMessages(),this.blockUI({title:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_DOWNLOAD_BLOCKUI_TITLE"),message:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_DOWNLOAD_BLOCKUI_MESSAGE")}),t.save2().then(function(){return window.changed=!1,window.successMessage(goog.getMsg(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_DOWNLOAD_SUCCEEDED"),{filename:t.get("filename")})),Smalruby.downloading=!0,$("#download-link").click()}).then(this.unblockUI,this.unblockUI).fail(function(){return window.errorMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_DOWNLOAD_ERROR"))})},onLoadLocal:function(e){return e.preventDefault(),!window.changed||confirm(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_LOAD_CONFIRM"))?Smalruby.Views.LoadModalView.render():void 0},onLoad:function(e){return e.preventDefault(),!window.changed||confirm(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_LOAD_CONFIRM"))?$('input#load-file[name="source_code[file]"]').click():void 0},onSave:function(e){var t,o,n,i=this;return e.preventDefault(),o=$.trim($("#filename").val()),o.length<=0?(window.errorMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_ERROR_NO_NAME")),$("#filename").focus(),void 0):(n=this.getSourceCode(),window.blockMode&&(n=new Smalruby.SourceCode({filename:n.getRbxmlFilename()})),clearMessages(),this.blockUI({title:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_TITLE"),message:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_MESSAGE"),notice:goog.getMsg(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_NOTICE"),{filename:n.get("filename")})}),t=Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_ERROR_MESSAGE"),n.save2().then(function(){return n.write()}).then(function(e){return i.confirmOverwrite_.call(i,e,n,function(){return t=Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_CANCELED")})}).then(this.unblockUI,this.unblockUI).done(function(){return Smalruby.savedFilename=n.get("filename"),window.changed=!1,window.successMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SAVE_SUCCEEDED"))}).fail(function(){return window.errorMessage(t)}))},onCheck:function(e){var t;return e.preventDefault(),clearMessages(),t=this.getSourceCode(),this.blockUI({title:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_TITLE"),message:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_MESSAGE"),notice:Smalruby.bm("VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_NOTICE")}),t.check().then(function(e){var t,o,n,i;if(0===e.length)return window.successMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_CHECK_SUCCEEDED"),Smalruby.bm("VIEWS_MAIN_MENU_VIEW_CHECK_SUCCEEDED_NOTICE"));for(i=[],o=0,n=e.length;n>o;o++)t=e[o],i.push(function(e){var t;return t=""+e.row+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_LINES"),e.column>0&&(t+=""+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_COMMA")+e.column+Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_LETTERS")),window.errorMessage(t+(": "+e.message))}(t));return i}).then(this.unblockUI,this.unblockUI).fail(function(){return errorMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_CHECK_ERROR"))})},onReset:function(e){return e.preventDefault(),window.changed?Smalruby.Views.ResetModalView.render():Smalruby.reset(),!0},onSignin:function(e){return e.preventDefault(),Smalruby.Views.SigninModalView.render()},onSignout:function(e){return e.preventDefault(),$.ajax({url:"/signout",type:"DELETE"}).then(function(){return Smalruby.username=null,$("#signin-button").show(),$("#signout-button").hide(),$("#username-label").text(""),$("#username-button").hide(),successMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SIGNOUT_SUCCEEDED")),Smalruby.isEnabled("must_signin")?Smalruby.Views.SigninModalView.render():void 0},function(){return errorMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_SIGNOUT_ERROR"))})},onUsername:function(e){return e.preventDefault()},getFilename:function(){return $.trim($("#filename").val())},getSourceCode:function(){var e;return e=new Smalruby.SourceCode,$("#filename").val(e.get("filename")),e},blockUI:function(e){var t,o;return t="",e.title&&(t+="<h3>\n "+e.title+"\n</h3>"),(e.message||e.notice)&&(o="",e.message&&(o+="<p>\n "+e.message+"\n</p>"),e.notice&&(o+="<small>\n "+e.notice+"\n</small>"),t+="<blockquote>\n "+o+"\n</blockquote>"),$.blockUI({message:t,css:{border:"none","text-align":"left","padding-left":"2em"}})
37
37
  },unblockUI:function(){return $.unblockUI()},confirmOverwrite_:function(e,t,o){return null==o&&(o=$.noop),e.source_code.error?t.get("filename")===Smalruby.savedFilename||confirm(goog.getMsg(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_COMMON_CONFIRM_OVERWRITE"),{filename:t.get("filename")}))?t.write(!0):(o.call(),$.Deferred().reject().promise()):void 0},load:function(e){var t;return e.error?window.errorMessage(goog.getMsg(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_LOAD_ERROR"),{filename:e.filename,error:e.error})):(clearMessages(),t=e.filename,t.match(/\.xml$/)?(window.blockMode||(window.blockMode=!0,$('#tabs a[href="#block-tab"]').tab("show")),t=t.replace(/(\.rb)?\.xml$/,".rb"),Smalruby.blocklyLoading=!0,Smalruby.loadXml(e.data),e.data=Blockly.Ruby.workspaceToCode()):(Smalruby.Collections.CharacterSet.reset(),Blockly.mainWorkspace.clear(),window.blockMode&&(window.blockMode=!1,$('#tabs a[href="#ruby-tab"]').tab("show"),window.textEditor.focus())),$("#filename").val(t),window.textEditor.getSession().getDocument().setValue(e.data),window.textEditor.moveCursorTo(0,0),window.changed=!1,Smalruby.changedAfterTranslating=!0,window.successMessage(Smalruby.bm("VIEWS_MAIN_MENU_VIEW_LOAD_SUCCEEDED")))}})}.call(this),function(){Smalruby.ResetModalView=Backbone.View.extend({events:{"click #reset-modal-ok-button":"onOk"},render:function(){return this.$el.modal({backdrop:"static"}),this.$el.modal("show")},onOk:function(){return Smalruby.reset(),this.$el.modal("hide")}})}.call(this),function(){Smalruby.SigninModalView=Backbone.View.extend({events:{"click #signin-modal-ok-button":"onOk"},initialize:function(){var e=this;return Smalruby.ignoreEnterKey(this.$el),this.$el.on("shown",function(){return e.$el.find("#signin-modal-username").focus()})},render:function(){return this.$el.find("#signin-modal-username").val($("#username-label").text()),this.$el.modal({backdrop:"static"}),this.$el.modal("show")},onOk:function(){var e,t=this;return e=this.$el.find("input[name=username]").val(),$.trim(e).length>0?$.post("/sessions/",{username:e}).then(function(e){return Smalruby.username=e,$("#signin-button").hide(),$("#signout-button").show(),$("#username-label").text(e),$("#username-button").show(),successMessage(Smalruby.bm("VIEWS_SIGNIN_MODAL_VIEW_SIGNED_IN")),(new $.Deferred).resolve().promise()},function(){return errorMessage(Smalruby.bm("VIEWS_SIGNIN_MODAL_VIEW_ERROR")),(new $.Deferred).resolve().promise()}).done(function(){return null===Smalruby.username&&Smalruby.isEnabled("must_signin")?void 0:t.$el.modal("hide")}):void 0}})}.call(this),function(){Blockly.Ruby=new Blockly.Generator("Ruby"),Blockly.Ruby.addReservedWords("BEGIN class ensure nil self whenEND def false not super whilealias defined? for or then yieldand do if redo true __LINE__begin else in rescue undef __FILE__break elsif module retry unless __ENCODING__case end next return until".split(/\s+/)),Blockly.Ruby.ORDER_ATOMIC=0,Blockly.Ruby.ORDER_COLLECTION=1,Blockly.Ruby.ORDER_STRING_CONVERSION=1,Blockly.Ruby.ORDER_MEMBER=2,Blockly.Ruby.ORDER_INDEX=3,Blockly.Ruby.ORDER_FUNCTION_CALL=4,Blockly.Ruby.ORDER_UNARY_SIGN=5,Blockly.Ruby.ORDER_EXPONENTIATION=6,Blockly.Ruby.ORDER_UNARY_MINUS_SIGN=7,Blockly.Ruby.ORDER_MULTIPLICATIVE=8,Blockly.Ruby.ORDER_ADDITIVE=9,Blockly.Ruby.ORDER_BITWISE_SHIFT=10,Blockly.Ruby.ORDER_BITWISE_AND=11,Blockly.Ruby.ORDER_BITWISE_XOR=12,Blockly.Ruby.ORDER_BITWISE_OR=12,Blockly.Ruby.ORDER_RELATIONAL=13,Blockly.Ruby.ORDER_EQUALS=14,Blockly.Ruby.ORDER_LOGICAL_AND=15,Blockly.Ruby.ORDER_LOGICAL_OR=16,Blockly.Ruby.ORDER_RANGE=17,Blockly.Ruby.ORDER_CONDITIONAL=18,Blockly.Ruby.ORDER_ASSIGNMENT=19,Blockly.Ruby.ORDER_NOT=20,Blockly.Ruby.ORDER_AND_OR=21,Blockly.Ruby.ORDER_NONE=99,Blockly.Ruby.INFINITE_LOOP_TRAP=null,Blockly.Ruby.init=function(){return this.definitions_=Object.create(null),Blockly.Variables&&(this.variableDB_?this.variableDB_.reset():this.variableDB_=new Blockly.Names(Blockly.Ruby.RESERVED_WORDS_),this.definitions_.require_smalruby='require "smalruby"',this.definitions_.receiver_stack=["main"],this.definitions_.character_stack=[],Smalruby.isEnabled("auto_init_hardware"))?this.definitions_.init_hardware="init_hardware":void 0},Blockly.Ruby.defineCharacter=function(e){var t,o,n;if(o=e.get("name"),t="character_"+o,!Blockly.Ruby.definitions_[t]){switch(e.get("rotationStyle")){case"left_right":n=", rotation_style: :left_right";break;case"none":n=", rotation_style: :none";break;default:n=""}return Blockly.Ruby.definitions_[t]=""+o+" = Character.new(costume: "+Blockly.Ruby.quote_(e.costume())+", x: "+e.get("x")+", y: "+e.get("y")+", angle: "+e.get("angle")+n+")"}},Blockly.Ruby.characterStack=function(){return this.definitions_.character_stack},Blockly.Ruby.character=function(){return _.last(this.characterStack())},Blockly.Ruby.receiverStack=function(){return this.definitions_.receiver_stack},Blockly.Ruby.receiver=function(){return _.last(this.receiverStack())},Blockly.Ruby.receiverName=function(e){var t,o;return null==e&&(e={}),t={object:Blockly.Ruby.character(),dropSelf:!0},_.extend(t,e),o=this.receiver(),o===t.object?t.dropSelf?"":"self.":""+t.object.get("name")+"."},Blockly.Ruby.cs=Blockly.Ruby.characterStack,Blockly.Ruby.cs_=Blockly.Ruby.characterStack,Blockly.Ruby.c=Blockly.Ruby.character,Blockly.Ruby.c_=Blockly.Ruby.character,Blockly.Ruby.rs=Blockly.Ruby.receiverStack,Blockly.Ruby.rs_=Blockly.Ruby.receiverStack,Blockly.Ruby.r=Blockly.Ruby.receiver,Blockly.Ruby.r_=Blockly.Ruby.receiver,Blockly.Ruby.rn=Blockly.Ruby.receiverName,Blockly.Ruby.rn_=Blockly.Ruby.receiverName,Blockly.Ruby.characterMethodCall_=function(e,t,o){var n;return null==o&&(o={}),n=this.characterMethodCallInput_(e,t,o),n[0]?""+n[0]+"\n":""},Blockly.Ruby.characterMethodCallInput_=function(e,t,o){var n;return null==o&&(o={}),n=this.c_()?t&&t.length>0?""+this.rn_(o)+e+"("+t+")":""+this.rn_(o)+e:null,[n,this.ORDER_FUNCTION_CALL]},Blockly.Ruby.characterSetVariable_=function(e,t,o){return null==o&&(o="="),this.c_()?""+this.rn_({dropSelf:!1})+e+" "+o+" "+t+"\n":""},Blockly.Ruby.characterEvent_=function(e,t,o,n){var i,r;if(null==n&&(n=null),r=this.c_()){this.rs_().push(r);try{i=Blockly.Ruby.statementToCode(e,t)||"\n"}finally{this.rs_().pop()}return n=n?", "+n:"","\n"+this.rn_()+"on(:"+o+n+") do\n"+i+"end\n"}return""},Blockly.Ruby.finish=function(e){var t,o,n,i,r;i=[],o=[],r=function(e){var t;return t=Blockly.Ruby.definitions_[e],_.isString(t)?t.match(/^require\s*('\S+'|"\S+")/)?i.push(t):o.push(t):void 0};for(n in Blockly.Ruby.definitions_)r(n);return 0===o.length&&0===e.length?"":(t=i.join("\n")+"\n\n",o.length>0&&(t+=o.join("\n").replace(/\n\n+/g,"\n\n").replace(/\n*$/,"\n")),t+e)},Blockly.Ruby.scrubNakedValue=function(e){return e+"\n"},Blockly.Ruby.escapeChars_={'"':'\\"'},Blockly.Ruby.quote_=function(e){var t,o,n,i,r,s;for(o=String(e),n=['"'],i=function(e){var t;return t=o.charAt(e),n[e+1]=Blockly.Ruby.escapeChars_[t]||t},t=r=0,s=o.length;s>=0?s>r:r>s;t=s>=0?++r:--r)i(t);return n.push('"'),n.join("")},Blockly.Ruby.scrub_=function(e,t){var o,n,i,r,s,l,a,c,g,u=this;if(null===t)return"";if(n="",!e.outputConnection||!e.outputConnection.targetConnection)for(o=e.getCommentText(),o&&(n+=this.prefixLines(o,"# ")+"\n"),g=e.inputList,l=function(e){var t;return e.type===Blockly.INPUT_VALUE&&(t=e.connection.targetBlock(),t&&(o=u.allNestedComments(t)))?n+=u.prefixLines(o,"# "):void 0},a=0,c=g.length;c>a;a++)i=g[a],l(i);return r=e.nextConnection&&e.nextConnection.targetBlock(),s=this.blockToCode(r),n+t+s}}.call(this),function(){"use strict";goog.provide("Smalruby.FieldCharacter"),goog.require("Blockly.FieldDropdown"),Smalruby.FieldCharacter=function(e,t){var o,n,i=this;return o=t?function(e){var o,n;return n=Smalruby.FieldCharacter.dropdownChange.call(i,e),n?o=n:n=i.getValue(),t.call(i,o),n}:Smalruby.FieldCharacter.dropdownChange,Smalruby.FieldCharacter.superClass_.constructor.call(this,Smalruby.FieldCharacter.dropdownCreate,o),n=Smalruby.Collections.CharacterSet,n.on("add",this.onCharacterSetAdd_,this),n.on("remove",this.onCharacterSetRemove_,this),n.on("reset",this.onCharacterSetReset_,this),this.character=Smalruby.FieldCharacter.NullCharacter,e||(e=Smalruby.Collections.CharacterSet.first()),this.setCharacter(e)},goog.inherits(Smalruby.FieldCharacter,Blockly.FieldDropdown),Smalruby.FieldCharacter.prototype.setCharacter=function(e){return e!==this.character?(this.character.unlink(this),this.character.off("change:name",this.onCharacterChangeName_,this),this.character=e?e:Smalruby.FieldCharacter.NullCharacter,this.character.link(this),this.character.on("change:name",this.onCharacterChangeName_,this),this.setValue(this.character.get("name"))):void 0},Smalruby.FieldCharacter.prototype.onCharacterSetAdd_=function(e){return this.character===Smalruby.FieldCharacter.NullCharacter?this.setCharacter(e):void 0},Smalruby.FieldCharacter.prototype.onCharacterSetRemove_=function(e){return e===this.character?this.setCharacter():void 0},Smalruby.FieldCharacter.prototype.onCharacterSetReset_=function(e){return this.character===Smalruby.FieldCharacter.NullCharacter?this.setCharacter(e.first()):this.setCharacter(e.findWhere({name:this.getValue()}))},Smalruby.FieldCharacter.prototype.onCharacterChangeName_=function(e,t){return this.setValue(t)},Smalruby.FieldCharacter.prototype.clone=function(){return new Smalruby.FieldCharacter(this.character,this.changeHandler_)},Smalruby.FieldCharacter.prototype.dispose=function(){var e;return e=Smalruby.Collections.CharacterSet,e.off("add",this.onCharacterSetAdd_,this),e.off("remove",this.onCharacterSetRemove_,this),e.off("reset",this.onCharacterSetReset_,this),this.setCharacter(),Blockly.FieldDropdown.prototype.dispose.call(this)},Smalruby.FieldCharacter.prototype.setText=function(e){var t;return this.character||(this.character=Smalruby.FieldCharacter.NullCharacter,t=Smalruby.Collections.CharacterSet,this.setCharacter(t.findWhere({name:e}))),Blockly.FieldDropdown.prototype.setText.call(this,e)},Smalruby.FieldCharacter.dropdownCreate=function(){var e;return e=Smalruby.Collections.CharacterSet,e.length>0?Smalruby.Collections.CharacterSet.map(function(e){var t;return t=e.get("name"),[t,t]}):[[Smalruby.FieldCharacter.NullCharacter.get("name"),""]]},Smalruby.FieldCharacter.dropdownChange=function(e){var t;return t=Smalruby.Collections.CharacterSet.findWhere({name:e}),t?(this.setCharacter(t),e):null},Smalruby.FieldCharacter.NullCharacter={get:function(){return Smalruby.bm("BLOCKS_FIELD_CHARACTER_NO_CHARACTER")},on:function(){return $.noop},off:function(){return $.noop},link:function(){return $.noop},unlink:function(){return $.noop}},Blockly.Block.prototype.getCharacterFieldValue=function(e){var t,o;return null==e&&(e="CHAR"),o=this.getFieldValue(e),Blockly.Ruby.c()&&(t=Smalruby.Collections.CharacterSet.findWhere({name:o}),Blockly.Ruby.defineCharacter(t)),o}}.call(this),function(){Blockly.Ruby.math_number=function(){var e,t;return e=parseFloat(this.getFieldValue("NUM")),t=0>e?Blockly.Ruby.ORDER_UNARY_MINUS_SIGN:Blockly.Ruby.ORDER_ATOMIC,[e,t]},Blockly.Ruby.text=function(){var e;return e=Blockly.Ruby.quote_(this.getFieldValue("TEXT")),[e,Blockly.Ruby.ORDER_ATOMIC]},Blockly.Ruby.variables_get=function(e){var t;return t=Blockly.Ruby.variableDB_.getName(e.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE),[t,Blockly.Ruby.ORDER_ATOMIC]},Blockly.Ruby.variables_set=function(e){var t,o;return o=Blockly.Ruby.valueToCode(e,"VALUE",Blockly.Ruby.ORDER_NONE)||"0",t=Blockly.Ruby.variableDB_.getName(e.getFieldValue("VAR"),Blockly.Variables.NAME_TYPE),t+" = "+o+"\n"}}.call(this),function(){Blockly.Blocks.character_new={init:function(){var e,t,o,n;return this.setHelpUrl(""),this.setColour(198),n=2*Blockly.BlockSvg.FIELD_HEIGHT,e=new Blockly.FieldImage(null,n,n),t=new Blockly.FieldLabel(""),t.EDITABLE=!0,t.setText=_.bind(this.nameFieldSetText_,this),o=t.init,t.init=function(){return o.apply(this,arguments),this.getSvgRoot().setAttribute("y",n/4)},this.appendDummyInput().appendField(e,"COSTUME").appendField(t,"NAME"),this.appendStatementInput("DO"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")},dispose:function(){var e;return this.character.off("change",this.changeHandler),"function"==typeof(e=this.character).unlink&&e.unlink(this),this.constructor.prototype.dispose.apply(this,arguments)},nameFieldSetText_:function(e){var t,o;return o=Smalruby.Collections.CharacterSet,t=o.findWhere({name:e}),t?this.setCharacter(t):this.fieldLableSetText_(this.getField_("NAME"),e)},fieldLableSetText_:function(e,t){return Blockly.FieldLabel.prototype.setText.call(e,t)},setCharacter:function(e){var t=this;return this.changeHandler&&this.character.off("change",this.changeHandler),this.character=e,this.setFieldValue(e.costumeUrl(),"COSTUME"),this.fieldLableSetText_(this.getField_("NAME"),e.get("name")),e.link(this),this.changeHandler=function(o){return t.setFieldValue(o.costumeUrl(),"COSTUME"),t.fieldLableSetText_(t.getField_("NAME"),e.get("name"))},e.on("change",this.changeHandler),this}},Blockly.Ruby.character_new=function(e){var t,o,n;t=e.character,Blockly.Ruby.defineCharacter(t),Blockly.Ruby.cs_().push(t);try{n=e.getInputTargetBlock("DO"),o=Blockly.Ruby.blockToCode(n)||"\n"}finally{Blockly.Ruby.cs_().pop()}return o}}.call(this),function(){Blockly.Blocks.control_sleep={init:function(){return this.setHelpUrl(""),this.setColour(43),this.interpolateMsg(Smalruby.bm("BLOCKS_CONTROL_SLEEP"),["SEC",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.control_sleep=function(){var e;return e=Blockly.Ruby.valueToCode(this,"SEC",Blockly.Ruby.ORDER_FUNCTION_CALL)||"0","sleep("+e+")\n"},Blockly.Blocks.control_loop={init:function(){return this.setHelpUrl(""),this.setColour(43),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_CONTROL_LOOP")),this.appendStatementInput("DO"),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_CONTROL_LOOP_END")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.control_loop=function(e){var t;return"main"===Blockly.Ruby.r_()?"":(t=Blockly.Ruby.statementToCode(e,"DO")||"\n","loop do\n"+t+"end\n")},Blockly.Blocks.control_break={init:function(){return this.setHelpUrl(""),this.setColour(43),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_CONTROL_BREAK")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.control_break=function(){return"main"===Blockly.Ruby.receiver()?"":"break\n"},Blockly.Blocks.control_next={init:function(){return this.setHelpUrl(""),this.setColour(43),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_CONTROL_NEXT")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.control_next=function(){return"main"===Blockly.Ruby.receiver()?"":"next\n"},Blockly.Blocks.control_redo={init:function(){return this.setHelpUrl(""),this.setColour(43),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_CONTROL_REDO")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.control_redo=function(){return"main"===Blockly.Ruby.receiver()?"":"redo\n"},Blockly.Blocks.control_if={init:function(){return this.setHelpUrl(""),this.setColour(43),this.appendValueInput("COND").setCheck("Boolean").appendField(Smalruby.bm("BLOCKS_CONTROL_IF")),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_CONTROL_THEN")),this.appendStatementInput("THEN"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("")}},Blockly.Ruby.control_if=function(e){var t,o;return o=Blockly.Ruby.valueToCode(e,"COND",Blockly.Ruby.ORDER_CONDITIONAL)||"false",t=Blockly.Ruby.statementToCode(e,"THEN")||"\n","if "+o+"\n"+t+"end\n"},Blockly.Blocks.control_if_else={init:function(){return this.setHelpUrl(""),this.setColour(43),this.appendValueInput("COND").setCheck("Boolean").appendField(Smalruby.bm("BLOCKS_CONTROL_IF")),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_CONTROL_THEN")),this.appendStatementInput("THEN"),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_CONTROL_ELSE")),this.appendStatementInput("ELSE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip("")}},Blockly.Ruby.control_if_else=function(e){var t,o,n;return n=Blockly.Ruby.valueToCode(e,"COND",Blockly.Ruby.ORDER_CONDITIONAL)||"false",t=Blockly.Ruby.statementToCode(e,"THEN")||"\n",o=Blockly.Ruby.statementToCode(e,"ELSE")||"\n","if "+n+"\n"+t+"else\n"+o+"end\n"},Blockly.Blocks.control_times={init:function(){return this.setHelpUrl(""),this.setColour(43),this.interpolateMsg(Smalruby.bm("BLOCKS_CONTROL_TIMES"),["COUNT",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.appendStatementInput("DO"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.control_times=function(e){var t,o;return o=Blockly.Ruby.valueToCode(this,"COUNT",Blockly.Ruby.ORDER_NONE)||0,t=Blockly.Ruby.statementToCode(e,"DO")||"\n",""+o+".times do\n"+t+"end\n"},Blockly.Blocks.control_await_until={init:function(){return this.setHelpUrl(""),this.setColour(43),this.interpolateMsg(Smalruby.bm("BLOCKS_CONTROL_AWAIT_UNTIL"),["COND",["Boolean"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.control_await_until=function(){var e,t;return"main"===Blockly.Ruby.receiver()?"":(e=Blockly.Ruby.characterMethodCallInput_("await")[0],t=Blockly.Ruby.valueToCode(this,"COND",Blockly.Ruby.ORDER_CONDITIONAL)||"true",""+e+" until "+t+"\n")},Blockly.Blocks.control_until={init:function(){return this.setHelpUrl(""),this.setColour(43),this.interpolateMsg(Smalruby.bm("BLOCKS_CONTROL_UNTIL"),["COND",["Boolean"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.appendStatementInput("DO"),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_CONTROL_LOOP_END")).setAlign(Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.control_until=function(e){var t,o;return o=Blockly.Ruby.valueToCode(this,"COND",Blockly.Ruby.ORDER_CONDITIONAL)||"true",t=Blockly.Ruby.statementToCode(e,"DO")||"\n","until "+o+"\n"+t+"end\n"},Blockly.Blocks.control_await={init:function(){return this.setHelpUrl(""),this.setColour(43),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_CONTROL_AWAIT")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.control_await=function(){return"main"===Blockly.Ruby.receiver()?"":Blockly.Ruby.characterMethodCall_("await")}}.call(this),function(){}.call(this),function(){}.call(this),function(){Blockly.Blocks.events_on_start={init:function(){return this.setHelpUrl(""),this.setColour(33),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_EVENTS_ON_START")),this.appendStatementInput("DO"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.events_on_start=function(e){return Blockly.Ruby.characterEvent_(e,"DO","start")},Blockly.Blocks.events_on_key_push_or_down={init:function(){var e,t;return e=window.SmalrubyEditor.Sensing.KeyDropdown,t=window.SmalrubyEditor.Sensing.PushOrDownDropdown,this.setHelpUrl(""),this.setColour(33),this.interpolateMsg(Smalruby.bm("BLOCKS_EVENTS_ON_KEY_PUSH_OR_DOWN"),["KEY",new Blockly.FieldDropdown(e)],["POD",new Blockly.FieldDropdown(t)],Blockly.ALIGN_RIGHT),this.appendStatementInput("DO"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.events_on_key_push_or_down=function(e){var t,o;return t=this.getFieldValue("KEY"),o=this.getFieldValue("POD"),Blockly.Ruby.characterEvent_(e,"DO","key_"+o,t)},Blockly.Blocks.events_on_click={init:function(){return this.setHelpUrl(""),this.setColour(33),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_EVENTS_ON_CLICK")),this.appendStatementInput("DO"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.events_on_click=function(e){return Blockly.Ruby.characterEvent_(e,"DO","click")},Blockly.Blocks.events_on_hit={init:function(){return this.setHelpUrl(""),this.setColour(33),this.interpolateMsg(Smalruby.bm("BLOCKS_EVENTS_ON_HIT"),["CHAR",new Smalruby.FieldCharacter],Blockly.ALIGN_RIGHT),this.appendStatementInput("DO"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.events_on_hit=function(e){var t;return t=this.getCharacterFieldValue(),Blockly.Ruby.characterEvent_(e,"DO","hit",t)}}.call(this),function(){var e,t,o,n,i,r,s,l;n=null,r=null,s=null,o=null,e=null,i=null,l=null,t=null,$(document).ready(function(){var a;return window.SmalrubyEditor.Hardware={Type:"Arduino",DioPins:[2,3,4,5,6,7,8,9,10,11,12,13],PwmPins:[3,5,6,9,10,11],AiPins:[0,1,2,3,4,5]},n=function(){var e,t,o,n;for(o=window.SmalrubyEditor.Hardware.DioPins,n=[],e=0,t=o.length;t>e;e++)a=o[e],n.push(["D"+a,"D"+a]);return n}(),r=function(){var e,t,o,n;for(o=window.SmalrubyEditor.Hardware.PwmPins,n=[],e=0,t=o.length;t>e;e++)a=o[e],n.push(["D"+a,"D"+a]);return n}(),s=function(){var e,t,o,n;for(o=[3,9],n=[],e=0,t=o.length;t>e;e++)a=o[e],n.push(["D"+a,"D"+a]);return n}(),o=function(){var e,t,o,n;for(o=window.SmalrubyEditor.Hardware.AiPins,n=[],e=0,t=o.length;t>e;e++)a=o[e],n.push(["A"+a,"A"+a]);return n}(),e=[[Smalruby.bm("BLOCKS_HARDWARE_ANODE"),"anode"],[Smalruby.bm("BLOCKS_HARDWARE_CATHODE"),"cathode"]],i=[[Smalruby.bm("BLOCKS_HARDWARE_LEFT"),"left"],[Smalruby.bm("BLOCKS_HARDWARE_RIGHT"),"right"]],l=function(){var e,t,o,n;for(o=[5,6],n=[],e=0,t=o.length;t>e;e++)a=o[e],n.push(["D"+a,"D"+a]);return n}(),t=[[Smalruby.bm("COMMON_FORWARD"),"forward"],[Smalruby.bm("COMMON_BACKWARD"),"backward"],[Smalruby.bm("COMMON_TURN_LEFT"),"turn_left"],[Smalruby.bm("COMMON_TURN_RIGHT"),"turn_right"],[Smalruby.bm("COMMON_STOP"),"stop"]]}),Blockly.Blocks.hardware_init_hardware={init:function(){return this.setHelpUrl(""),this.setColour(340),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_HARDWARE_INIT_HARDWARE")),this.setTooltip("")}},Blockly.Ruby.hardware_init_hardware=function(){return Blockly.Ruby.definitions_.init_hardware="init_hardware",""},Blockly.Blocks.hardware_led_turn_on={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_LED_TURN_ON"),["PIN",new Blockly.FieldDropdown(n)],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(""),this.setFieldValue("D2","PIN")}},Blockly.Ruby.hardware_led_turn_on=function(){var e;return e=this.getFieldValue("PIN"),Blockly.Ruby.characterMethodCall_("led("+Blockly.Ruby.quote_(e)+").turn_on")},Blockly.Blocks.hardware_led_turn_off={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_LED_TURN_OFF"),["PIN",new Blockly.FieldDropdown(n)],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(""),this.setFieldValue("D2","PIN")}},Blockly.Ruby.hardware_led_turn_off=function(){var e;return e=this.getFieldValue("PIN"),Blockly.Ruby.characterMethodCall_("led("+Blockly.Ruby.quote_(e)+").turn_off")},Blockly.Blocks.hardware_rgb_led_set_color={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_RGB_LED_SET_COLOR"),["AC",new Blockly.FieldDropdown(e)],["PIN",new Blockly.FieldDropdown(s)],["COLOUR",new Blockly.FieldColour("#ff0000")],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_rgb_led_set_color=function(e){var t,o,n,i,r,s;return t=this.getFieldValue("AC"),r=this.getFieldValue("PIN"),n=e.getFieldValue("COLOUR"),s=parseInt(n.slice(1,3),16),i=parseInt(n.slice(3,5),16),o=parseInt(n.slice(5,7),16),Blockly.Ruby.characterSetVariable_("rgb_led_"+t+"("+Blockly.Ruby.quote_(r)+").color","["+s+", "+i+", "+o+"]")},Blockly.Blocks.hardware_rgb_led_turn_off={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_RGB_LED_TURN_OFF"),["AC",new Blockly.FieldDropdown(e)],["PIN",new Blockly.FieldDropdown(s)],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_rgb_led_turn_off=function(){var e,t;return e=this.getFieldValue("AC"),t=this.getFieldValue("PIN"),Blockly.Ruby.characterMethodCall_("rgb_led_"+e+"("+Blockly.Ruby.quote_(t)+").turn_off")},Blockly.Blocks.hardware_seven_segment_display_show={init:function(){var e,t;return e=function(){var e,o;for(o=[],t=e=0;9>=e;t=++e)o.push([String(t),String(t)]);return o}(),this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SEVEN_SEGMENT_DISPLAY_SHOW"),["NUM",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_seven_segment_display_show=function(){var e;return e=parseInt(this.getFieldValue("NUM")),Blockly.Ruby.characterMethodCall_("seven_segment_display.show("+e+")")},Blockly.Blocks.hardware_seven_segment_display_off={init:function(){return this.setHelpUrl(""),this.setColour(270),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_HARDWARE_SEVEN_SEGMENT_DISPLAY_OFF")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_seven_segment_display_off=function(){return Blockly.Ruby.characterMethodCall_("seven_segment_display.off")},Blockly.Blocks.hardware_lcd_puts={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_LCD_PUTS"),["TEXT",["String"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_lcd_puts=function(){var e;return e=Blockly.Ruby.valueToCode(this,"TEXT",Blockly.Ruby.ORDER_NONE)||"",Blockly.Ruby.characterMethodCall_("lcd.puts("+e+")")},Blockly.Blocks.hardware_lcd_clear={init:function(){return this.setHelpUrl(""),this.setColour(270),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_HARDWARE_LCD_CLEAR")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_lcd_clear=function(){return Blockly.Ruby.characterMethodCall_("lcd.clear")},Blockly.Blocks.hardware_servo_set_position={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SERVO_SET_POSITION"),["PIN",new Blockly.FieldDropdown(r)],["POS",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_servo_set_position=function(){var e,t;return e=this.getFieldValue("PIN"),t=Blockly.Ruby.valueToCode(this,"POS",Blockly.Ruby.ORDER_FUNCTION_CALL)||"5",Blockly.Ruby.characterMethodCall_("servo("+Blockly.Ruby.quote_(e)+").position = "+t)},Blockly.Blocks.hardware_two_wheel_drive_car_forward={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_FORWARD"),["PIN",new Blockly.FieldDropdown(l)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_two_wheel_drive_car_forward=function(){var e;return e=this.getFieldValue("PIN"),Blockly.Ruby.characterMethodCall_("two_wheel_drive_car("+Blockly.Ruby.quote_(e)+").forward")},Blockly.Blocks.hardware_two_wheel_drive_car_backward={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_BACKWARD"),["PIN",new Blockly.FieldDropdown(l)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_two_wheel_drive_car_backward=function(){var e;return e=this.getFieldValue("PIN"),Blockly.Ruby.characterMethodCall_("two_wheel_drive_car("+Blockly.Ruby.quote_(e)+").backward")},Blockly.Blocks.hardware_two_wheel_drive_car_turn_left={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_TURN_LEFT"),["PIN",new Blockly.FieldDropdown(l)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_two_wheel_drive_car_turn_left=function(){var e;return e=this.getFieldValue("PIN"),Blockly.Ruby.characterMethodCall_("two_wheel_drive_car("+Blockly.Ruby.quote_(e)+").turn_left")},Blockly.Blocks.hardware_two_wheel_drive_car_turn_right={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_TURN_RIGHT"),["PIN",new Blockly.FieldDropdown(l)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_two_wheel_drive_car_turn_right=function(){var e;return e=this.getFieldValue("PIN"),Blockly.Ruby.characterMethodCall_("two_wheel_drive_car("+Blockly.Ruby.quote_(e)+").turn_right")},Blockly.Blocks.hardware_two_wheel_drive_car_stop={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_STOP"),["PIN",new Blockly.FieldDropdown(l)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_two_wheel_drive_car_stop=function(){var e;return e=this.getFieldValue("PIN"),Blockly.Ruby.characterMethodCall_("two_wheel_drive_car("+Blockly.Ruby.quote_(e)+").stop")},Blockly.Blocks.hardware_two_wheel_drive_car_run={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_RUN"),["COMMAND",["String"],Blockly.ALIGN_RIGHT],["PIN",new Blockly.FieldDropdown(l)],["SEC",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_two_wheel_drive_car_run=function(){var e,t,o;return t=this.getFieldValue("PIN"),o=Blockly.Ruby.valueToCode(this,"SEC",Blockly.Ruby.ORDER_NONE)||0,e=Blockly.Ruby.valueToCode(this,"COMMAND",Blockly.Ruby.ORDER_NONE)||Blockly.Ruby.quote_("stop"),Blockly.Ruby.characterMethodCall_("two_wheel_drive_car("+Blockly.Ruby.quote_(t)+").run(command: "+e+", sec: "+o+")")},Blockly.Blocks.hardware_two_wheel_drive_car_commands={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS"),["COMMAND",new Blockly.FieldDropdown(t)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"String"),this.setTooltip("")}},Blockly.Ruby.hardware_two_wheel_drive_car_commands=function(){var e;return e=Blockly.Ruby.quote_(this.getFieldValue("COMMAND")),[e,Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.hardware_two_wheel_drive_car_set_speed={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_SET_SPEED"),["PIN",new Blockly.FieldDropdown(r)],["LOR",new Blockly.FieldDropdown(i)],["SPEED",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_two_wheel_drive_car_set_speed=function(){var e,t,o;return t=this.getFieldValue("PIN"),e=this.getFieldValue("LOR"),o=Blockly.Ruby.valueToCode(this,"SPEED",Blockly.Ruby.ORDER_NONE)||"100",Blockly.Ruby.characterMethodCall_("two_wheel_drive_car("+Blockly.Ruby.quote_(t)+")."+e+"_speed = "+o)},Blockly.Blocks.hardware_two_wheel_drive_car_speed={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_SPEED"),["PIN",new Blockly.FieldDropdown(r)],["LOR",new Blockly.FieldDropdown(i)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.hardware_two_wheel_drive_car_speed=function(){var e,t;return t=this.getFieldValue("PIN"),e=this.getFieldValue("LOR"),Blockly.Ruby.characterMethodCallInput_("two_wheel_drive_car("+Blockly.Ruby.quote_(t)+")."+e+"_speed")},Blockly.Blocks.hardware_motor_driver={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_HARDWARE_MOTOR_DRIVER_FORWARD"),"forward"],[Smalruby.bm("BLOCKS_HARDWARE_MOTOR_DRIVER_BACKWARD"),"backward"],[Smalruby.bm("BLOCKS_HARDWARE_MOTOR_DRIVER_STOP"),"stop"]],this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_MOTOR_DRIVER"),["PIN",new Blockly.FieldDropdown(r)],["METHOD",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")
38
- }},Blockly.Ruby.hardware_motor_driver=function(){var e,t;return t=this.getFieldValue("PIN"),e=this.getFieldValue("METHOD"),Blockly.Ruby.characterMethodCall_("motor_driver("+Blockly.Ruby.quote_(t)+")."+e)},Blockly.Blocks.hardware_motor_driver_set_speed={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_MOTOR_DRIVER_SET_SPEED"),["PIN",new Blockly.FieldDropdown(r)],["SPEED",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_motor_driver_set_speed=function(){var e,t;return e=this.getFieldValue("PIN"),t=Blockly.Ruby.valueToCode(this,"SPEED",Blockly.Ruby.ORDER_NONE)||"100",Blockly.Ruby.characterMethodCall_("motor_driver("+Blockly.Ruby.quote_(e)+").speed = "+t)},Blockly.Blocks.hardware_motor_driver_speed={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_MOTOR_DRIVER_SPEED"),["PIN",new Blockly.FieldDropdown(r)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.hardware_motor_driver_speed=function(){var e;return e=this.getFieldValue("PIN"),Blockly.Ruby.characterMethodCallInput_("motor_driver("+Blockly.Ruby.quote_(e)+").speed")},Blockly.Blocks.hardware_button_pressed_or_released={init:function(){var e;return e=window.SmalrubyEditor.Sensing.PressedOrReleasedDropdown,this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_BUTTON_PRESSED_OR_RELEASED"),["PIN",new Blockly.FieldDropdown(n)],["POR",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.hardware_button_pressed_or_released=function(){var e,t;return e=this.getFieldValue("PIN"),t=this.getFieldValue("POR"),Blockly.Ruby.characterMethodCallInput_("button("+Blockly.Ruby.quote_(e)+")."+t+"?")},Blockly.Blocks.hardware_sensor_value={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SENSOR_VALUE"),["PIN",new Blockly.FieldDropdown(o)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.hardware_sensor_value=function(){var e;return e=this.getFieldValue("PIN"),Blockly.Ruby.characterMethodCallInput_("sensor("+Blockly.Ruby.quote_(e)+").value")},Blockly.Blocks.hardware_smalrubot_v3_led_turn_on_or_off={init:function(){var e,t;return e=[[Smalruby.bm("COLOUR_RED"),"red"],[Smalruby.bm("COLOUR_GREEN"),"green"]],t=[[Smalruby.bm("COMMON_TURN_ON"),"turn_on"],[Smalruby.bm("COMMON_TURN_OFF"),"turn_off"]],this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_LED_TURN_ON_OR_OFF"),["COLOUR",new Blockly.FieldDropdown(e)],["OOO",new Blockly.FieldDropdown(t)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_led_turn_on_or_off=function(){var e,t;return e=this.getFieldValue("COLOUR"),t=this.getFieldValue("OOO"),Blockly.Ruby.characterMethodCall_("smalrubot_v3."+e+"_led."+t)},Blockly.Blocks.hardware_smalrubot_v3_motor_speed={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_MOTOR_SPEED"),["LOR",new Blockly.FieldDropdown(i)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_motor_speed=function(){var e;return e=this.getFieldValue("LOR"),Blockly.Ruby.characterMethodCallInput_("smalrubot_v3."+e+"_motor.speed")},Blockly.Blocks.hardware_smalrubot_v3_motor_set_speed={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_MOTOR_SET_SPEED"),["LOR",new Blockly.FieldDropdown(i)],["SPEED",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_motor_set_speed=function(){var e,t;return e=this.getFieldValue("LOR"),t=Blockly.Ruby.valueToCode(this,"SPEED",Blockly.Ruby.ORDER_NONE)||"100",Blockly.Ruby.characterSetVariable_("smalrubot_v3."+e+"_motor.speed",t)},Blockly.Blocks.hardware_smalrubot_v3_action={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_ACTION"),["ACTION",new Blockly.FieldDropdown(t)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_action=function(){var e;return e=this.getFieldValue("ACTION"),Blockly.Ruby.characterMethodCall_("smalrubot_v3."+e)},Blockly.Blocks.hardware_smalrubot_v3_action_with_sec={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_ACTION_WITH_SEC"),["ACTION",new Blockly.FieldDropdown(t)],["SEC",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_action_with_sec=function(){var e,t;return e=this.getFieldValue("ACTION"),t=Blockly.Ruby.valueToCode(this,"SEC",Blockly.Ruby.ORDER_FUNCTION_CALL)||"nil",Blockly.Ruby.characterMethodCall_("smalrubot_v3."+e+"(sec: "+t+")")},Blockly.Blocks.hardware_smalrubot_v3_touch_sensor_pressed_or_released={init:function(){var e;return e=window.SmalrubyEditor.Sensing.PressedOrReleasedDropdown,this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_TOUCH_SENSOR_PRESSED_OR_RELEASED"),["LOR",new Blockly.FieldDropdown(i)],["POR",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_touch_sensor_pressed_or_released=function(){var e,t;return e=this.getFieldValue("LOR"),t=this.getFieldValue("POR"),Blockly.Ruby.characterMethodCallInput_("smalrubot_v3."+e+"_touch_sensor."+t+"?")},Blockly.Blocks.hardware_smalrubot_v3_light_sensor_value={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_LIGHT_SENSOR_VALUE")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_light_sensor_value=function(){return Blockly.Ruby.characterMethodCallInput_("smalrubot_v3.light_sensor.value")},Blockly.Blocks.hardware_smalrubot_s1_led_turn_on_or_off={init:function(){var e,t;return e=[[Smalruby.bm("COLOUR_BLUE"),"blue"],[Smalruby.bm("COLOUR_WHITE"),"white"]],t=[[Smalruby.bm("COMMON_TURN_ON"),"turn_on"],[Smalruby.bm("COMMON_TURN_OFF"),"turn_off"]],this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_S1_LED_TURN_ON_OR_OFF"),["COLOUR",new Blockly.FieldDropdown(e)],["OOO",new Blockly.FieldDropdown(t)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_s1_led_turn_on_or_off=function(){var e,t;return e=this.getFieldValue("COLOUR"),t=this.getFieldValue("OOO"),Blockly.Ruby.characterMethodCall_("smalrubot_s1."+t+"_"+e+"_led")},Blockly.Blocks.hardware_smalrubot_s1_action={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_S1_ACTION"),["ACTION",new Blockly.FieldDropdown(t)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_s1_action=function(){var e;return e=this.getFieldValue("ACTION"),Blockly.Ruby.characterMethodCall_("smalrubot_s1."+e)},Blockly.Blocks.hardware_smalrubot_s1_action_with_sec={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_S1_ACTION_WITH_SEC"),["ACTION",new Blockly.FieldDropdown(t)],["SEC",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_s1_action_with_sec=function(){var e,t;return e=this.getFieldValue("ACTION"),t=Blockly.Ruby.valueToCode(this,"SEC",Blockly.Ruby.ORDER_FUNCTION_CALL)||"nil",Blockly.Ruby.characterMethodCall_("smalrubot_s1."+e+"(sec: "+t+")")},Blockly.Blocks.hardware_smalrubot_s1_ir_photoreflector_value={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_S1_IR_PHOTOREFLECTOR_VALUE"),["LOR",new Blockly.FieldDropdown(i)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_s1_ir_photoreflector_value=function(){var e;return e=this.getFieldValue("LOR"),Blockly.Ruby.characterMethodCallInput_("smalrubot_s1."+e+"_ir_photoreflector_value")},Blockly.Blocks.hardware_smalrubot_s1_dc_motor_power_ratio={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_S1_DC_MOTOR_POWER_RATIO"),["LOR",new Blockly.FieldDropdown(i)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_s1_dc_motor_power_ratio=function(){var e;return e=this.getFieldValue("LOR"),Blockly.Ruby.characterMethodCallInput_("smalrubot_s1."+e+"_dc_motor_power_ratio")},Blockly.Blocks.hardware_smalrubot_s1_dc_motor_set_power_ratio={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_S1_DC_MOTOR_SET_POWER_RATIO"),["LOR",new Blockly.FieldDropdown(i)],["SPEED",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_s1_dc_motor_set_power_ratio=function(){var e,t;return e=this.getFieldValue("LOR"),t=Blockly.Ruby.valueToCode(this,"SPEED",Blockly.Ruby.ORDER_NONE)||"100",Blockly.Ruby.characterSetVariable_("smalrubot_s1."+e+"_dc_motor_power_ratio",t)}}.call(this),function(){Blockly.Blocks.looks_say_second={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_LOOKS_SAY_WITH_SECOND"),["TEXT",null,Blockly.ALIGN_RIGHT],["SEC",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_say_second=function(){var e,t;return e=Blockly.Ruby.valueToCode(this,"SEC",Blockly.Ruby.ORDER_NONE)||"0",t=Blockly.Ruby.valueToCode(this,"TEXT",Blockly.Ruby.ORDER_NONE)||Blockly.Ruby.quote_(""),Blockly.Ruby.characterMethodCall_("say","message: "+t+", second: "+e)},Blockly.Blocks.looks_say={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_LOOKS_SAY"),["TEXT",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_say=function(){var e;return e=Blockly.Ruby.valueToCode(this,"TEXT",Blockly.Ruby.ORDER_NONE)||Blockly.Ruby.quote_(""),Blockly.Ruby.characterMethodCall_("say","message: "+e)},Blockly.Blocks.looks_think_second={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_LOOKS_THINK_WITH_SECOND"),["TEXT",null,Blockly.ALIGN_RIGHT],["SEC",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_think_second=function(){var e,t;return e=Blockly.Ruby.valueToCode(this,"SEC",Blockly.Ruby.ORDER_NONE)||"0",t=Blockly.Ruby.valueToCode(this,"TEXT",Blockly.Ruby.ORDER_NONE)||Blockly.Ruby.quote_(""),Blockly.Ruby.characterMethodCall_("think","message: "+t+", second: "+e)},Blockly.Blocks.looks_think={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_LOOKS_THINK"),["TEXT",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_think=function(){var e;return e=Blockly.Ruby.valueToCode(this,"TEXT",Blockly.Ruby.ORDER_NONE)||Blockly.Ruby.quote_(""),Blockly.Ruby.characterMethodCall_("think","message: "+e)},Blockly.Blocks.looks_show={init:function(){return this.setHelpUrl(""),this.setColour(270),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_LOOKS_SHOW")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_show=function(){return Blockly.Ruby.characterSetVariable_("visible","true")},Blockly.Blocks.looks_hide={init:function(){return this.setHelpUrl(""),this.setColour(270),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_LOOKS_HIDE")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_hide=function(){return Blockly.Ruby.characterSetVariable_("visible","false")},Blockly.Blocks.looks_vanish={init:function(){return this.setHelpUrl(""),this.setColour(270),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_LOOKS_VANISH")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_vanish=function(){return Blockly.Ruby.characterMethodCall_("vanish")},Blockly.Blocks.looks_change_scale_by={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg("大きさを%1%ずつ変える",["SCALE",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_change_scale_by=function(){var e;return e=Blockly.Ruby.valueToCode(this,"SCALE",Blockly.Ruby.ORDER_NONE)||"0",e=parseInt(e)/100,"self.scale += "+e+"\n"},Blockly.Blocks.looks_set_scale={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg("大きさを%1%にする",["SCALE",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_set_scale=function(){var e;return e=Blockly.Ruby.valueToCode(this,"SCALE",Blockly.Ruby.ORDER_NONE)||"0",e=parseInt(e)/100,"self.scale = "+e+"\n"},Blockly.Blocks.looks_self_scale={init:function(){return this.setHelpUrl(""),this.setColour(270),this.appendDummyInput().appendField("大きさ"),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.looks_self_scale=function(){return["scale",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.looks_preset_images={init:function(){var e;return e=[["車1","car1.png"],["車2","car2.png"],["車3","car3.png"],["車4","car4.png"],["ボール1","ball1.png"],["ボール2","ball2.png"],["ボール3","ball3.png"],["ボール4","ball4.png"],["ボール5","ball5.png"],["ボール6","ball6.png"],["猫1","cat1.png"],["猫2","cat2.png"],["猫3","cat3.png"],["かえる1","frog1.png"],["コウガ リュウ1","ryu1.png"],["コウガ リュウ2","ryu2.png"],["イタチのタイチ","taichi1.png"],["イタチのタイチ","taichi2.png"]],this.setHelpUrl(""),this.setColour(270),this.appendDummyInput().appendField(new Blockly.FieldDropdown(e),"NAME"),this.setOutput(!0,"String"),this.setTooltip("")}},Blockly.Ruby.looks_preset_images=function(){var e;return e=Blockly.Ruby.quote_(this.getFieldValue("NAME")),[e,Blockly.Ruby.ORDER_ATOMIC]}}.call(this),function(){Blockly.Blocks.motion_move={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_MOVE"),["STEP",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_move=function(){var e;return e=Blockly.Ruby.valueToCode(this,"STEP",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterMethodCall_("move",""+e)},Blockly.Blocks.motion_rotate_right={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_TURN_RIGHT_DEGREES"),["ANGLE",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_rotate_right=function(){var e;return e=Blockly.Ruby.valueToCode(this,"ANGLE",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterMethodCall_("rotate",""+e)},Blockly.Blocks.motion_rotate_left={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_TURN_LEFT_DEGREES"),["ANGLE",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_rotate_left=function(){var e;return e=Blockly.Ruby.valueToCode(this,"ANGLE",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterMethodCall_("rotate","-"+e)},Blockly.Blocks.motion_set_angle={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_POINT_IN_DIRECTION"),["ANGLE",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_set_angle=function(){var e;return e=Blockly.Ruby.valueToCode(this,"ANGLE",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterSetVariable_("angle",e)},Blockly.Blocks.motion_point_towards_mouse={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_POINT_TOWARDS_MOUSE")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_point_towards_mouse=function(){return""+Blockly.Ruby.rn()+"point_towards(:mouse)\n"},Blockly.Blocks.motion_point_towards_character={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_POINT_TOWARDS_CHARACTER"),["CHAR",new Smalruby.FieldCharacter],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_point_towards_character=function(){var e;return e=this.getCharacterFieldValue(),Blockly.Ruby.characterMethodCall_("point_towards",e)},Blockly.Blocks.motion_set_x_y={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_SET_X_Y"),["X",["Number"],Blockly.ALIGN_RIGHT],["Y",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_set_x_y=function(){var e,t;return e=Blockly.Ruby.valueToCode(this,"X",Blockly.Ruby.ORDER_NONE)||"0",t=Blockly.Ruby.valueToCode(this,"Y",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterSetVariable_("position","["+e+", "+t+"]")},Blockly.Blocks.motion_go_to_mouse={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_GO_TO_MOUSE")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_go_to_mouse=function(){return Blockly.Ruby.characterMethodCall_("go_to(:mouse)")},Blockly.Blocks.motion_go_to_character={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_GO_TO_CHARACTER"),["CHAR",new Smalruby.FieldCharacter],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_go_to_character=function(){var e;return e=this.getCharacterFieldValue(),Blockly.Ruby.characterMethodCall_("go_to("+e+")")},Blockly.Blocks.motion_glide_to_x_y={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg("%1秒でx座標を%2、y座標を%3に変える",["SEC",["Number"],Blockly.ALIGN_RIGHT],["X",["Number"],Blockly.ALIGN_RIGHT],["Y",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_glide_to_x_y=function(){var e,t,o;return e=Blockly.Ruby.valueToCode(this,"SEC",Blockly.Ruby.ORDER_NONE)||"0",t=Blockly.Ruby.valueToCode(this,"X",Blockly.Ruby.ORDER_NONE)||"0",o=Blockly.Ruby.valueToCode(this,"Y",Blockly.Ruby.ORDER_NONE)||"0",""+Blockly.Ruby.rn()+"glide_to(second: "+e+", x: "+t+", y: "+o+")\n"},Blockly.Blocks.motion_change_x_by={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_CHANGE_X_BY"),["X",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_change_x_by=function(){var e;return e=Blockly.Ruby.valueToCode(this,"X",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterSetVariable_("x",e,"+=")},Blockly.Blocks.motion_set_x={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_SET_X"),["X",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_set_x=function(){var e;return e=Blockly.Ruby.valueToCode(this,"X",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterSetVariable_("x",e,"=")},Blockly.Blocks.motion_change_y_by={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_CHANGE_Y_BY"),["Y",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_change_y_by=function(){var e;return e=Blockly.Ruby.valueToCode(this,"Y",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterSetVariable_("y",e,"+=")},Blockly.Blocks.motion_set_y={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_SET_Y"),["Y",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_set_y=function(){var e;return e=Blockly.Ruby.valueToCode(this,"Y",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterSetVariable_("y",e,"=")},Blockly.Blocks.motion_turn_if_reach_wall={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_TURN_IF_REACH_WALL")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_turn_if_reach_wall=function(){return Blockly.Ruby.characterMethodCall_("turn_if_reach_wall")},Blockly.Blocks.motion_turn={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_TURN")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_turn=function(){return Blockly.Ruby.characterMethodCall_("turn")},Blockly.Blocks.motion_turn_xy={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_MOTION_TURN_XY_X"),"x"],[Smalruby.bm("BLOCKS_MOTION_TURN_XY_Y"),"y"]],this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_TURN_XY"),["XY",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_turn_xy=function(){var e;return e=this.getFieldValue("XY"),Blockly.Ruby.characterMethodCall_("turn_"+e)},Blockly.Blocks.motion_set_rotation_style={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_MOTION_SET_ROTATION_STYLE_LEFT_RIGHT"),"left_right"],[Smalruby.bm("BLOCKS_MOTION_SET_ROTATION_STYLE_NONE"),"none"],[Smalruby.bm("BLOCKS_MOTION_SET_ROTATION_STYLE_FREE"),"free"]],this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_SET_ROTATION_STYLE"),["STYLE",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_set_rotation_style=function(){var e;return e=this.getFieldValue("STYLE"),Blockly.Ruby.characterSetVariable_("rotation_style",":"+e)},Blockly.Blocks.motion_self_x={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_SELF_X")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.motion_self_x=function(){return Blockly.Ruby.characterMethodCallInput_("x")},Blockly.Blocks.motion_self_y={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_SELF_Y")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.motion_self_y=function(){return Blockly.Ruby.characterMethodCallInput_("y")},Blockly.Blocks.motion_self_angle={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_SELF_ANGLE")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.motion_self_angle=function(){return Blockly.Ruby.characterMethodCallInput_("angle")}}.call(this),function(){Blockly.Blocks.operators_add={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_ADD"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.operators_add=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_ADDITIVE,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" + "+o,n]},Blockly.Blocks.operators_minus={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_MINUS"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.operators_minus=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_ADDITIVE,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" - "+o,n]},Blockly.Blocks.operators_multiply={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_MULTIPLY"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.operators_multiply=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_MULTIPLICATIVE,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" * "+o,n]},Blockly.Blocks.operators_divide={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_DIVIDE"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.operators_divide=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_MULTIPLICATIVE,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"1",[t+" / "+o,n]},Blockly.Blocks.operators_compare_lt={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_COMPARE_LT"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_compare_lt=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_RELATIONAL,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" < "+o,n]},Blockly.Blocks.operators_compare_lte={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_COMPARE_LTE"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_compare_lte=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_RELATIONAL,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" <= "+o,n]},Blockly.Blocks.operators_compare_eq={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_COMPARE_EQ"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_compare_eq=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_EQUALS,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" == "+o,n]},Blockly.Blocks.operators_compare_gte={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_COMPARE_GTE"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_compare_gte=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_RELATIONAL,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" >= "+o,n]},Blockly.Blocks.operators_compare_gt={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_COMPARE_GT"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_compare_gt=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_RELATIONAL,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" > "+o,n]},Blockly.Blocks.operators_rand={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_RAND"),["A",["Number"],Blockly.ALIGN_RIGHT],["B",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.operators_rand=function(e){var t,o;return t=Blockly.Ruby.valueToCode(e,"A",Blockly.Ruby.ORDER_RANGE)||"0",o=Blockly.Ruby.valueToCode(e,"B",Blockly.Ruby.ORDER_RANGE)||"0",["rand("+t+".."+o+")",Blockly.Ruby.ORDER_FUNCTION_CALL]},Blockly.Blocks.operators_and={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_AND"),["A",["Boolean"],Blockly.ALIGN_RIGHT],["B",["Boolean"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_and=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_LOGICAL_AND,t=Blockly.Ruby.valueToCode(e,"A",n)||"true",o=Blockly.Ruby.valueToCode(e,"B",n)||"true",[""+t+" && "+o,n]},Blockly.Blocks.operators_or={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_OR"),["A",["Boolean"],Blockly.ALIGN_RIGHT],["B",["Boolean"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_or=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_LOGICAL_OR,t=Blockly.Ruby.valueToCode(e,"A",n)||"true",o=Blockly.Ruby.valueToCode(e,"B",n)||"true",[""+t+" || "+o,n]},Blockly.Blocks.operators_negate={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_NOT"),["A",["Boolean"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_negate=function(e){var t,o;return o=Blockly.Ruby.ORDER_UNARY_SIGN,t=Blockly.Ruby.valueToCode(e,"A",o)||"true",["!"+t,o]},Blockly.Blocks.operators_index_of={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_INDEX_OF"),["A",null,Blockly.ALIGN_RIGHT],["INDEX",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.operators_index_of=function(e){var t,o;return t=Blockly.Ruby.valueToCode(e,"A",Blockly.Ruby.ORDER_FUNCTION_CALL)||'""',o=Blockly.Ruby.valueToCode(e,"INDEX",Blockly.Ruby.ORDER_INDEX)||"0",[""+t+"["+o+"]",Blockly.Ruby.ORDER_FUNCTION_CALL]},Blockly.Blocks.operators_length={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_LENGTH"),["A",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.operators_length=function(e){var t,o;return o=Blockly.Ruby.ORDER_FUNCTION_CALL,t=Blockly.Ruby.valueToCode(e,"A",o)||'""',[""+t+".length",o]},Blockly.Blocks.operators_modulo={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_MODULO"),["A",["Number"],Blockly.ALIGN_RIGHT],["B",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Number"),this.setTooltip("")
39
- }},Blockly.Ruby.operators_modulo=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_MULTIPLICATIVE,t=Blockly.Ruby.valueToCode(e,"A",n)||"1",o=Blockly.Ruby.valueToCode(e,"B",n)||"1",[""+t+" % "+o,n]},Blockly.Blocks.operators_round={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_ROUND"),["A",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.operators_round=function(e){var t,o;return o=Blockly.Ruby.ORDER_FUNCTION_CALL,t=Blockly.Ruby.valueToCode(e,"A",o)||"0",[""+t+".round",o]},Blockly.Blocks.operators_math_method={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_ABS"),"%num%.abs"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_FLOOR"),"%num%.floor"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_CEIL"),"%num%.ceil"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_SQRT"),"Math.sqrt(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_SIN"),"Math.sin(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_COS"),"Math.cos(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_TAN"),"Math.tan(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_ASIN"),"Math.asin(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_ACOS"),"Math.acos(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_ATAN"),"Math.atan(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_LN"),"Math.log(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_LOG"),"Math.log10(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_E_SQUARE"),"Math::E ** %num%"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_10_SQUARE"),"10 ** %num%"]],this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD"),["NUM",["Number"],Blockly.ALIGN_RIGHT],["METHOD",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.operators_math_method=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_FUNCTION_CALL,t=this.getFieldValue("METHOD"),o=Blockly.Ruby.valueToCode(e,"NUM",n)||"0",[t.replace(/%num%/,o),n]},Blockly.Blocks.operators_true={init:function(){return this.setHelpUrl(""),this.setColour(100),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_OPERATORS_TRUE")),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_true=function(){return["true",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.operators_false={init:function(){return this.setHelpUrl(""),this.setColour(100),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_OPERATORS_FALSE")),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_false=function(){return["false",Blockly.Ruby.ORDER_ATOMIC]}}.call(this),function(){Blockly.Blocks.pen_down_pen={init:function(){return this.setHelpUrl(""),this.setColour(160),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_PEN_DOWN_PEN")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.pen_down_pen=function(){return Blockly.Ruby.characterMethodCall_("down_pen")},Blockly.Blocks.pen_up_pen={init:function(){return this.setHelpUrl(""),this.setColour(160),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_PEN_UP_PEN")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.pen_up_pen=function(){return Blockly.Ruby.characterMethodCall_("up_pen")},Blockly.Blocks.pen_set_pen_color={init:function(){return this.setHelpUrl(""),this.setColour(160),this.interpolateMsg(Smalruby.bm("BLOCKS_PEN_SET_PEN_COLOR"),["COLOUR",new Blockly.FieldColour("#ff0000")],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.pen_set_pen_color=function(){var e,t,o,n;return t=this.getFieldValue("COLOUR"),n=parseInt(t.slice(1,3),16),o=parseInt(t.slice(3,5),16),e=parseInt(t.slice(5,7),16),Blockly.Ruby.characterSetVariable_("pen_color","["+n+", "+o+", "+e+"]")}}.call(this),function(){Blockly.Blocks.ruby_statement={init:function(){return this.setHelpUrl(""),this.setColour(340),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_RUBY_STATEMENT")).appendField(new Blockly.FieldTextInput(""),"STATEMENT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.ruby_statement=function(){var e;return e=this.getFieldValue("STATEMENT"),""+e+"\n"},Blockly.Blocks.ruby_expression={init:function(){return this.setHelpUrl(""),this.setColour(340),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_RUBY_EXPRESSION")).appendField(new Blockly.FieldTextInput(""),"EXP"),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.ruby_expression=function(){var e;return e=this.getFieldValue("EXP"),["("+e+")",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.ruby_comment={init:function(){return this.setHelpUrl(""),this.setColour(340),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_RUBY_COMMENT")).appendField(new Blockly.FieldTextInput(""),"COMMENT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.ruby_comment=function(){var e;return e=this.getFieldValue("COMMENT"),"# "+e+"\n"},Blockly.Blocks.ruby_p={init:function(){return this.setHelpUrl(""),this.setColour(340),this.interpolateMsg(Smalruby.bm("BLOCKS_RUBY_P"),["ARG",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.ruby_p=function(){var e;return e=Blockly.Ruby.valueToCode(this,"ARG",Blockly.Ruby.ORDER_NONE)||'""',"p("+e+")\n"}}.call(this),function(){$(document).ready(function(){return window.SmalrubyEditor.Sensing={KeyDropdown:[[Smalruby.bm("BLOCKS_SENSING_K_UP"),"K_UP"],[Smalruby.bm("BLOCKS_SENSING_K_DOWN"),"K_DOWN"],[Smalruby.bm("BLOCKS_SENSING_K_LEFT"),"K_LEFT"],[Smalruby.bm("BLOCKS_SENSING_K_RIGHT"),"K_RIGHT"],[Smalruby.bm("BLOCKS_SENSING_K_SPACE"),"K_SPACE"],["a","K_A"],["b","K_B"],["c","K_C"],["d","K_D"],["e","K_E"],["f","K_F"],["g","K_G"],["h","K_H"],["i","K_I"],["j","K_J"],["k","K_K"],["l","K_L"],["m","K_M"],["n","K_N"],["o","K_O"],["p","K_P"],["q","K_Q"],["r","K_R"],["s","K_S"],["t","K_T"],["u","K_U"],["v","K_V"],["w","K_W"],["x","K_X"],["y","K_Y"],["z","K_Z"],["0","K_0"],["1","K_1"],["2","K_2"],["3","K_3"],["4","K_4"],["5","K_5"],["6","K_6"],["7","K_7"],["8","K_8"],["9","K_9"]],PushOrDownDropdown:[[Smalruby.bm("BLOCKS_SENSING_PUSH"),"push"],[Smalruby.bm("BLOCKS_SENSING_HOLD_DOWN"),"down"]],MouseButtonDropdown:[[Smalruby.bm("BLOCKS_SENSING_M_LBUTTON"),"M_LBUTTON"],[Smalruby.bm("BLOCKS_SENSING_M_MBUTTON"),"M_MBUTTON"],[Smalruby.bm("BLOCKS_SENSING_M_RBUTTON"),"M_RBUTTON"]],DownOrUpDropdown:[[Smalruby.bm("BLOCKS_SENSING_DOWN"),"down"],[Smalruby.bm("BLOCKS_SENSING_UP"),"up"]],PressedOrReleasedDropdown:[[Smalruby.bm("BLOCKS_SENSING_PRESSED"),"pressed"],[Smalruby.bm("BLOCKS_SENSING_RELEASED"),"released"]]}}),Blockly.Blocks.sensing_reach_wall={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_REACH_WALL")),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.sensing_reach_wall=function(){return Blockly.Ruby.characterMethodCallInput_("reach_wall?")},Blockly.Blocks.motion_reach_wall=Blockly.Blocks.sensing_reach_wall,Blockly.Ruby.motion_reach_wall=Blockly.Ruby.sensing_reach_wall,Blockly.Blocks.sensing_input_key_push_or_down={init:function(){var e,t;return e=window.SmalrubyEditor.Sensing.KeyDropdown,t=window.SmalrubyEditor.Sensing.PushOrDownDropdown,this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_PREFIX")).appendField(new Blockly.FieldDropdown(e),"KEY").appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_MIDDLE")).appendField(new Blockly.FieldDropdown(t),"POD").appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_SUFFIX")),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.sensing_input_key_push_or_down=function(){var e,t;return e=this.getFieldValue("KEY"),t=this.getFieldValue("POD"),["Input.key_"+t+"?("+e+")",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_input_mouse_push_or_down={init:function(){var e,t;return e=window.SmalrubyEditor.Sensing.MouseButtonDropdown,t=window.SmalrubyEditor.Sensing.PushOrDownDropdown,this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_PREFIX")).appendField(new Blockly.FieldDropdown(e),"MOUSE_BUTTON").appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_MIDDLE")).appendField(new Blockly.FieldDropdown(t),"POD").appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_SUFFIX")),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.sensing_input_mouse_push_or_down=function(){var e,t;return e=this.getFieldValue("MOUSE_BUTTON"),t=this.getFieldValue("POD"),["Input.mouse_"+t+"?("+e+")",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_input_mouse_pos_x={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_MOUSE_POS_X")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.sensing_input_mouse_pos_x=function(){return["Input.mouse_pos_x",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_input_mouse_pos_y={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_MOUSE_POS_Y")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.sensing_input_mouse_pos_y=function(){return["Input.mouse_pos_y",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_hit={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_HIT_PREFIX")).appendField(new Smalruby.FieldCharacter,"CHAR").appendField(Smalruby.bm("BLOCKS_SENSING_HIT_SUFFIX")),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.sensing_hit=function(){var e;return e=this.getCharacterFieldValue(),Blockly.Ruby.characterMethodCallInput_("hit?",e)},Blockly.Blocks.sensing_ask={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg("%1と聞いて待つ",["TEXT",["String"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.sensing_ask=function(){var e;return e=Blockly.Ruby.valueToCode(this,"TEXT",Blockly.Ruby.ORDER_NONE)||'""',"ask("+e+")\n"},Blockly.Blocks.sensing_answer={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField("答え"),this.setOutput(!0,"String"),this.setTooltip("")}},Blockly.Ruby.sensing_answer=function(){return["answer",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_timer_count={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField("タイマー"),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.sensing_timer_count=function(){return["timer.count",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_timer_reset={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField("タイマーをリセット"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.sensing_timer_reset=function(){return"timer.reset\n"},Blockly.Blocks.sensing_character_property={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_X"),"x"],[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_Y"),"y"],[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_ANGLE"),"angle"],[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_COSTUME_INDEX"),"costume_index"],[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_COSTUME"),"costume"],[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_SCALE"),"scale"],[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_VOLUME"),"volume"]],this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY"),["CHAR",new Smalruby.FieldCharacter],["PROPERTY",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setOutput(!0,["Number","String"]),this.setTooltip("")}},Blockly.Ruby.sensing_character_property=function(){var e,t,o;return t=this.getCharacterFieldValue(),o=this.getFieldValue("PROPERTY"),e=Smalruby.Collections.CharacterSet.findWhere({name:t}),Blockly.Ruby.characterMethodCallInput_(o,null,{object:e})},Blockly.Blocks.sensing_time_now={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_YEAR"),"year"],[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_MONTH"),"month"],[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_DAY"),"day"],[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_WDAY"),"wday"],[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_HOUR"),"hour"],[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_MIN"),"min"],[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_SEC"),"sec"]],this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_SENSING_TIME_NOW"),["METHOD",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.sensing_time_now=function(){var e;return e=this.getFieldValue("METHOD"),["Time.now."+e,Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_days_since_2000={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_DAYS_SINCE_2000")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.sensing_days_since_2000=function(){return["(Time.now - Time.mktime(2000, 1, 1)).to_i / 1.day",Blockly.Ruby.ORDER_ATOMIC]}}.call(this),function(){Blockly.Blocks.sound_preset_sounds={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_DO"),"piano_do.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_RE"),"piano_re.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_MI"),"piano_mi.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_FA"),"piano_fa.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_SO"),"piano_so.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_RA"),"piano_ra.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_SI"),"piano_si.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_DO_2"),"piano_do_2.wav"]],this.setHelpUrl(""),this.setColour(300),this.interpolateMsg(Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS"),["NAME",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"String"),this.setTooltip("")}},Blockly.Ruby.sound_preset_sounds=function(){var e;return e=Blockly.Ruby.quote_(this.getFieldValue("NAME")),[e,Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sound_play={init:function(){return this.setHelpUrl(""),this.setColour(300),this.interpolateMsg(Smalruby.bm("BLOCKS_SOUND_PLAY"),["NAME",["String"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.sound_play=function(){var e;return e=Blockly.Ruby.valueToCode(this,"NAME",Blockly.Ruby.ORDER_NONE)||"",Blockly.Ruby.characterMethodCall_("play","name: "+e)},Blockly.Blocks.sound_stop={init:function(){return this.setHelpUrl(""),this.setColour(300),this.appendDummyInput().appendField("すべての音を止める"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.sound_stop=function(){return"stop\n"},Blockly.Blocks.sound_volume={init:function(){return this.setHelpUrl(""),this.setColour(300),this.appendDummyInput().appendField("ボリューム"),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.sound_volume=function(){return["volume",Blockly.Ruby.ORDER_ATOMIC]}}.call(this);
38
+ }},Blockly.Ruby.hardware_motor_driver=function(){var e,t;return t=this.getFieldValue("PIN"),e=this.getFieldValue("METHOD"),Blockly.Ruby.characterMethodCall_("motor_driver("+Blockly.Ruby.quote_(t)+")."+e)},Blockly.Blocks.hardware_motor_driver_set_speed={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_MOTOR_DRIVER_SET_SPEED"),["PIN",new Blockly.FieldDropdown(r)],["SPEED",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_motor_driver_set_speed=function(){var e,t;return e=this.getFieldValue("PIN"),t=Blockly.Ruby.valueToCode(this,"SPEED",Blockly.Ruby.ORDER_NONE)||"100",Blockly.Ruby.characterMethodCall_("motor_driver("+Blockly.Ruby.quote_(e)+").speed = "+t)},Blockly.Blocks.hardware_motor_driver_speed={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_MOTOR_DRIVER_SPEED"),["PIN",new Blockly.FieldDropdown(r)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.hardware_motor_driver_speed=function(){var e;return e=this.getFieldValue("PIN"),Blockly.Ruby.characterMethodCallInput_("motor_driver("+Blockly.Ruby.quote_(e)+").speed")},Blockly.Blocks.hardware_button_pressed_or_released={init:function(){var e;return e=window.SmalrubyEditor.Sensing.PressedOrReleasedDropdown,this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_BUTTON_PRESSED_OR_RELEASED"),["PIN",new Blockly.FieldDropdown(n)],["POR",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.hardware_button_pressed_or_released=function(){var e,t;return e=this.getFieldValue("PIN"),t=this.getFieldValue("POR"),Blockly.Ruby.characterMethodCallInput_("button("+Blockly.Ruby.quote_(e)+")."+t+"?")},Blockly.Blocks.hardware_sensor_value={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SENSOR_VALUE"),["PIN",new Blockly.FieldDropdown(o)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.hardware_sensor_value=function(){var e;return e=this.getFieldValue("PIN"),Blockly.Ruby.characterMethodCallInput_("sensor("+Blockly.Ruby.quote_(e)+").value")},Blockly.Blocks.hardware_smalrubot_v3_led_turn_on_or_off={init:function(){var e;return e=[[Smalruby.bm("COMMON_TURN_ON"),"turn_on"],[Smalruby.bm("COMMON_TURN_OFF"),"turn_off"]],this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_LED_TURN_ON_OR_OFF"),["LOR",new Blockly.FieldDropdown(i)],["OOO",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_led_turn_on_or_off=function(){var e,t;return e=this.getFieldValue("LOR"),t=this.getFieldValue("OOO"),Blockly.Ruby.characterMethodCall_("smalrubot_v3."+t+"_"+e+"_led")},Blockly.Blocks.hardware_smalrubot_v3_action={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_ACTION"),["ACTION",new Blockly.FieldDropdown(t)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_action=function(){var e;return e=this.getFieldValue("ACTION"),Blockly.Ruby.characterMethodCall_("smalrubot_v3."+e)},Blockly.Blocks.hardware_smalrubot_v3_action_with_sec={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_ACTION_WITH_SEC"),["ACTION",new Blockly.FieldDropdown(t)],["SEC",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_action_with_sec=function(){var e,t;return e=this.getFieldValue("ACTION"),t=Blockly.Ruby.valueToCode(this,"SEC",Blockly.Ruby.ORDER_FUNCTION_CALL)||"nil",Blockly.Ruby.characterMethodCall_("smalrubot_v3."+e+"(sec: "+t+")")},Blockly.Blocks.hardware_smalrubot_v3_sensor_value={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_SENSOR_VALUE"),["LOR",new Blockly.FieldDropdown(i)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_sensor_value=function(){var e;return e=this.getFieldValue("LOR"),Blockly.Ruby.characterMethodCallInput_("smalrubot_v3."+e+"_sensor_value")},Blockly.Blocks.hardware_smalrubot_v3_dc_motor_power_ratio={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_DC_MOTOR_POWER_RATIO"),["LOR",new Blockly.FieldDropdown(i)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_dc_motor_power_ratio=function(){var e;return e=this.getFieldValue("LOR"),Blockly.Ruby.characterMethodCallInput_("smalrubot_v3."+e+"_dc_motor_power_ratio")},Blockly.Blocks.hardware_smalrubot_v3_dc_motor_set_power_ratio={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_V3_DC_MOTOR_SET_POWER_RATIO"),["LOR",new Blockly.FieldDropdown(i)],["SPEED",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_v3_dc_motor_set_power_ratio=function(){var e,t;return e=this.getFieldValue("LOR"),t=Blockly.Ruby.valueToCode(this,"SPEED",Blockly.Ruby.ORDER_NONE)||"100",Blockly.Ruby.characterSetVariable_("smalrubot_v3."+e+"_dc_motor_power_ratio",t)},Blockly.Blocks.hardware_smalrubot_s1_led_turn_on_or_off={init:function(){var e;return e=[[Smalruby.bm("COMMON_TURN_ON"),"turn_on"],[Smalruby.bm("COMMON_TURN_OFF"),"turn_off"]],this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_S1_LED_TURN_ON_OR_OFF"),["LOR",new Blockly.FieldDropdown(i)],["OOO",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_s1_led_turn_on_or_off=function(){var e,t;return e=this.getFieldValue("LOR"),t=this.getFieldValue("OOO"),Blockly.Ruby.characterMethodCall_("smalrubot_s1."+t+"_"+e+"_led")},Blockly.Blocks.hardware_smalrubot_s1_action={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_S1_ACTION"),["ACTION",new Blockly.FieldDropdown(t)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_s1_action=function(){var e;return e=this.getFieldValue("ACTION"),Blockly.Ruby.characterMethodCall_("smalrubot_s1."+e)},Blockly.Blocks.hardware_smalrubot_s1_action_with_sec={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_S1_ACTION_WITH_SEC"),["ACTION",new Blockly.FieldDropdown(t)],["SEC",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_s1_action_with_sec=function(){var e,t;return e=this.getFieldValue("ACTION"),t=Blockly.Ruby.valueToCode(this,"SEC",Blockly.Ruby.ORDER_FUNCTION_CALL)||"nil",Blockly.Ruby.characterMethodCall_("smalrubot_s1."+e+"(sec: "+t+")")},Blockly.Blocks.hardware_smalrubot_s1_sensor_value={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_S1_SENSOR_VALUE"),["LOR",new Blockly.FieldDropdown(i)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_s1_sensor_value=function(){var e;return e=this.getFieldValue("LOR"),Blockly.Ruby.characterMethodCallInput_("smalrubot_s1."+e+"_sensor_value")},Blockly.Blocks.hardware_smalrubot_s1_dc_motor_power_ratio={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_S1_DC_MOTOR_POWER_RATIO"),["LOR",new Blockly.FieldDropdown(i)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_s1_dc_motor_power_ratio=function(){var e;return e=this.getFieldValue("LOR"),Blockly.Ruby.characterMethodCallInput_("smalrubot_s1."+e+"_dc_motor_power_ratio")},Blockly.Blocks.hardware_smalrubot_s1_dc_motor_set_power_ratio={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_HARDWARE_SMALRUBOT_S1_DC_MOTOR_SET_POWER_RATIO"),["LOR",new Blockly.FieldDropdown(i)],["SPEED",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.hardware_smalrubot_s1_dc_motor_set_power_ratio=function(){var e,t;return e=this.getFieldValue("LOR"),t=Blockly.Ruby.valueToCode(this,"SPEED",Blockly.Ruby.ORDER_NONE)||"100",Blockly.Ruby.characterSetVariable_("smalrubot_s1."+e+"_dc_motor_power_ratio",t)}}.call(this),function(){Blockly.Blocks.looks_say_second={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_LOOKS_SAY_WITH_SECOND"),["TEXT",null,Blockly.ALIGN_RIGHT],["SEC",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_say_second=function(){var e,t;return e=Blockly.Ruby.valueToCode(this,"SEC",Blockly.Ruby.ORDER_NONE)||"0",t=Blockly.Ruby.valueToCode(this,"TEXT",Blockly.Ruby.ORDER_NONE)||Blockly.Ruby.quote_(""),Blockly.Ruby.characterMethodCall_("say","message: "+t+", second: "+e)},Blockly.Blocks.looks_say={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_LOOKS_SAY"),["TEXT",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_say=function(){var e;return e=Blockly.Ruby.valueToCode(this,"TEXT",Blockly.Ruby.ORDER_NONE)||Blockly.Ruby.quote_(""),Blockly.Ruby.characterMethodCall_("say","message: "+e)},Blockly.Blocks.looks_think_second={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_LOOKS_THINK_WITH_SECOND"),["TEXT",null,Blockly.ALIGN_RIGHT],["SEC",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_think_second=function(){var e,t;return e=Blockly.Ruby.valueToCode(this,"SEC",Blockly.Ruby.ORDER_NONE)||"0",t=Blockly.Ruby.valueToCode(this,"TEXT",Blockly.Ruby.ORDER_NONE)||Blockly.Ruby.quote_(""),Blockly.Ruby.characterMethodCall_("think","message: "+t+", second: "+e)},Blockly.Blocks.looks_think={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg(Smalruby.bm("BLOCKS_LOOKS_THINK"),["TEXT",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_think=function(){var e;return e=Blockly.Ruby.valueToCode(this,"TEXT",Blockly.Ruby.ORDER_NONE)||Blockly.Ruby.quote_(""),Blockly.Ruby.characterMethodCall_("think","message: "+e)},Blockly.Blocks.looks_show={init:function(){return this.setHelpUrl(""),this.setColour(270),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_LOOKS_SHOW")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_show=function(){return Blockly.Ruby.characterSetVariable_("visible","true")},Blockly.Blocks.looks_hide={init:function(){return this.setHelpUrl(""),this.setColour(270),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_LOOKS_HIDE")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_hide=function(){return Blockly.Ruby.characterSetVariable_("visible","false")},Blockly.Blocks.looks_vanish={init:function(){return this.setHelpUrl(""),this.setColour(270),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_LOOKS_VANISH")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_vanish=function(){return Blockly.Ruby.characterMethodCall_("vanish")},Blockly.Blocks.looks_change_scale_by={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg("大きさを%1%ずつ変える",["SCALE",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_change_scale_by=function(){var e;return e=Blockly.Ruby.valueToCode(this,"SCALE",Blockly.Ruby.ORDER_NONE)||"0",e=parseInt(e)/100,"self.scale += "+e+"\n"},Blockly.Blocks.looks_set_scale={init:function(){return this.setHelpUrl(""),this.setColour(270),this.interpolateMsg("大きさを%1%にする",["SCALE",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.looks_set_scale=function(){var e;return e=Blockly.Ruby.valueToCode(this,"SCALE",Blockly.Ruby.ORDER_NONE)||"0",e=parseInt(e)/100,"self.scale = "+e+"\n"},Blockly.Blocks.looks_self_scale={init:function(){return this.setHelpUrl(""),this.setColour(270),this.appendDummyInput().appendField("大きさ"),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.looks_self_scale=function(){return["scale",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.looks_preset_images={init:function(){var e;return e=[["車1","car1.png"],["車2","car2.png"],["車3","car3.png"],["車4","car4.png"],["ボール1","ball1.png"],["ボール2","ball2.png"],["ボール3","ball3.png"],["ボール4","ball4.png"],["ボール5","ball5.png"],["ボール6","ball6.png"],["猫1","cat1.png"],["猫2","cat2.png"],["猫3","cat3.png"],["かえる1","frog1.png"],["コウガ リュウ1","ryu1.png"],["コウガ リュウ2","ryu2.png"],["イタチのタイチ","taichi1.png"],["イタチのタイチ","taichi2.png"]],this.setHelpUrl(""),this.setColour(270),this.appendDummyInput().appendField(new Blockly.FieldDropdown(e),"NAME"),this.setOutput(!0,"String"),this.setTooltip("")}},Blockly.Ruby.looks_preset_images=function(){var e;return e=Blockly.Ruby.quote_(this.getFieldValue("NAME")),[e,Blockly.Ruby.ORDER_ATOMIC]}}.call(this),function(){Blockly.Blocks.motion_move={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_MOVE"),["STEP",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_move=function(){var e;return e=Blockly.Ruby.valueToCode(this,"STEP",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterMethodCall_("move",""+e)},Blockly.Blocks.motion_rotate_right={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_TURN_RIGHT_DEGREES"),["ANGLE",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_rotate_right=function(){var e;return e=Blockly.Ruby.valueToCode(this,"ANGLE",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterMethodCall_("rotate",""+e)},Blockly.Blocks.motion_rotate_left={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_TURN_LEFT_DEGREES"),["ANGLE",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_rotate_left=function(){var e;return e=Blockly.Ruby.valueToCode(this,"ANGLE",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterMethodCall_("rotate","-"+e)},Blockly.Blocks.motion_set_angle={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_POINT_IN_DIRECTION"),["ANGLE",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_set_angle=function(){var e;return e=Blockly.Ruby.valueToCode(this,"ANGLE",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterSetVariable_("angle",e)},Blockly.Blocks.motion_point_towards_mouse={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_POINT_TOWARDS_MOUSE")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_point_towards_mouse=function(){return""+Blockly.Ruby.rn()+"point_towards(:mouse)\n"},Blockly.Blocks.motion_point_towards_character={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_POINT_TOWARDS_CHARACTER"),["CHAR",new Smalruby.FieldCharacter],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_point_towards_character=function(){var e;return e=this.getCharacterFieldValue(),Blockly.Ruby.characterMethodCall_("point_towards",e)},Blockly.Blocks.motion_set_x_y={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_SET_X_Y"),["X",["Number"],Blockly.ALIGN_RIGHT],["Y",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_set_x_y=function(){var e,t;return e=Blockly.Ruby.valueToCode(this,"X",Blockly.Ruby.ORDER_NONE)||"0",t=Blockly.Ruby.valueToCode(this,"Y",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterSetVariable_("position","["+e+", "+t+"]")},Blockly.Blocks.motion_go_to_mouse={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_GO_TO_MOUSE")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_go_to_mouse=function(){return Blockly.Ruby.characterMethodCall_("go_to(:mouse)")},Blockly.Blocks.motion_go_to_character={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_GO_TO_CHARACTER"),["CHAR",new Smalruby.FieldCharacter],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_go_to_character=function(){var e;return e=this.getCharacterFieldValue(),Blockly.Ruby.characterMethodCall_("go_to("+e+")")},Blockly.Blocks.motion_glide_to_x_y={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg("%1秒でx座標を%2、y座標を%3に変える",["SEC",["Number"],Blockly.ALIGN_RIGHT],["X",["Number"],Blockly.ALIGN_RIGHT],["Y",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_glide_to_x_y=function(){var e,t,o;return e=Blockly.Ruby.valueToCode(this,"SEC",Blockly.Ruby.ORDER_NONE)||"0",t=Blockly.Ruby.valueToCode(this,"X",Blockly.Ruby.ORDER_NONE)||"0",o=Blockly.Ruby.valueToCode(this,"Y",Blockly.Ruby.ORDER_NONE)||"0",""+Blockly.Ruby.rn()+"glide_to(second: "+e+", x: "+t+", y: "+o+")\n"},Blockly.Blocks.motion_change_x_by={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_CHANGE_X_BY"),["X",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_change_x_by=function(){var e;return e=Blockly.Ruby.valueToCode(this,"X",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterSetVariable_("x",e,"+=")},Blockly.Blocks.motion_set_x={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_SET_X"),["X",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_set_x=function(){var e;return e=Blockly.Ruby.valueToCode(this,"X",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterSetVariable_("x",e,"=")},Blockly.Blocks.motion_change_y_by={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_CHANGE_Y_BY"),["Y",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_change_y_by=function(){var e;return e=Blockly.Ruby.valueToCode(this,"Y",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterSetVariable_("y",e,"+=")},Blockly.Blocks.motion_set_y={init:function(){return this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_SET_Y"),["Y",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_set_y=function(){var e;return e=Blockly.Ruby.valueToCode(this,"Y",Blockly.Ruby.ORDER_NONE)||"0",Blockly.Ruby.characterSetVariable_("y",e,"=")},Blockly.Blocks.motion_turn_if_reach_wall={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_TURN_IF_REACH_WALL")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_turn_if_reach_wall=function(){return Blockly.Ruby.characterMethodCall_("turn_if_reach_wall")},Blockly.Blocks.motion_turn={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_TURN")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_turn=function(){return Blockly.Ruby.characterMethodCall_("turn")},Blockly.Blocks.motion_turn_xy={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_MOTION_TURN_XY_X"),"x"],[Smalruby.bm("BLOCKS_MOTION_TURN_XY_Y"),"y"]],this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_TURN_XY"),["XY",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_turn_xy=function(){var e;return e=this.getFieldValue("XY"),Blockly.Ruby.characterMethodCall_("turn_"+e)},Blockly.Blocks.motion_set_rotation_style={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_MOTION_SET_ROTATION_STYLE_LEFT_RIGHT"),"left_right"],[Smalruby.bm("BLOCKS_MOTION_SET_ROTATION_STYLE_NONE"),"none"],[Smalruby.bm("BLOCKS_MOTION_SET_ROTATION_STYLE_FREE"),"free"]],this.setHelpUrl(""),this.setColour(208),this.interpolateMsg(Smalruby.bm("BLOCKS_MOTION_SET_ROTATION_STYLE"),["STYLE",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.motion_set_rotation_style=function(){var e;return e=this.getFieldValue("STYLE"),Blockly.Ruby.characterSetVariable_("rotation_style",":"+e)},Blockly.Blocks.motion_self_x={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_SELF_X")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.motion_self_x=function(){return Blockly.Ruby.characterMethodCallInput_("x")},Blockly.Blocks.motion_self_y={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_SELF_Y")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.motion_self_y=function(){return Blockly.Ruby.characterMethodCallInput_("y")},Blockly.Blocks.motion_self_angle={init:function(){return this.setHelpUrl(""),this.setColour(208),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_MOTION_SELF_ANGLE")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.motion_self_angle=function(){return Blockly.Ruby.characterMethodCallInput_("angle")}}.call(this),function(){Blockly.Blocks.operators_add={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_ADD"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.operators_add=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_ADDITIVE,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" + "+o,n]},Blockly.Blocks.operators_minus={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_MINUS"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.operators_minus=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_ADDITIVE,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" - "+o,n]},Blockly.Blocks.operators_multiply={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_MULTIPLY"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.operators_multiply=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_MULTIPLICATIVE,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" * "+o,n]},Blockly.Blocks.operators_divide={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_DIVIDE"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.operators_divide=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_MULTIPLICATIVE,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"1",[t+" / "+o,n]},Blockly.Blocks.operators_compare_lt={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_COMPARE_LT"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_compare_lt=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_RELATIONAL,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" < "+o,n]},Blockly.Blocks.operators_compare_lte={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_COMPARE_LTE"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_compare_lte=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_RELATIONAL,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" <= "+o,n]},Blockly.Blocks.operators_compare_eq={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_COMPARE_EQ"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_compare_eq=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_EQUALS,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" == "+o,n]},Blockly.Blocks.operators_compare_gte={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_COMPARE_GTE"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_compare_gte=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_RELATIONAL,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" >= "+o,n]},Blockly.Blocks.operators_compare_gt={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_COMPARE_GT"),["A",null,Blockly.ALIGN_RIGHT],["B",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_compare_gt=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_RELATIONAL,t=Blockly.Ruby.valueToCode(e,"A",n)||"0",o=Blockly.Ruby.valueToCode(e,"B",n)||"0",[t+" > "+o,n]},Blockly.Blocks.operators_rand={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_RAND"),["A",["Number"],Blockly.ALIGN_RIGHT],["B",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.operators_rand=function(e){var t,o;return t=Blockly.Ruby.valueToCode(e,"A",Blockly.Ruby.ORDER_RANGE)||"0",o=Blockly.Ruby.valueToCode(e,"B",Blockly.Ruby.ORDER_RANGE)||"0",["rand("+t+".."+o+")",Blockly.Ruby.ORDER_FUNCTION_CALL]},Blockly.Blocks.operators_and={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_AND"),["A",["Boolean"],Blockly.ALIGN_RIGHT],["B",["Boolean"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_and=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_LOGICAL_AND,t=Blockly.Ruby.valueToCode(e,"A",n)||"true",o=Blockly.Ruby.valueToCode(e,"B",n)||"true",[""+t+" && "+o,n]},Blockly.Blocks.operators_or={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_OR"),["A",["Boolean"],Blockly.ALIGN_RIGHT],["B",["Boolean"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_or=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_LOGICAL_OR,t=Blockly.Ruby.valueToCode(e,"A",n)||"true",o=Blockly.Ruby.valueToCode(e,"B",n)||"true",[""+t+" || "+o,n]},Blockly.Blocks.operators_negate={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_NOT"),["A",["Boolean"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_negate=function(e){var t,o;return o=Blockly.Ruby.ORDER_UNARY_SIGN,t=Blockly.Ruby.valueToCode(e,"A",o)||"true",["!"+t,o]},Blockly.Blocks.operators_index_of={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_INDEX_OF"),["A",null,Blockly.ALIGN_RIGHT],["INDEX",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.operators_index_of=function(e){var t,o;return t=Blockly.Ruby.valueToCode(e,"A",Blockly.Ruby.ORDER_FUNCTION_CALL)||'""',o=Blockly.Ruby.valueToCode(e,"INDEX",Blockly.Ruby.ORDER_INDEX)||"0",[""+t+"["+o+"]",Blockly.Ruby.ORDER_FUNCTION_CALL]},Blockly.Blocks.operators_length={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_LENGTH"),["A",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.operators_length=function(e){var t,o;return o=Blockly.Ruby.ORDER_FUNCTION_CALL,t=Blockly.Ruby.valueToCode(e,"A",o)||'""',[""+t+".length",o]},Blockly.Blocks.operators_modulo={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_MODULO"),["A",["Number"],Blockly.ALIGN_RIGHT],["B",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.operators_modulo=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_MULTIPLICATIVE,t=Blockly.Ruby.valueToCode(e,"A",n)||"1",o=Blockly.Ruby.valueToCode(e,"B",n)||"1",[""+t+" % "+o,n]},Blockly.Blocks.operators_round={init:function(){return this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_ROUND"),["A",["Number"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Number"),this.setTooltip("")
39
+ }},Blockly.Ruby.operators_round=function(e){var t,o;return o=Blockly.Ruby.ORDER_FUNCTION_CALL,t=Blockly.Ruby.valueToCode(e,"A",o)||"0",[""+t+".round",o]},Blockly.Blocks.operators_math_method={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_ABS"),"%num%.abs"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_FLOOR"),"%num%.floor"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_CEIL"),"%num%.ceil"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_SQRT"),"Math.sqrt(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_SIN"),"Math.sin(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_COS"),"Math.cos(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_TAN"),"Math.tan(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_ASIN"),"Math.asin(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_ACOS"),"Math.acos(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_ATAN"),"Math.atan(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_LN"),"Math.log(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_LOG"),"Math.log10(%num%)"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_E_SQUARE"),"Math::E ** %num%"],[Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD_10_SQUARE"),"10 ** %num%"]],this.setHelpUrl(""),this.setColour(100),this.interpolateMsg(Smalruby.bm("BLOCKS_OPERATORS_MATH_METHOD"),["NUM",["Number"],Blockly.ALIGN_RIGHT],["METHOD",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.operators_math_method=function(e){var t,o,n;return n=Blockly.Ruby.ORDER_FUNCTION_CALL,t=this.getFieldValue("METHOD"),o=Blockly.Ruby.valueToCode(e,"NUM",n)||"0",[t.replace(/%num%/,o),n]},Blockly.Blocks.operators_true={init:function(){return this.setHelpUrl(""),this.setColour(100),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_OPERATORS_TRUE")),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_true=function(){return["true",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.operators_false={init:function(){return this.setHelpUrl(""),this.setColour(100),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_OPERATORS_FALSE")),this.setInputsInline(!0),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.operators_false=function(){return["false",Blockly.Ruby.ORDER_ATOMIC]}}.call(this),function(){Blockly.Blocks.pen_down_pen={init:function(){return this.setHelpUrl(""),this.setColour(160),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_PEN_DOWN_PEN")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.pen_down_pen=function(){return Blockly.Ruby.characterMethodCall_("down_pen")},Blockly.Blocks.pen_up_pen={init:function(){return this.setHelpUrl(""),this.setColour(160),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_PEN_UP_PEN")),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.pen_up_pen=function(){return Blockly.Ruby.characterMethodCall_("up_pen")},Blockly.Blocks.pen_set_pen_color={init:function(){return this.setHelpUrl(""),this.setColour(160),this.interpolateMsg(Smalruby.bm("BLOCKS_PEN_SET_PEN_COLOR"),["COLOUR",new Blockly.FieldColour("#ff0000")],Blockly.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.pen_set_pen_color=function(){var e,t,o,n;return t=this.getFieldValue("COLOUR"),n=parseInt(t.slice(1,3),16),o=parseInt(t.slice(3,5),16),e=parseInt(t.slice(5,7),16),Blockly.Ruby.characterSetVariable_("pen_color","["+n+", "+o+", "+e+"]")}}.call(this),function(){Blockly.Blocks.ruby_statement={init:function(){return this.setHelpUrl(""),this.setColour(340),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_RUBY_STATEMENT")).appendField(new Blockly.FieldTextInput(""),"STATEMENT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.ruby_statement=function(){var e;return e=this.getFieldValue("STATEMENT"),""+e+"\n"},Blockly.Blocks.ruby_expression={init:function(){return this.setHelpUrl(""),this.setColour(340),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_RUBY_EXPRESSION")).appendField(new Blockly.FieldTextInput(""),"EXP"),this.setOutput(!0,null),this.setTooltip("")}},Blockly.Ruby.ruby_expression=function(){var e;return e=this.getFieldValue("EXP"),["("+e+")",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.ruby_comment={init:function(){return this.setHelpUrl(""),this.setColour(340),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_RUBY_COMMENT")).appendField(new Blockly.FieldTextInput(""),"COMMENT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.ruby_comment=function(){var e;return e=this.getFieldValue("COMMENT"),"# "+e+"\n"},Blockly.Blocks.ruby_p={init:function(){return this.setHelpUrl(""),this.setColour(340),this.interpolateMsg(Smalruby.bm("BLOCKS_RUBY_P"),["ARG",null,Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.ruby_p=function(){var e;return e=Blockly.Ruby.valueToCode(this,"ARG",Blockly.Ruby.ORDER_NONE)||'""',"p("+e+")\n"}}.call(this),function(){$(document).ready(function(){return window.SmalrubyEditor.Sensing={KeyDropdown:[[Smalruby.bm("BLOCKS_SENSING_K_UP"),"K_UP"],[Smalruby.bm("BLOCKS_SENSING_K_DOWN"),"K_DOWN"],[Smalruby.bm("BLOCKS_SENSING_K_LEFT"),"K_LEFT"],[Smalruby.bm("BLOCKS_SENSING_K_RIGHT"),"K_RIGHT"],[Smalruby.bm("BLOCKS_SENSING_K_SPACE"),"K_SPACE"],["a","K_A"],["b","K_B"],["c","K_C"],["d","K_D"],["e","K_E"],["f","K_F"],["g","K_G"],["h","K_H"],["i","K_I"],["j","K_J"],["k","K_K"],["l","K_L"],["m","K_M"],["n","K_N"],["o","K_O"],["p","K_P"],["q","K_Q"],["r","K_R"],["s","K_S"],["t","K_T"],["u","K_U"],["v","K_V"],["w","K_W"],["x","K_X"],["y","K_Y"],["z","K_Z"],["0","K_0"],["1","K_1"],["2","K_2"],["3","K_3"],["4","K_4"],["5","K_5"],["6","K_6"],["7","K_7"],["8","K_8"],["9","K_9"]],PushOrDownDropdown:[[Smalruby.bm("BLOCKS_SENSING_PUSH"),"push"],[Smalruby.bm("BLOCKS_SENSING_HOLD_DOWN"),"down"]],MouseButtonDropdown:[[Smalruby.bm("BLOCKS_SENSING_M_LBUTTON"),"M_LBUTTON"],[Smalruby.bm("BLOCKS_SENSING_M_MBUTTON"),"M_MBUTTON"],[Smalruby.bm("BLOCKS_SENSING_M_RBUTTON"),"M_RBUTTON"]],DownOrUpDropdown:[[Smalruby.bm("BLOCKS_SENSING_DOWN"),"down"],[Smalruby.bm("BLOCKS_SENSING_UP"),"up"]],PressedOrReleasedDropdown:[[Smalruby.bm("BLOCKS_SENSING_PRESSED"),"pressed"],[Smalruby.bm("BLOCKS_SENSING_RELEASED"),"released"]]}}),Blockly.Blocks.sensing_reach_wall={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_REACH_WALL")),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.sensing_reach_wall=function(){return Blockly.Ruby.characterMethodCallInput_("reach_wall?")},Blockly.Blocks.motion_reach_wall=Blockly.Blocks.sensing_reach_wall,Blockly.Ruby.motion_reach_wall=Blockly.Ruby.sensing_reach_wall,Blockly.Blocks.sensing_input_key_push_or_down={init:function(){var e,t;return e=window.SmalrubyEditor.Sensing.KeyDropdown,t=window.SmalrubyEditor.Sensing.PushOrDownDropdown,this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_PREFIX")).appendField(new Blockly.FieldDropdown(e),"KEY").appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_MIDDLE")).appendField(new Blockly.FieldDropdown(t),"POD").appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_SUFFIX")),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.sensing_input_key_push_or_down=function(){var e,t;return e=this.getFieldValue("KEY"),t=this.getFieldValue("POD"),["Input.key_"+t+"?("+e+")",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_input_mouse_push_or_down={init:function(){var e,t;return e=window.SmalrubyEditor.Sensing.MouseButtonDropdown,t=window.SmalrubyEditor.Sensing.PushOrDownDropdown,this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_PREFIX")).appendField(new Blockly.FieldDropdown(e),"MOUSE_BUTTON").appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_MIDDLE")).appendField(new Blockly.FieldDropdown(t),"POD").appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_SUFFIX")),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.sensing_input_mouse_push_or_down=function(){var e,t;return e=this.getFieldValue("MOUSE_BUTTON"),t=this.getFieldValue("POD"),["Input.mouse_"+t+"?("+e+")",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_input_mouse_pos_x={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_MOUSE_POS_X")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.sensing_input_mouse_pos_x=function(){return["Input.mouse_pos_x",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_input_mouse_pos_y={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_INPUT_MOUSE_POS_Y")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.sensing_input_mouse_pos_y=function(){return["Input.mouse_pos_y",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_hit={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_HIT_PREFIX")).appendField(new Smalruby.FieldCharacter,"CHAR").appendField(Smalruby.bm("BLOCKS_SENSING_HIT_SUFFIX")),this.setOutput(!0,"Boolean"),this.setTooltip("")}},Blockly.Ruby.sensing_hit=function(){var e;return e=this.getCharacterFieldValue(),Blockly.Ruby.characterMethodCallInput_("hit?",e)},Blockly.Blocks.sensing_ask={init:function(){return this.setHelpUrl(""),this.setColour(190),this.interpolateMsg("%1と聞いて待つ",["TEXT",["String"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.sensing_ask=function(){var e;return e=Blockly.Ruby.valueToCode(this,"TEXT",Blockly.Ruby.ORDER_NONE)||'""',"ask("+e+")\n"},Blockly.Blocks.sensing_answer={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField("答え"),this.setOutput(!0,"String"),this.setTooltip("")}},Blockly.Ruby.sensing_answer=function(){return["answer",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_timer_count={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField("タイマー"),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.sensing_timer_count=function(){return["timer.count",Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_timer_reset={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField("タイマーをリセット"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.sensing_timer_reset=function(){return"timer.reset\n"},Blockly.Blocks.sensing_character_property={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_X"),"x"],[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_Y"),"y"],[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_ANGLE"),"angle"],[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_COSTUME_INDEX"),"costume_index"],[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_COSTUME"),"costume"],[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_SCALE"),"scale"],[Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY_VOLUME"),"volume"]],this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_SENSING_CHARACTER_PROPERTY"),["CHAR",new Smalruby.FieldCharacter],["PROPERTY",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setOutput(!0,["Number","String"]),this.setTooltip("")}},Blockly.Ruby.sensing_character_property=function(){var e,t,o;return t=this.getCharacterFieldValue(),o=this.getFieldValue("PROPERTY"),e=Smalruby.Collections.CharacterSet.findWhere({name:t}),Blockly.Ruby.characterMethodCallInput_(o,null,{object:e})},Blockly.Blocks.sensing_time_now={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_YEAR"),"year"],[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_MONTH"),"month"],[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_DAY"),"day"],[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_WDAY"),"wday"],[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_HOUR"),"hour"],[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_MIN"),"min"],[Smalruby.bm("BLOCKS_SENSING_TIME_NOW_SEC"),"sec"]],this.setHelpUrl(""),this.setColour(190),this.interpolateMsg(Smalruby.bm("BLOCKS_SENSING_TIME_NOW"),["METHOD",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.sensing_time_now=function(){var e;return e=this.getFieldValue("METHOD"),["Time.now."+e,Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sensing_days_since_2000={init:function(){return this.setHelpUrl(""),this.setColour(190),this.appendDummyInput().appendField(Smalruby.bm("BLOCKS_SENSING_DAYS_SINCE_2000")),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.sensing_days_since_2000=function(){return["(Time.now - Time.mktime(2000, 1, 1)).to_i / 1.day",Blockly.Ruby.ORDER_ATOMIC]}}.call(this),function(){Blockly.Blocks.sound_preset_sounds={init:function(){var e;return e=[[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_DO"),"piano_do.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_RE"),"piano_re.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_MI"),"piano_mi.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_FA"),"piano_fa.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_SO"),"piano_so.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_RA"),"piano_ra.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_SI"),"piano_si.wav"],[Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS_PIANO_DO_2"),"piano_do_2.wav"]],this.setHelpUrl(""),this.setColour(300),this.interpolateMsg(Smalruby.bm("BLOCKS_SOUND_PRESET_SOUNDS"),["NAME",new Blockly.FieldDropdown(e)],Blockly.ALIGN_RIGHT),this.setOutput(!0,"String"),this.setTooltip("")}},Blockly.Ruby.sound_preset_sounds=function(){var e;return e=Blockly.Ruby.quote_(this.getFieldValue("NAME")),[e,Blockly.Ruby.ORDER_ATOMIC]},Blockly.Blocks.sound_play={init:function(){return this.setHelpUrl(""),this.setColour(300),this.interpolateMsg(Smalruby.bm("BLOCKS_SOUND_PLAY"),["NAME",["String"],Blockly.ALIGN_RIGHT],Blockly.ALIGN_RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.sound_play=function(){var e;return e=Blockly.Ruby.valueToCode(this,"NAME",Blockly.Ruby.ORDER_NONE)||"",Blockly.Ruby.characterMethodCall_("play","name: "+e)},Blockly.Blocks.sound_stop={init:function(){return this.setHelpUrl(""),this.setColour(300),this.appendDummyInput().appendField("すべての音を止める"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Blockly.Ruby.sound_stop=function(){return"stop\n"},Blockly.Blocks.sound_volume={init:function(){return this.setHelpUrl(""),this.setColour(300),this.appendDummyInput().appendField("ボリューム"),this.setOutput(!0,"Number"),this.setTooltip("")}},Blockly.Ruby.sound_volume=function(){return["volume",Blockly.Ruby.ORDER_ATOMIC]}}.call(this);
@@ -1 +1 @@
1
- {"files":{"favicon-d958ba1d3efbea2e9a10fda1b5970b6c.ico":{"logical_path":"favicon.ico","mtime":"2014-12-02T18:24:29+09:00","size":5430,"digest":"d958ba1d3efbea2e9a10fda1b5970b6c"},"application-eece3e01e35f8f689e2e282a168f6059.js":{"logical_path":"application.js","mtime":"2015-02-15T00:36:24+09:00","size":1295775,"digest":"eece3e01e35f8f689e2e282a168f6059"},"msg/en_us-3eb2f104a6bad9c60226ff7475013874.js":{"logical_path":"msg/en_us.js","mtime":"2015-02-10T21:16:07+09:00","size":15082,"digest":"3eb2f104a6bad9c60226ff7475013874"},"msg/ja-8450d011b1f093dc4b6b7c467e5bcae4.js":{"logical_path":"msg/ja.js","mtime":"2015-02-10T10:51:50+09:00","size":17575,"digest":"8450d011b1f093dc4b6b7c467e5bcae4"},"application-c196e243630d74071981a16041bf391d.css":{"logical_path":"application.css","mtime":"2015-02-10T21:16:07+09:00","size":91728,"digest":"c196e243630d74071981a16041bf391d"},"toolbox_default-e023d3f7a2cc7cc1f54a1224577b3c26.css":{"logical_path":"toolbox_default.css","mtime":"2015-01-28T14:52:57+09:00","size":2023,"digest":"e023d3f7a2cc7cc1f54a1224577b3c26"},"toolbox_raspberrypi-c25b8ac975fbc79031ecf87e74027694.css":{"logical_path":"toolbox_raspberrypi.css","mtime":"2015-02-10T23:24:46+09:00","size":1617,"digest":"c25b8ac975fbc79031ecf87e74027694"},"toolbox_smalrubot_s1-9af26ff13d4496890c4a391f65f95bcd.css":{"logical_path":"toolbox_smalrubot_s1.css","mtime":"2015-02-10T10:14:17+09:00","size":1617,"digest":"9af26ff13d4496890c4a391f65f95bcd"},"toolbox_smalrubot_v3-9af26ff13d4496890c4a391f65f95bcd.css":{"logical_path":"toolbox_smalrubot_v3.css","mtime":"2015-01-28T15:40:59+09:00","size":1617,"digest":"9af26ff13d4496890c4a391f65f95bcd"},"blockly/msg/js/en_us-d5e1938b2d57c1df954f4411b9165d10.js":{"logical_path":"blockly/msg/js/en_us.js","mtime":"2015-02-01T20:49:20+09:00","size":25865,"digest":"d5e1938b2d57c1df954f4411b9165d10"},"blockly/msg/js/ja-9f676d46458a2802b8f5a797c90ae8a4.js":{"logical_path":"blockly/msg/js/ja.js","mtime":"2015-02-01T20:49:20+09:00","size":31319,"digest":"9f676d46458a2802b8f5a797c90ae8a4"},"jquery-ui/animated-overlay-9b629ab5247187e831ea51106acdf03a.gif":{"logical_path":"jquery-ui/animated-overlay.gif","mtime":"2015-01-11T23:15:23+09:00","size":1738,"digest":"9b629ab5247187e831ea51106acdf03a"},"jquery-ui/ui-bg_flat_0_aaaaaa_40x100-e055bc219bd3aed111713c2ef884d6f4.png":{"logical_path":"jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png","mtime":"2015-01-11T23:15:23+09:00","size":180,"digest":"e055bc219bd3aed111713c2ef884d6f4"},"jquery-ui/ui-bg_flat_75_ffffff_40x100-1ed964fd6a424fc2d8653d5a64705840.png":{"logical_path":"jquery-ui/ui-bg_flat_75_ffffff_40x100.png","mtime":"2015-01-11T23:15:23+09:00","size":178,"digest":"1ed964fd6a424fc2d8653d5a64705840"},"jquery-ui/ui-bg_glass_55_fbf9ee_1x400-c47b4313972b0311e02e671fd15a66c9.png":{"logical_path":"jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png","mtime":"2015-01-11T23:15:23+09:00","size":120,"digest":"c47b4313972b0311e02e671fd15a66c9"},"jquery-ui/ui-bg_glass_65_ffffff_1x400-4b5173f329e3e9fbfcfcc88a84920e81.png":{"logical_path":"jquery-ui/ui-bg_glass_65_ffffff_1x400.png","mtime":"2015-01-11T23:15:23+09:00","size":105,"digest":"4b5173f329e3e9fbfcfcc88a84920e81"},"jquery-ui/ui-bg_glass_75_dadada_1x400-b0155cdc12d3bcdfa7f4890938366181.png":{"logical_path":"jquery-ui/ui-bg_glass_75_dadada_1x400.png","mtime":"2015-01-11T23:15:23+09:00","size":111,"digest":"b0155cdc12d3bcdfa7f4890938366181"},"jquery-ui/ui-bg_glass_75_e6e6e6_1x400-21014afa81b0fea76840432b22d9d0e5.png":{"logical_path":"jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png","mtime":"2015-01-11T23:15:23+09:00","size":110,"digest":"21014afa81b0fea76840432b22d9d0e5"},"jquery-ui/ui-bg_glass_95_fef1ec_1x400-6526cba95388d3f36f03cc6296f192b5.png":{"logical_path":"jquery-ui/ui-bg_glass_95_fef1ec_1x400.png","mtime":"2015-01-11T23:15:23+09:00","size":119,"digest":"6526cba95388d3f36f03cc6296f192b5"},"jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100-f0e42cc2ef6523f77aa730753cff0462.png":{"logical_path":"jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png","mtime":"2015-01-11T23:15:23+09:00","size":101,"digest":"f0e42cc2ef6523f77aa730753cff0462"},"jquery-ui/ui-icons_222222_256x240-d5b2a50ddba8e90f9487cc29efbc9080.png":{"logical_path":"jquery-ui/ui-icons_222222_256x240.png","mtime":"2015-01-11T23:15:23+09:00","size":4369,"digest":"d5b2a50ddba8e90f9487cc29efbc9080"},"jquery-ui/ui-icons_2e83ff_256x240-735b447c0a9f42ce6836a1e74aad6f23.png":{"logical_path":"jquery-ui/ui-icons_2e83ff_256x240.png","mtime":"2015-01-11T23:15:23+09:00","size":4369,"digest":"735b447c0a9f42ce6836a1e74aad6f23"},"jquery-ui/ui-icons_454545_256x240-ed3057724414ea20ff7bae1cdb644aca.png":{"logical_path":"jquery-ui/ui-icons_454545_256x240.png","mtime":"2015-01-11T23:15:23+09:00","size":4369,"digest":"ed3057724414ea20ff7bae1cdb644aca"},"jquery-ui/ui-icons_888888_256x240-ce584ffa171c3ea9a018cf0d7bec65c8.png":{"logical_path":"jquery-ui/ui-icons_888888_256x240.png","mtime":"2015-01-11T23:15:23+09:00","size":4369,"digest":"ce584ffa171c3ea9a018cf0d7bec65c8"},"jquery-ui/ui-icons_cd0a0a_256x240-747e96029e8dedcabc224e5f7d1f2ede.png":{"logical_path":"jquery-ui/ui-icons_cd0a0a_256x240.png","mtime":"2015-01-11T23:15:23+09:00","size":4369,"digest":"747e96029e8dedcabc224e5f7d1f2ede"},"loading-e77296be32d066d3e29d3bf9803fa417.gif":{"logical_path":"loading.gif","mtime":"2015-01-11T23:11:45+09:00","size":3897,"digest":"e77296be32d066d3e29d3bf9803fa417"},"progressbar-ee8fb1222f286f625bbf7332844a6a0c.gif":{"logical_path":"progressbar.gif","mtime":"2015-01-11T23:11:45+09:00","size":3323,"digest":"ee8fb1222f286f625bbf7332844a6a0c"}},"assets":{"favicon.ico":"favicon-d958ba1d3efbea2e9a10fda1b5970b6c.ico","application.js":"application-eece3e01e35f8f689e2e282a168f6059.js","msg/en_us.js":"msg/en_us-3eb2f104a6bad9c60226ff7475013874.js","msg/ja.js":"msg/ja-8450d011b1f093dc4b6b7c467e5bcae4.js","application.css":"application-c196e243630d74071981a16041bf391d.css","toolbox_default.css":"toolbox_default-e023d3f7a2cc7cc1f54a1224577b3c26.css","toolbox_raspberrypi.css":"toolbox_raspberrypi-c25b8ac975fbc79031ecf87e74027694.css","toolbox_smalrubot_s1.css":"toolbox_smalrubot_s1-9af26ff13d4496890c4a391f65f95bcd.css","toolbox_smalrubot_v3.css":"toolbox_smalrubot_v3-9af26ff13d4496890c4a391f65f95bcd.css","blockly/msg/js/en_us.js":"blockly/msg/js/en_us-d5e1938b2d57c1df954f4411b9165d10.js","blockly/msg/js/ja.js":"blockly/msg/js/ja-9f676d46458a2802b8f5a797c90ae8a4.js","jquery-ui/animated-overlay.gif":"jquery-ui/animated-overlay-9b629ab5247187e831ea51106acdf03a.gif","jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png":"jquery-ui/ui-bg_flat_0_aaaaaa_40x100-e055bc219bd3aed111713c2ef884d6f4.png","jquery-ui/ui-bg_flat_75_ffffff_40x100.png":"jquery-ui/ui-bg_flat_75_ffffff_40x100-1ed964fd6a424fc2d8653d5a64705840.png","jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png":"jquery-ui/ui-bg_glass_55_fbf9ee_1x400-c47b4313972b0311e02e671fd15a66c9.png","jquery-ui/ui-bg_glass_65_ffffff_1x400.png":"jquery-ui/ui-bg_glass_65_ffffff_1x400-4b5173f329e3e9fbfcfcc88a84920e81.png","jquery-ui/ui-bg_glass_75_dadada_1x400.png":"jquery-ui/ui-bg_glass_75_dadada_1x400-b0155cdc12d3bcdfa7f4890938366181.png","jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png":"jquery-ui/ui-bg_glass_75_e6e6e6_1x400-21014afa81b0fea76840432b22d9d0e5.png","jquery-ui/ui-bg_glass_95_fef1ec_1x400.png":"jquery-ui/ui-bg_glass_95_fef1ec_1x400-6526cba95388d3f36f03cc6296f192b5.png","jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png":"jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100-f0e42cc2ef6523f77aa730753cff0462.png","jquery-ui/ui-icons_222222_256x240.png":"jquery-ui/ui-icons_222222_256x240-d5b2a50ddba8e90f9487cc29efbc9080.png","jquery-ui/ui-icons_2e83ff_256x240.png":"jquery-ui/ui-icons_2e83ff_256x240-735b447c0a9f42ce6836a1e74aad6f23.png","jquery-ui/ui-icons_454545_256x240.png":"jquery-ui/ui-icons_454545_256x240-ed3057724414ea20ff7bae1cdb644aca.png","jquery-ui/ui-icons_888888_256x240.png":"jquery-ui/ui-icons_888888_256x240-ce584ffa171c3ea9a018cf0d7bec65c8.png","jquery-ui/ui-icons_cd0a0a_256x240.png":"jquery-ui/ui-icons_cd0a0a_256x240-747e96029e8dedcabc224e5f7d1f2ede.png","loading.gif":"loading-e77296be32d066d3e29d3bf9803fa417.gif","progressbar.gif":"progressbar-ee8fb1222f286f625bbf7332844a6a0c.gif"}}
1
+ {"files":{"favicon-d958ba1d3efbea2e9a10fda1b5970b6c.ico":{"logical_path":"favicon.ico","mtime":"2014-12-02T18:24:29+09:00","size":5430,"digest":"d958ba1d3efbea2e9a10fda1b5970b6c"},"application-e64da116c4adad30e499acda9d657fb5.js":{"logical_path":"application.js","mtime":"2015-05-13T16:07:56+09:00","size":1295021,"digest":"e64da116c4adad30e499acda9d657fb5"},"msg/en_us-a3f6b99f4b54cfaeed42452de11ab02e.js":{"logical_path":"msg/en_us.js","mtime":"2015-03-15T11:42:00+09:00","size":14971,"digest":"a3f6b99f4b54cfaeed42452de11ab02e"},"msg/ja-9323664964a9b8ede99ae16c43db5827.js":{"logical_path":"msg/ja.js","mtime":"2015-04-28T09:43:02+09:00","size":17493,"digest":"9323664964a9b8ede99ae16c43db5827"},"application-c196e243630d74071981a16041bf391d.css":{"logical_path":"application.css","mtime":"2015-02-10T21:16:07+09:00","size":91728,"digest":"c196e243630d74071981a16041bf391d"},"toolbox_default-e023d3f7a2cc7cc1f54a1224577b3c26.css":{"logical_path":"toolbox_default.css","mtime":"2015-01-28T14:52:57+09:00","size":2023,"digest":"e023d3f7a2cc7cc1f54a1224577b3c26"},"toolbox_raspberrypi-c25b8ac975fbc79031ecf87e74027694.css":{"logical_path":"toolbox_raspberrypi.css","mtime":"2015-02-10T23:24:46+09:00","size":1617,"digest":"c25b8ac975fbc79031ecf87e74027694"},"toolbox_smalrubot_s1-9af26ff13d4496890c4a391f65f95bcd.css":{"logical_path":"toolbox_smalrubot_s1.css","mtime":"2015-02-10T10:14:17+09:00","size":1617,"digest":"9af26ff13d4496890c4a391f65f95bcd"},"toolbox_smalrubot_v3-9af26ff13d4496890c4a391f65f95bcd.css":{"logical_path":"toolbox_smalrubot_v3.css","mtime":"2015-01-28T15:40:59+09:00","size":1617,"digest":"9af26ff13d4496890c4a391f65f95bcd"},"blockly/msg/js/en_us-d5e1938b2d57c1df954f4411b9165d10.js":{"logical_path":"blockly/msg/js/en_us.js","mtime":"2015-02-01T20:49:20+09:00","size":25865,"digest":"d5e1938b2d57c1df954f4411b9165d10"},"blockly/msg/js/ja-9f676d46458a2802b8f5a797c90ae8a4.js":{"logical_path":"blockly/msg/js/ja.js","mtime":"2015-02-01T20:49:20+09:00","size":31319,"digest":"9f676d46458a2802b8f5a797c90ae8a4"},"jquery-ui/animated-overlay-9b629ab5247187e831ea51106acdf03a.gif":{"logical_path":"jquery-ui/animated-overlay.gif","mtime":"2015-01-11T23:15:23+09:00","size":1738,"digest":"9b629ab5247187e831ea51106acdf03a"},"jquery-ui/ui-bg_flat_0_aaaaaa_40x100-e055bc219bd3aed111713c2ef884d6f4.png":{"logical_path":"jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png","mtime":"2015-01-11T23:15:23+09:00","size":180,"digest":"e055bc219bd3aed111713c2ef884d6f4"},"jquery-ui/ui-bg_flat_75_ffffff_40x100-1ed964fd6a424fc2d8653d5a64705840.png":{"logical_path":"jquery-ui/ui-bg_flat_75_ffffff_40x100.png","mtime":"2015-01-11T23:15:23+09:00","size":178,"digest":"1ed964fd6a424fc2d8653d5a64705840"},"jquery-ui/ui-bg_glass_55_fbf9ee_1x400-c47b4313972b0311e02e671fd15a66c9.png":{"logical_path":"jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png","mtime":"2015-01-11T23:15:23+09:00","size":120,"digest":"c47b4313972b0311e02e671fd15a66c9"},"jquery-ui/ui-bg_glass_65_ffffff_1x400-4b5173f329e3e9fbfcfcc88a84920e81.png":{"logical_path":"jquery-ui/ui-bg_glass_65_ffffff_1x400.png","mtime":"2015-01-11T23:15:23+09:00","size":105,"digest":"4b5173f329e3e9fbfcfcc88a84920e81"},"jquery-ui/ui-bg_glass_75_dadada_1x400-b0155cdc12d3bcdfa7f4890938366181.png":{"logical_path":"jquery-ui/ui-bg_glass_75_dadada_1x400.png","mtime":"2015-01-11T23:15:23+09:00","size":111,"digest":"b0155cdc12d3bcdfa7f4890938366181"},"jquery-ui/ui-bg_glass_75_e6e6e6_1x400-21014afa81b0fea76840432b22d9d0e5.png":{"logical_path":"jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png","mtime":"2015-01-11T23:15:23+09:00","size":110,"digest":"21014afa81b0fea76840432b22d9d0e5"},"jquery-ui/ui-bg_glass_95_fef1ec_1x400-6526cba95388d3f36f03cc6296f192b5.png":{"logical_path":"jquery-ui/ui-bg_glass_95_fef1ec_1x400.png","mtime":"2015-01-11T23:15:23+09:00","size":119,"digest":"6526cba95388d3f36f03cc6296f192b5"},"jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100-f0e42cc2ef6523f77aa730753cff0462.png":{"logical_path":"jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png","mtime":"2015-01-11T23:15:23+09:00","size":101,"digest":"f0e42cc2ef6523f77aa730753cff0462"},"jquery-ui/ui-icons_222222_256x240-d5b2a50ddba8e90f9487cc29efbc9080.png":{"logical_path":"jquery-ui/ui-icons_222222_256x240.png","mtime":"2015-01-11T23:15:23+09:00","size":4369,"digest":"d5b2a50ddba8e90f9487cc29efbc9080"},"jquery-ui/ui-icons_2e83ff_256x240-735b447c0a9f42ce6836a1e74aad6f23.png":{"logical_path":"jquery-ui/ui-icons_2e83ff_256x240.png","mtime":"2015-01-11T23:15:23+09:00","size":4369,"digest":"735b447c0a9f42ce6836a1e74aad6f23"},"jquery-ui/ui-icons_454545_256x240-ed3057724414ea20ff7bae1cdb644aca.png":{"logical_path":"jquery-ui/ui-icons_454545_256x240.png","mtime":"2015-01-11T23:15:23+09:00","size":4369,"digest":"ed3057724414ea20ff7bae1cdb644aca"},"jquery-ui/ui-icons_888888_256x240-ce584ffa171c3ea9a018cf0d7bec65c8.png":{"logical_path":"jquery-ui/ui-icons_888888_256x240.png","mtime":"2015-01-11T23:15:23+09:00","size":4369,"digest":"ce584ffa171c3ea9a018cf0d7bec65c8"},"jquery-ui/ui-icons_cd0a0a_256x240-747e96029e8dedcabc224e5f7d1f2ede.png":{"logical_path":"jquery-ui/ui-icons_cd0a0a_256x240.png","mtime":"2015-01-11T23:15:23+09:00","size":4369,"digest":"747e96029e8dedcabc224e5f7d1f2ede"},"loading-e77296be32d066d3e29d3bf9803fa417.gif":{"logical_path":"loading.gif","mtime":"2015-05-13T15:34:45+09:00","size":3897,"digest":"e77296be32d066d3e29d3bf9803fa417"},"progressbar-ee8fb1222f286f625bbf7332844a6a0c.gif":{"logical_path":"progressbar.gif","mtime":"2015-05-13T15:34:45+09:00","size":3323,"digest":"ee8fb1222f286f625bbf7332844a6a0c"}},"assets":{"favicon.ico":"favicon-d958ba1d3efbea2e9a10fda1b5970b6c.ico","application.js":"application-e64da116c4adad30e499acda9d657fb5.js","msg/en_us.js":"msg/en_us-a3f6b99f4b54cfaeed42452de11ab02e.js","msg/ja.js":"msg/ja-9323664964a9b8ede99ae16c43db5827.js","application.css":"application-c196e243630d74071981a16041bf391d.css","toolbox_default.css":"toolbox_default-e023d3f7a2cc7cc1f54a1224577b3c26.css","toolbox_raspberrypi.css":"toolbox_raspberrypi-c25b8ac975fbc79031ecf87e74027694.css","toolbox_smalrubot_s1.css":"toolbox_smalrubot_s1-9af26ff13d4496890c4a391f65f95bcd.css","toolbox_smalrubot_v3.css":"toolbox_smalrubot_v3-9af26ff13d4496890c4a391f65f95bcd.css","blockly/msg/js/en_us.js":"blockly/msg/js/en_us-d5e1938b2d57c1df954f4411b9165d10.js","blockly/msg/js/ja.js":"blockly/msg/js/ja-9f676d46458a2802b8f5a797c90ae8a4.js","jquery-ui/animated-overlay.gif":"jquery-ui/animated-overlay-9b629ab5247187e831ea51106acdf03a.gif","jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png":"jquery-ui/ui-bg_flat_0_aaaaaa_40x100-e055bc219bd3aed111713c2ef884d6f4.png","jquery-ui/ui-bg_flat_75_ffffff_40x100.png":"jquery-ui/ui-bg_flat_75_ffffff_40x100-1ed964fd6a424fc2d8653d5a64705840.png","jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png":"jquery-ui/ui-bg_glass_55_fbf9ee_1x400-c47b4313972b0311e02e671fd15a66c9.png","jquery-ui/ui-bg_glass_65_ffffff_1x400.png":"jquery-ui/ui-bg_glass_65_ffffff_1x400-4b5173f329e3e9fbfcfcc88a84920e81.png","jquery-ui/ui-bg_glass_75_dadada_1x400.png":"jquery-ui/ui-bg_glass_75_dadada_1x400-b0155cdc12d3bcdfa7f4890938366181.png","jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png":"jquery-ui/ui-bg_glass_75_e6e6e6_1x400-21014afa81b0fea76840432b22d9d0e5.png","jquery-ui/ui-bg_glass_95_fef1ec_1x400.png":"jquery-ui/ui-bg_glass_95_fef1ec_1x400-6526cba95388d3f36f03cc6296f192b5.png","jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png":"jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100-f0e42cc2ef6523f77aa730753cff0462.png","jquery-ui/ui-icons_222222_256x240.png":"jquery-ui/ui-icons_222222_256x240-d5b2a50ddba8e90f9487cc29efbc9080.png","jquery-ui/ui-icons_2e83ff_256x240.png":"jquery-ui/ui-icons_2e83ff_256x240-735b447c0a9f42ce6836a1e74aad6f23.png","jquery-ui/ui-icons_454545_256x240.png":"jquery-ui/ui-icons_454545_256x240-ed3057724414ea20ff7bae1cdb644aca.png","jquery-ui/ui-icons_888888_256x240.png":"jquery-ui/ui-icons_888888_256x240-ce584ffa171c3ea9a018cf0d7bec65c8.png","jquery-ui/ui-icons_cd0a0a_256x240.png":"jquery-ui/ui-icons_cd0a0a_256x240-747e96029e8dedcabc224e5f7d1f2ede.png","loading.gif":"loading-e77296be32d066d3e29d3bf9803fa417.gif","progressbar.gif":"progressbar-ee8fb1222f286f625bbf7332844a6a0c.gif"}}
@@ -1 +1 @@
1
- goog.provide("Blockly.Msg.en_us.smalruby"),goog.require("Blockly.Msg"),Blockly.Msg.COMMON_TURN_ON="turn on",Blockly.Msg.COMMON_TURN_OFF="turn off",Blockly.Msg.COMMON_FORWARD="forward",Blockly.Msg.COMMON_BACKWARD="backward",Blockly.Msg.COMMON_TURN_LEFT="turn left",Blockly.Msg.COMMON_TURN_RIGHT="turn right",Blockly.Msg.COMMON_STOP="stop",Blockly.Msg.COMMON_ERROR="Error",Blockly.Msg.COLOUR_RED="red",Blockly.Msg.COLOUR_GREEN="green",Blockly.Msg.COLOUR_BLUE="blue",Blockly.Msg.COLOUR_WHITE="white",Blockly.Msg.SMALRUBY_WILL_DISAPPER_YOUR_PROGRAM="Disappear your program!",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_COMMON_LINES=" Lines",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_COMMON_LETTERS=" Letters",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_COMMON_COMMA=", ",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_COMMON_CONFIRM_OVERWRITE="Are you sure to save?\nBecause you saved as {$filename}, so that will disappear, if you will save!",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_BLOCKUI_TITLE="Converting Program",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_BLOCKUI_MESSAGE="Converting your program to instruction blocks.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_ERROR="Can't convert your program to instruction blocks.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_TITLE="Running",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_MESSAGE="Please switch your program's window.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_NOTICE="Running your program after save & check it.<br>Press ESC key to quit.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_ERROR_CANT_RUN="Can't run your program.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_ERROR_CANCEL_TO_RUN="Cancel to run your program.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_DOWNLOAD_BLOCKUI_TITLE="Downloading",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_DOWNLOAD_BLOCKUI_MESSAGE="Downloading your program.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_DOWNLOAD_SUCCEEDED='Downloaded.<br>You can run with "ruby {$filename}" on windows or "rsdl {$filename}" on Mac OS X.',Blockly.Msg.VIEWS_MAIN_MENU_VIEW_DOWNLOAD_ERROR="Can't download",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_LOAD_CONFIRM="Your program will disappear, because you didn't save it! Are you sure to load?",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_ERROR_NO_NAME="You must set program name before you save it!",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_TITLE="Saving your program",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_MESSAGE="Now, saving your program.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_NOTICE='Your program name is "{$filename}".<br>It will be saved at home directory.<br>',Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_ERROR_MESSAGE="Can't save your program.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_CANCELED="Canceled to save.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_SUCCEEDED="Saved.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_TITLE="Checking your program",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_MESSAGE="Now, checking syntax of your program.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_NOTICE="This is only checking syntax, so you will find error when you run it.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_SUCCEEDED="Checked.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_SUCCEEDED_NOTICE="Your program was checked only syntax, so you will find error when you run it.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_ERROR="Can't check.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SIGNOUT_SUCCEEDED="Logouted.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SIGNOUT_ERROR="Can't logout.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_LOAD_ERROR="{$filename}{$error}",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_LOAD_SUCCEEDED="Loaded.",Blockly.Msg.VIEWS_LOAD_MODAL_VIEW_ERROR="Can't load the program.",Blockly.Msg.VIEWS_SIGNIN_MODAL_VIEW_SIGNED_IN="Logged in.",Blockly.Msg.VIEWS_SIGNIN_MODAL_VIEW_ERROR="Can't login.",Blockly.Msg.BLOCKS_MOTION_MOVE="move %1 steps",Blockly.Msg.BLOCKS_MOTION_TURN_RIGHT_DEGREES="turn right %1 degrees",Blockly.Msg.BLOCKS_MOTION_TURN_LEFT_DEGREES="turn left %1 degrees",Blockly.Msg.BLOCKS_MOTION_POINT_IN_DIRECTION="point in direction %1",Blockly.Msg.BLOCKS_MOTION_POINT_TOWARDS_MOUSE="point towards mouse-pointer",Blockly.Msg.BLOCKS_MOTION_POINT_TOWARDS_CHARACTER="point towards %1",Blockly.Msg.BLOCKS_MOTION_SET_X_Y="go to x: %1 y: %2",Blockly.Msg.BLOCKS_MOTION_GO_TO_MOUSE="go to mouse-pointer",Blockly.Msg.BLOCKS_MOTION_GO_TO_CHARACTER="go to %1",Blockly.Msg.BLOCKS_MOTION_CHANGE_X_BY="change x by %1",Blockly.Msg.BLOCKS_MOTION_SET_X="set x to %1",Blockly.Msg.BLOCKS_MOTION_CHANGE_Y_BY="change y by %1",Blockly.Msg.BLOCKS_MOTION_SET_Y="set y to %1",Blockly.Msg.BLOCKS_MOTION_TURN_IF_REACH_WALL="if reach wall, turn",Blockly.Msg.BLOCKS_MOTION_TURN="turn",Blockly.Msg.BLOCKS_MOTION_TURN_XY_X="(x) horizontal",Blockly.Msg.BLOCKS_MOTION_TURN_XY_Y="(y) vertical",Blockly.Msg.BLOCKS_MOTION_TURN_XY="turn to %1",Blockly.Msg.BLOCKS_MOTION_SET_ROTATION_STYLE="set rotation style %1",Blockly.Msg.BLOCKS_MOTION_SET_ROTATION_STYLE_LEFT_RIGHT="left-right",Blockly.Msg.BLOCKS_MOTION_SET_ROTATION_STYLE_NONE="don't rorate",Blockly.Msg.BLOCKS_MOTION_SET_ROTATION_STYLE_FREE="all around",Blockly.Msg.BLOCKS_MOTION_SELF_X="x position",Blockly.Msg.BLOCKS_MOTION_SELF_Y="y position",Blockly.Msg.BLOCKS_MOTION_SELF_ANGLE="direction",Blockly.Msg.BLOCKS_EVENTS_ON_START="when Run clicked",Blockly.Msg.BLOCKS_EVENTS_ON_KEY_PUSH_OR_DOWN="when %1 key %2",Blockly.Msg.BLOCKS_EVENTS_ON_CLICK="when this sprite clicked",Blockly.Msg.BLOCKS_EVENTS_ON_HIT="when %1 hit",Blockly.Msg.BLOCKS_SENSING_K_UP="up arrow",Blockly.Msg.BLOCKS_SENSING_K_DOWN="down arrow",Blockly.Msg.BLOCKS_SENSING_K_LEFT="left arrow",Blockly.Msg.BLOCKS_SENSING_K_RIGHT="right arrow",Blockly.Msg.BLOCKS_SENSING_K_SPACE="space",Blockly.Msg.BLOCKS_SENSING_PRESSED="pressed",Blockly.Msg.BLOCKS_SENSING_PUSH=Blockly.Msg.BLOCKS_SENSING_PRESSED,Blockly.Msg.BLOCKS_SENSING_DOWN=Blockly.Msg.BLOCKS_SENSING_PRESSED,Blockly.Msg.BLOCKS_SENSING_HOLD_PRESSED="hold pressed",Blockly.Msg.BLOCKS_SENSING_HOLD_DOWN=Blockly.Msg.BLOCKS_SENSING_HOLD_PRESSED,Blockly.Msg.BLOCKS_SENSING_M_LBUTTON="left-button",Blockly.Msg.BLOCKS_SENSING_M_MBUTTON="middle-button",Blockly.Msg.BLOCKS_SENSING_M_RBUTTON="right-button",Blockly.Msg.BLOCKS_SENSING_RELEASED="released",Blockly.Msg.BLOCKS_SENSING_UP=Blockly.Msg.BLOCKS_SENSING_RELEASED,Blockly.Msg.BLOCKS_SENSING_REACH_WALL="reach wall?",Blockly.Msg.BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_PREFIX="key ",Blockly.Msg.BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_MIDDLE=" ",Blockly.Msg.BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_SUFFIX="",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_PREFIX="mouse ",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_MIDDLE=" ",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_SUFFIX="",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_POS_X="mouse x",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_POS_Y="mouse y",Blockly.Msg.BLOCKS_SENSING_HIT_PREFIX="reach ",Blockly.Msg.BLOCKS_SENSING_HIT_SUFFIX="?",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_X="x position",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_Y="y position",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_ANGLE="direction",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_COSTUME_INDEX="costume #",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_COSTUME="contume name",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_SCALE="size",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_VOLUME="volume",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY="%2 of %1",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_YEAR="year",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_MONTH="month",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_DAY="day",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_WDAY="day of week",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_HOUR="hour",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_MIN="min",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_SEC="sec",Blockly.Msg.BLOCKS_SENSING_TIME_NOW="current ",Blockly.Msg.BLOCKS_SENSING_DAYS_SINCE_2000="days since 2000",Blockly.Msg.BLOCKS_CONTROL_SLEEP="wait %1 secs",Blockly.Msg.BLOCKS_CONTROL_LOOP="loop",Blockly.Msg.BLOCKS_CONTROL_LOOP_END="end of loop",Blockly.Msg.BLOCKS_CONTROL_BREAK="stop this loop",Blockly.Msg.BLOCKS_CONTROL_NEXT="next iteration of this loop",Blockly.Msg.BLOCKS_CONTROL_REDO="redo iteration of this loop",Blockly.Msg.BLOCKS_CONTROL_IF="if ",Blockly.Msg.BLOCKS_CONTROL_THEN=" then",Blockly.Msg.BLOCKS_CONTROL_ELSE="else",Blockly.Msg.BLOCKS_CONTROL_TIMES="repeat %1",Blockly.Msg.BLOCKS_CONTROL_AWAIT_UNTIL="wait until %1",Blockly.Msg.BLOCKS_CONTROL_UNTIL="repeat until %1",Blockly.Msg.BLOCKS_CONTROL_AWAIT="just wait a little",Blockly.Msg.BLOCKS_RUBY_STATEMENT="statement ",Blockly.Msg.BLOCKS_RUBY_EXPRESSION="expression ",Blockly.Msg.BLOCKS_RUBY_COMMENT="comment ",Blockly.Msg.BLOCKS_RUBY_P="p %1",Blockly.Msg.BLOCKS_FIELD_CHARACTER_NO_CHARACTER="no character",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS="%1",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_DO="Middle C of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_RE="D of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_MI="E of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_FA="F of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_SO="G of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_RA="A of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_SI="B of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_DO_2="High C of piano",Blockly.Msg.BLOCKS_SOUND_PLAY="play sound %1",Blockly.Msg.BLOCKS_LOOKS_SAY="say %1",Blockly.Msg.BLOCKS_LOOKS_THINK="think %1",Blockly.Msg.BLOCKS_LOOKS_SAY_WITH_SECOND="say %1 for %2 secs",Blockly.Msg.BLOCKS_LOOKS_THINK_WITH_SECOND="think %1 for %2 secs",Blockly.Msg.BLOCKS_LOOKS_SHOW="show",Blockly.Msg.BLOCKS_LOOKS_HIDE="hide",Blockly.Msg.BLOCKS_LOOKS_VANISH="vanish",Blockly.Msg.BLOCKS_HARDWARE_LED_TURN_ON="turn on LED %1",Blockly.Msg.BLOCKS_HARDWARE_LED_TURN_OFF="turn off LED %1",Blockly.Msg.BLOCKS_HARDWARE_ANODE="anode",Blockly.Msg.BLOCKS_HARDWARE_CATHODE="cathode",Blockly.Msg.BLOCKS_HARDWARE_LEFT="left",Blockly.Msg.BLOCKS_HARDWARE_RIGHT="right",Blockly.Msg.BLOCKS_HARDWARE_INIT_HARDWARE="setup hardware",Blockly.Msg.BLOCKS_HARDWARE_RGB_LED_SET_COLOR="set RGB LED %1 common %2 color to %3",Blockly.Msg.BLOCKS_HARDWARE_RGB_LED_TURN_OFF="turn off RGB LED %1 common %2",Blockly.Msg.BLOCKS_HARDWARE_SEVEN_SEGMENT_DISPLAY_SHOW="show 7 segment display %1",Blockly.Msg.BLOCKS_HARDWARE_SEVEN_SEGMENT_DISPLAY_OFF="turn off 7 segment display",Blockly.Msg.BLOCKS_HARDWARE_LCD_PUTS="display %1 on the LCD",Blockly.Msg.BLOCKS_HARDWARE_LCD_CLEAR="clear LCD",Blockly.Msg.BLOCKS_HARDWARE_SERVO_SET_POSITION="servo motor %1 set %2 degree (5-180)",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS="%1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_FORWARD="forward 2WD car %1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_BACKWARD="backward 2WD car %1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_TURN_LEFT="turn left 2WD car %1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_TURN_RIGHT="turn right 2WD car %1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_STOP="stop 2WD car %1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_RUN="%1 2WD car %2 %3 secs",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_FORWARD="forward",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_BACKWARD="backward",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_TURN_LEFT="turn left",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_TURN_RIGHT="turn right",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_STOP="stop",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_SET_SPEED="set 2WD car %1 's %2 motor speed to %3 %",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_SPEED="2WD car %1 's %2 motor speed (%)",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_FORWARD="forward",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_BACKWARD="backward",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_STOP="stop",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER="%2 (motor driver %1's) motor",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_SET_SPEED="set (motor driver %1's) motor speed to %2 %",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_SPEED="(motor driver %1's) motor speed (%)",Blockly.Msg.BLOCKS_HARDWARE_BUTTON_PRESSED_OR_RELEASED="button %1 %2 ?",Blockly.Msg.BLOCKS_HARDWARE_SENSOR_VALUE="sensor %1 value",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_LED_TURN_ON_OR_OFF="%2 Smalrubot v3 %1 LED",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_MOTOR_SPEED="Smalrubot v3 %1 motor speed",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_MOTOR_SET_SPEED="set Smalrubot v3 %1 motor speed to %2 %",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_ACTION="%1 Smalrubot v3",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_ACTION_WITH_SEC="%1 Smalrubot v3 for %2 secs",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_TOUCH_SENSOR_PRESSED_OR_RELEASED="Smalrubot v3 %1 touch sensor %2 ?",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_LIGHT_SENSOR_VALUE="Smalrubot v3 light sensor value",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_LED_TURN_ON_OR_OFF="%2 Smalrubot s1 %1 LED",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_ACTION="%1 Smalrubot s1",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_ACTION_WITH_SEC="%1 Smalrubot s1 for %2 secs",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_IR_PHOTOREFLECTOR_VALUE="Smalrubot s1 %1 IR Photoreflector",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_DC_MOTOR_POWER_RATIO="Smalrubot s1 %1 dc motor power ratio",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_DC_MOTOR_SET_POWER_RATIO="set Smalrubot s1 %1 dc motor power ratio to %2 %",Blockly.Msg.BLOCKS_OPERATORS_ADD="%1 + %2",Blockly.Msg.BLOCKS_OPERATORS_MINUS="%1 - %2",Blockly.Msg.BLOCKS_OPERATORS_MULTIPLY="%1 * %2",Blockly.Msg.BLOCKS_OPERATORS_DIVIDE="%1 / %2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_LT="%1 < %2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_LTE="%1 <= %2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_EQ="%1 = %2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_GTE="%1 >= %2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_GT="%1 > %2",Blockly.Msg.BLOCKS_OPERATORS_RAND="pick random %1 to %2",Blockly.Msg.BLOCKS_OPERATORS_AND="%1 and %2",Blockly.Msg.BLOCKS_OPERATORS_OR="%1 or %2",Blockly.Msg.BLOCKS_OPERATORS_NOT="not %1",Blockly.Msg.BLOCKS_OPERATORS_INDEX_OF="letter %1 of %2",Blockly.Msg.BLOCKS_OPERATORS_LENGTH="length of %1",Blockly.Msg.BLOCKS_OPERATORS_MODULO="%1 mod %2",Blockly.Msg.BLOCKS_OPERATORS_ROUND="round %1",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD="%1 of %2",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_ABS="abs",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_FLOOR="floor",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_CEIL="ceiling",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_SQRT="sqrt",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_SIN="sin",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_COS="cos",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_TAN="tan",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_ASIN="asin",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_ACOS="acos",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_ATAN="atan",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_LN="ln",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_LOG="log",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_E_SQUARE="e ^",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_10_SQUARE="10 ^",Blockly.Msg.BLOCKS_OPERATORS_TRUE="true",Blockly.Msg.BLOCKS_OPERATORS_FALSE="false",Blockly.Msg.BLOCKS_PEN_DOWN_PEN="pen down",Blockly.Msg.BLOCKS_PEN_UP_PEN="pen up",Blockly.Msg.BLOCKS_PEN_SET_PEN_COLOR="set pen color to %1";
1
+ goog.provide("Blockly.Msg.en_us.smalruby"),goog.require("Blockly.Msg"),Blockly.Msg.COMMON_TURN_ON="turn on",Blockly.Msg.COMMON_TURN_OFF="turn off",Blockly.Msg.COMMON_FORWARD="forward",Blockly.Msg.COMMON_BACKWARD="backward",Blockly.Msg.COMMON_TURN_LEFT="turn left",Blockly.Msg.COMMON_TURN_RIGHT="turn right",Blockly.Msg.COMMON_STOP="stop",Blockly.Msg.COMMON_ERROR="Error",Blockly.Msg.COLOUR_RED="red",Blockly.Msg.COLOUR_GREEN="green",Blockly.Msg.COLOUR_BLUE="blue",Blockly.Msg.COLOUR_WHITE="white",Blockly.Msg.SMALRUBY_WILL_DISAPPER_YOUR_PROGRAM="Disappear your program!",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_COMMON_LINES=" Lines",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_COMMON_LETTERS=" Letters",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_COMMON_COMMA=", ",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_COMMON_CONFIRM_OVERWRITE="Are you sure to save?\nBecause you saved as {$filename}, so that will disappear, if you will save!",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_BLOCKUI_TITLE="Converting Program",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_BLOCKUI_MESSAGE="Converting your program to instruction blocks.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_ERROR="Can't convert your program to instruction blocks.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_TITLE="Running",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_MESSAGE="Please switch your program's window.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_NOTICE="Running your program after save & check it.<br>Press ESC key to quit.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_ERROR_CANT_RUN="Can't run your program.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_ERROR_CANCEL_TO_RUN="Cancel to run your program.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_DOWNLOAD_BLOCKUI_TITLE="Downloading",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_DOWNLOAD_BLOCKUI_MESSAGE="Downloading your program.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_DOWNLOAD_SUCCEEDED='Downloaded.<br>You can run with "ruby {$filename}" on windows or "rsdl {$filename}" on Mac OS X.',Blockly.Msg.VIEWS_MAIN_MENU_VIEW_DOWNLOAD_ERROR="Can't download",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_LOAD_CONFIRM="Your program will disappear, because you didn't save it! Are you sure to load?",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_ERROR_NO_NAME="You must set program name before you save it!",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_TITLE="Saving your program",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_MESSAGE="Now, saving your program.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_NOTICE='Your program name is "{$filename}".<br>It will be saved at home directory.<br>',Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_ERROR_MESSAGE="Can't save your program.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_CANCELED="Canceled to save.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_SUCCEEDED="Saved.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_TITLE="Checking your program",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_MESSAGE="Now, checking syntax of your program.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_NOTICE="This is only checking syntax, so you will find error when you run it.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_SUCCEEDED="Checked.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_SUCCEEDED_NOTICE="Your program was checked only syntax, so you will find error when you run it.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_ERROR="Can't check.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SIGNOUT_SUCCEEDED="Logouted.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SIGNOUT_ERROR="Can't logout.",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_LOAD_ERROR="{$filename}{$error}",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_LOAD_SUCCEEDED="Loaded.",Blockly.Msg.VIEWS_LOAD_MODAL_VIEW_ERROR="Can't load the program.",Blockly.Msg.VIEWS_SIGNIN_MODAL_VIEW_SIGNED_IN="Logged in.",Blockly.Msg.VIEWS_SIGNIN_MODAL_VIEW_ERROR="Can't login.",Blockly.Msg.BLOCKS_MOTION_MOVE="move %1 steps",Blockly.Msg.BLOCKS_MOTION_TURN_RIGHT_DEGREES="turn right %1 degrees",Blockly.Msg.BLOCKS_MOTION_TURN_LEFT_DEGREES="turn left %1 degrees",Blockly.Msg.BLOCKS_MOTION_POINT_IN_DIRECTION="point in direction %1",Blockly.Msg.BLOCKS_MOTION_POINT_TOWARDS_MOUSE="point towards mouse-pointer",Blockly.Msg.BLOCKS_MOTION_POINT_TOWARDS_CHARACTER="point towards %1",Blockly.Msg.BLOCKS_MOTION_SET_X_Y="go to x: %1 y: %2",Blockly.Msg.BLOCKS_MOTION_GO_TO_MOUSE="go to mouse-pointer",Blockly.Msg.BLOCKS_MOTION_GO_TO_CHARACTER="go to %1",Blockly.Msg.BLOCKS_MOTION_CHANGE_X_BY="change x by %1",Blockly.Msg.BLOCKS_MOTION_SET_X="set x to %1",Blockly.Msg.BLOCKS_MOTION_CHANGE_Y_BY="change y by %1",Blockly.Msg.BLOCKS_MOTION_SET_Y="set y to %1",Blockly.Msg.BLOCKS_MOTION_TURN_IF_REACH_WALL="if reach wall, turn",Blockly.Msg.BLOCKS_MOTION_TURN="turn",Blockly.Msg.BLOCKS_MOTION_TURN_XY_X="(x) horizontal",Blockly.Msg.BLOCKS_MOTION_TURN_XY_Y="(y) vertical",Blockly.Msg.BLOCKS_MOTION_TURN_XY="turn to %1",Blockly.Msg.BLOCKS_MOTION_SET_ROTATION_STYLE="set rotation style %1",Blockly.Msg.BLOCKS_MOTION_SET_ROTATION_STYLE_LEFT_RIGHT="left-right",Blockly.Msg.BLOCKS_MOTION_SET_ROTATION_STYLE_NONE="don't rorate",Blockly.Msg.BLOCKS_MOTION_SET_ROTATION_STYLE_FREE="all around",Blockly.Msg.BLOCKS_MOTION_SELF_X="x position",Blockly.Msg.BLOCKS_MOTION_SELF_Y="y position",Blockly.Msg.BLOCKS_MOTION_SELF_ANGLE="direction",Blockly.Msg.BLOCKS_EVENTS_ON_START="when Run clicked",Blockly.Msg.BLOCKS_EVENTS_ON_KEY_PUSH_OR_DOWN="when %1 key %2",Blockly.Msg.BLOCKS_EVENTS_ON_CLICK="when this sprite clicked",Blockly.Msg.BLOCKS_EVENTS_ON_HIT="when %1 hit",Blockly.Msg.BLOCKS_SENSING_K_UP="up arrow",Blockly.Msg.BLOCKS_SENSING_K_DOWN="down arrow",Blockly.Msg.BLOCKS_SENSING_K_LEFT="left arrow",Blockly.Msg.BLOCKS_SENSING_K_RIGHT="right arrow",Blockly.Msg.BLOCKS_SENSING_K_SPACE="space",Blockly.Msg.BLOCKS_SENSING_PRESSED="pressed",Blockly.Msg.BLOCKS_SENSING_PUSH=Blockly.Msg.BLOCKS_SENSING_PRESSED,Blockly.Msg.BLOCKS_SENSING_DOWN=Blockly.Msg.BLOCKS_SENSING_PRESSED,Blockly.Msg.BLOCKS_SENSING_HOLD_PRESSED="hold pressed",Blockly.Msg.BLOCKS_SENSING_HOLD_DOWN=Blockly.Msg.BLOCKS_SENSING_HOLD_PRESSED,Blockly.Msg.BLOCKS_SENSING_M_LBUTTON="left-button",Blockly.Msg.BLOCKS_SENSING_M_MBUTTON="middle-button",Blockly.Msg.BLOCKS_SENSING_M_RBUTTON="right-button",Blockly.Msg.BLOCKS_SENSING_RELEASED="released",Blockly.Msg.BLOCKS_SENSING_UP=Blockly.Msg.BLOCKS_SENSING_RELEASED,Blockly.Msg.BLOCKS_SENSING_REACH_WALL="reach wall?",Blockly.Msg.BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_PREFIX="key ",Blockly.Msg.BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_MIDDLE=" ",Blockly.Msg.BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_SUFFIX="",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_PREFIX="mouse ",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_MIDDLE=" ",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_SUFFIX="",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_POS_X="mouse x",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_POS_Y="mouse y",Blockly.Msg.BLOCKS_SENSING_HIT_PREFIX="reach ",Blockly.Msg.BLOCKS_SENSING_HIT_SUFFIX="?",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_X="x position",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_Y="y position",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_ANGLE="direction",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_COSTUME_INDEX="costume #",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_COSTUME="contume name",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_SCALE="size",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_VOLUME="volume",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY="%2 of %1",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_YEAR="year",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_MONTH="month",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_DAY="day",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_WDAY="day of week",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_HOUR="hour",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_MIN="min",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_SEC="sec",Blockly.Msg.BLOCKS_SENSING_TIME_NOW="current ",Blockly.Msg.BLOCKS_SENSING_DAYS_SINCE_2000="days since 2000",Blockly.Msg.BLOCKS_CONTROL_SLEEP="wait %1 secs",Blockly.Msg.BLOCKS_CONTROL_LOOP="loop",Blockly.Msg.BLOCKS_CONTROL_LOOP_END="end of loop",Blockly.Msg.BLOCKS_CONTROL_BREAK="stop this loop",Blockly.Msg.BLOCKS_CONTROL_NEXT="next iteration of this loop",Blockly.Msg.BLOCKS_CONTROL_REDO="redo iteration of this loop",Blockly.Msg.BLOCKS_CONTROL_IF="if ",Blockly.Msg.BLOCKS_CONTROL_THEN=" then",Blockly.Msg.BLOCKS_CONTROL_ELSE="else",Blockly.Msg.BLOCKS_CONTROL_TIMES="repeat %1",Blockly.Msg.BLOCKS_CONTROL_AWAIT_UNTIL="wait until %1",Blockly.Msg.BLOCKS_CONTROL_UNTIL="repeat until %1",Blockly.Msg.BLOCKS_CONTROL_AWAIT="just wait a little",Blockly.Msg.BLOCKS_RUBY_STATEMENT="statement ",Blockly.Msg.BLOCKS_RUBY_EXPRESSION="expression ",Blockly.Msg.BLOCKS_RUBY_COMMENT="comment ",Blockly.Msg.BLOCKS_RUBY_P="p %1",Blockly.Msg.BLOCKS_FIELD_CHARACTER_NO_CHARACTER="no character",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS="%1",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_DO="Middle C of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_RE="D of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_MI="E of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_FA="F of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_SO="G of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_RA="A of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_SI="B of piano",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_DO_2="High C of piano",Blockly.Msg.BLOCKS_SOUND_PLAY="play sound %1",Blockly.Msg.BLOCKS_LOOKS_SAY="say %1",Blockly.Msg.BLOCKS_LOOKS_THINK="think %1",Blockly.Msg.BLOCKS_LOOKS_SAY_WITH_SECOND="say %1 for %2 secs",Blockly.Msg.BLOCKS_LOOKS_THINK_WITH_SECOND="think %1 for %2 secs",Blockly.Msg.BLOCKS_LOOKS_SHOW="show",Blockly.Msg.BLOCKS_LOOKS_HIDE="hide",Blockly.Msg.BLOCKS_LOOKS_VANISH="vanish",Blockly.Msg.BLOCKS_HARDWARE_LED_TURN_ON="turn on LED %1",Blockly.Msg.BLOCKS_HARDWARE_LED_TURN_OFF="turn off LED %1",Blockly.Msg.BLOCKS_HARDWARE_ANODE="anode",Blockly.Msg.BLOCKS_HARDWARE_CATHODE="cathode",Blockly.Msg.BLOCKS_HARDWARE_LEFT="left",Blockly.Msg.BLOCKS_HARDWARE_RIGHT="right",Blockly.Msg.BLOCKS_HARDWARE_INIT_HARDWARE="setup hardware",Blockly.Msg.BLOCKS_HARDWARE_RGB_LED_SET_COLOR="set RGB LED %1 common %2 color to %3",Blockly.Msg.BLOCKS_HARDWARE_RGB_LED_TURN_OFF="turn off RGB LED %1 common %2",Blockly.Msg.BLOCKS_HARDWARE_SEVEN_SEGMENT_DISPLAY_SHOW="show 7 segment display %1",Blockly.Msg.BLOCKS_HARDWARE_SEVEN_SEGMENT_DISPLAY_OFF="turn off 7 segment display",Blockly.Msg.BLOCKS_HARDWARE_LCD_PUTS="display %1 on the LCD",Blockly.Msg.BLOCKS_HARDWARE_LCD_CLEAR="clear LCD",Blockly.Msg.BLOCKS_HARDWARE_SERVO_SET_POSITION="servo motor %1 set %2 degree (5-180)",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS="%1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_FORWARD="forward 2WD car %1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_BACKWARD="backward 2WD car %1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_TURN_LEFT="turn left 2WD car %1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_TURN_RIGHT="turn right 2WD car %1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_STOP="stop 2WD car %1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_RUN="%1 2WD car %2 %3 secs",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_FORWARD="forward",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_BACKWARD="backward",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_TURN_LEFT="turn left",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_TURN_RIGHT="turn right",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_STOP="stop",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_SET_SPEED="set 2WD car %1 's %2 motor speed to %3 %",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_SPEED="2WD car %1 's %2 motor speed (%)",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_FORWARD="forward",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_BACKWARD="backward",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_STOP="stop",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER="%2 (motor driver %1's) motor",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_SET_SPEED="set (motor driver %1's) motor speed to %2 %",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_SPEED="(motor driver %1's) motor speed (%)",Blockly.Msg.BLOCKS_HARDWARE_BUTTON_PRESSED_OR_RELEASED="button %1 %2 ?",Blockly.Msg.BLOCKS_HARDWARE_SENSOR_VALUE="sensor %1 value",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_LED_TURN_ON_OR_OFF="%2 Smalrubot v3 %1 LED",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_ACTION="%1 Smalrubot v3",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_ACTION_WITH_SEC="%1 Smalrubot v3 for %2 secs",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_SENSOR_VALUE="Smalrubot v3 %1 sensor",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_DC_MOTOR_POWER_RATIO="Smalrubot v3 %1 dc motor power ratio",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_DC_MOTOR_SET_POWER_RATIO="set Smalrubot v3 %1 dc motor power ratio to %2 %",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_LED_TURN_ON_OR_OFF="%2 Smalrubot s1 %1 LED",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_ACTION="%1 Smalrubot s1",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_ACTION_WITH_SEC="%1 Smalrubot s1 for %2 secs",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_SENSOR_VALUE="Smalrubot s1 %1 sensor",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_DC_MOTOR_POWER_RATIO="Smalrubot s1 %1 dc motor power ratio",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_DC_MOTOR_SET_POWER_RATIO="set Smalrubot s1 %1 dc motor power ratio to %2 %",Blockly.Msg.BLOCKS_OPERATORS_ADD="%1 + %2",Blockly.Msg.BLOCKS_OPERATORS_MINUS="%1 - %2",Blockly.Msg.BLOCKS_OPERATORS_MULTIPLY="%1 * %2",Blockly.Msg.BLOCKS_OPERATORS_DIVIDE="%1 / %2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_LT="%1 < %2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_LTE="%1 <= %2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_EQ="%1 = %2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_GTE="%1 >= %2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_GT="%1 > %2",Blockly.Msg.BLOCKS_OPERATORS_RAND="pick random %1 to %2",Blockly.Msg.BLOCKS_OPERATORS_AND="%1 and %2",Blockly.Msg.BLOCKS_OPERATORS_OR="%1 or %2",Blockly.Msg.BLOCKS_OPERATORS_NOT="not %1",Blockly.Msg.BLOCKS_OPERATORS_INDEX_OF="letter %1 of %2",Blockly.Msg.BLOCKS_OPERATORS_LENGTH="length of %1",Blockly.Msg.BLOCKS_OPERATORS_MODULO="%1 mod %2",Blockly.Msg.BLOCKS_OPERATORS_ROUND="round %1",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD="%1 of %2",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_ABS="abs",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_FLOOR="floor",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_CEIL="ceiling",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_SQRT="sqrt",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_SIN="sin",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_COS="cos",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_TAN="tan",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_ASIN="asin",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_ACOS="acos",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_ATAN="atan",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_LN="ln",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_LOG="log",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_E_SQUARE="e ^",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_10_SQUARE="10 ^",Blockly.Msg.BLOCKS_OPERATORS_TRUE="true",Blockly.Msg.BLOCKS_OPERATORS_FALSE="false",Blockly.Msg.BLOCKS_PEN_DOWN_PEN="pen down",Blockly.Msg.BLOCKS_PEN_UP_PEN="pen up",Blockly.Msg.BLOCKS_PEN_SET_PEN_COLOR="set pen color to %1";
@@ -0,0 +1 @@
1
+ goog.provide("Blockly.Msg.ja.smalruby"),goog.require("Blockly.Msg"),Blockly.Msg.COMMON_TURN_ON="オンにする",Blockly.Msg.COMMON_TURN_OFF="オフにする",Blockly.Msg.COMMON_FORWARD="進める",Blockly.Msg.COMMON_BACKWARD="バックさせる",Blockly.Msg.COMMON_TURN_LEFT="左に曲げる",Blockly.Msg.COMMON_TURN_RIGHT="右に曲げる",Blockly.Msg.COMMON_STOP="止める",Blockly.Msg.COMMON_ERROR="エラー",Blockly.Msg.COLOUR_RED="赤色",Blockly.Msg.COLOUR_GREEN="緑色",Blockly.Msg.COLOUR_BLUE="青色",Blockly.Msg.COLOUR_WHITE="白色",Blockly.Msg.SMALRUBY_WILL_DISAPPER_YOUR_PROGRAM="作成中のプログラムが消えてしまうよ!",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_COMMON_LINES="行",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_COMMON_LETTERS="文字",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_COMMON_COMMA="、",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_COMMON_CONFIRM_OVERWRITE="前に{$filename}という名前でセーブしているけど本当にセーブしますか?\nセーブすると前に作成したプログラムは消えてしまうよ!",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_BLOCKUI_TITLE="プログラムの変換中",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_BLOCKUI_MESSAGE="プログラムをブロックに変換しています。",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_BLOCK_MODE_ERROR="ブロックへの変換に失敗しました",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_TITLE="プログラムの実行中",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_MESSAGE="プログラムの画面に切り替えてください。",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_BLOCKUI_NOTICE="プログラムをセーブ・チェックしてから実行するよ♪<br>Escキーを押すとプログラムが終わります。",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_ERROR_CANT_RUN="プログラムを実行できませんでした",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_RUN_ERROR_CANCEL_TO_RUN="プログラムの実行をキャンセルしました",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_DOWNLOAD_BLOCKUI_TITLE="プログラムのダウンロード中",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_DOWNLOAD_BLOCKUI_MESSAGE="プログラムをダウンロードしています。",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_DOWNLOAD_SUCCEEDED="ダウンロードしました。<br>ダウンロードしたプログラムは、Windowsだと「ruby {$filename}」、Macだと「rsdl {$filename}」で実行できます。",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_DOWNLOAD_ERROR="ダウンロードできませんでした",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_LOAD_CONFIRM="まだセーブしていないのでロードするとプログラムが消えてしまうよ!\nそれでもロードしますか?",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_ERROR_NO_NAME="セーブする前にプログラムに名前をつけてね!",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_TITLE="プログラムのセーブ中",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_MESSAGE="プログラムをセーブしています。",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_BLOCKUI_NOTICE="プログラムの名前は「{$filename}」です。<br>プログラムはホームディレクトリにセーブします。<br>",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_ERROR_MESSAGE="セーブできませんでした",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_CANCELED="セーブをキャンセルしました",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SAVE_SUCCEEDED="セーブしました",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_TITLE="プログラムのチェック中",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_MESSAGE="プログラムの文法をチェックしています。",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_BLOCKUI_NOTICE="このチェックは簡易的なものですので、<br>プログラムを動かすとエラーが見つかるかもしれません。",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_SUCCEEDED="チェックしました",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_SUCCEEDED_NOTICE="ただし、プログラムを動かすとエラーが見つかるかもしれません。",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_CHECK_ERROR="チェックできませんでした",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SIGNOUT_SUCCEEDED="ログアウトしました",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_SIGNOUT_ERROR="ログアウトに失敗しました",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_LOAD_ERROR="{$filename}{$error}",Blockly.Msg.VIEWS_MAIN_MENU_VIEW_LOAD_SUCCEEDED="ロードしました",Blockly.Msg.VIEWS_LOAD_MODAL_VIEW_ERROR="ロードに失敗しました",Blockly.Msg.VIEWS_SIGNIN_MODAL_VIEW_SIGNED_IN="ログインしました",Blockly.Msg.VIEWS_SIGNIN_MODAL_VIEW_ERROR="ログインに失敗しました",Blockly.Msg.BLOCKS_MOTION_MOVE="■%1歩動かす",Blockly.Msg.BLOCKS_MOTION_MOVE2="■%1歩動かす2",Blockly.Msg.BLOCKS_MOTION_TURN_RIGHT_DEGREES="■時計回りに%1度回す",Blockly.Msg.BLOCKS_MOTION_TURN_LEFT_DEGREES="■反時計回りに%1度回す",Blockly.Msg.BLOCKS_MOTION_POINT_IN_DIRECTION="■%1 度に向ける",Blockly.Msg.BLOCKS_MOTION_POINT_TOWARDS_MOUSE="■マウスポインターへ向ける",Blockly.Msg.BLOCKS_MOTION_POINT_TOWARDS_CHARACTER="■%1 へ向ける",Blockly.Msg.BLOCKS_MOTION_SET_X_Y="■x座標を %1 、y座標を %2 にする",Blockly.Msg.BLOCKS_MOTION_GO_TO_MOUSE="■マウスポインターへ行く",Blockly.Msg.BLOCKS_MOTION_GO_TO_CHARACTER="■%1 へ行く",Blockly.Msg.BLOCKS_MOTION_CHANGE_X_BY="■x座標を %1 ずつ変える",Blockly.Msg.BLOCKS_MOTION_SET_X="■x座標を %1 にする",Blockly.Msg.BLOCKS_MOTION_CHANGE_Y_BY="■y座標を %1 ずつ変える",Blockly.Msg.BLOCKS_MOTION_SET_Y="■y座標を %1 にする",Blockly.Msg.BLOCKS_MOTION_TURN_IF_REACH_WALL="■もし端に着いたら、跳ね返る",Blockly.Msg.BLOCKS_MOTION_TURN="■跳ね返る",Blockly.Msg.BLOCKS_MOTION_TURN_XY_X="水平(x)",Blockly.Msg.BLOCKS_MOTION_TURN_XY_Y="垂直(y)",Blockly.Msg.BLOCKS_MOTION_TURN_XY="■%1 方向に跳ね返る",Blockly.Msg.BLOCKS_MOTION_SET_ROTATION_STYLE_LEFT_RIGHT="左右のみ",Blockly.Msg.BLOCKS_MOTION_SET_ROTATION_STYLE_NONE="回転しない",Blockly.Msg.BLOCKS_MOTION_SET_ROTATION_STYLE_FREE="自由に回転",Blockly.Msg.BLOCKS_MOTION_SET_ROTATION_STYLE="■回転方法を %1 にする",Blockly.Msg.BLOCKS_MOTION_SELF_X="■x座標",Blockly.Msg.BLOCKS_MOTION_SELF_Y="■y座標",Blockly.Msg.BLOCKS_MOTION_SELF_ANGLE="■向き",Blockly.Msg.BLOCKS_EVENTS_ON_START="♣実行ボタンがクリックされたとき",Blockly.Msg.BLOCKS_EVENTS_ON_KEY_PUSH_OR_DOWN="♣キーボードの %1 が %2 のとき",Blockly.Msg.BLOCKS_EVENTS_ON_CLICK="♣キャラクターがクリックされたとき",Blockly.Msg.BLOCKS_EVENTS_ON_HIT="♣%1 にぶつかったとき",Blockly.Msg.BLOCKS_SENSING_K_UP="↑",Blockly.Msg.BLOCKS_SENSING_K_DOWN="↓",Blockly.Msg.BLOCKS_SENSING_K_LEFT="←",Blockly.Msg.BLOCKS_SENSING_K_RIGHT="→",Blockly.Msg.BLOCKS_SENSING_K_SPACE="スペース",Blockly.Msg.BLOCKS_SENSING_PRESSED="押された",Blockly.Msg.BLOCKS_SENSING_PUSH=Blockly.Msg.BLOCKS_SENSING_PRESSED,Blockly.Msg.BLOCKS_SENSING_UP=Blockly.Msg.BLOCKS_SENSING_PRESSED,Blockly.Msg.BLOCKS_SENSING_HOLD_PRESSED="押され続けている",Blockly.Msg.BLOCKS_SENSING_HOLD_DOWN=Blockly.Msg.BLOCKS_SENSING_HOLD_PRESSED,Blockly.Msg.BLOCKS_SENSING_M_LBUTTON="左ボタン",Blockly.Msg.BLOCKS_SENSING_M_MBUTTON="中ボタン",Blockly.Msg.BLOCKS_SENSING_M_RBUTTON="右ボタン",Blockly.Msg.BLOCKS_SENSING_RELEASED="離された",Blockly.Msg.BLOCKS_SENSING_UP=Blockly.Msg.BLOCKS_SENSING_RELEASED,Blockly.Msg.BLOCKS_SENSING_REACH_WALL="◎端に触れた",Blockly.Msg.BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_PREFIX="◎キーボードの",Blockly.Msg.BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_MIDDLE="が",Blockly.Msg.BLOCKS_SENSING_INPUT_KEY_PUSH_OR_DOWN_SUFFIX="",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_PREFIX="◎マウスの",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_MIDDLE="が",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_PUSH_OR_DOWN_SUFFIX="",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_POS_X="◎マウスのx座標",Blockly.Msg.BLOCKS_SENSING_INPUT_MOUSE_POS_Y="◎マウスのy座標",Blockly.Msg.BLOCKS_SENSING_HIT_PREFIX="◎",Blockly.Msg.BLOCKS_SENSING_HIT_SUFFIX="に触れた",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_X="x座標",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_Y="y座標",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_ANGLE="向き",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_COSTUME_INDEX="コスチューム番号",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_COSTUME="コスチューム名",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_SCALE="大きさ",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY_VOLUME="ボリューム",Blockly.Msg.BLOCKS_SENSING_CHARACTER_PROPERTY="◎%1 の %2",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_YEAR="年",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_MONTH="月",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_DAY="日",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_WDAY="曜日",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_HOUR="時",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_MIN="分",Blockly.Msg.BLOCKS_SENSING_TIME_NOW_SEC="秒",Blockly.Msg.BLOCKS_SENSING_TIME_NOW="◎現在の %1",Blockly.Msg.BLOCKS_SENSING_DAYS_SINCE_2000="◎2000年からの日数",Blockly.Msg.BLOCKS_CONTROL_SLEEP="◆%1秒待つ",Blockly.Msg.BLOCKS_CONTROL_LOOP="◆ずっと",Blockly.Msg.BLOCKS_CONTROL_LOOP_END="を繰り返す",Blockly.Msg.BLOCKS_CONTROL_BREAK="◆繰り返しから脱出する",Blockly.Msg.BLOCKS_CONTROL_NEXT="◆以降の処理を飛ばして、次の回の処理を開始する",Blockly.Msg.BLOCKS_CONTROL_REDO="◆以降の処理を飛ばして、もう一度同じ処理をやり直す",Blockly.Msg.BLOCKS_CONTROL_IF="◆もし",Blockly.Msg.BLOCKS_CONTROL_THEN="ならば",Blockly.Msg.BLOCKS_CONTROL_ELSE="でなければ",Blockly.Msg.BLOCKS_CONTROL_TIMES="◆%1回繰り返す",Blockly.Msg.BLOCKS_CONTROL_AWAIT_UNTIL="◆%1まで待つ",Blockly.Msg.BLOCKS_CONTROL_UNTIL="◆%1まで",Blockly.Msg.BLOCKS_CONTROL_AWAIT="◆ほんの少し待つ",Blockly.Msg.BLOCKS_RUBY_STATEMENT="♠文",Blockly.Msg.BLOCKS_RUBY_EXPRESSION="♠式",Blockly.Msg.BLOCKS_RUBY_COMMENT="♠コメント",Blockly.Msg.BLOCKS_RUBY_P="♠p %1",Blockly.Msg.BLOCKS_FIELD_CHARACTER_NO_CHARACTER="キャラクターなし",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS="♪%1",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_DO="ピアノのド",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_RE="ピアノのレ",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_MI="ピアノのミ",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_FA="ピアノのファ",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_SO="ピアノのソ",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_RA="ピアノのラ",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_SI="ピアノのシ",Blockly.Msg.BLOCKS_SOUND_PRESET_SOUNDS_PIANO_DO_2="ピアノの高いド",Blockly.Msg.BLOCKS_SOUND_PLAY="♪%1 の音を鳴らす",Blockly.Msg.BLOCKS_LOOKS_SAY="★%1 と言う",Blockly.Msg.BLOCKS_LOOKS_THINK="★%1 と考える",Blockly.Msg.BLOCKS_LOOKS_SAY_WITH_SECOND="★%1 と %2 秒と言う",Blockly.Msg.BLOCKS_LOOKS_THINK_WITH_SECOND="★%1 と %2 秒と考える",Blockly.Msg.BLOCKS_LOOKS_SHOW="★表示する",Blockly.Msg.BLOCKS_LOOKS_HIDE="★隠す",Blockly.Msg.BLOCKS_LOOKS_VANISH="★消滅する",Blockly.Msg.BLOCKS_HARDWARE_LED_TURN_ON="★LED %1 をオンにする",Blockly.Msg.BLOCKS_HARDWARE_LED_TURN_OFF="★LED %1 をオフにする",Blockly.Msg.BLOCKS_HARDWARE_ANODE="アノード",Blockly.Msg.BLOCKS_HARDWARE_CATHODE="カソード",Blockly.Msg.BLOCKS_HARDWARE_LEFT=" 左",Blockly.Msg.BLOCKS_HARDWARE_RIGHT="右",Blockly.Msg.BLOCKS_HARDWARE_INIT_HARDWARE="♠ハードウェアを準備する",Blockly.Msg.BLOCKS_HARDWARE_RGB_LED_SET_COLOR="★RGB LED %1 コモン %2 を %3 にする",Blockly.Msg.BLOCKS_HARDWARE_RGB_LED_TURN_OFF="★RGB LED %1 コモン %2 をオフにする",Blockly.Msg.BLOCKS_HARDWARE_SEVEN_SEGMENT_DISPLAY_SHOW="★7セグディスプレイに %1 を表示する",Blockly.Msg.BLOCKS_HARDWARE_SEVEN_SEGMENT_DISPLAY_OFF="★7セグディスプレイをオフにする",Blockly.Msg.BLOCKS_HARDWARE_LCD_PUTS="★LCDに %1 を表示する",Blockly.Msg.BLOCKS_HARDWARE_LCD_CLEAR="★LCDをクリアする",Blockly.Msg.BLOCKS_HARDWARE_SERVO_SET_POSITION="■サーボ %1 を %2 度(5~180)にする",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_FORWARD="■2WD車 %1 を進める",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_BACKWARD="■2WD車 %1 をバックさせる",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_TURN_LEFT="■2WD車 %1 を左に曲げる",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_TURN_RIGHT="■2WD車 %1 を右に曲げる",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_STOP="■2WD車 %1 を止める",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_RUN="■2WD車 %2 を %3 秒 %1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS="■%1",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_FORWARD="進める",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_BACKWARD="バックさせる",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_TURN_LEFT="左に曲げる",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_TURN_RIGHT="右に曲げる",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_COMMANDS_STOP="止める",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_SET_SPEED="■2WD車 %1 の %2 の速度(%)を %3 にする",Blockly.Msg.BLOCKS_HARDWARE_TWO_WHEEL_DRIVE_CAR_SPEED="◎2WD車 %1 の %2 の速度(%)",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_FORWARD="正転させる",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_BACKWARD="逆転させる",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_STOP="止める",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER="■(モータードライバ %1 で)モーターを %2",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_SET_SPEED="■(モータードライバ %1 の)モーターの速度を %2 にする",Blockly.Msg.BLOCKS_HARDWARE_MOTOR_DRIVER_SPEED="◎(モータードライバ %1 の)モーターの速度(%)",Blockly.Msg.BLOCKS_HARDWARE_BUTTON_PRESSED_OR_RELEASED="◎ボタン %1 が %2 ?",Blockly.Msg.BLOCKS_HARDWARE_SENSOR_VALUE="◎センサー %1",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_LED_TURN_ON_OR_OFF="★スモウルボットV3の %1 LEDを %2",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_ACTION="■スモウルボットV3を %1",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_ACTION_WITH_SEC="■スモウルボットV3を %2 秒 %1",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_SENSOR_VALUE="◎スモウルボットV3の %1 のセンサー",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_DC_MOTOR_POWER_RATIO="◎スモウルボットV3の %1 DCモーターの速度(%)",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_V3_DC_MOTOR_SET_POWER_RATIO="■スモウルボットV3の %1 DCモーターの速度を %2 (%) にする",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_LED_TURN_ON_OR_OFF="★スモウルボットS1の %1 LEDを %2",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_ACTION="■スモウルボットS1を %1",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_ACTION_WITH_SEC="■スモウルボットS1を %2 秒 %1",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_SENSOR_VALUE="◎スモウルボットS1の %1 のセンサー",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_DC_MOTOR_POWER_RATIO="◎スモウルボットS1の %1 DCモーターの速度(%)",Blockly.Msg.BLOCKS_HARDWARE_SMALRUBOT_S1_DC_MOTOR_SET_POWER_RATIO="■スモウルボットS1の %1 DCモーターの速度を %2 (%) にする",Blockly.Msg.BLOCKS_OPERATORS_ADD="%1+%2",Blockly.Msg.BLOCKS_OPERATORS_MINUS="%1ー%2",Blockly.Msg.BLOCKS_OPERATORS_MULTIPLY="%1×%2",Blockly.Msg.BLOCKS_OPERATORS_DIVIDE="%1÷%2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_LT="%1<%2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_LTE="%1≦%2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_EQ="%1=%2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_GTE="%1≧%2",Blockly.Msg.BLOCKS_OPERATORS_COMPARE_GT="%1>%2",Blockly.Msg.BLOCKS_OPERATORS_RAND="%1から%2までの乱数",Blockly.Msg.BLOCKS_OPERATORS_AND="%1かつ%2",Blockly.Msg.BLOCKS_OPERATORS_OR="%1または%2",Blockly.Msg.BLOCKS_OPERATORS_NOT="%1ではない",Blockly.Msg.BLOCKS_OPERATORS_INDEX_OF="%1の%2番目",Blockly.Msg.BLOCKS_OPERATORS_LENGTH="%1の長さ",Blockly.Msg.BLOCKS_OPERATORS_MODULO="%1を%2で割った余り",Blockly.Msg.BLOCKS_OPERATORS_ROUND="%1を四捨五入",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD="%1の%2",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_ABS="絶対値",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_FLOOR="切り上げ",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_CEIL="切り下げ",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_SQRT="平方根",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_SIN="sin",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_COS="cos",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_TAN="tan",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_ASIN="asin",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_ACOS="acos",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_ATAN="atan",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_LN="log",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_LOG="log10",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_E_SQUARE="e ^",Blockly.Msg.BLOCKS_OPERATORS_MATH_METHOD_10_SQUARE="10 ^",Blockly.Msg.BLOCKS_OPERATORS_TRUE="真",Blockly.Msg.BLOCKS_OPERATORS_FALSE="偽",Blockly.Msg.BLOCKS_PEN_DOWN_PEN="●ペンを下ろす",Blockly.Msg.BLOCKS_PEN_UP_PEN="●ペンを上げる",Blockly.Msg.BLOCKS_PEN_SET_PEN_COLOR="●ペンの色を%1にする",Blockly.Msg.VARIABLES_SET_TITLE="☼セット",Blockly.Msg.VARIABLES_GET_TITLE="☼";
@@ -69,7 +69,7 @@ Gem::Specification.new do |spec|
69
69
  ['haml-rails'],
70
70
  ['nokogiri'],
71
71
  ['settingslogic'],
72
- ['smalruby', '~> 0.1.4'],
72
+ ['smalruby', '~> 0.1.6'],
73
73
  ]
74
74
  runtime_dependencies << ['therubyracer'] unless is_windows
75
75
  runtime_dependencies.each do |args|
@@ -10,8 +10,8 @@ Feature: hardware_smalrubot_s1_led_turn_on_or_off block
10
10
  When 次のブロックを配置する:
11
11
  """
12
12
  %block{:type => "hardware_smalrubot_s1_led_turn_on_or_off", :x => "0", :y => "0"}
13
- %field{:name => "COLOUR"}<
14
- white
13
+ %field{:name => "LOR"}<
14
+ right
15
15
  %field{:name => "OOO"}<
16
16
  turn_off
17
17
  """
@@ -27,8 +27,8 @@ Feature: hardware_smalrubot_s1_led_turn_on_or_off block
27
27
  car1
28
28
  %statement{:name => "DO"}
29
29
  %block{:type => "hardware_smalrubot_s1_led_turn_on_or_off", :x => "0", :y => "0"}
30
- %field{:name => "COLOUR"}<
31
- white
30
+ %field{:name => "LOR"}<
31
+ right
32
32
  %field{:name => "OOO"}<
33
33
  turn_off
34
34
  """
@@ -39,7 +39,7 @@ Feature: hardware_smalrubot_s1_led_turn_on_or_off block
39
39
  require "smalruby"
40
40
 
41
41
  car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
42
- car1.smalrubot_s1.turn_off_white_led
42
+ car1.smalrubot_s1.turn_off_right_led
43
43
 
44
44
  """
45
45
 
@@ -53,8 +53,8 @@ Feature: hardware_smalrubot_s1_led_turn_on_or_off block
53
53
  %block{:type => "events_on_start"}
54
54
  %statement{:name => "DO"}
55
55
  %block{:type => "hardware_smalrubot_s1_led_turn_on_or_off", :x => "0", :y => "0"}
56
- %field{:name => "COLOUR"}<
57
- blue
56
+ %field{:name => "LOR"}<
57
+ left
58
58
  %field{:name => "OOO"}<
59
59
  turn_on
60
60
  """
@@ -67,7 +67,7 @@ Feature: hardware_smalrubot_s1_led_turn_on_or_off block
67
67
  car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
68
68
 
69
69
  car1.on(:start) do
70
- smalrubot_s1.turn_on_blue_led
70
+ smalrubot_s1.turn_on_left_led
71
71
  end
72
72
 
73
73
  """
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # language: en
3
3
  @javascript
4
- Feature: hardware_smalrubot_v3_motor_{speed,set_speed} block
4
+ Feature: hardware_smalrubot_v3_dc_motor_{,set_}power_ratio block
5
5
  Background:
6
6
  Given "ブロック" タブを表示する
7
7
  And キャラクターcar1を追加する
@@ -9,7 +9,7 @@ Feature: hardware_smalrubot_v3_motor_{speed,set_speed} block
9
9
  Scenario: ブロックのみ配置する
10
10
  When 次のブロックを配置する:
11
11
  """
12
- %block{:type => "hardware_smalrubot_v3_motor_speed"}
12
+ %block{:type => "hardware_smalrubot_v3_dc_motor_power_ratio"}
13
13
  %field{:name => "LOR"}<
14
14
  right
15
15
  """
@@ -22,11 +22,11 @@ Feature: hardware_smalrubot_v3_motor_{speed,set_speed} block
22
22
  """
23
23
  %block{:type => "ruby_p", :x => "0", :y => "0", :inline => "true" }
24
24
  %value{:name => "ARG"}
25
- %block{:type => "hardware_smalrubot_v3_motor_speed"}
25
+ %block{:type => "hardware_smalrubot_v3_dc_motor_power_ratio"}
26
26
  %field{:name => "LOR"}<
27
27
  right
28
28
  %next
29
- %block{:type => "hardware_smalrubot_v3_motor_set_speed"}
29
+ %block{:type => "hardware_smalrubot_v3_dc_motor_set_power_ratio"}
30
30
  %field{:name => "LOR"}<
31
31
  left
32
32
  %value{:name => "SPEED"}
@@ -53,11 +53,11 @@ Feature: hardware_smalrubot_v3_motor_{speed,set_speed} block
53
53
  %statement{:name => "DO"}
54
54
  %block{:type => "ruby_p", :x => "0", :y => "0", :inline => "true" }
55
55
  %value{:name => "ARG"}
56
- %block{:type => "hardware_smalrubot_v3_motor_speed"}
56
+ %block{:type => "hardware_smalrubot_v3_dc_motor_power_ratio"}
57
57
  %field{:name => "LOR"}<
58
58
  right
59
59
  %next
60
- %block{:type => "hardware_smalrubot_v3_motor_set_speed"}
60
+ %block{:type => "hardware_smalrubot_v3_dc_motor_set_power_ratio"}
61
61
  %field{:name => "LOR"}<
62
62
  left
63
63
  %value{:name => "SPEED"}
@@ -72,8 +72,8 @@ Feature: hardware_smalrubot_v3_motor_{speed,set_speed} block
72
72
  require "smalruby"
73
73
 
74
74
  car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
75
- p(car1.smalrubot_v3.right_motor.speed)
76
- car1.smalrubot_v3.left_motor.speed = 50
75
+ p(car1.smalrubot_v3.right_dc_motor_power_ratio)
76
+ car1.smalrubot_v3.left_dc_motor_power_ratio = 50
77
77
 
78
78
  """
79
79
 
@@ -88,11 +88,11 @@ Feature: hardware_smalrubot_v3_motor_{speed,set_speed} block
88
88
  %statement{:name => "DO"}
89
89
  %block{:type => "ruby_p", :x => "0", :y => "0", :inline => "true" }
90
90
  %value{:name => "ARG"}
91
- %block{:type => "hardware_smalrubot_v3_motor_speed"}
91
+ %block{:type => "hardware_smalrubot_v3_dc_motor_power_ratio"}
92
92
  %field{:name => "LOR"}<
93
93
  right
94
94
  %next
95
- %block{:type => "hardware_smalrubot_v3_motor_set_speed"}
95
+ %block{:type => "hardware_smalrubot_v3_dc_motor_set_power_ratio"}
96
96
  %field{:name => "LOR"}<
97
97
  left
98
98
  %value{:name => "SPEED"}
@@ -109,8 +109,8 @@ Feature: hardware_smalrubot_v3_motor_{speed,set_speed} block
109
109
  car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
110
110
 
111
111
  car1.on(:start) do
112
- p(smalrubot_v3.right_motor.speed)
113
- self.smalrubot_v3.left_motor.speed = 50
112
+ p(smalrubot_v3.right_dc_motor_power_ratio)
113
+ self.smalrubot_v3.left_dc_motor_power_ratio = 50
114
114
  end
115
115
 
116
116
  """
@@ -10,8 +10,8 @@ Feature: hardware_smalrubot_v3_led_turn_on_or_off block
10
10
  When 次のブロックを配置する:
11
11
  """
12
12
  %block{:type => "hardware_smalrubot_v3_led_turn_on_or_off", :x => "0", :y => "0"}
13
- %field{:name => "COLOUR"}<
14
- green
13
+ %field{:name => "LOR"}<
14
+ left
15
15
  %field{:name => "OOO"}<
16
16
  turn_off
17
17
  """
@@ -27,8 +27,8 @@ Feature: hardware_smalrubot_v3_led_turn_on_or_off block
27
27
  car1
28
28
  %statement{:name => "DO"}
29
29
  %block{:type => "hardware_smalrubot_v3_led_turn_on_or_off", :x => "0", :y => "0"}
30
- %field{:name => "COLOUR"}<
31
- green
30
+ %field{:name => "LOR"}<
31
+ left
32
32
  %field{:name => "OOO"}<
33
33
  turn_off
34
34
  """
@@ -39,7 +39,7 @@ Feature: hardware_smalrubot_v3_led_turn_on_or_off block
39
39
  require "smalruby"
40
40
 
41
41
  car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
42
- car1.smalrubot_v3.green_led.turn_off
42
+ car1.smalrubot_v3.turn_off_left_led
43
43
 
44
44
  """
45
45
 
@@ -53,8 +53,8 @@ Feature: hardware_smalrubot_v3_led_turn_on_or_off block
53
53
  %block{:type => "events_on_start"}
54
54
  %statement{:name => "DO"}
55
55
  %block{:type => "hardware_smalrubot_v3_led_turn_on_or_off", :x => "0", :y => "0"}
56
- %field{:name => "COLOUR"}<
57
- red
56
+ %field{:name => "LOR"}<
57
+ right
58
58
  %field{:name => "OOO"}<
59
59
  turn_on
60
60
  """
@@ -67,7 +67,7 @@ Feature: hardware_smalrubot_v3_led_turn_on_or_off block
67
67
  car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
68
68
 
69
69
  car1.on(:start) do
70
- smalrubot_v3.red_led.turn_on
70
+ smalrubot_v3.turn_on_right_led
71
71
  end
72
72
 
73
73
  """
@@ -1,13 +1,13 @@
1
1
  # encoding: utf-8
2
2
  # language: en
3
3
  @javascript
4
- Feature: hardware_smalrubot_s1_ir_photoreflector_value block
4
+ Feature: hardware_smalrubot_v3_sensor_value block
5
5
  Scenario: ブロックのみ配置する
6
6
  Given "ブロック" タブを表示する
7
7
 
8
8
  When 次のブロックを配置する:
9
9
  """
10
- %block{:type => "hardware_smalrubot_s1_ir_photoreflector_value", :x => "0", :y => "0"}
10
+ %block{:type => "hardware_smalrubot_v3_sensor_value", :x => "0", :y => "0"}
11
11
  %field{:name => "LOR"}<
12
12
  right
13
13
  """
@@ -22,7 +22,7 @@ Feature: hardware_smalrubot_s1_ir_photoreflector_value block
22
22
  """
23
23
  %block{:type => "ruby_p", :x => "0", :y => "0", :inline => "true" }
24
24
  %value{:name => "ARG"}
25
- %block{:type => "hardware_smalrubot_s1_ir_photoreflector_value", :x => "0", :y => "0"}
25
+ %block{:type => "hardware_smalrubot_v3_sensor_value", :x => "0", :y => "0"}
26
26
  %field{:name => "LOR"}<
27
27
  right
28
28
  """
@@ -50,7 +50,7 @@ Feature: hardware_smalrubot_s1_ir_photoreflector_value block
50
50
  %statement{:name => "DO"}
51
51
  %block{:type => "ruby_p", :x => "0", :y => "0", :inline => "true" }
52
52
  %value{:name => "ARG"}
53
- %block{:type => "hardware_smalrubot_s1_ir_photoreflector_value", :x => "0", :y => "0"}
53
+ %block{:type => "hardware_smalrubot_v3_sensor_value", :x => "0", :y => "0"}
54
54
  %field{:name => "LOR"}<
55
55
  right
56
56
  """
@@ -61,7 +61,7 @@ Feature: hardware_smalrubot_s1_ir_photoreflector_value block
61
61
  require "smalruby"
62
62
 
63
63
  car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
64
- p(car1.smalrubot_s1.right_ir_photoreflector_value)
64
+ p(car1.smalrubot_v3.right_sensor_value)
65
65
 
66
66
  """
67
67
 
@@ -81,7 +81,7 @@ Feature: hardware_smalrubot_s1_ir_photoreflector_value block
81
81
  %statement{:name => "DO"}
82
82
  %block{:type => "ruby_p", :x => "0", :y => "0", :inline => "true" }
83
83
  %value{:name => "ARG"}
84
- %block{:type => "hardware_smalrubot_s1_ir_photoreflector_value", :x => "0", :y => "0"}
84
+ %block{:type => "hardware_smalrubot_v3_sensor_value", :x => "0", :y => "0"}
85
85
  %field{:name => "LOR"}<
86
86
  left
87
87
  """
@@ -94,7 +94,7 @@ Feature: hardware_smalrubot_s1_ir_photoreflector_value block
94
94
  car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
95
95
 
96
96
  car1.on(:start) do
97
- p(smalrubot_s1.left_ir_photoreflector_value)
97
+ p(smalrubot_v3.left_sensor_value)
98
98
  end
99
99
 
100
100
  """