@@ -0,0 +1,545 @@
1+var ElmCode = ElmCode || {};
2+ElmCode.Graphics = ElmCode.Graphics || {};
3+ElmCode.Graphics.Element = function() {
4+ var DLeft_0 = ["DLeft"];
5+ var DRight_1 = ["DRight"];
7+ var DDown_3 = ["DDown"];
9+ var DOut_5 = ["DOut"];
10+ function Absolute_12(a1) {
11+ return["Absolute", a1]
13+ function Relative_13(a1) {
14+ return["Relative", a1]
16+ var Near_14 = ["Near"];
17+ var Mid_15 = ["Mid"];
18+ var Far_16 = ["Far"];
19+ function Position_17(a1) {
20+ return function(a2) {
21+ return["Position", a1, a2]
24+ function PositionTL_18(a1) {
25+ return function(a2) {
26+ return["PositionTL", a1, a2]
29+ function PositionTR_19(a1) {
30+ return function(a2) {
31+ return["PositionTR", a1, a2]
34+ function PositionBL_20(a1) {
35+ return function(a2) {
36+ return["PositionBL", a1, a2]
39+ function PositionBR_21(a1) {
40+ return function(a2) {
41+ return["PositionBR", a1, a2]
44+ function Element_37(a1) {
45+ return function(a2) {
46+ return function(a3) {
47+ return function(a4) {
48+ return function(a5) {
49+ return function(a6) {
50+ return["Element", a1, a2, a3, a4, a5, a6]
57+ function EText_39(a1) {
58+ return function(a2) {
59+ return["EText", a1, a2]
62+ function EImage_40(a1) {
65+ function EVideo_41(a1) {
68+ function EFittedImage_42(a1) {
69+ return["EFittedImage", a1]
71+ function EFlow_43(a1) {
72+ return function(a2) {
73+ return["EFlow", a1, Foreign.JavaScript.castListToJSArray(a2)]
76+ function ECollage_44(a1) {
77+ return function(a2) {
78+ return function(a3) {
79+ return["ECollage", a1, a2, Value.groupForms(a3)]
83+ var EEmpty_45 = ["EEmpty"];
84+ function EContainer_46(a1) {
85+ return function(a2) {
86+ return["EContainer", a1, a2]
89+ var Solid_68 = ["Solid"];
90+ var Dotted_69 = ["Dotted"];
91+ var Dashed_70 = ["Dashed"];
92+ function Custom_71(a1) {
95+ var Filled_72 = ["Filled"];
96+ var Outlined_73 = ["Outlined"];
97+ function CustomOutline_74(a1) {
98+ return["CustomOutline", a1]
100+ function Line_75(a1) {
103+ function Shape_78(a1) {
104+ return function(a2) {
105+ return["Shape", a1, a2]
108+ function Form_84(a1) {
109+ return function(a2) {
110+ return function(a3) {
111+ return function(a4) {
112+ return["Form", a1, a2, a3, a4]
117+ function FLine_85(a1) {
118+ return function(a2) {
119+ return function(a3) {
120+ return["FLine", a1, a2, a3]
124+ function FShape_86(a1) {
125+ return function(a2) {
126+ return function(a3) {
127+ return["FShape", a1, a2, a3]
131+ function FImage_87(a1) {
132+ return function(a2) {
133+ return function(a3) {
134+ return["FImage", a1, a2, a3]
138+ function FElement_88(a1) {
139+ return["FElement", a1]
141+ var left_6 = DLeft_0;
142+ var right_7 = DRight_1;
143+ var down_8 = DDown_3;
145+ var inward_10 = DIn_4;
146+ var outward_11 = DOut_5;
147+ var topLeft_22 = Position_17(Near_14)(Near_14);
148+ var topRight_23 = Position_17(Far_16)(Near_14);
149+ var bottomLeft_24 = Position_17(Near_14)(Far_16);
150+ var bottomRight_25 = Position_17(Far_16)(Far_16);
151+ var midLeft_26 = Position_17(Mid_15)(Near_14);
152+ var midRight_27 = Position_17(Mid_15)(Far_16);
153+ var midTop_28 = Position_17(Near_14)(Mid_15);
154+ var midBottom_29 = Position_17(Far_16)(Mid_15);
155+ var middle_30 = Position_17(Mid_15)(Mid_15);
156+ var topLeftAt_31 = PositionTL_18;
157+ var topRightAt_32 = PositionTR_19;
158+ var bottomLeftAt_33 = PositionBL_20;
159+ var bottomRightAt_34 = PositionBR_21;
160+ var absolute_35 = Absolute_12;
161+ var relative_36 = Relative_13;
162+ function newElement_38(a) { return Element_37(Guid.guid())(a); }
163+ var line_76 = Line_75;
164+ var polygon_79 = Shape_78;
165+ function sprite_96(src) {
166+ return function(w) {
167+ return function(h) {
168+ return function(pos) {
169+ return Form_84(0)(1)(pos)(FImage_87(w)(h)(src))
174+ function toForm_97(pos) {
175+ return function(e) {
176+ return Form_84(0)(1)(pos)(FElement_88(e))
179+ function width_47(w__101) {
180+ return function(Element$_ewhoc_102) {
181+ return function(case7) {
185+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
186+ return function(case12) {
191+ return newElement_38(case2)(w__101)(case4 * w__101 / case3)(case5)(case6);
193+ var p = Value.getTextSize(w__101,case4,case8[2]);
194+ return newElement_38(case2)(w__101)(p[1])(case5)(case6);
196+ return newElement_38(case2)(w__101)(case4)(case5)(case6)
199+ throw"Non-exhaustive pattern match in case";
200+ }(Element$_ewhoc_102)
203+ function height_48(h__108) {
204+ return function(Element$_ewhoc_109) {
205+ return function(case7) {
209+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
210+ return function(case12) {
215+ return newElement_38(case2)(case3 * h__108 / case4)(h__108)(case5)(case6);
217+ return newElement_38(case2)(case3)(h__108)(case5)(case6)
220+ throw"Non-exhaustive pattern match in case";
221+ }(Element$_ewhoc_109)
224+ function size_49(w__115) {
225+ return function(h__116) {
226+ return function(Element$_ewhoc_117) {
227+ return function(case7) {
231+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
232+ return newElement_38(case2)(w__115)(h__116)(case5)(case6)
234+ throw"Non-exhaustive pattern match in case";
235+ }(Element$_ewhoc_117)
239+ function opacity_50(o__123) {
240+ return function(Element$_ewhoc_124) {
241+ return function(case7) {
245+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
246+ return newElement_38(case2)(case3)(case4)(o__123)(case6)
248+ throw"Non-exhaustive pattern match in case";
249+ }(Element$_ewhoc_124)
252+ function color_51(c__130) {
253+ return function(Element$_ewhoc_131) {
254+ return function(case7) {
258+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
259+ return newElement_38(case2)(case3)(case4)(case5)(Just(c__130))
261+ throw"Non-exhaustive pattern match in case";
262+ }(Element$_ewhoc_131)
265+ function widthOf_52(e) { return ~~e[3]; }
266+ function heightOf_53(e) { return ~~e[4]; }
267+ function sizeOf_54(e) { return["Tuple2", ~~e[3], ~~e[4]] }
268+ function text_56(txt) {
269+ var p = Value.getTextSize(-1,-1,txt);
270+ return newElement_38(EText_39("left")(txt))(p[0])(p[1])(1)(Nothing)
272+ function plainText(str) {
273+ var txt = Value.toText(str);
274+ var p = Value.getTextSize(-1,-1,txt);
275+ return newElement_38(EText_39("left")(txt))(p[0])(p[1])(1)(Nothing)
277+ function asText(v) {
278+ var txt = Value.show(v);
279+ var p = Value.getTextSize(-1,-1,txt);
280+ return newElement_38(EText_39("left")(txt))(p[0])(p[1])(1)(Nothing)
282+ function centeredText(txt) {
283+ var p = Value.getTextSize(-1,-1,txt);
284+ return newElement_38(EText_39("center")(txt))(p[0])(p[1])(1)(Nothing)
286+ function justifiedText(txt) {
287+ var p = Value.getTextSize(-1,-1,txt);
288+ return newElement_38(EText_39("justify")(txt))(p[0])(p[1])(1)(Nothing)
290+ function rightedText(txt) {
291+ var p = Value.getTextSize(-1,-1,txt);
292+ return newElement_38(EText_39("right")(txt))(p[0])(p[1])(1)(Nothing)
294+ function image_57(w) {
295+ return function(h) {
296+ return function(src) {
297+ return newElement_38(EImage_40(src))(w)(h)(1)(Nothing)
301+ function video_58(w) {
302+ return function(h) {
303+ return function(src) {
304+ return newElement_38(EVideo_41(src))(w)(h)(1)(Nothing)
308+ function fittedImage_59(w_147) {
309+ return function(h_148) {
310+ return function(s_149) {
311+ return newElement_38(EFittedImage_42(s_149))(w_147)(h_148)(1)(Nothing)
315+ function flow_60(dir_150) {
316+ return function(es_151) {
318+ var w_152 = function() {
319+ var ws_154 = map(widthOf_52)(es_151);
320+ return function(case1) {
328+ return maximum(ws_154)
331+ var h_153 = function() {
332+ var hs_155 = map(heightOf_53)(es_151);
333+ return function(case3) {
341+ return maximum(hs_155)
344+ return newElement_38(EFlow_43(dir_150)(es_151))(w_152)(h_153)(1)(Nothing)
348+ function above_61(e1_156) {
349+ return function(e2_157) {
350+ return newElement_38(EFlow_43(DDown_3)(["Cons", e1_156, ["Cons", e2_157, ["Nil"]]]))(max(widthOf_52(e1_156))(widthOf_52(e2_157)))(heightOf_53(e1_156) + heightOf_53(e2_157))(1)(Nothing)
353+ function below_62(e1_158) {
354+ return function(e2_159) {
355+ return newElement_38(EFlow_43(DDown_3)(["Cons", e2_159, ["Cons", e1_158, ["Nil"]]]))(max(widthOf_52(e1_158))(widthOf_52(e2_159)))(heightOf_53(e1_158) + heightOf_53(e2_159))(1)(Nothing)
358+ function beside_63(e1_160) {
359+ return function(e2_161) {
360+ return newElement_38(EFlow_43(DRight_1)(["Cons", e1_160, ["Cons", e2_161, ["Nil"]]]))(widthOf_52(e1_160) + widthOf_52(e2_161))(max(heightOf_53(e1_160))(heightOf_53(e2_161)))(1)(Nothing)
363+ function layers_64(es_162) {
364+ return newElement_38(EFlow_43(DOut_5)(es_162))(maximum(map(widthOf_52)(es_162)))(maximum(map(heightOf_53)(es_162)))(1)(Nothing)
366+ function collage_65(w_163) {
367+ return function(h_164) {
368+ return function(forms_165) {
369+ return newElement_38(ECollage_44(w_163)(h_164)(forms_165))(w_163)(h_164)(1)(Nothing)
373+ function spacer_66(w_166) {
374+ return function(h_167) {
375+ return newElement_38(EEmpty_45)(w_166)(h_167)(1)(Nothing)
378+ function container_67(pos_168) {
379+ return function(w_169) {
380+ return function(h_170) {
381+ return function(e_171) {
382+ return newElement_38(EContainer_46(pos_168)(e_171))(w_169)(h_170)(1)(Nothing)
387+ function segment_77(p1_172) {
388+ return function(p2_173) {
389+ return Line_75(["Cons", p1_172, ["Cons", p2_173, ["Nil"]]])
392+ function rect_80(w_174) {
393+ return function(h_175) {
394+ return function(pos_176) {
395+ return Shape_78(["Cons", ["Tuple2", 0 - w_174 / 2, 0 - h_175 / 2], ["Cons", ["Tuple2", 0 - w_174 / 2, h_175 / 2], ["Cons", ["Tuple2", w_174 / 2, h_175 / 2], ["Cons", ["Tuple2", w_174 / 2, 0 - h_175 / 2], ["Nil"]]]]])(pos_176)
399+ function oval_81(w_177) {
400+ return function(h_178) {
401+ return function(pos_179) {
405+ function f_181(i_182) {
406+ return["Tuple2", w_177 / 2 * cos(2 * (pi / n_180) * i_182), h_178 / 2 * sin(2 * (pi / n_180) * i_182)]
408+ return Shape_78(map(f_181)(function() {
414+ var lst = ["Cons", hi, lst]
424+ function circle_82(r_183) {
425+ return oval_81(2 * r_183)(2 * r_183)
427+ function ngon_83(n_184) {
428+ return function(r_185) {
429+ return function(pos_186) {
431+ var m_187 = toFloat(n_184);
433+ function f_188(i_189) {
434+ return["Tuple2", r_185 * cos(2 * (pi / m_187) * i_189), r_185 * sin(2 * (pi / m_187) * i_189)]
436+ return Shape_78(map(f_188)(function() {
442+ var lst = ["Cons", hi, lst]
452+ function solid_89(clr_190) {
453+ return function(ln_191) {
454+ return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Solid_68)(clr_190)(ln_191))
457+ function dotted_90(clr_192) {
458+ return function(ln_193) {
459+ return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Dotted_69)(clr_192)(ln_193))
462+ function dashed_91(clr_194) {
463+ return function(ln_195) {
464+ return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Dashed_70)(clr_194)(ln_195))
467+ function customLine_92(pattern_196) {
468+ return function(clr_197) {
469+ return function(ln_198) {
470+ return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Custom_71(pattern_196))(clr_197)(ln_198))
474+ function filled_93(clr) {
475+ return function(shape) {
476+ return Form_84(0)(1)(shape[2])(FShape_86(Filled_72)(clr)(shape));
479+ function outlined_94(clr) {
480+ return function(shape) {
481+ return Form_84(0)(1)(shape[2])(FShape_86(Outlined_73)(clr)(shape));
484+ function customOutline_95(pattern) {
485+ return function(clr) {
486+ return function(shape) {
487+ return Form_84(0)(1)(shape[2])(FShape_86(["CustomOutline",pattern])(clr)(shape));
491+ function textured(src) {
492+ return function(shape) {
493+ return Form_84(0)(1)(shape[2])(FShape_86(["Textured",src])(null)(shape));
496+ function rotate_98(t_212) {
497+ return function(Form$thetascaleposform_213) {
498+ return function(case5) {
502+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
503+ return Form_84(t_212 + case1)(case2)(case3)(case4)
505+ throw"Non-exhaustive pattern match in case";
506+ }(Form$thetascaleposform_213)
509+ function scale_99(s_218) {
510+ return function(Form$thetascaleposform_219) {
511+ return function(case5) {
515+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
516+ return Form_84(case1)(s_218 * case2)(case3)(case4)
518+ throw"Non-exhaustive pattern match in case";
519+ }(Form$thetascaleposform_219)
522+ function move_100(x_224) {
523+ return function(y_225) {
524+ return function(Form$thetascaleTuple2$pxpyform_226) {
525+ return function(case7) {
529+ var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
532+ var case5 = case3[1], case6 = case3[2];
533+ return Form_84(case1)(case2)(["Tuple2", x_224 + case5, y_225 + case6])(case4)
537+ throw"Non-exhaustive pattern match in case";
538+ }(Form$thetascaleTuple2$pxpyform_226)
542+ return{left:left_6, right:right_7, down:down_8, up:up_9, inward:inward_10, outward:outward_11, topLeft:topLeft_22, topRight:topRight_23, bottomLeft:bottomLeft_24, bottomRight:bottomRight_25, midLeft:midLeft_26, midRight:midRight_27, midTop:midTop_28, midBottom:midBottom_29, middle:middle_30, topLeftAt:topLeftAt_31, topRightAt:topRightAt_32, bottomLeftAt:bottomLeftAt_33, bottomRightAt:bottomRightAt_34, absolute:absolute_35, relative:relative_36, width:width_47, height:height_48, size:size_49, opacity:opacity_50,
543+ color:color_51, widthOf:widthOf_52, heightOf:heightOf_53, sizeOf:sizeOf_54, text:text_56, plainText:plainText, centeredText:centeredText, justifiedText:justifiedText, rightedText:rightedText, image:image_57, video:video_58, fittedImage:fittedImage_59, flow:flow_60, above:above_61, below:below_62, beside:beside_63, layers:layers_64, collage:collage_65, spacer:spacer_66, container:container_67, line:line_76, segment:segment_77, polygon:polygon_79, rect:rect_80, oval:oval_81, circle:circle_82, ngon:ngon_83, solid:solid_89, dotted:dotted_90, dashed:dashed_91, customLine:customLine_92, filled:filled_93,
544+ outlined:outlined_94, customOutline:customOutline_95, textured:textured, sprite:sprite_96, toForm:toForm_97, rotate:rotate_98, scale:scale_99, move:move_100}