SiteOrigin Widgets Bundle - Version 1.6.0

Version Description

  • 11 February 2020 =
  • Block Editor: Fixed widget select field width and alignment.
  • Removed unused template files.
  • Contact Form: Improved checking for SiteOrigin development email addresses.
  • Minor styling improvements to the Classic and Block Editor admin interfaces.
  • Features: Added a new setting to select the H tag to be used for the title field.
  • Hero: If a height value is assigned, added prefilling to avoid a page jump.
  • Hero: Added font-display: swap for Google font imports.
  • Layout Slider: If a height value is assigned, added prefilling to avoid a page jump.
  • Image Grid: Added a class of sow-image-grid-image_html to each image. Can be used to exclude images from Lazy Loading plugins.
  • Simple Masonry: Added a class of sow-masonry-grid-image to each image. Can be used to exclude images from Lazy Loading plugins.
  • Features: Added fallback support for the Icon image field.
  • Testimonials: Add fallback support for the Image field.
  • Post Carousel: Prevented looping until all posts are loaded.
  • Post Carousel: Added a new setting to disable looping.
  • Post Carousel: Prevented scrolling past loading items and loop as soon as last item is completely visible.
  • Contact Form: Added disabled cursor to submit button when disabled.
  • Block Editor: Resolved Features widget default settings.
  • Tabs and Accordion: Account for accented characters.
  • Social Media Buttons: Allowed for multiple instances of the same network without duplicating colors.
  • Social Media Buttons: Ensured all icons are correctly centered.
  • Contact Form: Added lightweight validation for phone numbers.
  • Block Editor: Display author for third party widgets.
  • Block Editor: Added processing for the more quicktag in the Editor widget.
  • Tabs and Accordion: Added icon spacing.
  • Testimonials: Improved image sizing behavior for square images.
Download this release

Release Info

Developer gpriday
Plugin Icon 128x128 SiteOrigin Widgets Bundle
Version 1.6.0
Comparing to
See all releases

Code changes from version 1.15.9 to 1.6.0

Files changed (96) hide show
  1. admin/admin.min.js +1 -1
  2. admin/trianglify.min.js +23 -1
  3. base/base.php +1 -1
  4. base/css/admin.css +1 -1
  5. base/inc/fields/css/measurement-field.css +1 -1
  6. base/inc/fields/css/media-field.css +1 -1
  7. base/inc/fields/js/autocomplete-field.min.js +1 -1
  8. base/inc/fields/js/code-field.min.js +1 -1
  9. base/inc/fields/js/date-range-field.min.js +1 -1
  10. base/inc/fields/js/icon-field.min.js +1 -1
  11. base/inc/fields/js/image-radio-field.min.js +1 -1
  12. base/inc/fields/js/media-field.min.js +1 -1
  13. base/inc/fields/js/multi-measurement-field.min.js +1 -1
  14. base/inc/fields/js/order-field.min.js +1 -1
  15. base/inc/fields/js/posts-field.min.js +1 -1
  16. base/inc/fields/js/presets-field.min.js +1 -1
  17. base/inc/fields/js/tinymce-field-pre48.min.js +1 -1
  18. base/inc/fields/js/tinymce-field.min.js +1 -1
  19. base/inc/lib/Less/Configurable.php +68 -68
  20. base/inc/lib/Less/Exception/Chunk.php +5 -0
  21. base/inc/lib/Less/Exception/Compiler.php +10 -10
  22. base/inc/lib/Less/Exception/Parser.php +125 -125
  23. base/inc/lib/Less/Output/Mapped.php +121 -121
  24. base/inc/lib/Less/Parser.php +1 -1
  25. base/inc/lib/Less/SourceMap/Generator.php +364 -364
  26. base/inc/lib/Less/Tree/Dimension.php +0 -1
  27. base/inc/post-selector.php +0 -5
  28. base/inc/routes/siteorigin-widgets-resource.class.php +24 -19
  29. base/inc/widget-manager.class.php +19 -2
  30. base/js/admin.min.js +1 -1
  31. base/js/meta-box-manager.min.js +1 -1
  32. base/siteorigin-widget.class.php +13 -13
  33. base/tpl/posts-selector/modal.html +0 -24
  34. base/tpl/posts-selector/post.html +0 -10
  35. base/tpl/posts-selector/selector.html +0 -13
  36. compat/beaver-builder/sowb-beaver-builder.min.js +1 -1
  37. compat/block-editor/widget-block.js +24 -32
  38. compat/block-editor/widget-block.min.js +1 -1
  39. compat/block-editor/widget-block.php +47 -17
  40. compat/elementor/sowb-elementor.min.js +1 -1
  41. compat/visual-composer/front_enqueue_js.min.js +1 -1
  42. compat/visual-composer/sowb-vc-widget.min.js +1 -1
  43. js/jquery.cycle.min.js +24 -1
  44. js/jquery.cycle.swipe.min.js +2 -1
  45. js/jquery.touchSwipe.min.js +1 -1
  46. js/lib/imagesloaded.pkgd.min.js +25 -1
  47. js/lib/packery.pkgd.min.js +67 -1
  48. js/lib/pikaday.jquery.min.js +6 -1
  49. js/lib/pikaday.min.js +6 -1
  50. js/slider/jquery.slider.min.js +1 -1
  51. js/sow.google-map.min.js +1 -1
  52. js/sow.jquery.fittext.min.js +10 -1
  53. lang/so-widgets-bundle.pot +119 -99
  54. readme.txt +31 -4
  55. so-widgets-bundle.php +2 -2
  56. widgets/accordion/js/accordion.js +6 -3
  57. widgets/accordion/js/accordion.min.js +1 -1
  58. widgets/accordion/styles/default.less +37 -8
  59. widgets/accordion/tpl/default.php +1 -1
  60. widgets/contact/contact.php +28 -12
  61. widgets/contact/js/contact.min.js +1 -1
  62. widgets/contact/styles/default.less +5 -7
  63. widgets/cta/js/cta.min.js +1 -1
  64. widgets/editor/editor.php +33 -9
  65. widgets/features/features.php +16 -0
  66. widgets/features/styles/default.less +3 -2
  67. widgets/features/tpl/default.php +8 -4
  68. widgets/google-map/fields/js/location-field.min.js +1 -1
  69. widgets/google-map/js/static-map.min.js +1 -1
  70. widgets/hero/styles/default.less +17 -0
  71. widgets/image-grid/image-grid.php +2 -1
  72. widgets/image-grid/js/image-grid.min.js +1 -1
  73. widgets/layout-slider/styles/default.less +17 -0
  74. widgets/post-carousel/js/carousel.js +26 -22
  75. widgets/post-carousel/js/carousel.min.js +1 -1
  76. widgets/post-carousel/post-carousel.php +12 -4
  77. widgets/post-carousel/tpl/base.php +3 -1
  78. widgets/price-table/js/pricetable.min.js +1 -1
  79. widgets/price-table/price-table.php +1 -1
  80. widgets/simple-masonry/js/simple-masonry.min.js +1 -1
  81. widgets/simple-masonry/tpl/default.php +4 -1
  82. widgets/social-media-buttons/js/social-media-buttons-admin.min.js +1 -1
  83. widgets/social-media-buttons/social-media-buttons.php +17 -3
  84. widgets/social-media-buttons/styles/atom.less +5 -7
  85. widgets/social-media-buttons/styles/flat.less +2 -3
  86. widgets/social-media-buttons/styles/widget-mixins.less +22 -26
  87. widgets/social-media-buttons/styles/wire.less +7 -8
  88. widgets/social-media-buttons/tpl/default.php +8 -2
  89. widgets/tabs/js/tabs.js +5 -3
  90. widgets/tabs/js/tabs.min.js +1 -1
  91. widgets/tabs/styles/default.less +22 -0
  92. widgets/tabs/tpl/default.php +1 -1
  93. widgets/testimonial/styles/default.less +4 -12
  94. widgets/testimonial/testimonial.php +12 -9
  95. widgets/testimonial/tpl/default.php +7 -5
  96. widgets/video/js/so-video-widget.min.js +1 -1
admin/admin.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(a){a(".so-widget-toggle-active button").click(function(){var i=a(this),s=i.data("status"),t=i.closest(".so-widget");s?t.addClass("so-widget-is-active").removeClass("so-widget-is-inactive"):t.removeClass("so-widget-is-active").addClass("so-widget-is-inactive"),a.post(soWidgetsAdmin.toggleUrl,{widget:t.data("id"),active:s},function(i){})}),a(".so-widget-banner").each(function(){var i=a(this),s=i.find("img");if(s.length)128<s.width()&&s.css("margin-left",-(s.width()-128)/2);else{var t=Trianglify({width:128,height:128,variance:1,cell_size:32,seed:i.data("seed")});i.append(t.svg())}});function i(){var s=a(this).val().toLowerCase();""===s?a(".so-widget-wrap").show():a(".so-widget").each(function(){var i=a(this);-1<i.find("h3").html().toLowerCase().indexOf(s)?i.parent().show():i.parent().hide()})}a("#sow-widget-search input").on({keyup:i,search:i}),a(window).resize(function(){var i=a(".so-widget-text").css("height","auto"),s=0;i.each(function(){s=Math.max(s,a(this).height())}),i.each(function(){a(this).css("height",s)})}).resize(),a("#sow-widgets-page .page-nav a").click(function(i){i.preventDefault();var s=a(this),t=s.attr("href"),e=s.closest("li");switch(a("#sow-widgets-page .page-nav li").not(e).removeClass("active"),e.addClass("active"),t){case"#all":a(".so-widget-wrap").show();break;case"#enabled":a(".so-widget-wrap").hide(),a(".so-widget-wrap .so-widget-is-active").each(function(){a(this).closest(".so-widget-wrap").show()}),a(".so-widget-wrap .so-widget-is-inactive").each(function(){a(this).closest(".so-widget-wrap").hide()});break;case"#disabled":a(".so-widget-wrap .so-widget-is-active").each(function(){a(this).closest(".so-widget-wrap").hide()}),a(".so-widget-wrap .so-widget-is-inactive").each(function(){a(this).closest(".so-widget-wrap").show()})}a(window).resize()}),a("#widgets-list").addClass("so-animated");var t=a("#sow-settings-dialog");if(a("#widgets-list .so-widget-settings").click(function(i){var s=a(this);i.preventDefault(),t.find(".so-content").empty().addClass("so-loading").load(s.data("form-url"),function(){a(this).removeClass("so-loading")}),t.show()}),t.find(".so-close").click(function(i){i.preventDefault(),t.hide()}),t.find(".so-save").click(function(i){i.preventDefault();var s=a(this);s.prop("disabled",!0),a("#widgets-list .so-widget-settings").prop("disabled",!0),t.find("form").submit(function(){s.prop("disabled",!1),t.hide()}).submit()}),a("#so-widget-settings-save").load(function(){a("#widgets-list .so-widget-settings").prop("disabled",!1)}),window.location.hash&&"#settings-"===window.location.hash.substring(0,10)){var s=window.location.hash.substring(10);a('div[data-id="'+s+'"] button.so-widget-settings').click()}});
1
+ jQuery((function(i){i(".so-widget-toggle-active button").click((function(){var s=i(this),t=s.data("status"),e=s.closest(".so-widget");t?e.addClass("so-widget-is-active").removeClass("so-widget-is-inactive"):e.removeClass("so-widget-is-active").addClass("so-widget-is-inactive"),i.post(soWidgetsAdmin.toggleUrl,{widget:e.data("id"),active:t},(function(i){}))})),i(".so-widget-banner").each((function(){var s=i(this),t=s.find("img");if(t.length)t.width()>128&&t.css("margin-left",-(t.width()-128)/2);else{var e=Trianglify({width:128,height:128,variance:1,cell_size:32,seed:s.data("seed")});s.append(e.svg())}}));var s=function(){var s=i(this).val().toLowerCase();""===s?i(".so-widget-wrap").show():i(".so-widget").each((function(){var t=i(this);t.find("h3").html().toLowerCase().indexOf(s)>-1?t.parent().show():t.parent().hide()}))};i("#sow-widget-search input").on({keyup:s,search:s}),i(window).resize((function(){var s=i(".so-widget-text").css("height","auto"),t=0;s.each((function(){t=Math.max(t,i(this).height())})),s.each((function(){i(this).css("height",t)}))})).resize(),i("#sow-widgets-page .page-nav a").click((function(s){s.preventDefault();var t=i(this),e=t.attr("href"),a=t.closest("li");switch(i("#sow-widgets-page .page-nav li").not(a).removeClass("active"),a.addClass("active"),e){case"#all":i(".so-widget-wrap").show();break;case"#enabled":i(".so-widget-wrap").hide(),i(".so-widget-wrap .so-widget-is-active").each((function(){i(this).closest(".so-widget-wrap").show()})),i(".so-widget-wrap .so-widget-is-inactive").each((function(){i(this).closest(".so-widget-wrap").hide()}));break;case"#disabled":i(".so-widget-wrap .so-widget-is-active").each((function(){i(this).closest(".so-widget-wrap").hide()})),i(".so-widget-wrap .so-widget-is-inactive").each((function(){i(this).closest(".so-widget-wrap").show()}))}i(window).resize()})),i("#widgets-list").addClass("so-animated");var t=i("#sow-settings-dialog");if(i("#widgets-list .so-widget-settings").click((function(s){var e=i(this);s.preventDefault(),t.find(".so-content").empty().addClass("so-loading").load(e.data("form-url"),(function(){i(this).removeClass("so-loading")})),t.show()})),t.find(".so-close").click((function(i){i.preventDefault(),t.hide()})),t.find(".so-save").click((function(s){s.preventDefault();var e=i(this);e.prop("disabled",!0),i("#widgets-list .so-widget-settings").prop("disabled",!0),t.find("form").submit((function(){e.prop("disabled",!1),t.hide()})).submit()})),i("#so-widget-settings-save").load((function(){i("#widgets-list .so-widget-settings").prop("disabled",!1)})),window.location.hash&&"#settings-"===window.location.hash.substring(0,10)){var e=window.location.hash.substring(10);i('div[data-id="'+e+'"] button.so-widget-settings').click()}}));
admin/trianglify.min.js CHANGED
@@ -1 +1,23 @@
1
- !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Trianglify=e()}}(function(){return function a(o,i,s){function d(n,e){if(!i[n]){if(!o[n]){var r="function"==typeof require&&require;if(!e&&r)return r(n,!0);if(c)return c(n,!0);var t=new Error("Cannot find module '"+n+"'");throw t.code="MODULE_NOT_FOUND",t}var f=i[n]={exports:{}};o[n][0].call(f.exports,function(e){var r=o[n][1][e];return d(r||e)},f,f.exports,a,o,i,s)}return i[n].exports}for(var c="function"==typeof require&&require,e=0;e<s.length;e++)d(s[e]);return d}({"./lib/trianglify.js":[function(e,r,n){var _=e("delaunay-fast"),k=e("seedrandom"),j=e("chroma-js"),t=e("./colorbrewer"),M=e("./pattern"),N={width:600,height:400,cell_size:75,variance:.75,seed:null,x_colors:"random",y_colors:"match_x",palette:t,color_space:"lab",color_function:null,stroke_width:1.51};function f(i){if(i=function(e,r){var n={};for(var t in e)n[t]=e[t];for(t in r){if(!e.hasOwnProperty(t))throw new Error(t+" is not a configuration option for Trianglify. Check your spelling?");n[t]=r[t]}return n}(N,i),rand=k(i.seed),"random"===i.x_colors&&(i.x_colors=x()),"random"===i.y_colors&&(i.y_colors=x()),"match_x"===i.y_colors&&(i.y_colors=i.x_colors),!(0<i.width&&0<i.height))throw new Error("Width and height must be numbers greater than 0");if(i.cell_size<2)throw new Error("Cell size must be greater than 2.");var e;if(i.color_function)e=function(e,r){return j(i.color_function(e,r))};else{var n=j.scale(i.x_colors).mode(i.color_space),t=j.scale(i.y_colors).mode(i.color_space);e=function(e,r){return j.interpolate(n(e),t(r),.5,i.color_space)}}function r(e){return b[e]}for(var f,a=i.width,o=i.height,s=Math.floor((a+4*i.cell_size)/i.cell_size),d=Math.floor((o+4*i.cell_size)/i.cell_size),c=(s*i.cell_size-a)/2,u=(d*i.cell_size-o)/2,l=i.cell_size*i.variance/2,b=function(e,r){for(var n=[],t=-c;t<e+c;t+=i.cell_size)for(var f=-u;f<r+u;f+=i.cell_size){var a=t+i.cell_size/2+v(rand(),[0,1],[-l,l]),o=f+i.cell_size/2+v(rand(),[0,1],[-l,l]);n.push([a,o].map(Math.floor))}return n}(a,o),h=_.triangulate(b),g=[],p=0;p<h.length;p+=3){var m=[h[p],h[p+1],h[p+2]].map(r),y={x:((f=m)[0][0]+f[1][0]+f[2][0])/3,y:(f[0][1]+f[1][1]+f[2][1])/3},w=e(v(y.x,[-c,a+c],[0,1]),v(y.y,[-u,o+u],[0,1])).hex();g.push([w,m])}return M(g,i);function v(e,r,n){return(e-r[0])*(n[1]-n[0])/(r[1]-r[0])+n[0]}function x(){if(i.palette instanceof Array)return i.palette[Math.floor(rand()*i.palette.length)];var e=Object.keys(i.palette);return i.palette[e[Math.floor(rand()*e.length)]]}}f.colorbrewer=t,f.defaults=N,r.exports=f},{"./colorbrewer":"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js","./pattern":"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js","chroma-js":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js","delaunay-fast":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js",seedrandom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js"}],"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js":[function(e,r,n){r.exports={YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]}},{}],"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js":[function(a,e,r){(function(n){var f="undefined"!=typeof document?document:a("jsdom").jsdom("<html/>");e.exports=function(r,t){function e(e){if(void 0!==n)try{a("canvas")}catch(e){throw Error("The optional node-canvas dependency is needed for Trianglify to render using canvas in node.")}return(e=e||f.createElement("canvas")).setAttribute("width",t.width),e.setAttribute("height",t.height),ctx=e.getContext("2d"),ctx.canvas.width=t.width,ctx.canvas.height=t.height,r.forEach(function(e){ctx.fillStyle=ctx.strokeStyle=e[0],ctx.lineWidth=t.stroke_width,ctx.beginPath(),ctx.moveTo.apply(ctx,e[1][0]),ctx.lineTo.apply(ctx,e[1][1]),ctx.lineTo.apply(ctx,e[1][2]),ctx.fill(),ctx.stroke()}),e}return{polys:r,opts:t,svg:function(){var n=f.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("width",t.width),n.setAttribute("height",t.height),r.forEach(function(e){var r=f.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("d","M"+e[1].join("L")+"Z"),r.setAttribute("fill",e[0]),r.setAttribute("stroke",e[0]),r.setAttribute("stroke-width",t.stroke_width),n.appendChild(r)}),n},canvas:e,png:function(){return e().toDataURL("image/png")}}}}).call(this,a("_process"))},{_process:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js",canvas:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js",jsdom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js":[function(e,r,n){},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js":[function(e,r,n){var t=r.exports={},f=[],a=!1;function o(){if(!a){var e;a=!0;for(var r=f.length;r;){e=f,f=[];for(var n=-1;++n<r;)e[n]();r=f.length}a=!1}}function i(){}t.nextTick=function(e){f.push(e),a||setTimeout(o,0)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=i,t.addListener=i,t.once=i,t.off=i,t.removeListener=i,t.removeAllListeners=i,t.emit=i,t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js":[function(e,P,z){(function(){var f,i,s,l,fe,g,d,t,p,m,y,w,c,v,u,b,x,h,r,a,e,n,o,_,k,j,M,ae,N,D,U;function A(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b,h;for(f=this,n=[],s=0,d=arguments.length;s<d;s++)null!=(r=arguments[s])&&n.push(r);if(0===n.length)a=(c=[255,0,255,1,"rgb"])[0],o=c[1],i=c[2],e=c[3],t=c[4];else if("array"===ae(n[0])){if(3===n[0].length)a=(u=n[0])[0],o=u[1],i=u[2],e=1;else{if(4!==n[0].length)throw"unknown input argument";a=(l=n[0])[0],o=l[1],i=l[2],e=l[3]}t=null!=(b=n[1])?b:"rgb"}else"string"===ae(n[0])?(a=n[0],t="hex"):"object"===ae(n[0])?(a=(h=n[0]._rgb)[0],o=h[1],i=h[2],e=h[3],t="rgb"):3<=n.length&&(a=n[0],o=n[1],i=n[2]);3===n.length?(t="rgb",e=1):4===n.length?"string"===ae(n[3])?(t=n[3],e=1):"number"===ae(n[3])&&(t="rgb",e=n[3]):5===n.length&&(e=n[3],t=n[4]),null==e&&(e=1),"rgb"===t?f._rgb=[a,o,i,e]:"gl"===t?f._rgb=[255*a,255*o,255*i,e]:"hsl"===t?(f._rgb=y(a,o,i),f._rgb[3]=e):"hsv"===t?(f._rgb=w(a,o,i),f._rgb[3]=e):"hex"===t?f._rgb=p(a):"lab"===t?(f._rgb=v(a,o,i),f._rgb[3]=e):"lch"===t?(f._rgb=x(a,o,i),f._rgb[3]=e):"hsi"===t&&(f._rgb=m(a,o,i),f._rgb[3]=e),g(f._rgb)}fe=function(e,r,n,t){return new f(e,r,n,t)},null!=P&&null!=P.exports&&(P.exports=fe),((null!=z?z:this).chroma=fe).color=function(e,r,n,t){return new f(e,r,n,t)},fe.hsl=function(e,r,n,t){return new f(e,r,n,t,"hsl")},fe.hsv=function(e,r,n,t){return new f(e,r,n,t,"hsv")},fe.rgb=function(e,r,n,t){return new f(e,r,n,t,"rgb")},fe.hex=function(e){return new f(e)},fe.css=function(e){return new f(e)},fe.lab=function(e,r,n){return new f(e,r,n,"lab")},fe.lch=function(e,r,n){return new f(e,r,n,"lch")},fe.hsi=function(e,r,n){return new f(e,r,n,"hsi")},fe.gl=function(e,r,n,t){return new f(255*e,255*r,255*n,t,"gl")},fe.mix=fe.interpolate=function(e,r,n,t){return null==e||null==r?"#000":("string"===ae(e)&&(e=new f(e)),"string"===ae(r)&&(r=new f(r)),e.interpolate(n,r,t))},fe.contrast=function(e,r){var n,t;return"string"===ae(e)&&(e=new f(e)),"string"===ae(r)&&(r=new f(r)),n=e.luminance(),(t=r.luminance())<n?(n+.05)/(t+.05):(t+.05)/(n+.05)},fe.luminance=function(e){return fe(e).luminance()},fe._Color=f,A.prototype.rgb=function(){return this._rgb.slice(0,3)},A.prototype.rgba=function(){return this._rgb},A.prototype.hex=function(){return e(this._rgb)},A.prototype.toString=function(){return this.name()},A.prototype.hsl=function(){return o(this._rgb)},A.prototype.hsv=function(){return _(this._rgb)},A.prototype.lab=function(){return k(this._rgb)},A.prototype.lch=function(){return j(this._rgb)},A.prototype.hsi=function(){return n(this._rgb)},A.prototype.gl=function(){return[this._rgb[0]/255,this._rgb[1]/255,this._rgb[2]/255,this._rgb[3]]},A.prototype.luminance=function(f,a){var e,o,i;return null==a&&(a="rgb"),arguments.length?(0===f&&(this._rgb=[0,0,0,this._rgb[3]]),1===f&&(this._rgb=[255,255,255,this._rgb[3]]),e=r(this._rgb),o=20,i=function(e,r){var n,t;return n=(t=e.interpolate(.5,r,a)).luminance(),Math.abs(f-n)<1e-7||!o--?t:f<n?i(e,t):i(t,r)},this._rgb=(f<e?i(new A("black"),this):i(this,new A("white"))).rgba(),this):r(this._rgb)},A.prototype.name=function(){var e,r;for(r in e=this.hex(),fe.colors)if(e===fe.colors[r])return r;return e},A.prototype.alpha=function(e){return arguments.length?(this._rgb[3]=e,this):this._rgb[3]},A.prototype.css=function(e){var r,n,t;return null==e&&(e="rgb"),n=this._rgb,3===e.length&&n[3]<1&&(e+="a"),"rgb"===e?e+"("+n.slice(0,3).map(Math.round).join(",")+")":"rgba"===e?e+"("+n.slice(0,3).map(Math.round).join(",")+","+n[3]+")":"hsl"===e||"hsla"===e?(t=function(e){return Math.round(100*e)/100},(r=this.hsl())[0]=t(r[0]),r[1]=t(100*r[1])+"%",r[2]=t(100*r[2])+"%",4===e.length&&(r[3]=n[3]),e+"("+r.join(",")+")"):void 0},A.prototype.interpolate=function(e,r,n){var t,f,a,o,i,s,d,c,u,l,b,h,g;if(d=this,null==n&&(n="rgb"),"string"===ae(r)&&(r=new A(r)),"hsl"===n||"hsv"===n||"lch"===n||"hsi"===n)"hsl"===n?(h=d.hsl(),g=r.hsl()):"hsv"===n?(h=d.hsv(),g=r.hsv()):"hsi"===n?(h=d.hsi(),g=r.hsi()):"lch"===n&&(h=d.lch(),g=r.lch()),"h"===n.substr(0,1)?(f=h[0],l=h[1],i=h[2],a=g[0],b=g[1],s=g[2]):(i=h[0],l=h[1],f=h[2],s=g[0],b=g[1],a=g[2]),isNaN(f)||isNaN(a)?isNaN(f)?isNaN(a)?t=Number.NaN:(t=a,1!==i&&0!==i||"hsv"===n||(u=b)):(t=f,1!==s&&0!==s||"hsv"===n||(u=l)):t=f+e*(f<a&&180<a-f?a-(f+360):a<f&&180<f-a?a+360-f:a-f),null==u&&(u=l+e*(b-l)),o=i+e*(s-i),c="h"===n.substr(0,1)?new A(t,u,o,n):new A(o,u,t,n);else if("rgb"===n)h=d._rgb,g=r._rgb,c=new A(h[0]+e*(g[0]-h[0]),h[1]+e*(g[1]-h[1]),h[2]+e*(g[2]-h[2]),n);else{if("lab"!==n)throw"color mode "+n+" is not supported";h=d.lab(),g=r.lab(),c=new A(h[0]+e*(g[0]-h[0]),h[1]+e*(g[1]-h[1]),h[2]+e*(g[2]-h[2]),n)}return c.alpha(d.alpha()+e*(r.alpha()-d.alpha())),c},A.prototype.premultiply=function(){var e,r;return r=this.rgb(),e=this.alpha(),fe(r[0]*e,r[1]*e,r[2]*e,e)},A.prototype.darken=function(e){var r;return null==e&&(e=20),(r=this.lch())[0]-=e,fe.lch(r).alpha(this.alpha())},A.prototype.darker=function(e){return this.darken(e)},A.prototype.brighten=function(e){return null==e&&(e=20),this.darken(-e)},A.prototype.brighter=function(e){return this.brighten(e)},A.prototype.saturate=function(e){var r;return null==e&&(e=20),(r=this.lch())[1]+=e,fe.lch(r).alpha(this.alpha())},A.prototype.desaturate=function(e){return null==e&&(e=20),this.saturate(-e)},f=A,g=function(e){var r;for(r in e)r<3?(e[r]<0&&(e[r]=0),255<e[r]&&(e[r]=255)):3===r&&(e[r]<0&&(e[r]=0),1<e[r]&&(e[r]=1));return e},t=function(e){var r,n,t,f,a,o,i,s;if(e=e.toLowerCase(),null!=fe.colors&&fe.colors[e])return p(fe.colors[e]);if(t=e.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(f=t.slice(1,4),n=a=0;a<=2;n=++a)f[n]=+f[n];f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(f=t.slice(1,5),n=o=0;o<=3;n=++o)f[n]=+f[n];else if(t=e.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(f=t.slice(1,4),n=i=0;i<=2;n=++i)f[n]=Math.round(2.55*f[n]);f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(f=t.slice(1,5),n=s=0;s<=2;n=++s)f[n]=Math.round(2.55*f[n]);f[3]=+f[3]}else(t=e.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(f=y(r))[3]=1):(t=e.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(f=y(r))[3]=+t[4]);return f},p=function(e){var r,n;if(e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})#x2F;))return 4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[(n=parseInt(e,16))>>16,n>>8&255,255&n,1];if(e.match(/^#?([A-Fa-f0-9]{8})#x2F;))return 9===e.length&&(e=e.substr(1)),[(n=parseInt(e,16))>>24&255,n>>16&255,n>>8&255,255&n];if(r=t(e))return r;throw"unknown color: "+e},m=function(e,r,n){var t,f,a,o;return e=(o=N(arguments))[0],r=o[1],n=o[2],(e/=360)<1/3?f=1-((t=(1-r)/3)+(a=(1+r*d(s*e)/d(i-s*e))/3)):e<2/3?t=1-((a=(1-r)/3)+(f=(1+r*d(s*(e-=1/3))/d(i-s*e))/3)):a=1-((f=(1-r)/3)+(t=(1+r*d(s*(e-=2/3))/d(i-s*e))/3)),[255*(a=h(n*a*3)),255*(f=h(n*f*3)),255*(t=h(n*t*3))]},y=function(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b;if(t=(l=N(arguments))[0],i=l[1],a=l[2],0===i)o=n=e=255*a;else{for(r=[0,0,0],s=2*a-(d=a<.5?a*(1+i):a+i-a*i),(c=[0,0,0])[0]=(t/=360)+1/3,c[1]=t,c[2]=t-1/3,f=u=0;u<=2;f=++u)c[f]<0&&(c[f]+=1),1<c[f]&&(c[f]-=1),6*c[f]<1?r[f]=s+6*(d-s)*c[f]:2*c[f]<1?r[f]=d:3*c[f]<2?r[f]=s+(d-s)*(2/3-c[f])*6:r[f]=s;o=(b=[Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])])[0],n=b[1],e=b[2]}return[o,n,e]},w=function(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b,h,g,p,m;if(t=(u=N(arguments))[0],s=u[1],c=u[2],c*=255,0===s)i=n=e=c;else switch(360===t&&(t=0),360<t&&(t-=360),t<0&&(t+=360),a=c*(1-s),o=c*(1-s*(r=(t/=60)-(f=Math.floor(t)))),d=c*(1-s*(1-r)),f){case 0:i=(l=[c,d,a])[0],n=l[1],e=l[2];break;case 1:i=(b=[o,c,a])[0],n=b[1],e=b[2];break;case 2:i=(h=[a,c,d])[0],n=h[1],e=h[2];break;case 3:i=(g=[a,o,c])[0],n=g[1],e=g[2];break;case 4:i=(p=[d,a,c])[0],n=p[1],e=p[2];break;case 5:i=(m=[c,a,o])[0],n=m[1],e=m[2]}return[i=Math.round(i),n=Math.round(n),e=Math.round(e)]},c=function(){var e,r,n,t;return n=(t=N(arguments))[0],e=t[1],r=t[2],[n,Math.sqrt(e*e+r*r),Math.atan2(r,e)/Math.PI*180]},v=function(e,r,n){var t,f,a,o,i,s,d;return void 0!==e&&3===e.length&&(e=(s=e)[0],r=s[1],n=s[2]),void 0!==e&&3===e.length&&(e=(d=e)[0],r=d[1],n=d[2]),i=(o=(e+16)/116)-n/200,a=.95047*u(a=o+r/500),o=1*u(o),i=1.08883*u(i),f=U(3.2404542*a-1.5371385*o-.4985314*i),t=U(-.969266*a+1.8760108*o+.041556*i),n=U(.0556434*a-.2040259*o+1.0572252*i),[h(f,0,255),h(t,0,255),h(n,0,255),1]},u=function(e){return.206893034<e?e*e*e:(e-4/29)/7.787037},U=function(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))},b=function(){var e,r,n,t;return n=(t=N(arguments))[0],e=t[1],r=(r=t[2])*Math.PI/180,[n,Math.cos(r)*e,Math.sin(r)*e]},x=function(e,r,n){var t,f,a,o,i,s,d;return t=(s=b(e,r,n))[0],f=s[1],a=s[2],i=(d=v(t,f,a))[0],o=d[1],a=d[2],[h(i,0,255),h(o,0,255),h(a,0,255)]},r=function(e,r,n){var t;return e=(t=N(arguments))[0],r=t[1],n=t[2],.2126*(e=a(e))+.7152*(r=a(r))+.0722*(n=a(n))},a=function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},e=function(){var e,r;return"#"+(e="000000"+((r=N(arguments))[0]<<16|r[1]<<8|r[2]).toString(16)).substr(e.length-6)},n=function(){var e,r,n,t,f,a,o,i;return a=(i=N(arguments))[0],n=i[1],r=i[2],e=2*Math.PI,a/=255,n/=255,r/=255,0==(o=1-Math.min(a,n,r)/(f=(a+n+r)/3))?t=0:(t=(a-n+(a-r))/2,t/=Math.sqrt((a-n)*(a-n)+(a-r)*(n-r)),t=Math.acos(t),n<r&&(t=e-t),t/=e),[360*t,o,f]},o=function(e,r,n){var t,f,a,o,i,s;return void 0!==e&&3<=e.length&&(e=(s=e)[0],r=s[1],n=s[2]),e/=255,r/=255,n/=255,o=Math.min(e,r,n),f=((a=Math.max(e,r,n))+o)/2,a===o?(i=0,t=Number.NaN):i=f<.5?(a-o)/(a+o):(a-o)/(2-a-o),e===a?t=(r-n)/(a-o):r===a?t=2+(n-e)/(a-o):n===a&&(t=4+(e-r)/(a-o)),(t*=60)<0&&(t+=360),[t,i,f]},_=function(){var e,r,n,t,f,a,o,i,s,d;return o=(d=N(arguments))[0],n=d[1],e=d[2],a=Math.min(o,n,e),r=(f=Math.max(o,n,e))-a,s=f/255,0===f?(t=Number.NaN,i=0):(i=r/f,o===f&&(t=(n-e)/r),n===f&&(t=2+(e-o)/r),e===f&&(t=4+(o-n)/r),(t*=60)<0&&(t+=360)),[t,i,s]},k=function(){var e,r,n,t,f,a;return n=(a=N(arguments))[0],r=a[1],e=a[2],n=M(n),r=M(r),e=M(e),t=D((.4124564*n+.3575761*r+.1804375*e)/.95047),[116*(f=D((.2126729*n+.7151522*r+.072175*e)/1))-16,500*(t-f),200*(f-D((.0193339*n+.119192*r+.9503041*e)/1.08883))]},M=function(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},D=function(e){return.008856<e?Math.pow(e,1/3):7.787037*e+4/29},j=function(){var e,r,n,t,f,a,o;return f=(a=N(arguments))[0],n=a[1],r=a[2],t=(o=k(f,n,r))[0],e=o[1],r=o[2],c(t,e,r)},fe.scale=function(i,e){var s,d,c,u,n,a,l,b,h,r,g,p,m,y,w,v,t,x,o;return y="rgb",w=fe("#ccc"),!1,g=[o=0,1],t=!(h=[]),x=[],r=!(p=1),v=m=0,b={},n=function(e,r){var n,t,f,a,o,i,s;if(null==e&&(e=["#ddd","#222"]),null!=e&&"string"===ae(e)&&null!=(null!=(o=fe.brewer)?o[e]:void 0)&&(e=fe.brewer[e]),"array"===ae(e)){for(n=f=0,i=(e=e.slice(0)).length-1;0<=i?f<=i:i<=f;n=0<=i?++f:--f)t=e[n],"string"===ae(t)&&(e[n]=fe(t));if(null!=r)x=r;else for(x=[],n=a=0,s=e.length-1;0<=s?a<=s:s<=a;n=0<=s?++a:--a)x.push(n/(e.length-1))}return u(),h=e},a=function(e){return null==e&&(e=[]),m=(g=e)[0],p=e[e.length-1],u(),v=2===e.length?0:e.length-1},d=function(e){var r,n;if(null==g)return 0;for(n=g.length-1,r=0;r<n&&e>=g[r];)r++;return r-1},l=function(e){return e},function(e){var r,n,t,f,a;return a=e,2<g.length&&(f=g.length-1,r=d(e),t=g[0]+(g[1]-g[0])*(0+.5*o),n=g[f-1]+(g[f]-g[f-1])*(1-.5*o),a=m+(g[r]+.5*(g[r+1]-g[r])-t)/(n-t)*(p-m)),a},c=function(e,r){var n,t,f,a,o,i,s;if(null==r&&(r=!1),isNaN(e))return w;if(o=r?e:2<g.length?d(e)/(v-1):(o=m!==p?(e-m)/(p-m):0,o=(e-m)/(p-m),Math.min(1,Math.max(0,o))),r||(o=l(o)),f=Math.floor(1e4*o),b[f])n=b[f];else{if("array"===ae(h))for(t=i=0,s=x.length-1;0<=s?i<=s:s<=i;t=0<=s?++i:--i){if(o<=(a=x[t])){n=h[t];break}if(a<=o&&t===x.length-1){n=h[t];break}if(a<o&&o<x[t+1]){o=(o-a)/(x[t+1]-a),n=fe.interpolate(h[t],h[t+1],o,y);break}}else"function"===ae(h)&&(n=h(o));b[f]=n}return n},u=function(){return b={}},n(i,e),(s=function(e){var r;return r=c(e),t&&r[t]?r[t]():r}).domain=function(e,r,n,t){var f;return null==n&&(n="e"),arguments.length?(null!=r&&(f=fe.analyze(e,t),e=0===r?[f.min,f.max]:fe.limits(f,n,r)),a(e),s):g},s.mode=function(e){return arguments.length?(y=e,u(),s):y},s.range=function(e,r){return n(e,r),s},s.out=function(e){return t=e,s},s.spread=function(e){return arguments.length?(o=e,s):o},s.correctLightness=function(e){return arguments.length?(r=e,u(),l=r?function(e){var r,n,t,f,a,o,i,s,d;for(r=c(0,!0).lab()[0],n=c(1,!0).lab()[0],i=n<r,t=c(e,!0).lab()[0],f=t-(a=r+(n-r)*e),s=0,d=1,o=20;.01<Math.abs(f)&&0<o--;)i&&(f*=-1),e+=f<0?.5*(d-(s=e)):.5*(s-(d=e)),t=c(e,!0).lab()[0],f=t-a;return e}:function(e){return e},s):r},s.colors=function(e){var r,n,t,f,a,o;if(null==e&&(e="hex"),i=[],n=[],2<g.length)for(r=t=1,o=g.length;1<=o?t<o:o<t;r=1<=o?++t:--t)n.push(.5*(g[r-1]+g[r]));else n=g;for(f=0,a=n.length;f<a;f++)r=n[f],i.push(s(r)[e]());return i},s},null==fe.scales&&(fe.scales={}),fe.scales.cool=function(){return fe.scale([fe.hsl(180,1,.9),fe.hsl(250,.7,.4)])},fe.scales.hot=function(){return fe.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},fe.analyze=function(e,n,t){var f,r,a,o,i,s;if(a={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==t&&(t=function(){return!0}),f=function(e){null==e||isNaN(e)||(a.values.push(e),a.sum+=e,e<a.min&&(a.min=e),e>a.max&&(a.max=e),a.count+=1)},o=function(e,r){if(t(e,r))return null!=n&&"function"===ae(n)?f(n(e)):null!=n&&"string"===ae(n)||"number"===ae(n)?f(e[n]):f(e)},"array"===ae(e))for(i=0,s=e.length;i<s;i++)o(e[i]);else for(r in e)o(e[r],r);return a.domain=[a.min,a.max],a.limits=function(e,r){return fe.limits(a,e,r)},a},fe.limits=function(e,r,n){var t,f,a,o,i,s,d,c,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,B,I,q,R,S,O,C,T,Y,L,F,V,X,W,$,Z,H,J,K,Q,ee,re,ne,te;if(null==r&&(r="equal"),null==n&&(n=7),"array"===ae(e)&&(e=fe.analyze(e)),g=e.min,b=e.max,e.sum,D=e.values.sort(function(e,r){return e-r}),l=[],"c"===r.substr(0,1)&&(l.push(g),l.push(b)),"e"===r.substr(0,1)){for(l.push(g),d=U=1,S=n-1;1<=S?U<=S:S<=U;d=1<=S?++U:--U)l.push(g+d/n*(b-g));l.push(b)}else if("l"===r.substr(0,1)){if(g<=0)throw"Logarithmic scales are only possible for values > 0";for(p=Math.LOG10E*Math.log(g),h=Math.LOG10E*Math.log(b),l.push(g),d=A=1,V=n-1;1<=V?A<=V:V<=A;d=1<=V?++A:--A)l.push(Math.pow(10,p+d/n*(h-p)));l.push(b)}else if("q"===r.substr(0,1)){for(l.push(g),d=P=1,X=n-1;1<=X?P<=X:X<=P;d=1<=X?++P:--P)x=D.length*d/n,(_=Math.floor(x))===x?l.push(D[_]):(k=x-_,l.push(D[_]*k+D[_+1]*(1-k)));l.push(b)}else if("k"===r.substr(0,1)){for(y=D.length,t=new Array(y),i=new Array(n),j=!0,w=0,a=null,(a=[]).push(g),d=z=1,W=n-1;1<=W?z<=W:W<=z;d=1<=W?++z:--z)a.push(g+d/n*(b-g));for(a.push(b);j;){for(c=G=0,$=n-1;0<=$?G<=$:lt;=G;c=0<=$?++G:--G)i[c]=0;for(d=E=0,Z=y-1;0<=Z?E<=Z:Z<=E;d=0<=Z?++E:--E){for(N=D[d],m=Number.MAX_VALUE,c=B=0,H=n-1;0<=H?B<=H:H<=B;c=0<=H?++B:--B)(s=Math.abs(a[c]-N))<m&&(m=s,f=c);i[f]++,t[d]=f}for(v=new Array(n),c=I=0,J=n-1;0<=J?I<=J:J<=I;c=0<=J?++I:--I)v[c]=null;for(d=q=0,K=y-1;0<=K?q<=K:K<=q;d=0<=K?++q:--q)null===v[o=t[d]]?v[o]=D[d]:v[o]+=D[d];for(c=R=0,O=n-1;0<=O?R<=O:O<=R;c=0<=O?++R:--R)v[c]*=1/i[c];for(j=!1,c=Q=0,C=n-1;0<=C?Q<=C:C<=Q;c=0<=C?++Q:--Q)if(v[c]!==a[d]){j=!0;break}a=v,200<++w&&(j=!1)}for(u={},c=ee=0,T=n-1;0<=T?ee<=T:T<=ee;c=0<=T?++ee:--ee)u[c]=[];for(d=re=0,Y=y-1;0<=Y?re<=Y:Y<=re;d=0<=Y?++re:--re)u[o=t[d]].push(D[d]);for(M=[],c=ne=0,L=n-1;0<=L?ne<=L:L<=ne;c=0<=L?++ne:--ne)M.push(u[c][0]),M.push(u[c][u[c].length-1]);for(M=M.sort(function(e,r){return e-r}),l.push(M[0]),d=te=1,F=M.length-1;te<=F;d=te+=2)isNaN(M[d])||l.push(M[d])}return l},fe.brewer={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},fe.colors={indigo:"#4b0082",gold:"#ffd700",hotpink:"#ff69b4",firebrick:"#b22222",indianred:"#cd5c5c",yellow:"#ffff00",mistyrose:"#ffe4e1",darkolivegreen:"#556b2f",olive:"#808000",darkseagreen:"#8fbc8f",pink:"#ffc0cb",tomato:"#ff6347",lightcoral:"#f08080",orangered:"#ff4500",navajowhite:"#ffdead",lime:"#00ff00",palegreen:"#98fb98",darkslategrey:"#2f4f4f",greenyellow:"#adff2f",burlywood:"#deb887",seashell:"#fff5ee",mediumspringgreen:"#00fa9a",fuchsia:"#ff00ff",papayawhip:"#ffefd5",blanchedalmond:"#ffebcd",chartreuse:"#7fff00",dimgray:"#696969",black:"#000000",peachpuff:"#ffdab9",springgreen:"#00ff7f",aquamarine:"#7fffd4",white:"#ffffff",orange:"#ffa500",lightsalmon:"#ffa07a",darkslategray:"#2f4f4f",brown:"#a52a2a",ivory:"#fffff0",dodgerblue:"#1e90ff",peru:"#cd853f",lawngreen:"#7cfc00",chocolate:"#d2691e",crimson:"#dc143c",forestgreen:"#228b22",darkgrey:"#a9a9a9",lightseagreen:"#20b2aa",cyan:"#00ffff",mintcream:"#f5fffa",silver:"#c0c0c0",antiquewhite:"#faebd7",mediumorchid:"#ba55d3",skyblue:"#87ceeb",gray:"#808080",darkturquoise:"#00ced1",goldenrod:"#daa520",darkgreen:"#006400",floralwhite:"#fffaf0",darkviolet:"#9400d3",darkgray:"#a9a9a9",moccasin:"#ffe4b5",saddlebrown:"#8b4513",grey:"#808080",darkslateblue:"#483d8b",lightskyblue:"#87cefa",lightpink:"#ffb6c1",mediumvioletred:"#c71585",slategrey:"#708090",red:"#ff0000",deeppink:"#ff1493",limegreen:"#32cd32",darkmagenta:"#8b008b",palegoldenrod:"#eee8aa",plum:"#dda0dd",turquoise:"#40e0d0",lightgrey:"#d3d3d3",lightgoldenrodyellow:"#fafad2",darkgoldenrod:"#b8860b",lavender:"#e6e6fa",maroon:"#800000",yellowgreen:"#9acd32",sandybrown:"#f4a460",thistle:"#d8bfd8",violet:"#ee82ee",navy:"#000080",magenta:"#ff00ff",dimgrey:"#696969",tan:"#d2b48c",rosybrown:"#bc8f8f",olivedrab:"#6b8e23",blue:"#0000ff",lightblue:"#add8e6",ghostwhite:"#f8f8ff",honeydew:"#f0fff0",cornflowerblue:"#6495ed",slateblue:"#6a5acd",linen:"#faf0e6",darkblue:"#00008b",powderblue:"#b0e0e6",seagreen:"#2e8b57",darkkhaki:"#bdb76b",snow:"#fffafa",sienna:"#a0522d",mediumblue:"#0000cd",royalblue:"#4169e1",lightcyan:"#e0ffff",green:"#008000",mediumpurple:"#9370db",midnightblue:"#191970",cornsilk:"#fff8dc",paleturquoise:"#afeeee",bisque:"#ffe4c4",slategray:"#708090",darkcyan:"#008b8b",khaki:"#f0e68c",wheat:"#f5deb3",teal:"#008080",darkorchid:"#9932cc",deepskyblue:"#00bfff",salmon:"#fa8072",darkred:"#8b0000",steelblue:"#4682b4",palevioletred:"#db7093",lightslategray:"#778899",aliceblue:"#f0f8ff",lightslategrey:"#778899",lightgreen:"#90ee90",orchid:"#da70d6",gainsboro:"#dcdcdc",mediumseagreen:"#3cb371",lightgray:"#d3d3d3",mediumturquoise:"#48d1cc",lemonchiffon:"#fffacd",cadetblue:"#5f9ea0",lightyellow:"#ffffe0",lavenderblush:"#fff0f5",coral:"#ff7f50",purple:"#800080",aqua:"#00ffff",whitesmoke:"#f5f5f5",mediumslateblue:"#7b68ee",darkorange:"#ff8c00",mediumaquamarine:"#66cdaa",darksalmon:"#e9967a",beige:"#f5f5dc",blueviolet:"#8a2be2",azure:"#f0ffff",lightsteelblue:"#b0c4de",oldlace:"#fdf5e6"},ae=function(){var n,e,r,t,f;for(n={},r=0,t=(f="Boolean Number String Function Array Date RegExp Undefined Null".split(" ")).length;r<t;r++)e=f[r],n["[object "+e+"]"]=e.toLowerCase();return function(e){var r;return r=Object.prototype.toString.call(e),n[r]||"object"}}(),h=function(e,r,n){return null==r&&(r=0),null==n&&(n=1),e<r&&(e=r),n<e&&(e=n),e},N=function(e){return 3<=e.length?e:e[0]},s=2*Math.PI,i=Math.PI/3,d=Math.cos,l=function(t){var e,r,n,f,a,o,i,s,d,c,u;return 2===(t=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)f=t[e],n.push(fe(f));return n}()).length?(d=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)f=t[e],n.push(f.lab());return n}(),a=d[0],o=d[1],e=function(n){var t,e;return e=function(){var e,r;for(r=[],t=e=0;e<=2;t=++e)r.push(a[t]+n*(o[t]-a[t]));return r}(),fe.lab.apply(fe,e)}):3===t.length?(c=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)f=t[e],n.push(f.lab());return n}(),a=c[0],o=c[1],i=c[2],e=function(n){var t,e;return e=function(){var e,r;for(r=[],t=e=0;e<=2;t=++e)r.push((1-n)*(1-n)*a[t]+2*(1-n)*n*o[t]+n*n*i[t]);return r}(),fe.lab.apply(fe,e)}):4===t.length?(u=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)f=t[e],n.push(f.lab());return n}(),a=u[0],o=u[1],i=u[2],s=u[3],e=function(n){var t,e;return e=function(){var e,r;for(r=[],t=e=0;e<=2;t=++e)r.push((1-n)*(1-n)*(1-n)*a[t]+3*(1-n)*(1-n)*n*o[t]+3*(1-n)*n*n*i[t]+n*n*n*s[t]);return r}(),fe.lab.apply(fe,e)}):5===t.length&&(r=l(t.slice(0,3)),n=l(t.slice(2,5)),e=function(e){return e<.5?r(2*e):n(2*(e-.5))}),e},fe.interpolate.bezier=l}).call(this)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js":[function(e,r,n){var t;!function(){"use strict";var _=1/1048576;function g(e,r,n,t){var f,a,o,i,s,d,c,u,l,b,h=e[r][0],g=e[r][1],p=e[n][0],m=e[n][1],y=e[t][0],w=e[t][1],v=Math.abs(g-m),x=Math.abs(m-w);if(v<_&&x<_)throw new Error("Eek! Coincident points!");return a=v<_?(i=-(y-p)/(w-m))*((f=(p+h)/2)-(d=(p+y)/2))+(u=(m+w)/2):x<_?(o=-(p-h)/(m-g))*((f=(y+p)/2)-(s=(h+p)/2))+(c=(g+m)/2):(f=((o=-(p-h)/(m-g))*(s=(h+p)/2)-(i=-(y-p)/(w-m))*(d=(p+y)/2)+(u=(m+w)/2)-(c=(g+m)/2))/(o-i),x<v?o*(f-s)+c:i*(f-d)+u),{i:r,j:n,k:t,x:f,y:a,r:(l=p-f)*l+(b=m-a)*b}}function p(e){var r,n,t,f,a,o;for(n=e.length;n;)for(f=e[--n],t=e[--n],r=n;r;)if(o=e[--r],t===(a=e[--r])&&f===o||t===o&&f===a){e.splice(n,2),e.splice(r,2);break}}t={triangulate:function(n,e){var r,t,f,a,o,i,s,d,c,u,l,b,h=n.length;if(h<3)return[];if(n=n.slice(0),e)for(r=h;r--;)n[r]=n[r][e];for(f=new Array(h),r=h;r--;)f[r]=r;for(f.sort(function(e,r){return n[r][0]-n[e][0]}),a=function(e){var r,n,t,f,a,o,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(r=e.length;r--;)e[r][0]<i&&(i=e[r][0]),e[r][0]>d&&(d=e[r][0]),e[r][1]<s&&(s=e[r][1]),e[r][1]>c&&(c=e[r][1]);return t=c-s,[[(a=i+.5*(n=d-i))-20*(f=Math.max(n,t)),(o=s+.5*t)-f],[a,o+20*f],[a+20*f,o-f]]}(n),n.push(a[0],a[1],a[2]),o=[g(n,h+0,h+1,h+2)],i=[],s=[],r=f.length;r--;s.length=0){for(b=f[r],t=o.length;t--;)0<(d=n[b][0]-o[t].x)&&d*d>o[t].r?(i.push(o[t]),o.splice(t,1)):d*d+(c=n[b][1]-o[t].y)*c-o[t].r>_||(s.push(o[t].i,o[t].j,o[t].j,o[t].k,o[t].k,o[t].i),o.splice(t,1));for(p(s),t=s.length;t;)l=s[--t],u=s[--t],o.push(g(n,u,l,b))}for(r=o.length;r--;)i.push(o[r]);for(o.length=0,r=i.length;r--;)i[r].i<h&&i[r].j<h&&i[r].k<h&&o.push(i[r].i,i[r].j,i[r].k);return o},contains:function(e,r){if(r[0]<e[0][0]&&r[0]<e[1][0]&&r[0]<e[2][0]||r[0]>e[0][0]&&r[0]>e[1][0]&&r[0]>e[2][0]||r[1]<e[0][1]&&r[1]<e[1][1]&&r[1]<e[2][1]||r[1]>e[0][1]&&r[1]>e[1][1]&&r[1]>e[2][1])return null;var n=e[1][0]-e[0][0],t=e[2][0]-e[0][0],f=e[1][1]-e[0][1],a=e[2][1]-e[0][1],o=n*a-t*f;if(0==o)return null;var i=(a*(r[0]-e[0][0])-t*(r[1]-e[0][1]))/o,s=(n*(r[1]-e[0][1])-f*(r[0]-e[0][0]))/o;return i<0||s<0||1<i+s?null:[i,s]}},void 0!==r&&(r.exports=t)}()},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js":[function(e,r,n){var t=e("./lib/alea"),f=e("./lib/xor128"),a=e("./lib/xorwow"),o=e("./lib/xorshift7"),i=e("./lib/xor4096"),s=e("./lib/tychei"),d=e("./seedrandom");d.alea=t,d.xor128=f,d.xorwow=a,d.xorshift7=o,d.xor4096=i,d.tychei=s,r.exports=d},{"./lib/alea":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js","./lib/tychei":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js","./lib/xor128":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js","./lib/xor4096":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js","./lib/xorshift7":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js","./lib/xorwow":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js","./seedrandom":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js":[function(e,r,n){!function(e,r,n){function a(e){var r=this,n=function(){var t=4022871197;return function(e){e=e.toString();for(var r=0;r<e.length;r++){var n=.02519603282416938*(t+=e.charCodeAt(r));n-=t=n>>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)}}();r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function o(e,r){return r.c=e.c,r.s0=e.s0,r.s1=e.s1,r.s2=e.s2,r}function t(e,r){var n=new a(e),t=r&&r.state,f=n.next;return f.int32=function(){return 4294967296*n.next()|0},f.double=function(){return f()+11102230246251565e-32*(2097152*f()|0)},f.quick=f,t&&("object"==typeof t&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.alea=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js":[function(e,r,n){!function(e,r,n){function a(e){var f=this,r="";f.next=function(){var e=f.b,r=f.c,n=f.d,t=f.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^t,t=t-e|0,f.b=e=e<<20^e>>>12^r,f.c=r=r-n|0,f.d=n<<16^r>>>16^t,f.a=t-e|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,e===Math.floor(e)?(f.a=e/4294967296|0,f.b=0|e):r+=e;for(var n=0;n<r.length+20;n++)f.b^=0|r.charCodeAt(n),f.next()}function o(e,r){return r.a=e.a,r.b=e.b,r.c=e.c,r.d=e.d,r}function t(e,r){function n(){return(t.next()>>>0)/4294967296}var t=new a(e),f=r&&r.state;return n.double=function(){do{var e=((t.next()>>>11)+(t.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=t.next,n.quick=n,f&&("object"==typeof f&&o(f,t),n.state=function(){return o(t,{})}),n}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.tychei=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js":[function(e,r,n){!function(e,r,n){function a(e){var r=this,n="";r.x=0,r.y=0,r.z=0,r.w=0,r.next=function(){var e=r.x^r.x<<11;return r.x=r.y,r.y=r.z,r.z=r.w,r.w^=r.w>>>19^e^e>>>8},e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),r.next()}function o(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r}function t(e,r){function n(){return(t.next()>>>0)/4294967296}var t=new a(e),f=r&&r.state;return n.double=function(){do{var e=((t.next()>>>11)+(t.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=t.next,n.quick=n,f&&("object"==typeof f&&o(f,t),n.state=function(){return o(t,{})}),n}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.xor128=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js":[function(e,r,n){!function(e,r,n){function a(e){var a=this;a.next=function(){var e,r,n=a.w,t=a.X,f=a.i;return a.w=n=n+1640531527|0,r=t[f+34&127],e=t[f=f+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=t[f]=r^e,a.i=f,r+(n^n>>>16)|0},function(e,r){var n,t,f,a,o,i=[],s=128;for(r===(0|r)?(t=r,r=null):(r+="\0",t=0,s=Math.max(s,r.length)),f=0,a=-32;a<s;++a)r&&(t^=r.charCodeAt((a+32)%r.length)),0===a&&(o=t),t^=t<<10,t^=t>>>15,t^=t<<4,t^=t>>>13,0<=a&&(o=o+1640531527|0,f=0==(n=i[127&a]^=t+o)?f+1:0);for(128<=f&&(i[127&(r&&r.length||0)]=-1),f=127,a=512;0<a;--a)t=i[f+34&127],n=i[f=f+1&127],t^=t<<13,n^=n<<17,t^=t>>>15,n^=n>>>12,i[f]=t^n;e.w=o,e.X=i,e.i=f}(a,e)}function o(e,r){return r.i=e.i,r.w=e.w,r.X=e.X.slice(),r}function t(e,r){null==e&&(e=+new Date);function n(){return(t.next()>>>0)/4294967296}var t=new a(e),f=r&&r.state;return n.double=function(){do{var e=((t.next()>>>11)+(t.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=t.next,n.quick=n,f&&(f.X&&o(f,t),n.state=function(){return o(t,{})}),n}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.xor4096=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js":[function(e,r,n){!function(e,r,n){function a(e){var f=this;f.next=function(){var e,r,n=f.x,t=f.i;return e=n[t],r=(e^=e>>>7)^e<<24,r^=(e=n[t+1&7])^e>>>10,r^=(e=n[t+3&7])^e>>>3,r^=(e=n[t+4&7])^e<<7,e=n[t+7&7],r^=(e^=e<<13)^e<<9,n[t]=r,f.i=t+1&7,r},function(e,r){var n,t=[];if(r===(0|r))t[0]=r;else for(r=""+r,n=0;n<r.length;++n)t[7&n]=t[7&n]<<15^r.charCodeAt(n)+t[n+1&7]<<13;for(;t.length<8;)t.push(0);for(n=0;n<8&&0===t[n];++n);for(8==n?t[7]=-1:t[n],e.x=t,e.i=0,n=256;0<n;--n)e.next()}(f,e)}function o(e,r){return r.x=e.x.slice(),r.i=e.i,r}function t(e,r){null==e&&(e=+new Date);function n(){return(t.next()>>>0)/4294967296}var t=new a(e),f=r&&r.state;return n.double=function(){do{var e=((t.next()>>>11)+(t.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=t.next,n.quick=n,f&&(f.x&&o(f,t),n.state=function(){return o(t,{})}),n}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.xorshift7=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js":[function(e,r,n){!function(e,r,n){function a(e){var r=this,n="";r.next=function(){var e=r.x^r.x>>>2;return r.x=r.y,r.y=r.z,r.z=r.w,r.w=r.v,(r.d=r.d+362437|0)+(r.v=r.v^r.v<<4^e^e<<1)|0},r.x=0,r.y=0,r.z=0,r.w=0,e===((r.v=0)|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),t==n.length&&(r.d=r.x<<10^r.x>>>4),r.next()}function o(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r.v=e.v,r.d=e.d,r}function t(e,r){function n(){return(t.next()>>>0)/4294967296}var t=new a(e),f=r&&r.state;return n.double=function(){do{var e=((t.next()>>>11)+(t.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=t.next,n.quick=n,f&&("object"==typeof f&&o(f,t),n.state=function(){return o(t,{})}),n}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.xorwow=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js":[function(r,n,e){!function(i,s){var d,c=this,u=256,l=6,b="random",h=s.pow(u,l),g=s.pow(2,52),p=2*g,m=u-1;function e(e,r,n){function t(){for(var e=o.g(l),r=h,n=0;e<g;)e=(e+n)*u,r*=u,n=o.g(1);for(;p<=e;)e/=2,r/=2,n>>>=1;return(e+n)/r}var f=[],a=v(function e(r,n){var t,f=[],a=typeof r;if(n&&"object"==a)for(t in r)try{f.push(e(r[t],n-1))}catch(e){}return f.length?f:"string"==a?r:r+"\0"}((r=1==r?{entropy:!0}:r||{}).entropy?[e,x(i)]:null==e?function(){try{if(d)return x(d.randomBytes(u));var e=new Uint8Array(u);return(c.crypto||c.msCrypto).getRandomValues(e),x(e)}catch(e){var r=c.navigator,n=r&&r.plugins;return[+new Date,c,n,c.screen,x(i)]}}():e,3),f),o=new y(f);return t.int32=function(){return 0|o.g(4)},t.quick=function(){return o.g(4)/4294967296},t.double=t,v(x(o.S),i),(r.pass||n||function(e,r,n,t){return t&&(t.S&&w(t,o),e.state=function(){return w(o,{})}),n?(s[b]=e,r):e})(t,a,"global"in r?r.global:this==s,r.state)}function y(e){var r,n=e.length,o=this,t=0,f=o.i=o.j=0,a=o.S=[];for(n||(e=[n++]);t<u;)a[t]=t++;for(t=0;t<u;t++)a[t]=a[f=m&f+e[t%n]+(r=a[t])],a[f]=r;(o.g=function(e){for(var r,n=0,t=o.i,f=o.j,a=o.S;e--;)r=a[t=m&t+1],n=n*u+a[m&(a[t]=a[f=m&f+r])+(a[f]=r)];return o.i=t,o.j=f,n})(u)}function w(e,r){return r.i=e.i,r.j=e.j,r.S=e.S.slice(),r}function v(e,r){for(var n,t=e+"",f=0;f<t.length;)r[m&f]=m&(n^=19*r[m&f])+t.charCodeAt(f++);return x(r)}function x(e){return String.fromCharCode.apply(0,e)}if(s["seed"+b]=e,v(s.random(),i),"object"==typeof n&&n.exports){n.exports=e;try{d=r("crypto")}catch(e){}}else 0}([],Math)},{crypto:!1}]},{},["./lib/trianglify.js"])("./lib/trianglify.js")});
1
+ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Trianglify=e()}}((function(){return function e(r,n,t){function f(o,i){if(!n[o]){if(!r[o]){var s="function"==typeof require&&require;if(!i&&s)return s(o,!0);if(a)return a(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var c=n[o]={exports:{}};r[o][0].call(c.exports,(function(e){var n=r[o][1][e];return f(n||e)}),c,c.exports,e,r,n,t)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<t.length;o++)f(t[o]);return f}({"./lib/trianglify.js":[function(e,r,n){var t=e("delaunay-fast"),f=e("seedrandom"),a=e("chroma-js"),o=e("./colorbrewer"),i=e("./pattern"),s={width:600,height:400,cell_size:75,variance:.75,seed:null,x_colors:"random",y_colors:"match_x",palette:o,color_space:"lab",color_function:null,stroke_width:1.51};function d(e){if(e=function(e,r){var n={};for(var t in e)n[t]=e[t];for(t in r){if(!e.hasOwnProperty(t))throw new Error(t+" is not a configuration option for Trianglify. Check your spelling?");n[t]=r[t]}return n}(s,e),rand=f(e.seed),"random"===e.x_colors&&(e.x_colors=U()),"random"===e.y_colors&&(e.y_colors=U()),"match_x"===e.y_colors&&(e.y_colors=e.x_colors),!(e.width>0&&e.height>0))throw new Error("Width and height must be numbers greater than 0");if(e.cell_size<2)throw new Error("Cell size must be greater than 2.");var r;if(e.color_function)r=function(r,n){return a(e.color_function(r,n))};else{var n=a.scale(e.x_colors).mode(e.color_space),o=a.scale(e.y_colors).mode(e.color_space);r=function(r,t){return a.interpolate(n(r),o(t),.5,e.color_space)}}for(var d,c,u,l=e.width,b=e.height,h=Math.floor((l+4*e.cell_size)/e.cell_size),g=Math.floor((b+4*e.cell_size)/e.cell_size),p=(h*e.cell_size-l)/2,m=(g*e.cell_size-b)/2,y=e.cell_size*e.variance/2,w=function(r,n){for(var t=[],f=-p;f<r+p;f+=e.cell_size)for(var a=-m;a<n+m;a+=e.cell_size){var o=f+e.cell_size/2+D(rand(),[0,1],[-y,y]),i=a+e.cell_size/2+D(rand(),[0,1],[-y,y]);t.push([o,i].map(Math.floor))}return t}(l,b),v=t.triangulate(w),x=[],_=function(e){return w[e]},k=0;k<v.length;k+=3){var j=[v[k],v[k+1],v[k+2]].map(_),M={x:((u=j)[0][0]+u[1][0]+u[2][0])/3,y:(u[0][1]+u[1][1]+u[2][1])/3},N=r((c=M.x,D(c,[-p,l+p],[0,1])),(d=M.y,D(d,[-m,b+m],[0,1]))).hex();x.push([N,j])}return i(x,e);function D(e,r,n){return(e-r[0])*(n[1]-n[0])/(r[1]-r[0])+n[0]}function U(){if(e.palette instanceof Array)return e.palette[Math.floor(rand()*e.palette.length)];var r=Object.keys(e.palette);return e.palette[r[Math.floor(rand()*r.length)]]}}d.colorbrewer=o,d.defaults=s,r.exports=d},{"./colorbrewer":"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js","./pattern":"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js","chroma-js":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js","delaunay-fast":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js",seedrandom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js"}],"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js":[function(e,r,n){r.exports={YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]}},{}],"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js":[function(e,r,n){(function(n){var t="undefined"!=typeof document?document:e("jsdom").jsdom("<html/>");r.exports=function(r,f){function a(a){if(void 0!==n)try{e("canvas")}catch(e){throw Error("The optional node-canvas dependency is needed for Trianglify to render using canvas in node.")}return a||(a=t.createElement("canvas")),a.setAttribute("width",f.width),a.setAttribute("height",f.height),ctx=a.getContext("2d"),ctx.canvas.width=f.width,ctx.canvas.height=f.height,r.forEach((function(e){ctx.fillStyle=ctx.strokeStyle=e[0],ctx.lineWidth=f.stroke_width,ctx.beginPath(),ctx.moveTo.apply(ctx,e[1][0]),ctx.lineTo.apply(ctx,e[1][1]),ctx.lineTo.apply(ctx,e[1][2]),ctx.fill(),ctx.stroke()})),a}return{polys:r,opts:f,svg:function(){var e=t.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width",f.width),e.setAttribute("height",f.height),r.forEach((function(r){var n=t.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M"+r[1].join("L")+"Z"),n.setAttribute("fill",r[0]),n.setAttribute("stroke",r[0]),n.setAttribute("stroke-width",f.stroke_width),e.appendChild(n)})),e},canvas:a,png:function(){return a().toDataURL("image/png")}}}}).call(this,e("_process"))},{_process:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js",canvas:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js",jsdom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js":[function(e,r,n){},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js":[function(e,r,n){var t=r.exports={},f=[],a=!1;function o(){if(!a){var e;a=!0;for(var r=f.length;r;){e=f,f=[];for(var n=-1;++n<r;)e[n]();r=f.length}a=!1}}function i(){}t.nextTick=function(e){f.push(e),a||setTimeout(o,0)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=i,t.addListener=i,t.once=i,t.off=i,t.removeListener=i,t.removeAllListeners=i,t.emit=i,t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js":[function(e,r,n){
2
+ /** echo * @license echo * while read i do echo * done echo
3
+ */
4
+ (function(){var e,t,f,a,o,i,s,d,c,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,B;s=function(r,n,t,f){return new e(r,n,t,f)},null!=r&&null!=r.exports&&(r.exports=s),(null!=n?n:this).chroma=s,s.color=function(r,n,t,f){return new e(r,n,t,f)},s.hsl=function(r,n,t,f){return new e(r,n,t,f,"hsl")},s.hsv=function(r,n,t,f){return new e(r,n,t,f,"hsv")},s.rgb=function(r,n,t,f){return new e(r,n,t,f,"rgb")},s.hex=function(r){return new e(r)},s.css=function(r){return new e(r)},s.lab=function(r,n,t){return new e(r,n,t,"lab")},s.lch=function(r,n,t){return new e(r,n,t,"lch")},s.hsi=function(r,n,t){return new e(r,n,t,"hsi")},s.gl=function(r,n,t,f){return new e(255*r,255*n,255*t,f,"gl")},s.mix=s.interpolate=function(r,n,t,f){return null==r||null==n?"#000":("string"===z(r)&&(r=new e(r)),"string"===z(n)&&(n=new e(n)),r.interpolate(t,n,f))},s.contrast=function(r,n){var t,f;return"string"===z(r)&&(r=new e(r)),"string"===z(n)&&(n=new e(n)),(t=r.luminance())>(f=n.luminance())?(t+.05)/(f+.05):(f+.05)/(t+.05)},s.luminance=function(e){return s(e).luminance()},s._Color=e,e=function(){function e(){var e,r,n,t,f,a,o,i,s,c,u,p,y,w,x;for(f=this,n=[],s=0,c=arguments.length;s<c;s++)null!=(r=arguments[s])&&n.push(r);if(0===n.length)a=(u=[255,0,255,1,"rgb"])[0],o=u[1],i=u[2],e=u[3],t=u[4];else if("array"===z(n[0])){if(3===n[0].length)a=(p=n[0])[0],o=p[1],i=p[2],e=1;else{if(4!==n[0].length)throw"unknown input argument";a=(y=n[0])[0],o=y[1],i=y[2],e=y[3]}t=null!=(w=n[1])?w:"rgb"}else"string"===z(n[0])?(a=n[0],t="hex"):"object"===z(n[0])?(a=(x=n[0]._rgb)[0],o=x[1],i=x[2],e=x[3],t="rgb"):n.length>=3&&(a=n[0],o=n[1],i=n[2]);3===n.length?(t="rgb",e=1):4===n.length?"string"===z(n[3])?(t=n[3],e=1):"number"===z(n[3])&&(t="rgb",e=n[3]):5===n.length&&(e=n[3],t=n[4]),null==e&&(e=1),"rgb"===t?f._rgb=[a,o,i,e]:"gl"===t?f._rgb=[255*a,255*o,255*i,e]:"hsl"===t?(f._rgb=h(a,o,i),f._rgb[3]=e):"hsv"===t?(f._rgb=g(a,o,i),f._rgb[3]=e):"hex"===t?f._rgb=l(a):"lab"===t?(f._rgb=m(a,o,i),f._rgb[3]=e):"lch"===t?(f._rgb=v(a,o,i),f._rgb[3]=e):"hsi"===t&&(f._rgb=b(a,o,i),f._rgb[3]=e),d(f._rgb)}return e.prototype.rgb=function(){return this._rgb.slice(0,3)},e.prototype.rgba=function(){return this._rgb},e.prototype.hex=function(){return j(this._rgb)},e.prototype.toString=function(){return this.name()},e.prototype.hsl=function(){return N(this._rgb)},e.prototype.hsv=function(){return D(this._rgb)},e.prototype.lab=function(){return U(this._rgb)},e.prototype.lch=function(){return A(this._rgb)},e.prototype.hsi=function(){return M(this._rgb)},e.prototype.gl=function(){return[this._rgb[0]/255,this._rgb[1]/255,this._rgb[2]/255,this._rgb[3]]},e.prototype.luminance=function(r,n){var t,f,a,o;return null==n&&(n="rgb"),arguments.length?(0===r&&(this._rgb=[0,0,0,this._rgb[3]]),1===r&&(this._rgb=[255,255,255,this._rgb[3]]),t=_(this._rgb),f=1e-7,a=20,o=function(e,t){var i,s;return i=(s=e.interpolate(.5,t,n)).luminance(),Math.abs(r-i)<f||!a--?s:i>r?o(e,s):o(s,t)},this._rgb=(t>r?o(new e("black"),this):o(this,new e("white"))).rgba(),this):_(this._rgb)},e.prototype.name=function(){var e,r;for(r in e=this.hex(),s.colors)if(e===s.colors[r])return r;return e},e.prototype.alpha=function(e){return arguments.length?(this._rgb[3]=e,this):this._rgb[3]},e.prototype.css=function(e){var r,n,t;return null==e&&(e="rgb"),this,n=this._rgb,3===e.length&&n[3]<1&&(e+="a"),"rgb"===e?e+"("+n.slice(0,3).map(Math.round).join(",")+")":"rgba"===e?e+"("+n.slice(0,3).map(Math.round).join(",")+","+n[3]+")":"hsl"===e||"hsla"===e?(t=function(e){return Math.round(100*e)/100},(r=this.hsl())[0]=t(r[0]),r[1]=t(100*r[1])+"%",r[2]=t(100*r[2])+"%",4===e.length&&(r[3]=n[3]),e+"("+r.join(",")+")"):void 0},e.prototype.interpolate=function(r,n,t){var f,a,o,i,s,d,c,u,l,b,h,g,p;if(c=this,null==t&&(t="rgb"),"string"===z(n)&&(n=new e(n)),"hsl"===t||"hsv"===t||"lch"===t||"hsi"===t)"hsl"===t?(g=c.hsl(),p=n.hsl()):"hsv"===t?(g=c.hsv(),p=n.hsv()):"hsi"===t?(g=c.hsi(),p=n.hsi()):"lch"===t&&(g=c.lch(),p=n.lch()),"h"===t.substr(0,1)?(a=g[0],b=g[1],s=g[2],o=p[0],h=p[1],d=p[2]):(s=g[0],b=g[1],a=g[2],d=p[0],h=p[1],o=p[2]),isNaN(a)||isNaN(o)?isNaN(a)?isNaN(o)?f=Number.NaN:(f=o,1!==s&&0!==s||"hsv"===t||(l=h)):(f=a,1!==d&&0!==d||"hsv"===t||(l=b)):f=a+r*(o>a&&o-a>180?o-(a+360):o<a&&a-o>180?o+360-a:o-a),null==l&&(l=b+r*(h-b)),i=s+r*(d-s),u="h"===t.substr(0,1)?new e(f,l,i,t):new e(i,l,f,t);else if("rgb"===t)g=c._rgb,p=n._rgb,u=new e(g[0]+r*(p[0]-g[0]),g[1]+r*(p[1]-g[1]),g[2]+r*(p[2]-g[2]),t);else{if("lab"!==t)throw"color mode "+t+" is not supported";g=c.lab(),p=n.lab(),u=new e(g[0]+r*(p[0]-g[0]),g[1]+r*(p[1]-g[1]),g[2]+r*(p[2]-g[2]),t)}return u.alpha(c.alpha()+r*(n.alpha()-c.alpha())),u},e.prototype.premultiply=function(){var e,r;return r=this.rgb(),e=this.alpha(),s(r[0]*e,r[1]*e,r[2]*e,e)},e.prototype.darken=function(e){var r;return null==e&&(e=20),this,(r=this.lch())[0]-=e,s.lch(r).alpha(this.alpha())},e.prototype.darker=function(e){return this.darken(e)},e.prototype.brighten=function(e){return null==e&&(e=20),this.darken(-e)},e.prototype.brighter=function(e){return this.brighten(e)},e.prototype.saturate=function(e){var r;return null==e&&(e=20),this,(r=this.lch())[1]+=e,s.lch(r).alpha(this.alpha())},e.prototype.desaturate=function(e){return null==e&&(e=20),this.saturate(-e)},e}(),d=function(e){var r;for(r in e)r<3?(e[r]<0&&(e[r]=0),e[r]>255&&(e[r]=255)):3===r&&(e[r]<0&&(e[r]=0),e[r]>1&&(e[r]=1));return e},u=function(e){var r,n,t,f,a,o,i,d;if(e=e.toLowerCase(),null!=s.colors&&s.colors[e])return l(s.colors[e]);if(t=e.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(f=t.slice(1,4),n=a=0;a<=2;n=++a)f[n]=+f[n];f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(f=t.slice(1,5),n=o=0;o<=3;n=++o)f[n]=+f[n];else if(t=e.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(f=t.slice(1,4),n=i=0;i<=2;n=++i)f[n]=Math.round(2.55*f[n]);f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(f=t.slice(1,5),n=d=0;d<=2;n=++d)f[n]=Math.round(2.55*f[n]);f[3]=+f[3]}else(t=e.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(f=h(r))[3]=1):(t=e.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(f=h(r))[3]=+t[4]);return f},l=function(e){var r,n;if(e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})#x2F;))return 4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[(n=parseInt(e,16))>>16,n>>8&255,255&n,1];if(e.match(/^#?([A-Fa-f0-9]{8})#x2F;))return 9===e.length&&(e=e.substr(1)),[(n=parseInt(e,16))>>24&255,n>>16&255,n>>8&255,255&n];if(r=u(e))return r;throw"unknown color: "+e},b=function(e,r,n){var a,o,i,s;return e=(s=G(arguments))[0],r=s[1],n=s[2],(e/=360)<1/3?o=1-((a=(1-r)/3)+(i=(1+r*c(f*e)/c(t-f*e))/3)):e<2/3?a=1-((i=(1-r)/3)+(o=(1+r*c(f*(e-=1/3))/c(t-f*e))/3)):i=1-((o=(1-r)/3)+(a=(1+r*c(f*(e-=2/3))/c(t-f*e))/3)),[255*(i=x(n*i*3)),255*(o=x(n*o*3)),255*(a=x(n*a*3))]},h=function(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b;if(t=(l=G(arguments))[0],i=l[1],a=l[2],0===i)o=n=e=255*a;else{for(r=[0,0,0],s=2*a-(d=a<.5?a*(1+i):a+i-a*i),(c=[0,0,0])[0]=(t/=360)+1/3,c[1]=t,c[2]=t-1/3,f=u=0;u<=2;f=++u)c[f]<0&&(c[f]+=1),c[f]>1&&(c[f]-=1),6*c[f]<1?r[f]=s+6*(d-s)*c[f]:2*c[f]<1?r[f]=d:3*c[f]<2?r[f]=s+(d-s)*(2/3-c[f])*6:r[f]=s;o=(b=[Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])])[0],n=b[1],e=b[2]}return[o,n,e]},g=function(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b,h,g,p,m;if(t=(u=G(arguments))[0],s=u[1],c=u[2],c*=255,0===s)i=n=e=c;else switch(360===t&&(t=0),t>360&&(t-=360),t<0&&(t+=360),a=c*(1-s),o=c*(1-s*(r=(t/=60)-(f=Math.floor(t)))),d=c*(1-s*(1-r)),f){case 0:i=(l=[c,d,a])[0],n=l[1],e=l[2];break;case 1:i=(b=[o,c,a])[0],n=b[1],e=b[2];break;case 2:i=(h=[a,c,d])[0],n=h[1],e=h[2];break;case 3:i=(g=[a,o,c])[0],n=g[1],e=g[2];break;case 4:i=(p=[d,a,c])[0],n=p[1],e=p[2];break;case 5:i=(m=[c,a,o])[0],n=m[1],e=m[2]}return[i=Math.round(i),n=Math.round(n),e=Math.round(e)]},a=.95047,o=1.08883,p=function(){var e,r,n,t;return n=(t=G(arguments))[0],e=t[1],r=t[2],[n,Math.sqrt(e*e+r*r),Math.atan2(r,e)/Math.PI*180]},m=function(e,r,n){var t,f,i,s,d,c,u;return void 0!==e&&3===e.length&&(e=(c=e)[0],r=c[1],n=c[2]),void 0!==e&&3===e.length&&(e=(u=e)[0],r=u[1],n=u[2]),d=(s=(e+16)/116)-n/200,i=y(i=s+r/500)*a,s=1*y(s),d=y(d)*o,f=B(3.2404542*i-1.5371385*s-.4985314*d),t=B(-.969266*i+1.8760108*s+.041556*d),n=B(.0556434*i-.2040259*s+1.0572252*d),[x(f,0,255),x(t,0,255),x(n,0,255),1]},y=function(e){return e>.206893034?e*e*e:(e-4/29)/7.787037},B=function(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))},w=function(){var e,r,n,t;return n=(t=G(arguments))[0],e=t[1],r=(r=t[2])*Math.PI/180,[n,Math.cos(r)*e,Math.sin(r)*e]},v=function(e,r,n){var t,f,a,o,i,s,d;return t=(s=w(e,r,n))[0],f=s[1],a=s[2],i=(d=m(t,f,a))[0],o=d[1],a=d[2],[x(i,0,255),x(o,0,255),x(a,0,255)]},_=function(e,r,n){var t;return e=(t=G(arguments))[0],r=t[1],n=t[2],.2126*(e=k(e))+.7152*(r=k(r))+.0722*(n=k(n))},k=function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},j=function(){var e,r;return"#"+(e="000000"+((r=G(arguments))[0]<<16|r[1]<<8|r[2]).toString(16)).substr(e.length-6)},M=function(){var e,r,n,t,f,a,o,i;return a=(i=G(arguments))[0],n=i[1],r=i[2],e=2*Math.PI,a/=255,n/=255,r/=255,0===(o=1-Math.min(a,n,r)/(f=(a+n+r)/3))?t=0:(t=(a-n+(a-r))/2,t/=Math.sqrt((a-n)*(a-n)+(a-r)*(n-r)),t=Math.acos(t),r>n&&(t=e-t),t/=e),[360*t,o,f]},N=function(e,r,n){var t,f,a,o,i,s;return void 0!==e&&e.length>=3&&(e=(s=e)[0],r=s[1],n=s[2]),e/=255,r/=255,n/=255,o=Math.min(e,r,n),f=((a=Math.max(e,r,n))+o)/2,a===o?(i=0,t=Number.NaN):i=f<.5?(a-o)/(a+o):(a-o)/(2-a-o),e===a?t=(r-n)/(a-o):r===a?t=2+(n-e)/(a-o):n===a&&(t=4+(e-r)/(a-o)),(t*=60)<0&&(t+=360),[t,i,f]},D=function(){var e,r,n,t,f,a,o,i,s,d;return o=(d=G(arguments))[0],n=d[1],e=d[2],a=Math.min(o,n,e),r=(f=Math.max(o,n,e))-a,s=f/255,0===f?(t=Number.NaN,i=0):(i=r/f,o===f&&(t=(n-e)/r),n===f&&(t=2+(e-o)/r),e===f&&(t=4+(o-n)/r),(t*=60)<0&&(t+=360)),[t,i,s]},U=function(){var e,r,n,t,f,i;return n=(i=G(arguments))[0],r=i[1],e=i[2],n=P(n),r=P(r),e=P(e),t=E((.4124564*n+.3575761*r+.1804375*e)/a),[116*(f=E((.2126729*n+.7151522*r+.072175*e)/1))-16,500*(t-f),200*(f-E((.0193339*n+.119192*r+.9503041*e)/o))]},P=function(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},E=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},A=function(){var e,r,n,t,f,a,o;return f=(a=G(arguments))[0],n=a[1],r=a[2],t=(o=U(f,n,r))[0],e=o[1],r=o[2],p(t,e,r)},s.scale=function(e,r){var n,t,f,a,o,i,d,c,u,l,b,h,g,p,m,y,w,v,x;return p="rgb",m=s("#ccc"),x=0,!1,b=[0,1],u=[],w=!1,v=[],g=0,h=1,l=!1,y=0,c={},o=function(e,r){var n,t,f,o,i,d,c;if(null==e&&(e=["#ddd","#222"]),null!=e&&"string"===z(e)&&null!=(null!=(i=s.brewer)?i[e]:void 0)&&(e=s.brewer[e]),"array"===z(e)){for(n=f=0,d=(e=e.slice(0)).length-1;0<=d?f<=d:f>=d;n=0<=d?++f:--f)t=e[n],"string"===z(t)&&(e[n]=s(t));if(null!=r)v=r;else for(v=[],n=o=0,c=e.length-1;0<=c?o<=c:o>=c;n=0<=c?++o:--o)v.push(n/(e.length-1))}return a(),u=e},i=function(e){return null==e&&(e=[]),b=e,g=e[0],h=e[e.length-1],a(),y=2===e.length?0:e.length-1},t=function(e){var r,n;if(null!=b){for(n=b.length-1,r=0;r<n&&e>=b[r];)r++;return r-1}return 0},d=function(e){return e},function(e){var r,n,f,a,o;return o=e,b.length>2&&(a=b.length-1,r=t(e),f=b[0]+(b[1]-b[0])*(0+.5*x),n=b[a-1]+(b[a]-b[a-1])*(1-.5*x),o=g+(b[r]+.5*(b[r+1]-b[r])-f)/(n-f)*(h-g)),o},f=function(e,r){var n,f,a,o,i,l,w;if(null==r&&(r=!1),isNaN(e))return m;if(r?i=e:b.length>2?i=t(e)/(y-1):(i=g!==h?(e-g)/(h-g):0,i=(e-g)/(h-g),i=Math.min(1,Math.max(0,i))),r||(i=d(i)),a=Math.floor(1e4*i),c[a])n=c[a];else{if("array"===z(u))for(f=l=0,w=v.length-1;0<=w?l<=w:l>=w;f=0<=w?++l:--l){if(i<=(o=v[f])){n=u[f];break}if(i>=o&&f===v.length-1){n=u[f];break}if(i>o&&i<v[f+1]){i=(i-o)/(v[f+1]-o),n=s.interpolate(u[f],u[f+1],i,p);break}}else"function"===z(u)&&(n=u(i));c[a]=n}return n},a=function(){return c={}},o(e,r),(n=function(e){var r;return r=f(e),w&&r[w]?r[w]():r}).domain=function(e,r,t,f){var a;return null==t&&(t="e"),arguments.length?(null!=r&&(a=s.analyze(e,f),e=0===r?[a.min,a.max]:s.limits(a,t,r)),i(e),n):b},n.mode=function(e){return arguments.length?(p=e,a(),n):p},n.range=function(e,r){return o(e,r),n},n.out=function(e){return w=e,n},n.spread=function(e){return arguments.length?(x=e,n):x},n.correctLightness=function(e){return arguments.length?(l=e,a(),d=l?function(e){var r,n,t,a,o,i,s,d,c;for(r=f(0,!0).lab()[0],n=f(1,!0).lab()[0],s=r>n,t=f(e,!0).lab()[0],a=t-(o=r+(n-r)*e),d=0,c=1,i=20;Math.abs(a)>.01&&i-- >0;)s&&(a*=-1),a<0?(d=e,e+=.5*(c-e)):(c=e,e+=.5*(d-e)),t=f(e,!0).lab()[0],a=t-o;return e}:function(e){return e},n):l},n.colors=function(r){var t,f,a,o,i,s;if(null==r&&(r="hex"),e=[],f=[],b.length>2)for(t=a=1,s=b.length;1<=s?a<s:a>s;t=1<=s?++a:--a)f.push(.5*(b[t-1]+b[t]));else f=b;for(o=0,i=f.length;o<i;o++)t=f[o],e.push(n(t)[r]());return e},n},null==s.scales&&(s.scales={}),s.scales.cool=function(){return s.scale([s.hsl(180,1,.9),s.hsl(250,.7,.4)])},s.scales.hot=function(){return s.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},s.analyze=function(e,r,n){var t,f,a,o,i,d;if(a={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==n&&(n=function(){return!0}),t=function(e){null==e||isNaN(e)||(a.values.push(e),a.sum+=e,e<a.min&&(a.min=e),e>a.max&&(a.max=e),a.count+=1)},o=function(e,f){if(n(e,f))return null!=r&&"function"===z(r)?t(r(e)):null!=r&&"string"===z(r)||"number"===z(r)?t(e[r]):t(e)},"array"===z(e))for(i=0,d=e.length;i<d;i++)o(e[i]);else for(f in e)o(e[f],f);return a.domain=[a.min,a.max],a.limits=function(e,r){return s.limits(a,e,r)},a},s.limits=function(e,r,n){var t,f,a,o,i,d,c,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,G,E,B,I,q,R,S,O,C,T,Y,L,F,V,X,W,$,Z,H,J,K,Q,ee,re,ne,te,fe,ae;if(null==r&&(r="equal"),null==n&&(n=7),"array"===z(e)&&(e=s.analyze(e)),p=e.min,h=e.max,e.sum,U=e.values.sort((function(e,r){return e-r})),b=[],"c"===r.substr(0,1)&&(b.push(p),b.push(h)),"e"===r.substr(0,1)){for(b.push(p),c=A=1,C=n-1;1<=C?A<=C:A>=C;c=1<=C?++A:--A)b.push(p+c/n*(h-p));b.push(h)}else if("l"===r.substr(0,1)){if(p<=0)throw"Logarithmic scales are only possible for values > 0";for(m=Math.LOG10E*Math.log(p),g=Math.LOG10E*Math.log(h),b.push(p),c=P=1,W=n-1;1<=W?P<=W:P>=W;c=1<=W?++P:--P)b.push(Math.pow(10,m+c/n*(g-m)));b.push(h)}else if("q"===r.substr(0,1)){for(b.push(p),c=G=1,$=n-1;1<=$?G<=$:G>=$;c=1<=$?++G:--G)_=U.length*c/n,(k=Math.floor(_))===_?b.push(U[k]):(j=_-k,b.push(U[k]*j+U[k+1]*(1-j)));b.push(h)}else if("k"===r.substr(0,1)){for(w=U.length,t=new Array(w),i=new Array(n),M=!0,v=0,a=null,(a=[]).push(p),c=E=1,Z=n-1;1<=Z?E<=Z:E>=Z;c=1<=Z?++E:--E)a.push(p+c/n*(h-p));for(a.push(h);M;){for(u=B=0,H=n-1;0<=H?B<=H:B>=H;u=0<=H?++B:--B)i[u]=0;for(c=I=0,J=w-1;0<=J?I<=J:I>=J;c=0<=J?++I:--I){for(D=U[c],y=Number.MAX_VALUE,u=q=0,K=n-1;0<=K?q<=K:q>=K;u=0<=K?++q:--q)(d=Math.abs(a[u]-D))<y&&(y=d,f=u);i[f]++,t[c]=f}for(x=new Array(n),u=R=0,Q=n-1;0<=Q?R<=Q:R>=Q;u=0<=Q?++R:--R)x[u]=null;for(c=S=0,ee=w-1;0<=ee?S<=ee:S>=ee;c=0<=ee?++S:--S)null===x[o=t[c]]?x[o]=U[c]:x[o]+=U[c];for(u=O=0,T=n-1;0<=T?O<=T:O>=T;u=0<=T?++O:--O)x[u]*=1/i[u];for(M=!1,u=re=0,Y=n-1;0<=Y?re<=Y:re>=Y;u=0<=Y?++re:--re)if(x[u]!==a[c]){M=!0;break}a=x,++v>200&&(M=!1)}for(l={},u=ne=0,L=n-1;0<=L?ne<=L:ne>=L;u=0<=L?++ne:--ne)l[u]=[];for(c=te=0,F=w-1;0<=F?te<=F:te>=F;c=0<=F?++te:--te)l[o=t[c]].push(U[c]);for(N=[],u=fe=0,V=n-1;0<=V?fe<=V:fe>=V;u=0<=V?++fe:--fe)N.push(l[u][0]),N.push(l[u][l[u].length-1]);for(N=N.sort((function(e,r){return e-r})),b.push(N[0]),c=ae=1,X=N.length-1;ae<=X;c=ae+=2)isNaN(N[c])||b.push(N[c])}return b},
5
+ /**
6
+ ColorBrewer colors for chroma.js
7
+
8
+ Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The
9
+ Pennsylvania State University.
10
+
11
+ Licensed under the Apache License, Version 2.0 (the "License");
12
+ you may not use this file except in compliance with the License.
13
+ You may obtain a copy of the License at
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software distributed
17
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
18
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
19
+ specific language governing permissions and limitations under the License.
20
+
21
+ @preserve
22
+ */
23
+ s.brewer={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},s.colors={indigo:"#4b0082",gold:"#ffd700",hotpink:"#ff69b4",firebrick:"#b22222",indianred:"#cd5c5c",yellow:"#ffff00",mistyrose:"#ffe4e1",darkolivegreen:"#556b2f",olive:"#808000",darkseagreen:"#8fbc8f",pink:"#ffc0cb",tomato:"#ff6347",lightcoral:"#f08080",orangered:"#ff4500",navajowhite:"#ffdead",lime:"#00ff00",palegreen:"#98fb98",darkslategrey:"#2f4f4f",greenyellow:"#adff2f",burlywood:"#deb887",seashell:"#fff5ee",mediumspringgreen:"#00fa9a",fuchsia:"#ff00ff",papayawhip:"#ffefd5",blanchedalmond:"#ffebcd",chartreuse:"#7fff00",dimgray:"#696969",black:"#000000",peachpuff:"#ffdab9",springgreen:"#00ff7f",aquamarine:"#7fffd4",white:"#ffffff",orange:"#ffa500",lightsalmon:"#ffa07a",darkslategray:"#2f4f4f",brown:"#a52a2a",ivory:"#fffff0",dodgerblue:"#1e90ff",peru:"#cd853f",lawngreen:"#7cfc00",chocolate:"#d2691e",crimson:"#dc143c",forestgreen:"#228b22",darkgrey:"#a9a9a9",lightseagreen:"#20b2aa",cyan:"#00ffff",mintcream:"#f5fffa",silver:"#c0c0c0",antiquewhite:"#faebd7",mediumorchid:"#ba55d3",skyblue:"#87ceeb",gray:"#808080",darkturquoise:"#00ced1",goldenrod:"#daa520",darkgreen:"#006400",floralwhite:"#fffaf0",darkviolet:"#9400d3",darkgray:"#a9a9a9",moccasin:"#ffe4b5",saddlebrown:"#8b4513",grey:"#808080",darkslateblue:"#483d8b",lightskyblue:"#87cefa",lightpink:"#ffb6c1",mediumvioletred:"#c71585",slategrey:"#708090",red:"#ff0000",deeppink:"#ff1493",limegreen:"#32cd32",darkmagenta:"#8b008b",palegoldenrod:"#eee8aa",plum:"#dda0dd",turquoise:"#40e0d0",lightgrey:"#d3d3d3",lightgoldenrodyellow:"#fafad2",darkgoldenrod:"#b8860b",lavender:"#e6e6fa",maroon:"#800000",yellowgreen:"#9acd32",sandybrown:"#f4a460",thistle:"#d8bfd8",violet:"#ee82ee",navy:"#000080",magenta:"#ff00ff",dimgrey:"#696969",tan:"#d2b48c",rosybrown:"#bc8f8f",olivedrab:"#6b8e23",blue:"#0000ff",lightblue:"#add8e6",ghostwhite:"#f8f8ff",honeydew:"#f0fff0",cornflowerblue:"#6495ed",slateblue:"#6a5acd",linen:"#faf0e6",darkblue:"#00008b",powderblue:"#b0e0e6",seagreen:"#2e8b57",darkkhaki:"#bdb76b",snow:"#fffafa",sienna:"#a0522d",mediumblue:"#0000cd",royalblue:"#4169e1",lightcyan:"#e0ffff",green:"#008000",mediumpurple:"#9370db",midnightblue:"#191970",cornsilk:"#fff8dc",paleturquoise:"#afeeee",bisque:"#ffe4c4",slategray:"#708090",darkcyan:"#008b8b",khaki:"#f0e68c",wheat:"#f5deb3",teal:"#008080",darkorchid:"#9932cc",deepskyblue:"#00bfff",salmon:"#fa8072",darkred:"#8b0000",steelblue:"#4682b4",palevioletred:"#db7093",lightslategray:"#778899",aliceblue:"#f0f8ff",lightslategrey:"#778899",lightgreen:"#90ee90",orchid:"#da70d6",gainsboro:"#dcdcdc",mediumseagreen:"#3cb371",lightgray:"#d3d3d3",mediumturquoise:"#48d1cc",lemonchiffon:"#fffacd",cadetblue:"#5f9ea0",lightyellow:"#ffffe0",lavenderblush:"#fff0f5",coral:"#ff7f50",purple:"#800080",aqua:"#00ffff",whitesmoke:"#f5f5f5",mediumslateblue:"#7b68ee",darkorange:"#ff8c00",mediumaquamarine:"#66cdaa",darksalmon:"#e9967a",beige:"#f5f5dc",blueviolet:"#8a2be2",azure:"#f0ffff",lightsteelblue:"#b0c4de",oldlace:"#fdf5e6"},z=function(){var e,r,n,t,f;for(e={},n=0,t=(f="Boolean Number String Function Array Date RegExp Undefined Null".split(" ")).length;n<t;n++)r=f[n],e["[object "+r+"]"]=r.toLowerCase();return function(r){var n;return n=Object.prototype.toString.call(r),e[n]||"object"}}(),x=function(e,r,n){return null==r&&(r=0),null==n&&(n=1),e<r&&(e=r),e>n&&(e=n),e},G=function(e){return e.length>=3?e:e[0]},f=2*Math.PI,t=Math.PI/3,c=Math.cos,i=function(e){var r,n,t,f,a,o,d,c,u,l,b;return 2===(e=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(s(f));return t}()).length?(u=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=u[0],o=u[1],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;n<=2;r=++n)t.push(a[r]+e*(o[r]-a[r]));return t}(),s.lab.apply(s,n)}):3===e.length?(l=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=l[0],o=l[1],d=l[2],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;n<=2;r=++n)t.push((1-e)*(1-e)*a[r]+2*(1-e)*e*o[r]+e*e*d[r]);return t}(),s.lab.apply(s,n)}):4===e.length?(b=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=b[0],o=b[1],d=b[2],c=b[3],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;n<=2;r=++n)t.push((1-e)*(1-e)*(1-e)*a[r]+3*(1-e)*(1-e)*e*o[r]+3*(1-e)*e*e*d[r]+e*e*e*c[r]);return t}(),s.lab.apply(s,n)}):5===e.length&&(n=i(e.slice(0,3)),t=i(e.slice(2,5)),r=function(e){return e<.5?n(2*e):t(2*(e-.5))}),r},s.interpolate.bezier=i}).call(this)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js":[function(e,r,n){var t;!function(){"use strict";function e(e,r,n,t){var f,a,o,i,s,d,c,u,l,b,h=e[r][0],g=e[r][1],p=e[n][0],m=e[n][1],y=e[t][0],w=e[t][1],v=Math.abs(g-m),x=Math.abs(m-w);if(v<1/1048576&&x<1/1048576)throw new Error("Eek! Coincident points!");return v<1/1048576?a=(i=-(y-p)/(w-m))*((f=(p+h)/2)-(d=(p+y)/2))+(u=(m+w)/2):x<1/1048576?a=(o=-(p-h)/(m-g))*((f=(y+p)/2)-(s=(h+p)/2))+(c=(g+m)/2):(f=((o=-(p-h)/(m-g))*(s=(h+p)/2)-(i=-(y-p)/(w-m))*(d=(p+y)/2)+(u=(m+w)/2)-(c=(g+m)/2))/(o-i),a=v>x?o*(f-s)+c:i*(f-d)+u),{i:r,j:n,k:t,x:f,y:a,r:(l=p-f)*l+(b=m-a)*b}}function n(e){var r,n,t,f,a,o;for(n=e.length;n;)for(f=e[--n],t=e[--n],r=n;r;)if(o=e[--r],t===(a=e[--r])&&f===o||t===o&&f===a){e.splice(n,2),e.splice(r,2);break}}t={triangulate:function(r,t){var f,a,o,i,s,d,c,u,l,b,h,g,p=r.length;if(p<3)return[];if(r=r.slice(0),t)for(f=p;f--;)r[f]=r[f][t];for(o=new Array(p),f=p;f--;)o[f]=f;for(o.sort((function(e,n){return r[n][0]-r[e][0]})),i=function(e){var r,n,t,f,a,o,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(r=e.length;r--;)e[r][0]<i&&(i=e[r][0]),e[r][0]>d&&(d=e[r][0]),e[r][1]<s&&(s=e[r][1]),e[r][1]>c&&(c=e[r][1]);return t=c-s,[[(a=i+.5*(n=d-i))-20*(f=Math.max(n,t)),(o=s+.5*t)-f],[a,o+20*f],[a+20*f,o-f]]}(r),r.push(i[0],i[1],i[2]),s=[e(r,p+0,p+1,p+2)],d=[],c=[],f=o.length;f--;c.length=0){for(g=o[f],a=s.length;a--;)(u=r[g][0]-s[a].x)>0&&u*u>s[a].r?(d.push(s[a]),s.splice(a,1)):u*u+(l=r[g][1]-s[a].y)*l-s[a].r>1/1048576||(c.push(s[a].i,s[a].j,s[a].j,s[a].k,s[a].k,s[a].i),s.splice(a,1));for(n(c),a=c.length;a;)h=c[--a],b=c[--a],s.push(e(r,b,h,g))}for(f=s.length;f--;)d.push(s[f]);for(s.length=0,f=d.length;f--;)d[f].i<p&&d[f].j<p&&d[f].k<p&&s.push(d[f].i,d[f].j,d[f].k);return s},contains:function(e,r){if(r[0]<e[0][0]&&r[0]<e[1][0]&&r[0]<e[2][0]||r[0]>e[0][0]&&r[0]>e[1][0]&&r[0]>e[2][0]||r[1]<e[0][1]&&r[1]<e[1][1]&&r[1]<e[2][1]||r[1]>e[0][1]&&r[1]>e[1][1]&&r[1]>e[2][1])return null;var n=e[1][0]-e[0][0],t=e[2][0]-e[0][0],f=e[1][1]-e[0][1],a=e[2][1]-e[0][1],o=n*a-t*f;if(0===o)return null;var i=(a*(r[0]-e[0][0])-t*(r[1]-e[0][1]))/o,s=(n*(r[1]-e[0][1])-f*(r[0]-e[0][0]))/o;return i<0||s<0||i+s>1?null:[i,s]}},void 0!==r&&(r.exports=t)}()},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js":[function(e,r,n){var t=e("./lib/alea"),f=e("./lib/xor128"),a=e("./lib/xorwow"),o=e("./lib/xorshift7"),i=e("./lib/xor4096"),s=e("./lib/tychei"),d=e("./seedrandom");d.alea=t,d.xor128=f,d.xorwow=a,d.xorshift7=o,d.xor4096=i,d.tychei=s,r.exports=d},{"./lib/alea":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js","./lib/tychei":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js","./lib/xor128":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js","./lib/xor4096":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js","./lib/xorshift7":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js","./lib/xorwow":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js","./seedrandom":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js":[function(e,r,n){!function(e,r,n){function t(e){var r,n=this,t=(r=4022871197,function(e){e=e.toString();for(var n=0;n<e.length;n++){var t=.02519603282416938*(r+=e.charCodeAt(n));t-=r=t>>>0,r=(t*=r)>>>0,r+=4294967296*(t-=r)}return 2.3283064365386963e-10*(r>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=t(" "),n.s1=t(" "),n.s2=t(" "),n.s0-=t(e),n.s0<0&&(n.s0+=1),n.s1-=t(e),n.s1<0&&(n.s1+=1),n.s2-=t(e),n.s2<0&&(n.s2+=1),t=null}function f(e,r){return r.c=e.c,r.s0=e.s0,r.s1=e.s1,r.s2=e.s2,r}function a(e,r){var n=new t(e),a=r&&r.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o.double=function(){return o()+11102230246251565e-32*(2097152*o()|0)},o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n((function(){return a})):this.alea=a}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js":[function(e,r,n){!function(e,r,n){function t(e){var r=this,n="";r.next=function(){var e=r.b,n=r.c,t=r.d,f=r.a;return e=e<<25^e>>>7^n,n=n-t|0,t=t<<24^t>>>8^f,f=f-e|0,r.b=e=e<<20^e>>>12^n,r.c=n=n-t|0,r.d=t<<16^n>>>16^f,r.a=f-e|0},r.a=0,r.b=0,r.c=-1640531527,r.d=1367130551,e===Math.floor(e)?(r.a=e/4294967296|0,r.b=0|e):n+=e;for(var t=0;t<n.length+20;t++)r.b^=0|n.charCodeAt(t),r.next()}function f(e,r){return r.a=e.a,r.b=e.b,r.c=e.c,r.d=e.d,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n((function(){return a})):this.tychei=a}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js":[function(e,r,n){!function(e,r,n){function t(e){var r=this,n="";r.x=0,r.y=0,r.z=0,r.w=0,r.next=function(){var e=r.x^r.x<<11;return r.x=r.y,r.y=r.z,r.z=r.w,r.w^=r.w>>>19^e^e>>>8},e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),r.next()}function f(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n((function(){return a})):this.xor128=a}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js":[function(e,r,n){!function(e,r,n){function t(e){var r=this;r.next=function(){var e,n,t=r.w,f=r.X,a=r.i;return r.w=t=t+1640531527|0,n=f[a+34&127],e=f[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=f[a]=n^e,r.i=a,n+(t^t>>>16)|0},function(e,r){var n,t,f,a,o,i=[],s=128;for(r===(0|r)?(t=r,r=null):(r+="\0",t=0,s=Math.max(s,r.length)),f=0,a=-32;a<s;++a)r&&(t^=r.charCodeAt((a+32)%r.length)),0===a&&(o=t),t^=t<<10,t^=t>>>15,t^=t<<4,t^=t>>>13,a>=0&&(o=o+1640531527|0,f=0==(n=i[127&a]^=t+o)?f+1:0);for(f>=128&&(i[127&(r&&r.length||0)]=-1),f=127,a=512;a>0;--a)t=i[f+34&127],n=i[f=f+1&127],t^=t<<13,n^=n<<17,t^=t>>>15,n^=n>>>12,i[f]=t^n;e.w=o,e.X=i,e.i=f}(r,e)}function f(e,r){return r.i=e.i,r.w=e.w,r.X=e.X.slice(),r}function a(e,r){null==e&&(e=+new Date);var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,a&&(a.X&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n((function(){return a})):this.xor4096=a}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js":[function(e,r,n){!function(e,r,n){function t(e){var r=this;r.next=function(){var e,n,t=r.x,f=r.i;return e=t[f],n=(e^=e>>>7)^e<<24,n^=(e=t[f+1&7])^e>>>10,n^=(e=t[f+3&7])^e>>>3,n^=(e=t[f+4&7])^e<<7,e=t[f+7&7],n^=(e^=e<<13)^e<<9,t[f]=n,r.i=f+1&7,n},function(e,r){var n,t=[];if(r===(0|r))t[0]=r;else for(r=""+r,n=0;n<r.length;++n)t[7&n]=t[7&n]<<15^r.charCodeAt(n)+t[n+1&7]<<13;for(;t.length<8;)t.push(0);for(n=0;n<8&&0===t[n];++n);for(8==n?t[7]=-1:t[n],e.x=t,e.i=0,n=256;n>0;--n)e.next()}(r,e)}function f(e,r){return r.x=e.x.slice(),r.i=e.i,r}function a(e,r){null==e&&(e=+new Date);var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,a&&(a.x&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n((function(){return a})):this.xorshift7=a}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js":[function(e,r,n){!function(e,r,n){function t(e){var r=this,n="";r.next=function(){var e=r.x^r.x>>>2;return r.x=r.y,r.y=r.z,r.z=r.w,r.w=r.v,(r.d=r.d+362437|0)+(r.v=r.v^r.v<<4^e^e<<1)|0},r.x=0,r.y=0,r.z=0,r.w=0,r.v=0,e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),t==n.length&&(r.d=r.x<<10^r.x>>>4),r.next()}function f(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r.v=e.v,r.d=e.d,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n((function(){return a})):this.xorwow=a}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js":[function(e,r,n){!function(n,t){var f,a=this,o=t.pow(256,6),i=t.pow(2,52),s=2*i;function d(e,r,d){var h=[],g=l(function e(r,n){var t,f=[],a=typeof r;if(n&&"object"==a)for(t in r)try{f.push(e(r[t],n-1))}catch(e){}return f.length?f:"string"==a?r:r+"\0"}((r=1==r?{entropy:!0}:r||{}).entropy?[e,b(n)]:null==e?function(){try{if(f)return b(f.randomBytes(256));var e=new Uint8Array(256);return(a.crypto||a.msCrypto).getRandomValues(e),b(e)}catch(e){var r=a.navigator,t=r&&r.plugins;return[+new Date,a,t,a.screen,b(n)]}}():e,3),h),p=new c(h),m=function(){for(var e=p.g(6),r=o,n=0;e<i;)e=256*(e+n),r*=256,n=p.g(1);for(;e>=s;)e/=2,r/=2,n>>>=1;return(e+n)/r};return m.int32=function(){return 0|p.g(4)},m.quick=function(){return p.g(4)/4294967296},m.double=m,l(b(p.S),n),(r.pass||d||function(e,r,n,f){return f&&(f.S&&u(f,p),e.state=function(){return u(p,{})}),n?(t.random=e,r):e})(m,g,"global"in r?r.global:this==t,r.state)}function c(e){var r,n=e.length,t=this,f=0,a=t.i=t.j=0,o=t.S=[];for(n||(e=[n++]);f<256;)o[f]=f++;for(f=0;f<256;f++)o[f]=o[a=255&a+e[f%n]+(r=o[f])],o[a]=r;(t.g=function(e){for(var r,n=0,f=t.i,a=t.j,o=t.S;e--;)r=o[f=255&f+1],n=256*n+o[255&(o[f]=o[a=255&a+r])+(o[a]=r)];return t.i=f,t.j=a,n})(256)}function u(e,r){return r.i=e.i,r.j=e.j,r.S=e.S.slice(),r}function l(e,r){for(var n,t=e+"",f=0;f<t.length;)r[255&f]=255&(n^=19*r[255&f])+t.charCodeAt(f++);return b(r)}function b(e){return String.fromCharCode.apply(0,e)}if(t.seedrandom=d,l(t.random(),n),"object"==typeof r&&r.exports){r.exports=d;try{f=e("crypto")}catch(e){}}else 0}([],Math)},{crypto:!1}]},{},["./lib/trianglify.js"])("./lib/trianglify.js")}));
base/base.php CHANGED
@@ -136,7 +136,7 @@ function siteorigin_widget_get_font($font_value) {
136
$font_url_param .= ':' . $font_parts[1];
137
}
138
$font['url'] = 'https://fonts.googleapis.com/css?family=' . $font_url_param;
139
- $font['css_import'] = '@import url(https://fonts.googleapis.com/css?family=' . $font_url_param . ');';
140
}
141
else {
142
$font['family'] = $font_value;
136
$font_url_param .= ':' . $font_parts[1];
137
}
138
$font['url'] = 'https://fonts.googleapis.com/css?family=' . $font_url_param;
139
+ $font['css_import'] = '@import url(https://fonts.googleapis.com/css?family=' . $font_url_param . '&display=swap);';
140
}
141
else {
142
$font['family'] = $font_value;
base/css/admin.css CHANGED
@@ -1 +1 @@
1
- .siteorigin-widget-form-no-styles{display:none !important}.siteorigin-widget-teaser{padding:10px 12px;border:1px solid #5fc133;background:#edfbe7;color:#394a3a;margin-bottom:20px}.siteorigin-widget-teaser .dashicons{float:right;margin:1px 2px 6px 10px;cursor:pointer;font-size:18px;width:18px;height:18px}.siteorigin-widget-form-notification{padding:8px 12px;border:1px solid #a4cadd;background-color:#CDE2EC;margin-bottom:20px}.siteorigin-widget-form-notification>span{line-height:22px}.siteorigin-widget-form-notification>a.button.button-small{margin-left:10px;height:22px}.siteorigin-widget-form{display:block !important;margin:15px 0}.siteorigin-widget-form>div:first-child{margin-top:0}.siteorigin-widget-form a{box-shadow:none}.siteorigin-widget-form.siteorigin-widget-form-main{min-width:600px}.siteorigin-widget-form .siteorigin-widget-field{margin:1em 0}.siteorigin-widget-form .siteorigin-widget-field>label{display:block;margin-bottom:3px}.siteorigin-widget-form .siteorigin-widget-field>label.siteorigin-widget-field-label{font-weight:bold}.siteorigin-widget-form .siteorigin-widget-field>label.so-checkbox-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.siteorigin-widget-form .siteorigin-widget-field .siteorigin-widget-description{font-size:.9em;margin-top:.2em;color:#999;font-style:italic}.siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-separator{margin:1.75em 0}.siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-is-optional .field-optional{font-weight:normal;font-size:.8em;vertical-align:super;padding-left:.5em;color:#54a242;font-style:italic}.siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-is-required .field-required{font-weight:normal;font-size:.8em;vertical-align:super;padding-left:.5em;color:#F02311;font-style:italic}.siteorigin-widget-form .siteorigin-widget-field input[type="text"]{width:100%}.siteorigin-widget-form .siteorigin-widget-field input.siteorigin-widget-input-color{width:auto}.siteorigin-widget-form .siteorigin-widget-field textarea.siteorigin-widget-code-input{font-family:"Courier New",Courier,monospace}.siteorigin-widget-form .siteorigin-widget-field select{min-width:150px}.siteorigin-widget-form .siteorigin-widget-field select[multiple]{max-height:83px}.siteorigin-widget-form .siteorigin-widget-field-type-slider .siteorigin-widget-slider-wrapper{margin:10px 0;border:1px solid #E0E0E0;padding:12px 15px;background:#F4F4F4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;max-width:500px;display:block;margin-left:55px}.siteorigin-widget-form .siteorigin-widget-field-type-slider .siteorigin-widget-slider-value{display:block;float:left;margin-top:0;border:1px solid #E0E0E0;padding:11px 0;background:#F4F4F4;font-weight:bold;color:#666;width:45px;text-align:center}.siteorigin-widget-form .siteorigin-widget-field-type-slider .siteorigin-widget-value-slider{position:relative;height:5px;background:#A0A0A0;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.25);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.25);box-shadow:inset 0 1px 2px rgba(0,0,0,0.25);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.siteorigin-widget-form .siteorigin-widget-field-type-slider .ui-slider-handle{cursor:move;-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #a4a3a8;z-index:10;position:absolute;width:18px;height:18px;margin-top:-7px;margin-left:-9px;background:#F9F9F9;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;top:0;left:0;-webkit-box-shadow:inset 0 1px 0 #FFFFFF, 0 1px 1px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 0 #FFFFFF, 0 1px 1px rgba(0,0,0,0.1);box-shadow:inset 0 1px 0 #FFFFFF, 0 1px 1px rgba(0,0,0,0.1)}.siteorigin-widget-form .siteorigin-widget-field-type-slider input[type="number"]{display:none}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-top{background:#F0F0F0;border:1px solid #D0D0D0;padding:10px;position:relative}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-top h3{font-size:13px;margin:0;padding:0 !important}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-expand,.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-copy,.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-remove{width:14px;height:14px;position:absolute;top:50%;margin-top:-7px;cursor:pointer;font-size:14px;line-height:14px;text-align:center}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-expand:before,.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-copy:before,.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-remove:before{font-family:dashicons;vertical-align:middle;color:#999999}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-expand{right:48px}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-expand:before{content:"\f140"}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-expand:hover:before{color:#50575D}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-copy{right:28px}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-copy:before{content:"\f105"}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-copy:hover:before{color:#50575D}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-remove{right:12px}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-remove:before{content:'\f158'}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-remove:hover{background:#ff0000}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-remove:hover:before{color:#FFFFFF}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items{background:#FCFCFC;border:1px solid #EEEEEE;border-top:0;border-bottom:0}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item{background:#FCFCFC;border-bottom:1px solid #EEEEEE}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item .siteorigin-widget-field-repeater-item-top{padding:10px;cursor:move;position:relative;background:#F6F6F6}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item .siteorigin-widget-field-repeater-item-top h4{font-size:12px;margin:0}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item h4{font-size:15px;margin:0}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item:last-child{border-bottom:0}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item .siteorigin-widget-field-repeater-item-form{border-top:1px solid #EEEEEE;display:none;padding:1px 10px}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-add{padding:7px 10px;background:#F0F0F0;border:1px dashed #D0D0D0;font-size:12px;line-height:1em;text-align:center;cursor:pointer}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-add:hover{background:#F4F4F4}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-top{background:#eaf2f6;border-color:#c9d0d4}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-top h3{color:#42484b}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items{background:#f6fdff;border-color:#e8eff3}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item{background:#f8fdff;border-bottom-color:#e8eff3}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item .siteorigin-widget-field-repeater-item-top{background:#f0f8fc}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item .siteorigin-widget-field-repeater-item-form{border-top-color:#e8eff3}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-add{background:#eaf2f6;border-color:#c9d0d4;color:#42484b}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-add:hover{background:#edf5f9}.siteorigin-widget-form .siteorigin-widget-field-type-posts .posts-container-label-wrapper{background:#F0F0F0;border:1px solid #D0D0D0;padding:10px;display:block;margin-bottom:0}.siteorigin-widget-form .siteorigin-widget-field-type-posts .posts-container-label-wrapper>label{display:inline}.siteorigin-widget-form .siteorigin-widget-field-type-posts .posts-container-label-wrapper:before{float:left;margin:3px 6px 0 0;display:block;width:14px;height:14px;font-size:14px;line-height:1;font-family:"dashicons";content:"\f132"}.siteorigin-widget-form .siteorigin-widget-field-type-posts .posts-container-label-wrapper.siteorigin-widget-section-visible:before{content:"\f460"}.siteorigin-widget-form .siteorigin-widget-field-type-posts .posts-container-label-wrapper span.sow-current-count{display:inline-block;border-radius:9px;background:#f92700;border:1px solid #da0900;line-height:14px;font-size:7px;width:17px;height:17px;text-align:center;vertical-align:middle;font-weight:bold;color:#FFFFFF;box-sizing:border-box;margin:1px 5px}.siteorigin-widget-form .siteorigin-widget-field-type-widget>label,.siteorigin-widget-form .siteorigin-widget-field-type-section>label{background:#F0F0F0;border:1px solid #D0D0D0;padding:10px;display:block;margin-bottom:0}.siteorigin-widget-form .siteorigin-widget-field-type-widget>label:before,.siteorigin-widget-form .siteorigin-widget-field-type-section>label:before{float:left;margin:3px 6px 0 0;display:block;width:14px;height:14px;font-size:14px;line-height:1;font-family:"dashicons";content:"\f132"}.siteorigin-widget-form .siteorigin-widget-field-type-widget>label.siteorigin-widget-section-visible:before,.siteorigin-widget-form .siteorigin-widget-field-type-section>label.siteorigin-widget-section-visible:before{content:"\f460"}.siteorigin-widget-form .siteorigin-widget-field-type-posts .siteorigin-widget-section,.siteorigin-widget-form .siteorigin-widget-field-type-widget .siteorigin-widget-section,.siteorigin-widget-form .siteorigin-widget-field-type-section .siteorigin-widget-section{padding:1px 10px;background:#FCFCFC;border:1px solid #EEEEEE;border-top:0}.siteorigin-widget-form .siteorigin-widget-field-type-posts .siteorigin-widget-section.siteorigin-widget-section-hide,.siteorigin-widget-form .siteorigin-widget-field-type-widget .siteorigin-widget-section.siteorigin-widget-section-hide,.siteorigin-widget-form .siteorigin-widget-field-type-section .siteorigin-widget-section.siteorigin-widget-section-hide{display:none}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete,.siteorigin-widget-form .siteorigin-widget-field-type-link{position:relative}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector{padding:20px;display:none;position:absolute;top:110%;width:360px;z-index:10;border:1px solid #c0c0c0;background:#F6F6F6;-webkit-box-shadow:0 2px 4px rgba(0,0,0,0.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,0.2);box-shadow:0 2px 4px rgba(0,0,0,0.2);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .content-text-search,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .content-text-search{width:100%;margin-bottom:15px}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts{margin:0;padding:0;background:#fff;max-height:300px;overflow-y:scroll;border:1px solid #e4e4e4}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li{cursor:pointer;padding:5px 10px;color:#32373c;border-bottom:1px solid #f1f1f1;margin:0;font-size:.95em}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li.selected,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li.selected,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li.selected,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li.selected{background:#e1edfa}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li:hover,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li:hover,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li:hover,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li:hover{background:#eaf2fa}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li:last-child,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li:last-child,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li:last-child,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li:last-child{border-bottom:0}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li span,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li span,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li span,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li span{font-size:.9em;display:inline-block;float:right;color:#999;margin-left:10px}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items.loading,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items.loading,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts.loading,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts.loading{min-height:40px;background:#FFFFFF url("img/wpspin_light.gif") center center no-repeat}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items.loading,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items.loading,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts.loading,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts.loading{background-image:url("img/wpspin_light-2x.gif");background-size:16px 16px}}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items.loading li,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items.loading li,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts.loading li,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts.loading li{display:none}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .buttons,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .buttons{margin-top:15px;text-align:right}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .buttons a,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .buttons a{display:inline-block}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .url-input-wrapper,.siteorigin-widget-form .siteorigin-widget-field-type-link .url-input-wrapper{display:block;margin-right:130px}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .select-content-button,.siteorigin-widget-form .siteorigin-widget-field-type-link .select-content-button{float:right;width:120px;text-align:center}.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector{right:0}.siteorigin-widget-form .siteorigin-widget-description{clear:both}.siteorigin-widget-preview{display:block !important}.siteorigin-widget-help-link{display:block;margin:1em 0}.so-widgets-dialog .so-widgets-dialog-overlay{position:fixed;z-index:500000;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.7)}.so-widgets-dialog .so-widgets-toolbar,.so-widgets-dialog .so-widgets-dialog-frame{position:fixed;z-index:500001;-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.so-widgets-dialog .so-widgets-toolbar{left:30px;right:30px;top:30px;height:50px;background:#fafafa;border-bottom:1px solid #D8D8D8}.so-widgets-dialog .so-widgets-toolbar h3{margin:15px 0 15px 20px}.so-widgets-dialog .so-widgets-toolbar .close{position:absolute;box-sizing:border-box;width:50px;height:50px;display:block;cursor:pointer;top:0;right:0;-webkit-transition:all .2s ease;-moz-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;background:#fafafa;border-left:1px solid #d8d8d8;border-bottom:1px solid #d8d8d8}.so-widgets-dialog .so-widgets-toolbar .close:hover{background:#e9e9e9}.so-widgets-dialog .so-widgets-toolbar .close:hover .so-dialog-icon{color:#333333}.so-widgets-dialog .so-widgets-toolbar .close .dashicons{position:absolute;top:50%;left:50%;text-decoration:none;width:21px;height:21px;margin-left:-11px;margin-top:-10px;font-size:21px;color:#666666;text-align:center}.so-widgets-dialog .so-widgets-dialog-frame{top:80px;left:30px;right:30px;bottom:30px;background:#FFFFFF url("img/wpspin_light.gif") center center no-repeat}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.so-widgets-dialog .so-widgets-dialog-frame{background-image:url("img/wpspin_light-2x.gif");background-size:16px 16px}}.so-widgets-dialog .so-widgets-dialog-frame iframe{width:100%;height:100%}.widget-icon.so-widget-icon{background-size:cover;background-image:url("img/bundle-icon.png")}.widget-icon.so-widget-icon.so-block-editor-icon{width:20px;height:20px;display:inline-block}.block-editor .so-widget-placeholder{text-align:left}.block-editor .so-widget-placeholder>.components-placeholder__label{background:url("img/bundle-icon.png") no-repeat left;background-size:20px;padding-left:25px}.block-editor .so-widget-placeholder>.components-placeholder__fieldset{max-width:unset}.block-editor .so-widget-placeholder>.components-placeholder__fieldset .so-widget-block-container{width:100%}.block-editor .so-widget-placeholder>.components-placeholder__fieldset .so-widget-block-container .siteorigin-widget-form.siteorigin-widget-form-main{min-width:unset}.block-editor .siteorigin-widget-form .siteorigin-widget-field{text-align:left}.block-editor .siteorigin-widget-form .siteorigin-widget-field input{padding:3px 5px}.block-editor .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-autocomplete .select-content-button,.block-editor .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-link .select-content-button{box-shadow:unset;font-size:13px;height:28px}.block-editor .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-icon .siteorigin-widget-icon-selector-current{height:37px}.block-editor .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-tinymce .wp-switch-editor{box-sizing:content-box}.block-editor .so-widget-preview-container .so-widgets-spinner-container{text-align:center}.block-editor .so-widget-preview-container .so-widgets-spinner-container>span{display:inline-block}
1
+ .siteorigin-widget-form-no-styles{display:none !important}.siteorigin-widget-teaser{padding:10px 12px;border:1px solid #5fc133;background:#edfbe7;color:#394a3a;margin-bottom:20px}.siteorigin-widget-teaser .dashicons{float:right;margin:1px 2px 6px 10px;cursor:pointer;font-size:18px;width:18px;height:18px}.siteorigin-widget-form-notification{padding:8px 12px;border:1px solid #a4cadd;background-color:#CDE2EC;margin-bottom:20px}.siteorigin-widget-form-notification>span{line-height:22px}.siteorigin-widget-form-notification>a.button.button-small{margin-left:10px;height:22px}.siteorigin-widget-form{display:block !important;margin:15px 0}.siteorigin-widget-form>div:first-child{margin-top:0}.siteorigin-widget-form a{box-shadow:none}.siteorigin-widget-form.siteorigin-widget-form-main{min-width:600px}.siteorigin-widget-form .siteorigin-widget-field{margin:1em 0}.siteorigin-widget-form .siteorigin-widget-field>label{display:block;font-size:13px;font-weight:400;margin-bottom:3px}.siteorigin-widget-form .siteorigin-widget-field>label.siteorigin-widget-field-label{font-weight:bold}.siteorigin-widget-form .siteorigin-widget-field>label.so-checkbox-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.siteorigin-widget-form .siteorigin-widget-field .siteorigin-widget-description{font-size:.9em;margin-top:.2em;color:#999;font-style:italic}.siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-separator{margin:1.75em 0}.siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-is-optional .field-optional{font-weight:normal;font-size:.8em;vertical-align:super;padding-left:.5em;color:#54a242;font-style:italic}.siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-is-required .field-required{font-weight:normal;font-size:.8em;vertical-align:super;padding-left:.5em;color:#F02311;font-style:italic}.siteorigin-widget-form .siteorigin-widget-field input[type="text"]{width:100%}.siteorigin-widget-form .siteorigin-widget-field input.siteorigin-widget-input-color{width:auto}.siteorigin-widget-form .siteorigin-widget-field .wp-picker-clear{margin-left:6px;min-height:30px}.siteorigin-widget-form .siteorigin-widget-field textarea.siteorigin-widget-code-input{font-family:"Courier New",Courier,monospace}.siteorigin-widget-form .siteorigin-widget-field select{min-width:150px}.siteorigin-widget-form .siteorigin-widget-field select[multiple]{max-height:83px}.siteorigin-widget-form .siteorigin-widget-field-type-slider .siteorigin-widget-slider-wrapper{margin:10px 0;border:1px solid #E0E0E0;padding:12px 15px;background:#F4F4F4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;max-width:500px;display:block;margin-left:55px}.siteorigin-widget-form .siteorigin-widget-field-type-slider .siteorigin-widget-slider-value{display:block;float:left;margin-top:0;border:1px solid #E0E0E0;padding:11px 0;background:#F4F4F4;font-weight:bold;color:#666;width:45px;text-align:center}.siteorigin-widget-form .siteorigin-widget-field-type-slider .siteorigin-widget-value-slider{position:relative;height:5px;background:#A0A0A0;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.25);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.25);box-shadow:inset 0 1px 2px rgba(0,0,0,0.25);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.siteorigin-widget-form .siteorigin-widget-field-type-slider .ui-slider-handle{cursor:move;-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #a4a3a8;z-index:10;position:absolute;width:18px;height:18px;margin-top:-7px;margin-left:-9px;background:#F9F9F9;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;top:0;left:0;-webkit-box-shadow:inset 0 1px 0 #FFFFFF, 0 1px 1px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 0 #FFFFFF, 0 1px 1px rgba(0,0,0,0.1);box-shadow:inset 0 1px 0 #FFFFFF, 0 1px 1px rgba(0,0,0,0.1)}.siteorigin-widget-form .siteorigin-widget-field-type-slider input[type="number"]{display:none}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-top{background:#F0F0F0;border:1px solid #D0D0D0;padding:10px;position:relative}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-top h3{font-size:13px;margin:0;padding:0 !important}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-expand,.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-copy,.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-remove{width:14px;height:14px;position:absolute;top:50%;margin-top:-7px;cursor:pointer;font-size:14px;line-height:14px;text-align:center}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-expand:before,.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-copy:before,.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-remove:before{font-family:dashicons;vertical-align:middle;color:#999999}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-expand{right:48px}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-expand:before{content:"\f140"}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-expand:hover:before{color:#50575D}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-copy{right:28px}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-copy:before{content:"\f105"}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-copy:hover:before{color:#50575D}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-remove{right:12px}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-remove:before{content:'\f158'}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-remove:hover{background:#ff0000}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-remove:hover:before{color:#FFFFFF}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items{background:#FCFCFC;border:1px solid #EEEEEE;border-top:0;border-bottom:0}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item{background:#FCFCFC;border-bottom:1px solid #EEEEEE}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item .siteorigin-widget-field-repeater-item-top{padding:10px;cursor:move;position:relative;background:#F6F6F6}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item .siteorigin-widget-field-repeater-item-top h4{font-size:12px;margin:0}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item h4{font-size:15px;margin:0}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item:last-child{border-bottom:0}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item .siteorigin-widget-field-repeater-item-form{border-top:1px solid #EEEEEE;display:none;padding:1px 10px}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-add{padding:7px 10px;background:#F0F0F0;border:1px dashed #D0D0D0;font-size:12px;line-height:1em;text-align:center;cursor:pointer}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-add:hover{background:#F4F4F4}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-top{background:#eaf2f6;border-color:#c9d0d4}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-top h3{color:#42484b}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items{background:#f6fdff;border-color:#e8eff3}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item{background:#f8fdff;border-bottom-color:#e8eff3}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item .siteorigin-widget-field-repeater-item-top{background:#f0f8fc}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-items .siteorigin-widget-field-repeater-item .siteorigin-widget-field-repeater-item-form{border-top-color:#e8eff3}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-add{background:#eaf2f6;border-color:#c9d0d4;color:#42484b}.siteorigin-widget-form .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater .siteorigin-widget-field-repeater-add:hover{background:#edf5f9}.siteorigin-widget-form .siteorigin-widget-field-type-posts .posts-container-label-wrapper{background:#F0F0F0;border:1px solid #D0D0D0;padding:10px;display:block;margin-bottom:0}.siteorigin-widget-form .siteorigin-widget-field-type-posts .posts-container-label-wrapper>label{display:inline}.siteorigin-widget-form .siteorigin-widget-field-type-posts .posts-container-label-wrapper:before{float:left;margin:3px 6px 0 0;display:block;width:14px;height:14px;font-size:14px;line-height:1;font-family:"dashicons";content:"\f132"}.siteorigin-widget-form .siteorigin-widget-field-type-posts .posts-container-label-wrapper.siteorigin-widget-section-visible:before{content:"\f460"}.siteorigin-widget-form .siteorigin-widget-field-type-posts .posts-container-label-wrapper span.sow-current-count{display:inline-block;border-radius:9px;background:#f92700;border:1px solid #da0900;line-height:14px;font-size:7px;width:17px;height:17px;text-align:center;vertical-align:middle;font-weight:bold;color:#FFFFFF;box-sizing:border-box;margin:1px 5px}.siteorigin-widget-form .siteorigin-widget-field-type-widget>label,.siteorigin-widget-form .siteorigin-widget-field-type-section>label{background:#F0F0F0;border:1px solid #D0D0D0;line-height:1.4;padding:10px;display:block;margin-bottom:0}.siteorigin-widget-form .siteorigin-widget-field-type-widget>label:before,.siteorigin-widget-form .siteorigin-widget-field-type-section>label:before{float:left;margin:3px 6px 0 0;display:block;width:14px;height:14px;font-size:14px;line-height:1;font-family:"dashicons";content:"\f132"}.siteorigin-widget-form .siteorigin-widget-field-type-widget>label.siteorigin-widget-section-visible:before,.siteorigin-widget-form .siteorigin-widget-field-type-section>label.siteorigin-widget-section-visible:before{content:"\f460"}.siteorigin-widget-form .siteorigin-widget-field-type-posts .siteorigin-widget-section,.siteorigin-widget-form .siteorigin-widget-field-type-widget .siteorigin-widget-section,.siteorigin-widget-form .siteorigin-widget-field-type-section .siteorigin-widget-section{padding:1px 10px;background:#FCFCFC;border:1px solid #EEEEEE;border-top:0}.siteorigin-widget-form .siteorigin-widget-field-type-posts .siteorigin-widget-section.siteorigin-widget-section-hide,.siteorigin-widget-form .siteorigin-widget-field-type-widget .siteorigin-widget-section.siteorigin-widget-section-hide,.siteorigin-widget-form .siteorigin-widget-field-type-section .siteorigin-widget-section.siteorigin-widget-section-hide{display:none}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete,.siteorigin-widget-form .siteorigin-widget-field-type-link{position:relative}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector{padding:20px;display:none;position:absolute;top:110%;width:360px;z-index:10;border:1px solid #c0c0c0;background:#F6F6F6;-webkit-box-shadow:0 2px 4px rgba(0,0,0,0.2);-moz-box-shadow:0 2px 4px rgba(0,0,0,0.2);box-shadow:0 2px 4px rgba(0,0,0,0.2);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .content-text-search,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .content-text-search{width:100%;margin-bottom:15px}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts{margin:0;padding:0;background:#fff;max-height:300px;overflow-y:scroll;border:1px solid #e4e4e4}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li{cursor:pointer;padding:5px 10px;color:#32373c;border-bottom:1px solid #f1f1f1;margin:0;font-size:.95em}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li.selected,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li.selected,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li.selected,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li.selected{background:#e1edfa}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li:hover,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li:hover,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li:hover,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li:hover{background:#eaf2fa}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li:last-child,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li:last-child,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li:last-child,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li:last-child{border-bottom:0}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items li span,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items li span,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts li span,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts li span{font-size:.9em;display:inline-block;float:right;color:#999;margin-left:10px}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items.loading,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items.loading,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts.loading,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts.loading{min-height:40px;background:#FFFFFF url("img/wpspin_light.gif") center center no-repeat}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items.loading,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items.loading,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts.loading,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts.loading{background-image:url("img/wpspin_light-2x.gif");background-size:16px 16px}}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .items.loading li,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .items.loading li,.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .posts.loading li,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .posts.loading li{display:none}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .buttons,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .buttons{margin-top:15px;text-align:right}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .existing-content-selector .buttons a,.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector .buttons a{display:inline-block}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .url-input-wrapper,.siteorigin-widget-form .siteorigin-widget-field-type-link .url-input-wrapper{display:block;margin-right:130px}.siteorigin-widget-form .siteorigin-widget-field-type-autocomplete .select-content-button,.siteorigin-widget-form .siteorigin-widget-field-type-link .select-content-button{float:right;line-height:28px;min-height:30px;width:120px;text-align:center}.siteorigin-widget-form .siteorigin-widget-field-type-link .existing-content-selector{right:0}.siteorigin-widget-form .siteorigin-widget-description{clear:both}.siteorigin-widget-preview{display:block !important}.siteorigin-widget-help-link{display:block;margin:1em 0}.so-widgets-dialog .so-widgets-dialog-overlay{position:fixed;z-index:500000;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.7)}.so-widgets-dialog .so-widgets-toolbar,.so-widgets-dialog .so-widgets-dialog-frame{position:fixed;z-index:500001;-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.so-widgets-dialog .so-widgets-toolbar{left:30px;right:30px;top:30px;height:50px;background:#fafafa;border-bottom:1px solid #D8D8D8}.so-widgets-dialog .so-widgets-toolbar h3{margin:15px 0 15px 20px}.so-widgets-dialog .so-widgets-toolbar .close{position:absolute;box-sizing:border-box;width:50px;height:50px;display:block;cursor:pointer;top:0;right:0;-webkit-transition:all .2s ease;-moz-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;background:#fafafa;border-left:1px solid #d8d8d8;border-bottom:1px solid #d8d8d8}.so-widgets-dialog .so-widgets-toolbar .close:hover{background:#e9e9e9}.so-widgets-dialog .so-widgets-toolbar .close:hover .so-dialog-icon{color:#333333}.so-widgets-dialog .so-widgets-toolbar .close .dashicons{position:absolute;top:50%;left:50%;text-decoration:none;width:21px;height:21px;margin-left:-11px;margin-top:-10px;font-size:21px;color:#666666;text-align:center}.so-widgets-dialog .so-widgets-dialog-frame{top:80px;left:30px;right:30px;bottom:30px;background:#FFFFFF url("img/wpspin_light.gif") center center no-repeat}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.so-widgets-dialog .so-widgets-dialog-frame{background-image:url("img/wpspin_light-2x.gif");background-size:16px 16px}}.so-widgets-dialog .so-widgets-dialog-frame iframe{width:100%;height:100%}.widget-icon.so-widget-icon{background-size:cover;background-image:url("img/bundle-icon.png")}.widget-icon.so-widget-icon.so-block-editor-icon{width:20px;height:20px;display:inline-block}.block-editor .so-widget-placeholder{text-align:left}.block-editor .so-widget-placeholder>.components-placeholder__label{background:url("img/bundle-icon.png") no-repeat left;background-size:20px;padding-left:25px}.block-editor .so-widget-placeholder>.components-placeholder__fieldset{max-width:unset}.block-editor .so-widget-placeholder>.components-placeholder__fieldset .so-widget-block-container{width:100%}.block-editor .so-widget-placeholder>.components-placeholder__fieldset .so-widget-block-container .components-base-control__field select{max-width:unset}.block-editor .so-widget-placeholder>.components-placeholder__fieldset .so-widget-block-container .siteorigin-widget-form.siteorigin-widget-form-main{min-width:unset}.block-editor .siteorigin-widget-form .siteorigin-widget-field{text-align:left}.block-editor .siteorigin-widget-form .siteorigin-widget-field input{padding:3px 5px}.block-editor .siteorigin-widget-form .siteorigin-widget-field input[type=checkbox]{background-color:#ffffff}.block-editor .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-autocomplete .select-content-button,.block-editor .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-link .select-content-button{box-shadow:unset;font-size:13px;height:28px}.block-editor .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-icon .siteorigin-widget-icon-selector-current{height:37px}.block-editor .siteorigin-widget-form .siteorigin-widget-field.siteorigin-widget-field-type-tinymce .wp-switch-editor{box-sizing:content-box}.block-editor .so-widget-preview-container .so-widgets-spinner-container{text-align:center}.block-editor .so-widget-preview-container .so-widgets-spinner-container>span{display:inline-block}
base/inc/fields/css/measurement-field.css CHANGED
@@ -1 +1 @@
1
- .siteorigin-widget-form .siteorigin-widget-field input[type="text"].siteorigin-widget-input-measurement{float:left;max-width:58px;margin:1px;height:28px;vertical-align:middle}.siteorigin-widget-form .siteorigin-widget-field select.sow-measurement-select-unit{min-width:inherit}
1
+ .siteorigin-widget-form .siteorigin-widget-field input[type="text"].siteorigin-widget-input-measurement{float:left;max-width:58px;margin-right:1px;min-height:28px;vertical-align:middle}.siteorigin-widget-form .siteorigin-widget-field select.sow-measurement-select-unit{min-width:inherit}
base/inc/fields/css/media-field.css CHANGED
@@ -1 +1 @@
1
- .siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper{position:relative;display:block;float:left;background:#f9f9f9;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #f2f2f2), color-stop(1, #f9f9f9));background:-ms-linear-gradient(bottom, #f2f2f2, #f9f9f9);background:-moz-linear-gradient(center bottom, #f2f2f2 0%, #f9f9f9 100%);background:-o-linear-gradient(#f9f9f9, #f2f2f2);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#f2f2f2', GradientType=0);-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.1);box-shadow:0 1px 2px rgba(0,0,0,0.1);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;border:1px solid #bbbbbb;height:32px}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper:hover{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15)}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .current{-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;float:left;height:32px;padding:4px;border-right:1px solid #bbb;position:relative;box-shadow:1px 0 0 #FFF}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .current .title{display:none;position:absolute;bottom:34px;left:0;padding:4px 12px;background:#333;color:#CCC;font-weight:bold;width:auto;white-space:nowrap}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .current .thumbnail-wrapper{border:1px solid #999;line-height:0;box-shadow:0 1px 1px #FFF;width:22px;height:22px;background:#cfcfcf;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #cccccc), color-stop(1, #cfcfcf));background:-ms-linear-gradient(bottom, #cccccc, #cfcfcf);background:-moz-linear-gradient(center bottom, #cccccc 0%, #cfcfcf 100%);background:-o-linear-gradient(#cfcfcf, #cccccc);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#cfcfcf', endColorstr='#cccccc', GradientType=0);box-shadow:inset 0 1px 3px rgba(0,0,0,0.2)}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .current .thumbnail-wrapper img{height:100%;width:100%;box-shadow:inset 0 1px 3px rgba(0,0,0,0.2)}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .media-upload-button,.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .find-image-button{display:block;float:left;color:#666;text-decoration:none;text-shadow:0 1px 0 #FFF;font-weight:600;font-size:11px;padding:7px 8px;outline:none;cursor:pointer;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .media-upload-button:hover,.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .find-image-button:hover{background:rgba(255,255,255,0.75)}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .find-image-button{border-left:1px solid #bbbbbb}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper:hover .media-upload-button{color:#707070}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-remove-button{display:block;text-decoration:none;float:left;color:#AAA;font-size:11px;line-height:1em;padding:11px 0 11px 6px;-webkit-transition:all .25s ease;-moz-transition:all .25s ease;-o-transition:all .25s ease;transition:all .25s ease;position:static;opacity:1}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-remove-button.remove-hide{pointer-events:none;opacity:0}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-remove-button:hover{color:#BC0B0B}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-fallback-external{float:left;padding:4px 8px;margin-top:2px !important;margin-left:25px !important;max-width:320px}#so-widgets-image-search-frame{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#fff;padding:25px;overflow-y:scroll;overflow-x:hidden}#so-widgets-image-search-frame #so-widgets-image-search-form{display:block;width:100%;position:relative;padding-right:368px;margin-bottom:2px;box-sizing:border-box}#so-widgets-image-search-frame #so-widgets-image-search-form .so-widgets-search-input{padding:9px 12px;margin-bottom:0px;box-shadow:none}#so-widgets-image-search-frame #so-widgets-image-search-form .so-widgets-search-input:focus{box-shadow:none}#so-widgets-image-search-frame #so-widgets-image-search-form .so-widgets-search-button{position:absolute;padding:9px 14px;font-size:1.2em;height:100%;top:0;right:320px;border-width:1px;box-shadow:none}#so-widgets-image-search-frame #so-widgets-image-search-suggestions{position:absolute;right:0;top:0;width:300px;height:40px;text-align:right;display:none;font-size:1.1em;overflow:hidden}#so-widgets-image-search-frame #so-widgets-image-search-suggestions strong{display:block}#so-widgets-image-search-frame #so-widgets-image-search-suggestions ul{display:block;list-style:none;margin:0;padding:0}#so-widgets-image-search-frame #so-widgets-image-search-suggestions ul li{display:inline-block;margin-right:4px}#so-widgets-image-search-frame #so-widgets-image-search-powered{font-size:.85em;margin-bottom:15px;color:#888}#so-widgets-image-search-frame .so-widgets-image-results{zoom:1;margin:0 -8px}#so-widgets-image-search-frame .so-widgets-image-results:before{content:'';display:block}#so-widgets-image-search-frame .so-widgets-image-results:after{content:'';display:table;clear:both}#so-widgets-image-search-frame .so-widgets-image-results .so-widgets-result{-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;float:left;margin:8px}#so-widgets-image-search-frame .so-widgets-image-results .so-widgets-result a{position:relative;background-repeat:no-repeat;background-size:cover;display:block;width:260px;height:180px;background-color:#e8e8e8}#so-widgets-image-search-frame .so-widgets-image-results .so-widgets-result a .so-widgets-result-sponsored{font-size:.8em;position:absolute;top:5px;right:5px;color:#fff;background:#59946B;line-height:1em;padding:5px;border-radius:2px}#so-widgets-image-search-frame .so-widgets-results-loading{display:none;font-size:1.1em;padding:15px 5px;background-color:#f7f7f7;text-align:center;margin-top:20px}#so-widgets-image-search-frame .so-widgets-results-loading .so-widgets-loading-icon{margin:0 6px -3px 0;display:inline-block;width:16px;height:16px;background-image:url("images/wpspin_light.gif");background-position:center center;background-repeat:no-repeat}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#so-widgets-image-search-frame .so-widgets-results-loading .so-widgets-loading-icon{background-image:url(images/wpspin_light-2x.gif);background-size:16px 16px}}#so-widgets-image-search-frame .so-widgets-results-more{display:none;text-align:center;margin-top:20px;padding-bottom:20px}#so-widgets-image-search-frame .so-widgets-preview-window{display:none;position:fixed;background-color:#ffffff;box-shadow:0 1px 3px rgba(0,0,0,0.35);padding:10px;pointer-events:none}#so-widgets-image-search-frame .so-widgets-preview-window .so-widgets-preview-window-inside{background-size:cover;overflow:hidden}#so-widgets-image-search-frame .so-widgets-preview-window img{width:100%;height:auto}#so-widgets-image-search-frame.so-widgets-importing .so-widgets-preview-window,#so-widgets-image-search-frame.so-widgets-importing #so-widgets-image-search-form,#so-widgets-image-search-frame.so-widgets-importing #so-widgets-image-search-powered,#so-widgets-image-search-frame.so-widgets-importing .so-widgets-image-results{visibility:hidden !important;display:none !important}
1
+ .siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper{background:#f9f9f9;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #f2f2f2), color-stop(1, #f9f9f9));background:-ms-linear-gradient(bottom, #f2f2f2, #f9f9f9);background:-moz-linear-gradient(center bottom, #f2f2f2 0%, #f9f9f9 100%);background:-o-linear-gradient(#f9f9f9, #f2f2f2);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#f2f2f2', GradientType=0);border:1px solid #bbbbbb;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.1);box-shadow:0 1px 2px rgba(0,0,0,0.1);display:block;float:left;font-size:13px;height:32px;line-height:18.2px;overflow:auto;position:relative}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper:hover{-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15)}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .current{-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;float:left;height:32px;padding:4px;border-right:1px solid #bbb;position:relative;box-shadow:1px 0 0 #FFF}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .current .title{display:none;position:absolute;bottom:34px;left:0;padding:4px 12px;background:#333;color:#CCC;font-weight:bold;width:auto;white-space:nowrap}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .current .thumbnail-wrapper{border:1px solid #999;line-height:0;box-shadow:0 1px 1px #FFF;width:22px;height:22px;background:#cfcfcf;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #cccccc), color-stop(1, #cfcfcf));background:-ms-linear-gradient(bottom, #cccccc, #cfcfcf);background:-moz-linear-gradient(center bottom, #cccccc 0%, #cfcfcf 100%);background:-o-linear-gradient(#cfcfcf, #cccccc);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#cfcfcf', endColorstr='#cccccc', GradientType=0);box-shadow:inset 0 1px 3px rgba(0,0,0,0.2)}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .current .thumbnail-wrapper img{height:100%;width:100%;box-shadow:inset 0 1px 3px rgba(0,0,0,0.2)}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .media-upload-button,.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .find-image-button{display:block;float:left;color:#666;text-decoration:none;text-shadow:0 1px 0 #FFF;font-weight:600;font-size:11px;padding:7px 8px;outline:none;cursor:pointer;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .media-upload-button:hover,.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .find-image-button:hover{background:rgba(255,255,255,0.75)}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper .find-image-button{border-left:1px solid #bbbbbb}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-field-wrapper:hover .media-upload-button{color:#707070}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-remove-button{display:block;text-decoration:none;float:left;color:#AAA;font-size:11px;line-height:1em;margin-right:25px;padding:11px 0 11px 6px;-webkit-transition:all .25s ease;-moz-transition:all .25s ease;-o-transition:all .25s ease;transition:all .25s ease;position:static;opacity:1}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-remove-button.remove-hide{pointer-events:none;opacity:0}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-remove-button:hover{color:#BC0B0B}.siteorigin-widget-form .siteorigin-widget-field-type-media .media-fallback-external{float:left;margin-top:2px !important;max-width:320px}#so-widgets-image-search-frame{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#fff;padding:25px;overflow-y:scroll;overflow-x:hidden}#so-widgets-image-search-frame #so-widgets-image-search-form{display:block;width:100%;position:relative;margin-bottom:2px;box-sizing:border-box}@media (min-width:783px){#so-widgets-image-search-frame #so-widgets-image-search-form{padding-right:368px}}#so-widgets-image-search-frame #so-widgets-image-search-form .so-widgets-search-input{padding:9px 12px;margin-bottom:0px;box-shadow:none}#so-widgets-image-search-frame #so-widgets-image-search-form .so-widgets-search-input:focus{box-shadow:none}#so-widgets-image-search-frame #so-widgets-image-search-form .so-widgets-search-button{position:absolute;padding:0 14px;font-size:1.2em;height:100%;top:0;right:320px;border-width:1px;box-shadow:none}@media (max-width:783px){#so-widgets-image-search-frame #so-widgets-image-search-form .so-widgets-search-button{right:0}}#so-widgets-image-search-frame #so-widgets-image-search-form .so-widgets-search-button .dashicons-search{vertical-align:middle}#so-widgets-image-search-frame #so-widgets-image-search-suggestions{position:absolute;right:0;top:0;width:300px;height:40px;text-align:right;display:none;font-size:1.1em;overflow:hidden}#so-widgets-image-search-frame #so-widgets-image-search-suggestions strong{display:block}#so-widgets-image-search-frame #so-widgets-image-search-suggestions ul{display:block;list-style:none;margin:0;padding:0}#so-widgets-image-search-frame #so-widgets-image-search-suggestions ul li{display:inline-block;margin-right:4px}#so-widgets-image-search-frame #so-widgets-image-search-powered{font-size:.85em;margin-bottom:15px;color:#888}#so-widgets-image-search-frame .so-widgets-image-results{zoom:1;margin:0 -8px}#so-widgets-image-search-frame .so-widgets-image-results:before{content:'';display:block}#so-widgets-image-search-frame .so-widgets-image-results:after{content:'';display:table;clear:both}#so-widgets-image-search-frame .so-widgets-image-results .so-widgets-result{-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;float:left;margin:8px}#so-widgets-image-search-frame .so-widgets-image-results .so-widgets-result a{position:relative;background-repeat:no-repeat;background-size:cover;display:block;width:260px;height:180px;background-color:#e8e8e8}#so-widgets-image-search-frame .so-widgets-image-results .so-widgets-result a .so-widgets-result-sponsored{font-size:.8em;position:absolute;top:5px;right:5px;color:#fff;background:#59946B;line-height:1em;padding:5px;border-radius:2px}#so-widgets-image-search-frame .so-widgets-results-loading{display:none;font-size:1.1em;padding:15px 5px;background-color:#f7f7f7;text-align:center;margin-top:20px}#so-widgets-image-search-frame .so-widgets-results-loading .so-widgets-loading-icon{margin:0 6px -3px 0;display:inline-block;width:16px;height:16px;background-image:url("images/wpspin_light.gif");background-position:center center;background-repeat:no-repeat}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#so-widgets-image-search-frame .so-widgets-results-loading .so-widgets-loading-icon{background-image:url(images/wpspin_light-2x.gif);background-size:16px 16px}}#so-widgets-image-search-frame .so-widgets-results-more{display:none;text-align:center;margin-top:20px;padding-bottom:20px}#so-widgets-image-search-frame .so-widgets-preview-window{display:none;position:fixed;background-color:#ffffff;box-shadow:0 1px 3px rgba(0,0,0,0.35);padding:10px;pointer-events:none}#so-widgets-image-search-frame .so-widgets-preview-window .so-widgets-preview-window-inside{background-size:cover;overflow:hidden}#so-widgets-image-search-frame .so-widgets-preview-window img{width:100%;height:auto}#so-widgets-image-search-frame.so-widgets-importing .so-widgets-preview-window,#so-widgets-image-search-frame.so-widgets-importing #so-widgets-image-search-form,#so-widgets-image-search-frame.so-widgets-importing #so-widgets-image-search-powered,#so-widgets-image-search-frame.so-widgets-importing .so-widgets-image-results{visibility:hidden !important;display:none !important}
base/inc/fields/js/autocomplete-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(d){d(document).on("sowsetupformfield",".siteorigin-widget-field-type-autocomplete",function(e){var l=d(this);if(!l.data("initialized")){function o(){var e=l.find("input.siteorigin-widget-input").val();return 0===e.length?[]:e.split(",")}function i(){var n=o();l.find("ul.items > li").each(function(e,t){var i=d(this);-1<n.indexOf(i.data("value"))?i.addClass("selected"):i.removeClass("selected")})}function n(){var e=l.find(".content-text-search"),t=e.val(),i=e.data("source"),n=e.data("postTypes"),a={action:"so_widgets_search_"+i};"posts"===i?(a.query=t,a.postTypes=n):"terms"===i&&(a.term=t);var s=l.find("ul.items").empty().addClass("loading");return d.get(soWidgets.ajaxurl,a,function(e){e.forEach(function(e){""===e.label&&(e.label="&nbsp;"),s.append(d("<li>").html(e.label+"<span>("+e.type+")</span>").data(e))}),s.removeClass("loading")})}l.find(".siteorigin-widget-autocomplete-input").click(function(){var e=l.find(".existing-content-selector");e.show();var t=new d.Deferred;e.is(":visible")&&0===e.find("ul.items li").length?t=n():t.resolve(),t.done(i)});function t(){l.find(".existing-content-selector").hide()}d(window).mousedown(function(e){0===l.find(e.target).length&&t()}),l.find(".button-close").click(t),l.on("click",".items li",function(e){e.preventDefault();var t=d(this),i=o(),n=t.data("value"),a=i.indexOf(n);-1<a?(i.splice(a,1),t.removeClass("selected")):(i.push(n),t.addClass("selected"));var s=l.find("input.siteorigin-widget-input");s.val(i.join(",")),s.change()});var a=null;l.find(".content-text-search").keyup(function(){null!==a&&clearTimeout(a),a=setTimeout(function(){n()},500)}),l.data("initialized",!0)}})}(jQuery);
1
+ !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-autocomplete",(function(t){var i=e(this);if(!i.data("initialized")){var n=function(){var e=i.find("input.siteorigin-widget-input").val();return 0===e.length?[]:e.split(",")},a=function(){var t=n();i.find("ul.items > li").each((function(i,n){var a=e(this);t.indexOf(a.data("value"))>-1?a.addClass("selected"):a.removeClass("selected")}))},s=function(){var t=i.find(".content-text-search"),n=t.val(),a=t.data("source"),s=t.data("postTypes"),l={action:"so_widgets_search_"+a};"posts"===a?(l.query=n,l.postTypes=s):"terms"===a&&(l.term=n);var o=i.find("ul.items").empty().addClass("loading");return e.get(soWidgets.ajaxurl,l,(function(t){t.forEach((function(t){""===t.label&&(t.label="&nbsp;"),o.append(e("<li>").html(t.label+"<span>("+t.type+")</span>").data(t))})),o.removeClass("loading")}))};i.find(".siteorigin-widget-autocomplete-input").click((function(){var t=i.find(".existing-content-selector");t.show();var n=new e.Deferred;t.is(":visible")&&0===t.find("ul.items li").length?n=s():n.resolve(),n.done(a)}));var l=function(){i.find(".existing-content-selector").hide()};e(window).mousedown((function(e){0===i.find(e.target).length&&l()})),i.find(".button-close").click(l),i.on("click",".items li",(function(t){t.preventDefault();var a=e(this),s=n(),l=a.data("value"),o=s.indexOf(l);o>-1?(s.splice(o,1),a.removeClass("selected")):(s.push(l),a.addClass("selected"));var d=i.find("input.siteorigin-widget-input");d.val(s.join(",")),d.change()}));var o=null;i.find(".content-text-search").keyup((function(){null!==o&&clearTimeout(o),o=setTimeout((function(){s()}),500)})),i.data("initialized",!0)}}))}(jQuery);
base/inc/fields/js/code-field.min.js CHANGED
@@ -1 +1 @@
1
- (function(l){"use strict";var a,u=u||(a={},{add:function(e,t){var r;if("object"==typeof e)for(r=0;r<e.length;r++){var n=e[r];a[n]||(a[n]=[]),a[n].push(t)}else a[e]||(a[e]=[]),a[e].push(t)},get:function(e){if(a[e])return a[e]}}),e=e||function(e){"function"!=typeof String.prototype.repeat&&(String.prototype.repeat=function(e){if(e<1)return"";if(e%2)return this.repeat(e-1)+this;var t=this.repeat(e/2);return t+t}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(e){if(null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=[],a=arguments[1],o=0;o<r;o++)if(o in t){var i=t[o];e.call(a,i,o,t)&&n.push(i)}return n});var g,p,t,c={textarea:null,replaceTab:!0,softTabs:!0,tabSize:4,autoOpen:!0,overwrite:!0,autoStrip:!0,autoIndent:!0,fence:!1},v={keyMap:[{open:'"',close:'"',canBreak:!1},{open:"'",close:"'",canBreak:!1},{open:"(",close:")",canBreak:!1},{open:"[",close:"]",canBreak:!0},{open:"{",close:"}",canBreak:!0}]},h={_callHook:function(e,t){var r=u.get(e);if(t="boolean"!=typeof t||!1!==t,r)if(t){var n,a=c.textarea,o=a.value,i=h.cursor.get();for(n=0;n<r.length;n++)r[n].call(l,{editor:{element:a,text:o,levelsDeep:h.levelsDeep()},caret:{pos:i},lines:{current:h.cursor.getLine(o,i),total:h.editor.getLines(o)}})}else for(n=0;n<r.length;n++)r[n].call(l)},defineNewLine:function(){var e=document.createElement("textarea");e.value="\n",p=2==e.value.length?"\r\n":"\n"},defineTabSize:function(e){void 0===c.textarea.style.OTabSize?void 0===c.textarea.style.MozTabSize?void 0===c.textarea.style.tabSize||(c.textarea.style.tabSize=e):c.textarea.style.MozTabSize=e:c.textarea.style.OTabSize=e},cursor:{getLine:function(e,t){return e.substring(0,t).split("\n").length},get:function(){if("number"==typeof document.createElement("textarea").selectionStart)return c.textarea.selectionStart;if(document.selection){var e=0,t=c.textarea.createTextRange(),r=document.selection.createRange().duplicate().getBookmark();for(t.moveToBookmark(r);0!==t.moveStart("character",-1);)e++;return e}},set:function(e,t){if(t=t||e,c.textarea.setSelectionRange)c.textarea.focus(),c.textarea.setSelectionRange(e,t);else if(c.textarea.createTextRange){var r=c.textarea.createTextRange();r.collapse(!0),r.moveEnd("character",t),r.moveStart("character",e),r.select()}},selection:function(){var e,t,r,n,a,o=c.textarea,i=0,s=0;return"number"==typeof o.selectionStart&&"number"==typeof o.selectionEnd?(i=o.selectionStart,s=o.selectionEnd):(t=document.selection.createRange())&&t.parentElement()==o&&(n=(e=h.editor.get()).length,(r=o.createTextRange()).moveToBookmark(t.getBookmark()),(a=o.createTextRange()).collapse(!1),-1<r.compareEndPoints("StartToEnd",a)?i=s=n:(i=-r.moveStart("character",-n),i+=e.slice(0,i).split(p).length-1,-1<r.compareEndPoints("EndToEnd",a)?s=n:(s=-r.moveEnd("character",-n),s+=e.slice(0,s).split(p).length-1))),i!=s&&{start:i,end:s}}},editor:{getLines:function(e){return e.split("\n").length},get:function(){return c.textarea.value.replace(/\r/g,"")},set:function(e){c.textarea.value=e}},fenceRange:function(){if("string"!=typeof c.fence)return!0;for(var e=h.editor.get(),t=h.cursor.get(),r=0,n=e.indexOf(c.fence),a=0;0<=n&&(a++,!(t<n+r));)r+=n+c.fence.length,n=(e=e.substring(n+c.fence.length)).indexOf(c.fence);return r<t&&t<n+r&&a%2==0},isEven:function(e,t){return t%2},levelsDeep:function(){var e,t,r=h.cursor.get(),n=h.editor.get().substring(0,r),a=0;for(e=0;e<n.length;e++)for(t=0;t<v.keyMap.length;t++)v.keyMap[t].canBreak&&(v.keyMap[t].open==n.charAt(e)&&a++,v.keyMap[t].close==n.charAt(e)&&a--);var o=0,i=["'",'"'];for(e=0;e<v.keyMap.length;e++)if(v.keyMap[e].canBreak)for(t in i)o+=n.split(i[t]).filter(h.isEven).join("").split(v.keyMap[e].open).length-1;var s=a-o;return 0<=s?s:0},deepExtend:function(e,t){for(var r in t)t[r]&&t[r].constructor&&t[r].constructor===Object?(e[r]=e[r]||{},h.deepExtend(e[r],t[r])):e[r]=t[r];return e},addEvent:function(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent&&e.attachEvent("on"+t,r)},removeEvent:function(e,t,r){e.addEventListener?e.removeEventListener(t,r,!1):e.attachEvent&&e.detachEvent("on"+t,r)},preventDefaultEvent:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}},r=function(e){if(h.fenceRange()){if(9==e.keyCode){h.preventDefaultEvent(e);var t=!0;h._callHook("tab:before");var r=h.cursor.selection(),n=h.cursor.get(),a=h.editor.get();if(r){for(var o=r.start;o--;)if("\n"==a.charAt(o)){r.start=o+1;break}var i,s=a.substring(r.start,r.end),c=s.split("\n");if(e.shiftKey){for(i=0;i<c.length;i++)c[i].substring(0,g.length)==g&&(c[i]=c[i].substring(g.length));s=c.join("\n"),h.editor.set(a.substring(0,r.start)+s+a.substring(r.end)),h.cursor.set(r.start,r.start+s.length)}else{for(i in c)c[i]=g+c[i];s=c.join("\n"),h.editor.set(a.substring(0,r.start)+s+a.substring(r.end)),h.cursor.set(r.start,r.start+s.length)}}else{var l=a.substring(0,n),u=a.substring(n),f=l+g+u;e.shiftKey?a.substring(n-g.length,n)==g&&(f=a.substring(0,n-g.length)+u,h.editor.set(f),h.cursor.set(n-g.length)):(h.editor.set(f),h.cursor.set(n+g.length),t=!1)}h._callHook("tab:after")}return t}},n=function(e){if(h.fenceRange()&&13==e.keyCode){h.preventDefaultEvent(e),h._callHook("enter:before");var t,r,n=h.cursor.get(),a=h.editor.get(),o=a.substring(0,n),i=a.substring(n),s=o.charAt(o.length-1),c=i.charAt(0),l=h.levelsDeep(),u="",f="";if(l){for(;l--;)u+=g;for(t=(u=u).length+1,r=0;r<v.keyMap.length;r++)v.keyMap[r].open==s&&v.keyMap[r].close==c&&(f=p)}else t=1;var d=o+p+u+f+u.substring(0,u.length-g.length)+i;h.editor.set(d),h.cursor.set(n+t),h._callHook("enter:after")}},a=function(e){if(h.fenceRange()&&8==e.keyCode){h.preventDefaultEvent(e),h._callHook("delete:before");var t,r=h.cursor.get(),n=h.editor.get(),a=n.substring(0,r),o=n.substring(r),i=a.charAt(a.length-1),s=o.charAt(0);if(!1===h.cursor.selection()){for(t=0;t<v.keyMap.length;t++)if(v.keyMap[t].open==i&&v.keyMap[t].close==s){var c=n.substring(0,r-1)+n.substring(r+1);return h.editor.set(c),void h.cursor.set(r-1)}c=n.substring(0,r-1)+n.substring(r);h.editor.set(c),h.cursor.set(r-1)}else{var l=h.cursor.selection();c=n.substring(0,l.start)+n.substring(l.end);h.editor.set(c),h.cursor.set(r)}h._callHook("delete:after")}},o=function(e,t){h.preventDefaultEvent(t),h._callHook("openChar:before");var r=h.cursor.get(),n=h.editor.get(),a=n.substring(0,r),o=n.substring(r),i=a+e.open+e.close+o;c.textarea.value=i,h.cursor.set(r+1),h._callHook("openChar:after")},i=function(e,t){var r=h.cursor.get();return h.editor.get().substring(r,r+1)==e.close&&(h.preventDefaultEvent(t),h._callHook("closeChar:before"),h.cursor.set(h.cursor.get()+1),h._callHook("closeChar:after"),!0)},s={filter:function(e){if(h.fenceRange()){var t=e.which||e.keyCode;if(39!=t&&(40!=t||0!==e.which)){var r,n=String.fromCharCode(t);for(r=0;r<v.keyMap.length;r++){if(v.keyMap[r].close==n)!(c.overwrite&&i(v.keyMap[r],e))&&v.keyMap[r].open==n&&c.autoOpen&&o(v.keyMap[r],e);else v.keyMap[r].open==n&&c.autoOpen&&o(v.keyMap[r],e)}}}},listen:function(){c.replaceTab&&h.addEvent(c.textarea,"keydown",r),c.autoIndent&&h.addEvent(c.textarea,"keydown",n),c.autoStrip&&h.addEvent(c.textarea,"keydown",a),h.addEvent(c.textarea,"keypress",s.filter),h.addEvent(c.textarea,"keydown",function(){h._callHook("keydown")}),h.addEvent(c.textarea,"keyup",function(){h._callHook("keyup")})}};this.destroy=function(){h.removeEvent(c.textarea,"keydown",r),h.removeEvent(c.textarea,"keydown",n),h.removeEvent(c.textarea,"keydown",a),h.removeEvent(c.textarea,"keypress",s.filter)},(t=e).textarea&&(h._callHook("init:before",!1),h.deepExtend(c,t),h.defineNewLine(),c.softTabs?g=" ".repeat(c.tabSize):(g="\t",h.defineTabSize(c.tabSize)),s.listen(),h._callHook("init:after",!1))};"undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"==typeof ender&&(this.Behave=e,this.BehaveHooks=u),"function"==typeof define&&define.amd&&define("behave",[],function(){return e})}).call(this),function(r){r(document).on("sowsetupformfield",".siteorigin-widget-field-type-code",function(e){var t=r(this);new Behave({textarea:t.find(".siteorigin-widget-code-input").get(0)})})}(jQuery);
1
+ (function(e){"use strict";var t,r=r||(t={},{add:function(e,r){var n;if("object"==typeof e)for(n=0;n<e.length;n++){var a=e[n];t[a]||(t[a]=[]),t[a].push(r)}else t[e]||(t[e]=[]),t[e].push(r)},get:function(e){if(t[e])return t[e]}}),n=n||function(t){"function"!=typeof String.prototype.repeat&&(String.prototype.repeat=function(e){if(e<1)return"";if(e%2)return this.repeat(e-1)+this;var t=this.repeat(e/2);return t+t}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(e){if(null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=[],a=arguments[1],o=0;o<r;o++)if(o in t){var i=t[o];e.call(a,i,o,t)&&n.push(i)}return n});var n,a,o,i={textarea:null,replaceTab:!0,softTabs:!0,tabSize:4,autoOpen:!0,overwrite:!0,autoStrip:!0,autoIndent:!0,fence:!1},s={keyMap:[{open:'"',close:'"',canBreak:!1},{open:"'",close:"'",canBreak:!1},{open:"(",close:")",canBreak:!1},{open:"[",close:"]",canBreak:!0},{open:"{",close:"}",canBreak:!0}]},c={_callHook:function(t,n){var a=r.get(t);if(n="boolean"!=typeof n||!1!==n,a)if(n){var o,s=i.textarea,l=s.value,u=c.cursor.get();for(o=0;o<a.length;o++)a[o].call(e,{editor:{element:s,text:l,levelsDeep:c.levelsDeep()},caret:{pos:u},lines:{current:c.cursor.getLine(l,u),total:c.editor.getLines(l)}})}else for(o=0;o<a.length;o++)a[o].call(e)},defineNewLine:function(){var e=document.createElement("textarea");e.value="\n",a=2==e.value.length?"\r\n":"\n"},defineTabSize:function(e){void 0===i.textarea.style.OTabSize?void 0===i.textarea.style.MozTabSize?void 0===i.textarea.style.tabSize||(i.textarea.style.tabSize=e):i.textarea.style.MozTabSize=e:i.textarea.style.OTabSize=e},cursor:{getLine:function(e,t){return e.substring(0,t).split("\n").length},get:function(){if("number"==typeof document.createElement("textarea").selectionStart)return i.textarea.selectionStart;if(document.selection){var e=0,t=i.textarea.createTextRange(),r=document.selection.createRange().duplicate().getBookmark();for(t.moveToBookmark(r);0!==t.moveStart("character",-1);)e++;return e}},set:function(e,t){if(t||(t=e),i.textarea.setSelectionRange)i.textarea.focus(),i.textarea.setSelectionRange(e,t);else if(i.textarea.createTextRange){var r=i.textarea.createTextRange();r.collapse(!0),r.moveEnd("character",t),r.moveStart("character",e),r.select()}},selection:function(){var e,t,r,n,o,s=i.textarea,l=0,u=0;return"number"==typeof s.selectionStart&&"number"==typeof s.selectionEnd?(l=s.selectionStart,u=s.selectionEnd):(t=document.selection.createRange())&&t.parentElement()==s&&(n=(e=c.editor.get()).length,(r=s.createTextRange()).moveToBookmark(t.getBookmark()),(o=s.createTextRange()).collapse(!1),r.compareEndPoints("StartToEnd",o)>-1?l=u=n:(l=-r.moveStart("character",-n),l+=e.slice(0,l).split(a).length-1,r.compareEndPoints("EndToEnd",o)>-1?u=n:(u=-r.moveEnd("character",-n),u+=e.slice(0,u).split(a).length-1))),l!=u&&{start:l,end:u}}},editor:{getLines:function(e){return e.split("\n").length},get:function(){return i.textarea.value.replace(/\r/g,"")},set:function(e){i.textarea.value=e}},fenceRange:function(){if("string"==typeof i.fence){for(var e=c.editor.get(),t=c.cursor.get(),r=0,n=e.indexOf(i.fence),a=0;n>=0&&(a++,!(t<n+r));)r+=n+i.fence.length,n=(e=e.substring(n+i.fence.length)).indexOf(i.fence);return r<t&&n+r>t&&a%2==0}return!0},isEven:function(e,t){return t%2},levelsDeep:function(){var e,t,r=c.cursor.get(),n=c.editor.get().substring(0,r),a=0;for(e=0;e<n.length;e++)for(t=0;t<s.keyMap.length;t++)s.keyMap[t].canBreak&&(s.keyMap[t].open==n.charAt(e)&&a++,s.keyMap[t].close==n.charAt(e)&&a--);var o=0,i=["'",'"'];for(e=0;e<s.keyMap.length;e++)if(s.keyMap[e].canBreak)for(t in i)o+=n.split(i[t]).filter(c.isEven).join("").split(s.keyMap[e].open).length-1;var l=a-o;return l>=0?l:0},deepExtend:function(e,t){for(var r in t)t[r]&&t[r].constructor&&t[r].constructor===Object?(e[r]=e[r]||{},c.deepExtend(e[r],t[r])):e[r]=t[r];return e},addEvent:function(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent&&e.attachEvent("on"+t,r)},removeEvent:function(e,t,r){e.addEventListener?e.removeEventListener(t,r,!1):e.attachEvent&&e.detachEvent("on"+t,r)},preventDefaultEvent:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}},l=function(e){if(c.fenceRange()){if(9==e.keyCode){c.preventDefaultEvent(e);var t=!0;c._callHook("tab:before");var r=c.cursor.selection(),a=c.cursor.get(),o=c.editor.get();if(r){for(var i=r.start;i--;)if("\n"==o.charAt(i)){r.start=i+1;break}var s,l=o.substring(r.start,r.end),u=l.split("\n");if(e.shiftKey){for(s=0;s<u.length;s++)u[s].substring(0,n.length)==n&&(u[s]=u[s].substring(n.length));l=u.join("\n"),c.editor.set(o.substring(0,r.start)+l+o.substring(r.end)),c.cursor.set(r.start,r.start+l.length)}else{for(s in u)u[s]=n+u[s];l=u.join("\n"),c.editor.set(o.substring(0,r.start)+l+o.substring(r.end)),c.cursor.set(r.start,r.start+l.length)}}else{var f=o.substring(0,a),d=o.substring(a),g=f+n+d;e.shiftKey?o.substring(a-n.length,a)==n&&(g=o.substring(0,a-n.length)+d,c.editor.set(g),c.cursor.set(a-n.length)):(c.editor.set(g),c.cursor.set(a+n.length),t=!1)}c._callHook("tab:after")}return t}},u=function(e){if(c.fenceRange()&&13==e.keyCode){c.preventDefaultEvent(e),c._callHook("enter:before");var t,r,o=c.cursor.get(),i=c.editor.get(),l=i.substring(0,o),u=i.substring(o),f=l.charAt(l.length-1),d=u.charAt(0),g=c.levelsDeep(),p="",v="";if(g){for(;g--;)p+=n;for(t=(p=p).length+1,r=0;r<s.keyMap.length;r++)s.keyMap[r].open==f&&s.keyMap[r].close==d&&(v=a)}else t=1;var h=l+a+p+v+p.substring(0,p.length-n.length)+u;c.editor.set(h),c.cursor.set(o+t),c._callHook("enter:after")}},f=function(e){if(c.fenceRange()&&8==e.keyCode){c.preventDefaultEvent(e),c._callHook("delete:before");var t,r=c.cursor.get(),n=c.editor.get(),a=n.substring(0,r),o=n.substring(r),i=a.charAt(a.length-1),l=o.charAt(0);if(!1===c.cursor.selection()){for(t=0;t<s.keyMap.length;t++)if(s.keyMap[t].open==i&&s.keyMap[t].close==l){var u=n.substring(0,r-1)+n.substring(r+1);return c.editor.set(u),void c.cursor.set(r-1)}u=n.substring(0,r-1)+n.substring(r);c.editor.set(u),c.cursor.set(r-1)}else{var f=c.cursor.selection();u=n.substring(0,f.start)+n.substring(f.end);c.editor.set(u),c.cursor.set(r)}c._callHook("delete:after")}},d=function(e,t){c.preventDefaultEvent(t),c._callHook("openChar:before");var r=c.cursor.get(),n=c.editor.get(),a=n.substring(0,r),o=n.substring(r),s=a+e.open+e.close+o;i.textarea.value=s,c.cursor.set(r+1),c._callHook("openChar:after")},g=function(e,t){var r=c.cursor.get();return c.editor.get().substring(r,r+1)==e.close&&(c.preventDefaultEvent(t),c._callHook("closeChar:before"),c.cursor.set(c.cursor.get()+1),c._callHook("closeChar:after"),!0)},p={filter:function(e){if(c.fenceRange()){var t=e.which||e.keyCode;if(39!=t&&(40!=t||0!==e.which)){var r,n=String.fromCharCode(t);for(r=0;r<s.keyMap.length;r++){if(s.keyMap[r].close==n)!(i.overwrite&&g(s.keyMap[r],e))&&s.keyMap[r].open==n&&i.autoOpen&&d(s.keyMap[r],e);else s.keyMap[r].open==n&&i.autoOpen&&d(s.keyMap[r],e)}}}},listen:function(){i.replaceTab&&c.addEvent(i.textarea,"keydown",l),i.autoIndent&&c.addEvent(i.textarea,"keydown",u),i.autoStrip&&c.addEvent(i.textarea,"keydown",f),c.addEvent(i.textarea,"keypress",p.filter),c.addEvent(i.textarea,"keydown",(function(){c._callHook("keydown")})),c.addEvent(i.textarea,"keyup",(function(){c._callHook("keyup")}))}};this.destroy=function(){c.removeEvent(i.textarea,"keydown",l),c.removeEvent(i.textarea,"keydown",u),c.removeEvent(i.textarea,"keydown",f),c.removeEvent(i.textarea,"keypress",p.filter)},(o=t).textarea&&(c._callHook("init:before",!1),c.deepExtend(i,o),c.defineNewLine(),i.softTabs?n=" ".repeat(i.tabSize):(n="\t",c.defineTabSize(i.tabSize)),p.listen(),c._callHook("init:after",!1))};"undefined"!=typeof module&&module.exports&&(module.exports=n),"undefined"==typeof ender&&(this.Behave=n,this.BehaveHooks=r),"function"==typeof define&&define.amd&&define("behave",[],(function(){return n}))}).call(this),function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-code",(function(t){var r=e(this);new Behave({textarea:r.find(".siteorigin-widget-code-input").get(0)})}))}(jQuery);
base/inc/fields/js/date-range-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(r){r(document).on("sowsetupformfield",".siteorigin-widget-field-type-date-range",function(e){var s=r(this),f=s.find('input[type="hidden"][class="siteorigin-widget-input"]');if(!s.data("initialized")){if(0<s.find('[class*="sowb-specific-date"]').length){var t=function(i,e){function a(e,t){if(isNaN(e.valueOf()))return"";var i=e.getDate();i=i<10?"0"+i.toString():i.toString();var a=e.getMonth()+1;return a=a<10?"0"+a.toString():a.toString(),e.getFullYear()+"-"+a+"-"+i}function n(e,t){var i=e.split("-"),a=parseInt(i[2]),n=parseInt(i[1])-1,r=parseInt(i[0]);return new Date(r,n,a)}function r(e){var t=""===f.val()?{}:JSON.parse(f.val());t[i]=a(e),l.val(t[i]),f.val(JSON.stringify(t)),f.trigger("change",{silent:!0})}var l=s.find("."+i+"-picker"),t=new Pikaday({field:l[0],blurFieldOnSelect:!1,toString:a,parse:n,onSelect:r});return l.change(function(e){var t=n(l.val());return r(t),e.preventDefault(),!1}),e&&l.val(e),t}.bind(this),i=""===f.val()?{after:"",before:""}:JSON.parse(f.val()),a=t("after",i.after),n=t("before",i.before);f.change(function(e,t){if(!t||!t.silent){var i=""===f.val()?{after:"",before:""}:JSON.parse(f.val());a.setDate(i.after),n.setDate(i.before)}})}else 0<s.find(".sowb-relative-date").length&&s.find(".sowb-relative-date").each(function(){var a=r(this).data("name");r(this).change(function(){var e=""===f.val()?{}:JSON.parse(f.val());e.hasOwnProperty(a)||(e[a]={}),e[a].value=r(this).find("> input").val(),e[a].unit=r(this).find("> select").val(),f.val(JSON.stringify(e)),f.trigger("change",{silent:!0})}.bind(this)),f.change(function(e,t){if(!t||!t.silent){var i=""===f.val()?{from:{},to:{}}:JSON.parse(f.val());i.hasOwnProperty(a)&&(r(this).find("> input").val(i[a].value),r(this).find("> select").val(i[a].unit))}}.bind(this))});s.data("initialized",!0)}})}(jQuery);
1
+ !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-date-range",(function(t){var i=e(this),a=i.find('input[type="hidden"][class="siteorigin-widget-input"]');if(!i.data("initialized")){if(i.find('[class*="sowb-specific-date"]').length>0){var n=function(e,t){var n=i.find("."+e+"-picker"),r=function(e,t){if(!isNaN(e.valueOf())){var i=e.getDate();i=i<10?"0"+i.toString():i.toString();var a=e.getMonth()+1;return a=a<10?"0"+a.toString():a.toString(),e.getFullYear()+"-"+a+"-"+i}return""},l=function(e,t){var i=e.split("-"),a=parseInt(i[2]),n=parseInt(i[1])-1,r=parseInt(i[0]);return new Date(r,n,a)},s=function(t){var i=""===a.val()?{}:JSON.parse(a.val());i[e]=r(t),n.val(i[e]),a.val(JSON.stringify(i)),a.trigger("change",{silent:!0})},f=new Pikaday({field:n[0],blurFieldOnSelect:!1,toString:r,parse:l,onSelect:s});return n.change((function(e){var t=l(n.val());return s(t),e.preventDefault(),!1})),t&&n.val(t),f}.bind(this),r=""===a.val()?{after:"",before:""}:JSON.parse(a.val()),l=n("after",r.after),s=n("before",r.before);a.change((function(e,t){if(!t||!t.silent){var i=""===a.val()?{after:"",before:""}:JSON.parse(a.val());l.setDate(i.after),s.setDate(i.before)}}))}else i.find(".sowb-relative-date").length>0&&i.find(".sowb-relative-date").each((function(){var t=e(this).data("name");e(this).change(function(){var i=""===a.val()?{}:JSON.parse(a.val());i.hasOwnProperty(t)||(i[t]={}),i[t].value=e(this).find("> input").val(),i[t].unit=e(this).find("> select").val(),a.val(JSON.stringify(i)),a.trigger("change",{silent:!0})}.bind(this)),a.change(function(i,n){if(!n||!n.silent){var r=""===a.val()?{from:{},to:{}}:JSON.parse(a.val());r.hasOwnProperty(t)&&(e(this).find("> input").val(r[t].value),e(this).find("> select").val(r[t].unit))}}.bind(this))}));i.data("initialized",!0)}}))}(jQuery);
base/inc/fields/js/icon-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(h){var u={};h(document).on("sowsetupformfield",".siteorigin-widget-field-type-icon",function(i){var e=h(this),g=e.find(".siteorigin-widget-icon-selector"),f=g.find(".siteorigin-widget-icon-icon"),v=e.find(".siteorigin-widget-icon-selector-current"),w=e.find(".so-icon-remove"),n=e.find(".siteorigin-widget-icon-search");if(!e.data("initialized")){v.click(function(){g.slideToggle(),n.val(""),y()}),w.click(function(i){i.preventDefault(),e.find(".siteorigin-widget-active").click()});var y=function(){var t=n.val().toLowerCase();""===t?g.find(".siteorigin-widget-icon-icons-icon").show():g.find(".siteorigin-widget-icon-icons-icon").each(function(){var i=h(this),e=i.attr("data-value");-1===(e=e.replace(/-/," ")).indexOf(t)?i.hide():i.show()})};n.keyup(y).change(y);function t(e){var t=g.find("select.siteorigin-widget-icon-family").val(),i=g.find("select.siteorigin-widget-icon-family option:selected").data("icons");if(null!==i&&(u[t]=i),void 0!==t&&""!==t)if(void 0===u[t]){var n=g.find(".siteorigin-widget-icon-icons");n.addClass("loading"),h.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:g.find("select.siteorigin-widget-icon-family").val()},function(i){u[t]=i,function(i){var e=g.find("select.siteorigin-widget-icon-family"),t=e.val();if(void 0!==u[t]){var n=g.find(".siteorigin-widget-icon-family-styles");if(!i){n.off("change",d),n.remove();var s=u[t];if(s.hasOwnProperty("styles")&&s.styles){var o="";for(var a in s.styles)o+='<option value="'+a+'">'+s.styles[a]+"</option>";o&&(n=h('<select class="siteorigin-widget-icon-family-styles"></select>').append(o),e.after(n))}}n.on("change",d)}}(e),n.removeClass("loading"),d()})}else d()}var d=function(){var i=g.find("select.siteorigin-widget-icon-family").val(),e=g.find(".siteorigin-widget-icon-icons");if(void 0!==u[i]){e.empty();var t,n=u[i],s=n.icons;for(var o in n.hasOwnProperty("styles")&&n.styles&&(t=g.find(".siteorigin-widget-icon-family-styles").val()),0===h("#siteorigin-widget-font-"+i).length&&h("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+i).attr("href",u[i].style_uri).appendTo("head"),s){var a=s[o],d=a.hasOwnProperty("unicode")?a.unicode:a;if(!a.hasOwnProperty("styles")||-1!==a.styles.indexOf(t)){var c="sow-icon-"+i+(t?" "+t:""),r=i+(t?"-"+t:"")+"-"+o,l=h('<div data-sow-icon="'+d+'"/>').attr("data-value",r).addClass(c).addClass("siteorigin-widget-icon-icons-icon").click(function(){var i=h(this);i.hasClass("siteorigin-widget-active")?(i.removeClass("siteorigin-widget-active"),f.val(""),v.find("span").hide(),w.hide()):(e.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),i.addClass("siteorigin-widget-active"),f.val(i.data("value")),v.find("span").show().attr("data-sow-icon",i.attr("data-sow-icon")).attr("class","").addClass(c),w.show()),f.trigger("change",{isRendering:!0}),g.slideUp()});e.append(l),f.val()===r&&(v.find("span").show().attr("data-sow-icon",l.attr("data-sow-icon")).attr("class","").addClass(c),l.addClass("siteorigin-widget-active"))}}e.prepend(e.find(".siteorigin-widget-active")),y()}};t(!0),g.find("select.siteorigin-widget-icon-family").change(function(){g.find(".siteorigin-widget-icon-icons").empty(),t()}),f.change(function(i,e){e&&e.isRendering||d()}),e.data("initialized",!0)}})}(jQuery);
1
+ !function(i){var e={};i(document).on("sowsetupformfield",".siteorigin-widget-field-type-icon",(function(t){var n=i(this),s=n.find(".siteorigin-widget-icon-selector"),o=s.find(".siteorigin-widget-icon-icon"),a=n.find(".siteorigin-widget-icon-selector-current"),d=n.find(".so-icon-remove"),c=n.find(".siteorigin-widget-icon-search");if(!n.data("initialized")){a.click((function(){s.slideToggle(),c.val(""),r()})),d.click((function(i){i.preventDefault(),n.find(".siteorigin-widget-active").click()}));var r=function(){var e=c.val().toLowerCase();""===e?s.find(".siteorigin-widget-icon-icons-icon").show():s.find(".siteorigin-widget-icon-icons-icon").each((function(){var t=i(this),n=t.attr("data-value");-1===(n=n.replace(/-/," ")).indexOf(e)?t.hide():t.show()}))};c.keyup(r).change(r);var l=function(){var t=s.find("select.siteorigin-widget-icon-family").val(),n=s.find(".siteorigin-widget-icon-icons");if(void 0!==e[t]){n.empty();var c,l=e[t],g=l.icons;for(var f in l.hasOwnProperty("styles")&&l.styles&&(c=s.find(".siteorigin-widget-icon-family-styles").val()),0===i("#siteorigin-widget-font-"+t).length&&i("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+t).attr("href",e[t].style_uri).appendTo("head"),g){var v=g[f],w=v.hasOwnProperty("unicode")?v.unicode:v;if(!v.hasOwnProperty("styles")||-1!==v.styles.indexOf(c)){var y="sow-icon-"+t+(c?" "+c:""),h=t+(c?"-"+c:"")+"-"+f,u=i('<div data-sow-icon="'+w+'"/>').attr("data-value",h).addClass(y).addClass("siteorigin-widget-icon-icons-icon").click((function(){var e=i(this);e.hasClass("siteorigin-widget-active")?(e.removeClass("siteorigin-widget-active"),o.val(""),a.find("span").hide(),d.hide()):(n.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),e.addClass("siteorigin-widget-active"),o.val(e.data("value")),a.find("span").show().attr("data-sow-icon",e.attr("data-sow-icon")).attr("class","").addClass(y),d.show()),o.trigger("change",{isRendering:!0}),s.slideUp()}));n.append(u),o.val()===h&&(a.find("span").show().attr("data-sow-icon",u.attr("data-sow-icon")).attr("class","").addClass(y),u.addClass("siteorigin-widget-active"))}}n.prepend(n.find(".siteorigin-widget-active")),r()}},g=function(t){var n=s.find("select.siteorigin-widget-icon-family").val(),o=s.find("select.siteorigin-widget-icon-family option:selected").data("icons");if(null!==o&&(e[n]=o),void 0!==n&&""!==n)if(void 0===e[n]){var a=s.find(".siteorigin-widget-icon-icons");a.addClass("loading"),i.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:s.find("select.siteorigin-widget-icon-family").val()},(function(o){e[n]=o,function(t){var n=s.find("select.siteorigin-widget-icon-family"),o=n.val();if(void 0!==e[o]){var a=s.find(".siteorigin-widget-icon-family-styles");if(!t){a.off("change",l),a.remove();var d=e[o];if(d.hasOwnProperty("styles")&&d.styles){var c="";for(var r in d.styles)c+='<option value="'+r+'">'+d.styles[r]+"</option>";c&&(a=i('<select class="siteorigin-widget-icon-family-styles"></select>').append(c),n.after(a))}}a.on("change",l)}}(t),a.removeClass("loading"),l()}))}else l()};g(!0),s.find("select.siteorigin-widget-icon-family").change((function(){s.find(".siteorigin-widget-icon-icons").empty(),g()})),o.change((function(i,e){e&&e.isRendering||l()})),n.data("initialized",!0)}}))}(jQuery);
base/inc/fields/js/image-radio-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){t(document).on("sowsetupform",function(e){t(e.target).find(".siteorigin-widget-field-type-image-radio").each(function(){var e=t(this);e.find('input[type="radio"]:checked').parent().addClass("so-selected"),e.find('input[type="radio"]').on("change",function(){e.find('input[type="radio"]').parent().removeClass("so-selected"),e.find('input[type="radio"]:checked').parent().addClass("so-selected")})})})}(jQuery);
1
+ !function(e){e(document).on("sowsetupform",(function(t){e(t.target).find(".siteorigin-widget-field-type-image-radio").each((function(){var t=e(this);t.find('input[type="radio"]:checked').parent().addClass("so-selected"),t.find('input[type="radio"]').on("change",(function(){t.find('input[type="radio"]').parent().removeClass("so-selected"),t.find('input[type="radio"]:checked').parent().addClass("so-selected")}))}))}))}(jQuery);
base/inc/fields/js/media-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(f){f(document).on("sowsetupformfield",".siteorigin-widget-field-type-media",function(e){var n=f(this),t=n.find("> .media-field-wrapper"),r=n.find(".siteorigin-widget-input").not(".media-fallback-external");if(!t.data("initialized")){var u;t.find(".media-upload-button").click(function(e){if(e.preventDefault(),void 0!==wp.media){var t=f(this),i=f(this).data("frame");if(i)return i.open(),!1;i=wp.media({title:t.data("choose"),library:{type:t.data("library").split(",").map(function(e){return e.trim()})},button:{text:t.data("update"),close:!1}}),t.data("frame",i),i.on("select",function(){var e=i.state().get("selection").first().attributes;n.find(".current .title").html(e.title),r.val(e.id),r.trigger("change",{silent:!0});var t=n.find(".current .thumbnail");void 0!==e.sizes?void 0!==e.sizes.thumbnail?t.attr("src",e.sizes.thumbnail.url).fadeIn():t.attr("src",e.sizes.full.url).fadeIn():t.attr("src",e.icon).fadeIn(),n.find(".media-remove-button").removeClass("remove-hide"),i.close()}),i.open()}}),t.find(".current").mouseenter(function(){var e=f(this).find(".title");""!==e.html()&&e.fadeIn("fast")}).mouseleave(function(){f(this).find(".title").clearQueue().fadeOut("fast")}),n.find("a.media-remove-button").click(function(e){e.preventDefault(),n.find(".current .title").html(""),r.val(""),r.trigger("change",{silent:!0}),n.find(".current .thumbnail").fadeOut("fast"),f(this).addClass("remove-hide")});function a(){if(u){var e=u.find(".so-widgets-image-results");if(0!==e.length){var t=e.width(),i=Math.floor(t/276),s=(t-276*i)/i+260;e.find(".so-widgets-result-image").css({width:s,height:s/1.4})}}}f(window).resize(a);t.find(".find-image-button").click(function(e){e.preventDefault(),function(){if(!u){(u=f(f("#so-widgets-bundle-tpl-image-search-dialog").html().trim()).appendTo("body")).find(".close").click(function(){u.hide()});function i(t,i){u.find(".so-widgets-results-loading").fadeIn("fast"),u.find(".so-widgets-results-loading strong").html(u.find(".so-widgets-results-loading strong").data("loading")),u.find(".so-widgets-results-more").hide(),f.get(ajaxurl,{action:"so_widgets_image_search",q:t,page:i,_sononce:u.find('input[name="_sononce"]').val()},function(e){e.error?alert(e.message):(s.removeClass("so-loading"),f.each(e.items,function(e,t){var i=f(f("#so-widgets-bundle-tpl-image-search-result").html().trim()).appendTo(s).addClass("source-"+t.source).find(".so-widgets-result-image");i.css("background-image","url("+t.thumbnail+")"),i.data("thumbnail",t.thumbnail),i.data("preview",t.preview),t.url&&i.attr({href:t.url,target:"_blank"}),t.full_url&&(i.data({full_url:t.full_url,import_signature:t.import_signature}),i.attr("href",t.full_url)),"shutterstock"===t.source&&i.append(f("#so-widgets-bundle-tpl-image-search-result-sponsored").html())}),1===i&&(u.find("#so-widgets-image-search-suggestions ul").empty(),f.each(e.keywords,function(e,t){u.find("#so-widgets-image-search-suggestions").show(),u.find("#so-widgets-image-search-suggestions ul").append(f("<li></li>").append(f('<a href="#"></a>').html(t).data("keyword",t)))})),u.find(".so-widgets-results-loading").fadeOut("fast"),a(),u.find(".so-widgets-results-more").show().find("button").data({query:t,page:i+1}))})}var e,s=u.find(".so-widgets-image-results");u.find("#so-widgets-image-search-form").submit(function(e){e.preventDefault();var t=u.find(".so-widgets-search-input").val();s.empty(),""!==t&&i(t,1)}),u.on("click",".so-keywords-list a",function(e){e.preventDefault();var t=f(this).blur();u.find(".so-widgets-search-input").val(t.data("keyword")),u.find("#so-widgets-image-search-form").submit()}),u.find(".so-widgets-results-more button").click(function(){var e=f(this);i(e.data("query"),e.data("page"))}),u.on("click",".so-widgets-result-image",function(e){var t=f(this);if(t.data("full_url")&&(e.preventDefault(),confirm(u.data("confirm-import")))){u.addClass("so-widgets-importing");var i=f("#post_ID").val();null===i&&(i=""),f.get(ajaxurl,{action:"so_widgets_image_import",full_url:t.data("full_url"),import_signature:t.data("import_signature"),post_id:i,_sononce:u.find('input[name="_sononce"]').val()},function(e){u.find("#so-widgets-image-search-frame").removeClass("so-widgets-importing"),!1===e.error?(u.hide(),u.find(".so-widgets-results-loading").hide(),r.val(e.attachment_id).trigger("change",{silent:!0}),n.find(".current .thumbnail").attr("src",e.thumb).fadeIn(),n.find(".media-remove-button").removeClass("remove-hide")):(alert(e.message),u.find(".so-widgets-results-loading").hide())}),u.find(".so-widgets-results-loading").fadeIn("fast"),u.find(".so-widgets-results-loading strong").html(u.find(".so-widgets-results-loading strong").data("importing")),u.find(".so-widgets-results-more").hide(),u.find("#so-widgets-image-search-frame").addClass("so-widgets-importing")}});var o,d,l=u.find(".so-widgets-preview-window");u.on("mouseenter",".so-widgets-result-image",function(){var s=f(this),a=s.data("preview");clearTimeout(e),e=setTimeout(function(){var e=1,t=1;a[1]>.33*f(window).outerWidth()&&(e=.33*f(window).outerWidth()/a[1]),a[2]>.5*f(window).outerHeight()&&(t=.5*f(window).outerHeight()/a[2]);var i=Math.min(e,t);1<i&&(i=1),l.show().find(".so-widgets-preview-window-inside").css({"background-image":"url("+s.data("thumbnail")+")",width:a[1]*i,height:a[2]*i}).append(f("<img />").attr("src",a[0])),u.trigger("mousemove")},1e3)}).on("mouseleave",".so-widgets-result-image",function(){l.hide().find("img").remove(),clearTimeout(e)}),u.on("mousemove",function(e){if(e.clientX&&(o=e.clientX),e.clientY&&(d=e.clientY),l.is(":visible")){var t=l.outerHeight(),i=l.outerWidth(),s=f(window).outerHeight(),a=f(window).outerWidth(),n=d-t/2;n=Math.max(n,10),n=Math.min(n,s-10-t);var r=o<a/2?o+15:o-15-i;l.css({top:n,left:r})}})}u.show(),u.find(".so-widgets-search-input").focus()}()}),r.change(function(e,t){if(!t||!t.silent){var i=r.val();if(i){var s=n.find(".current .thumbnail"),a=wp.media.attachment(i);a.fetch().done(function(){if(a.has("sizes")){var e=a.get("sizes");void 0!==e.thumbnail?s.attr("src",e.thumbnail.url).fadeIn():s.attr("src",e.full.url).fadeIn()}else s.attr("src",a.get("icon")).fadeIn();n.find(".media-remove-button").removeClass("remove-hide")})}else n.find("a.media-remove-button").click()}}),t.data("initialized",!0)}})}(jQuery);
1
+ !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-media",(function(t){var i=e(this),a=i.find("> .media-field-wrapper"),s=i.find(".siteorigin-widget-input").not(".media-fallback-external");if(!a.data("initialized")){var n;a.find(".media-upload-button").click((function(t){if(t.preventDefault(),void 0!==wp.media){var a=e(this),n=e(this).data("frame");if(n)return n.open(),!1;n=wp.media({title:a.data("choose"),library:{type:a.data("library").split(",").map((function(e){return e.trim()}))},button:{text:a.data("update"),close:!1}}),a.data("frame",n),n.on("select",(function(){var e=n.state().get("selection").first().attributes;i.find(".current .title").html(e.title),s.val(e.id),s.trigger("change",{silent:!0});var t=i.find(".current .thumbnail");void 0!==e.sizes?void 0!==e.sizes.thumbnail?t.attr("src",e.sizes.thumbnail.url).fadeIn():t.attr("src",e.sizes.full.url).fadeIn():t.attr("src",e.icon).fadeIn(),i.find(".media-remove-button").removeClass("remove-hide"),n.close()})),n.open()}})),a.find(".current").mouseenter((function(){var t=e(this).find(".title");""!==t.html()&&t.fadeIn("fast")})).mouseleave((function(){e(this).find(".title").clearQueue().fadeOut("fast")})),i.find("a.media-remove-button").click((function(t){t.preventDefault(),i.find(".current .title").html(""),s.val(""),s.trigger("change",{silent:!0}),i.find(".current .thumbnail").fadeOut("fast"),e(this).addClass("remove-hide")}));var r=function(){if(n){var e=n.find(".so-widgets-image-results");if(0!==e.length){var t=e.width(),i=Math.floor(t/276),a=(t-276*i)/i+260;e.find(".so-widgets-result-image").css({width:a,height:a/1.4})}}};e(window).resize(r);a.find(".find-image-button").click((function(t){t.preventDefault(),function(){if(!n){(n=e(e("#so-widgets-bundle-tpl-image-search-dialog").html().trim()).appendTo("body")).find(".close").click((function(){n.hide()}));var t,a=n.find(".so-widgets-image-results"),o=function(t,i){n.find(".so-widgets-results-loading").fadeIn("fast"),n.find(".so-widgets-results-loading strong").html(n.find(".so-widgets-results-loading strong").data("loading")),n.find(".so-widgets-results-more").hide(),e.get(ajaxurl,{action:"so_widgets_image_search",q:t,page:i,_sononce:n.find('input[name="_sononce"]').val()},(function(s){s.error?alert(s.message):(a.removeClass("so-loading"),e.each(s.items,(function(t,i){var s=e(e("#so-widgets-bundle-tpl-image-search-result").html().trim()).appendTo(a).addClass("source-"+i.source).find(".so-widgets-result-image");s.css("background-image","url("+i.thumbnail+")"),s.data("thumbnail",i.thumbnail),s.data("preview",i.preview),i.url&&s.attr({href:i.url,target:"_blank"}),i.full_url&&(s.data({full_url:i.full_url,import_signature:i.import_signature}),s.attr("href",i.full_url)),"shutterstock"===i.source&&s.append(e("#so-widgets-bundle-tpl-image-search-result-sponsored").html())})),1===i&&(n.find("#so-widgets-image-search-suggestions ul").empty(),e.each(s.keywords,(function(t,i){n.find("#so-widgets-image-search-suggestions").show(),n.find("#so-widgets-image-search-suggestions ul").append(e("<li></li>").append(e('<a href="#"></a>').html(i).data("keyword",i)))}))),n.find(".so-widgets-results-loading").fadeOut("fast"),r(),n.find(".so-widgets-results-more").show().find("button").data({query:t,page:i+1}))}))};n.find("#so-widgets-image-search-form").submit((function(e){e.preventDefault();var t=n.find(".so-widgets-search-input").val();a.empty(),""!==t&&o(t,1)})),n.on("click",".so-keywords-list a",(function(t){t.preventDefault();var i=e(this).blur();n.find(".so-widgets-search-input").val(i.data("keyword")),n.find("#so-widgets-image-search-form").submit()})),n.find(".so-widgets-results-more button").click((function(){var t=e(this);o(t.data("query"),t.data("page"))})),n.on("click",".so-widgets-result-image",(function(t){var a=e(this);if(a.data("full_url")&&(t.preventDefault(),confirm(n.data("confirm-import")))){n.addClass("so-widgets-importing");var r=e("#post_ID").val();null===r&&(r=""),e.get(ajaxurl,{action:"so_widgets_image_import",full_url:a.data("full_url"),import_signature:a.data("import_signature"),post_id:r,_sononce:n.find('input[name="_sononce"]').val()},(function(e){n.find("#so-widgets-image-search-frame").removeClass("so-widgets-importing"),!1===e.error?(n.hide(),n.find(".so-widgets-results-loading").hide(),s.val(e.attachment_id).trigger("change",{silent:!0}),i.find(".current .thumbnail").attr("src",e.thumb).fadeIn(),i.find(".media-remove-button").removeClass("remove-hide")):(alert(e.message),n.find(".so-widgets-results-loading").hide())})),n.find(".so-widgets-results-loading").fadeIn("fast"),n.find(".so-widgets-results-loading strong").html(n.find(".so-widgets-results-loading strong").data("importing")),n.find(".so-widgets-results-more").hide(),n.find("#so-widgets-image-search-frame").addClass("so-widgets-importing")}}));var d,l,u=n.find(".so-widgets-preview-window");n.on("mouseenter",".so-widgets-result-image",(function(){var i=e(this),a=i.data("preview");clearTimeout(t),t=setTimeout((function(){var t=1,s=1;a[1]>.33*e(window).outerWidth()&&(t=.33*e(window).outerWidth()/a[1]),a[2]>.5*e(window).outerHeight()&&(s=.5*e(window).outerHeight()/a[2]);var r=Math.min(t,s);r>1&&(r=1),u.show().find(".so-widgets-preview-window-inside").css({"background-image":"url("+i.data("thumbnail")+")",width:a[1]*r,height:a[2]*r}).append(e("<img />").attr("src",a[0])),n.trigger("mousemove")}),1e3)})).on("mouseleave",".so-widgets-result-image",(function(){u.hide().find("img").remove(),clearTimeout(t)})),n.on("mousemove",(function(t){if(t.clientX&&(d=t.clientX),t.clientY&&(l=t.clientY),u.is(":visible")){var i=u.outerHeight(),a=u.outerWidth(),s=e(window).outerHeight(),n=e(window).outerWidth(),r=l-i/2;r=Math.max(r,10),r=Math.min(r,s-10-i);var o=d<n/2?d+15:d-15-a;u.css({top:r,left:o})}}))}n.show(),n.find(".so-widgets-search-input").focus()}()})),s.change((function(e,t){if(!t||!t.silent){var a=s.val();if(a){var n=i.find(".current .thumbnail"),r=wp.media.attachment(a);r.fetch().done((function(){if(r.has("sizes")){var e=r.get("sizes");void 0!==e.thumbnail?n.attr("src",e.thumbnail.url).fadeIn():n.attr("src",e.full.url).fadeIn()}else n.attr("src",r.get("icon")).fadeIn();i.find(".media-remove-button").removeClass("remove-hide")}))}else i.find("a.media-remove-button").click()}})),a.data("initialized",!0)}}))}(jQuery);
base/inc/fields/js/multi-measurement-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(r){r(document).on("sowsetupformfield",".siteorigin-widget-field-type-multi-measurement",function(t){function l(t){var i=""===n.val()?[]:n.val().split(a),e=t.find("+ .sow-multi-measurement-select-unit");i[s.index(t)]=t.val()+(""===t.val()?"":e.val()),n.val(i.join(a))}var n=r(this).find('input[type="hidden"][class="siteorigin-widget-input"]'),a=n.data("separator"),i=n.data("autofill"),u=""===n.val()?[]:n.val().split(a),s=r(this).find(".sow-multi-measurement-input"),e=r(this).find(".sow-multi-measurement-input-container");s.each(function(t,i){if(u.length>t){var e=u[t].match(/(\d+\.?\d*)([a-z%]+)*/);if(e&&e.length){var n=e[1],a=e[2];r(i).val(n),r(i).find("+ .sow-multi-measurement-select-unit").val(a)}}else l(r(i))}),e.change(function(t){var e=r(t.currentTarget).find("> .sow-multi-measurement-input"),n=i;i&&s.each(function(t,i){r(i).attr("id")!==e.eq(0).attr("id")&&(n=n&&!r(i).val())}),n?s.each(function(t,i){r(i).val(e.val()),l(r(i))}):l(e)})})}(jQuery);
1
+ !function(t){t(document).on("sowsetupformfield",".siteorigin-widget-field-type-multi-measurement",(function(i){var e=t(this).find('input[type="hidden"][class="siteorigin-widget-input"]'),n=e.data("separator"),a=e.data("autofill"),l=""===e.val()?[]:e.val().split(n),u=t(this).find(".sow-multi-measurement-input"),s=t(this).find(".sow-multi-measurement-input-container"),r=function(t){var i=""===e.val()?[]:e.val().split(n),a=t.find("+ .sow-multi-measurement-select-unit");i[u.index(t)]=t.val()+(""===t.val()?"":a.val()),e.val(i.join(n))};u.each((function(i,e){if(l.length>i){var n=l[i].match(/(\d+\.?\d*)([a-z%]+)*/);if(n&&n.length){var a=n[1],u=n[2];t(e).val(a),t(e).find("+ .sow-multi-measurement-select-unit").val(u)}}else r(t(e))})),s.change((function(i){var e=t(i.currentTarget).find("> .sow-multi-measurement-input"),n=a;a&&u.each((function(i,a){t(a).attr("id")!==e.eq(0).attr("id")&&(n=n&&!t(a).val())})),n?u.each((function(i,n){t(n).val(e.val()),r(t(n))})):r(e)}))}))}(jQuery);
base/inc/fields/js/order-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){t(document).on("sowsetupform",function(i){t(i.target).find(".siteorigin-widget-field-type-order").each(function(){var o=t(this),d=o.find(".siteorigin-widget-input"),g=o.find(".siteorigin-widget-order-items");g.sortable({stop:function(){var i=t(this).sortable("toArray",{attribute:"data-value"});d.val(i.join(",")),d.trigger("change",{silent:!0})}}),o.change(function(i,t){if(!t||!t.silent){var e=""===d.val()?[]:d.val().split(",");if(e.length)for(var n=0;n<e.length;n++){var r=e[n],a=o.find(".siteorigin-widget-order-item[data-value="+r+"]");g.append(a)}}})})})}(jQuery);
1
+ !function(i){i(document).on("sowsetupform",(function(t){i(t.target).find(".siteorigin-widget-field-type-order").each((function(){var t=i(this),e=t.find(".siteorigin-widget-input"),n=t.find(".siteorigin-widget-order-items");n.sortable({stop:function(){var t=i(this).sortable("toArray",{attribute:"data-value"});e.val(t.join(",")),e.trigger("change",{silent:!0})}}),t.change((function(i,r){if(!r||!r.silent){var a=""===e.val()?[]:e.val().split(",");if(a.length)for(var o=0;o<a.length;o++){var d=a[o],g=t.find(".siteorigin-widget-order-item[data-value="+d+"]");n.append(g)}}}))}))}))}(jQuery);
base/inc/fields/js/posts-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(r){r(document).on("sowsetupform",".siteorigin-widget-field-type-posts",function(t){var i=r(this);i.change(function(t){var o=sowbForms.getWidgetFormValues(i),s=o.hasOwnProperty("posts")?o.posts:null,n="";for(var e in s)""!==n&&(n+="&"),n+=e+"="+s[e];r.post(soWidgets.ajaxurl,{action:"sow_get_posts_count",query:n},function(t){i.find(".sow-current-count").text(t.posts_count)})})})}(jQuery);
1
+ !function(t){t(document).on("sowsetupform",".siteorigin-widget-field-type-posts",(function(o){var s=t(this);s.change((function(o){var n=sowbForms.getWidgetFormValues(s),e=n.hasOwnProperty("posts")?n.posts:null,i="";for(var r in e)""!==i&&(i+="&"),i+=r+"="+e[r];t.post(soWidgets.ajaxurl,{action:"sow_get_posts_count",query:i},(function(t){s.find(".sow-current-count").text(t.posts_count)}))}))}))}(jQuery);
base/inc/fields/js/presets-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(i){i(document).on("sowsetupformfield",".siteorigin-widget-field-type-presets",function(e){var u=i(this).find('select[class="siteorigin-widget-input"]');if(!u.data("initialized")){var l=u.find("+ .sowb-presets-field-undo");l.hide();var d=u.data("presets");u.change(function(){var e=u.val();if(e&&d.hasOwnProperty(e)){var i=d[e].values,t=u.closest(".siteorigin-widget-form-main"),s=u.data("previousValues");if(!s){var r=JSON.parse(JSON.stringify(i)),a=sowbForms.getWidgetFormValues(t),o=0,n=function(e,i){if(10<++o)return i;for(var t in i)if(e.hasOwnProperty(t)){var s=e[t],r=i[t];null!==s&&null!==r&&"object"==typeof s?n(s,r):i[t]=s}return i};s=n(a,r),u.data("previousValues",s)}l.not(":visible")&&(l.show(),l.click(function(e){e.preventDefault(),l.hide(),sowbForms.setWidgetFormValues(t,s,!0),u.removeData("previousValues"),u.val("")})),sowbForms.setWidgetFormValues(t,i,!0)}}),u.data("initialized",!0)}})}(jQuery);
1
+ !function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-presets",(function(i){var t=e(this).find('select[class="siteorigin-widget-input"]');if(!t.data("initialized")){var s=t.find("+ .sowb-presets-field-undo");s.hide();var r=t.data("presets");t.change((function(){var e=t.val();if(e&&r.hasOwnProperty(e)){var i=r[e].values,a=t.closest(".siteorigin-widget-form-main"),o=t.data("previousValues");if(!o){var n=JSON.parse(JSON.stringify(i)),u=sowbForms.getWidgetFormValues(a),l=0,d=function(e,i){if(++l>10)return i;for(var t in i)if(e.hasOwnProperty(t)){var s=e[t],r=i[t];null!==s&&null!==r&&"object"==typeof s?d(s,r):i[t]=s}return i};o=d(u,n),t.data("previousValues",o)}s.not(":visible")&&(s.show(),s.click((function(e){e.preventDefault(),s.hide(),sowbForms.setWidgetFormValues(a,o,!0),t.removeData("previousValues"),t.val("")}))),sowbForms.setWidgetFormValues(a,i,!0)}})),t.data("initialized",!0)}}))}(jQuery);
base/inc/fields/js/tinymce-field-pre48.min.js CHANGED
@@ -1 +1 @@
1
- !function(v){var i=function(e){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit[void 0],tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit[void 0],QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances[void 0],v(e).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each(function(e,t){var i=v(t),a=i.find("textarea"),o=a.attr("id");if("undefined"!=typeof tinymce){if(-1<o.indexOf("__i__"))return;var n,r=i.data("mceSettings"),s=i.data("widgetIdBase"),c=a.attr("name").replace(/\[\d*\]/g,""),d=/[a-zA-Z0-9-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(c)[1],f=new RegExp("widget-"+s+"-?.*-"+d.replace(/\]\[/g,"-")+"[-d]*");for(var g in tinyMCEPreInit.mceInit)g.match(f)&&(r=v.extend({},tinyMCEPreInit.mceInit[g],r));var l=tinymce.get(o);null!==l&&("undefined"==typeof vc&&0===i.closest(".vc_active").length&&(n=l.getContent()),l.remove());if(r=v.extend({},r,{selector:"#"+o,setup:function(e){e.on("change",function(){tinymce.get(o).save(),a.trigger("change"),a.val(window.switchEditors.pre_wpautop(e.getContent()))}),e.on("init",function(){n&&e.setContent(n)})}}),tinyMCEPreInit.mceInit[o]=r,i.find("div#wp-"+o+"-wrap").hasClass("tmce-active"))if(v("#"+o).is(":visible"))tinymce.init(tinyMCEPreInit.mceInit[o]);else var m=setInterval(function(){v("#"+o).is(":visible")&&(tinymce.init(tinyMCEPreInit.mceInit[o]),clearInterval(m))},500)}var u=i.data("qtSettings");u=v.extend({},tinyMCEPreInit.qtInit["siteorigin-widget-input-tinymce-field"],u,{id:o}),tinyMCEPreInit.qtInit[o]=u,i.find(".quicktags-toolbar").remove(),quicktags(tinyMCEPreInit.qtInit[o]),v(this).on("click",function(e){var t=v(e.target);if(t.hasClass("wp-switch-editor")){var i=t.hasClass("switch-tmce")?"tmce":"html";if("tmce"==i){var n=tinymce.get(o);if(null!=n){var r=a.val();-1!=r.search("<")&&-1==r.search(">")&&(r=r.replace(/</g,""),a.val(r)),n.setContent(window.switchEditors.wpautop(r))}}v(this).find("+ .siteorigin-widget-tinymce-selected-editor").val(i)}})}),QTags._buttonsInit()):setTimeout(function(){i(e)},500)};v(document).on("sowsetupform",function(e){var t=v(e.target);t.is(".siteorigin-widget-field-repeater-item-form")?t.is(":visible")?i(t):t.on("slideToggleOpenComplete",function(){t.is(":visible")&&(i(t),t.off("slideToggleOpenComplete"))}):i(t)}),v(document).on("sortstop",function(e,t){t.item.is(".siteorigin-widget-field-repeater-item")?t.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){i(v(this))}):i(t.item.find(".siteorigin-widget-form"))})}(jQuery);
1
+ !function(e){var t=function(i){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit[void 0],tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit[void 0],QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances[void 0],e(i).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each((function(t,i){var n=e(i),r=n.find("textarea"),a=r.attr("id");if("undefined"!=typeof tinymce){if(a.indexOf("__i__")>-1)return;var o,s=n.data("mceSettings"),c=n.data("widgetIdBase"),d=r.attr("name").replace(/\[\d*\]/g,""),f=/[a-zA-Z0-9-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(d)[1],g=new RegExp("widget-"+c+"-?.*-"+f.replace(/\]\[/g,"-")+"[-d]*");for(var l in tinyMCEPreInit.mceInit)l.match(g)&&(s=e.extend({},tinyMCEPreInit.mceInit[l],s));var m=tinymce.get(a);null!==m&&("undefined"==typeof vc&&0===n.closest(".vc_active").length&&(o=m.getContent()),m.remove());if(s=e.extend({},s,{selector:"#"+a,setup:function(e){e.on("change",(function(){tinymce.get(a).save(),r.trigger("change"),r.val(window.switchEditors.pre_wpautop(e.getContent()))})),e.on("init",(function(){o&&e.setContent(o)}))}}),tinyMCEPreInit.mceInit[a]=s,n.find("div#wp-"+a+"-wrap").hasClass("tmce-active"))if(e("#"+a).is(":visible"))tinymce.init(tinyMCEPreInit.mceInit[a]);else var u=setInterval((function(){e("#"+a).is(":visible")&&(tinymce.init(tinyMCEPreInit.mceInit[a]),clearInterval(u))}),500)}var v=n.data("qtSettings");v=e.extend({},tinyMCEPreInit.qtInit["siteorigin-widget-input-tinymce-field"],v,{id:a}),tinyMCEPreInit.qtInit[a]=v,n.find(".quicktags-toolbar").remove(),quicktags(tinyMCEPreInit.qtInit[a]),e(this).on("click",(function(t){var i=e(t.target);if(i.hasClass("wp-switch-editor")){var n=i.hasClass("switch-tmce")?"tmce":"html";if("tmce"==n){var o=tinymce.get(a);if(null!=o){var s=r.val();-1!=s.search("<")&&-1==s.search(">")&&(s=s.replace(/</g,""),r.val(s)),o.setContent(window.switchEditors.wpautop(s))}}e(this).find("+ .siteorigin-widget-tinymce-selected-editor").val(n)}}))})),QTags._buttonsInit()):setTimeout((function(){t(i)}),500)};e(document).on("sowsetupform",(function(i){var n=e(i.target);n.is(".siteorigin-widget-field-repeater-item-form")?n.is(":visible")?t(n):n.on("slideToggleOpenComplete",(function(){n.is(":visible")&&(t(n),n.off("slideToggleOpenComplete"))})):t(n)})),e(document).on("sortstop",(function(i,n){n.item.is(".siteorigin-widget-field-repeater-item")?n.item.find("> .siteorigin-widget-field-repeater-item-form").each((function(){t(e(this))})):t(n.item.find(".siteorigin-widget-form"))}))}(jQuery);
base/inc/fields/js/tinymce-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(w){function t(r){if(!r.data("initialized")){var i=wp.oldEditor?wp.oldEditor:wp.editor;i&&i.hasOwnProperty("autop")&&(wp.editor.autop=i.autop,wp.editor.removep=i.removep,wp.editor.initialize=i.initialize);var e,n=r.find(".siteorigin-widget-tinymce-container"),c=n.data("editorSettings");if(tinyMCEPreInit.mceInit&&tinyMCEPreInit.mceInit.hasOwnProperty("content")){var t=tinyMCEPreInit.mceInit.content;if(t.hasOwnProperty("content_css")&&t.content_css){var o=t.content_css.split(",");if(c.tinymce.hasOwnProperty("content_css")&&c.tinymce.content_css)for(var s=0;s<o.length;s++){var a=o[s];-1===c.tinymce.content_css.indexOf(a)&&(c.tinymce.content_css+=","+a)}else c.tinymce.content_css=o}}if(c.wpautopToggleField){var d=n.closest(".siteorigin-widget-form");e=d.find(c.wpautopToggleField),c.tinymce.wpautop=e.is(":checked")}var l=n.find("textarea"),f=l.attr("id");if(c.tinymce&&(c.tinymce=w.extend({},c.tinymce,{selector:"#"+f,setup:function(i){i.on("change",function(){window.tinymce.get(f).save(),l.trigger("change")}),e&&(e.off("change"),e.on("change",function(){wp.editor.remove(f),c.tinymce.wpautop=e.is(":checked"),wp.editor.initialize(f,c)}))}})),w(document).on("wp-before-tinymce-init",function(i,e){if(e.selector===c.tinymce.selector){var t=n.data("mediaButtons");0===r.find(".wp-media-buttons").length&&r.find(".wp-editor-tabs").before(t.html)}}),w(document).on("tinymce-editor-setup",function(){var i=r.find(".wp-editor-wrap");0<i.length&&!i.hasClass(c.selectedEditor+"-active")&&setTimeout(function(){window.switchEditors.go(f)},10)}),i.remove(f),window.tinymce&&window.tinymce.EditorManager.overrideDefaults({base_url:c.baseURL,suffix:c.suffix}),l.is(":visible"))i.initialize(f,c);else var m=setInterval(function(){l.is(":visible")&&(i.initialize(f,c),clearInterval(m))},500);r.on("click",function(i){var e=w(i.target);if(e.is(".wp-switch-editor")){var t=e.hasClass("switch-tmce")?"tmce":"html";if("tmce"==t){var n=window.tinymce.get(f);if(null!==n){var o=l.val();-1!==o.search("<")&&-1===o.search(">")&&(o=o.replace(/</g,""),l.val(o)),n.setContent(window.switchEditors.wpautop(o))}}c.selectedEditor=t,r.find(".siteorigin-widget-tinymce-selected-editor").val(t)}}),r.data("initialized",!0)}}w(document).on("sowsetupformfield",".siteorigin-widget-field-type-tinymce",function(){var i=w(this),e=i.closest(".siteorigin-widget-field-repeater-item-form");0<e.length?e.is(":visible")?t(i):e.on("slideToggleOpenComplete",function(){e.is(":visible")&&(t(i),e.off("slideToggleOpenComplete"))}):t(i)}),w(document).on("sortstop",function(i,e){(e.item.is(".siteorigin-widget-field-repeater-item")?e.item.find("> .siteorigin-widget-field-repeater-item-form"):e.item.find(".siteorigin-widget-form")).find(".siteorigin-widget-field-type-tinymce").each(function(){w(this).data("initialized",null),t(w(this))})})}(jQuery);
1
+ !function(i){var e=function(e){if(!e.data("initialized")){var t=wp.oldEditor?wp.oldEditor:wp.editor;t&&t.hasOwnProperty("autop")&&(wp.editor.autop=t.autop,wp.editor.removep=t.removep,wp.editor.initialize=t.initialize);var n,o=e.find(".siteorigin-widget-tinymce-container"),r=o.data("editorSettings");if(tinyMCEPreInit.mceInit&&tinyMCEPreInit.mceInit.hasOwnProperty("content")){var c=tinyMCEPreInit.mceInit.content;if(c.hasOwnProperty("content_css")&&c.content_css){var s=c.content_css.split(",");if(r.tinymce.hasOwnProperty("content_css")&&r.tinymce.content_css)for(var a=0;a<s.length;a++){var d=s[a];-1===r.tinymce.content_css.indexOf(d)&&(r.tinymce.content_css+=","+d)}else r.tinymce.content_css=s}}if(r.wpautopToggleField){var l=o.closest(".siteorigin-widget-form");n=l.find(r.wpautopToggleField),r.tinymce.wpautop=n.is(":checked")}var f=o.find("textarea"),m=f.attr("id");if(r.tinymce&&(r.tinymce=i.extend({},r.tinymce,{selector:"#"+m,setup:function(i){i.on("change",(function(){window.tinymce.get(m).save(),f.trigger("change")})),n&&(n.off("change"),n.on("change",(function(){wp.editor.remove(m),r.tinymce.wpautop=n.is(":checked"),wp.editor.initialize(m,r)})))}})),i(document).on("wp-before-tinymce-init",(function(i,t){if(t.selector===r.tinymce.selector){var n=o.data("mediaButtons");0===e.find(".wp-media-buttons").length&&e.find(".wp-editor-tabs").before(n.html)}})),i(document).on("tinymce-editor-setup",(function(){var i=e.find(".wp-editor-wrap");i.length>0&&!i.hasClass(r.selectedEditor+"-active")&&setTimeout((function(){window.switchEditors.go(m)}),10)})),t.remove(m),window.tinymce&&window.tinymce.EditorManager.overrideDefaults({base_url:r.baseURL,suffix:r.suffix}),f.is(":visible"))t.initialize(m,r);else var w=setInterval((function(){f.is(":visible")&&(t.initialize(m,r),clearInterval(w))}),500);e.on("click",(function(t){var n=i(t.target);if(n.is(".wp-switch-editor")){var o=n.hasClass("switch-tmce")?"tmce":"html";if("tmce"===o){var c=window.tinymce.get(m);if(null!==c){var s=f.val();-1!==s.search("<")&&-1===s.search(">")&&(s=s.replace(/</g,""),f.val(s)),c.setContent(window.switchEditors.wpautop(s))}}r.selectedEditor=o,e.find(".siteorigin-widget-tinymce-selected-editor").val(o)}})),e.data("initialized",!0)}};i(document).on("sowsetupformfield",".siteorigin-widget-field-type-tinymce",(function(){var t=i(this),n=t.closest(".siteorigin-widget-field-repeater-item-form");n.length>0?n.is(":visible")?e(t):n.on("slideToggleOpenComplete",(function(){n.is(":visible")&&(e(t),n.off("slideToggleOpenComplete"))})):e(t)})),i(document).on("sortstop",(function(t,n){(n.item.is(".siteorigin-widget-field-repeater-item")?n.item.find("> .siteorigin-widget-field-repeater-item-form"):n.item.find(".siteorigin-widget-form")).find(".siteorigin-widget-field-type-tinymce").each((function(){i(this).data("initialized",null),e(i(this))}))}))}(jQuery);
base/inc/lib/Less/Configurable.php CHANGED
@@ -1,69 +1,69 @@
1
- <?php
2
-
3
- /**
4
- * Configurable
5
- *
6
- * @package Less
7
- * @subpackage Core
8
- */
9
- abstract class Less_Configurable {
10
-
11
- /**
12
- * Array of options
13
- *
14
- * @var array
15
- */
16
- protected $options = array();
17
-
18
- /**
19
- * Array of default options
20
- *
21
- * @var array
22
- */
23
- protected $defaultOptions = array();
24
-
25
-
26
- /**
27
- * Set options
28
- *
29
- * If $options is an object it will be converted into an array by called
30
- * it's toArray method.
31
- *
32
- * @throws Exception
33
- * @param array|object $options
34
- *
35
- */
36
- public function setOptions($options){
37
- $options = array_intersect_key($options,$this->defaultOptions);
38
- $this->options = array_merge($this->defaultOptions, $this->options, $options);
39
- }
40
-
41
-
42
- /**
43
- * Get an option value by name
44
- *
45
- * If the option is empty or not set a NULL value will be returned.
46
- *
47
- * @param string $name
48
- * @param mixed $default Default value if confiuration of $name is not present
49
- * @return mixed
50
- */
51
- public function getOption($name, $default = null){
52
- if(isset($this->options[$name])){
53
- return $this->options[$name];
54
- }
55
- return $default;
56
- }
57
-
58
-
59
- /**
60
- * Set an option
61
- *
62
- * @param string $name
63
- * @param mixed $value
64
- */
65
- public function setOption($name, $value){
66
- $this->options[$name] = $value;
67
- }
68
-
69
}
1
+ <?php
2
+
3
+ /**
4
+ * Configurable
5
+ *
6
+ * @package Less
7
+ * @subpackage Core
8
+ */
9
+ abstract class Less_Configurable {
10
+
11
+ /**
12
+ * Array of options
13
+ *
14
+ * @var array
15
+ */
16
+ protected $options = array();
17
+
18
+ /**
19
+ * Array of default options
20
+ *
21
+ * @var array
22
+ */
23
+ protected $defaultOptions = array();
24
+
25
+
26
+ /**
27
+ * Set options
28
+ *
29
+ * If $options is an object it will be converted into an array by called
30
+ * it's toArray method.
31
+ *
32
+ * @throws Exception
33
+ * @param array|object $options
34
+ *
35
+ */
36
+ public function setOptions($options){
37
+ $options = array_intersect_key($options,$this->defaultOptions);
38
+ $this->options = array_merge($this->defaultOptions, $this->options, $options);
39
+ }
40
+
41
+
42
+ /**
43
+ * Get an option value by name
44
+ *
45
+ * If the option is empty or not set a NULL value will be returned.
46
+ *
47
+ * @param string $name
48
+ * @param mixed $default Default value if confiuration of $name is not present
49
+ * @return mixed
50
+ */
51
+ public function getOption($name, $default = null){
52
+ if(isset($this->options[$name])){
53
+ return $this->options[$name];
54
+ }
55
+ return $default;
56
+ }
57
+
58
+
59
+ /**
60
+ * Set an option
61
+ *
62
+ * @param string $name
63
+ * @param mixed $value
64
+ */
65
+ public function setOption($name, $value){
66
+ $this->options[$name] = $value;
67
+ }
68
+
69
}
base/inc/lib/Less/Exception/Chunk.php CHANGED
@@ -68,6 +68,7 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
68
$parenLevel++;
69
$lastParen = $this->parserCurrentIndex;
70
break;
71
// )
72
case 41:
73
$parenLevel--;
@@ -75,15 +76,18 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
75
return $this->fail("missing opening `(`");
76
}
77
break;
78
// ;
79
case 59:
80
//if (!$parenLevel) { $this->emitChunk(); }
81
break;
82
// {
83
case 123:
84
$level++;
85
$lastOpening = $this->parserCurrentIndex;
86
break;
87
// }
88
case 125:
89
$level--;
@@ -142,6 +146,7 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
142
}
143
}
144
break;
145
// *, check for unmatched */
146
case 42:
147
if (($this->parserCurrentIndex < $this->input_len - 1) && ($this->CharCode($this->parserCurrentIndex+1) == 47)) {
68
$parenLevel++;
69
$lastParen = $this->parserCurrentIndex;
70
break;
71
+
72
// )
73
case 41:
74
$parenLevel--;
76
return $this->fail("missing opening `(`");
77
}
78
break;
79
+
80
// ;
81
case 59:
82
//if (!$parenLevel) { $this->emitChunk(); }
83
break;
84
+
85
// {
86
case 123:
87
$level++;
88
$lastOpening = $this->parserCurrentIndex;
89
break;
90
+
91
// }
92
case 125:
93
$level--;
146
}
147
}
148
break;
149
+
150
// *, check for unmatched */
151
case 42:
152
if (($this->parserCurrentIndex < $this->input_len - 1) && ($this->CharCode($this->parserCurrentIndex+1) == 47)) {
base/inc/lib/Less/Exception/Compiler.php CHANGED
@@ -1,11 +1,11 @@
1
- <?php
2
-
3
- /**
4
- * Compiler Exception
5
- *
6
- * @package Less
7
- * @subpackage exception
8
- */
9
- class Less_Exception_Compiler extends Less_Exception_Parser{
10
-
11
}
1
+ <?php
2
+
3
+ /**
4
+ * Compiler Exception
5
+ *
6
+ * @package Less
7
+ * @subpackage exception
8
+ */
9
+ class Less_Exception_Compiler extends Less_Exception_Parser{
10
+
11
}
base/inc/lib/Less/Exception/Parser.php CHANGED
@@ -1,125 +1,125 @@
1
- <?php
2
-
3
- /**
4
- * Parser Exception
5
- *
6
- * @package Less
7
- * @subpackage exception
8
- */
9
- class Less_Exception_Parser extends Exception{
10
-
11
- /**
12
- * The current file
13
- *
14
- * @var Less_ImportedFile
15
- */
16
- public $currentFile;
17
-
18
- /**
19
- * The current parser index
20
- *
21
- * @var integer
22
- */
23
- public $index;
24
-
25
- protected $input;
26
-
27
- protected $details = array();
28
-
29
-
30
- /**
31
- * Constructor
32
- *
33
- * @param string $message
34
- * @param Exception $previous Previous exception
35
- * @param integer $index The current parser index
36
- * @param Less_FileInfo|string $currentFile The file
37
- * @param integer $code The exception code
38
- */
39
- public function __construct($message = null, Exception $previous = null, $index = null, $currentFile = null, $code = 0){
40
-
41
- if (PHP_VERSION_ID < 50300) {
42
- $this->previous = $previous;
43
- parent::__construct($message, $code);
44
- } else {
45
- parent::__construct($message, $code, $previous);
46
- }
47
-
48
- $this->currentFile = $currentFile;
49
- $this->index = $index;
50
-
51
- $this->genMessage();
52
- }
53
-
54
-
55
- protected function getInput(){
56
-
57
- if( !$this->input && $this->currentFile && $this->currentFile['filename'] && file_exists($this->currentFile['filename']) ){
58
- $this->input = file_get_contents( $this->currentFile['filename'] );
59
- }
60
- }
61
-
62
-
63
-
64
- /**
65
- * Converts the exception to string
66
- *
67
- * @return string
68
- */
69
- public function genMessage(){
70
-
71
- if( $this->currentFile && $this->currentFile['filename'] ){
72
- $this->message .= ' in '.basename($this->currentFile['filename']);
73
- }
74
-
75
- if( $this->index !== null ){
76
- $this->getInput();
77
- if( $this->input ){
78
- $line = self::getLineNumber();
79
- $this->message .= ' on line '.$line.', column '.self::getColumn();
80
-
81
- $lines = explode("\n",$this->input);
82
-
83
- $count = count($lines);
84
- $start_line = max(0, $line-3);
85
- $last_line = min($count, $start_line+6);
86
- $num_len = strlen($last_line);
87
- for( $i = $start_line; $i < $last_line; $i++ ){
88
- $this->message .= "\n".str_pad($i+1,$num_len,'0',STR_PAD_LEFT).'| '.$lines[$i];
89
- }
90
- }
91
- }
92
-
93
- }
94
-
95
- /**
96
- * Returns the line number the error was encountered
97
- *
98
- * @return integer
99
- */
100
- public function getLineNumber(){
101
- if( $this->index ){
102
- // https://bugs.php.net/bug.php?id=49790
103
- if (ini_get("mbstring.func_overload")) {
104
- return substr_count(substr($this->input, 0, $this->index), "\n") + 1;
105
- } else {
106
- return substr_count($this->input, "\n", 0, $this->index) + 1;
107
- }
108
- }
109
- return 1;
110
- }
111
-
112
-
113
- /**
114
- * Returns the column the error was encountered
115
- *
116
- * @return integer
117
- */
118
- public function getColumn(){
119
-
120
- $part = substr($this->input, 0, $this->index);
121
- $pos = strrpos($part,"\n");
122
- return $this->index - $pos;
123
- }
124
-
125
- }
1
+ <?php
2
+
3
+ /**
4
+ * Parser Exception
5
+ *
6
+ * @package Less
7
+ * @subpackage exception
8
+ */
9
+ class Less_Exception_Parser extends Exception{
10
+
11
+ /**
12
+ * The current file
13
+ *
14
+ * @var Less_ImportedFile
15
+ */
16
+ public $currentFile;
17
+
18
+ /**
19
+ * The current parser index
20
+ *
21
+ * @var integer
22
+ */
23
+ public $index;
24
+
25
+ protected $input;
26
+
27
+ protected $details = array();
28
+
29
+
30
+ /**
31
+ * Constructor
32
+ *
33
+ * @param string $message
34
+ * @param Exception $previous Previous exception
35
+ * @param integer $index The current parser index
36
+ * @param Less_FileInfo|string $currentFile The file
37
+ * @param integer $code The exception code
38
+ */
39
+ public function __construct($message = null, Exception $previous = null, $index = null, $currentFile = null, $code = 0){
40
+
41
+ if (PHP_VERSION_ID < 50300) {
42
+ $this->previous = $previous;
43
+ parent::__construct($message, $code);
44
+ } else {
45
+ parent::__construct($message, $code, $previous);
46
+ }
47
+
48
+ $this->currentFile = $currentFile;
49
+ $this->index = $index;
50
+
51
+ $this->genMessage();
52
+ }
53
+
54
+
55
+ protected function getInput(){
56
+
57
+ if( !$this->input && $this->currentFile && $this->currentFile['filename'] && file_exists($this->currentFile['filename']) ){
58
+ $this->input = file_get_contents( $this->currentFile['filename'] );
59
+ }
60
+ }
61
+
62
+
63
+
64
+ /**
65
+ * Converts the exception to string
66
+ *
67
+ * @return string
68
+ */
69
+ public function genMessage(){
70
+
71
+ if( $this->currentFile && $this->currentFile['filename'] ){
72
+ $this->message .= ' in '.basename($this->currentFile['filename']);
73
+ }
74
+
75
+ if( $this->index !== null ){
76
+ $this->getInput();
77
+ if( $this->input ){
78
+ $line = self::getLineNumber();
79
+ $this->message .= ' on line '.$line.', column '.self::getColumn();
80
+
81
+ $lines = explode("\n",$this->input);
82
+
83
+ $count = count($lines);
84
+ $start_line = max(0, $line-3);
85
+ $last_line = min($count, $start_line+6);
86
+ $num_len = strlen($last_line);
87
+ for( $i = $start_line; $i < $last_line; $i++ ){
88
+ $this->message .= "\n".str_pad($i+1,$num_len,'0',STR_PAD_LEFT).'| '.$lines[$i];
89
+ }
90
+ }
91
+ }
92
+
93
+ }
94
+
95
+ /**
96
+ * Returns the line number the error was encountered
97
+ *
98
+ * @return integer
99
+ */
100
+ public function getLineNumber(){
101
+ if( $this->index ){
102
+ // https://bugs.php.net/bug.php?id=49790
103
+ if (ini_get("mbstring.func_overload")) {
104
+ return substr_count(substr($this->input, 0, $this->index), "\n") + 1;
105
+ } else {
106
+ return substr_count($this->input, "\n", 0, $this->index) + 1;
107
+ }
108
+ }
109
+ return 1;
110
+ }
111
+
112
+
113
+ /**
114
+ * Returns the column the error was encountered
115
+ *
116
+ * @return integer
117
+ */
118
+ public function getColumn(){
119
+
120
+ $part = substr($this->input, 0, $this->index);
121
+ $pos = strrpos($part,"\n");
122
+ return $this->index - $pos;
123
+ }
124
+
125
+ }
base/inc/lib/Less/Output/Mapped.php CHANGED
@@ -1,122 +1,122 @@
1
- <?php
2
-
3
- /**
4
- * Parser output with source map
5
- *
6
- * @package Less
7
- * @subpackage Output
8
- */
9
- class Less_Output_Mapped extends Less_Output {
10
-
11
- /**
12
- * The source map generator
13
- *
14
- * @var Less_SourceMap_Generator
15
- */
16
- protected $generator;
17
-
18
- /**
19
- * Current line
20
- *
21
- * @var integer
22
- */
23
- protected $lineNumber = 0;
24
-
25
- /**
26
- * Current column
27
- *
28
- * @var integer
29
- */
30
- protected $column = 0;
31
-
32
- /**
33
- * Array of contents map (file and its content)
34
- *
35
- * @var array
36
- */
37
- protected $contentsMap = array();
38
-
39
- /**
40
- * Constructor
41
- *
42
- * @param array $contentsMap Array of filename to contents map
43
- * @param Less_SourceMap_Generator $generator
44
- */
45
- public function __construct(array $contentsMap, $generator){
46
- $this->contentsMap = $contentsMap;
47
- $this->generator = $generator;
48
- }
49
-
50
- /**
51
- * Adds a chunk to the stack
52
- * The $index for less.php may be different from less.js since less.php does not chunkify inputs
53
- *
54
- * @param string $chunk
55
- * @param string $fileInfo
56
- * @param integer $index
57
- * @param mixed $mapLines
58
- */
59
- public function add($chunk, $fileInfo = null, $index = 0, $mapLines = null){
60
-
61
- //ignore adding empty strings
62
- if( $chunk === '' ){
63
- return;
64
- }
65
-
66
-
67
- $sourceLines = array();
68
- $sourceColumns = ' ';
69
-
70
-
71
- if( $fileInfo ){
72
-
73
- $url = $fileInfo['currentUri'];
74
-
75
- if( isset($this->contentsMap[$url]) ){
76
- $inputSource = substr($this->contentsMap[$url], 0, $index);
77
- $sourceLines = explode("\n", $inputSource);
78
- $sourceColumns = end($sourceLines);
79
- }else{
80
- throw new Exception('Filename '.$url.' not in contentsMap');
81
- }
82
-
83
- }
84
-
85
- $lines = explode("\n", $chunk);
86
- $columns = end($lines);
87
-
88
- if($fileInfo){
89
-
90
- if(!$mapLines){
91
- $this->generator->addMapping(
92
- $this->lineNumber + 1, // generated_line
93
- $this->column, // generated_column
94
- count($sourceLines), // original_line
95
- strlen($sourceColumns), // original_column
96
- $fileInfo
97
- );
98
- }else{
99
- for($i = 0, $count = count($lines); $i < $count; $i++){
100
- $this->generator->addMapping(
101
- $this->lineNumber + $i + 1, // generated_line
102
- $i === 0 ? $this->column : 0, // generated_column
103
- count($sourceLines) + $i, // original_line
104
- $i === 0 ? strlen($sourceColumns) : 0, // original_column
105
- $fileInfo
106
- );
107
- }
108
- }
109
- }
110
-
111
- if(count($lines) === 1){
112
- $this->column += strlen($columns);
113
- }else{
114
- $this->lineNumber += count($lines) - 1;
115
- $this->column = strlen($columns);
116
- }
117
-
118
- // add only chunk
119
- parent::add($chunk);
120
- }
121
-
122
}
1
+ <?php
2
+
3
+ /**
4
+ * Parser output with source map
5
+ *
6
+ * @package Less
7
+ * @subpackage Output
8
+ */
9
+ class Less_Output_Mapped extends Less_Output {
10
+
11
+ /**
12
+ * The source map generator
13
+ *
14
+ * @var Less_SourceMap_Generator
15
+ */
16
+ protected $generator;
17
+
18
+ /**
19
+ * Current line
20
+ *
21
+ * @var integer
22
+ */
23
+ protected $lineNumber = 0;
24
+
25
+ /**
26
+ * Current column
27
+ *
28
+ * @var integer
29
+ */
30
+ protected $column = 0;
31
+
32
+ /**
33
+ * Array of contents map (file and its content)
34
+ *
35
+ * @var array
36
+ */
37
+ protected $contentsMap = array();
38
+
39
+ /**
40
+ * Constructor
41
+ *
42
+ * @param array $contentsMap Array of filename to contents map
43
+ * @param Less_SourceMap_Generator $generator
44
+ */
45
+ public function __construct(array $contentsMap, $generator){
46
+ $this->contentsMap = $contentsMap;
47
+ $this->generator = $generator;
48
+ }
49
+
50
+ /**
51
+ * Adds a chunk to the stack
52
+ * The $index for less.php may be different from less.js since less.php does not chunkify inputs
53
+ *
54
+ * @param string $chunk
55
+ * @param string $fileInfo
56
+ * @param integer $index
57
+ * @param mixed $mapLines
58
+ */
59
+ public function add($chunk, $fileInfo = null, $index = 0, $mapLines = null){
60
+
61
+ //ignore adding empty strings
62
+ if( $chunk === '' ){
63
+ return;
64
+ }
65
+
66
+
67
+ $sourceLines = array();
68
+ $sourceColumns = ' ';
69
+
70
+
71
+ if( $fileInfo ){
72
+
73
+ $url = $fileInfo['currentUri'];
74
+
75
+ if( isset($this->contentsMap[$url]) ){
76
+ $inputSource = substr($this->contentsMap[$url], 0, $index);
77
+ $sourceLines = explode("\n", $inputSource);
78
+ $sourceColumns = end($sourceLines);
79
+ }else{
80
+ throw new Exception('Filename '.$url.' not in contentsMap');
81
+ }
82
+
83
+ }
84
+
85
+ $lines = explode("\n", $chunk);
86
+ $columns = end($lines);
87
+
88
+ if($fileInfo){
89
+
90
+ if(!$mapLines){
91
+ $this->generator->addMapping(
92
+ $this->lineNumber + 1, // generated_line
93
+ $this->column, // generated_column
94
+ count($sourceLines), // original_line
95
+ strlen($sourceColumns), // original_column
96
+ $fileInfo
97
+ );
98
+ }else{
99
+ for($i = 0, $count = count($lines); $i < $count; $i++){
100
+ $this->generator->addMapping(
101
+ $this->lineNumber + $i + 1, // generated_line
102
+ $i === 0 ? $this->column : 0, // generated_column
103
+ count($sourceLines) + $i, // original_line
104
+ $i === 0 ? strlen($sourceColumns) : 0, // original_column
105
+ $fileInfo
106
+ );
107
+ }
108
+ }
109
+ }
110
+
111
+ if(count($lines) === 1){
112
+ $this->column += strlen($columns);
113
+ }else{
114
+ $this->lineNumber += count($lines) - 1;
115
+ $this->column = strlen($columns);
116
+ }
117
+
118
+ // add only chunk
119
+ parent::add($chunk);
120
+ }
121
+
122
}
base/inc/lib/Less/Parser.php CHANGED
@@ -877,8 +877,8 @@ class Less_Parser{
877
878
if( preg_match($tok, $this->input, $match, 0, $this->pos) ){
879
$this->skipWhitespace(strlen($match[0]));
880
- return $match;
881
}
882
}
883
884
877
878
if( preg_match($tok, $this->input, $match, 0, $this->pos) ){
879
$this->skipWhitespace(strlen($match[0]));
880
}
881
+ return $match;
882
}
883
884
base/inc/lib/Less/SourceMap/Generator.php CHANGED
@@ -1,365 +1,365 @@
1
- <?php
2
-
3
- /**
4
- * Source map generator
5
- *
6
- * @package Less
7
- * @subpackage Output
8
- */
9
- class Less_SourceMap_Generator extends Less_Configurable {
10
-
11
- /**
12
- * What version of source map does the generator generate?
13
- */
14
- const VERSION = 3;
15
-
16
- /**
17
- * Array of default options
18
- *
19
- * @var array
20
- */
21
- protected $defaultOptions = array(
22
- // an optional source root, useful for relocating source files
23
- // on a server or removing repeated values in the 'sources' entry.
24
- // This value is prepended to the individual entries in the 'source' field.
25
- 'sourceRoot' => '',
26
-
27
- // an optional name of the generated code that this source map is associated with.
28
- 'sourceMapFilename' => null,
29
-
30
- // url of the map
31
- 'sourceMapURL' => null,
32
-
33
- // absolute path to a file to write the map to
34
- 'sourceMapWriteTo' => null,
35
-
36
- // output source contents?
37
- 'outputSourceFiles' => false,
38
-
39
- // base path for filename normalization
40
- 'sourceMapRootpath' => '',
41
-
42
- // base path for filename normalization
43
- 'sourceMapBasepath' => ''
44
- );
45
-
46
- /**
47
- * The base64 VLQ encoder
48
- *
49
- * @var Less_SourceMap_Base64VLQ
50
- */
51
- protected $encoder;
52
-
53
- /**
54
- * Array of mappings
55
- *
56
- * @var array
57
- */
58
- protected $mappings = array();
59
-
60
- /**
61
- * The root node
62
- *
63
- * @var Less_Tree_Ruleset
64
- */
65
- protected $root;
66
-
67
- /**
68
- * Array of contents map
69
- *
70
- * @var array
71
- */
72
- protected $contentsMap = array();
73
-
74
- /**
75
- * File to content map
76
- *
77
- * @var array
78
- */
79
- protected $sources = array();
80
- protected $source_keys = array();
81
-
82
- /**
83
- * Constructor
84
- *
85
- * @param Less_Tree_Ruleset $root The root node
86
- * @param array $options Array of options
87
- */
88
- public function __construct(Less_Tree_Ruleset $root, $contentsMap, $options = array()){
89
- $this->root = $root;
90
- $this->contentsMap = $contentsMap;
91
- $this->encoder = new Less_SourceMap_Base64VLQ();
92
-
93
- $this->SetOptions($options);
94
-
95
- $this->options['sourceMapRootpath'] = $this->fixWindowsPath($this->options['sourceMapRootpath'], true);
96
- $this->options['sourceMapBasepath'] = $this->fixWindowsPath($this->options['sourceMapBasepath'], true);
97
- }
98
-
99
- /**
100
- * Generates the CSS
101
- *
102
- * @return string
103
- */
104
- public function generateCSS(){
105
- $output = new Less_Output_Mapped($this->contentsMap, $this);
106
-
107
- // catch the output
108
- $this->root->genCSS($output);
109
-
110
-
111
- $sourceMapUrl = $this->getOption('sourceMapURL');
112
- $sourceMapFilename = $this->getOption('sourceMapFilename');
113
- $sourceMapContent = $this->generateJson();
114
- $sourceMapWriteTo = $this->getOption('sourceMapWriteTo');
115
-
116
- if( !$sourceMapUrl && $sourceMapFilename ){
117
- $sourceMapUrl = $this->normalizeFilename($sourceMapFilename);
118
- }
119
-
120
- // write map to a file
121
- if( $sourceMapWriteTo ){
122
- $this->saveMap($sourceMapWriteTo, $sourceMapContent);
123
- }
124
-
125
- // inline the map
126
- if( !$sourceMapUrl ){
127
- $sourceMapUrl = sprintf('data:application/json,%s', Less_Functions::encodeURIComponent($sourceMapContent));
128
- }
129
-
130
- if( $sourceMapUrl ){
131
- $output->add( sprintf('/*# sourceMappingURL=%s */', $sourceMapUrl) );
132
- }
133
-
134
- return $output->toString();
135
- }
136
-
137
- /**
138
- * Saves the source map to a file
139
- *
140
- * @param string $file The absolute path to a file
141
- * @param string $content The content to write
142
- * @throws Exception If the file could not be saved
143
- */
144
- protected function saveMap($file, $content){
145
- $dir = dirname($file);
146
- // directory does not exist
147
- if( !is_dir($dir) ){
148
- // FIXME: create the dir automatically?
149
- throw new Exception(sprintf('The directory "%s" does not exist. Cannot save the source map.', $dir));
150
- }
151
- // FIXME: proper saving, with dir write check!
152
- if(file_put_contents($file, $content) === false){
153
- throw new Exception(sprintf('Cannot save the source map to "%s"', $file));
154
- }
155
- return true;
156
- }
157
-
158
- /**
159
- * Normalizes the filename
160
- *
161
- * @param string $filename
162
- * @return string
163
- */
164
- protected function normalizeFilename($filename){
165
-
166
- $filename = $this->fixWindowsPath($filename);
167
-
168
- $rootpath = $this->getOption('sourceMapRootpath');
169
- $basePath = $this->getOption('sourceMapBasepath');
170
-
171
- // "Trim" the 'sourceMapBasepath' from the output filename.
172
- if (strpos($filename, $basePath) === 0) {
173
- $filename = substr($filename, strlen($basePath));
174
- }
175
-
176
- // Remove extra leading path separators.
177
- if(strpos($filename, '\\') === 0 || strpos($filename, '/') === 0){
178
- $filename = substr($filename, 1);
179
- }
180
-
181
- return $rootpath . $filename;
182
- }
183
-
184
- /**
185
- * Adds a mapping
186
- *
187
- * @param integer $generatedLine The line number in generated file
188
- * @param integer $generatedColumn The column number in generated file
189
- * @param integer $originalLine The line number in original file
190
- * @param integer $originalColumn The column number in original file
191
- * @param string $sourceFile The original source file
192
- */
193
- public function addMapping($generatedLine, $generatedColumn, $originalLine, $originalColumn, $fileInfo ){
194
-
195
- $this->mappings[] = array(
196
- 'generated_line' => $generatedLine,
197
- 'generated_column' => $generatedColumn,
198
- 'original_line' => $originalLine,
199
- 'original_column' => $originalColumn,
200
- 'source_file' => $fileInfo['currentUri']
201
- );
202
-
203
- $this->sources[$fileInfo['currentUri']] = $fileInfo['filename'];
204
- }
205
-
206
-
207
- /**
208
- * Generates the JSON source map
209
- *
210
- * @return string
211
- * @see https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#
212
- */
213
- protected function generateJson(){
214
-
215
- $sourceMap = array();
216
- $mappings = $this->generateMappings();
217
-
218
- // File version (always the first entry in the object) and must be a positive integer.
219
- $sourceMap['version'] = self::VERSION;
220
-
221
-
222
- // An optional name of the generated code that this source map is associated with.
223
- $file = $this->getOption('sourceMapFilename');
224
- if( $file ){
225
- $sourceMap['file'] = $file;
226
- }
227
-
228
-
229
- // An optional source root, useful for relocating source files on a server or removing repeated values in the 'sources' entry. This value is prepended to the individual entries in the 'source' field.
230
- $root = $this->getOption('sourceRoot');
231
- if( $root ){
232
- $sourceMap['sourceRoot'] = $root;
233
- }
234
-
235
-
236
- // A list of original sources used by the 'mappings' entry.
237
- $sourceMap['sources'] = array();
238
- foreach($this->sources as $source_uri => $source_filename){
239
- $sourceMap['sources'][] = $this->normalizeFilename($source_filename);
240
- }
241
-
242
-
243
- // A list of symbol names used by the 'mappings' entry.
244
- $sourceMap['names'] = array();
245
-
246
- // A string with the encoded mapping data.
247
- $sourceMap['mappings'] = $mappings;
248
-
249
- if( $this->getOption('outputSourceFiles') ){
250
- // An optional list of source content, useful when the 'source' can't be hosted.
251
- // The contents are listed in the same order as the sources above.
252
- // 'null' may be used if some original sources should be retrieved by name.
253
- $sourceMap['sourcesContent'] = $this->getSourcesContent();
254
- }
255
-
256
- // less.js compat fixes
257
- if( count($sourceMap['sources']) && empty($sourceMap['sourceRoot']) ){
258
- unset($sourceMap['sourceRoot']);
259
- }
260
-
261
- return json_encode($sourceMap);
262
- }
263
-
264
- /**
265
- * Returns the sources contents
266
- *
267
- * @return array|null
268
- */
269
- protected function getSourcesContent(){
270
- if(empty($this->sources)){
271
- return;
272
- }
273
- $content = array();
274
- foreach($this->sources as $sourceFile){
275
- $content[] = file_get_contents($sourceFile);
276
- }
277
- return $content;
278
- }
279
-
280
- /**
281
- * Generates the mappings string
282
- *
283
- * @return string
284
- */
285
- public function generateMappings(){
286
-
287
- if( !count($this->mappings) ){
288
- return '';
289
- }
290
-
291
- $this->source_keys = array_flip(array_keys($this->sources));
292
-
293
-
294
- // group mappings by generated line number.
295
- $groupedMap = $groupedMapEncoded = array();
296
- foreach($this->mappings as $m){
297
- $groupedMap[$m['generated_line']][] = $m;
298
- }
299
- ksort($groupedMap);
300
-
301
- $lastGeneratedLine = $lastOriginalIndex = $lastOriginalLine = $lastOriginalColumn = 0;
302
-
303
- foreach($groupedMap as $lineNumber => $line_map){
304
- while(++$lastGeneratedLine < $lineNumber){
305
- $groupedMapEncoded[] = ';';
306
- }
307
-
308
- $lineMapEncoded = array();
309
- $lastGeneratedColumn = 0;
310
-
311
- foreach($line_map as $m){
312
- $mapEncoded = $this->encoder->encode($m['generated_column'] - $lastGeneratedColumn);
313
- $lastGeneratedColumn = $m['generated_column'];
314
-
315
- // find the index
316
- if( $m['source_file'] ){
317
- $index = $this->findFileIndex($m['source_file']);
318
- if( $index !== false ){
319
- $mapEncoded .= $this->encoder->encode($index - $lastOriginalIndex);
320
- $lastOriginalIndex = $index;
321
-
322
- // lines are stored 0-based in SourceMap spec version 3
323
- $mapEncoded .= $this->encoder->encode($m['original_line'] - 1 - $lastOriginalLine);
324
- $lastOriginalLine = $m['original_line'] - 1;
325
-
326
- $mapEncoded .= $this->encoder->encode($m['original_column'] - $lastOriginalColumn);
327
- $lastOriginalColumn = $m['original_column'];
328
- }
329
- }
330
-
331
- $lineMapEncoded[] = $mapEncoded;
332
- }
333
-
334
- $groupedMapEncoded[] = implode(',', $lineMapEncoded) . ';';
335
- }
336
-
337
- return rtrim(implode($groupedMapEncoded), ';');
338
- }
339
-
340
- /**
341
- * Finds the index for the filename
342
- *
343
- * @param string $filename
344
- * @return integer|false
345
- */
346
- protected function findFileIndex($filename){
347
- return $this->source_keys[$filename];
348
- }
349
-
350
- /**
351
- * fix windows paths
352
- * @param string $path
353
- * @return string
354
- */
355
- public function fixWindowsPath($path, $addEndSlash = false){
356
- $slash = ($addEndSlash) ? '/' : '';
357
- if( !empty($path) ){
358
- $path = str_replace('\\', '/', $path);
359
- $path = rtrim($path,'/') . $slash;
360
- }
361
-
362
- return $path;
363
- }
364
-
365
}
1
+ <?php
2
+
3
+ /**
4
+ * Source map generator
5
+ *
6
+ * @package Less
7
+ * @subpackage Output
8
+ */
9
+ class Less_SourceMap_Generator extends Less_Configurable {
10
+
11
+ /**
12
+ * What version of source map does the generator generate?
13
+ */
14
+ const VERSION = 3;
15
+
16
+ /**
17
+ * Array of default options
18
+ *
19
+ * @var array
20
+ */
21
+ protected $defaultOptions = array(
22
+ // an optional source root, useful for relocating source files
23
+ // on a server or removing repeated values in the 'sources' entry.
24
+ // This value is prepended to the individual entries in the 'source' field.
25
+ 'sourceRoot' => '',
26
+
27
+ // an optional name of the generated code that this source map is associated with.
28
+ 'sourceMapFilename' => null,
29
+
30
+ // url of the map
31
+ 'sourceMapURL' => null,
32
+
33
+ // absolute path to a file to write the map to
34
+ 'sourceMapWriteTo' => null,
35
+
36
+ // output source contents?
37
+ 'outputSourceFiles' => false,
38
+
39
+ // base path for filename normalization
40
+ 'sourceMapRootpath' => '',
41
+
42
+ // base path for filename normalization
43
+ 'sourceMapBasepath' => ''
44
+ );
45
+
46
+ /**
47
+ * The base64 VLQ encoder
48
+ *
49
+ * @var Less_SourceMap_Base64VLQ
50
+ */
51
+ protected $encoder;
52
+
53
+ /**
54
+ * Array of mappings
55
+ *
56
+ * @var array
57
+ */
58
+ protected $mappings = array();
59
+
60
+ /**
61
+ * The root node
62
+ *
63
+ * @var Less_Tree_Ruleset
64
+ */
65
+ protected $root;
66
+
67
+ /**
68
+ * Array of contents map
69
+ *
70
+ * @var array
71
+ */
72
+ protected $contentsMap = array();
73
+
74
+ /**
75
+ * File to content map
76
+ *
77
+ * @var array
78
+ */
79
+ protected $sources = array();
80
+ protected $source_keys = array();
81
+
82
+ /**
83
+ * Constructor
84
+ *
85
+ * @param Less_Tree_Ruleset $root The root node
86
+ * @param array $options Array of options
87
+ */
88
+ public function __construct(Less_Tree_Ruleset $root, $contentsMap, $options = array()){
89
+ $this->root = $root;
90
+ $this->contentsMap = $contentsMap;
91
+ $this->encoder = new Less_SourceMap_Base64VLQ();
92
+
93
+ $this->SetOptions($options);
94
+
95
+ $this->options['sourceMapRootpath'] = $this->fixWindowsPath($this->options['sourceMapRootpath'], true);
96
+ $this->options['sourceMapBasepath'] = $this->fixWindowsPath($this->options['sourceMapBasepath'], true);
97
+ }
98
+
99
+ /**
100
+ * Generates the CSS
101
+ *
102
+ * @return string
103
+ */
104
+ public function generateCSS(){
105
+ $output = new Less_Output_Mapped($this->contentsMap, $this);
106
+
107
+ // catch the output
108
+ $this->root->genCSS($output);
109
+
110
+
111
+ $sourceMapUrl = $this->getOption('sourceMapURL');
112
+ $sourceMapFilename = $this->getOption('sourceMapFilename');
113
+ $sourceMapContent = $this->generateJson();
114
+ $sourceMapWriteTo = $this->getOption('sourceMapWriteTo');
115
+
116
+ if( !$sourceMapUrl && $sourceMapFilename ){
117
+ $sourceMapUrl = $this->normalizeFilename($sourceMapFilename);
118
+ }
119
+
120
+ // write map to a file
121
+ if( $sourceMapWriteTo ){
122
+ $this->saveMap($sourceMapWriteTo, $sourceMapContent);
123
+ }
124
+
125
+ // inline the map
126
+ if( !$sourceMapUrl ){
127
+ $sourceMapUrl = sprintf('data:application/json,%s', Less_Functions::encodeURIComponent($sourceMapContent));
128
+ }
129
+
130
+ if( $sourceMapUrl ){
131
+ $output->add( sprintf('/*# sourceMappingURL=%s */', $sourceMapUrl) );
132
+ }
133
+
134
+ return $output->toString();
135
+ }
136
+
137
+ /**
138
+ * Saves the source map to a file
139
+ *
140
+ * @param string $file The absolute path to a file
141
+ * @param string $content The content to write
142
+ * @throws Exception If the file could not be saved
143
+ */
144
+ protected function saveMap($file, $content){
145
+ $dir = dirname($file);
146
+ // directory does not exist
147
+ if( !is_dir($dir) ){
148
+ // FIXME: create the dir automatically?
149
+ throw new Exception(sprintf('The directory "%s" does not exist. Cannot save the source map.', $dir));
150
+ }
151
+ // FIXME: proper saving, with dir write check!
152
+ if(file_put_contents($file, $content) === false){
153
+ throw new Exception(sprintf('Cannot save the source map to "%s"', $file));
154
+ }
155
+ return true;
156
+ }
157
+
158
+ /**
159
+ * Normalizes the filename
160
+ *
161
+ * @param string $filename
162
+ * @return string
163
+ */
164
+ protected function normalizeFilename($filename){
165
+
166
+ $filename = $this->fixWindowsPath($filename);
167
+
168
+ $rootpath = $this->getOption('sourceMapRootpath');
169
+ $basePath = $this->getOption('sourceMapBasepath');
170
+
171
+ // "Trim" the 'sourceMapBasepath' from the output filename.
172
+ if (strpos($filename, $basePath) === 0) {
173
+ $filename = substr($filename, strlen($basePath));
174
+ }
175
+
176
+ // Remove extra leading path separators.
177
+ if(strpos($filename, '\\') === 0 || strpos($filename, '/') === 0){
178
+ $filename = substr($filename, 1);
179
+ }
180
+
181
+ return $rootpath . $filename;
182
+ }
183
+
184
+ /**
185
+ * Adds a mapping
186
+ *
187
+ * @param integer $generatedLine The line number in generated file
188
+ * @param integer $generatedColumn The column number in generated file
189
+ * @param integer $originalLine The line number in original file
190
+ * @param integer $originalColumn The column number in original file
191
+ * @param string $sourceFile The original source file
192
+ */
193
+ public function addMapping($generatedLine, $generatedColumn, $originalLine, $originalColumn, $fileInfo ){
194
+
195
+ $this->mappings[] = array(
196
+ 'generated_line' => $generatedLine,
197
+ 'generated_column' => $generatedColumn,
198
+ 'original_line' => $originalLine,
199
+ 'original_column' => $originalColumn,
200
+ 'source_file' => $fileInfo['currentUri']
201
+ );
202
+
203
+ $this->sources[$fileInfo['currentUri']] = $fileInfo['filename'];
204
+ }
205
+
206
+
207
+ /**
208
+ * Generates the JSON source map
209
+ *
210
+ * @return string
211
+ * @see https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#
212
+ */
213
+ protected function generateJson(){
214
+
215
+ $sourceMap = array();
216
+ $mappings = $this->generateMappings();
217
+
218
+ // File version (always the first entry in the object) and must be a positive integer.
219
+ $sourceMap['version'] = self::VERSION;
220
+
221
+
222
+ // An optional name of the generated code that this source map is associated with.
223
+ $file = $this->getOption('sourceMapFilename');
224
+ if( $file ){
225
+ $sourceMap['file'] = $file;
226
+ }
227
+
228
+
229
+ // An optional source root, useful for relocating source files on a server or removing repeated values in the 'sources' entry. This value is prepended to the individual entries in the 'source' field.
230
+ $root = $this->getOption('sourceRoot');
231
+ if( $root ){
232
+ $sourceMap['sourceRoot'] = $root;
233
+ }
234
+
235
+
236
+ // A list of original sources used by the 'mappings' entry.
237
+ $sourceMap['sources'] = array();
238
+ foreach($this->sources as $source_uri => $source_filename){
239
+ $sourceMap['sources'][] = $this->normalizeFilename($source_filename);
240
+ }
241
+
242
+
243
+ // A list of symbol names used by the 'mappings' entry.
244
+ $sourceMap['names'] = array();
245
+
246
+ // A string with the encoded mapping data.
247
+ $sourceMap['mappings'] = $mappings;
248
+
249
+ if( $this->getOption('outputSourceFiles') ){
250
+ // An optional list of source content, useful when the 'source' can't be hosted.
251
+ // The contents are listed in the same order as the sources above.
252
+ // 'null' may be used if some original sources should be retrieved by name.
253
+ $sourceMap['sourcesContent'] = $this->getSourcesContent();
254
+ }
255
+
256
+ // less.js compat fixes
257
+ if( count($sourceMap['sources']) && empty($sourceMap['sourceRoot']) ){
258
+ unset($sourceMap['sourceRoot']);
259
+ }
260
+
261
+ return json_encode($sourceMap);
262
+ }
263
+
264
+ /**
265
+ * Returns the sources contents
266
+ *
267
+ * @return array|null
268
+ */
269
+ protected function getSourcesContent(){
270
+ if(empty($this->sources)){
271
+ return;
272
+ }
273
+ $content = array();
274
+ foreach($this->sources as $sourceFile){
275
+ $content[] = file_get_contents($sourceFile);
276
+ }
277
+ return $content;
278
+ }
279
+
280
+ /**
281
+ * Generates the mappings string
282
+ *
283
+ * @return string
284
+ */
285
+ public function generateMappings(){
286
+
287
+ if( !count($this->mappings) ){
288
+ return '';
289
+ }
290
+
291
+ $this->source_keys = array_flip(array_keys($this->sources));
292
+
293
+
294
+ // group mappings by generated line number.
295
+ $groupedMap = $groupedMapEncoded = array();
296
+ foreach($this->mappings as $m){
297
+ $groupedMap[$m['generated_line']][] = $m;
298
+ }
299
+ ksort($groupedMap);
300
+
301
+ $lastGeneratedLine = $lastOriginalIndex = $lastOriginalLine = $lastOriginalColumn = 0;
302
+
303
+ foreach($groupedMap as $lineNumber => $line_map){
304
+ while(++$lastGeneratedLine < $lineNumber){
305
+ $groupedMapEncoded[] = ';';
306
+ }
307
+
308
+ $lineMapEncoded = array();
309
+ $lastGeneratedColumn = 0;
310
+
311
+ foreach($line_map as $m){
312
+ $mapEncoded = $this->encoder->encode($m['generated_column'] - $lastGeneratedColumn);
313
+ $lastGeneratedColumn = $m['generated_column'];
314
+
315
+ // find the index
316
+ if( $m['source_file'] ){
317
+ $index = $this->findFileIndex($m['source_file']);
318
+ if( $index !== false ){
319
+ $mapEncoded .= $this->encoder->encode($index - $lastOriginalIndex);
320
+ $lastOriginalIndex = $index;
321
+
322
+ // lines are stored 0-based in SourceMap spec version 3
323
+ $mapEncoded .= $this->encoder->encode($m['original_line'] - 1 - $lastOriginalLine);
324
+ $lastOriginalLine = $m['original_line'] - 1;
325
+
326
+ $mapEncoded .= $this->encoder->encode($m['original_column'] - $lastOriginalColumn);
327
+ $lastOriginalColumn = $m['original_column'];
328
+ }
329
+ }
330
+
331
+ $lineMapEncoded[] = $mapEncoded;
332
+ }
333
+
334
+ $groupedMapEncoded[] = implode(',', $lineMapEncoded) . ';';
335
+ }
336
+
337
+ return rtrim(implode($groupedMapEncoded), ';');
338
+ }
339
+
340
+ /**
341
+ * Finds the index for the filename
342
+ *
343
+ * @param string $filename
344
+ * @return integer|false
345
+ */
346
+ protected function findFileIndex($filename){
347
+ return $this->source_keys[$filename];
348
+ }
349
+
350
+ /**
351
+ * fix windows paths
352
+ * @param string $path
353
+ * @return string
354
+ */
355
+ public function fixWindowsPath($path, $addEndSlash = false){
356
+ $slash = ($addEndSlash) ? '/' : '';
357
+ if( !empty($path) ){
358
+ $path = str_replace('\\', '/', $path);
359
+ $path = rtrim($path,'/') . $slash;
360
+ }
361
+
362
+ return $path;
363
+ }
364
+
365
}
base/inc/lib/Less/Tree/Dimension.php CHANGED
@@ -166,7 +166,6 @@ class Less_Tree_Dimension extends Less_Tree{
166
if( isset(Less_Tree_UnitConversions::$angle[$conversions]) ){
167
$derivedConversions = array( 'angle' => $conversions );
168
}
169
-
170
$conversions = $derivedConversions;
171
}
172
166
if( isset(Less_Tree_UnitConversions::$angle[$conversions]) ){
167
$derivedConversions = array( 'angle' => $conversions );
168
}
169
$conversions = $derivedConversions;
170
}
171
base/inc/post-selector.php CHANGED
@@ -87,11 +87,6 @@ function siteorigin_widget_post_selector_process_query( $query ){
87
unset( $query['sticky'] );
88
}
89
90
- // Exclude the current post (if applicable) to avoid any issues associated with showing the same post again
91
- if( is_singular() && get_the_id() != false ){
92
- $query['post__not_in'][] = get_the_id();
93
- }
94
-
95
if ( ! empty( $query['additional'] ) ) {
96
$query = wp_parse_args( $query['additional'], $query );
97
unset( $query['additional'] );
87
unset( $query['sticky'] );
88
}
89
90
if ( ! empty( $query['additional'] ) ) {
91
$query = wp_parse_args( $query['additional'], $query );
92
unset( $query['additional'] );
base/inc/routes/siteorigin-widgets-resource.class.php CHANGED
@@ -4,12 +4,12 @@
4
*/
5
6
class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
7
-
8
public function register_routes() {
9
$version = '1';
10
$namespace = 'sowb/v' . $version;
11
$resource = 'widgets';
12
-
13
$subresource = 'forms';
14
register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
15
'methods' => WP_REST_Server::CREATABLE,
@@ -24,7 +24,7 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
24
),
25
'permission_callback' => array( $this, 'permissions_check' ),
26
) );
27
-
28
$subresource = 'previews';
29
register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
30
'methods' => WP_REST_Server::CREATABLE,
@@ -40,14 +40,14 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
40
'permission_callback' => array( $this, 'permissions_check' ),
41
) );
42
}
43
-
44
/**
45
*
46
* @param WP_REST_Request $request Request.
47
* @return true|WP_Error True if the request has read access, WP_Error object otherwise.
48
*/
49
public function permissions_check( $request ) {
50
-
51
if ( ! current_user_can( 'edit_posts' ) ) {
52
$status_code = rest_authorization_required_code();
53
return new WP_Error(
@@ -58,10 +58,10 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
58
)
59
);
60
}
61
-
62
return true;
63
}
64
-
65
/**
66
* Validate passed in widgetClass arg only contains alphanumeric and underscores.
67
*
@@ -74,7 +74,7 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
74
function validate_widget_class( $param, $request, $key ) {
75
return preg_match( '/\w+/', $param ) == 1;
76
}
77
-
78
/**
79
* Get the collection of widgets.
80
*
@@ -85,12 +85,14 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
85
public function get_widget_form( $request ) {
86
$widget_class = $request['widgetClass'];
87
$widget_data = empty( $request['widgetData'] ) ? array() : $request['widgetData'];
88
-
89
/* @var $widget SiteOrigin_Widget */
90
$widget = SiteOrigin_Widgets_Widget_Manager::get_widget_instance( $widget_class );
91
-
92
if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
93
- $widget_data = $widget->update( $widget_data, $widget_data );
94
ob_start();
95
$widget->form( $widget_data );
96
$widget_form = ob_get_clean();
@@ -103,10 +105,10 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
103
)
104
);
105
}
106
-
107
return rest_ensure_response( $widget_form );
108
}
109
-
110
/**
111
* For now widget data is validated in the below `get_widget_preview` function.
112
* Leaving this here for possible later implementation.
@@ -120,7 +122,7 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
120
function validate_widget_data( $param, $request, $key ) {
121
return true;
122
}
123
-
124
/**
125
* Get the collection of widgets.
126
*
@@ -131,15 +133,16 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
131
public function get_widget_preview( $request ) {
132
$widget_class = $request['widgetClass'];
133
$widget_data = $request['widgetData'];
134
-
135
$widget = SiteOrigin_Widgets_Widget_Manager::get_widget_instance( $widget_class );
136
// This ensures styles are added inline.
137
add_filter( 'siteorigin_widgets_is_preview', '__return_true' );
138
-
139
$valid_widget_class = ! empty( $widget ) &&
140
is_object( $widget ) &&
141
is_subclass_of( $widget, 'SiteOrigin_Widget' );
142
-
143
if ( $valid_widget_class && ! empty( $widget_data ) ) {
144
ob_start();
145
/* @var $widget SiteOrigin_Widget */
@@ -163,10 +166,12 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
163
'status' => 400,
164
)
165
);
166
-
167
}
168
}
169
-
170
return rest_ensure_response( $rendered_widget );
171
}
172
}
4
*/
5
6
class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
7
+
8
public function register_routes() {
9
$version = '1';
10
$namespace = 'sowb/v' . $version;
11
$resource = 'widgets';
12
+
13
$subresource = 'forms';
14
register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
15
'methods' => WP_REST_Server::CREATABLE,
24
),
25
'permission_callback' => array( $this, 'permissions_check' ),
26
) );
27
+
28
$subresource = 'previews';
29
register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
30
'methods' => WP_REST_Server::CREATABLE,
40
'permission_callback' => array( $this, 'permissions_check' ),
41
) );
42
}
43
+
44
/**
45
*
46
* @param WP_REST_Request $request Request.
47
* @return true|WP_Error True if the request has read access, WP_Error object otherwise.
48
*/
49
public function permissions_check( $request ) {
50
+
51
if ( ! current_user_can( 'edit_posts' ) ) {
52
$status_code = rest_authorization_required_code();
53
return new WP_Error(
58
)
59
);
60
}
61
+
62
return true;
63
}
64
+
65
/**
66
* Validate passed in widgetClass arg only contains alphanumeric and underscores.
67
*
74
function validate_widget_class( $param, $request, $key ) {
75
return preg_match( '/\w+/', $param ) == 1;
76
}
77
+
78
/**
79
* Get the collection of widgets.
80
*
85
public function get_widget_form( $request ) {
86
$widget_class = $request['widgetClass'];
87
$widget_data = empty( $request['widgetData'] ) ? array() : $request['widgetData'];
88
+
89
/* @var $widget SiteOrigin_Widget */
90
$widget = SiteOrigin_Widgets_Widget_Manager::get_widget_instance( $widget_class );
91
+
92
if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
93
+ if ( ! empty( $widget_data ) ) {
94
+ $widget_data = $widget->update( $widget_data, $widget_data );
95
+ }
96
ob_start();
97
$widget->form( $widget_data );
98
$widget_form = ob_get_clean();
105
)
106
);
107
}
108
+
109
return rest_ensure_response( $widget_form );
110
}
111
+
112
/**
113
* For now widget data is validated in the below `get_widget_preview` function.
114
* Leaving this here for possible later implementation.
122
function validate_widget_data( $param, $request, $key ) {
123
return true;
124
}
125
+
126
/**
127
* Get the collection of widgets.
128
*
133
public function get_widget_preview( $request ) {
134
$widget_class = $request['widgetClass'];
135
$widget_data = $request['widgetData'];
136
+
137
$widget = SiteOrigin_Widgets_Widget_Manager::get_widget_instance( $widget_class );
138
// This ensures styles are added inline.
139
add_filter( 'siteorigin_widgets_is_preview', '__return_true' );
140
+ $GLOBALS[ 'SO_WIDGETS_BUNDLE_PREVIEW_RENDER' ] = true;
141
+
142
$valid_widget_class = ! empty( $widget ) &&
143
is_object( $widget ) &&
144
is_subclass_of( $widget, 'SiteOrigin_Widget' );
145
+
146
if ( $valid_widget_class && ! empty( $widget_data ) ) {
147
ob_start();
148
/* @var $widget SiteOrigin_Widget */
166
'status' => 400,
167
)
168
);
169
+
170
}
171
}
172
+
173
+ unset( $GLOBALS['SO_WIDGETS_BUNDLE_PREVIEW_RENDER'] );
174
+
175
return rest_ensure_response( $rendered_widget );
176
}
177
}
base/inc/widget-manager.class.php CHANGED
@@ -81,6 +81,23 @@ class SiteOrigin_Widgets_Widget_Manager {
81
return !empty($this->registered[$id]) ? $this->registered[$id]->path : false;
82
}
83
84
/**
85
* @param $id
86
*
@@ -122,7 +139,7 @@ class SiteOrigin_Widgets_Widget_Manager {
122
}
123
return false;
124
}
125
-
126
/**
127
* Get the list of registered widgets.
128
*
@@ -131,7 +148,7 @@ class SiteOrigin_Widgets_Widget_Manager {
131
function get_registered_widgets() {
132
return $this->registered;
133
}
134
-
135
/**
136
* Get the registered widget instance by it's class name or the hash generated when it was registered.
137
*
81
return !empty($this->registered[$id]) ? $this->registered[$id]->path : false;
82
}
83
84
+ /**
85
+ * Get the filename of the widget
86
+ *
87
+ * @param $id
88
+ *
89
+ * @return string|bool
90
+ */
91
+ public function get_widget_filename( $id ) {
92
+ $path = $this->get_plugin_path( $id );
93
+ if ( ! empty( $path ) ) {
94
+ $info = pathinfo( $path );
95
+
96
+ return $info['filename'];
97
+ }
98
+ return false;
99
+ }
100
+
101
/**
102
* @param $id
103
*
139
}
140
return false;
141
}
142
+
143
/**
144
* Get the list of registered widgets.
145
*
148
function get_registered_widgets() {
149
return $this->registered;
150
}
151
+
152
/**
153
* Get the registered widget instance by it's class name or the hash generated when it was registered.
154
*
base/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- var sowbForms=window.sowbForms||{};!function(C){C.fn.sowSetupForm=function(){return C(this).each(function(e,i){var o,t=C(i),y=!0,r=C("body"),n=t.find("input[name]");if(n.length&&-1!==n.attr("name").indexOf("__i__"))return this;if(t.is(".siteorigin-widget-form-main")){if(!0===t.data("sow-form-setup"))return!0;if(r.hasClass("widgets-php")&&!t.is(":visible")&&0===t.closest(".panel-dialog").length)return!0;t.on("sowstatechange",function(e,h,b){t.find("[data-state-handler]").each(function(){var e,i,t,r,n,a,s=C(this),o=C.extend({},s.data("state-handler"),y?s.data("state-handler-initial"):{});if(0===Object.keys(o).length)return!0;var d={},l=sowbForms.getContainerFieldId(s,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==l){var g={};for(var f in o)g[f.replace("{$repeater}",l)]=o[f];o=g}var c=sowbForms.getContainerFieldId(s,"widget",".siteorigin-widget-widget");if(!1!==c){var p={};for(var u in o){var w=u.match(/_else\[(.*)\]|(.*)\[(.*)\]/);p[w&&w.length&&void 0===w[1]?w[2]+"_"+c+"["+w[3]+"]":"_else["+w[1]+"_"+c+"]"]=o[u]}o=p}for(var m in o)if(n=!1,null!==(e=m.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?#x2F;))){if(i={group:"default",name:"",multi:!1},void 0!==e[2]?(i.group=e[1],i.name=e[3]):i.name=e[0],i.multi=void 0!==e[4],"_else"===i.group)i.group=i.name,i.name="",n=i.group===h&&void 0===d[i.group];else{a=i.name.split(",").map(function(e){return e.trim()});for(var v=0;v<a.length&&!(n=i.group===h&&a[v]===b);v++);}if(n){t=o[m],i.multi||(t=[t]);for(v=0;v<t.length;v++){if((r=void 0!==t[v][1]&&Boolean(t[v][1])?s.find(t[v][1]):s)[t[v][0]].apply(r,void 0!==t[v][2]?t[v][2]:[]),r.is(".siteorigin-widget-field:visible"))if(r.is(".siteorigin-widget-field-type-section"))r.find("> .siteorigin-widget-section > .siteorigin-widget-field").trigger("sowsetupformfield");else r.trigger("sowsetupformfield")}d[i.group]=!0}}})}),t.sowSetupPreview();var a=(o=t).find(".siteorigin-widget-teaser");if(a.find(".dashicons-dismiss").click(function(){var e=C(this);C.get(e.data("dismiss-url")),a.slideUp("normal",function(){a.remove()})}),!t.data("backupDisabled")){var s=t.find("> .siteorigin-widgets-form-id").val(),d=t.find("> .siteorigin-widgets-form-timestamp"),l=parseInt(d.val()||0),g=JSON.parse(sessionStorage.getItem(s));g&&(g._sow_form_timestamp>l?sowbForms.displayNotice(t,soWidgets.backup.newerVersion,soWidgets.backup.replaceWarning,[{label:soWidgets.backup.restore,callback:function(e){sowbForms.setWidgetFormValues(o,g),e.slideUp("fast",function(){e.remove()})}},{label:soWidgets.backup.dismiss,callback:function(e){e.slideUp("fast",function(){sessionStorage.removeItem(s),e.remove()})}}]):sessionStorage.removeItem(s)),t.change(function(){d.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(t);sessionStorage.setItem(s,JSON.stringify(e))})}}else o=t.closest(".siteorigin-widget-form-main");o.find("> .siteorigin-widgets-form-id").val();var f=t.find("> .siteorigin-widget-field");f.find("> .siteorigin-widget-section").sowSetupForm();var c=f.find("> .siteorigin-widget-widget");c.find("> .siteorigin-widget-section").sowSetupForm(),c.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),f.find(".siteorigin-widget-input").each(function(e,i){null===C(i).data("original-name")&&C(i).data("original-name",C(i).attr("name"))}),f.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),t.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),f.find("> .siteorigin-widget-input-color").each(function(){var e=C(this),i={change:function(e,i){setTimeout(function(){C(e.target).trigger("change")},100)}};e.data("defaultColor")&&(i.defaultColor=e.data("defaultColor")),e.wpColorPicker(i)});function p(){C(this).toggleClass("siteorigin-widget-section-visible"),C(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",function(){C(window).resize(),C(this).find("> .siteorigin-widget-field-container-state").val(C(this).is(":visible")?"open":"closed"),C(this).is(":visible")&&C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})}f.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(p),f.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(p),f.filter(".siteorigin-widget-field-type-slider").each(function(){var t=C(this),r=t.find('input[type="number"]'),n=t.find(".siteorigin-widget-value-slider");n.slider({max:parseFloat(r.attr("max")),min:parseFloat(r.attr("min")),step:parseFloat(r.attr("step")),value:parseFloat(r.val()),slide:function(e,i){r.val(parseFloat(i.value)),r.trigger("change"),t.find(".siteorigin-widget-slider-value").html(i.value)}}),r.change(function(e,i){i&&i.silent||n.slider("value",parseFloat(r.val()))})}),f.filter(".siteorigin-widget-field-type-link").each(function(){function t(){var e=n.find(".content-text-search"),i=e.val(),t=e.data("postTypes"),r=n.find("ul.posts").empty().addClass("loading");C.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:i,postTypes:t},function(e){for(var i=0;i<e.length;i++)""===e[i].label&&(e[i].label="&nbsp;"),r.append(C("<li>").addClass("post").html(e[i].label+"<span>("+e[i].type+")</span>").data(e[i]));r.removeClass("loading")})}var n=C(this);n.find(".select-content-button, .button-close").click(function(e){e.preventDefault(),C(this).blur();var i=n.find(".existing-content-selector");i.toggle(),i.is(":visible")&&0===i.find("ul.posts li").length&&t()}),n.on("click",".posts li",function(e){e.preventDefault();var i=C(this);n.find("input.siteorigin-widget-input").val("post: "+i.data("value")),n.change(),n.find(".existing-content-selector").toggle()});var e=null;n.find(".content-text-search").keyup(function(){null!==e&&clearTimeout(e),e=setTimeout(function(){t()},500)})}),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&f.filter(".siteorigin-widget-field-type-builder").each(function(){C(this).find("> .siteorigin-page-builder-field").each(function(){var e=C(this);e.soPanelsSetupBuilderWidget({builderType:e.data("type")})})});function u(){var a=C(this),e=a.closest("[data-state-emitter]").data("state-emitter");if(void 0!==e){function i(i,e){if(void 0===sowEmitters[i.callback]||"_"===i.callback.substr(0,1))return e;if(a.is('[type="radio"]')&&!a.is(":checked"))return e;var t=sowbForms.getContainerFieldId(a,"repeater",".siteorigin-widget-field-repeater-item");!1!==t&&(i.args=i.args.map(function(e){return e.replace("{$repeater}",t)}));var r=sowbForms.getContainerFieldId(a,"widget",".siteorigin-widget-widget");!1===r||i.hasOwnProperty("widgetFieldId")||(i.widgetFieldId=r,i.args=i.args.map(function(e){return e="conditional"===i.callback?e.replace(/(.*)(\[.*)/,"$1_"+r+"$2"):e+"_"+r}));var n=a.is('[type="checkbox"]')?a.is(":checked"):a.val();return C.extend(e,sowEmitters[i.callback](n,i.args))}var t={default:""};void 0===e.length&&(e=[e]);for(var r=0;r<e.length;r++)t=i(e[r],t);var n=o.data("states");for(var s in void 0===n&&(n={default:""}),t)void 0!==n[s]&&t[s]===n[s]||(n[s]=t[s],o.trigger("sowstatechange",[s,t[s]]));o.data("states",n)}}f.filter("[data-state-emitter]").each(function(){var e=C(this).find(".siteorigin-widget-input");e.on("keyup change",u),e.each(function(){var e=C(this);e.is(":radio")?e.is(":checked")&&u.call(e[0]):u.call(e[0])})}),t.trigger("sowsetupform",f).data("sow-form-setup",!0),f.trigger("sowsetupformfield"),t.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(r.hasClass("wp-customizer")||r.hasClass("widgets-php"))&&t.closest(".ui-sortable").on("sortstop",function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),y=!1})},C.fn.sowSetupPreview=function(){var r=C(this);r.siblings(".siteorigin-widget-preview").find("> a").click(function(e){e.preventDefault();var i=sowbForms.getWidgetFormValues(r),t=C(C("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");t.find('input[name="data"]').val(JSON.stringify(i)),t.find('input[name="class"]').val(r.data("class")),t.find("iframe").on("load",function(){C(this).css("visibility","visible")}),t.find("form").submit(),t.find(".close").click(function(){t.remove()})})},C.fn.sowSetupRepeater=function(){return C(this).each(function(e,i){var n=C(i),t=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");t.bind("updateFieldPositions",function(){var e=C(this),i=e.find("> .siteorigin-widget-field-repeater-item");i.each(function(r,e){C(e).find(".siteorigin-widget-input").each(function(e,i){var t=C(i).data("repeater-positions");void 0===t&&(t={}),t[a]=r,C(i).data("repeater-positions",t)})}),e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i),r=t.data("repeater-positions");if(void 0!==r){var n=t.attr("data-original-name");if(n||(t.attr("data-original-name",t.attr("name")),n=t.attr("name")),!n)return;if(r)for(var a in r)n=n.replace("#"+a+"#",r[a]);t.attr("name",n)}}),e.data("initialSetup")||(e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i);t.prop("checked",t.prop("defaultChecked"))}),e.data("initialSetup",!0));var t=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(0<t&&i.length>t){var r=i.first().outerHeight();e.css("max-height",r*t).css("overflow","auto")}else e.css("max-height","").css("overflow","")}),t.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){t.find('input[type="radio"].siteorigin-widget-input').attr("name",""),t.trigger("updateFieldPositions"),n.trigger("change")},sortstop:function(e,i){i.item.is(".siteorigin-widget-field-repeater-item")?i.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}):i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");n.trigger("change")}}),t.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){C(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){C(window).resize()})})})},C.fn.sowAddRepeaterItem=function(){return C(this).each(function(e,i){var t=C(i),r=t.find("> .siteorigin-widget-field-repeater-items").children().length+1,n=C("<div>"+t.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");n.find(".siteorigin-widget-input[data-name]").each(function(){var e=C(this);0===e.closest(".siteorigin-widget-field-repeater-item-html").length&&e.attr("name",C(this).data("name"))});var a="";n.find("> .siteorigin-widget-field").each(function(e,i){var t=i.outerHTML;C(i).is(".siteorigin-widget-field-type-repeater")||(t=t.replace(/_id_/g,r)),a+=t});var s=void 0!==t.attr("readonly"),o=C('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(C('<div class="siteorigin-widget-field-repeater-item-top" />').append(C('<div class="siteorigin-widget-field-expand" />')).append(s?"":C('<div class="siteorigin-widget-field-copy" />')).append(s?"":C('<div class="siteorigin-widget-field-remove" />')).append(C("<h4 />").html(t.data("item-name")))).append(C('<div class="siteorigin-widget-field-repeater-item-form" />').html(a));t.find("> .siteorigin-widget-field-repeater-items").append(o).sortable("refresh").trigger("updateFieldPositions"),o.sowSetupRepeaterItems(),o.hide().slideDown("fast",function(){C(window).resize()}),t.trigger("change")})},C.fn.sowRemoveRepeaterItem=function(){return C(this).each(function(e,i){var t=C(this).closest(".siteorigin-widget-field-repeater-items");C(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(i).trigger("change")})},C.fn.sowSetupRepeaterItems=function(){return C(this).each(function(e,i){var _=C(i);if(void 0===_.data("sowrepeater-actions-setup")){var a=_.closest(".siteorigin-widget-field-repeater"),t=_.find("> .siteorigin-widget-field-repeater-item-top"),r=a.data("item-label");if(r&&r.selector){function n(){var e=r.hasOwnProperty("valueMethod")&&r.valueMethod?r.valueMethod:"val",i=_.find(r.selector)[e]();i&&(80<i.length&&(i=i.substr(0,79)+"..."),t.find("h4").text(i))}n();var s=r.hasOwnProperty("updateEvent")&&r.updateEvent?r.updateEvent:"change";_.bind(s,n)}t.click(function(e){"siteorigin-widget-field-remove"!==e.target.className&&"siteorigin-widget-field-copy"!==e.target.className&&(e.preventDefault(),C(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){C(window).resize(),C(this).is(":visible")?(C(this).trigger("slideToggleOpenComplete"),C(this).find(".siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field,> .siteorigin-widget-field").each(function(e,i){var t=C(i);t.is(":visible")&&t.trigger("sowsetupformfield")})):C(this).trigger("slideToggleCloseComplete")}))}),t.find(".siteorigin-widget-field-remove").click(function(e,i){e.preventDefault();function t(){n.remove(),r.sortable("refresh").trigger("updateFieldPositions"),C(window).resize(),a.trigger("change")}var r=C(this).closest(".siteorigin-widget-field-repeater-items"),n=C(this).closest(".siteorigin-widget-field-repeater-item");i&&i.silent?t():confirm(soWidgets.sure)&&n.slideUp("fast",t)}),t.find(".siteorigin-widget-field-copy").click(function(e){e.preventDefault();var h=C(this).closest(".siteorigin-widget-form-main"),b=C(this).closest(".siteorigin-widget-field-repeater-item"),y=b.clone(),i=b.closest(".siteorigin-widget-field-repeater-items"),F=i.children().length,k={};y.find("*[name]").each(function(){var e=C(this),i=e.attr("id"),t=e.attr("name");if(e.is("textarea")&&e.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){e.parent().empty().append(e),e.css("display","");var r=tinymce.get(i);r&&e.val(r.getContent())}else if(e.is(".wp-color-picker")){var n=e.closest(".wp-picker-container"),a=e.closest(".siteorigin-widget-field");n.remove(),a.append(e.remove())}else{var s=i?b.find("#"+i):b.find('[name="'+t+'"]');s.length&&null!=s.val()&&e.val(s.val())}if(i){var o,d;if(e.is('[type="radio"]')){o=i.replace(/-\d+-\d+#x2F;,"");var l=i.replace(/-\d+#x2F;,"");if(!k[o]){var g={};k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").filter(function(e,i){var t=C(i).attr("name");return!g[t]&&(g[t]=!0)}).length+1}var f=o+"-"+k[o];d=f+i.match(/-\d+#x2F;)[0],y.find("label[for="+l+"]").attr("for",f)}else u=new RegExp("-\\d+quot;),o=i.replace(u,""),k[o]||(k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").length+1),d=o+"-"+k[o]++;if(e.attr("id",d),e.is(".wp-editor-area")){var c=e.closest(".siteorigin-widget-tinymce-container"),p=c.data("media-buttons");if(p&&p.html){var u=new RegExp(i,"g");p.html=p.html.replace(u,d),c.data("media-buttons",p)}}y.find("label[for="+i+"]").attr("for",d),y.find("[id*="+i+"]").each(function(){var e=C(this).attr("id").replace(i,d);C(this).attr("id",e)}),"undefined"!=typeof tinymce&&tinymce.get(d)&&tinymce.get(d).remove()}var w=b.parents(".siteorigin-widget-field-repeater").length,m=C("body");(m.hasClass("wp-customizer")||m.hasClass("widgets-php"))&&0===_.closest(".panel-dialog").length&&(w+=1);var v=t.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(w-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+F.toString()+"$3");e.attr("name",v),e.data("original-name",v)}),i.append(y).sortable("refresh").trigger("updateFieldPositions"),y.sowSetupRepeaterItems(),y.hide().slideDown("fast",function(){C(window).resize()}),_.trigger("change")}),_.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),_.data("sowrepeater-actions-setup",!0)}})},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?C.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,r(window.sowVars[t][i])}):r(window.sowVars[t][i])},sowbForms.getWidgetIdBase=function(e){return e.data("id-base")},sowbForms.getWidgetFormValues=function(e){if(_.isUndefined(e))return null;var l={};return e.find("*[name]").each(function(){var i=C(this);try{var e=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(e))return!0;var t=(e=e[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});var r=l,n=null,a=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===a)n=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===a){if(!i.is(":checked"))return;n=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(i.attr("id"))),n=null===s||"function"!=typeof s.getContent||s.isHidden()?i.val():s.getContent()}else if("SELECT"===i.prop("tagName")){var o=i.find("option:selected");1===o.length?n=i.find("option:selected").val():1<o.length&&(n=_.map(i.find("option:selected"),function(e,i){return C(e).val()}))}else n=i.val();for(var d=0;d<t.length;d++)d===t.length-1?""===t[d]?r.push(n):r[t[d]]=n:(_.isUndefined(r[t[d]])&&(_.isNumber(t[d+1])||""===t[d+1]?r[t[d]]=[]:r[t[d]]={}),r=r[t[d]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}}),l},sowbForms.setWidgetFormValues=function(e,d,v,l){v=v||!1,l=void 0!==l&&l||void 0===l;var i=0,h=function(e,m){10!=++i&&e.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each(function(e,i){var t=C(this),r=t.find("> .siteorigin-widget-field-repeater"),n=r.data("repeaterName"),a=m.hasOwnProperty(n)?m[n]:null;if(t.parent().is(".siteorigin-widget-section")){var s=r.data("element-name");s=s.replace(/\[#.*?#\]/g,"");for(var o=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(s)[1].split("]["),d=o.length?m:null;o.length;){var l=o.shift();d=d.hasOwnProperty(l)?d[l]:d}a=d}if(a&&Array.isArray(a)){var g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),f=a.length,c=g.length;if(c<f)for(var p=0;p<f-c;p++)r.find("> .siteorigin-widget-field-repeater-add").click();else if(!v&&f<c)for(var u=f;u<c;u++){C(g.eq(u)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var w=0;w<g.length;w++)g.eq(w).find("> .siteorigin-widget-field-repeater-item-form"),h(g.eq(w).find("> .siteorigin-widget-field-repeater-item-form"),a[w])}}),--i};h(e,d),e.find("*[name]").each(function(){var e=C(this),i=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(e.attr("name"));if(null==i)return!0;var t=(i=i[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var r,n=d,a=0;a<t.length;a++){if(!n.hasOwnProperty(t[a])){if(v)return!0;break}a===t.length-1?r=n[t[a]]:n=n[t[a]]}if("checkbox"===e.attr("type"))e.prop("checked",r);else if("radio"===e.attr("type"))e.prop("checked",r===e.val());else if("TEXTAREA"===e.prop("tagName")&&e.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(e.attr("id"))),null!==s&&"function"==typeof s.setContent&&!s.isHidden()&&e.parent().is(":visible")?s.initialized?s.setContent(r):s.on("init",function(){s.setContent(r)}):e.val(r)}else if(e.is(".panels-data")){e.val(r);var o=e.data("builder");o&&o.setDataField(e)}else e.val(r);l&&(e.trigger("change"),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})))})},sowbForms.displayNotice=function(e,i,t,r,n){var a=C('<div class="siteorigin-widget-form-notification"></div>');i&&a.append("<span>"+i+"</span>"),r&&r.length&&r.forEach(function(e){var i="";e.classes&&e.classes.length&&(i=" "+e.classes.join(" "));var t=C('<a class="button button-small'+i+'">'+e.label+"</a>");e.url&&t.attr("href",e.url),e.callback&&t.on("click",function(){e.callback(a)}),a.append(t)}),t&&a.append("<div><small>"+t+"</small></div>"),n?n.before(a):e.prepend(a)},C(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var e=C(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){e.sowSetupForm()},200)});var e=C("body");e.hasClass("wp-customizer")&&C(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e.hasClass("block-editor-page")&&C(document).on("panels_setup_preview",function(){window.hasOwnProperty("sowb")&&C(sowb).trigger("setup_widgets",{preview:!0})}),C(document).on("open_dialog",function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),C(function(){C(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *quot;).exec(e);if(null===t)return!1;var r="",n="default";return r=void 0!==t[3]?(n=t[1],t[3]):t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"!==n.match&&!r(e,i,n.match)||(a[n.group]=n.state));return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},in:function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return-1!==t.split(",").map(function(e){return e.trim()}).indexOf(e)})}};window.sowbForms=sowbForms;
1
+ var sowbForms=window.sowbForms||{};!function(e){e.fn.sowSetupForm=function(){return e(this).each((function(i,t){var r,n=e(t),a=!0,s=e("body"),o=n.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(n.is(".siteorigin-widget-form-main")){if(!0===n.data("sow-form-setup"))return!0;if(s.hasClass("widgets-php")&&!n.is(":visible")&&0===n.closest(".panel-dialog").length)return!0;n.on("sowstatechange",(function(i,t,r){n.find("[data-state-handler]").each((function(){var i,n,s,o,d,l,g=e(this),f=e.extend({},g.data("state-handler"),a?g.data("state-handler-initial"):{});if(0===Object.keys(f).length)return!0;var c={},p=sowbForms.getContainerFieldId(g,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==p){var u={};for(var w in f)u[w.replace("{$repeater}",p)]=f[w];f=u}var m=sowbForms.getContainerFieldId(g,"widget",".siteorigin-widget-widget");if(!1!==m){var v={};for(var h in f){var b=h.match(/_else\[(.*)\]|(.*)\[(.*)\]/);v[b&&b.length&&void 0===b[1]?b[2]+"_"+m+"["+b[3]+"]":"_else["+b[1]+"_"+m+"]"]=f[h]}f=v}for(var y in f)if(d=!1,null!==(i=y.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?#x2F;))){if(n={group:"default",name:"",multi:!1},void 0!==i[2]?(n.group=i[1],n.name=i[3]):n.name=i[0],n.multi=void 0!==i[4],"_else"===n.group)n.group=n.name,n.name="",d=n.group===t&&void 0===c[n.group];else{l=n.name.split(",").map((function(e){return e.trim()}));for(var F=0;F<l.length&&!(d=n.group===t&&l[F]===r);F++);}if(d){s=f[y],n.multi||(s=[s]);for(F=0;F<s.length;F++){if((o=void 0!==s[F][1]&&Boolean(s[F][1])?g.find(s[F][1]):g)[s[F][0]].apply(o,void 0!==s[F][2]?s[F][2]:[]),o.is(".siteorigin-widget-field:visible"))if(o.is(".siteorigin-widget-field-type-section"))o.find("> .siteorigin-widget-section > .siteorigin-widget-field").trigger("sowsetupformfield");else o.trigger("sowsetupformfield")}c[n.group]=!0}}}))})),n.sowSetupPreview(),r=n;var d=n.find(".siteorigin-widget-teaser");if(d.find(".dashicons-dismiss").click((function(){var i=e(this);e.get(i.data("dismiss-url")),d.slideUp("normal",(function(){d.remove()}))})),!n.data("backupDisabled")){var l=n.find("> .siteorigin-widgets-form-id").val(),g=n.find("> .siteorigin-widgets-form-timestamp"),f=parseInt(g.val()||0),c=JSON.parse(sessionStorage.getItem(l));c&&(c._sow_form_timestamp>f?sowbForms.displayNotice(n,soWidgets.backup.newerVersion,soWidgets.backup.replaceWarning,[{label:soWidgets.backup.restore,callback:function(e){sowbForms.setWidgetFormValues(r,c),e.slideUp("fast",(function(){e.remove()}))}},{label:soWidgets.backup.dismiss,callback:function(e){e.slideUp("fast",(function(){sessionStorage.removeItem(l),e.remove()}))}}]):sessionStorage.removeItem(l)),n.change((function(){g.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(n);sessionStorage.setItem(l,JSON.stringify(e))}))}}else r=n.closest(".siteorigin-widget-form-main");r.find("> .siteorigin-widgets-form-id").val();var p=n.find("> .siteorigin-widget-field");p.find("> .siteorigin-widget-section").sowSetupForm();var u=p.find("> .siteorigin-widget-widget");u.find("> .siteorigin-widget-section").sowSetupForm(),u.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),p.find(".siteorigin-widget-input").each((function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))})),p.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),n.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),p.find("> .siteorigin-widget-input-color").each((function(){var i=e(this),t={change:function(i,t){setTimeout((function(){e(i.target).trigger("change")}),100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)}));var w=function(){e(this).toggleClass("siteorigin-widget-section-visible"),e(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",(function(){(e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed"),e(this).is(":visible"))&&e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}))};p.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(w),p.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(w),p.filter(".siteorigin-widget-field-type-slider").each((function(){var i=e(this),t=i.find('input[type="number"]'),r=i.find(".siteorigin-widget-value-slider");r.slider({max:parseFloat(t.attr("max")),min:parseFloat(t.attr("min")),step:parseFloat(t.attr("step")),value:parseFloat(t.val()),slide:function(e,r){t.val(parseFloat(r.value)),t.trigger("change"),i.find(".siteorigin-widget-slider-value").html(r.value)}}),t.change((function(e,i){i&&i.silent||r.slider("value",parseFloat(t.val()))}))})),p.filter(".siteorigin-widget-field-type-link").each((function(){var i=e(this),t=function(){var t=i.find(".content-text-search"),r=t.val(),n=t.data("postTypes"),a=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:r,postTypes:n},(function(i){for(var t=0;t<i.length;t++)""===i[t].label&&(i[t].label="&nbsp;"),a.append(e("<li>").addClass("post").html(i[t].label+"<span>("+i[t].type+")</span>").data(i[t]));a.removeClass("loading")}))};i.find(".select-content-button, .button-close").click((function(r){r.preventDefault(),e(this).blur();var n=i.find(".existing-content-selector");n.toggle(),n.is(":visible")&&0===n.find("ul.posts li").length&&t()})),i.on("click",".posts li",(function(t){t.preventDefault();var r=e(this);i.find("input.siteorigin-widget-input").val("post: "+r.data("value")),i.change(),i.find(".existing-content-selector").toggle()}));var r=null;i.find(".content-text-search").keyup((function(){null!==r&&clearTimeout(r),r=setTimeout((function(){t()}),500)}))})),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&p.filter(".siteorigin-widget-field-type-builder").each((function(){e(this).find("> .siteorigin-page-builder-field").each((function(){var i=e(this);i.soPanelsSetupBuilderWidget({builderType:i.data("type")})}))}));var m=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if(void 0!==t){var n=function(t,r){if(void 0===sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return r;if(i.is('[type="radio"]')&&!i.is(":checked"))return r;var n=sowbForms.getContainerFieldId(i,"repeater",".siteorigin-widget-field-repeater-item");!1!==n&&(t.args=t.args.map((function(e){return e.replace("{$repeater}",n)})));var a=sowbForms.getContainerFieldId(i,"widget",".siteorigin-widget-widget");!1===a||t.hasOwnProperty("widgetFieldId")||(t.widgetFieldId=a,t.args=t.args.map((function(e){return e="conditional"===t.callback?e.replace(/(.*)(\[.*)/,"$1_"+a+"$2"):e+"_"+a})));var s=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return e.extend(r,sowEmitters[t.callback](s,t.args))},a={default:""};void 0===t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=n(t[s],a);var o=r.data("states");for(var d in void 0===o&&(o={default:""}),a)void 0!==o[d]&&a[d]===o[d]||(o[d]=a[d],r.trigger("sowstatechange",[d,a[d]]));r.data("states",o)}};p.filter("[data-state-emitter]").each((function(){var i=e(this).find(".siteorigin-widget-input");i.on("keyup change",m),i.each((function(){var i=e(this);i.is(":radio")?i.is(":checked")&&m.call(i[0]):m.call(i[0])}))})),n.trigger("sowsetupform",p).data("sow-form-setup",!0),p.trigger("sowsetupformfield"),n.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(s.hasClass("wp-customizer")||s.hasClass("widgets-php"))&&n.closest(".ui-sortable").on("sortstop",(function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),a=!1}))},e.fn.sowSetupPreview=function(){var i=e(this);i.siblings(".siteorigin-widget-preview").find("> a").click((function(t){t.preventDefault();var r=sowbForms.getWidgetFormValues(i),n=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");n.find('input[name="data"]').val(JSON.stringify(r)),n.find('input[name="class"]').val(i.data("class")),n.find("iframe").on("load",(function(){e(this).css("visibility","visible")})),n.find("form").submit(),n.find(".close").click((function(){n.remove()}))}))},e.fn.sowSetupRepeater=function(){return e(this).each((function(i,t){var r=e(t),n=r.find(".siteorigin-widget-field-repeater-items"),a=r.data("repeater-name");n.bind("updateFieldPositions",(function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each((function(i,t){e(t).find(".siteorigin-widget-input").each((function(t,r){var n=e(r).data("repeater-positions");void 0===n&&(n={}),n[a]=i,e(r).data("repeater-positions",n)}))})),i.find(".siteorigin-widget-input").each((function(i,t){var r=e(t),n=r.data("repeater-positions");if(void 0!==n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}})),i.data("initialSetup")||(i.find(".siteorigin-widget-input").each((function(i,t){var r=e(t);r.prop("checked",r.prop("defaultChecked"))})),i.data("initialSetup",!0));var n=r.data("scroll-count")?parseInt(r.data("scroll-count")):0;if(n>0&&t.length>n){var s=t.first().outerHeight();i.css("max-height",s*n).css("overflow","auto")}else i.css("max-height","").css("overflow","")})),n.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){n.find('input[type="radio"].siteorigin-widget-input').attr("name",""),n.trigger("updateFieldPositions"),r.trigger("change")},sortstop:function(i,t){t.item.is(".siteorigin-widget-field-repeater-item")?t.item.find("> .siteorigin-widget-field-repeater-item-form").each((function(){e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})):t.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");r.trigger("change")}}),n.trigger("updateFieldPositions"),r.find("> .siteorigin-widget-field-repeater-add").disableSelection().click((function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",(function(){e(window).resize()}))})),r.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click((function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",(function(){e(window).resize()}))}))}))},e.fn.sowAddRepeaterItem=function(){return e(this).each((function(i,t){var r=e(t),n=r.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+r.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find(".siteorigin-widget-input[data-name]").each((function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))}));var s="";a.find("> .siteorigin-widget-field").each((function(i,t){var r=t.outerHTML;e(t).is(".siteorigin-widget-field-type-repeater")||(r=r.replace(/_id_/g,n)),s+=r}));var o=void 0!==r.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(r.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));r.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",(function(){e(window).resize()})),r.trigger("change")}))},e.fn.sowRemoveRepeaterItem=function(){return e(this).each((function(i,t){var r=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),r.sortable("refresh").trigger("updateFieldPositions"),e(t).trigger("change")}))},e.fn.sowSetupRepeaterItems=function(){return e(this).each((function(i,t){var r=e(t);if(void 0===r.data("sowrepeater-actions-setup")){var n=r.closest(".siteorigin-widget-field-repeater"),a=r.find("> .siteorigin-widget-field-repeater-item-top"),s=n.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=r.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),a.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";r.bind(d,o)}a.click((function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",(function(){e(window).resize(),e(this).is(":visible")?(e(this).trigger("slideToggleOpenComplete"),e(this).find(".siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field,> .siteorigin-widget-field").each((function(i,t){var r=e(t);r.is(":visible")&&r.trigger("sowsetupformfield")}))):e(this).trigger("slideToggleCloseComplete")})))})),a.find(".siteorigin-widget-field-remove").click((function(i,t){i.preventDefault();var r=e(this).closest(".siteorigin-widget-field-repeater-items"),a=e(this).closest(".siteorigin-widget-field-repeater-item"),s=function(){a.remove(),r.sortable("refresh").trigger("updateFieldPositions"),e(window).resize(),n.trigger("change")};t&&t.silent?s():confirm(soWidgets.sure)&&a.slideUp("fast",s)})),a.find(".siteorigin-widget-field-copy").click((function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),n=e(this).closest(".siteorigin-widget-field-repeater-item"),a=n.clone(),s=n.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each((function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var g=tinymce.get(s);g&&i.val(g.getContent())}else if(i.is(".wp-color-picker")){var f=i.closest(".wp-picker-container"),c=i.closest(".siteorigin-widget-field");f.remove(),c.append(i.remove())}else{var p=s?n.find("#"+s):n.find('[name="'+l+'"]');p.length&&null!=p.val()&&i.val(p.val())}if(s){var u,w;if(i.is('[type="radio"]')){u=s.replace(/-\d+-\d+#x2F;,"");var m=s.replace(/-\d+#x2F;,"");if(!d[u]){var v={};d[u]=t.find(".siteorigin-widget-input[id^="+u+"]").not("[id*=_id_]").filter((function(i,t){var r=e(t).attr("name");return!v[r]&&(v[r]=!0,!0)})).length+1}var h=u+"-"+d[u];w=h+s.match(/-\d+#x2F;)[0],a.find("label[for="+m+"]").attr("for",h)}else F=new RegExp("-\\d+quot;),u=s.replace(F,""),d[u]||(d[u]=t.find(".siteorigin-widget-input[id^="+u+"]").not("[id*=_id_]").length+1),w=u+"-"+d[u]++;if(i.attr("id",w),i.is(".wp-editor-area")){var b=i.closest(".siteorigin-widget-tinymce-container"),y=b.data("media-buttons");if(y&&y.html){var F=new RegExp(s,"g");y.html=y.html.replace(F,w),b.data("media-buttons",y)}}a.find("label[for="+s+"]").attr("for",w),a.find("[id*="+s+"]").each((function(){var i=e(this).attr("id").replace(s,w);e(this).attr("id",i)})),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var k=n.parents(".siteorigin-widget-field-repeater").length,_=e("body");(_.hasClass("wp-customizer")||_.hasClass("widgets-php"))&&0===r.closest(".panel-dialog").length&&(k+=1);var C=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(k-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",C),i.data("original-name",C)})),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",(function(){e(window).resize()})),r.trigger("change")})),r.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),r.data("sowrepeater-actions-setup",!0)}}))},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},(function(e){window.sowVars[t]=e,r(window.sowVars[t][i])})):r(window.sowVars[t][i])},sowbForms.getWidgetIdBase=function(e){return e.data("id-base")},sowbForms.getWidgetFormValues=function(i){if(_.isUndefined(i))return null;var t={};return i.find("*[name]").each((function(){var i=e(this);try{var r=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(r))return!0;var n=(r=r[1]).split("][");n=n.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));var a=t,s=null,o=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===o)s=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===o){if(!i.is(":checked"))return;s=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),s=null===d||"function"!=typeof d.getContent||d.isHidden()?i.val():d.getContent()}else if("SELECT"===i.prop("tagName")){var l=i.find("option:selected");1===l.length?s=i.find("option:selected").val():l.length>1&&(s=_.map(i.find("option:selected"),(function(i,t){return e(i).val()})))}else s=i.val();for(var g=0;g<n.length;g++)g===n.length-1?""===n[g]?a.push(s):a[n[g]]=s:(_.isUndefined(a[n[g]])&&(_.isNumber(n[g+1])||""===n[g+1]?a[n[g]]=[]:a[n[g]]={}),a=a[n[g]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}})),t},sowbForms.setWidgetFormValues=function(i,t,r,n){r=r||!1,n=void 0!==n&&n||void 0===n;var a=0,s=function(i,t){10!=++a?(i.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each((function(i,n){var a=e(this),o=a.find("> .siteorigin-widget-field-repeater"),d=o.data("repeaterName"),l=t.hasOwnProperty(d)?t[d]:null;if(a.parent().is(".siteorigin-widget-section")){var g=o.data("element-name");g=g.replace(/\[#.*?#\]/g,"");for(var f=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(g)[1].split("]["),c=f.length?t:null;f.length;){var p=f.shift();c=c.hasOwnProperty(p)?c[p]:c}l=c}if(l&&Array.isArray(l)){var u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),w=l.length,m=u.length;if(w>m)for(var v=0;v<w-m;v++)o.find("> .siteorigin-widget-field-repeater-add").click();else if(!r&&w<m)for(var h=w;h<m;h++){e(u.eq(h)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var b=0;b<u.length;b++)u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),s(u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),l[b])}})),--a):--a};s(i,t),i.find("*[name]").each((function(){var i=e(this),a=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(null==a)return!0;var s=(a=a[1]).split("][");s=s.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));for(var o,d=t,l=0;l<s.length;l++){if(!d.hasOwnProperty(s[l])){if(r)return!0;break}l===s.length-1?o=d[s[l]]:d=d[s[l]]}if("checkbox"===i.attr("type"))i.prop("checked",o);else if("radio"===i.attr("type"))i.prop("checked",o===i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var g=null;"undefined"!=typeof tinyMCE&&(g=tinyMCE.get(i.attr("id"))),null!==g&&"function"==typeof g.setContent&&!g.isHidden()&&i.parent().is(":visible")?g.initialized?g.setContent(o):g.on("init",(function(){g.setContent(o)})):i.val(o)}else if(i.is(".panels-data")){i.val(o);var f=i.data("builder");f&&f.setDataField(i)}else i.val(o);n&&(i.trigger("change"),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})))}))},sowbForms.displayNotice=function(i,t,r,n,a){var s=e('<div class="siteorigin-widget-form-notification"></div>');t&&s.append("<span>"+t+"</span>"),n&&n.length&&n.forEach((function(i){var t="";i.classes&&i.classes.length&&(t=" "+i.classes.join(" "));var r=e('<a class="button button-small'+t+'">'+i.label+"</a>");i.url&&r.attr("href",i.url),i.callback&&r.on("click",(function(){i.callback(s)})),s.append(r)})),r&&s.append("<div><small>"+r+"</small></div>"),a?a.before(s):i.prepend(s)},e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",(function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout((function(){i.sowSetupForm()}),200)}));var i=e("body");i.hasClass("wp-customizer")&&e(document).on("widget-added",(function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()})),i.hasClass("block-editor-page")&&e(document).on("panels_setup_preview",(function(){window.hasOwnProperty("sowb")&&e(sowb).trigger("setup_widgets",{preview:!0})})),e(document).on("open_dialog",(function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),e((function(){e(document).trigger("sowadminloaded")}))}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *quot;).exec(e);if(null===t)return!1;var r="",n="default";return void 0!==t[3]?(n=t[1],r=t[3]):r=t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",(function(val,args,match){return eval(match)}))},in:function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",(function(e,i,t){return-1!==t.split(",").map((function(e){return e.trim()})).indexOf(e)}))}};window.sowbForms=sowbForms;
base/js/meta-box-manager.min.js CHANGED
@@ -1 +1 @@
1
- !function(n){n("#post").on("submit",function(t){var i=n("#siteorigin-widgets-meta-box"),e=sowbForms.getWidgetFormValues(i);i.find('input[name="widget_post_meta"]').val(JSON.stringify(e))})}(jQuery);
1
+ !function(t){t("#post").on("submit",(function(i){var e=t("#siteorigin-widgets-meta-box"),n=sowbForms.getWidgetFormValues(e);e.find('input[name="widget_post_meta"]').val(JSON.stringify(n))}))}(jQuery);
base/siteorigin-widget.class.php CHANGED
@@ -237,7 +237,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
237
echo '</div>';
238
echo $args['after_widget'];
239
do_action( 'siteorigin_widgets_after_widget_' . $this->id_base, $instance, $this );
240
-
241
if ( $this->is_preview( $instance ) ) {
242
// print inline styles if we're preview the widget.
243
siteorigin_widget_print_styles();
@@ -335,10 +335,10 @@ abstract class SiteOrigin_Widget extends WP_Widget {
335
global $wp_customize;
336
return is_a( $wp_customize, 'WP_Customize_Manager' ) && $wp_customize->is_preview();
337
}
338
-
339
- private function is_block_editor_page() {
340
$current_screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
341
-
342
// This is for the Gutenberg plugin.
343
$is_gutenberg_page = $current_screen != null &&
344
function_exists( 'is_gutenberg_page' ) &&
@@ -348,7 +348,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
348
if ( ! empty( $current_screen ) && method_exists( $current_screen, 'is_block_editor' ) ) {
349
$is_block_editor = $current_screen->is_block_editor();
350
}
351
-
352
return $is_block_editor || $is_gutenberg_page;
353
}
354
@@ -749,14 +749,14 @@ abstract class SiteOrigin_Widget extends WP_Widget {
749
if ( WP_Filesystem() ) {
750
global $wp_filesystem;
751